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:
ccd0 2015-01-26 00:57:17 -08:00
parent fe81085b0f
commit d65dc2ca97
5 changed files with 13 additions and 11 deletions

View File

@ -1,6 +1,6 @@
FappeTyme =
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 = {}
@enabled =

View File

@ -1,6 +1,6 @@
Gallery =
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']
@ -291,7 +291,7 @@ Gallery =
menu:
init: ->
return if g.VIEW not in ['index', 'thread'] or !Conf['Gallery']
return unless Gallery.enabled
el = $.el 'span',
textContent: 'Gallery'

View File

@ -1,6 +1,6 @@
ImageExpand =
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',
className: 'expand-all-shortcut fa fa-expand'
@ -242,7 +242,7 @@ ImageExpand =
menu:
init: ->
return if g.VIEW not in ['index', 'thread'] or !Conf['Image Expansion']
return unless ImageExpand.enabled
el = $.el 'span',
textContent: 'Image Expansion'

View File

@ -1,7 +1,8 @@
ImageLoader =
init: ->
return if g.VIEW not in ['index', 'thread']
return unless Conf['Image Prefetching'] or Conf['Replace JPG'] or Conf['Replace PNG'] or Conf['Replace GIF'] or Conf['Replace WEBM']
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']
Post.callbacks.push
name: 'Image Replace'

View File

@ -88,19 +88,20 @@ Keybinds =
ThreadWatcher.toggle thread
# Images
when Conf['Expand image']
return unless threadRoot
return unless ImageExpand.enabled and threadRoot
Keybinds.img threadRoot
when Conf['Expand images']
return unless threadRoot
return unless ImageExpand.enabled and threadRoot
Keybinds.img threadRoot, true
when Conf['Open Gallery']
return if g.VIEW not in ['index', 'thread']
return unless Gallery.enabled
Gallery.cb.toggle()
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'
when Conf['werkTyme']
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'
# Board Navigation
when Conf['Front page']