diff --git a/src/General/Config.coffee b/src/General/Config.coffee index de19a2481..b455aafdb 100755 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -837,6 +837,18 @@ Config = 'Ctrl+Left' 'Jump to the previous page.' ] + 'Paged mode': [ + 'Alt+1' + 'Open the index in paged mode.' + ] + 'Infinite scrolling mode': [ + 'Alt+2' + 'Open the index in infinite scrolling mode.' + ] + 'All pages mode': [ + 'Alt+3' + 'Open the index in all threads mode.' + ] 'Open catalog': [ 'Shift+c' 'Open the catalog of the current board.' diff --git a/src/General/Index.coffee b/src/General/Index.coffee index a80f71658..5fb7b9fb4 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -57,7 +57,6 @@ Index = $('.cataloglink a', @pagelist).href = CatalogLinks.catalog() @navLinks = $.el 'div', className: 'navLinks' $.extend @navLinks, <%= importHTML('Features/Index-navlinks') %> - $('.returnlink a', @navLinks).href = CatalogLinks.index() $('.cataloglink a', @navLinks).href = CatalogLinks.catalog() $('.archlistlink', @navLinks).hidden = true if g.BOARD.ID is 'b' @searchInput = $ '#index-search', @navLinks @@ -73,7 +72,6 @@ Index = $.on @searchInput, 'input', @onSearchInput $.on $('#index-search-clear', @navLinks), 'click', @clearSearch $.on $('#hidden-toggle a', @navLinks), 'click', @cb.toggleHiddenThreads - $.on $('.returnlink a', @navLinks), 'click', @cb.frontPage unless Conf['Use <%= meta.name %> Catalog'] $.on @selectMode, 'change', @cb.mode for select in [@selectMode, @selectSort, @selectSize] select.value = Conf[select.name] @@ -263,11 +261,6 @@ Index = e.preventDefault() Index.userPageNav +a.pathname.split('/')[2] or 1 - frontPage: (e) -> - return if e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0 - e.preventDefault() - Index.userPageNav 1 - scrollToIndex: -> Header.scrollToIfNeeded Index.navLinks diff --git a/src/General/css/style.css b/src/General/css/style.css index f701d96b4..fed33c815 100755 --- a/src/General/css/style.css +++ b/src/General/css/style.css @@ -545,6 +545,8 @@ div[data-checked="false"] > .suboption-list { :root.infinite-mode .pagelist, :root.all-pages-mode .pagelist, :root.catalog-mode .pagelist, +:root:not(.catalog-mode) .indexlink, +:root.catalog-mode .cataloglink, :root:not(.catalog-mode) #hidden-label, :root:not(.catalog-mode) #index-size { display: none; diff --git a/src/General/html/Features/Index-navlinks.html b/src/General/html/Features/Index-navlinks.html index ae921b516..0a1e6108e 100644 --- a/src/General/html/Features/Index-navlinks.html +++ b/src/General/html/Features/Index-navlinks.html @@ -1,5 +1,5 @@ -Return -Catalog +Index +Catalog Archive Bottom diff --git a/src/Miscellaneous/CatalogLinks.coffee b/src/Miscellaneous/CatalogLinks.coffee index f4d534639..f95b3a684 100755 --- a/src/Miscellaneous/CatalogLinks.coffee +++ b/src/Miscellaneous/CatalogLinks.coffee @@ -8,8 +8,11 @@ CatalogLinks = $.ready -> for link in $$ selector switch link.pathname - when "/#{g.BOARD}/" then link.href = CatalogLinks.index() - when "/#{g.BOARD}/catalog" then link.href = CatalogLinks.catalog() + when "/#{g.BOARD}/" + link.textContent = 'Index' if Conf['JSON Navigation'] + link.href = CatalogLinks.index() + when "/#{g.BOARD}/catalog" + link.href = CatalogLinks.catalog() if g.VIEW is 'catalog' and Conf['JSON Navigation'] and Conf['Use <%= meta.name %> Catalog'] catalogLink = link.parentNode.cloneNode true catalogLink.firstElementChild.textContent = '<%= meta.name %> Catalog' @@ -76,7 +79,7 @@ CatalogLinks = "/#{board}/catalog" index: (board=g.BOARD.ID) -> - if Conf['JSON Navigation'] and Conf['Use <%= meta.name %> Catalog'] + if Conf['JSON Navigation'] if g.BOARD.ID is board and g.VIEW is 'index' then '#index' else "/#{board}/#index" else "/#{board}/" diff --git a/src/Miscellaneous/Keybinds.coffee b/src/Miscellaneous/Keybinds.coffee index 26dcaf314..dd688fa6d 100755 --- a/src/Miscellaneous/Keybinds.coffee +++ b/src/Miscellaneous/Keybinds.coffee @@ -105,12 +105,12 @@ Keybinds = FappeTyme.toggle 'werk' # Board Navigation when Conf['Front page'] - if Conf['JSON Navigation'] and !Conf['Use <%= meta.name %> Catalog'] and g.VIEW is 'index' + if Conf['JSON Navigation'] and g.VIEW is 'index' Index.userPageNav 1 else - window.location = CatalogLinks.index() + window.location = "/#{g.BOARD}/" when Conf['Open front page'] - $.open CatalogLinks.index() + $.open "/#{g.BOARD}/" when Conf['Next page'] return unless g.VIEW is 'index' if Conf['JSON Navigation'] @@ -132,6 +132,15 @@ Keybinds = searchInput = if Conf['JSON Navigation'] then Index.searchInput else $.id('search-box') Header.scrollToIfNeeded searchInput searchInput.focus() + when Conf['Paged mode'] + return unless Conf['JSON Navigation'] + window.location = if g.VIEW is 'index' then '#paged' else "/#{g.BOARD}/#paged" + when Conf['Infinite scrolling mode'] + return unless Conf['JSON Navigation'] + window.location = if g.VIEW is 'index' then '#infinite' else "/#{g.BOARD}/#infinite" + when Conf['All pages mode'] + return unless Conf['JSON Navigation'] + window.location = if g.VIEW is 'index' then '#all-pages' else "/#{g.BOARD}/#all-pages" when Conf['Open catalog'] window.location = CatalogLinks.catalog() when Conf['Cycle sort type']