Grammalecte  Check-in [01daed0f9f]

Overview
Comment:[fx] gc_panel: clean text, fix URL opening
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fx | kill_innerHTML
Files: files | file ages | folders
SHA3-256: 01daed0f9fa4b1fcf37756b8136c42f9223ad134bdb1d0a305bac1fc4bd6f0eb
User & Date: olr on 2017-07-15 06:24:32
Other Links: branch diff | manifest | tags
Context
2017-07-15
08:13
[fx] gc_panel: modify buttons check-in: 84a87c62b0 user: olr tags: fx, kill_innerHTML
06:24
[fx] gc_panel: clean text, fix URL opening check-in: 01daed0f9f user: olr tags: fx, kill_innerHTML
05:38
[fx] gc_panel: paragraphs editable by default check-in: 417e143855 user: olr tags: fx, kill_innerHTML
Changes

Modified gc_lang/fr/xpi/data/gc_panel.html from [4937649fc5] to [2b215e4ad5].

53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

        <div id="gc_tooltip" class="tooltip">
            <!-- grammar error -->
            <div id="gc_message_block">
                <p id="gc_rule_id"></p>
                <p id="gc_message">Erreur grammaticale.</p>
                <a id="gc_ignore" href="#">Ignorer</a> &nbsp; 
                <a id="gc_url" href="">Voulez-vous en savoir plus ?…</a>
            </div>
            <div id="gc_sugg_title">SUGGESTIONS :</div>
            <div id="gc_sugg_block"></div>
        </div>

        <div id="sc_tooltip" class="tooltip">
            <!-- spelling error -->







|







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

        <div id="gc_tooltip" class="tooltip">
            <!-- grammar error -->
            <div id="gc_message_block">
                <p id="gc_rule_id"></p>
                <p id="gc_message">Erreur grammaticale.</p>
                <a id="gc_ignore" href="#">Ignorer</a> &nbsp; 
                <a id="gc_url" href="" onclick="return false;">Voulez-vous en savoir plus ?…</a>
            </div>
            <div id="gc_sugg_title">SUGGESTIONS :</div>
            <div id="gc_sugg_block"></div>
        </div>

        <div id="sc_tooltip" class="tooltip">
            <!-- spelling error -->

Modified gc_lang/fr/xpi/data/gc_panel.js from [b1b76acc2e] to [7b61fc3131].

91
92
93
94
95
96
97


98
99
100
101
102
103
104
                } else if (xElem.id.startsWith("end")) {
                    document.getElementById(xElem.id).parentNode.parentNode.style.display = "none";
                } else if (xElem.tagName === "U" && xElem.id.startsWith("err")
                           && xElem.className !== "corrected" && xElem.className !== "ignored") {
                    showTooltip(xElem.id);
                } else if (xElem.id.startsWith("resize")) {
                    self.port.emit("resize", xElem.id, 10);


                } else {
                    hideAllTooltips();
                }
            } else if (xElem.tagName === "A") {
                self.port.emit("openURL", xElem.getAttribute("href"));
            } else {
                hideAllTooltips();







>
>







91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
                } else if (xElem.id.startsWith("end")) {
                    document.getElementById(xElem.id).parentNode.parentNode.style.display = "none";
                } else if (xElem.tagName === "U" && xElem.id.startsWith("err")
                           && xElem.className !== "corrected" && xElem.className !== "ignored") {
                    showTooltip(xElem.id);
                } else if (xElem.id.startsWith("resize")) {
                    self.port.emit("resize", xElem.id, 10);
                } else if (xElem.id === "gc_url") {
                    self.port.emit("openURL", xElem.getAttribute("href"));
                } else {
                    hideAllTooltips();
                }
            } else if (xElem.tagName === "A") {
                self.port.emit("openURL", xElem.getAttribute("href"));
            } else {
                hideAllTooltips();
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
        let sErrorId = document.getElementById(sSuggId).dataset.error_id;
        let sIdParagr = sErrorId.slice(0, sErrorId.indexOf("_"));
        startWaitIcon("paragr"+sIdParagr);
        let xNodeErr = document.getElementById("err" + sErrorId);
        xNodeErr.textContent = document.getElementById(sSuggId).textContent;
        xNodeErr.className = "corrected";
        xNodeErr.removeAttribute("style");
        self.port.emit("correction", sIdParagr, document.getElementById("paragr"+sIdParagr).textContent);
        hideAllTooltips();
        stopWaitIcon("paragr"+sIdParagr);
    }
    catch (e) {
        showError(e);
    }
}







|







253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
        let sErrorId = document.getElementById(sSuggId).dataset.error_id;
        let sIdParagr = sErrorId.slice(0, sErrorId.indexOf("_"));
        startWaitIcon("paragr"+sIdParagr);
        let xNodeErr = document.getElementById("err" + sErrorId);
        xNodeErr.textContent = document.getElementById(sSuggId).textContent;
        xNodeErr.className = "corrected";
        xNodeErr.removeAttribute("style");
        self.port.emit("correction", sIdParagr, getPurgedTextOfParagraph("paragr"+sIdParagr));
        hideAllTooltips();
        stopWaitIcon("paragr"+sIdParagr);
    }
    catch (e) {
        showError(e);
    }
}
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
        document.getElementById(sEditButtonId).className = "button";
    }
}*/

function sendBackAndCheck (sCheckButtonId) {  // check
    startWaitIcon();
    let sIdParagr = sCheckButtonId.slice(5);
    self.port.emit("modifyAndCheck", sIdParagr, document.getElementById("paragr"+sIdParagr).textContent);
    stopWaitIcon();
}

function hideAllTooltips () {
    document.getElementById("gc_tooltip").style.display = "none";
    document.getElementById("sc_tooltip").style.display = "none";
}







|







343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
        document.getElementById(sEditButtonId).className = "button";
    }
}*/

function sendBackAndCheck (sCheckButtonId) {  // check
    startWaitIcon();
    let sIdParagr = sCheckButtonId.slice(5);
    self.port.emit("modifyAndCheck", sIdParagr, getPurgedTextOfParagraph("paragr"+sIdParagr));
    stopWaitIcon();
}

function hideAllTooltips () {
    document.getElementById("gc_tooltip").style.display = "none";
    document.getElementById("sc_tooltip").style.display = "none";
}
374
375
376
377
378
379
380






381
382
383
384
385
386
387
            }
        }
    }
    catch (e) {
        showError(e);
    }
}







function copyToClipboard () {
    startWaitIcon();
    try {
        let xClipboardButton = document.getElementById("clipboard_msg");
        xClipboardButton.textContent = "copie en cours…";
        let sText = "";







>
>
>
>
>
>







376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
            }
        }
    }
    catch (e) {
        showError(e);
    }
}

function getPurgedTextOfParagraph (sNodeParagrId) {
    let sText = document.getElementById(sNodeParagrId).textContent;
    sText = sText.replace(/&nbsp;/g, " ").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
    return sText;
}

function copyToClipboard () {
    startWaitIcon();
    try {
        let xClipboardButton = document.getElementById("clipboard_msg");
        xClipboardButton.textContent = "copie en cours…";
        let sText = "";