Changeset 24 for trunk/instant_messenger/js/im_preferences.js
- Timestamp:
- 05/10/07 11:51:20 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/instant_messenger/js/im_preferences.js
r23 r24 86 86 var text2 = document.getElementById('text2'); 87 87 var _this = this; 88 89 if(pFunc != "divUpdateUser_im"){ 90 var jid = text0.value.substr(0,text0.value.indexOf('@')); 91 for(var i=0; i < IM.user_not_aut.length; i++){ 92 if(IM.user_not_aut[i].substr(0,IM.user_not_aut[i].indexOf('@')) == jid){ 93 return; 94 } 95 } 96 } 97 88 98 89 if(IM.LTrim(text0.value) != "" && IM.LTrim(text1.value) != "" && IM.LTrim(text2.value) != ""){ 99 90 var handler_add_contact = function(data){ … … 130 121 sel_contact.options[sel_contact.length] = opt; 131 122 132 for(var i=1; i < IM. vcard_contacts.length; i++){133 if(IM. vcard_contacts[i].name != ""){134 opt = new Option(IM. vcard_contacts[i].name,IM.vcard_contacts[i].jid, false, false);123 for(var i=1; i < IM.array_users.length; i++){ 124 if(IM.array_users[i].name != ""){ 125 opt = new Option(IM.array_users[i].name,IM.array_users[i].jid, false, false); 135 126 sel_contact.options[sel_contact.length] = opt; 136 127 }else{ 137 name = IM. vcard_contacts[i].jid.substr(0,IM.vcard_contacts[i].jid.indexOf('@'));138 opt = new Option(name,IM. vcard_contacts[i].jid, false, false);128 name = IM.array_users[i].jid.substr(0,IM.array_users[i].jid.indexOf('@')); 129 opt = new Option(name,IM.array_users[i].jid, false, false); 139 130 sel_contact.options[sel_contact.length] = opt; 140 131 } … … 150 141 if(confirm("Excluir o contato " + sel_contact.options[i].innerHTML + "?")){ 151 142 var in_el = sel_contact.options[i].innerHTML; 152 for(var j=1 ; j < IM. vcard_contacts.length; j++){153 var name = IM. vcard_contacts[j].jid.substr(0,IM.vcard_contacts[j].jid.indexOf('@'));154 if(IM. vcard_contacts[j].name == in_el || name == in_el){143 for(var j=1 ; j < IM.array_users.length; j++){ 144 var name = IM.array_users[j].jid.substr(0,IM.array_users[j].jid.indexOf('@')); 145 if(IM.array_users[j].name == in_el || name == in_el){ 155 146 var handler_remove_contact = function(data){ 156 147 if(!data){ … … 161 152 } 162 153 cIM.cExecute("$this.Ujabber.RosterRemoveUser",handler_remove_contact,"jid="+sel_contact.options[i].value); 163 IM. vcard_contacts.splice(j,1);154 IM.array_users.splice(j,1); 164 155 _this.ComboRemove(); 165 156 j--; … … 183 174 var opt = new Option("-- "+IM.get_lang('Choice Contact')+" -- ","0",true,true); 184 175 sel_contact.options[sel_contact.length] = opt; 185 for(var i=0; i < IM. vcard_contacts.length; i++){186 opt = new Option(IM. vcard_contacts[i].name,IM.vcard_contacts[i].jid, false, false);176 for(var i=0; i < IM.array_users.length; i++){ 177 opt = new Option(IM.array_users[i].name,IM.array_users[i].jid, false, false); 187 178 sel_contact.options[sel_contact.length] = opt; 188 179 } … … 191 182 Preferences.prototype.Remove_Contact = function(pJid) 192 183 { 193 for(var i=0; i < IM. vcard_contacts.length; i++){194 if(IM. vcard_contacts[i].jid == pJid){195 if(confirm("Excluir o contato " + IM. vcard_contacts[i].name + "?")){184 for(var i=0; i < IM.array_users.length; i++){ 185 if(IM.array_users[i].jid == pJid){ 186 if(confirm("Excluir o contato " + IM.array_users[i].name + "?")){ 196 187 var handler_remove_contact = function(data){ 197 188 if(!data){ … … 215 206 Preferences.prototype.updateLoad = function(i) 216 207 { 217 Jid = IM. vcard_contacts[i].jid;208 Jid = IM.array_users[i].jid; 218 209 Templates.update_user(); 219 210 document.getElementById('text0').value = Jid; … … 227 218 var jid = pJid; 228 219 229 for(var i=1; i < IM. vcard_contacts.length; i++){230 if(IM. vcard_contacts[i].jid == pJid){231 name = IM. vcard_contacts[i].name;232 group = IM. vcard_contacts[i].group;220 for(var i=1; i < IM.array_users.length; i++){ 221 if(IM.array_users[i].jid == pJid){ 222 name = IM.array_users[i].name; 223 group = IM.array_users[i].group; 233 224 } 234 225 } … … 314 305 { 315 306 Templates.information_Contact(); 316 for(var i=0; i < IM. vcard_contacts.length; i++){317 if(IM. vcard_contacts[i].jid == pJid){318 document.getElementById('_lbl_FN').innerHTML = decodeURI(IM. vcard_contacts[i].VCARD_FN);319 document.getElementById('_lbl_Nickname').innerHTML = decodeURI(IM. vcard_contacts[i].VCARD_NICKNAME);320 document.getElementById('_lbl_Orgunit').innerHTML = decodeURI(IM. vcard_contacts[i].VCARD_ORGUNIT);321 document.getElementById('_lbl_Role').innerHTML = decodeURI(IM. vcard_contacts[i].VCARD_ROLE);322 document.getElementById('_lbl_Birthday').innerHTML = decodeURI(IM. vcard_contacts[i].VCARD_BDAY);307 for(var i=0; i < IM.array_users.length; i++){ 308 if(IM.array_users[i].jid == pJid){ 309 document.getElementById('_lbl_FN').innerHTML = decodeURI(IM.array_users[i].VCARD_FN); 310 document.getElementById('_lbl_Nickname').innerHTML = decodeURI(IM.array_users[i].VCARD_NICKNAME); 311 document.getElementById('_lbl_Orgunit').innerHTML = decodeURI(IM.array_users[i].VCARD_ORGUNIT); 312 document.getElementById('_lbl_Role').innerHTML = decodeURI(IM.array_users[i].VCARD_ROLE); 313 document.getElementById('_lbl_Birthday').innerHTML = decodeURI(IM.array_users[i].VCARD_BDAY); 323 314 return; 324 315 }
Note: See TracChangeset
for help on using the changeset viewer.