Skip to content

Commit 004adf5

Browse files
committed
Stubbed in an All section in Reference. Currently commented out.
Signed-off-by: Grant Skinner <[email protected]>
1 parent 3316907 commit 004adf5

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

js/documentation.js

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,14 +520,39 @@ var errors = {
520520
// infinite is handled in the Help section.
521521
};
522522

523-
// add escaped characters:
523+
// add escaped characters to the reference:
524+
var reference = library.kids[1];
524525
var chars = "\t\n\v\f\r\0.\\+*?^$[]{}()|/";
525526
var tokens = "tnvfr0";
526-
var kids = library.kids[1].kids[2].kids;
527+
var kids = reference.kids[2].kids;
527528
for (var i=0; i<chars.length; i++) {
528529
kids.push(Docs.getEscCharDocs(chars[i], tokens[i], misc.kids[0].tip));
529530
}
530531

532+
533+
/*
534+
// add the "All" reference section:
535+
kids = reference.kids;
536+
kids.unshift({
537+
label: "All",
538+
desc: "All RegEx tokens supported in JS.",
539+
kids: []
540+
});
541+
var all = kids[0].kids;
542+
for (i=0; i<kids.length; i++) {
543+
var entries = kids[i].kids;
544+
for (var j=0; j<entries.length; j++) {
545+
var entry = entries[j];
546+
var o = {};
547+
for (var n in entry) { o[n] = entry[n]; }
548+
o.label = o.label||o.id;
549+
delete(o.id);
550+
all.push(o);
551+
}
552+
}
553+
//*/
554+
555+
531556
Docs.setContent({errors:errors, library:library, misc:misc});
532557

533558
})();

js/views/DocView.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ SOFTWARE.
158158

159159
window.addEventListener("resize", $.bind(this, this.deferResize));
160160
this.resize();
161+
this.deferResize(); // this (hopefully) fixes an odd bug in some browsers where the initial draw is wrong.
161162
this.setupUndo();
162163

163164
this.setInitialExpression();

0 commit comments

Comments
 (0)