Grammalecte  Check-in [603dc4246d]

Overview
Comment:[tb][fr][js] conjugueur: table de conjugaison dans le module conj au lieu de l’ui
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fr | tb
Files: files | file ages | folders
SHA3-256: 603dc4246d2259d86483c7b151817b3feba4a577dcda0eab1ce2721da655bff9
User & Date: olr on 2019-05-06 15:09:36
Other Links: manifest | tags
Context
2019-05-06
15:21
[fr] ajustement check-in: bcae854603 user: olr tags: trunk, fr
15:09
[tb][fr][js] conjugueur: table de conjugaison dans le module conj au lieu de l’ui check-in: 603dc4246d user: olr tags: trunk, fr, tb
13:56
[fx][fr][js] conjugueur: table de conjugaison dans le module conj au lieu de l’ui check-in: 397ebe76eb user: olr tags: trunk, fr, fx
Changes

Modified gc_lang/fr/tb/content/conjugueur.js from [7858c1ae9f] to [3912023790].

78
79
80
81
82
83
84
85
86
87
88


89
90
91
92
93
94
95
96
97
98
99


100
101

102
103
104
105

106
107
108
109
110
111
112
113
114

115
116
117
118
119
120

121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142





143
144
145
146
147
148


149
150
151

152
153
154
155
156
157
158
159
160
161
162
163
164












165
166
167
168
169
170
171
172






173
174
175
176
177
178
179
180
181
182
183
184




185
186
187


188
189
190
191
192
193
194
195
196
197
198
199
200



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219




















220
221
222

223
224
225
226
227
228
229
230
231
232
233
234






235
236

237
238
239
240
241
242
243
244
245
246
247
248



249
250
251
252
253
254
255






256
257
258
259
260
261
262
263
264
265










266
267
268
269
270
271
272

273
274
275
276
78
79
80
81
82
83
84

85


86
87
88
89
90
91
92
93
94
95



96
97


98
99
100
101

102
103
104
105






106

107
108
109
110

111

112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127





128
129
130
131
132






133
134

135

136
137












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








150
151
152
153
154
155












156
157
158
159



160
161













162
163
164



















165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184



185












186
187
188
189
190
191


192












193
194
195







196
197
198
199
200
201










202
203
204
205
206
207
208
209
210
211

212
213
214
215
216
217
218
219
220
221
222







-

-
-
+
+








-
-
-
+
+
-
-
+



-
+



-
-
-
-
-
-
+
-




-
+
-
















-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
-

-
+

-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-






+




                if (!conj.isVerb(sVerb)) {
                    document.getElementById('verb').style = "color: #BB4411;";
                } else {
                    document.getElementById('verb_title').textContent = sVerb;
                    document.getElementById('verb').style = "color: #999999;";
                    document.getElementById('verb').value = "";
                    this.oVerb = new Verb(sVerb);
                    let sRawInfo = this.oVerb._sRawInfo;
                    document.getElementById('info').textContent = this.oVerb.sInfo;
                    document.getElementById('opro').textContent = "pronominal";
                    if (sRawInfo.endsWith("zz")) {
                    document.getElementById('opro').textContent = this.oVerb.sProLabel;
                    if (this.oVerb.bUncomplete) {
                        document.getElementById('opro').checked = false;
                        document.getElementById('opro').disabled = true;
                        document.getElementById('opro').style = "color: #CCC;";
                        document.getElementById('otco').checked = false;
                        document.getElementById('otco').disabled = true;
                        document.getElementById('otco').style = "color: #CCC;";
                        document.getElementById('smallnote').hidden = false;
                    } else {
                        if (sRawInfo[5] == "_") {
                            document.getElementById('opro').checked = false;
                            document.getElementById('opro').disabled = true;
                        document.getElementById('otco').disabled = false;
                        document.getElementById('otco').style = "color: #000;";
                            document.getElementById('opro').style = "color: #CCC;";
                        } else if (["q", "u", "v", "e"].includes(sRawInfo[5])) {
                        if (this.oVerb.nPronominable == 0) {
                            document.getElementById('opro').checked = false;
                            document.getElementById('opro').disabled = false;
                            document.getElementById('opro').style = "color: #000;";
                        } else if (sRawInfo[5] == "p" || sRawInfo[5] == "r") {
                        } else if (this.oVerb.nPronominable == 1) {
                            document.getElementById('opro').checked = true;
                            document.getElementById('opro').disabled = true;
                            document.getElementById('opro').style = "color: #CCC;";
                        } else if (sRawInfo[5] == "x") {
                            document.getElementById('opro').textContent = "cas particuliers";
                            document.getElementById('opro').checked = false;
                            document.getElementById('opro').disabled = true;
                            document.getElementById('opro').style = "color: #CCC;";
                        } else {
                        } else { // -1 or 1 or error
                            document.getElementById('opro').textContent = "# erreur #";
                            document.getElementById('opro').checked = false;
                            document.getElementById('opro').disabled = true;
                            document.getElementById('opro').style = "color: #CCC;";
                        }
                        document.getElementById('otco').disabled = false;
                        document.getElementById('smallnote').textContent = "❦";
                        document.getElementById('otco').style = "color: #000;";
                    }
                    this._displayResults();
                }
            }
        }
        catch (e) {
            console.error(e);
            // Cu.reportError(e);
        }
    },

    _displayResults: function () {
        if (this.oVerb === null) {
            return;
        }
        try {
            let opro = document.getElementById('opro').checked;
            let oneg = document.getElementById('oneg').checked;
            let otco = document.getElementById('otco').checked;
            let oint = document.getElementById('oint').checked;
            let ofem = document.getElementById('ofem').checked;
            let bPro = document.getElementById('opro').checked;
            let bNeg = document.getElementById('oneg').checked;
            let bTCo = document.getElementById('otco').checked;
            let bInt = document.getElementById('oint').checked;
            let bFem = document.getElementById('ofem').checked;
            // titles
            this._setTitles();
            // participes passés
            document.getElementById('ppas1').textContent = this.oVerb.participePasse(":Q1") || " "; // something or nbsp
            document.getElementById('ppas2').textContent = this.oVerb.participePasse(":Q2") || " ";
            document.getElementById('ppas3').textContent = this.oVerb.participePasse(":Q3") || " ";
            let oConjTable = this.oVerb.createConjTable(bPro, bNeg, bTCo, bInt, bFem);
            document.getElementById('verb').Text = "";
            document.getElementById('ppas4').textContent = this.oVerb.participePasse(":Q4") || " ";
            // infinitif
            document.getElementById('infi').textContent = this.oVerb.infinitif(opro, oneg, otco, oint, ofem);
            document.getElementById('infi').textContent = oConjTable["infi"] || " "; // something or nbsp
            // participe présent
            document.getElementById('ppre').textContent = this.oVerb.participePresent(opro, oneg, otco, oint, ofem) || " ";
            // conjugaisons
            document.getElementById('ipre1').textContent = this.oVerb.conjugue(":Ip", ":1s", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ipre2').textContent = this.oVerb.conjugue(":Ip", ":2s", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ipre3').textContent = this.oVerb.conjugue(":Ip", ":3s", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ipre4').textContent = this.oVerb.conjugue(":Ip", ":1p", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ipre5').textContent = this.oVerb.conjugue(":Ip", ":2p", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ipre6').textContent = this.oVerb.conjugue(":Ip", ":3p", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('iimp1').textContent = this.oVerb.conjugue(":Iq", ":1s", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('iimp2').textContent = this.oVerb.conjugue(":Iq", ":2s", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('iimp3').textContent = this.oVerb.conjugue(":Iq", ":3s", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('iimp4').textContent = this.oVerb.conjugue(":Iq", ":1p", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ppre').textContent = oConjTable["ppre"] || " ";
            // participes passés
            document.getElementById('ppas1').textContent = oConjTable["ppas1"] || " ";
            document.getElementById('ppas2').textContent = oConjTable["ppas2"] || " ";
            document.getElementById('ppas3').textContent = oConjTable["ppas3"] || " ";
            document.getElementById('ppas4').textContent = oConjTable["ppas4"] || " ";
            // impératif
            document.getElementById('impe_temps').textContent = oConjTable["t_impe"] || " ";
            document.getElementById('impe1').textContent = oConjTable["impe1"] || " ";
            document.getElementById('impe2').textContent = oConjTable["impe2"] || " ";
            document.getElementById('impe3').textContent = oConjTable["impe3"] || " ";
            // présent
            document.getElementById('iimp5').textContent = this.oVerb.conjugue(":Iq", ":2p", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('iimp6').textContent = this.oVerb.conjugue(":Iq", ":3p", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ipsi1').textContent = this.oVerb.conjugue(":Is", ":1s", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ipsi2').textContent = this.oVerb.conjugue(":Is", ":2s", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ipsi3').textContent = this.oVerb.conjugue(":Is", ":3s", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ipsi4').textContent = this.oVerb.conjugue(":Is", ":1p", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ipsi5').textContent = this.oVerb.conjugue(":Is", ":2p", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ipsi6').textContent = this.oVerb.conjugue(":Is", ":3p", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ipre_temps').textContent = oConjTable["t_ipre"] || " ";
            document.getElementById('ipre1').textContent = oConjTable["ipre1"] || " ";
            document.getElementById('ipre2').textContent = oConjTable["ipre2"] || " ";
            document.getElementById('ipre3').textContent = oConjTable["ipre3"] || " ";
            document.getElementById('ipre4').textContent = oConjTable["ipre4"] || " ";
            document.getElementById('ipre5').textContent = oConjTable["ipre5"] || " ";
            document.getElementById('ifut1').textContent = this.oVerb.conjugue(":If", ":1s", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ifut2').textContent = this.oVerb.conjugue(":If", ":2s", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ifut3').textContent = this.oVerb.conjugue(":If", ":3s", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ifut4').textContent = this.oVerb.conjugue(":If", ":1p", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ifut5').textContent = this.oVerb.conjugue(":If", ":2p", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ifut6').textContent = this.oVerb.conjugue(":If", ":3p", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('conda1').textContent = this.oVerb.conjugue(":K", ":1s", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('conda2').textContent = this.oVerb.conjugue(":K", ":2s", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('conda3').textContent = this.oVerb.conjugue(":K", ":3s", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('conda4').textContent = this.oVerb.conjugue(":K", ":1p", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('conda5').textContent = this.oVerb.conjugue(":K", ":2p", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('conda6').textContent = this.oVerb.conjugue(":K", ":3p", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('ipre6').textContent = oConjTable["ipre6"] || " ";
            // imparfait
            document.getElementById('iimp_temps').textContent = oConjTable["t_iimp"] || " ";
            document.getElementById('iimp1').textContent = oConjTable["iimp1"] || " ";
            if (!oint) {
                document.getElementById('spre1').textContent = this.oVerb.conjugue(":Sp", ":1s", opro, oneg, otco, oint, ofem) || " ";
                document.getElementById('spre2').textContent = this.oVerb.conjugue(":Sp", ":2s", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('iimp2').textContent = oConjTable["iimp2"] || " ";
            document.getElementById('iimp3').textContent = oConjTable["iimp3"] || " ";
                document.getElementById('spre3').textContent = this.oVerb.conjugue(":Sp", ":3s", opro, oneg, otco, oint, ofem) || " ";
                document.getElementById('spre4').textContent = this.oVerb.conjugue(":Sp", ":1p", opro, oneg, otco, oint, ofem) || " ";
                document.getElementById('spre5').textContent = this.oVerb.conjugue(":Sp", ":2p", opro, oneg, otco, oint, ofem) || " ";
                document.getElementById('spre6').textContent = this.oVerb.conjugue(":Sp", ":3p", opro, oneg, otco, oint, ofem) || " ";
                document.getElementById('simp1').textContent = this.oVerb.conjugue(":Sq", ":1s", opro, oneg, otco, oint, ofem) || " ";
                document.getElementById('simp2').textContent = this.oVerb.conjugue(":Sq", ":2s", opro, oneg, otco, oint, ofem) || " ";
                document.getElementById('simp3').textContent = this.oVerb.conjugue(":Sq", ":3s", opro, oneg, otco, oint, ofem) || " ";
                document.getElementById('simp4').textContent = this.oVerb.conjugue(":Sq", ":1p", opro, oneg, otco, oint, ofem) || " ";
                document.getElementById('simp5').textContent = this.oVerb.conjugue(":Sq", ":2p", opro, oneg, otco, oint, ofem) || " ";
                document.getElementById('simp6').textContent = this.oVerb.conjugue(":Sq", ":3p", opro, oneg, otco, oint, ofem) || " ";
                document.getElementById('impe1').textContent = this.oVerb.imperatif(":2s", opro, oneg, otco, ofem) || " ";
                document.getElementById('impe2').textContent = this.oVerb.imperatif(":1p", opro, oneg, otco, ofem) || " ";
                document.getElementById('impe3').textContent = this.oVerb.imperatif(":2p", opro, oneg, otco, ofem) || " ";
            document.getElementById('iimp4').textContent = oConjTable["iimp4"] || " ";
            document.getElementById('iimp5').textContent = oConjTable["iimp5"] || " ";
            document.getElementById('iimp6').textContent = oConjTable["iimp6"] || " ";
            } else {
                document.getElementById('spre_temps').textContent = " ";
                document.getElementById('spre1').textContent = " ";
                document.getElementById('spre2').textContent = " ";
                document.getElementById('spre3').textContent = " ";
                document.getElementById('spre4').textContent = " ";
                document.getElementById('spre5').textContent = " ";
                document.getElementById('spre6').textContent = " ";
                document.getElementById('simp_temps').textContent = " ";
                document.getElementById('simp1').textContent = " ";
                document.getElementById('simp2').textContent = " ";
                document.getElementById('simp3').textContent = " ";
                document.getElementById('simp4').textContent = " ";
                document.getElementById('simp5').textContent = " ";
                document.getElementById('simp6').textContent = " ";
                document.getElementById('impe_temps').textContent = " ";
                document.getElementById('impe1').textContent = " ";
                document.getElementById('impe2').textContent = " ";
                document.getElementById('impe3').textContent = " ";
            // passé simple
            document.getElementById('ipsi_temps').textContent = oConjTable["t_ipsi"] || " ";
            document.getElementById('ipsi1').textContent = oConjTable["ipsi1"] || " ";
            document.getElementById('ipsi2').textContent = oConjTable["ipsi2"] || " ";
            document.getElementById('ipsi3').textContent = oConjTable["ipsi3"] || " ";
            document.getElementById('ipsi4').textContent = oConjTable["ipsi4"] || " ";
            document.getElementById('ipsi5').textContent = oConjTable["ipsi5"] || " ";
            document.getElementById('ipsi6').textContent = oConjTable["ipsi6"] || " ";
            // futur
            document.getElementById('ifut_temps').textContent = oConjTable["t_ifut"] || " ";
            document.getElementById('ifut1').textContent = oConjTable["ifut1"] || " ";
            document.getElementById('ifut2').textContent = oConjTable["ifut2"] || " ";
            document.getElementById('ifut3').textContent = oConjTable["ifut3"] || " ";
            document.getElementById('ifut4').textContent = oConjTable["ifut4"] || " ";
            document.getElementById('ifut5').textContent = oConjTable["ifut5"] || " ";
            document.getElementById('ifut6').textContent = oConjTable["ifut6"] || " ";
            // Conditionnel
            document.getElementById('conda_temps').textContent = oConjTable["t_conda"] || " ";
            document.getElementById('conda1').textContent = oConjTable["conda1"] || " ";
            document.getElementById('conda2').textContent = oConjTable["conda2"] || " ";
            }
            if (otco) {
                document.getElementById('condb1').textContent = this.oVerb.conjugue(":Sq", ":1s", opro, oneg, otco, oint, ofem) || " ";
            document.getElementById('conda3').textContent = oConjTable["conda3"] || " ";
                document.getElementById('condb2').textContent = this.oVerb.conjugue(":Sq", ":2s", opro, oneg, otco, oint, ofem) || " ";
                document.getElementById('condb3').textContent = this.oVerb.conjugue(":Sq", ":3s", opro, oneg, otco, oint, ofem) || " ";
                document.getElementById('condb4').textContent = this.oVerb.conjugue(":Sq", ":1p", opro, oneg, otco, oint, ofem) || " ";
                document.getElementById('condb5').textContent = this.oVerb.conjugue(":Sq", ":2p", opro, oneg, otco, oint, ofem) || " ";
                document.getElementById('condb6').textContent = this.oVerb.conjugue(":Sq", ":3p", opro, oneg, otco, oint, ofem) || " ";
            } else {
                document.getElementById('condb1').textContent = " ";
                document.getElementById('condb2').textContent = " ";
                document.getElementById('condb3').textContent = " ";
                document.getElementById('condb4').textContent = " ";
                document.getElementById('condb5').textContent = " ";
                document.getElementById('condb6').textContent = " ";
            document.getElementById('conda4').textContent = oConjTable["conda4"] || " ";
            document.getElementById('conda5').textContent = oConjTable["conda5"] || " ";
            document.getElementById('conda6').textContent = oConjTable["conda6"] || " ";
            document.getElementById('condb_temps').textContent = oConjTable["t_condb"] || " ";
            document.getElementById('condb1').textContent = oConjTable["condb1"] || " ";
            document.getElementById('condb2').textContent = oConjTable["condb2"] || " ";
            }
            document.getElementById('verb').Text = "";
            document.getElementById('condb3').textContent = oConjTable["condb3"] || " ";
        }
        catch (e) {
            console.error(e);
            // Cu.reportError(e);
        }
    },

    _setTitles: function () {
        try {
            if (!document.getElementById('otco').checked) {
                document.getElementById('ipre_temps').textContent = "Présent";
                document.getElementById('ifut_temps').textContent = "Futur";
            document.getElementById('condb4').textContent = oConjTable["condb4"] || " ";
            document.getElementById('condb5').textContent = oConjTable["condb5"] || " ";
            document.getElementById('condb6').textContent = oConjTable["condb6"] || " ";
                document.getElementById('iimp_temps').textContent = "Imparfait";
                document.getElementById('ipsi_temps').textContent = "Passé simple";
                document.getElementById('spre_temps').textContent = "Présent";
                document.getElementById('simp_temps').textContent = "Imparfait";
                document.getElementById('conda_temps').textContent = "Présent";
                document.getElementById('condb_temps').textContent = " ";
                document.getElementById('impe_temps').textContent = "Présent";
            // subjonctif présent
            document.getElementById('spre_temps').textContent = oConjTable["t_spre"] || " ";
            document.getElementById('spre1').textContent = oConjTable["spre1"] || " ";
            document.getElementById('spre2').textContent = oConjTable["spre2"] || " ";
            document.getElementById('spre3').textContent = oConjTable["spre3"] || " ";
            document.getElementById('spre4').textContent = oConjTable["spre4"] || " ";
            } else {
                document.getElementById('ipre_temps').textContent = "Pas composé";
                document.getElementById('ifut_temps').textContent = "Futur antérieur";
                document.getElementById('iimp_temps').textContent = "Plus-que-parfait";
                document.getElementById('ipsi_temps').textContent = "Pas antérieur";
                document.getElementById('spre_temps').textContent = "Pas";
                document.getElementById('simp_temps').textContent = "Plus-que-parfait";
                document.getElementById('conda_temps').textContent = "Pas (1ʳᵉ forme)";
                document.getElementById('condb_temps').textContent = "Pas (2ᵉ forme)";
                document.getElementById('impe_temps').textContent = "Pas";
            document.getElementById('spre5').textContent = oConjTable["spre5"] || " ";
            document.getElementById('spre6').textContent = oConjTable["spre6"] || " ";
            // subjonctif imparfait
            document.getElementById('simp_temps').textContent = oConjTable["t_simp"] || " ";
            document.getElementById('simp1').textContent = oConjTable["simp1"] || " ";
            document.getElementById('simp2').textContent = oConjTable["simp2"] || " ";
            document.getElementById('simp3').textContent = oConjTable["simp3"] || " ";
            document.getElementById('simp4').textContent = oConjTable["simp4"] || ";
            document.getElementById('simp5').textContent = oConjTable["simp5"] || ";
            document.getElementById('simp6').textContent = oConjTable["simp6"] || " ";
            }
        }
        catch (e) {
            console.error(e);
            // Cu.reportError(e);
        }
    }

};

conj.init(helpers.loadFile("resource://grammalecte/fr/conj_data.json"));
oConj.init();