use $.formData

This commit is contained in:
James Campos 2012-06-13 06:17:35 -07:00
parent e718579e04
commit c383397b19
2 changed files with 12 additions and 9 deletions

View File

@ -3437,7 +3437,7 @@
return $.on(a, 'click', DeleteButton["delete"]); return $.on(a, 'click', DeleteButton["delete"]);
}, },
"delete": function() { "delete": function() {
var board, form, id, m, pwd, self; var board, form, id, m, o, pwd, self;
$.off(this, 'click', DeleteButton["delete"]); $.off(this, 'click', DeleteButton["delete"]);
this.textContent = 'Deleting...'; this.textContent = 'Deleting...';
if (m = d.cookie.match(/4chan_pass=([^;]+)/)) { if (m = d.cookie.match(/4chan_pass=([^;]+)/)) {
@ -3448,10 +3448,12 @@
id = $.x('preceding-sibling::input', this).name; id = $.x('preceding-sibling::input', this).name;
board = $.x('preceding-sibling::span[1]/a', this).pathname.match(/\w+/)[0]; board = $.x('preceding-sibling::span[1]/a', this).pathname.match(/\w+/)[0];
self = this; self = this;
form = new FormData(); o = {
form.append(id, 'delete'); mode: 'usrdel',
form.append('mode', 'usrdel'); pwd: pwd
form.append('pwd', pwd); };
o[id] = 'delete';
form = $.formData(o);
return $.ajax("https://sys.4chan.org/" + board + "/imgboard.php", { return $.ajax("https://sys.4chan.org/" + board + "/imgboard.php", {
onload: function() { onload: function() {
return DeleteButton.load(self, this.response); return DeleteButton.load(self, this.response);

View File

@ -2634,10 +2634,11 @@ DeleteButton =
board = $.x('preceding-sibling::span[1]/a', @).pathname.match(/\w+/)[0] board = $.x('preceding-sibling::span[1]/a', @).pathname.match(/\w+/)[0]
self = this self = this
form = new FormData() o =
form.append id, 'delete' mode: 'usrdel'
form.append 'mode', 'usrdel' pwd: pwd
form.append 'pwd', pwd o[id] = 'delete'
form = $.formData o
$.ajax "https://sys.4chan.org/#{board}/imgboard.php", { $.ajax "https://sys.4chan.org/#{board}/imgboard.php", {
onload: -> DeleteButton.load self, @response onload: -> DeleteButton.load self, @response