aboutsummaryrefslogtreecommitdiffstats
path: root/lib/handler_stack.coffee
AgeCommit message (Collapse)Author
2017-11-09Suppress propagation for keyup events when we have for keydown eventsmrmr1993
2017-10-29Suppress all keyup events automatically if we consume the keydownmrmr1993
2017-10-25FF: Share |root| global proxy, re-add the globals to window on DOMLoadmrmr1993
This is a workaround for Firefox bug 1408996.
2016-04-13Add <c-y> and <c-e> for visual mode.Stephen Blott
Fixes #2092.
2016-03-31Fix @suppressEvent and tweak comments.Stephen Blott
2016-03-30Rework handlerStack.bubbleEvent() for greater clarity.Stephen Blott
2016-03-30Rename handlerStack constants.Stephen Blott
Problems: - The meanings of some of the Mode/handlerStack constant names is far from obvious. - The same thing is named different things in different places. This changes various constant names such that: - the names used in the handler stack and in the modes are the same. - ditto vis-a-vis DomUtils. Also, break out the core of the handler stacks' `bubbleEvent` method into a switch statements. This makes it more obvious that the cases are mutually exclusive.
2016-03-05Key bindings; more tweaks and fixes.Stephen Blott
Miscellaneous fixes and tweaks, including: - Reinstate key logging. - Fix count handling in line with expected behaviour in #2024. - Remove `noCount` option; we don't need it. - Simplify logic in various places. Fixes #2024.
2016-03-04Do not use standalone @.Stephen Blott
The styles guide says not to use standalone `@`. So this changes the occurrences I could find (with sed) to `this`. Occurrences within files with major outstanding PRs are omitted.
2015-10-04Suppress trailing key events (after link hints).Stephen Blott
This ensures that -- on leaving link hints mode -- we consume any trailing keyup events (and don't let the underlying page see them). Additional notes: - There are other places where we seem to be leaking keyup events. - A separate bug... It looks like we're calling `exit()` on link-hints mode twice.
2015-04-18Mode indicator: strip all references to badges.Stephen Blott
2015-02-09Merge branch 'visual-and-edit-modes'Stephen Blott
Conflicts: background_scripts/main.coffee content_scripts/vimium_frontend.coffee lib/keyboard_utils.coffee
2015-01-24Visual/edit modes: miscellaneous improvements.Stephen Blott
2015-01-23Visual/edit modes: develop edit mode.Stephen Blott
- implement "i", "a". - fix "w" for edit mode. - try out "e" for enter edit mode. - initial implementation "o", "O" - Suppress backspace and delete. - Scroll in text areas.
2015-01-20Rework DOM tests (integrate keyboard-event handling).Stephen Blott
This uses phantomjs to generate keyboard events. So the events are propagated through the regular event listeners. So we're testing the full keyboard-event flow.
2015-01-20Rework DOM tests.Stephen Blott
- Set up modes such that they can be re-initialised. - Move initialisation of BadgeMode to general initialisation function. - Add reset() method for handlerStack. - Consistently use initializeModeState() in all tests' setup(). - Refactor focusInput tests. - Add some more tests. - Simplify some other tests. Note: Clean-up of the inputFocus overlay now happens when the exit() method is called in Mode.reset(). This eliminates most needs to artificially bubble a keyboard event to clear the overlay.
2015-01-18Modes; pre-merge clean up.Stephen Blott
2015-01-11Modes; yet more tweaks, yet more tests.Stephen Blott
2015-01-11Modes; rework debugging support.Stephen Blott
2015-01-11Modes; add DOM tests.Stephen Blott
2015-01-11Modes; add DOM tests.Stephen Blott
2015-01-10Modes; instrument for debugging...Stephen Blott
- Set Mode.debug to true to see mode activation/deactivation on the console. - Use Mode.log() to see a list of currently-active modes. - Use handlerStack.debugOn() to enable debugging of the handler stack.
2015-01-10Modes; more changes...Stephen Blott
- Better comments. - Strip unnecessary handlers for leaving post-find mode. - Simplify passKeys. - focusInput now re-bubbles its triggering keydown event.
2015-01-08Modes; incorporate small changes from #1413.Stephen Blott
Slightly more significant: Move several utilities to dome_utils.
2015-01-08Modes; refactor PostFindMode key handling.Stephen Blott
In particular, this refactors the handling of non-vimium key events in PostFindMode. This implements option 2 from #1415. However, #1415 is not resolved, and option 3 remains a viable option.
2015-01-07Modes; Continue incorporation of comments in #1413.Stephen Blott
- Slight rework of HandlerStack. - Remove classs ExitOnEscape and ExitOnBlur - Rework InsertMode, plus trigger and blocker. - Remove StateMode. - Do no mixin options. - Lots of tidy up (including set a debug variable to Mode).
2015-01-07Modes; rework Singletons, InsertModeBlocker and HandlerStack.Stephen Blott
This begins work on addressing @philc's comments in #1413. That work is nevertheless not yet complete.
2015-01-05Modes; revise InsertMode as two classes.Stephen Blott
2015-01-04Modes; comment tweeks.Stephen Blott
2015-01-04Revise handler stack implementation.Stephen Blott
The old implementation: - Wasn't actually checking whether handlers had been removed before calling them. - Could end up calling the same handler twice (if a handler was removed further down the stack, and the stack elements moved due the resulting splice. Solution: - Mark elements as removed and check. Set their ids to null. - Don't splice stack. Also, optimisation: - Removing the element at the top of the stack is still O(1). - In Modes, reverse handlers before removing (so, more likely to hit the optimisation above). For the record, the stable stack length at the moment seems to be about 10-12 elements.
2015-01-03Modes; more renaming and refactoring.Stephen Blott
2015-01-03Modes; better constant naming.Stephen Blott
2015-01-02Modes; incorporate find mode.Stephen Blott
2015-01-02Modes; fix insert mode.Stephen Blott
2015-01-02Modes; rework badge handling and fix passkeys mode.Stephen Blott
2015-01-02Modes; better name for handlerStack.passDirectlyToPage.Stephen Blott
2015-01-01Modes; implement insert mode.Stephen Blott
2015-01-01Modes; minor changes.Stephen Blott
2015-01-01Modes; incorporate three test modes.Stephen Blott
As a proof of concept, this incorporates normal mode, passkeys mode and insert mode.
2014-12-31Modes proof-of-concept.Stephen Blott
2012-10-20Refactor handlerStack. Closes #657.Jez Ng
Previously, handlerStack was designed only for removal of the handler right at the top of the stack. However, some handlers sought to remove themselves when they were not at the top of the stack, creating confusion. The new handlerStack ensures that such removal can always be done safely.