mirror of
https://gitlab.com/Shinobi-Systems/ShinobiCE.git
synced 2025-03-09 15:40:15 +00:00
Son Goku
- Rebased sql, test, web, defintions, languages, INSTALL, and libs folders.
This commit is contained in:
parent
24de55e45a
commit
d0b12e92e7
362 changed files with 21716 additions and 7018 deletions
|
@ -12,7 +12,7 @@ module.exports = function(s,config){
|
|||
if(s.isWin===true){
|
||||
cmd = "Taskkill /IM ffmpeg.exe /F"
|
||||
}else{
|
||||
cmd = "ps aux | grep -ie ffmpeg | awk '{print $2}' | xargs kill -9"
|
||||
cmd = "pkill -9 ffmpeg"
|
||||
}
|
||||
exec(cmd,{detached: true})
|
||||
};
|
||||
|
@ -31,12 +31,14 @@ module.exports = function(s,config){
|
|||
}
|
||||
}
|
||||
s.parseJSON = function(string){
|
||||
var parsed
|
||||
try{
|
||||
string = JSON.parse(string)
|
||||
parsed = JSON.parse(string)
|
||||
}catch(err){
|
||||
|
||||
}
|
||||
return string
|
||||
if(!parsed)parsed = string
|
||||
return parsed
|
||||
}
|
||||
s.stringJSON = function(json){
|
||||
try{
|
||||
|
@ -224,4 +226,30 @@ module.exports = function(s,config){
|
|||
break;
|
||||
}
|
||||
}
|
||||
s.createTimeout = function(timeoutVar,timeoutLength,defaultLength,multiplier,callback){
|
||||
var theTimeout
|
||||
if(!multiplier)multiplier = 1000 * 60
|
||||
if(!timeoutLength || timeoutLength === ''){
|
||||
theTimeout = defaultLength
|
||||
}else{
|
||||
theTimeout = parseFloat(timeoutLength) * multiplier
|
||||
}
|
||||
clearTimeout(timeoutVar)
|
||||
timeoutVar = setTimeout(function(){
|
||||
clearTimeout(timeoutVar)
|
||||
delete(timeoutVar)
|
||||
if(callback)callback()
|
||||
},theTimeout)
|
||||
}
|
||||
Object.defineProperty(Array.prototype, 'chunk', {
|
||||
value: function(chunkSize){
|
||||
var temporal = [];
|
||||
|
||||
for (var i = 0; i < this.length; i+= chunkSize){
|
||||
temporal.push(this.slice(i,i+chunkSize));
|
||||
}
|
||||
|
||||
return temporal;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue