From 9f54d39a6d931088c73128f030ec19a3b4e45f2f Mon Sep 17 00:00:00 2001 From: James Campos Date: Thu, 30 Jun 2011 20:43:53 -0700 Subject: [PATCH 1/2] Revert "Shave a line." This reverts commit d313fb776092cfb75749e9e1f975f8b50e3c3315. outerHTML isn't supported in firefox. --- 4chan_x.user.js | 7 ++++--- script.coffee | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 78df3b7f1..545fca2be 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1364,8 +1364,9 @@ return f.innerHTML = f.innerHTML; }, dialog: function(link) { - var THREAD_ID, c, challenge, dialog, html, m, mail, name, pass, spoiler, src, submitHTML; - submitHTML = $('#com_submit').outerHTML; + var THREAD_ID, c, challenge, dialog, html, m, mail, name, pass, spoiler, src, submitDisabled, submitValue; + submitValue = $('#com_submit').value; + submitDisabled = $('#com_submit').disabled ? 'disabled' : ''; THREAD_ID = g.THREAD_ID || $.x('ancestor::div[@class="thread"]/div', link).id; challenge = $('input[name=recaptcha_challenge_field]').value; src = "http://www.google.com/recaptcha/api/image?c=" + challenge; @@ -1373,7 +1374,7 @@ name = (m = c.match(/4chan_name=([^;]+)/)) ? decodeURIComponent(m[1]) : ''; mail = (m = c.match(/4chan_email=([^;]+)/)) ? decodeURIComponent(m[1]) : ''; pass = (m = c.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $('input[name=pwd]').value; - html = "
Quick Reply X
" + submitHTML + "
"; + html = "
Quick Reply X
"; dialog = ui.dialog('qr', { top: '0px', left: '0px' diff --git a/script.coffee b/script.coffee index f5c9963dc..fe95c3c59 100644 --- a/script.coffee +++ b/script.coffee @@ -1076,8 +1076,8 @@ qr = f.innerHTML = f.innerHTML dialog: (link) -> - #copy submit button state and value - submitHTML = $('#com_submit').outerHTML + submitValue = $('#com_submit').value + submitDisabled = if $('#com_submit').disabled then 'disabled' else '' #FIXME inlined cross-thread quotes THREAD_ID = g.THREAD_ID or $.x('ancestor::div[@class="thread"]/div', link).id challenge = $('input[name=recaptcha_challenge_field]').value @@ -1097,7 +1097,7 @@ qr =
-
#{submitHTML}
+
From 073e2608ae9c1f3a33285a87bd8d85dc6d2fdc40 Mon Sep 17 00:00:00 2001 From: James Campos Date: Thu, 30 Jun 2011 20:49:19 -0700 Subject: [PATCH 2/2] shave a line --- 4chan_x.user.js | 3 +-- script.coffee | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 545fca2be..0e75a91b9 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2729,8 +2729,7 @@ $.setValue('lastChecked', now); } $.addStyle(main.css); - if ((form = $('form[name=post]')) && $('#recaptcha_response_field')) { - canPost = true; + if ((form = $('form[name=post]')) && (canPost = !!$('#recaptcha_response_field'))) { Recaptcha.init(); $.bind(form, 'submit', qr.cb.submit); } diff --git a/script.coffee b/script.coffee index fe95c3c59..c285dc647 100644 --- a/script.coffee +++ b/script.coffee @@ -2124,8 +2124,7 @@ main = $.addStyle main.css - if (form = $ 'form[name=post]') and $ '#recaptcha_response_field' - canPost = true + if (form = $ 'form[name=post]') and canPost = !!$ '#recaptcha_response_field' Recaptcha.init() $.bind form, 'submit', qr.cb.submit