This commit is contained in:
James Campos 2011-04-20 00:16:32 -07:00
parent 8977f055cc
commit 0575c17582
2 changed files with 41 additions and 45 deletions

View File

@ -684,16 +684,12 @@
}
},
qr: function(thread, quote) {
var e, qrLink;
var qrLink;
if (!(qrLink = $('td.replyhl span[id] a:not(:first-child)', thread))) {
qrLink = $("span[id^=nothread] a:not(:first-child)", thread);
}
if (quote) {
e = {
preventDefault: function() {},
target: qrLink
};
return qr.cb.quote(e);
return qr.quote(qrLink);
} else {
if (!$('#qr')) {
qr.dialog(qrLink);
@ -1027,15 +1023,18 @@
}
},
quote: function(e) {
var dialog, id, s, selection, selectionID, ta, target, text, _ref;
e.preventDefault();
target = e.target;
return qr.quote(e.target);
}
},
quote: function(link) {
var dialog, id, s, selection, selectionID, ta, text, _ref;
if (dialog = $('#qr')) {
qr.autohide.unset();
} else {
dialog = qr.dialog(target);
dialog = qr.dialog(link);
}
id = target.textContent;
id = link.textContent;
text = ">>" + id + "\n";
selection = window.getSelection();
if (s = selection.toString()) {
@ -1047,7 +1046,6 @@
ta = $('textarea', dialog);
ta.focus();
return ta.value += text;
}
},
refresh: function(dialog) {
var f;

View File

@ -499,11 +499,7 @@ keybinds =
qrLink = $ "span[id^=nothread] a:not(:first-child)", thread
if quote
# qrLink.click() doesn't work, so use this hack
e =
preventDefault: ->
target: qrLink
qr.cb.quote e
qr.quote qrLink
else
unless $ '#qr'
qr.dialog qrLink
@ -781,13 +777,15 @@ qr =
quote: (e) ->
e.preventDefault()
{target} = e
qr.quote e.target
quote: (link) ->
if dialog = $ '#qr'
qr.autohide.unset()
else
dialog = qr.dialog target
dialog = qr.dialog link
id = target.textContent
id = link.textContent
text = ">>#{id}\n"
selection = window.getSelection()