-g.THREAD_ID

This commit is contained in:
James Campos 2011-09-04 03:25:13 -07:00
parent 8245ecba83
commit cb10ce14c6
2 changed files with 6 additions and 6 deletions

View File

@ -913,7 +913,7 @@
if (QR.qr) {
return $('textarea', QR.qr).focus();
} else {
return QR.dialog('', g.THREAD_ID || thread.firstChild.id);
return QR.dialog('', thread != null ? thread.firstChild.id : void 0);
}
}
},
@ -1436,15 +1436,15 @@
return QR.submit();
},
quote: function(e, blank) {
var i, id, qr, s, sel, ss, ta, text, tid, v, _ref;
var i, id, qr, s, sel, ss, ta, text, tid, v, _ref, _ref2;
if (e != null) {
e.preventDefault();
}
tid = g.THREAD_ID || $.x('ancestor::div[@class="thread"]/div', this).id;
tid = (_ref = $.x('ancestor::div[@class="thread"]/div', this)) != null ? _ref.id : void 0;
id = this.textContent;
text = ">>" + id + "\n";
sel = getSelection();
if (id === ((_ref = $.x('preceding::input[@type="checkbox"][1]', sel.anchorNode)) != null ? _ref.name : void 0)) {
if (id === ((_ref2 = $.x('preceding::input[@type="checkbox"][1]', sel.anchorNode)) != null ? _ref2.name : void 0)) {
if (s = sel.toString().replace(/\n/g, '\n>')) {
text += ">" + s + "\n";
}

View File

@ -656,7 +656,7 @@ keybinds =
if QR.qr
$('textarea', QR.qr).focus()
else
QR.dialog '', g.THREAD_ID or thread.firstChild.id
QR.dialog '', thread?.firstChild.id
open: (thread, tab) ->
id = thread.firstChild.id
@ -1145,7 +1145,7 @@ QR =
QR.submit() #derpy, but prevents checking for content twice
quote: (e, blank) ->
e?.preventDefault()
tid = g.THREAD_ID or $.x('ancestor::div[@class="thread"]/div', @).id
tid = $.x('ancestor::div[@class="thread"]/div', @)?.id
id = @textContent
text = ">>#{id}\n"
sel = getSelection()