This commit is contained in:
James Campos 2011-05-21 23:08:14 -07:00
parent 55dbd3915a
commit c2d993adcd

View File

@ -325,10 +325,10 @@ expandComment =
@textContent = "Loading #{replyID}..." @textContent = "Loading #{replyID}..."
if req = g.requests[threadID] if req = g.requests[threadID]
if req.readyState is 4 if req.readyState is 4
expandComment.parse req, this, threadID, replyID expandComment.parse req, @, threadID, replyID
else else
a = this a = @
g.requests[threadID] = $.get @href, (-> expandComment.parse this, a, threadID, replyID) g.requests[threadID] = $.get @href, (-> expandComment.parse @, a, threadID, replyID)
parse: (req, a, threadID, replyID) -> parse: (req, a, threadID, replyID) ->
if req.status isnt 200 if req.status isnt 200
a.textContent = "#{req.status} #{req.statusText}" a.textContent = "#{req.status} #{req.statusText}"
@ -373,7 +373,7 @@ expandThread =
if req.readyState is 4 if req.readyState is 4
expandThread.parse req, thread, a expandThread.parse req, thread, a
else else
g.requests[threadID] = $.get "res/#{threadID}", (-> expandThread.parse this, thread, a) g.requests[threadID] = $.get "res/#{threadID}", (-> expandThread.parse @, thread, a)
when 'X' when 'X'
a.textContent = a.textContent.replace 'X Loading...', '+' a.textContent = a.textContent.replace 'X Loading...', '+'
@ -799,7 +799,7 @@ qr =
$.bind quote, 'click', qr.cb.quote $.bind quote, 'click', qr.cb.quote
submit: (e) -> submit: (e) ->
form = this form = @
isQR = form.parentNode.id == 'qr' isQR = form.parentNode.id == 'qr'
if $.config('Auto Watch Reply') and $.config('Thread Watcher') if $.config('Auto Watch Reply') and $.config('Thread Watcher')
@ -831,7 +831,7 @@ qr =
quote: (e) -> quote: (e) ->
e.preventDefault() e.preventDefault()
qr.quote this qr.quote @
quote: (link) -> quote: (link) ->
if dialog = $ '#qr' if dialog = $ '#qr'
@ -1395,7 +1395,7 @@ quoteInline =
toggle: (e) -> toggle: (e) ->
e.preventDefault() e.preventDefault()
return unless id = @hash[1..] return unless id = @hash[1..]
root = $.x 'ancestor::td[1]', this root = $.x 'ancestor::td[1]', @
if table = $ "#i#{id}", root if table = $ "#i#{id}", root
$.rm table $.rm table
$.removeClass @, 'inlined' $.removeClass @, 'inlined'
@ -1417,13 +1417,13 @@ quoteInline =
innerHTML: "Loading #{id}..." innerHTML: "Loading #{id}..."
$.after @parentNode, inline $.after @parentNode, inline
# or ... is for index page new posts. # or ... is for index page new posts.
threadID = @pathname.split('/').pop() or $.x('ancestor::div[@class="thread"]/div', this).id threadID = @pathname.split('/').pop() or $.x('ancestor::div[@class="thread"]/div', @).id
if req = g.requests[threadID] if req = g.requests[threadID]
if req.readyState is 4 if req.readyState is 4
quoteInline.parse req, id, threadID, inline quoteInline.parse req, id, threadID, inline
else else
#FIXME need an array of callbacks #FIXME need an array of callbacks
g.requests[threadID] = $.get @href, (-> quoteInline.parse this, id, threadID, inline) g.requests[threadID] = $.get @href, (-> quoteInline.parse @, id, threadID, inline)
parse: (req, id, threadID, inline) -> parse: (req, id, threadID, inline) ->
if req.status isnt 200 if req.status isnt 200
inline.innerHTML = "#{req.status} #{req.statusText}" inline.innerHTML = "#{req.status} #{req.statusText}"
@ -1477,7 +1477,7 @@ quotePreview =
if req.readyState is 4 if req.readyState is 4
quotePreview.parse req, id, threadID quotePreview.parse req, id, threadID
else else
g.requests[threadID] = $.get @href, (-> quotePreview.parse this, id, threadID) g.requests[threadID] = $.get @href, (-> quotePreview.parse @, id, threadID)
ui.el = qp ui.el = qp
ui.winHeight = d.body.clientHeight ui.winHeight = d.body.clientHeight
$.show qp $.show qp
@ -1526,7 +1526,7 @@ reportButton =
$.after span, $.tn(' ') $.after span, $.tn(' ')
$.bind a, 'click', reportButton.cb.report $.bind a, 'click', reportButton.cb.report
report: (e) -> report: (e) ->
reportButton.report this reportButton.report @
report: (target) -> report: (target) ->
input = $.x('preceding-sibling::input[1]', target) input = $.x('preceding-sibling::input[1]', target)
input.click() input.click()
@ -1678,7 +1678,7 @@ imgExpand =
toggle: (e) -> toggle: (e) ->
return if e.shiftKey or e.altKey or e.ctrlKey or e.button isnt 0 return if e.shiftKey or e.altKey or e.ctrlKey or e.button isnt 0
e.preventDefault() e.preventDefault()
imgExpand.toggle this imgExpand.toggle @
all: (e) -> all: (e) ->
thumbs = $$ 'img[md5]' thumbs = $$ 'img[md5]'
imgExpand.on = @checked imgExpand.on = @checked