mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
refactor(cloudfunc) mv getStrBigFirst to client
This commit is contained in:
parent
cb4f2e1b41
commit
9615b6466f
2 changed files with 12 additions and 12 deletions
|
|
@ -83,7 +83,7 @@ var Util, DOM, CloudFunc, join;
|
|||
doBefore = params.dobefore;
|
||||
|
||||
if (path && !name) {
|
||||
name = CloudFunc.getStrBigFirst(path);
|
||||
name = getStrBigFirst(path);
|
||||
name = Util.rmStr(name, '.js');
|
||||
|
||||
slash = name.indexOf('/');
|
||||
|
|
@ -166,7 +166,7 @@ var Util, DOM, CloudFunc, join;
|
|||
if (path) {
|
||||
module = query[0];
|
||||
module = Util.slice(module, 1).join('');
|
||||
module = CloudFunc.getStrBigFirst(module);
|
||||
module = getStrBigFirst(module);
|
||||
|
||||
file = query[1];
|
||||
current = DOM.getCurrentByName(file);
|
||||
|
|
@ -455,5 +455,15 @@ var Util, DOM, CloudFunc, join;
|
|||
}
|
||||
};
|
||||
|
||||
function getStrBigFirst(str) {
|
||||
var isStr = Util.type.string(str),
|
||||
ret = str;
|
||||
|
||||
if (isStr && str.length)
|
||||
ret = str[0].toUpperCase() + str.substring(1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
})(this, Util, DOM, CloudFunc, join);
|
||||
|
|
|
|||
|
|
@ -32,16 +32,6 @@ var Util;
|
|||
this.CHANNEL_TERMINAL_RESIZE= 'terminal-resize';
|
||||
this.MAX_FILE_SIZE = 500 * 1024;
|
||||
|
||||
this.getStrBigFirst = function(str) {
|
||||
var isStr = Util.type.string(str),
|
||||
ret = str;
|
||||
|
||||
if (isStr && str.length)
|
||||
ret = str[0].toUpperCase() + str.substring(1);
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
this.formatMsg = function(msg, name, status) {
|
||||
if (!status)
|
||||
status = 'ok';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue