mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
fix(client) disable localStorage
This commit is contained in:
parent
c458f926cb
commit
5cd04d0191
2 changed files with 28 additions and 22 deletions
|
|
@ -236,15 +236,17 @@ var Util, DOM, CloudFunc;
|
|||
}
|
||||
|
||||
function baseInit(callback) {
|
||||
var files = DOM.getFiles(),
|
||||
LEFT = CloudFunc.PANEL_LEFT,
|
||||
RIGHT = CloudFunc.PANEL_RIGHT;
|
||||
var dirPath = '',
|
||||
files = DOM.getFiles(),
|
||||
LEFT = CloudFunc.PANEL_LEFT,
|
||||
RIGHT = CloudFunc.PANEL_RIGHT;
|
||||
|
||||
/* выделяем строку с первым файлом */
|
||||
if (files)
|
||||
DOM.setCurrentFile(files[0]);
|
||||
|
||||
Listeners = CloudCmd.Listeners;
|
||||
|
||||
dirPath = DOM.getCurrentDirPath(),
|
||||
Listeners = CloudCmd.Listeners;
|
||||
Listeners.init();
|
||||
/* загружаем Google Analytics */
|
||||
Listeners.analytics();
|
||||
|
|
@ -254,22 +256,14 @@ var Util, DOM, CloudFunc;
|
|||
|
||||
Listeners.initKeysPanel();
|
||||
|
||||
Files.get('config', function(error, config) {
|
||||
var localStorage = config.localStorage,
|
||||
dirPath = DOM.getCurrentDirPath();
|
||||
|
||||
/* устанавливаем переменную доступности кэша */
|
||||
Storage.setAllowed(localStorage);
|
||||
/* Устанавливаем кэш корневого каталога */
|
||||
|
||||
dirPath = CloudFunc.rmLastSlash(dirPath) || '/';
|
||||
|
||||
Storage.get(dirPath, function(error, data) {
|
||||
if (!data) {
|
||||
data = getJSONfromFileTable();
|
||||
Storage.set(dirPath, data);
|
||||
}
|
||||
});
|
||||
/* Устанавливаем кэш корневого каталога */
|
||||
dirPath = CloudFunc.rmLastSlash(dirPath) || '/';
|
||||
|
||||
Storage.get(dirPath, function(error, data) {
|
||||
if (!data) {
|
||||
data = getJSONfromFileTable();
|
||||
Storage.set(dirPath, data);
|
||||
}
|
||||
});
|
||||
|
||||
callback();
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ var Util, DOM, Promise;
|
|||
|
||||
function FilesProto(Util, DOM) {
|
||||
var Promises = {},
|
||||
Storage = DOM.Storage,
|
||||
Files = this,
|
||||
FILES_JSON = 'config|modules|ext',
|
||||
FILES_HTML = 'file|path|link|pathLink|media',
|
||||
|
|
@ -59,6 +60,9 @@ var Util, DOM, Promise;
|
|||
callback(null);
|
||||
}
|
||||
|
||||
if (name === 'config')
|
||||
setConfig(data);
|
||||
|
||||
return Files;
|
||||
};
|
||||
|
||||
|
|
@ -138,11 +142,19 @@ var Util, DOM, Promise;
|
|||
});
|
||||
|
||||
Promises.config.then(function(data) {
|
||||
if (!Data.config)
|
||||
if (!Data.config) {
|
||||
Data.config = data;
|
||||
Storage.setAllowed(data.localStorage);
|
||||
}
|
||||
|
||||
callback(null, data);
|
||||
});
|
||||
}
|
||||
|
||||
function setConfig(config) {
|
||||
var isStorage = config.localStorage;
|
||||
|
||||
Storage.setAllowed(isStorage);
|
||||
}
|
||||
}
|
||||
})(Util, DOM);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue