mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-28 10:14:13 +00:00
fixed bug with reading folder with no access
This commit is contained in:
parent
c3b231a8c5
commit
fd3838f5ec
8 changed files with 93 additions and 64 deletions
|
|
@ -46,7 +46,7 @@ var CloudCommander, Util,
|
|||
DOM.Images.showLoad();
|
||||
sendRequest({
|
||||
method : 'DELETE',
|
||||
url : pUrl,
|
||||
url : CloudFunc.FS + pUrl,
|
||||
callback : pCallBack
|
||||
});
|
||||
};
|
||||
|
|
@ -54,12 +54,20 @@ var CloudCommander, Util,
|
|||
this.save = function(pUrl, pData, pCallBack){
|
||||
sendRequest({
|
||||
method : 'PUT',
|
||||
url : pUrl,
|
||||
url : CloudFunc.FS + pUrl,
|
||||
data : pData,
|
||||
callback : pCallBack
|
||||
});
|
||||
};
|
||||
|
||||
this.read = function(pUrl, pCallBack){
|
||||
sendRequest({
|
||||
method : 'GET',
|
||||
url : CloudFunc.FS + pUrl,
|
||||
callback : pCallBack
|
||||
});
|
||||
};
|
||||
|
||||
this.mv = function(pData, pCallBack){
|
||||
sendRequest({
|
||||
method : 'PUT',
|
||||
|
|
@ -79,8 +87,10 @@ var CloudCommander, Util,
|
|||
if( Util.isString(p.url) )
|
||||
p.url = decodeURI(p.url);
|
||||
|
||||
if(p.data)
|
||||
if( p.data && !Util.isString(p.data))
|
||||
lData = Util.stringifyJSON(p.data);
|
||||
else
|
||||
lData = p.data;
|
||||
|
||||
p.url = pConfig && pConfig.api_url + p.url,
|
||||
DOM.ajax({
|
||||
|
|
@ -91,7 +101,7 @@ var CloudCommander, Util,
|
|||
success : function(pData){
|
||||
DOM.Images.hideLoad();
|
||||
Util.log(pData);
|
||||
Util.exec(p.callback);
|
||||
Util.exec(p.callback, pData);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -1002,7 +1012,7 @@ var CloudCommander, Util,
|
|||
lPath += '?json';
|
||||
|
||||
if(!lParams.url)
|
||||
lParams.url = lPath;
|
||||
lParams.url = CloudFunc.FS + lPath;
|
||||
|
||||
lRet = DOM.ajax(lParams);
|
||||
|
||||
|
|
@ -1186,7 +1196,7 @@ var CloudCommander, Util,
|
|||
var lCurrent = pCurrentFile || DOM.getCurrentFile(),
|
||||
lPath = DOM.getCurrentLink( lCurrent ).href;
|
||||
/* убираем адрес хоста*/
|
||||
lPath = Util.removeStr(lPath, CloudCommander.HOST);
|
||||
lPath = Util.removeStr( lPath, [CloudCommander.HOST, CloudFunc.FS] );
|
||||
|
||||
return lPath;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -159,7 +159,9 @@ var CloudCommander, Util, DOM, $;
|
|||
lMenuItems = {
|
||||
'View' : Util.retExec(showEditor, true),
|
||||
'Edit' : Util.retExec(showEditor, false),
|
||||
'Rename' : DOM.renameCurrentFile,
|
||||
'Rename' : function(){
|
||||
setTimeout( Util.retExec(DOM.renameCurrentFile), 100);
|
||||
},
|
||||
'Delete' : Util.retExec(DOM.promptDeleteCurrent),
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue