Grammalecte  Diff

Differences From Artifact [30d4ca29ce]:

To Artifact [19387800f2]:


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







-
+









function onSelectionClick (xEvent) {
    try {
        let xElem = xEvent.target;
        if (xElem.id) {
            if (xElem.id.startsWith("select_")) {
                showSection("section_" + xElem.id.slice(7));
                oPage.showSection("section_" + xElem.id.slice(7));
            } else {
                
            }
        } else {
            
        }
    }
32
33
34
35
36
37
38


39
40
41
42
43
44
45







46
47
48
49
50
51
52
































































32
33
34
35
36
37
38
39
40







41
42
43
44
45
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
102
103
104
105
106
107
108
109
110
111
112







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

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



/*
    ACTIONS
*/

const oPage = {

function hideAllSections () {
    for (let xElem of document.getElementById("editor").childNodes) {
        if (xElem.id) {
            xElem.style.display = "none";
        }
    }
}
    hideAllSections: function () {
        for (let xElem of document.getElementById("editor").childNodes) {
            if (xElem.id) {
                xElem.style.display = "none";
            }
        }
    },

function showSection (sName) {
    hideAllSections();
    if (document.getElementById(sName)) {
        document.getElementById(sName).style.display = "block";
    }
}
    showSection: function (sName) {
        this.clear();
        this.hideAllSections();
        if (document.getElementById(sName)) {
            document.getElementById(sName).style.display = "block";
        }
    },

    clear: function () {
        try {
            // nom, adjectif, noms propres
            for (let xElem of document.getElementsByName("POS")) {
                xElem.checked = false;
            }
            for (let xElem of document.getElementsByName("POS2")) {
                xElem.checked = false;
            }
            for (let xElem of document.getElementsByName("pluriel")) {
                xElem.checked = false;
            }
            for (let xElem of document.getElementsByName("genre")) {
                xElem.checked = false;
            }
            // verbe
            document.getElementById("v_i").checked = false;
            document.getElementById("v_t").checked = false;
            document.getElementById("v_n").checked = false;
            document.getElementById("v_p").checked = false;
            document.getElementById("v_m").checked = false;
            document.getElementById("v_ae").checked = false;
            document.getElementById("v_aa").checked = false;
            // autre
            document.getElementById("lemma").value = "";
            document.getElementById("tags").value = "";
        }
        catch (e) {
            showError(e);
        }
    }
}



const oFlex = {

    sLemma: "",
    lFlexion: [],

    getLemma: function () {
        this.sLemma = document.getElementById("lemma").value;
    },

    create: function () {

    },

    show: function () {

    },

    addToDictionary: function () {

    }
}