aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/vimium_frontend.coffee
diff options
context:
space:
mode:
authormrmr19932015-06-03 04:37:45 +0100
committermrmr19932015-06-10 17:26:53 +0100
commitffee870176040a77e5bd541a18d1cde002cc23fa (patch)
treed135d5e17a8c8677409b70a77b71fde69d16445a /content_scripts/vimium_frontend.coffee
parent32457e8dbe9ed54808738e986694c19c67c3bdd1 (diff)
downloadvimium-ffee870176040a77e5bd541a18d1cde002cc23fa.tar.bz2
Move FindMode from vimium_frontend to mode_find
Diffstat (limited to 'content_scripts/vimium_frontend.coffee')
-rw-r--r--content_scripts/vimium_frontend.coffee43
1 files changed, 0 insertions, 43 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 820645bc..b6ca06a2 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -686,38 +686,6 @@ window.handleEnterForFindMode = ->
document.body.classList.add("vimiumFindMode")
FindModeHistory.saveQuery findModeQuery.rawQuery
-class FindMode extends Mode
- constructor: (@options = {}) ->
- # Save the selection, so findInPlace can restore it.
- @initialRange = getCurrentRange()
- window.findModeQuery = rawQuery: ""
- if @options.returnToViewport
- @scrollX = window.scrollX
- @scrollY = window.scrollY
- super
- name: "find"
- indicator: false
- exitOnClick: true
-
- HUD.showFindMode()
-
- exit: (event) ->
- super()
- handleEscapeForFindMode() if event
-
- restoreSelection: ->
- range = @initialRange
- selection = getSelection()
- selection.removeAllRanges()
- selection.addRange range
-
- findInPlace: ->
- # Restore the selection. That way, we're always searching forward from the same place, so we find the right
- # match as the user adds matching characters, or removes previously-matched characters. See #1434.
- @restoreSelection()
- query = if findModeQuery.isRegex then getNextQueryFromRegexMatches(0) else findModeQuery.parsedQuery
- window.findModeQueryHasResults = executeFind(query, { caseSensitive: !findModeQuery.ignoreCase })
-
# :options is an optional dict. valid parameters are 'caseSensitive' and 'backwards'.
window.executeFind = (query, options) ->
result = null
@@ -897,17 +865,6 @@ window.goNext = ->
nextStrings = nextPatterns.split(",").filter( (s) -> s.trim().length )
findAndFollowRel("next") || findAndFollowLink(nextStrings)
-getCurrentRange = ->
- selection = getSelection()
- if selection.type == "None"
- range = document.createRange()
- range.setStart document.body, 0
- range.setEnd document.body, 0
- range
- else
- selection.collapseToStart() if selection.type == "Range"
- selection.getRangeAt 0
-
# Enters find mode. Returns the new find-mode instance.
window.enterFindMode = ->
Marks.setPreviousPosition()