From e28c668fc55c50b23af8f4e64d0e727f8f53075a Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 15 Mar 2012 16:04:25 +0100 Subject: [PATCH] Get the XHR post url dynamically. --- 4chan_x.user.js | 8 ++++---- script.coffee | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index cb18a9300..3fcf74e4d 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1885,7 +1885,7 @@ Watcher.watch(threadID); } post = { - board: g.BOARD, + postURL: $('form[name=post]').action, resto: threadID, name: reply.name, email: reply.email, @@ -2020,8 +2020,8 @@ }, post: function(data) { var boundary, callbacks, form, i, name, opts, parts, toBin, url, val; - url = "https://sys.4chan.org/" + data.board + "/post"; - delete data.board; + url = data.postURL; + delete data.postURL; if (engine === 'gecko' && data.upfile) { if (!data.binary) { toBin = function(data, name, val) { @@ -2050,7 +2050,7 @@ toBin(data, name, val); } } - data.board = url.split('/')[3]; + data.postURL = url; data.binary = true; return; } diff --git a/script.coffee b/script.coffee index 5cb6453a4..a325c32d3 100644 --- a/script.coffee +++ b/script.coffee @@ -1563,7 +1563,7 @@ qr = Watcher.watch threadID post = - board: g.BOARD + postURL: $('form[name=post]').action resto: threadID name: reply.name email: reply.email @@ -1694,9 +1694,9 @@ qr = post: (data) -> - url = "https://sys.4chan.org/#{data.board}/post" + url = data.postURL # Do not append these values to the form. - delete data.board + delete data.postURL # File with filename upload fix from desuwa if engine is 'gecko' and data.upfile @@ -1722,8 +1722,8 @@ qr = i-- else toBin data, name, val - data.board = url.split('/')[3] - data.binary = true + data.postURL = url + data.binary = true return delete data.binary