aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content_scripts/ui_component.coffee4
-rw-r--r--content_scripts/vimium_frontend.coffee2
-rw-r--r--content_scripts/vomnibar.coffee4
-rw-r--r--pages/help_dialog.coffee2
-rw-r--r--pages/hud.coffee4
-rw-r--r--pages/ui_component_server.coffee7
6 files changed, 7 insertions, 16 deletions
diff --git a/content_scripts/ui_component.coffee b/content_scripts/ui_component.coffee
index 6aa22119..7792bfba 100644
--- a/content_scripts/ui_component.coffee
+++ b/content_scripts/ui_component.coffee
@@ -95,8 +95,7 @@ class UIComponent
else
window.focus()
@options = null
- # Inform the UI component that it is hidden.
- @postMessage "hidden"
+ @postMessage "hidden" # Inform the UI component that it is hidden.
# Fetch a Vimium file/resource (such as "content_scripts/vimium.css").
# We try making an XMLHttpRequest request. That can fail (see #1817), in which case we fetch the
@@ -119,6 +118,5 @@ class UIComponent
request.open "GET", (chrome.runtime.getURL file), true
request.send()
-
root = exports ? window
root.UIComponent = UIComponent
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 56f7742e..986fd322 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -121,7 +121,7 @@ class NormalMode extends KeyHandlerMode
if registryEntry.topFrame
# The Vomnibar (a top-frame command) cannot coexist with the help dialog (it causes focus issues).
- sourceFrameId = if HelpDialog.isShowing() and window.isVimiumUIComponent then 0 else frameId
+ sourceFrameId = if window.isVimiumUIComponent then 0 else frameId
HelpDialog.toggle() if HelpDialog.isShowing()
chrome.runtime.sendMessage
handler: "sendMessageToFrames", message: {name: "runInTopFrame", sourceFrameId, registryEntry}
diff --git a/content_scripts/vomnibar.coffee b/content_scripts/vomnibar.coffee
index 646fda43..02ce97c5 100644
--- a/content_scripts/vomnibar.coffee
+++ b/content_scripts/vomnibar.coffee
@@ -49,9 +49,7 @@ Vomnibar =
init: ->
unless @vomnibarUI?
- @vomnibarUI = new UIComponent "pages/vomnibar.html", "vomnibarFrame", (event) =>
- @vomnibarUI.hide() if event.data == "hide"
-
+ @vomnibarUI = new UIComponent "pages/vomnibar.html", "vomnibarFrame", ->
# This function opens the vomnibar. It accepts options, a map with the values:
# completer - The completer to fetch results from.
diff --git a/pages/help_dialog.coffee b/pages/help_dialog.coffee
index 7fee8bf9..2ea4353c 100644
--- a/pages/help_dialog.coffee
+++ b/pages/help_dialog.coffee
@@ -48,7 +48,7 @@ HelpDialog =
HUD.showForDuration("Yanked #{commandName}.", 2000)
hide: -> UIComponentServer.hide()
- toggle: (html) -> @hide()
+ toggle: -> @hide()
#
# Advanced commands are hidden by default so they don't overwhelm new and casual users.
diff --git a/pages/hud.coffee b/pages/hud.coffee
index e35e587e..fcc7b1dd 100644
--- a/pages/hud.coffee
+++ b/pages/hud.coffee
@@ -92,7 +92,5 @@ handlers =
" (No matches)"
countElement.textContent = if showMatchText then countText else ""
-UIComponentServer.registerHandler ({data}) ->
- handlers[data.name ? data]? data
-
+UIComponentServer.registerHandler ({data}) -> handlers[data.name ? data]? data
FindModeHistory.init()
diff --git a/pages/ui_component_server.coffee b/pages/ui_component_server.coffee
index 9f72dd92..488ff0ed 100644
--- a/pages/ui_component_server.coffee
+++ b/pages/ui_component_server.coffee
@@ -18,11 +18,8 @@ UIComponentServer =
registerHandler: (@handleMessage) ->
- postMessage: (message) ->
- @ownerPagePort?.postMessage message
-
- hide: ->
- @postMessage "hide"
+ postMessage: (message) -> @ownerPagePort?.postMessage message
+ hide: -> @postMessage "hide"
# We require both that the DOM is ready and that the port has been opened before the UI component is ready.
# These events can happen in either order. We count them, and notify the content script when we've seen