mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
added ability not to change url if we have no rights for reading
This commit is contained in:
parent
f43bb8ed42
commit
044cca53c1
4 changed files with 17 additions and 12 deletions
|
|
@ -148,6 +148,9 @@ would not be supported anymore.
|
|||
|
||||
* Added ability to add ?json flag only if we work with dir.
|
||||
|
||||
* Added ability not to change url if we have no rights
|
||||
for reading.
|
||||
|
||||
|
||||
2012.12.12, Version 0.1.8
|
||||
|
||||
|
|
|
|||
10
cloudcmd.js
10
cloudcmd.js
|
|
@ -192,16 +192,12 @@
|
|||
lRet = main.sendFile( pParams );
|
||||
}
|
||||
else if( Util.isContainStr(p.name, FS) || Util.strCmp( p.name, '/') ){
|
||||
var lQuery = main.getQuery(p.request);
|
||||
var lQuery = main.getQuery(p.request),
|
||||
lName = Minify.allowed.html ?
|
||||
Minify.getName(INDEX) : INDEX;
|
||||
|
||||
if( !lQuery )
|
||||
p.request.url += '?html';
|
||||
else if(lQuery === '?download')
|
||||
lQuery += '&&html';
|
||||
|
||||
|
||||
var lName = Minify.allowed.html ?
|
||||
Minify.getName(INDEX) : INDEX;
|
||||
|
||||
lRet = main.commander.sendContent({
|
||||
request : p.request,
|
||||
|
|
|
|||
|
|
@ -532,11 +532,12 @@ CloudCmd._ajaxLoad = function(pPath, pOptions){
|
|||
|
||||
var lFSPath = decodeURI(pPath),
|
||||
lNOJSPath = Util.removeStr( lFSPath, '?json' ),
|
||||
lCleanPath = Util.removeStr( lNOJSPath, CloudFunc.FS ) || '/';
|
||||
lCleanPath = Util.removeStr( lNOJSPath, CloudFunc.FS ) || '/',
|
||||
|
||||
lOldURL = window.location.pathname;
|
||||
|
||||
Util.log ('reading dir: "' + lCleanPath + '";');
|
||||
|
||||
|
||||
if(!pOptions.nohistory){
|
||||
lNOJSPath = lCleanPath === '/' ? '/' : lNOJSPath;
|
||||
DOM.setHistory(lNOJSPath, null, lNOJSPath);
|
||||
|
|
@ -569,6 +570,11 @@ CloudCmd._ajaxLoad = function(pPath, pOptions){
|
|||
if(lRet)
|
||||
DOM.getCurrentFileContent({
|
||||
url : lFSPath,
|
||||
|
||||
error : function(){
|
||||
DOM.setHistory(lOldURL, null, lOldURL);
|
||||
},
|
||||
|
||||
success : function(pData){
|
||||
CloudCmd._createFileTable(lPanel, pData, true);
|
||||
CloudCmd._changeLinks(lPanel);
|
||||
|
|
|
|||
|
|
@ -585,8 +585,8 @@ var CloudCommander, Util,
|
|||
*/
|
||||
|
||||
var lLoad = function(pEvent){
|
||||
DOM.removeListener('load', lLoad, false, lElement);
|
||||
DOM.removeListener('error', lError, false, lElement);
|
||||
DOM.removeListener('load', lLoad, lElement);
|
||||
DOM.removeListener('error', lError, lElement);
|
||||
|
||||
Util.exec(lFunc, pEvent);
|
||||
},
|
||||
|
|
@ -605,7 +605,7 @@ var CloudCommander, Util,
|
|||
};
|
||||
|
||||
DOM.addListener('load', lLoad, lElement);
|
||||
DOM.addErrorListener(lError,lElement);
|
||||
DOM.addErrorListener(lError, lElement);
|
||||
|
||||
if(lStyle)
|
||||
lElement.style.cssText = lStyle;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue