aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJez Ng2012-08-04 13:16:14 -0700
committerJez Ng2012-08-04 13:18:26 -0700
commit6043f25b8dcbba3a522df4ddf59e1070fdc134e5 (patch)
treed4ed7657f74150e0295577a13e8c7ad512024bb3
parentee8ec26a6b4f3996bd94903b435ecafd30648c2d (diff)
downloadvimium-6043f25b8dcbba3a522df4ddf59e1070fdc134e5.tar.bz2
linkHintCss should be accessed via settings. Closes #605.
-rw-r--r--background_scripts/main.js8
-rw-r--r--content_scripts/link_hints.coffee2
-rw-r--r--content_scripts/vimium_frontend.coffee7
3 files changed, 2 insertions, 15 deletions
diff --git a/background_scripts/main.js b/background_scripts/main.js
index 49790b87..4dc11181 100644
--- a/background_scripts/main.js
+++ b/background_scripts/main.js
@@ -24,7 +24,6 @@ var portHandlers = {
var sendRequestHandlers = {
getCompletionKeys: getCompletionKeysRequest,
- getLinkHintCss: getLinkHintCss,
openUrlInNewTab: openUrlInNewTab,
openUrlInCurrentTab: openUrlInCurrentTab,
openOptionsPageInNewTab: openOptionsPageInNewTab,
@@ -239,13 +238,6 @@ function openCopiedUrlInCurrentTab(request) { openUrlInCurrentTab({ url: Clipboa
function openCopiedUrlInNewTab(request) { openUrlInNewTab({ url: Clipboard.paste() }); }
/*
- * Returns the user-provided CSS overrides.
- */
-function getLinkHintCss(request) {
- return { linkHintCss: (Settings.get("userDefinedLinkHintCss") || "") };
-}
-
-/*
* Called when the user has clicked the close icon on the "Vimium has been updated" message.
* We should now dismiss that message in all tabs.
*/
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee
index d2db5b12..8d5227d5 100644
--- a/content_scripts/link_hints.coffee
+++ b/content_scripts/link_hints.coffee
@@ -53,7 +53,7 @@ LinkHints =
if (!document.getElementById("vimiumLinkHintCss"))
# linkHintCss is declared by vimiumFrontend.js and contains the user supplied css overrides.
- addCssToPage(linkHintCss, "vimiumLinkHintCss")
+ addCssToPage(settings.get("userDefinedLinkHintCss"), "vimiumLinkHintCss")
@setOpenLinkMode(openInNewTab, withQueue, copyLinkUrl)
@buildLinkHints()
# handlerStack is declared by vimiumFrontend.js
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 77c9e296..21c366e9 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -19,7 +19,6 @@ isEnabledForUrl = true
# The user's operating system.
currentCompletionKeys = null
validFirstKeys = null
-linkHintCss = null
activatedElement = null
# The types in <input type="..."> that we consider for focusInput command. Right now this is recalculated in
@@ -46,7 +45,7 @@ settings =
values: {}
loadedValues: 0
valuesToLoad: ["scrollStepSize", "linkHintCharacters", "filterLinkHints", "hideHud", "previousPatterns",
- "nextPatterns", "findModeRawQuery"]
+ "nextPatterns", "findModeRawQuery", "userDefinedLinkHintCss"]
isLoaded: false
eventListeners: {}
@@ -100,9 +99,6 @@ initializePreDomReady = ->
checkIfEnabledForUrl()
- chrome.extension.sendRequest { handler: "getLinkHintCss" }, (response) ->
- linkHintCss = response.linkHintCss
-
refreshCompletionKeys()
# Send the key to the key handler in the background page.
@@ -1030,7 +1026,6 @@ window.onbeforeunload = ->
root = exports ? window
root.window = window
root.settings = settings
-root.linkHintCss = linkHintCss
root.addCssToPage = addCssToPage
root.HUD = HUD
root.handlerStack = handlerStack