From 7313f415bf968be9c125e81ed44e5c9effc418d8 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 18 Jun 2016 20:15:41 -0400 Subject: [PATCH] Move devices into module --- app/lib/devices-ui.js | 24 ++++++++++++++++++++++++ app/src/index.js | 25 ++----------------------- 2 files changed, 26 insertions(+), 23 deletions(-) create mode 100644 app/lib/devices-ui.js diff --git a/app/lib/devices-ui.js b/app/lib/devices-ui.js new file mode 100644 index 0000000..fcf510f --- /dev/null +++ b/app/lib/devices-ui.js @@ -0,0 +1,24 @@ +var devices = {}; + +devices.init = function () { + 'use strict'; + devices.listen(); + gui.overlay(true); + gui.spinner(true); +}; +devices.listen = function () { + 'use strict'; + ipcRenderer.on('ready', function (event, arg) { + //console.log(arg.camera); + //console.log(arg.projector); + devices.ready(); + return event.returnValue = true; + }); +}; +devices.ready = function () { + 'use strict'; + gui.spinner(false); + gui.overlay(false); +}; + +module.exports = devices; \ No newline at end of file diff --git a/app/src/index.js b/app/src/index.js index d4df2b8..4c452fe 100644 --- a/app/src/index.js +++ b/app/src/index.js @@ -10,11 +10,12 @@ var remote = require('remote'), light = require('./lib/light-ui.js'), proj = require('./lib/proj-ui.js'), cam = require('./lib/cam-ui.js'), - nav = {}, + nav = require('./lib/nav-ui.js'), seq = require('./lib/seq-ui.js'), cmd = require('./lib/cmd-ui.js'), gui = require('./lib/gui.js'), log = require('./lib/log-ui.js'), + devices = require('./lib/devices-ui.js'), mscript = require('./lib/mscript.js'); //console.log(ipcRenderer.sendSync('light', { 'fuck' : true }) ); @@ -59,28 +60,6 @@ mcopy.state = { //mcopy.gui.updateState(); -var devices = {}; -devices.init = function () { - 'use strict'; - devices.listen(); - gui.overlay(true); - gui.spinner(true); -}; -devices.listen = function () { - 'use strict'; - ipcRenderer.on('ready', function (event, arg) { - //console.log(arg.camera); - //console.log(arg.projector); - devices.ready(); - return event.returnValue = true; - }); -}; -devices.ready = function () { - 'use strict'; - gui.spinner(false); - gui.overlay(false); -}; - var init = function () { 'use strict'; nav.init();