Fix a bunch of feature initialization conditions.
Conflicts: LICENSE builds/appchan-x.user.js builds/crx/script.js src/Filtering/PostHiding.coffee src/General/Index.coffee src/General/Navigate.coffee src/Images/FappeTyme.coffee src/Images/Gallery.coffee src/Images/ImageExpand.coffee src/Images/ImageLoader.coffee src/Menu/Labels.coffee src/Miscellaneous/Keybinds.coffee src/Monitoring/ThreadWatcher.coffee
This commit is contained in:
parent
fe81085b0f
commit
d65dc2ca97
@ -1,6 +1,6 @@
|
|||||||
FappeTyme =
|
FappeTyme =
|
||||||
init: ->
|
init: ->
|
||||||
return if !(Conf['Fappe Tyme'] or Conf['Werk Tyme']) or g.VIEW not in ['index', 'thread'] or g.BOARD.ID is 'f'
|
return unless (Conf['Fappe Tyme'] or Conf['Werk Tyme']) and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f'
|
||||||
|
|
||||||
@nodes = {}
|
@nodes = {}
|
||||||
@enabled =
|
@enabled =
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
Gallery =
|
Gallery =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW not in ['index', 'thread'] or g.BOARD is 'f' or !Conf['Gallery']
|
return unless @enabled = Conf['Gallery'] and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f'
|
||||||
|
|
||||||
@delay = Conf['Slide Delay']
|
@delay = Conf['Slide Delay']
|
||||||
|
|
||||||
@ -291,7 +291,7 @@ Gallery =
|
|||||||
|
|
||||||
menu:
|
menu:
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW not in ['index', 'thread'] or !Conf['Gallery']
|
return unless Gallery.enabled
|
||||||
|
|
||||||
el = $.el 'span',
|
el = $.el 'span',
|
||||||
textContent: 'Gallery'
|
textContent: 'Gallery'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
ImageExpand =
|
ImageExpand =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW not in ['index', 'thread'] or !Conf['Image Expansion']
|
return unless @enabled = Conf['Image Expansion'] and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f'
|
||||||
|
|
||||||
@EAI = $.el 'a',
|
@EAI = $.el 'a',
|
||||||
className: 'expand-all-shortcut fa fa-expand'
|
className: 'expand-all-shortcut fa fa-expand'
|
||||||
@ -242,7 +242,7 @@ ImageExpand =
|
|||||||
|
|
||||||
menu:
|
menu:
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW not in ['index', 'thread'] or !Conf['Image Expansion']
|
return unless ImageExpand.enabled
|
||||||
|
|
||||||
el = $.el 'span',
|
el = $.el 'span',
|
||||||
textContent: 'Image Expansion'
|
textContent: 'Image Expansion'
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
ImageLoader =
|
ImageLoader =
|
||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW not in ['index', 'thread']
|
return unless g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f'
|
||||||
return unless Conf['Image Prefetching'] or Conf['Replace JPG'] or Conf['Replace PNG'] or Conf['Replace GIF'] or Conf['Replace WEBM']
|
return unless Conf['Image Prefetching'] or
|
||||||
|
Conf['Replace JPG'] or Conf['Replace PNG'] or Conf['Replace GIF'] or Conf['Replace WEBM']
|
||||||
|
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
name: 'Image Replace'
|
name: 'Image Replace'
|
||||||
|
|||||||
@ -88,19 +88,20 @@ Keybinds =
|
|||||||
ThreadWatcher.toggle thread
|
ThreadWatcher.toggle thread
|
||||||
# Images
|
# Images
|
||||||
when Conf['Expand image']
|
when Conf['Expand image']
|
||||||
return unless threadRoot
|
return unless ImageExpand.enabled and threadRoot
|
||||||
Keybinds.img threadRoot
|
Keybinds.img threadRoot
|
||||||
when Conf['Expand images']
|
when Conf['Expand images']
|
||||||
return unless threadRoot
|
return unless ImageExpand.enabled and threadRoot
|
||||||
Keybinds.img threadRoot, true
|
Keybinds.img threadRoot, true
|
||||||
when Conf['Open Gallery']
|
when Conf['Open Gallery']
|
||||||
return if g.VIEW not in ['index', 'thread']
|
return unless Gallery.enabled
|
||||||
Gallery.cb.toggle()
|
Gallery.cb.toggle()
|
||||||
when Conf['fappeTyme']
|
when Conf['fappeTyme']
|
||||||
return if !Conf['Fappe Tyme'] or g.VIEW not in ['index', 'thread'] or g.BOARD is 'f'
|
return unless Conf['Fappe Tyme'] and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f'
|
||||||
FappeTyme.toggle 'fappe'
|
FappeTyme.toggle 'fappe'
|
||||||
when Conf['werkTyme']
|
when Conf['werkTyme']
|
||||||
return if !Conf['Werk Tyme'] or g.VIEW not in ['index', 'thread'] or g.BOARD is 'f'
|
return if !Conf['Werk Tyme'] or g.VIEW not in ['index', 'thread'] or g.BOARD is 'f'
|
||||||
|
return unless Conf['Werk Tyme'] and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f'
|
||||||
FappeTyme.toggle 'werk'
|
FappeTyme.toggle 'werk'
|
||||||
# Board Navigation
|
# Board Navigation
|
||||||
when Conf['Front page']
|
when Conf['Front page']
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user