Merge from Appchan X: src/General/lib

deferred: changes to Callbacks.execute
This commit is contained in:
ccd0 2015-02-06 20:59:54 -08:00
parent 7a9546949d
commit b01c372c1a
6 changed files with 12 additions and 13 deletions

View File

@ -215,7 +215,7 @@ $.one = (el, events, handler) ->
$.event = (event, detail, root=d) ->
<% if (type === 'userscript') { %>
if detail? and typeof cloneInto is 'function'
detail = cloneInto detail, document.defaultView
detail = cloneInto detail, d.defaultView
<% } %>
root.dispatchEvent new CustomEvent event, {bubbles: true, detail}

View File

@ -2,7 +2,7 @@ class Board
toString: -> @ID
constructor: (@ID) ->
@threads = new SimpleDict
@posts = new SimpleDict
@threads = new SimpleDict()
@posts = new SimpleDict()
g.boards[@] = @
g.boards[@] = @

View File

@ -1,5 +1,5 @@
class CatalogThread
@callbacks = new Callbacks 'CatalogThread'
@callbacks = new Callbacks 'Catalog Thread'
toString: -> @ID
constructor: (root, @thread) ->

View File

@ -1,11 +1,11 @@
class Connection
constructor: (@target, @origin, @cb) ->
$.on window, 'message', @onMessage.bind @
$.on window, 'message', @onMessage
send: (data) ->
send: (data) =>
@target.postMessage "#{g.NAMESPACE}#{JSON.stringify data}", @origin
onMessage: (e) ->
onMessage: (e) =>
return unless e.source is @target and
e.origin is @origin and
typeof e.data is 'string' and

View File

@ -234,10 +234,9 @@ class Post
for clone in @clones
clone.resurrect()
for quotelink in Get.allQuotelinksLinkingTo @
if $.hasClass quotelink, 'deadlink'
quotelink.textContent = quotelink.textContent.replace '\u00A0(Dead)', ''
$.rmClass quotelink, 'deadlink'
for quotelink in Get.allQuotelinksLinkingTo @ when $.hasClass quotelink, 'deadlink'
quotelink.textContent = quotelink.textContent.replace '\u00A0(Dead)', ''
$.rmClass quotelink, 'deadlink'
return
collect: ->

View File

@ -4,7 +4,7 @@ class Thread
constructor: (@ID, @board) ->
@fullID = "#{@board}.#{@ID}"
@posts = new SimpleDict
@posts = new SimpleDict()
@isDead = false
@isHidden = false
@isOnTop = false