diff options
| author | mrmr1993 | 2014-12-28 19:53:06 +0000 |
|---|---|---|
| committer | mrmr1993 | 2014-12-28 19:53:06 +0000 |
| commit | d20caa49075c0605ec2196416a5633d5e205b615 (patch) | |
| tree | 3f08988b3ede7988b922aacbeeb4c3feaba08fea /content_scripts | |
| parent | 697b065f9adff48ad270d8ea85e90faa63190179 (diff) | |
| download | vimium-d20caa49075c0605ec2196416a5633d5e205b615.tar.bz2 | |
Add an example test for UIComponent
Diffstat (limited to 'content_scripts')
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 1f116f88..245e481a 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -181,6 +181,8 @@ window.addEventListener "focus", -> initializeOnDomReady = -> enterInsertModeIfElementIsFocused() if isEnabledForUrl + testUIComponentSetup() + # Tell the background page we're in the dom ready state. chrome.runtime.connect({ name: "domReady" }) @@ -920,6 +922,10 @@ 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" @@ -966,6 +972,9 @@ window.showHelpDialog = (html, fid) -> hideHelpDialog = (clickEvent) -> + + testUIComponent.hide() + isShowingHelpDialog = false helpDialog = document.getElementById("vimiumHelpDialogContainer") if (helpDialog) @@ -1086,6 +1095,12 @@ Tween = value = (elapsed / state.duration) * (state.to - state.from) + state.from state.onUpdate(value) +testUIComponent = null +testUIComponentSetup = -> + testUIComponent = new UIComponent "pages/test_ui_component.html", "testUIComponent" + testUIComponent.setHideStyle "display: none;" + testUIComponent.setShowStyle "display: block;" + initializePreDomReady() window.addEventListener("DOMContentLoaded", registerFrame) window.addEventListener("unload", unregisterFrame) |
