Changeset 8f1d60


Ignore:
Timestamp:
Mar 12, 2010, 1:42:06 PM (11 years ago)
Author:
rene <rene@…>
Branches:
multiEdit, ng_0.6, ng_0.8, ng_0.9
Children:
ffaef1
Parents:
2d024f
Message:

renamed global variable vI to vI_main

Location:
chrome/content/v_identity
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/vI_account.js

    r2d024f r8f1d60  
    3535
    3636    _getBaseIdentity : function () {
    37         return gAccountManager.getIdentity(vI.elements.Obj_MsgIdentity.value);
     37        return gAccountManager.getIdentity(vI_main.elements.Obj_MsgIdentity.value);
    3838    },
    3939
     
    5959
    6060    copyPreferences : function() {
    61         if (vI.preferences.getBoolPref("copySMIMESettings")) {
     61        if (vI_main.preferences.getBoolPref("copySMIMESettings")) {
    6262            // SMIME settings
    6363            vI_notificationBar.dump("## vI_account: copy S/MIME settings\n")
     
    6767        }
    6868/*      seems not required, encryption happens before Virtual Identity account is created
    69         if (vI.preferences.getBoolPref("copyEnigmailSettings")) {
     69        if (vI_main.preferences.getBoolPref("copyEnigmailSettings")) {
    7070            // pgp/enigmail settings
    7171            vI_notificationBar.dump("## vI_account: copy PGP settings\n")
     
    8080            vI_account._copyIntAttribute("defaultEncryptionPolicy");
    8181        }   */
    82         if (vI.preferences.getBoolPref("copyAttachVCardSettings")) {
     82        if (vI_main.preferences.getBoolPref("copyAttachVCardSettings")) {
    8383            // attach vcard
    8484            vI_notificationBar.dump("## vI_account: copy VCard settings\n")
     
    210210        /*
    211211        // 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.elements.Obj_MsgIdentity.selectedItem.getAttribute("accountkey"));
    213         vI.VIdent_Account = vI_account.AccountManager.duplicateAccount(recentAccount);
     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);
    214214        // but this ends up in the following exception:
    215215        // "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIMsgAccountManager.duplicateAccount]"
     
    259259    {
    260260        if (document.getElementById("fcc_switch").getAttribute("checked")) {
    261             switch (vI.preferences.getCharPref("fccFolderPickerMode"))
     261            switch (vI_main.preferences.getCharPref("fccFolderPickerMode"))
    262262            {
    263263                case "2"  :
     
    280280                vI_notificationBar.dump ("## vI_account: preparing Fcc --- use Virtual Identity Settings\n");
    281281                vI_account.account.defaultIdentity.doFcc
    282                     = vI.preferences.getBoolPref("doFcc");
     282                    = vI_main.preferences.getBoolPref("doFcc");
    283283                vI_account.account.defaultIdentity.fccFolder
    284                     = vI.unicodeConverter.ConvertToUnicode(vI.preferences.getCharPref("fccFolder"));
     284                    = vI_main.unicodeConverter.ConvertToUnicode(vI_main.preferences.getCharPref("fccFolder"));
    285285                vI_account.account.defaultIdentity.fccFolderPickerMode
    286                     = vI.preferences.getCharPref("fccFolderPickerMode");
     286                    = vI_main.preferences.getCharPref("fccFolderPickerMode");
    287287                if (!vI_helper.olderVersion("TB", "2.0"))
    288                     vI_account.account.defaultIdentity.fccReplyFollowsParent = vI.preferences.getBoolPref("fccReplyFollowsParent");
     288                    vI_account.account.defaultIdentity.fccReplyFollowsParent = vI_main.preferences.getBoolPref("fccReplyFollowsParent");
    289289
    290290                break;
     
    298298            vI_account.account.defaultIdentity.fccFolder + " fccFolderPickerMode " +
    299299            vI_account.account.defaultIdentity.fccFolderPickerMode + "(" +
    300             vI.preferences.getCharPref("fccFolderPickerMode") + "))\n");
     300            vI_main.preferences.getCharPref("fccFolderPickerMode") + "))\n");
    301301    },
    302302   
    303303    setupDraft : function() {
    304         switch (vI.preferences.getCharPref("draftFolderPickerMode"))
     304        switch (vI_main.preferences.getCharPref("draftFolderPickerMode"))
    305305        {
    306306            case "2"  :
     
    317317            vI_notificationBar.dump ("## vI_account: preparing Draft --- use Virtual Identity Settings\n");
    318318            vI_account.account.defaultIdentity.draftFolder
    319                 = vI.unicodeConverter.ConvertToUnicode(vI.preferences.getCharPref("draftFolder"));
     319                = vI_main.unicodeConverter.ConvertToUnicode(vI_main.preferences.getCharPref("draftFolder"));
    320320            vI_account.account.defaultIdentity.draftsFolderPickerMode
    321                 = vI.preferences.getCharPref("draftFolderPickerMode");
     321                = vI_main.preferences.getCharPref("draftFolderPickerMode");
    322322            break;
    323323        }
     
    325325            vI_account.account.defaultIdentity.draftFolder + " draftsFolderPickerMode " +
    326326            vI_account.account.defaultIdentity.draftsFolderPickerMode + "(" +
    327             vI.preferences.getCharPref("draftFolderPickerMode") + "))\n");
     327            vI_main.preferences.getCharPref("draftFolderPickerMode") + "))\n");
    328328    },
    329329   
    330330    setupTemplates : function() {
    331         switch (vI.preferences.getCharPref("stationeryFolderPickerMode"))
     331        switch (vI_main.preferences.getCharPref("stationeryFolderPickerMode"))
    332332        {
    333333            case "2"  :
     
    344344            vI_notificationBar.dump ("## vI_account: preparing Templates --- use Virtual Identity Settings\n");
    345345            vI_account.account.defaultIdentity.stationeryFolder
    346                 = vI.unicodeConverter.ConvertToUnicode(vI.preferences.getCharPref("stationeryFolder"));
     346                = vI_main.unicodeConverter.ConvertToUnicode(vI_main.preferences.getCharPref("stationeryFolder"));
    347347            vI_account.account.defaultIdentity.tmplFolderPickerMode
    348                 = vI.preferences.getCharPref("stationeryFolderPickerMode");
     348                = vI_main.preferences.getCharPref("stationeryFolderPickerMode");
    349349            break;
    350350        }
     
    352352            vI_account.account.defaultIdentity.stationeryFolder + " tmplFolderPickerMode " +
    353353            vI_account.account.defaultIdentity.tmplFolderPickerMode + "(" +
    354             vI.preferences.getCharPref("stationeryFolderPickerMode") + "))\n");
     354            vI_main.preferences.getCharPref("stationeryFolderPickerMode") + "))\n");
    355355    }
    356356}
  • chrome/content/v_identity/vI_msgIdentityCloneTools.js

    r2d024f r8f1d60  
    4646            vI_notificationBar.dump("## vI_msgIdentityCloneTools: signatureSwitch hide/remove signatures\n");
    4747            // code to hide the text signature
    48             try { if (vI.preferences.getBoolPref("hide_signature") && ss_signature.length == 0) {
     48            try { if (vI_main.preferences.getBoolPref("hide_signature") && ss_signature.length == 0) {
    4949                vI_notificationBar.dump("## vI_msgIdentityCloneTools: hide text/html signature");
    5050                ss_main.signatureSwitch()
     
    5252            } } catch(vErr) { vI_notificationBar.dump(" -- missing signatureSwitch extension?\n"); };
    5353            // code to hide the sMime signature
    54             try { if (vI.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") {
     
    6262            } catch(vErr) { };
    6363            // code to hide the openGPG signature
    64             try { if (vI.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") {
  • chrome/content/v_identity/vI_smartIdentity.js

    r2d024f r8f1d60  
    7474        vI_notificationBar.dump("## vI_smartIdentity: new email: " + new_email + "\n");
    7575
    76         vI_notificationBar.setNote(vI.elements.strings.getString("vident.smartIdentity.vIUsage") + ".",
     76        vI_notificationBar.setNote(vI_main.elements.strings.getString("vident.smartIdentity.vIUsage") + ".",
    7777                    "smart_reply_notification");
    7878
     
    8585       
    8686        if (storageIdentities.number > 0) vI_smartIdentity.__smartIdentitySelection(storageIdentities, false)
    87         else if (vI.preferences.getBoolPref("autoTimestamp")) vI_smartIdentity.__autoTimestamp();   
     87        else if (vI_main.preferences.getBoolPref("autoTimestamp")) vI_smartIdentity.__autoTimestamp(); 
    8888    },
    8989   
     
    126126    __parseHeadersWithArray: function(hdr, allIdentities) {
    127127        var emails = {}; var fullNames = {}; var combinedNames = {};
    128         var number = vI.headerParser.parseHeadersWithArray(hdr, emails, fullNames, combinedNames);
     128        var number = vI_main.headerParser.parseHeadersWithArray(hdr, emails, fullNames, combinedNames);
    129129        for (var index = 0; index < number; index++) {
    130130            var newIdentity = new identityData(emails.value[index], fullNames.value[index],
     
    136136    // this function checks if we have a draft-case and Smart-Draft should replace the Identity
    137137    __SmartDraftOrReplyOnSent : function(hdr, allIdentities) {
    138         if (!vI.preferences.getBoolPref("smart_draft"))
     138        if (!vI_main.preferences.getBoolPref("smart_draft"))
    139139            { vI_notificationBar.dump("## vI_smartIdentity: SmartDraft deactivated\n"); return; }
    140140
     
    152152       
    153153        var filterList  =
    154             vI.unicodeConverter.ConvertToUnicode(vI.preferences.getCharPref("smart_reply_filter")).split(/\n/)
     154            vI_main.unicodeConverter.ConvertToUnicode(vI_main.preferences.getCharPref("smart_reply_filter")).split(/\n/)
    155155        if (filterList.length == 0) filterList[0] == ""
    156156       
     
    182182                        catch(vErr) {
    183183                            vI_notificationBar.addNote(
    184                                 vI.elements.strings.getString("vident.smartIdentity.ignoreRegExp") +
     184                                vI_main.elements.strings.getString("vident.smartIdentity.ignoreRegExp") +
    185185                                +filterList[i].replace(/\\/g,"\\\\") + " .",
    186186                                "smart_reply_notification");
     
    199199    __smartReplyCollectAddresses : function(hdr, allIdentities) {
    200200        // add emails from selected headers (stored by vI_getHeader.xul/js)
    201         var reply_headers = vI.unicodeConverter.ConvertToUnicode(vI.preferences.getCharPref("smart_reply_headers")).split(/\n/)
     201        var reply_headers = vI_main.unicodeConverter.ConvertToUnicode(vI_main.preferences.getCharPref("smart_reply_headers")).split(/\n/)
    202202                   
    203203        for (var index = 0; index < reply_headers.length; index++) {
     
    224224           
    225225            // ------------- read the stored header -------------------------------
    226             var value = vI.unicodeConverter.ConvertToUnicode(hdr.getStringProperty("vI_" + replyHeaderNameToRead))
     226            var value = vI_main.unicodeConverter.ConvertToUnicode(hdr.getStringProperty("vI_" + replyHeaderNameToRead))
    227227            vI_notificationBar.dump("## vI_smartIdentity: reading header '" +
    228228                replyHeaderNameToRead + "': '" + value + "'\n");
     
    267267        //  hidden option smart_detectByReceivedHeader will act as a switch for not RFC-compliant servers
    268268            // RFC-compliant
    269             if (vI.preferences.getBoolPref("smart_detectByReceivedHeader")) {
     269            if (vI_main.preferences.getBoolPref("smart_detectByReceivedHeader")) {
    270270                if (!hdr.getStringProperty("vI_received")) { // mail was not received
    271271                    vI_notificationBar.dump("## vI_smartIdentity: reply on non-received (sent?) mail. Using SmartDraft. \n");
     
    296296       
    297297        var smartIdentities = new identityCollection();
    298         if (storageIdentities.number == 0 || !vI.preferences.getBoolPref("idSelection_storage_ignore_smart_reply"))
     298        if (storageIdentities.number == 0 || !vI_main.preferences.getBoolPref("idSelection_storage_ignore_smart_reply"))
    299299            vI_smartIdentity.__SmartReply(hdr, smartIdentities);
    300300        else vI_notificationBar.dump("## vI_smartIdentity: SmartReply skipped, Identities in Storage found.\n");
    301301
    302302        // merge SmartReply-Identities and Storage-Identites
    303         if (vI.preferences.getBoolPref("idSelection_storage_prefer_smart_reply"))
     303        if (vI_main.preferences.getBoolPref("idSelection_storage_prefer_smart_reply"))
    304304            { smartIdentities.mergeWithoutDuplicates(storageIdentities); var allIdentities = smartIdentities; }
    305305        else
     
    313313    // this function checks if we have a reply-case and Smart-Reply should replace the Identity
    314314    __SmartReply : function(hdr, smartIdentities) {
    315         if (!vI.preferences.getBoolPref("smart_reply"))
     315        if (!vI_main.preferences.getBoolPref("smart_reply"))
    316316            { vI_notificationBar.dump("## vI_smartIdentity: SmartReply deactivated\n"); return; }
    317         if (gMsgCompose.compFields.newsgroups && !vI.preferences.getBoolPref("smart_reply_for_newsgroups")) {
     317        if (gMsgCompose.compFields.newsgroups && !vI_main.preferences.getBoolPref("smart_reply_for_newsgroups")) {
    318318            vI_notificationBar.dump("## vI_smartIdentity: SmartReply, answering to a newsgroup, aborting\n");
    319319            return;
     
    333333           
    334334            /* set default FullName */
    335             var smart_reply_defaultFullName = vI.unicodeConverter.ConvertToUnicode(vI.preferences.getCharPref("smart_reply_defaultFullName"))
     335            var smart_reply_defaultFullName = vI_main.unicodeConverter.ConvertToUnicode(vI_main.preferences.getCharPref("smart_reply_defaultFullName"))
    336336            if (smart_reply_defaultFullName != "") {
    337337                for (var index = 0; index < smartIdentities.number; index++) {
     
    347347            /* if match replace FullName with existing one, keep identity in list by now        */
    348348            /* will not be added to the menu but probably choosen with __smartIdentitySelection     */
    349             if (vI.preferences.getBoolPref("smart_reply_ignoreFullName")) {
     349            if (vI_main.preferences.getBoolPref("smart_reply_ignoreFullName")) {
    350350                vI_notificationBar.dump("## vI_smartIdentity: compare with existing Identities (ignoring FullNames).\n")
    351351           
     
    372372                allIdentities.identityDataCollection[index].id.key = existingID;    // set found identity
    373373                // if 'preferExisting' than select it and return
    374                 if (vI.preferences.getBoolPref("idSelection_preferExisting")) {
     374                if (vI_main.preferences.getBoolPref("idSelection_preferExisting")) {
    375375                    vI_notificationBar.dump("## vI_smartIdentity: found existing Identity, use without interaction.\n");
    376376                    // add all Indentities to Clone Menu before selecting and leaving the function
     
    393393        document.getElementById("msgIdentity_clone").addIdentitiesToCloneMenu(allIdentities);
    394394
    395         if (!autocreate && vI.preferences.getBoolPref("idSelection_ask") &&
    396             ((allIdentities.number == 1 && vI.preferences.getBoolPref("idSelection_ask_always"))
     395        if (!autocreate && vI_main.preferences.getBoolPref("idSelection_ask") &&
     396            ((allIdentities.number == 1 && vI_main.preferences.getBoolPref("idSelection_ask_always"))
    397397                || allIdentities.number > 1)) {
    398398            for (var index = 0; index < allIdentities.number; index++) {
     
    405405                    /* callback: */ vI_smartIdentity.changeIdentityToSmartIdentity).focus();
    406406        }
    407         else if (autocreate || vI.preferences.getBoolPref("idSelection_autocreate")) {
     407        else if (autocreate || vI_main.preferences.getBoolPref("idSelection_autocreate")) {
    408408            vI_smartIdentity.changeIdentityToSmartIdentity(allIdentities, 0);
    409409        }   
     
    415415        document.getElementById("msgIdentity_clone").selectedMenuItem = allIdentities.menuItems[selectedValue];
    416416        if (document.getElementById("msgIdentity_clone").vid) {
    417             var label=vI.elements.strings.getString("vident.smartIdentity.vIUsage");
     417            var label=vI_main.elements.strings.getString("vident.smartIdentity.vIUsage");
    418418            if (allIdentities.number > 1) label += " "
    419                 + vI.elements.strings.getString("vident.smartIdentity.moreThanOne");
     419                + vI_main.elements.strings.getString("vident.smartIdentity.moreThanOne");
    420420            vI_notificationBar.addNote(label + ".", "smart_reply_notification");
    421421        }
     
    424424   
    425425    __removeSmartIdentityFromRecipients : function(allIdentities, index) {
    426         if (!vI.preferences.getBoolPref("idSelection_removeSmartIdentityFromRecipients")) return;
     426        if (!vI_main.preferences.getBoolPref("idSelection_removeSmartIdentityFromRecipients")) return;
    427427       
    428428        // check if selected email is defined as doBcc address. If so, it should not be removed.
     
    462462                    awCleanupRows()
    463463                    vI_notificationBar.addNote(" " +
    464                         vI.elements.strings.getString("vident.smartIdentity.remRecipient"),
     464                        vI_main.elements.strings.getString("vident.smartIdentity.remRecipient"),
    465465                        "smart_reply_notification");
    466466                    break;
  • chrome/content/v_identity/vI_statusmenu.js

    r2d024f r8f1d60  
    145145        var sourceString = "vident.statusText.save." + save;
    146146        if (smtp != "off") sourceString = sourceString + ".smtp"
    147         var messageLine1 = vI.elements.strings.getString(sourceString + ".line1");
    148         var messageLine2 = vI.elements.strings.getString(sourceString + ".line2");
     147        var messageLine1 = vI_main.elements.strings.getString(sourceString + ".line1");
     148        var messageLine2 = vI_main.elements.strings.getString(sourceString + ".line2");
    149149        if (!messageLine2) {
    150150            vI_statusmenu.objStatusText.setAttribute("label", messageLine1);
  • chrome/content/v_identity/vI_storage.js

    r2d024f r8f1d60  
    106106        const enigmail_ID="{847b3a00-7ab1-11d4-8f02-006008948af5}"
    107107        if (!vI_helper.extensionActive(enigmail_ID)) {
    108             vI.preferences.setBoolPref("storageExtras_openPGP_messageEncryption", false)
    109             vI.preferences.setBoolPref("storageExtras_openPGP_messageSignature", false)
    110             vI.preferences.setBoolPref("storageExtras_openPGP_PGPMIME", false)
     108            vI_main.preferences.setBoolPref("storageExtras_openPGP_messageEncryption", false)
     109            vI_main.preferences.setBoolPref("storageExtras_openPGP_messageSignature", false)
     110            vI_main.preferences.setBoolPref("storageExtras_openPGP_PGPMIME", false)
    111111        }
    112112    },
     
    115115    firstUsedInputElement : null,   // this stores the first Element for which a Lookup in the Storage was successfull
    116116    updateVIdentityFromStorage: function(inputElement) {       
    117         if (!vI.preferences.getBoolPref("storage"))
     117        if (!vI_main.preferences.getBoolPref("storage"))
    118118            { vI_notificationBar.dump("## vI_storage: Storage deactivated\n"); return; }
    119119        vI_notificationBar.dump("## vI_storage: updateVIdentityFromStorage()\n");
     
    165165       
    166166        vI_notificationBar.dump("## vI_storage: compare with current Identity\n");
    167         if (vI.preferences.getBoolPref("storage_getOneOnly") &&                 // if requested to retrieve only storageID for first recipient entered
     167        if (vI_main.preferences.getBoolPref("storage_getOneOnly") &&                    // if requested to retrieve only storageID for first recipient entered
    168168            vI_storage.firstUsedInputElement &&                     // and the request for the first recipient was already done
    169169            vI_storage.firstUsedInputElement != inputElement &&             // and it's not the same element we changed now
    170170            !matchResults.storageData[matchIndex].equalsCurrentIdentity(false).equal)   // and this id is different than the current used one
    171                 vI_notificationBar.setNote(vI.elements.strings
     171                vI_notificationBar.setNote(vI_main.elements.strings
    172172                    .getString("vident.smartIdentity.vIStorageCollidingIdentity"),  // than drop the potential changes
    173173                    "storage_notification");
     
    180180                var msgIdentityCloneElem = document.getElementById("msgIdentity_clone")
    181181                if (    !msgIdentityCloneElem.vid ||
    182                     !vI.preferences.getBoolPref("storage_warn_vI_replace") ||
     182                    !vI_main.preferences.getBoolPref("storage_warn_vI_replace") ||
    183183                    (vI_storage.__askWarning(warning) == "accept")) {
    184184                        msgIdentityCloneElem.selectedMenuItem = matchResults.menuItem[matchIndex];
    185185                        if (msgIdentityCloneElem.vid)
    186                             vI_notificationBar.setNote(vI.elements.strings.getString("vident.smartIdentity.vIStorageUsage") + ".",
     186                            vI_notificationBar.setNote(vI_main.elements.strings.getString("vident.smartIdentity.vIStorageUsage") + ".",
    187187                            "storage_notification");
    188188                }
     
    205205        if (msgType != nsIMsgCompDeliverMode.Now) return true;
    206206        vI_notificationBar.dump("## vI_storage: ----------------------------------------------------------\n")
    207         if (!vI.preferences.getBoolPref("storage"))
     207        if (!vI_main.preferences.getBoolPref("storage"))
    208208            { vI_notificationBar.dump("## vI_storage: Storage deactivated\n"); return true; }
    209209       
     
    244244    __getWarning : function(warningCase, recipient, compareMatrix) {
    245245        var warning = { title: null, recLabel : null, recipient : null, warning : null, css: null, query : null, class : null };
    246         warning.title = vI.elements.strings.getString("vident." + warningCase + ".title")
    247         warning.recLabel = vI.elements.strings.getString("vident." + warningCase + ".recipient") + " (" + recipient.recType + "):"
     246        warning.title = vI_main.elements.strings.getString("vident." + warningCase + ".title")
     247        warning.recLabel = vI_main.elements.strings.getString("vident." + warningCase + ".recipient") + " (" + recipient.recType + "):"
    248248        warning.recipient = recipient.recDesc;
    249249        warning.warning =
    250250            "<table class='" + warningCase + "'><thead><tr><th class='col1'/>" +
    251                 "<th class='col2'>" + vI.elements.strings.getString("vident." + warningCase + ".currentIdentity") + "</th>" +
    252                 "<th class='col3'>" + vI.elements.strings.getString("vident." + warningCase + ".storedIdentity") + "</th>" +
     251                "<th class='col2'>" + vI_main.elements.strings.getString("vident." + warningCase + ".currentIdentity") + "</th>" +
     252                "<th class='col3'>" + vI_main.elements.strings.getString("vident." + warningCase + ".storedIdentity") + "</th>" +
    253253            "</tr></thead>" +
    254254            "<tbody>" + compareMatrix + "</tbody>" +
    255255            "</table>"
    256256        warning.css = "vI_DialogBrowser.css";
    257         warning.query = vI.elements.strings.getString("vident." + warningCase + ".query");
     257        warning.query = vI_main.elements.strings.getString("vident." + warningCase + ".query");
    258258        warning.class = warningCase;
    259259        return warning;
     
    270270    __updateStorageFromVIdentity : function(recipient, recipientType) {
    271271        vI_notificationBar.dump("## vI_storage: __updateStorageFromVIdentity.\n")
    272         var dontUpdateMultipleNoEqual = (vI.preferences.getBoolPref("storage_dont_update_multiple") &&
     272        var dontUpdateMultipleNoEqual = (vI_main.preferences.getBoolPref("storage_dont_update_multiple") &&
    273273                    vI_storage.multipleRecipients)
    274274        vI_notificationBar.dump("## vI_storage: __updateStorageFromVIdentity dontUpdateMultipleNoEqual='" + dontUpdateMultipleNoEqual + "'\n")
     
    289289            vI_notificationBar.dump("## vI_storage: __updateStorageFromVIdentity updating\n")
    290290            var doUpdate = "accept";
    291             if (storageDataByType && !storageDataByTypeEqual && vI.preferences.getBoolPref("storage_warn_update")) {
     291            if (storageDataByType && !storageDataByTypeEqual && vI_main.preferences.getBoolPref("storage_warn_update")) {
    292292                vI_notificationBar.dump("## vI_storage: __updateStorageFromVIdentity overwrite warning\n");
    293293                doUpdate = vI_storage.__askWarning(vI_storage.__getWarning("updateStorage", recipient, storageDataByTypeCompResult.compareMatrix));
     
    388388
    389389    getVIdentityFromAllRecipients : function(allIdentities) {
    390         if (!vI.preferences.getBoolPref("storage"))
     390        if (!vI_main.preferences.getBoolPref("storage"))
    391391            { vI_notificationBar.dump("## vI_storage: Storage deactivated\n"); return; }
    392392        vI_notificationBar.dump("## vI_storage: getVIdentityFromAllRecipients()\n");
  • chrome/content/v_identity/vI_storageExtras.js

    r2d024f r8f1d60  
    267267        // read the value from the internal vI object, global object might not be available any more
    268268        // happens especially while storing after sending the message
    269         this.value = vI.gMsgCompose.compFields.characterSet;
     269        this.value = vI_main.gMsgCompose.compFields.characterSet;
    270270        if (gCharsetConvertManager) {
    271271            var charsetAlias = gCharsetConvertManager.getCharsetAlias(this.value);
  • chrome/content/v_identity/v_identity.js

    r2d024f r8f1d60  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
    25 var vI = {
     25var vI_main = {
    2626    preferences : Components.classes["@mozilla.org/preferences-service;1"]
    2727            .getService(Components.interfaces.nsIPrefService)
     
    4646    elements : {
    4747        init_base : function() {
    48             vI.elements.Area_MsgIdentityHbox = document.getElementById("msgIdentityHbox");
    49             vI.elements.Obj_MsgIdentity = document.getElementById("msgIdentity");
     48            vI_main.elements.Area_MsgIdentityHbox = document.getElementById("msgIdentityHbox");
     49            vI_main.elements.Obj_MsgIdentity = document.getElementById("msgIdentity");
    5050        },
    5151        init_rest : function() {
    52             vI.elements.Obj_MsgIdentityPopup = document.getElementById("msgIdentityPopup");
    53             vI.elements.Obj_vILogo = document.getElementById("v_identity_logo");
    54             vI.elements.strings = document.getElementById("vIdentBundle");
     52            vI_main.elements.Obj_MsgIdentityPopup = document.getElementById("msgIdentityPopup");
     53            vI_main.elements.Obj_vILogo = document.getElementById("v_identity_logo");
     54            vI_main.elements.strings = document.getElementById("vIdentBundle");
    5555        },
    5656        strings : null
     
    6060        NotifyComposeBodyReady: function() {
    6161            vI_notificationBar.dump("## v_identity: NotifyComposeBodyReady\n");
    62             if (!vI_helper.olderVersion("TB", "2.0a")) vI.initSystemStage2();
     62            if (!vI_helper.olderVersion("TB", "2.0a")) vI_main.initSystemStage2();
    6363        },
    6464        NotifyComposeFieldsReady: function() {
    6565            vI_notificationBar.dump("## v_identity: NotifyComposeFieldsReady\n");
    66             if (vI_helper.olderVersion("TB", "2.0a")) vI.initSystemStage2();
     66            if (vI_helper.olderVersion("TB", "2.0a")) vI_main.initSystemStage2();
    6767        },
    6868        ComposeProcessDone: function(aResult) {
    6969            vI_notificationBar.dump("## v_identity: StateListener reports ComposeProcessDone\n");
    70             vI.Cleanup(); // not really required, parallel handled by vI.close
     70            vI_main.Cleanup(); // not really required, parallel handled by vI_main.close
    7171            vI_storage.clean();
    7272        },
    7373        SaveInFolderDone: function(folderURI) {
    7474            vI_notificationBar.dump("## v_identity: SaveInFolderDone\n");
    75             vI.Cleanup();
     75            vI_main.Cleanup();
    7676            vI_storage.clean();
    7777        }
     
    131131        GenericSendMessageInProgress : false,
    132132        GenericSendMessage: function (msgType) {
    133             if (vI.replacement_functions.GenericSendMessageInProgress) return;
    134             vI.replacement_functions.GenericSendMessageInProgress = true;
     133            if (vI_main.replacement_functions.GenericSendMessageInProgress) return;
     134            vI_main.replacement_functions.GenericSendMessageInProgress = true;
    135135           
    136136            var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
     
    146146                    var name = gAccountManager.defaultAccount.defaultIdentity.fullName
    147147                    var email = gAccountManager.defaultAccount.defaultIdentity.email
    148                     var query = vI.elements.strings.getString("vident.sendLater.warning") +
    149                         vI.elements.strings.getString("vident.sendLater.prefix") +
     148                    var query = vI_main.elements.strings.getString("vident.sendLater.warning") +
     149                        vI_main.elements.strings.getString("vident.sendLater.prefix") +
    150150                        name + " " + email + " [" + server + "]" +
    151                         vI.elements.strings.getString("vident.sendLater.postfix")
     151                        vI_main.elements.strings.getString("vident.sendLater.postfix")
    152152                   
    153153                    if (!promptService.confirm(window,"Error",query)) {
    154                         vI.replacement_functions.GenericSendMessageInProgress = false;
     154                        vI_main.replacement_functions.GenericSendMessageInProgress = false;
    155155                        return;
    156156                    }
     
    159159            }
    160160            else {
    161                 if ( (vid && vI.preferences.getBoolPref("warn_virtual") &&
     161                if ( (vid && vI_main.preferences.getBoolPref("warn_virtual") &&
    162162                    !(promptService.confirm(window,"Warning",
    163                         vI.elements.strings.getString("vident.sendVirtual.warning")))) ||
    164                   (!vid && vI.preferences.getBoolPref("warn_nonvirtual") &&
     163                        vI_main.elements.strings.getString("vident.sendVirtual.warning")))) ||
     164                  (!vid && vI_main.preferences.getBoolPref("warn_nonvirtual") &&
    165165                    !(promptService.confirm(window,"Warning",
    166                         vI.elements.strings.getString("vident.sendNonvirtual.warning")))) ) {
    167                     vI.replacement_functions.GenericSendMessageInProgress = false;
     166                        vI_main.elements.strings.getString("vident.sendNonvirtual.warning")))) ) {
     167                    vI_main.replacement_functions.GenericSendMessageInProgress = false;
    168168                    return;
    169169                }
    170170                if (!vI_storage.storeVIdentityToAllRecipients(msgType)) {
    171171//                  vI_notificationBar.dump("## v_identity: sending aborted\n");
    172                     vI.replacement_functions.GenericSendMessageInProgress = false;
     172                    vI_main.replacement_functions.GenericSendMessageInProgress = false;
    173173                    return;
    174174                }
    175175                vI_msgIdentityCloneTools.addReplyToSelf();
    176176            }
    177             if (vid) vI.prepareAccount();
    178             vI.replacement_functions.GenericSendMessageInProgress = false;
     177            if (vid) vI_main.prepareAccount();
     178            vI_main.replacement_functions.GenericSendMessageInProgress = false;
    179179//          vI_notificationBar.dump("## v_identity: original_functions.GenericSendMessage\n");
    180180
     
    191191                currentIdentity.email == virtualIdentityData.email      &&
    192192                virtualIdentityData.smtp.equal(currentSMTPobj)  ) {
    193                     vI.original_functions.GenericSendMessage(msgType);
     193                    vI_main.original_functions.GenericSendMessage(msgType);
    194194            }
    195195            else {
    196                 alert(vI.elements.strings.getString("vident.genericSendMessage.error"));
    197                 vI.Cleanup();
     196                alert(vI_main.elements.strings.getString("vident.genericSendMessage.error"));
     197                vI_main.Cleanup();
    198198            }
    199199//          vI_notificationBar.dump("## v_identity: original_functions.GenericSendMessage done\n");
     
    203203            if (typeof(FillIdentityList)=="function") {
    204204                //~ vI_notificationBar.dump("## v_identity: replace FillIdentityList (TB 3.x)\n");
    205                 vI.original_functions.FillIdentityList = FillIdentityList;
    206                 FillIdentityList = vI.replacement_functions.FillIdentityList;
     205                vI_main.original_functions.FillIdentityList = FillIdentityList;
     206                FillIdentityList = vI_main.replacement_functions.FillIdentityList;
    207207            }
    208208            else {
    209209                //~ vI_notificationBar.dump("## v_identity: replace FillIdentityListPopup (TB 2.x)\n");
    210                 vI.original_functions.FillIdentityListPopup = FillIdentityListPopup;
    211                 FillIdentityListPopup = vI.replacement_functions.FillIdentityListPopup;
     210                vI_main.original_functions.FillIdentityListPopup = FillIdentityListPopup;
     211                FillIdentityListPopup = vI_main.replacement_functions.FillIdentityListPopup;
    212212            }
    213213        }
     
    215215
    216216    remove: function() {
    217         window.removeEventListener('compose-window-reopen', vI.reopen, true);
    218         window.removeEventListener('compose-window-close', vI.close, true);
     217        window.removeEventListener('compose-window-reopen', vI_main.reopen, true);
     218        window.removeEventListener('compose-window-close', vI_main.close, true);
    219219        vI_notificationBar.dump("## v_identity: end. remove Account if there.\n")
    220         vI.Cleanup();
     220        vI_main.Cleanup();
    221221        vI_storage.clean();
    222222    },
     
    224224    // initialization //
    225225    init: function() {
    226         window.removeEventListener('load', vI.init, false);
    227         window.removeEventListener('compose-window-init', vI.init, true);
    228         if (vI.elements.Area_MsgIdentityHbox) return; // init done before, (?reopen)
     226        window.removeEventListener('load', vI_main.init, false);
     227        window.removeEventListener('compose-window-init', vI_main.init, true);
     228        if (vI_main.elements.Area_MsgIdentityHbox) return; // init done before, (?reopen)
    229229        vI_notificationBar.dump("\n## v_identity: init.\n")
    230         vI.unicodeConverter.charset="UTF-8";
    231         if (!vI.adapt_genericSendMessage()) { vI_notificationBar.dump("\n## v_identity: init failed.\n"); return; }
    232         vI.adapt_interface();
    233         gMsgCompose.RegisterStateListener(vI.ComposeStateListener);
     230        vI_main.unicodeConverter.charset="UTF-8";
     231        if (!vI_main.adapt_genericSendMessage()) { vI_notificationBar.dump("\n## v_identity: init failed.\n"); return; }
     232        vI_main.adapt_interface();
     233        gMsgCompose.RegisterStateListener(vI_main.ComposeStateListener);
    234234        document.getElementById("vI_tooltipPopupset")
    235235            .addTooltip(document.getElementById("msgIdentity_clone"), false);
    236         window.addEventListener('compose-window-reopen', vI.reopen, true);
    237         window.addEventListener('compose-window-close', vI.close, true);
     236        window.addEventListener('compose-window-reopen', vI_main.reopen, true);
     237        window.addEventListener('compose-window-close', vI_main.close, true);
    238238       
    239239        // append observer to fcc_switch, because it does'n work with real identities (hidden by css)
    240240        document.getElementById("fcc_switch").appendChild(document.getElementById("msgIdentity_clone_observer").cloneNode(false));
    241241
    242         vI.initSystemStage1();
     242        vI_main.initSystemStage1();
    243243        vI_notificationBar.dump("## v_identity: init done.\n\n")
    244244    },
     
    246246    initSystemStage1 : function() {
    247247        vI_notificationBar.dump("## v_identity: initSystemStage1.\n")
    248         vI.gMsgCompose = gMsgCompose;
     248        vI_main.gMsgCompose = gMsgCompose;
    249249        document.getElementById("msgIdentity_clone").init();
    250250        vI_statusmenu.init();
     
    259259   
    260260    close : function() {
    261         vI.Cleanup();
     261        vI_main.Cleanup();
    262262        vI_storage.clean();
    263263    },
    264264   
    265265    adapt_interface : function() {
    266         if (vI.elements.strings) return; // only rearrange the interface once
     266        if (vI_main.elements.strings) return; // only rearrange the interface once
    267267       
    268268        // initialize the pointers to extension elements
    269         vI.elements.init_base()
     269        vI_main.elements.init_base()
    270270       
    271271        // rearrange the positions of some elements
    272         var parent_hbox = vI.elements.Obj_MsgIdentity.parentNode;
     272        var parent_hbox = vI_main.elements.Obj_MsgIdentity.parentNode;
    273273        var storage_box = document.getElementById("addresses-box");
    274274        var autoReplyToSelfLabel = document.getElementById("autoReplyToSelfLabel");
     
    276276        storage_box.removeChild(autoReplyToSelfLabel);
    277277        parent_hbox.appendChild(autoReplyToSelfLabel);
    278         storage_box.removeChild(vI.elements.Area_MsgIdentityHbox);
    279         parent_hbox.appendChild(vI.elements.Area_MsgIdentityHbox);
    280 
    281         vI.elements.Obj_MsgIdentity.setAttribute("hidden", "true");
    282         vI.elements.Obj_MsgIdentity.previousSibling.setAttribute("control", "msgIdentity_clone");
     278        storage_box.removeChild(vI_main.elements.Area_MsgIdentityHbox);
     279        parent_hbox.appendChild(vI_main.elements.Area_MsgIdentityHbox);
     280
     281        vI_main.elements.Obj_MsgIdentity.setAttribute("hidden", "true");
     282        vI_main.elements.Obj_MsgIdentity.previousSibling.setAttribute("control", "msgIdentity_clone");
    283283       
    284284        // initialize the pointers to extension elements (initialize those earlier might brake the interface)
    285         vI.elements.init_rest();   
     285        vI_main.elements.init_rest();   
    286286    },
    287287   
    288288    adapt_genericSendMessage : function() {
    289         if (vI.original_functions.GenericSendMessage) return true; // only initialize this once
     289        if (vI_main.original_functions.GenericSendMessage) return true; // only initialize this once
    290290        vI_notificationBar.dump("## v_identity: adapt GenericSendMessage\n");
    291         vI.original_functions.GenericSendMessage = GenericSendMessage;
    292         GenericSendMessage = vI.replacement_functions.GenericSendMessage;
     291        vI_main.original_functions.GenericSendMessage = GenericSendMessage;
     292        GenericSendMessage = vI_main.replacement_functions.GenericSendMessage;
    293293        return true;
    294294    },
     
    305305       
    306306        // now (re)init the elements
    307         vI.initSystemStage1();
     307        vI_main.initSystemStage1();
    308308       
    309309        // stateListener only works in reply-cases
     
    319319            case msgComposeType.ForwardAsAttachment:
    320320            case msgComposeType.ForwardInline:
    321                 vI.initSystemStage2(); break;
     321                vI_main.initSystemStage2(); break;
    322322            case msgComposeType.Reply:
    323323            case msgComposeType.ReplyAll:
     
    326326            case msgComposeType.ReplyToSenderAndGroup:
    327327            case msgComposeType.ReplyWithTemplate:
    328                 gMsgCompose.RegisterStateListener(vI.ComposeStateListener);
     328                gMsgCompose.RegisterStateListener(vI_main.ComposeStateListener);
    329329        }
    330330        vI_notificationBar.dump("## v_identity: reopen done.\n")
     
    334334
    335335    __setSelectedIdentity : function(menuItem) {
    336         vI.elements.Obj_MsgIdentity.selectedItem = menuItem;
    337         vI.elements.Obj_MsgIdentity.setAttribute("label", menuItem.getAttribute("label"));
    338         vI.elements.Obj_MsgIdentity.setAttribute("accountname", menuItem.getAttribute("accountname"));
    339         vI.elements.Obj_MsgIdentity.setAttribute("value", menuItem.getAttribute("value"));
     336        vI_main.elements.Obj_MsgIdentity.selectedItem = menuItem;
     337        vI_main.elements.Obj_MsgIdentity.setAttribute("label", menuItem.getAttribute("label"));
     338        vI_main.elements.Obj_MsgIdentity.setAttribute("accountname", menuItem.getAttribute("accountname"));
     339        vI_main.elements.Obj_MsgIdentity.setAttribute("value", menuItem.getAttribute("value"));
    340340    },
    341341
     
    343343    addVirtualIdentityToMsgIdentityMenu : function()
    344344    {
    345         vI.tempStorage.BaseIdentity = vI.elements.Obj_MsgIdentity.selectedItem;
    346         vI.tempStorage.NewIdentity = document.createElement("menuitem");
    347         vI.tempStorage.NewIdentity.className = "identity-popup-item";
     345        vI_main.tempStorage.BaseIdentity = vI_main.elements.Obj_MsgIdentity.selectedItem;
     346        vI_main.tempStorage.NewIdentity = document.createElement("menuitem");
     347        vI_main.tempStorage.NewIdentity.className = "identity-popup-item";
    348348       
    349349        // set the account name in the choosen menu item
    350         vI.tempStorage.NewIdentity.setAttribute("label", vI_account.account.defaultIdentity.identityName);
    351         vI.tempStorage.NewIdentity.setAttribute("accountname", " - " +  vI_account.account.incomingServer.prettyName);
    352         vI.tempStorage.NewIdentity.setAttribute("accountkey", vI_account.account.key);
    353         vI.tempStorage.NewIdentity.setAttribute("value", vI_account.account.defaultIdentity.key);
    354        
    355         vI.elements.Obj_MsgIdentityPopup.appendChild(vI.tempStorage.NewIdentity);
    356         vI.__setSelectedIdentity(vI.tempStorage.NewIdentity);
     350        vI_main.tempStorage.NewIdentity.setAttribute("label", vI_account.account.defaultIdentity.identityName);
     351        vI_main.tempStorage.NewIdentity.setAttribute("accountname", " - " +  vI_account.account.incomingServer.prettyName);
     352        vI_main.tempStorage.NewIdentity.setAttribute("accountkey", vI_account.account.key);
     353        vI_main.tempStorage.NewIdentity.setAttribute("value", vI_account.account.defaultIdentity.key);
     354       
     355        vI_main.elements.Obj_MsgIdentityPopup.appendChild(vI_main.tempStorage.NewIdentity);
     356        vI_main.__setSelectedIdentity(vI_main.tempStorage.NewIdentity);
    357357    },
    358358   
    359359    removeVirtualIdentityFromMsgIdentityMenu : function()
    360360    {
    361         if (!vI.tempStorage.BaseIdentity) return; // don't try to remove Item twice
     361        if (!vI_main.tempStorage.BaseIdentity) return; // don't try to remove Item twice
    362362        try {   // might not exist anymore (window closed), so just try to remove it
    363             document.getElementById("msgIdentity").firstChild.removeChild(vI.tempStorage.NewIdentity);
    364             vI.__setSelectedIdentity(vI.tempStorage.BaseIdentity);
     363            document.getElementById("msgIdentity").firstChild.removeChild(vI_main.tempStorage.NewIdentity);
     364            vI_main.__setSelectedIdentity(vI_main.tempStorage.BaseIdentity);
    365365        } catch (e) { };
    366         vI.tempStorage.NewIdentity = null;
    367         vI.tempStorage.BaseIdentity = null;
     366        vI_main.tempStorage.NewIdentity = null;
     367        vI_main.tempStorage.BaseIdentity = null;
    368368    },
    369369
    370370    prepareAccount : function() {
    371         vI.Cleanup(); // just to be sure that nothing is left (maybe last time sending was irregularily stopped)
     371        vI_main.Cleanup(); // just to be sure that nothing is left (maybe last time sending was irregularily stopped)
    372372        vI_account.createAccount();
    373         vI.addVirtualIdentityToMsgIdentityMenu();
     373        vI_main.addVirtualIdentityToMsgIdentityMenu();
    374374    },
    375375
    376376    Cleanup : function() {
    377         vI.removeVirtualIdentityFromMsgIdentityMenu();
     377        vI_main.removeVirtualIdentityFromMsgIdentityMenu();
    378378        vI_account.removeUsedVIAccount();
    379379    }
     
    381381
    382382
    383 vI.replacement_functions.replace_FillIdentityList();
    384 window.addEventListener('load', vI.init, false);        // TB 1.5x, SM
    385 window.addEventListener('compose-window-init', vI.init, true);  // TB 2.x 3.x
     383vI_main.replacement_functions.replace_FillIdentityList();
     384window.addEventListener('load', vI_main.init, false);       // TB 1.5x, SM
     385window.addEventListener('compose-window-init', vI_main.init, true); // TB 2.x 3.x
    386386
    387387window.addEventListener("unload", function(e) { try {vI_statusmenu.removeObserver();} catch (ex) { } }, false);
Note: See TracChangeset for help on using the changeset viewer.