Fixed Google Drive actions
This commit is contained in:
parent
c6203e15d1
commit
663c62b162
@ -1 +1 @@
|
||||
CACHE MANIFEST
# v6
CACHE:
index.html
css/main-min.css
js/main-min.js
js/require.js
img/ajax-loader.gif
img/glyphicons-halflings.png
img/glyphicons-halflings-white.png
img/icons.png
img/stackedit-32.ico
img/stackedit-promo.png
NETWORK:
*
|
||||
CACHE MANIFEST
# v7
CACHE:
index.html
css/main-min.css
js/main-min.js
js/require.js
img/ajax-loader.gif
img/glyphicons-halflings.png
img/glyphicons-halflings-white.png
img/icons.png
img/stackedit-32.ico
img/stackedit-promo.png
NETWORK:
*
|
||||
|
25
js/core.js
25
js/core.js
@ -579,8 +579,33 @@ define(
|
||||
+ left);
|
||||
};
|
||||
|
||||
// Keep a reference to the fileManager
|
||||
core.setFileManager = function(fileManager) {
|
||||
core.fileManager = fileManager;
|
||||
runReadyCallbacks();
|
||||
};
|
||||
|
||||
// onReady event callbacks
|
||||
var readyCallbacks = [];
|
||||
core.onReady = function(callback) {
|
||||
readyCallbacks.push(callback);
|
||||
runReadyCallbacks();
|
||||
};
|
||||
var documentLoaded = false;
|
||||
function runReadyCallbacks() {
|
||||
if(documentLoaded === true && core.fileManager !== undefined) {
|
||||
_.each(readyCallbacks, function(callback) {
|
||||
callback();
|
||||
});
|
||||
readyCallbacks = [];
|
||||
}
|
||||
}
|
||||
$(function() {
|
||||
documentLoaded = true;
|
||||
runReadyCallbacks();
|
||||
});
|
||||
|
||||
core.onReady(function() {
|
||||
// jGrowl configuration
|
||||
$.jGrowl.defaults.life = 5000;
|
||||
$.jGrowl.defaults.closer = false;
|
||||
|
@ -2,8 +2,7 @@ define(["jquery", "core", "synchronizer", "publisher", "underscore"],
|
||||
function($, core, synchronizer, publisher) {
|
||||
|
||||
var fileManager = {};
|
||||
// To avoid circle inclusion
|
||||
core.fileManager = fileManager;
|
||||
core.setFileManager(fileManager);
|
||||
|
||||
// Defines the current file
|
||||
var currentFileIndex = localStorage["file.current"];
|
||||
@ -216,7 +215,7 @@ define(["jquery", "core", "synchronizer", "publisher", "underscore"],
|
||||
}).value();
|
||||
};
|
||||
|
||||
$(function() {
|
||||
core.onReady(function() {
|
||||
fileManager.selectFile();
|
||||
|
||||
$(".action-create-file").click(function() {
|
||||
|
@ -240,7 +240,7 @@ define(["jquery", "core", "google-helper", "underscore"], function($, core, goog
|
||||
return publishAttributes;
|
||||
};
|
||||
|
||||
$(function() {
|
||||
core.onReady(function() {
|
||||
var state = localStorage[PROVIDER_GDRIVE + ".state"];
|
||||
if(state === undefined) {
|
||||
return;
|
||||
|
2
js/main-min.js
vendored
2
js/main-min.js
vendored
File diff suppressed because one or more lines are too long
@ -205,7 +205,7 @@ define(["jquery", "core", "github-provider", "blogger-provider", "dropbox-provid
|
||||
});
|
||||
};
|
||||
|
||||
$(function() {
|
||||
core.onReady(function() {
|
||||
// Init each provider
|
||||
_.each(providerMap, function(provider) {
|
||||
// Publish provider button
|
||||
|
@ -236,7 +236,7 @@ define(["jquery", "core", "dropbox-provider", "gdrive-provider", "underscore"],
|
||||
return providerIdList;
|
||||
};
|
||||
|
||||
$(function() {
|
||||
core.onReady(function() {
|
||||
// Init each provider
|
||||
_.each(providerMap, function(provider) {
|
||||
// Provider's import button
|
||||
|
Loading…
Reference in New Issue
Block a user