Get the XHR post url dynamically.
This commit is contained in:
parent
b6a0ccd8dd
commit
e28c668fc5
@ -1885,7 +1885,7 @@
|
|||||||
Watcher.watch(threadID);
|
Watcher.watch(threadID);
|
||||||
}
|
}
|
||||||
post = {
|
post = {
|
||||||
board: g.BOARD,
|
postURL: $('form[name=post]').action,
|
||||||
resto: threadID,
|
resto: threadID,
|
||||||
name: reply.name,
|
name: reply.name,
|
||||||
email: reply.email,
|
email: reply.email,
|
||||||
@ -2020,8 +2020,8 @@
|
|||||||
},
|
},
|
||||||
post: function(data) {
|
post: function(data) {
|
||||||
var boundary, callbacks, form, i, name, opts, parts, toBin, url, val;
|
var boundary, callbacks, form, i, name, opts, parts, toBin, url, val;
|
||||||
url = "https://sys.4chan.org/" + data.board + "/post";
|
url = data.postURL;
|
||||||
delete data.board;
|
delete data.postURL;
|
||||||
if (engine === 'gecko' && data.upfile) {
|
if (engine === 'gecko' && data.upfile) {
|
||||||
if (!data.binary) {
|
if (!data.binary) {
|
||||||
toBin = function(data, name, val) {
|
toBin = function(data, name, val) {
|
||||||
@ -2050,7 +2050,7 @@
|
|||||||
toBin(data, name, val);
|
toBin(data, name, val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data.board = url.split('/')[3];
|
data.postURL = url;
|
||||||
data.binary = true;
|
data.binary = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1563,7 +1563,7 @@ qr =
|
|||||||
Watcher.watch threadID
|
Watcher.watch threadID
|
||||||
|
|
||||||
post =
|
post =
|
||||||
board: g.BOARD
|
postURL: $('form[name=post]').action
|
||||||
resto: threadID
|
resto: threadID
|
||||||
name: reply.name
|
name: reply.name
|
||||||
email: reply.email
|
email: reply.email
|
||||||
@ -1694,9 +1694,9 @@ qr =
|
|||||||
|
|
||||||
post: (data) ->
|
post: (data) ->
|
||||||
|
|
||||||
url = "https://sys.4chan.org/#{data.board}/post"
|
url = data.postURL
|
||||||
# Do not append these values to the form.
|
# Do not append these values to the form.
|
||||||
delete data.board
|
delete data.postURL
|
||||||
|
|
||||||
# File with filename upload fix from desuwa
|
# File with filename upload fix from desuwa
|
||||||
if engine is 'gecko' and data.upfile
|
if engine is 'gecko' and data.upfile
|
||||||
@ -1722,8 +1722,8 @@ qr =
|
|||||||
i--
|
i--
|
||||||
else
|
else
|
||||||
toBin data, name, val
|
toBin data, name, val
|
||||||
data.board = url.split('/')[3]
|
data.postURL = url
|
||||||
data.binary = true
|
data.binary = true
|
||||||
return
|
return
|
||||||
|
|
||||||
delete data.binary
|
delete data.binary
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user