diff --git a/lib/cloudfunc.js b/lib/cloudfunc.js index 43f6f11a..71f420d1 100644 --- a/lib/cloudfunc.js +++ b/lib/cloudfunc.js @@ -13,6 +13,8 @@ var Util; function CloudFuncProto(Util) { var CloudFunc = this, + check = Util.check, + render = Util.render, FS; /* КОНСТАНТЫ (общие для клиента и сервера)*/ @@ -53,7 +55,7 @@ var Util; this.rmLastSlash = function(path) { var length, lastSlash, isEqual; - Util.check(arguments, ['path']) + check(arguments, ['path']) .type('path', path, 'string'); length = path.length - 1; @@ -86,7 +88,7 @@ var Util; pathHTML = '', path = '/'; - Util.check(arguments, ['url', 'template']); + check(arguments, ['url', 'template']); namesRaw = url.split('/') .slice(1, -1), @@ -108,7 +110,7 @@ var Util; if (index) slash = '/'; - pathHTML += Util.render(template, { + pathHTML += render(template, { path: path, name: name, slash: slash @@ -147,13 +149,13 @@ var Util; */ refreshPath = CloudFunc.rmLastSlash(path), - fileTable = Util.render(template.path, { + fileTable = render(template.path, { link : FS + refreshPath, fullPath : path, path : htmlPath }), - header = Util.render(templateFile, { + header = render(templateFile, { tag : 'div', attribute : '', className : 'fm-header', @@ -181,7 +183,7 @@ var Util; link = FS + dotDot; - linkResult = Util.render(template.link, { + linkResult = render(template.link, { link : link, name : '..' }); @@ -189,7 +191,7 @@ var Util; dataName = 'data-name="js-file-.." ', attribute = 'draggable="true" ' + dataName, /* Сохраняем путь к каталогу верхнего уровня*/ - fileTable += Util.render(template.file, { + fileTable += render(template.file, { tag : 'li', attribute : attribute, className : '', @@ -219,7 +221,7 @@ var Util; owner = file.owner || 'root'; mode = file.mode; - linkResult = Util.render(templateLink, { + linkResult = render(templateLink, { link : link, name : file.name, attribute : attribute @@ -228,7 +230,7 @@ var Util; dataName = 'data-name="js-file-' + file.name + '" '; attribute = 'draggable="true" ' + dataName; - fileTable += Util.render(templateFile, { + fileTable += render(templateFile, { tag : 'li', attribute : attribute, className : '',