diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f9c77613..69308c0cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ Index navigation improvements: - You can now refresh the index page you are on with the same keybind for refreshing threads. + - You can now switch between single-page and all-pages navigation via the "Index Navigation" header sub-menu. Added a keybind to open the catalog search field on index pages. ### 3.11.5 - *2013-10-03* diff --git a/src/General/Build.coffee b/src/General/Build.coffee index fb3843804..b62418e13 100644 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -238,7 +238,7 @@ Build = else "/#{boardID}/res/#{threadID}#q#{postID}" }' title='Quote this post'>#{postID}" + - replyLink + + replyLink + '' + '' + diff --git a/src/General/Config.coffee b/src/General/Config.coffee index 4f422357e..dd3220383 100644 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -139,6 +139,7 @@ Config = #//archive.foolz.us/%board/search/image/%MD5/;text:View same on foolz /%board/ #//archive.installgentoo.net/%board/image/%MD5;text:View same on installgentoo /%board/ """ + 'Index Mode': 'paged' 'Custom CSS': false Header: 'Header auto-hide': false diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 604393db8..a504f76ef 100644 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -208,7 +208,7 @@ Main = try localStorage.getItem '4chan-settings' catch err - new Notice 'warning', 'Cookies need to be enabled on 4chan for <%= meta.name %> to properly function.', 30 + new Notice 'warning', 'Cookies need to be enabled on 4chan for <%= meta.name %> to operate properly.', 30 Main.disableReports = true $.event '4chanXInitFinished' diff --git a/src/Miscellaneous/Index.coffee b/src/Miscellaneous/Index.coffee index a277d76fd..dd49f4f37 100644 --- a/src/Miscellaneous/Index.coffee +++ b/src/Miscellaneous/Index.coffee @@ -2,6 +2,33 @@ Index = init: -> return if g.VIEW isnt 'index' + label = $.el 'label', + innerHTML: """ + + """ + select = label.firstChild + select.value = Conf['Index Mode'] + $.on select, 'change', $.cb.value + $.on select, 'change', @update + + $.event 'AddMenuEntry', + type: 'header' + el: $.el 'span', + textContent: 'Index Navigation' + order: 90 + subEntries: [el: label] + + $.on d, '4chanXInitFinished', @initReady + + initReady: -> + $.off d, '4chanXInitFinished', Index.initReady + return if Conf['Index Mode'] is 'paged' + Index.update() + update: -> return unless navigator.onLine Index.req?.abort() @@ -38,8 +65,13 @@ Index = Header.scrollTo $.id 'delform' parse: (pages) -> - pageNum = +window.location.pathname.split('/')[2] - dataThr = pages[pageNum].threads + if Conf['Index Mode'] is 'paged' + pageNum = +window.location.pathname.split('/')[2] + dataThr = pages[pageNum].threads + else + dataThr = [] + for page in pages + dataThr.push page.threads... nodes = [] threads = []