aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/mode.coffee
diff options
context:
space:
mode:
authorStephen Blott2014-12-31 19:04:26 +0000
committerStephen Blott2014-12-31 20:00:07 +0000
commitf2b428b4fe1eecd66ee95513da779470f7c621aa (patch)
tree038032ba697ec0a46b1647b73866901195b27520 /content_scripts/mode.coffee
parent4a00f76f2ad3d0ec8cdb70c7e45f561d5a73ff27 (diff)
downloadvimium-f2b428b4fe1eecd66ee95513da779470f7c621aa.tar.bz2
Modes proof-of-concept.
Diffstat (limited to 'content_scripts/mode.coffee')
-rw-r--r--content_scripts/mode.coffee12
1 files changed, 12 insertions, 0 deletions
diff --git a/content_scripts/mode.coffee b/content_scripts/mode.coffee
new file mode 100644
index 00000000..f7bf9e69
--- /dev/null
+++ b/content_scripts/mode.coffee
@@ -0,0 +1,12 @@
+root = exports ? window
+
+class root.Mode
+ constructor: (onKeydown, onKeypress, onKeyup, @popModeCallback) ->
+ @handlerId = handlerStack.push
+ keydown: onKeydown
+ keypress: onKeypress
+ keyup: onKeyup
+
+ popMode: ->
+ handlerStack.remove @handlerId
+ @popModeCallback()