diff --git a/Reflect.js b/Reflect.js index 8a3f95b..e1a29c9 100644 --- a/Reflect.js +++ b/Reflect.js @@ -1129,4 +1129,3 @@ var Reflect; } }); })(Reflect || (Reflect = {})); -//# sourceMappingURL=Reflect.js.map \ No newline at end of file diff --git a/docs/ecmarkup.css b/docs/ecmarkup.css index cb554c7..de9bbfb 100644 --- a/docs/ecmarkup.css +++ b/docs/ecmarkup.css @@ -78,16 +78,43 @@ emu-const { emu-val { font-weight: bold; } -emu-alg ol, emu-alg ol ol ol ol { - list-style-type: decimal; -} - -emu-alg ol ol, emu-alg ol ol ol ol ol { - list-style-type: lower-alpha; -} -emu-alg ol ol ol, ol ol ol ol ol ol { - list-style-type: lower-roman; +/* depth 1 */ +emu-alg ol, +/* depth 4 */ +emu-alg ol ol ol ol, +emu-alg ol.nested-thrice, +emu-alg ol.nested-twice ol, +emu-alg ol.nested-once ol ol { + list-style-type: decimal; +} + +/* depth 2 */ +emu-alg ol ol, +emu-alg ol.nested-once, +/* depth 5 */ +emu-alg ol ol ol ol ol, +emu-alg ol.nested-four-times, +emu-alg ol.nested-thrice ol, +emu-alg ol.nested-twice ol ol, +emu-alg ol.nested-once ol ol ol { + list-style-type: lower-alpha; +} + +/* depth 3 */ +emu-alg ol ol ol, +emu-alg ol.nested-twice, +emu-alg ol.nested-once ol, +/* depth 6 */ +emu-alg ol ol ol ol ol ol, +emu-alg ol.nested-lots, +emu-alg ol.nested-four-times ol, +emu-alg ol.nested-thrice ol ol, +emu-alg ol.nested-twice ol ol ol, +emu-alg ol.nested-once ol ol ol ol, +/* depth 7+ */ +emu-alg ol.nested-lots ol { + list-style-type: lower-roman; } emu-eqn { @@ -138,6 +165,10 @@ emu-note > div.note-contents > p:last-of-type { margin-bottom: 0; } +emu-table td code { + white-space: normal; +} + emu-figure { display: block; } @@ -162,6 +193,10 @@ emu-table figure { emu-production { display: block; +} + +emu-grammar[type="example"] emu-production, +emu-grammar[type="definition"] emu-production { margin-top: 1em; margin-bottom: 1em; margin-left: 5ex; @@ -189,6 +224,7 @@ emu-gann { } emu-gann emu-t:last-child, +emu-gann emu-gprose:last-child, emu-gann emu-nt:last-child { margin-right: 0; } @@ -243,10 +279,6 @@ emu-mods { font-weight: normal; } -emu-production[collapsed] emu-mods { - display: none; -} - emu-params, emu-opt { margin-right: 1ex; font-family: monospace; @@ -265,6 +297,10 @@ emu-gprose { font-family: Helvetica, Arial, sans-serif; } +emu-production emu-gprose { + margin-right: 1ex; +} + h1.shortname { color: #f60; font-size: 1.5em; @@ -292,7 +328,7 @@ h1, h2, h3, h4, h5, h6 { h1 .secnum { text-decoration: none; - margin-right: 10px; + margin-right: 5px; } h1 span.title { diff --git a/docs/ecmarkup.js b/docs/ecmarkup.js index 6ad1a1f..ef29b3f 100644 --- a/docs/ecmarkup.js +++ b/docs/ecmarkup.js @@ -5,13 +5,18 @@ function Search(menu) { this.$search = document.getElementById('menu-search'); this.$searchBox = document.getElementById('menu-search-box'); this.$searchResults = document.getElementById('menu-search-results'); - + this.loadBiblio(); - + document.addEventListener('keydown', this.documentKeydown.bind(this)); - + this.$searchBox.addEventListener('keydown', debounce(this.searchBoxKeydown.bind(this), { stopPropagation: true })); this.$searchBox.addEventListener('keyup', debounce(this.searchBoxKeyup.bind(this), { stopPropagation: true })); + + // Perform an initial search if the box is not empty. + if (this.$searchBox.value) { + this.search(this.$searchBox.value); + } } Search.prototype.loadBiblio = function () { @@ -51,7 +56,7 @@ Search.prototype.searchBoxKeyup = function (e) { if (e.keyCode === 13 || e.keyCode === 9) { return; } - + this.search(e.target.value); } @@ -74,25 +79,23 @@ Search.prototype.triggerSearch = function (e) { // prefer shorter matches. function relevance(result, searchString) { var relevance = 0; - + relevance = Math.max(0, 8 - result.match.chunks) << 7; - + if (result.match.caseMatch) { relevance *= 2; } - + if (result.match.prefix) { relevance += 2048 } - + relevance += Math.max(0, 255 - result.entry.key.length); - + return relevance; } Search.prototype.search = function (searchString) { - var s = Date.now(); - if (searchString === '') { this.displayResults([]); this.hideSearch(); @@ -100,12 +103,12 @@ Search.prototype.search = function (searchString) { } else { this.showSearch(); } - + if (searchString.length === 1) { this.displayResults([]); return; } - + var results; if (/^[\d\.]*$/.test(searchString)) { @@ -116,7 +119,7 @@ Search.prototype.search = function (searchString) { }); } else { results = []; - + for (var i = 0; i < this.biblio.length; i++) { var entry = this.biblio[i]; if (!entry.key) { @@ -129,11 +132,11 @@ Search.prototype.search = function (searchString) { results.push({ entry: entry, match: match }); } } - + results.forEach(function (result) { result.relevance = relevance(result, searchString); }); - + results = results.sort(function (a, b) { return b.relevance - a.relevance }); } @@ -141,7 +144,7 @@ Search.prototype.search = function (searchString) { if (results.length > 50) { results = results.slice(0, 50); } - + this.displayResults(results); } Search.prototype.hideSearch = function () { @@ -158,7 +161,7 @@ Search.prototype.selectResult = function () { if ($first) { document.location = $first.getAttribute('href'); } - + this.$searchBox.value = ''; this.$searchBox.blur(); this.displayResults([]); @@ -172,7 +175,7 @@ Search.prototype.selectResult = function () { Search.prototype.displayResults = function (results) { if (results.length > 0) { this.$searchResults.classList.remove('no-results'); - + var html = '