mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-11-22 17:06:24 -06:00
Merge pull request #14 from lneir/dmg-img-update
update dmg image and docs
This commit is contained in:
commit
c36328eb4d
Binary file not shown.
Before Width: | Height: | Size: 8.1 KiB |
BIN
build/background.tiff
Normal file
BIN
build/background.tiff
Normal file
Binary file not shown.
@ -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 = {
|
||||
};
|
||||
|
||||
|
@ -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', {
|
||||
|
16
js/main.js
16
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();
|
||||
});
|
||||
|
@ -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"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user