Changeset 750887


Ignore:
Timestamp:
Nov 17, 2011, 1:32:17 AM (9 years ago)
Author:
rene <rene@…>
Branches:
ng_0.9
Children:
598551
Parents:
4eb23a
Message:

finally, all modules are where they should be. conversation plugin added.

Files:
6 edited
1 moved

Legend:

Unmodified
Added
Removed
  • content/vI_context.xul

    r4eb23a r750887  
    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/modules/vI_rdfDatasource.js" />
    3736    <script type="application/x-javascript">
    3837    Components.utils.import("resource://v_identity/vI_nameSpaceWrapper.js");
    3938    virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
     39   
     40    Components.utils.import("resource://v_identity/vI_rdfDatasource.js");
     41   
    4042    var vI_context = {
    4143        prefroot : Components.classes["@mozilla.org/preferences-service;1"]
     
    7072                        <menuitem label="&vident.vI_Menu.DataEditor.label;"
    7173                            oncommand="window.open('chrome://v_identity/content/vI_rdfDataTree.xul', '', 'chrome, dialog, resizable=yes');" />
    72                         <menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="dump('command: ' + virtualIdentityExtension.initTime + '\n');var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasourceImporter('virtualIdentity.rdf');"/>
    73                         <menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand="dump('command: ' + virtualIdentityExtension.initTime + '\n');var vI_localRdfDatasource = new virtualIdentityExtension.rdfDatasource(); vI_localRdfDatasource.export('virtualIdentity.rdf')"/>
     74                        <menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="dump('command: ' + virtualIdentityExtension.initTime + '\n');var vI_localRdfDatasource = new rdfDatasourceImporter('virtualIdentity.rdf');"/>
     75                        <menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand="dump('command: ' + virtualIdentityExtension.initTime + '\n');var vI_localRdfDatasource = new rdfDatasource(); vI_localRdfDatasource.export('virtualIdentity.rdf')"/>
    7476                    </menupopup>
    7577                </menu>
  • content/vI_overlay.js

    r4eb23a r750887  
    33virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
    44  // this is the entry place, nameSpaceWrapper is loaded and the show can start
     5  try {
     6    Components.utils.import("resource://v_identity/plugins/conversations.js", virtualIdentityExtension);
     7  } catch(e) {
     8    vI.dumpCallStack(e);
     9  }
    510}});
  • content/vI_overlay.xul

    r4eb23a r750887  
    2424   - ***** END LICENSE BLOCK ***** -->
    2525
    26 <!DOCTYPE overlay SYSTEM "chrome://conversations/locale/overlay.dtd">
    2726<overlay id="messengerWindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    2827  <script type="application/x-javascript" src="chrome://v_identity/content/vI_overlay.js" />
  • content/vI_upgrade.xul

    r4eb23a r750887  
    4242<script type="application/x-javascript" src="chrome://v_identity/content/vI_upgrade.js" />
    4343<script type="application/x-javascript" src="chrome://v_identity/content/vI_storage.js" />
    44 <script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_identityData.js" />
    45 <script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_helper.js" />
    46 <script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_rdfDatasource.js" />   
    4744
    4845<stringbundle id="virtualIdentityExtension_TextBoxBundle" src="chrome://v_identity/locale/vI_upgrade.properties" />
  • content/vI_upgradeOverlay.xul

    r4eb23a r750887  
    3636
    3737<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    38     <script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_rdfDatasource.js" />
    3938    <script type="application/x-javascript" src="chrome://v_identity/content/vI_upgradeOverlay.js" />
    4039
     
    4241    <script type="application/x-javascript" src="chrome://v_identity/content/vI_upgrade.js" />
    4342    <script type="application/x-javascript" src="chrome://v_identity/content/vI_storage.js" />
    44     <script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_identityData.js" />
    45     <script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_helper.js" />
    4643    <!-- include following script to enable conversation plugin -->
    47     <script type="application/x-javascript" src="chrome://v_identity/content/modules/plugins/conversation.js" />
    4844    <script type="application/x-javascript" src="chrome://v_identity/content/vI_smartIdentity.js" />
    49     <script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_smartIdentityCollection.js" />
    5045
    5146    <vbox id="messagepanebox" >
  • content/v_identity.xul

    r4eb23a r750887  
    3737          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    3838
    39 <script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_helper.js" />
    40 <script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_smartIdentityCollection.js" />
    41 <script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_rdfDatasource.js"/>
    42 
    4339<script type="application/x-javascript" src="chrome://v_identity/content/v_identity.js" />
    44 <script type="application/x-javascript" src="chrome://v_identity/content/modules/vI_identityData.js" />
    4540<script type="application/x-javascript" src="chrome://v_identity/content/vI_msgIdentityCloneTools.js" />
    4641<script type="application/x-javascript" src="chrome://v_identity/content/vI_smartIdentity.js" />
  • modules/plugins/conversations.js

    r4eb23a r750887  
    1 Components.utils.import("resource://v_identity/vI_nameSpaceWrapper.js");
    2 virtualIdentityExtension.ns(function() { with (virtualIdentityExtension.LIB) {
    3 
    4 let Log = vI.setupLogging("virtualIdentity.plugin.conversation");
    5 
    6 Components.utils.import("resource://v_identity/vI_rdfDatasource.js", virtualIdentityExtension);
    7 Components.utils.import("resource://v_identity/vI_account.js", virtualIdentityExtension);
    8 Components.utils.import("resource://v_identity/vI_smartIdentityCollection.js", virtualIdentityExtension);
     1/* ***** BEGIN LICENSE BLOCK *****
     2    This program is free software; you can redistribute it and/or modify
     3    it under the terms of the GNU General Public License as published by
     4    the Free Software Foundation; either version 2 of the License, or
     5    (at your option) any later version.
     6
     7    This program is distributed in the hope that it will be useful,
     8    but WITHOUT ANY WARRANTY; without even the implied warranty of
     9    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     10    GNU General Public License for more details.
     11
     12    You should have received a copy of the GNU General Public License
     13    along with this program; if not, write to the Free Software
     14    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     15
     16    The Original Code is the Virtual Identity Extension.
     17
     18    The Initial Developer of the Original Code is Rene Ejury.
     19    Portions created by the Initial Developer are Copyright (C) 2007
     20    the Initial Developer. All Rights Reserved.
     21
     22    Contributor(s):
     23 * ***** END LICENSE BLOCK ***** */
     24 
     25var EXPORTED_SYMBOLS = [];
    926
    1027const {classes: Cc, interfaces: Ci, utils: Cu, results : Cr} = Components;
     28
     29Cu.import("resource://v_identity/vI_log.js");
     30Cu.import("resource://v_identity/vI_rdfDatasource.js");
     31Cu.import("resource://v_identity/vI_account.js");
     32Cu.import("resource://v_identity/vI_smartIdentityCollection.js");
     33Cu.import("resource://v_identity/vI_identityData.js");
     34
     35let Log = setupLogging("virtualIdentity.plugins.conversations");
    1136
    1237let pref = Cc["@mozilla.org/preferences-service;1"]
     
    2449let virtualIdInUse;
    2550let virtualSenderNameElem;
    26 
    2751
    2852let _rdfDatasourceAccess;
     
    4973};
    5074
    51 let conversationHook = {
    52   onComposeSessionChanged: function (aComposeSession, aAddress) {
     75let virtualIdentityHook = {
     76  onComposeSessionChanged: function _virtualIdentityHook_onComposeSessionChanged(aComposeSession, aMessage, aAddress) {
    5377    let toAddrList = aAddress.to.concat(aAddress.cc);
    5478   
     
    5781   
    5882    let server = AccountManager.GetServersForIdentity(identity).QueryElementAt(0, Components.interfaces.nsIMsgIncomingServer);
    59     currentIdentityData = new virtualIdentityExtension.identityData(identity.email, identity.fullName, identity.key,
     83    currentIdentityData = new identityData(identity.email, identity.fullName, identity.key,
    6084                                                                    identity.smtpServerKey, null, server.prettyName, true)
    6185    currentIdSenderName = currentIdentityData.combinedName;
     
    6791      recipients.push( { recipient: combinedNames.value[index], recipientType: "addr_to" } )
    6892     
    69     var localSmartIdentityCollection = new vI.smartIdentityCollection(aComposeSession.params.msgHdr, identity,
     93    var localSmartIdentityCollection = new smartIdentityCollection(aComposeSession.params.msgHdr, identity,
    7094                                                                      false, false, recipients);
    7195    localSmartIdentityCollection.Reply();   // we can always use the reply-case, msgHdr is set the right way
     
    86110      ((localSmartIdentityCollection._allIdentities.number == 1 && pref.getBoolPref("idSelection_ask_always"))
    87111      || localSmartIdentityCollection._allIdentities.number > 1)) {
    88         window.openDialog("chrome://v_identity/content/vI_smartReplyDialog.xul",0,
     112        recentWindow = Cc["@mozilla.org/appshell/window-mediator;1"]
     113          .getService(Ci.nsIWindowMediator)
     114          .getMostRecentWindow("mail:3pane");
     115     
     116        recentWindow.openDialog("chrome://v_identity/content/vI_smartReplyDialog.xul",0,
    89117          "chrome, dialog, modal, alwaysRaised, resizable=yes",
    90118          localSmartIdentityCollection._allIdentities,
     
    95123  },
    96124 
    97   onMessageBeforeSendOrPopout: function(aAddress, aStatus, aPopout) {
     125  onMessageBeforeSendOrPopout_early: function _enigmailHook_onMessageBeforeSendOrPopout_early(aAddress, aEditor, aStatus, aPopout) {
     126    if (aStatus.canceled)
     127      return aStatus;
     128
    98129    let toAddrList = aAddress.to.concat(aAddress.cc);
    99130    Log.debug("onMessageBeforeSendOrPopup");
     
    106137          recipients.push( { recipient: combinedNames.value[index], recipientType: "addr_to" } )
    107138
    108         returnValue = vI.prepareSendMsg(virtualIdInUse, Ci.nsIMsgCompDeliverMode.Now,
     139        returnValue = prepareSendMsg(virtualIdInUse, Ci.nsIMsgCompDeliverMode.Now,
    109140          currentIdentityData, aAddress.params.identity, recipients );
    110141        Log.debug("returnValue.update:", returnValue.update);
     
    119150       
    120151        aAddress.params.identity = vIaccount_defaultIdentity
    121         if (!vI.finalCheck(currentIdentityData, aAddress.params.identity)) {
     152        if (!finalCheck(currentIdentityData, aAddress.params.identity)) {
    122153          vIaccount_removeUsedVIAccountt();
    123154          aStatus.canceled = true; return aStatus;
     
    134165  },
    135166 
    136   onStopSending: function () {
     167  onStopSending: function _virtualIdentityHook_onStopSending(aMsgID, aStatus, aMsg, aReturnFile) {
    137168    vIaccount_removeUsedVIAccount();
    138169    Log.debug("onStopSending done");
    139170  },
    140171
    141   onRecipientAdded: function onRecipientAdded(aData, aType, aCount) {
     172  onRecipientAdded: function _virtualIdentityHook_onRecipientAdded(aData, aType, aCount) {
    142173    Log.debug("onRecipientAdded", aData.data, aType, aCount);
    143174    if (!pref.getBoolPref("storage")) return;
     
    149180    Log.debug("onRecipientAdded isNotFirstInputElement", isNotFirstInputElement);
    150181   
    151     if (!_rdfDatasourceAccess) _rdfDatasourceAccess = new vI.rdfDatasourceAccess();
     182    if (!_rdfDatasourceAccess) _rdfDatasourceAccess = new rdfDatasourceAccess();
    152183    else _rdfDatasourceAccess.clean();
    153184   
     
    162193}
    163194
    164 vI.conversationHook = conversationHook;
    165 }});
     195try {
     196  Cu.import("resource://conversations/hook.js");
     197  mainWindow = Cc["@mozilla.org/appshell/window-mediator;1"]
     198    .getService(Ci.nsIWindowMediator)
     199    .getMostRecentWindow("mail:3pane");
     200  mainWindow.addEventListener("load", function () {
     201    Log.debug("Virtual Identity plugin for Thunderbird Conversations loaded!");
     202    registerHook(virtualIdentityHook);
     203  }, false);
     204}
     205catch(e) {
     206  Log.debug("virtualIdentity is ready for conversations, but you don't use it\n");
     207}
Note: See TracChangeset for help on using the changeset viewer.