Changeset 48333d


Ignore:
Timestamp:
Dec 2, 2014, 4:34:14 PM (5 years ago)
Author:
rene <rene@…>
Branches:
ng_0.9
Children:
b91264
Parents:
55a9c3
Message:

modularized smartIdentity

Files:
1 added
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • content/v_identity.js

    r55a9c3 r48333d  
    3333    Components.utils.import("resource://v_identity/vI_accountUtils.js", virtualIdentityExtension);
    3434    Components.utils.import("resource://v_identity/plugins/signatureSwitch.js", virtualIdentityExtension);
     35    Components.utils.import("resource://v_identity/vI_smartIdentity.js", virtualIdentityExtension);
    3536
    3637    var main = {
     38      _smartIdentity: null,
     39     
    3740      headerParser: Components.classes["@mozilla.org/messenger/headerparser;1"]
    3841        .getService(Components.interfaces.nsIMsgHeaderParser),
     
    4447        .getService(Components.interfaces.nsIMsgAccountManager),
    4548
    46 
    47       gMsgCompose: null, // to store the global gMsgCompose after MsgComposeDialog is closed
    4849
    4950      // Those variables keep pointers to original functions which might get replaced later
     
    242243      initSystemStage1: function () {
    243244        Log.debug("initSystemStage1.")
    244         main.gMsgCompose = gMsgCompose;
    245245        document.getElementById("virtualIdentityExtension_msgIdentityClone").init();
    246246        vI.statusmenu.init();
     
    250250      initSystemStage2: function () {
    251251        Log.debug("initSystemStage2.")
     252        Log.debug("document.title=" + document.title + " gMsgCompose=" + gMsgCompose + " msgIdentityClone=" + document.getElementById("virtualIdentityExtension_msgIdentityClone"))
    252253        vI.initReplyTo(window);
    253254        vI.storage.init();
    254         vI.smartIdentity.init(window);
     255        this._smartIdentity = new vI.smartIdentity(window, gMsgCompose, vI.storage);
    255256        Log.debug("initSystemStage2 done.")
    256257      },
     
    297298        vI.clearDebugOutput();
    298299        Log.debug("composeDialog reopened. (msgType " + gMsgCompose.type + ")")
    299         vI.gMsgCompose = gMsgCompose; // don't know why and how, but faced loosing of gMsgCompose trough later stages, strange
    300 
     300        Log.debug("document.title=" + document.title + " gMsgCompose=" + gMsgCompose + " msgIdentityClone=" + document.getElementById("virtualIdentityExtension_msgIdentityClone"))
     301       
    301302        // clean all elements
    302303        document.getElementById("virtualIdentityExtension_msgIdentityClone").clean();
     304        vI.storage.clean(); // just to be sure!
    303305        Log.debug("everything cleaned.")
    304306
Note: See TracChangeset for help on using the changeset viewer.