Make Volume in New Tab and Loop in New Tab work on Tinyboard/vichan sites.

This commit is contained in:
ccd0 2019-07-10 17:00:54 -07:00
parent 32ebd6a318
commit 28ba2df7d4
3 changed files with 8 additions and 2 deletions

View File

@ -156,9 +156,9 @@ Main =
PostSuccessful.init() PostSuccessful.init()
return return
if ImageHost.test hostname if g.SITE.isFileURL()
$.asap (-> d.readyState isnt 'loading'), -> $.asap (-> d.readyState isnt 'loading'), ->
if Conf['404 Redirect'] and g.SITE.is404?() if g.SITE.software is 'yotsuba' and Conf['404 Redirect'] and g.SITE.is404?()
Redirect.navigate 'file', { Redirect.navigate 'file', {
boardID: g.BOARD.ID boardID: g.BOARD.ID
filename: pathname[pathname.length - 1] filename: pathname[pathname.length - 1]

View File

@ -132,6 +132,9 @@ SW.tinyboard =
bgColoredEl: -> bgColoredEl: ->
$.el 'div', className: 'post reply' $.el 'div', className: 'post reply'
isFileURL: ->
/\/src\/[^\/]+/.test(location.pathname)
parseNodes: (post, nodes) -> parseNodes: (post, nodes) ->
# Add vichan's span.poster_id around the ID if not already present. # Add vichan's span.poster_id around the ID if not already present.
return if nodes.uniqueID return if nodes.uniqueID

View File

@ -91,6 +91,9 @@ SW.yotsuba =
isAuxiliaryPage: -> isAuxiliaryPage: ->
location.hostname not in ['boards.4chan.org', 'boards.4channel.org'] location.hostname not in ['boards.4chan.org', 'boards.4channel.org']
isFileURL: ->
ImageHost.test(location.hostname)
scriptData: -> scriptData: ->
for script in $$ 'script:not([src])', d.head for script in $$ 'script:not([src])', d.head
return script.textContent if /\bcooldowns *=/.test script.textContent return script.textContent if /\bcooldowns *=/.test script.textContent