Changeset 327 for trunk/instant_messenger/js
- Timestamp:
- 06/24/08 17:09:46 (16 years ago)
- Location:
- trunk/instant_messenger/js
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/instant_messenger/js/client.js
r323 r327 149 149 if ( !_disconnected ) 150 150 { 151 _conn.go('$this.Ujabber.getContacts'); 151 _conn.go('t.update'); 152 152 153 setTimeout(function() 153 154 { … … 189 190 190 191 var local; 191 if ( (local = top.document.getElementById('user_info')) ) 192 { 193 local.firstChild.style.marginLeft = '30px'; 192 if ( (local = top.document.getElementById('divStatusBar')) ) 193 { 194 // tentando colocar os icones em local que não seja mexido. 195 // VERIFICAR 196 var _div = top.document.createElement('div'); 197 _div.appendChild(local.parentNode.removeChild(local.previousSibling)); 198 local.parentNode.insertBefore(_div, local); 199 //_div.appendChild(local); 200 201 //local = _div; 202 203 local.style.paddingLeft = '30px'; 194 204 195 205 var _status = top.document.createElement('div'); 196 206 _status.setAttribute('id', 'im_status'); 197 _status.style.height = '15px';198 _status.style.margin = '0 0 0 10px';199 _status.style.padding = '0px';200 _status.style.width = '15px';201 207 _status.style.background = 'no-repeat'; 202 208 _status.style.backgroundImage = 'url(' + im_unavailable.src + ')'; 203 209 _status.style.float = 'left'; 210 _status.style.height = '15px'; 211 _status.style.left = '20px'; 212 _status.style.margin = '0 0 0 10px'; 213 _status.style.padding = '0px'; 204 214 _status.style.position = 'absolute'; 215 _status.style.width = '15px'; 205 216 206 217 local.insertBefore(_status, local.firstChild); … … 221 232 _menu_img.style.background = 'no-repeat'; 222 233 _menu_img.style.backgroundImage = 'url(' + im_fast_menu.src + ')'; 234 _menu_img.style.float = 'left'; 223 235 _menu_img.style.height = '10px'; 236 _menu_img.style.left = '23px'; 224 237 _menu_img.style.margin = '0px'; 225 238 _menu_img.style.padding = '0px'; 226 239 _menu_img.style.position = 'absolute'; 227 240 _menu_img.style.width = '10px'; 228 _menu_img.style.float = 'left';229 241 local.insertBefore(_menu_img, local.firstChild); 230 242 … … 288 300 } 289 301 290 function _check_connection()291 {292 if ( !_disconnected )293 _conn.go('t.checkConnection');294 }295 296 302 function Client() 297 303 { 298 304 _request(); 299 305 setTimeout(_contacts, 3000); 300 window.setInterval(_check_connection, 20000);301 306 } 302 307 -
trunk/instant_messenger/js/connector.js
r318 r327 71 71 catch(_e) 72 72 { 73 alert("#stream\n\n" + _e + "\n\n" + _e.description);73 //alert("#stream\n\n" + _e + "\n\n" + _e.description); 74 74 } 75 75 … … 103 103 catch(_e) 104 104 { 105 alert("#request\n\n" + _e + "\n\n" + _e.description);105 //alert("#request\n\n" + _e + "\n\n" + _e.description); 106 106 } 107 107 -
trunk/instant_messenger/js/jabber.js
r323 r327 185 185 _win = _chat(id); 186 186 _win.title(el.getAttribute('idname')); 187 _win.icon(eval('im_' + el.getAttribute('status') + '.src')); 187 if ( el.getAttribute('status') ) 188 _win.icon(eval('im_' + el.getAttribute('status') + '.src')); 188 189 } 189 190 else … … 225 226 if ( _contact_list ) 226 227 { 227 _conn.go('$this.Ujabber.setPresence', 'type=unavailable'); 228 _setPresence(); 229 _ldap.photo( 230 'im_avatar', 231 _win_contact.wc.firstChild 232 ); 233 _conn.go('$this.Ujabber.getVcard','jid=this'); 228 var _presence; 229 if ( !(_presence = _cookies.get('IM_presence')) ) 230 _presence = 'available'; 231 232 var _img_status = eval('im_' + _presence + '.src'); 233 234 if ( _img_status ) 235 { 236 _win_contact.icon(_img_status); 237 238 var _status = top.document.getElementById('im_status'); 239 if ( _status ) 240 _status.style.backgroundImage = 'url(' + _img_status + ')'; 241 } 242 243 _ldap.photo('im_avatar', _win_contact.wc.firstChild); 244 234 245 function _click(e) 235 246 { 236 247 var el = ( e.target ) ? e.target : e.srcElement; 237 //alert(e.button);238 248 if ( (e.button == 0 && !document.all) || (e.button == 1 && document.all) ) 239 249 _openChat(el); … … 307 317 } 308 318 } 319 function _show_hidden_group(e) 320 { 321 var el = ( e.target ) ? e.target : e.srcElement; 322 var _display = "none"; 323 var _image = im_group_close.src; 324 325 if ( el.style.backgroundImage.indexOf('group_open') < 0 ) 326 { 327 _display = "block"; 328 _image = im_group_open.src; 329 } 330 331 el.style.backgroundImage = 'url(' + _image + ')'; 332 333 el = el.nextSibling; 334 while ( el.getAttribute('jid') ) 335 { 336 if ( _display == 'block' ) 337 { 338 var _show_all = _cookies.get('IM_unavailable'); 339 if ( (el.style.backgroundImage.indexOf('unavailable') > -1) && (_show_all == 'hidden') ) 340 _display = 'none'; 341 } 342 el.style.display = _display; 343 el = el.nextSibling; 344 if ( el && el.nextSibling ) 345 el = el.nextSibling; 346 } 347 } 309 348 function _hover(e) 310 349 { … … 323 362 _config(_contact, 'onmouseover', _hover); 324 363 _config(_contact, 'onmouseout', _hover); 325 if ( _contact.getAttribute('jid') ) 326 { 327 if ( _show_all == 'hidden' ) 328 _contact.style.display = 'none'; 329 //_config(_contact, 'onmousedown', _click); 364 // it is a group 365 if ( !(_contact.getAttribute('jid')) ) 366 _config(_contact, 'onclick', _show_hidden_group); 367 // it is a contact 368 else 369 { 370 if ( _show_all != 'hidden' ) 371 _contact.style.display = 'block'; 330 372 _config(_contact, 'onmouseup', _click); 331 }332 else333 {334 _config(_contact, 'onclick',335 function(e)336 {337 var el = ( e.target ) ? e.target : e.srcElement;338 var _display = "none";339 var _image = im_group_close.src;340 341 if ( el.style.backgroundImage.indexOf('group_open') < 0 )342 {343 _display = "block";344 _image = im_group_open.src;345 }346 347 el.style.backgroundImage = 'url(' + _image + ')';348 349 el = el.nextSibling;350 while ( el.getAttribute('jid') )351 {352 if ( _display == 'block' )353 {354 var _show_all = _cookies.get('IM_unavailable');355 if ( (el.style.backgroundImage.indexOf('unavailable') > -1) && (_show_all == 'hidden') )356 _display = 'none';357 }358 el.style.display = _display;359 el = el.nextSibling;360 if ( el && el.nextSibling )361 el = el.nextSibling;362 }363 });364 373 } 365 374 } … … 371 380 function _setPresence() 372 381 { 382 if ( !(_cookies) ) 383 return false; 384 373 385 var _presence = false; 374 386 var _pPresence; … … 506 518 { 507 519 if ( pIq.firstChild.getAttribute("seconds") != 0 ) 508 _conn.go(' $this.Ujabber.getContacts');520 _conn.go('t.update'); 509 521 } 510 522 … … 523 535 { 524 536 _contact_list.style.backgroundImage = 'url(' + im_composing.src + ')'; 525 setTimeout(function(){_contact_list.style.backgroundImage = 'url(' + eval('im_' + _contact_list.getAttribute('status') + '.src') + ')';}, 10000); 537 setTimeout(function() 538 { 539 _contact_list.style.backgroundImage = 'url(' + eval('im_' + _contact_list.getAttribute('status') + '.src') + ')'; 540 }, 10000); 526 541 } 527 542 … … 593 608 var _win_chat = _window.get('chat' + _from); 594 609 595 _img_status_contact.setAttribute('status', _presence_type);596 597 610 if ( _mensagem_status_contact ) 598 611 { … … 607 620 case 'available' : 608 621 case 'unavailable' : 622 _img_status_contact.setAttribute('status', _presence_type); 623 609 624 if ( _img_status_contact ) 610 625 _img_status_contact.style.backgroundImage = 'url(' + eval('im_' + _presence_type + '.src') + ')'; … … 733 748 { 734 749 case "show" : 750 var _show = _node.firstChild.nodeValue; 751 _img_status_contact.setAttribute('status', _show); 735 752 if ( _img_status_contact ) 736 _img_status_contact.style.backgroundImage = 'url(' + eval('im_' + _ node.firstChild.nodeValue+ '.src') + ')';753 _img_status_contact.style.backgroundImage = 'url(' + eval('im_' + _show + '.src') + ')'; 737 754 if ( _win_chat ) 738 _win_chat.icon(eval('im_' + _ node.firstChild.nodeValue+ '.src'));755 _win_chat.icon(eval('im_' + _show + '.src')); 739 756 break; 740 757 case "status" : … … 747 764 break; 748 765 default : 766 _img_status_contact.setAttribute('status', 'available'); 749 767 if ( _img_status_contact ) 750 768 _img_status_contact.style.backgroundImage = 'url(' + im_available.src + ')'; -
trunk/instant_messenger/js/preferences.js
r323 r327 142 142 143 143 // New Message 144 /* 144 145 if(top.document.getElementById('rd_nm').checked) 145 146 { … … 157 158 else 158 159 preferences += 'rd_ch:false;'; 160 */ 159 161 160 162 // Write Cookie … … 196 198 } 197 199 200 function _show_hidden_group() 201 { 202 if ( !(arguments[0]) ) 203 return false; 204 205 var show = 'block'; 206 if ( !(arguments[0].checked) ) 207 show = 'none'; 208 209 var el = top.document.getElementById('im_contact_list'); 210 if ( el && (el = el.firstChild) ) 211 while ( el ) 212 { 213 // it is a contact 214 if ( (el.nodeName.toLowerCase() == 'div') && el.getAttribute('jid') ) 215 if ( el.style.backgroundImage.indexOf('unavailable') > -1 ) 216 el.style.display = show; 217 el = el.nextSibling; 218 } 219 } 220 198 221 function Preferences() 199 222 { … … 206 229 Preferences.prototype.load = _load_window; 207 230 Preferences.prototype.getfocus = focus_select; 231 232 Preferences.prototype.showHiddenGroup = _show_hidden_group; 233 208 234 top.window.im_preferences = new Preferences; 209 235 _config(top.window.document, 'onmousemove', _timeOut);
Note: See TracChangeset
for help on using the changeset viewer.