Automatically pick threads to reply to. Finish keybinds.

This commit is contained in:
Nicolas Stepien 2012-01-02 02:08:12 +01:00
parent 7e6f3ff09e
commit 4e2f3efef6
2 changed files with 12 additions and 0 deletions

View File

@ -1053,6 +1053,7 @@
} else { } else {
qr.open(); qr.open();
} }
if (!g.REPLY) qr.pickThread(thread.firstChild.id);
return $('textarea', qr.el).focus(); return $('textarea', qr.el).focus();
}, },
open: function(thread, tab) { open: function(thread, tab) {
@ -1236,10 +1237,16 @@
cleanError: function() { cleanError: function() {
return $('.error', qr.el).textContent = null; return $('.error', qr.el).textContent = null;
}, },
pickThread: function(thread) {
return $('select', qr.el).value = thread;
},
quote: function(e) { quote: function(e) {
var caretPos, id, s, sel, ta, text, _ref; var caretPos, id, s, sel, ta, text, _ref;
if (e != null) e.preventDefault(); if (e != null) e.preventDefault();
qr.open(); qr.open();
if (!g.REPLY) {
qr.pickThread($.x('ancestor::div[@class="thread"]/div', this).id);
}
id = this.textContent; id = this.textContent;
text = ">>" + id + "\n"; text = ">>" + id + "\n";
sel = window.getSelection(); sel = window.getSelection();

View File

@ -747,6 +747,7 @@ keybinds =
qr.quote.call $ '.quotejs + .quotejs', $('.replyhl', thread) or thread qr.quote.call $ '.quotejs + .quotejs', $('.replyhl', thread) or thread
else else
qr.open() qr.open()
qr.pickThread thread.firstChild.id unless g.REPLY
$('textarea', qr.el).focus() $('textarea', qr.el).focus()
open: (thread, tab) -> open: (thread, tab) ->
@ -901,9 +902,13 @@ qr =
cleanError: -> cleanError: ->
$('.error', qr.el).textContent = null $('.error', qr.el).textContent = null
pickThread: (thread) ->
$('select', qr.el).value = thread
quote: (e) -> quote: (e) ->
e?.preventDefault() e?.preventDefault()
qr.open() qr.open()
qr.pickThread $.x('ancestor::div[@class="thread"]/div', @).id unless g.REPLY
id = @textContent id = @textContent
text = ">>#{id}\n" text = ">>#{id}\n"