diff --git a/src/General/Config.coffee b/src/General/Config.coffee index d04114ec1..217bab12b 100644 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -188,6 +188,9 @@ Config = 'Next page': ['Right', 'Jump to the next page.'] 'Previous page': ['Left', 'Jump to the previous page.'] 'Search form': ['Ctrl+Alt+s', 'Focus the search field on the board index.'] + 'Paged mode': ['Ctrl+p', 'Sets the index mode to paged.'] + 'Catalog mode': ['Ctrl+c', 'Sets the index mode to catalog.'] + 'All pages mode': ['Ctrl+a', 'Sets the index mode to all threads.'] 'Cycle sort type': ['Ctrl+x', 'Cycle through index sort types.'] # Thread Navigation 'Next thread': ['Down', 'See next thread.'] diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 2e9150881..a1b101f02 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -186,6 +186,10 @@ Index = val: isPinned: thread.isPinned Index.sort() Index.buildIndex() + setIndexMode: (mode) -> + [opt] = [Index.selectMode.options...].filter (option) -> option.value is mode + opt.selected = true + $.event 'change', null, Index.selectMode cycleSortType: -> types = [Index.selectSort.options...].filter (option) -> !option.disabled for type, i in types diff --git a/src/Miscellaneous/Keybinds.coffee b/src/Miscellaneous/Keybinds.coffee index 433ca353d..74d112efa 100644 --- a/src/Miscellaneous/Keybinds.coffee +++ b/src/Miscellaneous/Keybinds.coffee @@ -88,6 +88,15 @@ Keybinds = $('.prev button', Index.pagelist).click() when Conf['Search form'] Index.searchInput.focus() + when Conf['Paged mode'] + return unless g.VIEW is 'index' and Conf['Index Mode'] isnt 'paged' + Index.setIndexMode('paged') + when Conf['Catalog mode'] + return unless g.VIEW is 'index' and Conf['Index Mode'] isnt 'catalog' + Index.setIndexMode('catalog') + when Conf['All pages mode'] + return unless g.VIEW is 'index' and Conf['Index Mode'] isnt 'all pages' + Index.setIndexMode('all pages') when Conf['Cycle sort type'] Index.cycleSortType() # Thread Navigation