mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
refactor(dom) lCurrent -> current
This commit is contained in:
parent
b8ee29db7a
commit
be97852e40
1 changed files with 14 additions and 14 deletions
|
|
@ -945,8 +945,8 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
*/
|
||||
this.getCurrentMode = function(currentFile) {
|
||||
var ret,
|
||||
lCurrent = currentFile || this.getCurrentFile(),
|
||||
lMode = this.getByClass('mode', lCurrent);
|
||||
current = currentFile || this.getCurrentFile(),
|
||||
lMode = this.getByClass('mode', current);
|
||||
ret = lMode.textContent;
|
||||
|
||||
return ret;
|
||||
|
|
@ -973,9 +973,9 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
*/
|
||||
this.getCurrentFileContent = function(pParams, currentFile) {
|
||||
var ret,
|
||||
lCurrentFile = currentFile ? currentFile : this.getCurrentFile(),
|
||||
currentFile = currentFile ? currentFile : this.getCurrentFile(),
|
||||
lParams = pParams ? pParams : {},
|
||||
lPath = this.getCurrentPath(lCurrentFile),
|
||||
lPath = this.getCurrentPath(currentFile),
|
||||
lErrorWas = pParams.error,
|
||||
lError = function(jqXHR) {
|
||||
Util.exec(lErrorWas);
|
||||
|
|
@ -988,7 +988,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
lParams.error = lError;
|
||||
|
||||
|
||||
if (this.isCurrentIsDir(lCurrentFile))
|
||||
if (this.isCurrentIsDir(currentFile))
|
||||
lPath += '?json';
|
||||
else if (!lParams.dataType)
|
||||
lParams.dataType = 'text';
|
||||
|
|
@ -1009,9 +1009,9 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
*/
|
||||
this.getCurrentData = function(callback, currentFile) {
|
||||
var hash,
|
||||
lCurrentFile = currentFile ? currentFile : Cmd.getCurrentFile(),
|
||||
path = DOM.getCurrentPath(lCurrentFile),
|
||||
isDir = DOM.isCurrentIsDir(lCurrentFile),
|
||||
currentFile = currentFile ? currentFile : Cmd.getCurrentFile(),
|
||||
path = DOM.getCurrentPath(currentFile),
|
||||
isDir = DOM.isCurrentIsDir(currentFile),
|
||||
|
||||
func = function(data) {
|
||||
var length,
|
||||
|
|
@ -1028,14 +1028,14 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
};
|
||||
|
||||
if (isDir)
|
||||
DOM.getCurrentFileContent(func, lCurrentFile);
|
||||
DOM.getCurrentFileContent(func, currentFile);
|
||||
else
|
||||
DOM.checkStorageHash(path, function(error, equal, hashNew) {
|
||||
Util.ifExec(!error && equal, function() {
|
||||
DOM.getDataFromStorage(path, callback);
|
||||
}, function() {
|
||||
hash = hashNew;
|
||||
DOM.getCurrentFileContent(func, lCurrentFile);
|
||||
DOM.getCurrentFileContent(func, currentFile);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
@ -1314,8 +1314,8 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
* @param currentFile
|
||||
*/
|
||||
this.isCurrentIsDir = function(currentFile) {
|
||||
var lCurrent = currentFile || this.getCurrentFile(),
|
||||
lFileType = this.getByClass('mini-icon', lCurrent),
|
||||
var current = currentFile || this.getCurrentFile(),
|
||||
lFileType = this.getByClass('mini-icon', current),
|
||||
ret = this.isContainClass(lFileType, 'directory');
|
||||
|
||||
return ret;
|
||||
|
|
@ -1341,8 +1341,8 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
* @param currentFile - current file by default
|
||||
*/
|
||||
this.getCurrentPath = function(currentFile) {
|
||||
var lCurrent = currentFile || this.getCurrentFile(),
|
||||
lPath = this.getCurrentLink( lCurrent ).href;
|
||||
var current = currentFile || this.getCurrentFile(),
|
||||
lPath = this.getCurrentLink( current ).href;
|
||||
|
||||
lPath = decodeURI(lPath);
|
||||
/* убираем адрес хоста*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue