From 6f9b6641de2a149718c6d7c86fb466a85f8be38a Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 29 Mar 2012 04:31:14 +0200 Subject: [PATCH] Get the form even if we hide the original post form. --- 4chan_x.user.js | 2 +- script.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 9a096366b..3d77eb90b 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1227,6 +1227,7 @@ }, asyncInit: function() { var form, iframe, link, loadChecking, script, src; + form = $('form[name=post]'); if (Conf['Hide Original Post Form']) { link = $.el('h1', { innerHTML: "" + (g.REPLY ? 'Quick Reply' : 'New Thread') + "" @@ -1236,7 +1237,6 @@ if (!g.REPLY) $('select', QR.el).value = 'new'; return $('textarea', QR.el).focus(); }); - form = d.forms[0]; $.before(form, link); } if (/chrome/i.test(navigator.userAgent)) { diff --git a/script.coffee b/script.coffee index 76aef1dc5..c7c3d30fc 100644 --- a/script.coffee +++ b/script.coffee @@ -1010,13 +1010,13 @@ QR = setTimeout @asyncInit asyncInit: -> + form = $ 'form[name=post]' if Conf['Hide Original Post Form'] link = $.el 'h1', innerHTML: "#{if g.REPLY then 'Quick Reply' else 'New Thread'}" $.on $('a', link), 'click', -> QR.open() $('select', QR.el).value = 'new' unless g.REPLY $('textarea', QR.el).focus() - form = d.forms[0] $.before form, link # CORS is ignored for content script on Chrome, but not Safari/Oprah/Firefox.