remove dead feature disconnection code

This commit is contained in:
ccd0 2014-06-17 22:54:51 -07:00
parent efc852464f
commit e810af22ca
7 changed files with 1 additions and 95 deletions

View File

@ -3,17 +3,13 @@ class Callbacks
@keys = []
push: ({name, cb}) ->
@connect name if @[name]
@keys.push name unless @[name]
@[name] = cb
connect: (name) -> delete @[name].disconnected if @[name].disconnected
disconnect: (name) -> @[name].disconnected = true if @[name]
execute: (node) ->
for name in @keys
try
@[name].call node unless @[name].disconnected
@[name].call node
catch err
errors = [] unless errors
errors.push

View File

@ -89,8 +89,3 @@ class DataBoard
onSync: (data) =>
@data = data or boards: {}
@sync?()
disconnect: ->
$.desync @key
delete @sync
delete @data

View File

@ -6,6 +6,3 @@ ThreadExcerpt =
name: 'Thread Excerpt'
cb: @node
node: -> d.title = Get.threadExcerpt @
disconnect: ->
return if g.VIEW isnt 'thread' or !Conf['Thread Excerpt']
Thread.callbacks.disconnect 'Thread Excerpt'

View File

@ -34,26 +34,6 @@ ThreadStats =
ThreadStats.update postCount, fileCount
$.on d, 'ThreadUpdate', ThreadStats.onUpdate
disconnect: ->
return if g.VIEW isnt 'thread' or !Conf['Thread Stats']
if Conf['Updater and Stats in Header']
Header.rmShortcut @dialog
else
$.rm @dialog
clearTimeout @timeout # a possible race condition might be that this won't clear in time, but the resulting error will prevent issues anyways.
delete @timeout
delete @thread
delete @postCountEl
delete @fileCountEl
delete @pageCountEl
delete @dialog
Thread.callbacks.disconnect 'Thread Stats'
$.off d, 'ThreadUpdate', ThreadStats.onUpdate
onUpdate: (e) ->
return if e.detail[404]
{postCount, fileCount} = e.detail

View File

@ -63,40 +63,6 @@ ThreadUpdater =
name: 'Thread Updater'
cb: @node
disconnect: ->
return if g.VIEW isnt 'thread' or !Conf['Thread Updater']
$.off @timer, 'click', @update
$.off @status, 'click', @update
clearTimeout @timeoutID if @timeoutID
for entry in @entry.subEntries
{el} = entry
input = el.firstElementChild
$.off input, 'change', $.cb.checked
$.off input, 'change', @cb.scrollBG
$.off input, 'change', @cb.update
$.off @settings, 'click', @intervalShortcut
$.off window, 'online offline', @cb.online
$.off d, 'QRPostSuccessful', @cb.checkpost
$.off d, 'visibilitychange', @cb.visibility
@set 'timer', null
@set 'status', 'Offline'
UI.rmMenuEntry @entry
if Conf['Updater and Stats in Header']
Header.rmShortcut @dialog
else
$.rmClass doc, 'float'
$.rm @dialog
delete @[name] for name in ['checkPostCount', 'timer', 'status', 'isUpdating', 'entry', 'dialog', 'thread', 'root', 'lastPost', 'outdateCount', 'online', 'seconds', 'timeoutID']
Thread.callbacks.disconnect 'Thread Updater'
node: ->
ThreadUpdater.thread = @
ThreadUpdater.root = @OP.nodes.root.parentNode

View File

@ -12,21 +12,6 @@ Unread =
name: 'Unread'
cb: @node
disconnect: ->
return if g.VIEW isnt 'thread' or !Conf['Unread Count'] and !Conf['Unread Favicon'] and !Conf['Desktop Notifications']
Unread.db.disconnect()
$.rm hr if {hr} = Unread
delete @[name] for name in ['db', 'hr', 'posts', 'postsQuotingYou', 'thread', 'title', 'lastReadPost']
$.off d, '4chanXInitFinished', @ready
$.off d, 'ThreadUpdate', @onUpdate
$.off d, 'scroll visibilitychange', @read
$.off d, 'visibilitychange', @setLine if Conf['Unread Line'] and not Conf['Quote Threading']
Thread.callbacks.disconnect 'Unread'
node: ->
Unread.thread = @
Unread.title = d.title

View File

@ -24,19 +24,6 @@ QuoteThreading =
name: 'Quote Threading'
cb: @node
disconnect: ->
return unless Conf['Quote Threading'] and g.VIEW is 'thread'
input = $ 'input', @controls
$.off input, 'change', @toggle
UI.rmMenuEntry @entry
delete @enabled
delete @controls
delete @entry
Post.callbacks.disconnect 'Quote Threading'
ready: ->
$.off d, '4chanXInitFinished', QuoteThreading.ready
QuoteThreading.force()