From 82743a39dc5e54b9c5472e99edfcab7bcba7468f Mon Sep 17 00:00:00 2001 From: James Campos Date: Tue, 12 Jun 2012 10:29:25 -0700 Subject: [PATCH] derp --- 4chan_x.user.js | 11 ++++++----- script.coffee | 12 +++++------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 2e76f00c9..acd016ecf 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -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'; } }; diff --git a/script.coffee b/script.coffee index 368417e70..9b2cd4d7e 100644 --- a/script.coffee +++ b/script.coffee @@ -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: ->