Grammalecte  Changes On Branch 09c165319c9719e4

Changes In Branch tbnext Through [09c165319c] Excluding Merge-Ins

This is equivalent to a diff from 94e2e47aea to 09c165319c

2018-03-12
13:58
[fr] pt: chaque fois check-in: 066a99dfc3 user: olr tags: trunk, fr
2018-03-10
14:58
[tb] fix modules importation, remove old logging system… check-in: a90720e17c user: olr tags: tb, tbnext
2018-03-09
09:32
[tb] build for Thunderbird Beta check-in: 09c165319c user: olr tags: tb, tbnext
09:08
[tb] new path for TB profile check-in: 3f49766c51 user: olr tags: tb, tbnext
08:28
[tb] new TB API: x-javascript > javascript check-in: 0e232d6b0f user: olr tags: tb, tbnext
2018-03-07
17:32
merge trunk check-in: a693df4168 user: olr tags: multid
16:10
[fx] hide useless panel about dictionaries for now check-in: 94e2e47aea user: olr tags: trunk, fx
16:01
[fx] new version for WebExtension check-in: 23d108bf86 user: olr tags: trunk, fx

Modified gc_lang/fr/build.py from [9ca6336e46] to [a54b2ffcfb].

89
90
91
92
93
94
95


96
97
98
99
100
101
102
    for sp in os.listdir(spDict):
        if os.path.isdir(spDict+"/"+sp):
            hZip.write(spDict+"/"+sp+"/"+sp+".dic", "content/dictionaries/"+sp+"/"+sp+".dic")
            hZip.write(spDict+"/"+sp+"/"+sp+".aff", "content/dictionaries/"+sp+"/"+sp+".aff")
    hZip.close()
    spfDebugProfile = dVars['win_tb_debug_extension_path']  if platform.system() == "Windows"  else dVars['linux_tb_debug_extension_path']
    helpers.unzip(spfZip, spfDebugProfile)




def _createOptionsForThunderbird (dVars):
    dVars['sXULTabs'] = ""
    dVars['sXULTabPanels'] = ""
    # dialog options
    for sSection, lOpt in dVars['lStructOpt']:







>
>







89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
    for sp in os.listdir(spDict):
        if os.path.isdir(spDict+"/"+sp):
            hZip.write(spDict+"/"+sp+"/"+sp+".dic", "content/dictionaries/"+sp+"/"+sp+".dic")
            hZip.write(spDict+"/"+sp+"/"+sp+".aff", "content/dictionaries/"+sp+"/"+sp+".aff")
    hZip.close()
    spfDebugProfile = dVars['win_tb_debug_extension_path']  if platform.system() == "Windows"  else dVars['linux_tb_debug_extension_path']
    helpers.unzip(spfZip, spfDebugProfile)
    spfBetaProfile = dVars['win_tb_beta_extension_path']  if platform.system() == "Windows"  else dVars['linux_tb_beta_extension_path']
    helpers.unzip(spfZip, spfBetaProfile)


def _createOptionsForThunderbird (dVars):
    dVars['sXULTabs'] = ""
    dVars['sXULTabPanels'] = ""
    # dialog options
    for sSection, lOpt in dVars['lStructOpt']:

Modified gc_lang/fr/config.ini from [eb081b50e5] to [c5bda27e4c].

44
45
46
47
48
49
50




51
52


53
54
55
56
57
58
59
win_fx_nightly_path = C:\Program Files\Nightly\firefox.exe
linux_fx_dev_path = /usr/bin/firefox
linux_fx_nightly_path = /usr/bin/firefox

# Thunderbird
tb_identifier = French-GC-TB@grammalecte.net
tb_name = Grammalecte [fr]




win_tb_debug_extension_path = D:\_temp\tb-debug.profile\extensions\French-GC-TB@grammalecte.net
linux_tb_debug_extension_path = ~/tb-debug.profile/extensions/French-GC-TB@grammalecte.net


# Set Thunderbird folder in your PATH variable
# Create a local profile:
#     	thunderbird -CreateProfile "debug _build\tb-debug.profile"
# Or you can use the GUI with:
#	 	thunderbird -P
# To launch Thunderbird with the profile debug, type:
#     	thunderbird -P debug







>
>
>
>


>
>







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
win_fx_nightly_path = C:\Program Files\Nightly\firefox.exe
linux_fx_dev_path = /usr/bin/firefox
linux_fx_nightly_path = /usr/bin/firefox

# Thunderbird
tb_identifier = French-GC-TB@grammalecte.net
tb_name = Grammalecte [fr]
win_tb_path = C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe
win_tb_beta_path = C:\Program Files (x86)\Mozilla Thunderbird (Beta)\thunderbird.exe
linux_tb_path = /usr/bin/thunderbird
linux_tb_beta_path = /usr/bin/thunderbird
win_tb_debug_extension_path = D:\_temp\tb-debug.profile\extensions\French-GC-TB@grammalecte.net
linux_tb_debug_extension_path = ~/tb-debug.profile/extensions/French-GC-TB@grammalecte.net
win_tb_beta_extension_path = D:\_temp\tb-beta.profile\extensions\French-GC-TB@grammalecte.net
linux_tb_beta_extension_path = ~/tb-beta.profile/extensions/French-GC-TB@grammalecte.net
# Set Thunderbird folder in your PATH variable
# Create a local profile:
#     	thunderbird -CreateProfile "debug _build\tb-debug.profile"
# Or you can use the GUI with:
#	 	thunderbird -P
# To launch Thunderbird with the profile debug, type:
#     	thunderbird -P debug

Modified gc_lang/fr/tb/chrome.manifest from [39608040f5] to [a8f859a2c4].

1
2
3
4
5
6
7
8
9
# https://developer.mozilla.org/en-US/docs/Chrome_Registration
content	grammarchecker	content/
content promiseworker ./worker/
resource grammalecte ./grammalecte-js/
locale	grammarchecker	fr	locale/fr/
locale	grammarchecker	en	locale/en/
skin	grammarchecker	classic/1.0	skin/
overlay	chrome://messenger/content/messengercompose/messengercompose.xul	chrome://grammarchecker/content/overlay.xul
style	chrome://global/content/customizeToolbar.xul	chrome://grammarchecker/content/overlay.css








|
1
2
3
4
5
6
7
8
9
# https://developer.mozilla.org/en-US/docs/Chrome_Registration
content	grammarchecker	content/
content promiseworker ./worker/
resource grammalecte ./grammalecte-js/
locale	grammarchecker	fr	locale/fr/
locale	grammarchecker	en	locale/en/
skin	grammarchecker	classic/1.0	skin/
overlay	chrome://messenger/content/messengercompose/messengercompose.xul	chrome://grammarchecker/content/overlay.xul
style	chrome://messenger/content/customizeToolbar.xul	chrome://grammarchecker/content/overlay.css

Modified gc_lang/fr/tb/content/about.xul from [fc21852913] to [9407ba6c78].

30
31
32
33
34
35
36
37
38
    onclick="openInTabURL('http://lamouette.org/?from=grammalecte-tb');" />
  <label class="stdlabel" value="&amp;" />
  <image src="chrome://grammarchecker/skin/Algoo_logo.png" style="cursor: pointer;"
    onclick="openInTabURL('https://www.algoo.fr/?from=grammalecte-tb');" />
  <label id="contrib" value="&contrib;"
    onclick="openInTabURL('https://www.dicollecte.org/#thanks');" />

  <script type="application/x-javascript" src="about.js"/>
</dialog>







|

30
31
32
33
34
35
36
37
38
    onclick="openInTabURL('http://lamouette.org/?from=grammalecte-tb');" />
  <label class="stdlabel" value="&amp;" />
  <image src="chrome://grammarchecker/skin/Algoo_logo.png" style="cursor: pointer;"
    onclick="openInTabURL('https://www.algoo.fr/?from=grammalecte-tb');" />
  <label id="contrib" value="&contrib;"
    onclick="openInTabURL('https://www.dicollecte.org/#thanks');" />

  <script type="application/javascript" src="about.js"/>
</dialog>

Modified gc_lang/fr/tb/content/conjugueur.xul from [ee8b63b554] to [429a95586f].

150
151
152
153
154
155
156
157
158
        <label id="condb4" class="cj">.</label>
        <label id="condb5" class="cj">.</label>
        <label id="condb6" class="cj">.</label>
      </groupbox>
    </column>
  </columns>

  <script type="application/x-javascript" src="conjugueur.js"/>
</dialog>







|

150
151
152
153
154
155
156
157
158
        <label id="condb4" class="cj">.</label>
        <label id="condb5" class="cj">.</label>
        <label id="condb6" class="cj">.</label>
      </groupbox>
    </column>
  </columns>

  <script type="application/javascript" src="conjugueur.js"/>
</dialog>

Modified gc_lang/fr/tb/content/gc_options.xul from [8e6b4a963d] to [65926a1200].

27
28
29
30
31
32
33
34
35
36
${sXULTabs}
    </tabs>
    <tabpanels>
${sXULTabPanels}
    </tabpanels>
  </tabbox>

  <script type="application/x-javascript" src="gc_options.js" />

</dialog>







|


27
28
29
30
31
32
33
34
35
36
${sXULTabs}
    </tabs>
    <tabpanels>
${sXULTabPanels}
    </tabpanels>
  </tabbox>

  <script type="application/javascript" src="gc_options.js" />

</dialog>

Modified gc_lang/fr/tb/content/overlay.xul from [f4f8642995] to [a19f1698d8].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://grammarchecker/content/overlay.css" type="text/css"?>

<!DOCTYPE overlay SYSTEM "chrome://grammarchecker/locale/overlay.dtd">

<overlay id="grammarchecker-overlay"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
  <script type="application/x-javascript" src="overlay.js"/>
  <script type="application/x-javascript" src="spellchecker.js"/>
  <script type="application/x-javascript" src="editor.js"/>

  <stringbundleset id="stringbundleset">
    <stringbundle id="grammarchecker-strings" src="chrome://grammarchecker/locale/grammarchecker.properties"/>
  </stringbundleset>

  <commandset id="composerEditMenuItems" commandupdater="true" 
              events="focus" 








|
|
|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://grammarchecker/content/overlay.css" type="text/css"?>

<!DOCTYPE overlay SYSTEM "chrome://grammarchecker/locale/overlay.dtd">

<overlay id="grammarchecker-overlay"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
  <script type="application/javascript" src="overlay.js"/>
  <script type="application/javascript" src="spellchecker.js"/>
  <script type="application/javascript" src="editor.js"/>

  <stringbundleset id="stringbundleset">
    <stringbundle id="grammarchecker-strings" src="chrome://grammarchecker/locale/grammarchecker.properties"/>
  </stringbundleset>

  <commandset id="composerEditMenuItems" commandupdater="true" 
              events="focus" 

Modified gc_lang/fr/tb/content/spell_options.xul from [5453a7e2cc] to [e6c1baec4c].

30
31
32
33
34
35
36
37
38
39
40
    <description class="dicdescr">&option.classic.descr;</description>
    <checkbox id="fr-FR-reform" class="option" label="&option.reform.label;" />
    <description class="dicdescr">&option.reform.descr;</description>
    <checkbox id="fr-FR-classic-reform" class="option" label="&option.allvar.label;" />
    <description class="dicdescr">&option.allvar.descr;</description>
  </groupbox>

  <script type="application/x-javascript" src="spell_options.js"/>
  <script type="application/x-javascript" src="spellchecker.js"/>

</dialog>







|
|


30
31
32
33
34
35
36
37
38
39
40
    <description class="dicdescr">&option.classic.descr;</description>
    <checkbox id="fr-FR-reform" class="option" label="&option.reform.label;" />
    <description class="dicdescr">&option.reform.descr;</description>
    <checkbox id="fr-FR-classic-reform" class="option" label="&option.allvar.label;" />
    <description class="dicdescr">&option.allvar.descr;</description>
  </groupbox>

  <script type="application/javascript" src="spell_options.js"/>
  <script type="application/javascript" src="spellchecker.js"/>

</dialog>

