Changeset 28c1a0
- Timestamp:
- Jul 19, 2008, 7:06:08 PM (13 years ago)
- Branches:
- master
- Children:
- ff647c
- Parents:
- 1c4459
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chrome/content/v_identity/vI_msgIdentityClone.js
r1c4459 r28c1a0 28 28 text_usualId_class : "plain menulist_clone-textbox", 29 29 text_virtualId_class : "plain menulist_clone-textbox vIactiv", 30 30 31 31 localIdentityData : null, 32 32 … … 189 189 }, 190 190 191 __setIdentity : function (id) { 192 // set orignal Identity-Menu to the selected Identity 193 vI_msgIdentityClone.copySelectedIdentity(id); 194 // set smtp-selector to the smtp of the selcted Identity 195 vI_smtpSelector.resetMenuToMsgIdentity(id); 196 // recognize reply-to fields for auto-reply 197 vI_msgIdentityClone.initReplyToFields(id); 198 }, 199 191 200 // this LoadIdentity - oncommand is used by our clone MsgIdentity Menu 192 201 // remove the Virtual Account if a different (usual) Account is choosen in the cloned dropdown-menu 193 LoadIdentity : function() 194 { 202 LoadIdentity : function() { 195 203 vI_notificationBar.dump("## vI_msgIdentityClone: LoadIdentity\n"); 196 vI_msgIdentityClone.cleanupReplyTo();197 204 vI_msgIdentityClone.initMsgIdentityTextbox_clone(); 198 205 … … 202 209 if (vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem.value != "vid" && 203 210 vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem.getAttribute("value") != "vid") { 211 212 // clean reply-to fields before reinit 213 vI_msgIdentityClone.cleanupReplyTo(); 214 // remove possibly stored base_id_key 204 215 vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.base_id_key = null; 205 vI_msgIdentityClone.copySelectedIdentity( 206 vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem.value); 207 vI_smtpSelector.resetMenuToMsgIdentity( 208 vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem.value); 216 217 vI_msgIdentityClone.__setIdentity(vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem.value); 218 209 219 // Identitys might have IdentityName set differently to 'name <email>', 210 220 // so retrieve name and email directly from Identity … … 214 224 else { 215 225 vI_notificationBar.dump("## vI_msgIdentityClone: LoadIdentity virtual Identity\n"); 216 vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.base_id_key = 217 vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem.base_id_key 218 vI_msgIdentityClone.copySelectedIdentity( 219 vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.base_id_key); 226 227 var base_id_key = vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem.base_id_key 228 // if MenuItem has a base_id_key set,first set Identity to base_id 229 if (base_id_key) { 230 vI_notificationBar.dump("## vI_msgIdentityClone: base_id found, set menu temporarily to base_id\n"); 231 vI_msgIdentityClone.__setIdentity(base_id_key); 232 // store base_id_key if available 233 vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.base_id_key = base_id_key 234 } 235 236 // set smtp-selector to the smtp of the selected Identity 220 237 vI_smtpSelector.setMenuToKey( 221 238 vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem.smtp_key); 239 222 240 if (vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem.extras) 223 241 vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem.extras.setValues(); … … 235 253 vI_helper.getAccountname(vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem)); 236 254 vI_msgIdentityClone.markAsNewAccount(vI_msgIdentityClone.isExistingIdentity()); 237 vI_msgIdentityClone.initReplyToFields(); 255 256 238 257 }, 239 258 240 259 setIdentity : function(newName, timeStamp) { 241 vI_notificationBar.dump("## initReplyToFieldssetIdentity " + newName + "\n");260 vI_notificationBar.dump("## vI_msgIdentityClone: setIdentity " + newName + "\n"); 242 261 vI_msgIdentityClone.initMsgIdentityTextbox_clone(); 243 262 vI_msgIdentityClone.elements.Obj_MsgIdentityTextbox_clone.value = newName; … … 280 299 281 300 cleanReplyToFields : function() { 301 vI_notificationBar.dump("## vI_msgIdentityClone: cleanReplyToFields\n"); 282 302 vI_msgIdentityClone.replyToInputElem = null; 283 303 vI_msgIdentityClone.replyToPopupElem = null; … … 290 310 // called directly after a change of the Identity with the dropdown menu 291 311 // searches the first reply-to row and assumes that this is the one we like to adapt 292 initReplyToFields : function( ) {293 // TB 1.x doesn'T accept the value without the getAttribute294 var id = (vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem.value ||295 vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem.getAttribute("value")) 296 if (id == "vid") return;312 initReplyToFields : function(id) { 313 // v_identity calls initReplyToFields in stage2 without id 314 if (!id) id = vI_msgIdentityClone.elements.Obj_MsgIdentity_clone.selectedItem.value; 315 316 vI_notificationBar.dump("## vI_msgIdentityClone: initReplyToFields id=" + id + "\n"); 297 317 var replyTo = gAccountManager.getIdentity(id).replyTo 298 vI_notificationBar.dump("## initReplyToFields identity.replyTo: " + replyTo + "\n");318 vI_notificationBar.dump("## vI_msgIdentityClone: initReplyToFields identity.replyTo: " + replyTo + "\n"); 299 319 if (replyTo == "") return 300 320 … … 304 324 var awValue = awGetInputElement(row).value 305 325 if (awType == "addr_reply" && awValue == replyTo) { 306 vI_notificationBar.dump("## vI_msgIdentityClone: Reply-To found in row " + row + "\n");326 vI_notificationBar.dump("## vI_msgIdentityClone: initReplyToFields Reply-To found in row " + row + "\n"); 307 327 vI_msgIdentityClone.replyToPopupElem = awGetPopupElement(row) 308 328 vI_msgIdentityClone.replyToInputElem = awGetInputElement(row) … … 310 330 } 311 331 } 312 if (!vI_msgIdentityClone.replyToInputElem) vI_notificationBar.dump("## vI_msgIdentityClone: no Reply-To row found\n");332 if (!vI_msgIdentityClone.replyToInputElem) vI_notificationBar.dump("## vI_msgIdentityClone: initReplyToFields no Reply-To row found\n"); 313 333 }, 314 334 315 335 cleanupReplyTo : function() { 316 336 if (!vI_msgIdentityClone.replyToSynchronize) return 317 vI_notificationBar.dump("## cleanupReplyTo\n");337 vI_notificationBar.dump("## vI_msgIdentityClone: cleanupReplyTo\n"); 318 338 319 339 // check if sychronizing should still be done (will be stopped if value was modified by hand) … … 322 342 if (vI_msgIdentityClone.replyToInitValue) { 323 343 var replyTo = vI_msgIdentityClone.replyToInitValue; 324 vI_notificationBar.dump("## restore ReplyTo: " + replyTo + "\n");344 vI_notificationBar.dump("## vI_msgIdentityClone: cleanupReplyTo restore ReplyTo: " + replyTo + "\n"); 325 345 vI_msgIdentityClone.replyToInputElem.value = replyTo; 326 346 vI_msgIdentityClone.replyToInputElem.setAttribute("value",replyTo) … … 338 358 339 359 synchroneReplyTo : function() { 340 vI_notificationBar.dump("## synchroneReplyTo\n");360 vI_notificationBar.dump("## vI_msgIdentityClone: synchroneReplyTo\n"); 341 361 if ( (vI_msgIdentityClone.replyToPopupElem.selectedItem.value != "addr_reply") || 342 362 (vI_msgIdentityClone.replyToStoredLastValue && … … 352 372 if (!vI.preferences.getBoolPref("autoReplyToSelf")) return 353 373 if (!vI_msgIdentityClone.replyToSynchronize) { 354 vI_notificationBar.dump("## updateReplyTo stopped Synchronizing\n")374 vI_notificationBar.dump("## vI_msgIdentityClone: updateReplyTo stopped Synchronizing\n") 355 375 return 356 376 } 357 vI_notificationBar.dump("## updateReplyTo replyToStoredLastValue="377 vI_notificationBar.dump("## vI_msgIdentityClone: updateReplyTo replyToStoredLastValue=" 358 378 + vI_msgIdentityClone.replyToStoredLastValue + "\n"); 359 379
Note: See TracChangeset
for help on using the changeset viewer.