From ee95cb38bbd24fec444e0af3f593f470cce60d22 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Tue, 24 Oct 2017 19:34:20 +0100 Subject: Move mainFrame and showHelp to normal mode file --- content_scripts/mode_normal.coffee | 4 ++++ content_scripts/vimium_frontend.coffee | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/content_scripts/mode_normal.coffee b/content_scripts/mode_normal.coffee index 652adc3c..6ae82fe6 100644 --- a/content_scripts/mode_normal.coffee +++ b/content_scripts/mode_normal.coffee @@ -108,6 +108,10 @@ NormalModeCommands = performFind: (count) -> FindMode.findNext false for [0...count] by 1 performBackwardsFind: (count) -> FindMode.findNext true for [0...count] by 1 + # Misc. + mainFrame: -> focusThisFrame highlight: true, forceFocusThisFrame: true + showHelp: (sourceFrameId) -> HelpDialog.toggle {sourceFrameId, showAllCommandDetails: false} + root = exports ? (window.root ?= {}) root.NormalMode = NormalMode root.NormalModeCommands = NormalModeCommands diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index e5de01a3..0cc9e15f 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -299,8 +299,6 @@ focusThisFrame = (request) -> flashFrame() if request.highlight extend root, - mainFrame: -> focusThisFrame highlight: true, forceFocusThisFrame: true - passNextKey: (count, options) -> if options.registryEntry.options.normal enterNormalMode count @@ -540,9 +538,6 @@ root.goNext = -> nextStrings = nextPatterns.split(",").filter( (s) -> s.trim().length ) findAndFollowRel("next") || findAndFollowLink(nextStrings) -root.showHelp = (sourceFrameId) -> - HelpDialog.toggle {sourceFrameId, showAllCommandDetails: false} - # If we are in the help dialog iframe, then HelpDialog is already defined with the necessary functions. root.HelpDialog ?= helpUI: null -- cgit v1.2.3