Changeset 2706 for sandbox/jabberit_messenger/trophy_expresso/js
- Timestamp:
- 05/04/10 16:36:51 (14 years ago)
- Location:
- sandbox/jabberit_messenger/trophy_expresso/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/jabberit_messenger/trophy_expresso/js/jscode/loadIM.js
r2696 r2706 281 281 } 282 282 283 function getShowContactsOffline() 284 { 285 if( _preferencesIM[3] ) 286 { 287 var showOffline = _preferencesIM[3].split(":"); 288 289 if( showOffline[1] === "true") 290 return true; 291 else 292 return false; 293 } 294 295 return true; 296 } 297 283 298 function getUserCurrent() 284 299 { … … 325 340 while( _elementNext ) 326 341 { 327 if( _elementNext.nodeType == 1 ) 328 _elementNext.style.display = "block"; 342 if( _elementNext.nodeType == 1 && _elementNext.nodeName.toLowerCase() == "div") 343 { 344 var is_off = _elementNext.style.backgroundImage.indexOf("unavailable"); 345 346 if( is_off > 0 && !getShowContactsOffline()) 347 _elementNext.style.display = "none"; 348 else 349 _elementNext.style.display = "block"; 350 } 329 351 330 352 _elementNext = _elementNext.nextSibling; … … 515 537 'lang10' : 'Ausente', 516 538 'lang11' : 'Definir status de ausente depois de', 517 'lang12' : 'minutos', 539 'lang12' : 'minutos', 540 'lang13' : 'Mostrar Contatos', 541 'lang14' : 'Mostrar contatos desconectados', 518 542 'langYes': 'Sim', 519 543 'langNo' : 'Não' … … 525 549 id_window : "jabberit_preferences", 526 550 width : 430, 527 height : 330,551 height : 410, 528 552 top : 150, 529 553 left : 100, … … 571 595 var element3 = document.getElementById(value3[0]); 572 596 element3.value = value3[1]; 597 598 // Element showContactsOfflineJabberit 599 var value4 = _preferencesIM[3].split(':'); 600 var element4 = document.getElementById(value4[0]); 601 var valueSelect4 = value4[1]; 602 for(var i = 0; i < element4.options.length; i++) 603 if( element4.options[i].value == valueSelect4 ) 604 element4.options[i].selected = true; 573 605 } 574 606 … … 757 789 return false; 758 790 } 759 760 791 792 // Element showContactsOfflineJabberit 793 var elementShowOffline = document.getElementById('showContactsOfflineJabberit'); 794 795 for(var i = 0 ; i < elementShowOffline.options.length; i++) 796 if( elementShowOffline.options[i].selected == true) 797 { 798 _preferencesIM[3] = 'showContactsOfflineJabberit:' + elementShowOffline.options[i].value; 799 value += '&preferences4=showContactsOfflineJabberit:' + elementShowOffline.options[i].value; 800 } 801 761 802 // Save Preferences 762 803 conn.go('p.pf.setPreferences', … … 893 934 // Preferences 894 935 _preferencesIM = arguments[1].split(";"); 895 936 937 if( !_preferencesIM[3] ) _preferencesIM[3] = "showContactsOfflineJabberit:false"; 938 896 939 loadScripts(files); 897 940 … … 946 989 loadIM.prototype.configEvents = configEvents; 947 990 loadIM.prototype.getPhotoUser = getPhotoUser; 991 loadIM.prototype.getShowContactsOffline = getShowContactsOffline; 948 992 loadIM.prototype.getUserCurrent = getUserCurrent; 949 993 loadIM.prototype.getZIndex = getZindex; -
sandbox/jabberit_messenger/trophy_expresso/js/trophyim.js
r2678 r2706 1013 1013 var element = arguments[2]; 1014 1014 var index = arguments[3]; 1015 1015 var showOffline = loadscript.getShowContactsOffline(); 1016 1016 1017 var itensJid = document.getElementById( 'itenContact_' + objContact.contact.jid + '_' + index ); 1017 1018 … … 1057 1058 var paramsContact = 1058 1059 { 1059 nameContact : nameContact, 1060 jid : objContact.contact.jid, 1060 divDisplay : "block", 1061 1061 id : 'itenContact_' + objContact.contact.jid + '_' + index , 1062 1062 index : ((index == 0 ) ? "0" : index), 1063 jid : objContact.contact.jid, 1064 nameContact : nameContact, 1063 1065 path_jabberit : path_jabberit, 1064 1066 presence : presence, 1067 spanDisplay : statusDisplay, 1065 1068 status : status, 1066 1069 statusColor : "black", 1067 statusDisplay : statusDisplay,1068 1070 subscription : objContact.contact.subscription 1069 1071 } … … 1205 1207 with ( document.getElementById('span_show_' + 'itenContact_' + objContact.contact.jid + '_' + index ) ) 1206 1208 { 1207 if( is_open > 0 )1209 /*if( is_open > 0 ) 1208 1210 { 1209 1211 style.display = statusDisplay; 1210 1212 style.color = statusColor; 1211 1213 innerHTML = status; 1214 }*/ 1215 1216 if( presence == "unavailable" && !showOffline ) 1217 { 1218 style.display = "none"; 1219 } 1220 else 1221 { 1222 if( is_open > 0 ) 1223 { 1224 style.display = statusDisplay; 1225 style.color = statusColor; 1226 innerHTML = status; 1227 } 1228 } 1229 } 1230 1231 if( presence == "unavailable" && !showOffline ) 1232 itensJid.style.display = "none"; 1233 else 1234 { 1235 if( is_open > 0 ) 1236 { 1237 itensJid.style.display = "block"; 1212 1238 } 1213 1239 } 1214 1240 1215 1241 itensJid.style.background = "url('"+path_jabberit+"templates/default/images/" + presence + ".gif') no-repeat center left"; 1242 } 1243 1244 // Contact OffLine 1245 if( !objContact.presence && !showOffline ) 1246 { 1247 with ( document.getElementById('span_show_' + 'itenContact_' + objContact.contact.jid + '_' + index )) 1248 { 1249 style.display = "none"; 1250 } 1251 1252 with ( document.getElementById('itenContact_' + objContact.contact.jid + '_' + index ) ) 1253 { 1254 style.display = "none"; 1255 } 1216 1256 } 1217 1257 }
Note: See TracChangeset
for help on using the changeset viewer.