Grammalecte  Check-in [018b49d9ba]

Overview
Comment:[fx] arrow for tooltips
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fx | kill_innerHTML
Files: files | file ages | folders
SHA3-256: 018b49d9ba21d92d65b00a50bc87a82b517ea0a065f1eac1e15f260013791599
User & Date: olr on 2017-07-18 09:31:22
Other Links: branch diff | manifest | tags
Context
2017-07-18
10:38
[fx] tooltip arrow position adjustment check-in: 22c8e20f5f user: olr tags: fx, kill_innerHTML
09:31
[fx] arrow for tooltips check-in: 018b49d9ba user: olr tags: fx, kill_innerHTML
08:35
[fx] remember ignored errors check-in: 5a76e4a564 user: olr tags: fx, kill_innerHTML
Changes

Modified gc_lang/fr/xpi/data/gc_panel.css from [d8c0673a48] to [c54a2e432d].

155
156
157
158
159
160
161




162
163
164
165
166
167
168
#gc_tooltip {
    border: 3px solid hsl(210, 50%, 30%);
    color: hsla(210, 10%, 20%, 1);
}
#sc_tooltip {
    border: 3px solid hsl(0, 50%, 30%);
    color: hsla(0, 10%, 20%, 1);




}
#gc_tooltip #gc_rule_id {
    display: none;
    background-color: hsla(0, 5%, 35%, 1);
    padding: 2px 5px;
    margin-left: 5px;
    border-radius: 2px;







>
>
>
>







155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#gc_tooltip {
    border: 3px solid hsl(210, 50%, 30%);
    color: hsla(210, 10%, 20%, 1);
}
#sc_tooltip {
    border: 3px solid hsl(0, 50%, 30%);
    color: hsla(0, 10%, 20%, 1);
}
#gc_tooltip_arrow, #sc_tooltip_arrow {
    position: absolute;
    display: none;
}
#gc_tooltip #gc_rule_id {
    display: none;
    background-color: hsla(0, 5%, 35%, 1);
    padding: 2px 5px;
    margin-left: 5px;
    border-radius: 2px;

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

46
47
48
49
50
51
52



53
54
55
56
57
58
59
            <p class="center">Grammalecte a besoin de vous<br>pour poursuivre sa route.</p>
            <p class="center" style="margin: 10px 0"><a href="https://fr.ulule.com/grammalecte-2/" onclick="return false;">Campagne de financement participatif…</a></p>
        </div>

        <div id="errorlist">
            <!-- result comes here -->
        </div>




        <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; 







>
>
>







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
            <p class="center">Grammalecte a besoin de vous<br>pour poursuivre sa route.</p>
            <p class="center" style="margin: 10px 0"><a href="https://fr.ulule.com/grammalecte-2/" onclick="return false;">Campagne de financement participatif…</a></p>
        </div>

        <div id="errorlist">
            <!-- result comes here -->
        </div>

        <img id="gc_tooltip_arrow" src="img/gc_tooltip_arrow.png" alt="^">
        <img id="sc_tooltip_arrow" src="img/sc_tooltip_arrow.png" alt="^">

        <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; 

Modified gc_lang/fr/xpi/data/gc_panel.js from [2a10459ec0] to [717ac8a586].

294
295
296
297
298
299
300

301


302
303
304
305
306
307
308
309
...
316
317
318
319
320
321
322

323
324
325
326
327
328
329
...
363
364
365
366
367
368
369


370
371
372
373
374
375
376

function showTooltip (sNodeErrorId) {  // err
    try {
        hideAllTooltips();
        let xNodeErr = document.getElementById(sNodeErrorId);
        let sTooltipId = (xNodeErr.dataset.error_type === "grammar") ? "gc_tooltip" : "sc_tooltip";
        let xNodeTooltip = document.getElementById(sTooltipId);

        let nLimit = nPanelWidth - 330; // paragraph width - tooltip width


        xNodeTooltip.style.top = (xNodeErr.offsetTop + 16) + "px";
        xNodeTooltip.style.left = (xNodeErr.offsetLeft > nLimit) ? nLimit + "px" : xNodeErr.offsetLeft + "px";
        if (xNodeErr.dataset.error_type === "grammar") {
            // grammar error
            document.getElementById("gc_message").textContent = xNodeErr.dataset.gc_message;
            if (xNodeErr.dataset.gc_url != "") {
                document.getElementById("gc_url").style.display = "inline";
                document.getElementById("gc_url").setAttribute("href", xNodeErr.dataset.gc_url);
................................................................................
            xGCSugg.textContent = "";
            for (let sSugg of xNodeErr.dataset.suggestions.split("|")) {
                xGCSugg.appendChild(_createSuggestion(xNodeErr.dataset.error_id, iSugg, sSugg));
                xGCSugg.appendChild(document.createTextNode(" "));
                iSugg += 1;
            }
        }

        xNodeTooltip.style.display = "block";
        if (xNodeErr.dataset.error_type === "spelling") {
            // spelling mistake
            document.getElementById("sc_ignore").dataset.error_id = xNodeErr.dataset.error_id;
            //console.log("getSuggFor: " + xNodeErr.textContent.trim() + " // error_id: " + xNodeErr.dataset.error_id);
            self.port.emit("getSuggestionsForTo", xNodeErr.textContent.trim(), xNodeErr.dataset.error_id);
        }
................................................................................
    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";


}

function setSpellSuggestionsFor (sWord, sSuggestions, sErrId) {
    // spell checking suggestions
    try {
        // console.log("setSuggestionsFor: " + sWord + " > " + sSuggestions + " // " + sErrId);
        let xSuggBlock = document.getElementById("sc_sugg_block");







>

>
>
|







 







>







 







>
>







294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
...
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
...
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382

function showTooltip (sNodeErrorId) {  // err
    try {
        hideAllTooltips();
        let xNodeErr = document.getElementById(sNodeErrorId);
        let sTooltipId = (xNodeErr.dataset.error_type === "grammar") ? "gc_tooltip" : "sc_tooltip";
        let xNodeTooltip = document.getElementById(sTooltipId);
        let xNodeTooltipArrow = document.getElementById(sTooltipId+"_arrow"); 
        let nLimit = nPanelWidth - 330; // paragraph width - tooltip width
        xNodeTooltipArrow.style.top = (xNodeErr.offsetTop + 16) + "px"
        xNodeTooltipArrow.style.left = (xNodeErr.offsetLeft + Math.floor(xNodeErr.offsetWidth / 2)) + "px"
        xNodeTooltip.style.top = (xNodeErr.offsetTop + 20) + "px";
        xNodeTooltip.style.left = (xNodeErr.offsetLeft > nLimit) ? nLimit + "px" : xNodeErr.offsetLeft + "px";
        if (xNodeErr.dataset.error_type === "grammar") {
            // grammar error
            document.getElementById("gc_message").textContent = xNodeErr.dataset.gc_message;
            if (xNodeErr.dataset.gc_url != "") {
                document.getElementById("gc_url").style.display = "inline";
                document.getElementById("gc_url").setAttribute("href", xNodeErr.dataset.gc_url);
................................................................................
            xGCSugg.textContent = "";
            for (let sSugg of xNodeErr.dataset.suggestions.split("|")) {
                xGCSugg.appendChild(_createSuggestion(xNodeErr.dataset.error_id, iSugg, sSugg));
                xGCSugg.appendChild(document.createTextNode(" "));
                iSugg += 1;
            }
        }
        xNodeTooltipArrow.style.display = "block";
        xNodeTooltip.style.display = "block";
        if (xNodeErr.dataset.error_type === "spelling") {
            // spelling mistake
            document.getElementById("sc_ignore").dataset.error_id = xNodeErr.dataset.error_id;
            //console.log("getSuggFor: " + xNodeErr.textContent.trim() + " // error_id: " + xNodeErr.dataset.error_id);
            self.port.emit("getSuggestionsForTo", xNodeErr.textContent.trim(), xNodeErr.dataset.error_id);
        }
................................................................................
    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";
    document.getElementById("gc_tooltip_arrow").style.display = "none";
    document.getElementById("sc_tooltip_arrow").style.display = "none";
}

function setSpellSuggestionsFor (sWord, sSuggestions, sErrId) {
    // spell checking suggestions
    try {
        // console.log("setSuggestionsFor: " + sWord + " > " + sSuggestions + " // " + sErrId);
        let xSuggBlock = document.getElementById("sc_sugg_block");

Added gc_lang/fr/xpi/data/img/gc_tooltip_arrow.png version [fd88b7cdf7].

cannot compute difference between binary files

Added gc_lang/fr/xpi/data/img/sc_tooltip_arrow.png version [983d7be01e].

cannot compute difference between binary files