diff --git a/ChangeLog b/ChangeLog index 5eb6efe6..33597cb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/cloudcmd.js b/cloudcmd.js index 52edd352..adc14c4c 100644 --- a/cloudcmd.js +++ b/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, diff --git a/lib/client.js b/lib/client.js index ff652cab..f2f748f2 100644 --- a/lib/client.js +++ b/lib/client.js @@ -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); diff --git a/lib/client/dom.js b/lib/client/dom.js index bd586171..03695be4 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -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;