This is just some static backup of the original site, don't expect every link to work!

Changeset 998c9e


Ignore:
Timestamp:
Oct 16, 2014, 9:02:17 PM (8 years ago)
Author:
rene <rene@…>
Branches:
ng_0.9
Children:
e23521
Parents:
fdd549
Message:

added compatibility changes for new charEncoding Menu

Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • chrome.manifest

    rfdd549 r998c9e  
    2020
    2121overlay chrome://v_identity/content/vI_rdfDataTree.xul      chrome://v_identity/content/vI_rdfDataTree_dataExtrasOverlay.xul
    22 overlay chrome://v_identity/content/vI_rdfDataEditor.xul    chrome://v_identity/content/vI_rdfDataEditor_dataExtrasOverlay.xul
     22
     23# only for Thunderbird <= 31.0a2 and Seamonkey < 2.30
     24overlay chrome://v_identity/content/vI_rdfDataEditor.xul    chrome://v_identity/content/vI_rdfDataEditor_dataExtrasOverlay_legacy.xul application={3550f703-e582-4d05-9a08-453d09bdfdc6} appversion<=31.0a2
     25overlay chrome://v_identity/content/vI_rdfDataEditor.xul    chrome://v_identity/content/vI_rdfDataEditor_dataExtrasOverlay_legacy.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} appversion<2.30
     26
     27# for current Thunderbird (> 31.0a2) and Seamonkey (>= 2.30)
     28overlay chrome://v_identity/content/vI_rdfDataEditor.xul    chrome://v_identity/content/vI_rdfDataEditor_dataExtrasOverlay.xul application={3550f703-e582-4d05-9a08-453d09bdfdc6} appversion>31.0a2
     29overlay chrome://v_identity/content/vI_rdfDataEditor.xul    chrome://v_identity/content/vI_rdfDataEditor_dataExtrasOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} appversion>=2.30
     30
     31
    2332
    2433overlay chrome://messenger/content/am-smtp.xul          chrome://v_identity/content/accountManagerOverlays/vI_am-smtpOverlay.xul
  • content/vI_rdfDataEditor_dataExtrasOverlay.xul

    rfdd549 r998c9e  
    2424   - ***** END LICENSE BLOCK ***** -->
    2525
     26<?xul-overlay href="chrome://communicator/content/charsetOverlay.xul"?>
     27
    2628<!DOCTYPE window [
     29<!ENTITY % vIstorageExtrasDTD SYSTEM "chrome://v_identity/locale/vI_storageExtras.dtd" >
     30%vIstorageExtrasDTD;
     31<!ENTITY % charsetMenuDTD SYSTEM "chrome://global/locale/charsetMenu.dtd" >
     32%charsetMenuDTD;
    2733<!ENTITY % messengercomposeDTD SYSTEM "chrome://messenger/locale/messengercompose/messengercompose.dtd" >
    2834%messengercomposeDTD;
    29 <!ENTITY % charsetDTD SYSTEM "chrome://global/locale/charsetOverlay.dtd" >
    30 %charsetDTD;
    31 <!ENTITY % vIstorageExtrasDTD SYSTEM "chrome://v_identity/locale/vI_storageExtras.dtd" >
    32 %vIstorageExtrasDTD;
    3335]>
    34 
    3536<overlay id="vI_storageExtras"
    3637          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" >
     
    6465            oncommand="virtualIdentityExtension.rdfDataEditor.identityExtras_adapt(this.id, 'maileditCharsetMenuLabel');virtualIdentityExtension.rdfDataEditor.identityExtras_adapt(this.id, 'maileditCharsetMenu');" />
    6566        <hbox id="vI_storageExtras_characterEncoding">
    66             <vbox><spacer flex="1"/>
    67                 <label id="maileditCharsetMenuLabel" value="&charsetMenu.label;"
    68                     accesskey="&charsetMenu.accesskey;" control="maileditCharsetMenu" />
    69             <spacer flex="1"/></vbox>
    70             <menulist id="maileditCharsetMenu"
    71                 datasources="rdf:charset-menu" ref="NC:MaileditCharsetMenuRoot" >
    72             <template>
    73                 <rule>
    74                 <menupopup>
    75                     <menuitem type="radio" name="charsetGroup" checked="rdf:http://home.netscape.com/NC-rdf#Checked" uri="..." label="rdf:http://home.netscape.com/NC-rdf#Name"/>
    76                 </menupopup>
    77                 </rule>
    78             </template>
    79             <menupopup>
    80                 <menuitem name="charsetCustomize" accesskey="&charsetCustomize.accesskey;" label="&charsetCustomize.label;" oncommand="window.openDialog('chrome://global/content/customizeCharset.xul','PrefWindow', 'chrome, dialog, modal, alwaysRaised, resizable=yes', 'mailedit')"/>
    81                 <menuseparator />
    82             </menupopup>
    83             </menulist>
     67        <script>
     68            Components.utils.import("resource://gre/modules/CharsetMenu.jsm");
     69        </script>
     70        <vbox><spacer flex="1"/>
     71            <label id="maileditCharsetMenuLabel" value="&charsetMenu.label;"
     72                accesskey="&charsetMenu.accesskey;" control="maileditCharsetMenu" />
     73        <spacer flex="1"/></vbox>
     74        <menulist id="maileditCharsetMenu">
     75            <menupopup id="charsetPopup"
     76                    onpopupshowing="CharsetMenu.build(this, false, false);"/>
     77        </menulist>
    8478        </hbox>
    8579        </hbox>
  • modules/identityDataExtras/characterEncoding.js

    rfdd549 r998c9e  
    3232Cu.import("resource://v_identity/vI_identityDataExtras.js");
    3333Cu.import("resource://v_identity/vI_log.js");
     34let legacy = false; // use pre TB-32 legacy code
     35try {
     36    Cu.import("resource://gre/modules/CharsetMenu.jsm");
     37} catch (e) {
     38    legacy = true; // pre TB-32-version, might be removed in the future
     39}
     40   
     41
    3442let Log = setupLogging("virtualIdentity.identityDataExtras.characterEncoding");
    3543
     
    4856  },
    4957
     58  // pre TB-32-version, might be removed in the future --------------------------------
    5059  _setMenuMark: function() {
    5160    var maileditCharsetMenu = this.currentWindow.document.getElementById("maileditCharsetMenu")
     
    5867    }
    5968  },
     69  // ----------------------------------------------------------------------------------
    6070 
    6171  setValueToEnvironment_msgCompose: function() {
    6272    if (!this.value)
    6373      return;
    64     var menuitem = this.currentWindow.document.getElementById(this.value);
    65     if (menuitem)
    66       menuitem.setAttribute('checked', 'true');
    67     else {  // set menumark later if menu is not ready yet
    68       var maileditCharsetMenu = this.currentWindow.document.getElementById("maileditCharsetMenu")
    69       maileditCharsetMenu.setAttribute("unmarkedValue", this.value)
    70       var onpopupshowing = maileditCharsetMenu.getAttribute("onpopupshowing")
    71       this.currentWindow.document.getElementById("maileditCharsetMenu").setAttribute("onpopupshowing",
    72         onpopupshowing + ";this.setMenuMark();")
     74    // pre TB-32-version, might be removed in the future --------------------------------
     75    if (legacy) {
     76        // old style
     77        var menuitem = this.currentWindow.document.getElementById(this.value);
     78        if (menuitem)
     79        menuitem.setAttribute('checked', 'true');
     80        else {  // set menumark later if menu is not ready yet
     81        var maileditCharsetMenu = this.currentWindow.document.getElementById("maileditCharsetMenu")
     82        maileditCharsetMenu.setAttribute("unmarkedValue", this.value)
     83        var onpopupshowing = maileditCharsetMenu.getAttribute("onpopupshowing")
     84        this.currentWindow.document.getElementById("maileditCharsetMenu").setAttribute("onpopupshowing",
     85            onpopupshowing + ";this._setMenuMark();")
     86        }
    7387    }
     88    // ----------------------------------------------------------------------------------
    7489    this.currentWindow.gMsgCompose.compFields.characterSet = this.value;
    7590    this.currentWindow.SetDocumentCharacterSet(this.value);
     
    7792 
    7893  setValueToEnvironment_dataEditor: function() {
    79     this.currentWindow.CreateMenu('mailedit'); // this is part of the magic included by the xul-binding
    80     if (this.value != null) {
    81       this.currentWindow.document.getElementById("maileditCharsetMenu").selectedItem = this.currentWindow.document.getElementById(this.value);
    82       this.currentWindow.document.getElementById("vI_" + this.option + "_store").setAttribute("checked", "true");
     94    // pre TB-32-version, might be removed in the future --------------------------------
     95    if (legacy) {
     96      this.currentWindow.CreateMenu('mailedit'); // this is part of the magic included by the xul-binding
     97        if (this.value != null) {
     98            this.currentWindow.document.getElementById("maileditCharsetMenu").selectedItem = this.currentWindow.document.getElementById(this.value);
     99            this.currentWindow.document.getElementById("vI_" + this.option + "_store").setAttribute("checked", "true");
     100        }
     101    }
     102    // ----------------------------------------------------------------------------------
     103    else {
     104        CharsetMenu.build(this.currentWindow.document.getElementById("charsetPopup"), false, false)
     105        if (this.value != null) {
     106            CharsetMenu.update(this.currentWindow.document.getElementById("maileditCharsetMenu"), this.value);
     107            this.currentWindow.document.getElementById("maileditCharsetMenu").setAttribute("label",CharsetMenu._getCharsetLabel(this.value));
     108            this.currentWindow.document.getElementById("vI_" + this.option + "_store").setAttribute("checked", "true");
     109        }
    83110    }
    84111    this.currentWindow.document.getElementById("vI_" + this.option + "_store").doCommand();
     
    100127      // check if element is selected (list might not contain relevant entry)
    101128      if (this.currentWindow.document.getElementById("maileditCharsetMenu").selectedItem)
    102         this.value = this.currentWindow.document.getElementById("maileditCharsetMenu").selectedItem.id
     129        // pre TB-32-version, might be removed in the future --------------------------------
     130        if (legacy) {
     131            this.value = this.currentWindow.document.getElementById("maileditCharsetMenu").selectedItem.id
     132        }
     133        // ----------------------------------------------------------------------------------
     134        else {
     135            this.value = this.currentWindow.document.getElementById("maileditCharsetMenu").selectedItem.getAttribute('charset');
     136        }
    103137    else
    104138      this.value = null;
  • skin/v_identity.css

    rfdd549 r998c9e  
    542542    margin-top: 20px;
    543543}
     544
     545#virtualIdentityExtension_rdfDataEditorContent .menu-iconic-text {
     546    padding-left: 20px;
     547}
Note: See TracChangeset for help on using the changeset viewer.