rm qr.cb.quote

This commit is contained in:
James Campos 2011-08-06 14:18:17 -07:00
parent 4ef9561520
commit 48e3fb74d6
2 changed files with 16 additions and 21 deletions

View File

@ -883,7 +883,7 @@
qrLink = $("span[id^=nothread] a:not(:first-child)", thread); qrLink = $("span[id^=nothread] a:not(:first-child)", thread);
} }
if (quote) { if (quote) {
return qr.quote(qrLink); return qr.quote.call(qrLink);
} else { } else {
if (!qr.el) { if (!qr.el) {
qr.dialog(qrLink); qr.dialog(qrLink);
@ -1279,12 +1279,6 @@
return qr.push.call(this); return qr.push.call(this);
} }
}, },
cb: {
quote: function(e) {
e.preventDefault();
return qr.quote(this);
}
},
close: function() { close: function() {
$.rm(qr.el); $.rm(qr.el);
return qr.el = null; return qr.el = null;
@ -1350,7 +1344,7 @@
node: function(root) { node: function(root) {
var quote; var quote;
quote = $('a.quotejs:not(:first-child)', root); quote = $('a.quotejs:not(:first-child)', root);
return $.bind(quote, 'click', qr.cb.quote); return $.bind(quote, 'click', qr.quote);
}, },
push: function() { push: function() {
this.nextSibling.textContent = qr.captcha.push({ this.nextSibling.textContent = qr.captcha.push({
@ -1360,14 +1354,17 @@
Recaptcha.reload(); Recaptcha.reload();
return this.value = ''; return this.value = '';
}, },
quote: function(link) { quote: function(e) {
var id, s, selection, selectionID, ta, text, _ref; var id, s, selection, selectionID, ta, text, _ref;
if (e) {
e.preventDefault();
}
if (qr.el) { if (qr.el) {
$('#autohide', qr.el).checked = false; $('#autohide', qr.el).checked = false;
} else { } else {
qr.dialog(link); qr.dialog(this);
} }
id = link.textContent; id = this.textContent;
text = ">>" + id + "\n"; text = ">>" + id + "\n";
selection = window.getSelection(); selection = window.getSelection();
if (s = selection.toString()) { if (s = selection.toString()) {

View File

@ -631,7 +631,7 @@ keybinds =
qrLink = $ "span[id^=nothread] a:not(:first-child)", thread qrLink = $ "span[id^=nothread] a:not(:first-child)", thread
if quote if quote
qr.quote qrLink qr.quote.call qrLink
else else
unless qr.el unless qr.el
qr.dialog qrLink qr.dialog qrLink
@ -971,6 +971,7 @@ qr =
# persistent captcha # persistent captcha
# code review # code review
# rm Recaptcha # rm Recaptcha
# group captcha
init: -> init: ->
g.callbacks.push qr.node g.callbacks.push qr.node
$.bind window, 'message', qr.message $.bind window, 'message', qr.message
@ -1011,11 +1012,6 @@ qr =
$('#autohide', qr.el).checked = true if conf['Auto Hide QR'] $('#autohide', qr.el).checked = true if conf['Auto Hide QR']
qr.push.call this qr.push.call this
cb:
quote: (e) ->
e.preventDefault()
qr.quote @
close: -> close: ->
$.rm qr.el $.rm qr.el
qr.el = null qr.el = null
@ -1093,7 +1089,7 @@ qr =
node: (root) -> node: (root) ->
quote = $ 'a.quotejs:not(:first-child)', root quote = $ 'a.quotejs:not(:first-child)', root
$.bind quote, 'click', qr.cb.quote $.bind quote, 'click', qr.quote
push: -> push: ->
@nextSibling.textContent = qr.captcha.push @nextSibling.textContent = qr.captcha.push
@ -1102,13 +1098,15 @@ qr =
Recaptcha.reload() Recaptcha.reload()
@value = '' @value = ''
quote: (link) -> quote: (e) ->
e.preventDefault() if e
if qr.el if qr.el
$('#autohide', qr.el).checked = false $('#autohide', qr.el).checked = false
else else
qr.dialog link qr.dialog @
id = link.textContent id = @textContent
text = ">>#{id}\n" text = ">>#{id}\n"
selection = window.getSelection() selection = window.getSelection()