Modified graphspell-js/helpers.js from [b70dea39e2] to [d93f7e0941].

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

    loadFile: function (spf) {
        // load ressources in workers (suggested by Mozilla extensions reviewers)
        // for more options have a look here: https://gist.github.com/Noitidart/ec1e6b9a593ec7e3efed
        // if not in workers, use sdk/data.load() instead
        try {
            let xRequest;
            if (typeof XMLHttpRequest !== "undefined") {
                xRequest = new XMLHttpRequest();
            } else {
                // JS sucks again… necessary for Thunderbird
                let { Cc, Ci } = require("chrome");
                xRequest = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance();
                xRequest.QueryInterface(Ci.nsIXMLHttpRequest);
            }
            xRequest.open('GET', spf, false); // 3rd arg is false for synchronous, sync is acceptable in workers
            xRequest.overrideMimeType('text/json');
            xRequest.send();
            return xRequest.responseText;
        }
        catch (e) {
            this.logerror(e);







<
|
<
<
<
<
<
<







49
50
51
52
53
54
55

56






57
58
59
60
61
62
63

    loadFile: function (spf) {
        // load ressources in workers (suggested by Mozilla extensions reviewers)
        // for more options have a look here: https://gist.github.com/Noitidart/ec1e6b9a593ec7e3efed
        // if not in workers, use sdk/data.load() instead
        try {
            let xRequest;

            xRequest = new XMLHttpRequest();






            xRequest.open('GET', spf, false); // 3rd arg is false for synchronous, sync is acceptable in workers
            xRequest.overrideMimeType('text/json');
            xRequest.send();
            return xRequest.responseText;
        }
        catch (e) {
            this.logerror(e);

Modified make.py from [dbe9299caf] to [4008460ad6].

361
362
363
364
365
366
367

368
369
370
371
372
373
374
    xParser.add_argument("-pm", "--perf_memo", help="run performance tests and store results in perf_memo.txt", action="store_true")
    xParser.add_argument("-js", "--javascript", help="JavaScript build for Firefox", action="store_true")
    xParser.add_argument("-aed", "--add_extended_dictionary", help="add extended dictionary to the build", action="store_true")
    xParser.add_argument("-apd", "--add_personal_dictionary", help="add personal dictionary to the build", action="store_true")
    xParser.add_argument("-fx", "--firefox", help="Launch Firefox Developper for WebExtension testing", action="store_true")
    xParser.add_argument("-we", "--web_ext", help="Launch Firefox Nightly for WebExtension testing", action="store_true")
    xParser.add_argument("-tb", "--thunderbird", help="Launch Thunderbird", action="store_true")

    xParser.add_argument("-i", "--install", help="install the extension in Writer (path of unopkg must be set in config.ini)", action="store_true")
    xArgs = xParser.parse_args()

    if xArgs.build_data:
        xArgs.build_data_before = True
        xArgs.build_data_after = True








>







361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
    xParser.add_argument("-pm", "--perf_memo", help="run performance tests and store results in perf_memo.txt", action="store_true")
    xParser.add_argument("-js", "--javascript", help="JavaScript build for Firefox", action="store_true")
    xParser.add_argument("-aed", "--add_extended_dictionary", help="add extended dictionary to the build", action="store_true")
    xParser.add_argument("-apd", "--add_personal_dictionary", help="add personal dictionary to the build", action="store_true")
    xParser.add_argument("-fx", "--firefox", help="Launch Firefox Developper for WebExtension testing", action="store_true")
    xParser.add_argument("-we", "--web_ext", help="Launch Firefox Nightly for WebExtension testing", action="store_true")
    xParser.add_argument("-tb", "--thunderbird", help="Launch Thunderbird", action="store_true")
    xParser.add_argument("-tbb", "--thunderbird_beta", help="Launch Thunderbird Beta", action="store_true")
    xParser.add_argument("-i", "--install", help="install the extension in Writer (path of unopkg must be set in config.ini)", action="store_true")
    xArgs = xParser.parse_args()

    if xArgs.build_data:
        xArgs.build_data_before = True
        xArgs.build_data_after = True

446
447
448
449
450
451
452


453




454
455
456
457
458
459
460
461
462
                    else:
                        # Firefox Nightly edition
                        spfFirefox = dVars['win_fx_nightly_path']  if platform.system() == "Windows"  else dVars['linux_fx_nightly_path']
                    os.system(r'web-ext run --firefox="' + spfFirefox + '" --browser-console --firefox-profile=debug')            

            # Thunderbird
            if xArgs.thunderbird:


                os.system("thunderbird -jsconsole -P debug")




        else:
            print("Folder not found: gc_lang/"+sLang)

    oNow = datetime.datetime.now()
    print("============== MAKE GRAMMALECTE [finished] at {0.hour:>2} h {0.minute:>2} min {0.second:>2} s ==============".format(oNow))


if __name__ == '__main__':
    main()







>
>
|
>
>
>
>









447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
                    else:
                        # Firefox Nightly edition
                        spfFirefox = dVars['win_fx_nightly_path']  if platform.system() == "Windows"  else dVars['linux_fx_nightly_path']
                    os.system(r'web-ext run --firefox="' + spfFirefox + '" --browser-console --firefox-profile=debug')            

            # Thunderbird
            if xArgs.thunderbird:
                spfThunderbird = '"'+dVars['win_tb_path']+'"'  if platform.system() == "Windows"  else dVars['linux_tb_path']
                print(spfThunderbird)
                os.system(spfThunderbird + ' -jsconsole -P debug')
            if xArgs.thunderbird_beta:
                spfThunderbird = '"'+dVars['win_tb_beta_path']+'"'  if platform.system() == "Windows"  else dVars['linux_tb_beta_path']
                print(spfThunderbird)
                os.system(spfThunderbird + ' -jsconsole -P beta')
        else:
            print("Folder not found: gc_lang/"+sLang)

    oNow = datetime.datetime.now()
    print("============== MAKE GRAMMALECTE [finished] at {0.hour:>2} h {0.minute:>2} min {0.second:>2} s ==============".format(oNow))


if __name__ == '__main__':
    main()