Parent Directory
|
Revision Log
++ ChangeLog 14 Aug 2008 07:18:47 -0000 2008-08-14 Wakaba <wakaba@suika.fam.cx> * cc-script.js, cc-style.js: Support for tab styling of the "input" subsections. Support for the "details" widget. ++ html/WebHACC/Language/ChangeLog 14 Aug 2008 07:19:38 -0000 2008-08-14 Wakaba <wakaba@suika.fam.cx> * CacheManifest.pm: Compile errors fixed. ++ html/WebHACC/ChangeLog 14 Aug 2008 07:19:14 -0000 2008-08-14 Wakaba <wakaba@suika.fam.cx> * Output.pm: Support for inner tabs for "input" subsections. Improved support for "details" widget.
| 1 | wakaba | 1.4 | function addSourceToParseErrorList (idPrefix, dlId) { |
| 2 | wakaba | 1.1 | var parseErrorsList = document.getElementById |
| 3 | wakaba | 1.4 | (idPrefix + dlId); |
| 4 | wakaba | 1.1 | if (!parseErrorsList) return; |
| 5 | var childs = parseErrorsList.childNodes; | ||
| 6 | var childsL = childs.length; | ||
| 7 | var line = 0; | ||
| 8 | var column = 0; | ||
| 9 | for (var i = 0; i < childsL; i++) { | ||
| 10 | var child = childs[i]; | ||
| 11 | if (child.nodeType != 1) continue; | ||
| 12 | if (child.nodeName == 'DT') { | ||
| 13 | wakaba | 1.5 | line = parseInt (child.getAttribute ('data-line') || 0); |
| 14 | column = parseInt (child.getAttribute ('data-column') || 0); | ||
| 15 | wakaba | 1.1 | } else if (child.nodeName == 'DD') { |
| 16 | if (line > 0) { | ||
| 17 | var lineEl = document.getElementById (idPrefix + 'line-' + line); | ||
| 18 | if (lineEl) { | ||
| 19 | lineText = lineEl.innerHTML | ||
| 20 | wakaba | 1.3 | .replace (/<var>U\+([0-9A-F]{4})<\/var>/g, function (s) { |
| 21 | return String.fromCharCode (parseInt (s, 16)); | ||
| 22 | }) | ||
| 23 | wakaba | 1.1 | .replace (/</g, '<') |
| 24 | .replace (/>/g, '>') | ||
| 25 | .replace (/ /g, '\u00A0') | ||
| 26 | .replace (/"/g, '"') | ||
| 27 | .replace (/&/g, '&'); | ||
| 28 | var p = document.createElement ('p'); | ||
| 29 | p.className = 'source-fragment'; | ||
| 30 | var code = document.createElement ('code'); | ||
| 31 | if (lineText.length > 50) { | ||
| 32 | if (column - 25 > 0) { | ||
| 33 | p.appendChild (document.createElement ('var')).innerHTML | ||
| 34 | = '...'; | ||
| 35 | lineText = lineText.substring (column - 25, column + 24); | ||
| 36 | code.appendChild (document.createTextNode | ||
| 37 | (lineText.substring (0, 24))); | ||
| 38 | code.appendChild (document.createElement ('mark')) | ||
| 39 | .appendChild (document.createTextNode | ||
| 40 | (lineText.charAt (24))); | ||
| 41 | code.appendChild (document.createTextNode | ||
| 42 | (lineText.substring (25, lineText.length))); | ||
| 43 | p.appendChild (code); | ||
| 44 | p.appendChild (document.createElement ('var')).innerHTML | ||
| 45 | = '...'; | ||
| 46 | } else { | ||
| 47 | lineText = lineText.substring (0, 50); | ||
| 48 | if (column > 0) { | ||
| 49 | code.appendChild (document.createTextNode | ||