summaryrefslogtreecommitdiff
path: root/common/modules/template.jsm
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2011-01-25 21:09:56 -0500
committerKris Maglione <maglione.k@gmail.com>2011-01-25 21:09:56 -0500
commit102fb67efff462160837ce733c8d542f91f8467a (patch)
treecb6beb1c2e372fba4ec231708e35ae4bc85add79 /common/modules/template.jsm
parentd9300049b0d16e1e8d108bf03eb6d57bc723d5cd (diff)
parenta66864d0774a081e11446fb0ffffb4246a228617 (diff)
downloadpentadactyl-102fb67efff462160837ce733c8d542f91f8467a.tar.gz
Merge key-processing.
Diffstat (limited to 'common/modules/template.jsm')
-rw-r--r--common/modules/template.jsm12
1 files changed, 11 insertions, 1 deletions
diff --git a/common/modules/template.jsm b/common/modules/template.jsm
index d9db8cb6..902d6f04 100644
--- a/common/modules/template.jsm
+++ b/common/modules/template.jsm
@@ -131,6 +131,16 @@ var Template = Module("Template", {
update: function update() {
this.collapsed = !this.commandAllowed;
}
+ }),
+
+ Events: Class("Events", Binding, {
+ init: function init(node, params) {
+ init.supercall(this, node);
+
+ let obj = params.eventTarget;
+ for (let [event, handler] in Iterator(obj[this.getAttribute("events") || "events"]))
+ node.addEventListener(event, obj.closure(handler), false);
+ }
})
},
@@ -329,7 +339,7 @@ var Template = Module("Template", {
let re = util.regexp(<![CDATA[
(?P<pre> [/\s]|^)
(?P<tag> '[\w-]+' | :(?:[\w-]+|!) | (?:._)?<[\w-]+> )
- (?= [[!,;./\s]|$)
+ (?= [[\)!,;./\s]|$)
]]>, "g");
return this.highlightSubstrings(str, (function () {
for (let res in re.iterate(str))