Add asyncRunner in the periodic callbacks
This commit is contained in:
parent
5b1b97a161
commit
9553b28132
@ -350,7 +350,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="control-group modal-publish-gdrive">
|
<div class="control-group modal-publish-gdrive">
|
||||||
<div class="controls muted">
|
<div class="controls muted">
|
||||||
If no filename is supplied, the document title will be used.
|
If no file name is supplied, the document title will be used.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -142,6 +142,8 @@ define([ "core", "underscore" ], function(core) {
|
|||||||
// Use defer to avoid stack overflow
|
// Use defer to avoid stack overflow
|
||||||
_.defer(runTask);
|
_.defer(runTask);
|
||||||
};
|
};
|
||||||
|
// Run runTask function periodically
|
||||||
|
core.addPeriodicCallback(asyncRunner.runTask);
|
||||||
|
|
||||||
function runSafe(task, callbacks, param) {
|
function runSafe(task, callbacks, param) {
|
||||||
try {
|
try {
|
||||||
|
2
js/main-min.js
vendored
2
js/main-min.js
vendored
File diff suppressed because one or more lines are too long
@ -35,6 +35,8 @@ define(["jquery", "core", "github-provider", "blogger-provider", "dropbox-provid
|
|||||||
$(".action-force-publish").removeClass("disabled");
|
$(".action-force-publish").removeClass("disabled");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
// Run updatePublishButton function on online/offline event
|
||||||
|
core.addOfflineListener(publisher.updatePublishButton);
|
||||||
|
|
||||||
// Apply template to the current document
|
// Apply template to the current document
|
||||||
publisher.applyTemplate = function(publishAttributes) {
|
publisher.applyTemplate = function(publishAttributes) {
|
||||||
@ -204,8 +206,6 @@ define(["jquery", "core", "github-provider", "blogger-provider", "dropbox-provid
|
|||||||
};
|
};
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
core.addOfflineListener(publisher.updatePublishButton);
|
|
||||||
|
|
||||||
// Init each provider
|
// Init each provider
|
||||||
_.each(providerMap, function(provider) {
|
_.each(providerMap, function(provider) {
|
||||||
// Publish provider button
|
// Publish provider button
|
||||||
|
@ -28,6 +28,8 @@ define(["jquery", "core", "dropbox-provider", "gdrive-provider", "underscore"],
|
|||||||
$(".action-force-sync").removeClass("disabled");
|
$(".action-force-sync").removeClass("disabled");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
// Run updateSyncButton on online/offline event
|
||||||
|
core.addOfflineListener(synchronizer.updateSyncButton);
|
||||||
|
|
||||||
// Force the synchronization
|
// Force the synchronization
|
||||||
synchronizer.forceSync = function() {
|
synchronizer.forceSync = function() {
|
||||||
@ -181,6 +183,8 @@ define(["jquery", "core", "dropbox-provider", "gdrive-provider", "underscore"],
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// Run sync function periodically
|
||||||
|
core.addPeriodicCallback(synchronizer.sync);
|
||||||
|
|
||||||
// Used to populate the "Manage synchronization" dialog
|
// Used to populate the "Manage synchronization" dialog
|
||||||
var lineTemplate = ['<div class="input-prepend input-append">',
|
var lineTemplate = ['<div class="input-prepend input-append">',
|
||||||
@ -233,9 +237,6 @@ define(["jquery", "core", "dropbox-provider", "gdrive-provider", "underscore"],
|
|||||||
};
|
};
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
core.addOfflineListener(synchronizer.updateSyncButton);
|
|
||||||
core.addPeriodicCallback(synchronizer.sync);
|
|
||||||
|
|
||||||
// Init each provider
|
// Init each provider
|
||||||
_.each(providerMap, function(provider) {
|
_.each(providerMap, function(provider) {
|
||||||
// Provider's import button
|
// Provider's import button
|
||||||
|
Loading…
Reference in New Issue
Block a user