Grammalecte  Check-in [5da1befa07]

Overview
Comment:[fx] display rule id in debug mode
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fx | kill_innerHTML
Files: files | file ages | folders
SHA3-256: 5da1befa0721eb3763dddbc797e43707e967bfc743c8389c308e14b5849a1ac1
User & Date: olr on 2017-07-18 11:47:20
Other Links: branch diff | manifest | tags
Context
2017-07-25
11:03
[fx] merge kill_innerHTML + lexicographer update + UI update check-in: a7259a047c user: olr tags: fx, major_change, trunk
2017-07-18
11:47
[fx] display rule id in debug mode Closed-Leaf check-in: 5da1befa07 user: olr tags: fx, kill_innerHTML
10:38
[fx] tooltip arrow position adjustment check-in: 22c8e20f5f user: olr tags: fx, kill_innerHTML
Changes

Modified gc_core/js/lang_core/gc_engine.js from [e250bfaf63] to [ee18ec83ee].

   216    216       // Message
   217    217       if (sMsg[0] === "=") {
   218    218           sMessage = oEvalFunc[sMsg.slice(1)](s, m)
   219    219       } else {
   220    220           sMessage = sMsg._expand(m);
   221    221       }
   222    222       if (bIdRule) {
   223         -        sMessage += "  #" + sLineId + " #" + sRuleId;
          223  +        sMessage += " ##" + sLineId + " #" + sRuleId;
   224    224       }
   225    225       oErr["sMessage"] = sMessage;
   226    226       // URL
   227    227       oErr["URL"] = sURL || "";
   228    228       // Context
   229    229       if (bContext) {
   230    230           oErr["sUnderlined"] = sx.slice(m.start[iGroup], m.end[iGroup]);

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

   162    162   }
   163    163   #gc_tooltip_arrow, #sc_tooltip_arrow {
   164    164       position: absolute;
   165    165       display: none;
   166    166   }
   167    167   #gc_tooltip #gc_rule_id {
   168    168       display: none;
   169         -    background-color: hsla(0, 5%, 35%, 1);
          169  +    margin: 0 0 5px 0;
          170  +    border: 1px solid hsl(210, 50%, 60%);
          171  +    background-color: hsl(210, 50%, 40%);
   170    172       padding: 2px 5px;
   171         -    margin-left: 5px;
   172    173       border-radius: 2px;
   173         -    color: hsla(0, 0%, 96%, 1);
          174  +    color: hsla(210, 0%, 96%, 1);
   174    175       font-size: 11px;
   175    176       font-style: normal;
          177  +    text-align: center;
   176    178   }
   177    179   #gc_message_block {
   178    180       padding: 5px 10px 10px 10px;
   179    181       background-color: hsl(210, 50%, 30%);
   180    182       color: hsl(210, 50%, 96%);
   181    183   }
   182    184   #sc_message_block {

Modified gc_lang/fr/xpi/data/gc_panel.js from [7ec8fbbdd9] to [3ba65998c7].

   302    302           let nLimit = nPanelWidth - 330; // paragraph width - tooltip width
   303    303           xNodeTooltipArrow.style.top = (xNodeErr.offsetTop + 16) + "px"
   304    304           xNodeTooltipArrow.style.left = (xNodeErr.offsetLeft + Math.floor((xNodeErr.offsetWidth / 2))-4) + "px" // 4 is half the width of the arrow.
   305    305           xNodeTooltip.style.top = (xNodeErr.offsetTop + 20) + "px";
   306    306           xNodeTooltip.style.left = (xNodeErr.offsetLeft > nLimit) ? nLimit + "px" : xNodeErr.offsetLeft + "px";
   307    307           if (xNodeErr.dataset.error_type === "grammar") {
   308    308               // grammar error
   309         -            document.getElementById("gc_message").textContent = xNodeErr.dataset.gc_message;
          309  +            if (xNodeErr.dataset.gc_message.includes(" ##")) {
          310  +                let n = xNodeErr.dataset.gc_message.indexOf(" ##");
          311  +                document.getElementById("gc_message").textContent = xNodeErr.dataset.gc_message.slice(0, n);
          312  +                document.getElementById("gc_rule_id").textContent = "Règle : " + xNodeErr.dataset.gc_message.slice(n+2);
          313  +                document.getElementById("gc_rule_id").style.display = "block";
          314  +            } else {
          315  +                document.getElementById("gc_message").textContent = xNodeErr.dataset.gc_message;
          316  +            }
   310    317               if (xNodeErr.dataset.gc_url != "") {
   311    318                   document.getElementById("gc_url").style.display = "inline";
   312    319                   document.getElementById("gc_url").setAttribute("href", xNodeErr.dataset.gc_url);
   313    320               } else {
   314    321                   document.getElementById("gc_url").style.display = "none";
   315    322               }
   316    323               document.getElementById("gc_ignore").dataset.error_id = xNodeErr.dataset.error_id;
................................................................................
   366    373       let sIdParagr = sCheckButtonId.slice(5);
   367    374       self.port.emit("modifyAndCheck", sIdParagr, getPurgedTextOfParagraph("paragr"+sIdParagr));
   368    375       stopWaitIcon();
   369    376   }
   370    377   
   371    378   function hideAllTooltips () {
   372    379       document.getElementById("gc_tooltip").style.display = "none";
          380  +    document.getElementById("gc_rule_id").style.display = "none";
   373    381       document.getElementById("sc_tooltip").style.display = "none";
   374    382       document.getElementById("gc_tooltip_arrow").style.display = "none";
   375    383       document.getElementById("sc_tooltip_arrow").style.display = "none";
   376    384   }
   377    385   
   378    386   function setSpellSuggestionsFor (sWord, sSuggestions, sErrId) {
   379    387       // spell checking suggestions