aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/hud.coffee2
-rw-r--r--content_scripts/link_hints.coffee10
-rw-r--r--content_scripts/scroller.coffee4
-rw-r--r--content_scripts/vimium_frontend.coffee20
-rw-r--r--content_scripts/vomnibar.coffee2
5 files changed, 18 insertions, 20 deletions
diff --git a/content_scripts/hud.coffee b/content_scripts/hud.coffee
index f38d6b45..84b8abeb 100644
--- a/content_scripts/hud.coffee
+++ b/content_scripts/hud.coffee
@@ -48,7 +48,7 @@ HUD =
-> ready and document.body != null
# A preference which can be toggled in the Options page. */
- enabled: -> !settings.get("hideHud")
+ enabled: -> !Settings.get("hideHud")
class Tween
opacity: 0
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee
index 3cebac4c..daf738a3 100644
--- a/content_scripts/link_hints.coffee
+++ b/content_scripts/link_hints.coffee
@@ -29,7 +29,7 @@ LinkHints =
# Handle the link hinting marker generation and matching. Must be initialized after settings have been
# loaded, so that we can retrieve the option setting.
getMarkerMatcher: ->
- if settings.get("filterLinkHints") then filterHints else alphabetHints
+ if Settings.get("filterLinkHints") then filterHints else alphabetHints
# lock to ensure only one instance runs at a time
isActive: false
# Call this function on exit (if defined).
@@ -60,7 +60,7 @@ LinkHints =
# For these modes, we filter out those elements which don't have an HREF (since there's nothing we can do
# with them).
elements = (el for el in elements when el.element.href?) if mode in [ COPY_LINK_URL, OPEN_INCOGNITO ]
- if settings.get "filterLinkHints"
+ if Settings.get "filterLinkHints"
# When using text filtering, we sort the elements such that we visit descendants before their ancestors.
# This allows us to exclude the text used for matching descendants from that used for matching their
# ancestors.
@@ -389,7 +389,7 @@ alphabetHints =
# may be of different lengths.
#
hintStrings: (linkCount) ->
- linkHintCharacters = settings.get("linkHintCharacters")
+ linkHintCharacters = Settings.get("linkHintCharacters")
# Determine how many digits the link hints will require in the worst case. Usually we do not need
# all of these digits for every link single hint, so we can show shorter hints for a few of the links.
digitsNeeded = Math.ceil(@logXOfBase(linkCount, linkHintCharacters.length))
@@ -460,7 +460,7 @@ filterHints =
@labelMap[forElement] = labelText
generateHintString: (linkHintNumber) ->
- (numberToHintString linkHintNumber + 1, settings.get "linkHintNumbers").toUpperCase()
+ (numberToHintString linkHintNumber + 1, Settings.get "linkHintNumbers").toUpperCase()
generateLinkText: (element) ->
linkText = ""
@@ -519,7 +519,7 @@ filterHints =
if (!@hintKeystrokeQueue.pop() && !@linkTextKeystrokeQueue.pop())
return { linksMatched: [] }
else if (keyChar)
- if (settings.get("linkHintNumbers").indexOf(keyChar) >= 0)
+ if (Settings.get("linkHintNumbers").indexOf(keyChar) >= 0)
@hintKeystrokeQueue.push(keyChar)
else
# since we might renumber the hints, the current hintKeyStrokeQueue
diff --git a/content_scripts/scroller.coffee b/content_scripts/scroller.coffee
index 27fc9cdc..29142064 100644
--- a/content_scripts/scroller.coffee
+++ b/content_scripts/scroller.coffee
@@ -139,7 +139,7 @@ CoreScroller =
@time += 1
# Return true if CoreScroller would not initiate a new scroll right now.
- wouldNotInitiateScroll: -> @lastEvent?.repeat and @settings.get "smoothScroll"
+ wouldNotInitiateScroll: -> @lastEvent?.repeat and Settings.get "smoothScroll"
# Calibration fudge factors for continuous scrolling. The calibration value starts at 1.0. We then
# increase it (until it exceeds @maxCalibration) if we guess that the scroll is too slow, or decrease it
@@ -153,7 +153,7 @@ CoreScroller =
scroll: (element, direction, amount, continuous = true) ->
return unless amount
- unless @settings.get "smoothScroll"
+ unless Settings.get "smoothScroll"
# Jump scrolling.
performScroll element, direction, amount
checkVisibility element
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index c603e15f..23b725e4 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -68,8 +68,6 @@ settings =
@port = true
Settings.init()
- get: Settings.get.bind Settings
-
set: (key, value) ->
@init() unless @port
Settings.set key, value
@@ -101,7 +99,7 @@ class GrabBackFocus extends Mode
mousedown: => @alwaysContinueBubbling => @exit()
activate = =>
- return @exit() unless settings.get "grabBackFocus"
+ return @exit() unless Settings.get "grabBackFocus"
@push
_name: "grab-back-focus-focus"
focus: (event) => @grabBackFocus event.target
@@ -345,14 +343,14 @@ extend window,
scrollToTop: -> Scroller.scrollTo "y", 0
scrollToLeft: -> Scroller.scrollTo "x", 0
scrollToRight: -> Scroller.scrollTo "x", "max"
- scrollUp: -> Scroller.scrollBy "y", -1 * settings.get("scrollStepSize")
- scrollDown: -> Scroller.scrollBy "y", settings.get("scrollStepSize")
+ scrollUp: -> Scroller.scrollBy "y", -1 * Settings.get("scrollStepSize")
+ scrollDown: -> Scroller.scrollBy "y", Settings.get("scrollStepSize")
scrollPageUp: -> Scroller.scrollBy "y", "viewSize", -1/2
scrollPageDown: -> Scroller.scrollBy "y", "viewSize", 1/2
scrollFullPageUp: -> Scroller.scrollBy "y", "viewSize", -1
scrollFullPageDown: -> Scroller.scrollBy "y", "viewSize"
- scrollLeft: -> Scroller.scrollBy "x", -1 * settings.get("scrollStepSize")
- scrollRight: -> Scroller.scrollBy "x", settings.get("scrollStepSize")
+ scrollLeft: -> Scroller.scrollBy "x", -1 * Settings.get("scrollStepSize")
+ scrollRight: -> Scroller.scrollBy "x", Settings.get("scrollStepSize")
extend window,
reload: -> window.location.reload()
@@ -698,7 +696,7 @@ updateFindModeQuery = ->
# the query can be treated differently (e.g. as a plain string versus regex depending on the presence of
# escape sequences. '\' is the escape character and needs to be escaped itself to be used as a normal
# character. here we grep for the relevant escape sequences.
- findModeQuery.isRegex = settings.get 'regexFindMode'
+ findModeQuery.isRegex = Settings.get 'regexFindMode'
hasNoIgnoreCaseFlag = false
findModeQuery.parsedQuery = findModeQuery.rawQuery.replace /(\\{1,2})([rRI]?)/g, (match, slashes, flag) ->
return match if flag == "" or slashes.length != 1
@@ -1010,12 +1008,12 @@ findAndFollowRel = (value) ->
return true
window.goPrevious = ->
- previousPatterns = settings.get("previousPatterns") || ""
+ previousPatterns = Settings.get("previousPatterns") || ""
previousStrings = previousPatterns.split(",").filter( (s) -> s.trim().length )
findAndFollowRel("prev") || findAndFollowLink(previousStrings)
window.goNext = ->
- nextPatterns = settings.get("nextPatterns") || ""
+ nextPatterns = Settings.get("nextPatterns") || ""
nextStrings = nextPatterns.split(",").filter( (s) -> s.trim().length )
findAndFollowRel("next") || findAndFollowLink(nextStrings)
@@ -1070,7 +1068,7 @@ window.showHelpDialog = (html, fid) ->
VimiumHelpDialog =
# This setting is pulled out of local storage. It's false by default.
- getShowAdvancedCommands: -> settings.get("helpDialog_showAdvancedCommands")
+ getShowAdvancedCommands: -> Settings.get("helpDialog_showAdvancedCommands")
init: () ->
this.dialogElement = document.getElementById("vimiumHelpDialog")
diff --git a/content_scripts/vomnibar.coffee b/content_scripts/vomnibar.coffee
index 4bd8e8fd..6c08ce92 100644
--- a/content_scripts/vomnibar.coffee
+++ b/content_scripts/vomnibar.coffee
@@ -8,7 +8,7 @@ Vomnibar =
# the form "keyword=X", for direct activation of a custom search engine.
parseRegistryEntry: (registryEntry = { options: [] }, callback = null) ->
options = {}
- searchEngines = settings.get("searchEngines") ? ""
+ searchEngines = Settings.get("searchEngines") ? ""
SearchEngines.refreshAndUse searchEngines, (engines) ->
for option in registryEntry.options
[ key, value ] = option.split "="