From 5af268c6028f1b72ec4d8bdb32dbcdaaf59f7c45 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Thu, 11 Jul 2019 06:03:19 -0700 Subject: [PATCH] Make `Normalize URL` work on Tinyboard/vichan. --- src/Miscellaneous/NormalizeURL.coffee | 13 +++++++------ src/site/SW.tinyboard.coffee | 1 - 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Miscellaneous/NormalizeURL.coffee b/src/Miscellaneous/NormalizeURL.coffee index f059ef72a..8af912235 100644 --- a/src/Miscellaneous/NormalizeURL.coffee +++ b/src/Miscellaneous/NormalizeURL.coffee @@ -3,12 +3,13 @@ NormalizeURL = return unless Conf['Normalize URL'] pathname = location.pathname.split /\/+/ - switch g.VIEW - when 'thread' - pathname[2] = 'thread' - pathname = pathname[0...4] - when 'index' - pathname = pathname[0...3] + if g.SITE.software is 'yotsuba' + switch g.VIEW + when 'thread' + pathname[2] = 'thread' + pathname = pathname[0...4] + when 'index' + pathname = pathname[0...3] pathname = pathname.join '/' if location.pathname isnt pathname history.replaceState history.state, '', "#{location.protocol}//#{location.host}#{pathname}#{location.hash}" diff --git a/src/site/SW.tinyboard.coffee b/src/site/SW.tinyboard.coffee index c5be0a1ec..b70b7bf14 100644 --- a/src/site/SW.tinyboard.coffee +++ b/src/site/SW.tinyboard.coffee @@ -3,7 +3,6 @@ SW.tinyboard = mayLackJSON: true disabledFeatures: [ - 'Normalize URL' 'Index Generator' 'Announcement Hiding' 'Resurrect Quotes'