From 9e3d8e2bf63c79fee9a57d4d66fcc049fcdedc3f Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 4 Dec 2013 14:27:17 +0000 Subject: [PATCH] chore(cloudfunc) bildFromJSON: add " " --- lib/cloudfunc.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/cloudfunc.js b/lib/cloudfunc.js index ca1ce3f8..e7ed47b0 100644 --- a/lib/cloudfunc.js +++ b/lib/cloudfunc.js @@ -318,29 +318,29 @@ var Util; * {name:'имя',size:'размер',mode:'права доступа'}] */ this.buildFromJSON = function(pJSON, pTemplate, pPathTemplate) { - var lFile, type, link, target, size, owner, mode, - files = pJSON.files, + var lFile, i, n, type, link, target, size, owner, mode, + files = pJSON.files, /* сохраняем путь каталога в котором мы сейчас находимся*/ - lPath = pJSON.path, + lPath = pJSON.path, /* * Строим путь каталога в котором мы находимся * со всеми подкаталогами */ - lHtmlPath = CloudFunc._getDirPath(lPath), + lHtmlPath = CloudFunc._getDirPath(lPath), /* Убираем последний слэш * с пути для кнопки обновить страницу * если он есть */ - lRefreshPath = CloudFunc.removeLastSlash(lPath), + lRefreshPath = CloudFunc.removeLastSlash(lPath), - lFileTable = Util.render(pPathTemplate, { + lFileTable = Util.render(pPathTemplate, { link: FS + lRefreshPath, path: lHtmlPath }); - lFileTable += Util.render(pTemplate, { + lFileTable += Util.render(pTemplate, { type : '', link : '', target : '', @@ -351,10 +351,10 @@ var Util; }); /* сохраняем путь */ - CloudFunc.Path = lPath; + CloudFunc.Path = lPath; /* Если мы не в корне */ - if(lPath !== '/') { + if (lPath !== '/') { /* ссылка на верхний каталог*/ var lDotDot, lLink; /* убираем последний слеш и каталог в котором мы сейчас находимся*/ @@ -378,7 +378,8 @@ var Util; }); } - for(var i = 0, n = files.length; i < n; i++) { + n = files.length; + for (i = 0; i < n; i++) { lFile = files[i]; type = lFile.size === 'dir' ? 'directory' : 'text-file'; link = FS + lPath + lFile.name;