- Timestamp:
- 06/25/10 17:59:42 (14 years ago)
- Location:
- trunk/jmessenger
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jmessenger/js/AddUser.js
r2961 r2971 10 10 var jidFrom = loadscript.getUserCurrent().jid; 11 11 var jidTo = arguments[0]; 12 var indexTo = arguments[1];13 12 var group = ""; 14 13 var name = jidTo.substring(0, jidTo.indexOf('@')); … … 30 29 group = ""; 31 30 32 // Remove Element html; 33 loadscript.removeElement( getElement('itenContact_' + jidTo + '_' + indexTo) ); 34 loadscript.removeElement( getElement('span_show_itenContact_' + jidTo + '_' + indexTo) ); 35 TrophyIM.rosterObj.removeContact(jidTo); 31 // Remove Element 32 if( getElement('itenContact_' + jidTo ) ) 33 { 34 loadscript.removeElement( getElement('itenContact_' + jidTo ) ); 35 loadscript.removeElement( getElement('span_show_itenContact_' + jidTo ) ); 36 } 37 38 TrophyIM.rosterObj.removeContact( jidTo ); 36 39 } 37 40 else -
trunk/jmessenger/js/trophyim.js
r2966 r2971 345 345 log : function(level, msg) 346 346 { 347 if (TrophyIM.logging_div && level >= TROPHYIM_LOGLEVEL) { 348 while(TrophyIM.logging_div.childNodes.length > TROPHYIM_LOG_LINES) { 349 TrophyIM.logging_div.removeChild( 350 TrophyIM.logging_div.firstChild); 347 if (TrophyIM.logging_div && level >= TROPHYIM_LOGLEVEL) 348 { 349 while(TrophyIM.logging_div.childNodes.length > TROPHYIM_LOG_LINES) 350 { 351 TrophyIM.logging_div.removeChild( TrophyIM.logging_div.firstChild ); 351 352 } 353 352 354 var msg_div = document.createElement('div'); 353 355 msg_div.className = 'trophyimlogitem'; 354 356 msg_div.appendChild(document.createTextNode(msg)); 357 355 358 TrophyIM.logging_div.appendChild(msg_div); 356 359 TrophyIM.logging_div.scrollTop = TrophyIM.logging_div.scrollHeight; … … 589 592 group_array[group_array.length] = groups[g].firstChild.nodeValue; 590 593 } 591 594 592 595 if( getAttribute('ask') ) 593 596 TrophyIM.rosterObj.addContact(getAttribute('jid'), getAttribute('ask'), getAttribute('name'), group_array); … … 966 969 */ 967 970 968 renameContact : function( jid , index)971 renameContact : function( jid ) 969 972 { 970 973 // Name … … 984 987 TrophyIM.addContact( jidTo, name, group ); 985 988 986 document.getElementById('itenContact_' + jid + '_' + index).innerHTML = name;989 document.getElementById('itenContact_' + jid ).innerHTML = name; 987 990 }, 988 991 … … 992 995 */ 993 996 994 renameGroup : function( jid , index)997 renameGroup : function( jid ) 995 998 { 996 999 var group = TrophyIM.rosterObj.roster[jid].contact.groups[0]; … … 1035 1038 */ 1036 1039 1037 removeContact : function( jidTo, indexTo)1040 removeContact : function( jidTo ) 1038 1041 { 1039 1042 var divItenContact = null; 1040 1043 var spanShow = null; 1041 1044 1042 if( ( divItenContact = document.getElementById('itenContact_' + jidTo + '_' + indexTo)))1045 if( ( divItenContact = document.getElementById('itenContact_' + jidTo ))) 1043 1046 { 1044 spanShow = document.getElementById('span_show_itenContact_' + jidTo + '_' + indexTo)1047 spanShow = document.getElementById('span_show_itenContact_' + jidTo ) 1045 1048 1046 1049 spanShow.parentNode.removeChild(spanShow); … … 1185 1188 var group = arguments[1]; 1186 1189 var element = arguments[2]; 1187 var index = arguments[3];1188 1190 var showOffline = loadscript.getShowContactsOffline(); 1189 1191 … … 1193 1195 var statusColor = "black"; 1194 1196 var statusDisplay = "none"; 1197 1198 var _resource = ""; 1195 1199 1196 1200 // Set Presence … … 1237 1241 statusColor = "orange"; 1238 1242 1239 if ( TrophyIM.controll.notificationNewUsers == 0 ) 1243 if ( TrophyIM.controll.notificationNewUsers == 0 ) 1240 1244 { 1241 loadscript. teste_new();1245 loadscript.enabledNotificationNewUsers(); 1242 1246 TrophyIM.controll.notificationNewUsers++; 1243 1247 } … … 1262 1266 statusColor = "orange"; 1263 1267 1264 if ( TrophyIM.controll.notificationNewUsers == 0 ) 1268 if ( TrophyIM.controll.notificationNewUsers == 0 ) 1265 1269 { 1266 loadscript. teste_new();1270 loadscript.enabledNotificationNewUsers(); 1267 1271 TrophyIM.controll.notificationNewUsers++; 1268 1272 } … … 1278 1282 }; 1279 1283 1280 var itensJid = document.getElementById( "itenContact_" + objContact.contact.jid + "_" + index);1284 var itensJid = document.getElementById( "itenContact_" + objContact.contact.jid ); 1281 1285 1282 1286 if( itensJid == null ) … … 1299 1303 { 1300 1304 divDisplay : "block", 1301 id : 'itenContact_' + objContact.contact.jid + '_' + index , 1302 index : ((index == 0 ) ? "0" : index), 1305 id : 'itenContact_' + objContact.contact.jid , 1303 1306 jid : objContact.contact.jid, 1304 1307 nameContact : nameContact, … … 1308 1311 status : status, 1309 1312 statusColor : "black", 1310 subscription : objContact.contact.subscription 1313 subscription : objContact.contact.subscription, 1314 resource : _resource 1311 1315 } 1312 1316 … … 1343 1347 _subscription( objContact ); 1344 1348 1345 with ( document.getElementById('span_show_' + 'itenContact_' + objContact.contact.jid + '_' + index ) ) 1349 // Set subscription 1350 itensJid.setAttribute('subscription', objContact.contact.subscription ); 1351 1352 with ( document.getElementById('span_show_' + 'itenContact_' + objContact.contact.jid ) ) 1346 1353 { 1347 1354 if( presence == "unavailable" && !showOffline ) … … 1361 1368 1362 1369 if( presence == "unavailable" && !showOffline ) 1370 { 1363 1371 itensJid.style.display = "none"; 1372 } 1364 1373 else 1365 1374 { … … 1376 1385 if( !objContact.presence && !showOffline ) 1377 1386 { 1378 with ( document.getElementById('span_show_' + 'itenContact_' + objContact.contact.jid + '_' + index))1387 with ( document.getElementById('span_show_' + 'itenContact_' + objContact.contact.jid )) 1379 1388 { 1380 1389 style.display = "none"; 1381 1390 } 1382 1391 1383 with ( document.getElementById('itenContact_' + objContact.contact.jid + '_' + index) )1392 with ( document.getElementById('itenContact_' + objContact.contact.jid ) ) 1384 1393 { 1385 1394 style.display = "none"; … … 1401 1410 for( var j = 0; j < groups.length; j++ ) 1402 1411 { 1403 addItem( TrophyIM.rosterObj.roster[users[i]], groups[j], element , j);1412 addItem( TrophyIM.rosterObj.roster[users[i]], groups[j], element ); 1404 1413 } 1405 1414 } 1406 1415 else 1407 1416 { 1408 addItem( TrophyIM.rosterObj.roster[users[i]], "Geral", element , 0);1417 addItem( TrophyIM.rosterObj.roster[users[i]], "Geral", element ); 1409 1418 } 1410 1419 } 1411 1420 else 1412 1421 { 1413 addItem( TrophyIM.rosterObj.roster[users[i]], "Geral", element , 0);1422 addItem( TrophyIM.rosterObj.roster[users[i]], "Geral", element ); 1414 1423 } 1415 1424 } … … 1843 1852 this.addContact(barejid, 'not-in-roster'); 1844 1853 } 1854 1845 1855 var presence = 1846 1856 { 1847 resource:resource, priority:priority, show:show, status:status 1857 resource : resource, 1858 priority : priority, 1859 show : show, 1860 status : status 1848 1861 } 1849 1862 … … 1852 1865 this.roster[jid_lower]['presence'] = {}; 1853 1866 } 1867 1854 1868 this.roster[jid_lower]['presence'][resource] = presence; 1855 1869 } -
trunk/jmessenger/xsl/itensGroup.xsl
r2896 r2971 5 5 <xsl:param name="divDisplay" /> 6 6 <xsl:param name="id" /> 7 <xsl:param name="index" />8 7 <xsl:param name="jid"/> 9 8 <xsl:param name="nameContact" /> … … 14 13 <xsl:param name="statusColor" /> 15 14 <xsl:param name="subscription" /> 15 <xsl:param name="resource" /> 16 16 17 17 <xsl:template match="itens_group"> 18 18 19 <div id="{$id}" subscription="{$subscription}" onmousedown="loadscript.actionButton(event,'{$jid}','{$index}');" style="background: url('{$path_jabberit}templates/default/images/{$presence}.gif') no-repeat center left; padding-left: 20px; margin:2px 0px 0px 10px; cursor:pointer; font-weight:normal; display:{$divDisplay};">19 <div id="{$id}" subscription="{$subscription}" resource="{$resource}" onmousedown="loadscript.actionButton(event,'{$jid}' );" style="background: url('{$path_jabberit}templates/default/images/{$presence}.gif') no-repeat center left; padding-left: 20px; margin:2px 0px 0px 10px; cursor:pointer; font-weight:normal; display:{$divDisplay};"> 20 20 <xsl:value-of select="$nameContact"/> 21 21 </div> -
trunk/jmessenger/xsl/notificationNewUsers.xsl
r2969 r2971 19 19 <xsl:for-each select="user"> 20 20 <xsl:sort select="jid"/> 21 <tr> 22 <td align="left" style="width: 60%;"><xsl:value-of select="jid" /></td> 23 <td align="center" style="width: 20%;"><a style="cursor:pointer;" onclick="alert('{jid}' + '{index}');"><xsl:value-of select="$lang_3"/></a></td> 24 <td align="center" style="width: 20%;"><a style="cursor:pointer;" onclick="alert('{jid}' + '{index}');"><xsl:value-of select="$lang_4"/></a></td> 21 <tr id="itenContactNotification_{jid}" subscription="{status}"> 22 <td align="left" style="width: 60%;"> 23 <xsl:value-of select="jid" /> 24 </td> 25 26 <td align="center" style="width: 20%;"> 27 <div style="cursor:pointer; color:green;" onclick="loadscript.setAutorization('{jid}');"> 28 <xsl:value-of select="$lang_3"/> 29 </div> 30 </td> 31 32 <td align="center" style="width: 20%;"> 33 <div style="cursor:pointer; color:red;" onclick="alert('{jid}');"> 34 <xsl:value-of select="$lang_4"/> 35 </div> 36 </td> 37 25 38 </tr> 26 39 </xsl:for-each>
Note: See TracChangeset
for help on using the changeset viewer.