Fix scroll wheel volume adjustment on /r/ and /wsr/. Also read list of boards allowing audio from 4chan's boards.json.

This commit is contained in:
ccd0 2017-12-28 02:29:22 -08:00
parent 1641aeacfd
commit fdfbc10cb2
3 changed files with 7 additions and 3 deletions

View File

@ -41,3 +41,7 @@ BoardConfig =
sfwBoards: (sfw) ->
board for board, data of (@boards or Conf['boardConfig'].boards) when !!data.ws_board is sfw
noAudio: (boardID) ->
boards = @boards or Conf['boardConfig'].boards
boards and !boards[boardID].webm_audio

View File

@ -16,7 +16,7 @@ Volume =
name: 'Mouse Wheel Volume'
cb: @node
return unless g.BOARD.ID in ['gif', 'wsg', 'r', 'wsr']
return if BoardConfig.noAudio(g.BOARD.ID)
if Conf['Mouse Wheel Volume']
Callbacks.CatalogThread.push
@ -60,7 +60,7 @@ Volume =
Volume.inputs.volume.value = volume
node: ->
return unless @board.ID in ['gif', 'wsg'] and @file?.isVideo
return unless !BoardConfig.noAudio(@board.ID) and @file?.isVideo
$.on @file.thumb, 'wheel', Volume.wheel.bind(Header.hover)
$.on ($('.file-info', @file.text) or @file.link), 'wheel', Volume.wheel.bind(@file.thumbLink)

View File

@ -265,7 +265,7 @@ QR.post = class
@fileError 'Video lacks duration metadata (try remuxing)'
else if duration > QR.max_duration_video
@fileError "Video too long (video: #{duration}s, max: #{QR.max_duration_video}s)"
if g.BOARD.ID not in ['gif', 'wsg', 'r', 'wsr'] and $.hasAudio el
if BoardConfig.noAudio(g.BOARD.ID) and $.hasAudio(el)
@fileError 'Audio not allowed'
setThumbnail: (el) ->