Changeset 2975 for trunk/jmessenger/js/jscode/loadIM.js
- Timestamp:
- 06/28/10 12:13:37 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jmessenger/js/jscode/loadIM.js
r2969 r2975 57 57 var _element = ( e.target ) ? e.target : e.srcElement; 58 58 var jid = arguments[1]; 59 var index = arguments[2];60 59 var coord = null; 61 60 … … 79 78 { 80 79 if( e.button > 1 ) 81 optionsItensContact( jid, index,coord );80 optionsItensContact( jid, coord ); 82 81 else 83 82 TrophyIM.rosterClick(jid); … … 86 85 { 87 86 if( e.which > 1 ) 88 optionsItensContact( jid, index,coord );87 optionsItensContact( jid, coord ); 89 88 else 90 89 if( e.target.id ) … … 281 280 } 282 281 } 283 282 283 function disabledNotificationNewUsers() 284 { 285 var _notification = getElement('notification_new_users_jabber') ; 286 var _statusJabber = getElement('status_jabber_expresso'); 287 288 _notification.style.display = 'none'; 289 290 _statusJabber.style.background = "url('"+path_jabberit+"templates/default/images/" + statusUserIM + ".gif') no-repeat"; 291 292 if( _timeOutNotification ) 293 clearTimeout(_timeOutNotification ); 294 295 TrophyIM.controll.notificationNewUsers = 0; 296 } 297 298 function enabledNotificationNewUsers() 299 { 300 var _notification = getElement('notification_new_users_jabber') ; 301 var _statusJabber = getElement('status_jabber_expresso'); 302 303 if( _notification && _statusJabber ) 304 { 305 if ( _notification.style.display == 'none' ) 306 { 307 _notification.style.display = 'block'; 308 309 _statusJabber.style.background = "url('"+path_jabberit+"templates/default/images/alert_mini.png') no-repeat"; 310 311 if( _timeOutNotification ) 312 clearTimeout(_timeOutNotification ); 313 314 _timeOutNotification = setTimeout( function(){ enabledNotificationNewUsers(); }, 2000 ); 315 } 316 else 317 { 318 _notification.style.display = 'none'; 319 320 _statusJabber.style.background = "url('"+path_jabberit+"templates/default/images/" + statusUserIM + ".gif') no-repeat"; 321 322 if( _timeOutNotification ) 323 clearTimeout(_timeOutNotification ); 324 325 _timeOutNotification = setTimeout( function(){ enabledNotificationNewUsers(); }, 800 ); 326 } 327 } 328 } 329 284 330 function fastMenu() 285 331 { … … 579 625 { 580 626 var jid = arguments[0]; 581 var index = arguments[1]; 582 var coord = arguments[2]; 583 var element = getElement('itenContact_' + jid + '_' + index ); 627 var coord = arguments[1]; 628 var element = getElement('itenContact_' + jid ); 584 629 var action = ( element.getAttribute("subscription") === "not-in-roster" ) ? "Adicionar" : "Autorizar"; 585 630 … … 588 633 589 634 var _options = [ 590 [ action , 'loadscript.setAutorization(\''+jid+'\' ,\''+index+'\')'],591 ['Remover' , 'loadscript.removeContact(\''+jid+'\' ,\''+index+'\')'],592 ['Renomear' , 'loadscript.renameContact(\''+jid+'\' ,\''+index+'\')'],593 ['Trocar grupo' , 'loadscript.renameGroup(\''+jid+'\' ,\''+index+'\')']635 [ action , 'loadscript.setAutorization(\''+jid+'\')'], 636 ['Remover' , 'loadscript.removeContact(\''+jid+'\')'], 637 ['Renomear' , 'loadscript.renameContact(\''+jid+'\')'], 638 ['Trocar grupo' , 'loadscript.renameGroup(\''+jid+'\')'] 594 639 ]; 595 640 … … 709 754 } 710 755 711 function removeContact(jid, index) 712 { 713 setTimeout(function() 714 { 715 TrophyIM.removeContact(jid, index); 716 717 },300); 756 function removeContact( jid ) 757 { 758 TrophyIM.removeContact( jid ); 718 759 } 719 760 … … 742 783 { 743 784 var _jid = arguments[0]; 744 var _index = arguments[1]; 745 746 TrophyIM.renameContact( _jid, _index ); 785 786 TrophyIM.renameContact( _jid ); 747 787 } 748 788 } … … 753 793 { 754 794 var _jid = arguments[0]; 755 var _index = arguments[1]; 756 757 TrophyIM.renameGroup( _jid , _index ); 795 796 TrophyIM.renameGroup( _jid ); 758 797 } 759 798 } … … 815 854 } 816 855 817 function setAutorization(jidTo, indexTo) 818 { 819 var divItenContact = null; 820 821 if( ( divItenContact = getElement('itenContact_' + jidTo + '_' + indexTo ))) 856 function setAutorization() 857 { 858 var divItenContact = null; 859 860 if( arguments.length > 0 ) 861 { 862 var jidTo = arguments[0]; 863 864 if( getElement('itenContact_' + jidTo) ) 865 divItenContact = getElement('itenContact_' + jidTo ); 866 } 867 868 if( divItenContact ) 822 869 { 823 870 var subscription = divItenContact.getAttribute('subscription'); 824 871 825 872 switch(subscription) 826 873 { … … 845 892 if( ( _add = confirm("Deseja adicionar o usuario!")) ) 846 893 { 847 addUser.add( jidTo , indexTo);894 addUser.add( jidTo ); 848 895 } 849 896 … … 863 910 864 911 default : 912 alert( "SEM PARAMETRO DEFINIDO : " + subscription ); 865 913 866 alert( "DEFAULT : " + subscription );867 914 } 868 } 915 } 916 917 setTimeout(function() 918 { 919 if( getElement('itenContactNotification_' + jidTo ) ) 920 loadscript.removeElement( getElement('itenContactNotification_' + jidTo ) ); 921 },500); 922 869 923 } 870 924 … … 1170 1224 var _user = _users.createElement('user'); 1171 1225 var _jid = _users.createElement('jid'); 1172 var _ index = _users.createElement('index');1226 var _status = _users.createElement('status'); 1173 1227 _jid.appendChild( _users.createTextNode(TrophyIM.rosterObj.roster[user].contact.jid) ); 1174 _ index.appendChild( _users.createTextNode("0"));1228 _status.appendChild( _users.createTextNode( _subscription ) ); 1175 1229 _user.appendChild( _jid ); 1176 _user.appendChild( _ index);1230 _user.appendChild( _status ); 1177 1231 _users.documentElement.appendChild( _user ); 1178 1232 } … … 1206 1260 _winBuild( winNotification ); 1207 1261 } 1208 1209 function teste_new() 1210 { 1211 var _notification = getElement('notification_new_users_jabber') ; 1212 var _statusJabber = getElement('status_jabber_expresso'); 1213 1214 if( _notification && _statusJabber ) 1215 { 1216 if ( _notification.style.display == 'none' ) 1217 { 1218 _notification.style.display = 'block'; 1219 1220 _statusJabber.style.background = "url('"+path_jabberit+"templates/default/images/alert_mini.png') no-repeat"; 1221 1222 if( _timeOutNotification ) 1223 clearTimeout(_timeOutNotification ); 1224 1225 _timeOutNotification = setTimeout( function(){ teste_new(); }, 2000 ); 1226 } 1227 else 1228 { 1229 _notification.style.display = 'none'; 1230 1231 _statusJabber.style.background = "url('"+path_jabberit+"templates/default/images/" + statusUserIM + ".gif') no-repeat"; 1232 1233 if( _timeOutNotification ) 1234 clearTimeout(_timeOutNotification ); 1235 1236 _timeOutNotification = setTimeout( function(){ teste_new(); }, 800 ); 1237 } 1238 } 1239 } 1240 1241 1242 loadIM.prototype.teste_new = teste_new; 1243 1244 1262 1245 1263 function loadIM() 1246 1264 { … … 1320 1338 loadIM.prototype.clrAllContacts = clrAllContacts; 1321 1339 loadIM.prototype.configEvents = configEvents; 1340 loadIM.prototype.disabledNotificationNewUsers = disabledNotificationNewUsers; 1341 loadIM.prototype.enabledNotificationNewUsers = enabledNotificationNewUsers; 1322 1342 loadIM.prototype.getIsIE = getIsIE; 1323 1343 loadIM.prototype.getPhotoUser = getPhotoUser;
Note: See TracChangeset
for help on using the changeset viewer.