This is just some static backup of the original site, don't expect every link to work!

Changeset c3feaa


Ignore:
Timestamp:
Aug 16, 2011, 10:12:23 PM (11 years ago)
Author:
rene <rene@…>
Branches:
ng_0.8, ng_0.9
Children:
190674
Parents:
92fd25
Message:

clean namespace from pollution

Files:
1 added
45 edited

Legend:

Unmodified
Added
Removed
  • chrome.manifest

    r92fd25 rc3feaa  
    1010overlay chrome://messenger/content/messengercompose/messengercompose.xul    chrome://v_identity/content/v_identity.xul
    1111overlay chrome://messenger/content/messengercompose/messengercompose.xul    chrome://v_identity/content/vI_context.xul
     12overlay chrome://messenger/content/messenger.xul                chrome://v_identity/content/vI_upgradeOverlay.xul
    1213overlay 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.xul
    1414overlay chrome://messenger/content/mailWindowOverlay.xul            chrome://v_identity/content/vI_getHeader.xul
    1515overlay chrome://v_identity/content/vI_rdfDataTree.xul  chrome://v_identity/content/vI_storageExtrasDataTreeOverlay.xul
  • chrome/content/v_identity/vI_Dialog.js

    r92fd25 rc3feaa  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
    25 var vI_Dialog = {
     25virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     26var Dialog = {
    2627    setDescription : function(object, description) {
    2728        var new_text = document.createTextNode(description);
     
    3132    init : function(warning) {
    3233        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);
    3637        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);
    3839        // show abort button
    3940        if (warning.class == "replaceVIdentity") {
     
    4344    }
    4445}
     46vI.Dialog = Dialog;
     47}});
  • chrome/content/v_identity/vI_Dialog.xul

    r92fd25 rc3feaa  
    3737        title="Virtual Identity"
    3838    zlevel="6"
    39     onload="vI_Dialog.init(window.arguments[0]);"
     39    onload="virtualIdentityExtension.Dialog.init(window.arguments[0]);"
    4040    ondialogaccept="window.arguments[1].returnValue = 'accept';"
    4141    ondialogcancel="window.close(); window.arguments[1].returnValue = 'cancel';"
     
    4444    persist="height width">
    4545
    46     <script type="application/x-javascript"
    47         src="chrome://v_identity/content/vI_Dialog.js" />
     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" />
    4848
    4949    <description id="vI_Dialog_title" />
  • chrome/content/v_identity/vI_account.js

    r92fd25 rc3feaa  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
    25 var vI_account = {
    26     account : null,
    27    
    28     AccountManager : Components.classes["@mozilla.org/messenger/account-manager;1"]
     25virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     26var account = {
     27    _account : null,
     28   
     29    _AccountManager : Components.classes["@mozilla.org/messenger/account-manager;1"]
    2930        .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"]
    3333        .getService(Components.interfaces.nsIPrefService)
    3434        .getBranch(null),
    3535
    3636    _getBaseIdentity : function () {
    37         return gAccountManager.getIdentity(vI_main.elements.Obj_MsgIdentity.value);
     37        return account._AccountManager.getIdentity(vI.main.elements.Obj_MsgIdentity.value);
    3838    },
    3939
    4040    _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));
    4343    },
    4444   
    4545    _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));
    4848    },
    4949
    5050    _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));
    5353    },
    5454
    5555    _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));
    5858    },
    5959
    6060    copyPreferences : function() {
    61         if (vI_main.preferences.getBoolPref("copySMIMESettings")) {
     61        if (vI.main.preferences.getBoolPref("copySMIMESettings")) {
    6262            // 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");
    6767        }
    6868/*      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")) {
    7070            // 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");
    8181        }   */
    82         if (vI_main.preferences.getBoolPref("copyAttachVCardSettings")) {
     82        if (vI.main.preferences.getBoolPref("copyAttachVCardSettings")) {
    8383            // 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");
    8787        }
    8888    },
     
    9797            // recurse into all subdirectories
    9898            if (maildir.isDirectory() &&
    99                 !vI_account.__dirEmpty(maildir)) return false;
     99                !account.__dirEmpty(maildir)) return false;
    100100            // ignore files with ending "*.msf"
    101101            if (!maildir.path.match(new RegExp(".*\.msf$","i")) &&
     
    106106
    107107    __cleanupDirectories : function() {
    108         vI_notificationBar.dump("## vI_account: checking for leftover VirtualIdentity directories ")
     108        vI.notificationBar.dump("## account: checking for leftover VirtualIdentity directories ")
    109109
    110110        var file = Components.classes["@mozilla.org/file/directory_service;1"]
     
    124124                    if (maildir.path.match(new RegExp("[/\\\\]virtualIdentity.*$","i"))) {
    125125                        // should be empty, VirtualIdentity never uses those directories
    126                         if (vI_account.__dirEmpty(maildir)) {
     126                        if (account.__dirEmpty(maildir)) {
    127127                            try {maildir.remove(true)} catch(e) { }
    128                             vI_notificationBar.dump("x");
     128                            vI.notificationBar.dump("x");
    129129                        }
    130                         else vI_notificationBar.dump(".");
     130                        else vI.notificationBar.dump(".");
    131131                       
    132132                    }
     
    134134            }
    135135        }
    136         vI_notificationBar.dump(" - done\n")
     136        vI.notificationBar.dump(" - done\n")
    137137    },
    138138   
    139139    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);
    146146            }
    147147        }
    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) {
    153153        // 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");
    155155            return true;
    156156        } catch (e) { };
    157157        // 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;
    159159        return false;
    160160    },
    161161   
    162     __removeAccount : function(account) {
     162    __removeAccount : function(checkAccount) {
     163        vI.notificationBar.dump("## account: __removeAccount\n")
    163164        // in new (post 0.5.0) Virtual Identity accounts the incomingServer of the account
    164165        // points to an incoming server of a different account. Cause the internal
    165166        // removeAccount function tries to removes the incomingServer ether, create
    166167        // a real one before calling this function.
    167         if (!account.incomingServer || account.incomingServer.hostName != "virtualIdentity") {
     168        if (!checkAccount.incomingServer || checkAccount.incomingServer.hostName != "virtualIdentity") {
    168169            // if not some of the 'old' accounts
    169             account.incomingServer = vI_account.AccountManager.
     170            checkAccount.incomingServer = account._AccountManager.
    170171                createIncomingServer("toRemove","virtualIdentity","pop3");
    171172        }
    172173
    173174        // remove the rootFolder of the account
    174         try { account.incomingServer.rootFolder.Delete(); }
     175        try { checkAccount.incomingServer.rootFolder.Delete(); }
    175176        catch (e) { };
    176177       
    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")
    179180        // remove the account
    180         vI_account.AccountManager.removeAccount(account);
     181        account._AccountManager.removeAccount(checkAccount);
    181182        // remove the additional tagging-pref
    182         try { vI_account.prefroot.clearUserPref("mail.account." + key + ".vIdentity");  }
     183        try { account._prefroot.clearUserPref("mail.account." + key + ".vIdentity");    }
    183184        catch (e) { };
    184185    },
     
    192193            var selectedMessages = (mailWindow.gFolderDisplay)?mailWindow.gFolderDisplay.selectedMessages:null;
    193194        }
    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;
    197198        }
    198199        try {
     
    204205    createAccount : function()
    205206    {
    206         if (vI_account.account) {  // if the Account is still created, then leave all like it is
     207        if (account._account) {  // if the Account is still created, then leave all like it is
    207208            alert("account still created, shouldn't happen");
    208209            return;
     
    210211        /*
    211212        // 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);
    214215        // but this ends up in the following exception:
    215         // "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIMsgAccountManager.duplicateAccount]"
     216        // "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIMsg_AccountManager.duplicateAccount]"
    216217        // so I have to do this by hand ;(
    217218        */
    218219       
    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());
    223224   
    224225        // the new account uses the same incomingServer than the base one,
     
    226227        // by pointing to the same incomingServer stored passwords can be reused
    227228        // 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());
    229230        var server = servers.QueryElementAt(0, Components.interfaces.nsIMsgIncomingServer);
    230231       
     
    233234        // but we should restore it, because it's actually the same server as the one of the base identity
    234235        server.valid = false;
    235         vI_account.account.incomingServer = server;
     236        account._account.incomingServer = server;
    236237        server.valid = true;
    237238
    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();
    243244    },
    244245   
    245246    copyMsgIdentityClone : function() {
    246247        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_TAG
    251 
    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");
    256257    },
    257258   
     
    259260    {
    260261        if (document.getElementById("fcc_switch").getAttribute("checked")) {
    261             switch (vI_main.preferences.getCharPref("fccFolderPickerMode"))
     262            switch (vI.main.preferences.getCharPref("fccFolderPickerMode"))
    262263            {
    263264                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;
    269270                break;
    270271                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;
    276277                break;
    277278                default  :
    278                 vI_notificationBar.dump ("## vI_account: preparing Fcc --- use Virtual Identity Settings\n");
    279                 vI_account.account.defaultIdentity.doFcc
    280                     = vI_main.preferences.getBoolPref("doFcc");
    281                 vI_account.account.defaultIdentity.fccFolder
    282                     = vI_main.unicodeConverter.ConvertToUnicode(vI_main.preferences.getCharPref("fccFolder"));
    283                 vI_account.account.defaultIdentity.fccFolderPickerMode
    284                     = 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");
    286287
    287288                break;
     
    289290        }
    290291        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");
    298299    },
    299300   
    300301    setupDraft : function() {
    301         switch (vI_main.preferences.getCharPref("draftFolderPickerMode"))
     302        switch (vI.main.preferences.getCharPref("draftFolderPickerMode"))
    302303        {
    303304            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;
    307308            break;
    308309            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;
    312313            break;
    313314            default  :
    314             vI_notificationBar.dump ("## vI_account: preparing Draft --- use Virtual Identity Settings\n");
    315             vI_account.account.defaultIdentity.draftFolder
    316                 = vI_main.unicodeConverter.ConvertToUnicode(vI_main.preferences.getCharPref("draftFolder"));
    317             vI_account.account.defaultIdentity.draftsFolderPickerMode
    318                 = 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");
    325326    },
    326327   
    327328    setupTemplates : function() {
    328         switch (vI_main.preferences.getCharPref("stationeryFolderPickerMode"))
     329        switch (vI.main.preferences.getCharPref("stationeryFolderPickerMode"))
    329330        {
    330331            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;
    334335            break;
    335336            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;
    339340            break;
    340341            default  :
    341             vI_notificationBar.dump ("## vI_account: preparing Templates --- use Virtual Identity Settings\n");
    342             vI_account.account.defaultIdentity.stationeryFolder
    343                 = vI_main.unicodeConverter.ConvertToUnicode(vI_main.preferences.getCharPref("stationeryFolder"));
    344             vI_account.account.defaultIdentity.tmplFolderPickerMode
    345                 = 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");
    352353    }
    353354}
     355vI.account = account;
     356}});
  • chrome/content/v_identity/vI_am-Overlay.js

    r92fd25 rc3feaa  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
     25virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
    2526function orig_onAccept() {};
    26 
    27 var vI_am_Overlay = {
     27var am_Overlay = {
    2828    onAccept : function(aServerKeyToSelect, aFocusList) {
    2929        orig_onAccept();
     
    3535    init : function() {
    3636        orig_onAccept = onAccept;
    37         onAccept = vI_am_Overlay.onAccept;
     37        onAccept = am_Overlay.onAccept;
    3838    }
    3939}
    40 window.addEventListener('load', vI_am_Overlay.init, false);
     40window.addEventListener('load', am_Overlay.init, false);
     41}});
  • chrome/content/v_identity/vI_am-smtpOverlay.js

    r92fd25 rc3feaa  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
    25 var vI_am_smtpOverlay = {
     25virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     26var am_smtpOverlay = {
    2627    refreshServerList : function(aServerKeyToSelect, aFocusList) {
    2728        gSmtpServerListWindow.orig_refreshServerList(aServerKeyToSelect, aFocusList);
     
    3334    init : function() {
    3435        gSmtpServerListWindow.orig_refreshServerList = gSmtpServerListWindow.refreshServerList;
    35         gSmtpServerListWindow.refreshServerList = vI_am_smtpOverlay.refreshServerList;
     36        gSmtpServerListWindow.refreshServerList = am_smtpOverlay.refreshServerList;
    3637    }
    3738}
    38 window.addEventListener('load', vI_am_smtpOverlay.init, false);
     39window.addEventListener('load', am_smtpOverlay.init, false);
     40}});
  • chrome/content/v_identity/vI_context.xul

    r92fd25 rc3feaa  
    3434
    3535<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" />
    3637    <script type="application/x-javascript">
     38    virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
    3739    var vI_context = {
    3840        prefroot : Components.classes["@mozilla.org/preferences-service;1"]
     
    5456        vI_context.prefroot.removeObserver("extensions.virtualIdentity.menu_entry", vI_context, false);
    5557    }, false);
     58    }});
     59    dump('context: ' + virtualIdentityExtension.initTime + '\n');
    5660    </script>
    5761   
     
    6569                        <menuitem label="&vident.vI_Menu.DataEditor.label;"
    6670                            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')"/>
    6973                    </menupopup>
    7074                </menu>
  • chrome/content/v_identity/vI_getHeader.js

    r92fd25 rc3feaa  
    3939*/
    4040
    41 var vI_getHeader = {
     41virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     42var getHeader = {
    4243    messenger: null,
    4344    preferences : Components.classes["@mozilla.org/preferences-service;1"]
     
    5354   
    5455    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 = [];
    5859       
    5960        // prepare headerToSearch for speedup.
     
    6768           
    6869            // create header name to store the value
    69             var headerNameToStore = "vI_" + headerNameToSearch
     70            var headerNameToStore = "vI." + headerNameToSearch
    7071            if (!isNaN(headerNumberToSearch)) headerNameToStore += ":" + headerNumberToSearch
    7172           
    72             vI_getHeader.headerToSearch.push({ headerNameToSearch : headerNameToSearch, headerNumberToSearch : headerNumberToSearch,
     73            getHeader.headerToSearch.push({ headerNameToSearch : headerNameToSearch, headerNumberToSearch : headerNumberToSearch,
    7374                    headerNameToStore : headerNameToStore });
    7475        }
     
    8081   
    8182    getHeader: function(hdr) {
    82         vI_notificationBar.clear_dump()
     83        vI.notificationBar.clear_dump()
    8384        var index;
    8485
    85         if (!vI_getHeader.headerToSearch) vI_getHeader.prepareHeaderToSearchArray()
     86        if (!getHeader.headerToSearch) getHeader.prepareHeaderToSearchArray()
    8687
    8788        var found = false; var label = "";
    88         var subtitle = vI_getHeader.strings.getString("vident.getHeader.noHeader");
     89        var subtitle = getHeader.strings.getString("vident.getHeader.noHeader");
    8990        // create array to count the header
    9091        var currentHeadersCounter = [];
    9192       
    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;
    9394        for (var header in currentHeaderData) {
    9495            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");
    9697
    9798            // 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");
    101102//              continue;
    102103            }
    103104
    104105            // 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");
    108109//              continue;
    109110            }
    110111           
    111112            // 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");
    115116//              continue;
    116117            }
     
    119120            else currentHeadersCounter[headerName] = 1
    120121           
    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])) {
    125126                   
    126127                    var value = currentHeaderData[header].headerValue;
    127128                    if (currentHeadersCounter[headerName] != 1)
    128                         value = hdr.getStringProperty(vI_getHeader.headerToSearch[index].headerNameToStore) +
     129                        value = hdr.getStringProperty(getHeader.headerToSearch[index].headerNameToStore) +
    129130                        ", " + 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 +
    135136                        "[:" + currentHeadersCounter[headerName] + "] - stored as '" +
    136137                        storedConvValue + "'\n");
    137138                    if (!found) {
    138                         subtitle = vI_getHeader.strings.getString("vident.getHeader.headerFound");
     139                        subtitle = getHeader.strings.getString("vident.getHeader.headerFound");
    139140                        found = true;
    140141                    }
     
    146147            }
    147148        }
    148         vI_notificationBar.setNote(label, "get_header_notification", subtitle);
     149        vI.notificationBar.setNote(label, "get_header_notification", subtitle);
    149150    },
    150151   
    151152    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(/ /);
    153154        for (var index = 0; index < addedHdrs.length; index++) {
    154155            var header_to_search_splitted=addedHdrs[index].split(/:/)
     
    167168    setupEventListener: function() {
    168169        var listener = {};
    169         listener.onStartHeaders = vI_getHeader.hideExtraHeader;
    170         listener.onEndHeaders   = vI_getHeader.getHeaderDummy;
     170        listener.onStartHeaders = getHeader.hideExtraHeader;
     171        listener.onEndHeaders   = getHeader.getHeaderDummy;
    171172        gMessageListeners.push(listener);
    172173
    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";
    178179       
    179180        // 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;
    182183    },
    183184   
     
    191192       
    192193        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)
    195196    }
    196197}
    197198
    198199
    199 var vI_prepareHeader = {
     200var prepareHeader = {
    200201    prefroot : Components.classes["@mozilla.org/preferences-service;1"]
    201202            .getService(Components.interfaces.nsIPrefService)
     
    208209   
    209210    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();
    213214    },
    214215   
    215216    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();
    220221    },
    221222   
    222223    cleanup : function() {
    223         vI_prepareHeader.removeObserver();
    224         vI_prepareHeader.removeExtraHeader();
     224        prepareHeader.removeObserver();
     225        prepareHeader.removeExtraHeader();
    225226    },
    226227   
    227228    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;
    233234    },
    234235   
    235236    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;
    240241    },
    241242   
    242243    // this is a adapted copy of enigEnsureExtraHeaders() from enigmail, thanks
    243244    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/)
    246247       
    247248        // add List-Id to recognizable headers to prevent using Mailing-List addresses as sender
     
    256257//      try {
    257258            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");
    261262
    262263            for (var index = 0; index < header_list.length; index++) {
     
    273274                    for (var j = 0; j < gCollapsedHeaderList.length; j++) {
    274275                        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");
    276277                            found = true; break;
    277278                        }
     
    283284                for (var j = 0; j < gExpandedHeaderList.length; j++) {
    284285                    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");
    286287                        found = true; break;
    287288                    }
     
    292293                    (addedHeaders.indexOf(" " + headerToSearch + " ") < 0))
    293294                        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");
    295296            }
    296297           
     
    299300                extraHdrs += " " + addedHeaders;
    300301                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");
    304305            }       
    305306
     
    307308//      }
    308309//      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.")
    310311//          return false;
    311312//      }
     
    313314
    314315    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(/ /);
    318319
    319320        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(/ /);
    321322       
    322323            for (var i = 0; i < addedHdrs.length; i++) {
     
    328329                }
    329330            }
    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", "")
    333334        }
    334335    },
     
    336337    observe: function(subject, topic, data) {
    337338        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");
    341342           
    342343            // 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");
    346347            MsgReload();
    347348        }
     
    354355            if (topic == "quit-application-granted") {
    355356                /* 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");
    359360                this.unregister();
    360361            }
     
    372373    }
    373374}
    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);
     375addEventListener('messagepane-loaded', getHeader.setupEventListener, true);
     376window.addEventListener("load", function(e) { prepareHeader.init(); }, false);
     377window.addEventListener("unload", function(e) { prepareHeader.cleanup(); }, false);
     378}});
  • chrome/content/v_identity/vI_getHeader.xul

    r92fd25 rc3feaa  
    3434
    3535<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" />
    3638<script type="application/x-javascript" src="chrome://v_identity/content/vI_getHeader.js"/>
    3739<script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/>
  • chrome/content/v_identity/vI_helper.js

    r92fd25 rc3feaa  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
    25 var vI_helper = {
     25virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     26var helper = {
    2627    // simplified versionChecker, type is "TB" or "SM"
    2728    // returns true if appVersion is smaller or equal version
     
    5354
    5455    extensionActive : function (extensionID) {
    55     // new AddonManager uses asynchronous calls, therefore status is pre-stored in vI_upgradeOverlay.js
     56    // new AddonManager uses asynchronous calls, therefore status is pre-stored in vI.upgradeOverlay.js
    5657        try {
    5758            var prefroot = Components.classes["@mozilla.org/preferences-service;1"]
     
    6263    }
    6364}
     65vI.helper = helper;
     66}});
  • chrome/content/v_identity/vI_htmlTextBox.xml

    r92fd25 rc3feaa  
    4444            <xul:browser xbl:inherits="src=url" type="content" class="vI_htmlTextBox" hidden="true" flex="1" disablehistory="true" />
    4545            <xul:button xbl:inherits="tooltiptext=url" label="&vI_prefDialog.openHelpInBrowserButton.label;"
    46                     oncommand="vI_prefDialog.openURL(this.tooltipText); vI_prefDialog.toggleHelp();" />
     46                    oncommand="virtualIdentityExtension.prefDialog.openURL(this.tooltipText); virtualIdentityExtension.prefDialog.toggleHelp();" />
    4747        </xul:vbox>
    4848    </content>
  • chrome/content/v_identity/vI_identityData.js

    r92fd25 rc3feaa  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
    25 function vI_identityData(email, fullName, id, smtp, extras, sideDescription, existingID) {
     25virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     26function identityData(email, fullName, id, smtp, extras, sideDescription, existingID) {
    2627    this._email = email?email:"";
    2728    this._emailParsed = false;
    2829    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();
    3233    this.comp = {   // holds the results of the last comparison for later creation of a compareMatrix
    3334        compareID : null,
     
    3940    this.stringBundle = document.getElementById("vIdentBundle");
    4041}
    41 vI_identityData.prototype = {
     42identityData.prototype = {
    4243    _email : null,          // internal email-field might contain combinedName (until first queried via email)
    4344    _fullName : null,
     
    5859            this._fullName += RegExp.leftContext + RegExp.rightContext;
    5960            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");
    6263        }
    6364        this._emailParsed = true;
     
    7071
    7172    cleanName : function(fullName) {
    72 //      vI_notificationBar.dump("## vI_identityData: cleanName init '" + fullName + "'\n");
     73//      vI.notificationBar.dump("## identityData: cleanName init '" + fullName + "'\n");
    7374        var _fullName = fullName.replace(/^\s+|\s+$/g,"");
    7475        if (_fullName.search(/^\".+\"$|^'.+'$/g) != -1) {
    7576            _fullName = this.cleanName(_fullName.replace(/^\"(.+)\"$|^'(.+)'$/g,"$1$2"));
    7677        }
    77 //      vI_notificationBar.dump("## vI_identityData: cleanName done '" + _fullName + "'\n");
     78//      vI.notificationBar.dump("## identityData: cleanName done '" + _fullName + "'\n");
    7879        return _fullName;
    7980    },
     
    105106    // creates an Duplicate of the current IdentityData, cause usually we are working with a pointer
    106107    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);
    108109    },
    109110
     
    120121    // dependent on MsgComposeCommands, should/will only be called in ComposeDialog
    121122    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");
    124125
    125126        var ignoreFullNameMatchKey = null;
     
    128129        for (var i in accounts) {
    129130            // 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) { };
    131132   
    132133            var identities = queryISupportsArray(accounts[i].identities, Components.interfaces.nsIMsgIdentity);
    133134            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");
    135136                var email = this.email?this.email:"";               // might be null if no identity is set
    136137                var idEmail = identities[j].email?identities[j].email:"";   // might be null if no identity is set
    137138                if (    (email.toLowerCase() == idEmail.toLowerCase()) &&
    138                     this.smtp.equal(new vI_smtpObj(identities[j].smtpServerKey))    ) {
     139                    this.smtp.equal(new smtpObj(identities[j].smtpServerKey))   ) {
    139140                        // if fullName matches, than this is a final match
    140141                        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");
    142143                            return identities[j].key; // return key and stop searching
    143144                        }
     
    149150
    150151        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");
    152153            return  ignoreFullNameMatchKey;
    153154        }
    154155
    155         vI_notificationBar.dump("## vI_identityData: isExistingIdentity: " + this.combinedName + " not found\n");
     156        vI.notificationBar.dump("## identityData: isExistingIdentity: " + this.combinedName + " not found\n");
    156157        return null;
    157158    },
     
    183184        const Items = Array("fullName", "email", "smtp", "id");
    184185        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")
    187188        for each (let item in Items) {
    188189            var classEqual = (this.comp.equals[item])?"equal":"unequal";
     
    209210}
    210211
    211 function vI_identityCollection() {
     212function identityCollection() {
    212213    this.number = 0;
    213214    this.identityDataCollection = {};
    214215    this.menuItems = {};
    215216}
    216 vI_identityCollection.prototype =
     217identityCollection.prototype =
    217218{
    218219    number : null,
     
    226227
    227228    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");
    229230        while (index < (this.number - 1)) { this.identityDataCollection[index] = this.identityDataCollection[++index]; };
    230231        this.identityDataCollection[--this.number] = null;
     
    240241                if (this.identityDataCollection[index].fullName == "" && identityData.fullName != "") {
    241242                    this.identityDataCollection[index].fullName = identityData.fullName;
    242                     vI_notificationBar.dump("## identityCollection:   added fullName '" + identityData.fullName
     243                    vI.notificationBar.dump("## identityCollection:   added fullName '" + identityData.fullName
    243244                        + "' to stored email '" + this.identityDataCollection[index].email +"'\n")
    244245                }
     
    249250                    this.identityDataCollection[index].smtp.key = identityData.smtp.key;
    250251                    this.identityDataCollection[index].extras = identityData.extras;
    251                     vI_notificationBar.dump("## identityCollection:   added id '" + identityData.id.value
     252                    vI.notificationBar.dump("## identityCollection:   added id '" + identityData.id.value
    252253                        + "' smtp '" + identityData.smtp.value + "' (+extras) to stored email '" + this.identityDataCollection[index].email +"'\n")
    253254                }
     
    255256            }
    256257        }
    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")
    258259        this.identityDataCollection[index] = identityData;
    259260        this.number = index + 1;
     
    261262   
    262263    // this is used to completely use the conten of another identityCollection, but without changing all pointers
    263     // see for instance vI_smartIdentity.__filterAddresses
     264    // see for instance vI.smartIdentity.__filterAddresses
    264265    takeOver : function(newIdentityCollection) {
    265266        this.number = newIdentityCollection.number
     
    268269};
    269270
    270 const vI_DEFAULT_SMTP_TAG = "vI_useDefaultSMTP"
    271 const vI_NO_SMTP_TAG = "vI_noStoredSMTP"
    272 
    273 function vI_smtpObj(key) {
     271const DEFAULT_SMTP_TAG = "vI_useDefaultSMTP"
     272const NO_SMTP_TAG = "vI_noStoredSMTP"
     273
     274function smtpObj(key) {
    274275    this._key = key;
    275276    this.DEFAULT_TAG = document.getElementById("bundle_messenger").getString("defaultServerTag");
    276277}
    277 vI_smtpObj.prototype = {
     278smtpObj.prototype = {
    278279    DEFAULT_TAG : null,
    279280    _key : null,
     
    285286        return this._key
    286287    },
    287     get keyNice() { // the same as key but with "" for vI_DEFAULT_SMTP_TAG
    288         if (this.key == vI_DEFAULT_SMTP_TAG) return ""; // this is the key used for default server
     288    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
    289290        return this.key
    290291    },
     
    292293        if (this._value == null) {
    293294            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;
    296297            else if (!this._key) this._value = null;
    297298            else if (this._key) {
     
    308309            }
    309310        }
    310         if (!this._value) this._key = vI_NO_SMTP_TAG; // if non-existant SMTP handle like non available
     311        if (!this._value) this._key = NO_SMTP_TAG; // if non-existant SMTP handle like non available
    311312        return this._value;
    312313    },
    313314    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;
    315316        return (this.keyNice == compareSmtpObj.keyNice);
    316317    },
    317318    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
     323function idObj(key) { this._key = key; }
     324idObj.prototype = {
    324325    _key : null,
    325326    _value : null,
     
    355356    }
    356357}
     358vI.DEFAULT_SMTP_TAG = DEFAULT_SMTP_TAG;
     359vI.NO_SMTP_TAG = NO_SMTP_TAG;
     360vI.identityCollection = identityCollection;
     361vI.identityData = identityData;
     362}});
  • chrome/content/v_identity/vI_msgIdentityCloneTools.js

    r92fd25 rc3feaa  
    2222    Contributor(s): Thunderbird Developers
    2323 * ***** END LICENSE BLOCK ***** */
    24 
    25 var vI_msgIdentityCloneTools = {   
     24virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     25var msgIdentityCloneTools = {   
    2626    copySelectedIdentity : function(id_key) {
    27         vI_notificationBar.dump("## vI_msgIdentityCloneTools: copySelectedIdentity\n");
     27        vI.notificationBar.dump("## msgIdentityCloneTools: copySelectedIdentity\n");
    2828        var msgIdentityElem = document.getElementById("msgIdentity");
    2929        var msgIdentityPopupElem = document.getElementById("msgIdentityPopup");
     
    4444        try { setSecuritySettings(1); enigSetMenuSettings(''); } catch(vErr) { };
    4545        if (!existingIdentity) {
    46             vI_notificationBar.dump("## vI_msgIdentityCloneTools: signatureSwitch hide/remove signatures\n");
     46            vI.notificationBar.dump("## msgIdentityCloneTools: signatureSwitch hide/remove signatures\n");
    4747            // 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");
    5050                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"); };
    5353            // 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")) {
    5555                var element = document.getElementById("menu_securitySign1");
    5656                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");
    5858                    element.doCommand();
    5959                }
     
    6262            } catch(vErr) { };
    6363            // 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")) {
    6565                var element = document.getElementById("enigmail_signed_send");
    6666                if (element.getAttribute("checked") == "true") {
     
    7474                    }
    7575                    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");
    7777                    else {
    78                         vI_notificationBar.dump("## signatureSwitch hide_openPGP_messageSignature with doCommand\n");
     78                        vI.notificationBar.dump("## signatureSwitch hide_openPGP_messageSignature with doCommand\n");
    7979                        element.doCommand();
    8080                    }
     
    8585        }
    8686        else {
    87             vI_notificationBar.dump("## vI_msgIdentityCloneTools: signatureSwitch restore signature\n");
     87            vI.notificationBar.dump("## msgIdentityCloneTools: signatureSwitch restore signature\n");
    8888            // code to show the text signature
    8989            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");
    9191                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"); };
    9494            // sMime and openGPG signature will not be re-added automatically
    9595        }
     
    9797   
    9898    initReplyTo : function() {
    99         if (vI_statusmenu.prefroot.getBoolPref("extensions.virtualIdentity.autoReplyToSelf")) {
     99        if (vI.statusmenu.prefroot.getBoolPref("extensions.virtualIdentity.autoReplyToSelf")) {
    100100            document.getElementById("autoReplyToSelfLabel").removeAttribute("hidden");
    101             vI_msgIdentityCloneTools.removeAllReplyTos();
     101            msgIdentityCloneTools.removeAllReplyTos();
    102102        }
    103103        else document.getElementById("autoReplyToSelfLabel").setAttribute("hidden", "true");
     
    109109                var awType = awGetPopupElement(row).selectedItem.getAttribute("value");
    110110                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");
    112112                    awDeleteRow(row--); // removed one line therefore decrease row-value
    113113                }
     
    119119        if (!document.getElementById("autoReplyToSelfLabel").hasAttribute("hidden")) {
    120120            awAddRecipient("addr_reply",document.getElementById("msgIdentity_clone").label);
    121             vI_notificationBar.dump("## vI_msgIdentityCloneTools: added ReplyToSelf");
     121            vI.notificationBar.dump("## msgIdentityCloneTools: added ReplyToSelf");
    122122            document.getElementById("autoReplyToSelfLabel").setAttribute("hidden","true");
    123123        }
    124124    }
    125125}
     126vI.msgIdentityCloneTools = msgIdentityCloneTools;   
     127}});
  • chrome/content/v_identity/vI_notificationBar.js

    r92fd25 rc3feaa  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
    25 var vI_notificationBar = {
     25virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     26var notificationBar = {
    2627    quiet : null,
    2728    timer : null,
     
    4344   
    4445    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)
    4950    },
    5051   
    5152    addObserver: function() {
    52         vI_notificationBar.prefroot.addObserver("extensions.virtualIdentity.debug_notification", vI_notificationBar, false);
     53        notificationBar.prefroot.addObserver("extensions.virtualIdentity.debug_notification", notificationBar, false);
    5354    },
    5455   
    5556    removeObserver: function() {
    56         vI_notificationBar.prefroot.removeObserver("extensions.virtualIdentity.debug_notification", vI_notificationBar);
     57        notificationBar.prefroot.removeObserver("extensions.virtualIdentity.debug_notification", notificationBar);
    5758    },
    5859
    5960    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")
    6364
    6465        // nothing else to do for the upgrade dialog
    65         if (vI_notificationBar.upgrade) return true;
     66        if (notificationBar.upgrade) return true;
    6667       
    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");
    7071       
    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();
    7475
    7576        return true;
     
    7778   
    7879    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);
    8384    },
    8485   
    8586    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();
    9293    },
    9394   
     
    114115            var protohandler = Components.classes["@mozilla.org/network/protocol;1?name=http"]
    115116                .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")
    117118        }
    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")
    119120       
    120         vI_notificationBar.__getExtensionList(vI_notificationBar.__dumpDebugBox)
     121        notificationBar.__getExtensionList(notificationBar.__dumpDebugBox)
    121122
    122 //      vI_notificationBar.__dumpDebugBox(output + "\n")
     123//      notificationBar.__dumpDebugBox(output + "\n")
    123124
    124         vI_notificationBar.__dumpDebugBox("--------------------------------------------------------------------------------\n")
     125        notificationBar.__dumpDebugBox("--------------------------------------------------------------------------------\n")
    125126    },
    126127   
    127128    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);
    132133    },
    133134
    134135    __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;
    140141
    141142        var new_text = document.createTextNode(note);
    142143        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.clientHeight
     144        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
    148149    },
    149150   
    150151    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);
    153154    },
    154155
     
    167168    __setTitle: function(title) {
    168169        if (!title) return;
    169 //      vI_notificationBar.dump("** setTitle: " + title + "\n");
     170//      notificationBar.dump("** setTitle: " + title + "\n");
    170171        var Obj_vINotificationTitle = document.getElementById("vINotificationTitle");
    171172        Obj_vINotificationTitle.setAttribute("value", title);
     
    174175
    175176    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.currentNotification
     177//      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
    181182        var newLabel = (oldNotification)?oldNotification.label + note:note;
    182         vI_notificationBar.clear();
    183         vI_notificationBar.Obj_vINotification
     183        notificationBar.clear();
     184        notificationBar.Obj_vINotification
    184185                .appendNotification(newLabel, "", "chrome://messenger/skin/icons/flag.png");
    185         vI_notificationBar.__setTitle(title);
     186        notificationBar.__setTitle(title);
    186187
    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);
    190191    }
    191192}
    192 window.addEventListener("unload", function(e) { try {vI_notificationBar.removeObserver();} catch (ex) { } }, false);
     193window.addEventListener("unload", function(e) { try {notificationBar.removeObserver();} catch (ex) { } }, false);
     194vI.notificationBar = notificationBar;   
     195}});
  • chrome/content/v_identity/vI_notificationBar.xml

    r92fd25 rc3feaa  
    3838            xbl:inherits="value=label"
    3939            DOMAttrModified="if(event.attrName == 'value') this.value = event.newValue; return true;"
    40             onoverflow="vI_notificationBar.overflow(this);" oncontextmenu="" />
     40            onoverflow="virtualIdentityExtension.notificationBar.overflow(this);" oncontextmenu="" />
    4141          <children/>
    4242        </xul:hbox>
  • chrome/content/v_identity/vI_prefDialog.js

    r92fd25 rc3feaa  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
    25 var vI_prefDialog = {
     25virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     26var prefDialog = {
    2627    toggleHelp : function() {
    2728        var browserElem = document.getElementById("vI_remoteBrowserBox");
     
    3334            browserElem.setAttribute("hidden", "true");
    3435        }
    35         vI_prefDialog.updateHelpUrl();
     36        prefDialog.updateHelpUrl();
    3637    },
    3738
     
    121122        init : function() {
    122123        // 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];
    125126                var element = document.getElementById(elementID);
    126127                if (!element) break;
     
    129130                    if (eltType == "radiogroup")
    130131                        element.selectedItem = element.childNodes[
    131                             vI_prefDialog.preferences.getIntPref(element.getAttribute("prefstring"))];
     132                            prefDialog.preferences.getIntPref(element.getAttribute("prefstring"))];
    132133                    else if (eltType == "checkbox")
    133134                        element.checked =
    134                             vI_prefDialog.preferences.getBoolPref(element.getAttribute("prefstring"));
     135                            prefDialog.preferences.getBoolPref(element.getAttribute("prefstring"));
    135136                    else if (eltType == "textbox")
    136137                        if (element.getAttribute("preftype") == "int")
    137138                            element.setAttribute("value",
    138                             vI_prefDialog.preferences.getIntPref(element.getAttribute("prefstring")) );
     139                            prefDialog.preferences.getIntPref(element.getAttribute("prefstring")) );
    139140                        else {
    140141                            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"))) );
    142143//                          alert(element.getAttribute("prefstring") + " " + element.getAttribute("value"))
    143144                        }
    144145                    else if (eltType == "listbox")
    145146                        element.value =
    146                             vI_prefDialog.preferences.getCharPref(element.getAttribute("prefstring"));
     147                            prefDialog.preferences.getCharPref(element.getAttribute("prefstring"));
    147148//              } catch (ex) {}
    148149            }
     
    150151
    151152        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];
    154155                var element = document.getElementById(elementID);
    155156                if (!element) break;
    156157                var eltType = element.localName;
    157158                if (eltType == "radiogroup")
    158                     vI_prefDialog.preferences.setIntPref(
     159                    prefDialog.preferences.setIntPref(
    159160                        element.getAttribute("prefstring"), parseInt(element.value));
    160161                else if (eltType == "checkbox")
    161                     vI_prefDialog.preferences.setBoolPref(
     162                    prefDialog.preferences.setBoolPref(
    162163                        element.getAttribute("prefstring"), element.checked);
    163164                else if (eltType == "textbox") {
    164165                    if (element.getAttribute("preftype") == "int")
    165                         vI_prefDialog.preferences.setIntPref(
     166                        prefDialog.preferences.setIntPref(
    166167                            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));
    169170                }
    170171                else if (eltType == "listbox")
    171                     vI_prefDialog.preferences.setCharPref(element.getAttribute("prefstring"), element.value);
     172                    prefDialog.preferences.setCharPref(element.getAttribute("prefstring"), element.value);
    172173            }
    173174        },
     
    182183            var smartDraft = document.getElementById("VIdent_identity.smart_draft").checked;
    183184            var smartReply = document.getElementById("VIdent_identity.smart_reply").checked;
    184             var mAttr = vI_prefDialog.base.modifyAttribute;
     185            var mAttr = prefDialog.base.modifyAttribute;
    185186
    186187            // idSelectionConstraint
     
    198199            mAttr("VIdent_identity.idSelection_storage_prefer_smart_reply","disabled",idSelectionInputConstraint);
    199200            mAttr("VIdent_identity.idSelection_storage_ignore_smart_reply","disabled",idSelectionInputConstraint);
    200             if (idSelectionInputConstraint) vI_prefDialog.base.idSelectionResultConstraint();
     201            if (idSelectionInputConstraint) prefDialog.base.idSelectionResultConstraint();
    201202
    202203            // sourceEmailConstraint
     
    219220
    220221        smartReplyConstraint : function(element) {
    221             var mAttr = vI_prefDialog.base.modifyAttribute;
     222            var mAttr = prefDialog.base.modifyAttribute;
    222223            mAttr("VIdent_identity.smart_reply_for_newsgroups","disabled",element.checked);
    223224            mAttr("VIdent_identity.smart_reply_headers","disabled",element.checked);
     
    227228            mAttr("VIdent_identity.smart_reply_headers_reset","disabled",element.checked);
    228229            mAttr("VIdent_identity.smart_detectByReceivedHeader","disabled",element.checked);
    229             vI_prefDialog.base.constraints();
     230            prefDialog.base.constraints();
    230231        },
    231232       
     
    237238        smartReplyHideSignature : function() {
    238239            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)) {
    240241                document.getElementById("VIdent_identity.HideSignature.warning").setAttribute("hidden", "true");
    241242                document.getElementById("VIdent_identity.hide_signature").setAttribute("disabled", "false");
     
    244245       
    245246        autoTimestampConstraint : function(element) {
    246             var mAttr = vI_prefDialog.base.modifyAttribute;
     247            var mAttr = prefDialog.base.modifyAttribute;
    247248            mAttr("VIdent_identity.autoTimestamp.options","hidden",element.checked);
    248249        },
    249250       
    250251        storageConstraint : function(element) {
    251             var mAttr = vI_prefDialog.base.modifyAttribute;
     252            var mAttr = prefDialog.base.modifyAttribute;
    252253            mAttr("VIdent_identity.storage_storedefault","disabled",element.checked);
    253254            mAttr("VIdent_identity.storage_store_base_id","disabled",element.checked);
     
    274275            mAttr("storageUp","featureDisabled",element.checked);
    275276            mAttr("storageUpDown","featureDisabled",element.checked);
    276             vI_prefDialog.base.constraints();
     277            prefDialog.base.constraints();
    277278        },
    278279
    279280        menuButtonConstraints : function(elem) {
    280             var mAttr = vI_prefDialog.base.modifyAttribute;
     281            var mAttr = prefDialog.base.modifyAttribute;
    281282            var valueParam = (document.getElementById("viewGroup").getAttribute("hidden") == "true");   // true -> removeAttribute
    282283            var dialogElem = document.getElementById("vI_prefDialog");
     
    287288
    288289        flipMenuButtons : function(elem) {
    289             var mAttr = vI_prefDialog.base.modifyAttribute;
     290            var mAttr = prefDialog.base.modifyAttribute;
    290291            var valueParam = (elem.getAttribute("open") == "true");
    291292            var dialogElem = document.getElementById("vI_prefDialog");
     
    304305
    305306    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()
    309310
    310311        const enigmail_ID="{847b3a00-7ab1-11d4-8f02-006008948af5}"
    311         if (!vI_helper.extensionActive(enigmail_ID)) {
     312        if (!vI.helper.extensionActive(enigmail_ID)) {
    312313            document.getElementById("openPGPencryption").setAttribute("hidden", "true");
    313314            document.getElementById("VIdent_identity.hide_openPGP_messageSignature").setAttribute("hidden", "true");
    314315        }
    315316       
    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();
    323324
    324325    },
     
    326327    savePrefs : function() {
    327328        // Copy all changes to Elements
    328         onSaveCopiesAndFolders();
    329         vI_prefDialog.base.savePrefs();
     329        vI.onSaveCopiesAndFolders();
     330        prefDialog.base.savePrefs();
    330331    },
    331332
     
    338339        }
    339340}
     341vI.prefDialog = prefDialog;
     342}});
  • chrome/content/v_identity/vI_prefDialog.xml

    r92fd25 rc3feaa  
    3333    <constructor>
    3434        <![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");
    3637        var AccountManager = Components.classes["@mozilla.org/messenger/account-manager;1"]
    3738            .getService(Components.interfaces.nsIMsgAccountManager);
    38         var debugNotes = vI_prefDialog.preferences.getBoolPref("debug_notification");
     39        var debugNotes = vI.prefDialog.preferences.getBoolPref("debug_notification");
    3940
    4041        for (let i = AccountManager.accounts.Count() - 1; i >= 0 ; i--) {
     
    5556        if (debugNotes)
    5657            document.getAnonymousElementByAttribute(this, "id", "ignoreIDs_debug").removeAttribute("hidden")
     58        }
    5759        ]]>
    5860    </constructor>
    5961    <property name="value" >
    6062        <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");
    6265        var listItems = this.childNodes;
    6366        for (var index = 0; index < listItems.length; index++) {
    6467            var key = listItems[index].getAttribute("value");
    6568            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")
    6770        }
    6871        this._value = val;
     72        }
    6973        ]]></setter>
    7074        <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");
    7277        var returnVal = "";
    7378        var listItems = this.childNodes;
    7479        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");
    7681            if (!listItems[index].checked) returnVal += " :" + listItems[index].getAttribute("value") + ": "
    7782        }
    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");
    7984        return returnVal;
     85        }
    8086        ]]></getter>       
    8187    </property>
  • chrome/content/v_identity/vI_prefDialog.xul

    r92fd25 rc3feaa  
    8080    <hbox>
    8181    <vbox>
    82         <image id="toggleIcon" class="addresstwisty" onclick="vI_prefDialog.base.flipMenuButtons(this);" open="true" persist="open" />
     82        <image id="toggleIcon" class="addresstwisty" onclick="virtualIdentityExtension.prefDialog.base.flipMenuButtons(this);" open="true" persist="open" />
    8383        <spacer flex="1" />
    8484    </vbox>
     
    8888        <hbox>
    8989            <radio pane="source" id="sourceEmail"
    90                 oncommand="document.getElementById('prefTabbox').selectedIndex = 0; vI_prefDialog.updateHelpUrl();"
     90                oncommand="document.getElementById('prefTabbox').selectedIndex = 0; virtualIdentityExtension.prefDialog.updateHelpUrl();"
    9191                tooltiptext="&vI_prefDialog.tabbox.tab0.label;" />
    9292            <vbox><spacer flex="1"/><image class="arrow" id="toSelection" /><spacer flex="1"/></vbox>
    9393            <radio pane="source" id="selection"
    94                 oncommand="document.getElementById('prefTabbox').selectedIndex = 1; vI_prefDialog.updateHelpUrl();"
     94                oncommand="document.getElementById('prefTabbox').selectedIndex = 1; virtualIdentityExtension.prefDialog.updateHelpUrl();"
    9595                tooltiptext="&vI_prefDialog.tabbox.tab1.label;" />
    9696            <vbox><spacer flex="1"/><image class="arrow" id="toCompose" /><spacer flex="1"/></vbox>
    9797            <radio pane="source" id="composeDialog"
    98                 oncommand="document.getElementById('prefTabbox').selectedIndex = 2; vI_prefDialog.updateHelpUrl();"
     98                oncommand="document.getElementById('prefTabbox').selectedIndex = 2; virtualIdentityExtension.prefDialog.updateHelpUrl();"
    9999                tooltiptext="&vI_prefDialog.tabbox.tab2.label;" />
    100100            <vbox><spacer flex="1"/><image class="arrow" id="toSend" /><spacer flex="1"/></vbox>
    101101            <radio pane="source" id="emailOut"
    102                 oncommand="document.getElementById('prefTabbox').selectedIndex = 3; vI_prefDialog.updateHelpUrl();"
     102                oncommand="document.getElementById('prefTabbox').selectedIndex = 3; virtualIdentityExtension.prefDialog.updateHelpUrl();"
    103103                tooltiptext="&vI_prefDialog.tabbox.tab3.label;" />
    104104        </hbox>
     
    108108            <vbox><spacer flex="1"/><image class="arrow" id="storageUp" /><spacer flex="1"/></vbox>
    109109            <radio pane="source" id="storageOut"
    110                 oncommand="document.getElementById('prefTabbox').selectedIndex = 4; vI_prefDialog.updateHelpUrl();"
     110                oncommand="document.getElementById('prefTabbox').selectedIndex = 4; virtualIdentityExtension.prefDialog.updateHelpUrl();"
    111111                tooltiptext="&vI_prefDialog.tabbox.tab4.label;" />
    112112            <vbox><spacer flex="1"/><image class="arrow" id="storageUpDown" /><spacer flex="1"/></vbox>
     
    118118            <spacer flex="1"/>
    119119            <hbox><spacer flex="1"/><radio pane="source" id="options"
    120                 oncommand="document.getElementById('prefTabbox').selectedIndex = 5; vI_prefDialog.updateHelpUrl();"
     120                oncommand="document.getElementById('prefTabbox').selectedIndex = 5; virtualIdentityExtension.prefDialog.updateHelpUrl();"
    121121                tooltiptext="&vI_prefDialog.tabbox.tab5.label;" />
    122122            </hbox>
     
    124124            <button id="logoButton1" class="v_identity_logo v_identity_logo_button"
    125125                label="&vident.vidLogo.label; &vident.version;"
    126                 oncommand="vI_prefDialog.openURL('http://www.absorb.it/virtual-id')"
     126                oncommand="virtualIdentityExtension.prefDialog.openURL('http://www.absorb.it/virtual-id')"
    127127                tooltiptext="&vI_prefDialog.vidLogo.tooltiptext;" />
    128128        </vbox>
     
    131131    <hbox>
    132132        <tabs>
    133             <tab label="&vI_prefDialog.tabbox.tab0.label;" oncommand="document.getElementById('viewGroup').selectedIndex = 0; vI_prefDialog.updateHelpUrl(0);"/>
    134             <tab label="&vI_prefDialog.tabbox.tab1.label;" oncommand="document.getElementById('viewGroup').selectedIndex = 1; vI_prefDialog.updateHelpUrl(1);"/>
    135             <tab label="&vI_prefDialog.tabbox.tab2.label;" oncommand="document.getElementById('viewGroup').selectedIndex = 2; vI_prefDialog.updateHelpUrl(2);"/>
    136             <tab label="&vI_prefDialog.tabbox.tab3.label;" oncommand="document.getElementById('viewGroup').selectedIndex = 3; vI_prefDialog.updateHelpUrl(3);"/>
    137             <tab label="&vI_prefDialog.tabbox.tab4.label;" oncommand="document.getElementById('viewGroup').selectedIndex = 4; vI_prefDialog.updateHelpUrl(4);"/>
    138             <tab label="&vI_prefDialog.tabbox.tab5.label;" oncommand="document.getElementById('viewGroup').selectedIndex = 5; vI_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);"/>
    139139        </tabs>
    140140        <spacer flex="1" />
    141141        <button id="logoButton2" class="v_identity_logo v_identity_logo_button"
    142142                label="&vident.vidLogo.label; &vident.version;"
    143                 oncommand="vI_prefDialog.openURL('http://www.absorb.it/virtual-id')"
     143                oncommand="virtualIdentityExtension.prefDialogopenURL('http://www.absorb.it/virtual-id')"
    144144                tooltiptext="&vI_prefDialog.vidLogo.tooltiptext;" hidden="true" />
    145145    </hbox>
     
    147147    <tabpanel orient="vertical" >
    148148        <hbox flex="1">
    149         <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; vI_prefDialog.updateHelpUrl();"
     149        <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; virtualIdentityExtension.prefDialog.updateHelpUrl();"
    150150            hidecolumnpicker="true" hidehscroll="true" >
    151151        <treecols orient="vertical"><treecol flex="1" hideheader="true" primary="true"/></treecols>
     
    175175                <checkbox id="VIdent_identity.smart_draft" label="&vI_prefDialog.smartDraft.label;"
    176176                    tooltiptext="&vI_prefDialog.smartDraft.tooltiptext;" prefstring="smart_draft"
    177                     oncommand="vI_prefDialog.base.constraints();" />
     177                    oncommand="virtualIdentityExtension.prefDialogbase.constraints();" />
    178178                </groupbox>
    179179                <groupbox>
     
    181181                <checkbox id="VIdent_identity.smart_reply" label="&vI_prefDialog.smartReply.label;"
    182182                    tooltiptext="&vI_prefDialog.smartReply.tooltiptext;" prefstring="smart_reply"
    183                     oncommand="vI_prefDialog.base.smartReplyConstraint(this);" />
     183                    oncommand="virtualIdentityExtension.prefDialogbase.smartReplyConstraint(this);" />
    184184                <hbox><spacer class="widthS"/>
    185185                    <vbox>
     
    201201                    <vbox><description class="widthX">&vI_prefDialog.smartReply.headers.desc;</description>
    202202                    <spacer flex="1"/>
    203                     <button id="VIdent_identity.smart_reply_headers_reset" label="&vI_prefDialog.smartReply.headers.reset;" oncommand="vI_prefDialog.base.smartReplyHeaderReset();"/>
     203                    <button id="VIdent_identity.smart_reply_headers_reset" label="&vI_prefDialog.smartReply.headers.reset;" oncommand="virtualIdentityExtension.prefDialogbase.smartReplyHeaderReset();"/>
    204204                    </vbox>
    205205                    <textbox id="VIdent_identity.smart_reply_headers" multiline="true"
     
    246246    <tabpanel orient="vertical" >
    247247        <hbox flex="1">
    248         <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; vI_prefDialog.updateHelpUrl();"
     248        <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; virtualIdentityExtension.prefDialog.updateHelpUrl();"
    249249            hidecolumnpicker="true" hidehscroll="true">
    250250        <treecols orient="vertical"><treecol flex="1" hideheader="true" primary="true" /></treecols>
     
    300300                    <checkbox id="VIdent_identity.idSelection_ask" label="&vI_prefDialog.idSelection.ask.label;"
    301301                        prefstring="idSelection_ask"
    302                         oncommand="vI_prefDialog.base.idSelectionResultConstraint();"/>
     302                        oncommand="virtualIdentityExtension.prefDialogbase.idSelectionResultConstraint();"/>
    303303                    <hbox><spacer class="widthS"/><checkbox id="VIdent_identity.idSelection_ask_always" label="&vI_prefDialog.idSelection.ask_always.label;"
    304304                        prefstring="idSelection_ask_always"
    305                         oncommand="vI_prefDialog.base.idSelectionResultConstraint();"/>
     305                        oncommand="virtualIdentityExtension.prefDialogbase.idSelectionResultConstraint();"/>
    306306                    </hbox>
    307307                    <checkbox id="VIdent_identity.idSelection_autocreate" label="&vI_prefDialog.idSelection.autocreate.label;"
    308308                        prefstring="idSelection_autocreate"
    309                         oncommand="vI_prefDialog.base.idSelectionResultConstraint();"/>
     309                        oncommand="virtualIdentityExtension.prefDialogbase.idSelectionResultConstraint();"/>
    310310
    311311                    <hbox><spacer class="widthS"/><label value="&vI_prefDialog.idSelection.autocreate.desc;" hidden="true"
     
    325325    <tabpanel orient="vertical" >
    326326        <hbox flex="1">
    327         <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; vI_prefDialog.updateHelpUrl();"
     327        <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; virtualIdentityExtension.prefDialog.updateHelpUrl();"
    328328            hidecolumnpicker="true" hidehscroll="true">
    329329        <treecols orient="vertical"><treecol flex="1" hideheader="true" primary="true" /></treecols>
     
    344344                <caption label="&vI_prefDialog.composeDialog.caption;"/>
    345345                    <checkbox id="VIdent_identity.autoTimestamp" label="&vI_prefDialog.composeDialog.autoTimestamp.label;"
    346                         tooltiptext="&vI_prefDialog.composeDialog.autoTimestamp.tooltiptext;" prefstring="autoTimestamp" oncommand="vI_prefDialog.base.autoTimestampConstraint(this);"/>
     346                        tooltiptext="&vI_prefDialog.composeDialog.autoTimestamp.tooltiptext;" prefstring="autoTimestamp" oncommand="virtualIdentityExtension.prefDialogbase.autoTimestampConstraint(this);"/>
    347347                    <hbox id="VIdent_identity.autoTimestamp.options" hidden="true"><spacer class="widthS"/>
    348348                        <vbox>
     
    396396    <tabpanel orient="vertical" >
    397397        <hbox flex="1">
    398         <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; vI_prefDialog.updateHelpUrl();"
     398        <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; virtualIdentityExtension.prefDialog.updateHelpUrl();"
    399399            hidecolumnpicker="true" hidehscroll="true" >
    400400        <treecols orient="vertical"><treecol flex="1" hideheader="true" primary="true"/></treecols>
     
    563563    <tabpanel orient="vertical" >
    564564        <hbox flex="1">
    565         <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; vI_prefDialog.updateHelpUrl();"
     565        <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; virtualIdentityExtension.prefDialog.updateHelpUrl();"
    566566            hidecolumnpicker="true" hidehscroll="true">
    567567        <treecols orient="vertical">
     
    592592                <checkbox id="VIdent_identity.storage" label="&vI_prefDialog.storage.label;"
    593593                    tooltiptext="&vI_prefDialog.storage.tooltiptext;" prefstring="storage"
    594                     oncommand="vI_prefDialog.base.storageConstraint(this);" />
     594                    oncommand="virtualIdentityExtension.prefDialogbase.storageConstraint(this);" />
    595595                <spacer class="paragraph"/>
    596596                <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 vI_rdfDatasourceImporter('virtualIdentity.rdf');" />
    598                 <button id="VIdent_identity.storage.export" label="&vI_prefDialog.storage.export;" oncommand="var vI_localRdfDatasource = new vI_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')" />
    599599                </groupbox>
    600600            </tabpanel>
     
    677677    <tabpanel orient="vertical" >
    678678        <hbox flex="1">
    679         <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; vI_prefDialog.updateHelpUrl();"
     679        <tree class="vIprefTree" seltype="single" onselect="this.nextSibling.selectedIndex = this.currentIndex; virtualIdentityExtension.prefDialog.updateHelpUrl();"
    680680            hidecolumnpicker="true" hidehscroll="true">
    681681        <treecols orient="vertical">
  • chrome/content/v_identity/vI_prefDialog_FolderPicker.js

    r92fd25 rc3feaa  
    4343 * ***** END LICENSE BLOCK ***** */
    4444
     45virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     46
    4547var gFccRadioElemChoice, gDraftsRadioElemChoice, gTmplRadioElemChoice;
    4648var gFccRadioElemChoiceLocked, gDraftsRadioElemChoiceLocked, gTmplRadioElemChoiceLocked;
     
    156158    // For POP3 accounts, special folders are created at the account creation time.
    157159    var msgFolder = GetMsgFolderFromUri(uri, false);
    158     InitFolderDisplays(msgFolder, accountPickerId, folderPickerId)
     160    vI.InitFolderDisplays(msgFolder, accountPickerId, folderPickerId)
    159161
    160162    switch (pickerMode)
     
    210212function onSaveCopiesAndFolders()
    211213{
    212     SaveFolderSettings( gFccRadioElemChoice,
     214    vI.SaveFolderSettings( gFccRadioElemChoice,
    213215                        "doFcc",
    214216                        gFccFolderWithDelim,
     
    218220                        "VIdent_identity.fccFolderPickerMode" );
    219221
    220     SaveFolderSettings( gDraftsRadioElemChoice,
     222    vI.SaveFolderSettings( gDraftsRadioElemChoice,
    221223                        "messageDrafts",
    222224                        gDraftsFolderWithDelim,
     
    226228                        "VIdent_identity.draftFolderPickerMode" );
    227229
    228     SaveFolderSettings( gTmplRadioElemChoice,
     230    vI.SaveFolderSettings( gTmplRadioElemChoice,
    229231                        "messageTemplates",
    230232                        gTemplatesFolderWithDelim,
     
    337339    activeRadioElem.radioGroup.selectedItem = activeRadioElem;
    338340}
     341vI.onInitCopiesAndFolders = onInitCopiesAndFolders;
     342vI.onSaveCopiesAndFolders = onSaveCopiesAndFolders;
     343}});
  • chrome/content/v_identity/vI_prefDialog_TB3.xul

    r92fd25 rc3feaa  
    2424   - ***** END LICENSE BLOCK ***** -->
    2525
     26<?xul-overlay href="chrome://v_identity/content/vI_prefDialog_TB3FolderPicker.xul"?>
    2627<?xul-overlay href="chrome://v_identity/content/vI_prefDialog.xul"?>
    27 <?xul-overlay href="chrome://v_identity/content/vI_prefDialog_TB3FolderPicker.xul"?>
    2828
    2929<!DOCTYPE overlay SYSTEM "chrome://v_identity/locale/vI_prefDialog.dtd">
     
    3131<dialog id="vI_prefDialog"
    3232    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    33         onload="vI_prefDialog.init();"
     33        onload="virtualIdentityExtension.prefDialog.init();"
    3434        buttons="accept,cancel,help"
    35         ondialogaccept="vI_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;"
    3838        persist="screenX screenY"
    3939            title="&vI_prefDialog.dlgTitle.label;" >
    4040       
     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" />
    4144        <script type="application/x-javascript"
    4245            src="chrome://v_identity/content/vI_prefDialog.js" />
    43         <script type="application/x-javascript"
    44             src="chrome://v_identity/content/vI_prefDialog_FolderPicker.js" />
    4546        <script type="application/x-javascript"
    4647            src="chrome://v_identity/content/vI_helper.js" />
  • chrome/content/v_identity/vI_prefDialog_TB3FolderPicker.js

    r92fd25 rc3feaa  
    4242 *
    4343 * ***** END LICENSE BLOCK ***** */
     44
     45virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
    4446
    4547function InitFolderDisplays(msgFolder, accountPickerId, folderPickerId) {
     
    123125    formElement.setAttribute("value", radioElemChoice);
    124126}
     127vI.InitFolderDisplays = InitFolderDisplays;
     128vI.SaveFolderSettings = SaveFolderSettings;
     129}});
  • chrome/content/v_identity/vI_rdfAccountMismatchDialog.js

    r92fd25 rc3feaa  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
    25 var vI_rdfAccountMismatchDialog = {
     25virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     26var rdfAccountMismatchDialog = {
    2627    mismatchItems : null,
    2728    type : null,
    2829
    2930    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];
    3233       
    3334        // 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");
    3637       
    37         for (var i = 0; i < vI_rdfAccountMismatchDialog.mismatchItems.length; i++) {
     38        for (var i = 0; i < rdfAccountMismatchDialog.mismatchItems.length; i++) {
    3839//             var label = document.createElement("label");
    3940            var listitem = document.createElement("listitem");
    4041            listitem.setAttribute("id", "mismatchLine_" + i);
    4142            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);
    4849            document.getElementById("rdfAccountMismatchDialog_listbox").appendChild(listitem)
    4950        }
     
    5152
    5253    accept : function() {
    53         for (var i = 0; i < vI_rdfAccountMismatchDialog.mismatchItems.length; i++) {
    54             vI_rdfAccountMismatchDialog.mismatchItems[i].key = document.getElementById("mismatchLine_" + i).key
     54        for (var i = 0; i < rdfAccountMismatchDialog.mismatchItems.length; i++) {
     55            rdfAccountMismatchDialog.mismatchItems[i].key = document.getElementById("mismatchLine_" + i).key
    5556        }
    5657        /* 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);
    5859    }
    5960}
    60 window.addEventListener("load", vI_rdfAccountMismatchDialog.init, false);
     61window.addEventListener("load", rdfAccountMismatchDialog.init, false);
     62}});
  • chrome/content/v_identity/vI_rdfAccountMismatchDialog.xml

    r92fd25 rc3feaa  
    155155    <method name="_addIdentities">
    156156        <body><![CDATA[
    157         vI_notificationBar.dump("## mismatchID-menupopup: _addIdentities.\n");
     157        virtualIdentityExtension.notificationBar.dump("## mismatchID-menupopup: _addIdentities.\n");
    158158        var AccountManager = Components.classes["@mozilla.org/messenger/account-manager;1"]
    159159            .getService(Components.interfaces.nsIMsgAccountManager);
     
    171171                this.appendChild(menuitem);
    172172            }
    173         }       
    174         ]]></body>
     173        }
     174        ]]></body>
    175175    </method>
    176176    <method name="_addSmtp">
    177177        <parameter name="server" />
    178178        <body><![CDATA[
    179             vI_notificationBar.dump("## mismatchID-menupopup: _addSmtp.\n");
     179            virtualIdentityExtension.notificationBar.dump("## mismatchID-menupopup: _addSmtp.\n");
    180180            const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
    181181            var menuitem = document.createElementNS(XUL_NS, "menuitem"); // create a new XUL menuitem
     
    185185            menuitem.setAttribute("ext2",  server.username);
    186186            menuitem.setAttribute("key",  server.key);
    187             this.appendChild(menuitem);       
     187            this.appendChild(menuitem);
    188188        ]]></body>
    189189    </method>
    190190    <method name="_addSmtpServers">
    191191        <body><![CDATA[
    192             vI_notificationBar.dump("## mismatchID-menupopup: _addSmtpServers.\n");
     192            virtualIdentityExtension.notificationBar.dump("## mismatchID-menupopup: _addSmtpServers.\n");
    193193           
    194194            const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
    195195            var menuitem = document.createElementNS(XUL_NS, "menuitem"); // create a new XUL menuitem
    196196            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);
    199198            menuitem.setAttribute("label", document.getElementById("bundle_messenger").getString("defaultServerTag"));
    200199            this.appendChild(menuitem);
     
    206205                if (server instanceof Components.interfaces.nsISmtpServer && !server.redirectorType) this._addSmtp(server);
    207206            }
    208         ]]></body>
     207        ]]></body>
    209208    </method>
    210209    <constructor>
    211210        <![CDATA[       
    212         vI_notificationBar.dump("## mismatchID-menupopup: constructor.\n");
     211        virtualIdentityExtension.notificationBar.dump("## mismatchID-menupopup: constructor.\n");
    213212        const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
    214213        this.appendChild(document.createElementNS(XUL_NS, "menuseparator")); // create a new XUL menuseparator
    215214        if (this.getAttribute("type") == "identity") this._addIdentities();
    216215        else    this._addSmtpServers();
    217         ]]>
     216        ]]>
    218217    </constructor>
    219218    </implementation>
  • chrome/content/v_identity/vI_rdfAccountMismatchDialog.xul

    r92fd25 rc3feaa  
    3232    buttons="accept"
    3333    title="&vident.vI_rdfAccountMismatchDialog.title;"
    34     ondialogaccept="vI_rdfAccountMismatchDialog.accept();"
    35     ondialogcancel="vI_rdfAccountMismatchDialog.accept();"
     34    ondialogaccept="virtualIdentityExtension.rdfAccountMismatchDialog.accept();"
     35    ondialogcancel="virtualIdentityExtension.rdfAccountMismatchDialog.accept();"
    3636    zlevel="6">
     37    <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" />
    3738    <script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/>
    3839    <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfAccountMismatchDialog.js" />
  • chrome/content/v_identity/vI_rdfDataEditor.js

    r92fd25 rc3feaa  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
    25 var vI_rdfDataEditor = {
     25virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     26var rdfDataEditor = {
    2627    __rdfDatasource : null,
    2728    __rdfDataTree : null,
     
    4445    init : function() {
    4546        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];
    5051        ;
    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);
    5354
    5455       
    5556        // set recipient
    56         document.getElementById("recipient").value = vI_rdfDataEditor.__recipient;
     57        document.getElementById("recipient").value = rdfDataEditor.__recipient;
    5758       
    5859        // set type of entry (and populate Menu)
    5960        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")) {
    6162            var menuitem = document.createElement("menuitem");
    6263            var label = document.getElementById("vI_rdfDataTreeBundle").getString("vI_rdfDataTree.dataType." + typeField)
     
    6465            menuitem.setAttribute("key", typeField);
    6566            typeMenuPopup.appendChild(menuitem);
    66             if (typeField == vI_rdfDataEditor.__type) document.getElementById("type_menu").selectedItem = menuitem
     67            if (typeField == rdfDataEditor.__type) document.getElementById("type_menu").selectedItem = menuitem
    6768        }
    6869       
    6970        // set sender
    70         document.getElementById("sender").value = vI_rdfDataEditor.__identityData.combinedName;
     71        document.getElementById("sender").value = rdfDataEditor.__identityData.combinedName;
    7172
    7273        // set Identity
    73         vI_rdfDataEditor.__populateIdentityMenu();
     74        rdfDataEditor.__populateIdentityMenu();
    7475        var MenuItems = document.getElementById("identity_list_popup").childNodes;
    7576        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) {
    7778                document.getElementById("identity_list").selectedItem =
    7879                        MenuItems[index];
     
    8384        // set SMTP
    8485        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;
    8687       
    8788        // set extra values
    88         vI_rdfDataEditor.__identityData.extras.setEditorValues();
    89         vI_storageExtrasHelper.hideUnusedEditorFields();
     89        rdfDataEditor.__identityData.extras.setEditorValues();
     90        vI.storageExtrasHelper.hideUnusedEditorFields();
    9091    },
    9192   
    9293    blurEvent : function(elementId) {
    9394        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);
    9596        elem.value = localIdentityData.combinedName;                   
    9697    },
    9798   
    9899    accept : function() {
    99         var localIdentityData = new vI_identityData(document.getElementById("sender").value, null,
     100        var localIdentityData = new vI.identityData(document.getElementById("sender").value, null,
    100101            document.getElementById("identity_list").selectedItem.getAttribute("value"),
    101102            document.getElementById("smtp_server_list").selectedItem.getAttribute("key"));
    102103        localIdentityData.extras.readEditorValues();
    103104
    104         vI_rdfDataEditor.__rdfDatasource.updateRDF(
     105        rdfDataEditor.__rdfDatasource.updateRDF(
    105106                document.getElementById("recipient").value,
    106107                document.getElementById("type_menu").selectedItem.getAttribute("key"),
    107108                localIdentityData,
    108                 true, true, vI_rdfDataEditor.__recipient, vI_rdfDataEditor.__type);
     109                true, true, rdfDataEditor.__recipient, rdfDataEditor.__type);
    109110       
    110111        return document.getElementById("type_menu").selectedItem.getAttribute("key");
    111112    }
    112113}
     114vI.rdfDataEditor = rdfDataEditor;
     115}});
  • chrome/content/v_identity/vI_rdfDataEditor.xul

    r92fd25 rc3feaa  
    3232<dialog id="vI_rdfDataEditor"
    3333    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    34     onload="vI_rdfDataEditor.init();"
    35     ondialogaccept="window.arguments[3].treeType = vI_rdfDataEditor.accept();"
     34    onload="virtualIdentityExtension.rdfDataEditor.init();"
     35    ondialogaccept="window.arguments[3].treeType = virtualIdentityExtension.rdfDataEditor.accept();"
    3636    title="&vI_rdfDataEditor.dlgTitle.label;" >
    3737
     38<script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" />
    3839<script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDataEditor.js" />
    3940<script type="application/x-javascript" src="chrome://v_identity/content/vI_identityData.js" />
     
    6869                <label value="&vI_rdfDataEditor.sender.label;" accesskey="&vI_rdfDataEditor.sender.accesskey;" control="sender"/>
    6970            <spacer flex="1"/></vbox>
    70             <textbox id="sender" flex="1"  onblur="vI_rdfDataEditor.blurEvent('sender')" />
     71            <textbox id="sender" flex="1"  onblur="virtualIdentityExtension.rdfDataEditor.blurEvent('sender')" />
    7172        </hbox>
    7273        <hbox>
  • chrome/content/v_identity/vI_rdfDataTree.js

    r92fd25 rc3feaa  
    2929*/
    3030
    31 
     31virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
    3232//prepares an object for easy comparison against another. for strings, lowercases them
    3333function prepareForComparison (o) {
     
    3838
    3939
    40 function rdfDataTree(treeType, vI_rdfDatasource) {
     40function rdfDataTree(treeType, rdfDatasource) {
    4141    this.treeType = treeType;
    42     this._vI_rdfDatasource = vI_rdfDatasource;
     42    this._rdfDatasource = rdfDatasource;
    4343    this.filterText = "";
    4444    this.loadTable();
    45 }
     45};
     46
    4647rdfDataTree.prototype = {
    4748    idTable : null,
     
    4950    filterText : null,
    5051    treeType : null,
    51     _vI_rdfDatasource : null,
     52    _rdfDatasource : null,
    5253
    5354    get treeElem() { return document.getElementById("rdfDataTree_" + this.treeType); },
     
    5657    //this function is called every time the tree is sorted, filtered, or reloaded
    5758    loadTable : function() {
    58 //         if (vI_notificationBar) vI_notificationBar.dump("## rdfDataTree: loadTable.\n");
     59//         if (vI.notificationBar) vI.notificationBar.dump("## rdfDataTree: loadTable.\n");
    5960        //remember scroll position. this is useful if this is an editable table
    6061        //to prevent the user from losing the row they edited
     
    6364        if (this.idData == null) {
    6465            this.idData = [];
    65             this._vI_rdfDatasource.readAllEntriesFromRDF(this.addNewDatum, this.treeType, this.idData);
     66            this._rdfDatasource.readAllEntriesFromRDF(this.addNewDatum, this.treeType, this.idData);
    6667        }
    6768        if (this.filterText == "") {
     
    9293        // set Tab label
    9394        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");
    9596    },
    9697
     
    105106                resource : resource,
    106107                identityData : localIdentityData}
    107 //      vI_notificationBar.dump("## addNewDatum.\n");
     108//      vI.notificationBar.dump("## addNewDatum.\n");
    108109        localIdentityData.extras.addPrefs(pref);
    109110        idData.push(pref);
    110111    },
    111112    sort : function(columnName) {
    112 //      vI_notificationBar.dump("## sort: " + columnName + ".\n");
     113//      vI.notificationBar.dump("## sort: " + columnName + ".\n");
    113114        var order = this.treeElem.getAttribute("sortDirection") == "ascending" ? 1 : -1;
    114115        //if the column is passed and it's already sorted by that column, reverse sort
     
    130131        this.treeElem.setAttribute("sortResource", columnName);
    131132       
    132         this.treeElem.view = new vI_rdfDataTree.treeView(this.idTable);
     133        this.treeElem.view = new rdfDataTreeCollection.treeView(this.idTable);
    133134       
    134135        //set the appropriate attributes to show to indicator
     
    140141        }
    141142    }
    142 }
    143 
    144 var vI_rdfDataTree = {
     143};
     144
     145var rdfDataTreeCollection = {
    145146    promptService : Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
    146147            .getService(Components.interfaces.nsIPromptService),
     
    152153   
    153154    _strings : null,
    154     _vI_rdfDatasource : null,
     155    _rdfDatasource : null,
    155156   
    156157    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();
    161162        }
    162163    },
    163164   
    164165    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")
    170171        if (tree.treeElem.view.selection.count != 1)
    171             { vI_rdfDataTree.hideInfoBox(); return; }
     172            { rdfDataTreeCollection.hideInfoBox(); return; }
    172173       
    173174        var identityData = tree.idTable[tree.treeElem.currentIndex]["identityData"];
     
    185186
    186187        htmlBox.outputString = _identityInfo;
    187         vI_rdfDataTree.infoBoxHidden = false;
     188        rdfDataTreeCollection.infoBoxHidden = false;
    188189        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  :)
    190191    },
    191192
    192193    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);
    200201    },
    201202   
    202203    clean : function() {
    203         if (vI_rdfDataTree._vI_rdfDatasource) vI_rdfDataTree._vI_rdfDatasource.clean();
     204        if (rdfDataTreeCollection._rdfDatasource) rdfDataTreeCollection._rdfDatasource.clean();
    204205    },
    205206
     
    219220        this.getCellText = function(row, col) {
    220221            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"))
    222223                return ""; // image will be used as indicator
    223224            else return retValue;
     
    241242        this.getColumnProperties = function(colid,col,props){};
    242243        this.cycleHeader = function(col, elem) {
    243             var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
     244            var treeType = rdfDataTreeCollection.tabbox.selectedPanel.id;
    244245            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("_")));
    246247        };
    247248        this.getCellProperties = function(row,col,props){
    248             if (vI_rdfDataTree._braille) return;
     249            if (rdfDataTreeCollection._braille) return;
    249250            var aserv=Components.classes["@mozilla.org/atom-service;1"].
    250251                getService(Components.interfaces.nsIAtomService);
     
    259260    __setFilter : function (text) {
    260261        // 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];
    263264            tree.filterText = text;
    264265            tree.loadTable();
     
    269270        //do this now rather than doing it at every comparison
    270271        var value = prepareForComparison(event.target.value);
    271         vI_rdfDataTree.__setFilter(value);
     272        rdfDataTreeCollection.__setFilter(value);
    272273        document.getElementById("clearFilter").disabled = value.length == 0;
    273274    },
     
    278279        filterElement.focus();
    279280        filterElement.value = "";
    280         vI_rdfDataTree.__setFilter("");
     281        rdfDataTreeCollection.__setFilter("");
    281282    },
    282283   
    283284    __updateMenu : function(modifySelected, removeSelected) {
    284         var tree = vI_rdfDataTree.trees[vI_rdfDataTree.tabbox.selectedPanel.id];
     285        var tree = rdfDataTreeCollection.trees[rdfDataTreeCollection.tabbox.selectedPanel.id];
    285286        var noSelections = (tree.treeElem.view.selection.count == 0)
    286287        modifySelected.setAttribute("disabled", noSelections)
     
    289290   
    290291    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))
    294295    },
    295296   
    296297    updateContextMenu : function() {
    297         vI_rdfDataTree.__updateMenu(
     298        rdfDataTreeCollection.__updateMenu(
    298299            document.getElementById("context_modifySelected"),
    299300            document.getElementById("context_removeSelected"))
     
    301302   
    302303    updateMenu : function() {
    303         vI_rdfDataTree.__updateMenu(
     304        rdfDataTreeCollection.__updateMenu(
    304305            document.getElementById("menu_modifySelected"),
    305306            document.getElementById("menu_removeSelected"))
     
    307308
    308309    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];
    311312        if (tree.treeElem.view.selection.count == 0) return;
    312313        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") + " " +
    314315                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;
    317318        }
    318319       
     
    327328                    "chrome, dialog, modal, alwaysRaised, resizable=yes",
    328329                    tree.idTable[v], treeType,
    329                     vI_rdfDataTree._vI_rdfDatasource, retVar).focus();
     330                    rdfDataTreeCollection._rdfDatasource, retVar).focus();
    330331        }
    331332       
    332333        // 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();
    340341    },
    341342   
    342343    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];
    345346        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") + " " +
    347348            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;
    351352       
    352353        var start = new Object(); var end = new Object();
     
    356357            tree.treeElem.view.selection.getRangeAt(t,start,end);
    357358            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)
    359360            }
    360361        }
     
    362363        tree.idData = null; tree.idTable = null;
    363364        tree.loadTable();
    364         vI_rdfDataTree.hideInfoBox();
     365        rdfDataTreeCollection.hideInfoBox();
    365366    },
    366367   
    367368    moveConstraints : function() {
    368         var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
     369        var treeType = rdfDataTreeCollection.tabbox.selectedPanel.id;
    369370        if (treeType != "filter") return;
    370         var tree = vI_rdfDataTree.trees[treeType];
     371        var tree = rdfDataTreeCollection.trees[treeType];
    371372        if (tree.treeElem.view.selection.count == 0) {
    372373            document.getElementById("reorderUpButton_filter").setAttribute("disabled","true");
     
    391392
    392393    moveUpSelected : function() {
    393         var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
     394        var treeType = rdfDataTreeCollection.tabbox.selectedPanel.id;
    394395        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];
    396397        if (tree.treeElem.view.selection.count == 0) return; // just to be safe, button should be disabled
    397398
     
    402403        tree.treeElem.view.selection.getRangeAt(0,start,end);
    403404        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);
    406407        }
    407408        tree.idData = null; tree.idTable = null;
     
    411412
    412413    moveDownSelected : function() {
    413         var treeType = vI_rdfDataTree.tabbox.selectedPanel.id;
     414        var treeType = rdfDataTreeCollection.tabbox.selectedPanel.id;
    414415        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];
    416417        if (tree.treeElem.view.selection.count == 0) return; // just to be safe, button should be disabled
    417418
     
    422423        tree.treeElem.view.selection.getRangeAt(0,start,end);
    423424        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);
    426427        }
    427428        tree.idData = null; tree.idTable = null;
     
    432433    infoBoxHidden : true,
    433434    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")
    436437        htmlBox.setAttribute("style", "height:" + htmlBox.contentDocument.lastChild.scrollHeight +"px");
    437438    },
    438439
    439440    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) { }
    445446        }
    446447    },
    447448
    448449    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];
    451452        tree.treeElem.view.selection.selectAll();
    452453    },
    453454   
    454455    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) };
    458458        var retVar = { treeType: null };
    459459
     
    461461            "chrome, dialog, modal, alwaysRaised, resizable=yes",
    462462            newItemPreset, treeType,
    463             vI_rdfDataTree._vI_rdfDatasource, retVar).focus();
     463            rdfDataTreeCollection._rdfDatasource, retVar).focus();
    464464
    465465        // 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();
    473473    }
    474474};
     475dump("registering global rdfDataTreeCollection\n");
     476vI.rdfDataTreeCollection = rdfDataTreeCollection;
     477vI.rdfDataTree = rdfDataTree;
     478dump("registering global rdfDataTreeCollection done " + vI.initTime + " " + vI.rdfDataTreeCollection + "\n");
     479}});
  • chrome/content/v_identity/vI_rdfDataTree.xul

    r92fd25 rc3feaa  
    5757        height="500"
    5858        persist="width,height,screenX,screenY"
    59         onload="vI_rdfDataTree.init();"
    60         onunload="vI_rdfDataTree.clean();"
     59        onload="virtualIdentityExtension.rdfDataTreeCollection.init();"
     60        onunload="virtualIdentityExtension.rdfDataTreeCollection.clean();"
    6161        title="&vI_rdfDataTree.dlgTitle.label;">
    6262
     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" />
    6368<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"/>
    6869<script type="application/x-javascript" src="chrome://messenger/content/messengercompose/MsgComposeCommands.js"/>
    6970
     
    8283</menupopup>
    8384
    84 <menupopup id="configContext" onpopupshowing="if (event.target == this) vI_rdfDataTree.updateContextMenu();">
     85<menupopup id="configContext" onpopupshowing="if (event.target == this) virtualIdentityExtension.rdfDataTreeCollection.updateContextMenu();">
    8586    <menuitem id="context_modifySelected" label="&vI_rdfDataTree.modifySelected.label;"
    86         oncommand="vI_rdfDataTree.modifySelected(this);"/>
     87        oncommand="virtualIdentityExtension.rdfDataTreeCollection.modifySelected(this);"/>
    8788    <menuitem id="context_removeSelected" label="&vI_rdfDataTree.removeSelected.label;"
    88         oncommand="vI_rdfDataTree.removeSelected();"/>
     89        oncommand="virtualIdentityExtension.rdfDataTreeCollection.removeSelected();"/>
    8990    <menuitem id="context_newItem" label="&vI_rdfDataTree.newItem.label;"
    90         oncommand="vI_rdfDataTree.newItem();"/>
     91        oncommand="virtualIdentityExtension.rdfDataTreeCollection.newItem();"/>
    9192    <menuseparator />
    9293    <menuitem id="context_menu_selectAll" label="&selectAllCmd.label;"
    93         oncommand="vI_rdfDataTree.selectAll();"/>
     94        oncommand="virtualIdentityExtension.rdfDataTreeCollection.selectAll();"/>
    9495</menupopup>
    9596
    9697<keyset>
    97     <key keycode="VK_ENTER" oncommand="vI_rdfDataTree.modifySelected();"/>
    98     <key keycode="VK_RETURN" oncommand="vI_rdfDataTree.modifySelected();"/>
    99     <key keycode="VK_DELETE" oncommand="vI_rdfDataTree.removeSelected();"/>
    100     <key modifiers="accel" key="&selectAllCmd.accesskey;" oncommand="vI_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();"/>
    101102</keyset>
    102103
     
    108109        <menu id="editMenu" label="&vI_rdfDataTree.editMenu.label;"
    109110            accesskey="&vI_rdfDataTree.editMenu.accesskey;">
    110         <menupopup onpopupshowing="if (event.target == this) vI_rdfDataTree.updateMenu();">
     111        <menupopup onpopupshowing="if (event.target == this) virtualIdentityExtension.rdfDataTreeCollection.updateMenu();">
    111112            <menuitem id="menu_modifySelected" label="&vI_rdfDataTree.modifySelected.label;"
    112113                accesskey="&vI_rdfDataTree.modifySelected.accesskey;"
    113                 oncommand="vI_rdfDataTree.modifySelected();"/>
     114                oncommand="virtualIdentityExtension.rdfDataTreeCollection.modifySelected();"/>
    114115            <menuitem id="menu_removeSelected" label="&vI_rdfDataTree.removeSelected.label;"
    115116                accesskey="&vI_rdfDataTree.removeSelected.accesskey;"
    116                 oncommand="vI_rdfDataTree.removeSelected();"/>
     117                oncommand="virtualIdentityExtension.rdfDataTreeCollection.removeSelected();"/>
    117118            <menuitem id="menu_newItem" label="&vI_rdfDataTree.newItem.label;"
    118119                accesskey="&vI_rdfDataTree.newItem.accesskey;"
    119                 oncommand="vI_rdfDataTree.newItem();"/>
     120                oncommand="virtualIdentityExtension.rdfDataTreeCollection.newItem();"/>
    120121            <menuseparator />
    121122            <menuitem id="menu_menu_selectAll" label="&selectAllCmd.label;" accesskey="&selectAllCmd.accesskey;"
    122                 oncommand="vI_rdfDataTree.selectAll();"/>
     123                oncommand="virtualIdentityExtension.rdfDataTreeCollection.selectAll();"/>
    123124        </menupopup>
    124125        </menu>
    125126        <menu id="tasksMenu" label="&tasksMenu.label;" accesskey="&tasksMenu.accesskey;">
    126127        <menupopup>
    127             <menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="var vI_localRdfDatasource = new vI_rdfDatasourceImporter('virtualIdentity.rdf');"/>
    128             <menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand="var vI_localRdfDatasource = new vI_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')"/>
    129130        </menupopup>
    130131        </menu>
     
    133134    <spacer width="20px" />
    134135    <label value="&vI_rdfDataTree.filterPrefs.label;" accesskey="&vI_rdfDataTree.filterPrefs.accesskey;" control="filter"/>
    135     <textbox id="filter" flex="1" oninput="vI_rdfDataTree.inputFilter(event);"/>
    136     <button id="clearFilter" label="&vI_rdfDataTree.showAll.label;" accesskey="&vI_rdfDataTree.showAll.accesskey;" oncommand="vI_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"/>
    137138</hbox>
    138139
    139140<tabbox id="TreeTabbox" flex="1">
    140 <tabs onselect="vI_rdfDataTree.onTabSelect();" >
     141<tabs onselect="virtualIdentityExtension.rdfDataTreeCollection.onTabSelect();" >
    141142<tab id="emailTab" />
    142143<tab id="maillistTab" />
     
    149150<tree id="rdfDataTree_email" flex="1" class="plain" seltype="multiple"
    150151    persist="sortDirection sortResource" sortDirection="ascending" sortResource="recipientCol"
    151     enableColumnDrag="true" context="configContext" onselect="vI_rdfDataTree.onselect(this);">
     152    enableColumnDrag="true" context="configContext" onselect="virtualIdentityExtension.rdfDataTreeCollection.onselect(this);">
    152153    <treecols id="rdfDataTreeCols_email">
    153154        <treecol id="recipientCol_email" label="&vI_rdfDataTree.recipientColumn.label;" flex="10"
     
    168169            persist="hidden width ordinal sortDirection"/>     
    169170    </treecols>
    170     <treechildren id="configTreeBody_email" ondblclick="if (event.button == 0) vI_rdfDataTree.modifySelected();" />
     171    <treechildren id="configTreeBody_email" ondblclick="if (event.button == 0) virtualIdentityExtension.rdfDataTreeCollection.modifySelected();" />
    171172</tree>
    172173<vbox>
    173174          <button id="newButton_email" label="&newButton.label;" accesskey="&newButton.accesskey;"
    174                   oncommand="vI_rdfDataTree.newItem();"/>
     175                  oncommand="virtualIdentityExtension.rdfDataTreeCollection.newItem();"/>
    175176          <button id="editButton_email" label="&editButton.label;" accesskey="&editButton.accesskey;"
    176                   oncommand="vI_rdfDataTree.modifySelected();" disabled="true"/>
     177                  oncommand="virtualIdentityExtension.rdfDataTreeCollection.modifySelected();" disabled="true"/>
    177178          <button id="deleteButton_email" label="&deleteButton.label;" accesskey="&deleteButton.accesskey;"
    178                   oncommand="vI_rdfDataTree.removeSelected();" disabled="true"/>
     179                  oncommand="virtualIdentityExtension.rdfDataTreeCollection.removeSelected();" disabled="true"/>
    179180          <spacer flex="1"/>
    180181</vbox>
     
    186187<tree id="rdfDataTree_maillist" flex="1" class="plain" seltype="multiple"
    187188    persist="sortDirection sortResource" sortDirection="ascending" sortResource="recipientCol"
    188     enableColumnDrag="true" context="configContext" onselect="vI_rdfDataTree.onselect();">
     189    enableColumnDrag="true" context="configContext" onselect="virtualIdentityExtension.rdfDataTreeCollection.onselect();">
    189190    <treecols id="rdfDataTreeCols_maillist">
    190191        <treecol id="recipientCol_maillist" label="&vI_rdfDataTree.recipientColumn.label;" flex="10"
     
    205206            persist="hidden width ordinal sortDirection"/>     
    206207    </treecols>
    207     <treechildren id="configTreeBody_maillist" ondblclick="if (event.button == 0) vI_rdfDataTree.modifySelected();" />
     208    <treechildren id="configTreeBody_maillist" ondblclick="if (event.button == 0) virtualIdentityExtension.rdfDataTreeCollection.modifySelected();" />
    208209</tree>
    209210<vbox>
    210211          <button id="newButton_maillist" label="&newButton.label;" accesskey="&newButton.accesskey;"
    211                   oncommand="vI_rdfDataTree.newItem();"/>
     212                  oncommand="virtualIdentityExtension.rdfDataTreeCollection.newItem();"/>
    212213          <button id="editButton_maillist" label="&editButton.label;" accesskey="&editButton.accesskey;"
    213                   oncommand="vI_rdfDataTree.modifySelected();" disabled="true"/>
     214                  oncommand="virtualIdentityExtension.rdfDataTreeCollection.modifySelected();" disabled="true"/>
    214215          <button id="deleteButton_maillist" label="&deleteButton.label;" accesskey="&deleteButton.accesskey;"
    215                   oncommand="vI_rdfDataTree.removeSelected();" disabled="true"/>
     216                  oncommand="virtualIdentityExtension.rdfDataTreeCollection.removeSelected();" disabled="true"/>
    216217          <spacer flex="1"/>
    217218</vbox>
     
    222223<tree id="rdfDataTree_newsgroup" flex="1" class="plain" seltype="multiple"
    223224    persist="sortDirection sortResource" sortDirection="ascending" sortResource="recipientCol"
    224     enableColumnDrag="true" context="configContext" onselect="vI_rdfDataTree.onselect();">
     225    enableColumnDrag="true" context="configContext" onselect="virtualIdentityExtension.rdfDataTreeCollection.onselect();">
    225226    <treecols id="rdfDataTreeCols_newsgroup">
    226227        <treecol id="recipientCol_newsgroup" label="&vI_rdfDataTree.recipientColumn.label;" flex="10"
     
    241242            persist="hidden width ordinal sortDirection"/>     
    242243    </treecols>
    243     <treechildren id="configTreeBody_newsgroup" ondblclick="if (event.button == 0) vI_rdfDataTree.modifySelected();" />
     244    <treechildren id="configTreeBody_newsgroup" ondblclick="if (event.button == 0) virtualIdentityExtension.rdfDataTreeCollection.modifySelected();" />
    244245</tree>
    245246<vbox>
    246247          <button id="newButton_newsgroup" label="&newButton.label;" accesskey="&newButton.accesskey;"
    247                   oncommand="vI_rdfDataTree.newItem();"/>
     248                  oncommand="virtualIdentityExtension.rdfDataTreeCollection.newItem();"/>
    248249          <button id="editButton_newsgroup" label="&editButton.label;" accesskey="&editButton.accesskey;"
    249                   oncommand="vI_rdfDataTree.modifySelected();" disabled="true"/>
     250                  oncommand="virtualIdentityExtension.rdfDataTreeCollection.modifySelected();" disabled="true"/>
    250251          <button id="deleteButton_newsgroup" label="&deleteButton.label;" accesskey="&deleteButton.accesskey;"
    251                   oncommand="vI_rdfDataTree.removeSelected();" disabled="true"/>
     252                  oncommand="virtualIdentityExtension.rdfDataTreeCollection.removeSelected();" disabled="true"/>
    252253          <spacer flex="1"/>
    253254</vbox>
     
    258259<tree id="rdfDataTree_filter" flex="1" class="plain" seltype="multiple"
    259260    persist="sortDirection sortResource" sortDirection="ascending" sortResource="indexCol"
    260     enableColumnDrag="true" context="configContext" onselect="vI_rdfDataTree.onselect();">
     261    enableColumnDrag="true" context="configContext" onselect="virtualIdentityExtension.rdfDataTreeCollection.onselect();">
    261262    <treecols id="rdfDataTreeCols_filter">
    262263        <treecol id="indexCol_filter" label="&vI_rdfDataTree.indexColumn.label;" flex="10"
     
    282283            persist="hidden width ordinal"/>       
    283284    </treecols>
    284     <treechildren id="configTreeBody_filter" ondblclick="if (event.button == 0) vI_rdfDataTree.modifySelected();" />
     285    <treechildren id="configTreeBody_filter" ondblclick="if (event.button == 0) virtualIdentityExtension.rdfDataTreeCollection.modifySelected();" />
    285286</tree>
    286287<vbox>
    287288          <button id="newButton_filter" label="&newButton.label;" accesskey="&newButton.accesskey;"
    288                   oncommand="vI_rdfDataTree.newItem();"/>
     289                  oncommand="virtualIdentityExtension.rdfDataTreeCollection.newItem();"/>
    289290          <button id="editButton_filter" label="&editButton.label;" accesskey="&editButton.accesskey;"
    290                   oncommand="vI_rdfDataTree.modifySelected();" disabled="true"/>
     291                  oncommand="virtualIdentityExtension.rdfDataTreeCollection.modifySelected();" disabled="true"/>
    291292          <button id="deleteButton_filter" label="&deleteButton.label;" accesskey="&deleteButton.accesskey;"
    292                   oncommand="vI_rdfDataTree.removeSelected();" disabled="true"/>
     293                  oncommand="virtualIdentityExtension.rdfDataTreeCollection.removeSelected();" disabled="true"/>
    293294          <spacer flex="1"/>
    294295          <button id="reorderUpButton_filter" label="&reorderUpButton.label;" accesskey="&reorderUpButton.accesskey;"
    295296                  class="up"
    296                   oncommand="vI_rdfDataTree.moveUpSelected();"/>
     297                  oncommand="virtualIdentityExtension.rdfDataTreeCollection.moveUpSelected();"/>
    297298          <button id="reorderDownButton_filter" label="&reorderDownButton.label;" accesskey="&reorderDownButton.accesskey;"
    298299                  class="down"
    299                   oncommand="vI_rdfDataTree.moveDownSelected();"/>
     300                  oncommand="virtualIdentityExtension.rdfDataTreeCollection.moveDownSelected();"/>
    300301          <spacer flex="1"/>
    301302</vbox>
     
    306307</tabbox>
    307308<!-- <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();"/>
    310310    <splitter id="vIDebugBoxSplitter" hidden="true"/>
    311311    <textbox id="vIDebugBox" hidden="true" multiline="true" readonly="true"
    312312    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>
    314314</window>
  • chrome/content/v_identity/vI_rdfDatasource.js

    r92fd25 rc3feaa  
    2424
    2525
    26 
    27 function vI_rdfDatasource(rdfFileName, dontRegisterObserver) {
     26virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     27function rdfDatasource(rdfFileName, dontRegisterObserver) {
    2828    this._rdfFileName = rdfFileName;
    2929    if (this._rdfFileName) this.init();
     
    3131}
    3232
    33 vI_rdfDatasource.prototype = {
     33rdfDatasource.prototype = {
    3434    _rdfVersion :       "0.0.5",
    3535    _rdfService :       Components.classes["@mozilla.org/rdf/rdf-service;1"]
     
    8080
    8181    init: function() {
    82 //         if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource init.\n");
     82//         if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource init.\n");
    8383
    8484        this._openRdfDataSource();
     
    9191           
    9292//         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");
    9494    },
    9595   
     
    109109        var fileURI = protoHandler.newFileURI(newFile);
    110110
    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");
    112112
    113113        this._rdfDataSource =
    114114            this._rdfService.GetDataSourceBlocking(fileURI.spec);
    115115           
    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");
    117117    },
    118118   
     
    161161    rdfUpgrade : function() {
    162162        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 " +
    164164            currentVersion + "\nrdf-upgrade required.\n")
    165165        switch (currentVersion) {
     
    175175        }
    176176        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");
    178178    },
    179179    // **************    RDF UPGRADE CODE    ****************************************************
    180180    // only used for upgrade to 0.0.3 - loop through all ressources.
    181181    _transferAllResources : function () {
    182         if (vI_notificationBar) vI_notificationBar.dump("upgrade: transferAllResources ");
     182        if (vI.notificationBar) vI.notificationBar.dump("upgrade: transferAllResources ");
    183183        var enumerator = this._rdfDataSource.GetAllResources();
    184184        while (enumerator && enumerator.hasMoreElements()) {
     
    200200            if (container.IndexOf(resource) == -1) container.AppendElement(resource);
    201201       
    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");
    205205    },
    206206    // **************    RDF UPGRADE CODE    ****************************************************
    207207    _tagDefaultSMTP: function() {
    208         if (vI_notificationBar) vI_notificationBar.dump("upgrade: tagDefaultSMTP ");
     208        if (vI.notificationBar) vI.notificationBar.dump("upgrade: tagDefaultSMTP ");
    209209        for each (treeType in Array("email", "maillist", "newsgroup", "filter")) {
    210210            var enumerator = this.getContainer(treeType).GetElements();
     
    213213                resource.QueryInterface(Components.interfaces.nsIRDFResource);
    214214                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");
    220220    },
    221221    // **************    RDF UPGRADE CODE    ****************************************************
    222222    _createAccountInfoContainers: function() {
    223         if (vI_notificationBar) vI_notificationBar.dump("upgrade: createAccountInfoContainers \n");
     223        if (vI.notificationBar) vI.notificationBar.dump("upgrade: createAccountInfoContainers \n");
    224224        var rdfContainerUtils = Components.classes["@mozilla.org/rdf/container-utils;1"].
    225225            getService(Components.interfaces.nsIRDFContainerUtils);
     
    253253    // **************    RDF UPGRADE CODE    ****************************************************
    254254    _createRDFContainers: function() {
    255         if (vI_notificationBar) vI_notificationBar.dump("upgrade: createRDFContainers ");
     255        if (vI.notificationBar) vI.notificationBar.dump("upgrade: createRDFContainers ");
    256256        var rdfContainerUtils = Components.classes["@mozilla.org/rdf/container-utils;1"].
    257257            getService(Components.interfaces.nsIRDFContainerUtils);
     
    340340   
    341341    cleanAccountInfo : function() {
    342         if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: cleanAccountInfo\n");
     342        if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: cleanAccountInfo\n");
    343343       
    344344        var enumerator = this._identityContainer.GetElements();
     
    381381   
    382382    searchIdentityMismatch : function() {
    383         if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: searchIdentityMismatch");
     383        if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: searchIdentityMismatch");
    384384
    385385        var relevantIDs = this.getRelevantIDs();
     
    408408        }
    409409        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");
    411411           
    412412            window.openDialog("chrome://v_identity/content/vI_rdfAccountMismatchDialog.xul",0,
     
    416416        }
    417417        else {
    418             if (vI_notificationBar) vI_notificationBar.dump(" found no mismatch\n");
     418            if (vI.notificationBar) vI.notificationBar.dump(" found no mismatch\n");
    419419            return false;
    420420        }
     
    424424        var keyField = (type == "identity")?"id":"smtp" // field to change is 'id' or 'smtp' dependent on type
    425425        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 + ": ");
    427427            // search relevant Identities
    428428            for each (treeType in Array("email", "maillist", "newsgroup", "filter")) {
     
    434434                        if (mismatchItems[i].key == "") this._unsetRDFValue(resource, keyField, mismatchItems[i].oldkey)
    435435                        else this._setRDFValue(resource, keyField, mismatchItems[i].key)
    436                         if (vI_notificationBar) vI_notificationBar.dump(".");
     436                        if (vI.notificationBar) vI.notificationBar.dump(".");
    437437                    }
    438438                }
    439439            }
    440             if (vI_notificationBar) vI_notificationBar.dump("\n");
     440            if (vI.notificationBar) vI.notificationBar.dump("\n");
    441441        }
    442442    },
     
    451451                resource.QueryInterface(Components.interfaces.nsIRDFResource);
    452452                var smtp = this._getRDFValue(resource, "smtp")
    453                 if (smtp && smtp != vI_DEFAULT_SMTP_TAG) {
     453                if (smtp && smtp != vI.DEFAULT_SMTP_TAG) {
    454454                    if (!relevantSMTPs[smtp]) relevantSMTPs[smtp] = 1; else relevantSMTPs[smtp] += 1;
    455455                }
     
    460460   
    461461    searchSmtpMismatch : function() {
    462         if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: searchSmtpMismatch");
     462        if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: searchSmtpMismatch");
    463463
    464464        var relevantSMTPs = this.getRelevantSMTPs();
     
    484484        }
    485485        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");
    487487            window.openDialog("chrome://v_identity/content/vI_rdfAccountMismatchDialog.xul",0,
    488488                    "chrome, dialog, modal, alwaysRaised, resizable=yes", "smtp", mismatchSMTPs,
     
    491491        }
    492492        else {
    493             if (vI_notificationBar) vI_notificationBar.dump(" found no mismatch\n");
     493            if (vI.notificationBar) vI.notificationBar.dump(" found no mismatch\n");
    494494            return false;
    495495        }
     
    497497
    498498    storeAccountInfo : function() {
    499         if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: storeAccounts\n");
     499        if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: storeAccounts\n");
    500500
    501501        var AccountManager = Components.classes["@mozilla.org/messenger/account-manager;1"]
     
    505505            for (let j = 0; j < account.identities.Count(); j++) {
    506506                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");
    508508
    509509                var resource = this._rdfService.GetResource(this._rdfNS + this._rdfNSIdentities + "/" + identity.key);
     
    519519       
    520520        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");
    522522            var resource = parent._rdfService.GetResource(parent._rdfNS + parent._rdfNSSMTPservers + "/" + server.key);
    523523            parent._setRDFValue(resource, "label", (server.description?server.description:server.hostname));
     
    536536        }
    537537
    538 //         if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: storeAccounts done\n");
     538//         if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: storeAccounts done\n");
    539539    },
    540540
     
    561561        if (!this._rdfDataSource) return null;
    562562        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");
    564564            return null;
    565565        }
     
    577577   
    578578    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");
    580580        this._unsetRDFValue(resource, "email", this._getRDFValue(resource, "email"))
    581581        this._unsetRDFValue(resource, "fullName", this._getRDFValue(resource, "fullName"))
     
    584584        this._unsetRDFValue(resource, "name", this._getRDFValue(resource, "name"))
    585585       
    586         var extras = new vI_storageExtras(this, resource);
     586        var extras = new vI.storageExtras(this, resource);
    587587        extras.loopForRDF(this, resource, "unset");
    588588        this.getContainer(recType).RemoveElement(resource, true);
     
    590590   
    591591    _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");
    593593        var predicate = this._rdfService.GetResource(this._rdfNS + "rdf#" + field);
    594594        var name = this._rdfService.GetLiteral(value?value:"");
     
    601601    },
    602602   
    603     // this will be used from rdfDataTree to get all RDF values, callFunction is vI_rdfDataTree.__addNewDatum
     603    // this will be used from rdfDataTree to get all RDF values, callFunction is vI.rdfDataTreeCollection.__addNewDatum
    604604    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");
    606606        var enumerator = this.getContainer(treeType).GetElements();
    607607        while (enumerator && enumerator.hasMoreElements()) {
     
    613613            var id = this._getRDFValue(resource, "id")
    614614            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);
    617617           
    618             var localIdentityData = new vI_identityData(email, fullName, id, smtp, extras)
     618            var localIdentityData = new vI.identityData(email, fullName, id, smtp, extras)
    619619            addNewDatum (resource, name, localIdentityData, idData)
    620620        }
     
    622622   
    623623    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");
    625625        var enumerator = this._filterContainer.GetElements();
    626626        while (enumerator && enumerator.hasMoreElements()) {
     
    634634            if (filter == "") continue;
    635635            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 '"
    637637                    + 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 '"
    639639                    + filter + "'\n"); recentfilterType = filterType.StrCmp; }
    640640           
     
    643643                    try {   /^\/(.*)\/$/.exec(filter);
    644644                        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");
    646646                            return this._readVIdentityFromRDF(resource);
    647647                        }
     
    650650                case filterType.StrCmp:
    651651                    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");
    653653                        return this._readVIdentityFromRDF(resource);
    654654                    }
     
    656656            }
    657657        }
    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");
    659659        return null;
    660660    },
     
    666666        if (!this._rdfDataSource.hasArcOut(resource, email)) {
    667667            // 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");
    669669            return null;
    670670        }
    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");
    672672       
    673673        return this._readVIdentityFromRDF(resource);
     
    679679        var id = this._getRDFValue(resource, "id")
    680680        var smtp = this._getRDFValue(resource, "smtp")
    681         if (!smtp) smtp = vI_NO_SMTP_TAG;
     681        if (!smtp) smtp = vI.NO_SMTP_TAG;
    682682       
    683         if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: email='" + email +
     683        if (vI.notificationBar) vI.notificationBar.dump("## rdfDatasource: email='" + email +
    684684            "' fullName='" + fullName + "' id='" + id + "' smtp='" + smtp + "'\n");
    685685       
    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");
    688688       
    689         var localIdentityData = new vI_identityData(email, fullName, id, smtp, extras)
     689        var localIdentityData = new vI.identityData(email, fullName, id, smtp, extras)
    690690        return localIdentityData;
    691691    },
    692692
    693693    _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");
    695695        var predicate = this._rdfService.GetResource(this._rdfNS + "rdf#" + field);
    696696        var target = this._rdfDataSource.GetTarget(resource, predicate, true);
     
    702702        this.updateRDF(recDescription, recType,
    703703            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"),
    706706            null, null);
    707707    },
     
    715715
    716716    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");
    718718       
    719719//      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");
    721721//          return;
    722722//      }
     
    728728        var resource = this._getRDFResourceForVIdentity(prevRecDescription, prevRecType);
    729729        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");
    731731       
    732732        var position = this.getContainer(recType).IndexOf(resource); // check for index in new recType
     
    740740            this._setRDFValue(resource, "id", localIdentityData.id.key);
    741741        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)
    743743            this._setRDFValue(resource, "smtp", localIdentityData.smtp.key);
    744744        else    this._unsetRDFValue(resource, "smtp", this._getRDFValue(resource, "smtp"))
     
    747747        localIdentityData.extras.loopForRDF(this, resource, "set");
    748748       
    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");
    750750        if (position != -1) this.getContainer(recType).InsertElementAt(resource, position, true);
    751751        else this.getContainer(recType).AppendElement(resource);
     
    753753
    754754    _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");
    756756        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");
    758758        var predicate = this._rdfService.GetResource(this._rdfNS + "rdf#" + field);
    759759        var name = this._rdfService.GetLiteral(value);
     
    771771        observe : function(subject, topic, data) {
    772772            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");
    774774                this.searchIdentityMismatch();
    775775                this.searchSmtpMismatch();
     
    778778        },
    779779        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");
    781781            var obsService = Components.classes["@mozilla.org/observer-service;1"].
    782782                getService(Components.interfaces.nsIObserverService)
     
    796796
    797797// create with name of the file to import into
    798 function vI_rdfDatasourceImporter(rdfFileName) {
     798function rdfDatasourceImporter(rdfFileName) {
    799799    this._rdfFileName = rdfFileName;
    800800    if (this._rdfFileName) this.import();
    801801}
    802802
    803 vI_rdfDatasourceImporter.prototype = {
     803rdfDatasourceImporter.prototype = {
    804804    _rdfService :       Components.classes["@mozilla.org/rdf/rdf-service;1"]
    805805                            .getService(Components.interfaces.nsIRDFService),
     
    844844            values.id = values.id?values.id:"import_" + id
    845845            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");
    847847        }
    848848        return relevantIDs;
     
    876876            values.smtp = values.smtp?values.smtp:"import_" + smtp;
    877877            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");
    879879        }
    880880        return relevantSMTPs;
     
    906906       
    907907        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");
    909909           
    910910            var importRdfDataFile = Components.classes["@mozilla.org/file/local;1"]
     
    916916            filePicker.file.copyTo(importRdfDataFile.parent,importRdfDataFile.leafName);
    917917
    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");
    919919           
    920920            // init Datasources
    921             this._rdfImportDataSource = new vI_rdfDatasource(importRdfDataFile.leafName, true);
     921            this._rdfImportDataSource = new rdfDatasource(importRdfDataFile.leafName, true);
    922922           
    923923            // search matching IDs and SMTPs for anyones used in import-file
     
    925925            var relevantSMTPs = this._translateRelevantSMTPs();
    926926           
    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");
    929929
    930930            for each (treeType in Array("email", "maillist", "newsgroup", "filter")) {
    931931                // 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);
    933933                var container = this._rdfImportDataSource.getContainer(treeType)
    934934                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");
    936936                var enumerator = container.GetElements();
    937937                // 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);
    939939                var count = 0;
    940940                while (enumerator.hasMoreElements()) {
    941941                    var resource = enumerator.getNext(); count += 1;
    942942                    resource.QueryInterface(Components.interfaces.nsIRDFResource);
    943                     if (vI_notificationBar) vI_notificationBar.dump("## " + count + " ");
     943                    if (vI.notificationBar) vI.notificationBar.dump("## " + count + " ");
    944944                    var name = this._rdfImportDataSource._getRDFValue(resource, "name")
    945945                    var email = this._rdfImportDataSource._getRDFValue(resource, "email")
     
    948948                    id = id?relevantIDs[id].id:null
    949949                    var smtp = this._rdfImportDataSource._getRDFValue(resource, "smtp")
    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)
     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)
    953953                   
    954954                    this._rdfDataSource.updateRDF(name, treeType, localIdentityData, false, false, null, null)
     
    959959            }
    960960           
    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");
    962962            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);
    967967           
    968968            this._storeMappedIDs(relevantIDs);
     
    974974            this._rdfDataSource.clean();
    975975            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");
    978978        }
    979979    }
    980980}
     981vI.rdfDatasource = rdfDatasource;
     982vI.rdfDatasourceImporter = rdfDatasourceImporter;
     983}});
  • chrome/content/v_identity/vI_smartIdentity.js

    r92fd25 rc3feaa  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
    25 var vI_smartIdentity = {
     25virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     26var smartIdentity = {
    2627    messenger : Components.classes["@mozilla.org/messenger;1"].createInstance()
    2728        .QueryInterface(Components.interfaces.nsIMessenger),
     
    3031
    3132    clean : function() {
    32         vI_smartIdentity.smartIdentity_BaseIdentity = null;
     33        smartIdentity.smartIdentity_BaseIdentity = null;
    3334    },
    3435   
     
    3738        var type = gMsgCompose.type;
    3839        var msgComposeType = Components.interfaces.nsIMsgCompType;
    39         vI_notificationBar.dump("## vI_smartIdentity: msgComposeType = " + type + "\n");
     40        vI.notificationBar.dump("## smartIdentity: msgComposeType = " + type + "\n");
    4041       
    4142        switch (type) {
     
    4950            case msgComposeType.ReplyWithTemplate:
    5051            case msgComposeType.ReplyToList:
    51                 vI_smartIdentity.Reply(); break;
     52                smartIdentity.Reply(); break;
    5253            case msgComposeType.Draft:
    5354            case msgComposeType.Template:
    54                 vI_smartIdentity.Draft(); break;
     55                smartIdentity.Draft(); break;
    5556            case msgComposeType.New:
    5657            case msgComposeType.NewsPost:
    5758            case msgComposeType.MailToUrl:
    58                 vI_smartIdentity.NewMail(); break;
     59                smartIdentity.NewMail(); break;
    5960            }
    6061    },
     
    6263    // this function adds a timestamp to the current sender
    6364    __autoTimestamp : function() {
    64         vI_notificationBar.dump("## vI_smartIdentity: __autoTimestamp()\n");
     65        vI.notificationBar.dump("## smartIdentity: __autoTimestamp()\n");
    6566        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");
    6768            return;
    6869        }
     
    7273        var domain = current_email[1];
    7374       
    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");
    7879       
    7980        var dateObj = new Date(); var dateString = "";
     
    8485       
    8586        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") + ".",
    8990                    "smart_reply_notification");
    9091
     
    9394   
    9495    __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")
    9697        // 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");
    99100            return true;
    100101        }
     
    103104   
    104105    NewMail : function() {
    105         if (vI_smartIdentity.__ignoreID()) return;
     106        if (smartIdentity.__ignoreID()) return;
    106107       
    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();
    112113    },
    113114   
    114115    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);
    122123       
    123124        allIdentities.mergeWithoutDuplicates(storageIdentities);
    124125           
    125         if (allIdentities.number > 0) vI_smartIdentity.__smartIdentitySelection(allIdentities, true);
     126        if (allIdentities.number > 0) smartIdentity.__smartIdentitySelection(allIdentities, true);
    126127
    127128    },
    128129
    129130    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.
    135136            messageServiceFromURI(gMsgCompose.originalMsgURI).messageURIToMsgHdr(gMsgCompose.originalMsgURI);
    136137        // 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.
    138139            messageServiceFromURI(gMsgCompose.compFields.draftId).messageURIToMsgHdr(gMsgCompose.compFields.draftId);
    139140        } catch (ex) { };
    140141
    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);
    144145       
    145146        allIdentities.mergeWithoutDuplicates(storageIdentities);
    146147           
    147         if (allIdentities.number > 0) vI_smartIdentity.__smartIdentitySelection(allIdentities, true);
     148        if (allIdentities.number > 0) smartIdentity.__smartIdentitySelection(allIdentities, true);
    148149    },
    149150   
    150151    __parseHeadersWithArray: function(hdr, allIdentities) {
    151152        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);
    153154        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);
    156157            allIdentities.addWithoutDuplicates(newIdentity);
    157158        }
     
    160161    // this function checks if we have a draft-case and Smart-Draft should replace the Identity
    161162    __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");
    166167
    167168        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");
    172173    },
    173174   
    174175    __filterAddresses : function(smartIdentities) {
    175         var returnIdentities = new vI_identityCollection();
     176        var returnIdentities = new vI.identityCollection();
    176177       
    177178        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/)
    179180        if (filterList.length == 0) filterList[0] == ""
    180181       
     
    183184            var recentfilterType; var skipRegExp = false;
    184185            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; }
    186187            else if (/^[+-]?\/(.*)\/$/.exec(filterList[i]))
    187                 { vI_notificationBar.dump("## vI_smartIdentity: filter emails with RegExp '"
     188                { vI.notificationBar.dump("## smartIdentity: filter emails with RegExp '"
    188189                    + 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 '"
    190191                    + filterList[i] + "'\n"); recentfilterType = filterType.StrCmp; }
    191192            for (var j = 0; j < smartIdentities.number; j++) { // check if recent email-address (pre-choosen identity) is found in
     
    205206                        }
    206207                        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") +
    209210                                +filterList[i].replace(/\\/g,"\\\\") + " .",
    210211                                "smart_reply_notification");
     
    223224    __smartReplyCollectAddresses : function(hdr, allIdentities) {
    224225        // 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/)
    226227                   
    227228        for (var index = 0; index < reply_headers.length; index++) {
     
    243244            // if mailing-list ignore to-header (usually the mailing list address)
    244245            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");
    246247                continue;
    247248            }
    248249           
    249250            // ------------- 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 '" +
    252253                replyHeaderNameToRead + "': '" + value + "'\n");
    253254           
    254255            // ------------- 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);
    257258           
    258259            // move found addresses step by step to allIdentities, and change values if requested
     
    260261                // if there is no email than it makes no sense to use it as a sender
    261262                if (!splitted.identityDataCollection[i].email.match(/^.*@.*$/)) {
    262                     vI_notificationBar.dump("## vI_smartIdentity:   skipping '" +
     263                    vI.notificationBar.dump("## smartIdentity:   skipping '" +
    263264                    splitted.identityDataCollection[i].email + "', no email\n")
    264265                    continue;
     
    269270                allIdentities.addWithoutDuplicates(splitted.identityDataCollection[i]);
    270271
    271                 vI_notificationBar.dump("## vI_smartIdentity:   found '" +
     272                vI.notificationBar.dump("## smartIdentity:   found '" +
    272273                    splitted.identityDataCollection[i].combinedName + "'\n")
    273274            }
     
    276277   
    277278    Reply : function() {
    278         var hdr = vI_smartIdentity.messenger.
     279        var hdr = smartIdentity.messenger.
    279280            messageServiceFromURI(gMsgCompose.originalMsgURI).messageURIToMsgHdr(gMsgCompose.originalMsgURI);
    280281
    281         vI_notificationBar.dump("## vI_smartIdentity: Reply()\n");
     282        vI.notificationBar.dump("## smartIdentity: Reply()\n");
    282283
    283284        if (hdr && !gMsgCompose.compFields.newsgroups && !hdr.getStringProperty("vI_content_base")) {
     
    291292        //  hidden option smart_detectByReceivedHeader will act as a switch for not RFC-compliant servers
    292293            // RFC-compliant
    293             if (vI_main.preferences.getBoolPref("smart_detectByReceivedHeader")) {
     294            if (vI.main.preferences.getBoolPref("smart_detectByReceivedHeader")) {
    294295                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);
    297298                    return;
    298299                }
     
    304305
    305306                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.");
    307308                    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");
    309310                    else {
    310                         vI_notificationBar.dump(" Using SmartDraft. \n");
    311                         vI_smartIdentity.ReplyOnSent(hdr);
     311                        vI.notificationBar.dump(" Using SmartDraft. \n");
     312                        smartIdentity.ReplyOnSent(hdr);
    312313                        return;
    313314                    }
     
    316317        }
    317318       
    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");
    327328
    328329        // 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"))
    330331            { smartIdentities.mergeWithoutDuplicates(storageIdentities); var allIdentities = smartIdentities; }
    331332        else
    332333            { storageIdentities.mergeWithoutDuplicates(smartIdentities); var allIdentities = storageIdentities; }
    333334       
    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);
    337338    },
    338339   
    339340    // this function checks if we have a reply-case and Smart-Reply should replace the Identity
    340341    __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");
    345346            return;
    346347        }
    347348
    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")
    350351        if (hdr) {
    351352            /* 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")
    354355           
    355356            /* 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")
    359360           
    360361            /* 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"))
    362363            if (smart_reply_defaultFullName != "") {
    363364                for (var index = 0; index < smartIdentities.number; index++) {
    364365                    if (smartIdentities.identityDataCollection[index].fullName == "") {
    365366                        smartIdentities.identityDataCollection[index].fullName = smart_reply_defaultFullName
    366                         vI_notificationBar.dump("## vI_smartIdentity: added default FullName '" +
     367                        vI.notificationBar.dump("## smartIdentity: added default FullName '" +
    367368                            smart_reply_defaultFullName + "' to '" + smartIdentities.identityDataCollection[index].email + "'\n")
    368369                    }
     
    373374            /* if match replace FullName with existing one, keep identity in list by now        */
    374375            /* 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")
    377378           
    378379                for (var index = 0; index < smartIdentities.number; index++) {
     
    381382                        var newFullName = gAccountManager.getIdentity(idKey).fullName;
    382383                        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");
    384385                    }
    385386                }
    386387            }
    387388        }
    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")
    391392    },
    392393   
     
    398399                allIdentities.identityDataCollection[index].id.key = existingID;    // set found identity
    399400                // 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");
    402403                    // add all Indentities to Clone Menu before selecting and leaving the function
    403404                    document.getElementById("msgIdentity_clone").addIdentitiesToCloneMenu(allIdentities);
    404                     vI_smartIdentity.changeIdentityToSmartIdentity(allIdentities, index);
     405                    smartIdentity.changeIdentityToSmartIdentity(allIdentities, index);
    405406                    return;
    406407                }
    407408                // else reorder list of Identities to prefer it on autoselect
    408409                // 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");
    410411                var firstIdentity = allIdentities.identityDataCollection[index];
    411412                for (var i = index; index > 0; index--) {
     
    419420        document.getElementById("msgIdentity_clone").addIdentitiesToCloneMenu(allIdentities);
    420421
    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"))
    423424                || allIdentities.number > 1)) {
    424425            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 + "' "
    426427                    + "(" + allIdentities.identityDataCollection[index].id.value + "," + allIdentities.identityDataCollection[index].smtp.value + ")\n");
    427428            }
     
    429430                    "chrome, dialog, modal, alwaysRaised, resizable=yes",
    430431                     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);
    435436        }   
    436437    },
    437438   
    438439    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 + "' "
    440441            + "(" + allIdentities.identityDataCollection[selectedValue].id.value + "," + allIdentities.identityDataCollection[selectedValue].smtp.value + ")\n");
    441442        document.getElementById("msgIdentity_clone").selectedMenuItem = allIdentities.menuItems[selectedValue];
    442443        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");
    444445            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);
    449450    },
    450451   
    451452    __removeSmartIdentityFromRecipients : function(allIdentities, index) {
    452         if (!vI_main.preferences.getBoolPref("idSelection_removeSmartIdentityFromRecipients")) return;
     453        if (!vI.main.preferences.getBoolPref("idSelection_removeSmartIdentityFromRecipients")) return;
    453454       
    454455        // check if selected email is defined as doBcc address. If so, it should not be removed.
    455456        var skip_bcc = false;
    456457        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);
    459460           
    460461            for (var i = 0; i < bcc_addresses.number; i++) {
     
    487488                    awSetInputAndPopupValue(input, "", popup, "addr_to", -1);
    488489                    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"),
    491492                        "smart_reply_notification");
    492493                    break;
     
    495496    }
    496497}
     498vI.smartIdentity = smartIdentity;
     499}});
  • chrome/content/v_identity/vI_smartReplyDialog.js

    r92fd25 rc3feaa  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
    25 var vI_smartReply_dialog = {
     25virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     26var smartReply_dialog = {
    2627    Obj_radioGroup : null,
    2728    all_addresses : null,
    2829
    2930    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;
    3435
    3536            var id = null; var smtp = null;
    3637
    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;
    4142
    4243            menuentry += (id?" (" + id + "," +
    4344                    (smtp?smtp:document.getElementById("bundle_messenger").getString("defaultServerTag")) +
    4445                    ")":"")
    45             vI_smartReply_dialog.add_row(menuentry);
     46            smartReply_dialog.add_row(menuentry);
    4647        }
    4748    },
     
    5051        var radio = document.createElement("radio");
    5152        radio.setAttribute("label",combinedName);
    52         vI_smartReply_dialog.Obj_radioGroup.appendChild(radio);
     53        smartReply_dialog.Obj_radioGroup.appendChild(radio);
    5354    },
    5455
    5556    accept : function() {
    5657        /* 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);
    5859        document.documentElement.acceptDialog();
    5960    }
    6061}
    61 window.addEventListener("load", vI_smartReply_dialog.init, false);
     62window.addEventListener("load", smartReply_dialog.init, false);
     63}});
  • chrome/content/v_identity/vI_smartReplyDialog.xul

    r92fd25 rc3feaa  
    3737    zlevel="6">
    3838
    39 <script type="application/x-javascript"
    40             src="chrome://v_identity/content/vI_smartReplyDialog.js" />
     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" />
    4141
    4242<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
     
    4949    <caption label="&vident.replySelector.caption.label;"/>
    5050
    51     <radiogroup id="replySelector.radiogroup" oncommand="vI_smartReply_dialog.accept();">
     51    <radiogroup id="replySelector.radiogroup" oncommand="virtualIdentityExtension.smartReply_dialog.accept();">
    5252    </radiogroup>
    5353  </groupbox>
  • chrome/content/v_identity/vI_statusmenu.js

    r92fd25 rc3feaa  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
    25 var vI_statusmenu = {
     25virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     26var statusmenu = {
    2627    prefroot : Components.classes["@mozilla.org/preferences-service;1"]
    2728        .getService(Components.interfaces.nsIPrefService)
     
    4142        switch (data) {
    4243            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));
    4445                // no break, continue like with doFcc           
    4546            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"));
    4748                break;
    4849            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));
    5051                break;
    5152            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));
    5354                break;
    5455            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));
    5657                break;
    5758            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"));
    5960                break;
    6061            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));
    6263                break;
    6364            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));
    6566                break;
    6667            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))
    7071                break;
    7172            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");
    7778                }
    7879                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");
    8384                }
    8485                break;
    8586        }
    86         vI_statusmenu.menuConstraint(vI_statusmenu.objStorageSaveMenuItem);
     87        statusmenu.menuConstraint(statusmenu.objStorageSaveMenuItem);
    8788    },
    8889   
    8990    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);
    100101    },
    101102   
    102103    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);
    113114    },
    114115   
    115116    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");
    141142    },
    142143   
     
    145146        var sourceString = "vident.statusText.save." + save;
    146147        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");
    149150        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");
    153154        }   
    154155        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(vI_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);
    161162    },
    162163
    163164    __clearStatusMessage : function() {
    164         vI_statusmenu.objStatusText.setAttribute("label", "");
     165        statusmenu.objStatusText.setAttribute("label", "");
    165166    },
    166167
    167168    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();
    170171    },
    171172
    172173    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();
    175176    },
    176177
    177178    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();
    180181    },
    181182
    182183    menuConstraint : function () {
    183184        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";
    189190                else save = "ok";
    190                 if (vI_statusmenu.objSaveSMTPMenuItem.getAttribute("checked") == "true") smtp = "save";
     191                if (statusmenu.objSaveSMTPMenuItem.getAttribute("checked") == "true") smtp = "save";
    191192            }
    192193        }
    193194        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);
    200201    },
    201202
    202203    clicked : function (button) {
    203204        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");
    209210        var newSaveStatus = ((!curSaveStatus) || (curSaveStatus && !curSaveSMTPStatus) || (curSaveStatus && !curSaveBaseIDStatus))
    210211        var newSaveSMTPStatus = ((!curSaveSMTPStatus && curSaveStatus) || (curSaveBaseIDStatus && !curSaveSMTPStatus))
    211212        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)
    215216       
    216         vI_statusmenu.menuConstraint();
     217        statusmenu.menuConstraint();
    217218    }
    218219}
     220vI.statusmenu = statusmenu;
     221}});
  • chrome/content/v_identity/vI_storage.js

    r92fd25 rc3feaa  
    2828*/
    2929
    30 var vI_storage = {
     30virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     31var storage = {
    3132    multipleRecipients : null,
    3233    focusedElement : null,
     
    4243            .getBranch(null).QueryInterface(Components.interfaces.nsIPrefBranch2),
    4344   
    44     vI_rdfDatasource : null,    // local storage
     45    rdfDatasource : null,    // local storage
    4546
    4647    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();
    5354    },
    5455   
     
    5960    replacement_functions : {
    6061        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);
    6465        }
    6566    },
     
    6869        // only react on events triggered by addressCol2 - textinput Elements
    6970        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;
    7374    },
    7475
    7576    awOnFocus : function (element) {
    7677        if (!element || ! element.id.match(/^addressCol2*/)) return;
    77         vI_storage.focusedElement = element;
     78        storage.focusedElement = element;
    7879    },
    7980
    8081    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")));
    8384        if (element.selectedItem.getAttribute("value") == "addr_reply") // if reply-to is manually entered disable AutoReplyToSelf
    8485            document.getElementById("autoReplyToSelfLabel").setAttribute("hidden", "true");
     
    8889    initialized : null,
    8990    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");
    9293
    9394            // better approach would be to use te onchange event, but this one is not fired in any change case
     
    100101                    var oldBlur = input.getAttribute("onblur")
    101102                    input.setAttribute("onblur", (oldBlur?oldBlur+"; ":"") +
    102                         "window.setTimeout(vI_storage.awOnBlur, 250, this.parentNode.parentNode.parentNode);")
     103                        "window.setTimeout(virtualIdentityExtension.storage.awOnBlur, 250, this.parentNode.parentNode.parentNode);")
    103104                    var oldFocus = input.getAttribute("onfocus")
    104105                    input.setAttribute("onfocus", (oldFocus?oldFocus+"; ":"") +
    105                         "window.setTimeout(vI_storage.awOnFocus, 250, this.parentNode.parentNode.parentNode);")
     106                        "window.setTimeout(virtualIdentityExtension.storage.awOnFocus, 250, this.parentNode.parentNode.parentNode);")
    106107                }
    107108                var popup = awGetPopupElement(row);
     
    109110                    var oldCommand = popup.getAttribute("oncommand")
    110111                    popup.setAttribute("oncommand", (oldCommand?oldCommand+"; ":"") +
    111                         "window.setTimeout(vI_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;
    117118        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) }
    119120
    120121        // reset unavailable storageExtras preferences
    121122        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)
    126127        }
    127128    },
     
    130131    firstUsedInputElement : null,   // this stores the first Element for which a Lookup in the Storage was successfull
    131132    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");
    135136
    136137        var recipientType = document.getElementById(inputElement.id.replace(/^addressCol2/,"addressCol1"))
    137138            .selectedItem.getAttribute("value");
    138139        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)) {
    140141            // 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")
    144145            return;
    145146        }
    146147       
    147148        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;
    149150        }
    150151       
    151152        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);
    157158
    158159        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");
    163164        var matchIndex = null;
    164165        for (var i = 0; i <= 1; i++) {
     
    170171        }
    171172        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");
    173174            return;
    174175        }
    175176        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");
    177178        }
    178179        // 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 entered
    183             vI_storage.firstUsedInputElement &&                     // and the request for the first recipient was already done
    184             vI_storage.firstUsedInputElement != inputElement &&             // and it's not the same element we changed now
     180        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
    185186            !matchResults.storageData[matchIndex].equalsCurrentIdentity(false).equal)   // and this id is different than the current used one
    186                 vI_notificationBar.setNote(vI_main.elements.strings
     187                vI.notificationBar.setNote(vI.main.elements.strings
    187188                    .getString("vident.smartIdentity.vIStorageCollidingIdentity"),  // than drop the potential changes
    188189                    "storage_notification");
    189190        // only update fields if new Identity is different than old one.
    190191        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");
    192193            var compResult = matchResults.storageData[matchIndex].equalsCurrentIdentity(true);
    193194            if (!compResult.equal) {
    194                 var warning = vI_storage.__getWarning("replaceVIdentity", recipient, compResult.compareMatrix);
     195                var warning = storage.__getWarning("replaceVIdentity", recipient, compResult.compareMatrix);
    195196                var msgIdentityCloneElem = document.getElementById("msgIdentity_clone")
    196197                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")) {
    199200                        msgIdentityCloneElem.selectedMenuItem = matchResults.menuItem[matchIndex];
    200201                        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") + ".",
    202203                            "storage_notification");
    203204                }
    204205            }
    205206            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");
    207208            }
    208209        }
     
    211212    __getDescriptionAndType : function (recipient, recipientType) {
    212213        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" }
    216217        }
    217218        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);
    220221            return { recDesc : localIdentityData.combinedName, recType : "email" }
    221222        }
     
    224225    storeVIdentityToAllRecipients : function(msgType) {
    225226        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")
    232233            return true;
    233234        }
    234235       
    235         vI_notificationBar.dump("## vI_storage: storeVIdentityToAllRecipients()\n");
     236        vI.notificationBar.dump("## storage: storeVIdentityToAllRecipients()\n");
    236237       
    237238        // check if there are multiple recipients
    238         vI_storage.multipleRecipients = false;
     239        storage.multipleRecipients = false;
    239240        var recipients = 0;
    240241        for (var row = 1; row <= top.MAX_RECIPIENTS; row ++) {
    241242            var recipientType = awGetPopupElement(row).selectedItem.getAttribute("value");
    242243            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;
    244245            if (recipients++ == 1) {
    245                 vI_storage.multipleRecipients = true
    246                 vI_notificationBar.dump("## vI_storage: multiple recipients found.\n")
     246                storage.multipleRecipients = true
     247                vI.notificationBar.dump("## storage: multiple recipients found.\n")
    247248                break;
    248249            }
     
    252253            var recipientType = awGetPopupElement(row).selectedItem.getAttribute("value");
    253254            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")
    257258                return false; // abort sending
    258259            }
    259260        }
    260         vI_notificationBar.dump("## vI_storage: ----------------------------------------------------------\n");
     261        vI.notificationBar.dump("## storage: ----------------------------------------------------------\n");
    261262        return true;
    262263    },
     
    264265    __getWarning : function(warningCase, recipient, compareMatrix) {
    265266        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 + "):"
    268269        warning.recipient = recipient.recDesc;
    269270        warning.warning =
    270271            "<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>" +
    273274            "</tr></thead>" +
    274275            "<tbody>" + compareMatrix + "</tbody>" +
    275276            "</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");
    278279        warning.class = warningCase;
    279280        return warning;
     
    289290   
    290291    __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);
    299300       
    300301        // update (storing) of data by type is required if there is
     
    307308        if (    (!storageDataByType && !storageDataByFilterEqual) ||
    308309            (!storageDataByTypeEqual && !storageDataByFilterEqual && !dontUpdateMultipleNoEqual) ) {
    309             vI_notificationBar.dump("## vI_storage: __updateStorageFromVIdentity updating\n")
     310            vI.notificationBar.dump("## storage: __updateStorageFromVIdentity updating\n")
    310311            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));
    314315                if (doUpdate == "takeover") {
    315316                    var msgIdentityCloneElem = document.getElementById("msgIdentity_clone");
     
    320321            }
    321322        }
    322         if (doUpdate == "accept") vI_storage.vI_rdfDatasource.updateRDFFromVIdentity(recipient.recDesc, recipient.recType);
     323        if (doUpdate == "accept") storage.rdfDatasource.updateRDFFromVIdentity(recipient.recDesc, recipient.recType);
    323324        return true;
    324325    },
     
    336337            if (ab instanceof Components.interfaces.nsIAbDirectory && !ab.isRemote) {
    337338                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))");
    339340                if (abdirectory) {
    340341                    let cards = abdirectory.childCards;
     
    364365        for (var index = 0; index < doBccArray.count; index++ ) {
    365366            if (doBccArray.StringAt(index) == awGetInputElement(row).value) {
    366                 vI_notificationBar.dump("## vI_storage: ignoring doBcc field '" +
     367                vI.notificationBar.dump("## storage: ignoring doBcc field '" +
    367368                    doBccArray.StringAt(index) + "'.\n");
    368369                return true;
     
    373374
    374375    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");
    378379
    379380        for (var row = 1; row <= top.MAX_RECIPIENTS; row ++) {
    380381            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);
    385386            if (storageData) allIdentities.addWithoutDuplicates(storageData);
    386             storageData = vI_storage.vI_rdfDatasource.findMatchingFilter(recipient.recDesc);
     387            storageData = storage.rdfDatasource.findMatchingFilter(recipient.recDesc);
    387388            if (storageData) allIdentities.addWithoutDuplicates(storageData);
    388389        }
    389         vI_notificationBar.dump("## vI_storage: found " + allIdentities.number + " address(es)\n")
     390        vI.notificationBar.dump("## storage: found " + allIdentities.number + " address(es)\n")
    390391    }
    391392}
     393vI.storage = storage;
     394}});
  • chrome/content/v_identity/vI_storageExtras.js

    r92fd25 rc3feaa  
    2222 * ***** END LICENSE BLOCK ***** */
    2323
    24 function vI_storageExtras_adapt(sourceId, targetId) {
     24virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     25function storageExtras_adapt(sourceId, targetId) {
    2526    var checked = document.getElementById(sourceId).getAttribute("checked");
    2627    if (targetId) var target = document.getElementById(targetId)
     
    3031}   
    3132
    32 var vI_storageExtrasHelper = {
     33var storageExtrasHelper = {
    3334    seamonkey_old : null,
    3435
     
    3839   
    3940    hideUnusedEditorFields : function() {
    40         var storageExtras = new vI_storageExtras();
     41        var localStorageExtras = new storageExtras();
    4142        var allHidden = true;
    4243        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)
    4546            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)
    4849        }
    4950        document.getElementById("storeValue").setAttribute("hidden", allHidden)
     
    5354}
    5455
    55 function vI_storageExtras(rdfDatasource, resource) {
    56 // function vI_storageExtras_checkbox(field, option, composeDialogElementID, updateFunction, identityValue) {
     56function storageExtras(rdfDatasource, resource) {
     57// function storageExtras_checkbox(field, option, composeDialogElementID, updateFunction, identityValue) {
    5758    this.extras = [
    58         new vI_storageExtras_checkbox(
     59        new storageExtras_checkbox(
    5960            "reciept", "storageExtras_returnReciept", "returnReceiptMenu", null, function(identity) { return identity.requestReturnReceipt; }),
    60         new vI_storageExtras_checkbox(
     61        new storageExtras_checkbox(
    6162            "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(
    6566            "sMimeEnc", "storageExtras_sMime_messageEncryption", "menu_securityEncryptRequire1",
    6667                function() { return ((typeof(setSecuritySettings)=='function')?setSecuritySettings(1):null) },
    6768                function(identity) { return (identity.getIntAttribute('encryptionpolicy') == 2) }),
    68         new vI_storageExtras_checkbox(
     69        new storageExtras_checkbox(
    6970            "sMimeSig", "storageExtras_sMime_messageSignature", "menu_securitySign1",
    7071                function() { return ((typeof(setSecuritySettings)=='function')?setSecuritySettings(1):null) },
    7172                function(identity) { return (identity.getBoolAttribute('sign_mail')) }),
    72         new vI_storageExtras_checkbox(
     73        new storageExtras_checkbox(
    7374            "PGPEnc", "storageExtras_openPGP_messageEncryption", "enigmail_encrypted_send",
    7475                function() { return ((typeof(enigSetMenuSettings)=='function')?enigSetMenuSettings(''):null) },
    7576                function(identity) { return (identity.getIntAttribute('defaultEncryptionPolicy') > 0) }),
    76         new vI_storageExtras_checkbox(
     77        new storageExtras_checkbox(
    7778            "PGPSig", "storageExtras_openPGP_messageSignature", "enigmail_signed_send",
    7879                function() { return ((typeof(enigSetMenuSettings)=='function')?enigSetMenuSettings(''):null) },
    7980                function(identity) { return ((identity.getIntAttribute('defaultEncryptionPolicy') > 0)?identity.getBoolAttribute('pgpSignEncrypted'):identity.getBoolAttribute('pgpSignPlain')) }),
    80         new vI_storageExtras_checkbox(
     81        new storageExtras_checkbox(
    8182            "PGPMIME", "storageExtras_openPGP_PGPMIME", "enigmail_sendPGPMime",
    8283                function() { return ((typeof(enigSetMenuSettings)=='function')?enigSetMenuSettings(''):null) },
     
    8687}
    8788
    88 vI_storageExtras.prototype = {
     89storageExtras.prototype = {
    8990    loopForRDF : function(rdfDatasource, resource, type) {
    9091        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");
    9293            // only if pref set and feature(element available) or for dataEditor
    9394            if (typeof(gMsgCompose) == "undefined" || !gMsgCompose || this.extras[i].active) {
     
    103104    // just give a duplicate of the current storageExtras, else we will work with pointers
    104105    getDuplicate : function() {
    105         var newExtras = new vI_storageExtras();
     106        var newExtras = new storageExtras();
    106107        for( var i = 0; i < this.extras.length; i++ ) {
    107108            newExtras.extras[i].value = this.extras[i].value;
     
    166167        for( var i = 0; i < this.extras.length; i++ ) {
    167168            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");
    169170        }
    170171    },
     
    173174        for( var i = 0; i < this.extras.length; i++ ) {
    174175            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");
    176177        }
    177178    },
    178179    readValues : function() {
    179180        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");
    181182            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");
    183184        }
    184185    },
     
    189190        for( var i = 0; i < this.extras.length; i++ ) {
    190191            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
    196197    addPrefs : function(pref) {
    197198        for( var i = 0; i < this.extras.length; i++ )
     
    200201}
    201202
    202 function vI_storageExtras_characterEncoding_setMenuMark() {
     203function storageExtras_characterEncoding_setMenuMark() {
    203204    var maileditCharsetMenu = document.getElementById("maileditCharsetMenu")
    204205    var value = maileditCharsetMenu.getAttribute("unmarkedValue")
     
    209210    }
    210211}
    211 function vI_storageExtras_characterEncoding() {
    212     this.active = vI_storageExtrasHelper.preferences.getBoolPref("storage") &&
    213                 vI_storageExtrasHelper.preferences.getBoolPref(this.option)
     212function storageExtras_characterEncoding() {
     213    this.active = storageExtrasHelper.preferences.getBoolPref("storage") &&
     214                storageExtrasHelper.preferences.getBoolPref(this.option)
    214215    this.comp = { compareValue : null, equal : null }
    215216}
    216 vI_storageExtras_characterEncoding.prototype = {
     217storageExtras_characterEncoding.prototype = {
    217218    active : null,
    218219    value : null,
     
    246247            var onpopupshowing = maileditCharsetMenu.getAttribute("onpopupshowing")
    247248            document.getElementById("maileditCharsetMenu").setAttribute("onpopupshowing",
    248                 onpopupshowing + ";vI_storageExtras_characterEncoding_setMenuMark();")
     249                onpopupshowing + ";storageExtras_characterEncoding_setMenuMark();")
    249250        }
    250251        gMsgCompose.compFields.characterSet = this.value;
     
    254255        // read the value from the internal vI object, global object might not be available any more
    255256        // happens especially while storing after sending the message
    256         this.value = vI_main.gMsgCompose.compFields.characterSet;
     257        this.value = vI.main.gMsgCompose.compFields.characterSet;
    257258        if (gCharsetConvertManager) {
    258259            var charsetAlias = gCharsetConvertManager.getCharsetAlias(this.value);
     
    281282}
    282283
    283 function vI_storageExtras_msgFormat() {
    284     this.active = vI_storageExtrasHelper.preferences.getBoolPref("storage") &&
    285                 vI_storageExtrasHelper.preferences.getBoolPref(this.option)
     284function storageExtras_msgFormat() {
     285    this.active = storageExtrasHelper.preferences.getBoolPref("storage") &&
     286                storageExtrasHelper.preferences.getBoolPref(this.option)
    286287    this.comp = { value : null, compareValue : null, equal : null }
    287288}
    288 vI_storageExtras_msgFormat.prototype = {
     289storageExtras_msgFormat.prototype = {
    289290    active : null,
    290291    value : null,
     
    338339}
    339340
    340 function vI_storageExtras_sMime_messageEncryption() {
    341     this.active = vI_storageExtrasHelper.preferences.getBoolPref("storage") &&
    342                 vI_storageExtrasHelper.preferences.getBoolPref(this.option)
     341function storageExtras_sMime_messageEncryption() {
     342    this.active = storageExtrasHelper.preferences.getBoolPref("storage") &&
     343                storageExtrasHelper.preferences.getBoolPref(this.option)
    343344    this.comp = { value : null, compareValue : null, equal : null }
    344345}
    345 vI_storageExtras_sMime_messageEncryption.prototype = {
     346storageExtras_sMime_messageEncryption.prototype = {
    346347    active : null,
    347348    value : null,
     
    375376    // function to set or read the value from/to the MessageCompose Dialog
    376377    setValue : function() {
    377         vI_notificationBar.dump("## storageExtras_sMime_messageEncryption \n");
     378        vI.notificationBar.dump("## storageExtras_sMime_messageEncryption \n");
    378379        var doEncryptElem = document.getElementById("menu_securityEncryptRequire1");
    379380        if (this.value == null) return;
     
    405406
    406407// a general checkbox for extra options. Has to provide some additional information
    407 function vI_storageExtras_checkbox(field, option, composeDialogElementID, updateFunction, identityValue) {
     408function storageExtras_checkbox(field, option, composeDialogElementID, updateFunction, identityValue) {
    408409    this.field = field;     // description of the option
    409410    this.option = option;       // option string to get preference settings
     
    411412    this.updateFunction = updateFunction;
    412413    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)
    415416//      elements are never available in DataTree, so leave this out.
    416417//      && document.getElementById(this.composeDialogElementID);
    417418    this.comp = { compareValue : null, equal : null }
    418419}
    419 vI_storageExtras_checkbox.prototype = {
     420storageExtras_checkbox.prototype = {
    420421    active : null,
    421422    value : null,
     
    457458
    458459        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");
    460461            element.doCommand();
    461462        }
     
    483484    }
    484485}
     486
     487vI.storageExtras = storageExtras;
     488vI.storageExtrasHelper = storageExtrasHelper;
     489vI.storageExtras_adapt = storageExtras_adapt;
     490}});
  • chrome/content/v_identity/vI_storageExtrasDataEditorOverlay.xul

    r92fd25 rc3feaa  
    4848        <spacer width="10px" />
    4949        <checkbox id="vI_storageExtras_hideUnusedEditorFields" label="&vI_storageExtrasDataEditorOverlay.hideUnused.label;"
    50             oncommand="vI_storageExtrasHelper.hideUnusedEditorFields();"
     50            oncommand="virtualIdentityExtension.storageExtrasHelper.hideUnusedEditorFields();"
    5151            persist="checked" />
    5252    </caption>
     
    5454    <!-- storageExtras_returnReciept -->
    5555        <hbox>
    56         <checkbox id="vI_storageExtras_returnReciept_store" oncommand="vI_storageExtras_adapt(this.id, null);" />
     56        <checkbox id="vI_storageExtras_returnReciept_store" oncommand="virtualIdentityExtension.storageExtras_adapt(this.id, null);" />
    5757        <checkbox id="vI_storageExtras_returnReciept" label="&vI_storageExtrasDataEditorOverlay.reciept.label;"/>
    5858        </hbox>
    5959    <!-- storageExtras_fcc -->
    6060        <hbox>
    61         <checkbox id="vI_storageExtras_fcc_store" oncommand="vI_storageExtras_adapt(this.id, null);" />
     61        <checkbox id="vI_storageExtras_fcc_store" oncommand="virtualIdentityExtension.storageExtras_adapt(this.id, null);" />
    6262        <checkbox id="vI_storageExtras_fcc" label="&vI_storageExtrasDataEditorOverlay.fcc.label;"/>
    6363        </hbox>
     
    6565        <hbox>
    6666        <checkbox id="vI_storageExtras_characterEncoding_store"
    67             oncommand="vI_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');" />
    6868        <hbox id="vI_storageExtras_characterEncoding">
    6969            <vbox><spacer flex="1"/>
     
    9090        <hbox>
    9191        <checkbox id="vI_storageExtras_messageFormat_store"
    92             oncommand="vI_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');" />
    9393        <hbox id="vI_storageExtras_messageFormat">
    9494            <vbox><spacer flex="1"/>
     
    108108    <!-- storageExtras_sMime_messageEncryption -->
    109109        <hbox>
    110         <checkbox id="vI_storageExtras_sMime_messageEncryption_store" oncommand="vI_storageExtras_adapt(this.id, null)" />
     110        <checkbox id="vI_storageExtras_sMime_messageEncryption_store" oncommand="virtualIdentityExtension.storageExtras_adapt(this.id, null)" />
    111111        <checkbox id="vI_storageExtras_sMime_messageEncryption"
    112112            label="&vI_storageExtrasDataEditorOverlay.sMimeEnc.label;"/>
     
    114114    <!-- storageExtras_sMime_messageSignature -->
    115115        <hbox>
    116         <checkbox id="vI_storageExtras_sMime_messageSignature_store" oncommand="vI_storageExtras_adapt(this.id, null)" />
     116        <checkbox id="vI_storageExtras_sMime_messageSignature_store" oncommand="virtualIdentityExtension.storageExtras_adapt(this.id, null)" />
    117117        <checkbox id="vI_storageExtras_sMime_messageSignature"
    118118            label="&vI_storageExtrasDataEditorOverlay.sMimeSig.label;"/>
     
    120120    <!-- storageExtras_openPGP_messageEncryption -->
    121121        <hbox>
    122         <checkbox id="vI_storageExtras_openPGP_messageEncryption_store" oncommand="vI_storageExtras_adapt(this.id, null)" />
     122        <checkbox id="vI_storageExtras_openPGP_messageEncryption_store" oncommand="virtualIdentityExtension.storageExtras_adapt(this.id, null)" />
    123123        <checkbox id="vI_storageExtras_openPGP_messageEncryption"
    124124            label="&vI_storageExtrasDataEditorOverlay.PGPEnc.label;"/>
     
    126126    <!-- storageExtras_openPGP_messageSignature -->
    127127        <hbox>
    128         <checkbox id="vI_storageExtras_openPGP_messageSignature_store" oncommand="vI_storageExtras_adapt(this.id, null)" />
     128        <checkbox id="vI_storageExtras_openPGP_messageSignature_store" oncommand="virtualIdentityExtension.storageExtras_adapt(this.id, null)" />
    129129        <checkbox id="vI_storageExtras_openPGP_messageSignature"
    130130            label="&vI_storageExtrasDataEditorOverlay.PGPSig.label;"/>
     
    132132    <!-- storageExtras_openPGP_PGPMIME -->
    133133        <hbox>
    134         <checkbox id="vI_storageExtras_openPGP_PGPMIME_store" oncommand="vI_storageExtras_adapt(this.id, null)" />
     134        <checkbox id="vI_storageExtras_openPGP_PGPMIME_store" oncommand="virtualIdentityExtension.storageExtras_adapt(this.id, null)" />
    135135        <checkbox id="vI_storageExtras_openPGP_PGPMIME"
    136136            label="&vI_storageExtrasDataEditorOverlay.PGPMIME.label;"/>
  • chrome/content/v_identity/vI_storageExtrasDataTreeOverlay.xul

    r92fd25 rc3feaa  
    3232
    3333<overlay id="vI_storageExtrasOverlay"
    34           xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" >
     34        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" >
    3535
    3636<script type="application/x-javascript" src="chrome://v_identity/content/vI_storageExtras.js" />
  • chrome/content/v_identity/vI_upgrade.js

    r92fd25 rc3feaa  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
    25 var vI_upgrade = {
     25virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     26var upgrade = {
    2627    preferences : Components.classes["@mozilla.org/preferences-service;1"]
    2728            .getService(Components.interfaces.nsIPrefService)
     
    3132            .getService(Components.interfaces.nsIVersionComparator),
    3233   
    33     vI_rdfDatasource : null,
     34    rdfDatasource : null,
    3435
    3536    init : function() {
    36         vI_upgrade.__initRequirements();
     37        upgrade.__initRequirements();
    3738        document.documentElement.getButton("cancel").setAttribute("hidden", "true")
    3839    },
    3940
    4041    clean : function() {
    41         if (vI_upgrade.vI_rdfDatasource) vI_upgrade.vI_rdfDatasource.clean();
     42        if (upgrade.rdfDatasource) upgrade.rdfDatasource.clean();
    4243    },
    4344
    4445    __initRequirements : function() {
    45         vI_notificationBar.dump("") // this initialises the debug-area
    46         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);
    4748    },
    4849   
     
    6162               
    6263        // 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();
    6768            return true;
    6869        }
     
    8182   
    8283    __upgrade : function() {
    83         if (vI_upgrade.vI_rdfDatasource.extUpgradeRequired()) vI_upgrade.extUpgrade();
     84        if (upgrade.rdfDatasource.extUpgradeRequired()) upgrade.extUpgrade();
    8485       
    85         vI_account.cleanupSystem();
     86        vI.account.cleanupSystem();
    8687    },         
    8788
    8889    upgrade : function() {
    89         vI_notificationBar.dump("starting upgrade.\n\n")
     90        vI.notificationBar.dump("starting upgrade.\n\n")
    9091        document.getElementById("upgradeWizard").setAttribute("canAdvance", "false")
    9192        document.documentElement.getButton('next').setAttribute('disabled','true');
    9293       
    93         vI_upgrade.__upgrade();
     94        upgrade.__upgrade();
    9495   
    95         vI_notificationBar.dump("\n\nupgrade finished.\n");
     96        vI.notificationBar.dump("\n\nupgrade finished.\n");
    9697       
    9798        document.documentElement.getButton('next').setAttribute('disabled','false');
     
    100101   
    101102    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 " +
    104105            currentVersion + "\nextension-upgrade required.\n")
    105106        switch (currentVersion) {
     
    107108                // no break
    108109            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);
    112113        }
    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");
    115116    },
    116117   
     
    120121            .getBranch(null);
    121122       
    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) &&
    124125                prefroot.getCharPref("mailnews.headers.extraExpandedHeaders") != "") {
    125126            // 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");
    127128            prefroot.setCharPref("mailnews.headers.extraExpandedHeaders", "")
    128             vI_notificationBar.dump("cleaned extraExpandedHeaders\n");
     129            vI.notificationBar.dump("cleaned extraExpandedHeaders\n");
    129130        }
    130         vI_notificationBar.dump("extension-upgrade __removeExtraAddedHeaders done.\n\n");
     131        vI.notificationBar.dump("extension-upgrade __removeExtraAddedHeaders done.\n\n");
    131132    },
    132133   
     
    143144        for (var i = 0; i < transferPrefs.length; i++) {
    144145            // 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)) {
    146147                // 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")
    148149                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(".")
    153154                    }
    154155                    catch (e) { };
    155156                }
    156                 vI_notificationBar.dump("done.\n")
     157                vI.notificationBar.dump("done.\n")
    157158            }
    158159        }
     
    171172        for (var i = 0; i < obsoletePrefs.length; i++) {
    172173            // 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)) {
    174175                // 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")
    176177                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(".") }
    178179                    catch (e) { };
    179180                }
    180                 vI_notificationBar.dump("done.\n")
     181                vI.notificationBar.dump("done.\n")
    181182            }
    182183        }
     
    191192        }
    192193}
     194vI.upgrade = upgrade;
    193195// 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  
    3838<wizard id="upgradeWizard" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    3939        title="&vident.upgrade.dlgTitle.label;"
    40     zlevel="6" onload="vI_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();" >
    4141
     42<script type="application/x-javascript" src="chrome://v_identity/content/vI_overlayNameSpaceWrapper.js" />
    4243<script type="application/x-javascript" src="chrome://v_identity/content/vI_upgrade.js" />
    4344<script type="application/x-javascript" src="chrome://v_identity/content/vI_account.js" />
     
    6263    </wizardpage>
    6364    <!-- features -->
    64     <wizardpage onpageshow="vI_upgrade.prepare(this);"
     65    <wizardpage onpageshow="virtualIdentityExtension.upgrade.prepare(this);"
    6566        label="&vident.upgrade.features.label;" description="&vident.upgrade.features.description;"
    6667        pageid="features" next="license" >
     
    7273    </wizardpage>
    7374    <!-- GPL license -->
    74     <wizardpage onpageshow="vI_upgrade.prepare(this);"
     75    <wizardpage onpageshow="virtualIdentityExtension.upgrade.prepare(this);"
    7576        label="&vident.upgrade.license.label;" description="&vident.upgrade.license.description;"
    7677        pageid="license" next="upgrade" >
     
    8384    </wizardpage>
    8485    <!-- upgrade procedure -->
    85     <wizardpage onpageshow="vI_upgrade.prepare(this);vI_upgrade.upgrade();"
     86    <wizardpage onpageshow="virtualIdentityExtension.upgrade.prepare(this);virtualIdentityExtension.upgrade.upgrade();"
    8687        label="&vident.upgrade.upgrade.label;" description="&vident.upgrade.upgrade.description;"
    8788        pageid="upgrade" next="finish" >
     
    9293    </wizardpage>   
    9394    <!-- finish -->
    94     <wizardpage onpageshow="vI_upgrade.prepare(this);"
     95    <wizardpage onpageshow="virtualIdentityExtension.upgrade.prepare(this);"
    9596        label="&vident.upgrade.finish.label;" description="&vident.upgrade.finish.description;"
    9697        pageid="finish" >
     
    105106    <button class="v_identity_logo v_identity_logo_button"
    106107        label="&vident.vidLogo.label; &vident.version;"
    107         oncommand="vI_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;" />
    108109    <spacer width="10px" />
    109110    <label id="extVersion" value="&vident.version;" hidden="true" />
  • chrome/content/v_identity/vI_upgradeOverlay.js

    r92fd25 rc3feaa  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
    25 var vI_upgradeOverlay = {
     25virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     26var upgradeOverlay = {
    2627    init: function() {
    27         var rdfDatasource = new vI_rdfDatasource("virtualIdentity.rdf", true);
     28        var rdfDatasource = new vI.rdfDatasource("virtualIdentity.rdf", true);
    2829        if (rdfDatasource.extUpgradeRequired()) {
    29             if (!vI_upgrade.quick_upgrade(rdfDatasource.getCurrentExtFileVersion()))
     30            if (!vI.upgrade.quick_upgrade(rdfDatasource.getCurrentExtFileVersion()))
    3031                window.open("chrome://v_identity/content/vI_upgrade.xul",0,
    3132                    "chrome, dialog, modal, alwaysRaised, resizable=yes").focus();
    3233        }
    3334        else {
    34             vI_account.cleanupSystem(); // always clean leftover accounts and directories
     35            vI.account.cleanupSystem(); // always clean leftover accounts and directories
    3536            rdfDatasource.storeExtVersion();
    3637        }
     
    6869    }
    6970}
    70 addEventListener('messagepane-loaded', vI_upgradeOverlay.init, true);
     71addEventListener('messagepane-loaded', upgradeOverlay.init, true);
     72}});
  • chrome/content/v_identity/vI_upgradeOverlay.xul

    r92fd25 rc3feaa  
    3636
    3737<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"/>   
    3941    <script type="application/x-javascript" src="chrome://v_identity/content/vI_account.js" />
    4042    <script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDatasource.js" />
    4143    <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
    4346    // include following scripts to enable quick_upgrade
    4447    <script type="application/x-javascript" src="chrome://v_identity/content/vI_upgrade.js" />
     
    4649    <script type="application/x-javascript" src="chrome://v_identity/content/vI_identityData.js" />
    4750    <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"/>
    4951
    5052    <vbox id="messagepanebox" >
  • chrome/content/v_identity/v_identity.js

    r92fd25 rc3feaa  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
    25 var vI_main = {
     25virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     26var main = {
    2627    preferences : Components.classes["@mozilla.org/preferences-service;1"]
    2728            .getService(Components.interfaces.nsIPrefService)
     
    4546    elements : {
    4647        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");
    4950        },
    5051        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");
    5455        },
    5556        strings : null
     
    5859    ComposeStateListener : {
    5960        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();
    6263        },
    6364        NotifyComposeFieldsReady: function() {
    64             vI_notificationBar.dump("## v_identity: NotifyComposeFieldsReady\n");
     65            vI.notificationBar.dump("## v_identity: NotifyComposeFieldsReady\n");
    6566        },
    6667        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.close
    69             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();
    7071        },
    7172        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();
    7576        }
    7677    },
     
    7879    replacement_functions : {
    7980        FillIdentityList: function(menulist) {
    80             vI_notificationBar.dump("## v_identity: mod. FillIdentityList\n");
     81            vI.notificationBar.dump("## v_identity: mod. FillIdentityList\n");
    8182            var mgr = Components.classes["@mozilla.org/messenger/account-manager;1"]
    8283                                .getService(Components.interfaces.nsIMsgAccountManager);
     
    112113                if (!server) continue;
    113114                // 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");
    115116                    continue; } catch (e) { };
    116117
     
    126127        GenericSendMessageInProgress : false,
    127128        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;
    130131           
    131132            // 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);
    133134
    134135            var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
    135136                .getService(Components.interfaces.nsIPromptService);
    136             vI_notificationBar.dump("\n## v_identity: VIdentity_GenericSendMessage\n");
     137            vI.notificationBar.dump("\n## v_identity: VIdentity_GenericSendMessage\n");
    137138           
    138139            var vid = document.getElementById("msgIdentity_clone").vid
    139140
    140141            if (msgType == nsIMsgCompDeliverMode.Now) {
    141                 if ( (vid && vI_main.preferences.getBoolPref("warn_virtual") &&
     142                if ( (vid && main.preferences.getBoolPref("warn_virtual") &&
    142143                    !(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") &&
    145146                    !(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;
    148149                    return;
    149150                }
    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;
    153154                    return;
    154155                }
    155                 vI_msgIdentityCloneTools.addReplyToSelf();
     156                vI.msgIdentityCloneTools.addReplyToSelf();
    156157            }
    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");
    160161
    161162            // final check if eyerything is nice before we handover to the real sending...
     
    163164
    164165            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);
    167168           
    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");
    171172
    172173            if  (currentIdentityData.fullName.toLowerCase() == virtualIdentityData.fullName.toLowerCase()   &&
    173174                currentIdentityData.email.toLowerCase() == virtualIdentityData.email.toLowerCase()      &&
    174175                virtualIdentityData.smtp.equal(currentIdentityData.smtp)    ) {
    175                     vI_main.original_functions.GenericSendMessage(msgType);
     176                    main.original_functions.GenericSendMessage(msgType);
    176177            }
    177178            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();
    183184            }
    184 //          vI_notificationBar.dump("## v_identity: original_functions.GenericSendMessage done\n");
     185//          vI.notificationBar.dump("## v_identity: original_functions.GenericSendMessage done\n");
    185186        },
    186187       
    187188        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;
    191192        }
    192193    },
    193194
    194195    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();
    200201    },
    201202
    202203    // initialization //
    203204    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("vI_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")
    214215            .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);
    217218       
    218219        // append observer to fcc_switch, because it does'n work with real identities (hidden by css)
    219220        document.getElementById("fcc_switch").appendChild(document.getElementById("msgIdentity_clone_observer").cloneNode(false));
    220221
    221         vI_main.AccountManagerObserver.register();
     222        main.AccountManagerObserver.register();
    222223       
    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")
    225226    },
    226227   
    227228    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;
    230231        document.getElementById("msgIdentity_clone").init();
    231         vI_statusmenu.init();
     232        vI.statusmenu.init();
    232233    },
    233234   
    234235    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();
    239240    },
    240241   
    241242    close : function() {
    242         vI_main.Cleanup();
    243         vI_storage.clean();
     243        main.Cleanup();
     244        vI.storage.clean();
    244245    },
    245246   
    246247    adapt_interface : function() {
    247         if (vI_main.elements.strings) return; // only rearrange the interface once
     248        if (main.elements.strings) return; // only rearrange the interface once
    248249       
    249250        // initialize the pointers to extension elements
    250         vI_main.elements.init_base()
     251        main.elements.init_base()
    251252       
    252253        // 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;
    254255        var storage_box = document.getElementById("addresses-box");
    255256        var autoReplyToSelfLabel = document.getElementById("autoReplyToSelfLabel");
     
    257258        storage_box.removeChild(autoReplyToSelfLabel);
    258259        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");
    264265       
    265266        var access_label = parent_hbox.getElementsByAttribute( "control", "msgIdentity" )[0];
     
    267268       
    268269        // initialize the pointers to extension elements (initialize those earlier might brake the interface)
    269         vI_main.elements.init_rest();   
     270        main.elements.init_rest(); 
    270271    },
    271272   
    272273    adapt_genericSendMessage : function() {
    273         if (vI_main.original_functions.GenericSendMessage) return true; // only initialize this once
    274         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;
    277278        return true;
    278279    },
    279280   
    280281    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")
    284285       
    285286        // clean all elements
    286287        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")
    289290       
    290291        // now (re)init the elements
    291         vI_main.initSystemStage1();
     292        main.initSystemStage1();
    292293       
    293294        // stateListener only works in reply-cases
     
    303304            case msgComposeType.ForwardAsAttachment:
    304305            case msgComposeType.ForwardInline:
    305                 vI_main.initSystemStage2(); break;
     306                main.initSystemStage2(); break;
    306307            case msgComposeType.Reply:
    307308            case msgComposeType.ReplyAll:
     
    311312            case msgComposeType.ReplyWithTemplate:
    312313            case msgComposeType.ReplyToList:
    313                 gMsgCompose.RegisterStateListener(vI_main.ComposeStateListener);
     314                gMsgCompose.RegisterStateListener(main.ComposeStateListener);
    314315        }
    315         vI_notificationBar.dump("## v_identity: reopen done.\n")
     316        vI.notificationBar.dump("## v_identity: reopen done.\n")
    316317    },
    317318   
     
    319320
    320321    __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"));
    325326    },
    326327
     
    328329    addVirtualIdentityToMsgIdentityMenu : function()
    329330    {
    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";
    333334       
    334335        // 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);
    342343    },
    343344   
    344345    removeVirtualIdentityFromMsgIdentityMenu : function()
    345346    {
    346         if (!vI_main.tempStorage.BaseIdentity) return; // don't try to remove Item twice
     347        if (!main.tempStorage.BaseIdentity) return; // don't try to remove Item twice
    347348        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);
    350351        } catch (e) { };
    351         vI_main.tempStorage.NewIdentity = null;
    352         vI_main.tempStorage.BaseIdentity = null;
     352        main.tempStorage.NewIdentity = null;
     353        main.tempStorage.BaseIdentity = null;
    353354    },
    354355
    355356    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();
    359360    },
    360361
    361362    Cleanup : function() {
    362         vI_main.removeVirtualIdentityFromMsgIdentityMenu();
    363         vI_account.removeUsedVIAccount();
     363        main.removeVirtualIdentityFromMsgIdentityMenu();
     364        vI.account.removeUsedVIAccount();
    364365    },
    365366   
     
    369370        observe : function(subject, topic, data) {
    370371            if (topic == "am-smtpChanges") {
    371                 vI_notificationBar.dump("## v_identity: smtp changes observed\n");
     372                vI.notificationBar.dump("## v_identity: smtp changes observed\n");
    372373                var msgIdentity_clone = document.getElementById("msgIdentity_clone");
    373374                document.getAnonymousElementByAttribute(msgIdentity_clone, "class", "smtpServerListHbox").refresh();
    374375            }
    375376            if (topic == "am-acceptChanges") {
    376                 vI_notificationBar.dump("## v_identity: account changes observed\n");
     377                vI.notificationBar.dump("## v_identity: account changes observed\n");
    377378                document.getElementById("msgIdentity_clone").clean();
    378379                document.getElementById("msgIdentity_clone").init();
     
    395396
    396397
    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 
     398main.replacement_functions.replace_FillIdentityList();
     399window.addEventListener('compose-window-init', main.init, true);
     400
     401window.addEventListener("unload", function(e) { main.AccountManagerObserver.unregister(); try {vI.statusmenu.removeObserver();} catch (ex) { } }, false);
     402vI.main = main;
     403}});
  • chrome/content/v_identity/v_identity.xml

    r92fd25 rc3feaa  
    3535          xmlns:xbl="http://www.mozilla.org/xbl">
    3636   
    37     <binding id="tooltipPopupset">
     37    <binding id="vI_tooltipPopupset">
    3838    <implementation>
    3939    <method name="addTooltip">
     
    4444        this.removeTooltip(randID);
    4545        if (!randID) {
    46             randID = "tooltip_" + parseInt((new Date()).getTime());
     46            randID = "virtualIdentityExtension_tooltip_" + parseInt((new Date()).getTime());
    4747            elem.tooltipElem.setAttribute("tooltip", randID);
    4848        }
     
    7272    <method name="popupshowing">
    7373            <body><![CDATA[
     74            virtualIdentityExtension.notificationBar.dump("** v_identity.xml vI_tooltipPopupset popupshowing.\n")
    7475        if (!this._identityInfo) {
    7576            this._identityInfo =
     
    8182                    "</td>" +
    8283                "</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")
    8485            this._tooltipBrowser.outputString = this._identityInfo;
    8586        }
     87        virtualIdentityExtension.notificationBar.dump("** v_identity.xml vI_tooltipPopupset popupshowing done.\n")
    8688        ]]></body>
    8789    </method>
     
    125127        this.label = this._identityDataStorage.combinedName;
    126128        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")
    128130
    129131        this.description = this._identityDataStorage.sideDescription;
    130132        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")
    132134        this.smtpStyle = "width:" + document.getElementById("smtp_server_list").clientWidth + "px;";
    133135        this._identityDataStorage.smtp.value;
    134136       
    135         document.getElementById("vI_tooltipPopupset").addTooltip(this, true);
     137        document.getElementById("virtualIdentityExtension_tooltipPopupset").addTooltip(this, true);
    136138        ]]>
    137139    </constructor>
    138140    <method name="clean">
    139141            <body><![CDATA[
    140         document.getElementById("vI_tooltipPopupset")
     142        document.getElementById("virtualIdentityExtension_tooltipPopupset")
    141143            .removeTooltip(this.tooltipElem.getAttribute("tooltip"));
    142144        ]]></body>
     
    167169                <xul:menupopup anonid="smtp_server_list_popup" />
    168170            </xul:menulist>
    169             <xul:checkbox  id="saveSMTPSwitch" class="vI_plain" allowevents="true" oncommand="event.stopPropagation();vI_statusmenu.changeSMTPStatus(this);" >
     171            <xul:checkbox  id="saveSMTPSwitch" class="vI_plain" allowevents="true" oncommand="event.stopPropagation();virtualIdentityExtension.statusmenu.changeSMTPStatus(this);" >
    170172                <xul:observes element="vI_statusMenu_storage_saveSMTP" attribute="checked" />
    171173                <xul:observes element="vI_statusMenu_storage_saveSMTP" attribute="disabled" />
     
    182184        listitem.setAttribute("type", "non-iconic-noaccel");
    183185        listitem.setAttribute("label", " ");
    184         listitem.setAttribute("key", vI_NO_SMTP_TAG);
     186        listitem.setAttribute("key", virtualIdentityExtension.NO_SMTP_TAG);
    185187        this._smtpPopup.insertBefore(listitem, this._smtpPopup.firstChild);
    186188        this._smtpMenu.selectedItem = listitem;
     
    242244    <property name="smtp" onget="return this._smtpMenu.selectedItem.getAttribute('key');" >
    243245        <setter><![CDATA[
    244         if (val == vI_NO_SMTP_TAG) return; // dont overwrite if not set
    245         vI_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")
    246248        var MenuItems = this._smtpPopup.childNodes
    247249        for (var index = 0; index < MenuItems.length; index++) {
     
    283285                <xul:spacer flex="1" /></xul:vbox>
    284286                <xul:vbox id="saveSwitch"><xul:spacer flex="1" />
    285                     <xul:checkbox class="vI_plain" allowevents="true" oncommand="event.stopPropagation();vI_statusmenu.changeSaveStatus(this);" >
     287                    <xul:checkbox class="vI_plain" allowevents="true" oncommand="event.stopPropagation();virtualIdentityExtension.statusmenu.changeSaveStatus(this);" >
    286288                        <xul:observes element="vI_statusMenu_storage_save" attribute="checked" />
    287289                    </xul:checkbox>
     
    300302                <xul:spacer flex="1" /></xul:vbox>
    301303                <xul:vbox id="saveBaseIDSwitch"><xul:spacer flex="1" />
    302                     <xul:checkbox class="vI_plain" allowevents="true" oncommand="event.stopPropagation();vI_statusmenu.changeBaseIDStatus(this);" >
     304                    <xul:checkbox class="vI_plain" allowevents="true" oncommand="event.stopPropagation();virtualIdentityExtension.statusmenu.changeBaseIDStatus(this);" >
    303305                        <xul:observes element="vI_statusMenu_storage_saveBaseID" attribute="checked" />
    304306                        <xul:observes element="vI_statusMenu_storage_saveBaseID" attribute="disabled" />
     
    321323        inputTextbox.setAttribute("timeout", "300")
    322324       
    323         // to ealy to access vI_tooltipPopupset, this might break the interface
     325        // too early to access virtualIdentityExtension_tooltipPopupset, this might break the interface
    324326        // it will be done in v_identity.js init
    325         // document.getElementById("vI_tooltipPopupset").addTooltip(this, false);
     327        // document.getElementById("virtualIdentityExtension_tooltipPopupset").addTooltip(this, false);
    326328       
    327329        this._prefroot.addObserver("extensions.virtualIdentity.show_smtp", this._observer, false);
     
    331333    <destructor>
    332334        <![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"));
    335337        this._prefroot.removeObserver("extensions.virtualIdentity.show_smtp", this._observer);
    336338        ]]>
     
    344346    <method name="command">
    345347        <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")
    347350        // 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")
    350352        if ( this.selectedMenuItem.identityData.id.key != null ) {
    351353            var MenuItems = this._msgIdentityPopupElem.childNodes
     
    360362        }
    361363        this.identityData = this.selectedMenuItem.identityData.getDuplicate();
    362        
     364        virtualIdentityExtension.notificationBar.dump("\n** v_identity.xml msgIdentityCloneElem.doCommand() this.value=" + this.value + "\n");
    363365        // if current SMTP is empty, take the one from current Identity
    364366        if (this.identityData.smtp.hasNoDefinedSMTP()) {
     
    381383            // else description = identity.description?"- "+identity.description:identity.accountname
    382384           
    383             var newIdentity = new vI_identityData(identity.email, identity.fullName, identity.key,
     385            var newIdentity = new virtualIdentityExtension.identityData(identity.email, identity.fullName, identity.key,
    384386                        identity.smtpServerKey, null, description, true)
    385387            newIdentity.extras.readIdentityValues(identity);
     
    490492        <getter><![CDATA[
    491493            if (!this._msgIdentityElem.selectedItem) {
    492                 vI_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");
    493495                this._msgIdentityElem.selectedItem = this._msgIdentityPopupElem.firstChild
    494                 vI_notificationBar.dump("** v_identity.xml: msgIdentityElem.doCommand()\n");
     496                virtualIdentityExtension.notificationBar.dump("** v_identity.xml: msgIdentityElem.doCommand()\n");
    495497                this._msgIdentityElem.doCommand();
    496498            }
     
    500502    <method name="blurEvent">
    501503            <body><![CDATA[
    502         vI_notificationBar.dump("\n** v_identity.xml blurEvent")
     504        virtualIdentityExtension.notificationBar.dump("\n** v_identity.xml blurEvent")
    503505        this.inputEvent(); // timeout might prevent inputEvent to fire before blurEvent
    504506       
     
    509511    <method name="inputEvent">
    510512            <body><![CDATA[     
    511         vI_notificationBar.dump("\n** v_identity.xml inputEvent\n")
     513        virtualIdentityExtension.notificationBar.dump("\n** v_identity.xml inputEvent\n")
    512514       
    513515        this.identityData.combinedName = this.label;
     
    519521    <method name="checkForVirtualIdentity">
    520522        <body><![CDATA[
    521         vI_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")
    522524        var existingIdentity = this.identityData.isExistingIdentity(false);
    523525       
    524526        this.vid = (!existingIdentity);
    525527       
    526         vI_msgIdentityCloneTools.signatureSwitch(existingIdentity);
     528        virtualIdentityExtension.msgIdentityCloneTools.signatureSwitch(existingIdentity);
    527529       
    528530        return existingIdentity;
     
    533535        this.identityData.smtp.key = val;
    534536       
    535         document.getElementById("vI_tooltipPopupset").addTooltip(this);
     537        document.getElementById("virtualIdentityExtension_tooltipPopupset").addTooltip(this);
    536538
    537539        var existingIdentity = this.checkForVirtualIdentity();
     
    545547        ]]></getter>
    546548        <setter><![CDATA[
    547         vI_notificationBar.dump("** v_identity.xml identityData setter\n")
     549        virtualIdentityExtension.notificationBar.dump("** v_identity.xml identityData setter\n")
    548550        if (!val) this._identityDataStorage = null
    549551        else {
     
    551553            this._identityDataStorage = val;
    552554            if (oldIdentityData) { // indicates that it's not first time after clean
    553                 vI_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                 vI_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");
    555557                if (!this._identityDataStorage.existingID && !this._identityDataStorage.combinedName)
    556558                    this._identityDataStorage.fullName = oldIdentityData.fullName;
     
    569571            this.description = this._identityDataStorage.sideDescription;
    570572            document.getAnonymousElementByAttribute(this, "anonid", "smtpServerListHbox").smtp = this._identityDataStorage.smtp.keyNice;
    571             vI_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         vI_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")
    574576        ]]></setter>
    575577    </property>
  • chrome/content/v_identity/v_identity.xul

    r92fd25 rc3feaa  
    3636  <overlay id="v_identity"
    3737          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" />
    3939<script type="application/x-javascript" src="chrome://v_identity/content/v_identity.js" />
    4040<script type="application/x-javascript" src="chrome://v_identity/content/vI_helper.js" />
     
    7777        tooltiptext="&vident.composeDialog.fcc_switch.tooltiptext;" hidden="true" doFcc="false"
    7878        oncommand="if (this.doFcc == this.checked) this.checked = !(this.checked); this.doFcc = this.checked;" />
    79     <popupset id="vI_tooltipPopupset" />
     79    <popupset id="virtualIdentityExtension_tooltipPopupset" />
    8080</hbox>
    8181  </vbox>
     
    8484      <menupopup id="vI_statusMenu">
    8585          <menuitem type="checkbox" id="vI_statusMenu_storage_save" label="&vident.vI_Menu.storageSave.label;"
    86             oncommand="vI_statusmenu.menuConstraint(this);"/>
     86            oncommand="virtualIdentityExtension.statusmenu.menuConstraint(this);"/>
    8787          <menuitem type="checkbox" id="vI_statusMenu_storage_saveBaseID" label="&vident.vI_Menu.saveBaseID.label;"
    88             oncommand="vI_statusmenu.menuConstraint(vI_statusmenu.objStorageSaveMenuItem);"/>
     88            oncommand="virtualIdentityExtension.statusmenu.menuConstraint(virtualIdentityExtension.statusmenu.objStorageSaveMenuItem);"/>
    8989          <menuitem type="checkbox" id="vI_statusMenu_storage_saveSMTP" label="&vident.vI_Menu.saveSMTP.label;"
    90             oncommand="vI_statusmenu.menuConstraint(vI_statusmenu.objStorageSaveMenuItem);"/>
     90            oncommand="virtualIdentityExtension.statusmenu.menuConstraint(virtualIdentityExtension.statusmenu.objStorageSaveMenuItem);"/>
    9191          <menuseparator id="vI_statusMenu_separator" />
    9292          <menuitem class="menuitem-iconic" label="&vident.vI_Menu.Settings.label;"
     
    125125              context="vI_statusMenu"
    126126              tooltip="vI_statusMenuTooltip"
    127               onclick="vI_statusmenu.clicked(event.button);" />
     127              onclick="virtualIdentityExtension.statusmenu.clicked(event.button);" />
    128128</statusbar>
    129129 
  • chrome/skin/classic/v_identity/v_identity.css

    r92fd25 rc3feaa  
    379379}
    380380
    381 #vI_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");
    383383}
    384384
Note: See TracChangeset for help on using the changeset viewer.