Grammalecte  Check-in [70d86a32b0]

Overview
Comment:[fx] update: lexicon editor
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fx
Files: files | file ages | folders
SHA3-256: 70d86a32b0523e3f624a19f53374f2c9676ef880c8c27aa9cd6b2ca5422ce14a
User & Date: olr on 2018-01-23 11:31:46
Other Links: manifest | tags
Context
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
2018-01-22
15:47
[fx] update: lexicon editor check-in: 89947a9517 user: olr tags: trunk, fx
Changes

Modified gc_lang/fr/webext/panel/lex_editor.css from [8493426f17] to [62b6a530c3].

47
48
49
50
51
52
53



54
55
56
57
58
59
60
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63







+
+
+







}
h3 {
    margin: 3px 0 2px 0;
    color: hsl(210, 50%, 50%);
    font: bold 16px "Trebuchet MS", "Fira Sans", "Liberation Sans", sans-serif;
}

#editor {
    display: none;
}

#categories {
    display: flex;
    padding: 10px 0;
}

#word_section2 {
134
135
136
137
138
139
140
141

142
143
144
145
146
147
148
137
138
139
140
141
142
143

144
145
146
147
148
149
150
151







-
+







    border-radius: 3px;
    height: 24px;
    background: transparent;
    font: normal 20px Tahoma, "Ubuntu Condensed";
    color: hsl(0, 0%, 20%);
}
input[placeholder] {
    color: hsl(0, 0%, 80%);
    color: hsl(0, 0%, 50%);
}


#actions {
    display: none;
    padding: 10px;
}

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

9
10
11
12
13
14
15
16

17
18
19
20
21
22
23
9
10
11
12
13
14
15

16
17
18
19
20
21
22
23







-
+







    <body>

        <div class="inbox">

            <h1>Éditeur lexical</h1>

            <h2>Nouveau mot</h2>
            <input type="text" id="word" name="word" maxlength="60" value="" placeholder="votre mot" autofocus />
            <input type="text" id="word" name="word" maxlength="60" value="" placeholder="votre mot" pattern="^[a-zA-Zà-ö0-9À-Öø-ÿØ-ßĀ-ʯ._-]+$" autofocus />

            <div id="editor">

                <div id="categories">
                    <div class="category" id="select_nom" data-tag="N">Nom, adjectif</div>
                    <div class="category" id="select_verbe" data-tag="V">Verbe</div>
                    <div class="category" id="select_adverbe" data-tag="W">Adverbe</div>
59
60
61
62
63
64
65
66

67
68
69
70
71
72
73
59
60
61
62
63
64
65

66
67
68
69
70
71
72
73







-
+







                                <p><input type="radio" id="up_nom_pluriel_s" name="pluriel" value="s" /><label for="up_nom_pluriel_s"> pluriel en ·s</label></p>
                                <p><input type="radio" id="up_nom_pluriel_x" name="pluriel" value="x" /><label for="up_nom_pluriel_x"> pluriel en ·x</label></p>
                                <p><input type="radio" id="up_nom_pluriel_i" name="pluriel" value="i" /><label for="up_nom_pluriel_i"> invariable</label></p>
                            </div>
                        </div>

                        <h2>[optionnel] Autre forme (masculine, féminine, variante, etc.)</h2>
                        <input type="text" id="word2" name="word2" maxlength="60" value="" placeholder="votre mot" />
                        <input type="text" id="word2" name="word2" maxlength="60" value="" pattern="^[a-zA-Zà-ö0-9À-Öø-ÿØ-ßĀ-ʯ._-]+$" placeholder="votre mot" />
                        <div id="word_section2">
                            <p class="typeline">
                                <input type="radio" id="up_type_nom2" name="POS2" value=":N" /> <label class="widelabel" for="up_type_nom2">Nom</label>
                                <input type="radio" id="up_type_adj2" name="POS2" value=":A" /> <label class="widelabel" for="up_type_adj2">Adjectif</label>
                                <input type="radio" id="up_type_nomadj2" name="POS2" value=":N:A" /> <label class="widelabel" for="up_type_nomadj2">Nom &amp; adjectif</label>
                            </p>
                            <div class="container">
121
122
123
124
125
126
127
128

129
130
131
132
133
134
135
121
122
123
124
125
126
127

128
129
130
131
132
133
134
135







-
+







                        </div>
                        <div class="block">
                            <h3><input type="checkbox" id="up_v_p" value="p" /><label for="up_v_p"> pronominal</label></h3>
                            <div class="description">Cochez cette case si ce verbe peut s’utiliser pronominalement.</div>
                            <details>
                                <div class="container">
                                    <div class="examples_true">Je me suis trompé.<br/>Tu t’es étonné toi-même.<br/>Elle s’est souvenu de ses études.<br/>Nous nous sommes égarés.<br/>Vous vous êtes retrouvées.<br/>Ils se sont rappelé leur enfance.</div>
                                    <div class="examples_false">Je me suis venu.</div>
                                    <div class="examples_false">Je me suis venu.<br/>tu t’es arrivé.<br/>elle s’est marché.<br/>nous nous sommes courus.<br/>vous vous êtes acculés.<br/>Elles se sont capitulées.</div>
                                </div>
                            </details>
                        </div>
                        <div class="block">
                            <h3><input type="checkbox" id="up_v_m" value="m" /><label for="up_v_m"> impersonnel</label></h3>
                            <div class="description">Cochez cette case si ce verbe ne peut s’utiliser à la première personne, mais uniquement à la troisième personne du singulier ou du pluriel.</div>
                            <details>
214
215
216
217
218
219
220
221

222
223

224
225
226
227
228
229
230
214
215
216
217
218
219
220

221
222

223
224
225
226
227
228
229
230







-
+

-
+







                        </div>
                    </div>

                    <div id="section_autre" class="section">
                        <h2>Autre</h2>
                        <p>Indiquez les étiquettes grammaticales que vous voulez appliquer au mot. À utiliser seulement si vous savez ce que vous faites. Dans le cas contraire, tant pis pour vous.</p>
                        <h3>Lemme</h3>
                        <p><input type="text" id="up_lemma" name="lemma" maxlength="20" value="" placeholder="lemme" /></p>
                        <p><input type="text" id="lemma" name="lemma" maxlength="20" value="" pattern="^[a-zA-Zà-ö0-9À-Öø-ÿØ-ßĀ-ʯ._-]+$" placeholder="lemme" /></p>
                        <h3>Étiquettes</h3>
                        <p><input type="text" id="up_tags" name="tags" maxlength="20" value="" placeholder="étiquettes" /></p>
                        <p><input type="text" id="tags" name="tags" maxlength="20" value="" pattern="^:[a-zA-Zà-ö0-9À-Öø-ÿØ-ßĀ-ʯ:._-]+$"placeholder="étiquettes" /></p>
                    </div>
                </div>
            </div>
            
            <div id="actions">
                <h2>Mots générés</h2>
                <h3>Forme fléchie (lemme), étiquettes</h3>

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

43
44
45
46
47
48
49
50


51
52
53
54
55
56
57
43
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 = {
106
107
108
109
110
111
112
113
114


115
116
117
118
119
120
121
107
108
109
110
111
112
113


114
115
116
117
118
119
120
121
122







-
-
+
+







            document.getElementById("up_v_t").checked = false;
            document.getElementById("up_v_n").checked = false;
            document.getElementById("up_v_p").checked = false;
            document.getElementById("up_v_m").checked = false;
            document.getElementById("up_v_ae").checked = false;
            document.getElementById("up_v_aa").checked = false;
            // autre
            document.getElementById("up_lemma").value = "";
            document.getElementById("up_tags").value = "";
            document.getElementById("lemma").value = "";
            document.getElementById("tags").value = "";
        }
        catch (e) {
            showError(e);
        }
    },

    showWord2: function () {
179
180
181
182
183
184
185
186
187


188
189
190
191


192
193
194

195
196
197
198
199
200
201
180
181
182
183
184
185
186


187
188
189
190


191
192
193
194

195
196
197
198
199
200
201
202







-
-
+
+


-
-
+
+


-
+







                                break;
                        }
                        let sWord2 = document.getElementById("word2").value.trim();
                        if (sWord2.length > 0) {
                            let sTag2 = this.getRadioValue("POS2") + this.getRadioValue("genre2");
                            switch (this.getRadioValue("pluriel2")) {
                                case "s":
                                    this.addFlexion(sWord2, sWord2, sTag2+":s");
                                    this.addFlexion(sWord2+"s", sWord2, sTag2+":p");
                                    this.addFlexion(sWord2, sWord, sTag2+":s");
                                    this.addFlexion(sWord2+"s", sWord, sTag2+":p");
                                    break;
                                case "x":
                                    this.addFlexion(sWord2, sWord2, sTag2+":s");
                                    this.addFlexion(sWord2+"x", sWord2, sTag2+":p");
                                    this.addFlexion(sWord2, sWord, sTag2+":s");
                                    this.addFlexion(sWord2+"x", sWord, sTag2+":p");
                                    break;
                                case "i":
                                    this.addFlexion(sWord2, sWord2, sTag2+":i");
                                    this.addFlexion(sWord2, sWord, sTag2+":i");
                                    break;
                            }
                        }
                        break;
                    case "V":
                        if (!sWord.endsWith("er") && !sWord.endsWith("ir")) {
                            break;
229
230
231
232
233
234
235







236
237
238
239
240
241
242
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250







+
+
+
+
+
+
+







                        }
                        break;
                    case "MP":
                        sGenderTag = this.getRadioValue("genre_mp");
                        if (sGenderTag) {
                            this.addFlexion(sWord, sWord, ":MP"+sGenderTag+":i");
                        }
                        break;
                    case "X":
                        let sLemma = document.getElementById("lemma").value.trim();
                        let sTags = document.getElementById("tags").value.trim();
                        if (sLemma.length > 0 && sTags.startsWith(":")) {
                            this.addFlexion(sWord, sLemma, sTags);
                        }
                        break;
                }
            }
            this.show();
        }
        catch (e) {
            showError(e);