mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
feature(util) mv getStrBigFirst to CloudFunc
This commit is contained in:
parent
866aa0456d
commit
548bb8d7f1
3 changed files with 12 additions and 12 deletions
|
|
@ -83,7 +83,7 @@ var Util, DOM, CloudFunc, join;
|
|||
doBefore = params.dobefore;
|
||||
|
||||
if (path && !name) {
|
||||
name = Util.getStrBigFirst(path);
|
||||
name = CloudFunc.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 = Util.getStrBigFirst(module);
|
||||
module = CloudFunc.getStrBigFirst(module);
|
||||
|
||||
file = query[1];
|
||||
current = DOM.getCurrentByName(file);
|
||||
|
|
|
|||
|
|
@ -57,6 +57,16 @@ var Util;
|
|||
return str;
|
||||
};
|
||||
|
||||
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';
|
||||
|
|
|
|||
10
lib/util.js
10
lib/util.js
|
|
@ -225,16 +225,6 @@
|
|||
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
/**
|
||||
* function log pArg if it's not empty
|
||||
* @param pArg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue