Grammalecte  Check-in [64a6a08b79]

Overview
Comment:[fr] update: lexicon editor
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fx
Files: files | file ages | folders
SHA3-256: 64a6a08b79d6adb3df73e3da6252befd1f092912fa2b8073f84b017679350d6f
User & Date: olr on 2018-01-23 15:30:09
Other Links: manifest | tags
Context
2018-01-24
16:24
[fx] update: lexicon editor check-in: ae6457bb81 user: olr tags: trunk, fx
2018-01-23
15:30
[fr] update: lexicon editor check-in: 64a6a08b79 user: olr tags: trunk, fx
11:31
[fx] update: lexicon editor check-in: 70d86a32b0 user: olr tags: trunk, fx
Changes

Modified gc_lang/fr/webext/manifest.json from [e08a3d0ea1] to [444665e26c].

123
124
125
126
127
128
129

130
131
132
133
134
135
136
    "grammalecte/fr/tests_data.json",
    "img/logo-16.png"
  ],

  "permissions": [
    "activeTab",
    "contextMenus",

    "storage"
  ],

  "chrome_settings_overrides": {
    "search_provider": {
      "name": "Grammalecte",
      "search_url": "https://www.dicollecte.org/dictionary.php?prj=fr&lemma={searchTerms}",







>







123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
    "grammalecte/fr/tests_data.json",
    "img/logo-16.png"
  ],

  "permissions": [
    "activeTab",
    "contextMenus",
    "downloads",
    "storage"
  ],

  "chrome_settings_overrides": {
    "search_provider": {
      "name": "Grammalecte",
      "search_url": "https://www.dicollecte.org/dictionary.php?prj=fr&lemma={searchTerms}",

Modified gc_lang/fr/webext/panel/lex_editor.css from [62b6a530c3] to [3cee00f715].

158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
    font-family: "Courier New", Courier, "Lucida Sans Typewriter", "Lucida Typewriter", monospace;
}

#buttonline {
    text-align: right;
}

#add_to_dictionary {
    display: inline-block;
    padding: 7px 10px;
    font-size: 20px;
    background-color: hsl(0, 30%, 30%);
    color: hsl(0, 30%, 60%);
    border-radius: 3px;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
#add_to_dictionary:hover {
    background-color: hsl(0, 60%, 40%);
    color: hsl(0, 60%, 70%);
    box-shadow: 0 0 2px hsl(0, 60%, 50%);
}







|











|




158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
    font-family: "Courier New", Courier, "Lucida Sans Typewriter", "Lucida Typewriter", monospace;
}

#buttonline {
    text-align: right;
}

#add_to_lexicon {
    display: inline-block;
    padding: 7px 10px;
    font-size: 20px;
    background-color: hsl(0, 30%, 30%);
    color: hsl(0, 30%, 60%);
    border-radius: 3px;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
#add_to_lexicon:hover {
    background-color: hsl(0, 60%, 40%);
    color: hsl(0, 60%, 70%);
    box-shadow: 0 0 2px hsl(0, 60%, 50%);
}

Modified gc_lang/fr/webext/panel/lex_editor.html from [413c8d10ea] to [f63ed175e8].

229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
                <h2>Mots générés</h2>
                <h3>Forme fléchie (lemme), étiquettes</h3>
                <div id="results">
                    
                </div>
                
                <div id="buttonline">
                    <div id="add_to_dictionary">Ajouter au dictionnaire</div>
                </div>
            </div>
            
        </div>


        <script src="../grammalecte/graphspell/helpers.js"></script>







|







229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
                <h2>Mots générés</h2>
                <h3>Forme fléchie (lemme), étiquettes</h3>
                <div id="results">
                    
                </div>
                
                <div id="buttonline">
                    <div id="add_to_lexicon">Ajouter au dictionnaire</div>
                </div>
            </div>
            
        </div>


        <script src="../grammalecte/graphspell/helpers.js"></script>

Modified gc_lang/fr/webext/panel/lex_editor.js from [5cc54c497e] to [e7376134de].

44
45
46
47
48
49
50
51


52
53
54
55
56
57
58
}


document.getElementById("editor").addEventListener("click", onSelectionClick, false);
document.getElementById("word").addEventListener("keyup", onWrite, false);
document.getElementById("word2").addEventListener("keyup", onWrite2, false);
document.getElementById("lemma").addEventListener("keyup", () => { oFlex.update(); }, false);
document.getElementById("tags").addEventListener("keyup", () => { oFlex.update(); } , false);




/*
    ACTIONS
*/

const oPage = {







|
>
>







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
}


document.getElementById("editor").addEventListener("click", onSelectionClick, false);
document.getElementById("word").addEventListener("keyup", onWrite, false);
document.getElementById("word2").addEventListener("keyup", onWrite2, false);
document.getElementById("lemma").addEventListener("keyup", () => { oFlex.update(); }, false);
document.getElementById("tags").addEventListener("keyup", () => { oFlex.update(); }, false);
document.getElementById("add_to_lexicon").addEventListener("click", () => { oFlex.addToLexicon(); }, false);



/*
    ACTIONS
*/

const oPage = {
267
268
269
270
271
272
273























274
275

276



277










            document.getElementById("results").innerHTML = sText;
            oPage.showActions();
        } else {
            oPage.hideActions();
        }
    },
























    addToDictionary: function () {


    }



}

















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

>
|
>
>
>
|
>
>
>
>
>
>
>
>
>
>
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
            document.getElementById("results").innerHTML = sText;
            oPage.showActions();
        } else {
            oPage.hideActions();
        }
    },

    addToLexicon: function () {
        try {
            oLexicon.addFlexions(this.lFlexion);
            oLexicon.save();
        }
        catch (e) {
            showError(e);
        }
    }
}



const oLexicon = {

    lFlexion: [],

    addFlexions: function (lFlex) {
        for (let aFlex of lFlex) {
            this.lFlexion.push(aFlex);
        }
    },

    load: function () {

    },

    save: function () {
        console.log(this.lFlexion);
    },

    build: function () {
        return null;
    },

    export: function () {
        let xBlob = new Blob(['{ "app": "grammalecte", "data": ["énum", "test"] }'], {type: 'application/json'}); 
        let sURL = URL.createObjectURL(xBlob);
        browser.downloads.download({ filename: "grammalecte_personal_dictionary.json", url: sURL, saveAs: true });
    }
}