diff --git a/build/background.png b/build/background.png deleted file mode 100644 index 57016803..00000000 Binary files a/build/background.png and /dev/null differ diff --git a/build/background.tiff b/build/background.tiff new file mode 100644 index 00000000..b4f2d16b Binary files /dev/null and b/build/background.tiff differ diff --git a/js/child-preload.js b/js/child-preload.js index 4d722cc7..6ec35104 100644 --- a/js/child-preload.js +++ b/js/child-preload.js @@ -1,5 +1,5 @@ // script run before others and still has access to node integration, even -// when turned off - also us to leak only what want into window object. +// when turned off - allows us to leak only what want into window object. // see: http://electron.atom.io/docs/api/browser-window/ // // to leak some node module into: @@ -15,10 +15,9 @@ const { ipcRenderer } = require('electron'); // hold ref so doesn't get GC'ed const local = { ipcRenderer: ipcRenderer -} +}; -// JS can detect if in wrapper mode by looking for window.SYM_API obj -// API exposes by Symphony to a child window: +// API exposed by Symphony to a child window: window.SYM_API = { }; diff --git a/js/main-preload.js b/js/main-preload.js index fdc9909a..8bc69852 100644 --- a/js/main-preload.js +++ b/js/main-preload.js @@ -1,5 +1,5 @@ // script run before others and still has access to node integration, even -// when turned off - also us to leak only what want into window object. +// when turned off - allows us to leak only what want into window object. // see: http://electron.atom.io/docs/api/browser-window/ // // to leak some node module into: @@ -15,10 +15,9 @@ const { ipcRenderer } = require('electron'); // hold ref so doesn't get GC'ed const local = { ipcRenderer: ipcRenderer -} +}; -// JS can detect if in container mode by looking for window.SYM_API obj -// API exposes by Symphony to main window: +// API exposed by Symphony to main window: window.SYM_API = { openWindow: function(url) { local.ipcRenderer.send('symphony-msg', { diff --git a/js/main.js b/js/main.js index ccaf9bdd..d98c13b8 100644 --- a/js/main.js +++ b/js/main.js @@ -76,6 +76,10 @@ function createMainWindow () { }); } +/** + * Generate a key (guid). + * @return {string} guid + */ function getWindowKey() { // generate guid: // http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript @@ -113,6 +117,10 @@ function isValidWindow(event) { return false; } +/** + * Handle ipc messages from renderers. Only messages from windows we have + * created are allowed. + */ electron.ipcMain.on('symphony-msg', (event, arg) => { if (!isValidWindow(event)) { console.log('invalid window try to perform action, ignoring action.'); @@ -143,9 +151,11 @@ electron.ipcMain.on('symphony-msg', (event, arg) => { } }); -// This method will be called when Electron has finished -// initialization and is ready to create browser windows. -// Some APIs can only be used after this event occurs. +/** + * This method will be called when Electron has finished + * initialization and is ready to create browser windows. + * Some APIs can only be used after this event occurs. + */ app.on('ready', function() { createMainWindow(); }); diff --git a/package.json b/package.json index 0b45222d..a3dc1bb5 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,12 @@ "target": "dmg", "category": "public.app-category.business" }, + "dmg": { + "contents": [ + { "x": 140, "y": 184 }, + { "x": 412, "y": 184, "type": "link", "path": "/Applications" } + ] + }, "win": { "target": "squirrel" }