Changeset 2577 for sandbox/jabberit_messenger/trophy_expresso/js/loadIM.js
- Timestamp:
- 04/16/10 18:15:47 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/jabberit_messenger/trophy_expresso/js/loadIM.js
r2511 r2577 28 28 var jid = arguments[1]; 29 29 var index = arguments[2]; 30 var coord = null; 30 31 31 32 if ( !e ) 32 33 var e = window.event; 33 34 ( ( e.target ) ? e.target : e.srcElement ).parentNode.oncontextmenu = function(e) 34 35 var _X = e.clientX + document.body.scrollLeft - document.body.clientLeft; 36 var _Y = e.clientY + document.body.scrollTop - document.body.clientTop; 37 38 coord = { X : _X, Y : _Y }; 39 40 window.document.oncontextmenu = function() 35 41 { 36 42 return false; … … 38 44 39 45 if ( ( e.which && e.which > 1 ) || ( e.button && e.button > 1 ) ) 40 optionsItensContact(jid, index); 46 { 47 optionsItensContact( jid, index, coord ); 48 } 41 49 else 42 50 { … … 321 329 var jid = arguments[0]; 322 330 var index = arguments[1]; 323 var element = document.getElementById('itenContact_' + jid + '_' + index ); 331 var coord = arguments[2]; 332 var element = getElement('itenContact_' + jid + '_' + index ); 333 324 334 325 335 if( showhidden == null ) … … 329 339 ['Autorizar', 'loadIM.setAutorization(\''+jid+'\',\''+index+'\')'], 330 340 ['Remover', 'loadIM.removeContact(\''+jid+'\',\''+index+'\')'], 331 ['Renomear', ' Renomear : ' + jid],332 ['Trocar grupo', ' Trocar grupo : ' + jid],341 ['Renomear', 'loadIM.rename()'], 342 ['Trocar grupo', 'loadIM.rename()'], 333 343 ]; 334 344 … … 343 353 344 354 var _optionsItens = document.createElement("div"); 345 _optionsItens.setAttribute("style", "margin: -10px 0px 0px 20px;");346 355 _optionsItens.className = "x-menu"; 347 _optionsItens.style.zIndex = zIndex++; 356 _optionsItens.style.top = coord.Y; 357 _optionsItens.style.left = ( coord.X - element.offsetLeft ); 358 _optionsItens.style.zIndex = getZindex(); 348 359 _optionsItens.innerHTML = _itens; 360 _optionsItens.onclick = function(){ showhidden.hiddenObject(false); }; 349 361 _optionsItens.onmouseout = function(){ showhidden.hiddenObject(false); }; 350 362 _optionsItens.onmouseover = function(){ showhidden.hiddenObject(true); }; … … 352 364 showhidden.action('onmouseover', 'onmouseout', _optionsItens); 353 365 354 element.appendChild(_optionsItens); 366 window.document.body.appendChild(_optionsItens); 367 368 369 setTimeout(function() 370 { 371 window.document.oncontextmenu = function() 372 { 373 return true; 374 }; 375 376 },500); 355 377 } 356 378 } … … 374 396 } 375 397 398 function removeElement( ) 399 { 400 if( arguments.length > 0 ) 401 { 402 var _element = arguments[0] 403 var _parent = _element.parentNode; 404 405 _parent.removeChild( _element ); 406 } 407 } 408 376 409 function removeGroup() 377 410 { … … 380 413 if( _parent.childNodes.length <= 2 ) 381 414 _parent.parentNode.removeChild(_parent); 415 } 416 417 function rename() 418 { 419 alert("Rename"); 382 420 } 383 421 … … 416 454 function searchUser() 417 455 { 418 var _input = document.getElementById('search_user_jabber');456 var _input = getElement('search_user_jabber'); 419 457 420 458 if( _input.value.length >= 3 ) … … 428 466 var divItenContact = null; 429 467 430 if( ( divItenContact = document.getElementById('itenContact_' + jidTo + '_' + indexTo )))468 if( ( divItenContact = getElement('itenContact_' + jidTo + '_' + indexTo ))) 431 469 { 432 470 var subscription = divItenContact.getAttribute('subscription'); … … 435 473 { 436 474 case 'from': 475 476 alert('SUBSCRIPTION FROM'); 477 //TrophyIM.setAutorization( jidTo, this.getUserCurrent().jid, 'subscribed'); 478 //TrophyIM.setAutorization( jidTo, this.getUserCurrent().jid, 'subscribe'); 479 break; 480 481 case 'none' : 482 483 TrophyIM.setAutorization( jidTo, this.getUserCurrent().jid, 'subscribe'); 484 TrophyIM.setAutorization( jidTo, this.getUserCurrent().jid, 'subscribed'); 485 486 break; 487 437 488 case 'not-in-roster': 438 TrophyIM.setAutorization( jidTo, this.getUserCurrent().jid, 'subscribe'); 489 490 setTimeout(function() 491 { 492 var _add = ""; 493 494 if( ( _add = confirm("Deseja adicionar o usuario!")) ) 495 { 496 addUser.add( jidTo, indexTo ); 497 } 498 499 },100); 500 439 501 break; 502 440 503 case 'to' : 441 TrophyIM.setAutorization( jidTo, this.getUserCurrent().jid, 'subscribed'); 442 break; 504 505 TrophyIM.setAutorization( jidTo, this.getUserCurrent().jid, 'subscribed'); 506 507 case 'subscribe' : 508 509 TrophyIM.setAutorization( jidTo, this.getUserCurrent().jid, 'subscribe'); 510 511 break; 443 512 } 444 513 } … … 488 557 function setSelectEditable(element) 489 558 { 490 if( document.getElementById('selectBox0') == null )559 if( getElement('selectBox0') == null ) 491 560 selectEditable.create(element); 492 561 } … … 586 655 loadIM.prototype.setSelectEditable = setSelectEditable; 587 656 loadIM.prototype.removeContact = removeContact; 657 loadIM.prototype.removeElement = removeElement; 588 658 loadIM.prototype.removeGroup = removeGroup; 659 loadIM.prototype.rename = rename; 589 660 loadIM.prototype.rosterDiv = rosterDiv; 590 661
Note: See TracChangeset
for help on using the changeset viewer.