feature(client) mv cloudfunc, listeners to index

This commit is contained in:
coderaiser 2013-11-28 14:56:43 +00:00
parent 25473fdb51
commit 1cfab411e2
2 changed files with 66 additions and 25 deletions

View file

@ -28,6 +28,50 @@
<button id=f10 class=cmd-button>F10 - config</button>
<button id=~ class=cmd-button>~ - console</button>
</div>
<script async src=/combine/lib/client.js:lib/client/dom.js:lib/util.js></script>
<script>
(function() {
'use strict';
var script,
files = [
'lib/client/listeners.js',
'lib/client.js',
'lib/client/dom.js',
'lib/cloudfunc.js',
'lib/util.js'
],
url = getCombineURL(files);
window.addEventListener('load', createScript);
function createScript() {
script = document.createElement('script');
script.src = url;
script.async = true;
script.addEventListener('load', scriptLoad);
document.body.appendChild(script);
window.removeEventListener('load', createScript);
}
function getCombineURL(files) {
var i,
url = '/combine/',
n = files.length;
for (i = 0; i < n-1; i++) {
url += files[i] + ':';
}
url += files[i];
return url;
}
function scriptLoad() {
CloudCmd.init();
script.removeEventListener('load', scriptLoad);
}
})();
</script>
</body>
</html>

View file

@ -247,30 +247,27 @@ var Util, DOM, CloudFunc, CloudCmd;
LIBCLIENT + 'listeners.js'
];
/* загружаем общие функции для клиента и сервера */
DOM.anyLoadInParallel(files, function() {
Listeners = CloudCmd.Listeners;
Listeners.init();
/* загружаем Google Analytics */
Listeners.analytics();
Listeners.changeLinks(CloudFunc.LEFTPANEL);
Listeners.changeLinks(CloudFunc.RIGHTPANEL);
CloudCmd.KeysPanel = Listeners.initKeysPanel();
CloudCmd.getConfig(function(config) {
var localStorage = config.localStorage;
/* устанавливаем переменную доступности кэша */
Storage.setAllowed(localStorage);
/* Устанавливаем кэш корневого каталога */
var lDirPath = DOM.getCurrentDirPath();
if (!Storage.get(lDirPath))
Storage.set(lDirPath, getJSONfromFileTable());
});
Util.exec(pCallBack);
});
Listeners = CloudCmd.Listeners;
Listeners.init();
/* загружаем Google Analytics */
Listeners.analytics();
Listeners.changeLinks(CloudFunc.LEFTPANEL);
Listeners.changeLinks(CloudFunc.RIGHTPANEL);
CloudCmd.KeysPanel = Listeners.initKeysPanel();
CloudCmd.getConfig(function(config) {
var localStorage = config.localStorage;
/* устанавливаем переменную доступности кэша */
Storage.setAllowed(localStorage);
/* Устанавливаем кэш корневого каталога */
var lDirPath = DOM.getCurrentDirPath();
if (!Storage.get(lDirPath))
Storage.set(lDirPath, getJSONfromFileTable());
});
Util.exec(pCallBack);
/* выделяем строку с первым файлом */
var lFmHeader = DOM.getByClass('fm-header');