diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-01-25 21:09:56 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-01-25 21:09:56 -0500 |
commit | 102fb67efff462160837ce733c8d542f91f8467a (patch) | |
tree | cb6beb1c2e372fba4ec231708e35ae4bc85add79 /common/modules/template.jsm | |
parent | d9300049b0d16e1e8d108bf03eb6d57bc723d5cd (diff) | |
parent | a66864d0774a081e11446fb0ffffb4246a228617 (diff) | |
download | pentadactyl-102fb67efff462160837ce733c8d542f91f8467a.tar.gz |
Merge key-processing.
Diffstat (limited to 'common/modules/template.jsm')
-rw-r--r-- | common/modules/template.jsm | 12 |
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)) |