mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
fix(cloudcmd) add ability work with % path
This commit is contained in:
parent
c06c77bf5e
commit
5f6ec6d9f3
5 changed files with 18 additions and 15 deletions
|
|
@ -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 = {};
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue