Changeset 2711
- Timestamp:
- 05/05/10 14:58:58 (14 years ago)
- Location:
- sandbox/jabberit_messenger/trophy_expresso
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/jabberit_messenger/trophy_expresso/js/jscode/loadIM.js
r2706 r2711 10 10 var selectEditable = null; 11 11 var showhidden = null; 12 var _statusMessage = ""; 12 13 var timeoutId = null; 13 14 var userCurrent = null; … … 96 97 return; 97 98 } 99 98 100 /**************************************************************************/ 99 101 … … 169 171 if( _status == "xa" ) 170 172 { 171 TrophyIM.setPresence("available"); 173 if( getStatusMessage() != "") 174 TrophyIM.setPresence("available", getStatusMessage()); 175 else 176 TrophyIM.setPresence("available"); 177 172 178 loadscript.setStatusJabber("Disponível","available"); 173 179 } … … 194 200 if( _status == "available" ) 195 201 { 196 TrophyIM.setPresence("xa"); 202 if(getStatusMessage() != "") 203 TrophyIM.setPresence("xa", getStatusMessage()); 204 else 205 TrophyIM.setPresence("xa"); 206 197 207 loadscript.setStatusJabber("Não Disponível","xa"); 198 208 } … … 279 289 _divPhoto.style.backgroundImage = 'url(' + _imgUser + ')'; 280 290 } 291 } 292 293 function getStatusMessage() 294 { 295 return _statusMessage; 281 296 } 282 297 … … 747 762 } 748 763 764 function setMessageStatus() 765 { 766 if( arguments.length > 0 ) 767 { 768 var _element = arguments[0]; 769 var _parent = _element.parentNode; 770 771 if( _element.nodeName.toLowerCase() == "label") 772 { 773 var _input = document.createElement("input"); 774 _input.size = "35"; 775 _input.maxlength = "35"; 776 _input.style.border = "0"; 777 _input.value = _element.innerHTML; 778 779 // OnkeyUp 780 configEvents( _input, "onkeyup", function(e) 781 { 782 if( e.keyCode == 13 ) loadscript.setMessageStatus(_input, _element); 783 } 784 ); 785 786 // Onblur 787 configEvents(_input, "onblur", function(){ loadscript.setMessageStatus(_input, _element)}); 788 789 790 if( _parent != null ) 791 { 792 // Remove label 793 if( _element != null ) 794 _parent.removeChild( _element ); 795 796 // Add Input 797 if( _input != null ) 798 _parent.appendChild( _input ); 799 } 800 801 _input.focus(); 802 _input.select(); 803 } 804 else 805 { 806 var _label = arguments[1]; 807 _statusMessage = _element.value.replace(/^\(+|\)+$/g,""); 808 809 if( ( _statusMessage = _statusMessage.replace(/^\s+|\s+$|^\n|\n$/g,"") ) != "") 810 _label.innerHTML = "( " + _statusMessage + " )"; 811 else 812 _label.innerHTML = "( Digite aqui sua mensagem de Status )"; 813 814 if( _parent != null ) 815 { 816 // Remove Input 817 if( _element != null ) 818 _parent.removeChild( _element ); 819 820 // Add Label 821 if( _label != null ) 822 _parent.appendChild( _label ); 823 } 824 825 // Send Status Message 826 TrophyIM.setPresence("status", _statusMessage ); 827 } 828 } 829 } 749 830 750 831 function setPreferences() … … 989 1070 loadIM.prototype.configEvents = configEvents; 990 1071 loadIM.prototype.getPhotoUser = getPhotoUser; 1072 loadIM.prototype.getStatusMessage = getStatusMessage; 991 1073 loadIM.prototype.getShowContactsOffline = getShowContactsOffline; 992 1074 loadIM.prototype.getUserCurrent = getUserCurrent; … … 1001 1083 loadIM.prototype.searchUser = searchUser 1002 1084 loadIM.prototype.setAutorization = setAutorization; 1085 loadIM.prototype.setMessageStatus = setMessageStatus; 1003 1086 loadIM.prototype.setPreferences = setPreferences; 1004 1087 loadIM.prototype.setPresence = setPresence; -
sandbox/jabberit_messenger/trophy_expresso/js/trophyim.js
r2706 r2711 1352 1352 } 1353 1353 else 1354 TrophyIM.connection.send($pres( ).c('show').t(_type).tree()); 1354 { 1355 if( loadscript.getStatusMessage() != "" ) 1356 { 1357 var _presence = $pres( ); 1358 _presence.node.appendChild( Strophe.xmlElement( 'show' ) ).appendChild( Strophe.xmlTextNode( _type ) ); 1359 _presence.node.appendChild( Strophe.xmlElement( 'status' ) ).appendChild( Strophe.xmlTextNode( loadscript.getStatusMessage() )); 1360 1361 TrophyIM.connection.send( _presence.tree() ); 1362 } 1363 else 1364 { 1365 TrophyIM.connection.send($pres( ).c('show').t(_type).tree()); 1366 } 1367 } 1355 1368 } 1356 1369 } … … 1360 1373 var _status = ""; 1361 1374 1362 if (( _status = prompt("Digite sua mensagem !") )) 1363 { 1364 for(var resource in TrophyIM.rosterObj.roster[Base64.decode(loadscript.getUserCurrent().jid)].presence ) 1365 { 1366 if ( TrophyIM.rosterObj.roster[Base64.decode(loadscript.getUserCurrent().jid)].presence[ resource ].constructor == Function ) 1367 continue; 1368 1369 if ( TROPHYIM_RESOURCE === ("/" + resource) ) 1370 _show = TrophyIM.rosterObj.roster[Base64.decode(loadscript.getUserCurrent().jid)].presence[resource].show; 1371 } 1372 1373 var _presence = $pres( ); 1374 _presence.node.appendChild( Strophe.xmlElement( 'show' ) ).appendChild( Strophe.xmlTextNode( _show ) ); 1375 _presence.node.appendChild( Strophe.xmlElement( 'status' ) ).appendChild( Strophe.xmlTextNode( _status ) ); 1375 if( arguments.length < 2 ) 1376 { 1377 if( loadscript.getStatusMessage() != "" ) 1378 _status = prompt("Digite sua mensagem !!!", loadscript.getStatusMessage()); 1379 else 1380 _status = prompt("Digite sua mensagem !!!"); 1376 1381 1377 TrophyIM.connection.send( _presence.tree() ); 1382 var _divStatus = document.getElementById("JabberIMStatusMessage"); 1383 1384 if( ( _status = _status.replace(/^\s+|\s+$|^\n|\n$/g,"") ) != "") 1385 _divStatus.firstChild.innerHTML = "( " + _status + " )"; 1386 } 1387 else 1388 { 1389 _status = arguments[1]; 1378 1390 } 1391 1392 for(var resource in TrophyIM.rosterObj.roster[Base64.decode(loadscript.getUserCurrent().jid)].presence ) 1393 { 1394 if ( TrophyIM.rosterObj.roster[Base64.decode(loadscript.getUserCurrent().jid)].presence[ resource ].constructor == Function ) 1395 continue; 1396 1397 if ( TROPHYIM_RESOURCE === ("/" + resource) ) 1398 _show = TrophyIM.rosterObj.roster[Base64.decode(loadscript.getUserCurrent().jid)].presence[resource].show; 1399 } 1400 1401 var _presence = $pres( ); 1402 _presence.node.appendChild( Strophe.xmlElement( 'show' ) ).appendChild( Strophe.xmlTextNode( _show ) ); 1403 _presence.node.appendChild( Strophe.xmlElement( 'status' ) ).appendChild( Strophe.xmlTextNode( _status ) ); 1404 1405 TrophyIM.connection.send( _presence.tree() ); 1379 1406 } 1380 1407 }, -
sandbox/jabberit_messenger/trophy_expresso/xsl/contactsList.xsl
r2706 r2711 13 13 <div id="{$idUser}__photo" style="position: absolute; left: 5px; top: 5px; width:60px; height:80px; background-image:url('{$path_jabberit}/templates/default/images/photo.png');"/> 14 14 15 <div style="position: absolute; left: 80px; top: 10px;"> <xsl:value-of select="$full_name"/> </div>15 <div style="position: absolute; left: 80px; top: 8px;"> <xsl:value-of select="$full_name"/> </div> 16 16 17 <div style="position: absolute; top: 30px; left: 80px;">17 <div style="position: absolute; top: 28px; left: 80px;"> 18 18 <button style="width:35px;" alt="Adicionar Contatos" title="Adicionar Contatos" onclick="loadscript.addContact();"> 19 19 <img src="{$path_jabberit}/templates/default/images/users.png"/> … … 25 25 </div> 26 26 27 <div style="position: absolute; left: 80px; top: 5 5px; cursor: pointer;" onclick="loadscript.setPresence(this);">27 <div style="position: absolute; left: 80px; top: 53px; cursor: pointer;" onclick="loadscript.setPresence(this);"> 28 28 <div id="statusJabberImg" style="background: url('{$path_jabberit}/templates/default/images/available.gif'); margin-left: 13px;width:15px; height:15px;"></div> 29 29 <div id="statusJabberText" style="margin-top: -13px; margin-left: 30px;"> Disponível </div> … … 31 31 </div> 32 32 33 <div id="JabberIMRosterLoadingGif" style="position:absolute; left: 85px; top:72px; display:block;">33 <div id="JabberIMRosterLoadingGif" style="position:absolute; left:136px; top:110px; display:block;"> 34 34 <img src='{$path_jabberit}/templates/default/images/loading.gif' style="width:20px; height:20px;"/> 35 <span style="color:red;">Carregando...</span> 35 <span style="color:red;"> Carregando...!!</span> 36 </div> 37 38 <div id="JabberIMStatusMessage" style="position:absolute; left:4px; top:90px; display:block;"> 39 <label style="cursor:pointer;" onclick="loadscript.setMessageStatus(this);">( Digite aqui sua mensagem de Status )</label> 36 40 </div> 37 41
Note: See TracChangeset
for help on using the changeset viewer.