})
});
+["appendChild", "getAttribute", "insertBefore", "setAttribute"].forEach(function (key) {
+ Object.defineProperty(Binding.prototype, key, {
+ configurable: true,
+ enumerable: false,
+ value: function () this.node[key].apply(this.node, arguments),
+ writable: true
+ });
+});
+
var Template = Module("Template", {
add: function add(a, b) a + b,
join: function join(c) function (a, b) a + c + b,
map: function map(iter, func, sep, interruptable) {
- XML.ignoreWhitespace = false; XML.prettyPrinting = false;
- if (iter.length) // FIXME: Kludge?
+ XML.ignoreWhitespace = XML.prettyPrinting = false;
+ if (typeof iter.length == "number") // FIXME: Kludge?
iter = array.iterValues(iter);
let res = <></>;
let n = 0;
var desc = this.processor[1].call(this, item, item.description);
}
- XML.ignoreWhitespace = false; XML.prettyPrinting = false;
+ XML.ignoreWhitespace = XML.prettyPrinting = false;
// <e4x>
return <div highlight={highlightGroup || "CompItem"} style="white-space: nowrap">
<!-- The non-breaking spaces prevent empty elements
if (help.initialized && !Set.has(help.tags, topic))
return <span highlight={type || ""}>{text || token}</span>;
- XML.ignoreWhitespace = false; XML.prettyPrinting = false;
+ XML.ignoreWhitespace = XML.prettyPrinting = false;
type = type || (/^'.*'$/.test(token) ? "HelpOpt" :
/^\[.*\]$|^E\d{3}$/.test(token) ? "HelpTopic" :
/^:\w/.test(token) ? "HelpEx" : "HelpKey");
if (help.initialized && !Set.has(help.tags, topic))
return <>{token}</>;
- XML.ignoreWhitespace = false; XML.prettyPrinting = false;
+ XML.ignoreWhitespace = XML.prettyPrinting = false;
let tag = (/^'.*'$/.test(token) ? "o" :
/^\[.*\]$|^E\d{3}$/.test(token) ? "t" :
/^:\w/.test(token) ? "ex" : "k");
linkifyHelp: function linkifyHelp(str, help) {
let re = util.regexp(<![CDATA[
(?P<pre> [/\s]|^)
- (?P<tag> '[\w-]+' | :(?:[\w-]+!?|!) | (?:._)?<[\w-]+>\w* | \b[a-zA-Z]_(?:\w+|.) | \[[\w-]+\] | E\d{3} )
+ (?P<tag> '[\w-]+' | :(?:[\w-]+!?|!) | (?:._)?<[\w-]+>\w* | \b[a-zA-Z]_(?:[\w[\]]+|.) | \[[\w-;]+\] | E\d{3} )
(?= [[\)!,:;./\s]|$)
]]>, "gx");
return this.highlightSubstrings(str, (function () {
// if "processStrings" is true, any passed strings will be surrounded by " and
// any line breaks are displayed as \n
highlight: function highlight(arg, processStrings, clip, bw) {
- XML.ignoreWhitespace = false; XML.prettyPrinting = false;
+ XML.ignoreWhitespace = XML.prettyPrinting = false;
// some objects like window.JSON or getBrowsers()._browsers need the try/catch
try {
let str = this.stringify(arg);
return this.highlightSubstrings(str, (function () {
if (filter.length == 0)
return;
+
+ XML.ignoreWhitespace = XML.prettyPrinting = false;
let lcstr = String.toLowerCase(str);
let lcfilter = filter.toLowerCase();
let start = 0;
</>,
jumps: function jumps(index, elems) {
- XML.ignoreWhitespace = false; XML.prettyPrinting = false;
+ XML.ignoreWhitespace = XML.prettyPrinting = false;
// <e4x>
return <table>
<tr style="text-align: left;" highlight="Title">
},
options: function options(title, opts, verbose) {
- XML.ignoreWhitespace = false; XML.prettyPrinting = false;
+ XML.ignoreWhitespace = XML.prettyPrinting = false;
// <e4x>
return <table>
<tr highlight="Title" align="left">
let url = util.fixURI(frame.filename || "unknown");
let path = util.urlPath(url);
- XML.ignoreWhitespace = false; XML.prettyPrinting = false;
+ XML.ignoreWhitespace = XML.prettyPrinting = false;
return <a xmlns:dactyl={NS} dactyl:command="buffer.viewSource"
href={url} path={path} line={frame.lineNumber}
highlight="URL">{
},
table: function table(title, data, indent) {
- XML.ignoreWhitespace = false; XML.prettyPrinting = false;
+ XML.ignoreWhitespace = XML.prettyPrinting = false;
let table = // <e4x>
<table>
<tr highlight="Title" align="left">
tabular: function tabular(headings, style, iter) {
// TODO: This might be mind-bogglingly slow. We'll see.
- XML.ignoreWhitespace = false; XML.prettyPrinting = false;
+ XML.ignoreWhitespace = XML.prettyPrinting = false;
// <e4x>
return <table>
<tr highlight="Title" align="left">
},
usage: function usage(iter, format) {
- XML.ignoreWhitespace = false; XML.prettyPrinting = false;
+ XML.ignoreWhitespace = XML.prettyPrinting = false;
format = format || {};
let desc = format.description || function (item) template.linkifyHelp(item.description);
let help = format.help || function (item) item.name;