Changeset dc1dce


Ignore:
Timestamp:
Jan 26, 2015, 8:31:03 PM (7 years ago)
Author:
rene <rene@…>
Branches:
ng_0.9
Children:
0a7b3f
Parents:
d7c9a6
Message:

keep currentWindow trough all objects - further testing required

Files:
26 edited

Legend:

Unmodified
Added
Removed
  • content/bindings/vI_htmlTextBox.xml

    rd7c9a6 rdc1dce  
    166166    <constructor>
    167167        <![CDATA[       
    168         virtualIdentityExtension.MyLog.debug('******* vI_htmlTextBox.xml constructor\n');
     168        virtualIdentityExtension.MyLog.debug('******* vI_htmlTextBox.xml constructor');
    169169        ]]>
    170170    </constructor>
     
    173173        <setter><![CDATA[
    174174        if (!val) return;
    175         virtualIdentityExtension.MyLog.debug("cssSource set to " + val + "\n");
    176175        var head = this.contentDocument.getElementsByTagName("HEAD").item(0);
    177176        var range = document.createRange();
    178177        range.selectNode(head);
    179178        var css_text = this._getContents("chrome://v_identity/skin/" + val);
    180         virtualIdentityExtension.MyLog.debug("cssSource set to " + val + " cont.\n");
    181179        var documentFragment = range.createContextualFragment("<style type='text/css'>" + css_text + "</style>");
    182180        head.appendChild(documentFragment);
    183         virtualIdentityExtension.MyLog.debug("cssSource set to " + val + " done\n");
     181        virtualIdentityExtension.MyLog.debug("cssSource set to " + val + " done");
    184182        this._cssRead = true;
    185183        ]]></setter>
  • content/bindings/v_identity.xml

    rd7c9a6 rdc1dce  
    383383    </method>   
    384384    <method name="init">
    385         <body><![CDATA[
     385    <body><![CDATA[
    386386        var MenuItems = this._msgIdentityPopupElem.childNodes
    387387        for (var index = 0; index < MenuItems.length; index++) {
     
    397397            // else description = identity.description?"- "+identity.description:identity.accountname
    398398           
    399             var newIdentity = new virtualIdentityExtension.identityData(identity.email, identity.fullName, identity.key,
     399      var newIdentity = new virtualIdentityExtension.identityData(window, identity.email, identity.fullName, identity.key,
    400400                        identity.smtpServerKey, null, description, true)
    401401            newIdentity.extras.readIdentityValues(identity);
  • content/prefDialog/vI_prefDialog.xul

    rd7c9a6 rdc1dce  
    588588                    oncommand="virtualIdentityExtension.prefDialog.base.storageConstraint(this);" />
    589589                <spacer class="paragraph"/>
    590                 <button id="VIdent_identity.storage.import" label="&vI_prefDialog.storage.import;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasourceImporter('virtualIdentity.rdf');" />
    591                 <button id="VIdent_identity.storage.export" label="&vI_prefDialog.storage.export;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasource(); vI_localRdfDatasource.export('virtualIdentity.rdf')" />
     590                <button id="VIdent_identity.storage.import" label="&vI_prefDialog.storage.import;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasourceImporter(window, 'virtualIdentity.rdf');" />
     591                <button id="VIdent_identity.storage.export" label="&vI_prefDialog.storage.export;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasource(window); vI_localRdfDatasource.export('virtualIdentity.rdf')" />
    592592                </groupbox>
    593593                <groupbox>
  • content/vI_context.xul

    rd7c9a6 rdc1dce  
    6666                        <menuitem label="&vident.vI_Menu.DataEditor.label;"
    6767                            oncommand="window.open('chrome://v_identity/content/vI_rdfDataTree.xul', '', 'chrome, dialog, resizable=yes');" />
    68                         <menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasourceImporter('virtualIdentity.rdf');"/>
    69                         <menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasource(); vI_localRdfDatasource.export('virtualIdentity.rdf')"/>
     68                        <menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasourceImporter(window, 'virtualIdentity.rdf');"/>
     69                        <menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasource(window); vI_localRdfDatasource.export('virtualIdentity.rdf')"/>
    7070                    </menupopup>
    7171                </menu>
  • content/vI_rdfDataEditor.js

    rd7c9a6 rdc1dce  
    5555        rdfDataEditor.__rdfDatasource = window.arguments[2];
    5656        rdfDataEditor.__rdfDataTree = window.arguments[3];;
    57         rdfDataEditor.__identityData = new vI.identityData();
     57        rdfDataEditor.__identityData = new vI.identityData(window);
    5858        rdfDataEditor.__identityData.copy(window.arguments[0].identityData);
    5959
     
    125125      blurEvent: function (elementId) {
    126126        var elem = document.getElementById(elementId);
    127         var localIdentityData = new vI.identityData(elem.value, null, null, null, null, null, null);
     127        var localIdentityData = new vI.identityData(window, elem.value, null, null, null, null, null, null);
    128128        elem.value = localIdentityData.combinedName;
    129129      },
     
    131131      accept: function () {
    132132        Log.debug("accept");
    133         var localIdentityData = new vI.identityData(document.getElementById("sender").value, null,
     133        var localIdentityData = new vI.identityData(window, document.getElementById("sender").value, null,
    134134          document.getElementById("virtualIdentityExtension_IdentityList").selectedItem.getAttribute("value"),
    135135          document.getElementById("virtualIdentityExtension_SmtpServerList").selectedItem.getAttribute("key"));
  • content/vI_rdfDataTree.js

    rd7c9a6 rdc1dce  
    244244          .createBundle("chrome://v_identity/locale/vI_rdfDataEditor.properties");
    245245
    246         rdfDataTreeCollection._rdfDatasource = new vI.rdfDatasource("virtualIdentity.rdf");
     246        rdfDataTreeCollection._rdfDatasource = new vI.rdfDatasource(window, "virtualIdentity.rdf");
    247247
    248248        for each(var treeType in rdfDataTreeCollection.treeTypes)
     
    547547        var treeType = rdfDataTreeCollection.tabbox.selectedPanel.id;
    548548        var newItemPreset = {
    549           identityData: new vI.identityData("", null, null, vI.NO_SMTP_TAG, null, null)
     549          identityData: new vI.identityData(window, "", null, null, vI.NO_SMTP_TAG, null, null)
    550550        };
    551551        var retVar = {
  • content/vI_rdfDataTree.xul

    rd7c9a6 rdc1dce  
    114114        <menu id="tasksMenu" label="&tasksMenu.label;" accesskey="&tasksMenu.accesskey;">
    115115        <menupopup>
    116             <menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasourceImporter('virtualIdentity.rdf');"/>
    117             <menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasource(); vI_localRdfDatasource.export('virtualIdentity.rdf')"/>
     116            <menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasourceImporter(window, 'virtualIdentity.rdf');"/>
     117            <menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand="var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasource(); vI_localRdfDatasource.export(window, 'virtualIdentity.rdf')"/>
    118118        </menupopup>
    119119        </menu>
  • content/vI_storage.js

    rd7c9a6 rdc1dce  
    110110        if (!storage.initialized) {
    111111          Log.debug("initializing storage request environment");
    112           storage._rdfDatasourceAccess = new vI.rdfDatasourceAccess();
     112          storage._rdfDatasourceAccess = new vI.rdfDatasourceAccess(window);
    113113
    114114          // better approach would be to use te onchange event, but this one is not fired in any change case
     
    194194        var currentIdentity = currentDocument.getElementById("virtualIdentityExtension_msgIdentityClone").identityData
    195195        var storageResult = storage._rdfDatasourceAccess.updateVIdentityFromStorage(inputElement.value, recipientType,
    196           currentIdentity, currentDocument.getElementById("virtualIdentityExtension_msgIdentityClone").vid, isNotFirstInputElement, window);
     196          currentIdentity, currentDocument.getElementById("virtualIdentityExtension_msgIdentityClone").vid, isNotFirstInputElement);
    197197
    198198        if (storageResult.identityCollection.number == 0) return; // return if there was no match
  • content/vI_upgrade.js

    rd7c9a6 rdc1dce  
    3939
    4040      quickUpgrade: function (currentVersion) {
    41         upgrade.rdfDatasource = new vI.rdfDatasource("virtualIdentity.rdf", true);
     41        upgrade.rdfDatasource = new vI.rdfDatasource(window, "virtualIdentity.rdf", true);
    4242        if (upgrade.rdfDatasource.extUpgradeRequired())
    4343          upgrade.extUpgrade();
  • content/v_identity.js

    rd7c9a6 rdc1dce  
    142142            var virtualIdentityData = document.getElementById("virtualIdentityExtension_msgIdentityClone").identityData;
    143143
    144             let returnValue = vI.vIaccount_prepareSendMsg(vid, msgType, virtualIdentityData,
     144            let returnValue = vI.vIaccount_prepareSendMsg(window, vid, msgType, virtualIdentityData,
    145145              main.accountManager.getIdentity(main.elements.Obj_MsgIdentity.value),
    146               main._getRecipients(), window);
     146              main._getRecipients());
    147147            if (returnValue.update == "abort") {
    148148              main.replacement_functions.GenericSendMessageInProgress = false;
     
    159159            if (vid) main.addVirtualIdentityToMsgIdentityMenu();
    160160            // final check if eyerything is nice before we handover to the real sending...
    161             if (vI.vIaccount_finalCheck(virtualIdentityData, getCurrentIdentity())) {
     161            if (vI.vIaccount_finalCheck(window, virtualIdentityData, getCurrentIdentity())) {
    162162              main.replacement_functions.GenericSendMessageInProgress = false;
    163163              main.original_functions.GenericSendMessage(msgType);
  • modules/identityDataExtras/PGPEncryption.js

    rd7c9a6 rdc1dce  
    3636
    3737function identityDataExtrasObject_PGPEncryption(currentWindow) {
    38   this.currentWindow = currentWindow;
     38  this._currentWindow = currentWindow;
    3939  this.field = "PGPEnc"; // description of the option
    4040  this.option = "storageExtras_openPGP_messageEncryption"; // option string to get preference settings
    41   this.enigmail_active = (typeof this.currentWindow.Enigmail != 'undefined');
     41  this.enigmail_active = (typeof this._currentWindow.Enigmail != 'undefined');
    4242
    4343  // enigmail preferences have changed into 1.7 - check for enigmail version
    44   if (this.enigmail_active && vc.compare(this.currentWindow.EnigmailCommon.getVersion(), "1.7") < 0) {
     44  if (this.enigmail_active && vc.compare(this._currentWindow.EnigmailCommon.getVersion(), "1.7") < 0) {
    4545    this.elementID_msgCompose = "enigmail_encrypted_send";
    4646    this.updateFunction_msgCompose = function () {
    47       (typeof (this.currentWindow.Enigmail.msg.setMenuSettings) == 'function') ? this.currentWindow.Enigmail.msg.setMenuSettings(''): null
     47      (typeof (this._currentWindow.Enigmail.msg.setMenuSettings) == 'function') ? this._currentWindow.Enigmail.msg.setMenuSettings(''): null
    4848    };
    4949  } else {
     
    6464
    6565    if (this.value == "true") {
    66       this.currentWindow.Enigmail.msg.setFinalSendMode("final-encryptYes");
     66      this._currentWindow.Enigmail.msg.setFinalSendMode("final-encryptYes");
    6767    } else {
    68       this.currentWindow.Enigmail.msg.setFinalSendMode("final-encryptNo");
     68      this._currentWindow.Enigmail.msg.setFinalSendMode("final-encryptNo");
    6969    }
    7070  },
     
    7373    if (this.enigmail_active && this.active) {
    7474      this.value = (
    75         this.currentWindow.Enigmail.msg.statusEncrypted == this.currentWindow.EnigmailCommon.ENIG_FINAL_YES ||
    76         this.currentWindow.Enigmail.msg.statusEncrypted == this.currentWindow.EnigmailCommon.ENIG_FINAL_FORCEYES) ? "true" : "false";
     75        this._currentWindow.Enigmail.msg.statusEncrypted == this._currentWindow.EnigmailCommon.ENIG_FINAL_YES ||
     76        this._currentWindow.Enigmail.msg.statusEncrypted == this._currentWindow.EnigmailCommon.ENIG_FINAL_FORCEYES) ? "true" : "false";
    7777    }
    7878  }
  • modules/identityDataExtras/PGPMIME.js

    rd7c9a6 rdc1dce  
    3636
    3737function identityDataExtrasObject_PGPMIME(currentWindow) {
    38   this.currentWindow = currentWindow;
     38  this._currentWindow = currentWindow;
    3939  this.field = "PGPMIME"; // description of the option
    4040  this.option = "storageExtras_openPGP_PGPMIME"; // option string to get preference settings
    41   this.enigmail_active = (typeof this.currentWindow.Enigmail != 'undefined');
     41  this.enigmail_active = (typeof this._currentWindow.Enigmail != 'undefined');
    4242
    4343  // enigmail preferences have changed into 1.7 - check for enigmail version
    44   if (this.enigmail_active && vc.compare(this.currentWindow.EnigmailCommon.getVersion(), "1.7") < 0) {
     44  if (this.enigmail_active && vc.compare(this._currentWindow.EnigmailCommon.getVersion(), "1.7") < 0) {
    4545    this.elementID_msgCompose = "enigmail_sendPGPMime";
    4646    this.updateFunction_msgCompose = function () {
    47       (typeof (this.currentWindow.Enigmail.msg.setMenuSettings) == 'function') ? this.currentWindow.Enigmail.msg.setMenuSettings(''): null
     47      (typeof (this._currentWindow.Enigmail.msg.setMenuSettings) == 'function') ? this._currentWindow.Enigmail.msg.setMenuSettings(''): null
    4848    };
    4949  } else {
     
    6464
    6565    if (this.value == "true") {
    66       this.currentWindow.Enigmail.msg.setFinalSendMode("final-pgpmimeYes");
     66      this._currentWindow.Enigmail.msg.setFinalSendMode("final-pgpmimeYes");
    6767    } else {
    68       this.currentWindow.Enigmail.msg.setFinalSendMode("final-pgpmimeNo");
     68      this._currentWindow.Enigmail.msg.setFinalSendMode("final-pgpmimeNo");
    6969    }
    7070  },
     
    7373    if (this.enigmail_active && this.active) {
    7474      this.value = (
    75         this.currentWindow.Enigmail.msg.statusPGPMime == this.currentWindow.EnigmailCommon.ENIG_FINAL_YES ||
    76         this.currentWindow.Enigmail.msg.statusPGPMime == this.currentWindow.EnigmailCommon.ENIG_FINAL_FORCEYES) ? "true" : "false";
     75        this._currentWindow.Enigmail.msg.statusPGPMime == this._currentWindow.EnigmailCommon.ENIG_FINAL_YES ||
     76        this._currentWindow.Enigmail.msg.statusPGPMime == this._currentWindow.EnigmailCommon.ENIG_FINAL_FORCEYES) ? "true" : "false";
    7777    }
    7878  }
  • modules/identityDataExtras/PGPSignature.js

    rd7c9a6 rdc1dce  
    3636
    3737function identityDataExtrasObject_PGPSignature(currentWindow) {
    38   this.currentWindow = currentWindow;
     38  this._currentWindow = currentWindow;
    3939  this.field = "PGPSig"; // description of the option
    4040  this.option = "storageExtras_openPGP_messageSignature"; // option string to get preference settings
    41   this.enigmail_active = (typeof this.currentWindow.Enigmail != 'undefined');
     41  this.enigmail_active = (typeof this._currentWindow.Enigmail != 'undefined');
    4242
    4343  // enigmail preferences have changed into 1.7 - check for enigmail version
    44   if (this.enigmail_active && vc.compare(this.currentWindow.EnigmailCommon.getVersion(), "1.7") < 0) {
     44  if (this.enigmail_active && vc.compare(this._currentWindow.EnigmailCommon.getVersion(), "1.7") < 0) {
    4545    this.elementID_msgCompose = "enigmail_signed_send";
    4646    this.updateFunction_msgCompose = function () {
    47       (typeof (this.currentWindow.Enigmail.msg.setMenuSettings) == 'function') ? this.currentWindow.Enigmail.msg.setMenuSettings(''): null
     47      (typeof (this._currentWindow.Enigmail.msg.setMenuSettings) == 'function') ? this._currentWindow.Enigmail.msg.setMenuSettings(''): null
    4848    };
    4949  } else {
     
    6969
    7070    if (this.value == "true") {
    71       this.currentWindow.Enigmail.msg.setFinalSendMode("final-signYes");
     71      this._currentWindow.Enigmail.msg.setFinalSendMode("final-signYes");
    7272    } else {
    73       this.currentWindow.Enigmail.msg.setFinalSendMode("final-signNo");
     73      this._currentWindow.Enigmail.msg.setFinalSendMode("final-signNo");
    7474    }
    7575  },
     
    7878    if (this.enigmail_active && this.active) {
    7979      this.value = (
    80         this.currentWindow.Enigmail.msg.statusSigned == this.currentWindow.EnigmailCommon.ENIG_FINAL_YES ||
    81         this.currentWindow.Enigmail.msg.statusSigned == this.currentWindow.EnigmailCommon.ENIG_FINAL_FORCEYES) ? "true" : "false";
     80        this._currentWindow.Enigmail.msg.statusSigned == this._currentWindow.EnigmailCommon.ENIG_FINAL_YES ||
     81        this._currentWindow.Enigmail.msg.statusSigned == this._currentWindow.EnigmailCommon.ENIG_FINAL_FORCEYES) ? "true" : "false";
    8282    }
    8383  }
  • modules/identityDataExtras/characterEncoding.js

    rd7c9a6 rdc1dce  
    4343
    4444function identityDataExtrasObject_characterEncoding(currentWindow) {
    45   this.currentWindow = currentWindow;
     45  this._currentWindow = currentWindow;
    4646  this.field = "charEnc"; // description of the option
    4747  this.option = "storageExtras_characterEncoding"; // option string to get preference settings
     
    5454  },
    5555  get valueNice() {
    56     return this.value ? this.currentWindow.gCharsetConvertManager
    57       .getCharsetTitle(this.currentWindow.gCharsetConvertManager.getCharsetAlias(this.value)) : "";
     56    return this.value ? this._currentWindow.gCharsetConvertManager
     57      .getCharsetTitle(this._currentWindow.gCharsetConvertManager.getCharsetAlias(this.value)) : "";
    5858  },
    5959
    6060  // pre TB-32-version, might be removed in the future --------------------------------
    6161  _setMenuMark: function () {
    62     var maileditCharsetMenu = this.currentWindow.document.getElementById("maileditCharsetMenu")
     62    var maileditCharsetMenu = this._currentWindow.document.getElementById("maileditCharsetMenu")
    6363    var value = maileditCharsetMenu.getAttribute("unmarkedValue")
    6464    if (value) {
    65       var menuitem = this.currentWindow.document.getElementById(value);
     65      var menuitem = this._currentWindow.document.getElementById(value);
    6666      if (menuitem)
    6767        menuitem.setAttribute('checked', 'true');
     
    7777    if (legacy) {
    7878      // old style
    79       var menuitem = this.currentWindow.document.getElementById(this.value);
     79      var menuitem = this._currentWindow.document.getElementById(this.value);
    8080      if (menuitem)
    8181        menuitem.setAttribute('checked', 'true');
    8282      else { // set menumark later if menu is not ready yet
    83         var maileditCharsetMenu = this.currentWindow.document.getElementById("maileditCharsetMenu")
     83        var maileditCharsetMenu = this._currentWindow.document.getElementById("maileditCharsetMenu")
    8484        maileditCharsetMenu.setAttribute("unmarkedValue", this.value)
    8585        var onpopupshowing = maileditCharsetMenu.getAttribute("onpopupshowing")
    86         this.currentWindow.document.getElementById("maileditCharsetMenu").setAttribute("onpopupshowing",
     86        this._currentWindow.document.getElementById("maileditCharsetMenu").setAttribute("onpopupshowing",
    8787          onpopupshowing + ";this._setMenuMark();")
    8888      }
    8989    }
    9090    // ----------------------------------------------------------------------------------
    91     this.currentWindow.gMsgCompose.compFields.characterSet = this.value;
    92     this.currentWindow.SetDocumentCharacterSet(this.value);
     91    this._currentWindow.gMsgCompose.compFields.characterSet = this.value;
     92    this._currentWindow.SetDocumentCharacterSet(this.value);
    9393  },
    9494
     
    9696    // pre TB-32-version, might be removed in the future --------------------------------
    9797    if (legacy) {
    98       this.currentWindow.CreateMenu('mailedit'); // this is part of the magic included by the xul-binding
     98      this._currentWindow.CreateMenu('mailedit'); // this is part of the magic included by the xul-binding
    9999      if (this.value != null) {
    100         this.currentWindow.document.getElementById("maileditCharsetMenu").selectedItem = this.currentWindow.document.getElementById(this.value);
    101         this.currentWindow.document.getElementById("vI_" + this.option + "_store").setAttribute("checked", "true");
     100        this._currentWindow.document.getElementById("maileditCharsetMenu").selectedItem = this._currentWindow.document.getElementById(this.value);
     101        this._currentWindow.document.getElementById("vI_" + this.option + "_store").setAttribute("checked", "true");
    102102      }
    103103    }
    104104    // ----------------------------------------------------------------------------------
    105105    else {
    106       CharsetMenu.build(this.currentWindow.document.getElementById("charsetPopup"), false, false)
     106      CharsetMenu.build(this._currentWindow.document.getElementById("charsetPopup"), false, false)
    107107      if (this.value != null) {
    108         CharsetMenu.update(this.currentWindow.document.getElementById("maileditCharsetMenu"), this.value);
    109         this.currentWindow.document.getElementById("maileditCharsetMenu").setAttribute("label", CharsetMenu._getCharsetLabel(this.value));
    110         this.currentWindow.document.getElementById("vI_" + this.option + "_store").setAttribute("checked", "true");
     108        CharsetMenu.update(this._currentWindow.document.getElementById("maileditCharsetMenu"), this.value);
     109        this._currentWindow.document.getElementById("maileditCharsetMenu").setAttribute("label", CharsetMenu._getCharsetLabel(this.value));
     110        this._currentWindow.document.getElementById("vI_" + this.option + "_store").setAttribute("checked", "true");
    111111      }
    112112    }
    113     this.currentWindow.document.getElementById("vI_" + this.option + "_store").doCommand();
     113    this._currentWindow.document.getElementById("vI_" + this.option + "_store").doCommand();
    114114  },
    115115
     
    117117    // read the value from the internal vI object, global object might not be available any more
    118118    // happens especially while storing after sending the message
    119     this.value = this.currentWindow.gMsgCompose.compFields.characterSet;
    120     if (this.currentWindow.gCharsetConvertManager) {
    121       var charsetAlias = this.currentWindow.gCharsetConvertManager.getCharsetAlias(this.value);
     119    this.value = this._currentWindow.gMsgCompose.compFields.characterSet;
     120    if (this._currentWindow.gCharsetConvertManager) {
     121      var charsetAlias = this._currentWindow.gCharsetConvertManager.getCharsetAlias(this.value);
    122122      if (charsetAlias == "us-ascii")
    123123        this.value = "ISO-8859-1"; // no menu item for "us-ascii"
     
    126126
    127127  getValueFromEnvironment_dataEditor: function () {
    128     if (this.currentWindow.document.getElementById("vI_" + this.option + "_store").getAttribute("checked") == "true")
     128    if (this._currentWindow.document.getElementById("vI_" + this.option + "_store").getAttribute("checked") == "true")
    129129    // check if element is selected (list might not contain relevant entry)
    130       if (this.currentWindow.document.getElementById("maileditCharsetMenu").selectedItem)
     130      if (this._currentWindow.document.getElementById("maileditCharsetMenu").selectedItem)
    131131      // pre TB-32-version, might be removed in the future --------------------------------
    132132        if (legacy) {
    133           this.value = this.currentWindow.document.getElementById("maileditCharsetMenu").selectedItem.id
     133          this.value = this._currentWindow.document.getElementById("maileditCharsetMenu").selectedItem.id
    134134        }
    135135        // ----------------------------------------------------------------------------------
    136136        else {
    137           this.value = this.currentWindow.document.getElementById("maileditCharsetMenu").selectedItem.getAttribute('charset');
     137          this.value = this._currentWindow.document.getElementById("maileditCharsetMenu").selectedItem.getAttribute('charset');
    138138        } else
    139139      this.value = null;
  • modules/identityDataExtras/fccSwitch.js

    rd7c9a6 rdc1dce  
    3535
    3636function identityDataExtrasObject_fccSwitch(currentWindow) {
    37   this.currentWindow = currentWindow;
     37  this._currentWindow = currentWindow;
    3838  this.field = "fcc"; // description of the option
    3939  this.option = "storageExtras_fcc"; // option string to get preference settings
     
    4848
    4949  setValueToEnvironment_msgCompose: function () {
    50     var element = this.currentWindow.document.getElementById(this.elementID_msgCompose);
     50    var element = this._currentWindow.document.getElementById(this.elementID_msgCompose);
    5151    if (!this.active || (this.value == null) || !element)
    5252      return;
  • modules/identityDataExtras/messageFormat.js

    rd7c9a6 rdc1dce  
    3535
    3636function identityDataExtrasObject_messageFormat(currentWindow) {
    37   this.currentWindow = currentWindow;
     37  this._currentWindow = currentWindow;
    3838  this.field = "msgFormat"; // description of the option
    3939  this.option = "storageExtras_messageFormat"; // option string to get preference settings
     
    4747  },
    4848  get valueNice() {
    49     return this.value ? this.currentWindow.document.getElementById(this.value).label : "";
     49    return this.value ? this._currentWindow.document.getElementById(this.value).label : "";
    5050  },
    5151
     
    5353    if (this.value == null)
    5454      return
    55     this.currentWindow.document.getElementById("outputFormatMenu").removeAttribute("hidden");
    56     this.currentWindow.document.getElementById(this.value).setAttribute("checked", "true");
    57     this.currentWindow.OutputFormatMenuSelect(this.currentWindow.document.getElementById(this.value))
     55    this._currentWindow.document.getElementById("outputFormatMenu").removeAttribute("hidden");
     56    this._currentWindow.document.getElementById(this.value).setAttribute("checked", "true");
     57    this._currentWindow.OutputFormatMenuSelect(this._currentWindow.document.getElementById(this.value))
    5858  },
    5959
    6060  setValueToEnvironment_dataEditor: function () {
    6161    if (this.value != null) {
    62       this.currentWindow.document.getElementById("outputFormatMenu").selectedItem = this.currentWindow.document.getElementById(this.value);
    63       this.currentWindow.document.getElementById("vI_" + this.option + "_store").setAttribute("checked", "true");
     62      this._currentWindow.document.getElementById("outputFormatMenu").selectedItem = this._currentWindow.document.getElementById(this.value);
     63      this._currentWindow.document.getElementById("vI_" + this.option + "_store").setAttribute("checked", "true");
    6464    }
    65     this.currentWindow.document.getElementById("vI_" + this.option + "_store").doCommand();
     65    this._currentWindow.document.getElementById("vI_" + this.option + "_store").doCommand();
    6666  },
    6767
    6868  getValueFromEnvironment_msgCompose: function () {
    6969    const nsIMsgCompSendFormat = Components.interfaces.nsIMsgCompSendFormat;
    70     switch (this.currentWindow.gSendFormat) {
     70    switch (this._currentWindow.gSendFormat) {
    7171    case nsIMsgCompSendFormat.AskUser:
    7272      this.value = "format_auto";
     
    8585
    8686  getValueFromEnvironment_dataEditor: function () {
    87     if (this.currentWindow.document.getElementById("vI_" + this.option + "_store").getAttribute("checked") == "true")
    88       this.value = this.currentWindow.document.getElementById("outputFormatMenu").selectedItem.id
     87    if (this._currentWindow.document.getElementById("vI_" + this.option + "_store").getAttribute("checked") == "true")
     88      this.value = this._currentWindow.document.getElementById("outputFormatMenu").selectedItem.id
    8989    else
    9090      this.value = null;
  • modules/identityDataExtras/returnReceipt.js

    rd7c9a6 rdc1dce  
    3535
    3636function identityDataExtrasObject_ReturnReceipt(currentWindow) {
    37   this.currentWindow = currentWindow;
     37  this._currentWindow = currentWindow;
    3838  this.field = "receipt"; // description of the option
    3939  this.option = "storageExtras_returnReciept"; // option string to get preference settings
  • modules/identityDataExtras/sMimeEncryption.js

    rd7c9a6 rdc1dce  
    3535
    3636function identityDataExtrasObject_sMimeEncryption(currentWindow) {
    37   this.currentWindow = currentWindow;
     37  this._currentWindow = currentWindow;
    3838  this.field = "sMimeEnc"; // description of the option
    3939  this.option = "storageExtras_sMime_messageEncryption"; // option string to get preference settings
    4040  this.elementID_msgCompose = "menu_securityEncryptRequire1";
    4141  this.updateFunction_msgCompose = function () {
    42     (typeof (this.currentWindow.setSecuritySettings) == 'function') ? this.currentWindow.setSecuritySettings(1): null
     42    (typeof (this._currentWindow.setSecuritySettings) == 'function') ? this._currentWindow.setSecuritySettings(1): null
    4343  };
    4444}
  • modules/identityDataExtras/sMimeSignature.js

    rd7c9a6 rdc1dce  
    3535
    3636function identityDataExtrasObject_sMimeSignature(currentWindow) {
    37   this.currentWindow = currentWindow;
     37  this._currentWindow = currentWindow;
    3838  this.field = "sMimeSig"; // description of the option
    3939  this.option = "storageExtras_sMime_messageSignature"; // option string to get preference settings
    4040  this.elementID_msgCompose = "menu_securitySign1";
    4141  this.updateFunction_msgCompose = function () {
    42     (typeof (this.currentWindow.setSecuritySettings) == 'function') ? this.currentWindow.setSecuritySettings(1): null
     42    (typeof (this._currentWindow.setSecuritySettings) == 'function') ? this._currentWindow.setSecuritySettings(1): null
    4343  };
    4444}
  • modules/plugins/conversations.js

    rd7c9a6 rdc1dce  
    8989    }
    9090
    91     currentIdentityData = new identityData(identity.email, identity.fullName, identity.key,
     91    let recentWindow = Cc["@mozilla.org/appshell/window-mediator;1"]
     92      .getService(Ci.nsIWindowMediator)
     93      .getMostRecentWindow("mail:3pane");
     94    currentIdentityData = new identityData(recentWindow, identity.email, identity.fullName, identity.key,
    9295      identity.smtpServerKey, null, server.prettyName, true)
    9396    currentIdSenderName = currentIdentityData.combinedName;
     
    104107      })
    105108
    106     var localSmartIdentityCollection = new smartIdentityCollection(aComposeSession.params.msgHdr, identity,
    107       false, false, recipients);
     109    let recentWindow = Cc["@mozilla.org/appshell/window-mediator;1"]
     110      .getService(Ci.nsIWindowMediator)
     111      .getMostRecentWindow("mail:3pane");
     112
     113    var localSmartIdentityCollection = new smartIdentityCollection(recentWindow, aComposeSession.params.msgHdr, identity,
     114      false, false, recipients, null);
    108115    localSmartIdentityCollection.Reply(); // we can always use the reply-case, msgHdr is set the right way
    109116
     
    168175          .getMostRecentWindow("mail:3pane");
    169176
    170         returnValue = vIaccount_prepareSendMsg(virtualIdInUse, Ci.nsIMsgCompDeliverMode.Now,
    171           currentIdentityData, aAddress.params.identity, recipients, recentWindow);
     177        returnValue = vIaccount_prepareSendMsg(recentWindow, virtualIdInUse, Ci.nsIMsgCompDeliverMode.Now,
     178          currentIdentityData, aAddress.params.identity, recipients);
    172179        Log.debug("returnValue.update:", returnValue.update);
    173180
     
    182189
    183190        aAddress.params.identity = get_vIaccount().defaultIdentity;
    184         if (!vIaccount_finalCheck(currentIdentityData, aAddress.params.identity)) {
     191        if (!vIaccount_finalCheck(recentWindow, currentIdentityData, aAddress.params.identity)) {
    185192          vIaccount_removeUsedVIAccount();
    186193          aStatus.canceled = true;
     
    212219    Log.debug("onRecipientAdded isNotFirstInputElement", isNotFirstInputElement);
    213220
    214     if (!_rdfDatasourceAccess) _rdfDatasourceAccess = new rdfDatasourceAccess();
    215     else _rdfDatasourceAccess.clean();
    216 
    217221    let recentWindow = Cc["@mozilla.org/appshell/window-mediator;1"]
    218222      .getService(Ci.nsIWindowMediator)
    219223      .getMostRecentWindow("mail:3pane");
    220224
     225    if (!_rdfDatasourceAccess) _rdfDatasourceAccess = new rdfDatasourceAccess(recentWindow);
     226    else _rdfDatasourceAccess.clean();
     227
    221228    var storageResult = _rdfDatasourceAccess.updateVIdentityFromStorage(aData.data, "addr_to",
    222       currentIdentityData, virtualIdInUse, isNotFirstInputElement, recentWindow);
     229      currentIdentityData, virtualIdInUse, isNotFirstInputElement);
    223230
    224231    if (storageResult.identityCollection.number == 0) return; // return if there was no match
  • modules/vI_account.js

    rd7c9a6 rdc1dce  
    4444let Log = setupLogging("virtualIdentity.account");
    4545
    46 function vIaccount_prepareSendMsg(vid, msgType, identityData, baseIdentity, recipients, currentWindow) {
     46function vIaccount_prepareSendMsg(currentWindow, vid, msgType, identityData, baseIdentity, recipients) {
    4747  var stringBundle = Services.strings.createBundle("chrome://v_identity/locale/v_identity.properties");
    4848
     
    7070    }
    7171    if (vIprefs.get("storage") && vIprefs.get("storage_store")) {
    72       var localeDatasourceAccess = new rdfDatasourceAccess();
    73       var returnValue = localeDatasourceAccess.storeVIdentityToAllRecipients(identityData, recipients, currentWindow)
     72      var localeDatasourceAccess = new rdfDatasourceAccess(currentWindow);
     73      var returnValue = localeDatasourceAccess.storeVIdentityToAllRecipients(identityData, recipients)
    7474      if (returnValue.update == "abort" || returnValue.update == "takeover") {
    7575        Log.debug("prepareSendMsg: sending aborted");
     
    8888};
    8989
    90 function vIaccount_finalCheck(virtualIdentityData, currentIdentity) {
     90function vIaccount_finalCheck(currentWindow, virtualIdentityData, currentIdentity) {
    9191  var stringBundle = Services.strings.createBundle("chrome://v_identity/locale/v_identity.properties");
    9292
    9393  // identityData(email, fullName, id, smtp, extras, sideDescription, existingID)
    94   var currentIdentityData = new identityData(currentIdentity.email, currentIdentity.fullName, null, currentIdentity.smtpServerKey, null, null, null);
     94  var currentIdentityData = new identityData(currentWindow, currentIdentity.email, currentIdentity.fullName, null, currentIdentity.smtpServerKey, null, null, null);
    9595
    9696  Log.debug("SendMessage Final Check");
  • modules/vI_identityData.js

    rd7c9a6 rdc1dce  
    4444Components.utils.import("resource://v_identity/identityDataExtras/PGPMIME.js");
    4545
    46 function identityData(email, fullName, id, smtp, extras, sideDescription, existingID) {
     46function identityData(currentWindow, email, fullName, id, smtp, extras, sideDescription, existingID) {
     47  this._currentWindow = currentWindow;
    4748  this._email = email ? email : "";
    4849  this._emailParsed = false;
     
    5152  this.smtp = new smtpObj(smtp);
    5253  if (extras) this.extras = extras;
    53   else this.extras = new identityDataExtras();
     54  else this.extras = new identityDataExtras(currentWindow);
    5455  this.comp = { // holds the results of the last comparison for later creation of a compareMatrix
    5556    compareID: null,
     
    7374  _fullName: null,
    7475  _emailParsed: null,
     76  _currentWindow: null,
    7577  id: null,
    7678  smtp: null,
     
    165167  // creates an Duplicate of the current IdentityData, cause usually we are working with a pointer
    166168  getDuplicate: function () {
    167     return new identityData(this.email, this.fullName, this.id.key, this.smtp.key, this.extras ? this.extras.getDuplicate() : null, this.sideDescription, this.existingID);
     169    return new identityData(this._currentWindow, this.email, this.fullName, this.id.key, this.smtp.key, this.extras ? this.extras.getDuplicate() : null,
     170      this.sideDescription, this.existingID);
    168171  },
    169172
     
    176179    this.sideDescription = identityData.sideDescription;
    177180    if (this.extras) this.extras.copy(identityData.extras);
     181    // don't copy the currentWindow value
    178182  },
    179183
  • modules/vI_identityDataExtras.js

    rd7c9a6 rdc1dce  
    4747}
    4848
    49 function identityDataExtras(rdfDatasource, resource, currentWindow) {
     49function identityDataExtras(currentWindow, rdfDatasource, resource) {
     50  this._currentWindow = currentWindow;
    5051  this.extras = [];
    51   if (currentWindow) {
    52     this._currentWindow = currentWindow;
    53   } else {
    54     this._currentWindow = Cc["@mozilla.org/appshell/window-mediator;1"]
    55       .getService(Ci.nsIWindowMediator)
    56       .getMostRecentWindow(null);
    57   }
    5852  for each(let [, identityDataExtrasObject] in Iterator(idExtrasObjects)) {
    5953    try {
     
    8781  // just give a duplicate of the current identityDataExtras, else we will work with pointers
    8882  getDuplicate: function () {
    89     var newExtras = new identityDataExtras(null, null, this._currentWindow);
     83    var newExtras = new identityDataExtras(this._currentWindow);
    9084    this.loopThroughExtras(function (extra, i) {
    9185      newExtras.extras[i].value = extra.value;
     
    169163
    170164function identityDataExtrasObject(currentWindow) {
    171   this.currentWindow = currentWindow;
     165  this._currentWindow = currentWindow;
    172166}
    173167identityDataExtrasObject.prototype = {
     168  _currentWindow: null, // the current Window the object was created for
     169
    174170  value: null, // will contain the current value of the object and can be accessed from outside
    175171  field: null, // short description of the field
    176172  option: null, // option from preferences, boolean
    177   window: null, // the current Window the object was created for
    178173
    179174  lastCompareValue: "",
     
    213208  // function to set or read the value from/to the environment
    214209  setValueToEnvironment: function () {
    215     let id = this.currentWindow.document.documentElement.id;
     210    let id = this._currentWindow.document.documentElement.id;
    216211    switch (id) {
    217212    case "msgcomposeWindow":
     
    230225  },
    231226  getValueFromEnvironment: function () {
    232     let id = this.currentWindow.document.documentElement.id;
     227    let id = this._currentWindow.document.documentElement.id;
    233228    switch (id) {
    234229    case "msgcomposeWindow":
     
    268263
    269264function identityDataExtrasCheckboxObject(currentWindow) {
    270   this.currentWindow = currentWindow;
     265  this._currentWindow = currentWindow;
    271266}
    272267identityDataExtrasCheckboxObject.prototype = {
     268  _currentWindow: null, // the current Window the object was created for
     269
    273270  __proto__: identityDataExtrasObject.prototype,
    274271
     
    282279
    283280  setValueToEnvironment_msgCompose: function () {
    284     var element = this.currentWindow.document.getElementById(this.elementID_msgCompose);
     281    var element = this._currentWindow.document.getElementById(this.elementID_msgCompose);
    285282    if (!this.active || (this.value == null) || !element)
    286283      return;
     
    295292  setValueToEnvironment_dataEditor: function () {
    296293    if (this.value != null) {
    297       this.currentWindow.document.getElementById("vI_" + this.option).setAttribute("checked", this.value);
    298       this.currentWindow.document.getElementById("vI_" + this.option + "_store").setAttribute("checked", "true");
    299     }
    300     this.currentWindow.document.getElementById("vI_" + this.option + "_store").doCommand();
     294      this._currentWindow.document.getElementById("vI_" + this.option).setAttribute("checked", this.value);
     295      this._currentWindow.document.getElementById("vI_" + this.option + "_store").setAttribute("checked", "true");
     296    }
     297    this._currentWindow.document.getElementById("vI_" + this.option + "_store").doCommand();
    301298  },
    302299
    303300  getValueFromEnvironment_msgCompose: function () {
    304     var element = this.currentWindow.document.getElementById(this.elementID_msgCompose)
     301    var element = this._currentWindow.document.getElementById(this.elementID_msgCompose)
    305302    if (this.active && element) {
    306303      this.updateFunction_msgCompose();
     
    310307
    311308  getValueFromEnvironment_dataEditor: function () {
    312     if (this.currentWindow.document.getElementById("vI_" + this.option + "_store").getAttribute("checked") == "true") {
    313       var elementValue = this.currentWindow.document.getElementById("vI_" + this.option).getAttribute("checked");
     309    if (this._currentWindow.document.getElementById("vI_" + this.option + "_store").getAttribute("checked") == "true") {
     310      var elementValue = this._currentWindow.document.getElementById("vI_" + this.option).getAttribute("checked");
    314311      this.value = (elementValue == "true") ? "true" : "false"
    315312    } else
  • modules/vI_rdfDatasource.js

    rd7c9a6 rdc1dce  
    4141  return mail3paneWindow;
    4242};
    43 
    44 function rdfDatasource(rdfFileName, dontRegisterObserver) {
    45   this._rdfFileName = rdfFileName;
    46   if (this._rdfFileName) this.init();
    47   if (!dontRegisterObserver) this.AccountManagerObserver.register();
    48   try {
    49     this._extVersion = get3PaneWindow().virtualIdentityExtension.extensionVersion;
    50   } catch (e) {}
    51 }
    5243
    5344function initWithFilePath_tryDelimiters(_nsILocalFile, path, filename) {
     
    7465};
    7566
     67function rdfDatasource(currentWindow, rdfFileName, dontRegisterObserver) {
     68  this._currentWindow = currentWindow;
     69  this._rdfFileName = rdfFileName;
     70  if (this._rdfFileName) this.init();
     71  if (!dontRegisterObserver) this.AccountManagerObserver.register();
     72  try {
     73    this._extVersion = get3PaneWindow().virtualIdentityExtension.extensionVersion;
     74  } catch (e) {}
     75}
     76
    7677rdfDatasource.prototype = {
     78  _currentWindow: null,
    7779  _extVersion: null,
    7880  _rdfVersion: "0.0.5",
     
    663665
    664666    let self = this;
    665     var extras = new identityDataExtras(self, resource)
     667    var extras = new identityDataExtras(this._currentWindow, self, resource)
    666668    extras.loopThroughExtras(
    667669      function (extra) {
     
    699701      if (!smtp) smtp = NO_SMTP_TAG;
    700702      let self = this;
    701       var localIdentityData = new identityData(email, fullName, id, smtp, new identityDataExtras(self, resource))
     703      var localIdentityData = new identityData(this._currentWindow, email, fullName, id, smtp,
     704        new identityDataExtras(this._currentWindow, self, resource))
    702705      addNewDatum(resource, name, localIdentityData, idData, used, changed)
    703706    }
     
    718721    } else {
    719722      Log.debug("__getDescriptionAndType: '" + recipient + "' is no MailList");
    720       var localIdentityData = new identityData(recipient, null, null, null, null, null, null);
     723      var localIdentityData = new identityData(this._currentWindow, recipient, null, null, null, null, null, null);
    721724      return {
    722725        recDesc: localIdentityData.combinedName,
     
    836839
    837840    let self = this;
    838     var localIdentityData = new identityData(email, fullName, id, smtp, new identityDataExtras(self, resource))
     841    var localIdentityData = new identityData(this._currentWindow, email, fullName, id, smtp,
     842      new identityDataExtras(this._currentWindow, self, resource))
    839843    return localIdentityData;
    840844  },
     
    956960
    957961
    958 function rdfDatasourceAccess() {
    959   this._rdfDataSource = new rdfDatasource("virtualIdentity.rdf", false);
     962function rdfDatasourceAccess(currentWindow) {
     963  this._currentWindow = currentWindow;
     964  this._rdfDataSource = new rdfDatasource(this._currentWindow, "virtualIdentity.rdf", false);
    960965  this.stringBundle = Services.strings.createBundle("chrome://v_identity/locale/v_identity.properties");
    961966}
    962967
    963968rdfDatasourceAccess.prototype = {
     969  _currentWindow: null,
    964970  _rdfDataSource: null,
    965971  stringBundle: null,
     
    969975  },
    970976
    971   updateVIdentityFromStorage: function (recipientName, recipientType, currentIdentity, currentIdentityIsVid, isNotFirstInputElement, currentWindow) {
     977  updateVIdentityFromStorage: function (recipientName, recipientType, currentIdentity, currentIdentityIsVid, isNotFirstInputElement) {
    972978    var localIdentities = new identityCollection();
    973979    localIdentities.addWithoutDuplicates(this._rdfDataSource.readVIdentityFromRDF(recipientName, recipientType));
     
    9961002          if (!currentIdentityIsVid ||
    9971003            !vIprefs.get("storage_warn_vI_replace") ||
    998             (this.__askWarning(warning, currentWindow) == "accept")) {
     1004            (this.__askWarning(warning) == "accept")) {
    9991005            returnValue.result = "accept";
    10001006          }
     
    10071013  },
    10081014
    1009   storeVIdentityToAllRecipients: function (identityData, recipients, currentWindow) {
     1015  storeVIdentityToAllRecipients: function (identityData, recipients) {
    10101016    var multipleRecipients = (recipients.length > 1);
    10111017    var dontUpdateMultipleNoEqual = (vIprefs.get("storage_dont_update_multiple") && multipleRecipients)
     
    10161022    };
    10171023    for (var j = 0; j < recipients.length; j++) {
    1018       returnValue = this.__updateStorageFromVIdentity(identityData, recipients[j].recipient, recipients[j].recipientType, dontUpdateMultipleNoEqual, currentWindow);
     1024      returnValue = this.__updateStorageFromVIdentity(identityData, recipients[j].recipient, recipients[j].recipientType, dontUpdateMultipleNoEqual);
    10191025      if (returnValue.update != "accept") break;
    10201026    }
     
    10351041  },
    10361042
    1037   __updateStorageFromVIdentity: function (identityData, recipient, recipientType, dontUpdateMultipleNoEqual, currentWindow) {
     1043  __updateStorageFromVIdentity: function (identityData, recipient, recipientType, dontUpdateMultipleNoEqual) {
    10381044    Log.debug("__updateStorageFromVIdentity.")
    10391045    var storageDataByType = this._rdfDataSource.readVIdentityFromRDF(recipient, recipientType);
     
    10521058      if (storageDataByType && !storageDataByTypeEqual && vIprefs.get("storage_warn_update")) {
    10531059        Log.debug("__updateStorageFromVIdentity overwrite warning");
    1054         doUpdate = this.__askWarning(this.__getWarning("updateStorage", recipient, storageDataByTypeCompResult.compareMatrix), currentWindow);
     1060        doUpdate = this.__askWarning(this.__getWarning("updateStorage", recipient, storageDataByTypeCompResult.compareMatrix));
    10551061      }
    10561062    }
     
    10881094  },
    10891095
    1090   __askWarning: function (warning, currentWindow) {
     1096  __askWarning: function (warning) {
    10911097    var retVar = {
    10921098      returnValue: null
    10931099    };
    1094     var answer = currentWindow.openDialog("chrome://v_identity/content/vI_Dialog.xul", "",
     1100    var answer = this._currentWindow.openDialog("chrome://v_identity/content/vI_Dialog.xul", "",
    10951101      "chrome, dialog, modal, alwaysRaised, resizable=yes",
    10961102      warning, retVar)
     
    11021108
    11031109// create with name of the file to import into
    1104 function rdfDatasourceImporter(rdfFileName) {
     1110function rdfDatasourceImporter(currentWindow, rdfFileName) {
     1111  this._currentWindow = currentWindow;
    11051112  this._rdfFileName = rdfFileName;
    11061113  if (this._rdfFileName) this.import();
     
    11081115
    11091116rdfDatasourceImporter.prototype = {
     1117  _currentWindow: null,
    11101118  _rdfService: Components.classes["@mozilla.org/rdf/rdf-service;1"]
    11111119    .getService(Components.interfaces.nsIRDFService),
     
    12391247
    12401248      // init Datasources
    1241       this._rdfImportDataSource = new rdfDatasource(importRdfDataFile.leafName, true);
     1249      this._rdfImportDataSource = new rdfDatasource(this._currentWindow, importRdfDataFile.leafName, true);
    12421250
    12431251      // search matching IDs and SMTPs for anyones used in import-file
     
    12491257      for each(let treeType in Array("email", "maillist", "newsgroup", "filter")) {
    12501258        // re-initialize importDataSource to point rdfService to the right Resources
    1251         this._rdfImportDataSource = new rdfDatasource(importRdfDataFile.leafName, true);
     1259        this._rdfImportDataSource = new rdfDatasource(this._currentWindow, importRdfDataFile.leafName, true);
    12521260        var container = this._rdfImportDataSource.getContainer(treeType)
    12531261        if (container.GetCount() == 0) continue;
     
    12551263        var enumerator = container.GetElements();
    12561264        // re-initialize dataSource to point rdfService to the right Resources
    1257         this._rdfDataSource = new rdfDatasource(this._rdfFileName, true);
     1265        this._rdfDataSource = new rdfDatasource(this._currentWindow, this._rdfFileName, true);
    12581266        var count = 0;
    12591267        while (enumerator.hasMoreElements()) {
     
    12691277          var smtp = this._rdfImportDataSource._getRDFValue(resource, "smtp")
    12701278          smtp = (smtp && smtp != DEFAULT_SMTP_TAG) ? relevantSMTPs[smtp].smtp : smtp
    1271           var localIdentityData = new identityData(email, fullName, id, smtp, new identityDataExtras(this._rdfImportDataSource, resource))
     1279          var localIdentityData = new identityData(this._currentWindow, email, fullName, id, smtp,
     1280            new identityDataExtras(this._currentWindow, this._rdfImportDataSource, resource))
    12721281
    12731282          this._rdfDataSource.updateRDF(name, treeType, localIdentityData, false, false, null, null, true)
     
    12841293
    12851294      Log.debug("import: cleaning ID/SMTP storages:");
    1286       this._rdfDataSource = new rdfDatasource(this._rdfFileName, true);
     1295      this._rdfDataSource = new rdfDatasource(this._currentWindow, this._rdfFileName, true);
    12871296
    12881297      this._storeMappedIDs(relevantIDs);
  • modules/vI_smartIdentity.js

    rd7c9a6 rdc1dce  
    3333
    3434function smartIdentity(currentWindow, msgCompose, storage) {
    35   this._window = currentWindow;
     35  this._currentWindow = currentWindow;
    3636  this._document = currentWindow.document;
    3737  this._msgCompose = msgCompose;
     
    7474      msgHdr = this.messenger.
    7575      messageServiceFromURI(this._msgCompose.originalMsgURI).messageURIToMsgHdr(this._msgCompose.originalMsgURI);
    76       this._smartIdentityCollection = new smartIdentityCollection(msgHdr, this._window.getCurrentIdentity(), this._document.getElementById("virtualIdentityExtension_msgIdentityClone").vid, newsgroup, this._getRecipients(this._window));
     76      this._smartIdentityCollection = new smartIdentityCollection(this._currentWindow, msgHdr, this._currentWindow.getCurrentIdentity(), this._document.getElementById("virtualIdentityExtension_msgIdentityClone").vid,
     77        newsgroup, this._getRecipients());
    7778      this._smartIdentityCollection.Reply();
    7879      autocreate = false;
     
    8384      msgHdr = this.messenger.
    8485      messageServiceFromURI(this._msgCompose.compFields.draftId).messageURIToMsgHdr(this._msgCompose.compFields.draftId);
    85       this._smartIdentityCollection = new smartIdentityCollection(msgHdr, this._window.getCurrentIdentity(), this._document.getElementById("virtualIdentityExtension_msgIdentityClone").vid, newsgroup, this._getRecipients(this._window));
     86      this._smartIdentityCollection = new smartIdentityCollection(this._currentWindow, msgHdr, this._currentWindow.getCurrentIdentity(), this._document.getElementById("virtualIdentityExtension_msgIdentityClone").vid,
     87        newsgroup, this._getRecipients());
    8688      this._smartIdentityCollection.Draft();
    8789      autocreate = false;
     
    9395    case msgComposeTypeReference.MailToUrl:
    9496      Log.debug("New Mail");
    95       this._smartIdentityCollection = new smartIdentityCollection(null, this._window.getCurrentIdentity(), this._document.getElementById("virtualIdentityExtension_msgIdentityClone").vid, newsgroup, this._getRecipients(this._window));
     97      this._smartIdentityCollection = new smartIdentityCollection(this._currentWindow, null, this._currentWindow.getCurrentIdentity(), this._document.getElementById("virtualIdentityExtension_msgIdentityClone").vid,
     98        newsgroup, this._getRecipients());
    9699      // to enable composing new email with new identity: identity is hidden in subject line
    97100      // used for instance from conversation addon
     
    111114  _getRecipients: function () {
    112115    var recipients = [];
    113     for (var row = 1; row <= this._window.top.MAX_RECIPIENTS; row++) {
    114       var recipientType = this._window.awGetPopupElement(row).selectedItem.getAttribute("value");
     116    for (var row = 1; row <= this._currentWindow.top.MAX_RECIPIENTS; row++) {
     117      var recipientType = this._currentWindow.awGetPopupElement(row).selectedItem.getAttribute("value");
    115118      if (recipientType == "addr_reply" || recipientType == "addr_followup" ||
    116         this._storage.isDoBcc(row, this._window) || this._window.awGetInputElement(row).value.match(/^\s*$/)) continue;
     119        this._storage.isDoBcc(row, this._currentWindow) || this._currentWindow.awGetInputElement(row).value.match(/^\s*$/)) continue;
    117120      recipients.push({
    118         recipient: this._window.awGetInputElement(row).value,
     121        recipient: this._currentWindow.awGetInputElement(row).value,
    119122        recipientType: recipientType
    120123      });
     
    147150        Log.debug("smartIdentityReplyDialog index=" + index + ": '" + this._smartIdentityCollection._allIdentities.identityDataCollection[index].combinedName + "' " + "(" + this._smartIdentityCollection._allIdentities.identityDataCollection[index].id.value + "," + this._smartIdentityCollection._allIdentities.identityDataCollection[index].smtp.value + ")");
    148151      }
    149       this._window.openDialog("chrome://v_identity/content/vI_smartReplyDialog.xul", 0,
     152      this._currentWindow.openDialog("chrome://v_identity/content/vI_smartReplyDialog.xul", 0,
    150153        "chrome, dialog, modal, alwaysRaised, resizable=yes",
    151154        this._smartIdentityCollection._allIdentities, this,
     
    176179    // check if selected email is defined as doBcc address. If so, it should not be removed.
    177180    var skip_bcc = false;
    178     if (this._window.getCurrentIdentity().doBcc) {
     181    if (this._currentWindow.getCurrentIdentity().doBcc) {
    179182      var bcc_addresses = new identityCollection();
    180       this.__parseHeadersWithArray(this._window.getCurrentIdentity().doBccList, bcc_addresses);
     183      this.__parseHeadersWithArray(this._currentWindow.getCurrentIdentity().doBccList, bcc_addresses);
    181184
    182185      for (var i = 0; i < bcc_addresses.number; i++) {
     
    190193    // check if there is more than one recipient for this mail. If not, preserve the only one existing.
    191194    var recipientCount = 0;
    192     for (var row = 1; row <= this._window.top.MAX_RECIPIENTS; row++) {
    193       var recipientType = this._window.awGetPopupElement(row).selectedItem.getAttribute("value");
     195    for (var row = 1; row <= this._currentWindow.top.MAX_RECIPIENTS; row++) {
     196      var recipientType = this._currentWindow.awGetPopupElement(row).selectedItem.getAttribute("value");
    194197      if (recipientType == "addr_to" || recipientType == "addr_cc") recipientCount++;
    195198    }
     
    197200
    198201
    199     for (var row = 1; row <= this._window.top.MAX_RECIPIENTS; row++) {
    200       var popup = this._window.awGetPopupElement(row);
    201       var input = this._window.awGetInputElement(row);
     202    for (var row = 1; row <= this._currentWindow.top.MAX_RECIPIENTS; row++) {
     203      var popup = this._currentWindow.awGetPopupElement(row);
     204      var input = this._currentWindow.awGetInputElement(row);
    202205      var recipientType = popup.selectedItem.getAttribute("value");
    203206      // if the entry is not a recipient, just continue
     
    208211      if (input.value == allIdentities.identityDataCollection[index].email ||
    209212        input.value == allIdentities.identityDataCollection[index].combinedName) {
    210         this._window.awSetInputAndPopupValue(input, "", popup, "addr_to", -1);
    211         this._window.awCleanupRows()
     213        this._currentWindow.awSetInputAndPopupValue(input, "", popup, "addr_to", -1);
     214        this._currentWindow.awCleanupRows()
    212215        SmartReplyNotification.info(" " + this.stringBundle.GetStringFromName("vident.smartIdentity.remRecipient"));
    213216        break;
  • modules/vI_smartIdentityCollection.js

    rd7c9a6 rdc1dce  
    3232let Log = setupLogging("virtualIdentity.smartIdentityCollection");
    3333
    34 function smartIdentityCollection(msgHdr, preseletedID, currentIDisVID, newsgroup, recipients) {
     34function smartIdentityCollection(currentWindow, msgHdr, preseletedID, currentIDisVID, newsgroup, recipients) {
     35  this._currentWindow = currentWindow;
    3536  this._IDisVID = currentIDisVID;
    3637  this._preselectedID = preseletedID;
     
    3940  this._unicodeConverter.charset = "UTF-8";
    4041  this._recipients = recipients;
    41   this._rdfDatasourceAccess = new rdfDatasourceAccess();
     42  this._rdfDatasourceAccess = new rdfDatasourceAccess(this._currentWindow);
    4243  this._allIdentities = new identityCollection();
    4344};
    4445
    4546smartIdentityCollection.prototype = {
     47  _currentWindow: null,
     48
    4649  messenger: Components.classes["@mozilla.org/messenger;1"].createInstance()
    4750    .QueryInterface(Components.interfaces.nsIMessenger),
     
    8790    Log.debug("new email: " + new_email);
    8891
    89     var newIdentity = new identityData(new_email,
     92    var newIdentity = new identityData(this._currentWindow, new_email,
    9093      this._preselectedID.fullName, this._preselectedID.key, this._preselectedID.smtpServerKey, null, null)
    9194
     
    152155    var number = this._headerParser.parseHeadersWithArray(header, emails, fullNames, combinedNames);
    153156    for (var index = 0; index < number; index++) {
    154       var newIdentity = new identityData(emails.value[index], fullNames.value[index],
     157      var newIdentity = new identityData(this._currentWindow, emails.value[index], fullNames.value[index],
    155158        null, NO_SMTP_TAG, null, null);
    156159      identityCollection.addWithoutDuplicates(newIdentity);
Note: See TracChangeset for help on using the changeset viewer.