Changeset c3feaa
- Timestamp:
- Aug 16, 2011, 10:12:23 PM (11 years ago)
- Branches:
- ng_0.8, ng_0.9
- Children:
- 190674
- Parents:
- 92fd25
- Files:
-
- 1 added
- 45 edited
Legend:
- Unmodified
- Added
- Removed
-
chrome.manifest
r92fd25 rc3feaa 10 10 overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://v_identity/content/v_identity.xul 11 11 overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://v_identity/content/vI_context.xul 12 overlay chrome://messenger/content/messenger.xul chrome://v_identity/content/vI_upgradeOverlay.xul 12 13 overlay chrome://messenger/content/messenger.xul chrome://v_identity/content/vI_context.xul 13 overlay chrome://messenger/content/messenger.xul chrome://v_identity/content/vI_upgradeOverlay.xul14 14 overlay chrome://messenger/content/mailWindowOverlay.xul chrome://v_identity/content/vI_getHeader.xul 15 15 overlay chrome://v_identity/content/vI_rdfDataTree.xul chrome://v_identity/content/vI_storageExtrasDataTreeOverlay.xul -
chrome/content/v_identity/vI_Dialog.js
r92fd25 rc3feaa 23 23 * ***** END LICENSE BLOCK ***** */ 24 24 25 var vI_Dialog = { 25 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 26 var Dialog = { 26 27 setDescription : function(object, description) { 27 28 var new_text = document.createTextNode(description); … … 31 32 init : function(warning) { 32 33 document.getElementById("vI_Dialog").setAttribute("class", warning.class); 33 vI_Dialog.setDescription(document.getElementById("vI_Dialog_title"), warning.title);34 vI_Dialog.setDescription(document.getElementById("vI_Dialog_recLabel"), warning.recLabel);35 vI_Dialog.setDescription(document.getElementById("vI_Dialog_recipient"), warning.recipient);34 Dialog.setDescription(document.getElementById("vI_Dialog_title"), warning.title); 35 Dialog.setDescription(document.getElementById("vI_Dialog_recLabel"), warning.recLabel); 36 Dialog.setDescription(document.getElementById("vI_Dialog_recipient"), warning.recipient); 36 37 document.getElementById("vI_Dialog_browser").outputString = warning.warning; 37 vI_Dialog.setDescription(document.getElementById("vI_Dialog_query"), warning.query);38 Dialog.setDescription(document.getElementById("vI_Dialog_query"), warning.query); 38 39 // show abort button 39 40 if (warning.class == "replaceVIdentity") { … … 43 44 } 44 45 } 46 vI.Dialog = Dialog; 47 }}); -
chrome/content/v_identity/vI_Dialog.xul
r92fd25 rc3feaa 37 37 title="Virtual Identity" 38 38 zlevel="6" 39 onload="v I_Dialog.init(window.arguments[0]);"39 onload="virtualIdentityExtension.Dialog.init(window.arguments[0]);" 40 40 ondialogaccept="window.arguments[1].returnValue = 'accept';" 41 41 ondialogcancel="window.close(); window.arguments[1].returnValue = 'cancel';" … … 44 44 persist="height width"> 45 45 46 <script type="application/x-javascript" 47 46 <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" /> 47 <script type="application/x-javascript" src="chrome://v_identity/content/vI_Dialog.js" /> 48 48 49 49 <description id="vI_Dialog_title" /> -
chrome/content/v_identity/vI_account.js
r92fd25 rc3feaa 23 23 * ***** END LICENSE BLOCK ***** */ 24 24 25 var vI_account = { 26 account : null, 27 28 AccountManager : Components.classes["@mozilla.org/messenger/account-manager;1"] 25 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 26 var account = { 27 _account : null, 28 29 _AccountManager : Components.classes["@mozilla.org/messenger/account-manager;1"] 29 30 .getService(Components.interfaces.nsIMsgAccountManager), 30 31 32 prefroot : Components.classes["@mozilla.org/preferences-service;1"] 31 32 _prefroot : Components.classes["@mozilla.org/preferences-service;1"] 33 33 .getService(Components.interfaces.nsIPrefService) 34 34 .getBranch(null), 35 35 36 36 _getBaseIdentity : function () { 37 return gAccountManager.getIdentity(vI_main.elements.Obj_MsgIdentity.value);37 return account._AccountManager.getIdentity(vI.main.elements.Obj_MsgIdentity.value); 38 38 }, 39 39 40 40 _copyBoolAttribute : function(name) { 41 vI_account.account.defaultIdentity.setBoolAttribute(name,42 vI_account._getBaseIdentity().getBoolAttribute(name));41 account._account.defaultIdentity.setBoolAttribute(name, 42 account._getBaseIdentity().getBoolAttribute(name)); 43 43 }, 44 44 45 45 _copyIntAttribute : function(name) { 46 vI_account.account.defaultIdentity.setIntAttribute(name,47 vI_account._getBaseIdentity().getIntAttribute(name));46 account._account.defaultIdentity.setIntAttribute(name, 47 account._getBaseIdentity().getIntAttribute(name)); 48 48 }, 49 49 50 50 _copyCharAttribute : function(name) { 51 vI_account.account.defaultIdentity.setCharAttribute(name,52 vI_account._getBaseIdentity().getCharAttribute(name));51 account._account.defaultIdentity.setCharAttribute(name, 52 account._getBaseIdentity().getCharAttribute(name)); 53 53 }, 54 54 55 55 _copyUnicharAttribute : function(name) { 56 vI_account.account.defaultIdentity.setUnicharAttribute(name,57 vI_account._getBaseIdentity().getUnicharAttribute(name));56 account._account.defaultIdentity.setUnicharAttribute(name, 57 account._getBaseIdentity().getUnicharAttribute(name)); 58 58 }, 59 59 60 60 copyPreferences : function() { 61 if (vI _main.preferences.getBoolPref("copySMIMESettings")) {61 if (vI.main.preferences.getBoolPref("copySMIMESettings")) { 62 62 // SMIME settings 63 vI _notificationBar.dump("## vI_account: copy S/MIME settings\n")64 vI_account._copyUnicharAttribute("signing_cert_name");65 vI_account._copyUnicharAttribute("encryption_cert_name");66 vI_account._copyIntAttribute("encryptionpolicy");63 vI.notificationBar.dump("## account: copy S/MIME settings\n") 64 account._copyUnicharAttribute("signing_cert_name"); 65 account._copyUnicharAttribute("encryption_cert_name"); 66 account._copyIntAttribute("encryptionpolicy"); 67 67 } 68 68 /* seems not required, encryption happens before Virtual Identity account is created 69 if (vI _main.preferences.getBoolPref("copyEnigmailSettings")) {69 if (vI.main.preferences.getBoolPref("copyEnigmailSettings")) { 70 70 // pgp/enigmail settings 71 vI _notificationBar.dump("## vI_account: copy PGP settings\n")72 vI_account._copyBoolAttribute("pgpSignEncrypted");73 vI_account._copyBoolAttribute("pgpSignPlain");74 vI_account._copyBoolAttribute("enablePgp");75 vI_account._copyIntAttribute("pgpKeyMode");76 vI_account._copyCharAttribute("pgpkeyId");77 vI_account._copyIntAttribute("openPgpHeaderMode");78 vI_account._copyCharAttribute("openPgpUrlName");79 80 vI_account._copyIntAttribute("defaultEncryptionPolicy");71 vI.notificationBar.dump("## account: copy PGP settings\n") 72 account._copyBoolAttribute("pgpSignEncrypted"); 73 account._copyBoolAttribute("pgpSignPlain"); 74 account._copyBoolAttribute("enablePgp"); 75 account._copyIntAttribute("pgpKeyMode"); 76 account._copyCharAttribute("pgpkeyId"); 77 account._copyIntAttribute("openPgpHeaderMode"); 78 account._copyCharAttribute("openPgpUrlName"); 79 80 account._copyIntAttribute("defaultEncryptionPolicy"); 81 81 } */ 82 if (vI _main.preferences.getBoolPref("copyAttachVCardSettings")) {82 if (vI.main.preferences.getBoolPref("copyAttachVCardSettings")) { 83 83 // attach vcard 84 vI _notificationBar.dump("## vI_account: copy VCard settings\n")85 vI_account._copyBoolAttribute("attachVCard");86 vI_account._copyCharAttribute("escapedVCard");84 vI.notificationBar.dump("## account: copy VCard settings\n") 85 account._copyBoolAttribute("attachVCard"); 86 account._copyCharAttribute("escapedVCard"); 87 87 } 88 88 }, … … 97 97 // recurse into all subdirectories 98 98 if (maildir.isDirectory() && 99 ! vI_account.__dirEmpty(maildir)) return false;99 !account.__dirEmpty(maildir)) return false; 100 100 // ignore files with ending "*.msf" 101 101 if (!maildir.path.match(new RegExp(".*\.msf$","i")) && … … 106 106 107 107 __cleanupDirectories : function() { 108 vI _notificationBar.dump("## vI_account: checking for leftover VirtualIdentity directories ")108 vI.notificationBar.dump("## account: checking for leftover VirtualIdentity directories ") 109 109 110 110 var file = Components.classes["@mozilla.org/file/directory_service;1"] … … 124 124 if (maildir.path.match(new RegExp("[/\\\\]virtualIdentity.*$","i"))) { 125 125 // should be empty, VirtualIdentity never uses those directories 126 if ( vI_account.__dirEmpty(maildir)) {126 if (account.__dirEmpty(maildir)) { 127 127 try {maildir.remove(true)} catch(e) { } 128 vI _notificationBar.dump("x");128 vI.notificationBar.dump("x"); 129 129 } 130 else vI _notificationBar.dump(".");130 else vI.notificationBar.dump("."); 131 131 132 132 } … … 134 134 } 135 135 } 136 vI _notificationBar.dump(" - done\n")136 vI.notificationBar.dump(" - done\n") 137 137 }, 138 138 139 139 cleanupSystem : function() { 140 vI _notificationBar.dump("## vI_account: checking for leftover VirtualIdentity accounts ")141 for (var i=0; i < vI_account.AccountManager.accounts.Count(); i++) {142 var account = vI_account.AccountManager.accounts.QueryElementAt(i, Components.interfaces.nsIMsgAccount);143 if ( vI_account.__isVIdentityAccount(account)) {144 vI _notificationBar.dump(".")145 vI_account.__removeAccount(account);140 vI.notificationBar.dump("## account: checking for leftover VirtualIdentity accounts ") 141 for (var i=0; i < account._AccountManager.accounts.Count(); i++) { 142 var checkAccount = account._AccountManager.accounts.QueryElementAt(i, Components.interfaces.nsIMsgAccount); 143 if (account.__isVIdentityAccount(checkAccount)) { 144 vI.notificationBar.dump(".") 145 account.__removeAccount(checkAccount); 146 146 } 147 147 } 148 vI _notificationBar.dump(" - done\n")149 vI_account.__cleanupDirectories();150 }, 151 152 __isVIdentityAccount : function( account) {148 vI.notificationBar.dump(" - done\n") 149 account.__cleanupDirectories(); 150 }, 151 152 __isVIdentityAccount : function(checkAccount) { 153 153 // check for new (post0.5.0) accounts, 154 try { vI_account.prefroot.getBoolPref("mail.account." + account.key + ".vIdentity");154 try { account._prefroot.getBoolPref("mail.account." + checkAccount.key + ".vIdentity"); 155 155 return true; 156 156 } catch (e) { }; 157 157 // check for old (pre 0.5.0) accounts 158 if ( account.incomingServer && account.incomingServer.hostName == "virtualIdentity") return true;158 if (checkAccount.incomingServer && checkAccount.incomingServer.hostName == "virtualIdentity") return true; 159 159 return false; 160 160 }, 161 161 162 __removeAccount : function(account) { 162 __removeAccount : function(checkAccount) { 163 vI.notificationBar.dump("## account: __removeAccount\n") 163 164 // in new (post 0.5.0) Virtual Identity accounts the incomingServer of the account 164 165 // points to an incoming server of a different account. Cause the internal 165 166 // removeAccount function tries to removes the incomingServer ether, create 166 167 // a real one before calling this function. 167 if (! account.incomingServer || account.incomingServer.hostName != "virtualIdentity") {168 if (!checkAccount.incomingServer || checkAccount.incomingServer.hostName != "virtualIdentity") { 168 169 // if not some of the 'old' accounts 169 account.incomingServer = vI_account.AccountManager.170 checkAccount.incomingServer = account._AccountManager. 170 171 createIncomingServer("toRemove","virtualIdentity","pop3"); 171 172 } 172 173 173 174 // remove the rootFolder of the account 174 try { account.incomingServer.rootFolder.Delete(); }175 try { checkAccount.incomingServer.rootFolder.Delete(); } 175 176 catch (e) { }; 176 177 177 var key = account.key;178 vI _notificationBar.dump("## vI_account: removing account " + key + ".\n")178 var key = checkAccount.key; 179 vI.notificationBar.dump("## account: removing account " + key + ".\n") 179 180 // remove the account 180 vI_account.AccountManager.removeAccount(account);181 account._AccountManager.removeAccount(checkAccount); 181 182 // remove the additional tagging-pref 182 try { vI_account.prefroot.clearUserPref("mail.account." + key + ".vIdentity"); }183 try { account._prefroot.clearUserPref("mail.account." + key + ".vIdentity"); } 183 184 catch (e) { }; 184 185 }, … … 192 193 var selectedMessages = (mailWindow.gFolderDisplay)?mailWindow.gFolderDisplay.selectedMessages:null; 193 194 } 194 if ( vI_account.account) {195 vI_account.__removeAccount(vI_account.account);196 vI_account.account = null;195 if (account._account) { 196 account.__removeAccount(account._account); 197 account._account = null; 197 198 } 198 199 try { … … 204 205 createAccount : function() 205 206 { 206 if ( vI_account.account) { // if the Account is still created, then leave all like it is207 if (account._account) { // if the Account is still created, then leave all like it is 207 208 alert("account still created, shouldn't happen"); 208 209 return; … … 210 211 /* 211 212 // the easiest way would be to get all requiered Attributes might be to duplicate the default account like this 212 var recentAccount = vI_account.AccountManager.getAccount(vI_main.elements.Obj_MsgIdentity.selectedItem.getAttribute("accountkey"));213 vI _main.VIdent_Account = vI_account.AccountManager.duplicateAccount(recentAccount);213 var recentAccount = account._AccountManager.getAccount(vI.main.elements.Obj_MsgIdentity.selectedItem.getAttribute("accountkey")); 214 vI.main.VIdent_Account = account._AccountManager.duplicateAccount(recentAccount); 214 215 // but this ends up in the following exception: 215 // "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIMsg AccountManager.duplicateAccount]"216 // "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIMsg_AccountManager.duplicateAccount]" 216 217 // so I have to do this by hand ;( 217 218 */ 218 219 219 vI_account.account = vI_account.AccountManager.createAccount();220 vI_account.prefroot.setBoolPref("mail.account." + vI_account.account.key + ".vIdentity", true)221 222 vI_account.account.addIdentity(vI_account.AccountManager.createIdentity());220 account._account = account._AccountManager.createAccount(); 221 account._prefroot.setBoolPref("mail.account." + account._account.key + ".vIdentity", true) 222 223 account._account.addIdentity(account._AccountManager.createIdentity()); 223 224 224 225 // the new account uses the same incomingServer than the base one, … … 226 227 // by pointing to the same incomingServer stored passwords can be reused 227 228 // the incomingServer has to be replaced before the account is removed, else it get removed ether 228 var servers = vI_account.AccountManager.GetServersForIdentity(vI_account._getBaseIdentity());229 var servers = account._AccountManager.GetServersForIdentity(account._getBaseIdentity()); 229 230 var server = servers.QueryElementAt(0, Components.interfaces.nsIMsgIncomingServer); 230 231 … … 233 234 // but we should restore it, because it's actually the same server as the one of the base identity 234 235 server.valid = false; 235 vI_account.account.incomingServer = server;236 account._account.incomingServer = server; 236 237 server.valid = true; 237 238 238 vI_account.copyMsgIdentityClone();239 vI_account.copyPreferences();240 vI_account.setupFcc();241 vI_account.setupDraft();242 vI_account.setupTemplates();239 account.copyMsgIdentityClone(); 240 account.copyPreferences(); 241 account.setupFcc(); 242 account.setupDraft(); 243 account.setupTemplates(); 243 244 }, 244 245 245 246 copyMsgIdentityClone : function() { 246 247 var identityData = document.getElementById("msgIdentity_clone").identityData; 247 vI_account.account.defaultIdentity.setCharAttribute("useremail", identityData.email);248 vI_account.account.defaultIdentity.setUnicharAttribute("fullName", identityData.fullName);249 250 vI_account.account.defaultIdentity.smtpServerKey = identityData.smtp.keyNice; // key with "" for vI_DEFAULT_SMTP_TAG251 252 vI _notificationBar.dump("## vI_account: Stored virtualIdentity (name "253 + vI_account.account.defaultIdentity.fullName + " email "254 + vI_account.account.defaultIdentity.email + " smtp "255 + vI_account.account.defaultIdentity.smtpServerKey +")\n");248 account._account.defaultIdentity.setCharAttribute("useremail", identityData.email); 249 account._account.defaultIdentity.setUnicharAttribute("fullName", identityData.fullName); 250 251 account._account.defaultIdentity.smtpServerKey = identityData.smtp.keyNice; // key with "" for vI.DEFAULT_SMTP_TAG 252 253 vI.notificationBar.dump("## account: Stored virtualIdentity (name " 254 + account._account.defaultIdentity.fullName + " email " 255 + account._account.defaultIdentity.email + " smtp " 256 + account._account.defaultIdentity.smtpServerKey +")\n"); 256 257 }, 257 258 … … 259 260 { 260 261 if (document.getElementById("fcc_switch").getAttribute("checked")) { 261 switch (vI _main.preferences.getCharPref("fccFolderPickerMode"))262 switch (vI.main.preferences.getCharPref("fccFolderPickerMode")) 262 263 { 263 264 case "2" : 264 vI _notificationBar.dump ("## vI_account: preparing Fcc --- use Settings of Default Account\n");265 vI_account.account.defaultIdentity.doFcc = vI_account.AccountManager.defaultAccount.defaultIdentity.doFcc;266 vI_account.account.defaultIdentity.fccFolder = vI_account.AccountManager.defaultAccount.defaultIdentity.fccFolder;267 vI_account.account.defaultIdentity.fccFolderPickerMode = vI_account.AccountManager.defaultAccount.defaultIdentity.fccFolderPickerMode;268 vI_account.account.defaultIdentity.fccReplyFollowsParent = vI_account.AccountManager.defaultAccount.defaultIdentity.fccReplyFollowsParent;265 vI.notificationBar.dump ("## account: preparing Fcc --- use Settings of Default Account\n"); 266 account._account.defaultIdentity.doFcc = account._AccountManager.defaultAccount.defaultIdentity.doFcc; 267 account._account.defaultIdentity.fccFolder = account._AccountManager.defaultAccount.defaultIdentity.fccFolder; 268 account._account.defaultIdentity.fccFolderPickerMode = account._AccountManager.defaultAccount.defaultIdentity.fccFolderPickerMode; 269 account._account.defaultIdentity.fccReplyFollowsParent = account._AccountManager.defaultAccount.defaultIdentity.fccReplyFollowsParent; 269 270 break; 270 271 case "3" : 271 vI _notificationBar.dump ("## vI_account: preparing Fcc --- use Settings of Modified Account\n");272 vI_account.account.defaultIdentity.doFcc = vI_account._getBaseIdentity().doFcc;273 vI_account.account.defaultIdentity.fccFolder = vI_account._getBaseIdentity().fccFolder;274 vI_account.account.defaultIdentity.fccFolderPickerMode = vI_account._getBaseIdentity().fccFolderPickerMode;275 vI_account.account.defaultIdentity.fccReplyFollowsParent = vI_account._getBaseIdentity().fccReplyFollowsParent;272 vI.notificationBar.dump ("## account: preparing Fcc --- use Settings of Modified Account\n"); 273 account._account.defaultIdentity.doFcc = account._getBaseIdentity().doFcc; 274 account._account.defaultIdentity.fccFolder = account._getBaseIdentity().fccFolder; 275 account._account.defaultIdentity.fccFolderPickerMode = account._getBaseIdentity().fccFolderPickerMode; 276 account._account.defaultIdentity.fccReplyFollowsParent = account._getBaseIdentity().fccReplyFollowsParent; 276 277 break; 277 278 default : 278 vI _notificationBar.dump ("## vI_account: preparing Fcc --- use Virtual Identity Settings\n");279 vI_account.account.defaultIdentity.doFcc280 = vI _main.preferences.getBoolPref("doFcc");281 vI_account.account.defaultIdentity.fccFolder282 = vI _main.unicodeConverter.ConvertToUnicode(vI_main.preferences.getCharPref("fccFolder"));283 vI_account.account.defaultIdentity.fccFolderPickerMode284 = vI _main.preferences.getCharPref("fccFolderPickerMode");285 vI_account.account.defaultIdentity.fccReplyFollowsParent = vI_main.preferences.getBoolPref("fccReplyFollowsParent");279 vI.notificationBar.dump ("## account: preparing Fcc --- use Virtual Identity Settings\n"); 280 account._account.defaultIdentity.doFcc 281 = vI.main.preferences.getBoolPref("doFcc"); 282 account._account.defaultIdentity.fccFolder 283 = vI.main.unicodeConverter.ConvertToUnicode(vI.main.preferences.getCharPref("fccFolder")); 284 account._account.defaultIdentity.fccFolderPickerMode 285 = vI.main.preferences.getCharPref("fccFolderPickerMode"); 286 account._account.defaultIdentity.fccReplyFollowsParent = vI.main.preferences.getBoolPref("fccReplyFollowsParent"); 286 287 287 288 break; … … 289 290 } 290 291 else { 291 dump ("## vI_account: dont performing Fcc\n");292 vI_account.account.defaultIdentity.doFcc = false;293 } 294 vI _notificationBar.dump("## vI_account: Stored (doFcc " + vI_account.account.defaultIdentity.doFcc + " fccFolder " +295 vI_account.account.defaultIdentity.fccFolder + " fccFolderPickerMode " +296 vI_account.account.defaultIdentity.fccFolderPickerMode + "(" +297 vI _main.preferences.getCharPref("fccFolderPickerMode") + "))\n");292 dump ("## account: dont performing Fcc\n"); 293 account._account.defaultIdentity.doFcc = false; 294 } 295 vI.notificationBar.dump("## account: Stored (doFcc " + account._account.defaultIdentity.doFcc + " fccFolder " + 296 account._account.defaultIdentity.fccFolder + " fccFolderPickerMode " + 297 account._account.defaultIdentity.fccFolderPickerMode + "(" + 298 vI.main.preferences.getCharPref("fccFolderPickerMode") + "))\n"); 298 299 }, 299 300 300 301 setupDraft : function() { 301 switch (vI _main.preferences.getCharPref("draftFolderPickerMode"))302 switch (vI.main.preferences.getCharPref("draftFolderPickerMode")) 302 303 { 303 304 case "2" : 304 vI _notificationBar.dump ("## vI_account: preparing Draft --- use Settings of Default Account\n");305 vI_account.account.defaultIdentity.draftFolder = vI_account.AccountManager.defaultAccount.defaultIdentity.draftFolder;306 vI_account.account.defaultIdentity.draftsFolderPickerMode = vI_account.AccountManager.defaultAccount.defaultIdentity.draftsFolderPickerMode;305 vI.notificationBar.dump ("## account: preparing Draft --- use Settings of Default Account\n"); 306 account._account.defaultIdentity.draftFolder = account._AccountManager.defaultAccount.defaultIdentity.draftFolder; 307 account._account.defaultIdentity.draftsFolderPickerMode = account._AccountManager.defaultAccount.defaultIdentity.draftsFolderPickerMode; 307 308 break; 308 309 case "3" : 309 vI _notificationBar.dump ("## vI_account: preparing Draft --- use Settings of Modified Account\n");310 vI_account.account.defaultIdentity.draftFolder = vI_account._getBaseIdentity().draftFolder;311 vI_account.account.defaultIdentity.draftsFolderPickerMode = vI_account._getBaseIdentity().draftsFolderPickerMode;310 vI.notificationBar.dump ("## account: preparing Draft --- use Settings of Modified Account\n"); 311 account._account.defaultIdentity.draftFolder = account._getBaseIdentity().draftFolder; 312 account._account.defaultIdentity.draftsFolderPickerMode = account._getBaseIdentity().draftsFolderPickerMode; 312 313 break; 313 314 default : 314 vI _notificationBar.dump ("## vI_account: preparing Draft --- use Virtual Identity Settings\n");315 vI_account.account.defaultIdentity.draftFolder316 = vI _main.unicodeConverter.ConvertToUnicode(vI_main.preferences.getCharPref("draftFolder"));317 vI_account.account.defaultIdentity.draftsFolderPickerMode318 = vI _main.preferences.getCharPref("draftFolderPickerMode");319 break; 320 } 321 vI _notificationBar.dump("## vI_account: Stored (draftFolder " +322 vI_account.account.defaultIdentity.draftFolder + " draftsFolderPickerMode " +323 vI_account.account.defaultIdentity.draftsFolderPickerMode + "(" +324 vI _main.preferences.getCharPref("draftFolderPickerMode") + "))\n");315 vI.notificationBar.dump ("## account: preparing Draft --- use Virtual Identity Settings\n"); 316 account._account.defaultIdentity.draftFolder 317 = vI.main.unicodeConverter.ConvertToUnicode(vI.main.preferences.getCharPref("draftFolder")); 318 account._account.defaultIdentity.draftsFolderPickerMode 319 = vI.main.preferences.getCharPref("draftFolderPickerMode"); 320 break; 321 } 322 vI.notificationBar.dump("## account: Stored (draftFolder " + 323 account._account.defaultIdentity.draftFolder + " draftsFolderPickerMode " + 324 account._account.defaultIdentity.draftsFolderPickerMode + "(" + 325 vI.main.preferences.getCharPref("draftFolderPickerMode") + "))\n"); 325 326 }, 326 327 327 328 setupTemplates : function() { 328 switch (vI _main.preferences.getCharPref("stationeryFolderPickerMode"))329 switch (vI.main.preferences.getCharPref("stationeryFolderPickerMode")) 329 330 { 330 331 case "2" : 331 vI _notificationBar.dump ("## vI_account: preparing Templates --- use Settings of Default Account\n");332 vI_account.account.defaultIdentity.stationeryFolder = vI_account.AccountManager.defaultAccount.defaultIdentity.stationeryFolder;333 vI_account.account.defaultIdentity.tmplFolderPickerMode = vI_account.AccountManager.defaultAccount.defaultIdentity.tmplFolderPickerMode;332 vI.notificationBar.dump ("## account: preparing Templates --- use Settings of Default Account\n"); 333 account._account.defaultIdentity.stationeryFolder = account._AccountManager.defaultAccount.defaultIdentity.stationeryFolder; 334 account._account.defaultIdentity.tmplFolderPickerMode = account._AccountManager.defaultAccount.defaultIdentity.tmplFolderPickerMode; 334 335 break; 335 336 case "3" : 336 vI _notificationBar.dump ("## vI_account: preparing Templates --- use Settings of Modified Account\n");337 vI_account.account.defaultIdentity.stationeryFolder = vI_account._getBaseIdentity().stationeryFolder;338 vI_account.account.defaultIdentity.tmplFolderPickerMode = vI_account._getBaseIdentity().tmplFolderPickerMode;337 vI.notificationBar.dump ("## account: preparing Templates --- use Settings of Modified Account\n"); 338 account._account.defaultIdentity.stationeryFolder = account._getBaseIdentity().stationeryFolder; 339 account._account.defaultIdentity.tmplFolderPickerMode = account._getBaseIdentity().tmplFolderPickerMode; 339 340 break; 340 341 default : 341 vI _notificationBar.dump ("## vI_account: preparing Templates --- use Virtual Identity Settings\n");342 vI_account.account.defaultIdentity.stationeryFolder343 = vI _main.unicodeConverter.ConvertToUnicode(vI_main.preferences.getCharPref("stationeryFolder"));344 vI_account.account.defaultIdentity.tmplFolderPickerMode345 = vI _main.preferences.getCharPref("stationeryFolderPickerMode");346 break; 347 } 348 vI _notificationBar.dump("## vI_account: Stored (stationeryFolder " +349 vI_account.account.defaultIdentity.stationeryFolder + " tmplFolderPickerMode " +350 vI_account.account.defaultIdentity.tmplFolderPickerMode + "(" +351 vI _main.preferences.getCharPref("stationeryFolderPickerMode") + "))\n");342 vI.notificationBar.dump ("## account: preparing Templates --- use Virtual Identity Settings\n"); 343 account._account.defaultIdentity.stationeryFolder 344 = vI.main.unicodeConverter.ConvertToUnicode(vI.main.preferences.getCharPref("stationeryFolder")); 345 account._account.defaultIdentity.tmplFolderPickerMode 346 = vI.main.preferences.getCharPref("stationeryFolderPickerMode"); 347 break; 348 } 349 vI.notificationBar.dump("## account: Stored (stationeryFolder " + 350 account._account.defaultIdentity.stationeryFolder + " tmplFolderPickerMode " + 351 account._account.defaultIdentity.tmplFolderPickerMode + "(" + 352 vI.main.preferences.getCharPref("stationeryFolderPickerMode") + "))\n"); 352 353 } 353 354 } 355 vI.account = account; 356 }}); -
chrome/content/v_identity/vI_am-Overlay.js
r92fd25 rc3feaa 23 23 * ***** END LICENSE BLOCK ***** */ 24 24 25 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 25 26 function orig_onAccept() {}; 26 27 var vI_am_Overlay = { 27 var am_Overlay = { 28 28 onAccept : function(aServerKeyToSelect, aFocusList) { 29 29 orig_onAccept(); … … 35 35 init : function() { 36 36 orig_onAccept = onAccept; 37 onAccept = vI_am_Overlay.onAccept;37 onAccept = am_Overlay.onAccept; 38 38 } 39 39 } 40 window.addEventListener('load', vI_am_Overlay.init, false); 40 window.addEventListener('load', am_Overlay.init, false); 41 }}); -
chrome/content/v_identity/vI_am-smtpOverlay.js
r92fd25 rc3feaa 23 23 * ***** END LICENSE BLOCK ***** */ 24 24 25 var vI_am_smtpOverlay = { 25 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 26 var am_smtpOverlay = { 26 27 refreshServerList : function(aServerKeyToSelect, aFocusList) { 27 28 gSmtpServerListWindow.orig_refreshServerList(aServerKeyToSelect, aFocusList); … … 33 34 init : function() { 34 35 gSmtpServerListWindow.orig_refreshServerList = gSmtpServerListWindow.refreshServerList; 35 gSmtpServerListWindow.refreshServerList = vI_am_smtpOverlay.refreshServerList;36 gSmtpServerListWindow.refreshServerList = am_smtpOverlay.refreshServerList; 36 37 } 37 38 } 38 window.addEventListener('load', vI_am_smtpOverlay.init, false); 39 window.addEventListener('load', am_smtpOverlay.init, false); 40 }}); -
chrome/content/v_identity/vI_context.xul
r92fd25 rc3feaa 34 34 35 35 <overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 36 <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDatasource.js" /> 36 37 <script type="application/x-javascript"> 38 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 37 39 var vI_context = { 38 40 prefroot : Components.classes["@mozilla.org/preferences-service;1"] … … 54 56 vI_context.prefroot.removeObserver("extensions.virtualIdentity.menu_entry", vI_context, false); 55 57 }, false); 58 }}); 59 dump('context: ' + virtualIdentityExtension.initTime + '\n'); 56 60 </script> 57 61 … … 65 69 <menuitem label="&vident.vI_Menu.DataEditor.label;" 66 70 oncommand="window.open('chrome://v_identity/content/vI_rdfDataTree.xul', '', 'chrome, dialog, resizable=yes');" /> 67 <menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand=" var vI_localRdfDatasource = new vI_rdfDatasourceImporter('virtualIdentity.rdf');"/>68 <menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand=" var vI_localRdfDatasource = new vI_rdfDatasource(); vI_localRdfDatasource.export('virtualIdentity.rdf')"/>71 <menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="dump('command: ' + virtualIdentityExtension.initTime + '\n');var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasourceImporter('virtualIdentity.rdf');"/> 72 <menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand="dump('command: ' + virtualIdentityExtension.initTime + '\n');var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasource(); vI_localRdfDatasource.export('virtualIdentity.rdf')"/> 69 73 </menupopup> 70 74 </menu> -
chrome/content/v_identity/vI_getHeader.js
r92fd25 rc3feaa 39 39 */ 40 40 41 var vI_getHeader = { 41 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 42 var getHeader = { 42 43 messenger: null, 43 44 preferences : Components.classes["@mozilla.org/preferences-service;1"] … … 53 54 54 55 prepareHeaderToSearchArray : function() { 55 var headerList = vI_getHeader.unicodeConverter.ConvertToUnicode(vI_getHeader.preferences.getCharPref("smart_reply_headers")).split(/\n/)56 57 vI_getHeader.headerToSearch = [];56 var headerList = getHeader.unicodeConverter.ConvertToUnicode(getHeader.preferences.getCharPref("smart_reply_headers")).split(/\n/) 57 58 getHeader.headerToSearch = []; 58 59 59 60 // prepare headerToSearch for speedup. … … 67 68 68 69 // create header name to store the value 69 var headerNameToStore = "vI _" + headerNameToSearch70 var headerNameToStore = "vI." + headerNameToSearch 70 71 if (!isNaN(headerNumberToSearch)) headerNameToStore += ":" + headerNumberToSearch 71 72 72 vI_getHeader.headerToSearch.push({ headerNameToSearch : headerNameToSearch, headerNumberToSearch : headerNumberToSearch,73 getHeader.headerToSearch.push({ headerNameToSearch : headerNameToSearch, headerNumberToSearch : headerNumberToSearch, 73 74 headerNameToStore : headerNameToStore }); 74 75 } … … 80 81 81 82 getHeader: function(hdr) { 82 vI _notificationBar.clear_dump()83 vI.notificationBar.clear_dump() 83 84 var index; 84 85 85 if (! vI_getHeader.headerToSearch) vI_getHeader.prepareHeaderToSearchArray()86 if (!getHeader.headerToSearch) getHeader.prepareHeaderToSearchArray() 86 87 87 88 var found = false; var label = ""; 88 var subtitle = vI_getHeader.strings.getString("vident.getHeader.noHeader");89 var subtitle = getHeader.strings.getString("vident.getHeader.noHeader"); 89 90 // create array to count the header 90 91 var currentHeadersCounter = []; 91 92 92 var vI_listId = false; var vI_received = false; var vI_content_base = false;93 var listId = false; var received = false; var content_base = false; 93 94 for (var header in currentHeaderData) { 94 95 var headerName = currentHeaderData[header].headerName.toLowerCase(); 95 // vI _notificationBar.dump("## vI_getHeader: found header: " + currentHeaderData[header].headerName + "\n");96 // vI.notificationBar.dump("## getHeader: found header: " + currentHeaderData[header].headerName + "\n"); 96 97 97 98 // remember list-id header to prevent using Mailing-List addresses as sender 98 if (! vI_listId && headerName == "list-id") {99 hdr.setStringProperty("vI_list-id","found"); vI_listId = true;100 vI _notificationBar.dump("## vI_getHeader: found header: list-id ...stored to recognize mailing-list\n");99 if (!listId && headerName == "list-id") { 100 hdr.setStringProperty("vI_list-id","found"); listId = true; 101 vI.notificationBar.dump("## getHeader: found header: list-id ...stored to recognize mailing-list\n"); 101 102 // continue; 102 103 } 103 104 104 105 // remember received header to prevent using Mailing-List addresses as sender 105 if (! vI_received && headerName == "received") {106 hdr.setStringProperty("vI_received","found"); vI_received = true;107 vI _notificationBar.dump("## vI_getHeader: found header: received ...stored to recognize received mail\n");106 if (!received && headerName == "received") { 107 hdr.setStringProperty("vI_received","found"); received = true; 108 vI.notificationBar.dump("## getHeader: found header: received ...stored to recognize received mail\n"); 108 109 // continue; 109 110 } 110 111 111 112 // remember content-base header to prevent using Blog/News-Feed addresses as sender 112 if (! vI_content_base && headerName == "content-base") {113 hdr.setStringProperty("vI_content_base","found"); vI_content_base = true;114 vI _notificationBar.dump("## vI_getHeader: found header: content-base ...stored to recognize blog/news-feed\n");113 if (!content_base && headerName == "content-base") { 114 hdr.setStringProperty("vI_content_base","found"); content_base = true; 115 vI.notificationBar.dump("## getHeader: found header: content-base ...stored to recognize blog/news-feed\n"); 115 116 // continue; 116 117 } … … 119 120 else currentHeadersCounter[headerName] = 1 120 121 121 for (var index = 0; index < vI_getHeader.headerToSearch.length; index++) {122 if (headerName == vI_getHeader.headerToSearch[index].headerNameToSearch &&123 (isNaN( vI_getHeader.headerToSearch[index].headerNumberToSearch) ||124 vI_getHeader.headerToSearch[index].headerNumberToSearch == currentHeadersCounter[headerName])) {122 for (var index = 0; index < getHeader.headerToSearch.length; index++) { 123 if (headerName == getHeader.headerToSearch[index].headerNameToSearch && 124 (isNaN(getHeader.headerToSearch[index].headerNumberToSearch) || 125 getHeader.headerToSearch[index].headerNumberToSearch == currentHeadersCounter[headerName])) { 125 126 126 127 var value = currentHeaderData[header].headerValue; 127 128 if (currentHeadersCounter[headerName] != 1) 128 value = hdr.getStringProperty( vI_getHeader.headerToSearch[index].headerNameToStore) +129 value = hdr.getStringProperty(getHeader.headerToSearch[index].headerNameToStore) + 129 130 ", " + value; 130 hdr.setStringProperty( vI_getHeader.headerToSearch[index].headerNameToStore,vI_getHeader.unicodeConverter.ConvertFromUnicode(value) + vI_getHeader.unicodeConverter.Finish());131 132 var storedValue = hdr.getProperty( vI_getHeader.headerToSearch[index].headerNameToStore)133 var storedConvValue = vI_getHeader.unicodeConverter.ConvertToUnicode(storedValue)134 vI _notificationBar.dump("## vI_getHeader: found header: " + headerName +131 hdr.setStringProperty(getHeader.headerToSearch[index].headerNameToStore,getHeader.unicodeConverter.ConvertFromUnicode(value) + getHeader.unicodeConverter.Finish()); 132 133 var storedValue = hdr.getProperty(getHeader.headerToSearch[index].headerNameToStore) 134 var storedConvValue = getHeader.unicodeConverter.ConvertToUnicode(storedValue) 135 vI.notificationBar.dump("## getHeader: found header: " + headerName + 135 136 "[:" + currentHeadersCounter[headerName] + "] - stored as '" + 136 137 storedConvValue + "'\n"); 137 138 if (!found) { 138 subtitle = vI_getHeader.strings.getString("vident.getHeader.headerFound");139 subtitle = getHeader.strings.getString("vident.getHeader.headerFound"); 139 140 found = true; 140 141 } … … 146 147 } 147 148 } 148 vI _notificationBar.setNote(label, "get_header_notification", subtitle);149 vI.notificationBar.setNote(label, "get_header_notification", subtitle); 149 150 }, 150 151 151 152 hideExtraHeader: function() { 152 var addedHdrs = vI_prepareHeader.prefroot.getCharPref("extensions.virtualIdentity.smart_reply_added_extraHeaders").split(/ /);153 var addedHdrs = prepareHeader.prefroot.getCharPref("extensions.virtualIdentity.smart_reply_added_extraHeaders").split(/ /); 153 154 for (var index = 0; index < addedHdrs.length; index++) { 154 155 var header_to_search_splitted=addedHdrs[index].split(/:/) … … 167 168 setupEventListener: function() { 168 169 var listener = {}; 169 listener.onStartHeaders = vI_getHeader.hideExtraHeader;170 listener.onEndHeaders = vI_getHeader.getHeaderDummy;170 listener.onStartHeaders = getHeader.hideExtraHeader; 171 listener.onEndHeaders = getHeader.getHeaderDummy; 171 172 gMessageListeners.push(listener); 172 173 173 vI_getHeader.messenger = Components.classes["@mozilla.org/messenger;1"].createInstance();174 vI_getHeader.messenger = vI_getHeader.messenger.QueryInterface(Components.interfaces.nsIMessenger);175 vI_getHeader.strings = document.getElementById("vIdentBundle");176 177 vI_getHeader.unicodeConverter.charset = "UTF-8";174 getHeader.messenger = Components.classes["@mozilla.org/messenger;1"].createInstance(); 175 getHeader.messenger = getHeader.messenger.QueryInterface(Components.interfaces.nsIMessenger); 176 getHeader.strings = document.getElementById("vIdentBundle"); 177 178 getHeader.unicodeConverter.charset = "UTF-8"; 178 179 179 180 // read headers later if msg is loaded completely - this ensures compatibility to Thunderbird Conversation 180 vI_getHeader.orig_OnMsgLoaded = OnMsgLoaded;181 OnMsgLoaded = vI_getHeader.OnMsgLoaded;181 getHeader.orig_OnMsgLoaded = OnMsgLoaded; 182 OnMsgLoaded = getHeader.OnMsgLoaded; 182 183 }, 183 184 … … 191 192 192 193 var msgHdr = neckoURL.messageHeader; 193 if (msgHdr) vI_getHeader.getHeader(msgHdr);194 vI_getHeader.orig_OnMsgLoaded(url)194 if (msgHdr) getHeader.getHeader(msgHdr); 195 getHeader.orig_OnMsgLoaded(url) 195 196 } 196 197 } 197 198 198 199 199 var vI_prepareHeader = {200 var prepareHeader = { 200 201 prefroot : Components.classes["@mozilla.org/preferences-service;1"] 201 202 .getService(Components.interfaces.nsIPrefService) … … 208 209 209 210 init : function() { 210 vI_prepareHeader.orig_initializeHeaderViewTables = initializeHeaderViewTables;211 initializeHeaderViewTables = vI_prepareHeader.replacement_initializeHeaderViewTables;212 if ( vI_prepareHeader.addExtraHeader()) vI_prepareHeader.addObserver();211 prepareHeader.orig_initializeHeaderViewTables = initializeHeaderViewTables; 212 initializeHeaderViewTables = prepareHeader.replacement_initializeHeaderViewTables; 213 if (prepareHeader.addExtraHeader()) prepareHeader.addObserver(); 213 214 }, 214 215 215 216 replacement_initializeHeaderViewTables : function() { 216 vI_prepareHeader.cleanup();217 vI _notificationBar.dump("## vI_getHeader: initializeHeaderViewTables\n");218 vI_prepareHeader.orig_initializeHeaderViewTables();219 if ( vI_prepareHeader.addExtraHeader()) vI_prepareHeader.addObserver();217 prepareHeader.cleanup(); 218 vI.notificationBar.dump("## getHeader: initializeHeaderViewTables\n"); 219 prepareHeader.orig_initializeHeaderViewTables(); 220 if (prepareHeader.addExtraHeader()) prepareHeader.addObserver(); 220 221 }, 221 222 222 223 cleanup : function() { 223 vI_prepareHeader.removeObserver();224 vI_prepareHeader.removeExtraHeader();224 prepareHeader.removeObserver(); 225 prepareHeader.removeExtraHeader(); 225 226 }, 226 227 227 228 addObserver : function() { 228 if ( vI_prepareHeader.observer_added) return;229 vI_prepareHeader.prefroot.QueryInterface(Components.interfaces.nsIPrefBranch2);230 vI_prepareHeader.prefroot.addObserver("extensions.virtualIdentity.smart_reply_headers", this, false);231 vI_prepareHeader.uninstallObserver.register();232 vI_prepareHeader.observer_added = true;229 if (prepareHeader.observer_added) return; 230 prepareHeader.prefroot.QueryInterface(Components.interfaces.nsIPrefBranch2); 231 prepareHeader.prefroot.addObserver("extensions.virtualIdentity.smart_reply_headers", this, false); 232 prepareHeader.uninstallObserver.register(); 233 prepareHeader.observer_added = true; 233 234 }, 234 235 235 236 removeObserver : function() { 236 if (! vI_prepareHeader.observer_added) return;237 vI_prepareHeader.prefroot.removeObserver("extensions.virtualIdentity.smart_reply_headers", this);238 vI_prepareHeader.uninstallObserver.unregister();239 vI_prepareHeader.observer_added = false;237 if (!prepareHeader.observer_added) return; 238 prepareHeader.prefroot.removeObserver("extensions.virtualIdentity.smart_reply_headers", this); 239 prepareHeader.uninstallObserver.unregister(); 240 prepareHeader.observer_added = false; 240 241 }, 241 242 242 243 // this is a adapted copy of enigEnsureExtraHeaders() from enigmail, thanks 243 244 addExtraHeader : function() { 244 vI_prepareHeader.unicodeConverter.charset = "UTF-8";245 var header_list = vI_prepareHeader.unicodeConverter.ConvertToUnicode(vI_prepareHeader.prefroot.getCharPref("extensions.virtualIdentity.smart_reply_headers")).split(/\n/)245 prepareHeader.unicodeConverter.charset = "UTF-8"; 246 var header_list = prepareHeader.unicodeConverter.ConvertToUnicode(prepareHeader.prefroot.getCharPref("extensions.virtualIdentity.smart_reply_headers")).split(/\n/) 246 247 247 248 // add List-Id to recognizable headers to prevent using Mailing-List addresses as sender … … 256 257 // try { 257 258 var extraHdrs = " " + 258 vI_prepareHeader.prefroot.getCharPref("mailnews.headers.extraExpandedHeaders").toLowerCase();259 260 var addedHeaders = vI_prepareHeader.prefroot.getCharPref("extensions.virtualIdentity.smart_reply_added_extraHeaders");259 prepareHeader.prefroot.getCharPref("mailnews.headers.extraExpandedHeaders").toLowerCase(); 260 261 var addedHeaders = prepareHeader.prefroot.getCharPref("extensions.virtualIdentity.smart_reply_added_extraHeaders"); 261 262 262 263 for (var index = 0; index < header_list.length; index++) { … … 273 274 for (var j = 0; j < gCollapsedHeaderList.length; j++) { 274 275 if (gCollapsedHeaderList[j].name == headerToSearch) { 275 // vI _notificationBar.dump("## vI_prepareHeader: Header '" + headerToSearch + "' in gCollapsedHeaderList\n");276 // vI.notificationBar.dump("## prepareHeader: Header '" + headerToSearch + "' in gCollapsedHeaderList\n"); 276 277 found = true; break; 277 278 } … … 283 284 for (var j = 0; j < gExpandedHeaderList.length; j++) { 284 285 if (gExpandedHeaderList[j].name == headerToSearch) { 285 // vI _notificationBar.dump("## vI_prepareHeader: Header '" + headerToSearch + "' in gExpandedHeaderList\n");286 // vI.notificationBar.dump("## prepareHeader: Header '" + headerToSearch + "' in gExpandedHeaderList\n"); 286 287 found = true; break; 287 288 } … … 292 293 (addedHeaders.indexOf(" " + headerToSearch + " ") < 0)) 293 294 addedHeaders += " " + headerToSearch; 294 // else vI _notificationBar.dump("## vI_prepareHeader: Header '" + headerToSearch + "' already in extraExpandedHeaders\n");295 // else vI.notificationBar.dump("## prepareHeader: Header '" + headerToSearch + "' already in extraExpandedHeaders\n"); 295 296 } 296 297 … … 299 300 extraHdrs += " " + addedHeaders; 300 301 extraHdrs = extraHdrs.replace(/^\s+|\s+$/g,"") 301 vI_prepareHeader.prefroot.setCharPref("mailnews.headers.extraExpandedHeaders", extraHdrs)302 vI_prepareHeader.prefroot.setCharPref("extensions.virtualIdentity.smart_reply_added_extraHeaders", addedHeaders)303 vI _notificationBar.dump("## vI_prepareHeader: extraExpandedHeaders '" + addedHeaders + "' added\n");302 prepareHeader.prefroot.setCharPref("mailnews.headers.extraExpandedHeaders", extraHdrs) 303 prepareHeader.prefroot.setCharPref("extensions.virtualIdentity.smart_reply_added_extraHeaders", addedHeaders) 304 vI.notificationBar.dump("## prepareHeader: extraExpandedHeaders '" + addedHeaders + "' added\n"); 304 305 } 305 306 … … 307 308 // } 308 309 // catch (e) { 309 // vI _notificationBar.dump("## vI_prepareHeader: your application is too old, please update. Otherwise try to install mnenhy or enigmail to use additional headers.")310 // vI.notificationBar.dump("## prepareHeader: your application is too old, please update. Otherwise try to install mnenhy or enigmail to use additional headers.") 310 311 // return false; 311 312 // } … … 313 314 314 315 removeExtraHeader: function() { 315 vI _notificationBar.dump("## vI_prepareHeader: cleanupExtraHeader\n");316 317 var addedHdrs = vI_prepareHeader.prefroot.getCharPref("extensions.virtualIdentity.smart_reply_added_extraHeaders").split(/ /);316 vI.notificationBar.dump("## prepareHeader: cleanupExtraHeader\n"); 317 318 var addedHdrs = prepareHeader.prefroot.getCharPref("extensions.virtualIdentity.smart_reply_added_extraHeaders").split(/ /); 318 319 319 320 if (addedHdrs.length > 0) { 320 var extraHdrs = vI_prepareHeader.prefroot.getCharPref("mailnews.headers.extraExpandedHeaders").toLowerCase().split(/ /);321 var extraHdrs = prepareHeader.prefroot.getCharPref("mailnews.headers.extraExpandedHeaders").toLowerCase().split(/ /); 321 322 322 323 for (var i = 0; i < addedHdrs.length; i++) { … … 328 329 } 329 330 } 330 vI _notificationBar.dump("## vI_prepareHeader: extraExpandedHeaders '" + addedHdrs.join(" ") + "' removed\n");331 vI_prepareHeader.prefroot.setCharPref("mailnews.headers.extraExpandedHeaders", extraHdrs.join(" "))332 vI_prepareHeader.prefroot.setCharPref("extensions.virtualIdentity.smart_reply_added_extraHeaders", "")331 vI.notificationBar.dump("## prepareHeader: extraExpandedHeaders '" + addedHdrs.join(" ") + "' removed\n"); 332 prepareHeader.prefroot.setCharPref("mailnews.headers.extraExpandedHeaders", extraHdrs.join(" ")) 333 prepareHeader.prefroot.setCharPref("extensions.virtualIdentity.smart_reply_added_extraHeaders", "") 333 334 } 334 335 }, … … 336 337 observe: function(subject, topic, data) { 337 338 if (topic == "nsPref:changed") { 338 vI_prepareHeader.removeExtraHeader();339 vI_prepareHeader.addExtraHeader();340 vI _notificationBar.dump("## vI_prepareHeader: changed preference '" + subject + " " + topic + " " + data + "'\n");339 prepareHeader.removeExtraHeader(); 340 prepareHeader.addExtraHeader(); 341 vI.notificationBar.dump("## prepareHeader: changed preference '" + subject + " " + topic + " " + data + "'\n"); 341 342 342 343 // remove (old) prepared headerArray 343 vI_getHeader.headerToSearch = null;344 345 vI _notificationBar.dump("## vI_prepareHeader: reload Message\n");344 getHeader.headerToSearch = null; 345 346 vI.notificationBar.dump("## prepareHeader: reload Message\n"); 346 347 MsgReload(); 347 348 } … … 354 355 if (topic == "quit-application-granted") { 355 356 /* uninstall stuff. */ 356 vI _notificationBar.dump("## vI_uninstall: uninstall/disabledment \n");357 vI_prepareHeader.removeExtraHeader();358 vI _notificationBar.dump("## vI_uninstall: uninstall/disablement done\n");357 vI.notificationBar.dump("## vI.uninstall: uninstall/disabledment \n"); 358 prepareHeader.removeExtraHeader(); 359 vI.notificationBar.dump("## vI.uninstall: uninstall/disablement done\n"); 359 360 this.unregister(); 360 361 } … … 372 373 } 373 374 } 374 375 addEventListener('messagepane-loaded', vI_getHeader.setupEventListener, true); 376 window.addEventListener("load", function(e) { vI_prepareHeader.init(); }, false); 377 window.addEventListener("unload", function(e) { vI_prepareHeader.cleanup(); }, false); 378 // window.addEventListener("load", initializeOverlay, false); 375 addEventListener('messagepane-loaded', getHeader.setupEventListener, true); 376 window.addEventListener("load", function(e) { prepareHeader.init(); }, false); 377 window.addEventListener("unload", function(e) { prepareHeader.cleanup(); }, false); 378 }}); -
chrome/content/v_identity/vI_getHeader.xul
r92fd25 rc3feaa 34 34 35 35 <overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 36 37 <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" /> 36 38 <script type="application/x-javascript" src="chrome://v_identity/content/vI_getHeader.js"/> 37 39 <script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/> -
chrome/content/v_identity/vI_helper.js
r92fd25 rc3feaa 23 23 * ***** END LICENSE BLOCK ***** */ 24 24 25 var vI_helper = { 25 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 26 var helper = { 26 27 // simplified versionChecker, type is "TB" or "SM" 27 28 // returns true if appVersion is smaller or equal version … … 53 54 54 55 extensionActive : function (extensionID) { 55 // new AddonManager uses asynchronous calls, therefore status is pre-stored in vI _upgradeOverlay.js56 // new AddonManager uses asynchronous calls, therefore status is pre-stored in vI.upgradeOverlay.js 56 57 try { 57 58 var prefroot = Components.classes["@mozilla.org/preferences-service;1"] … … 62 63 } 63 64 } 65 vI.helper = helper; 66 }}); -
chrome/content/v_identity/vI_htmlTextBox.xml
r92fd25 rc3feaa 44 44 <xul:browser xbl:inherits="src=url" type="content" class="vI_htmlTextBox" hidden="true" flex="1" disablehistory="true" /> 45 45 <xul:button xbl:inherits="tooltiptext=url" label="&vI_prefDialog.openHelpInBrowserButton.label;" 46 oncommand="v I_prefDialog.openURL(this.tooltipText); vI_prefDialog.toggleHelp();" />46 oncommand="virtualIdentityExtension.prefDialog.openURL(this.tooltipText); virtualIdentityExtension.prefDialog.toggleHelp();" /> 47 47 </xul:vbox> 48 48 </content> -
chrome/content/v_identity/vI_identityData.js
r92fd25 rc3feaa 23 23 * ***** END LICENSE BLOCK ***** */ 24 24 25 function vI_identityData(email, fullName, id, smtp, extras, sideDescription, existingID) { 25 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 26 function identityData(email, fullName, id, smtp, extras, sideDescription, existingID) { 26 27 this._email = email?email:""; 27 28 this._emailParsed = false; 28 29 this._fullName = fullName?fullName:""; 29 this.id = new vI_idObj(id);30 this.smtp = new vI_smtpObj(smtp);31 this.extras = extras?extras:new vI _storageExtras();30 this.id = new idObj(id); 31 this.smtp = new smtpObj(smtp); 32 this.extras = extras?extras:new vI.storageExtras(); 32 33 this.comp = { // holds the results of the last comparison for later creation of a compareMatrix 33 34 compareID : null, … … 39 40 this.stringBundle = document.getElementById("vIdentBundle"); 40 41 } 41 vI_identityData.prototype = {42 identityData.prototype = { 42 43 _email : null, // internal email-field might contain combinedName (until first queried via email) 43 44 _fullName : null, … … 58 59 this._fullName += RegExp.leftContext + RegExp.rightContext; 59 60 this._email = RegExp.lastMatch; 60 // vI _notificationBar.dump("## vI_identityData: parseEmail _fullName = '" + this._fullName + "'\n");61 // vI _notificationBar.dump("## vI_identityData: parseEmail _email = '" + this._email + "'\n");61 // vI.notificationBar.dump("## identityData: parseEmail _fullName = '" + this._fullName + "'\n"); 62 // vI.notificationBar.dump("## identityData: parseEmail _email = '" + this._email + "'\n"); 62 63 } 63 64 this._emailParsed = true; … … 70 71 71 72 cleanName : function(fullName) { 72 // vI _notificationBar.dump("## vI_identityData: cleanName init '" + fullName + "'\n");73 // vI.notificationBar.dump("## identityData: cleanName init '" + fullName + "'\n"); 73 74 var _fullName = fullName.replace(/^\s+|\s+$/g,""); 74 75 if (_fullName.search(/^\".+\"$|^'.+'$/g) != -1) { 75 76 _fullName = this.cleanName(_fullName.replace(/^\"(.+)\"$|^'(.+)'$/g,"$1$2")); 76 77 } 77 // vI _notificationBar.dump("## vI_identityData: cleanName done '" + _fullName + "'\n");78 // vI.notificationBar.dump("## identityData: cleanName done '" + _fullName + "'\n"); 78 79 return _fullName; 79 80 }, … … 105 106 // creates an Duplicate of the current IdentityData, cause usually we are working with a pointer 106 107 getDuplicate : function() { 107 return new vI_identityData(this.email, this.fullName, this.id.key, this.smtp.key, this.extras.getDuplicate(), this.sideDescription, this.existingID);108 return new identityData(this.email, this.fullName, this.id.key, this.smtp.key, this.extras.getDuplicate(), this.sideDescription, this.existingID); 108 109 }, 109 110 … … 120 121 // dependent on MsgComposeCommands, should/will only be called in ComposeDialog 121 122 isExistingIdentity : function(ignoreFullNameWhileComparing) { 122 vI _notificationBar.dump("## vI_identityData: isExistingIdentity: ignoreFullNameWhileComparing='" + ignoreFullNameWhileComparing + "'\n");123 // vI _notificationBar.dump("## vI_identityData base: fullName.toLowerCase()='" + this.fullName + "' email.toLowerCase()='" + this.email + "' smtp='" + this.smtp.key + "'\n");123 vI.notificationBar.dump("## identityData: isExistingIdentity: ignoreFullNameWhileComparing='" + ignoreFullNameWhileComparing + "'\n"); 124 // vI.notificationBar.dump("## identityData base: fullName.toLowerCase()='" + this.fullName + "' email.toLowerCase()='" + this.email + "' smtp='" + this.smtp.key + "'\n"); 124 125 125 126 var ignoreFullNameMatchKey = null; … … 128 129 for (var i in accounts) { 129 130 // skip possible active VirtualIdentity Accounts 130 try { vI _account.prefroot.getBoolPref("mail.account."+accounts[i].key+".vIdentity"); continue; } catch (e) { };131 try { vI.account.prefroot.getBoolPref("mail.account."+accounts[i].key+".vIdentity"); continue; } catch (e) { }; 131 132 132 133 var identities = queryISupportsArray(accounts[i].identities, Components.interfaces.nsIMsgIdentity); 133 134 for (var j in identities) { 134 // vI _notificationBar.dump("## vI_identityData comp: fullName.toLowerCase()='" + identities[j].fullName.toLowerCase() + "' email.toLowerCase()='" + identities[j].email.toLowerCase() + "' smtp='" + identities[j].smtpServerKey + "'\n");135 // vI.notificationBar.dump("## identityData comp: fullName.toLowerCase()='" + identities[j].fullName.toLowerCase() + "' email.toLowerCase()='" + identities[j].email.toLowerCase() + "' smtp='" + identities[j].smtpServerKey + "'\n"); 135 136 var email = this.email?this.email:""; // might be null if no identity is set 136 137 var idEmail = identities[j].email?identities[j].email:""; // might be null if no identity is set 137 138 if ( (email.toLowerCase() == idEmail.toLowerCase()) && 138 this.smtp.equal(new vI_smtpObj(identities[j].smtpServerKey)) ) {139 this.smtp.equal(new smtpObj(identities[j].smtpServerKey)) ) { 139 140 // if fullName matches, than this is a final match 140 141 if ( this.fullName.toLowerCase() == identities[j].fullName.toLowerCase() ) { 141 vI _notificationBar.dump("## vI_identityData: isExistingIdentity: " + this.combinedName + " found, id='" + identities[j].key + "'\n");142 vI.notificationBar.dump("## identityData: isExistingIdentity: " + this.combinedName + " found, id='" + identities[j].key + "'\n"); 142 143 return identities[j].key; // return key and stop searching 143 144 } … … 149 150 150 151 if ( ignoreFullNameWhileComparing && ignoreFullNameMatchKey ) { 151 vI _notificationBar.dump("## vI_identityData: isExistingIdentity: " + this.combinedName + " found, id='" + ignoreFullNameMatchKey + "'\n");152 vI.notificationBar.dump("## identityData: isExistingIdentity: " + this.combinedName + " found, id='" + ignoreFullNameMatchKey + "'\n"); 152 153 return ignoreFullNameMatchKey; 153 154 } 154 155 155 vI _notificationBar.dump("## vI_identityData: isExistingIdentity: " + this.combinedName + " not found\n");156 vI.notificationBar.dump("## identityData: isExistingIdentity: " + this.combinedName + " not found\n"); 156 157 return null; 157 158 }, … … 183 184 const Items = Array("fullName", "email", "smtp", "id"); 184 185 var string = ""; 185 var saveBaseId = (vI _statusmenu.objSaveBaseIDMenuItem.getAttribute("checked") == "true")186 var saveSMTP = (vI _statusmenu.objSaveSMTPMenuItem.getAttribute("checked") == "true")186 var saveBaseId = (vI.statusmenu.objSaveBaseIDMenuItem.getAttribute("checked") == "true") 187 var saveSMTP = (vI.statusmenu.objSaveSMTPMenuItem.getAttribute("checked") == "true") 187 188 for each (let item in Items) { 188 189 var classEqual = (this.comp.equals[item])?"equal":"unequal"; … … 209 210 } 210 211 211 function vI_identityCollection() {212 function identityCollection() { 212 213 this.number = 0; 213 214 this.identityDataCollection = {}; 214 215 this.menuItems = {}; 215 216 } 216 vI_identityCollection.prototype =217 identityCollection.prototype = 217 218 { 218 219 number : null, … … 226 227 227 228 dropIdentity : function(index) { 228 vI _notificationBar.dump("## identityCollection: dropping address from inputList: " + this.identityDataCollection[index].combinedName + "\n");229 vI.notificationBar.dump("## identityCollection: dropping address from inputList: " + this.identityDataCollection[index].combinedName + "\n"); 229 230 while (index < (this.number - 1)) { this.identityDataCollection[index] = this.identityDataCollection[++index]; }; 230 231 this.identityDataCollection[--this.number] = null; … … 240 241 if (this.identityDataCollection[index].fullName == "" && identityData.fullName != "") { 241 242 this.identityDataCollection[index].fullName = identityData.fullName; 242 vI _notificationBar.dump("## identityCollection: added fullName '" + identityData.fullName243 vI.notificationBar.dump("## identityCollection: added fullName '" + identityData.fullName 243 244 + "' to stored email '" + this.identityDataCollection[index].email +"'\n") 244 245 } … … 249 250 this.identityDataCollection[index].smtp.key = identityData.smtp.key; 250 251 this.identityDataCollection[index].extras = identityData.extras; 251 vI _notificationBar.dump("## identityCollection: added id '" + identityData.id.value252 vI.notificationBar.dump("## identityCollection: added id '" + identityData.id.value 252 253 + "' smtp '" + identityData.smtp.value + "' (+extras) to stored email '" + this.identityDataCollection[index].email +"'\n") 253 254 } … … 255 256 } 256 257 } 257 vI _notificationBar.dump("## identityCollection: add new address to result: " + identityData.combinedName + "\n")258 vI.notificationBar.dump("## identityCollection: add new address to result: " + identityData.combinedName + "\n") 258 259 this.identityDataCollection[index] = identityData; 259 260 this.number = index + 1; … … 261 262 262 263 // this is used to completely use the conten of another identityCollection, but without changing all pointers 263 // see for instance vI _smartIdentity.__filterAddresses264 // see for instance vI.smartIdentity.__filterAddresses 264 265 takeOver : function(newIdentityCollection) { 265 266 this.number = newIdentityCollection.number … … 268 269 }; 269 270 270 const vI_DEFAULT_SMTP_TAG = "vI_useDefaultSMTP"271 const vI_NO_SMTP_TAG = "vI_noStoredSMTP"272 273 function vI_smtpObj(key) {271 const DEFAULT_SMTP_TAG = "vI_useDefaultSMTP" 272 const NO_SMTP_TAG = "vI_noStoredSMTP" 273 274 function smtpObj(key) { 274 275 this._key = key; 275 276 this.DEFAULT_TAG = document.getElementById("bundle_messenger").getString("defaultServerTag"); 276 277 } 277 vI_smtpObj.prototype = {278 smtpObj.prototype = { 278 279 DEFAULT_TAG : null, 279 280 _key : null, … … 285 286 return this._key 286 287 }, 287 get keyNice() { // the same as key but with "" for vI_DEFAULT_SMTP_TAG288 if (this.key == vI_DEFAULT_SMTP_TAG) return ""; // this is the key used for default server288 get keyNice() { // the same as key but with "" for DEFAULT_SMTP_TAG 289 if (this.key == DEFAULT_SMTP_TAG) return ""; // this is the key used for default server 289 290 return this.key 290 291 }, … … 292 293 if (this._value == null) { 293 294 this._value = ""; 294 if (this._key == null || this._key == "") this._key = vI_DEFAULT_SMTP_TAG;295 if (this._key == vI_DEFAULT_SMTP_TAG) this._value = this.DEFAULT_TAG;295 if (this._key == null || this._key == "") this._key = DEFAULT_SMTP_TAG; 296 if (this._key == DEFAULT_SMTP_TAG) this._value = this.DEFAULT_TAG; 296 297 else if (!this._key) this._value = null; 297 298 else if (this._key) { … … 308 309 } 309 310 } 310 if (!this._value) this._key = vI_NO_SMTP_TAG; // if non-existant SMTP handle like non available311 if (!this._value) this._key = NO_SMTP_TAG; // if non-existant SMTP handle like non available 311 312 return this._value; 312 313 }, 313 314 equal : function(compareSmtpObj) { 314 if (this.key == vI_NO_SMTP_TAG || compareSmtpObj.key == vI_NO_SMTP_TAG) return true;315 if (this.key == NO_SMTP_TAG || compareSmtpObj.key == NO_SMTP_TAG) return true; 315 316 return (this.keyNice == compareSmtpObj.keyNice); 316 317 }, 317 318 hasNoDefinedSMTP : function() { 318 return (this.key == vI_NO_SMTP_TAG);319 } 320 } 321 322 function vI_idObj(key) { this._key = key; }323 vI_idObj.prototype = {319 return (this.key == NO_SMTP_TAG); 320 } 321 } 322 323 function idObj(key) { this._key = key; } 324 idObj.prototype = { 324 325 _key : null, 325 326 _value : null, … … 355 356 } 356 357 } 358 vI.DEFAULT_SMTP_TAG = DEFAULT_SMTP_TAG; 359 vI.NO_SMTP_TAG = NO_SMTP_TAG; 360 vI.identityCollection = identityCollection; 361 vI.identityData = identityData; 362 }}); -
chrome/content/v_identity/vI_msgIdentityCloneTools.js
r92fd25 rc3feaa 22 22 Contributor(s): Thunderbird Developers 23 23 * ***** END LICENSE BLOCK ***** */ 24 25 var vI_msgIdentityCloneTools = {24 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 25 var msgIdentityCloneTools = { 26 26 copySelectedIdentity : function(id_key) { 27 vI _notificationBar.dump("## vI_msgIdentityCloneTools: copySelectedIdentity\n");27 vI.notificationBar.dump("## msgIdentityCloneTools: copySelectedIdentity\n"); 28 28 var msgIdentityElem = document.getElementById("msgIdentity"); 29 29 var msgIdentityPopupElem = document.getElementById("msgIdentityPopup"); … … 44 44 try { setSecuritySettings(1); enigSetMenuSettings(''); } catch(vErr) { }; 45 45 if (!existingIdentity) { 46 vI _notificationBar.dump("## vI_msgIdentityCloneTools: signatureSwitch hide/remove signatures\n");46 vI.notificationBar.dump("## msgIdentityCloneTools: signatureSwitch hide/remove signatures\n"); 47 47 // code to hide the text signature 48 try { if (vI _main.preferences.getBoolPref("hide_signature") && ss_signature.length == 0) {49 vI _notificationBar.dump("## vI_msgIdentityCloneTools: hide text/html signature");48 try { if (vI.main.preferences.getBoolPref("hide_signature") && ss_signature.length == 0) { 49 vI.notificationBar.dump("## msgIdentityCloneTools: hide text/html signature"); 50 50 ss_main.signatureSwitch() 51 vI _notificationBar.dump("\n");52 } } catch(vErr) { vI _notificationBar.dump(" -- missing signatureSwitch extension?\n"); };51 vI.notificationBar.dump("\n"); 52 } } catch(vErr) { vI.notificationBar.dump(" -- missing signatureSwitch extension?\n"); }; 53 53 // code to hide the sMime signature 54 try { if (vI _main.preferences.getBoolPref("hide_sMime_messageSignature")) {54 try { if (vI.main.preferences.getBoolPref("hide_sMime_messageSignature")) { 55 55 var element = document.getElementById("menu_securitySign1"); 56 56 if (element.getAttribute("checked") == "true") { 57 vI _notificationBar.dump("## signatureSwitch hide_sMime_messageSignature with doCommand\n");57 vI.notificationBar.dump("## signatureSwitch hide_sMime_messageSignature with doCommand\n"); 58 58 element.doCommand(); 59 59 } … … 62 62 } catch(vErr) { }; 63 63 // code to hide the openGPG signature 64 try { if (vI _main.preferences.getBoolPref("hide_openPGP_messageSignature")) {64 try { if (vI.main.preferences.getBoolPref("hide_openPGP_messageSignature")) { 65 65 var element = document.getElementById("enigmail_signed_send"); 66 66 if (element.getAttribute("checked") == "true") { … … 74 74 } 75 75 if (skipChangeGPGsign) 76 vI _notificationBar.dump("## signatureSwitch skip hide_openPGP_messageSignature - EnigMail AlertWindow open\n");76 vI.notificationBar.dump("## signatureSwitch skip hide_openPGP_messageSignature - EnigMail AlertWindow open\n"); 77 77 else { 78 vI _notificationBar.dump("## signatureSwitch hide_openPGP_messageSignature with doCommand\n");78 vI.notificationBar.dump("## signatureSwitch hide_openPGP_messageSignature with doCommand\n"); 79 79 element.doCommand(); 80 80 } … … 85 85 } 86 86 else { 87 vI _notificationBar.dump("## vI_msgIdentityCloneTools: signatureSwitch restore signature\n");87 vI.notificationBar.dump("## msgIdentityCloneTools: signatureSwitch restore signature\n"); 88 88 // code to show the text signature 89 89 try { if (ss_signature.length > 0) { 90 vI _notificationBar.dump("## vI_msgIdentityCloneTools: show text/html signature");90 vI.notificationBar.dump("## msgIdentityCloneTools: show text/html signature"); 91 91 ss_main.signatureSwitch() 92 vI _notificationBar.dump("\n");93 } } catch(vErr) { vI _notificationBar.dump(" -- missing signatureSwitch extension?\n"); };92 vI.notificationBar.dump("\n"); 93 } } catch(vErr) { vI.notificationBar.dump(" -- missing signatureSwitch extension?\n"); }; 94 94 // sMime and openGPG signature will not be re-added automatically 95 95 } … … 97 97 98 98 initReplyTo : function() { 99 if (vI _statusmenu.prefroot.getBoolPref("extensions.virtualIdentity.autoReplyToSelf")) {99 if (vI.statusmenu.prefroot.getBoolPref("extensions.virtualIdentity.autoReplyToSelf")) { 100 100 document.getElementById("autoReplyToSelfLabel").removeAttribute("hidden"); 101 vI_msgIdentityCloneTools.removeAllReplyTos();101 msgIdentityCloneTools.removeAllReplyTos(); 102 102 } 103 103 else document.getElementById("autoReplyToSelfLabel").setAttribute("hidden", "true"); … … 109 109 var awType = awGetPopupElement(row).selectedItem.getAttribute("value"); 110 110 if (awType == "addr_reply") { 111 vI _notificationBar.dump("## vI_msgIdentityCloneTools: removed ReplyTo found in row " + row + "\n");111 vI.notificationBar.dump("## msgIdentityCloneTools: removed ReplyTo found in row " + row + "\n"); 112 112 awDeleteRow(row--); // removed one line therefore decrease row-value 113 113 } … … 119 119 if (!document.getElementById("autoReplyToSelfLabel").hasAttribute("hidden")) { 120 120 awAddRecipient("addr_reply",document.getElementById("msgIdentity_clone").label); 121 vI _notificationBar.dump("## vI_msgIdentityCloneTools: added ReplyToSelf");121 vI.notificationBar.dump("## msgIdentityCloneTools: added ReplyToSelf"); 122 122 document.getElementById("autoReplyToSelfLabel").setAttribute("hidden","true"); 123 123 } 124 124 } 125 125 } 126 vI.msgIdentityCloneTools = msgIdentityCloneTools; 127 }}); -
chrome/content/v_identity/vI_notificationBar.js
r92fd25 rc3feaa 23 23 * ***** END LICENSE BLOCK ***** */ 24 24 25 var vI_notificationBar = { 25 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 26 var notificationBar = { 26 27 quiet : null, 27 28 timer : null, … … 43 44 44 45 observe: function() { 45 var showDebugArea = vI_notificationBar.preferences.getBoolPref("debug_notification")46 vI_notificationBar.Obj_DebugBox.setAttribute("hidden", !showDebugArea)47 vI_notificationBar.Obj_DebugBoxSplitter.setAttribute("hidden", !showDebugArea)48 if ( vI_notificationBar.Obj_DebugBaseID) vI_notificationBar.Obj_DebugBaseID.setAttribute("base_id_key_hidden", !showDebugArea)46 var showDebugArea = notificationBar.preferences.getBoolPref("debug_notification") 47 notificationBar.Obj_DebugBox.setAttribute("hidden", !showDebugArea) 48 notificationBar.Obj_DebugBoxSplitter.setAttribute("hidden", !showDebugArea) 49 if (notificationBar.Obj_DebugBaseID) notificationBar.Obj_DebugBaseID.setAttribute("base_id_key_hidden", !showDebugArea) 49 50 }, 50 51 51 52 addObserver: function() { 52 vI_notificationBar.prefroot.addObserver("extensions.virtualIdentity.debug_notification", vI_notificationBar, false);53 notificationBar.prefroot.addObserver("extensions.virtualIdentity.debug_notification", notificationBar, false); 53 54 }, 54 55 55 56 removeObserver: function() { 56 vI_notificationBar.prefroot.removeObserver("extensions.virtualIdentity.debug_notification", vI_notificationBar);57 notificationBar.prefroot.removeObserver("extensions.virtualIdentity.debug_notification", notificationBar); 57 58 }, 58 59 59 60 init : function() { 60 vI_notificationBar.Obj_DebugBox = document.getElementById("vIDebugBox");61 if (! vI_notificationBar.Obj_DebugBox) return false;62 vI_notificationBar.upgrade = vI_notificationBar.Obj_DebugBox.getAttribute("upgrade")61 notificationBar.Obj_DebugBox = document.getElementById("vIDebugBox"); 62 if (!notificationBar.Obj_DebugBox) return false; 63 notificationBar.upgrade = notificationBar.Obj_DebugBox.getAttribute("upgrade") 63 64 64 65 // nothing else to do for the upgrade dialog 65 if ( vI_notificationBar.upgrade) return true;66 if (notificationBar.upgrade) return true; 66 67 67 vI_notificationBar.Obj_vINotification = document.getElementById("vINotification");68 vI_notificationBar.Obj_DebugBoxSplitter = document.getElementById("vIDebugBoxSplitter");69 vI_notificationBar.Obj_DebugBaseID = document.getElementById("msgIdentity_clone");68 notificationBar.Obj_vINotification = document.getElementById("vINotification"); 69 notificationBar.Obj_DebugBoxSplitter = document.getElementById("vIDebugBoxSplitter"); 70 notificationBar.Obj_DebugBaseID = document.getElementById("msgIdentity_clone"); 70 71 71 vI_notificationBar.addObserver();72 vI_notificationBar.observe();73 vI_notificationBar.dump_app_version();72 notificationBar.addObserver(); 73 notificationBar.observe(); 74 notificationBar.dump_app_version(); 74 75 75 76 return true; … … 77 78 78 79 clear : function() { 79 if (! vI_notificationBar.Obj_vINotification) return;80 if ( vI_notificationBar.timer) window.clearTimeout(vI_notificationBar.timer);81 vI_notificationBar.timer = null;82 vI_notificationBar.Obj_vINotification.removeAllNotifications(true);80 if (!notificationBar.Obj_vINotification) return; 81 if (notificationBar.timer) window.clearTimeout(notificationBar.timer); 82 notificationBar.timer = null; 83 notificationBar.Obj_vINotification.removeAllNotifications(true); 83 84 }, 84 85 85 86 clear_dump : function() { 86 if (! vI_notificationBar.Obj_DebugBox) return;87 var new_DebugBox = vI_notificationBar.Obj_DebugBox.cloneNode(false);88 vI_notificationBar.Obj_DebugBox.parentNode.replaceChild(89 new_DebugBox, vI_notificationBar.Obj_DebugBox);90 vI_notificationBar.Obj_DebugBox = new_DebugBox;91 vI_notificationBar.dump_app_version();87 if (!notificationBar.Obj_DebugBox) return; 88 var new_DebugBox = notificationBar.Obj_DebugBox.cloneNode(false); 89 notificationBar.Obj_DebugBox.parentNode.replaceChild( 90 new_DebugBox, notificationBar.Obj_DebugBox); 91 notificationBar.Obj_DebugBox = new_DebugBox; 92 notificationBar.dump_app_version(); 92 93 }, 93 94 … … 114 115 var protohandler = Components.classes["@mozilla.org/network/protocol;1?name=http"] 115 116 .getService(Components.interfaces.nsIHttpProtocolHandler); 116 vI_notificationBar.__dumpDebugBox(appInfo.name + " " + appInfo.version + " (" + appInfo.appBuildID + "; " + protohandler.oscpu + ")\n")117 notificationBar.__dumpDebugBox(appInfo.name + " " + appInfo.version + " (" + appInfo.appBuildID + "; " + protohandler.oscpu + ")\n") 117 118 } 118 else vI_notificationBar.__dumpDebugBox("mail-client seems not supported by Virtual Identity Extension")119 else notificationBar.__dumpDebugBox("mail-client seems not supported by Virtual Identity Extension") 119 120 120 vI_notificationBar.__getExtensionList(vI_notificationBar.__dumpDebugBox)121 notificationBar.__getExtensionList(notificationBar.__dumpDebugBox) 121 122 122 // vI_notificationBar.__dumpDebugBox(output + "\n")123 // notificationBar.__dumpDebugBox(output + "\n") 123 124 124 vI_notificationBar.__dumpDebugBox("--------------------------------------------------------------------------------\n")125 notificationBar.__dumpDebugBox("--------------------------------------------------------------------------------\n") 125 126 }, 126 127 127 128 dump : function(note) { 128 if (! vI_notificationBar.Obj_DebugBox) vI_notificationBar.init()129 if (! vI_notificationBar.preferences.getBoolPref("debug_notification") &&130 ! vI_notificationBar.upgrade) return;131 dump(note); vI_notificationBar.__dumpDebugBox(note);129 if (!notificationBar.Obj_DebugBox) notificationBar.init() 130 if (!notificationBar.preferences.getBoolPref("debug_notification") && 131 !notificationBar.upgrade) return; 132 dump(note); notificationBar.__dumpDebugBox(note); 132 133 }, 133 134 134 135 __dumpDebugBox : function(note) { 135 if ((! vI_notificationBar.preferences.getBoolPref("debug_notification") &&136 ! vI_notificationBar.upgrade) ||137 vI_notificationBar.quiet) return;138 if (! vI_notificationBar.Obj_DebugBox &&139 ! vI_notificationBar.init()) return;136 if ((!notificationBar.preferences.getBoolPref("debug_notification") && 137 !notificationBar.upgrade) || 138 notificationBar.quiet) return; 139 if (!notificationBar.Obj_DebugBox && 140 !notificationBar.init()) return; 140 141 141 142 var new_text = document.createTextNode(note); 142 143 var new_br = document.createElementNS("http://www.w3.org/1999/xhtml", 'br'); 143 vI_notificationBar.Obj_DebugBox.inputField.appendChild(new_text);144 vI_notificationBar.Obj_DebugBox.inputField.appendChild(new_br);145 vI_notificationBar.Obj_DebugBox.inputField.scrollTop =146 vI_notificationBar.Obj_DebugBox.inputField.scrollHeight -147 vI_notificationBar.Obj_DebugBox.inputField.clientHeight144 notificationBar.Obj_DebugBox.inputField.appendChild(new_text); 145 notificationBar.Obj_DebugBox.inputField.appendChild(new_br); 146 notificationBar.Obj_DebugBox.inputField.scrollTop = 147 notificationBar.Obj_DebugBox.inputField.scrollHeight - 148 notificationBar.Obj_DebugBox.inputField.clientHeight 148 149 }, 149 150 150 151 setNote: function(note, prefstring, title) { 151 vI_notificationBar.clear();152 vI_notificationBar.addNote(note, prefstring, title);152 notificationBar.clear(); 153 notificationBar.addNote(note, prefstring, title); 153 154 }, 154 155 … … 167 168 __setTitle: function(title) { 168 169 if (!title) return; 169 // vI_notificationBar.dump("** setTitle: " + title + "\n");170 // notificationBar.dump("** setTitle: " + title + "\n"); 170 171 var Obj_vINotificationTitle = document.getElementById("vINotificationTitle"); 171 172 Obj_vINotificationTitle.setAttribute("value", title); … … 174 175 175 176 addNote: function(note, prefstring, title) { 176 // vI_notificationBar.dump("** " + note + "\n\n");177 if (! vI_notificationBar.preferences.getBoolPref(prefstring)) return;178 if (! vI_notificationBar.Obj_vINotification) vI_notificationBar.init();179 if (! vI_notificationBar.Obj_vINotification) return;180 var oldNotification = vI_notificationBar.Obj_vINotification.currentNotification177 // notificationBar.dump("** " + note + "\n\n"); 178 if (!notificationBar.preferences.getBoolPref(prefstring)) return; 179 if (!notificationBar.Obj_vINotification) notificationBar.init(); 180 if (!notificationBar.Obj_vINotification) return; 181 var oldNotification = notificationBar.Obj_vINotification.currentNotification 181 182 var newLabel = (oldNotification)?oldNotification.label + note:note; 182 vI_notificationBar.clear();183 vI_notificationBar.Obj_vINotification183 notificationBar.clear(); 184 notificationBar.Obj_vINotification 184 185 .appendNotification(newLabel, "", "chrome://messenger/skin/icons/flag.png"); 185 vI_notificationBar.__setTitle(title);186 notificationBar.__setTitle(title); 186 187 187 if ( vI_notificationBar.preferences.getIntPref("notification_timeout") != 0)188 vI_notificationBar.timer = window.setTimeout(vI_notificationBar.clear,189 vI_notificationBar.preferences.getIntPref("notification_timeout") * 1000);188 if (notificationBar.preferences.getIntPref("notification_timeout") != 0) 189 notificationBar.timer = window.setTimeout(virtualIdentityExtension.notificationBar.clear, 190 notificationBar.preferences.getIntPref("notification_timeout") * 1000); 190 191 } 191 192 } 192 window.addEventListener("unload", function(e) { try {vI_notificationBar.removeObserver();} catch (ex) { } }, false); 193 window.addEventListener("unload", function(e) { try {notificationBar.removeObserver();} catch (ex) { } }, false); 194 vI.notificationBar = notificationBar; 195 }}); -
chrome/content/v_identity/vI_notificationBar.xml
r92fd25 rc3feaa 38 38 xbl:inherits="value=label" 39 39 DOMAttrModified="if(event.attrName == 'value') this.value = event.newValue; return true;" 40 onoverflow="v I_notificationBar.overflow(this);" oncontextmenu="" />40 onoverflow="virtualIdentityExtension.notificationBar.overflow(this);" oncontextmenu="" /> 41 41 <children/> 42 42 </xul:hbox> -
chrome/content/v_identity/vI_prefDialog.js
r92fd25 rc3feaa 23 23 * ***** END LICENSE BLOCK ***** */ 24 24 25 var vI_prefDialog = { 25 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 26 var prefDialog = { 26 27 toggleHelp : function() { 27 28 var browserElem = document.getElementById("vI_remoteBrowserBox"); … … 33 34 browserElem.setAttribute("hidden", "true"); 34 35 } 35 vI_prefDialog.updateHelpUrl();36 prefDialog.updateHelpUrl(); 36 37 }, 37 38 … … 121 122 init : function() { 122 123 // initialize the default window values... 123 for( var i = 0; i < vI_prefDialog.base._elementIDs.length; i++ ) {124 var elementID = vI_prefDialog.base._elementIDs[i];124 for( var i = 0; i < prefDialog.base._elementIDs.length; i++ ) { 125 var elementID = prefDialog.base._elementIDs[i]; 125 126 var element = document.getElementById(elementID); 126 127 if (!element) break; … … 129 130 if (eltType == "radiogroup") 130 131 element.selectedItem = element.childNodes[ 131 vI_prefDialog.preferences.getIntPref(element.getAttribute("prefstring"))];132 prefDialog.preferences.getIntPref(element.getAttribute("prefstring"))]; 132 133 else if (eltType == "checkbox") 133 134 element.checked = 134 vI_prefDialog.preferences.getBoolPref(element.getAttribute("prefstring"));135 prefDialog.preferences.getBoolPref(element.getAttribute("prefstring")); 135 136 else if (eltType == "textbox") 136 137 if (element.getAttribute("preftype") == "int") 137 138 element.setAttribute("value", 138 vI_prefDialog.preferences.getIntPref(element.getAttribute("prefstring")) );139 prefDialog.preferences.getIntPref(element.getAttribute("prefstring")) ); 139 140 else { 140 141 element.setAttribute("value", 141 vI_prefDialog.unicodeConverter.ConvertToUnicode(vI_prefDialog.preferences.getCharPref(element.getAttribute("prefstring"))) );142 prefDialog.unicodeConverter.ConvertToUnicode(prefDialog.preferences.getCharPref(element.getAttribute("prefstring"))) ); 142 143 // alert(element.getAttribute("prefstring") + " " + element.getAttribute("value")) 143 144 } 144 145 else if (eltType == "listbox") 145 146 element.value = 146 vI_prefDialog.preferences.getCharPref(element.getAttribute("prefstring"));147 prefDialog.preferences.getCharPref(element.getAttribute("prefstring")); 147 148 // } catch (ex) {} 148 149 } … … 150 151 151 152 savePrefs : function() { 152 for( var i = 0; i < vI_prefDialog.base._elementIDs.length; i++ ) {153 var elementID = vI_prefDialog.base._elementIDs[i];153 for( var i = 0; i < prefDialog.base._elementIDs.length; i++ ) { 154 var elementID = prefDialog.base._elementIDs[i]; 154 155 var element = document.getElementById(elementID); 155 156 if (!element) break; 156 157 var eltType = element.localName; 157 158 if (eltType == "radiogroup") 158 vI_prefDialog.preferences.setIntPref(159 prefDialog.preferences.setIntPref( 159 160 element.getAttribute("prefstring"), parseInt(element.value)); 160 161 else if (eltType == "checkbox") 161 vI_prefDialog.preferences.setBoolPref(162 prefDialog.preferences.setBoolPref( 162 163 element.getAttribute("prefstring"), element.checked); 163 164 else if (eltType == "textbox") { 164 165 if (element.getAttribute("preftype") == "int") 165 vI_prefDialog.preferences.setIntPref(166 prefDialog.preferences.setIntPref( 166 167 element.getAttribute("prefstring"), element.value); 167 else vI_prefDialog.preferences.setCharPref(168 element.getAttribute("prefstring"), vI_prefDialog.unicodeConverter.ConvertFromUnicode(element.value));168 else prefDialog.preferences.setCharPref( 169 element.getAttribute("prefstring"), prefDialog.unicodeConverter.ConvertFromUnicode(element.value)); 169 170 } 170 171 else if (eltType == "listbox") 171 vI_prefDialog.preferences.setCharPref(element.getAttribute("prefstring"), element.value);172 prefDialog.preferences.setCharPref(element.getAttribute("prefstring"), element.value); 172 173 } 173 174 }, … … 182 183 var smartDraft = document.getElementById("VIdent_identity.smart_draft").checked; 183 184 var smartReply = document.getElementById("VIdent_identity.smart_reply").checked; 184 var mAttr = vI_prefDialog.base.modifyAttribute;185 var mAttr = prefDialog.base.modifyAttribute; 185 186 186 187 // idSelectionConstraint … … 198 199 mAttr("VIdent_identity.idSelection_storage_prefer_smart_reply","disabled",idSelectionInputConstraint); 199 200 mAttr("VIdent_identity.idSelection_storage_ignore_smart_reply","disabled",idSelectionInputConstraint); 200 if (idSelectionInputConstraint) vI_prefDialog.base.idSelectionResultConstraint();201 if (idSelectionInputConstraint) prefDialog.base.idSelectionResultConstraint(); 201 202 202 203 // sourceEmailConstraint … … 219 220 220 221 smartReplyConstraint : function(element) { 221 var mAttr = vI_prefDialog.base.modifyAttribute;222 var mAttr = prefDialog.base.modifyAttribute; 222 223 mAttr("VIdent_identity.smart_reply_for_newsgroups","disabled",element.checked); 223 224 mAttr("VIdent_identity.smart_reply_headers","disabled",element.checked); … … 227 228 mAttr("VIdent_identity.smart_reply_headers_reset","disabled",element.checked); 228 229 mAttr("VIdent_identity.smart_detectByReceivedHeader","disabled",element.checked); 229 vI_prefDialog.base.constraints();230 prefDialog.base.constraints(); 230 231 }, 231 232 … … 237 238 smartReplyHideSignature : function() { 238 239 const switch_signature_ID="{2ab1b709-ba03-4361-abf9-c50b964ff75d}" 239 if (vI _helper.extensionActive(switch_signature_ID)) {240 if (vI.helper.extensionActive(switch_signature_ID)) { 240 241 document.getElementById("VIdent_identity.HideSignature.warning").setAttribute("hidden", "true"); 241 242 document.getElementById("VIdent_identity.hide_signature").setAttribute("disabled", "false"); … … 244 245 245 246 autoTimestampConstraint : function(element) { 246 var mAttr = vI_prefDialog.base.modifyAttribute;247 var mAttr = prefDialog.base.modifyAttribute; 247 248 mAttr("VIdent_identity.autoTimestamp.options","hidden",element.checked); 248 249 }, 249 250 250 251 storageConstraint : function(element) { 251 var mAttr = vI_prefDialog.base.modifyAttribute;252 var mAttr = prefDialog.base.modifyAttribute; 252 253 mAttr("VIdent_identity.storage_storedefault","disabled",element.checked); 253 254 mAttr("VIdent_identity.storage_store_base_id","disabled",element.checked); … … 274 275 mAttr("storageUp","featureDisabled",element.checked); 275 276 mAttr("storageUpDown","featureDisabled",element.checked); 276 vI_prefDialog.base.constraints();277 prefDialog.base.constraints(); 277 278 }, 278 279 279 280 menuButtonConstraints : function(elem) { 280 var mAttr = vI_prefDialog.base.modifyAttribute;281 var mAttr = prefDialog.base.modifyAttribute; 281 282 var valueParam = (document.getElementById("viewGroup").getAttribute("hidden") == "true"); // true -> removeAttribute 282 283 var dialogElem = document.getElementById("vI_prefDialog"); … … 287 288 288 289 flipMenuButtons : function(elem) { 289 var mAttr = vI_prefDialog.base.modifyAttribute;290 var mAttr = prefDialog.base.modifyAttribute; 290 291 var valueParam = (elem.getAttribute("open") == "true"); 291 292 var dialogElem = document.getElementById("vI_prefDialog"); … … 304 305 305 306 init : function() { 306 vI_prefDialog.unicodeConverter.charset="UTF-8";307 vI_prefDialog.base.init();308 onInitCopiesAndFolders()307 prefDialog.unicodeConverter.charset="UTF-8"; 308 prefDialog.base.init(); 309 vI.onInitCopiesAndFolders() 309 310 310 311 const enigmail_ID="{847b3a00-7ab1-11d4-8f02-006008948af5}" 311 if (!vI _helper.extensionActive(enigmail_ID)) {312 if (!vI.helper.extensionActive(enigmail_ID)) { 312 313 document.getElementById("openPGPencryption").setAttribute("hidden", "true"); 313 314 document.getElementById("VIdent_identity.hide_openPGP_messageSignature").setAttribute("hidden", "true"); 314 315 } 315 316 316 vI_prefDialog.base.smartReplyConstraint(document.getElementById("VIdent_identity.smart_reply"));317 vI_prefDialog.base.smartReplyHideSignature();318 vI_prefDialog.base.storageConstraint(document.getElementById("VIdent_identity.storage"));319 vI_prefDialog.base.autoTimestampConstraint(document.getElementById("VIdent_identity.autoTimestamp"));320 vI_prefDialog.base.constraints();321 vI_prefDialog.base.menuButtonConstraints();322 vI_prefDialog.base.initTreeValues();317 prefDialog.base.smartReplyConstraint(document.getElementById("VIdent_identity.smart_reply")); 318 prefDialog.base.smartReplyHideSignature(); 319 prefDialog.base.storageConstraint(document.getElementById("VIdent_identity.storage")); 320 prefDialog.base.autoTimestampConstraint(document.getElementById("VIdent_identity.autoTimestamp")); 321 prefDialog.base.constraints(); 322 prefDialog.base.menuButtonConstraints(); 323 prefDialog.base.initTreeValues(); 323 324 324 325 }, … … 326 327 savePrefs : function() { 327 328 // Copy all changes to Elements 328 onSaveCopiesAndFolders();329 vI_prefDialog.base.savePrefs();329 vI.onSaveCopiesAndFolders(); 330 prefDialog.base.savePrefs(); 330 331 }, 331 332 … … 338 339 } 339 340 } 341 vI.prefDialog = prefDialog; 342 }}); -
chrome/content/v_identity/vI_prefDialog.xml
r92fd25 rc3feaa 33 33 <constructor> 34 34 <![CDATA[ 35 if (vI_notificationBar) vI_notificationBar.dump("## identitySelector: constructor\n"); 35 with (virtualIdentityExtension.LIB) { 36 if (vI.notificationBar) vI.notificationBar.dump("## identitySelector: constructor\n"); 36 37 var AccountManager = Components.classes["@mozilla.org/messenger/account-manager;1"] 37 38 .getService(Components.interfaces.nsIMsgAccountManager); 38 var debugNotes = vI _prefDialog.preferences.getBoolPref("debug_notification");39 var debugNotes = vI.prefDialog.preferences.getBoolPref("debug_notification"); 39 40 40 41 for (let i = AccountManager.accounts.Count() - 1; i >= 0 ; i--) { … … 55 56 if (debugNotes) 56 57 document.getAnonymousElementByAttribute(this, "id", "ignoreIDs_debug").removeAttribute("hidden") 58 } 57 59 ]]> 58 60 </constructor> 59 61 <property name="value" > 60 62 <setter><![CDATA[ 61 if (vI_notificationBar) vI_notificationBar.dump("## identitySelector: setting value to '" + val + "'\n"); 63 with (virtualIdentityExtension.LIB) { 64 if (vI.notificationBar) vI.notificationBar.dump("## identitySelector: setting value to '" + val + "'\n"); 62 65 var listItems = this.childNodes; 63 66 for (var index = 0; index < listItems.length; index++) { 64 67 var key = listItems[index].getAttribute("value"); 65 68 listItems[index].checked = (val.indexOf(":" + key + ":") == -1); 66 if (vI _notificationBar) vI_notificationBar.dump("## identitySelector: setting value, '" + listItems[index].getAttribute("value") + "' '" + listItems[index].checked + "' '" + listItems[index].getAttribute("checked") + "'\n")69 if (vI.notificationBar) vI.notificationBar.dump("## identitySelector: setting value, '" + listItems[index].getAttribute("value") + "' '" + listItems[index].checked + "' '" + listItems[index].getAttribute("checked") + "'\n") 67 70 } 68 71 this._value = val; 72 } 69 73 ]]></setter> 70 74 <getter><![CDATA[ 71 if (vI_notificationBar) vI_notificationBar.dump("## identitySelector: getting value\n"); 75 with (virtualIdentityExtension.LIB) { 76 if (vI.notificationBar) vI.notificationBar.dump("## identitySelector: getting value\n"); 72 77 var returnVal = ""; 73 78 var listItems = this.childNodes; 74 79 for (var index = 0; index < listItems.length; index++) { 75 if (vI _notificationBar) vI_notificationBar.dump("## identitySelector: getting value, '" + listItems[index].getAttribute("value") + "' '" + listItems[index].checked + "' '" + listItems[index].getAttribute("checked") + "'\n");80 if (vI.notificationBar) vI.notificationBar.dump("## identitySelector: getting value, '" + listItems[index].getAttribute("value") + "' '" + listItems[index].checked + "' '" + listItems[index].getAttribute("checked") + "'\n"); 76 81 if (!listItems[index].checked) returnVal += " :" + listItems[index].getAttribute("value") + ": " 77 82 } 78 if (vI _notificationBar) vI_notificationBar.dump("## identitySelector: getting value, result '" + returnVal + "'\n");83 if (vI.notificationBar) vI.notificationBar.dump("## identitySelector: getting value, result '" + returnVal + "'\n"); 79 84 return returnVal; 85 } 80 86 ]]></getter> 81 87 </property> -
chrome/content/v_identity/vI_prefDialog.xul
r92fd25 rc3feaa 80 80 <hbox> 81 81 <vbox> 82 <image id="toggleIcon" class="addresstwisty" onclick="v I_prefDialog.base.flipMenuButtons(this);" open="true" persist="open" />82 <image id="toggleIcon" class="addresstwisty" onclick="virtualIdentityExtension.prefDialog.base.flipMenuButtons(this);" open="true" persist="open" /> 83 83 <spacer flex="1" /> 84 84 </vbox> … … 88 88 <hbox> 89 89 <radio pane="source" id="sourceEmail" 90 oncommand="document.getElementById('prefTabbox').selectedIndex = 0; v I_prefDialog.updateHelpUrl();"90 oncommand="document.getElementById('prefTabbox').selectedIndex = 0; virtualIdentityExtension.prefDialog.updateHelpUrl();" 91 91 tooltiptext="&vI_prefDialog.tabbox.tab0.label;" /> 92 92 <vbox><spacer flex="1"/><image class="arrow" id="toSelection" /><spacer flex="1"/></vbox> 93 93 <radio pane="source" id="selection" 94 oncommand="document.getElementById('prefTabbox').selectedIndex = 1; v I_prefDialog.updateHelpUrl();"94 oncommand="document.getElementById('prefTabbox').selectedIndex = 1; virtualIdentityExtension.prefDialog.updateHelpUrl();" 95 95 tooltiptext="&vI_prefDialog.tabbox.tab1.label;" /> 96 96 <vbox><spacer flex="1"/><image class="arrow" id="toCompose" /><spacer flex="1"/></vbox> 97 97 <radio pane="source" id="composeDialog" 98 oncommand="document.getElementById('prefTabbox').selectedIndex = 2; v I_prefDialog.updateHelpUrl();"98 oncommand="document.getElementById('prefTabbox').selectedIndex = 2; virtualIdentityExtension.prefDialog.updateHelpUrl();" 99 99 tooltiptext="&vI_prefDialog.tabbox.tab2.label;" /> 100 100 <vbox><spacer flex="1"/><image class="arrow" id="toSend" /><spacer flex="1"/></vbox> 101 101 <radio pane="source" id="emailOut" 102 oncommand="document.getElementById('prefTabbox').selectedIndex = 3; v I_prefDialog.updateHelpUrl();"102 oncommand="document.getElementById('prefTabbox').selectedIndex = 3; virtualIdentityExtension.prefDialog.updateHelpUrl();" 103 103 tooltiptext="&vI_prefDialog.tabbox.tab3.label;" /> 104 104 </hbox> … … 108 108 <vbox><spacer flex="1"/><image class="arrow" id="storageUp" /><spacer flex="1"/></vbox> 109 109 <radio pane="source" id="storageOut" 110 oncommand="document.getElementById('prefTabbox').selectedIndex = 4; v I_prefDialog.updateHelpUrl();"110 oncommand="document.getElementById('prefTabbox').selectedIndex = 4; virtualIdentityExtension.prefDialog.updateHelpUrl();" 111 111 tooltiptext="&vI_prefDialog.tabbox.tab4.label;" /> 112 112 <vbox><spacer flex="1"/><image class="arrow" id="storageUpDown" /><spacer flex="1"/></vbox> … … 118 118 <spacer flex="1"/> 119 119 <hbox><spacer flex="1"/><radio pane="source" id="options" 120 oncommand="document.getElementById('prefTabbox').selectedIndex = 5; v I_prefDialog.updateHelpUrl();"120 oncommand="document.getElementById('prefTabbox').selectedIndex = 5; virtualIdentityExtension.prefDialog.updateHelpUrl();" 121 121 tooltiptext="&vI_prefDialog.tabbox.tab5.label;" /> 122 122 </hbox> … … 124 124 <button id="logoButton1" class="v_identity_logo v_identity_logo_button" 125 125 label="&vident.vidLogo.label; &vident.version;" 126 oncommand="v I_prefDialog.openURL('http://www.absorb.it/virtual-id')"126 oncommand="virtualIdentityExtension.prefDialog.openURL('http://www.absorb.it/virtual-id')" 127 127 tooltiptext="&vI_prefDialog.vidLogo.tooltiptext;" /> 128 128 </vbox> … … 131 131 <hbox> 132 132 <tabs> 133 <tab label="&vI_prefDialog.tabbox.tab0.label;" oncommand="document.getElementById('viewGroup').selectedIndex = 0; v I_prefDialog.updateHelpUrl(0);"/>134 <tab label="&vI_prefDialog.tabbox.tab1.label;" oncommand="document.getElementById('viewGroup').selectedIndex = 1; v I_prefDialog.updateHelpUrl(1);"/>135 <tab label="&vI_prefDialog.tabbox.tab2.label;" oncommand="document.getElementById('viewGroup').selectedIndex = 2; v I_prefDialog.updateHelpUrl(2);"/>136 <tab label="&vI_prefDialog.tabbox.tab3.label;" oncommand="document.getElementById('viewGroup').selectedIndex = 3; v I_prefDialog.updateHelpUrl(3);"/>137 <tab label="&vI_prefDialog.tabbox.tab4.label;" oncommand="document.getElementById('viewGroup').selectedIndex = 4; v I_prefDialog.updateHelpUrl(4);"/>138 <tab label="&vI_prefDialog.tabbox.tab5.label;" oncommand="document.getElementById('viewGroup').selectedIndex = 5; v I_prefDialog.updateHelpUrl(5);"/>133 <tab label="&vI_prefDialog.tabbox.tab0.label;" oncommand="document.getElementById('viewGroup').selectedIndex = 0; virtualIdentityExtension.prefDialog.updateHelpUrl(0);"/> 134 <tab label="&vI_prefDialog.tabbox.tab1.label;" oncommand="document.getElementById('viewGroup').selectedIndex = 1; virtualIdentityExtension.prefDialog.updateHelpUrl(1);"/> 135 <tab label="&vI_prefDialog.tabbox.tab2.label;" oncommand="document.getElementById('viewGroup').selectedIndex = 2; virtualIdentityExtension.prefDialog.updateHelpUrl(2);"/> 136 <tab label="&vI_prefDialog.tabbox.tab3.label;" oncommand="document.getElementById('viewGroup').selectedIndex = 3; virtualIdentityExtension.prefDialog.updateHelpUrl(3);"/> 137 <tab label="&vI_prefDialog.tabbox.tab4.label;" oncommand="document.getElementById('viewGroup').selectedIndex = 4; virtualIdentityExtension.prefDialog.updateHelpUrl(4);"/> 138 <tab label="&vI_prefDialog.tabbox.tab5.label;" oncommand="document.getElementById('viewGroup').selectedIndex = 5; virtualIdentityExtension.prefDialog.updateHelpUrl(5);"/> 139 139 </tabs> 140 140 <spacer flex="1" /> 141 141 <button id="logoButton2" class="v_identity_logo v_identity_logo_button" 142 142 label="&vident.vidLogo.label; &vident.version;" 143 oncommand="v I_prefDialog.openURL('http://www.absorb.it/virtual-id')"143 oncommand="virtualIdentityExtension.prefDialogopenURL('http://www.absorb.it/virtual-id')" 144 144 tooltiptext="&vI_prefDialog.vidLogo.tooltiptext;" hidden="true" /> 145 145 </hbox> … … 147 147 <tabpanel orient="vertical" > 148 148 <hbox flex="1"> 149 <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; v I_prefDialog.updateHelpUrl();"149 <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; virtualIdentityExtension.prefDialog.updateHelpUrl();" 150 150 hidecolumnpicker="true" hidehscroll="true" > 151 151 <treecols orient="vertical"><treecol flex="1" hideheader="true" primary="true"/></treecols> … … 175 175 <checkbox id="VIdent_identity.smart_draft" label="&vI_prefDialog.smartDraft.label;" 176 176 tooltiptext="&vI_prefDialog.smartDraft.tooltiptext;" prefstring="smart_draft" 177 oncommand="v I_prefDialog.base.constraints();" />177 oncommand="virtualIdentityExtension.prefDialogbase.constraints();" /> 178 178 </groupbox> 179 179 <groupbox> … … 181 181 <checkbox id="VIdent_identity.smart_reply" label="&vI_prefDialog.smartReply.label;" 182 182 tooltiptext="&vI_prefDialog.smartReply.tooltiptext;" prefstring="smart_reply" 183 oncommand="v I_prefDialog.base.smartReplyConstraint(this);" />183 oncommand="virtualIdentityExtension.prefDialogbase.smartReplyConstraint(this);" /> 184 184 <hbox><spacer class="widthS"/> 185 185 <vbox> … … 201 201 <vbox><description class="widthX">&vI_prefDialog.smartReply.headers.desc;</description> 202 202 <spacer flex="1"/> 203 <button id="VIdent_identity.smart_reply_headers_reset" label="&vI_prefDialog.smartReply.headers.reset;" oncommand="v I_prefDialog.base.smartReplyHeaderReset();"/>203 <button id="VIdent_identity.smart_reply_headers_reset" label="&vI_prefDialog.smartReply.headers.reset;" oncommand="virtualIdentityExtension.prefDialogbase.smartReplyHeaderReset();"/> 204 204 </vbox> 205 205 <textbox id="VIdent_identity.smart_reply_headers" multiline="true" … … 246 246 <tabpanel orient="vertical" > 247 247 <hbox flex="1"> 248 <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; v I_prefDialog.updateHelpUrl();"248 <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; virtualIdentityExtension.prefDialog.updateHelpUrl();" 249 249 hidecolumnpicker="true" hidehscroll="true"> 250 250 <treecols orient="vertical"><treecol flex="1" hideheader="true" primary="true" /></treecols> … … 300 300 <checkbox id="VIdent_identity.idSelection_ask" label="&vI_prefDialog.idSelection.ask.label;" 301 301 prefstring="idSelection_ask" 302 oncommand="v I_prefDialog.base.idSelectionResultConstraint();"/>302 oncommand="virtualIdentityExtension.prefDialogbase.idSelectionResultConstraint();"/> 303 303 <hbox><spacer class="widthS"/><checkbox id="VIdent_identity.idSelection_ask_always" label="&vI_prefDialog.idSelection.ask_always.label;" 304 304 prefstring="idSelection_ask_always" 305 oncommand="v I_prefDialog.base.idSelectionResultConstraint();"/>305 oncommand="virtualIdentityExtension.prefDialogbase.idSelectionResultConstraint();"/> 306 306 </hbox> 307 307 <checkbox id="VIdent_identity.idSelection_autocreate" label="&vI_prefDialog.idSelection.autocreate.label;" 308 308 prefstring="idSelection_autocreate" 309 oncommand="v I_prefDialog.base.idSelectionResultConstraint();"/>309 oncommand="virtualIdentityExtension.prefDialogbase.idSelectionResultConstraint();"/> 310 310 311 311 <hbox><spacer class="widthS"/><label value="&vI_prefDialog.idSelection.autocreate.desc;" hidden="true" … … 325 325 <tabpanel orient="vertical" > 326 326 <hbox flex="1"> 327 <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; v I_prefDialog.updateHelpUrl();"327 <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; virtualIdentityExtension.prefDialog.updateHelpUrl();" 328 328 hidecolumnpicker="true" hidehscroll="true"> 329 329 <treecols orient="vertical"><treecol flex="1" hideheader="true" primary="true" /></treecols> … … 344 344 <caption label="&vI_prefDialog.composeDialog.caption;"/> 345 345 <checkbox id="VIdent_identity.autoTimestamp" label="&vI_prefDialog.composeDialog.autoTimestamp.label;" 346 tooltiptext="&vI_prefDialog.composeDialog.autoTimestamp.tooltiptext;" prefstring="autoTimestamp" oncommand="v I_prefDialog.base.autoTimestampConstraint(this);"/>346 tooltiptext="&vI_prefDialog.composeDialog.autoTimestamp.tooltiptext;" prefstring="autoTimestamp" oncommand="virtualIdentityExtension.prefDialogbase.autoTimestampConstraint(this);"/> 347 347 <hbox id="VIdent_identity.autoTimestamp.options" hidden="true"><spacer class="widthS"/> 348 348 <vbox> … … 396 396 <tabpanel orient="vertical" > 397 397 <hbox flex="1"> 398 <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; v I_prefDialog.updateHelpUrl();"398 <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; virtualIdentityExtension.prefDialog.updateHelpUrl();" 399 399 hidecolumnpicker="true" hidehscroll="true" > 400 400 <treecols orient="vertical"><treecol flex="1" hideheader="true" primary="true"/></treecols> … … 563 563 <tabpanel orient="vertical" > 564 564 <hbox flex="1"> 565 <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; v I_prefDialog.updateHelpUrl();"565 <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; virtualIdentityExtension.prefDialog.updateHelpUrl();" 566 566 hidecolumnpicker="true" hidehscroll="true"> 567 567 <treecols orient="vertical"> … … 592 592 <checkbox id="VIdent_identity.storage" label="&vI_prefDialog.storage.label;" 593 593 tooltiptext="&vI_prefDialog.storage.tooltiptext;" prefstring="storage" 594 oncommand="v I_prefDialog.base.storageConstraint(this);" />594 oncommand="virtualIdentityExtension.prefDialogbase.storageConstraint(this);" /> 595 595 <spacer class="paragraph"/> 596 596 <button id="VIdent_identity.storage.openEditor" label="&vI_prefDialog.storage.openEditor;" oncommand="openDialog('chrome://v_identity/content/vI_rdfDataTree.xul', '', 'chrome, dialog, resizable=yes');" /> 597 <button id="VIdent_identity.storage.import" label="&vI_prefDialog.storage.import;" oncommand="var vI_localRdfDatasource = new v I_rdfDatasourceImporter('virtualIdentity.rdf');" />598 <button id="VIdent_identity.storage.export" label="&vI_prefDialog.storage.export;" oncommand="var vI_localRdfDatasource = new v I_rdfDatasource(); vI_localRdfDatasource.export('virtualIdentity.rdf')" />597 <button id="VIdent_identity.storage.import" label="&vI_prefDialog.storage.import;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasourceImporter('virtualIdentity.rdf');" /> 598 <button id="VIdent_identity.storage.export" label="&vI_prefDialog.storage.export;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasource(); vI_localRdfDatasource.export('virtualIdentity.rdf')" /> 599 599 </groupbox> 600 600 </tabpanel> … … 677 677 <tabpanel orient="vertical" > 678 678 <hbox flex="1"> 679 <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; v I_prefDialog.updateHelpUrl();"679 <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; virtualIdentityExtension.prefDialog.updateHelpUrl();" 680 680 hidecolumnpicker="true" hidehscroll="true"> 681 681 <treecols orient="vertical"> -
chrome/content/v_identity/vI_prefDialog_FolderPicker.js
r92fd25 rc3feaa 43 43 * ***** END LICENSE BLOCK ***** */ 44 44 45 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 46 45 47 var gFccRadioElemChoice, gDraftsRadioElemChoice, gTmplRadioElemChoice; 46 48 var gFccRadioElemChoiceLocked, gDraftsRadioElemChoiceLocked, gTmplRadioElemChoiceLocked; … … 156 158 // For POP3 accounts, special folders are created at the account creation time. 157 159 var msgFolder = GetMsgFolderFromUri(uri, false); 158 InitFolderDisplays(msgFolder, accountPickerId, folderPickerId)160 vI.InitFolderDisplays(msgFolder, accountPickerId, folderPickerId) 159 161 160 162 switch (pickerMode) … … 210 212 function onSaveCopiesAndFolders() 211 213 { 212 SaveFolderSettings( gFccRadioElemChoice,214 vI.SaveFolderSettings( gFccRadioElemChoice, 213 215 "doFcc", 214 216 gFccFolderWithDelim, … … 218 220 "VIdent_identity.fccFolderPickerMode" ); 219 221 220 SaveFolderSettings( gDraftsRadioElemChoice,222 vI.SaveFolderSettings( gDraftsRadioElemChoice, 221 223 "messageDrafts", 222 224 gDraftsFolderWithDelim, … … 226 228 "VIdent_identity.draftFolderPickerMode" ); 227 229 228 SaveFolderSettings( gTmplRadioElemChoice,230 vI.SaveFolderSettings( gTmplRadioElemChoice, 229 231 "messageTemplates", 230 232 gTemplatesFolderWithDelim, … … 337 339 activeRadioElem.radioGroup.selectedItem = activeRadioElem; 338 340 } 341 vI.onInitCopiesAndFolders = onInitCopiesAndFolders; 342 vI.onSaveCopiesAndFolders = onSaveCopiesAndFolders; 343 }}); -
chrome/content/v_identity/vI_prefDialog_TB3.xul
r92fd25 rc3feaa 24 24 - ***** END LICENSE BLOCK ***** --> 25 25 26 <?xul-overlay href="chrome://v_identity/content/vI_prefDialog_TB3FolderPicker.xul"?> 26 27 <?xul-overlay href="chrome://v_identity/content/vI_prefDialog.xul"?> 27 <?xul-overlay href="chrome://v_identity/content/vI_prefDialog_TB3FolderPicker.xul"?>28 28 29 29 <!DOCTYPE overlay SYSTEM "chrome://v_identity/locale/vI_prefDialog.dtd"> … … 31 31 <dialog id="vI_prefDialog" 32 32 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 33 onload="v I_prefDialog.init();"33 onload="virtualIdentityExtension.prefDialog.init();" 34 34 buttons="accept,cancel,help" 35 ondialogaccept="v I_prefDialog.savePrefs();"36 ondialoghelp="vI_prefDialog.toggleHelp();"37 buttonlabelhelp="&vI_prefDialog.dlgHelpButton.label;"35 ondialogaccept="virtualIdentityExtension.prefDialog.savePrefs();" 36 ondialoghelp="virtualIdentityExtension.prefDialog.toggleHelp();" 37 buttonlabelhelp="&vI_prefDialog.dlgHelpButton.label;" 38 38 persist="screenX screenY" 39 39 title="&vI_prefDialog.dlgTitle.label;" > 40 40 41 <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" /> 42 <script type="application/x-javascript" 43 src="chrome://v_identity/content/vI_prefDialog_FolderPicker.js" /> 41 44 <script type="application/x-javascript" 42 45 src="chrome://v_identity/content/vI_prefDialog.js" /> 43 <script type="application/x-javascript"44 src="chrome://v_identity/content/vI_prefDialog_FolderPicker.js" />45 46 <script type="application/x-javascript" 46 47 src="chrome://v_identity/content/vI_helper.js" /> -
chrome/content/v_identity/vI_prefDialog_TB3FolderPicker.js
r92fd25 rc3feaa 42 42 * 43 43 * ***** END LICENSE BLOCK ***** */ 44 45 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 44 46 45 47 function InitFolderDisplays(msgFolder, accountPickerId, folderPickerId) { … … 123 125 formElement.setAttribute("value", radioElemChoice); 124 126 } 127 vI.InitFolderDisplays = InitFolderDisplays; 128 vI.SaveFolderSettings = SaveFolderSettings; 129 }}); -
chrome/content/v_identity/vI_rdfAccountMismatchDialog.js
r92fd25 rc3feaa 23 23 * ***** END LICENSE BLOCK ***** */ 24 24 25 var vI_rdfAccountMismatchDialog = { 25 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 26 var rdfAccountMismatchDialog = { 26 27 mismatchItems : null, 27 28 type : null, 28 29 29 30 init : function() { 30 vI_rdfAccountMismatchDialog.type = window.arguments[0];31 vI_rdfAccountMismatchDialog.mismatchItems = window.arguments[1];31 rdfAccountMismatchDialog.type = window.arguments[0]; 32 rdfAccountMismatchDialog.mismatchItems = window.arguments[1]; 32 33 33 34 // display the relevant help-tags 34 document.getElementById("rdfAccountMismatchDialog_vbox_" + vI_rdfAccountMismatchDialog.type).removeAttribute("hidden");35 document.getElementById("rdfAccountMismatchDialog_listhead_" + vI_rdfAccountMismatchDialog.type).removeAttribute("hidden");35 document.getElementById("rdfAccountMismatchDialog_vbox_" + rdfAccountMismatchDialog.type).removeAttribute("hidden"); 36 document.getElementById("rdfAccountMismatchDialog_listhead_" + rdfAccountMismatchDialog.type).removeAttribute("hidden"); 36 37 37 for (var i = 0; i < vI_rdfAccountMismatchDialog.mismatchItems.length; i++) {38 for (var i = 0; i < rdfAccountMismatchDialog.mismatchItems.length; i++) { 38 39 // var label = document.createElement("label"); 39 40 var listitem = document.createElement("listitem"); 40 41 listitem.setAttribute("id", "mismatchLine_" + i); 41 42 listitem.setAttribute("class", "mismatchLine"); 42 listitem.setAttribute("type", vI_rdfAccountMismatchDialog.type);43 listitem.setAttribute("oldkey", vI_rdfAccountMismatchDialog.mismatchItems[i].oldkey);44 listitem.setAttribute("label", vI_rdfAccountMismatchDialog.mismatchItems[i].label);45 listitem.setAttribute("ext1", vI_rdfAccountMismatchDialog.mismatchItems[i].ext1);46 listitem.setAttribute("ext2", vI_rdfAccountMismatchDialog.mismatchItems[i].ext2);47 listitem.setAttribute("count", vI_rdfAccountMismatchDialog.mismatchItems[i].count);43 listitem.setAttribute("type",rdfAccountMismatchDialog.type); 44 listitem.setAttribute("oldkey",rdfAccountMismatchDialog.mismatchItems[i].oldkey); 45 listitem.setAttribute("label",rdfAccountMismatchDialog.mismatchItems[i].label); 46 listitem.setAttribute("ext1",rdfAccountMismatchDialog.mismatchItems[i].ext1); 47 listitem.setAttribute("ext2",rdfAccountMismatchDialog.mismatchItems[i].ext2); 48 listitem.setAttribute("count",rdfAccountMismatchDialog.mismatchItems[i].count); 48 49 document.getElementById("rdfAccountMismatchDialog_listbox").appendChild(listitem) 49 50 } … … 51 52 52 53 accept : function() { 53 for (var i = 0; i < vI_rdfAccountMismatchDialog.mismatchItems.length; i++) {54 vI_rdfAccountMismatchDialog.mismatchItems[i].key = document.getElementById("mismatchLine_" + i).key54 for (var i = 0; i < rdfAccountMismatchDialog.mismatchItems.length; i++) { 55 rdfAccountMismatchDialog.mismatchItems[i].key = document.getElementById("mismatchLine_" + i).key 55 56 } 56 57 /* window.argument[2] stores callback parent */ 57 window.arguments[2].repairAccountMismatch( vI_rdfAccountMismatchDialog.type, vI_rdfAccountMismatchDialog.mismatchItems);58 window.arguments[2].repairAccountMismatch(rdfAccountMismatchDialog.type, rdfAccountMismatchDialog.mismatchItems); 58 59 } 59 60 } 60 window.addEventListener("load", vI_rdfAccountMismatchDialog.init, false); 61 window.addEventListener("load", rdfAccountMismatchDialog.init, false); 62 }}); -
chrome/content/v_identity/vI_rdfAccountMismatchDialog.xml
r92fd25 rc3feaa 155 155 <method name="_addIdentities"> 156 156 <body><![CDATA[ 157 v I_notificationBar.dump("## mismatchID-menupopup: _addIdentities.\n");157 virtualIdentityExtension.notificationBar.dump("## mismatchID-menupopup: _addIdentities.\n"); 158 158 var AccountManager = Components.classes["@mozilla.org/messenger/account-manager;1"] 159 159 .getService(Components.interfaces.nsIMsgAccountManager); … … 171 171 this.appendChild(menuitem); 172 172 } 173 } 174 173 } 174 ]]></body> 175 175 </method> 176 176 <method name="_addSmtp"> 177 177 <parameter name="server" /> 178 178 <body><![CDATA[ 179 v I_notificationBar.dump("## mismatchID-menupopup: _addSmtp.\n");179 virtualIdentityExtension.notificationBar.dump("## mismatchID-menupopup: _addSmtp.\n"); 180 180 const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; 181 181 var menuitem = document.createElementNS(XUL_NS, "menuitem"); // create a new XUL menuitem … … 185 185 menuitem.setAttribute("ext2", server.username); 186 186 menuitem.setAttribute("key", server.key); 187 this.appendChild(menuitem); 187 this.appendChild(menuitem); 188 188 ]]></body> 189 189 </method> 190 190 <method name="_addSmtpServers"> 191 191 <body><![CDATA[ 192 v I_notificationBar.dump("## mismatchID-menupopup: _addSmtpServers.\n");192 virtualIdentityExtension.notificationBar.dump("## mismatchID-menupopup: _addSmtpServers.\n"); 193 193 194 194 const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; 195 195 var menuitem = document.createElementNS(XUL_NS, "menuitem"); // create a new XUL menuitem 196 196 menuitem.setAttribute("class", "mismatchMenuitem"); 197 const vI_DEFAULT_SMTP_TAG = "vI_useDefaultSMTP" 198 menuitem.setAttribute("key", vI_DEFAULT_SMTP_TAG); 197 menuitem.setAttribute("key", virtualIdentityExtension.identityData.DEFAULT_SMTP_TAG); 199 198 menuitem.setAttribute("label", document.getElementById("bundle_messenger").getString("defaultServerTag")); 200 199 this.appendChild(menuitem); … … 206 205 if (server instanceof Components.interfaces.nsISmtpServer && !server.redirectorType) this._addSmtp(server); 207 206 } 208 207 ]]></body> 209 208 </method> 210 209 <constructor> 211 210 <![CDATA[ 212 v I_notificationBar.dump("## mismatchID-menupopup: constructor.\n");211 virtualIdentityExtension.notificationBar.dump("## mismatchID-menupopup: constructor.\n"); 213 212 const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; 214 213 this.appendChild(document.createElementNS(XUL_NS, "menuseparator")); // create a new XUL menuseparator 215 214 if (this.getAttribute("type") == "identity") this._addIdentities(); 216 215 else this._addSmtpServers(); 217 216 ]]> 218 217 </constructor> 219 218 </implementation> -
chrome/content/v_identity/vI_rdfAccountMismatchDialog.xul
r92fd25 rc3feaa 32 32 buttons="accept" 33 33 title="&vident.vI_rdfAccountMismatchDialog.title;" 34 ondialogaccept="v I_rdfAccountMismatchDialog.accept();"35 ondialogcancel="v I_rdfAccountMismatchDialog.accept();"34 ondialogaccept="virtualIdentityExtension.rdfAccountMismatchDialog.accept();" 35 ondialogcancel="virtualIdentityExtension.rdfAccountMismatchDialog.accept();" 36 36 zlevel="6"> 37 <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" /> 37 38 <script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/> 38 39 <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfAccountMismatchDialog.js" /> -
chrome/content/v_identity/vI_rdfDataEditor.js
r92fd25 rc3feaa 23 23 * ***** END LICENSE BLOCK ***** */ 24 24 25 var vI_rdfDataEditor = { 25 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 26 var rdfDataEditor = { 26 27 __rdfDatasource : null, 27 28 __rdfDataTree : null, … … 44 45 init : function() { 45 46 if (window.arguments[0]["recipientCol"]) 46 vI_rdfDataEditor.__recipient = window.arguments[0]["recipientCol"];47 vI_rdfDataEditor.__type = window.arguments[1];48 vI_rdfDataEditor.__rdfDatasource = window.arguments[2];49 vI_rdfDataEditor.__rdfDataTree = window.arguments[3];47 rdfDataEditor.__recipient = window.arguments[0]["recipientCol"]; 48 rdfDataEditor.__type = window.arguments[1]; 49 rdfDataEditor.__rdfDatasource = window.arguments[2]; 50 rdfDataEditor.__rdfDataTree = window.arguments[3]; 50 51 ; 51 vI_rdfDataEditor.__identityData = new vI_identityData();52 vI_rdfDataEditor.__identityData.copy(window.arguments[0].identityData);52 rdfDataEditor.__identityData = new vI.identityData(); 53 rdfDataEditor.__identityData.copy(window.arguments[0].identityData); 53 54 54 55 55 56 // set recipient 56 document.getElementById("recipient").value = vI_rdfDataEditor.__recipient;57 document.getElementById("recipient").value = rdfDataEditor.__recipient; 57 58 58 59 // set type of entry (and populate Menu) 59 60 var typeMenuPopup = document.getElementById("type_menu_popup") 60 for each ( typeField in Array("email", "maillist", "newsgroup", "filter")) {61 for each (var typeField in Array("email", "maillist", "newsgroup", "filter")) { 61 62 var menuitem = document.createElement("menuitem"); 62 63 var label = document.getElementById("vI_rdfDataTreeBundle").getString("vI_rdfDataTree.dataType." + typeField) … … 64 65 menuitem.setAttribute("key", typeField); 65 66 typeMenuPopup.appendChild(menuitem); 66 if (typeField == vI_rdfDataEditor.__type) document.getElementById("type_menu").selectedItem = menuitem67 if (typeField == rdfDataEditor.__type) document.getElementById("type_menu").selectedItem = menuitem 67 68 } 68 69 69 70 // set sender 70 document.getElementById("sender").value = vI_rdfDataEditor.__identityData.combinedName;71 document.getElementById("sender").value = rdfDataEditor.__identityData.combinedName; 71 72 72 73 // set Identity 73 vI_rdfDataEditor.__populateIdentityMenu();74 rdfDataEditor.__populateIdentityMenu(); 74 75 var MenuItems = document.getElementById("identity_list_popup").childNodes; 75 76 for (var index = 0; index < MenuItems.length; index++) { 76 if (MenuItems[index].getAttribute("value") == vI_rdfDataEditor.__identityData.id.key) {77 if (MenuItems[index].getAttribute("value") == rdfDataEditor.__identityData.id.key) { 77 78 document.getElementById("identity_list").selectedItem = 78 79 MenuItems[index]; … … 83 84 // set SMTP 84 85 document.getElementById("smtpServerListHbox").addNoneServer(); // add non (not stored) Server 85 document.getElementById("smtpServerListHbox").smtp = vI_rdfDataEditor.__identityData.smtp.keyNice;86 document.getElementById("smtpServerListHbox").smtp = rdfDataEditor.__identityData.smtp.keyNice; 86 87 87 88 // set extra values 88 vI_rdfDataEditor.__identityData.extras.setEditorValues();89 vI _storageExtrasHelper.hideUnusedEditorFields();89 rdfDataEditor.__identityData.extras.setEditorValues(); 90 vI.storageExtrasHelper.hideUnusedEditorFields(); 90 91 }, 91 92 92 93 blurEvent : function(elementId) { 93 94 var elem = document.getElementById(elementId); 94 var localIdentityData = new vI _identityData(elem.value, null, null, null, null, null, null);95 var localIdentityData = new vI.identityData(elem.value, null, null, null, null, null, null); 95 96 elem.value = localIdentityData.combinedName; 96 97 }, 97 98 98 99 accept : function() { 99 var localIdentityData = new vI _identityData(document.getElementById("sender").value, null,100 var localIdentityData = new vI.identityData(document.getElementById("sender").value, null, 100 101 document.getElementById("identity_list").selectedItem.getAttribute("value"), 101 102 document.getElementById("smtp_server_list").selectedItem.getAttribute("key")); 102 103 localIdentityData.extras.readEditorValues(); 103 104 104 vI_rdfDataEditor.__rdfDatasource.updateRDF(105 rdfDataEditor.__rdfDatasource.updateRDF( 105 106 document.getElementById("recipient").value, 106 107 document.getElementById("type_menu").selectedItem.getAttribute("key"), 107 108 localIdentityData, 108 true, true, vI_rdfDataEditor.__recipient, vI_rdfDataEditor.__type);109 true, true, rdfDataEditor.__recipient, rdfDataEditor.__type); 109 110 110 111 return document.getElementById("type_menu").selectedItem.getAttribute("key"); 111 112 } 112 113 } 114 vI.rdfDataEditor = rdfDataEditor; 115 }}); -
chrome/content/v_identity/vI_rdfDataEditor.xul
r92fd25 rc3feaa 32 32 <dialog id="vI_rdfDataEditor" 33 33 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 34 onload="v I_rdfDataEditor.init();"35 ondialogaccept="window.arguments[3].treeType = v I_rdfDataEditor.accept();"34 onload="virtualIdentityExtension.rdfDataEditor.init();" 35 ondialogaccept="window.arguments[3].treeType = virtualIdentityExtension.rdfDataEditor.accept();" 36 36 title="&vI_rdfDataEditor.dlgTitle.label;" > 37 37 38 <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" /> 38 39 <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDataEditor.js" /> 39 40 <script type="application/x-javascript" src="chrome://v_identity/content/vI_identityData.js" /> … … 68 69 <label value="&vI_rdfDataEditor.sender.label;" accesskey="&vI_rdfDataEditor.sender.accesskey;" control="sender"/> 69 70 <spacer flex="1"/></vbox> 70 <textbox id="sender" flex="1" onblur="v I_rdfDataEditor.blurEvent('sender')" />71 <textbox id="sender" flex="1" onblur="virtualIdentityExtension.rdfDataEditor.blurEvent('sender')" /> 71 72 </hbox> 72 73 <hbox> -
chrome/content/v_identity/vI_rdfDataTree.js
r92fd25 rc3feaa 29 29 */ 30 30 31 31 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 32 32 //prepares an object for easy comparison against another. for strings, lowercases them 33 33 function prepareForComparison (o) { … … 38 38 39 39 40 function rdfDataTree(treeType, vI_rdfDatasource) {40 function rdfDataTree(treeType, rdfDatasource) { 41 41 this.treeType = treeType; 42 this._ vI_rdfDatasource = vI_rdfDatasource;42 this._rdfDatasource = rdfDatasource; 43 43 this.filterText = ""; 44 44 this.loadTable(); 45 } 45 }; 46 46 47 rdfDataTree.prototype = { 47 48 idTable : null, … … 49 50 filterText : null, 50 51 treeType : null, 51 _ vI_rdfDatasource : null,52 _rdfDatasource : null, 52 53 53 54 get treeElem() { return document.getElementById("rdfDataTree_" + this.treeType); }, … … 56 57 //this function is called every time the tree is sorted, filtered, or reloaded 57 58 loadTable : function() { 58 // if (vI _notificationBar) vI_notificationBar.dump("## rdfDataTree: loadTable.\n");59 // if (vI.notificationBar) vI.notificationBar.dump("## rdfDataTree: loadTable.\n"); 59 60 //remember scroll position. this is useful if this is an editable table 60 61 //to prevent the user from losing the row they edited … … 63 64 if (this.idData == null) { 64 65 this.idData = []; 65 this._ vI_rdfDatasource.readAllEntriesFromRDF(this.addNewDatum, this.treeType, this.idData);66 this._rdfDatasource.readAllEntriesFromRDF(this.addNewDatum, this.treeType, this.idData); 66 67 } 67 68 if (this.filterText == "") { … … 92 93 // set Tab label 93 94 this.tabElem.setAttribute("label", this.treeType + " (" + this.idTable.length + ")"); 94 // if (vI _notificationBar) vI_notificationBar.dump("## rdfDataTree: loadTable done.\n");95 // if (vI.notificationBar) vI.notificationBar.dump("## rdfDataTree: loadTable done.\n"); 95 96 }, 96 97 … … 105 106 resource : resource, 106 107 identityData : localIdentityData} 107 // vI _notificationBar.dump("## addNewDatum.\n");108 // vI.notificationBar.dump("## addNewDatum.\n"); 108 109 localIdentityData.extras.addPrefs(pref); 109 110 idData.push(pref); 110 111 }, 111 112 sort : function(columnName) { 112 // vI _notificationBar.dump("## sort: " + columnName + ".\n");113 // vI.notificationBar.dump("## sort: " + columnName + ".\n"); 113 114 var order = this.treeElem.getAttribute("sortDirection") == "ascending" ? 1 : -1; 114 115 //if the column is passed and it's already sorted by that column, reverse sort … … 130 131 this.treeElem.setAttribute("sortResource", columnName); 131 132 132 this.treeElem.view = new vI_rdfDataTree.treeView(this.idTable);133 this.treeElem.view = new rdfDataTreeCollection.treeView(this.idTable); 133 134 134 135 //set the appropriate attributes to show to indicator … … 140 141 } 141 142 } 142 } 143 144 var vI_rdfDataTree= {143 }; 144 145 var rdfDataTreeCollection = { 145 146 promptService : Components.classes["@mozilla.org/embedcomp/prompt-service;1"] 146 147 .getService(Components.interfaces.nsIPromptService), … … 152 153 153 154 _strings : null, 154 _ vI_rdfDatasource : null,155 _rdfDatasource : null, 155 156 156 157 onTabSelect : function () { 157 vI_rdfDataTree.hideInfoBox();158 if ( vI_rdfDataTree.tabbox) {159 vI_rdfDataTree.moveConstraints();160 vI_rdfDataTree.updateButtonMenu();158 rdfDataTreeCollection.hideInfoBox(); 159 if (rdfDataTreeCollection.tabbox) { 160 rdfDataTreeCollection.moveConstraints(); 161 rdfDataTreeCollection.updateButtonMenu(); 161 162 } 162 163 }, 163 164 164 165 onselect : function () { 165 vI_rdfDataTree.moveConstraints();166 vI_rdfDataTree.updateButtonMenu();167 168 var tree = vI_rdfDataTree.trees[vI_rdfDataTree.tabbox.selectedPanel.id];169 var htmlBox = document.getElementById(" vI_rdfDataTreeInfoBox")166 rdfDataTreeCollection.moveConstraints(); 167 rdfDataTreeCollection.updateButtonMenu(); 168 169 var tree = rdfDataTreeCollection.trees[rdfDataTreeCollection.tabbox.selectedPanel.id]; 170 var htmlBox = document.getElementById("rdfDataTreeCollectionInfoBox") 170 171 if (tree.treeElem.view.selection.count != 1) 171 { vI_rdfDataTree.hideInfoBox(); return; }172 { rdfDataTreeCollection.hideInfoBox(); return; } 172 173 173 174 var identityData = tree.idTable[tree.treeElem.currentIndex]["identityData"]; … … 185 186 186 187 htmlBox.outputString = _identityInfo; 187 vI_rdfDataTree.infoBoxHidden = false;188 rdfDataTreeCollection.infoBoxHidden = false; 188 189 htmlBox.setAttribute("style", "height:" + htmlBox.contentDocument.lastChild.scrollHeight +"px"); 189 vI_rdfDataTree.overflow(); // better resize one time too much, mozilla is still magic :)190 rdfDataTreeCollection.overflow(); // better resize one time too much, mozilla is still magic :) 190 191 }, 191 192 192 193 init : function() { 193 vI_rdfDataTree.tabbox = document.getElementById("TreeTabbox");194 vI_rdfDataTree._strings = document.getElementById("vI_rdfDataTreeBundle");195 196 vI_rdfDataTree._vI_rdfDatasource = new vI_rdfDatasource("virtualIdentity.rdf");197 198 for each (var treeType in vI_rdfDataTree.treeTypes)199 vI_rdfDataTree.trees[treeType] = new rdfDataTree(treeType, vI_rdfDataTree._vI_rdfDatasource);194 rdfDataTreeCollection.tabbox = document.getElementById("TreeTabbox"); 195 rdfDataTreeCollection._strings = document.getElementById("vI_rdfDataTreeBundle"); 196 197 rdfDataTreeCollection._rdfDatasource = new vI.rdfDatasource("virtualIdentity.rdf"); 198 199 for each (var treeType in rdfDataTreeCollection.treeTypes) 200 rdfDataTreeCollection.trees[treeType] = new rdfDataTree(treeType, rdfDataTreeCollection._rdfDatasource); 200 201 }, 201 202 202 203 clean : function() { 203 if ( vI_rdfDataTree._vI_rdfDatasource) vI_rdfDataTree._vI_rdfDatasource.clean();204 if (rdfDataTreeCollection._rdfDatasource) rdfDataTreeCollection._rdfDatasource.clean(); 204 205 }, 205 206 … … 219 220 this.getCellText = function(row, col) { 220 221 var retValue = table[row][col.id.substr(0,col.id.indexOf("_"))]; 221 if (! vI_rdfDataTree._braille && (retValue == "no" || retValue == "yes"))222 if (!rdfDataTreeCollection._braille && (retValue == "no" || retValue == "yes")) 222 223 return ""; // image will be used as indicator 223 224 else return retValue; … … 241 242 this.getColumnProperties = function(colid,col,props){}; 242 243 this.cycleHeader = function(col, elem) { 243 var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;244 var treeType = rdfDataTreeCollection.tabbox.selectedPanel.id; 244 245 if (treeType != "filter") 245 vI_rdfDataTree.trees[treeType].sort(col.id.substr(0,col.id.indexOf("_")));246 rdfDataTreeCollection.trees[treeType].sort(col.id.substr(0,col.id.indexOf("_"))); 246 247 }; 247 248 this.getCellProperties = function(row,col,props){ 248 if ( vI_rdfDataTree._braille) return;249 if (rdfDataTreeCollection._braille) return; 249 250 var aserv=Components.classes["@mozilla.org/atom-service;1"]. 250 251 getService(Components.interfaces.nsIAtomService); … … 259 260 __setFilter : function (text) { 260 261 // loop trough all trees 261 for each (var treeType in vI_rdfDataTree.treeTypes) {262 var tree = vI_rdfDataTree.trees[treeType];262 for each (var treeType in rdfDataTreeCollection.treeTypes) { 263 var tree = rdfDataTreeCollection.trees[treeType]; 263 264 tree.filterText = text; 264 265 tree.loadTable(); … … 269 270 //do this now rather than doing it at every comparison 270 271 var value = prepareForComparison(event.target.value); 271 vI_rdfDataTree.__setFilter(value);272 rdfDataTreeCollection.__setFilter(value); 272 273 document.getElementById("clearFilter").disabled = value.length == 0; 273 274 }, … … 278 279 filterElement.focus(); 279 280 filterElement.value = ""; 280 vI_rdfDataTree.__setFilter("");281 rdfDataTreeCollection.__setFilter(""); 281 282 }, 282 283 283 284 __updateMenu : function(modifySelected, removeSelected) { 284 var tree = vI_rdfDataTree.trees[vI_rdfDataTree.tabbox.selectedPanel.id];285 var tree = rdfDataTreeCollection.trees[rdfDataTreeCollection.tabbox.selectedPanel.id]; 285 286 var noSelections = (tree.treeElem.view.selection.count == 0) 286 287 modifySelected.setAttribute("disabled", noSelections) … … 289 290 290 291 updateButtonMenu : function() { 291 vI_rdfDataTree.__updateMenu(292 document.getElementById("editButton_" + vI_rdfDataTree.tabbox.selectedPanel.id),293 document.getElementById("deleteButton_" + vI_rdfDataTree.tabbox.selectedPanel.id))292 rdfDataTreeCollection.__updateMenu( 293 document.getElementById("editButton_" + rdfDataTreeCollection.tabbox.selectedPanel.id), 294 document.getElementById("deleteButton_" + rdfDataTreeCollection.tabbox.selectedPanel.id)) 294 295 }, 295 296 296 297 updateContextMenu : function() { 297 vI_rdfDataTree.__updateMenu(298 rdfDataTreeCollection.__updateMenu( 298 299 document.getElementById("context_modifySelected"), 299 300 document.getElementById("context_removeSelected")) … … 301 302 302 303 updateMenu : function() { 303 vI_rdfDataTree.__updateMenu(304 rdfDataTreeCollection.__updateMenu( 304 305 document.getElementById("menu_modifySelected"), 305 306 document.getElementById("menu_removeSelected")) … … 307 308 308 309 modifySelected : function() { 309 var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;310 var tree = vI_rdfDataTree.trees[treeType];310 var treeType = rdfDataTreeCollection.tabbox.selectedPanel.id; 311 var tree = rdfDataTreeCollection.trees[treeType]; 311 312 if (tree.treeElem.view.selection.count == 0) return; 312 313 if (tree.treeElem.view.selection.count > 5) { 313 var warning = vI_rdfDataTree._strings.getString("vI_rdfDataTree.modify.Warning1") + " " +314 var warning = rdfDataTreeCollection._strings.getString("rdfDataTree.modify.Warning1") + " " + 314 315 tree.treeElem.view.selection.count + " " + 315 vI_rdfDataTree._strings.getString("vI_rdfDataTree.modify.Warning2")316 if (! vI_rdfDataTree.promptService.confirm(window,"Warning",warning)) return;316 rdfDataTreeCollection._strings.getString("rdfDataTree.modify.Warning2") 317 if (!rdfDataTreeCollection.promptService.confirm(window,"Warning",warning)) return; 317 318 } 318 319 … … 327 328 "chrome, dialog, modal, alwaysRaised, resizable=yes", 328 329 tree.idTable[v], treeType, 329 vI_rdfDataTree._vI_rdfDatasource, retVar).focus();330 rdfDataTreeCollection._rdfDatasource, retVar).focus(); 330 331 } 331 332 332 333 // reload all trees (multiple types might have changed) 333 for each (var treeType in vI_rdfDataTree.treeTypes) {334 vI_rdfDataTree.trees[treeType].idData = null;335 vI_rdfDataTree.trees[treeType].idTable = null;336 vI_rdfDataTree.trees[treeType].loadTable()337 } 338 vI_rdfDataTree.tabbox.selectedTab = document.getElementById(retVar.treeType + "Tab");339 vI_rdfDataTree.hideInfoBox();334 for each (var treeType in rdfDataTreeCollection.treeTypes) { 335 rdfDataTreeCollection.trees[treeType].idData = null; 336 rdfDataTreeCollection.trees[treeType].idTable = null; 337 rdfDataTreeCollection.trees[treeType].loadTable() 338 } 339 rdfDataTreeCollection.tabbox.selectedTab = document.getElementById(retVar.treeType + "Tab"); 340 rdfDataTreeCollection.hideInfoBox(); 340 341 }, 341 342 342 343 removeSelected : function() { 343 var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;344 var tree = vI_rdfDataTree.trees[treeType];344 var treeType = rdfDataTreeCollection.tabbox.selectedPanel.id; 345 var tree = rdfDataTreeCollection.trees[treeType]; 345 346 if (tree.treeElem.view.selection.count == 0) return; 346 var warning = vI_rdfDataTree._strings.getString("vI_rdfDataTree.remove.Warning1") + " " +347 var warning = rdfDataTreeCollection._strings.getString("rdfDataTreeCollection.remove.Warning1") + " " + 347 348 tree.treeElem.view.selection.count + " " + 348 vI_rdfDataTree._strings.getString("vI_rdfDataTree.remove.Warning2")349 350 if (! vI_rdfDataTree.promptService.confirm(window,"Warning",warning)) return;349 rdfDataTreeCollection._strings.getString("rdfDataTreeCollection.remove.Warning2") 350 351 if (!rdfDataTreeCollection.promptService.confirm(window,"Warning",warning)) return; 351 352 352 353 var start = new Object(); var end = new Object(); … … 356 357 tree.treeElem.view.selection.getRangeAt(t,start,end); 357 358 for (var v=start.value; v<=end.value; v++){ 358 vI_rdfDataTree._vI_rdfDatasource.removeVIdentityFromRDF(tree.idTable[v]["resource"], treeType)359 rdfDataTreeCollection._rdfDatasource.removeVIdentityFromRDF(tree.idTable[v]["resource"], treeType) 359 360 } 360 361 } … … 362 363 tree.idData = null; tree.idTable = null; 363 364 tree.loadTable(); 364 vI_rdfDataTree.hideInfoBox();365 rdfDataTreeCollection.hideInfoBox(); 365 366 }, 366 367 367 368 moveConstraints : function() { 368 var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;369 var treeType = rdfDataTreeCollection.tabbox.selectedPanel.id; 369 370 if (treeType != "filter") return; 370 var tree = vI_rdfDataTree.trees[treeType];371 var tree = rdfDataTreeCollection.trees[treeType]; 371 372 if (tree.treeElem.view.selection.count == 0) { 372 373 document.getElementById("reorderUpButton_filter").setAttribute("disabled","true"); … … 391 392 392 393 moveUpSelected : function() { 393 var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;394 var treeType = rdfDataTreeCollection.tabbox.selectedPanel.id; 394 395 if (treeType != "filter") return; // just to be safe, button should be disabled 395 var tree = vI_rdfDataTree.trees[treeType];396 var tree = rdfDataTreeCollection.trees[treeType]; 396 397 if (tree.treeElem.view.selection.count == 0) return; // just to be safe, button should be disabled 397 398 … … 402 403 tree.treeElem.view.selection.getRangeAt(0,start,end); 403 404 for (var v=start.value; v<=end.value; v++){ 404 var resource = vI_rdfDataTree._vI_rdfDatasource.filterContainer.RemoveElementAt(v+1, true);405 vI_rdfDataTree._vI_rdfDatasource.filterContainer.InsertElementAt(resource,v,true);405 var resource = rdfDataTreeCollection._rdfDatasource.filterContainer.RemoveElementAt(v+1, true); 406 rdfDataTreeCollection._rdfDatasource.filterContainer.InsertElementAt(resource,v,true); 406 407 } 407 408 tree.idData = null; tree.idTable = null; … … 411 412 412 413 moveDownSelected : function() { 413 var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;414 var treeType = rdfDataTreeCollection.tabbox.selectedPanel.id; 414 415 if (treeType != "filter") return; // just to be safe, button should be disabled 415 var tree = vI_rdfDataTree.trees[treeType];416 var tree = rdfDataTreeCollection.trees[treeType]; 416 417 if (tree.treeElem.view.selection.count == 0) return; // just to be safe, button should be disabled 417 418 … … 422 423 tree.treeElem.view.selection.getRangeAt(0,start,end); 423 424 for (var v=end.value; v>=start.value; v--){ 424 var resource = vI_rdfDataTree._vI_rdfDatasource.filterContainer.RemoveElementAt(v+1, true);425 vI_rdfDataTree._vI_rdfDatasource.filterContainer.InsertElementAt(resource,v+2,true);425 var resource = rdfDataTreeCollection._rdfDatasource.filterContainer.RemoveElementAt(v+1, true); 426 rdfDataTreeCollection._rdfDatasource.filterContainer.InsertElementAt(resource,v+2,true); 426 427 } 427 428 tree.idData = null; tree.idTable = null; … … 432 433 infoBoxHidden : true, 433 434 overflow : function() { 434 if ( vI_rdfDataTree.infoBoxHidden) return;435 var htmlBox = document.getElementById(" vI_rdfDataTreeInfoBox")435 if (rdfDataTreeCollection.infoBoxHidden) return; 436 var htmlBox = document.getElementById("rdfDataTreeCollectionInfoBox") 436 437 htmlBox.setAttribute("style", "height:" + htmlBox.contentDocument.lastChild.scrollHeight +"px"); 437 438 }, 438 439 439 440 hideInfoBox : function() { 440 vI_rdfDataTree.infoBoxHidden = true;441 document.getElementById(" vI_rdfDataTreeInfoBox").setAttribute("style", "height:0px");442 for each (var treeType in vI_rdfDataTree.treeTypes) {443 try { if ( vI_rdfDataTree.trees[treeType])444 vI_rdfDataTree.trees[treeType].treeElem.view.selection.selectNone() } catch (e) { }441 rdfDataTreeCollection.infoBoxHidden = true; 442 document.getElementById("rdfDataTreeCollectionInfoBox").setAttribute("style", "height:0px"); 443 for each (var treeType in rdfDataTreeCollection.treeTypes) { 444 try { if (rdfDataTreeCollection.trees[treeType]) 445 rdfDataTreeCollection.trees[treeType].treeElem.view.selection.selectNone() } catch (e) { } 445 446 } 446 447 }, 447 448 448 449 selectAll : function() { 449 var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;450 var tree = vI_rdfDataTree.trees[treeType];450 var treeType = rdfDataTreeCollection.tabbox.selectedPanel.id; 451 var tree = rdfDataTreeCollection.trees[treeType]; 451 452 tree.treeElem.view.selection.selectAll(); 452 453 }, 453 454 454 455 newItem : function() { 455 var treeType = vI_rdfDataTree.tabbox.selectedPanel.id; 456 var newItemPreset = { identityData : new vI_identityData ("", null, null, vI_NO_SMTP_TAG, null, null) }; 457 // XXXX create useful preset 456 var treeType = rdfDataTreeCollection.tabbox.selectedPanel.id; 457 var newItemPreset = { identityData : new vI.identityData ("", null, null, vI.NO_SMTP_TAG, null, null) }; 458 458 var retVar = { treeType: null }; 459 459 … … 461 461 "chrome, dialog, modal, alwaysRaised, resizable=yes", 462 462 newItemPreset, treeType, 463 vI_rdfDataTree._vI_rdfDatasource, retVar).focus();463 rdfDataTreeCollection._rdfDatasource, retVar).focus(); 464 464 465 465 // reload all trees (multiple types might have changed) 466 for each (var treeType in vI_rdfDataTree.treeTypes) {467 vI_rdfDataTree.trees[treeType].idData = null;468 vI_rdfDataTree.trees[treeType].idTable = null;469 vI_rdfDataTree.trees[treeType].loadTable()470 } 471 vI_rdfDataTree.tabbox.selectedTab = document.getElementById(retVar.treeType + "Tab");472 vI_rdfDataTree.hideInfoBox();466 for each (var treeType in rdfDataTreeCollection.treeTypes) { 467 rdfDataTreeCollection.trees[treeType].idData = null; 468 rdfDataTreeCollection.trees[treeType].idTable = null; 469 rdfDataTreeCollection.trees[treeType].loadTable() 470 } 471 rdfDataTreeCollection.tabbox.selectedTab = document.getElementById(retVar.treeType + "Tab"); 472 rdfDataTreeCollection.hideInfoBox(); 473 473 } 474 474 }; 475 dump("registering global rdfDataTreeCollection\n"); 476 vI.rdfDataTreeCollection = rdfDataTreeCollection; 477 vI.rdfDataTree = rdfDataTree; 478 dump("registering global rdfDataTreeCollection done " + vI.initTime + " " + vI.rdfDataTreeCollection + "\n"); 479 }}); -
chrome/content/v_identity/vI_rdfDataTree.xul
r92fd25 rc3feaa 57 57 height="500" 58 58 persist="width,height,screenX,screenY" 59 onload="v I_rdfDataTree.init();"60 onunload="v I_rdfDataTree.clean();"59 onload="virtualIdentityExtension.rdfDataTreeCollection.init();" 60 onunload="virtualIdentityExtension.rdfDataTreeCollection.clean();" 61 61 title="&vI_rdfDataTree.dlgTitle.label;"> 62 62 63 <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" /> 64 <script type="application/x-javascript" src="chrome://v_identity/content/vI_helper.js" /> 65 <script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/> 66 <script type="application/x-javascript" src="chrome://v_identity/content/vI_identityData.js" /> 67 <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDatasource.js" /> 63 68 <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDataTree.js" /> 64 <script type="application/x-javascript" src="chrome://v_identity/content/vI_identityData.js" />65 <script type="application/x-javascript" src="chrome://v_identity/content/vI_helper.js" />66 <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDatasource.js" />67 <script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/>68 69 <script type="application/x-javascript" src="chrome://messenger/content/messengercompose/MsgComposeCommands.js"/> 69 70 … … 82 83 </menupopup> 83 84 84 <menupopup id="configContext" onpopupshowing="if (event.target == this) v I_rdfDataTree.updateContextMenu();">85 <menupopup id="configContext" onpopupshowing="if (event.target == this) virtualIdentityExtension.rdfDataTreeCollection.updateContextMenu();"> 85 86 <menuitem id="context_modifySelected" label="&vI_rdfDataTree.modifySelected.label;" 86 oncommand="v I_rdfDataTree.modifySelected(this);"/>87 oncommand="virtualIdentityExtension.rdfDataTreeCollection.modifySelected(this);"/> 87 88 <menuitem id="context_removeSelected" label="&vI_rdfDataTree.removeSelected.label;" 88 oncommand="v I_rdfDataTree.removeSelected();"/>89 oncommand="virtualIdentityExtension.rdfDataTreeCollection.removeSelected();"/> 89 90 <menuitem id="context_newItem" label="&vI_rdfDataTree.newItem.label;" 90 oncommand="v I_rdfDataTree.newItem();"/>91 oncommand="virtualIdentityExtension.rdfDataTreeCollection.newItem();"/> 91 92 <menuseparator /> 92 93 <menuitem id="context_menu_selectAll" label="&selectAllCmd.label;" 93 oncommand="v I_rdfDataTree.selectAll();"/>94 oncommand="virtualIdentityExtension.rdfDataTreeCollection.selectAll();"/> 94 95 </menupopup> 95 96 96 97 <keyset> 97 <key keycode="VK_ENTER" oncommand="v I_rdfDataTree.modifySelected();"/>98 <key keycode="VK_RETURN" oncommand="v I_rdfDataTree.modifySelected();"/>99 <key keycode="VK_DELETE" oncommand="v I_rdfDataTree.removeSelected();"/>100 <key modifiers="accel" key="&selectAllCmd.accesskey;" oncommand="v I_rdfDataTree.selectAll();"/>98 <key keycode="VK_ENTER" oncommand="virtualIdentityExtension.rdfDataTreeCollection.modifySelected();"/> 99 <key keycode="VK_RETURN" oncommand="virtualIdentityExtension.rdfDataTreeCollection.modifySelected();"/> 100 <key keycode="VK_DELETE" oncommand="virtualIdentityExtension.rdfDataTreeCollection.removeSelected();"/> 101 <key modifiers="accel" key="&selectAllCmd.accesskey;" oncommand="virtualIdentityExtension.rdfDataTreeCollection.selectAll();"/> 101 102 </keyset> 102 103 … … 108 109 <menu id="editMenu" label="&vI_rdfDataTree.editMenu.label;" 109 110 accesskey="&vI_rdfDataTree.editMenu.accesskey;"> 110 <menupopup onpopupshowing="if (event.target == this) v I_rdfDataTree.updateMenu();">111 <menupopup onpopupshowing="if (event.target == this) virtualIdentityExtension.rdfDataTreeCollection.updateMenu();"> 111 112 <menuitem id="menu_modifySelected" label="&vI_rdfDataTree.modifySelected.label;" 112 113 accesskey="&vI_rdfDataTree.modifySelected.accesskey;" 113 oncommand="v I_rdfDataTree.modifySelected();"/>114 oncommand="virtualIdentityExtension.rdfDataTreeCollection.modifySelected();"/> 114 115 <menuitem id="menu_removeSelected" label="&vI_rdfDataTree.removeSelected.label;" 115 116 accesskey="&vI_rdfDataTree.removeSelected.accesskey;" 116 oncommand="v I_rdfDataTree.removeSelected();"/>117 oncommand="virtualIdentityExtension.rdfDataTreeCollection.removeSelected();"/> 117 118 <menuitem id="menu_newItem" label="&vI_rdfDataTree.newItem.label;" 118 119 accesskey="&vI_rdfDataTree.newItem.accesskey;" 119 oncommand="v I_rdfDataTree.newItem();"/>120 oncommand="virtualIdentityExtension.rdfDataTreeCollection.newItem();"/> 120 121 <menuseparator /> 121 122 <menuitem id="menu_menu_selectAll" label="&selectAllCmd.label;" accesskey="&selectAllCmd.accesskey;" 122 oncommand="v I_rdfDataTree.selectAll();"/>123 oncommand="virtualIdentityExtension.rdfDataTreeCollection.selectAll();"/> 123 124 </menupopup> 124 125 </menu> 125 126 <menu id="tasksMenu" label="&tasksMenu.label;" accesskey="&tasksMenu.accesskey;"> 126 127 <menupopup> 127 <menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="var vI_localRdfDatasource = new v I_rdfDatasourceImporter('virtualIdentity.rdf');"/>128 <menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand="var vI_localRdfDatasource = new v I_rdfDatasource(); vI_localRdfDatasource.export('virtualIdentity.rdf')"/>128 <menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasourceImporter('virtualIdentity.rdf');"/> 129 <menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasource(); vI_localRdfDatasource.export('virtualIdentity.rdf')"/> 129 130 </menupopup> 130 131 </menu> … … 133 134 <spacer width="20px" /> 134 135 <label value="&vI_rdfDataTree.filterPrefs.label;" accesskey="&vI_rdfDataTree.filterPrefs.accesskey;" control="filter"/> 135 <textbox id="filter" flex="1" oninput="v I_rdfDataTree.inputFilter(event);"/>136 <button id="clearFilter" label="&vI_rdfDataTree.showAll.label;" accesskey="&vI_rdfDataTree.showAll.accesskey;" oncommand="v I_rdfDataTree.clearFilter();" disabled="true"/>136 <textbox id="filter" flex="1" oninput="virtualIdentityExtension.rdfDataTreeCollection.inputFilter(event);"/> 137 <button id="clearFilter" label="&vI_rdfDataTree.showAll.label;" accesskey="&vI_rdfDataTree.showAll.accesskey;" oncommand="virtualIdentityExtension.rdfDataTreeCollection.clearFilter();" disabled="true"/> 137 138 </hbox> 138 139 139 140 <tabbox id="TreeTabbox" flex="1"> 140 <tabs onselect="v I_rdfDataTree.onTabSelect();" >141 <tabs onselect="virtualIdentityExtension.rdfDataTreeCollection.onTabSelect();" > 141 142 <tab id="emailTab" /> 142 143 <tab id="maillistTab" /> … … 149 150 <tree id="rdfDataTree_email" flex="1" class="plain" seltype="multiple" 150 151 persist="sortDirection sortResource" sortDirection="ascending" sortResource="recipientCol" 151 enableColumnDrag="true" context="configContext" onselect="v I_rdfDataTree.onselect(this);">152 enableColumnDrag="true" context="configContext" onselect="virtualIdentityExtension.rdfDataTreeCollection.onselect(this);"> 152 153 <treecols id="rdfDataTreeCols_email"> 153 154 <treecol id="recipientCol_email" label="&vI_rdfDataTree.recipientColumn.label;" flex="10" … … 168 169 persist="hidden width ordinal sortDirection"/> 169 170 </treecols> 170 <treechildren id="configTreeBody_email" ondblclick="if (event.button == 0) v I_rdfDataTree.modifySelected();" />171 <treechildren id="configTreeBody_email" ondblclick="if (event.button == 0) virtualIdentityExtension.rdfDataTreeCollection.modifySelected();" /> 171 172 </tree> 172 173 <vbox> 173 174 <button id="newButton_email" label="&newButton.label;" accesskey="&newButton.accesskey;" 174 oncommand="v I_rdfDataTree.newItem();"/>175 oncommand="virtualIdentityExtension.rdfDataTreeCollection.newItem();"/> 175 176 <button id="editButton_email" label="&editButton.label;" accesskey="&editButton.accesskey;" 176 oncommand="v I_rdfDataTree.modifySelected();" disabled="true"/>177 oncommand="virtualIdentityExtension.rdfDataTreeCollection.modifySelected();" disabled="true"/> 177 178 <button id="deleteButton_email" label="&deleteButton.label;" accesskey="&deleteButton.accesskey;" 178 oncommand="v I_rdfDataTree.removeSelected();" disabled="true"/>179 oncommand="virtualIdentityExtension.rdfDataTreeCollection.removeSelected();" disabled="true"/> 179 180 <spacer flex="1"/> 180 181 </vbox> … … 186 187 <tree id="rdfDataTree_maillist" flex="1" class="plain" seltype="multiple" 187 188 persist="sortDirection sortResource" sortDirection="ascending" sortResource="recipientCol" 188 enableColumnDrag="true" context="configContext" onselect="v I_rdfDataTree.onselect();">189 enableColumnDrag="true" context="configContext" onselect="virtualIdentityExtension.rdfDataTreeCollection.onselect();"> 189 190 <treecols id="rdfDataTreeCols_maillist"> 190 191 <treecol id="recipientCol_maillist" label="&vI_rdfDataTree.recipientColumn.label;" flex="10" … … 205 206 persist="hidden width ordinal sortDirection"/> 206 207 </treecols> 207 <treechildren id="configTreeBody_maillist" ondblclick="if (event.button == 0) v I_rdfDataTree.modifySelected();" />208 <treechildren id="configTreeBody_maillist" ondblclick="if (event.button == 0) virtualIdentityExtension.rdfDataTreeCollection.modifySelected();" /> 208 209 </tree> 209 210 <vbox> 210 211 <button id="newButton_maillist" label="&newButton.label;" accesskey="&newButton.accesskey;" 211 oncommand="v I_rdfDataTree.newItem();"/>212 oncommand="virtualIdentityExtension.rdfDataTreeCollection.newItem();"/> 212 213 <button id="editButton_maillist" label="&editButton.label;" accesskey="&editButton.accesskey;" 213 oncommand="v I_rdfDataTree.modifySelected();" disabled="true"/>214 oncommand="virtualIdentityExtension.rdfDataTreeCollection.modifySelected();" disabled="true"/> 214 215 <button id="deleteButton_maillist" label="&deleteButton.label;" accesskey="&deleteButton.accesskey;" 215 oncommand="v I_rdfDataTree.removeSelected();" disabled="true"/>216 oncommand="virtualIdentityExtension.rdfDataTreeCollection.removeSelected();" disabled="true"/> 216 217 <spacer flex="1"/> 217 218 </vbox> … … 222 223 <tree id="rdfDataTree_newsgroup" flex="1" class="plain" seltype="multiple" 223 224 persist="sortDirection sortResource" sortDirection="ascending" sortResource="recipientCol" 224 enableColumnDrag="true" context="configContext" onselect="v I_rdfDataTree.onselect();">225 enableColumnDrag="true" context="configContext" onselect="virtualIdentityExtension.rdfDataTreeCollection.onselect();"> 225 226 <treecols id="rdfDataTreeCols_newsgroup"> 226 227 <treecol id="recipientCol_newsgroup" label="&vI_rdfDataTree.recipientColumn.label;" flex="10" … … 241 242 persist="hidden width ordinal sortDirection"/> 242 243 </treecols> 243 <treechildren id="configTreeBody_newsgroup" ondblclick="if (event.button == 0) v I_rdfDataTree.modifySelected();" />244 <treechildren id="configTreeBody_newsgroup" ondblclick="if (event.button == 0) virtualIdentityExtension.rdfDataTreeCollection.modifySelected();" /> 244 245 </tree> 245 246 <vbox> 246 247 <button id="newButton_newsgroup" label="&newButton.label;" accesskey="&newButton.accesskey;" 247 oncommand="v I_rdfDataTree.newItem();"/>248 oncommand="virtualIdentityExtension.rdfDataTreeCollection.newItem();"/> 248 249 <button id="editButton_newsgroup" label="&editButton.label;" accesskey="&editButton.accesskey;" 249 oncommand="v I_rdfDataTree.modifySelected();" disabled="true"/>250 oncommand="virtualIdentityExtension.rdfDataTreeCollection.modifySelected();" disabled="true"/> 250 251 <button id="deleteButton_newsgroup" label="&deleteButton.label;" accesskey="&deleteButton.accesskey;" 251 oncommand="v I_rdfDataTree.removeSelected();" disabled="true"/>252 oncommand="virtualIdentityExtension.rdfDataTreeCollection.removeSelected();" disabled="true"/> 252 253 <spacer flex="1"/> 253 254 </vbox> … … 258 259 <tree id="rdfDataTree_filter" flex="1" class="plain" seltype="multiple" 259 260 persist="sortDirection sortResource" sortDirection="ascending" sortResource="indexCol" 260 enableColumnDrag="true" context="configContext" onselect="v I_rdfDataTree.onselect();">261 enableColumnDrag="true" context="configContext" onselect="virtualIdentityExtension.rdfDataTreeCollection.onselect();"> 261 262 <treecols id="rdfDataTreeCols_filter"> 262 263 <treecol id="indexCol_filter" label="&vI_rdfDataTree.indexColumn.label;" flex="10" … … 282 283 persist="hidden width ordinal"/> 283 284 </treecols> 284 <treechildren id="configTreeBody_filter" ondblclick="if (event.button == 0) v I_rdfDataTree.modifySelected();" />285 <treechildren id="configTreeBody_filter" ondblclick="if (event.button == 0) virtualIdentityExtension.rdfDataTreeCollection.modifySelected();" /> 285 286 </tree> 286 287 <vbox> 287 288 <button id="newButton_filter" label="&newButton.label;" accesskey="&newButton.accesskey;" 288 oncommand="v I_rdfDataTree.newItem();"/>289 oncommand="virtualIdentityExtension.rdfDataTreeCollection.newItem();"/> 289 290 <button id="editButton_filter" label="&editButton.label;" accesskey="&editButton.accesskey;" 290 oncommand="v I_rdfDataTree.modifySelected();" disabled="true"/>291 oncommand="virtualIdentityExtension.rdfDataTreeCollection.modifySelected();" disabled="true"/> 291 292 <button id="deleteButton_filter" label="&deleteButton.label;" accesskey="&deleteButton.accesskey;" 292 oncommand="v I_rdfDataTree.removeSelected();" disabled="true"/>293 oncommand="virtualIdentityExtension.rdfDataTreeCollection.removeSelected();" disabled="true"/> 293 294 <spacer flex="1"/> 294 295 <button id="reorderUpButton_filter" label="&reorderUpButton.label;" accesskey="&reorderUpButton.accesskey;" 295 296 class="up" 296 oncommand="v I_rdfDataTree.moveUpSelected();"/>297 oncommand="virtualIdentityExtension.rdfDataTreeCollection.moveUpSelected();"/> 297 298 <button id="reorderDownButton_filter" label="&reorderDownButton.label;" accesskey="&reorderDownButton.accesskey;" 298 299 class="down" 299 oncommand="v I_rdfDataTree.moveDownSelected();"/>300 oncommand="virtualIdentityExtension.rdfDataTreeCollection.moveDownSelected();"/> 300 301 <spacer flex="1"/> 301 302 </vbox> … … 306 307 </tabbox> 307 308 <!-- <splitter /> --> 308 <browser id="vI_rdfDataTreeInfoBox" class="vI_htmlTextBox" type="chrome" cssSource="vI_rdfTreeInfo.css" disablehistory="true" onoverflow="vI_rdfDataTree.overflow();"/> 309 309 <browser id="rdfDataTreeCollectionInfoBox" class="vI_htmlTextBox" type="chrome" cssSource="vI_rdfTreeInfo.css" disablehistory="true" onoverflow="virtualIdentityExtension.rdfDataTreeCollection.overflow();"/> 310 310 <splitter id="vIDebugBoxSplitter" hidden="true"/> 311 311 <textbox id="vIDebugBox" hidden="true" multiline="true" readonly="true" 312 312 DOMAttrModified="if(event.attrName == 'value') this.value = event.newValue; return true;"/> 313 313 <script type="application/x-javascript">dump('window rdfDataTreeCollection done ' + parseInt((new Date()).getTime()) + ' ' + virtualIdentityExtension.initTime + ' ' + virtualIdentityExtension.rdfDataTreeCollection + '\n');</script> 314 314 </window> -
chrome/content/v_identity/vI_rdfDatasource.js
r92fd25 rc3feaa 24 24 25 25 26 27 function vI_rdfDatasource(rdfFileName, dontRegisterObserver) {26 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 27 function rdfDatasource(rdfFileName, dontRegisterObserver) { 28 28 this._rdfFileName = rdfFileName; 29 29 if (this._rdfFileName) this.init(); … … 31 31 } 32 32 33 vI_rdfDatasource.prototype = {33 rdfDatasource.prototype = { 34 34 _rdfVersion : "0.0.5", 35 35 _rdfService : Components.classes["@mozilla.org/rdf/rdf-service;1"] … … 80 80 81 81 init: function() { 82 // if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource init.\n");82 // if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource init.\n"); 83 83 84 84 this._openRdfDataSource(); … … 91 91 92 92 // this.refreshAccountInfo(); 93 // if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource init done.\n");93 // if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource init done.\n"); 94 94 }, 95 95 … … 109 109 var fileURI = protoHandler.newFileURI(newFile); 110 110 111 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource init: read rdf from '" + fileURI.spec + "'\n");111 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource init: read rdf from '" + fileURI.spec + "'\n"); 112 112 113 113 this._rdfDataSource = 114 114 this._rdfService.GetDataSourceBlocking(fileURI.spec); 115 115 116 // if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource read rdf from '" + fileURI.spec + "' done." + this._rdfService + "\n");116 // if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource read rdf from '" + fileURI.spec + "' done." + this._rdfService + "\n"); 117 117 }, 118 118 … … 161 161 rdfUpgrade : function() { 162 162 var currentVersion = this.getCurrentRDFFileVersion(); 163 if (vI _notificationBar) vI_notificationBar.dump("checking for previous version of rdf, found " +163 if (vI.notificationBar) vI.notificationBar.dump("checking for previous version of rdf, found " + 164 164 currentVersion + "\nrdf-upgrade required.\n") 165 165 switch (currentVersion) { … … 175 175 } 176 176 this.storeRDFVersion(); 177 if (vI _notificationBar) vI_notificationBar.dump("rdf-upgrade to " + this.getCurrentRDFFileVersion() + " done.\n\n");177 if (vI.notificationBar) vI.notificationBar.dump("rdf-upgrade to " + this.getCurrentRDFFileVersion() + " done.\n\n"); 178 178 }, 179 179 // ************** RDF UPGRADE CODE **************************************************** 180 180 // only used for upgrade to 0.0.3 - loop through all ressources. 181 181 _transferAllResources : function () { 182 if (vI _notificationBar) vI_notificationBar.dump("upgrade: transferAllResources ");182 if (vI.notificationBar) vI.notificationBar.dump("upgrade: transferAllResources "); 183 183 var enumerator = this._rdfDataSource.GetAllResources(); 184 184 while (enumerator && enumerator.hasMoreElements()) { … … 200 200 if (container.IndexOf(resource) == -1) container.AppendElement(resource); 201 201 202 if (vI _notificationBar) vI_notificationBar.dump(".");203 } 204 if (vI _notificationBar) vI_notificationBar.dump("\n");202 if (vI.notificationBar) vI.notificationBar.dump("."); 203 } 204 if (vI.notificationBar) vI.notificationBar.dump("\n"); 205 205 }, 206 206 // ************** RDF UPGRADE CODE **************************************************** 207 207 _tagDefaultSMTP: function() { 208 if (vI _notificationBar) vI_notificationBar.dump("upgrade: tagDefaultSMTP ");208 if (vI.notificationBar) vI.notificationBar.dump("upgrade: tagDefaultSMTP "); 209 209 for each (treeType in Array("email", "maillist", "newsgroup", "filter")) { 210 210 var enumerator = this.getContainer(treeType).GetElements(); … … 213 213 resource.QueryInterface(Components.interfaces.nsIRDFResource); 214 214 var smtp = this._getRDFValue(resource, "smtp") 215 if (!smtp || smtp == "") this._setRDFValue(resource, "smtp", vI _DEFAULT_SMTP_TAG);216 if (vI _notificationBar) vI_notificationBar.dump(".");217 } 218 } 219 if (vI _notificationBar) vI_notificationBar.dump("\n");215 if (!smtp || smtp == "") this._setRDFValue(resource, "smtp", vI.DEFAULT_SMTP_TAG); 216 if (vI.notificationBar) vI.notificationBar.dump("."); 217 } 218 } 219 if (vI.notificationBar) vI.notificationBar.dump("\n"); 220 220 }, 221 221 // ************** RDF UPGRADE CODE **************************************************** 222 222 _createAccountInfoContainers: function() { 223 if (vI _notificationBar) vI_notificationBar.dump("upgrade: createAccountInfoContainers \n");223 if (vI.notificationBar) vI.notificationBar.dump("upgrade: createAccountInfoContainers \n"); 224 224 var rdfContainerUtils = Components.classes["@mozilla.org/rdf/container-utils;1"]. 225 225 getService(Components.interfaces.nsIRDFContainerUtils); … … 253 253 // ************** RDF UPGRADE CODE **************************************************** 254 254 _createRDFContainers: function() { 255 if (vI _notificationBar) vI_notificationBar.dump("upgrade: createRDFContainers ");255 if (vI.notificationBar) vI.notificationBar.dump("upgrade: createRDFContainers "); 256 256 var rdfContainerUtils = Components.classes["@mozilla.org/rdf/container-utils;1"]. 257 257 getService(Components.interfaces.nsIRDFContainerUtils); … … 340 340 341 341 cleanAccountInfo : function() { 342 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: cleanAccountInfo\n");342 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: cleanAccountInfo\n"); 343 343 344 344 var enumerator = this._identityContainer.GetElements(); … … 381 381 382 382 searchIdentityMismatch : function() { 383 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: searchIdentityMismatch");383 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: searchIdentityMismatch"); 384 384 385 385 var relevantIDs = this.getRelevantIDs(); … … 408 408 } 409 409 if (mismatchIDs.length > 0) { 410 if (vI _notificationBar) vI_notificationBar.dump(" found mismatches on id(s).\n");410 if (vI.notificationBar) vI.notificationBar.dump(" found mismatches on id(s).\n"); 411 411 412 412 window.openDialog("chrome://v_identity/content/vI_rdfAccountMismatchDialog.xul",0, … … 416 416 } 417 417 else { 418 if (vI _notificationBar) vI_notificationBar.dump(" found no mismatch\n");418 if (vI.notificationBar) vI.notificationBar.dump(" found no mismatch\n"); 419 419 return false; 420 420 } … … 424 424 var keyField = (type == "identity")?"id":"smtp" // field to change is 'id' or 'smtp' dependent on type 425 425 for (var i = 0; i < mismatchItems.length; i++) { 426 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: repairAccountMismatch change " + mismatchItems[i].oldkey + " into " + mismatchItems[i].key + ": ");426 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: repairAccountMismatch change " + mismatchItems[i].oldkey + " into " + mismatchItems[i].key + ": "); 427 427 // search relevant Identities 428 428 for each (treeType in Array("email", "maillist", "newsgroup", "filter")) { … … 434 434 if (mismatchItems[i].key == "") this._unsetRDFValue(resource, keyField, mismatchItems[i].oldkey) 435 435 else this._setRDFValue(resource, keyField, mismatchItems[i].key) 436 if (vI _notificationBar) vI_notificationBar.dump(".");436 if (vI.notificationBar) vI.notificationBar.dump("."); 437 437 } 438 438 } 439 439 } 440 if (vI _notificationBar) vI_notificationBar.dump("\n");440 if (vI.notificationBar) vI.notificationBar.dump("\n"); 441 441 } 442 442 }, … … 451 451 resource.QueryInterface(Components.interfaces.nsIRDFResource); 452 452 var smtp = this._getRDFValue(resource, "smtp") 453 if (smtp && smtp != vI _DEFAULT_SMTP_TAG) {453 if (smtp && smtp != vI.DEFAULT_SMTP_TAG) { 454 454 if (!relevantSMTPs[smtp]) relevantSMTPs[smtp] = 1; else relevantSMTPs[smtp] += 1; 455 455 } … … 460 460 461 461 searchSmtpMismatch : function() { 462 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: searchSmtpMismatch");462 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: searchSmtpMismatch"); 463 463 464 464 var relevantSMTPs = this.getRelevantSMTPs(); … … 484 484 } 485 485 if (mismatchSMTPs.length > 0) { 486 if (vI _notificationBar) vI_notificationBar.dump(" found mismatches on smtp(s).\n");486 if (vI.notificationBar) vI.notificationBar.dump(" found mismatches on smtp(s).\n"); 487 487 window.openDialog("chrome://v_identity/content/vI_rdfAccountMismatchDialog.xul",0, 488 488 "chrome, dialog, modal, alwaysRaised, resizable=yes", "smtp", mismatchSMTPs, … … 491 491 } 492 492 else { 493 if (vI _notificationBar) vI_notificationBar.dump(" found no mismatch\n");493 if (vI.notificationBar) vI.notificationBar.dump(" found no mismatch\n"); 494 494 return false; 495 495 } … … 497 497 498 498 storeAccountInfo : function() { 499 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: storeAccounts\n");499 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: storeAccounts\n"); 500 500 501 501 var AccountManager = Components.classes["@mozilla.org/messenger/account-manager;1"] … … 505 505 for (let j = 0; j < account.identities.Count(); j++) { 506 506 var identity = account.identities.QueryElementAt(j, Components.interfaces.nsIMsgIdentity); 507 // if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: storeAccounts identity store id " + identity.key + "\n");507 // if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: storeAccounts identity store id " + identity.key + "\n"); 508 508 509 509 var resource = this._rdfService.GetResource(this._rdfNS + this._rdfNSIdentities + "/" + identity.key); … … 519 519 520 520 function storeSmtp(server, parent) { 521 // if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: storeAccounts smtp store id " + server.key + "\n");521 // if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: storeAccounts smtp store id " + server.key + "\n"); 522 522 var resource = parent._rdfService.GetResource(parent._rdfNS + parent._rdfNSSMTPservers + "/" + server.key); 523 523 parent._setRDFValue(resource, "label", (server.description?server.description:server.hostname)); … … 536 536 } 537 537 538 // if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: storeAccounts done\n");538 // if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: storeAccounts done\n"); 539 539 }, 540 540 … … 561 561 if (!this._rdfDataSource) return null; 562 562 if (!recDescription) { 563 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: _getRDFResourceForVIdentity: no Recipient given.\n");563 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: _getRDFResourceForVIdentity: no Recipient given.\n"); 564 564 return null; 565 565 } … … 577 577 578 578 removeVIdentityFromRDF : function (resource, recType) { 579 // if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: removeVIdentityFromRDF " + resource.ValueUTF8 + ".\n");579 // if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: removeVIdentityFromRDF " + resource.ValueUTF8 + ".\n"); 580 580 this._unsetRDFValue(resource, "email", this._getRDFValue(resource, "email")) 581 581 this._unsetRDFValue(resource, "fullName", this._getRDFValue(resource, "fullName")) … … 584 584 this._unsetRDFValue(resource, "name", this._getRDFValue(resource, "name")) 585 585 586 var extras = new vI _storageExtras(this, resource);586 var extras = new vI.storageExtras(this, resource); 587 587 extras.loopForRDF(this, resource, "unset"); 588 588 this.getContainer(recType).RemoveElement(resource, true); … … 590 590 591 591 _unsetRDFValue : function (resource, field, value) { 592 // if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource _unsetRDFValue " + this._rdfService + " " + this._rdfDataSource + "\n");592 // if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource _unsetRDFValue " + this._rdfService + " " + this._rdfDataSource + "\n"); 593 593 var predicate = this._rdfService.GetResource(this._rdfNS + "rdf#" + field); 594 594 var name = this._rdfService.GetLiteral(value?value:""); … … 601 601 }, 602 602 603 // this will be used from rdfDataTree to get all RDF values, callFunction is vI _rdfDataTree.__addNewDatum603 // this will be used from rdfDataTree to get all RDF values, callFunction is vI.rdfDataTreeCollection.__addNewDatum 604 604 readAllEntriesFromRDF : function (addNewDatum, treeType, idData) { 605 // if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: readAllEntriesFromRDF " + this._rdfService + " " + this._rdfDataSource + " " + this + "\n");605 // if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: readAllEntriesFromRDF " + this._rdfService + " " + this._rdfDataSource + " " + this + "\n"); 606 606 var enumerator = this.getContainer(treeType).GetElements(); 607 607 while (enumerator && enumerator.hasMoreElements()) { … … 613 613 var id = this._getRDFValue(resource, "id") 614 614 var smtp = this._getRDFValue(resource, "smtp") 615 if (!smtp) smtp = vI _NO_SMTP_TAG;616 var extras = new vI _storageExtras(this, resource);615 if (!smtp) smtp = vI.NO_SMTP_TAG; 616 var extras = new vI.storageExtras(this, resource); 617 617 618 var localIdentityData = new vI _identityData(email, fullName, id, smtp, extras)618 var localIdentityData = new vI.identityData(email, fullName, id, smtp, extras) 619 619 addNewDatum (resource, name, localIdentityData, idData) 620 620 } … … 622 622 623 623 findMatchingFilter : function (recDescription) { 624 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: findMatchingFilter for " + recDescription + ".\n");624 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: findMatchingFilter for " + recDescription + ".\n"); 625 625 var enumerator = this._filterContainer.GetElements(); 626 626 while (enumerator && enumerator.hasMoreElements()) { … … 634 634 if (filter == "") continue; 635 635 if (/^\/(.*)\/$/.exec(filter)) 636 { if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: findMatchingFilter with RegExp '"636 { if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: findMatchingFilter with RegExp '" 637 637 + filter.replace(/\\/g,"\\\\") + "'\n"); recentfilterType = filterType.RegExp; } 638 else { if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: findMatchingFilter, compare with '"638 else { if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: findMatchingFilter, compare with '" 639 639 + filter + "'\n"); recentfilterType = filterType.StrCmp; } 640 640 … … 643 643 try { /^\/(.*)\/$/.exec(filter); 644 644 if (recDescription.match(new RegExp(RegExp.$1,"i"))) { 645 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: findMatchingFilter found stored data.\n");645 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: findMatchingFilter found stored data.\n"); 646 646 return this._readVIdentityFromRDF(resource); 647 647 } … … 650 650 case filterType.StrCmp: 651 651 if (recDescription.toLowerCase().indexOf(filter.toLowerCase()) != -1) { 652 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: findMatchingFilter found stored data.\n");652 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: findMatchingFilter found stored data.\n"); 653 653 return this._readVIdentityFromRDF(resource); 654 654 } … … 656 656 } 657 657 } 658 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: findMatchingFilter no match found.\n");658 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: findMatchingFilter no match found.\n"); 659 659 return null; 660 660 }, … … 666 666 if (!this._rdfDataSource.hasArcOut(resource, email)) { 667 667 // no data available --> give up. 668 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: readVIdentityFromRDF no data found.\n");668 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: readVIdentityFromRDF no data found.\n"); 669 669 return null; 670 670 } 671 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: readVIdentityFromRDF found stored data.\n");671 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: readVIdentityFromRDF found stored data.\n"); 672 672 673 673 return this._readVIdentityFromRDF(resource); … … 679 679 var id = this._getRDFValue(resource, "id") 680 680 var smtp = this._getRDFValue(resource, "smtp") 681 if (!smtp) smtp = vI _NO_SMTP_TAG;681 if (!smtp) smtp = vI.NO_SMTP_TAG; 682 682 683 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: email='" + email +683 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: email='" + email + 684 684 "' fullName='" + fullName + "' id='" + id + "' smtp='" + smtp + "'\n"); 685 685 686 var extras = new vI _storageExtras(this, resource);687 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: extras:" + extras.status() + "\n");686 var extras = new vI.storageExtras(this, resource); 687 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: extras:" + extras.status() + "\n"); 688 688 689 var localIdentityData = new vI _identityData(email, fullName, id, smtp, extras)689 var localIdentityData = new vI.identityData(email, fullName, id, smtp, extras) 690 690 return localIdentityData; 691 691 }, 692 692 693 693 _getRDFValue : function (resource, field) { 694 // if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource _getRDFValue " + this._rdfService + " " + this._rdfDataSource + " " + this + "\n");694 // if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource _getRDFValue " + this._rdfService + " " + this._rdfDataSource + " " + this + "\n"); 695 695 var predicate = this._rdfService.GetResource(this._rdfNS + "rdf#" + field); 696 696 var target = this._rdfDataSource.GetTarget(resource, predicate, true); … … 702 702 this.updateRDF(recDescription, recType, 703 703 document.getElementById("msgIdentity_clone").identityData, 704 (vI _statusmenu.objSaveBaseIDMenuItem.getAttribute("checked") == "true"),705 (vI _statusmenu.objSaveSMTPMenuItem.getAttribute("checked") == "true"),704 (vI.statusmenu.objSaveBaseIDMenuItem.getAttribute("checked") == "true"), 705 (vI.statusmenu.objSaveSMTPMenuItem.getAttribute("checked") == "true"), 706 706 null, null); 707 707 }, … … 715 715 716 716 updateRDF : function (recDescription, recType, localIdentityData, storeBaseID, storeSMTP, prevRecDescription, prevRecType) { 717 // if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource (" + this._rdfNS + "): updateRDF recDescription=" + recDescription + " localIdentityData.email=" + localIdentityData.email + ".\n");717 // if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource (" + this._rdfNS + "): updateRDF recDescription=" + recDescription + " localIdentityData.email=" + localIdentityData.email + ".\n"); 718 718 719 719 // if (!localIdentityData.email) { 720 // if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: updateRDF: no Sender-email for Recipient, aborting.\n");720 // if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: updateRDF: no Sender-email for Recipient, aborting.\n"); 721 721 // return; 722 722 // } … … 728 728 var resource = this._getRDFResourceForVIdentity(prevRecDescription, prevRecType); 729 729 if (!resource) return; 730 // if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: updateRDF " + resource.ValueUTF8 + ".\n");730 // if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: updateRDF " + resource.ValueUTF8 + ".\n"); 731 731 732 732 var position = this.getContainer(recType).IndexOf(resource); // check for index in new recType … … 740 740 this._setRDFValue(resource, "id", localIdentityData.id.key); 741 741 else this._unsetRDFValue(resource, "id", this._getRDFValue(resource, "id")) 742 if (storeSMTP && localIdentityData.smtp.key != vI _NO_SMTP_TAG)742 if (storeSMTP && localIdentityData.smtp.key != vI.NO_SMTP_TAG) 743 743 this._setRDFValue(resource, "smtp", localIdentityData.smtp.key); 744 744 else this._unsetRDFValue(resource, "smtp", this._getRDFValue(resource, "smtp")) … … 747 747 localIdentityData.extras.loopForRDF(this, resource, "set"); 748 748 749 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: updateRDF add " + resource.ValueUTF8 + " at position " + position + ".\n");749 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: updateRDF add " + resource.ValueUTF8 + " at position " + position + ".\n"); 750 750 if (position != -1) this.getContainer(recType).InsertElementAt(resource, position, true); 751 751 else this.getContainer(recType).AppendElement(resource); … … 753 753 754 754 _setRDFValue : function (resource, field, value) { 755 // if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: _setRDFValue " + resource.ValueUTF8 + " " + field + " " + value + ".\n");755 // if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: _setRDFValue " + resource.ValueUTF8 + " " + field + " " + value + ".\n"); 756 756 if (!value) return value; // return if some value was not set. 757 // if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource _setRDFValue " + this._rdfService + " " + this._rdfDataSource + "\n");757 // if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource _setRDFValue " + this._rdfService + " " + this._rdfDataSource + "\n"); 758 758 var predicate = this._rdfService.GetResource(this._rdfNS + "rdf#" + field); 759 759 var name = this._rdfService.GetLiteral(value); … … 771 771 observe : function(subject, topic, data) { 772 772 if (topic == "am-smtpChanges" || topic == "am-acceptChanges") { 773 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: account/smtp changes observed\n");773 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: account/smtp changes observed\n"); 774 774 this.searchIdentityMismatch(); 775 775 this.searchSmtpMismatch(); … … 778 778 }, 779 779 register : function() { 780 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: register AccountManagerObserver\n");780 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: register AccountManagerObserver\n"); 781 781 var obsService = Components.classes["@mozilla.org/observer-service;1"]. 782 782 getService(Components.interfaces.nsIObserverService) … … 796 796 797 797 // create with name of the file to import into 798 function vI_rdfDatasourceImporter(rdfFileName) {798 function rdfDatasourceImporter(rdfFileName) { 799 799 this._rdfFileName = rdfFileName; 800 800 if (this._rdfFileName) this.import(); 801 801 } 802 802 803 vI_rdfDatasourceImporter.prototype = {803 rdfDatasourceImporter.prototype = { 804 804 _rdfService : Components.classes["@mozilla.org/rdf/rdf-service;1"] 805 805 .getService(Components.interfaces.nsIRDFService), … … 844 844 values.id = values.id?values.id:"import_" + id 845 845 relevantIDs[id] = values; 846 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasourceImporter import: translate relevant ID from previous '" + id + "' to current '" + relevantIDs[id].id + "'\n");846 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasourceImporter import: translate relevant ID from previous '" + id + "' to current '" + relevantIDs[id].id + "'\n"); 847 847 } 848 848 return relevantIDs; … … 876 876 values.smtp = values.smtp?values.smtp:"import_" + smtp; 877 877 relevantSMTPs[smtp] = values; 878 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasourceImporter import: translate relevant SMTP from previous '" + smtp + "' to current '" + relevantSMTPs[smtp].smtp + "'\n");878 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasourceImporter import: translate relevant SMTP from previous '" + smtp + "' to current '" + relevantSMTPs[smtp].smtp + "'\n"); 879 879 } 880 880 return relevantSMTPs; … … 906 906 907 907 if (filePicker.show() == Components.interfaces.nsIFilePicker.returnOK) { 908 if (vI _notificationBar) vI_notificationBar.dump("\n## vI_rdfDatasourceImporter IMPORT\n## vI_rdfDatasourceImporter import: preparation:\n");908 if (vI.notificationBar) vI.notificationBar.dump("\n## rdfDatasourceImporter IMPORT\n## rdfDatasourceImporter import: preparation:\n"); 909 909 910 910 var importRdfDataFile = Components.classes["@mozilla.org/file/local;1"] … … 916 916 filePicker.file.copyTo(importRdfDataFile.parent,importRdfDataFile.leafName); 917 917 918 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasourceImporter import: copied file from " + filePicker.file.path + " to " + importRdfDataFile.path + "'\n");918 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasourceImporter import: copied file from " + filePicker.file.path + " to " + importRdfDataFile.path + "'\n"); 919 919 920 920 // init Datasources 921 this._rdfImportDataSource = new vI_rdfDatasource(importRdfDataFile.leafName, true);921 this._rdfImportDataSource = new rdfDatasource(importRdfDataFile.leafName, true); 922 922 923 923 // search matching IDs and SMTPs for anyones used in import-file … … 925 925 var relevantSMTPs = this._translateRelevantSMTPs(); 926 926 927 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasourceImporter import: preparation done.\n");928 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasourceImporter import: starting import:\n");927 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasourceImporter import: preparation done.\n"); 928 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasourceImporter import: starting import:\n"); 929 929 930 930 for each (treeType in Array("email", "maillist", "newsgroup", "filter")) { 931 931 // re-initialize importDataSource to point rdfService to the right Resources 932 this._rdfImportDataSource = new vI_rdfDatasource(importRdfDataFile.leafName, true);932 this._rdfImportDataSource = new rdfDatasource(importRdfDataFile.leafName, true); 933 933 var container = this._rdfImportDataSource.getContainer(treeType) 934 934 if (container.GetCount() == 0) continue; 935 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasourceImporter importing " + treeType + ": " + container.GetCount()+ " datasets from " + this._rdfImportDataSource._rdfDataSource.URI + "\n");935 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasourceImporter importing " + treeType + ": " + container.GetCount()+ " datasets from " + this._rdfImportDataSource._rdfDataSource.URI + "\n"); 936 936 var enumerator = container.GetElements(); 937 937 // re-initialize dataSource to point rdfService to the right Resources 938 this._rdfDataSource = new vI_rdfDatasource(this._rdfFileName, true);938 this._rdfDataSource = new rdfDatasource(this._rdfFileName, true); 939 939 var count = 0; 940 940 while (enumerator.hasMoreElements()) { 941 941 var resource = enumerator.getNext(); count += 1; 942 942 resource.QueryInterface(Components.interfaces.nsIRDFResource); 943 if (vI _notificationBar) vI_notificationBar.dump("## " + count + " ");943 if (vI.notificationBar) vI.notificationBar.dump("## " + count + " "); 944 944 var name = this._rdfImportDataSource._getRDFValue(resource, "name") 945 945 var email = this._rdfImportDataSource._getRDFValue(resource, "email") … … 948 948 id = id?relevantIDs[id].id:null 949 949 var smtp = this._rdfImportDataSource._getRDFValue(resource, "smtp") 950 smtp = (smtp && smtp != vI _DEFAULT_SMTP_TAG)?relevantSMTPs[smtp].smtp:smtp951 var extras = new vI _storageExtras(this._rdfImportDataSource, resource);952 var localIdentityData = new vI _identityData(email, fullName, id, smtp, extras)950 smtp = (smtp && smtp != vI.DEFAULT_SMTP_TAG)?relevantSMTPs[smtp].smtp:smtp 951 var extras = new vI.storageExtras(this._rdfImportDataSource, resource); 952 var localIdentityData = new vI.identityData(email, fullName, id, smtp, extras) 953 953 954 954 this._rdfDataSource.updateRDF(name, treeType, localIdentityData, false, false, null, null) … … 959 959 } 960 960 961 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasourceImporter import: removing temporary file " + importRdfDataFile.path + ".\n");961 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasourceImporter import: removing temporary file " + importRdfDataFile.path + ".\n"); 962 962 this._rdfImportDataSource = null; importRdfDataFile.remove(false); 963 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasourceImporter import: import done.\n");964 965 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasourceImporter import: cleaning ID/SMTP storages:\n");966 this._rdfDataSource = new vI_rdfDatasource(this._rdfFileName, true);963 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasourceImporter import: import done.\n"); 964 965 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasourceImporter import: cleaning ID/SMTP storages:\n"); 966 this._rdfDataSource = new rdfDatasource(this._rdfFileName, true); 967 967 968 968 this._storeMappedIDs(relevantIDs); … … 974 974 this._rdfDataSource.clean(); 975 975 this._rdfDataSource = null; 976 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasourceImporter import: cleaning ID/SMTP storages done.\n");977 if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasourceImporter IMPORT DONE.\n");976 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasourceImporter import: cleaning ID/SMTP storages done.\n"); 977 if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasourceImporter IMPORT DONE.\n"); 978 978 } 979 979 } 980 980 } 981 vI.rdfDatasource = rdfDatasource; 982 vI.rdfDatasourceImporter = rdfDatasourceImporter; 983 }}); -
chrome/content/v_identity/vI_smartIdentity.js
r92fd25 rc3feaa 23 23 * ***** END LICENSE BLOCK ***** */ 24 24 25 var vI_smartIdentity = { 25 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 26 var smartIdentity = { 26 27 messenger : Components.classes["@mozilla.org/messenger;1"].createInstance() 27 28 .QueryInterface(Components.interfaces.nsIMessenger), … … 30 31 31 32 clean : function() { 32 vI_smartIdentity.smartIdentity_BaseIdentity = null;33 smartIdentity.smartIdentity_BaseIdentity = null; 33 34 }, 34 35 … … 37 38 var type = gMsgCompose.type; 38 39 var msgComposeType = Components.interfaces.nsIMsgCompType; 39 vI _notificationBar.dump("## vI_smartIdentity: msgComposeType = " + type + "\n");40 vI.notificationBar.dump("## smartIdentity: msgComposeType = " + type + "\n"); 40 41 41 42 switch (type) { … … 49 50 case msgComposeType.ReplyWithTemplate: 50 51 case msgComposeType.ReplyToList: 51 vI_smartIdentity.Reply(); break;52 smartIdentity.Reply(); break; 52 53 case msgComposeType.Draft: 53 54 case msgComposeType.Template: 54 vI_smartIdentity.Draft(); break;55 smartIdentity.Draft(); break; 55 56 case msgComposeType.New: 56 57 case msgComposeType.NewsPost: 57 58 case msgComposeType.MailToUrl: 58 vI_smartIdentity.NewMail(); break;59 smartIdentity.NewMail(); break; 59 60 } 60 61 }, … … 62 63 // this function adds a timestamp to the current sender 63 64 __autoTimestamp : function() { 64 vI _notificationBar.dump("## vI_smartIdentity: __autoTimestamp()\n");65 vI.notificationBar.dump("## smartIdentity: __autoTimestamp()\n"); 65 66 if (document.getElementById("msgIdentity_clone").vid) { 66 vI _notificationBar.dump("## vI_smartIdentity: Virtual Identity in use, aborting\n");67 vI.notificationBar.dump("## smartIdentity: Virtual Identity in use, aborting\n"); 67 68 return; 68 69 } … … 72 73 var domain = current_email[1]; 73 74 74 vI _notificationBar.dump("## vI_smartIdentity: current email: " + current_email[0] + "@" + current_email[1] + "\n");75 76 var autoString = vI _main.preferences.getCharPref("autoString");77 var formatString = vI _main.preferences.getCharPref("autoTimeFormat");75 vI.notificationBar.dump("## smartIdentity: current email: " + current_email[0] + "@" + current_email[1] + "\n"); 76 77 var autoString = vI.main.preferences.getCharPref("autoString"); 78 var formatString = vI.main.preferences.getCharPref("autoTimeFormat"); 78 79 79 80 var dateObj = new Date(); var dateString = ""; … … 84 85 85 86 var new_email = autoString.replace(/%l/g, localpart).replace(/%d/g, domain).replace(/%t/g,dateString); 86 vI _notificationBar.dump("## vI_smartIdentity: new email: " + new_email + "\n");87 88 vI _notificationBar.setNote(vI_main.elements.strings.getString("vident.smartIdentity.vIUsage") + ".",87 vI.notificationBar.dump("## smartIdentity: new email: " + new_email + "\n"); 88 89 vI.notificationBar.setNote(vI.main.elements.strings.getString("vident.smartIdentity.vIUsage") + ".", 89 90 "smart_reply_notification"); 90 91 … … 93 94 94 95 __ignoreID : function() { 95 vI _notificationBar.dump("## vI_smartIdentity: checking " + vI_main.preferences.getCharPref("idSelection_ignoreIDs") + " against " + vI_main.elements.Obj_MsgIdentity.value + "\n")96 vI.notificationBar.dump("## smartIdentity: checking " + vI.main.preferences.getCharPref("idSelection_ignoreIDs") + " against " + vI.main.elements.Obj_MsgIdentity.value + "\n") 96 97 // check if usage if virtual Identities should be used at all for the currently selected ID 97 if (vI _main.preferences.getCharPref("idSelection_ignoreIDs").indexOf(":" + vI_main.elements.Obj_MsgIdentity.value + ":") != -1) {98 vI _notificationBar.dump("## vI_smartIdentity: not using virtual Identites for ID " + vI_main.elements.Obj_MsgIdentity.value + "\n");98 if (vI.main.preferences.getCharPref("idSelection_ignoreIDs").indexOf(":" + vI.main.elements.Obj_MsgIdentity.value + ":") != -1) { 99 vI.notificationBar.dump("## smartIdentity: not using virtual Identites for ID " + vI.main.elements.Obj_MsgIdentity.value + "\n"); 99 100 return true; 100 101 } … … 103 104 104 105 NewMail : function() { 105 if ( vI_smartIdentity.__ignoreID()) return;106 if (smartIdentity.__ignoreID()) return; 106 107 107 var storageIdentities = new vI _identityCollection();108 vI _storage.getVIdentityFromAllRecipients(storageIdentities);109 110 if (storageIdentities.number > 0) vI_smartIdentity.__smartIdentitySelection(storageIdentities, false)111 else if (vI _main.preferences.getBoolPref("autoTimestamp")) vI_smartIdentity.__autoTimestamp();108 var storageIdentities = new vI.identityCollection(); 109 vI.storage.getVIdentityFromAllRecipients(storageIdentities); 110 111 if (storageIdentities.number > 0) smartIdentity.__smartIdentitySelection(storageIdentities, false) 112 else if (vI.main.preferences.getBoolPref("autoTimestamp")) smartIdentity.__autoTimestamp(); 112 113 }, 113 114 114 115 ReplyOnSent : function(hdr) { 115 vI _notificationBar.dump("## vI_smartIdentity: ReplyOnSent() (rules like SmartDraft)\n");116 117 var allIdentities = new vI _identityCollection();118 119 vI_smartIdentity.__SmartDraftOrReplyOnSent(hdr, allIdentities);120 var storageIdentities = new vI _identityCollection();121 vI _storage.getVIdentityFromAllRecipients(storageIdentities);116 vI.notificationBar.dump("## smartIdentity: ReplyOnSent() (rules like SmartDraft)\n"); 117 118 var allIdentities = new vI.identityCollection(); 119 120 smartIdentity.__SmartDraftOrReplyOnSent(hdr, allIdentities); 121 var storageIdentities = new vI.identityCollection(); 122 vI.storage.getVIdentityFromAllRecipients(storageIdentities); 122 123 123 124 allIdentities.mergeWithoutDuplicates(storageIdentities); 124 125 125 if (allIdentities.number > 0) vI_smartIdentity.__smartIdentitySelection(allIdentities, true);126 if (allIdentities.number > 0) smartIdentity.__smartIdentitySelection(allIdentities, true); 126 127 127 128 }, 128 129 129 130 Draft : function() { 130 vI _notificationBar.dump("## vI_smartIdentity: Draft()\n");131 132 var allIdentities = new vI _identityCollection();133 134 var draftHdr = vI_smartIdentity.messenger.131 vI.notificationBar.dump("## smartIdentity: Draft()\n"); 132 133 var allIdentities = new vI.identityCollection(); 134 135 var draftHdr = smartIdentity.messenger. 135 136 messageServiceFromURI(gMsgCompose.originalMsgURI).messageURIToMsgHdr(gMsgCompose.originalMsgURI); 136 137 // fails with seamonkey 1.1.11, so just try to read to draft id 137 try { draftHdr = vI_smartIdentity.messenger.138 try { draftHdr = smartIdentity.messenger. 138 139 messageServiceFromURI(gMsgCompose.compFields.draftId).messageURIToMsgHdr(gMsgCompose.compFields.draftId); 139 140 } catch (ex) { }; 140 141 141 vI_smartIdentity.__SmartDraftOrReplyOnSent(draftHdr, allIdentities);142 var storageIdentities = new vI _identityCollection();143 vI _storage.getVIdentityFromAllRecipients(storageIdentities);142 smartIdentity.__SmartDraftOrReplyOnSent(draftHdr, allIdentities); 143 var storageIdentities = new vI.identityCollection(); 144 vI.storage.getVIdentityFromAllRecipients(storageIdentities); 144 145 145 146 allIdentities.mergeWithoutDuplicates(storageIdentities); 146 147 147 if (allIdentities.number > 0) vI_smartIdentity.__smartIdentitySelection(allIdentities, true);148 if (allIdentities.number > 0) smartIdentity.__smartIdentitySelection(allIdentities, true); 148 149 }, 149 150 150 151 __parseHeadersWithArray: function(hdr, allIdentities) { 151 152 var emails = {}; var fullNames = {}; var combinedNames = {}; 152 var number = vI _main.headerParser.parseHeadersWithArray(hdr, emails, fullNames, combinedNames);153 var number = vI.main.headerParser.parseHeadersWithArray(hdr, emails, fullNames, combinedNames); 153 154 for (var index = 0; index < number; index++) { 154 var newIdentity = new vI _identityData(emails.value[index], fullNames.value[index],155 null, vI _NO_SMTP_TAG, null, null);155 var newIdentity = new vI.identityData(emails.value[index], fullNames.value[index], 156 null, vI.NO_SMTP_TAG, null, null); 156 157 allIdentities.addWithoutDuplicates(newIdentity); 157 158 } … … 160 161 // this function checks if we have a draft-case and Smart-Draft should replace the Identity 161 162 __SmartDraftOrReplyOnSent : function(hdr, allIdentities) { 162 if (!vI _main.preferences.getBoolPref("smart_draft"))163 { vI _notificationBar.dump("## vI_smartIdentity: SmartDraft deactivated\n"); return; }164 165 vI _notificationBar.dump("## vI_smartIdentity: __SmartDraftOrReplyOnSent()\n");163 if (!vI.main.preferences.getBoolPref("smart_draft")) 164 { vI.notificationBar.dump("## smartIdentity: SmartDraft deactivated\n"); return; } 165 166 vI.notificationBar.dump("## smartIdentity: __SmartDraftOrReplyOnSent()\n"); 166 167 167 168 if (hdr) { 168 vI_smartIdentity.__parseHeadersWithArray(hdr.author, allIdentities)169 vI _notificationBar.dump("## vI_smartIdentity: sender '" + allIdentities.identityDataCollection[0].combinedName + "'\n");170 } 171 else vI _notificationBar.dump("## vI_smartIdentity: __SmartDraftOrReplyOnSent: No Header found, shouldn't happen\n");169 smartIdentity.__parseHeadersWithArray(hdr.author, allIdentities) 170 vI.notificationBar.dump("## smartIdentity: sender '" + allIdentities.identityDataCollection[0].combinedName + "'\n"); 171 } 172 else vI.notificationBar.dump("## smartIdentity: __SmartDraftOrReplyOnSent: No Header found, shouldn't happen\n"); 172 173 }, 173 174 174 175 __filterAddresses : function(smartIdentities) { 175 var returnIdentities = new vI _identityCollection();176 var returnIdentities = new vI.identityCollection(); 176 177 177 178 var filterList = 178 vI _main.unicodeConverter.ConvertToUnicode(vI_main.preferences.getCharPref("smart_reply_filter")).split(/\n/)179 vI.main.unicodeConverter.ConvertToUnicode(vI.main.preferences.getCharPref("smart_reply_filter")).split(/\n/) 179 180 if (filterList.length == 0) filterList[0] == "" 180 181 … … 183 184 var recentfilterType; var skipRegExp = false; 184 185 if (filterList.length <= 1 && filterList[0] == "") 185 { vI _notificationBar.dump("## vI_smartIdentity: no filters configured\n"); recentfilterType = filterType.None; }186 { vI.notificationBar.dump("## smartIdentity: no filters configured\n"); recentfilterType = filterType.None; } 186 187 else if (/^[+-]?\/(.*)\/$/.exec(filterList[i])) 187 { vI _notificationBar.dump("## vI_smartIdentity: filter emails with RegExp '"188 { vI.notificationBar.dump("## smartIdentity: filter emails with RegExp '" 188 189 + filterList[i].replace(/\\/g,"\\\\") + "'\n"); recentfilterType = filterType.RegExp; } 189 else { vI _notificationBar.dump("## vI_smartIdentity: filter emails, compare with '"190 else { vI.notificationBar.dump("## smartIdentity: filter emails, compare with '" 190 191 + filterList[i] + "'\n"); recentfilterType = filterType.StrCmp; } 191 192 for (var j = 0; j < smartIdentities.number; j++) { // check if recent email-address (pre-choosen identity) is found in … … 205 206 } 206 207 catch(vErr) { 207 vI _notificationBar.addNote(208 vI _main.elements.strings.getString("vident.smartIdentity.ignoreRegExp") +208 vI.notificationBar.addNote( 209 vI.main.elements.strings.getString("vident.smartIdentity.ignoreRegExp") + 209 210 +filterList[i].replace(/\\/g,"\\\\") + " .", 210 211 "smart_reply_notification"); … … 223 224 __smartReplyCollectAddresses : function(hdr, allIdentities) { 224 225 // add emails from selected headers (stored by vI_getHeader.xul/js) 225 var reply_headers = vI _main.unicodeConverter.ConvertToUnicode(vI_main.preferences.getCharPref("smart_reply_headers")).split(/\n/)226 var reply_headers = vI.main.unicodeConverter.ConvertToUnicode(vI.main.preferences.getCharPref("smart_reply_headers")).split(/\n/) 226 227 227 228 for (var index = 0; index < reply_headers.length; index++) { … … 243 244 // if mailing-list ignore to-header (usually the mailing list address) 244 245 if (replyHeaderNameToRead == "to" && hdr.getStringProperty("vI_list-id")) { 245 vI _notificationBar.dump("## vI_smartIdentity: header 'list-id' found (mailinglist), skipping header 'to'\n");246 vI.notificationBar.dump("## smartIdentity: header 'list-id' found (mailinglist), skipping header 'to'\n"); 246 247 continue; 247 248 } 248 249 249 250 // ------------- read the stored header ------------------------------- 250 var value = vI _main.unicodeConverter.ConvertToUnicode(hdr.getStringProperty("vI_" + replyHeaderNameToRead))251 vI _notificationBar.dump("## vI_smartIdentity: reading header '" +251 var value = vI.main.unicodeConverter.ConvertToUnicode(hdr.getStringProperty("vI_" + replyHeaderNameToRead)) 252 vI.notificationBar.dump("## smartIdentity: reading header '" + 252 253 replyHeaderNameToRead + "': '" + value + "'\n"); 253 254 254 255 // ------------- parse address-string to get a field of single email-addresses 255 var splitted = new vI _identityCollection();256 vI_smartIdentity.__parseHeadersWithArray(value, splitted);256 var splitted = new vI.identityCollection(); 257 smartIdentity.__parseHeadersWithArray(value, splitted); 257 258 258 259 // move found addresses step by step to allIdentities, and change values if requested … … 260 261 // if there is no email than it makes no sense to use it as a sender 261 262 if (!splitted.identityDataCollection[i].email.match(/^.*@.*$/)) { 262 vI _notificationBar.dump("## vI_smartIdentity: skipping '" +263 vI.notificationBar.dump("## smartIdentity: skipping '" + 263 264 splitted.identityDataCollection[i].email + "', no email\n") 264 265 continue; … … 269 270 allIdentities.addWithoutDuplicates(splitted.identityDataCollection[i]); 270 271 271 vI _notificationBar.dump("## vI_smartIdentity: found '" +272 vI.notificationBar.dump("## smartIdentity: found '" + 272 273 splitted.identityDataCollection[i].combinedName + "'\n") 273 274 } … … 276 277 277 278 Reply : function() { 278 var hdr = vI_smartIdentity.messenger.279 var hdr = smartIdentity.messenger. 279 280 messageServiceFromURI(gMsgCompose.originalMsgURI).messageURIToMsgHdr(gMsgCompose.originalMsgURI); 280 281 281 vI _notificationBar.dump("## vI_smartIdentity: Reply()\n");282 vI.notificationBar.dump("## smartIdentity: Reply()\n"); 282 283 283 284 if (hdr && !gMsgCompose.compFields.newsgroups && !hdr.getStringProperty("vI_content_base")) { … … 291 292 // hidden option smart_detectByReceivedHeader will act as a switch for not RFC-compliant servers 292 293 // RFC-compliant 293 if (vI _main.preferences.getBoolPref("smart_detectByReceivedHeader")) {294 if (vI.main.preferences.getBoolPref("smart_detectByReceivedHeader")) { 294 295 if (!hdr.getStringProperty("vI_received")) { // mail was not received 295 vI _notificationBar.dump("## vI_smartIdentity: reply on non-received (sent?) mail. Using SmartDraft. \n");296 vI_smartIdentity.ReplyOnSent(hdr);296 vI.notificationBar.dump("## smartIdentity: reply on non-received (sent?) mail. Using SmartDraft. \n"); 297 smartIdentity.ReplyOnSent(hdr); 297 298 return; 298 299 } … … 304 305 305 306 if (hdr && (hdr.folder.flags & MSG_FOLDER_FLAG_SENTMAIL)) { 306 vI _notificationBar.dump("## vI_smartIdentity: reply from Sent folder.");307 vI.notificationBar.dump("## smartIdentity: reply from Sent folder."); 307 308 if (hdr.folder.flags & MSG_FOLDER_FLAG_INBOX) 308 vI _notificationBar.dump(" Folder is INBOX, assuming Reply-Case. \n");309 vI.notificationBar.dump(" Folder is INBOX, assuming Reply-Case. \n"); 309 310 else { 310 vI _notificationBar.dump(" Using SmartDraft. \n");311 vI_smartIdentity.ReplyOnSent(hdr);311 vI.notificationBar.dump(" Using SmartDraft. \n"); 312 smartIdentity.ReplyOnSent(hdr); 312 313 return; 313 314 } … … 316 317 } 317 318 318 if ( vI_smartIdentity.__ignoreID()) return;319 320 var storageIdentities = new vI _identityCollection();321 vI _storage.getVIdentityFromAllRecipients(storageIdentities);322 323 var smartIdentities = new vI _identityCollection();324 if (storageIdentities.number == 0 || !vI _main.preferences.getBoolPref("idSelection_storage_ignore_smart_reply"))325 vI_smartIdentity.__SmartReply(hdr, smartIdentities);326 else vI _notificationBar.dump("## vI_smartIdentity: SmartReply skipped, Identities in Storage found.\n");319 if (smartIdentity.__ignoreID()) return; 320 321 var storageIdentities = new vI.identityCollection(); 322 vI.storage.getVIdentityFromAllRecipients(storageIdentities); 323 324 var smartIdentities = new vI.identityCollection(); 325 if (storageIdentities.number == 0 || !vI.main.preferences.getBoolPref("idSelection_storage_ignore_smart_reply")) 326 smartIdentity.__SmartReply(hdr, smartIdentities); 327 else vI.notificationBar.dump("## smartIdentity: SmartReply skipped, Identities in Storage found.\n"); 327 328 328 329 // merge SmartReply-Identities and Storage-Identites 329 if (vI _main.preferences.getBoolPref("idSelection_storage_prefer_smart_reply"))330 if (vI.main.preferences.getBoolPref("idSelection_storage_prefer_smart_reply")) 330 331 { smartIdentities.mergeWithoutDuplicates(storageIdentities); var allIdentities = smartIdentities; } 331 332 else 332 333 { storageIdentities.mergeWithoutDuplicates(smartIdentities); var allIdentities = storageIdentities; } 333 334 334 vI _notificationBar.dump("## vI_smartIdentity: merged SmartReply & Storage, " + allIdentities.number + " address(es) left\n")335 336 if (allIdentities.number > 0) vI_smartIdentity.__smartIdentitySelection(allIdentities, false);335 vI.notificationBar.dump("## smartIdentity: merged SmartReply & Storage, " + allIdentities.number + " address(es) left\n") 336 337 if (allIdentities.number > 0) smartIdentity.__smartIdentitySelection(allIdentities, false); 337 338 }, 338 339 339 340 // this function checks if we have a reply-case and Smart-Reply should replace the Identity 340 341 __SmartReply : function(hdr, smartIdentities) { 341 if (!vI _main.preferences.getBoolPref("smart_reply"))342 { vI _notificationBar.dump("## vI_smartIdentity: SmartReply deactivated\n"); return; }343 if (gMsgCompose.compFields.newsgroups && !vI _main.preferences.getBoolPref("smart_reply_for_newsgroups")) {344 vI _notificationBar.dump("## vI_smartIdentity: SmartReply, answering to a newsgroup, aborting\n");342 if (!vI.main.preferences.getBoolPref("smart_reply")) 343 { vI.notificationBar.dump("## smartIdentity: SmartReply deactivated\n"); return; } 344 if (gMsgCompose.compFields.newsgroups && !vI.main.preferences.getBoolPref("smart_reply_for_newsgroups")) { 345 vI.notificationBar.dump("## smartIdentity: SmartReply, answering to a newsgroup, aborting\n"); 345 346 return; 346 347 } 347 348 348 vI _notificationBar.dump("## vI_smartIdentity: __SmartReply()\n");349 vI _notificationBar.dump("## vI_smartIdentity: ----------------------------------------------------------\n")349 vI.notificationBar.dump("## smartIdentity: __SmartReply()\n"); 350 vI.notificationBar.dump("## smartIdentity: ----------------------------------------------------------\n") 350 351 if (hdr) { 351 352 /* first step: collect addresses */ 352 vI_smartIdentity.__smartReplyCollectAddresses(hdr, smartIdentities);353 vI _notificationBar.dump("## vI_smartIdentity: " + smartIdentities.number + " address(es) after parsing, before filtering\n")353 smartIdentity.__smartReplyCollectAddresses(hdr, smartIdentities); 354 vI.notificationBar.dump("## smartIdentity: " + smartIdentities.number + " address(es) after parsing, before filtering\n") 354 355 355 356 /* second step: filter (and sort) addresses */ 356 vI_smartIdentity.__filterAddresses(smartIdentities);357 358 vI _notificationBar.dump("## vI_smartIdentity: filtering done, " + smartIdentities.number + " address(es) left\n")357 smartIdentity.__filterAddresses(smartIdentities); 358 359 vI.notificationBar.dump("## smartIdentity: filtering done, " + smartIdentities.number + " address(es) left\n") 359 360 360 361 /* set default FullName */ 361 var smart_reply_defaultFullName = vI _main.unicodeConverter.ConvertToUnicode(vI_main.preferences.getCharPref("smart_reply_defaultFullName"))362 var smart_reply_defaultFullName = vI.main.unicodeConverter.ConvertToUnicode(vI.main.preferences.getCharPref("smart_reply_defaultFullName")) 362 363 if (smart_reply_defaultFullName != "") { 363 364 for (var index = 0; index < smartIdentities.number; index++) { 364 365 if (smartIdentities.identityDataCollection[index].fullName == "") { 365 366 smartIdentities.identityDataCollection[index].fullName = smart_reply_defaultFullName 366 vI _notificationBar.dump("## vI_smartIdentity: added default FullName '" +367 vI.notificationBar.dump("## smartIdentity: added default FullName '" + 367 368 smart_reply_defaultFullName + "' to '" + smartIdentities.identityDataCollection[index].email + "'\n") 368 369 } … … 373 374 /* if match replace FullName with existing one, keep identity in list by now */ 374 375 /* will not be added to the menu but probably choosen with __smartIdentitySelection */ 375 if (vI _main.preferences.getBoolPref("smart_reply_ignoreFullName")) {376 vI _notificationBar.dump("## vI_smartIdentity: compare with existing Identities (ignoring FullNames).\n")376 if (vI.main.preferences.getBoolPref("smart_reply_ignoreFullName")) { 377 vI.notificationBar.dump("## smartIdentity: compare with existing Identities (ignoring FullNames).\n") 377 378 378 379 for (var index = 0; index < smartIdentities.number; index++) { … … 381 382 var newFullName = gAccountManager.getIdentity(idKey).fullName; 382 383 smartIdentities.identityDataCollection[index].fullName = newFullName; 383 vI _notificationBar.dump("## vI_smartIdentity: replaced Fullname of '" + smartIdentities.identityDataCollection[index].email + "' with '" + newFullName + "' \n");384 vI.notificationBar.dump("## smartIdentity: replaced Fullname of '" + smartIdentities.identityDataCollection[index].email + "' with '" + newFullName + "' \n"); 384 385 } 385 386 } 386 387 } 387 388 } 388 else vI _notificationBar.dump("## vI_smartIdentity: SmartReply skipped. No Header-information found.\n");389 390 vI _notificationBar.dump("## vI_smartIdentity: ----------------------------------------------------------\n")389 else vI.notificationBar.dump("## smartIdentity: SmartReply skipped. No Header-information found.\n"); 390 391 vI.notificationBar.dump("## smartIdentity: ----------------------------------------------------------\n") 391 392 }, 392 393 … … 398 399 allIdentities.identityDataCollection[index].id.key = existingID; // set found identity 399 400 // if 'preferExisting' than select it and return 400 if (vI _main.preferences.getBoolPref("idSelection_preferExisting")) {401 vI _notificationBar.dump("## vI_smartIdentity: found existing Identity, use without interaction.\n");401 if (vI.main.preferences.getBoolPref("idSelection_preferExisting")) { 402 vI.notificationBar.dump("## smartIdentity: found existing Identity, use without interaction.\n"); 402 403 // add all Indentities to Clone Menu before selecting and leaving the function 403 404 document.getElementById("msgIdentity_clone").addIdentitiesToCloneMenu(allIdentities); 404 vI_smartIdentity.changeIdentityToSmartIdentity(allIdentities, index);405 smartIdentity.changeIdentityToSmartIdentity(allIdentities, index); 405 406 return; 406 407 } 407 408 // else reorder list of Identities to prefer it on autoselect 408 409 // has to be done before Identities are added to the Menu 409 vI _notificationBar.dump("## vI_smartIdentity: found existing Identity, prefer this one.\n");410 vI.notificationBar.dump("## smartIdentity: found existing Identity, prefer this one.\n"); 410 411 var firstIdentity = allIdentities.identityDataCollection[index]; 411 412 for (var i = index; index > 0; index--) { … … 419 420 document.getElementById("msgIdentity_clone").addIdentitiesToCloneMenu(allIdentities); 420 421 421 if (!autocreate && vI _main.preferences.getBoolPref("idSelection_ask") &&422 ((allIdentities.number == 1 && vI _main.preferences.getBoolPref("idSelection_ask_always"))422 if (!autocreate && vI.main.preferences.getBoolPref("idSelection_ask") && 423 ((allIdentities.number == 1 && vI.main.preferences.getBoolPref("idSelection_ask_always")) 423 424 || allIdentities.number > 1)) { 424 425 for (var index = 0; index < allIdentities.number; index++) { 425 vI _notificationBar.dump("## vI_smartIdentityReplyDialog index=" + index + ": '" + allIdentities.identityDataCollection[index].combinedName + "' "426 vI.notificationBar.dump("## smartIdentityReplyDialog index=" + index + ": '" + allIdentities.identityDataCollection[index].combinedName + "' " 426 427 + "(" + allIdentities.identityDataCollection[index].id.value + "," + allIdentities.identityDataCollection[index].smtp.value + ")\n"); 427 428 } … … 429 430 "chrome, dialog, modal, alwaysRaised, resizable=yes", 430 431 allIdentities, 431 /* callback: */ vI_smartIdentity.changeIdentityToSmartIdentity).focus();432 } 433 else if (autocreate || vI _main.preferences.getBoolPref("idSelection_autocreate")) {434 vI_smartIdentity.changeIdentityToSmartIdentity(allIdentities, 0);432 /* callback: */ smartIdentity.changeIdentityToSmartIdentity).focus(); 433 } 434 else if (autocreate || vI.main.preferences.getBoolPref("idSelection_autocreate")) { 435 smartIdentity.changeIdentityToSmartIdentity(allIdentities, 0); 435 436 } 436 437 }, 437 438 438 439 changeIdentityToSmartIdentity : function(allIdentities, selectedValue) { 439 vI _notificationBar.dump("## changeIdentityToSmartIdentity selectedValue=" + selectedValue + ": '" + allIdentities.identityDataCollection[selectedValue].combinedName + "' "440 vI.notificationBar.dump("## changeIdentityToSmartIdentity selectedValue=" + selectedValue + ": '" + allIdentities.identityDataCollection[selectedValue].combinedName + "' " 440 441 + "(" + allIdentities.identityDataCollection[selectedValue].id.value + "," + allIdentities.identityDataCollection[selectedValue].smtp.value + ")\n"); 441 442 document.getElementById("msgIdentity_clone").selectedMenuItem = allIdentities.menuItems[selectedValue]; 442 443 if (document.getElementById("msgIdentity_clone").vid) { 443 var label=vI _main.elements.strings.getString("vident.smartIdentity.vIUsage");444 var label=vI.main.elements.strings.getString("vident.smartIdentity.vIUsage"); 444 445 if (allIdentities.number > 1) label += " " 445 + vI _main.elements.strings.getString("vident.smartIdentity.moreThanOne");446 vI _notificationBar.addNote(label + ".", "smart_reply_notification");447 } 448 vI_smartIdentity.__removeSmartIdentityFromRecipients(allIdentities, selectedValue);446 + vI.main.elements.strings.getString("vident.smartIdentity.moreThanOne"); 447 vI.notificationBar.addNote(label + ".", "smart_reply_notification"); 448 } 449 smartIdentity.__removeSmartIdentityFromRecipients(allIdentities, selectedValue); 449 450 }, 450 451 451 452 __removeSmartIdentityFromRecipients : function(allIdentities, index) { 452 if (!vI _main.preferences.getBoolPref("idSelection_removeSmartIdentityFromRecipients")) return;453 if (!vI.main.preferences.getBoolPref("idSelection_removeSmartIdentityFromRecipients")) return; 453 454 454 455 // check if selected email is defined as doBcc address. If so, it should not be removed. 455 456 var skip_bcc = false; 456 457 if (getCurrentIdentity().doBcc) { 457 var bcc_addresses = new vI _identityCollection();458 vI_smartIdentity.__parseHeadersWithArray(getCurrentIdentity().doBccList, bcc_addresses);458 var bcc_addresses = new vI.identityCollection(); 459 smartIdentity.__parseHeadersWithArray(getCurrentIdentity().doBccList, bcc_addresses); 459 460 460 461 for (var i = 0; i < bcc_addresses.number; i++) { … … 487 488 awSetInputAndPopupValue(input, "", popup, "addr_to", -1); 488 489 awCleanupRows() 489 vI _notificationBar.addNote(" " +490 vI _main.elements.strings.getString("vident.smartIdentity.remRecipient"),490 vI.notificationBar.addNote(" " + 491 vI.main.elements.strings.getString("vident.smartIdentity.remRecipient"), 491 492 "smart_reply_notification"); 492 493 break; … … 495 496 } 496 497 } 498 vI.smartIdentity = smartIdentity; 499 }}); -
chrome/content/v_identity/vI_smartReplyDialog.js
r92fd25 rc3feaa 23 23 * ***** END LICENSE BLOCK ***** */ 24 24 25 var vI_smartReply_dialog = { 25 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 26 var smartReply_dialog = { 26 27 Obj_radioGroup : null, 27 28 all_addresses : null, 28 29 29 30 init : function() { 30 vI_smartReply_dialog.Obj_radioGroup = document.getElementById("replySelector.radiogroup");31 vI_smartReply_dialog.all_addresses = window.arguments[0];32 for (var index = 0; index < vI_smartReply_dialog.all_addresses.number; index++) {33 var menuentry = vI_smartReply_dialog.all_addresses.identityDataCollection[index].combinedName;31 smartReply_dialog.Obj_radioGroup = document.getElementById("replySelector.radiogroup"); 32 smartReply_dialog.all_addresses = window.arguments[0]; 33 for (var index = 0; index < smartReply_dialog.all_addresses.number; index++) { 34 var menuentry = smartReply_dialog.all_addresses.identityDataCollection[index].combinedName; 34 35 35 36 var id = null; var smtp = null; 36 37 37 if ( vI_smartReply_dialog.all_addresses.identityDataCollection[index].id)38 id = vI_smartReply_dialog.all_addresses.identityDataCollection[index].id.value;39 if ( vI_smartReply_dialog.all_addresses.identityDataCollection[index].smtp)40 smtp = vI_smartReply_dialog.all_addresses.identityDataCollection[index].smtp.value;38 if (smartReply_dialog.all_addresses.identityDataCollection[index].id) 39 id = smartReply_dialog.all_addresses.identityDataCollection[index].id.value; 40 if (smartReply_dialog.all_addresses.identityDataCollection[index].smtp) 41 smtp = smartReply_dialog.all_addresses.identityDataCollection[index].smtp.value; 41 42 42 43 menuentry += (id?" (" + id + "," + 43 44 (smtp?smtp:document.getElementById("bundle_messenger").getString("defaultServerTag")) + 44 45 ")":"") 45 vI_smartReply_dialog.add_row(menuentry);46 smartReply_dialog.add_row(menuentry); 46 47 } 47 48 }, … … 50 51 var radio = document.createElement("radio"); 51 52 radio.setAttribute("label",combinedName); 52 vI_smartReply_dialog.Obj_radioGroup.appendChild(radio);53 smartReply_dialog.Obj_radioGroup.appendChild(radio); 53 54 }, 54 55 55 56 accept : function() { 56 57 /* window.argument[1] stores callback function */ 57 window.arguments[1]( vI_smartReply_dialog.all_addresses, vI_smartReply_dialog.Obj_radioGroup.selectedIndex);58 window.arguments[1](smartReply_dialog.all_addresses, smartReply_dialog.Obj_radioGroup.selectedIndex); 58 59 document.documentElement.acceptDialog(); 59 60 } 60 61 } 61 window.addEventListener("load", vI_smartReply_dialog.init, false); 62 window.addEventListener("load", smartReply_dialog.init, false); 63 }}); -
chrome/content/v_identity/vI_smartReplyDialog.xul
r92fd25 rc3feaa 37 37 zlevel="6"> 38 38 39 <script type="application/x-javascript" 40 39 <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" /> 40 <script type="application/x-javascript" src="chrome://v_identity/content/vI_smartReplyDialog.js" /> 41 41 42 42 <stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/> … … 49 49 <caption label="&vident.replySelector.caption.label;"/> 50 50 51 <radiogroup id="replySelector.radiogroup" oncommand="v I_smartReply_dialog.accept();">51 <radiogroup id="replySelector.radiogroup" oncommand="virtualIdentityExtension.smartReply_dialog.accept();"> 52 52 </radiogroup> 53 53 </groupbox> -
chrome/content/v_identity/vI_statusmenu.js
r92fd25 rc3feaa 23 23 * ***** END LICENSE BLOCK ***** */ 24 24 25 var vI_statusmenu = { 25 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 26 var statusmenu = { 26 27 prefroot : Components.classes["@mozilla.org/preferences-service;1"] 27 28 .getService(Components.interfaces.nsIPrefService) … … 41 42 switch (data) { 42 43 case "extensions.virtualIdentity.fcc_show_switch": 43 vI_statusmenu.objFccSwitch.setAttribute("hidden", !vI_statusmenu.prefroot.getBoolPref(data));44 statusmenu.objFccSwitch.setAttribute("hidden", !statusmenu.prefroot.getBoolPref(data)); 44 45 // no break, continue like with doFcc 45 46 case "extensions.virtualIdentity.doFcc": 46 vI_statusmenu.objFccSwitch.setAttribute("checked", vI_statusmenu.prefroot.getBoolPref("extensions.virtualIdentity.doFcc"));47 statusmenu.objFccSwitch.setAttribute("checked", statusmenu.prefroot.getBoolPref("extensions.virtualIdentity.doFcc")); 47 48 break; 48 49 case "extensions.virtualIdentity.storage_show_switch": 49 vI_statusmenu.objSaveSwitch.setAttribute("hidden", !vI_statusmenu.prefroot.getBoolPref(data));50 statusmenu.objSaveSwitch.setAttribute("hidden", !statusmenu.prefroot.getBoolPref(data)); 50 51 break; 51 52 case "extensions.virtualIdentity.storage_show_baseID_switch": 52 vI_statusmenu.objSaveBaseIDSwitch.setAttribute("hidden", !vI_statusmenu.prefroot.getBoolPref(data));53 statusmenu.objSaveBaseIDSwitch.setAttribute("hidden", !statusmenu.prefroot.getBoolPref(data)); 53 54 break; 54 55 case "extensions.virtualIdentity.storage_show_SMTP_switch": 55 vI_statusmenu.objSaveSMTPSwitch.setAttribute("hidden", !vI_statusmenu.prefroot.getBoolPref(data));56 statusmenu.objSaveSMTPSwitch.setAttribute("hidden", !statusmenu.prefroot.getBoolPref(data)); 56 57 break; 57 58 case "extensions.virtualIdentity.storage_storedefault": 58 vI_statusmenu.objStorageSaveMenuItem.setAttribute("checked", vI_statusmenu.prefroot.getBoolPref("extensions.virtualIdentity.storage_storedefault"));59 statusmenu.objStorageSaveMenuItem.setAttribute("checked", statusmenu.prefroot.getBoolPref("extensions.virtualIdentity.storage_storedefault")); 59 60 break; 60 61 case "extensions.virtualIdentity.storage_store_base_id": 61 vI_statusmenu.objSaveBaseIDMenuItem.setAttribute("checked", vI_statusmenu.prefroot.getBoolPref(data));62 statusmenu.objSaveBaseIDMenuItem.setAttribute("checked", statusmenu.prefroot.getBoolPref(data)); 62 63 break; 63 64 case "extensions.virtualIdentity.storage_store_SMTP": 64 vI_statusmenu.objSaveSMTPMenuItem.setAttribute("checked", vI_statusmenu.prefroot.getBoolPref(data));65 statusmenu.objSaveSMTPMenuItem.setAttribute("checked", statusmenu.prefroot.getBoolPref(data)); 65 66 break; 66 67 case "extensions.virtualIdentity.storage_colorIndication": 67 document.getElementById("identityHbox").setAttribute("colorize", vI_statusmenu.prefroot.getBoolPref(data))68 document.getElementById("baseIDHbox").setAttribute("colorize", vI_statusmenu.prefroot.getBoolPref(data))69 document.getElementById("smtpServerHbox").setAttribute("colorize", vI_statusmenu.prefroot.getBoolPref(data))68 document.getElementById("identityHbox").setAttribute("colorize", statusmenu.prefroot.getBoolPref(data)) 69 document.getElementById("baseIDHbox").setAttribute("colorize", statusmenu.prefroot.getBoolPref(data)) 70 document.getElementById("smtpServerHbox").setAttribute("colorize", statusmenu.prefroot.getBoolPref(data)) 70 71 break; 71 72 case "extensions.virtualIdentity.storage": 72 if ( vI_statusmenu.prefroot.getBoolPref(data)) {73 vI_statusmenu.objStorageSaveMenuItem.removeAttribute("hidden");74 vI_statusmenu.objSaveBaseIDMenuItem.removeAttribute("hidden");75 vI_statusmenu.objSaveSMTPMenuItem.removeAttribute("hidden");76 vI_statusmenu.objStatusMenuSeparator.removeAttribute("hidden");73 if (statusmenu.prefroot.getBoolPref(data)) { 74 statusmenu.objStorageSaveMenuItem.removeAttribute("hidden"); 75 statusmenu.objSaveBaseIDMenuItem.removeAttribute("hidden"); 76 statusmenu.objSaveSMTPMenuItem.removeAttribute("hidden"); 77 statusmenu.objStatusMenuSeparator.removeAttribute("hidden"); 77 78 } 78 79 else { 79 vI_statusmenu.objStorageSaveMenuItem.setAttribute("hidden", "true");80 vI_statusmenu.objSaveBaseIDMenuItem.setAttribute("hidden", "true");81 vI_statusmenu.objSaveSMTPMenuItem.setAttribute("hidden", "true");82 vI_statusmenu.objStatusMenuSeparator.setAttribute("hidden", "true");80 statusmenu.objStorageSaveMenuItem.setAttribute("hidden", "true"); 81 statusmenu.objSaveBaseIDMenuItem.setAttribute("hidden", "true"); 82 statusmenu.objSaveSMTPMenuItem.setAttribute("hidden", "true"); 83 statusmenu.objStatusMenuSeparator.setAttribute("hidden", "true"); 83 84 } 84 85 break; 85 86 } 86 vI_statusmenu.menuConstraint(vI_statusmenu.objStorageSaveMenuItem);87 statusmenu.menuConstraint(statusmenu.objStorageSaveMenuItem); 87 88 }, 88 89 89 90 addObserver: function() { 90 vI_statusmenu.prefroot.addObserver("extensions.virtualIdentity.fcc_show_switch", vI_statusmenu, false);91 vI_statusmenu.prefroot.addObserver("extensions.virtualIdentity.doFcc", vI_statusmenu, false);92 vI_statusmenu.prefroot.addObserver("extensions.virtualIdentity.storage", vI_statusmenu, false);93 vI_statusmenu.prefroot.addObserver("extensions.virtualIdentity.storage_show_switch", vI_statusmenu, false);94 vI_statusmenu.prefroot.addObserver("extensions.virtualIdentity.storage_show_baseID_switch", vI_statusmenu, false);95 vI_statusmenu.prefroot.addObserver("extensions.virtualIdentity.storage_show_SMTP_switch", vI_statusmenu, false);96 vI_statusmenu.prefroot.addObserver("extensions.virtualIdentity.storage_colorIndication", vI_statusmenu, false);97 vI_statusmenu.prefroot.addObserver("extensions.virtualIdentity.storage_storedefault", vI_statusmenu, false);98 vI_statusmenu.prefroot.addObserver("extensions.virtualIdentity.storage_store_base_id", vI_statusmenu, false);99 vI_statusmenu.prefroot.addObserver("extensions.virtualIdentity.storage_store_SMTP", vI_statusmenu, false);91 statusmenu.prefroot.addObserver("extensions.virtualIdentity.fcc_show_switch", statusmenu, false); 92 statusmenu.prefroot.addObserver("extensions.virtualIdentity.doFcc", statusmenu, false); 93 statusmenu.prefroot.addObserver("extensions.virtualIdentity.storage", statusmenu, false); 94 statusmenu.prefroot.addObserver("extensions.virtualIdentity.storage_show_switch", statusmenu, false); 95 statusmenu.prefroot.addObserver("extensions.virtualIdentity.storage_show_baseID_switch", statusmenu, false); 96 statusmenu.prefroot.addObserver("extensions.virtualIdentity.storage_show_SMTP_switch", statusmenu, false); 97 statusmenu.prefroot.addObserver("extensions.virtualIdentity.storage_colorIndication", statusmenu, false); 98 statusmenu.prefroot.addObserver("extensions.virtualIdentity.storage_storedefault", statusmenu, false); 99 statusmenu.prefroot.addObserver("extensions.virtualIdentity.storage_store_base_id", statusmenu, false); 100 statusmenu.prefroot.addObserver("extensions.virtualIdentity.storage_store_SMTP", statusmenu, false); 100 101 }, 101 102 102 103 removeObserver: function() { 103 vI_statusmenu.prefroot.removeObserver("extensions.virtualIdentity.fcc_show_switch", vI_statusmenu);104 vI_statusmenu.prefroot.removeObserver("extensions.virtualIdentity.doFcc", vI_statusmenu);105 vI_statusmenu.prefroot.removeObserver("extensions.virtualIdentity.storage", vI_statusmenu);106 vI_statusmenu.prefroot.removeObserver("extensions.virtualIdentity.storage_show_switch", vI_statusmenu);107 vI_statusmenu.prefroot.removeObserver("extensions.virtualIdentity.storage_show_baseID_switch", vI_statusmenu);108 vI_statusmenu.prefroot.removeObserver("extensions.virtualIdentity.storage_show_SMTP_switch", vI_statusmenu);109 vI_statusmenu.prefroot.removeObserver("extensions.virtualIdentity.storage_colorIndication", vI_statusmenu);110 vI_statusmenu.prefroot.removeObserver("extensions.virtualIdentity.storage_storedefault", vI_statusmenu);111 vI_statusmenu.prefroot.removeObserver("extensions.virtualIdentity.storage_store_base_id", vI_statusmenu);112 vI_statusmenu.prefroot.removeObserver("extensions.virtualIdentity.storage_store_SMTP", vI_statusmenu);104 statusmenu.prefroot.removeObserver("extensions.virtualIdentity.fcc_show_switch", statusmenu); 105 statusmenu.prefroot.removeObserver("extensions.virtualIdentity.doFcc", statusmenu); 106 statusmenu.prefroot.removeObserver("extensions.virtualIdentity.storage", statusmenu); 107 statusmenu.prefroot.removeObserver("extensions.virtualIdentity.storage_show_switch", statusmenu); 108 statusmenu.prefroot.removeObserver("extensions.virtualIdentity.storage_show_baseID_switch", statusmenu); 109 statusmenu.prefroot.removeObserver("extensions.virtualIdentity.storage_show_SMTP_switch", statusmenu); 110 statusmenu.prefroot.removeObserver("extensions.virtualIdentity.storage_colorIndication", statusmenu); 111 statusmenu.prefroot.removeObserver("extensions.virtualIdentity.storage_storedefault", statusmenu); 112 statusmenu.prefroot.removeObserver("extensions.virtualIdentity.storage_store_base_id", statusmenu); 113 statusmenu.prefroot.removeObserver("extensions.virtualIdentity.storage_store_SMTP", statusmenu); 113 114 }, 114 115 115 116 init : function () { 116 vI_statusmenu.prefroot.QueryInterface(Components.interfaces.nsIPrefBranch2);117 118 vI_statusmenu.objStatusMenu = document.getElementById("vI-status-menu");119 vI_statusmenu.objSaveBaseIDMenuItem = document.getElementById("vI_statusMenu_storage_saveBaseID");120 vI_statusmenu.objSaveSMTPMenuItem = document.getElementById("vI_statusMenu_storage_saveSMTP");121 vI_statusmenu.objStorageSaveMenuItem = document.getElementById("vI_statusMenu_storage_save");122 vI_statusmenu.objStatusMenuSeparator = document.getElementById("vI_statusMenu_separator");123 vI_statusmenu.objSaveSwitch = document.getElementById("saveSwitch");124 vI_statusmenu.objSaveBaseIDSwitch = document.getElementById("saveBaseIDSwitch");125 vI_statusmenu.objSaveSMTPSwitch = document.getElementById("saveSMTPSwitch");126 vI_statusmenu.objFccSwitch = document.getElementById("fcc_switch");127 vI_statusmenu.objStatusText = document.getElementById("statusText");128 vI_statusmenu.objStatusTooltipLine1 = document.getElementById("vI_statusMenuTooltip_StatusValueLine1");129 vI_statusmenu.objStatusTooltipLine2 = document.getElementById("vI_statusMenuTooltip_StatusValueLine2");130 131 vI_statusmenu.addObserver();132 vI_statusmenu.observe(null, null, "extensions.virtualIdentity.fcc_show_switch");133 vI_statusmenu.observe(null, null, "extensions.virtualIdentity.storage_show_switch");134 vI_statusmenu.observe(null, null, "extensions.virtualIdentity.storage_show_baseID_switch");135 vI_statusmenu.observe(null, null, "extensions.virtualIdentity.storage_show_SMTP_switch");136 vI_statusmenu.observe(null, null, "extensions.virtualIdentity.storage_colorIndication");137 vI_statusmenu.observe(null, null, "extensions.virtualIdentity.storage_store_base_id");138 vI_statusmenu.observe(null, null, "extensions.virtualIdentity.storage_store_SMTP");139 vI_statusmenu.observe(null, null, "extensions.virtualIdentity.storage_storedefault");140 vI_statusmenu.observe(null, null, "extensions.virtualIdentity.storage");117 statusmenu.prefroot.QueryInterface(Components.interfaces.nsIPrefBranch2); 118 119 statusmenu.objStatusMenu = document.getElementById("vI-status-menu"); 120 statusmenu.objSaveBaseIDMenuItem = document.getElementById("vI_statusMenu_storage_saveBaseID"); 121 statusmenu.objSaveSMTPMenuItem = document.getElementById("vI_statusMenu_storage_saveSMTP"); 122 statusmenu.objStorageSaveMenuItem = document.getElementById("vI_statusMenu_storage_save"); 123 statusmenu.objStatusMenuSeparator = document.getElementById("vI_statusMenu_separator"); 124 statusmenu.objSaveSwitch = document.getElementById("saveSwitch"); 125 statusmenu.objSaveBaseIDSwitch = document.getElementById("saveBaseIDSwitch"); 126 statusmenu.objSaveSMTPSwitch = document.getElementById("saveSMTPSwitch"); 127 statusmenu.objFccSwitch = document.getElementById("fcc_switch"); 128 statusmenu.objStatusText = document.getElementById("statusText"); 129 statusmenu.objStatusTooltipLine1 = document.getElementById("vI_statusMenuTooltip_StatusValueLine1"); 130 statusmenu.objStatusTooltipLine2 = document.getElementById("vI_statusMenuTooltip_StatusValueLine2"); 131 132 statusmenu.addObserver(); 133 statusmenu.observe(null, null, "extensions.virtualIdentity.fcc_show_switch"); 134 statusmenu.observe(null, null, "extensions.virtualIdentity.storage_show_switch"); 135 statusmenu.observe(null, null, "extensions.virtualIdentity.storage_show_baseID_switch"); 136 statusmenu.observe(null, null, "extensions.virtualIdentity.storage_show_SMTP_switch"); 137 statusmenu.observe(null, null, "extensions.virtualIdentity.storage_colorIndication"); 138 statusmenu.observe(null, null, "extensions.virtualIdentity.storage_store_base_id"); 139 statusmenu.observe(null, null, "extensions.virtualIdentity.storage_store_SMTP"); 140 statusmenu.observe(null, null, "extensions.virtualIdentity.storage_storedefault"); 141 statusmenu.observe(null, null, "extensions.virtualIdentity.storage"); 141 142 }, 142 143 … … 145 146 var sourceString = "vident.statusText.save." + save; 146 147 if (smtp != "off") sourceString = sourceString + ".smtp" 147 var messageLine1 = vI _main.elements.strings.getString(sourceString + ".line1");148 var messageLine2 = vI _main.elements.strings.getString(sourceString + ".line2");148 var messageLine1 = vI.main.elements.strings.getString(sourceString + ".line1"); 149 var messageLine2 = vI.main.elements.strings.getString(sourceString + ".line2"); 149 150 if (!messageLine2) { 150 vI_statusmenu.objStatusText.setAttribute("label", messageLine1);151 vI_statusmenu.objStatusTooltipLine1.setAttribute("value", messageLine1);152 vI_statusmenu.objStatusTooltipLine2.setAttribute("hidden", "true");151 statusmenu.objStatusText.setAttribute("label", messageLine1); 152 statusmenu.objStatusTooltipLine1.setAttribute("value", messageLine1); 153 statusmenu.objStatusTooltipLine2.setAttribute("hidden", "true"); 153 154 } 154 155 else { 155 vI_statusmenu.objStatusText.setAttribute("label", messageLine1 + " " + messageLine2);156 vI_statusmenu.objStatusTooltipLine1.setAttribute("value", messageLine1);157 vI_statusmenu.objStatusTooltipLine2.setAttribute("value", messageLine2);158 vI_statusmenu.objStatusTooltipLine2.removeAttribute("hidden");159 } 160 window.setTimeout(v I_statusmenu.__clearStatusMessage, vI_statusmenu.__timeout * 1000);156 statusmenu.objStatusText.setAttribute("label", messageLine1 + " " + messageLine2); 157 statusmenu.objStatusTooltipLine1.setAttribute("value", messageLine1); 158 statusmenu.objStatusTooltipLine2.setAttribute("value", messageLine2); 159 statusmenu.objStatusTooltipLine2.removeAttribute("hidden"); 160 } 161 window.setTimeout(virtualIdentityExtension.statusmenu.__clearStatusMessage, statusmenu.__timeout * 1000); 161 162 }, 162 163 163 164 __clearStatusMessage : function() { 164 vI_statusmenu.objStatusText.setAttribute("label", "");165 statusmenu.objStatusText.setAttribute("label", ""); 165 166 }, 166 167 167 168 changeSMTPStatus : function (elem) { 168 vI_statusmenu.objSaveSMTPMenuItem.setAttribute("checked", elem.getAttribute("checked"));169 vI_statusmenu.menuConstraint();169 statusmenu.objSaveSMTPMenuItem.setAttribute("checked", elem.getAttribute("checked")); 170 statusmenu.menuConstraint(); 170 171 }, 171 172 172 173 changeBaseIDStatus : function (elem) { 173 vI_statusmenu.objSaveBaseIDMenuItem.setAttribute("checked", elem.getAttribute("checked"));174 vI_statusmenu.menuConstraint();174 statusmenu.objSaveBaseIDMenuItem.setAttribute("checked", elem.getAttribute("checked")); 175 statusmenu.menuConstraint(); 175 176 }, 176 177 177 178 changeSaveStatus : function (elem) { 178 vI_statusmenu.objStorageSaveMenuItem.setAttribute("checked", elem.getAttribute("checked"));179 vI_statusmenu.menuConstraint();179 statusmenu.objStorageSaveMenuItem.setAttribute("checked", elem.getAttribute("checked")); 180 statusmenu.menuConstraint(); 180 181 }, 181 182 182 183 menuConstraint : function () { 183 184 var save = "off"; var smtp = "off"; 184 if ( vI_statusmenu.objStorageSaveMenuItem.getAttribute("checked") == "true") {185 vI_statusmenu.objSaveSMTPMenuItem.removeAttribute("disabled");186 vI_statusmenu.objSaveBaseIDMenuItem.removeAttribute("disabled");187 if ( vI_statusmenu.prefroot.getBoolPref("extensions.virtualIdentity.storage")) {188 if ( vI_statusmenu.objSaveBaseIDMenuItem.getAttribute("checked") == "true") save = "base";185 if (statusmenu.objStorageSaveMenuItem.getAttribute("checked") == "true") { 186 statusmenu.objSaveSMTPMenuItem.removeAttribute("disabled"); 187 statusmenu.objSaveBaseIDMenuItem.removeAttribute("disabled"); 188 if (statusmenu.prefroot.getBoolPref("extensions.virtualIdentity.storage")) { 189 if (statusmenu.objSaveBaseIDMenuItem.getAttribute("checked") == "true") save = "base"; 189 190 else save = "ok"; 190 if ( vI_statusmenu.objSaveSMTPMenuItem.getAttribute("checked") == "true") smtp = "save";191 if (statusmenu.objSaveSMTPMenuItem.getAttribute("checked") == "true") smtp = "save"; 191 192 } 192 193 } 193 194 else { 194 vI_statusmenu.objSaveSMTPMenuItem.setAttribute("disabled", "true");195 vI_statusmenu.objSaveBaseIDMenuItem.setAttribute("disabled", "true");196 } 197 vI_statusmenu.objStatusMenu.setAttribute("save", save);198 vI_statusmenu.objStatusMenu.setAttribute("smtp", smtp);199 vI_statusmenu.__addStatusMessage(save, smtp);195 statusmenu.objSaveSMTPMenuItem.setAttribute("disabled", "true"); 196 statusmenu.objSaveBaseIDMenuItem.setAttribute("disabled", "true"); 197 } 198 statusmenu.objStatusMenu.setAttribute("save", save); 199 statusmenu.objStatusMenu.setAttribute("smtp", smtp); 200 statusmenu.__addStatusMessage(save, smtp); 200 201 }, 201 202 202 203 clicked : function (button) { 203 204 if (button != 0) return; // only react on left mouse button 204 if (! vI_statusmenu.prefroot.getBoolPref("extensions.virtualIdentity.storage")) return;205 206 var curSaveStatus = ( vI_statusmenu.objStorageSaveMenuItem.getAttribute("checked") == "true");207 var curSaveSMTPStatus = ( vI_statusmenu.objSaveSMTPMenuItem.getAttribute("checked") == "true");208 var curSaveBaseIDStatus = ( vI_statusmenu.objSaveBaseIDMenuItem.getAttribute("checked") == "true");205 if (!statusmenu.prefroot.getBoolPref("extensions.virtualIdentity.storage")) return; 206 207 var curSaveStatus = (statusmenu.objStorageSaveMenuItem.getAttribute("checked") == "true"); 208 var curSaveSMTPStatus = (statusmenu.objSaveSMTPMenuItem.getAttribute("checked") == "true"); 209 var curSaveBaseIDStatus = (statusmenu.objSaveBaseIDMenuItem.getAttribute("checked") == "true"); 209 210 var newSaveStatus = ((!curSaveStatus) || (curSaveStatus && !curSaveSMTPStatus) || (curSaveStatus && !curSaveBaseIDStatus)) 210 211 var newSaveSMTPStatus = ((!curSaveSMTPStatus && curSaveStatus) || (curSaveBaseIDStatus && !curSaveSMTPStatus)) 211 212 var newSaveBaseIDStatus = ((curSaveSMTPStatus && curSaveStatus && !curSaveBaseIDStatus) || (curSaveBaseIDStatus && !curSaveSMTPStatus)) 212 vI_statusmenu.objStorageSaveMenuItem.setAttribute("checked", newSaveStatus)213 vI_statusmenu.objSaveSMTPMenuItem.setAttribute("checked", newSaveSMTPStatus)214 vI_statusmenu.objSaveBaseIDMenuItem.setAttribute("checked", newSaveBaseIDStatus)213 statusmenu.objStorageSaveMenuItem.setAttribute("checked", newSaveStatus) 214 statusmenu.objSaveSMTPMenuItem.setAttribute("checked", newSaveSMTPStatus) 215 statusmenu.objSaveBaseIDMenuItem.setAttribute("checked", newSaveBaseIDStatus) 215 216 216 vI_statusmenu.menuConstraint();217 statusmenu.menuConstraint(); 217 218 } 218 219 } 220 vI.statusmenu = statusmenu; 221 }}); -
chrome/content/v_identity/vI_storage.js
r92fd25 rc3feaa 28 28 */ 29 29 30 var vI_storage = { 30 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 31 var storage = { 31 32 multipleRecipients : null, 32 33 focusedElement : null, … … 42 43 .getBranch(null).QueryInterface(Components.interfaces.nsIPrefBranch2), 43 44 44 vI_rdfDatasource : null, // local storage45 rdfDatasource : null, // local storage 45 46 46 47 clean: function() { 47 vI _notificationBar.dump("## vI_storage: clean.\n");48 vI_storage.multipleRecipients = null;49 vI_storage.lastCheckedEmail = {};50 vI_storage.firstUsedInputElement = null;51 awSetInputAndPopupValue = vI_storage.original_functions.awSetInputAndPopupValue;52 if ( vI_storage.vI_rdfDatasource) vI_storage.vI_rdfDatasource.clean();48 vI.notificationBar.dump("## storage: clean.\n"); 49 storage.multipleRecipients = null; 50 storage.lastCheckedEmail = {}; 51 storage.firstUsedInputElement = null; 52 awSetInputAndPopupValue = storage.original_functions.awSetInputAndPopupValue; 53 if (storage.rdfDatasource) storage.rdfDatasource.clean(); 53 54 }, 54 55 … … 59 60 replacement_functions : { 60 61 awSetInputAndPopupValue : function (inputElem, inputValue, popupElem, popupValue, rowNumber) { 61 vI _notificationBar.dump("## vI_storage: awSetInputAndPopupValue '" + inputElem.id +"'\n");62 vI_storage.original_functions.awSetInputAndPopupValue(inputElem, inputValue, popupElem, popupValue, rowNumber);63 vI_storage.updateVIdentityFromStorage(inputElem);62 vI.notificationBar.dump("## storage: awSetInputAndPopupValue '" + inputElem.id +"'\n"); 63 storage.original_functions.awSetInputAndPopupValue(inputElem, inputValue, popupElem, popupValue, rowNumber); 64 storage.updateVIdentityFromStorage(inputElem); 64 65 } 65 66 }, … … 68 69 // only react on events triggered by addressCol2 - textinput Elements 69 70 if (!element || ! element.id.match(/^addressCol2*/)) return; 70 vI _notificationBar.dump("\n## vI_storage: awOnBlur '" + element.id +"'\n");71 vI_storage.updateVIdentityFromStorage(element);72 vI_storage.focusedElement = null;71 vI.notificationBar.dump("\n## storage: awOnBlur '" + element.id +"'\n"); 72 storage.updateVIdentityFromStorage(element); 73 storage.focusedElement = null; 73 74 }, 74 75 75 76 awOnFocus : function (element) { 76 77 if (!element || ! element.id.match(/^addressCol2*/)) return; 77 vI_storage.focusedElement = element;78 storage.focusedElement = element; 78 79 }, 79 80 80 81 awPopupOnCommand : function (element) { 81 vI _notificationBar.dump("\n## vI_storage: awPopupOnCommand'" + element.id +"'\n");82 vI_storage.updateVIdentityFromStorage(document.getElementById(element.id.replace(/^addressCol1/,"addressCol2")));82 vI.notificationBar.dump("\n## storage: awPopupOnCommand'" + element.id +"'\n"); 83 storage.updateVIdentityFromStorage(document.getElementById(element.id.replace(/^addressCol1/,"addressCol2"))); 83 84 if (element.selectedItem.getAttribute("value") == "addr_reply") // if reply-to is manually entered disable AutoReplyToSelf 84 85 document.getElementById("autoReplyToSelfLabel").setAttribute("hidden", "true"); … … 88 89 initialized : null, 89 90 init: function() { 90 if (! vI_storage.initialized) {91 vI_storage.vI_rdfDatasource = new vI_rdfDatasource("virtualIdentity.rdf");91 if (!storage.initialized) { 92 storage.rdfDatasource = new vI.rdfDatasource("virtualIdentity.rdf"); 92 93 93 94 // better approach would be to use te onchange event, but this one is not fired in any change case … … 100 101 var oldBlur = input.getAttribute("onblur") 101 102 input.setAttribute("onblur", (oldBlur?oldBlur+"; ":"") + 102 "window.setTimeout(v I_storage.awOnBlur, 250, this.parentNode.parentNode.parentNode);")103 "window.setTimeout(virtualIdentityExtension.storage.awOnBlur, 250, this.parentNode.parentNode.parentNode);") 103 104 var oldFocus = input.getAttribute("onfocus") 104 105 input.setAttribute("onfocus", (oldFocus?oldFocus+"; ":"") + 105 "window.setTimeout(v I_storage.awOnFocus, 250, this.parentNode.parentNode.parentNode);")106 "window.setTimeout(virtualIdentityExtension.storage.awOnFocus, 250, this.parentNode.parentNode.parentNode);") 106 107 } 107 108 var popup = awGetPopupElement(row); … … 109 110 var oldCommand = popup.getAttribute("oncommand") 110 111 popup.setAttribute("oncommand", (oldCommand?oldCommand+"; ":"") + 111 "window.setTimeout(v I_storage.awPopupOnCommand, 250, this);")112 } 113 } 114 vI_storage.initialized = true;115 } 116 vI_storage.original_functions.awSetInputAndPopupValue = awSetInputAndPopupValue;112 "window.setTimeout(virtualIdentityExtension.storage.awPopupOnCommand, 250, this);") 113 } 114 } 115 storage.initialized = true; 116 } 117 storage.original_functions.awSetInputAndPopupValue = awSetInputAndPopupValue; 117 118 awSetInputAndPopupValue = function (inputElem, inputValue, popupElem, popupValue, rowNumber) { 118 vI_storage.replacement_functions.awSetInputAndPopupValue (inputElem, inputValue, popupElem, popupValue, rowNumber) }119 storage.replacement_functions.awSetInputAndPopupValue (inputElem, inputValue, popupElem, popupValue, rowNumber) } 119 120 120 121 // reset unavailable storageExtras preferences 121 122 const enigmail_ID="{847b3a00-7ab1-11d4-8f02-006008948af5}" 122 if (!vI _helper.extensionActive(enigmail_ID)) {123 vI _main.preferences.setBoolPref("storageExtras_openPGP_messageEncryption", false)124 vI _main.preferences.setBoolPref("storageExtras_openPGP_messageSignature", false)125 vI _main.preferences.setBoolPref("storageExtras_openPGP_PGPMIME", false)123 if (!vI.helper.extensionActive(enigmail_ID)) { 124 vI.main.preferences.setBoolPref("storageExtras_openPGP_messageEncryption", false) 125 vI.main.preferences.setBoolPref("storageExtras_openPGP_messageSignature", false) 126 vI.main.preferences.setBoolPref("storageExtras_openPGP_PGPMIME", false) 126 127 } 127 128 }, … … 130 131 firstUsedInputElement : null, // this stores the first Element for which a Lookup in the Storage was successfull 131 132 updateVIdentityFromStorage: function(inputElement) { 132 if (!vI _main.preferences.getBoolPref("storage"))133 { vI _notificationBar.dump("## vI_storage: Storage deactivated\n"); return; }134 vI _notificationBar.dump("## vI_storage: updateVIdentityFromStorage()\n");133 if (!vI.main.preferences.getBoolPref("storage")) 134 { vI.notificationBar.dump("## storage: Storage deactivated\n"); return; } 135 vI.notificationBar.dump("## storage: updateVIdentityFromStorage()\n"); 135 136 136 137 var recipientType = document.getElementById(inputElement.id.replace(/^addressCol2/,"addressCol1")) 137 138 .selectedItem.getAttribute("value"); 138 139 var row = inputElement.id.replace(/^addressCol2#/,"") 139 if (recipientType == "addr_reply" || recipientType == "addr_followup" || vI_storage.__isDoBcc(row)) {140 if (recipientType == "addr_reply" || recipientType == "addr_followup" || storage.__isDoBcc(row)) { 140 141 // reset firstUsedInputElement if recipientType was changed (and don't care about doBcc fields) 141 if ( vI_storage.firstUsedInputElement == inputElement)142 vI_storage.firstUsedInputElement = null;143 vI _notificationBar.dump("## vI_storage: field is a 'reply-to' or 'followup-to' or preconfigured 'doBcc'. not searched.\n")142 if (storage.firstUsedInputElement == inputElement) 143 storage.firstUsedInputElement = null; 144 vI.notificationBar.dump("## storage: field is a 'reply-to' or 'followup-to' or preconfigured 'doBcc'. not searched.\n") 144 145 return; 145 146 } 146 147 147 148 if (inputElement.value == "") { 148 vI _notificationBar.dump("## vI_storage: no recipient found, not checked.\n"); return;149 vI.notificationBar.dump("## storage: no recipient found, not checked.\n"); return; 149 150 } 150 151 151 152 var row = inputElement.id.replace(/^addressCol2#/,"") 152 if ( vI_storage.lastCheckedEmail[row] && vI_storage.lastCheckedEmail[row] == inputElement.value) {153 vI _notificationBar.dump("## vI_storage: same email than before, not checked again.\n"); return;154 } 155 vI_storage.lastCheckedEmail[row] = inputElement.value;156 var recipient = vI_storage.__getDescriptionAndType(inputElement.value, recipientType);153 if (storage.lastCheckedEmail[row] && storage.lastCheckedEmail[row] == inputElement.value) { 154 vI.notificationBar.dump("## storage: same email than before, not checked again.\n"); return; 155 } 156 storage.lastCheckedEmail[row] = inputElement.value; 157 var recipient = storage.__getDescriptionAndType(inputElement.value, recipientType); 157 158 158 159 var matchResults = { storageData : {}, menuItem : {} }; 159 matchResults.storageData[0] = vI_storage.vI_rdfDatasource.readVIdentityFromRDF(recipient.recDesc, recipient.recType);160 matchResults.storageData[1] = vI_storage.vI_rdfDatasource.findMatchingFilter(recipient.recDesc);161 162 vI _notificationBar.dump("## vI_storage: updateVIdentityFromStorage add found Identities to CloneMenu.\n");160 matchResults.storageData[0] = storage.rdfDatasource.readVIdentityFromRDF(recipient.recDesc, recipient.recType); 161 matchResults.storageData[1] = storage.rdfDatasource.findMatchingFilter(recipient.recDesc); 162 163 vI.notificationBar.dump("## storage: updateVIdentityFromStorage add found Identities to CloneMenu.\n"); 163 164 var matchIndex = null; 164 165 for (var i = 0; i <= 1; i++) { … … 170 171 } 171 172 if (matchIndex == null) { 172 vI _notificationBar.dump("## vI_storage: updateVIdentityFromStorage no usable Storage-Data found.\n");173 vI.notificationBar.dump("## storage: updateVIdentityFromStorage no usable Storage-Data found.\n"); 173 174 return; 174 175 } 175 176 else { 176 vI _notificationBar.dump("## vI_storage: using data from " + ((matchIndex == 0)?"direct":"filter") + " match\n");177 vI.notificationBar.dump("## storage: using data from " + ((matchIndex == 0)?"direct":"filter") + " match\n"); 177 178 } 178 179 // found storageData, so store InputElement 179 if (! vI_storage.firstUsedInputElement) vI_storage.firstUsedInputElement = inputElement;180 181 vI _notificationBar.dump("## vI_storage: compare with current Identity\n");182 if (vI _main.preferences.getBoolPref("storage_getOneOnly") && // if requested to retrieve only storageID for first recipient entered183 vI_storage.firstUsedInputElement && // and the request for the first recipient was already done184 vI_storage.firstUsedInputElement != inputElement && // and it's not the same element we changed now180 if (!storage.firstUsedInputElement) storage.firstUsedInputElement = inputElement; 181 182 vI.notificationBar.dump("## storage: compare with current Identity\n"); 183 if (vI.main.preferences.getBoolPref("storage_getOneOnly") && // if requested to retrieve only storageID for first recipient entered 184 storage.firstUsedInputElement && // and the request for the first recipient was already done 185 storage.firstUsedInputElement != inputElement && // and it's not the same element we changed now 185 186 !matchResults.storageData[matchIndex].equalsCurrentIdentity(false).equal) // and this id is different than the current used one 186 vI _notificationBar.setNote(vI_main.elements.strings187 vI.notificationBar.setNote(vI.main.elements.strings 187 188 .getString("vident.smartIdentity.vIStorageCollidingIdentity"), // than drop the potential changes 188 189 "storage_notification"); 189 190 // only update fields if new Identity is different than old one. 190 191 else { 191 vI _notificationBar.dump("## vI_storage: updateVIdentityFromStorage check if storage-data matches current Identity.\n");192 vI.notificationBar.dump("## storage: updateVIdentityFromStorage check if storage-data matches current Identity.\n"); 192 193 var compResult = matchResults.storageData[matchIndex].equalsCurrentIdentity(true); 193 194 if (!compResult.equal) { 194 var warning = vI_storage.__getWarning("replaceVIdentity", recipient, compResult.compareMatrix);195 var warning = storage.__getWarning("replaceVIdentity", recipient, compResult.compareMatrix); 195 196 var msgIdentityCloneElem = document.getElementById("msgIdentity_clone") 196 197 if ( !msgIdentityCloneElem.vid || 197 !vI _main.preferences.getBoolPref("storage_warn_vI_replace") ||198 ( vI_storage.__askWarning(warning) == "accept")) {198 !vI.main.preferences.getBoolPref("storage_warn_vI_replace") || 199 (storage.__askWarning(warning) == "accept")) { 199 200 msgIdentityCloneElem.selectedMenuItem = matchResults.menuItem[matchIndex]; 200 201 if (msgIdentityCloneElem.vid) 201 vI _notificationBar.setNote(vI_main.elements.strings.getString("vident.smartIdentity.vIStorageUsage") + ".",202 vI.notificationBar.setNote(vI.main.elements.strings.getString("vident.smartIdentity.vIStorageUsage") + ".", 202 203 "storage_notification"); 203 204 } 204 205 } 205 206 else { 206 vI _notificationBar.dump("## vI_storage: updateVIdentityFromStorage doing nothing - equals current Identity.\n");207 vI.notificationBar.dump("## storage: updateVIdentityFromStorage doing nothing - equals current Identity.\n"); 207 208 } 208 209 } … … 211 212 __getDescriptionAndType : function (recipient, recipientType) { 212 213 if (recipientType == "addr_newsgroups") return { recDesc : recipient, recType : "newsgroup" } 213 else if ( vI_storage.__isMailingList(recipient)) {214 vI _notificationBar.dump("## __getDescriptionAndType: '" + recipient + "' is MailList\n");215 return { recDesc : vI_storage.__getMailListName(recipient), recType : "maillist" }214 else if (storage.__isMailingList(recipient)) { 215 vI.notificationBar.dump("## __getDescriptionAndType: '" + recipient + "' is MailList\n"); 216 return { recDesc : storage.__getMailListName(recipient), recType : "maillist" } 216 217 } 217 218 else { 218 vI _notificationBar.dump("## __getDescriptionAndType: '" + recipient + "' is no MailList\n");219 var localIdentityData = new vI _identityData(recipient, null, null, null, null, null, null);219 vI.notificationBar.dump("## __getDescriptionAndType: '" + recipient + "' is no MailList\n"); 220 var localIdentityData = new vI.identityData(recipient, null, null, null, null, null, null); 220 221 return { recDesc : localIdentityData.combinedName, recType : "email" } 221 222 } … … 224 225 storeVIdentityToAllRecipients : function(msgType) { 225 226 if (msgType != nsIMsgCompDeliverMode.Now) return true; 226 vI _notificationBar.dump("## vI_storage: ----------------------------------------------------------\n")227 if (!vI _main.preferences.getBoolPref("storage"))228 { vI _notificationBar.dump("## vI_storage: Storage deactivated\n"); return true; }229 230 if (vI _statusmenu.objStorageSaveMenuItem.getAttribute("checked") != "true") {231 vI _notificationBar.dump("## vI_storage: SaveMenuItem not checked.\n")227 vI.notificationBar.dump("## storage: ----------------------------------------------------------\n") 228 if (!vI.main.preferences.getBoolPref("storage")) 229 { vI.notificationBar.dump("## storage: Storage deactivated\n"); return true; } 230 231 if (vI.statusmenu.objStorageSaveMenuItem.getAttribute("checked") != "true") { 232 vI.notificationBar.dump("## storage: SaveMenuItem not checked.\n") 232 233 return true; 233 234 } 234 235 235 vI _notificationBar.dump("## vI_storage: storeVIdentityToAllRecipients()\n");236 vI.notificationBar.dump("## storage: storeVIdentityToAllRecipients()\n"); 236 237 237 238 // check if there are multiple recipients 238 vI_storage.multipleRecipients = false;239 storage.multipleRecipients = false; 239 240 var recipients = 0; 240 241 for (var row = 1; row <= top.MAX_RECIPIENTS; row ++) { 241 242 var recipientType = awGetPopupElement(row).selectedItem.getAttribute("value"); 242 243 if (recipientType == "addr_reply" || recipientType == "addr_followup" || 243 vI_storage.__isDoBcc(row) || awGetInputElement(row).value.match(/^\s*$/) ) continue;244 storage.__isDoBcc(row) || awGetInputElement(row).value.match(/^\s*$/) ) continue; 244 245 if (recipients++ == 1) { 245 vI_storage.multipleRecipients = true246 vI _notificationBar.dump("## vI_storage: multiple recipients found.\n")246 storage.multipleRecipients = true 247 vI.notificationBar.dump("## storage: multiple recipients found.\n") 247 248 break; 248 249 } … … 252 253 var recipientType = awGetPopupElement(row).selectedItem.getAttribute("value"); 253 254 if (recipientType == "addr_reply" || recipientType == "addr_followup" || 254 vI_storage.__isDoBcc(row) || awGetInputElement(row).value.match(/^\s*$/) ) continue;255 if (! vI_storage.__updateStorageFromVIdentity(awGetInputElement(row).value, recipientType)) {256 vI _notificationBar.dump("## vI_storage: -------------- aborted ---------------------------------\n")255 storage.__isDoBcc(row) || awGetInputElement(row).value.match(/^\s*$/) ) continue; 256 if (!storage.__updateStorageFromVIdentity(awGetInputElement(row).value, recipientType)) { 257 vI.notificationBar.dump("## storage: -------------- aborted ---------------------------------\n") 257 258 return false; // abort sending 258 259 } 259 260 } 260 vI _notificationBar.dump("## vI_storage: ----------------------------------------------------------\n");261 vI.notificationBar.dump("## storage: ----------------------------------------------------------\n"); 261 262 return true; 262 263 }, … … 264 265 __getWarning : function(warningCase, recipient, compareMatrix) { 265 266 var warning = { title: null, recLabel : null, recipient : null, warning : null, css: null, query : null, class : null }; 266 warning.title = vI _main.elements.strings.getString("vident." + warningCase + ".title")267 warning.recLabel = vI _main.elements.strings.getString("vident." + warningCase + ".recipient") + " (" + recipient.recType + "):"267 warning.title = vI.main.elements.strings.getString("vident." + warningCase + ".title") 268 warning.recLabel = vI.main.elements.strings.getString("vident." + warningCase + ".recipient") + " (" + recipient.recType + "):" 268 269 warning.recipient = recipient.recDesc; 269 270 warning.warning = 270 271 "<table class='" + warningCase + "'><thead><tr><th class='col1'/>" + 271 "<th class='col2'>" + vI _main.elements.strings.getString("vident." + warningCase + ".currentIdentity") + "</th>" +272 "<th class='col3'>" + vI _main.elements.strings.getString("vident." + warningCase + ".storedIdentity") + "</th>" +272 "<th class='col2'>" + vI.main.elements.strings.getString("vident." + warningCase + ".currentIdentity") + "</th>" + 273 "<th class='col3'>" + vI.main.elements.strings.getString("vident." + warningCase + ".storedIdentity") + "</th>" + 273 274 "</tr></thead>" + 274 275 "<tbody>" + compareMatrix + "</tbody>" + 275 276 "</table>" 276 warning.css = "vI _DialogBrowser.css";277 warning.query = vI _main.elements.strings.getString("vident." + warningCase + ".query");277 warning.css = "vI.DialogBrowser.css"; 278 warning.query = vI.main.elements.strings.getString("vident." + warningCase + ".query"); 278 279 warning.class = warningCase; 279 280 return warning; … … 289 290 290 291 __updateStorageFromVIdentity : function(recipient, recipientType) { 291 vI _notificationBar.dump("## vI_storage: __updateStorageFromVIdentity.\n")292 var dontUpdateMultipleNoEqual = (vI _main.preferences.getBoolPref("storage_dont_update_multiple") &&293 vI_storage.multipleRecipients)294 vI _notificationBar.dump("## vI_storage: __updateStorageFromVIdentity dontUpdateMultipleNoEqual='" + dontUpdateMultipleNoEqual + "'\n")295 recipient = vI_storage.__getDescriptionAndType(recipient, recipientType);296 297 var storageDataByType = vI_storage.vI_rdfDatasource.readVIdentityFromRDF(recipient.recDesc, recipient.recType);298 var storageDataByFilter = vI_storage.vI_rdfDatasource.findMatchingFilter(recipient.recDesc);292 vI.notificationBar.dump("## storage: __updateStorageFromVIdentity.\n") 293 var dontUpdateMultipleNoEqual = (vI.main.preferences.getBoolPref("storage_dont_update_multiple") && 294 storage.multipleRecipients) 295 vI.notificationBar.dump("## storage: __updateStorageFromVIdentity dontUpdateMultipleNoEqual='" + dontUpdateMultipleNoEqual + "'\n") 296 recipient = storage.__getDescriptionAndType(recipient, recipientType); 297 298 var storageDataByType = storage.rdfDatasource.readVIdentityFromRDF(recipient.recDesc, recipient.recType); 299 var storageDataByFilter = storage.rdfDatasource.findMatchingFilter(recipient.recDesc); 299 300 300 301 // update (storing) of data by type is required if there is … … 307 308 if ( (!storageDataByType && !storageDataByFilterEqual) || 308 309 (!storageDataByTypeEqual && !storageDataByFilterEqual && !dontUpdateMultipleNoEqual) ) { 309 vI _notificationBar.dump("## vI_storage: __updateStorageFromVIdentity updating\n")310 vI.notificationBar.dump("## storage: __updateStorageFromVIdentity updating\n") 310 311 var doUpdate = "accept"; 311 if (storageDataByType && !storageDataByTypeEqual && vI _main.preferences.getBoolPref("storage_warn_update")) {312 vI _notificationBar.dump("## vI_storage: __updateStorageFromVIdentity overwrite warning\n");313 doUpdate = vI_storage.__askWarning(vI_storage.__getWarning("updateStorage", recipient, storageDataByTypeCompResult.compareMatrix));312 if (storageDataByType && !storageDataByTypeEqual && vI.main.preferences.getBoolPref("storage_warn_update")) { 313 vI.notificationBar.dump("## storage: __updateStorageFromVIdentity overwrite warning\n"); 314 doUpdate = storage.__askWarning(storage.__getWarning("updateStorage", recipient, storageDataByTypeCompResult.compareMatrix)); 314 315 if (doUpdate == "takeover") { 315 316 var msgIdentityCloneElem = document.getElementById("msgIdentity_clone"); … … 320 321 } 321 322 } 322 if (doUpdate == "accept") vI_storage.vI_rdfDatasource.updateRDFFromVIdentity(recipient.recDesc, recipient.recType);323 if (doUpdate == "accept") storage.rdfDatasource.updateRDFFromVIdentity(recipient.recDesc, recipient.recType); 323 324 return true; 324 325 }, … … 336 337 if (ab instanceof Components.interfaces.nsIAbDirectory && !ab.isRemote) { 337 338 let abdirectory = abManager.getDirectory(ab.URI + 338 "?(and(DisplayName,=," + encodeURIComponent( vI_storage.__getMailListName(recipient)) + ")(IsMailList,=,TRUE))");339 "?(and(DisplayName,=," + encodeURIComponent(storage.__getMailListName(recipient)) + ")(IsMailList,=,TRUE))"); 339 340 if (abdirectory) { 340 341 let cards = abdirectory.childCards; … … 364 365 for (var index = 0; index < doBccArray.count; index++ ) { 365 366 if (doBccArray.StringAt(index) == awGetInputElement(row).value) { 366 vI _notificationBar.dump("## vI_storage: ignoring doBcc field '" +367 vI.notificationBar.dump("## storage: ignoring doBcc field '" + 367 368 doBccArray.StringAt(index) + "'.\n"); 368 369 return true; … … 373 374 374 375 getVIdentityFromAllRecipients : function(allIdentities) { 375 if (!vI _main.preferences.getBoolPref("storage"))376 { vI _notificationBar.dump("## vI_storage: Storage deactivated\n"); return; }377 vI _notificationBar.dump("## vI_storage: getVIdentityFromAllRecipients()\n");376 if (!vI.main.preferences.getBoolPref("storage")) 377 { vI.notificationBar.dump("## storage: Storage deactivated\n"); return; } 378 vI.notificationBar.dump("## storage: getVIdentityFromAllRecipients()\n"); 378 379 379 380 for (var row = 1; row <= top.MAX_RECIPIENTS; row ++) { 380 381 var recipientType = awGetPopupElement(row).selectedItem.getAttribute("value"); 381 if (recipientType == "addr_reply" || recipientType == "addr_followup" || vI_storage.__isDoBcc(row)) continue;382 vI_storage.lastCheckedEmail[row] = awGetInputElement(row).value;383 var recipient = vI_storage.__getDescriptionAndType(awGetInputElement(row).value, recipientType);384 var storageData = vI_storage.vI_rdfDatasource.readVIdentityFromRDF(recipient.recDesc, recipient.recType);382 if (recipientType == "addr_reply" || recipientType == "addr_followup" || storage.__isDoBcc(row)) continue; 383 storage.lastCheckedEmail[row] = awGetInputElement(row).value; 384 var recipient = storage.__getDescriptionAndType(awGetInputElement(row).value, recipientType); 385 var storageData = storage.rdfDatasource.readVIdentityFromRDF(recipient.recDesc, recipient.recType); 385 386 if (storageData) allIdentities.addWithoutDuplicates(storageData); 386 storageData = vI_storage.vI_rdfDatasource.findMatchingFilter(recipient.recDesc);387 storageData = storage.rdfDatasource.findMatchingFilter(recipient.recDesc); 387 388 if (storageData) allIdentities.addWithoutDuplicates(storageData); 388 389 } 389 vI _notificationBar.dump("## vI_storage: found " + allIdentities.number + " address(es)\n")390 vI.notificationBar.dump("## storage: found " + allIdentities.number + " address(es)\n") 390 391 } 391 392 } 393 vI.storage = storage; 394 }}); -
chrome/content/v_identity/vI_storageExtras.js
r92fd25 rc3feaa 22 22 * ***** END LICENSE BLOCK ***** */ 23 23 24 function vI_storageExtras_adapt(sourceId, targetId) { 24 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 25 function storageExtras_adapt(sourceId, targetId) { 25 26 var checked = document.getElementById(sourceId).getAttribute("checked"); 26 27 if (targetId) var target = document.getElementById(targetId) … … 30 31 } 31 32 32 var vI_storageExtrasHelper = {33 var storageExtrasHelper = { 33 34 seamonkey_old : null, 34 35 … … 38 39 39 40 hideUnusedEditorFields : function() { 40 var storageExtras = new vI_storageExtras();41 var localStorageExtras = new storageExtras(); 41 42 var allHidden = true; 42 43 var hide = (document.getElementById("vI_storageExtras_hideUnusedEditorFields").getAttribute("checked") == "true") 43 for( var i = 0; i < storageExtras.extras.length; i++ ) {44 var hidden = hide && ! vI_storageExtrasHelper.preferences.getBoolPref(storageExtras.extras[i].option)44 for( var i = 0; i < localStorageExtras.extras.length; i++ ) { 45 var hidden = hide && !storageExtrasHelper.preferences.getBoolPref(localStorageExtras.extras[i].option) 45 46 if (!hidden) allHidden = false 46 document.getElementById("vI_" + storageExtras.extras[i].option).setAttribute("hidden", hidden)47 document.getElementById("vI_" + storageExtras.extras[i].option + "_store").setAttribute("hidden", hidden)47 document.getElementById("vI_" + localStorageExtras.extras[i].option).setAttribute("hidden", hidden) 48 document.getElementById("vI_" + localStorageExtras.extras[i].option + "_store").setAttribute("hidden", hidden) 48 49 } 49 50 document.getElementById("storeValue").setAttribute("hidden", allHidden) … … 53 54 } 54 55 55 function vI_storageExtras(rdfDatasource, resource) {56 // function vI_storageExtras_checkbox(field, option, composeDialogElementID, updateFunction, identityValue) {56 function storageExtras(rdfDatasource, resource) { 57 // function storageExtras_checkbox(field, option, composeDialogElementID, updateFunction, identityValue) { 57 58 this.extras = [ 58 new vI_storageExtras_checkbox(59 new storageExtras_checkbox( 59 60 "reciept", "storageExtras_returnReciept", "returnReceiptMenu", null, function(identity) { return identity.requestReturnReceipt; }), 60 new vI_storageExtras_checkbox(61 new storageExtras_checkbox( 61 62 "fcc", "storageExtras_fcc", "fcc_switch", null, function(identity) { return identity.doFcc; }), 62 new vI_storageExtras_characterEncoding(),63 new vI_storageExtras_msgFormat(),64 new vI_storageExtras_checkbox(63 new storageExtras_characterEncoding(), 64 new storageExtras_msgFormat(), 65 new storageExtras_checkbox( 65 66 "sMimeEnc", "storageExtras_sMime_messageEncryption", "menu_securityEncryptRequire1", 66 67 function() { return ((typeof(setSecuritySettings)=='function')?setSecuritySettings(1):null) }, 67 68 function(identity) { return (identity.getIntAttribute('encryptionpolicy') == 2) }), 68 new vI_storageExtras_checkbox(69 new storageExtras_checkbox( 69 70 "sMimeSig", "storageExtras_sMime_messageSignature", "menu_securitySign1", 70 71 function() { return ((typeof(setSecuritySettings)=='function')?setSecuritySettings(1):null) }, 71 72 function(identity) { return (identity.getBoolAttribute('sign_mail')) }), 72 new vI_storageExtras_checkbox(73 new storageExtras_checkbox( 73 74 "PGPEnc", "storageExtras_openPGP_messageEncryption", "enigmail_encrypted_send", 74 75 function() { return ((typeof(enigSetMenuSettings)=='function')?enigSetMenuSettings(''):null) }, 75 76 function(identity) { return (identity.getIntAttribute('defaultEncryptionPolicy') > 0) }), 76 new vI_storageExtras_checkbox(77 new storageExtras_checkbox( 77 78 "PGPSig", "storageExtras_openPGP_messageSignature", "enigmail_signed_send", 78 79 function() { return ((typeof(enigSetMenuSettings)=='function')?enigSetMenuSettings(''):null) }, 79 80 function(identity) { return ((identity.getIntAttribute('defaultEncryptionPolicy') > 0)?identity.getBoolAttribute('pgpSignEncrypted'):identity.getBoolAttribute('pgpSignPlain')) }), 80 new vI_storageExtras_checkbox(81 new storageExtras_checkbox( 81 82 "PGPMIME", "storageExtras_openPGP_PGPMIME", "enigmail_sendPGPMime", 82 83 function() { return ((typeof(enigSetMenuSettings)=='function')?enigSetMenuSettings(''):null) }, … … 86 87 } 87 88 88 vI_storageExtras.prototype = {89 storageExtras.prototype = { 89 90 loopForRDF : function(rdfDatasource, resource, type) { 90 91 for( var i = 0; i < this.extras.length; i++ ) { 91 // if (vI _notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: loopForRDF " + rdfDatasource + "\n");92 // if (vI.notificationBar) vI.notificationBar.dump("## vI.rdfDatasource: loopForRDF " + rdfDatasource + "\n"); 92 93 // only if pref set and feature(element available) or for dataEditor 93 94 if (typeof(gMsgCompose) == "undefined" || !gMsgCompose || this.extras[i].active) { … … 103 104 // just give a duplicate of the current storageExtras, else we will work with pointers 104 105 getDuplicate : function() { 105 var newExtras = new vI_storageExtras();106 var newExtras = new storageExtras(); 106 107 for( var i = 0; i < this.extras.length; i++ ) { 107 108 newExtras.extras[i].value = this.extras[i].value; … … 166 167 for( var i = 0; i < this.extras.length; i++ ) { 167 168 if (this.extras[i].active) this.extras[i].readIdentityValue(identity) 168 // vI _notificationBar.dump("## vI_storageExtras readIdentityValues "+ this.extras[i].field + "=" + this.extras[i].value + "\n");169 // vI.notificationBar.dump("## storageExtras readIdentityValues "+ this.extras[i].field + "=" + this.extras[i].value + "\n"); 169 170 } 170 171 }, … … 173 174 for( var i = 0; i < this.extras.length; i++ ) { 174 175 if (this.extras[i].active) this.extras[i].setValue() 175 // vI _notificationBar.dump("## vI_storageExtras setValue "+ this.extras[i].field + "=" + this.extras[i].value + "\n");176 // vI.notificationBar.dump("## storageExtras setValue "+ this.extras[i].field + "=" + this.extras[i].value + "\n"); 176 177 } 177 178 }, 178 179 readValues : function() { 179 180 for( var i = 0; i < this.extras.length; i++ ) { 180 // vI _notificationBar.dump("## vI_storageExtras preparing readValue "+ this.extras[i].field +"\n");181 // vI.notificationBar.dump("## storageExtras preparing readValue "+ this.extras[i].field +"\n"); 181 182 if (this.extras[i].active) this.extras[i].readValue() 182 // vI _notificationBar.dump("## vI_storageExtras readValue "+ this.extras[i].field + "=" + this.extras[i].value + "\n");183 // vI.notificationBar.dump("## storageExtras readValue "+ this.extras[i].field + "=" + this.extras[i].value + "\n"); 183 184 } 184 185 }, … … 189 190 for( var i = 0; i < this.extras.length; i++ ) { 190 191 this.extras[i].readEditorValue(); 191 // vI _notificationBar.dump("## vI_storageExtras readValue " + this.extras[i].field + "=" + this.extras[i].value + "\n");192 } 193 }, 194 195 // add value's to the pref object, required for rdfDataTree 192 // vI.notificationBar.dump("## storageExtras readValue " + this.extras[i].field + "=" + this.extras[i].value + "\n"); 193 } 194 }, 195 196 // add value's to the pref object, required for rdfDataTreeCollection 196 197 addPrefs : function(pref) { 197 198 for( var i = 0; i < this.extras.length; i++ ) … … 200 201 } 201 202 202 function vI_storageExtras_characterEncoding_setMenuMark() {203 function storageExtras_characterEncoding_setMenuMark() { 203 204 var maileditCharsetMenu = document.getElementById("maileditCharsetMenu") 204 205 var value = maileditCharsetMenu.getAttribute("unmarkedValue") … … 209 210 } 210 211 } 211 function vI_storageExtras_characterEncoding() {212 this.active = vI_storageExtrasHelper.preferences.getBoolPref("storage") &&213 vI_storageExtrasHelper.preferences.getBoolPref(this.option)212 function storageExtras_characterEncoding() { 213 this.active = storageExtrasHelper.preferences.getBoolPref("storage") && 214 storageExtrasHelper.preferences.getBoolPref(this.option) 214 215 this.comp = { compareValue : null, equal : null } 215 216 } 216 vI_storageExtras_characterEncoding.prototype = {217 storageExtras_characterEncoding.prototype = { 217 218 active : null, 218 219 value : null, … … 246 247 var onpopupshowing = maileditCharsetMenu.getAttribute("onpopupshowing") 247 248 document.getElementById("maileditCharsetMenu").setAttribute("onpopupshowing", 248 onpopupshowing + "; vI_storageExtras_characterEncoding_setMenuMark();")249 onpopupshowing + ";storageExtras_characterEncoding_setMenuMark();") 249 250 } 250 251 gMsgCompose.compFields.characterSet = this.value; … … 254 255 // read the value from the internal vI object, global object might not be available any more 255 256 // happens especially while storing after sending the message 256 this.value = vI _main.gMsgCompose.compFields.characterSet;257 this.value = vI.main.gMsgCompose.compFields.characterSet; 257 258 if (gCharsetConvertManager) { 258 259 var charsetAlias = gCharsetConvertManager.getCharsetAlias(this.value); … … 281 282 } 282 283 283 function vI_storageExtras_msgFormat() {284 this.active = vI_storageExtrasHelper.preferences.getBoolPref("storage") &&285 vI_storageExtrasHelper.preferences.getBoolPref(this.option)284 function storageExtras_msgFormat() { 285 this.active = storageExtrasHelper.preferences.getBoolPref("storage") && 286 storageExtrasHelper.preferences.getBoolPref(this.option) 286 287 this.comp = { value : null, compareValue : null, equal : null } 287 288 } 288 vI_storageExtras_msgFormat.prototype = {289 storageExtras_msgFormat.prototype = { 289 290 active : null, 290 291 value : null, … … 338 339 } 339 340 340 function vI_storageExtras_sMime_messageEncryption() {341 this.active = vI_storageExtrasHelper.preferences.getBoolPref("storage") &&342 vI_storageExtrasHelper.preferences.getBoolPref(this.option)341 function storageExtras_sMime_messageEncryption() { 342 this.active = storageExtrasHelper.preferences.getBoolPref("storage") && 343 storageExtrasHelper.preferences.getBoolPref(this.option) 343 344 this.comp = { value : null, compareValue : null, equal : null } 344 345 } 345 vI_storageExtras_sMime_messageEncryption.prototype = {346 storageExtras_sMime_messageEncryption.prototype = { 346 347 active : null, 347 348 value : null, … … 375 376 // function to set or read the value from/to the MessageCompose Dialog 376 377 setValue : function() { 377 vI _notificationBar.dump("## storageExtras_sMime_messageEncryption \n");378 vI.notificationBar.dump("## storageExtras_sMime_messageEncryption \n"); 378 379 var doEncryptElem = document.getElementById("menu_securityEncryptRequire1"); 379 380 if (this.value == null) return; … … 405 406 406 407 // a general checkbox for extra options. Has to provide some additional information 407 function vI_storageExtras_checkbox(field, option, composeDialogElementID, updateFunction, identityValue) {408 function storageExtras_checkbox(field, option, composeDialogElementID, updateFunction, identityValue) { 408 409 this.field = field; // description of the option 409 410 this.option = option; // option string to get preference settings … … 411 412 this.updateFunction = updateFunction; 412 413 this.valueFromIdentityFunction = identityValue; 413 this.active = vI_storageExtrasHelper.preferences.getBoolPref("storage") &&414 vI_storageExtrasHelper.preferences.getBoolPref(this.option)414 this.active = storageExtrasHelper.preferences.getBoolPref("storage") && 415 storageExtrasHelper.preferences.getBoolPref(this.option) 415 416 // elements are never available in DataTree, so leave this out. 416 417 // && document.getElementById(this.composeDialogElementID); 417 418 this.comp = { compareValue : null, equal : null } 418 419 } 419 vI_storageExtras_checkbox.prototype = {420 storageExtras_checkbox.prototype = { 420 421 active : null, 421 422 value : null, … … 457 458 458 459 if ((element.getAttribute("checked") == "true") != (this.value == "true")) { 459 vI _notificationBar.dump("## vI_storageExtras change "+ this.field + " to " + this.value + " with doCommand\n");460 vI.notificationBar.dump("## storageExtras change "+ this.field + " to " + this.value + " with doCommand\n"); 460 461 element.doCommand(); 461 462 } … … 483 484 } 484 485 } 486 487 vI.storageExtras = storageExtras; 488 vI.storageExtrasHelper = storageExtrasHelper; 489 vI.storageExtras_adapt = storageExtras_adapt; 490 }}); -
chrome/content/v_identity/vI_storageExtrasDataEditorOverlay.xul
r92fd25 rc3feaa 48 48 <spacer width="10px" /> 49 49 <checkbox id="vI_storageExtras_hideUnusedEditorFields" label="&vI_storageExtrasDataEditorOverlay.hideUnused.label;" 50 oncommand="v I_storageExtrasHelper.hideUnusedEditorFields();"50 oncommand="virtualIdentityExtension.storageExtrasHelper.hideUnusedEditorFields();" 51 51 persist="checked" /> 52 52 </caption> … … 54 54 <!-- storageExtras_returnReciept --> 55 55 <hbox> 56 <checkbox id="vI_storageExtras_returnReciept_store" oncommand="v I_storageExtras_adapt(this.id, null);" />56 <checkbox id="vI_storageExtras_returnReciept_store" oncommand="virtualIdentityExtension.storageExtras_adapt(this.id, null);" /> 57 57 <checkbox id="vI_storageExtras_returnReciept" label="&vI_storageExtrasDataEditorOverlay.reciept.label;"/> 58 58 </hbox> 59 59 <!-- storageExtras_fcc --> 60 60 <hbox> 61 <checkbox id="vI_storageExtras_fcc_store" oncommand="v I_storageExtras_adapt(this.id, null);" />61 <checkbox id="vI_storageExtras_fcc_store" oncommand="virtualIdentityExtension.storageExtras_adapt(this.id, null);" /> 62 62 <checkbox id="vI_storageExtras_fcc" label="&vI_storageExtrasDataEditorOverlay.fcc.label;"/> 63 63 </hbox> … … 65 65 <hbox> 66 66 <checkbox id="vI_storageExtras_characterEncoding_store" 67 oncommand="v I_storageExtras_adapt(this.id, 'maileditCharsetMenuLabel');vI_storageExtras_adapt(this.id, 'maileditCharsetMenu');" />67 oncommand="virtualIdentityExtension.storageExtras_adapt(this.id, 'maileditCharsetMenuLabel');virtualIdentityExtension.storageExtras_adapt(this.id, 'maileditCharsetMenu');" /> 68 68 <hbox id="vI_storageExtras_characterEncoding"> 69 69 <vbox><spacer flex="1"/> … … 90 90 <hbox> 91 91 <checkbox id="vI_storageExtras_messageFormat_store" 92 oncommand="v I_storageExtras_adapt(this.id, 'outputFormatMenuLabel');vI_storageExtras_adapt(this.id, 'outputFormatMenu');" />92 oncommand="virtualIdentityExtension.storageExtras_adapt(this.id, 'outputFormatMenuLabel');virtualIdentityExtension.storageExtras_adapt(this.id, 'outputFormatMenu');" /> 93 93 <hbox id="vI_storageExtras_messageFormat"> 94 94 <vbox><spacer flex="1"/> … … 108 108 <!-- storageExtras_sMime_messageEncryption --> 109 109 <hbox> 110 <checkbox id="vI_storageExtras_sMime_messageEncryption_store" oncommand="v I_storageExtras_adapt(this.id, null)" />110 <checkbox id="vI_storageExtras_sMime_messageEncryption_store" oncommand="virtualIdentityExtension.storageExtras_adapt(this.id, null)" /> 111 111 <checkbox id="vI_storageExtras_sMime_messageEncryption" 112 112 label="&vI_storageExtrasDataEditorOverlay.sMimeEnc.label;"/> … … 114 114 <!-- storageExtras_sMime_messageSignature --> 115 115 <hbox> 116 <checkbox id="vI_storageExtras_sMime_messageSignature_store" oncommand="v I_storageExtras_adapt(this.id, null)" />116 <checkbox id="vI_storageExtras_sMime_messageSignature_store" oncommand="virtualIdentityExtension.storageExtras_adapt(this.id, null)" /> 117 117 <checkbox id="vI_storageExtras_sMime_messageSignature" 118 118 label="&vI_storageExtrasDataEditorOverlay.sMimeSig.label;"/> … … 120 120 <!-- storageExtras_openPGP_messageEncryption --> 121 121 <hbox> 122 <checkbox id="vI_storageExtras_openPGP_messageEncryption_store" oncommand="v I_storageExtras_adapt(this.id, null)" />122 <checkbox id="vI_storageExtras_openPGP_messageEncryption_store" oncommand="virtualIdentityExtension.storageExtras_adapt(this.id, null)" /> 123 123 <checkbox id="vI_storageExtras_openPGP_messageEncryption" 124 124 label="&vI_storageExtrasDataEditorOverlay.PGPEnc.label;"/> … … 126 126 <!-- storageExtras_openPGP_messageSignature --> 127 127 <hbox> 128 <checkbox id="vI_storageExtras_openPGP_messageSignature_store" oncommand="v I_storageExtras_adapt(this.id, null)" />128 <checkbox id="vI_storageExtras_openPGP_messageSignature_store" oncommand="virtualIdentityExtension.storageExtras_adapt(this.id, null)" /> 129 129 <checkbox id="vI_storageExtras_openPGP_messageSignature" 130 130 label="&vI_storageExtrasDataEditorOverlay.PGPSig.label;"/> … … 132 132 <!-- storageExtras_openPGP_PGPMIME --> 133 133 <hbox> 134 <checkbox id="vI_storageExtras_openPGP_PGPMIME_store" oncommand="v I_storageExtras_adapt(this.id, null)" />134 <checkbox id="vI_storageExtras_openPGP_PGPMIME_store" oncommand="virtualIdentityExtension.storageExtras_adapt(this.id, null)" /> 135 135 <checkbox id="vI_storageExtras_openPGP_PGPMIME" 136 136 label="&vI_storageExtrasDataEditorOverlay.PGPMIME.label;"/> -
chrome/content/v_identity/vI_storageExtrasDataTreeOverlay.xul
r92fd25 rc3feaa 32 32 33 33 <overlay id="vI_storageExtrasOverlay" 34 34 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" > 35 35 36 36 <script type="application/x-javascript" src="chrome://v_identity/content/vI_storageExtras.js" /> -
chrome/content/v_identity/vI_upgrade.js
r92fd25 rc3feaa 23 23 * ***** END LICENSE BLOCK ***** */ 24 24 25 var vI_upgrade = { 25 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 26 var upgrade = { 26 27 preferences : Components.classes["@mozilla.org/preferences-service;1"] 27 28 .getService(Components.interfaces.nsIPrefService) … … 31 32 .getService(Components.interfaces.nsIVersionComparator), 32 33 33 vI_rdfDatasource : null,34 rdfDatasource : null, 34 35 35 36 init : function() { 36 vI_upgrade.__initRequirements();37 upgrade.__initRequirements(); 37 38 document.documentElement.getButton("cancel").setAttribute("hidden", "true") 38 39 }, 39 40 40 41 clean : function() { 41 if ( vI_upgrade.vI_rdfDatasource) vI_upgrade.vI_rdfDatasource.clean();42 if (upgrade.rdfDatasource) upgrade.rdfDatasource.clean(); 42 43 }, 43 44 44 45 __initRequirements : function() { 45 vI _notificationBar.dump("") // this initialises the debug-area46 vI_upgrade.vI_rdfDatasource = new vI_rdfDatasource("virtualIdentity.rdf", true);46 vI.notificationBar.dump("") // this initialises the debug-area 47 upgrade.rdfDatasource = new vI.rdfDatasource("virtualIdentity.rdf", true); 47 48 }, 48 49 … … 61 62 62 63 // don't show the dialog if we do a one-step upgrade 63 if ( vI_upgrade.versionChecker.compare(extVersion, nextVersion) <= 0) {64 vI _notificationBar.dump("starting quick_upgrade.\n")65 vI_upgrade.__initRequirements();66 vI_upgrade.__upgrade();64 if (upgrade.versionChecker.compare(extVersion, nextVersion) <= 0) { 65 vI.notificationBar.dump("starting quick_upgrade.\n") 66 upgrade.__initRequirements(); 67 upgrade.__upgrade(); 67 68 return true; 68 69 } … … 81 82 82 83 __upgrade : function() { 83 if ( vI_upgrade.vI_rdfDatasource.extUpgradeRequired()) vI_upgrade.extUpgrade();84 if (upgrade.rdfDatasource.extUpgradeRequired()) upgrade.extUpgrade(); 84 85 85 vI _account.cleanupSystem();86 vI.account.cleanupSystem(); 86 87 }, 87 88 88 89 upgrade : function() { 89 vI _notificationBar.dump("starting upgrade.\n\n")90 vI.notificationBar.dump("starting upgrade.\n\n") 90 91 document.getElementById("upgradeWizard").setAttribute("canAdvance", "false") 91 92 document.documentElement.getButton('next').setAttribute('disabled','true'); 92 93 93 vI_upgrade.__upgrade();94 upgrade.__upgrade(); 94 95 95 vI _notificationBar.dump("\n\nupgrade finished.\n");96 vI.notificationBar.dump("\n\nupgrade finished.\n"); 96 97 97 98 document.documentElement.getButton('next').setAttribute('disabled','false'); … … 100 101 101 102 extUpgrade : function() { 102 var currentVersion = vI_upgrade.vI_rdfDatasource.getCurrentExtFileVersion();103 vI _notificationBar.dump("checking for previous version, found " +103 var currentVersion = upgrade.rdfDatasource.getCurrentExtFileVersion(); 104 vI.notificationBar.dump("checking for previous version, found " + 104 105 currentVersion + "\nextension-upgrade required.\n") 105 106 switch (currentVersion) { … … 107 108 // no break 108 109 default: 109 vI_upgrade.__transferMovedUserPrefs(currentVersion);110 vI_upgrade.__removeObsoleteUserPrefs(currentVersion);111 vI_upgrade.__removeExtraAddedHeaders(currentVersion);110 upgrade.__transferMovedUserPrefs(currentVersion); 111 upgrade.__removeObsoleteUserPrefs(currentVersion); 112 upgrade.__removeExtraAddedHeaders(currentVersion); 112 113 } 113 vI_upgrade.vI_rdfDatasource.storeExtVersion();114 vI _notificationBar.dump("extension-upgrade to " + vI_upgrade.vI_rdfDatasource.getCurrentExtFileVersion() + " done.\n\n");114 upgrade.rdfDatasource.storeExtVersion(); 115 vI.notificationBar.dump("extension-upgrade to " + upgrade.rdfDatasource.getCurrentExtFileVersion() + " done.\n\n"); 115 116 }, 116 117 … … 120 121 .getBranch(null); 121 122 122 vI _notificationBar.dump("extension-upgrade __removeExtraAddedHeaders " + currentVersion + "\n");123 if ((!currentVersion || vI_upgrade.versionChecker.compare(currentVersion, "0.6.9") < 0) &&123 vI.notificationBar.dump("extension-upgrade __removeExtraAddedHeaders " + currentVersion + "\n"); 124 if ((!currentVersion || upgrade.versionChecker.compare(currentVersion, "0.6.9") < 0) && 124 125 prefroot.getCharPref("mailnews.headers.extraExpandedHeaders") != "") { 125 126 // clean extraExpandedHeaders once, because the whole header-saving and restoring was broken too long 126 vI _notificationBar.dump("cleaning extraExpandedHeaders\n");127 vI.notificationBar.dump("cleaning extraExpandedHeaders\n"); 127 128 prefroot.setCharPref("mailnews.headers.extraExpandedHeaders", "") 128 vI _notificationBar.dump("cleaned extraExpandedHeaders\n");129 vI.notificationBar.dump("cleaned extraExpandedHeaders\n"); 129 130 } 130 vI _notificationBar.dump("extension-upgrade __removeExtraAddedHeaders done.\n\n");131 vI.notificationBar.dump("extension-upgrade __removeExtraAddedHeaders done.\n\n"); 131 132 }, 132 133 … … 143 144 for (var i = 0; i < transferPrefs.length; i++) { 144 145 // if former version of extension was at least 0.5.0, start with WizardPage 0.5.2 145 if (!currentVersion || ( vI_upgrade.versionChecker.compare(currentVersion, transferPrefs[i].version) < 0)) {146 if (!currentVersion || (upgrade.versionChecker.compare(currentVersion, transferPrefs[i].version) < 0)) { 146 147 // remove any obsolete preferences under extensions.virtualIdentity 147 vI _notificationBar.dump("transfer changed preferences of pre-" + transferPrefs[i].version + " release:\n")148 vI.notificationBar.dump("transfer changed preferences of pre-" + transferPrefs[i].version + " release:\n") 148 149 for each (transferPref in transferPrefs[i].prefs) { 149 try { vI_upgrade.preferences.setBoolPref(transferPref.targetPref,150 vI_upgrade.preferences.getBoolPref(transferPref.sourcePref));151 vI_upgrade.preferences.clearUserPref(transferPref.sourcePref);152 vI _notificationBar.dump(".")150 try { upgrade.preferences.setBoolPref(transferPref.targetPref, 151 upgrade.preferences.getBoolPref(transferPref.sourcePref)); 152 upgrade.preferences.clearUserPref(transferPref.sourcePref); 153 vI.notificationBar.dump(".") 153 154 } 154 155 catch (e) { }; 155 156 } 156 vI _notificationBar.dump("done.\n")157 vI.notificationBar.dump("done.\n") 157 158 } 158 159 } … … 171 172 for (var i = 0; i < obsoletePrefs.length; i++) { 172 173 // if former version of extension was at least 0.5.0, start with WizardPage 0.5.2 173 if (!currentVersion || ( vI_upgrade.versionChecker.compare(currentVersion, obsoletePrefs[i].version) < 0)) {174 if (!currentVersion || (upgrade.versionChecker.compare(currentVersion, obsoletePrefs[i].version) < 0)) { 174 175 // remove any obsolete preferences under extensions.virtualIdentity 175 vI _notificationBar.dump("removing obsolete preferences of pre-" + obsoletePrefs[i].version + " release:\n")176 vI.notificationBar.dump("removing obsolete preferences of pre-" + obsoletePrefs[i].version + " release:\n") 176 177 for each (pref in obsoletePrefs[i].prefs) { 177 try { vI_upgrade.preferences.clearUserPref(pref); vI_notificationBar.dump(".") }178 try { upgrade.preferences.clearUserPref(pref); vI.notificationBar.dump(".") } 178 179 catch (e) { }; 179 180 } 180 vI _notificationBar.dump("done.\n")181 vI.notificationBar.dump("done.\n") 181 182 } 182 183 } … … 191 192 } 192 193 } 194 vI.upgrade = upgrade; 193 195 // start init only if wizard is shown, so it is done in vI_upgrade.xul 194 // window.addEventListener('load', vI_upgrade.init, true); 196 // window.addEventListener('load', upgrade.init, true); 197 }}); -
chrome/content/v_identity/vI_upgrade.xul
r92fd25 rc3feaa 38 38 <wizard id="upgradeWizard" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 39 39 title="&vident.upgrade.dlgTitle.label;" 40 zlevel="6" onload="v I_upgrade.init(); vI_upgrade.prepare(document.getElementById('introPage'));" onunload="vI_upgrade.clean();" >40 zlevel="6" onload="virtualIdentityExtension.upgrade.init(); virtualIdentityExtension.upgrade.prepare(document.getElementById('introPage'));" onunload="virtualIdentityExtension.upgrade.clean();" > 41 41 42 <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" /> 42 43 <script type="application/x-javascript" src="chrome://v_identity/content/vI_upgrade.js" /> 43 44 <script type="application/x-javascript" src="chrome://v_identity/content/vI_account.js" /> … … 62 63 </wizardpage> 63 64 <!-- features --> 64 <wizardpage onpageshow="v I_upgrade.prepare(this);"65 <wizardpage onpageshow="virtualIdentityExtension.upgrade.prepare(this);" 65 66 label="&vident.upgrade.features.label;" description="&vident.upgrade.features.description;" 66 67 pageid="features" next="license" > … … 72 73 </wizardpage> 73 74 <!-- GPL license --> 74 <wizardpage onpageshow="v I_upgrade.prepare(this);"75 <wizardpage onpageshow="virtualIdentityExtension.upgrade.prepare(this);" 75 76 label="&vident.upgrade.license.label;" description="&vident.upgrade.license.description;" 76 77 pageid="license" next="upgrade" > … … 83 84 </wizardpage> 84 85 <!-- upgrade procedure --> 85 <wizardpage onpageshow="v I_upgrade.prepare(this);vI_upgrade.upgrade();"86 <wizardpage onpageshow="virtualIdentityExtension.upgrade.prepare(this);virtualIdentityExtension.upgrade.upgrade();" 86 87 label="&vident.upgrade.upgrade.label;" description="&vident.upgrade.upgrade.description;" 87 88 pageid="upgrade" next="finish" > … … 92 93 </wizardpage> 93 94 <!-- finish --> 94 <wizardpage onpageshow="v I_upgrade.prepare(this);"95 <wizardpage onpageshow="virtualIdentityExtension.upgrade.prepare(this);" 95 96 label="&vident.upgrade.finish.label;" description="&vident.upgrade.finish.description;" 96 97 pageid="finish" > … … 105 106 <button class="v_identity_logo v_identity_logo_button" 106 107 label="&vident.vidLogo.label; &vident.version;" 107 oncommand="v I_upgrade.openURL('http://www.absorb.it/virtual-id')" tooltiptext="&vident.upgrade.vidLogo.tooltiptext;" />108 oncommand="virtualIdentityExtension.upgrade.openURL('http://www.absorb.it/virtual-id')" tooltiptext="&vident.upgrade.vidLogo.tooltiptext;" /> 108 109 <spacer width="10px" /> 109 110 <label id="extVersion" value="&vident.version;" hidden="true" /> -
chrome/content/v_identity/vI_upgradeOverlay.js
r92fd25 rc3feaa 23 23 * ***** END LICENSE BLOCK ***** */ 24 24 25 var vI_upgradeOverlay = { 25 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 26 var upgradeOverlay = { 26 27 init: function() { 27 var rdfDatasource = new vI _rdfDatasource("virtualIdentity.rdf", true);28 var rdfDatasource = new vI.rdfDatasource("virtualIdentity.rdf", true); 28 29 if (rdfDatasource.extUpgradeRequired()) { 29 if (!vI _upgrade.quick_upgrade(rdfDatasource.getCurrentExtFileVersion()))30 if (!vI.upgrade.quick_upgrade(rdfDatasource.getCurrentExtFileVersion())) 30 31 window.open("chrome://v_identity/content/vI_upgrade.xul",0, 31 32 "chrome, dialog, modal, alwaysRaised, resizable=yes").focus(); 32 33 } 33 34 else { 34 vI _account.cleanupSystem(); // always clean leftover accounts and directories35 vI.account.cleanupSystem(); // always clean leftover accounts and directories 35 36 rdfDatasource.storeExtVersion(); 36 37 } … … 68 69 } 69 70 } 70 addEventListener('messagepane-loaded', vI_upgradeOverlay.init, true); 71 addEventListener('messagepane-loaded', upgradeOverlay.init, true); 72 }}); -
chrome/content/v_identity/vI_upgradeOverlay.xul
r92fd25 rc3feaa 36 36 37 37 <overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 38 <script type="application/x-javascript" src="chrome://v_identity/content/vI_upgradeOverlay.js" /> 38 <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" /> 39 40 <script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/> 39 41 <script type="application/x-javascript" src="chrome://v_identity/content/vI_account.js" /> 40 42 <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDatasource.js" /> 41 43 <script type="application/x-javascript" src="chrome://v_identity/content/vI_storageExtras.js" /> 42 44 <script type="application/x-javascript" src="chrome://v_identity/content/vI_upgradeOverlay.js" /> 45 43 46 // include following scripts to enable quick_upgrade 44 47 <script type="application/x-javascript" src="chrome://v_identity/content/vI_upgrade.js" /> … … 46 49 <script type="application/x-javascript" src="chrome://v_identity/content/vI_identityData.js" /> 47 50 <script type="application/x-javascript" src="chrome://v_identity/content/vI_helper.js" /> 48 <script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/>49 51 50 52 <vbox id="messagepanebox" > -
chrome/content/v_identity/v_identity.js
r92fd25 rc3feaa 23 23 * ***** END LICENSE BLOCK ***** */ 24 24 25 var vI_main = { 25 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) { 26 var main = { 26 27 preferences : Components.classes["@mozilla.org/preferences-service;1"] 27 28 .getService(Components.interfaces.nsIPrefService) … … 45 46 elements : { 46 47 init_base : function() { 47 vI_main.elements.Area_MsgIdentityHbox = document.getElementById("msgIdentityHbox");48 vI_main.elements.Obj_MsgIdentity = document.getElementById("msgIdentity");48 main.elements.Area_MsgIdentityHbox = document.getElementById("msgIdentityHbox"); 49 main.elements.Obj_MsgIdentity = document.getElementById("msgIdentity"); 49 50 }, 50 51 init_rest : function() { 51 vI_main.elements.Obj_MsgIdentityPopup = document.getElementById("msgIdentityPopup");52 vI_main.elements.Obj_vILogo = document.getElementById("v_identity_logo");53 vI_main.elements.strings = document.getElementById("vIdentBundle");52 main.elements.Obj_MsgIdentityPopup = document.getElementById("msgIdentityPopup"); 53 main.elements.Obj_vILogo = document.getElementById("v_identity_logo"); 54 main.elements.strings = document.getElementById("vIdentBundle"); 54 55 }, 55 56 strings : null … … 58 59 ComposeStateListener : { 59 60 NotifyComposeBodyReady: function() { 60 vI _notificationBar.dump("## v_identity: NotifyComposeBodyReady\n");61 vI_main.initSystemStage2();61 vI.notificationBar.dump("## v_identity: NotifyComposeBodyReady\n"); 62 main.initSystemStage2(); 62 63 }, 63 64 NotifyComposeFieldsReady: function() { 64 vI _notificationBar.dump("## v_identity: NotifyComposeFieldsReady\n");65 vI.notificationBar.dump("## v_identity: NotifyComposeFieldsReady\n"); 65 66 }, 66 67 ComposeProcessDone: function(aResult) { 67 vI _notificationBar.dump("## v_identity: StateListener reports ComposeProcessDone\n");68 vI_main.Cleanup(); // not really required, parallel handled by vI_main.close69 vI _storage.clean();68 vI.notificationBar.dump("## v_identity: StateListener reports ComposeProcessDone\n"); 69 main.Cleanup(); // not really required, parallel handled by main.close 70 vI.storage.clean(); 70 71 }, 71 72 SaveInFolderDone: function(folderURI) { 72 vI _notificationBar.dump("## v_identity: SaveInFolderDone\n");73 vI_main.Cleanup();74 vI _storage.clean();73 vI.notificationBar.dump("## v_identity: SaveInFolderDone\n"); 74 main.Cleanup(); 75 vI.storage.clean(); 75 76 } 76 77 }, … … 78 79 replacement_functions : { 79 80 FillIdentityList: function(menulist) { 80 vI _notificationBar.dump("## v_identity: mod. FillIdentityList\n");81 vI.notificationBar.dump("## v_identity: mod. FillIdentityList\n"); 81 82 var mgr = Components.classes["@mozilla.org/messenger/account-manager;1"] 82 83 .getService(Components.interfaces.nsIMsgAccountManager); … … 112 113 if (!server) continue; 113 114 // check for VirtualIdentity Account 114 try { vI _account.prefroot.getBoolPref("mail.account." + accounts[i].key + ".vIdentity");115 try { vI.account.prefroot.getBoolPref("mail.account." + accounts[i].key + ".vIdentity"); 115 116 continue; } catch (e) { }; 116 117 … … 126 127 GenericSendMessageInProgress : false, 127 128 GenericSendMessage: function (msgType) { 128 if ( vI_main.replacement_functions.GenericSendMessageInProgress) return;129 vI_main.replacement_functions.GenericSendMessageInProgress = true;129 if (main.replacement_functions.GenericSendMessageInProgress) return; 130 main.replacement_functions.GenericSendMessageInProgress = true; 130 131 131 132 // if addressCol2 is focused while sending check storage for the entered address before continuing 132 vI _storage.awOnBlur(vI_storage.focusedElement);133 vI.storage.awOnBlur(vI.storage.focusedElement); 133 134 134 135 var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] 135 136 .getService(Components.interfaces.nsIPromptService); 136 vI _notificationBar.dump("\n## v_identity: VIdentity_GenericSendMessage\n");137 vI.notificationBar.dump("\n## v_identity: VIdentity_GenericSendMessage\n"); 137 138 138 139 var vid = document.getElementById("msgIdentity_clone").vid 139 140 140 141 if (msgType == nsIMsgCompDeliverMode.Now) { 141 if ( (vid && vI_main.preferences.getBoolPref("warn_virtual") &&142 if ( (vid && main.preferences.getBoolPref("warn_virtual") && 142 143 !(promptService.confirm(window,"Warning", 143 vI_main.elements.strings.getString("vident.sendVirtual.warning")))) ||144 (!vid && vI_main.preferences.getBoolPref("warn_nonvirtual") &&144 main.elements.strings.getString("vident.sendVirtual.warning")))) || 145 (!vid && main.preferences.getBoolPref("warn_nonvirtual") && 145 146 !(promptService.confirm(window,"Warning", 146 vI_main.elements.strings.getString("vident.sendNonvirtual.warning")))) ) {147 vI_main.replacement_functions.GenericSendMessageInProgress = false;147 main.elements.strings.getString("vident.sendNonvirtual.warning")))) ) { 148 main.replacement_functions.GenericSendMessageInProgress = false; 148 149 return; 149 150 } 150 if (!vI _storage.storeVIdentityToAllRecipients(msgType)) {151 // vI _notificationBar.dump("## v_identity: sending aborted\n");152 vI_main.replacement_functions.GenericSendMessageInProgress = false;151 if (!vI.storage.storeVIdentityToAllRecipients(msgType)) { 152 // vI.notificationBar.dump("## v_identity: sending aborted\n"); 153 main.replacement_functions.GenericSendMessageInProgress = false; 153 154 return; 154 155 } 155 vI _msgIdentityCloneTools.addReplyToSelf();156 vI.msgIdentityCloneTools.addReplyToSelf(); 156 157 } 157 if (vid) vI_main.prepareAccount();158 vI_main.replacement_functions.GenericSendMessageInProgress = false;159 // vI _notificationBar.dump("## v_identity: original_functions.GenericSendMessage\n");158 if (vid) main.prepareAccount(); 159 main.replacement_functions.GenericSendMessageInProgress = false; 160 // vI.notificationBar.dump("## v_identity: original_functions.GenericSendMessage\n"); 160 161 161 162 // final check if eyerything is nice before we handover to the real sending... … … 163 164 164 165 var currentIdentity = getCurrentIdentity(); 165 // vI _identityData(email, fullName, id, smtp, extras, sideDescription, existingID)166 var currentIdentityData = new vI _identityData(currentIdentity.email, currentIdentity.fullName, null, currentIdentity.smtpServerKey, null, null, null);166 // vI.identityData(email, fullName, id, smtp, extras, sideDescription, existingID) 167 var currentIdentityData = new vI.identityData(currentIdentity.email, currentIdentity.fullName, null, currentIdentity.smtpServerKey, null, null, null); 167 168 168 vI _notificationBar.dump("\n## vI_identityData GenericSendMessage Final Check\n");169 vI _notificationBar.dump("## vI_identityData currentIdentity: fullName='" + currentIdentityData.fullName + "' email='" + currentIdentityData.email + "' smtp='" + currentIdentityData.smtp.key + "'\n");170 vI _notificationBar.dump("## vI_identityData virtualIdentityData: fullName='" + virtualIdentityData.fullName + "' email='" + virtualIdentityData.email + "' smtp='" + virtualIdentityData.smtp.key + "'\n");169 vI.notificationBar.dump("\n## vI.identityData GenericSendMessage Final Check\n"); 170 vI.notificationBar.dump("## vI.identityData currentIdentity: fullName='" + currentIdentityData.fullName + "' email='" + currentIdentityData.email + "' smtp='" + currentIdentityData.smtp.key + "'\n"); 171 vI.notificationBar.dump("## vI.identityData virtualIdentityData: fullName='" + virtualIdentityData.fullName + "' email='" + virtualIdentityData.email + "' smtp='" + virtualIdentityData.smtp.key + "'\n"); 171 172 172 173 if (currentIdentityData.fullName.toLowerCase() == virtualIdentityData.fullName.toLowerCase() && 173 174 currentIdentityData.email.toLowerCase() == virtualIdentityData.email.toLowerCase() && 174 175 virtualIdentityData.smtp.equal(currentIdentityData.smtp) ) { 175 vI_main.original_functions.GenericSendMessage(msgType);176 main.original_functions.GenericSendMessage(msgType); 176 177 } 177 178 else { 178 if (!(currentIdentityData.fullName.toLowerCase() == virtualIdentityData.fullName.toLowerCase())) vI _notificationBar.dump("\n## vI_identityData failed check for fullName.\n");179 if (!(currentIdentityData.email.toLowerCase() == virtualIdentityData.email.toLowerCase())) vI _notificationBar.dump("\n## vI_identityData failed check for email.\n");180 if (!(virtualIdentityData.smtp.equal(currentIdentityData.smtp))) vI _notificationBar.dump("\n## vI_identityData failed check for SMTP.\n");181 alert( vI_main.elements.strings.getString("vident.genericSendMessage.error"));182 vI_main.Cleanup();179 if (!(currentIdentityData.fullName.toLowerCase() == virtualIdentityData.fullName.toLowerCase())) vI.notificationBar.dump("\n## vI.identityData failed check for fullName.\n"); 180 if (!(currentIdentityData.email.toLowerCase() == virtualIdentityData.email.toLowerCase())) vI.notificationBar.dump("\n## vI.identityData failed check for email.\n"); 181 if (!(virtualIdentityData.smtp.equal(currentIdentityData.smtp))) vI.notificationBar.dump("\n## vI.identityData failed check for SMTP.\n"); 182 alert(main.elements.strings.getString("vident.genericSendMessage.error")); 183 main.Cleanup(); 183 184 } 184 // vI _notificationBar.dump("## v_identity: original_functions.GenericSendMessage done\n");185 // vI.notificationBar.dump("## v_identity: original_functions.GenericSendMessage done\n"); 185 186 }, 186 187 187 188 replace_FillIdentityList : function() { 188 //~ vI _notificationBar.dump("## v_identity: replace FillIdentityList \n");189 vI_main.original_functions.FillIdentityList = FillIdentityList;190 FillIdentityList = vI_main.replacement_functions.FillIdentityList;189 //~ vI.notificationBar.dump("## v_identity: replace FillIdentityList \n"); 190 main.original_functions.FillIdentityList = FillIdentityList; 191 FillIdentityList = main.replacement_functions.FillIdentityList; 191 192 } 192 193 }, 193 194 194 195 remove: function() { 195 window.removeEventListener('compose-window-reopen', vI_main.reopen, true);196 window.removeEventListener('compose-window-close', vI_main.close, true);197 vI _notificationBar.dump("## v_identity: end. remove Account if there.\n")198 vI_main.Cleanup();199 vI _storage.clean();196 window.removeEventListener('compose-window-reopen', main.reopen, true); 197 window.removeEventListener('compose-window-close', main.close, true); 198 vI.notificationBar.dump("## v_identity: end. remove Account if there.\n") 199 main.Cleanup(); 200 vI.storage.clean(); 200 201 }, 201 202 202 203 // initialization // 203 204 init: function() { 204 window.removeEventListener('load', vI_main.init, false);205 window.removeEventListener('compose-window-init', vI_main.init, true);206 if ( vI_main.elements.Area_MsgIdentityHbox) return; // init done before, (?reopen)207 vI _notificationBar.dump("\n## v_identity: init.\n")208 vI_main.unicodeConverter.charset="UTF-8";209 if (! vI_main.adapt_genericSendMessage()) { vI_notificationBar.dump("\n## v_identity: init failed.\n"); return; }210 211 vI_main.adapt_interface();212 gMsgCompose.RegisterStateListener( vI_main.ComposeStateListener);213 document.getElementById("v I_tooltipPopupset")205 window.removeEventListener('load', main.init, false); 206 window.removeEventListener('compose-window-init', main.init, true); 207 if (main.elements.Area_MsgIdentityHbox) return; // init done before, (?reopen) 208 vI.notificationBar.dump("\n## v_identity: init.\n") 209 main.unicodeConverter.charset="UTF-8"; 210 if (!main.adapt_genericSendMessage()) { vI.notificationBar.dump("\n## v_identity: init failed.\n"); return; } 211 212 main.adapt_interface(); 213 gMsgCompose.RegisterStateListener(main.ComposeStateListener); 214 document.getElementById("virtualIdentityExtension_tooltipPopupset") 214 215 .addTooltip(document.getElementById("msgIdentity_clone"), false); 215 window.addEventListener('compose-window-reopen', vI_main.reopen, true);216 window.addEventListener('compose-window-close', vI_main.close, true);216 window.addEventListener('compose-window-reopen', main.reopen, true); 217 window.addEventListener('compose-window-close', main.close, true); 217 218 218 219 // append observer to fcc_switch, because it does'n work with real identities (hidden by css) 219 220 document.getElementById("fcc_switch").appendChild(document.getElementById("msgIdentity_clone_observer").cloneNode(false)); 220 221 221 vI_main.AccountManagerObserver.register();222 main.AccountManagerObserver.register(); 222 223 223 vI_main.initSystemStage1();224 vI _notificationBar.dump("## v_identity: init done.\n\n")224 main.initSystemStage1(); 225 vI.notificationBar.dump("## v_identity: init done.\n\n") 225 226 }, 226 227 227 228 initSystemStage1 : function() { 228 vI _notificationBar.dump("## v_identity: initSystemStage1.\n")229 vI_main.gMsgCompose = gMsgCompose;229 vI.notificationBar.dump("## v_identity: initSystemStage1.\n") 230 main.gMsgCompose = gMsgCompose; 230 231 document.getElementById("msgIdentity_clone").init(); 231 vI _statusmenu.init();232 vI.statusmenu.init(); 232 233 }, 233 234 234 235 initSystemStage2 : function() { 235 vI _notificationBar.dump("## v_identity: initSystemStage2.\n")236 vI _msgIdentityCloneTools.initReplyTo();237 vI _storage.init();238 vI _smartIdentity.init();236 vI.notificationBar.dump("## v_identity: initSystemStage2.\n") 237 vI.msgIdentityCloneTools.initReplyTo(); 238 vI.storage.init(); 239 vI.smartIdentity.init(); 239 240 }, 240 241 241 242 close : function() { 242 vI_main.Cleanup();243 vI _storage.clean();243 main.Cleanup(); 244 vI.storage.clean(); 244 245 }, 245 246 246 247 adapt_interface : function() { 247 if ( vI_main.elements.strings) return; // only rearrange the interface once248 if (main.elements.strings) return; // only rearrange the interface once 248 249 249 250 // initialize the pointers to extension elements 250 vI_main.elements.init_base()251 main.elements.init_base() 251 252 252 253 // rearrange the positions of some elements 253 var parent_hbox = vI_main.elements.Obj_MsgIdentity.parentNode;254 var parent_hbox = main.elements.Obj_MsgIdentity.parentNode; 254 255 var storage_box = document.getElementById("addresses-box"); 255 256 var autoReplyToSelfLabel = document.getElementById("autoReplyToSelfLabel"); … … 257 258 storage_box.removeChild(autoReplyToSelfLabel); 258 259 parent_hbox.appendChild(autoReplyToSelfLabel); 259 storage_box.removeChild( vI_main.elements.Area_MsgIdentityHbox);260 parent_hbox.appendChild( vI_main.elements.Area_MsgIdentityHbox);261 262 vI_main.elements.Obj_MsgIdentity.setAttribute("hidden", "true");263 vI_main.elements.Obj_MsgIdentity.previousSibling.setAttribute("control", "msgIdentity_clone");260 storage_box.removeChild(main.elements.Area_MsgIdentityHbox); 261 parent_hbox.appendChild(main.elements.Area_MsgIdentityHbox); 262 263 main.elements.Obj_MsgIdentity.setAttribute("hidden", "true"); 264 main.elements.Obj_MsgIdentity.previousSibling.setAttribute("control", "msgIdentity_clone"); 264 265 265 266 var access_label = parent_hbox.getElementsByAttribute( "control", "msgIdentity" )[0]; … … 267 268 268 269 // initialize the pointers to extension elements (initialize those earlier might brake the interface) 269 vI_main.elements.init_rest();270 main.elements.init_rest(); 270 271 }, 271 272 272 273 adapt_genericSendMessage : function() { 273 if ( vI_main.original_functions.GenericSendMessage) return true; // only initialize this once274 vI _notificationBar.dump("## v_identity: adapt GenericSendMessage\n");275 vI_main.original_functions.GenericSendMessage = GenericSendMessage;276 GenericSendMessage = vI_main.replacement_functions.GenericSendMessage;274 if (main.original_functions.GenericSendMessage) return true; // only initialize this once 275 vI.notificationBar.dump("## v_identity: adapt GenericSendMessage\n"); 276 main.original_functions.GenericSendMessage = GenericSendMessage; 277 GenericSendMessage = main.replacement_functions.GenericSendMessage; 277 278 return true; 278 279 }, 279 280 280 281 reopen: function() { 281 vI _notificationBar.clear();282 vI _notificationBar.clear_dump();283 vI _notificationBar.dump("## v_identity: composeDialog reopened. (msgType " + gMsgCompose.type + ")\n")282 vI.notificationBar.clear(); 283 vI.notificationBar.clear_dump(); 284 vI.notificationBar.dump("## v_identity: composeDialog reopened. (msgType " + gMsgCompose.type + ")\n") 284 285 285 286 // clean all elements 286 287 document.getElementById("msgIdentity_clone").clean(); 287 vI _smartIdentity.clean();288 vI _notificationBar.dump("## v_identity: everything cleaned.\n")288 vI.smartIdentity.clean(); 289 vI.notificationBar.dump("## v_identity: everything cleaned.\n") 289 290 290 291 // now (re)init the elements 291 vI_main.initSystemStage1();292 main.initSystemStage1(); 292 293 293 294 // stateListener only works in reply-cases … … 303 304 case msgComposeType.ForwardAsAttachment: 304 305 case msgComposeType.ForwardInline: 305 vI_main.initSystemStage2(); break;306 main.initSystemStage2(); break; 306 307 case msgComposeType.Reply: 307 308 case msgComposeType.ReplyAll: … … 311 312 case msgComposeType.ReplyWithTemplate: 312 313 case msgComposeType.ReplyToList: 313 gMsgCompose.RegisterStateListener( vI_main.ComposeStateListener);314 gMsgCompose.RegisterStateListener(main.ComposeStateListener); 314 315 } 315 vI _notificationBar.dump("## v_identity: reopen done.\n")316 vI.notificationBar.dump("## v_identity: reopen done.\n") 316 317 }, 317 318 … … 319 320 320 321 __setSelectedIdentity : function(menuItem) { 321 vI_main.elements.Obj_MsgIdentity.selectedItem = menuItem;322 vI_main.elements.Obj_MsgIdentity.setAttribute("label", menuItem.getAttribute("label"));323 vI_main.elements.Obj_MsgIdentity.setAttribute("accountname", menuItem.getAttribute("accountname"));324 vI_main.elements.Obj_MsgIdentity.setAttribute("value", menuItem.getAttribute("value"));322 main.elements.Obj_MsgIdentity.selectedItem = menuItem; 323 main.elements.Obj_MsgIdentity.setAttribute("label", menuItem.getAttribute("label")); 324 main.elements.Obj_MsgIdentity.setAttribute("accountname", menuItem.getAttribute("accountname")); 325 main.elements.Obj_MsgIdentity.setAttribute("value", menuItem.getAttribute("value")); 325 326 }, 326 327 … … 328 329 addVirtualIdentityToMsgIdentityMenu : function() 329 330 { 330 vI_main.tempStorage.BaseIdentity = vI_main.elements.Obj_MsgIdentity.selectedItem;331 vI_main.tempStorage.NewIdentity = document.createElement("menuitem");332 vI_main.tempStorage.NewIdentity.className = "identity-popup-item";331 main.tempStorage.BaseIdentity = main.elements.Obj_MsgIdentity.selectedItem; 332 main.tempStorage.NewIdentity = document.createElement("menuitem"); 333 main.tempStorage.NewIdentity.className = "identity-popup-item"; 333 334 334 335 // set the account name in the choosen menu item 335 vI_main.tempStorage.NewIdentity.setAttribute("label", vI_account.account.defaultIdentity.identityName);336 vI_main.tempStorage.NewIdentity.setAttribute("accountname", " - " + vI_account.account.incomingServer.prettyName);337 vI_main.tempStorage.NewIdentity.setAttribute("accountkey", vI_account.account.key);338 vI_main.tempStorage.NewIdentity.setAttribute("value", vI_account.account.defaultIdentity.key);339 340 vI_main.elements.Obj_MsgIdentityPopup.appendChild(vI_main.tempStorage.NewIdentity);341 vI_main.__setSelectedIdentity(vI_main.tempStorage.NewIdentity);336 main.tempStorage.NewIdentity.setAttribute("label", vI.account.account.defaultIdentity.identityName); 337 main.tempStorage.NewIdentity.setAttribute("accountname", " - " + vI.account.account.incomingServer.prettyName); 338 main.tempStorage.NewIdentity.setAttribute("accountkey", vI.account.account.key); 339 main.tempStorage.NewIdentity.setAttribute("value", vI.account.account.defaultIdentity.key); 340 341 main.elements.Obj_MsgIdentityPopup.appendChild(main.tempStorage.NewIdentity); 342 main.__setSelectedIdentity(main.tempStorage.NewIdentity); 342 343 }, 343 344 344 345 removeVirtualIdentityFromMsgIdentityMenu : function() 345 346 { 346 if (! vI_main.tempStorage.BaseIdentity) return; // don't try to remove Item twice347 if (!main.tempStorage.BaseIdentity) return; // don't try to remove Item twice 347 348 try { // might not exist anymore (window closed), so just try to remove it 348 document.getElementById("msgIdentity").firstChild.removeChild( vI_main.tempStorage.NewIdentity);349 vI_main.__setSelectedIdentity(vI_main.tempStorage.BaseIdentity);349 document.getElementById("msgIdentity").firstChild.removeChild(main.tempStorage.NewIdentity); 350 main.__setSelectedIdentity(main.tempStorage.BaseIdentity); 350 351 } catch (e) { }; 351 vI_main.tempStorage.NewIdentity = null;352 vI_main.tempStorage.BaseIdentity = null;352 main.tempStorage.NewIdentity = null; 353 main.tempStorage.BaseIdentity = null; 353 354 }, 354 355 355 356 prepareAccount : function() { 356 vI_main.Cleanup(); // just to be sure that nothing is left (maybe last time sending was irregularily stopped)357 vI _account.createAccount();358 vI_main.addVirtualIdentityToMsgIdentityMenu();357 main.Cleanup(); // just to be sure that nothing is left (maybe last time sending was irregularily stopped) 358 vI.account.createAccount(); 359 main.addVirtualIdentityToMsgIdentityMenu(); 359 360 }, 360 361 361 362 Cleanup : function() { 362 vI_main.removeVirtualIdentityFromMsgIdentityMenu();363 vI _account.removeUsedVIAccount();363 main.removeVirtualIdentityFromMsgIdentityMenu(); 364 vI.account.removeUsedVIAccount(); 364 365 }, 365 366 … … 369 370 observe : function(subject, topic, data) { 370 371 if (topic == "am-smtpChanges") { 371 vI _notificationBar.dump("## v_identity: smtp changes observed\n");372 vI.notificationBar.dump("## v_identity: smtp changes observed\n"); 372 373 var msgIdentity_clone = document.getElementById("msgIdentity_clone"); 373 374 document.getAnonymousElementByAttribute(msgIdentity_clone, "class", "smtpServerListHbox").refresh(); 374 375 } 375 376 if (topic == "am-acceptChanges") { 376 vI _notificationBar.dump("## v_identity: account changes observed\n");377 vI.notificationBar.dump("## v_identity: account changes observed\n"); 377 378 document.getElementById("msgIdentity_clone").clean(); 378 379 document.getElementById("msgIdentity_clone").init(); … … 395 396 396 397 397 vI_main.replacement_functions.replace_FillIdentityList(); 398 window.addEventListener('compose-window-init', vI_main.init, true); 399 400 window.addEventListener("unload", function(e) { vI_main.AccountManagerObserver.unregister(); try {vI_statusmenu.removeObserver();} catch (ex) { } }, false); 401 398 main.replacement_functions.replace_FillIdentityList(); 399 window.addEventListener('compose-window-init', main.init, true); 400 401 window.addEventListener("unload", function(e) { main.AccountManagerObserver.unregister(); try {vI.statusmenu.removeObserver();} catch (ex) { } }, false); 402 vI.main = main; 403 }}); -
chrome/content/v_identity/v_identity.xml
r92fd25 rc3feaa 35 35 xmlns:xbl="http://www.mozilla.org/xbl"> 36 36 37 <binding id=" tooltipPopupset">37 <binding id="vI_tooltipPopupset"> 38 38 <implementation> 39 39 <method name="addTooltip"> … … 44 44 this.removeTooltip(randID); 45 45 if (!randID) { 46 randID = " tooltip_" + parseInt((new Date()).getTime());46 randID = "virtualIdentityExtension_tooltip_" + parseInt((new Date()).getTime()); 47 47 elem.tooltipElem.setAttribute("tooltip", randID); 48 48 } … … 72 72 <method name="popupshowing"> 73 73 <body><![CDATA[ 74 virtualIdentityExtension.notificationBar.dump("** v_identity.xml vI_tooltipPopupset popupshowing.\n") 74 75 if (!this._identityInfo) { 75 76 this._identityInfo = … … 81 82 "</td>" + 82 83 "</tr></table>" 83 // vI_notificationBar.dump("** v_identity.xml added tooltip with id='" + this.elem.identityData.id.key + "'\n")84 virtualIdentityExtension.notificationBar.dump("** v_identity.xml added tooltip with id='" + this.elem.identityData.id.key + "'\n") 84 85 this._tooltipBrowser.outputString = this._identityInfo; 85 86 } 87 virtualIdentityExtension.notificationBar.dump("** v_identity.xml vI_tooltipPopupset popupshowing done.\n") 86 88 ]]></body> 87 89 </method> … … 125 127 this.label = this._identityDataStorage.combinedName; 126 128 this.value = this._identityDataStorage.id.key; 127 // vI_notificationBar.dump("** v_identity.xml fromPopupItem_clone constructor id='" + this.value + "'.\n")129 virtualIdentityExtension.notificationBar.dump("** v_identity.xml fromPopupItem_clone constructor id='" + this.value + "'.\n") 128 130 129 131 this.description = this._identityDataStorage.sideDescription; 130 132 this.smtp = this._identityDataStorage.smtp.value; 131 // vI_notificationBar.dump("** v_identity.xml fromPopupItem_clone constructor smtp='" + this.smtp + "'.\n")133 virtualIdentityExtension.notificationBar.dump("** v_identity.xml fromPopupItem_clone constructor smtp='" + this.smtp + "'.\n") 132 134 this.smtpStyle = "width:" + document.getElementById("smtp_server_list").clientWidth + "px;"; 133 135 this._identityDataStorage.smtp.value; 134 136 135 document.getElementById("v I_tooltipPopupset").addTooltip(this, true);137 document.getElementById("virtualIdentityExtension_tooltipPopupset").addTooltip(this, true); 136 138 ]]> 137 139 </constructor> 138 140 <method name="clean"> 139 141 <body><![CDATA[ 140 document.getElementById("v I_tooltipPopupset")142 document.getElementById("virtualIdentityExtension_tooltipPopupset") 141 143 .removeTooltip(this.tooltipElem.getAttribute("tooltip")); 142 144 ]]></body> … … 167 169 <xul:menupopup anonid="smtp_server_list_popup" /> 168 170 </xul:menulist> 169 <xul:checkbox id="saveSMTPSwitch" class="vI_plain" allowevents="true" oncommand="event.stopPropagation();v I_statusmenu.changeSMTPStatus(this);" >171 <xul:checkbox id="saveSMTPSwitch" class="vI_plain" allowevents="true" oncommand="event.stopPropagation();virtualIdentityExtension.statusmenu.changeSMTPStatus(this);" > 170 172 <xul:observes element="vI_statusMenu_storage_saveSMTP" attribute="checked" /> 171 173 <xul:observes element="vI_statusMenu_storage_saveSMTP" attribute="disabled" /> … … 182 184 listitem.setAttribute("type", "non-iconic-noaccel"); 183 185 listitem.setAttribute("label", " "); 184 listitem.setAttribute("key", v I_NO_SMTP_TAG);186 listitem.setAttribute("key", virtualIdentityExtension.NO_SMTP_TAG); 185 187 this._smtpPopup.insertBefore(listitem, this._smtpPopup.firstChild); 186 188 this._smtpMenu.selectedItem = listitem; … … 242 244 <property name="smtp" onget="return this._smtpMenu.selectedItem.getAttribute('key');" > 243 245 <setter><![CDATA[ 244 if (val == v I_NO_SMTP_TAG) return; // dont overwrite if not set245 v I_notificationBar.dump("** v_identity.xml smtp set to '" + val + "'\n")246 if (val == virtualIdentityExtension.NO_SMTP_TAG) return; // dont overwrite if not set 247 virtualIdentityExtension.notificationBar.dump("** v_identity.xml smtp set to '" + val + "'\n") 246 248 var MenuItems = this._smtpPopup.childNodes 247 249 for (var index = 0; index < MenuItems.length; index++) { … … 283 285 <xul:spacer flex="1" /></xul:vbox> 284 286 <xul:vbox id="saveSwitch"><xul:spacer flex="1" /> 285 <xul:checkbox class="vI_plain" allowevents="true" oncommand="event.stopPropagation();v I_statusmenu.changeSaveStatus(this);" >287 <xul:checkbox class="vI_plain" allowevents="true" oncommand="event.stopPropagation();virtualIdentityExtension.statusmenu.changeSaveStatus(this);" > 286 288 <xul:observes element="vI_statusMenu_storage_save" attribute="checked" /> 287 289 </xul:checkbox> … … 300 302 <xul:spacer flex="1" /></xul:vbox> 301 303 <xul:vbox id="saveBaseIDSwitch"><xul:spacer flex="1" /> 302 <xul:checkbox class="vI_plain" allowevents="true" oncommand="event.stopPropagation();v I_statusmenu.changeBaseIDStatus(this);" >304 <xul:checkbox class="vI_plain" allowevents="true" oncommand="event.stopPropagation();virtualIdentityExtension.statusmenu.changeBaseIDStatus(this);" > 303 305 <xul:observes element="vI_statusMenu_storage_saveBaseID" attribute="checked" /> 304 306 <xul:observes element="vI_statusMenu_storage_saveBaseID" attribute="disabled" /> … … 321 323 inputTextbox.setAttribute("timeout", "300") 322 324 323 // to ealy to access vI_tooltipPopupset, this might break the interface325 // too early to access virtualIdentityExtension_tooltipPopupset, this might break the interface 324 326 // it will be done in v_identity.js init 325 // document.getElementById("v I_tooltipPopupset").addTooltip(this, false);327 // document.getElementById("virtualIdentityExtension_tooltipPopupset").addTooltip(this, false); 326 328 327 329 this._prefroot.addObserver("extensions.virtualIdentity.show_smtp", this._observer, false); … … 331 333 <destructor> 332 334 <![CDATA[ 333 var vI_tooltipPopupset = document.getElementById("vI_tooltipPopupset")334 if ( vI_tooltipPopupset) vI_tooltipPopupset.removeTooltip(this.tooltipElem.getAttribute("tooltip"));335 var tooltipPopupset = document.getElementById("virtualIdentityExtension_tooltipPopupset") 336 if (tooltipPopupset) tooltipPopupset.removeTooltip(this.tooltipElem.getAttribute("tooltip")); 335 337 this._prefroot.removeObserver("extensions.virtualIdentity.show_smtp", this._observer); 336 338 ]]> … … 344 346 <method name="command"> 345 347 <body><![CDATA[ 346 vI_notificationBar.dump("\n** v_identity.xml msgIdentityCloneElem.doCommand() \n") 348 virtualIdentityExtension.notificationBar.dump("\n** v_identity.xml msgIdentityCloneElem.doCommand() \n") 349 virtualIdentityExtension.notificationBar.dump("\n** v_identity.xml msgIdentityCloneElem.doCommand() \n") 347 350 // copy selected Menu-Value from clone to orig. 348 vI_notificationBar.dump("** v_identity.xmlcopy selected Menu-Value from clone to orig. Searching for id=" + this.selectedMenuItem.identityData.id.key + " \n") 349 351 virtualIdentityExtension.notificationBar.dump("** v_identity.xmlcopy selected Menu-Value from clone to orig. Searching for id=" + this.selectedMenuItem.identityData.id.key + " \n") 350 352 if ( this.selectedMenuItem.identityData.id.key != null ) { 351 353 var MenuItems = this._msgIdentityPopupElem.childNodes … … 360 362 } 361 363 this.identityData = this.selectedMenuItem.identityData.getDuplicate(); 362 364 virtualIdentityExtension.notificationBar.dump("\n** v_identity.xml msgIdentityCloneElem.doCommand() this.value=" + this.value + "\n"); 363 365 // if current SMTP is empty, take the one from current Identity 364 366 if (this.identityData.smtp.hasNoDefinedSMTP()) { … … 381 383 // else description = identity.description?"- "+identity.description:identity.accountname 382 384 383 var newIdentity = new v I_identityData(identity.email, identity.fullName, identity.key,385 var newIdentity = new virtualIdentityExtension.identityData(identity.email, identity.fullName, identity.key, 384 386 identity.smtpServerKey, null, description, true) 385 387 newIdentity.extras.readIdentityValues(identity); … … 490 492 <getter><![CDATA[ 491 493 if (!this._msgIdentityElem.selectedItem) { 492 v I_notificationBar.dump("** v_identity.xml: msgIdentityElem.selectedItem not set, using first Menuitem\n");494 virtualIdentityExtension.notificationBar.dump("** v_identity.xml: msgIdentityElem.selectedItem not set, using first Menuitem\n"); 493 495 this._msgIdentityElem.selectedItem = this._msgIdentityPopupElem.firstChild 494 v I_notificationBar.dump("** v_identity.xml: msgIdentityElem.doCommand()\n");496 virtualIdentityExtension.notificationBar.dump("** v_identity.xml: msgIdentityElem.doCommand()\n"); 495 497 this._msgIdentityElem.doCommand(); 496 498 } … … 500 502 <method name="blurEvent"> 501 503 <body><![CDATA[ 502 v I_notificationBar.dump("\n** v_identity.xml blurEvent")504 virtualIdentityExtension.notificationBar.dump("\n** v_identity.xml blurEvent") 503 505 this.inputEvent(); // timeout might prevent inputEvent to fire before blurEvent 504 506 … … 509 511 <method name="inputEvent"> 510 512 <body><![CDATA[ 511 v I_notificationBar.dump("\n** v_identity.xml inputEvent\n")513 virtualIdentityExtension.notificationBar.dump("\n** v_identity.xml inputEvent\n") 512 514 513 515 this.identityData.combinedName = this.label; … … 519 521 <method name="checkForVirtualIdentity"> 520 522 <body><![CDATA[ 521 v I_notificationBar.dump("** v_identity.xml checkForVirtualIdentity: " + this.identityData.id.key + " '" + this.identityData.id.value + "'\n")523 virtualIdentityExtension.notificationBar.dump("** v_identity.xml checkForVirtualIdentity: " + this.identityData.id.key + " '" + this.identityData.id.value + "'\n") 522 524 var existingIdentity = this.identityData.isExistingIdentity(false); 523 525 524 526 this.vid = (!existingIdentity); 525 527 526 v I_msgIdentityCloneTools.signatureSwitch(existingIdentity);528 virtualIdentityExtension.msgIdentityCloneTools.signatureSwitch(existingIdentity); 527 529 528 530 return existingIdentity; … … 533 535 this.identityData.smtp.key = val; 534 536 535 document.getElementById("v I_tooltipPopupset").addTooltip(this);537 document.getElementById("virtualIdentityExtension_tooltipPopupset").addTooltip(this); 536 538 537 539 var existingIdentity = this.checkForVirtualIdentity(); … … 545 547 ]]></getter> 546 548 <setter><![CDATA[ 547 v I_notificationBar.dump("** v_identity.xml identityData setter\n")549 virtualIdentityExtension.notificationBar.dump("** v_identity.xml identityData setter\n") 548 550 if (!val) this._identityDataStorage = null 549 551 else { … … 551 553 this._identityDataStorage = val; 552 554 if (oldIdentityData) { // indicates that it's not first time after clean 553 v I_notificationBar.dump("** v_identity.xml previousID: fullName='" + oldIdentityData.fullName + "' email='" + oldIdentityData.email + "' smtp='" + oldIdentityData.smtp.key + "' id='" + oldIdentityData.id.key + "' existingID='" + oldIdentityData.existingID + "'\n");554 v I_notificationBar.dump("** v_identity.xml newID: fullName='" + this._identityDataStorage.fullName + "' email='" + this._identityDataStorage.email + "' smtp='" + this._identityDataStorage.smtp.key + "' id='" + this._identityDataStorage.id.key + "' existingID='" + this._identityDataStorage.existingID + "'\n");555 virtualIdentityExtension.notificationBar.dump("** v_identity.xml previousID: fullName='" + oldIdentityData.fullName + "' email='" + oldIdentityData.email + "' smtp='" + oldIdentityData.smtp.key + "' id='" + oldIdentityData.id.key + "' existingID='" + oldIdentityData.existingID + "'\n"); 556 virtualIdentityExtension.notificationBar.dump("** v_identity.xml newID: fullName='" + this._identityDataStorage.fullName + "' email='" + this._identityDataStorage.email + "' smtp='" + this._identityDataStorage.smtp.key + "' id='" + this._identityDataStorage.id.key + "' existingID='" + this._identityDataStorage.existingID + "'\n"); 555 557 if (!this._identityDataStorage.existingID && !this._identityDataStorage.combinedName) 556 558 this._identityDataStorage.fullName = oldIdentityData.fullName; … … 569 571 this.description = this._identityDataStorage.sideDescription; 570 572 document.getAnonymousElementByAttribute(this, "anonid", "smtpServerListHbox").smtp = this._identityDataStorage.smtp.keyNice; 571 v I_notificationBar.dump("** v_identity.xml resultingID: fullName='" + this._identityDataStorage.fullName + "' email='" + this._identityDataStorage.email + "' smtp='" + this._identityDataStorage.smtp.key + "' id='" + this._identityDataStorage.id.key + "' existingID='" + this._identityDataStorage.existingID + "'\n");572 } 573 v I_notificationBar.dump("** v_identity.xml identityData setter done.'\n")573 virtualIdentityExtension.notificationBar.dump("** v_identity.xml resultingID: fullName='" + this._identityDataStorage.fullName + "' email='" + this._identityDataStorage.email + "' smtp='" + this._identityDataStorage.smtp.key + "' id='" + this._identityDataStorage.id.key + "' existingID='" + this._identityDataStorage.existingID + "'\n"); 574 } 575 virtualIdentityExtension.notificationBar.dump("** v_identity.xml identityData setter done.'\n") 574 576 ]]></setter> 575 577 </property> -
chrome/content/v_identity/v_identity.xul
r92fd25 rc3feaa 36 36 <overlay id="v_identity" 37 37 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 38 38 <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" /> 39 39 <script type="application/x-javascript" src="chrome://v_identity/content/v_identity.js" /> 40 40 <script type="application/x-javascript" src="chrome://v_identity/content/vI_helper.js" /> … … 77 77 tooltiptext="&vident.composeDialog.fcc_switch.tooltiptext;" hidden="true" doFcc="false" 78 78 oncommand="if (this.doFcc == this.checked) this.checked = !(this.checked); this.doFcc = this.checked;" /> 79 <popupset id="v I_tooltipPopupset" />79 <popupset id="virtualIdentityExtension_tooltipPopupset" /> 80 80 </hbox> 81 81 </vbox> … … 84 84 <menupopup id="vI_statusMenu"> 85 85 <menuitem type="checkbox" id="vI_statusMenu_storage_save" label="&vident.vI_Menu.storageSave.label;" 86 oncommand="v I_statusmenu.menuConstraint(this);"/>86 oncommand="virtualIdentityExtension.statusmenu.menuConstraint(this);"/> 87 87 <menuitem type="checkbox" id="vI_statusMenu_storage_saveBaseID" label="&vident.vI_Menu.saveBaseID.label;" 88 oncommand="v I_statusmenu.menuConstraint(vI_statusmenu.objStorageSaveMenuItem);"/>88 oncommand="virtualIdentityExtension.statusmenu.menuConstraint(virtualIdentityExtension.statusmenu.objStorageSaveMenuItem);"/> 89 89 <menuitem type="checkbox" id="vI_statusMenu_storage_saveSMTP" label="&vident.vI_Menu.saveSMTP.label;" 90 oncommand="v I_statusmenu.menuConstraint(vI_statusmenu.objStorageSaveMenuItem);"/>90 oncommand="virtualIdentityExtension.statusmenu.menuConstraint(virtualIdentityExtension.statusmenu.objStorageSaveMenuItem);"/> 91 91 <menuseparator id="vI_statusMenu_separator" /> 92 92 <menuitem class="menuitem-iconic" label="&vident.vI_Menu.Settings.label;" … … 125 125 context="vI_statusMenu" 126 126 tooltip="vI_statusMenuTooltip" 127 onclick="v I_statusmenu.clicked(event.button);" />127 onclick="virtualIdentityExtension.statusmenu.clicked(event.button);" /> 128 128 </statusbar> 129 129 -
chrome/skin/classic/v_identity/v_identity.css
r92fd25 rc3feaa 379 379 } 380 380 381 #v I_tooltipPopupset {382 -moz-binding: url("chrome://v_identity/content/v_identity.xml# tooltipPopupset");381 #virtualIdentityExtension_tooltipPopupset { 382 -moz-binding: url("chrome://v_identity/content/v_identity.xml#vI_tooltipPopupset"); 383 383 } 384 384
Note: See TracChangeset
for help on using the changeset viewer.