This commit is contained in:
James Campos 2012-06-12 10:29:25 -07:00
parent 91efc92fe1
commit 82743a39dc
2 changed files with 11 additions and 12 deletions

View File

@ -3442,20 +3442,21 @@
this.textContent = 'Error: no password found';
return;
}
DeleteButton.el = this;
$.off(this, 'click', DeleteButton["delete"]);
this.textContent = 'Deleting...';
self = this;
id = $.x('preceding-sibling::input', this).name;
data = new FormData();
data.append(id, 'delete');
data.append('mode', 'usrdel');
data.append('pwd', pwd);
self = this;
return $.ajax("https://sys.4chan.org/" + g.BOARD + "/imgboard.php", {
onload: function() {
return DeleteButton.load(self);
},
onerror: DeleteButton.error
onerror: function() {
return DeleteButton.error(self);
}
}, {
type: 'post',
form: data
@ -3474,8 +3475,8 @@
}
return self.textContent = tc;
},
error: function() {
return DeleteButton.el.textContent = 'Error';
error: function(self) {
return self.textContent = 'Error';
}
};

View File

@ -2625,20 +2625,18 @@ DeleteButton =
@textContent = 'Error: no password found'
return
DeleteButton.el = @
$.off @, 'click', DeleteButton.delete
@textContent = 'Deleting...'
self = this
id = $.x('preceding-sibling::input', @).name
data = new FormData()
data.append id, 'delete'
data.append 'mode', 'usrdel'
data.append 'pwd', pwd
self = this
$.ajax "https://sys.4chan.org/#{g.BOARD}/imgboard.php", {
onload: -> DeleteButton.load self
onerror: DeleteButton.error
onload: -> DeleteButton.load self
onerror: -> DeleteButton.error self
}, {
type: 'post'
form: data
@ -2653,8 +2651,8 @@ DeleteButton =
else
tc = 'Deleted'
self.textContent = tc
error: ->
DeleteButton.el.textContent = 'Error'
error: (self) ->
self.textContent = 'Error'
ReportButton =
init: ->