Move the QR out of 4chanXInitFinished and into $.ready

This commit is contained in:
Zixaphir 2013-04-25 04:14:11 -07:00
parent c07d39a11f
commit 3ce9bc395f
5 changed files with 15 additions and 19 deletions

View File

@ -6892,7 +6892,7 @@
return $.addClass(doc, 'hide-original-post-form');
});
}
$.on(d, '4chanXInitFinished', this.initReady);
$.ready(this.initReady);
return Post.prototype.callbacks.push({
name: 'Quick Reply',
cb: this.node
@ -6901,7 +6901,6 @@
initReady: function() {
var link, title;
$.off(d, '4chanXInitFinished', QR.initReady);
QR.postingIsEnabled = !!$.id('postForm');
if (!QR.postingIsEnabled) {
return;
@ -9664,13 +9663,13 @@
softTask = function() {
var args, func, task;
if (!queue.length) {
return;
}
task = queue.shift();
func = task[0];
args = Array.prototype.slice.call(task, 1);
func.apply(func, args);
if (!queue.length) {
return;
}
if ((queue.length % 7) === 0) {
return setTimeout(softTask, 0);
} else {

View File

@ -6888,7 +6888,7 @@
return $.addClass(doc, 'hide-original-post-form');
});
}
$.on(d, '4chanXInitFinished', this.initReady);
$.ready(this.initReady);
return Post.prototype.callbacks.push({
name: 'Quick Reply',
cb: this.node
@ -6897,7 +6897,6 @@
initReady: function() {
var link, title;
$.off(d, '4chanXInitFinished', QR.initReady);
QR.postingIsEnabled = !!$.id('postForm');
if (!QR.postingIsEnabled) {
return;
@ -9687,13 +9686,13 @@
softTask = function() {
var args, func, task;
if (!queue.length) {
return;
}
task = queue.shift();
func = task[0];
args = Array.prototype.slice.call(task, 1);
func.apply(func, args);
if (!queue.length) {
return;
}
if ((queue.length % 7) === 0) {
return setTimeout(softTask, 0);
} else {

View File

@ -6757,7 +6757,7 @@
return $.addClass(doc, 'hide-original-post-form');
});
}
$.on(d, '4chanXInitFinished', this.initReady);
$.ready(this.initReady);
return Post.prototype.callbacks.push({
name: 'Quick Reply',
cb: this.node
@ -6766,7 +6766,6 @@
initReady: function() {
var link, title;
$.off(d, '4chanXInitFinished', QR.initReady);
QR.postingIsEnabled = !!$.id('postForm');
if (!QR.postingIsEnabled) {
return;
@ -9530,13 +9529,13 @@
softTask = function() {
var args, func, task;
if (!queue.length) {
return;
}
task = queue.shift();
func = task[0];
args = Array.prototype.slice.call(task, 1);
func.apply(func, args);
if (!queue.length) {
return;
}
if ((queue.length % 7) === 0) {
return setTimeout(softTask, 0);
} else {

View File

@ -24,14 +24,13 @@ QR =
if Conf['Hide Original Post Form']
$.asap (-> doc), -> $.addClass doc, 'hide-original-post-form'
$.on d, '4chanXInitFinished', @initReady
$.ready @initReady
Post::callbacks.push
name: 'Quick Reply'
cb: @node
initReady: ->
$.off d, '4chanXInitFinished', QR.initReady
QR.postingIsEnabled = !!$.id 'postForm'
return unless QR.postingIsEnabled

View File

@ -196,7 +196,7 @@ Main =
Main.callbackNodesDB Post, posts, ->
$.event '4chanXInitFinished'
Main.checkUpdate()
return
$.event '4chanXInitFinished'
@ -223,11 +223,11 @@ Main =
callbackNodesDB: (klass, nodes, cb) ->
queue = []
softTask = ->
return unless queue.length
task = queue.shift()
func = task[0]
args = Array::slice.call task, 1
func.apply func, args
return unless queue.length
if (queue.length % 7) is 0
setTimeout softTask, 0
else