From 16d4fc6c46a7c6c98a4c5cab78a1b0f0339a0ef0 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 22 Jan 2014 11:20:02 -0500 Subject: [PATCH] refactor(cloudfunc) LEFT_PANEL -> PANEL_LEFT --- cloudcmd.js | 4 ++-- lib/client.js | 20 +++++++++----------- lib/cloudfunc.js | 4 ++-- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/cloudcmd.js b/cloudcmd.js index 3483dd59..4de24be7 100644 --- a/cloudcmd.js +++ b/cloudcmd.js @@ -270,8 +270,8 @@ var lPanel, lList, config = main.config, minify = config.minify, - LEFT = CloudFunc.LEFT_PANEL, - RIGHT = CloudFunc.RIGHT_PANEL; + LEFT = CloudFunc.PANEL_LEFT, + RIGHT = CloudFunc.PANEL_RIGHT; if (error) main.sendError(p, error); diff --git a/lib/client.js b/lib/client.js index d517e335..b055f038 100644 --- a/lib/client.js +++ b/lib/client.js @@ -11,6 +11,7 @@ var Util, DOM, CloudFunc; function CloudCmdProto(Util, DOM, CloudFunc) { var Key, Config, Modules, Extensions, FileTemplate, PathTemplate, LinkTemplate, Listeners, + Info = DOM.CurrentInfo, CloudCmd = this, Storage = DOM.Storage; @@ -233,8 +234,8 @@ var Util, DOM, CloudFunc; var LIB = CloudCmd.LIBDIR, LIBCLIENT = CloudCmd.LIBDIRCLIENT, files = DOM.getFiles(), - LEFT = CloudFunc.LEFT_PANEL, - RIGHT = CloudFunc.RIGHT_PANEL; + LEFT = CloudFunc.PANEL_LEFT, + RIGHT = CloudFunc.PANEL_RIGHT; /* выделяем строку с первым файлом */ if (files) @@ -458,25 +459,23 @@ var Util, DOM, CloudFunc; */ function getJSONfromFileTable() { var current, name, size, owner, mode, ret, - LEFT = CloudFunc.LEFT_PANEL, - left = DOM.getById(LEFT), path = DOM.getCurrentDirPath(), + infoFiles = Info.files, - fileTable = { + fileTable = { path : path, files : [] }, files = fileTable.files, - li = DOM.getByTag('li', left), - i, n = li.length; + i, n = infoFiles.length; for (i = 0; i < n; i++) { - current = li[i]; + current = infoFiles[i]; name = DOM.getCurrentName(current); size = DOM.getCurrentSize(current); - owner = DOM.getCurrentOwner(current); + owner = DOM.getCurrentOwner(current); mode = DOM.getCurrentMode(current); mode = CloudFunc.getNumericPermissions(mode); @@ -496,8 +495,7 @@ var Util, DOM, CloudFunc; } this.goToParentDir = function() { - var Info = DOM.CurrentInfo, - path = Info.dirPath, + var path = Info.dirPath, parentPath = Info.parentDirPath; if (path !== parentPath) { diff --git a/lib/cloudfunc.js b/lib/cloudfunc.js index 5b0702eb..471694ab 100644 --- a/lib/cloudfunc.js +++ b/lib/cloudfunc.js @@ -46,8 +46,8 @@ var Util; this.REFRESHICON = 'refresh-icon'; /* id панелей с файлами */ - this.LEFT_PANEL = 'js-left'; - this.RIGHT_PANEL = 'js-right'; + this.PANEL_LEFT = 'js-left'; + this.PANEL_RIGHT = 'js-right'; this.getJoinURL = function(names) { var url, isContain,