mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
minor changes
This commit is contained in:
parent
3f804bfc99
commit
c2b08f1f6d
2 changed files with 33 additions and 22 deletions
17
client.js
17
client.js
|
|
@ -1051,26 +1051,27 @@ CloudClient.baseInit = (function(){
|
|||
if(lTitle.length > 0)
|
||||
lTitle[0].textContent = 'Cloud Commander';
|
||||
|
||||
/* загружаем общие функции для клиента и сервера*/
|
||||
/* загружаем общие функции для клиента и сервера */
|
||||
Util.jsload(CloudClient.LIBDIR+'cloudfunc.js',function(){
|
||||
/* берём из обьекта window общий с сервером функционал */
|
||||
/* берём из обьекта window общий с сервером функционал */
|
||||
CloudFunc=window.CloudFunc;
|
||||
|
||||
/* меняем ссылки на ajax'овые*/
|
||||
/* меняем ссылки на ajax'овые */
|
||||
CloudClient._changeLinks(CloudFunc.LEFTPANEL);
|
||||
CloudClient._changeLinks(CloudFunc.RIGHTPANEL);
|
||||
|
||||
/* устанавливаем переменную доступности кэша*/
|
||||
/* устанавливаем переменную доступности кэша */
|
||||
CloudClient.Cache.isAllowed();
|
||||
/* Устанавливаем кэш корневого каталога */
|
||||
if(!CloudClient.Cache.get('/'))CloudClient.Cache.set('/',CloudClient._getJSONfromFileTable());
|
||||
/* Устанавливаем кэш корневого каталога */
|
||||
if(!CloudClient.Cache.get('/'))
|
||||
CloudClient.Cache.set('/', CloudClient._getJSONfromFileTable());
|
||||
});
|
||||
|
||||
/* устанавливаем размер высоты таблицы файлов
|
||||
* исходя из размеров разрешения экрана
|
||||
*/
|
||||
|
||||
/* выделяем строку с первым файлом */
|
||||
/* выделяем строку с первым файлом */
|
||||
var lFmHeader = getByClass('fm_header');
|
||||
if(lFmHeader && lFmHeader[0].nextSibling)
|
||||
Util.setCurrentFile(lFmHeader[0].nextSibling);
|
||||
|
|
@ -1080,7 +1081,7 @@ CloudClient.baseInit = (function(){
|
|||
if(lFM)
|
||||
lFM.className='localstorage';
|
||||
|
||||
/* если есть js - показываем правую панель*/
|
||||
/* если есть js - показываем правую панель */
|
||||
var lRight=getById('right');
|
||||
if(lRight)
|
||||
lRight.className = lRight.className.replace('hidden','');
|
||||
|
|
|
|||
|
|
@ -93,16 +93,19 @@ var CloudCommander, CloudFunc, $;
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
FancyBox.loadData = (function(pA){
|
||||
/* function loads data an put it to pSuccess_f
|
||||
* @pA - link to data
|
||||
* @pSucces_f - function, thet process data (@data)
|
||||
*
|
||||
* Example: loadData('index.html', function(pData){console.log(pData)});
|
||||
*/
|
||||
FancyBox.loadData = (function(pA, pSuccess_f){
|
||||
Util.Images.showLoad();
|
||||
|
||||
var lThis = this;
|
||||
var lConfig = this.getConfig();
|
||||
|
||||
var lThis = this;
|
||||
var lLink = pA.href;
|
||||
|
||||
/* убираем адрес хоста*/
|
||||
/* убираем адрес хоста */
|
||||
lLink = '/' + lLink.replace(document.location.href,'');
|
||||
|
||||
if (lLink.indexOf(CloudFunc.NOJS) === CloudFunc.FS.length)
|
||||
|
|
@ -116,17 +119,24 @@ var CloudCommander, CloudFunc, $;
|
|||
}),
|
||||
|
||||
success:function(data, textStatus, jqXHR){
|
||||
/* if we got json - show it */
|
||||
if(typeof data === 'object')
|
||||
data = JSON.stringify(data, null, 4);
|
||||
|
||||
$.fancybox('<div id=CloudViewer tabindex=0>' + data + '</div>', lConfig);
|
||||
|
||||
if(typeof pSuccess_f === 'function')
|
||||
pSuccess_f(data);
|
||||
|
||||
Util.Images.hideLoad();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
FancyBox.onDataLoaded = (function(pData){
|
||||
var lConfig = FancyBox.getConfig();
|
||||
|
||||
/* if we got json - show it */
|
||||
if(typeof pData === 'object')
|
||||
pData = JSON.stringify(pData, null, 4);
|
||||
|
||||
$.fancybox('<div id=CloudViewer tabindex=0>' + pData + '</div>', lConfig);
|
||||
});
|
||||
|
||||
|
||||
FancyBox.set = (function(){
|
||||
if(Util.getByClass('fancybox').length)
|
||||
|
|
@ -147,7 +157,7 @@ var CloudCommander, CloudFunc, $;
|
|||
if(pA.rel)
|
||||
$.fancybox(lConfig);
|
||||
else
|
||||
lThis.loadData(pA);
|
||||
lThis.loadData(pA, lThis.onDataLoaded);
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -180,7 +190,7 @@ var CloudCommander, CloudFunc, $;
|
|||
if(lA.rel)
|
||||
$.fancybox.open({ href : lA.href },
|
||||
lConfig);
|
||||
else this.loadData(lA);
|
||||
else this.loadData(lA, this.onDataLoaded);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue