From 38ef5ed257e676fed043868ea6b0ba68b2639b80 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Thu, 25 Apr 2013 06:23:06 -0700 Subject: [PATCH] Race conditions. --- builds/4chan-X.js | 8 ++++---- builds/4chan-X.user.js | 8 ++++---- builds/crx/script.js | 8 ++++---- src/features/posting/qr.coffee | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/builds/4chan-X.js b/builds/4chan-X.js index 7bc5931bc..3c5c570de 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -6918,6 +6918,9 @@ }); } $.ready(this.initReady); + if (Conf['Persistent QR']) { + $.on(d, '4chanXInitFinished', this.persist); + } return Post.prototype.callbacks.push({ name: 'Quick Reply', cb: this.node @@ -6963,16 +6966,13 @@ $.on(d, 'dragover', QR.dragOver); $.on(d, 'drop', QR.dropFile); $.on(d, 'dragstart dragend', QR.drag); - $.on(d, 'ThreadUpdate', function() { + return $.on(d, 'ThreadUpdate', function() { if (g.DEAD) { return QR.abort(); } else { return QR.status(); } }); - if (Conf['Persistent QR']) { - return QR.persist(); - } }, node: function() { return $.on($('a[title="Quote this post"]', this.nodes.info), 'click', QR.quote); diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 6d83aad06..aeb08e14b 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -6914,6 +6914,9 @@ }); } $.ready(this.initReady); + if (Conf['Persistent QR']) { + $.on(d, '4chanXInitFinished', this.persist); + } return Post.prototype.callbacks.push({ name: 'Quick Reply', cb: this.node @@ -6959,16 +6962,13 @@ $.on(d, 'dragover', QR.dragOver); $.on(d, 'drop', QR.dropFile); $.on(d, 'dragstart dragend', QR.drag); - $.on(d, 'ThreadUpdate', function() { + return $.on(d, 'ThreadUpdate', function() { if (g.DEAD) { return QR.abort(); } else { return QR.status(); } }); - if (Conf['Persistent QR']) { - return QR.persist(); - } }, node: function() { return $.on($('a[title="Quote this post"]', this.nodes.info), 'click', QR.quote); diff --git a/builds/crx/script.js b/builds/crx/script.js index d058c68ea..f32e0ab6d 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -6783,6 +6783,9 @@ }); } $.ready(this.initReady); + if (Conf['Persistent QR']) { + $.on(d, '4chanXInitFinished', this.persist); + } return Post.prototype.callbacks.push({ name: 'Quick Reply', cb: this.node @@ -6829,16 +6832,13 @@ $.on(d, 'dragover', QR.dragOver); $.on(d, 'drop', QR.dropFile); $.on(d, 'dragstart dragend', QR.drag); - $.on(d, 'ThreadUpdate', function() { + return $.on(d, 'ThreadUpdate', function() { if (g.DEAD) { return QR.abort(); } else { return QR.status(); } }); - if (Conf['Persistent QR']) { - return QR.persist(); - } }, node: function() { return $.on($('a[title="Quote this post"]', this.nodes.info), 'click', QR.quote); diff --git a/src/features/posting/qr.coffee b/src/features/posting/qr.coffee index da8ba92d5..c71e0dd52 100644 --- a/src/features/posting/qr.coffee +++ b/src/features/posting/qr.coffee @@ -25,6 +25,7 @@ QR = $.asap (-> doc), -> $.addClass doc, 'hide-original-post-form' $.ready @initReady + $.on d, '4chanXInitFinished', @persist if Conf['Persistent QR'] Post::callbacks.push name: 'Quick Reply' @@ -67,7 +68,6 @@ QR = else QR.status() - QR.persist() if Conf['Persistent QR'] node: -> $.on $('a[title="Quote this post"]', @nodes.info), 'click', QR.quote