diff --git a/4chan_x.user.js b/4chan_x.user.js
index 06ffe3de3..edbf6d546 100644
--- a/4chan_x.user.js
+++ b/4chan_x.user.js
@@ -1359,7 +1359,7 @@
}
}
},
- dialog: function(text) {
+ dialog: function(text, tid) {
var c, l, m, qr, ta;
if (text == null) {
text = '';
@@ -1367,7 +1367,7 @@
QR.qr = qr = ui.dialog('qr', {
top: '0',
left: '0'
- }, " X
Quick Reply
");
+ }, " X Quick Reply
");
c = d.cookie;
$('[name=name]', qr).value = (m = c.match(/4chan_name=([^;]+)/)) ? decodeURIComponent(m[1]) : '';
$('[name=email]', qr).value = (m = c.match(/4chan_email=([^;]+)/)) ? decodeURIComponent(m[1]) : '';
@@ -1395,8 +1395,9 @@
return QR.submit();
},
quote: function(e) {
- var i, id, qr, s, sel, ss, ta, text, v, _ref;
+ var i, id, qr, s, sel, ss, ta, text, tid, v, _ref;
e.preventDefault();
+ tid = g.THREAD_ID || $.x('ancestor::div[@class="thread"]/div', this).id;
id = this.textContent;
text = ">>" + id + "\n";
sel = getSelection();
@@ -1407,7 +1408,7 @@
}
qr = QR.qr;
if (!qr) {
- QR.dialog(text);
+ QR.dialog(text, tid);
return;
}
$('#autohide', qr).checked = false;
diff --git a/script.coffee b/script.coffee
index fbc705b0a..1caae9e68 100644
--- a/script.coffee
+++ b/script.coffee
@@ -961,9 +961,8 @@ cooldown =
qr.autoPost()
QR =
+ #TODO create new thread
#FIXME DRY
- #index reply
- #create new thread
#sys normal post form fallback
init: ->
g.callbacks.push (root) ->
@@ -1057,12 +1056,12 @@ QR =
textContent: 'Submit'
disabled: false
QR.submit() if $('#auto', QR.qr).checked
- dialog: (text='') ->
+ dialog: (text='', tid) ->
QR.qr = qr = ui.dialog 'qr', top: '0', left: '0', "
X
Quick Reply