Changeset 2966
- Timestamp:
- 06/22/10 17:26:23 (14 years ago)
- Location:
- trunk/jmessenger
- Files:
-
- 6 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jmessenger/js/jscode/loadIM.js
r2954 r2966 2 2 { 3 3 var _autoStatus; 4 var _autoStatusTime = 60000; // 1 minuto 5 var addUser = null; 6 var conn = null; 7 var fullName = ""; 8 var path = ""; 9 var _preferencesIM = ""; 10 var selectEditable = null; 11 var showhidden = null; 12 var _statusMessage = ""; 13 var timeoutId = null; 14 var userCurrent = null; 15 var Xtools = null; 16 var zIndex = 9001; 17 var windowPopUp = []; 4 var _autoStatusTime = 60000; // 1 minuto 5 var addUser = null; 6 var conn = null; 7 var fullName = ""; 8 var path = ""; 9 var _preferencesIM = ""; 10 var selectEditable = null; 11 var showhidden = null; 12 var statusUserIM = ""; 13 var _statusMessage = ""; 14 var timeoutId = null; 15 var userCurrent = null; 16 var _timeOutNotification = ""; 17 var Xtools = null; 18 var zIndex = 9001; 19 var windowPopUp = []; 18 20 19 21 // Sniffer Browser … … 245 247 246 248 _div_status.setAttribute('autoStatus','true'); 249 247 250 loadscript.setStatusJabber("Não Disponível","xa"); 248 251 } … … 797 800 // Photo User 798 801 getPhotoUser(_idUser); 799 800 802 } 801 803 … … 829 831 830 832 case 'none' : 831 833 832 834 TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribe'); 833 835 TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribed'); … … 851 853 852 854 case 'to' : 853 855 854 856 TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribed'); 855 857 … … 859 861 860 862 break; 863 864 default : 865 866 alert( "DEFAULT : " + subscription ); 861 867 } 862 868 } … … 1046 1052 { 1047 1053 var _text = arguments[0]; 1048 var _img = arguments[1];1049 1054 var _img = statusUserIM = arguments[1]; 1055 1050 1056 getElement('statusJabberText').innerHTML = _text; 1051 1057 getElement('statusJabberImg').style.background = "url('"+path_jabberit+"templates/default/images/"+_img+".gif')"; … … 1146 1152 } 1147 1153 } 1154 1155 function windowNotificationNewUsers() 1156 { 1157 var paramsNotification = 1158 { 1159 'lang_1' : "Notificação", 1160 'lang_2' : "O(s) usuário(s) abaixo pedem sua autorização." 1161 }; 1162 1163 var winLoginPage = 1164 { 1165 id_window : "window_notification_new_users", 1166 width : 350, 1167 height : 300, 1168 top : 100, 1169 left : 400, 1170 draggable : true, 1171 visible : "display", 1172 resizable : true, 1173 zindex : zIndex++, 1174 title : "Expresso Messenger - Notificação de Novos Usuários", 1175 closeAction : "remove", 1176 content : Xtools.parse(Xtools.xml("notification_new_users"), "notificationNewUsers.xsl", paramsNotification) 1177 }; 1178 1179 _winBuild( winLoginPage ); 1180 } 1181 1182 function teste_new() 1183 { 1184 var _notification = getElement('notification_new_users_jabber') ; 1185 var _statusJabber = getElement('status_jabber_expresso'); 1186 1187 if( _notification && _statusJabber ) 1188 { 1189 if ( _notification.style.display == 'none' ) 1190 { 1191 _notification.style.display = 'block'; 1192 1193 _statusJabber.style.background = "url('"+path_jabberit+"templates/default/images/alert_mini.png') no-repeat"; 1194 1195 if( _timeOutNotification ) 1196 clearTimeout(_timeOutNotification ); 1197 1198 _timeOutNotification = setTimeout( function(){ teste_new(); }, 2000 ); 1199 } 1200 else 1201 { 1202 _notification.style.display = 'none'; 1203 1204 _statusJabber.style.background = "url('"+path_jabberit+"templates/default/images/" + statusUserIM + ".gif') no-repeat"; 1205 1206 if( _timeOutNotification ) 1207 clearTimeout(_timeOutNotification ); 1208 1209 _timeOutNotification = setTimeout( function(){ teste_new(); }, 800 ); 1210 } 1211 } 1212 } 1213 1214 1215 loadIM.prototype.teste_new = teste_new; 1216 1148 1217 1149 1218 function loadIM() … … 1204 1273 { 1205 1274 if( _preferencesIM[0] === 'openWindowJabberit:true' ) 1275 { 1206 1276 TrophyIM.load(); 1277 } 1278 1207 1279 },1500); 1208 1280 … … 1249 1321 loadIM.prototype.renameGroup = renameGroup; 1250 1322 loadIM.prototype.rosterDiv = rosterDiv; 1323 loadIM.prototype.windowNotificationNewUsers = windowNotificationNewUsers; 1251 1324 loadIM.prototype.windowPOPUP = windowPOPUP; 1325 1252 1326 1253 1327 window.LoadIM = loadIM; -
trunk/jmessenger/js/trophyim.js
r2961 r2966 130 130 */ 131 131 TrophyIM = { 132 133 134 controll : { notificationNewUsers : 0 }, 135 132 136 133 137 /** AutoConnection … … 1177 1181 if( arguments.length > 0 ) 1178 1182 { 1183 // Get Arguments 1179 1184 var objContact = arguments[0]; 1180 1185 var group = arguments[1]; … … 1183 1188 var showOffline = loadscript.getShowContactsOffline(); 1184 1189 1185 var itensJid = document.getElementById( 'itenContact_' + objContact.contact.jid + '_' + index ); 1190 // Presence e Status 1191 var presence = "unavailable"; 1192 var status = ""; 1193 var statusColor = "black"; 1194 var statusDisplay = "none"; 1195 1196 // Set Presence 1197 var _presence = function(objContact) 1198 { 1199 if (objContact.presence) 1200 { 1201 for (var resource in objContact.presence) 1202 { 1203 if ( objContact.presence[resource].constructor == Function ) 1204 continue; 1205 1206 if( objContact.presence[resource].show != 'invisible' ) 1207 presence = objContact.presence[resource].show; 1208 1209 if( objContact.contact.subscription != "both") 1210 presence = 'subscription'; 1211 1212 if( objContact.presence[resource].status ) 1213 { 1214 status = " ( " + objContact.presence[resource].status + " ) "; 1215 statusDisplay = "block"; 1216 } 1217 } 1218 } 1219 }; 1220 1221 // Set Subscription 1222 var _subscription = function( objContact ) 1223 { 1224 if( objContact.contact.subscription != "both" ) 1225 { 1226 switch( objContact.contact.subscription ) 1227 { 1228 case "none" : 1229 1230 status = " (( " + i18n.ASK_FOR_AUTH + " )) "; 1231 statusColor = "red"; 1232 break; 1233 1234 case "to" : 1235 1236 status = " (( " + i18n.CONTACT_ASK_FOR_AUTH + " )) "; 1237 statusColor = "orange"; 1238 1239 if ( TrophyIM.controll.notificationNewUsers == 0 ) 1240 { 1241 loadscript.teste_new(); 1242 TrophyIM.controll.notificationNewUsers++; 1243 } 1244 1245 break; 1246 1247 case "from" : 1248 1249 status = " (( " + i18n.AUTH_ASK + " )) "; 1250 statusColor = "green"; 1251 break; 1252 1253 case "subscribe" : 1254 1255 status = " (( " + i18n.AUTH_SENT + " )) "; 1256 statusColor = "red"; 1257 break; 1258 1259 case "not-in-roster" : 1260 1261 status = " (( " + i18n.ASK_FOR_AUTH_QUESTION + " )) "; 1262 statusColor = "orange"; 1263 1264 if ( TrophyIM.controll.notificationNewUsers == 0 ) 1265 { 1266 loadscript.teste_new(); 1267 TrophyIM.controll.notificationNewUsers++; 1268 } 1269 1270 break; 1271 1272 default: 1273 paramsContact.status = " ( SEM PARAMETRO DEFINIDO" + objContact.contact.subscription + " ) "; 1274 } 1275 1276 statusDisplay = "block"; 1277 } 1278 }; 1279 1280 var itensJid = document.getElementById( "itenContact_" + objContact.contact.jid + "_" + index ); 1186 1281 1187 1282 if( itensJid == null ) … … 1198 1293 } 1199 1294 1200 // Presence e Status 1201 var presence = "unavailable"; 1202 var status = ""; 1203 var statusDisplay = "none"; 1204 1205 if (objContact.presence) 1206 { 1207 for (var resource in objContact.presence) 1208 { 1209 if ( objContact.presence[resource].constructor == Function ) 1210 continue; 1211 1212 if( objContact.presence[resource].show != 'invisible' ) 1213 presence = objContact.presence[resource].show; 1214 1215 if( objContact.contact.subscription != "both") 1216 presence = 'subscription'; 1217 1218 if( objContact.presence[resource].status ) 1219 { 1220 status = " ( " + objContact.presence[resource].status + " ) "; 1221 statusDisplay = "block"; 1222 } 1223 } 1224 } 1295 // Get Presence 1296 _presence(objContact); 1225 1297 1226 1298 var paramsContact = … … 1239 1311 } 1240 1312 1241 // Authorization 1242 if( objContact.contact.subscription != "both" ) 1243 { 1244 1245 switch(objContact.contact.subscription) 1246 { 1247 case "none" : 1248 1249 paramsContact.status = " (( " + i18n.ASK_AUTHO + " )) "; 1250 paramsContact.statusColor = "red"; 1251 break; 1252 1253 case "to" : 1254 1255 paramsContact.status = " (( " + i18n.CONTACT_ASK_FOR_AUTH + ")) "; 1256 paramsContact.statusColor = "orange"; 1257 break; 1258 1259 case "from" : 1260 1261 paramsContact.status = " (( " + i18n.AUTH_ASK + " )) "; 1262 paramsContact.statusColor = "green"; 1263 break; 1264 1265 case "subscribe" : 1266 1267 paramsContact.status = " (( " + i18n.AUTH_SENT + " )) "; 1268 paramsContact.statusColor = "red"; 1269 break; 1270 1271 case "not-in-roster" : 1272 1273 paramsContact.status = " (( " + i18n.ASK_FOR_AUTH_QUESTION + " )) "; 1274 paramsContact.statusColor = "orange"; 1275 break; 1276 1277 default: 1278 paramsContact.status = " ( " + objContact.contact.subscription + " ) "; 1279 } 1280 } 1313 // Get Authorization 1314 _subscription( objContact ); 1281 1315 1282 1316 if( group != "") … … 1300 1334 else 1301 1335 { 1302 1303 // Presence e Status 1304 var presence = "unavailable"; 1305 var status = ""; 1306 var statusColor = "black"; 1307 var statusDisplay = "none"; 1308 1309 if ( objContact.presence ) 1310 { 1311 for ( var resource in objContact.presence ) 1312 { 1313 if ( objContact.presence[resource].constructor == Function ) 1314 continue; 1315 1316 if( objContact.presence[resource].show != 'invisible' ) 1317 presence = objContact.presence[resource].show; 1318 1319 if( objContact.contact.subscription != "both") 1320 presence = 'subscription'; 1321 1322 if( objContact.presence[resource].status ) 1323 { 1324 status = " ( " + objContact.presence[resource].status + " ) "; 1325 statusDisplay = "block"; 1326 } 1327 } 1328 } 1329 1336 // Get Presence 1337 _presence(objContact); 1338 1330 1339 var is_open = itensJid.parentNode.childNodes[0].style.backgroundImage; 1331 1340 is_open = is_open.indexOf("arrow_down.gif"); 1332 1341 1333 // Authorization 1334 if( objContact.contact.subscription != "both" ) 1335 { 1336 switch(objContact.contact.subscription) 1337 { 1338 case "none" : 1339 1340 status = " (( " + i18n.ASK_FOR_AUTH + " )) "; 1341 statusColor = "red"; 1342 break; 1343 1344 case "to" : 1345 1346 status = " (( " + i18n.CONTACT_ASK_FOR_AUTH + " )) "; 1347 statusColor = "orange"; 1348 break; 1349 1350 case "from" : 1351 1352 status = " (( " + i18n.AUTH_ASK + " )) "; 1353 statusColor = "green"; 1354 break; 1355 1356 case "subscribe" : 1357 1358 status = " (( " + i18n.AUTH_SENT + " )) "; 1359 statusColor = "red"; 1360 break; 1361 1362 case "not-in-roster" : 1363 1364 status = " (( " + i18n.ASK_FOR_AUTH_QUESTION + " )) "; 1365 statusColor = "orange"; 1366 break; 1367 1368 default: 1369 status = " ( " + objContact.contact.subscription + " ) "; 1370 } 1371 1372 statusDisplay = "block"; 1373 } 1342 // Get Authorization 1343 _subscription( objContact ); 1374 1344 1375 1345 with ( document.getElementById('span_show_' + 'itenContact_' + objContact.contact.jid + '_' + index ) ) … … 1417 1387 } 1418 1388 } 1419 } 1389 }; 1420 1390 1421 1391 for( var i = 0 ; i < users.length; i++ ) 1422 1392 { 1423 if( TrophyIM.rosterObj.roster[users[i]].contact.jid != Base64.decode( loadscript.getUserCurrent().jid) )1393 if( TrophyIM.rosterObj.roster[users[i]].contact.jid != Base64.decode( loadscript.getUserCurrent().jid) ) 1424 1394 { 1425 1395 if( TrophyIM.rosterObj.roster[users[i]].contact.groups ) … … 1444 1414 } 1445 1415 } 1446 } 1416 } 1447 1417 }, 1448 1418 -
trunk/jmessenger/xsl/contactsList.xsl
r2896 r2966 15 15 <div style="position: absolute; left: 80px; top: 8px;"> <xsl:value-of select="$full_name"/> </div> 16 16 17 <div style="position: absolute; top: 2 8px; left: 80px;">17 <div style="position: absolute; top: 25px; 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"/> … … 23 23 24 24 <img style="height:16px; margin-left:10px;cursor:pointer;" alt="Help" title="Help" src="{$path_jabberit}/templates/default/images/help.png" onclick="alert('2');" /> 25 26 </div> 27 28 <div id="notification_new_users_jabber" style="display:none; position:absolute; top: 25px; left: 165px;"> 29 <img style="margin-left:15px;cursor:pointer;" alt="Novos Contatos" title="Novos Contatos" src="{$path_jabberit}/templates/default/images/alert_2.png" onclick="loadscript.windowNotificationNewUsers();" /> 25 30 </div> 26 31
Note: See TracChangeset
for help on using the changeset viewer.