diff options
| -rw-r--r-- | background_scripts/commands.coffee | 3 | ||||
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 10 | ||||
| -rw-r--r-- | pages/test_ui_component.coffee | 5 |
3 files changed, 12 insertions, 6 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index 585ef572..63b870cc 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -91,6 +91,7 @@ Commands = commandGroups: pageNavigation: ["scrollDown", + "activateTestUIComponent", "scrollUp", "scrollLeft", "scrollRight", @@ -252,6 +253,7 @@ defaultKeyMappings = "m": "Marks.activateCreateMode" "`": "Marks.activateGotoMode" + "D": "activateTestUIComponent" # This is a mapping of: commandIdentifier => [description, options]. @@ -263,6 +265,7 @@ commandDescriptions = scrollUp: ["Scroll up"] scrollLeft: ["Scroll left"] scrollRight: ["Scroll right"] + activateTestUIComponent: ["UI component test"] scrollToTop: ["Scroll to the top of the page", { noRepeat: true }] scrollToBottom: ["Scroll to the bottom of the page", { noRepeat: true }] diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 245e481a..5c166ff0 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -923,9 +923,6 @@ exitFindMode = -> window.showHelpDialog = (html, fid) -> return if (isShowingHelpDialog || !document.body || fid != frameId) - testUIComponent.show() - testUIComponent.postMessage "version: #{chrome.runtime.getManifest().version}; random number: #{Math.random()}" - isShowingHelpDialog = true container = document.createElement("div") container.id = "vimiumHelpDialogContainer" @@ -972,9 +969,6 @@ window.showHelpDialog = (html, fid) -> hideHelpDialog = (clickEvent) -> - - testUIComponent.hide() - isShowingHelpDialog = false helpDialog = document.getElementById("vimiumHelpDialogContainer") if (helpDialog) @@ -1101,6 +1095,10 @@ testUIComponentSetup = -> testUIComponent.setHideStyle "display: none;" testUIComponent.setShowStyle "display: block;" +window.activateTestUIComponent = -> + testUIComponent.show() + testUIComponent.postMessage "version: #{chrome.runtime.getManifest().version}; random number: #{Math.random()}" + initializePreDomReady() window.addEventListener("DOMContentLoaded", registerFrame) window.addEventListener("unload", unregisterFrame) diff --git a/pages/test_ui_component.coffee b/pages/test_ui_component.coffee index b1d3625a..0156c8f2 100644 --- a/pages/test_ui_component.coffee +++ b/pages/test_ui_component.coffee @@ -1,2 +1,7 @@ UIComponentServer.addEventListener "message", (event) -> document.body.innerHTML = event.data + +document.addEventListener "DOMContentLoaded", -> + document.addEventListener "keydown", (event) -> + # Close on any key. + console.log "How do I close myself?" |
