From 609683bbae2f3a4aa0b7704fde2b7cba5a3083d8 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 12 Mar 2016 12:30:27 -0800 Subject: [PATCH] Support #infinite-scrolling and #all-threads as index hash commands to match labels in UI. --- src/General/Index.coffee | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/General/Index.coffee b/src/General/Index.coffee index cbc2e8f49..0d62451b2 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -281,6 +281,15 @@ Index = else Index.pageLoad() + hashCommands: + mode: + 'paged': 'paged' + 'infinite-scrolling': 'infinite' + 'infinite': 'infinite' + 'all-threads': 'all pages' + 'all-pages': 'all pages' + 'catalog': 'catalog' + processHash: -> # XXX https://bugzilla.mozilla.org/show_bug.cgi?id=483304 hash = location.href.match(/#.*/)?[0] or '' @@ -288,8 +297,8 @@ Index = replace: true commands = hash[1..].split '/' for command, i in commands - if command in ['paged', 'infinite', 'all-pages', 'catalog'] - state.mode = command.replace /-/g, ' ' + if (mode = Index.hashCommands.mode[command]) + state.mode = mode else if command is 'index' state.mode = Conf['Previous Index Mode'] state.page = 1