Disable some inapplicable keybinds on /f/.

This commit is contained in:
ccd0 2015-03-14 21:08:04 -07:00
parent f2055bbace
commit 5298cbc378

View File

@ -21,7 +21,11 @@ Keybinds =
{target} = e {target} = e
if target.nodeName in ['INPUT', 'TEXTAREA'] if target.nodeName in ['INPUT', 'TEXTAREA']
return unless /(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test key return unless /(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test key
unless g.VIEW not in ['index', 'thread'] or g.VIEW is 'index' and Conf['JSON Navigation'] and Conf['Index Mode'] is 'catalog' unless (
g.VIEW not in ['index', 'thread'] or
g.VIEW is 'index' and Conf['JSON Navigation'] and Conf['Index Mode'] is 'catalog' or
g.VIEW is 'index' and g.BOARD.ID is 'f'
)
threadRoot = Nav.getThread() threadRoot = Nav.getThread()
if op = $ '.op', threadRoot if op = $ '.op', threadRoot
thread = Get.postFromNode(op).thread thread = Get.postFromNode(op).thread
@ -133,18 +137,19 @@ Keybinds =
Header.scrollToIfNeeded searchInput Header.scrollToIfNeeded searchInput
searchInput.focus() searchInput.focus()
when Conf['Paged mode'] when Conf['Paged mode']
return unless Conf['JSON Navigation'] return unless Conf['JSON Navigation'] and g.BOARD.ID isnt 'f'
window.location = if g.VIEW is 'index' then '#paged' else "/#{g.BOARD}/#paged" window.location = 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 Navigation'] return unless Conf['JSON Navigation'] and g.BOARD.ID isnt 'f'
window.location = if g.VIEW is 'index' then '#infinite' else "/#{g.BOARD}/#infinite" window.location = 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 Navigation'] return unless Conf['JSON Navigation'] and g.BOARD.ID isnt 'f'
window.location = if g.VIEW is 'index' then '#all-pages' else "/#{g.BOARD}/#all-pages" window.location = 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'
window.location = CatalogLinks.catalog() window.location = CatalogLinks.catalog()
when Conf['Cycle sort type'] when Conf['Cycle sort type']
return unless Conf['JSON Navigation'] and g.VIEW is 'index' and g.BOARD isnt 'f' return unless Conf['JSON Navigation'] and g.VIEW is 'index' and g.BOARD.ID isnt 'f'
Index.cycleSortType() Index.cycleSortType()
# Thread Navigation # Thread Navigation
when Conf['Next thread'] when Conf['Next thread']