mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
feature(util) checkExtension -> checkExt
This commit is contained in:
parent
8a4d6bb28f
commit
d31a166e52
3 changed files with 27 additions and 31 deletions
|
|
@ -162,25 +162,17 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
}
|
||||
|
||||
function isAudio(name) {
|
||||
var isMatch,
|
||||
isStr = Util.isString(name),
|
||||
exts = '\\.(mp3|ogg)$',
|
||||
extsReg = new RegExp(exts);
|
||||
var isMatch;
|
||||
|
||||
if (isStr)
|
||||
isMatch = name.match(extsReg);
|
||||
isMatch = Util.checkExt(name, ['mp3', 'ogg']);
|
||||
|
||||
return isMatch;
|
||||
}
|
||||
|
||||
function isVideo(name) {
|
||||
var isMatch,
|
||||
isStr = Util.isString(name),
|
||||
exts = '\\.(mp4|avi)$',
|
||||
extsReg = new RegExp(exts);
|
||||
var isMatch;
|
||||
|
||||
if (isStr)
|
||||
isMatch = name.match(extsReg);
|
||||
Util.checkExt(name, ['mp4', 'avi']);
|
||||
|
||||
return isMatch;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue