Grammalecte  Check-in [617b4e1348]

Overview
Comment:[tb] remove dialog for bundled options > common dialog box
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tb | tbnext
Files: files | file ages | folders
SHA3-256: 617b4e13487325e5fd243714eda7cbf0ffb40bc4d4969d0bcd67c0197bff7bf7
User & Date: olr on 2018-03-14 15:37:27
Other Links: branch diff | manifest | tags
Context
2018-03-14
19:49
[tb] new API: fix dictionary loading + remove obsolete echo function check-in: 1dd9310e28 user: olr tags: tb, tbnext
15:37
[tb] remove dialog for bundled options > common dialog box check-in: 617b4e1348 user: olr tags: tb, tbnext
2018-03-10
15:18
[tb] fix conjugueur initialization… (again, and again, and again, and again, thanks to the endless JS pile of shit) check-in: 8253dcac97 user: olr tags: tb, tbnext
Changes

Added gc_lang/fr/tb/content/options.css version [9480df93df].

            1  +/* CSS */
            2  +

Added gc_lang/fr/tb/content/options.js version [239a6bffa5].

            1  +// JavaScript
            2  +
            3  +"use strict";
            4  +
            5  +
            6  +console.log("1");
            7  +
            8  +const Cc = Components.classes;
            9  +const Ci = Components.interfaces;
           10  +const Cu = Components.utils;
           11  +const prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService).getBranch("extensions.grammarchecker.");
           12  +
           13  +
           14  +var oOptControl = {
           15  +
           16  +    load: function () {
           17  +    	console.log("load");
           18  +        try {
           19  +            document.getElementById('check_signature').checked = prefs.getBoolPref('bCheckSignature');
           20  +        }
           21  +        catch (e) {
           22  +            Cu.reportError(e);
           23  +        }
           24  +    },
           25  +
           26  +    save: function () {
           27  +    	console.log("save");
           28  +        try {
           29  +            prefs.setBoolPref('bCheckSignature', document.getElementById('check_signature').checked);
           30  +        }
           31  +        catch (e) {
           32  +            Cu.reportError(e);
           33  +        }
           34  +    }
           35  +}
           36  +
           37  +console.log("2");
           38  +oOptControl.load();
           39  +console.log("3");

Modified gc_lang/fr/tb/content/options.xul from [4546c76788] to [b4b7f2b7c3].

     1         -<?xml version="1.0" encoding="UTF-8"?>
            1  +<?xml version="1.0"?>
     2      2   <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
            3  +<?xml-stylesheet href="chrome://grammarchecker/content/options.css" type="text/css"?>
     3      4   
     4         -<!DOCTYPE prefwindow SYSTEM "chrome://grammarchecker/locale/options.dtd">
            5  +<!DOCTYPE dialog SYSTEM "chrome://grammarchecker/locale/options.dtd">
     5      6   
     6         -<prefwindow id="grammarcheckerPreferences"
     7         -  title="&prefwindow.title;"
            7  +<dialog
            8  +  id="grammalecte-options-window"
            9  +  title="&window.title;"
           10  +  orient="vertical"
           11  +  buttons="accept, cancel"
           12  +  ondialogaccept="oOptControl.save();"
           13  +  ondialogcancel="return;"
           14  +  defaultButton="accept"
           15  +  width="400"
           16  +  onload="document.getElementById('grammalecte-options-window').centerWindowOnScreen();"
     8     17     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
     9     18   
    10         -  <prefpane id="pane1" label="&pane1.title;">
    11         -    <dialogheader id="grammalecte-title" title="&pane1.title;" description="" />
    12         -    <preferences>
    13         -      <preference id="check_signature" name="extensions.grammarchecker.bCheckSignature" type="bool" />
    14         -      <!--<preference id="gc_options" name="extensions.grammarchecker.sGCOptions" type="string" />
    15         -      <preference id="tf_options" name="extensions.grammarchecker.sTFOptions" type="string" />
    16         -      <preference id="mothertongue" name="extensions.grammarchecker.mothertongue" type="string"/>-->
    17         -    </preferences>
    18         -    <checkbox label="&check_signature.label;" accesskey="&check_signature.accesskey;"  preference="check_signature"/>
    19         -    <!--<label accesskey="&gc_options.accesskey;" control="texturlpref1">&gc_options.label;</label><textbox id="texturlpref1" preference="gc_options"/>
    20         -    <label accesskey="&tf_options.accesskey;" control="texturlpref2">&tf_options.label;</label><textbox id="texturlpref2" preference="tf_options"/>
    21         -    <label accesskey="&mothertongue.accesskey;" control="textmothertongue">&mothertongue.label;</label><textbox id="textmothertongue" preference="mothertongue"/>-->
    22         -    <!--<description>&panel.description;</description>-->
    23         -  </prefpane>
    24         -</prefwindow>
           19  +  <!-- Other elements go here -->
           20  +  
           21  +  <dialogheader id="grammalecte-title" title="&dialogheader.label;" description="" />
           22  +
           23  +  <checkbox id="check_signature" label="&check_signature.label;" accesskey="&check_signature.accesskey;" />
           24  +
           25  +  <script type="application/javascript" src="options.js" />
           26  +
           27  +</dialog>

Modified gc_lang/fr/tb/install.rdf from [c98ee16b92] to [95227f9159].

     5      5       <em:id>${tb_identifier}</em:id>
     6      6       <em:name>${tb_name}</em:name>
     7      7       <em:type>2</em:type>
     8      8       <em:version>${version}</em:version>
     9      9       <em:creator>${author}</em:creator>
    10     10       <em:description>${description}</em:description>
    11     11       <em:homepageURL>${link}</em:homepageURL>
    12         -    <em:optionsURL>chrome://grammarchecker/content/options.xul</em:optionsURL>
           12  +    <!--<em:optionsURL>chrome://grammarchecker/content/options.xul</em:optionsURL>-->
    13     13       <em:unpack>true</em:unpack>
    14     14   
    15     15       <em:targetApplication>
    16     16         <Description>
    17     17           <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> <!-- thunderbird -->
    18     18           <em:minVersion>45.8.0</em:minVersion>
    19     19           <em:maxVersion>55.*</em:maxVersion>
    20     20         </Description>
    21     21       </em:targetApplication>
    22     22     </Description>
    23     23   </RDF>

Modified gc_lang/fr/tb/locale/en/options.dtd from [071253db94] to [5fe56718ba].

     1         -<!ENTITY prefwindow.title "Grammalecte · Options">
     2         -<!ENTITY pane1.title "Other options">
     3         -<!ENTITY pane1.description "Options are available in the menu Grammalecte in composing windows.">
     4         -<!ENTITY mothertongue.label "Mother tongue:">
     5         -<!ENTITY mothertongue.accesskey "M">
            1  +<!ENTITY window.title "Grammalecte · Options">
            2  +<!ENTITY dialogheader.label "Other options">
     6      3   <!ENTITY check_signature.label "Check signature text (in text mode)">
     7      4   <!ENTITY check_signature.accesskey "C">
            5  +
            6  +

Modified gc_lang/fr/tb/locale/fr/options.dtd from [a50c0f39f8] to [37a043f079].

     1         -<!ENTITY prefwindow.title "Grammalecte · Options">
     2         -<!ENTITY pane1.title "Autres options">
     3         -<!ENTITY pane1.description "Les options sont disponibles dans le menu Grammalecte des fenêtres de rédaction.">
     4         -<!ENTITY mothertongue.label "Langue maternelle:">
     5         -<!ENTITY mothertongue.accesskey "M">
            1  +<!ENTITY window.title "Grammalecte · Options">
            2  +<!ENTITY dialogheader.label "Autres options">
     6      3   <!ENTITY check_signature.label "Vérifier le texte de la signature (en mode texte)">
     7      4   <!ENTITY check_signature.accesskey "V">