diff options
| author | Stephen Blott | 2014-12-29 08:12:59 +0000 | 
|---|---|---|
| committer | mrmr1993 | 2014-12-29 09:11:41 +0000 | 
| commit | 71af7f016f51e3c8b9c1fcfba46cb8289c91e030 (patch) | |
| tree | b9f6d8eedd9564fc6b6f09c3ca0acc4a600c8c09 | |
| parent | d20caa49075c0605ec2196416a5633d5e205b615 (diff) | |
| download | vimium-71af7f016f51e3c8b9c1fcfba46cb8289c91e030.tar.bz2 | |
IFrame framework; develop demo.
| -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?"  | 
