Changeset c3feaa


Ignore:
Timestamp:
Aug 16, 2011, 10:12:23 PM (9 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