Changeset 2511 for sandbox/jabberit_messenger/trophy_expresso/js
- Timestamp:
- 04/13/10 17:48:28 (14 years ago)
- Location:
- sandbox/jabberit_messenger/trophy_expresso/js
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/jabberit_messenger/trophy_expresso/js/AddUser.js
r2471 r2511 57 57 58 58 var _img_path = path_jabberit + 'inc/WebService.php?' + Date.parse( new Date ); 59 _img_path += '&ph pPhoto=' + jid + '&phpOu=' + ou;59 _img_path += '&photo_session=' + jid + '&ou=' + ou; 60 60 61 61 _newUser.style.backgroundImage = 'url(' + _img_path + ')'; -
sandbox/jabberit_messenger/trophy_expresso/js/loadIM.js
r2491 r2511 167 167 _optionsItens.setAttribute("style", "margin: 20px 0px 0px -4px;"); 168 168 _optionsItens.className = "x-menu"; 169 _optionsItens.style.zIndex = '99999 ';169 _optionsItens.style.zIndex = '999999'; 170 170 _optionsItens.innerHTML = _itens; 171 171 … … 182 182 { 183 183 return document.getElementById( elementId ); 184 } 185 186 function getPhotoUser( jid ) 187 { 188 var _divPhoto = getElement( jid + '__photo' ); 189 190 if( _divPhoto.style.backgroundImage.indexOf('photo.png') > 0 ) 191 { 192 var _imgUser = path_jabberit + 'inc/WebService.php?' + Date.parse( new Date ); 193 _imgUser += '&photo_ldap=' + jid; 194 195 _divPhoto.style.backgroundImage = 'url(' + _imgUser + ')'; 196 } 184 197 } 185 198 … … 332 345 _optionsItens.setAttribute("style", "margin: -10px 0px 0px 20px;"); 333 346 _optionsItens.className = "x-menu"; 334 _optionsItens.style.zIndex = '99999';347 _optionsItens.style.zIndex = zIndex++; 335 348 _optionsItens.innerHTML = _itens; 336 349 _optionsItens.onmouseout = function(){ showhidden.hiddenObject(false); }; … … 373 386 var paramListContact = 374 387 { 388 'idUser' : getUserCurrent().jid, 389 'full_name' : (( fullName.length < 25 ) ? fullName : ( fullName.substring( 0, 25) + "...")), 375 390 'path_jabberit' : path_jabberit, 376 ' full_name' : (( fullName.length < 25 ) ? fullName : ( fullName.substring( 0, 25) + "..."))391 'zIndex_' : zIndex++ 377 392 }; 378 393 … … 394 409 395 410 _winBuild( winRosterDiv ); 411 412 // Photo User 413 getPhotoUser(getUserCurrent().jid); 396 414 } 397 415 … … 442 460 ['Não Disponível', 'xa', '<img src="'+path_jabberit+'templates/default/images/xa.gif" />'], 443 461 ['Ocupado', 'dnd', '<img src="'+path_jabberit+'templates/default/images/dnd.gif" />'], 462 ['Mensagem de Status...', 'status', '<img src="'+path_jabberit+'templates/default/images/message_normal.gif" />'] 444 463 ]; 445 464 … … 477 496 if( arguments.length > 0 ) 478 497 { 479 var _text = arguments[0]; 480 var _img = arguments[1]; 481 482 getElement('statusJabberImg').setAttribute("style", "background-image: url('"+path_jabberit+"templates/default/images/"+_img+".gif'); margin-left: 13px;width:15px; height:15px;"); 483 getElement('statusJabberText').innerHTML = _text; 484 getElement('status_jabber_expresso').style.background = "url('"+path_jabberit+"templates/default/images/"+_img+".gif') no-repeat"; 498 if( arguments[1] != 'status' ) 499 { 500 var _text = arguments[0]; 501 var _img = arguments[1]; 502 503 getElement('statusJabberImg').setAttribute("style", "background-image: url('"+path_jabberit+"templates/default/images/"+_img+".gif'); margin-left: 13px;width:15px; height:15px;"); 504 getElement('statusJabberText').innerHTML = _text; 505 getElement('status_jabber_expresso').style.background = "url('"+path_jabberit+"templates/default/images/"+_img+".gif') no-repeat"; 506 } 485 507 } 486 508 } … … 550 572 loadIM.prototype.addContact = addContact; 551 573 loadIM.prototype.configEvents = configEvents; 574 loadIM.prototype.getPhotoUser = getPhotoUser; 552 575 loadIM.prototype.getUserCurrent = getUserCurrent; 553 576 loadIM.prototype.getZIndex = getZindex; -
sandbox/jabberit_messenger/trophy_expresso/js/trophyim.js
r2491 r2511 656 656 'path_jabberit' : path_jabberit 657 657 }; 658 658 659 titleWindow = barejid.toLowerCase(); 660 titleWindow = titleWindow.substring(0, titleWindow.indexOf('@')); 661 659 662 if( TrophyIM.rosterObj.roster[barejid] ) 660 663 { … … 664 667 } 665 668 } 666 else667 {668 titleWindow = barejid.toLowerCase();669 titleWindow = titleWindow.substring(0, titleWindow.indexOf('@'));670 }671 669 672 670 var winChatBox = … … 687 685 688 686 _winBuild(winChatBox); 687 688 // Photo User; 689 loadIM.getPhotoUser(barejid); 689 690 690 691 loadIM.configEvents( document.getElementById( barejid + '__sendBox'), … … 999 1000 for( var i = 0 ; i < users.length; i++ ) 1000 1001 { 1001 if( TrophyIM.rosterObj.roster[users[i]].contact.groups ) 1002 { 1003 var groups = TrophyIM.rosterObj.roster[users[i]].contact.groups; 1004 1005 if( groups.length > 0 ) 1002 if( TrophyIM.rosterObj.roster[users[i]].contact.jid != loadIM.getUserCurrent().jid ) 1003 { 1004 if( TrophyIM.rosterObj.roster[users[i]].contact.groups ) 1006 1005 { 1007 for( var j = 0; j < groups.length; j++ ) 1008 addItem( TrophyIM.rosterObj.roster[users[i]], groups[j], element, j ); 1006 var groups = TrophyIM.rosterObj.roster[users[i]].contact.groups; 1007 1008 if( groups.length > 0 ) 1009 { 1010 for( var j = 0; j < groups.length; j++ ) 1011 addItem( TrophyIM.rosterObj.roster[users[i]], groups[j], element, j ); 1012 } 1013 else 1014 { 1015 addItem( TrophyIM.rosterObj.roster[users[i]], "Geral", element, 0 ); 1016 } 1009 1017 } 1010 1018 else … … 1013 1021 } 1014 1022 } 1015 else1016 {1017 addItem( TrophyIM.rosterObj.roster[users[i]], "Geral", element, 0 );1018 }1019 1023 } 1020 1024 }, … … 1046 1050 */ 1047 1051 1048 setPresence : function( show ) 1049 { 1050 TrophyIM.connection.send($pres( ).c('show').t(show).tree()); 1052 setPresence : function( type ) 1053 { 1054 if( type != 'status') 1055 { 1056 TrophyIM.connection.send($pres( ).c('show').t(type).tree()); 1057 } 1058 else 1059 { 1060 var _show = "available"; 1061 var _status = ""; 1062 1063 if (( _status = prompt("Digite sua mensagem !") )) 1064 { 1065 for(var resource in TrophyIM.rosterObj.roster[loadIM.getUserCurrent().jid].presence ) 1066 { 1067 if ( TROPHYIM_RESOURCE === ("/" + resource) ) 1068 _show = TrophyIM.rosterObj.roster[loadIM.getUserCurrent().jid].presence[resource].show; 1069 } 1070 1071 var _presence = $pres( ); 1072 _presence.node.appendChild( Strophe.xmlElement( 'show' ) ).appendChild( Strophe.xmlTextNode( _show ) ); 1073 _presence.node.appendChild( Strophe.xmlElement( 'status' ) ).appendChild( Strophe.xmlTextNode( _status ) ); 1074 1075 TrophyIM.connection.send( _presence.tree() ); 1076 } 1077 } 1051 1078 }, 1052 1079 … … 1157 1184 this.addContact = function(jid, subscription, name, groups ) 1158 1185 { 1159 if( jid != loadIM.getUserCurrent().jid ) 1160 { 1161 if( subscription !== "remove" ) 1162 { 1163 var contact = { jid:jid, subscription:subscription, name:name, groups:groups } 1164 var jid_lower = jid.toLowerCase(); 1165 1166 if ( this.roster[jid_lower] ) 1186 if( subscription !== "remove" ) 1187 { 1188 var contact = { jid:jid, subscription:subscription, name:name, groups:groups } 1189 var jid_lower = jid.toLowerCase(); 1190 1191 if ( this.roster[jid_lower] ) 1192 { 1193 this.roster[jid_lower]['contact'] = contact; 1194 } 1195 else 1196 { 1197 this.roster[jid_lower] = {contact:contact}; 1198 } 1199 1200 groups = groups ? groups : ['']; 1201 1202 for ( var g = 0; g < groups.length; g++ ) 1203 { 1204 if ( !this.groups[groups[g]] ) 1167 1205 { 1168 this.roster[jid_lower]['contact'] = contact; 1169 } 1170 else 1171 { 1172 this.roster[jid_lower] = {contact:contact}; 1173 } 1174 1175 groups = groups ? groups : ['']; 1176 1177 for ( var g = 0; g < groups.length; g++ ) 1178 { 1179 if ( !this.groups[groups[g]] ) 1180 { 1181 this.groups[groups[g]] = {}; 1182 } 1183 1184 this.groups[groups[g]][jid_lower] = jid_lower; 1185 } 1206 this.groups[groups[g]] = {}; 1207 } 1208 1209 this.groups[groups[g]][jid_lower] = jid_lower; 1186 1210 } 1187 else1188 {1189 this.removeContact(jid);1190 }1211 } 1212 else 1213 { 1214 this.removeContact(jid); 1191 1215 } 1192 1216 } … … 1314 1338 var jid_lower = barejid.toLowerCase(); 1315 1339 1316 if( barejid != loadIM.getUserCurrent().jid ) 1317 { 1318 if( show != 'unavailable') 1319 { 1320 if (!this.roster[jid_lower]) 1321 { 1322 this.addContact(barejid, 'not-in-roster'); 1323 } 1324 var presence = 1325 { 1326 resource:resource, priority:priority, show:show, status:status 1327 } 1328 1329 if (!this.roster[jid_lower]['presence']) 1330 { 1331 this.roster[jid_lower]['presence'] = {} 1332 } 1333 this.roster[jid_lower]['presence'][resource] = presence 1334 } 1335 else if (this.roster[jid_lower] && this.roster[jid_lower]['presence'] && this.roster[jid_lower]['presence'][resource]) 1336 { 1337 delete this.roster[jid_lower]['presence'][resource]; 1338 } 1339 1340 this.addChange(jid_lower); 1341 1342 if (TrophyIM.activeChats['divs'][jid_lower]) 1343 { 1344 TrophyIM.setTabPresence(jid_lower, TrophyIM.activeChats['divs'][jid_lower]['tab']); 1345 } 1346 } 1340 if( show != 'unavailable') 1341 { 1342 if (!this.roster[jid_lower]) 1343 { 1344 this.addContact(barejid, 'not-in-roster'); 1345 } 1346 var presence = 1347 { 1348 resource:resource, priority:priority, show:show, status:status 1349 } 1350 1351 if (!this.roster[jid_lower]['presence']) 1352 { 1353 this.roster[jid_lower]['presence'] = {} 1354 } 1355 this.roster[jid_lower]['presence'][resource] = presence 1356 } 1357 else if (this.roster[jid_lower] && this.roster[jid_lower]['presence'] && this.roster[jid_lower]['presence'][resource]) 1358 { 1359 delete this.roster[jid_lower]['presence'][resource]; 1360 } 1361 1362 this.addChange(jid_lower); 1347 1363 } 1348 1364
Note: See TracChangeset
for help on using the changeset viewer.