Grammalecte  Check-in [a646054ced]

Overview
Comment:[fx] dictionaries manager: update
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fx | comdic
Files: files | file ages | folders
SHA3-256: a646054cedde110bd53d63b85a6e33af665407f62f217bbcbb9008b02dc4284c
User & Date: olr on 2019-02-09 14:07:22
Other Links: branch diff | manifest | tags
Context
2019-02-09
20:27
merge trunk check-in: aea2e8d9ee user: olr tags: comdic
14:07
[fx] dictionaries manager: update check-in: a646054ced user: olr tags: fx, comdic
2019-02-05
18:40
merge trunk check-in: 521f9f5963 user: olr tags: comdic
Changes

Modified gc_lang/fr/webext/panel/dictionaries.html from [8ce0f3ed0b] to [2c8f4ed726].

1
2
3
4
5
6
7
8
9
10
11
12
13

















14
15
16
17
18
19
20
<!DOCTYPE HTML>
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="dictionaries.css" />
    <title>Grammalecte · Dictionnaires communautaires</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  </head>

  <body>

    <div class="inbox">

      <h1>Dictionnaires communautaires</h1>


















        <div id="apply" class="apply">Appliquer les modifications</div>
        <h2>Dictionnaires sélectionnés</h2>
        <p id="dictionaries_list">[Aucun]<p>


        <h2><span id="num_dic">0</span> dictionnaires disponibles</h2>













>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE HTML>
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="dictionaries.css" />
    <title>Grammalecte · Dictionnaires communautaires</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  </head>

  <body>

    <div class="inbox">

      <h1>Dictionnaires communautaires</h1>

        <div id="connect_panel">
            <div id="connect_form">
                <div>Inscription</div>
                <p>Vous n’êtes pas identifié.</p>
                <p>
                    <label value="E-mail"><input type="text" name="email"></label>
                    <label value="Mot de passe"><input type="password" name="pw"></label>
                    <div id="submit_button">Envoyer</div>
                </p>
            </div>
            <div id="connect_info">
                <p>
                    Identifiants : <span id="login_label"> </span>, <span id="email_label"> </span>
                </p>
            </div>
        </div>

        <div id="apply" class="apply">Appliquer les modifications</div>
        <h2>Dictionnaires sélectionnés</h2>
        <p id="dictionaries_list">[Aucun]<p>


        <h2><span id="num_dic">0</span> dictionnaires disponibles</h2>

Modified gc_lang/fr/webext/panel/dictionaries.js from [f9a15fdf35] to [66c74db008].

46
47
48
49
50
51
52










































53
54
55
56
57
58
59
    if (document.getElementById(sElemId)) {
        document.getElementById(sElemId).style.display = "none";
    } else {
        console.log("HTML node named <" + sElemId + "> not found.")
    }
}













































class Table {

    constructor (sNodeId, lColumn, sProgressBarId, sResultId="", bDeleteButtons=true, bActionButtons) {
        this.sNodeId = sNodeId;
        this.xTable = document.getElementById(sNodeId);







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
    if (document.getElementById(sElemId)) {
        document.getElementById(sElemId).style.display = "none";
    } else {
        console.log("HTML node named <" + sElemId + "> not found.")
    }
}

async function hashText (sText, sAlgorithm = 'SHA-256') {
    let msgBuffer = new TextEncoder('utf-8').encode(sText);
    let hashBuffer = await crypto.subtle.digest(sAlgorithm, msgBuffer);
    let hashArray = Array.from(new Uint8Array(hashBuffer));
    return hashArray.map(b => ('00' + b.toString(16)).slice(-2)).join('');
}


oConnect = {
    bConnected: false,

    init: function () {
        if (bChrome) {
            browser.storage.local.get("credentials", this._init().bind(this));
            return;
        }
        let xPromise = browser.storage.local.get("credentials");
        xPromise.then(this._init.bind(this), showError);
    },

    _init: function (oData) {
        if (oData.hasOwnProperty("credentials")) {
            hideElement("connect_form");
            showElement("connect_info");
            this.bConnected = true;
        }
        else {
            hideElement("connect_form");
            showElement("connect_info");
        }
    },

    listen: function () {
        document.getElementById("submit_button").addEventListener("click", (xEvent) => { this.connect() });
    },

    connect: function () {
        let sEmail = document.getElementById("email").value;
        let sPassword = document.getElementById("password").value;
        console.log(sEmail, sPassword);
    }
}


class Table {

    constructor (sNodeId, lColumn, sProgressBarId, sResultId="", bDeleteButtons=true, bActionButtons) {
        this.sNodeId = sNodeId;
        this.xTable = document.getElementById(sNodeId);
310
311
312
313
314
315
316



        browser.runtime.sendMessage({ sCommand: "setDictionary", dParam: {sDictionary: "community", oDict: oDict}, dInfo: {} });
    }
}

const oDicTable = new Table("dictionaries_table", ["Nom", "Entrées", "Description", "Date"], "wait_progress", "num_dic", false, true);

oDicTable.init();










>
>
>
352
353
354
355
356
357
358
359
360
361
        browser.runtime.sendMessage({ sCommand: "setDictionary", dParam: {sDictionary: "community", oDict: oDict}, dInfo: {} });
    }
}

const oDicTable = new Table("dictionaries_table", ["Nom", "Entrées", "Description", "Date"], "wait_progress", "num_dic", false, true);

oDicTable.init();

oConnect.init();
oConnect.listen();