// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
-// Copyright (c) 2008-2011 by Kris Maglione <maglione.k@gmail.com>
+// Copyright (c) 2008-2012 Kris Maglione <maglione.k@gmail.com>
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-/* use strict */
+"use strict";
/** @scope modules */
onKeyPress: function (events) { if (modes.main == modes.QUOTE) modes.pop(); }
});
this.addMode("IGNORE", { hidden: true }, {
- onKeyPress: function (events) Events.KILL,
+ onKeyPress: function (events_) {
+ if (events.isCancelKey(DOM.Event.stringify(events_[0])))
+ return true;
+ return false;
+ },
bases: [],
passthrough: true
});
return;
}
- params = params || this.getMode(mainMode || this.main).params;
+ params = params || Object.create(this.getMode(mainMode || this.main).params);
if (!stack && mainMode != null && this._modeStack.length > 1)
this.reset();
update(StackElement.prototype, {
get toStringParams() !loaded.modes ? this.main.name : [
this.main.name,
- <>({ modes.all.filter(function (m) this.extended & m, this).map(function (m) m.name).join("|") })</>
+ ["(", modes.all.filter(function (m) this.extended & m, this)
+ .map(function (m) m.name).join("|"),
+ ")"].join("")
]
});
return StackElement;
for (let base in values(mode.bases))
tree[base.name][mode.name] = tree[mode.name];
- let roots = iter([m.name, tree[m.name]] for (m in values(list)) if (!m.bases.length)).toObject();
+ let roots = iter([m.name, tree[m.name]]
+ for (m in values(list))
+ if (!m.bases.length)).toObject();
- default xml namespace = NS;
function rec(obj) {
- XML.ignoreWhitespace = XML.prettyPrinting = false;
-
- let res = <ul dactyl:highlight="Dense" xmlns:dactyl={NS}/>;
+ let res = ["ul", { "dactyl:highlight": "Dense" }];
Object.keys(obj).sort().forEach(function (name) {
let mode = modes.getMode(name);
- res.* += <li><em>{mode.displayName}</em>: {mode.description}{
- rec(obj[name])
- }</li>;
+ res.push(["li", {},
+ ["em", {}, mode.displayName],
+ ": ", mode.description,
+ rec(obj[name])]);
});
- if (res.*.length())
+ if (res.length > 2)
return res;
- return <></>;
+ return [];
}
return rec(roots);