diff --git a/cloudcmd.js b/cloudcmd.js index 14c040e1..d36846c0 100644 --- a/cloudcmd.js +++ b/cloudcmd.js @@ -25,14 +25,15 @@ KEY = DIR + 'ssl/ssl.key', CERT = DIR + 'ssl/ssl.crt', - HTML_FS_DIR = HTMLDIR + 'fs/', - INDEX_PATH = HTML_FS_DIR + 'index.html', - FILE_TMPL = HTML_FS_DIR + 'file.html', - PANEL_TMPL = HTML_FS_DIR + 'panel.html', - PATH_TMPL = HTML_FS_DIR + 'path.html', - LINK_TMPL = HTML_FS_DIR + 'link.html', + HTML_FS_DIR = HTMLDIR + 'fs/', + INDEX_PATH = HTML_FS_DIR + 'index.html', + FILE_TMPL = HTML_FS_DIR + 'file.html', + PANEL_TMPL = HTML_FS_DIR + 'panel.html', + PATH_TMPL = HTML_FS_DIR + 'path.html', + PATH_LINK_TMPL = HTML_FS_DIR + 'path-link.html', + LINK_TMPL = HTML_FS_DIR + 'link.html', - FileTemplate, PanelTemplate, PathTemplate, LinkTemplate, + FileTemplate, PanelTemplate, PathTemplate, LinkTemplate, PathLinkTemplate, FS = CloudFunc.FS; /* reinit main dir os if we on Win32 should be backslashes */ @@ -162,10 +163,11 @@ } else { status = 'ok'; - FileTemplate = files[FILE_TMPL]; - PanelTemplate = files[PANEL_TMPL]; - PathTemplate = files[PATH_TMPL]; - LinkTemplate = files[LINK_TMPL]; + FileTemplate = files[FILE_TMPL]; + PanelTemplate = files[PANEL_TMPL]; + PathTemplate = files[PATH_TMPL]; + PathLinkTemplate = files[PATH_LINK_TMPL]; + LinkTemplate = files[LINK_TMPL]; if (Config.ssl) params.ssl = { @@ -278,9 +280,10 @@ panel = CloudFunc.buildFromJSON({ data: json, template: { - file: FileTemplate, - path: PathTemplate, - link: LinkTemplate + file : FileTemplate, + path : PathTemplate, + pathLinks : PathLinkTemplate, + link : LinkTemplate } }), diff --git a/html/fs/path-link.html b/html/fs/path-link.html new file mode 100644 index 00000000..304af188 --- /dev/null +++ b/html/fs/path-link.html @@ -0,0 +1 @@ +{{ name }}{{ slash }} \ No newline at end of file diff --git a/lib/client.js b/lib/client.js index e8582c44..0c2c304f 100644 --- a/lib/client.js +++ b/lib/client.js @@ -323,6 +323,7 @@ var Util, DOM, CloudFunc; this.getExt = getSystemFile(Extensions, DIR_JSON + 'ext.json'); this.getFileTemplate = getSystemFile(FileTemplate, DIR_HTML_FS + 'file.html'); this.getPathTemplate = getSystemFile(PathTemplate, DIR_HTML_FS + 'path.html'); + this.getPathLinkTemplate = getSystemFile(PathTemplate, DIR_HTML_FS + 'path-link.html'); this.getLinkTemplate = getSystemFile(PathTemplate, DIR_HTML_FS + 'link.html'); this.execFromModule = function(moduleName, funcName, params) { @@ -404,10 +405,11 @@ var Util, DOM, CloudFunc; funcs = [ CloudCmd.getFileTemplate, CloudCmd.getPathTemplate, + CloudCmd.getPathLinkTemplate, CloudCmd.getLinkTemplate ]; - Util.exec.parallel(funcs, function(templFile, templPath, templLink) { + Util.exec.parallel(funcs, function(templFile, templPath, templPathLink, templLink) { var n, found, varCurrent, varName, current, dir = DOM.getCurrentDirName(), name = DOM.getCurrentName(), @@ -420,9 +422,10 @@ var Util, DOM, CloudFunc; data : json, id : panel.id, template : { - file : templFile, - path : templPath, - link : templLink + file : templFile, + path : templPath, + pathLink : templPathLink, + link : templLink } }); diff --git a/lib/cloudfunc.js b/lib/cloudfunc.js index 1932d1b4..5eec4071 100644 --- a/lib/cloudfunc.js +++ b/lib/cloudfunc.js @@ -326,10 +326,9 @@ var Util; * возвращаеться массив каталогов * @param url - адрес каталога */ - function getPathLinks(url) { + function getPathLink(url, template) { var pathHTML = '', path = '/', - template = '{{ name }}{{ slash }}', namesRaw = url.split('/') .slice(1, -1), names = [].concat('/', namesRaw), @@ -382,7 +381,7 @@ var Util; * Строим путь каталога в котором мы находимся * со всеми подкаталогами */ - htmlPath = getPathLinks(path), + htmlPath = getPathLink(path, template.pathLink), /* Убираем последний слэш * с пути для кнопки обновить страницу