Parent Directory
|
Revision Log
++ ChangeLog 16 Aug 2008 07:38:01 -0000 * cc-script.js: Support for #index- fragment identifiers. * cc-style.css: Prety styling for reformatted sources. Support for new version of manifest dump sections. * error-description-source.xml: Support for Whatpm::CacheManifest, Whatpm::CSS::SelectorsParser, Whatpm::CSS::MediaQueryParser, and Whatpm::CSS::Parser errors. Support for l10n of cache manifest dump sections. 2008-08-16 Wakaba <wakaba@suika.fam.cx> ++ html/WebHACC/Language/ChangeLog 16 Aug 2008 07:42:17 -0000 * CSS.pm, CacheManifest.pm, HTML.pm, XML.pm: Use ->url attribute to obtain the URL of the document. * CacheManifest.pm (generate_structure_dump_section): It is now i18n'ed. In addition, since URLs are tend to be long, tables for fallback entries are replaced by |dd| entries and paragraphs. "No entry" message is now handled by catalog, rather than CSS. 2008-08-16 Wakaba <wakaba@suika.fam.cx> ++ html/WebHACC/ChangeLog 16 Aug 2008 07:39:54 -0000 * Input.pm (Subdocument new): Invoke superclass's new method such that |urls| attribute is initialized. * Result.pm (add_error): Use ->url attribute to obtain the URL of the document. No longer output |text| argument, since all error types except for those used in the WebIDL module are now defined in the catalog. 2008-08-16 Wakaba <wakaba@suika.fam.cx>
| 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 |