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) -> $.event = (event, detail, root=d) ->
<% if (type === 'userscript') { %> <% if (type === 'userscript') { %>
if detail? and typeof cloneInto is 'function' 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} root.dispatchEvent new CustomEvent event, {bubbles: true, detail}

View File

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

View File

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

View File

@ -1,11 +1,11 @@
class Connection class Connection
constructor: (@target, @origin, @cb) -> 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 @target.postMessage "#{g.NAMESPACE}#{JSON.stringify data}", @origin
onMessage: (e) -> onMessage: (e) =>
return unless e.source is @target and return unless e.source is @target and
e.origin is @origin and e.origin is @origin and
typeof e.data is 'string' and typeof e.data is 'string' and

View File

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

View File

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