Attempt to fix navigation keybind issue in Violentmonkey. #1656
This commit is contained in:
parent
efaea04478
commit
fd191f95c5
@ -130,7 +130,7 @@ Keybinds =
|
|||||||
if Conf['JSON Index'] and g.VIEW is 'index' and g.BOARD.ID isnt 'f'
|
if Conf['JSON Index'] and g.VIEW is 'index' and g.BOARD.ID isnt 'f'
|
||||||
Index.userPageNav 1
|
Index.userPageNav 1
|
||||||
else
|
else
|
||||||
window.location = "/#{g.BOARD}/"
|
location.href = "/#{g.BOARD}/"
|
||||||
when Conf['Open front page']
|
when Conf['Open front page']
|
||||||
$.open "#{location.origin}/#{g.BOARD}/"
|
$.open "#{location.origin}/#{g.BOARD}/"
|
||||||
when Conf['Next page']
|
when Conf['Next page']
|
||||||
@ -140,7 +140,7 @@ Keybinds =
|
|||||||
$('.next button', Index.pagelist).click()
|
$('.next button', Index.pagelist).click()
|
||||||
else
|
else
|
||||||
if form = $ '.next form'
|
if form = $ '.next form'
|
||||||
window.location = form.action
|
location.href = form.action
|
||||||
when Conf['Previous page']
|
when Conf['Previous page']
|
||||||
return unless g.VIEW is 'index' and g.BOARD.ID isnt 'f'
|
return unless g.VIEW is 'index' and g.BOARD.ID isnt 'f'
|
||||||
if Conf['JSON Index']
|
if Conf['JSON Index']
|
||||||
@ -148,7 +148,7 @@ Keybinds =
|
|||||||
$('.prev button', Index.pagelist).click()
|
$('.prev button', Index.pagelist).click()
|
||||||
else
|
else
|
||||||
if form = $ '.prev form'
|
if form = $ '.prev form'
|
||||||
window.location = form.action
|
location.href = form.action
|
||||||
when Conf['Search form']
|
when Conf['Search form']
|
||||||
return unless g.VIEW is 'index' and g.BOARD.ID isnt 'f'
|
return unless g.VIEW is 'index' and g.BOARD.ID isnt 'f'
|
||||||
searchInput = if Conf['JSON Index'] then Index.searchInput else $.id('search-box')
|
searchInput = if Conf['JSON Index'] then Index.searchInput else $.id('search-box')
|
||||||
@ -156,16 +156,16 @@ Keybinds =
|
|||||||
searchInput.focus()
|
searchInput.focus()
|
||||||
when Conf['Paged mode']
|
when Conf['Paged mode']
|
||||||
return unless Conf['JSON Index'] and g.BOARD.ID isnt 'f'
|
return unless Conf['JSON Index'] and g.BOARD.ID isnt 'f'
|
||||||
window.location = if g.VIEW is 'index' then '#paged' else "/#{g.BOARD}/#paged"
|
location.href = if g.VIEW is 'index' then '#paged' else "/#{g.BOARD}/#paged"
|
||||||
when Conf['Infinite scrolling mode']
|
when Conf['Infinite scrolling mode']
|
||||||
return unless Conf['JSON Index'] and g.BOARD.ID isnt 'f'
|
return unless Conf['JSON Index'] and g.BOARD.ID isnt 'f'
|
||||||
window.location = if g.VIEW is 'index' then '#infinite' else "/#{g.BOARD}/#infinite"
|
location.href = if g.VIEW is 'index' then '#infinite' else "/#{g.BOARD}/#infinite"
|
||||||
when Conf['All pages mode']
|
when Conf['All pages mode']
|
||||||
return unless Conf['JSON Index'] and g.BOARD.ID isnt 'f'
|
return unless Conf['JSON Index'] and g.BOARD.ID isnt 'f'
|
||||||
window.location = if g.VIEW is 'index' then '#all-pages' else "/#{g.BOARD}/#all-pages"
|
location.href = if g.VIEW is 'index' then '#all-pages' else "/#{g.BOARD}/#all-pages"
|
||||||
when Conf['Open catalog']
|
when Conf['Open catalog']
|
||||||
return if g.BOARD.ID is 'f'
|
return if g.BOARD.ID is 'f'
|
||||||
window.location = CatalogLinks.catalog()
|
location.href = CatalogLinks.catalog()
|
||||||
when Conf['Cycle sort type']
|
when Conf['Cycle sort type']
|
||||||
return unless Conf['JSON Index'] and g.VIEW is 'index' and g.BOARD.ID isnt 'f'
|
return unless Conf['JSON Index'] and g.VIEW is 'index' and g.BOARD.ID isnt 'f'
|
||||||
Index.cycleSortType()
|
Index.cycleSortType()
|
||||||
|
|||||||
@ -852,7 +852,7 @@ QR =
|
|||||||
open = if Conf['Open Post in New Tab'] or postsCount
|
open = if Conf['Open Post in New Tab'] or postsCount
|
||||||
-> $.open URL
|
-> $.open URL
|
||||||
else
|
else
|
||||||
-> window.location = URL
|
-> location.href = URL
|
||||||
|
|
||||||
if threadID is postID
|
if threadID is postID
|
||||||
# XXX 4chan sometimes responds before the thread exists.
|
# XXX 4chan sometimes responds before the thread exists.
|
||||||
|
|||||||
@ -115,7 +115,7 @@ QuoteYou =
|
|||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
QuoteYou.lastRead = root
|
QuoteYou.lastRead = root
|
||||||
window.location = "##{post.id}"
|
location.href = "##{post.id}"
|
||||||
Header.scrollTo post
|
Header.scrollTo post
|
||||||
$.addClass post, 'highlight'
|
$.addClass post, 'highlight'
|
||||||
return true
|
return true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user