Make Normalize URL work on Tinyboard/vichan.
This commit is contained in:
parent
fa7f2cb20b
commit
5af268c602
@ -3,12 +3,13 @@ NormalizeURL =
|
|||||||
return unless Conf['Normalize URL']
|
return unless Conf['Normalize URL']
|
||||||
|
|
||||||
pathname = location.pathname.split /\/+/
|
pathname = location.pathname.split /\/+/
|
||||||
switch g.VIEW
|
if g.SITE.software is 'yotsuba'
|
||||||
when 'thread'
|
switch g.VIEW
|
||||||
pathname[2] = 'thread'
|
when 'thread'
|
||||||
pathname = pathname[0...4]
|
pathname[2] = 'thread'
|
||||||
when 'index'
|
pathname = pathname[0...4]
|
||||||
pathname = pathname[0...3]
|
when 'index'
|
||||||
|
pathname = pathname[0...3]
|
||||||
pathname = pathname.join '/'
|
pathname = pathname.join '/'
|
||||||
if location.pathname isnt pathname
|
if location.pathname isnt pathname
|
||||||
history.replaceState history.state, '', "#{location.protocol}//#{location.host}#{pathname}#{location.hash}"
|
history.replaceState history.state, '', "#{location.protocol}//#{location.host}#{pathname}#{location.hash}"
|
||||||
|
|||||||
@ -3,7 +3,6 @@ SW.tinyboard =
|
|||||||
mayLackJSON: true
|
mayLackJSON: true
|
||||||
|
|
||||||
disabledFeatures: [
|
disabledFeatures: [
|
||||||
'Normalize URL'
|
|
||||||
'Index Generator'
|
'Index Generator'
|
||||||
'Announcement Hiding'
|
'Announcement Hiding'
|
||||||
'Resurrect Quotes'
|
'Resurrect Quotes'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user