Changeset 2491 for sandbox/jabberit_messenger/trophy_expresso/js/loadIM.js
- Timestamp:
- 04/12/10 15:50:03 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/jabberit_messenger/trophy_expresso/js/loadIM.js
r2471 r2491 32 32 var e = window.event; 33 33 34 ( ( e.target ) ? e.target : e.srcElement ). oncontextmenu = function(e)34 ( ( e.target ) ? e.target : e.srcElement ).parentNode.oncontextmenu = function(e) 35 35 { 36 36 return false; … … 40 40 optionsItensContact(jid, index); 41 41 else 42 TrophyIM.rosterClick(jid); 42 { 43 if ( e.target.id ) 44 TrophyIM.rosterClick(jid); 45 } 43 46 } 44 47 } … … 299 302 } 300 303 301 302 304 function optionsItensContact() 303 305 { … … 312 314 313 315 var _options = [ 314 ['Autorizar', ' TrophyIM.setAutorization(\''+jid+'\')'],315 ['Remover', 'loadIM.removeContact(\''+jid+'\' )'],316 ['Autorizar', 'loadIM.setAutorization(\''+jid+'\',\''+index+'\')'], 317 ['Remover', 'loadIM.removeContact(\''+jid+'\',\''+index+'\')'], 316 318 ['Renomear', 'Renomear : ' + jid], 317 319 ['Trocar grupo', 'Trocar grupo : ' + jid], … … 323 325 { 324 326 _itens += '<img src="'+arrow_right.src+'"/>'; 325 _itens += '<span style="cursor:pointer; margin:3px;font-weight:normal;" onclick='+_options[i][1]+'>';327 _itens += '<span style="cursor:pointer;margin:3px;font-weight:normal;" onclick='+_options[i][1]+'>'; 326 328 _itens += _options[i][0] + '</span><br/>'; 327 329 } 328 330 329 331 var _optionsItens = document.createElement("div"); 330 _optionsItens.setAttribute("style", "margin: - 5px 0px 0px 20px;");332 _optionsItens.setAttribute("style", "margin: -10px 0px 0px 20px;"); 331 333 _optionsItens.className = "x-menu"; 332 334 _optionsItens.style.zIndex = '99999'; 333 335 _optionsItens.innerHTML = _itens; 334 _optionsItens.onclick = function(){ showhidden.hiddenObject(false); }; 336 _optionsItens.onmouseout = function(){ showhidden.hiddenObject(false); }; 337 _optionsItens.onmouseover = function(){ showhidden.hiddenObject(true); }; 335 338 336 339 showhidden.action('onmouseover', 'onmouseout', _optionsItens); 337 340 338 element.onmouseout = function(){ showhidden.hiddenObject(false); }; 339 element.onmouseover = function(){ showhidden.hiddenObject(true); }; 340 element.appendChild( _optionsItens ); 341 } 342 341 element.appendChild(_optionsItens); 342 } 343 343 } 344 344 … … 352 352 } 353 353 354 function removeContact(jid )354 function removeContact(jid, index) 355 355 { 356 356 setTimeout(function() 357 357 { 358 TrophyIM.removeContact(jid );359 360 }, 500);358 TrophyIM.removeContact(jid, index); 359 360 },300); 361 361 } 362 362 … … 367 367 if( _parent.childNodes.length <= 2 ) 368 368 _parent.parentNode.removeChild(_parent); 369 370 369 } 371 370 … … 407 406 } 408 407 409 function setSelectEditable(element) 410 { 411 if( document.getElementById('selectBox0') == null ) 412 selectEditable.create(element); 408 function setAutorization(jidTo, indexTo) 409 { 410 var divItenContact = null; 411 412 if( ( divItenContact = document.getElementById('itenContact_' + jidTo + '_' + indexTo ))) 413 { 414 var subscription = divItenContact.getAttribute('subscription'); 415 416 switch(subscription) 417 { 418 case 'from': 419 case 'not-in-roster': 420 TrophyIM.setAutorization( jidTo, this.getUserCurrent().jid, 'subscribe'); 421 break; 422 case 'to' : 423 TrophyIM.setAutorization( jidTo, this.getUserCurrent().jid, 'subscribed'); 424 break; 425 } 426 } 413 427 } 414 428 … … 452 466 } 453 467 } 454 468 469 function setSelectEditable(element) 470 { 471 if( document.getElementById('selectBox0') == null ) 472 selectEditable.create(element); 473 } 474 455 475 function setStatusJabber() 456 476 { … … 538 558 loadIM.prototype.parse = parse; 539 559 loadIM.prototype.searchUser = searchUser 560 loadIM.prototype.setAutorization = setAutorization; 540 561 loadIM.prototype.setPresence = setPresence; 541 562 loadIM.prototype.setStatusJabber = setStatusJabber;
Note: See TracChangeset
for help on using the changeset viewer.