mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-25 08:54:10 +00:00
refactor(dom) rm Util.rmStrOnce
This commit is contained in:
parent
051b7d2ab5
commit
0f8b224f15
1 changed files with 7 additions and 5 deletions
|
|
@ -521,8 +521,8 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
nameFile = name + '.gz';
|
||||
} else if (operation.unpack) {
|
||||
op = RESTful.unpack;
|
||||
nameDir = Util.rmStrOnce(name, '.tar.gz');
|
||||
nameFile = Util.rmStrOnce(name, '.gz');
|
||||
nameDir = name.replace('.tar.gz', '');
|
||||
nameFile = name.replace('.gz', '');
|
||||
}
|
||||
|
||||
Images.show.load();
|
||||
|
|
@ -658,7 +658,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
|
||||
lHref = CloudFunc.rmLastSlash(lHref);
|
||||
lSubstr = lHref.substr(lHref , lHref.lastIndexOf('/'));
|
||||
ret = Util.rmStrOnce(lHref, lSubstr + '/') || '/';
|
||||
ret = lHref.replace(lSubstr + '/', '') || '/';
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
|
@ -766,7 +766,9 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
|
||||
size = size.textContent;
|
||||
/* если это папка - возвращаем слово dir вместо размера*/
|
||||
ret = Util.rmStrOnce(size, ['<', '>']);
|
||||
['<', '>'].forEach(function(str) {
|
||||
ret = size.replace(str);
|
||||
});
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
|
@ -1195,7 +1197,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
element = DOM.getByTag('a', current)[0],
|
||||
path = element.getAttribute('href');
|
||||
|
||||
path = Util.rmStrOnce(path, CloudFunc.FS);
|
||||
path = path.replace(CloudFunc.FS, '');
|
||||
|
||||
return path;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue