From d313525c8c8ecfb5144e5bc695638575c6ba1ceb Mon Sep 17 00:00:00 2001 From: James Campos Date: Wed, 20 Jul 2011 02:48:19 -0700 Subject: [PATCH] qr.cb.submit -> qr.submit --- 4chan_x.user.js | 60 ++++++++++++++++++++++++------------------------- script.coffee | 54 ++++++++++++++++++++++---------------------- 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 4a2b2231e..48119f8c2 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1294,39 +1294,39 @@ quote = $('a.quotejs:not(:first-child)', root); return $.bind(quote, 'click', qr.cb.quote); }, - submit: function(e) { - var id, inputfile, isQR, op; - if ($.config('Auto Watch Reply') && $.config('Thread Watcher')) { - if (g.REPLY && $('img.favicon').src === Favicon.empty) { - watcher.watch(null, g.THREAD_ID); - } else { - id = $('input[name=resto]').value; - op = d.getElementById(id); - if ($('img.favicon', op).src === Favicon.empty) { - watcher.watch(op, id); - } - } - } - isQR = this.id === 'qr_form'; - inputfile = $('input[type=file]', this); - if (inputfile.value && inputfile.files[0].size > $('input[name=MAX_FILE_SIZE]').value) { - e.preventDefault(); - if (isQR) { - return $('#error').textContent = 'Error: File too large.'; - } else { - return alert('Error: File too large.'); - } - } else if (isQR) { - $('#error').textContent = ''; - qr.autohide.set(); - return qr.sage = /sage/i.test($('input[name=email]', this).value); - } - }, quote: function(e) { e.preventDefault(); return qr.quote(this); } }, + submit: function(e) { + var id, inputfile, isQR, op; + if ($.config('Auto Watch Reply') && $.config('Thread Watcher')) { + if (g.REPLY && $('img.favicon').src === Favicon.empty) { + watcher.watch(null, g.THREAD_ID); + } else { + id = $('input[name=resto]').value; + op = d.getElementById(id); + if ($('img.favicon', op).src === Favicon.empty) { + watcher.watch(op, id); + } + } + } + isQR = this.id === 'qr_form'; + inputfile = $('input[type=file]', this); + if (inputfile.value && inputfile.files[0].size > $('input[name=MAX_FILE_SIZE]').value) { + e.preventDefault(); + if (isQR) { + return $('#error').textContent = 'Error: File too large.'; + } else { + return alert('Error: File too large.'); + } + } else if (isQR) { + $('#error').textContent = ''; + qr.autohide.set(); + return qr.sage = /sage/i.test($('input[name=email]', this).value); + } + }, quote: function(link) { var dialog, id, s, selection, selectionID, ta, text, _ref; if (dialog = $('#qr')) { @@ -1382,7 +1382,7 @@ }); $.after($('input[name=email]', dialog), spoiler); } - $.bind($('form', dialog), 'submit', qr.cb.submit); + $.bind($('form', dialog), 'submit', qr.submit); $.bind($('input[name=recaptcha_response_field]', dialog), 'keydown', Recaptcha.listener); $.append(d.body, dialog); return dialog; @@ -2696,7 +2696,7 @@ $.addStyle(main.css); if ((form = $('form[name=post]')) && (canPost = !!$('#recaptcha_response_field'))) { Recaptcha.init(); - $.bind(form, 'submit', qr.cb.submit); + $.bind(form, 'submit', qr.submit); } if ($.config('Auto Noko')) { $('.postarea form').action += '?auto_noko'; diff --git a/script.coffee b/script.coffee index 896ed0258..19d1ded4c 100644 --- a/script.coffee +++ b/script.coffee @@ -1014,35 +1014,35 @@ qr = quote = $ 'a.quotejs:not(:first-child)', root $.bind quote, 'click', qr.cb.quote - submit: (e) -> - if $.config('Auto Watch Reply') and $.config('Thread Watcher') - if g.REPLY and $('img.favicon').src is Favicon.empty - watcher.watch null, g.THREAD_ID - else - id = $('input[name=resto]').value - op = d.getElementById id - if $('img.favicon', op).src is Favicon.empty - watcher.watch op, id - - isQR = @id is 'qr_form' - - inputfile = $('input[type=file]', @) - if inputfile.value and inputfile.files[0].size > $('input[name=MAX_FILE_SIZE]').value - e.preventDefault() - if isQR - $('#error').textContent = 'Error: File too large.' - else - alert 'Error: File too large.' - - else if isQR - $('#error').textContent = '' - qr.autohide.set() - qr.sage = /sage/i.test $('input[name=email]', @).value - quote: (e) -> e.preventDefault() qr.quote @ + submit: (e) -> + if $.config('Auto Watch Reply') and $.config('Thread Watcher') + if g.REPLY and $('img.favicon').src is Favicon.empty + watcher.watch null, g.THREAD_ID + else + id = $('input[name=resto]').value + op = d.getElementById id + if $('img.favicon', op).src is Favicon.empty + watcher.watch op, id + + isQR = @id is 'qr_form' + + inputfile = $('input[type=file]', @) + if inputfile.value and inputfile.files[0].size > $('input[name=MAX_FILE_SIZE]').value + e.preventDefault() + if isQR + $('#error').textContent = 'Error: File too large.' + else + alert 'Error: File too large.' + + else if isQR + $('#error').textContent = '' + qr.autohide.set() + qr.sage = /sage/i.test $('input[name=email]', @).value + quote: (link) -> if dialog = $ '#qr' qr.autohide.unset() @@ -1110,7 +1110,7 @@ qr = innerHTML: " [Spoiler Image?]" $.after $('input[name=email]', dialog), spoiler - $.bind $('form', dialog), 'submit', qr.cb.submit + $.bind $('form', dialog), 'submit', qr.submit $.bind $('input[name=recaptcha_response_field]', dialog), 'keydown', Recaptcha.listener $.append d.body, dialog @@ -2094,7 +2094,7 @@ main = if (form = $ 'form[name=post]') and canPost = !!$ '#recaptcha_response_field' Recaptcha.init() - $.bind form, 'submit', qr.cb.submit + $.bind form, 'submit', qr.submit #major features if $.config 'Auto Noko'