diff --git a/lib/client.js b/lib/client.js index c9a948a7..beafe97c 100644 --- a/lib/client.js +++ b/lib/client.js @@ -321,8 +321,7 @@ var Util, DOM, CloudFunc; */ function ajaxLoad(path, options, panel) { var SLASH = '/', - fsPath = decodeURI(path), - cleanPath = Util.rmStrOnce(fsPath, CloudFunc.FS) || SLASH; + cleanPath = Util.rmStrOnce(path, CloudFunc.FS) || SLASH; if (!options) options = {}; diff --git a/lib/client/dom.js b/lib/client/dom.js index 42f6ec99..af209efc 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1101,14 +1101,10 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; * @param currentFile - current file by default */ this.getCurrentPath = function(currentFile) { - var current = currentFile || this.getCurrentFile(), - lPath = this.getCurrentLink( current ).href; + var name = this.getCurrentName(currentFile), + path = this.getCurrentDirPath(); - lPath = decodeURI(lPath); - /* убираем адрес хоста*/ - lPath = Util.rmStrOnce(lPath, [CloudCmd.HOST, CloudFunc.FS]); - - return lPath; + return path + name; }; /** diff --git a/lib/client/key.js b/lib/client/key.js index 4be46251..de78738d 100644 --- a/lib/client/key.js +++ b/lib/client/key.js @@ -371,7 +371,9 @@ var CloudCmd, Util, DOM; /* открываем папку*/ case Key.ENTER: if (Info.isDir) - CloudCmd.loadDir(); + CloudCmd.loadDir({ + path: DOM.getCurrentPath() + }); break; case Key.BACKSPACE: diff --git a/lib/client/listeners.js b/lib/client/listeners.js index b362f934..bffd9279 100644 --- a/lib/client/listeners.js +++ b/lib/client/listeners.js @@ -107,6 +107,12 @@ var Util, DOM, CloudCmd; url = CloudCmd.HOST; href = element.href; link = Util.rmStr(href, url); + /* + * browser do not replace % -> %25% + * do it for him + */ + link = Util.replaceStr(link, '%%', '%25%'); + link = decodeURI(link); CloudCmd.loadDir({ path : link, @@ -159,7 +165,9 @@ var Util, DOM, CloudCmd; isDir = DOM.isCurrentIsDir(current); if (isDir) { - CloudCmd.loadDir(); + CloudCmd.loadDir({ + path: DOM.getCurrentPath() + }); Events.preventDefault(event); } } diff --git a/lib/client/rest.js b/lib/client/rest.js index 7e5ec26c..90386caa 100644 --- a/lib/client/rest.js +++ b/lib/client/rest.js @@ -145,10 +145,8 @@ var Util, DOM, CloudFunc; var p = params, apiURL = CloudFunc.apiURL; - if (Util.isString(p.url)) - p.url = decodeURI(p.url); - - p.url = apiURL + p.url; + p.url = apiURL + p.url; + p.url = encodeURI(p.url); DOM.load.ajax({ method : p.method,