main: remove useless semicolons and improve readability
This commit is contained in:
parent
c6b3215f02
commit
3fdd586f51
3 changed files with 18 additions and 7 deletions
|
|
@ -34,7 +34,7 @@ module.exports = function(options={}) {
|
|||
})
|
||||
|
||||
shortcut.register(window,'F12',function(){
|
||||
window.toggleDevTools();
|
||||
window.toggleDevTools()
|
||||
})
|
||||
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ var oscServer = new osc.UDPPort({
|
|||
localAddress: "0.0.0.0",
|
||||
localPort: oscInPort,
|
||||
metadata: true
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
var parseType = function(type){
|
||||
|
|
@ -50,7 +50,7 @@ var sendOsc = function(data){
|
|||
oscServer.send({
|
||||
address: data.address,
|
||||
args: data.args
|
||||
}, data.host, data.port);
|
||||
}, data.host, data.port)
|
||||
|
||||
if (debug) console.log('OSC sent: ',{address:data.address, args: data.args}, 'To : ' + data.host + ':' + data.port)
|
||||
|
||||
|
|
@ -69,21 +69,32 @@ var receiveOsc = function(data, info){
|
|||
}
|
||||
|
||||
var customModule = (function(){
|
||||
|
||||
if (!settings.read('customModule')) return false
|
||||
|
||||
var file = (function(){try {return fs.readFileSync(settings.read('customModule'),'utf8')} catch(err) {console.log('CustomModule Error: File not found: ' + settings.read('customModule'));return false}})(),
|
||||
var file = (function(){
|
||||
try {
|
||||
return fs.readFileSync(settings.read('customModule'),'utf8')
|
||||
} catch(err) {
|
||||
console.log('CustomModule Error: File not found: ' + settings.read('customModule'))
|
||||
return false
|
||||
}
|
||||
})(),
|
||||
mod,
|
||||
context = {
|
||||
console: console,
|
||||
sendOsc: sendOsc,
|
||||
receiveOsc: receiveOsc
|
||||
}
|
||||
|
||||
try {
|
||||
mod = vm.runInContext(file, vm.createContext(context))
|
||||
} catch(err) {
|
||||
console.log(err)
|
||||
}
|
||||
|
||||
return mod
|
||||
|
||||
})()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ express.get('*', function(req, res){
|
|||
io.use(ioWildcard)
|
||||
|
||||
|
||||
io.listen(server);
|
||||
io.listen(server)
|
||||
|
||||
server.listen(settings.read('httpPort'))
|
||||
|
||||
|
|
@ -48,8 +48,8 @@ var bindCallbacks = function(callbacks) {
|
|||
}
|
||||
|
||||
if (callbacks[name]) callbacks[name](data,socket.id)
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue