- Timestamp:
- 08/24/10 17:13:42 (14 years ago)
- Location:
- branches/2.2/jabberit_messenger/jmessenger/js
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/jabberit_messenger/jmessenger/js/dragdrop.js
r3102 r3177 6 6 var _parent = null; 7 7 8 function _configEvent( pObj, pEvent, pHandler)9 { 10 if ( typeof pObj == 'object' )8 function _configEvent( pObj, pEvent, pHandler ) 9 { 10 if ( pObj && typeof pObj == 'object' ) 11 11 { 12 12 if ( pEvent.substring(0, 2) == 'on' ) … … 22 22 else if ( arguments.length == 4 ) 23 23 { 24 if ( pObj.removeEventListener && pObj.removeEventListener != 'undefined') 25 pObj.removeEventListener(pEvent, pHandler, false); 24 if ( pObj.removeEventListener ) 25 { 26 pObj.removeEventListener( pEvent, pHandler, false ); 27 } 26 28 else if ( pObj.detachEvent ) 27 pObj.detachEvent('on' + pEvent, pHandler); 29 { 30 pObj.detachEvent( 'on' + pEvent, pHandler ); 31 } 28 32 } 29 33 } … … 148 152 if ( _element ) 149 153 { 150 _mouseUpShadow();151 152 154 _configEvent(_element, 'onmousemove', _mouseMove, 'remove'); 153 155 _configEvent(top.document, 'onmousemove', _mouseMove, 'remove'); … … 157 159 158 160 _element.mouseOffset = null; 159 _ element = null;161 _mouseUpShadow(); 160 162 } 161 163 } -
branches/2.2/jabberit_messenger/jmessenger/js/dragdrop.mini.js
r3102 r3177 2 2 (function() 3 3 {var _element=null;var _elementA=null;var _elementB=null;var _parent=null;function _configEvent(pObj,pEvent,pHandler) 4 {if( typeof pObj=='object')4 {if(pObj&&typeof pObj=='object') 5 5 {if(pEvent.substring(0,2)=='on') 6 6 pEvent=pEvent.substring(2,pEvent.length);if(arguments.length==3) … … 9 9 pObj.attachEvent('on'+pEvent,pHandler);} 10 10 else if(arguments.length==4) 11 {if(pObj.removeEventListener&&pObj.removeEventListener!='undefined') 12 pObj.removeEventListener(pEvent,pHandler,false);else if(pObj.detachEvent) 13 pObj.detachEvent('on'+pEvent,pHandler);}}} 11 {if(pObj.removeEventListener) 12 {pObj.removeEventListener(pEvent,pHandler,false);} 13 else if(pObj.detachEvent) 14 {pObj.detachEvent('on'+pEvent,pHandler);}}}} 14 15 function _drag(e) 15 16 {if(typeof e.preventDefault!='undefined') … … 38 39 function _mouseUp() 39 40 {if(_element) 40 {_ mouseUpShadow();_configEvent(_element,'onmousemove',_mouseMove,'remove');_configEvent(top.document,'onmousemove',_mouseMove,'remove');_configEvent(_element,'onmouseup',_mouseUp,'remove');_configEvent(top.document,'onmouseup',_mouseUp,'remove');_element.mouseOffset=null;_element=null;}}41 {_configEvent(_element,'onmousemove',_mouseMove,'remove');_configEvent(top.document,'onmousemove',_mouseMove,'remove');_configEvent(_element,'onmouseup',_mouseUp,'remove');_configEvent(top.document,'onmouseup',_mouseUp,'remove');_element.mouseOffset=null;_mouseUpShadow();}} 41 42 function _mouseDownShadow(e) 42 43 {try -
branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.js
r3129 r3177 1351 1351 var _JIDROOM = _xml.createElement('jidRoom') 1352 1352 var nameRoom = _room.getAttribute( 'from' ); 1353 1353 1354 1354 _ROOM.setAttribute( 'nameRoom', (nameRoom.substring(0, nameRoom.indexOf("@"))).toUpperCase() ); 1355 1355 _JIDROOM.appendChild( _xml.createTextNode(nameRoom) ); 1356 1356 _ROOM.appendChild( _JIDROOM ); 1357 1357 1358 1358 // Get fields elements; 1359 1359 var _fields = _room.getElementsByTagName( 'field' ); 1360 1360 1361 1361 for ( var f = 0; f < _fields.length; f++ ) 1362 1362 { 1363 if ( _fields[ f ]. hasAttribute( 'var' ) )1363 if ( _fields[ f ].getAttribute( 'var' ) ) 1364 1364 { 1365 1365 if ( _fields[ f ].firstChild.hasChildNodes( ) && _fields[ f ].getAttribute( 'var' ) == 'muc#roominfo_description' ) … … 1384 1384 for( var f = 0 ; f < _feature.length; f++ ) 1385 1385 { 1386 if ( _feature[ f ]. hasAttribute( 'var' ) )1386 if ( _feature[ f ].getAttribute( 'var' ) ) 1387 1387 { 1388 1388 if( _feature[ f ].getAttribute( 'var' ) == 'muc_unsecured' ) -
branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.mini.js
r3129 r3177 277 277 var _JIDROOM=_xml.createElement('jidRoom') 278 278 var nameRoom=_room.getAttribute('from');_ROOM.setAttribute('nameRoom',(nameRoom.substring(0,nameRoom.indexOf("@"))).toUpperCase());_JIDROOM.appendChild(_xml.createTextNode(nameRoom));_ROOM.appendChild(_JIDROOM);var _fields=_room.getElementsByTagName('field');for(var f=0;f<_fields.length;f++) 279 {if(_fields[f]. hasAttribute('var'))279 {if(_fields[f].getAttribute('var')) 280 280 {if(_fields[f].firstChild.hasChildNodes()&&_fields[f].getAttribute('var')=='muc#roominfo_description') 281 281 {var _description=_xml.createElement("description");_description.appendChild(_xml.createTextNode(_fields[f].firstChild.firstChild.nodeValue));_ROOM.appendChild(_description);} … … 284 284 _occupants.appendChild(_xml.createTextNode(_fields[f].firstChild.firstChild.nodeValue));_ROOM.appendChild(_occupants);}}} 285 285 var _feature=_room.getElementsByTagName('feature');for(var f=0;f<_feature.length;f++) 286 {if(_feature[f]. hasAttribute('var'))286 {if(_feature[f].getAttribute('var')) 287 287 {if(_feature[f].getAttribute('var')=='muc_unsecured') 288 288 {var _password=_xml.createElement("password");_password.appendChild(_xml.createTextNode("false"));_ROOM.appendChild(_password);} -
branches/2.2/jabberit_messenger/jmessenger/js/trophyim.js
r3132 r3177 305 305 // Get User Current; 306 306 var _getUserCurrent = null; 307 308 var _flag = 0; 309 310 do 307 _getUserCurrent = loadscript.getUserCurrent(); 308 309 if( _getUserCurrent == null ) 310 { 311 setTimeout( "TrophyIM.showLogin()", 500 ); 312 } 313 else 311 314 { 312 _getUserCurrent = loadscript.getUserCurrent(); 313 _flag++; 314 315 }while( ( _getUserCurrent == null || _flag > 3 ) ) 316 317 TrophyIM.login( Base64.decode( _getUserCurrent.jid ), Base64.decode( _getUserCurrent.password )); 315 TrophyIM.login( Base64.decode( _getUserCurrent.jid ), Base64.decode( _getUserCurrent.password )); 316 } 318 317 } 319 318 } … … 671 670 var _idElement = nameChatRoom + "_UserChatRoom__" + nickName; 672 671 673 var _UserChatRoom = document.createElement("div"); 674 _UserChatRoom.id = _idElement; 675 _UserChatRoom.setAttribute("style","padding-left:18px ; margin:3px 0px 0px 2px; background: url('"+path_jabberit+"templates/default/images/" + show + ".gif')no-repeat center left"); 672 var _UserChatRoom = document.createElement("div"); 673 _UserChatRoom.id = _idElement; 674 _UserChatRoom.style.paddingLeft = '18px'; 675 _UserChatRoom.style.margin = '3px 0px 0px 2px'; 676 _UserChatRoom.style.background = 'url("'+path_jabberit+'templates/default/images/' + show + '.gif") no-repeat center left'; 676 677 _UserChatRoom.appendChild( document.createTextNode( nickName ) ); 677 678 … … 703 704 else if( show ) 704 705 { 705 nodeUser.s etAttribute("style","padding-left:18px ; margin:3px 0px 0px 2px; background: url('"+path_jabberit+"templates/default/images/" + show + ".gif')no-repeat center left");706 706 nodeUser.style.backgroundImage = 'url("'+path_jabberit+'templates/default/images/' + show + '.gif")'; 707 } 707 708 } 708 709 } -
branches/2.2/jabberit_messenger/jmessenger/js/trophyim.mini.js
r3132 r3177 35 35 {var xids=TrophyIM.cookies['trophyim_bosh_xid'].split("|");TrophyIM.delCookie('trophyim_bosh_xid');TrophyIM.constants.stale_roster=true;TrophyIM.connection=new Strophe.Connection(TROPHYIM_BOSH_SERVICE);TrophyIM.connection.rawInput=TrophyIM.rawInput;TrophyIM.connection.rawOutput=TrophyIM.rawOutput;Strophe.info('Attempting Strophe attach.');TrophyIM.connection.attach(xids[0],xids[1],xids[2],TrophyIM.onConnect);TrophyIM.onConnect(Strophe.Status.CONNECTED);} 36 36 else 37 {loadscript.rosterDiv();var _getUserCurrent=null;var _flag=0;do 38 {_getUserCurrent=loadscript.getUserCurrent();_flag++;}while((_getUserCurrent==null||_flag>3)) 39 TrophyIM.login(Base64.decode(_getUserCurrent.jid),Base64.decode(_getUserCurrent.password));}} 37 {loadscript.rosterDiv();var _getUserCurrent=null;_getUserCurrent=loadscript.getUserCurrent();if(_getUserCurrent==null) 38 {setTimeout("TrophyIM.showLogin()",500);} 39 else 40 {TrophyIM.login(Base64.decode(_getUserCurrent.jid),Base64.decode(_getUserCurrent.password));}}} 40 41 else 41 42 {setTimeout("TrophyIM.showLogin()",500);}},log:function(level,msg) … … 104 105 {for(var i=0;i<xquery.length;i++) 105 106 {var xmlns=xquery[i].getAttribute("xmlns");if(xmlns.indexOf("http://jabber.org/protocol/muc#user")==0) 106 {var _from=xquery[i].parentNode.getAttribute('from');var _to=xquery[i].parentNode.getAttribute('to');var nameChatRoom=Strophe.getBareJidFromJid(_from);var nickName=Strophe.getResourceFromJid(_from);var type=(xquery[i].parentNode.getAttribute('type')!=null)?xquery[i].parentNode.getAttribute('type'):'available';var show=(xquery[i].parentNode.firstChild.nodeName=="show")?xquery[i].parentNode.firstChild.firstChild.nodeValue:type;var _idElement=nameChatRoom+"_UserChatRoom__"+nickName;var _UserChatRoom=document.createElement("div");_UserChatRoom.id=_idElement;_UserChatRoom.s etAttribute("style","padding-left:18px ; margin:3px 0px 0px 2px; background: url('"+path_jabberit+"templates/default/images/"+show+".gif')no-repeat center left");_UserChatRoom.appendChild(document.createTextNode(nickName));var nodeUser=document.getElementById(_idElement);if(nodeUser==null)107 {var _from=xquery[i].parentNode.getAttribute('from');var _to=xquery[i].parentNode.getAttribute('to');var nameChatRoom=Strophe.getBareJidFromJid(_from);var nickName=Strophe.getResourceFromJid(_from);var type=(xquery[i].parentNode.getAttribute('type')!=null)?xquery[i].parentNode.getAttribute('type'):'available';var show=(xquery[i].parentNode.firstChild.nodeName=="show")?xquery[i].parentNode.firstChild.firstChild.nodeValue:type;var _idElement=nameChatRoom+"_UserChatRoom__"+nickName;var _UserChatRoom=document.createElement("div");_UserChatRoom.id=_idElement;_UserChatRoom.style.paddingLeft='18px';_UserChatRoom.style.margin='3px 0px 0px 2px';_UserChatRoom.style.background='url("'+path_jabberit+'templates/default/images/'+show+'.gif") no-repeat center left';_UserChatRoom.appendChild(document.createTextNode(nickName));var nodeUser=document.getElementById(_idElement);if(nodeUser==null) 107 108 {if(document.getElementById(nameChatRoom+'__roomChat__participants')!=null) 108 109 {nameChatRoom=document.getElementById(nameChatRoom+'__roomChat__participants');nameChatRoom.appendChild(_UserChatRoom);} … … 114 115 {nodeUser.parentNode.removeChild(nodeUser);} 115 116 else if(show) 116 {nodeUser.s etAttribute("style","padding-left:18px ; margin:3px 0px 0px 2px; background: url('"+path_jabberit+"templates/default/images/"+show+".gif')no-repeat center left");}}}}}},onMessage:function(msg)117 {nodeUser.style.backgroundImage='url("'+path_jabberit+'templates/default/images/'+show+'.gif")';}}}}}},onMessage:function(msg) 117 118 {var checkTime=function(i) 118 119 {if(i<10)i="0"+i;return i;};var messageDate=function(_date)
Note: See TracChangeset
for help on using the changeset viewer.