This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //watch all nodes for a click | |
| cy.on('click', 'node', function(evt){ | |
| //add the labeling style to show the name on the specific one clicked | |
| cy.$('#'+this.id()).style({ | |
| "content": this[0]._private.data.name, | |
| "font-size": "12px", | |
| "text-valign": "top", | |
| "text-halign": "center" | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // capture any data you need from the url that opened the app | |
| app.on('open-url',function(e, strUrl){ | |
| var someThingToUse = strUrl; | |
| }); | |
| const createWindow = () => { | |
| // Create the browser window. | |
| mainWindow = new BrowserWindow({ | |
| width: 1280, | |
| height: 800, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "config": { | |
| "forge": { | |
| "electronInstallerDMG":{"format":"UDRO"}, | |
| "make_targets": { | |
| "win32": [ | |
| "squirrel" | |
| ], | |
| "darwin": [ | |
| "dmg" | |
| ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // get an IPC message from renderer | |
| // I put an "action" filed in my ipc messages to switch on | |
| ipcMain.on('electron-msg', (event, objMsg) => { | |
| //handle incoming message here | |
| switch(objMsg.action){ | |
| case 'oAuth': | |
| // Create a system default browser window. | |
| shell.openExternal(objMsg.data.url); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fnMayI=function(intPerms,strPerm){ | |
| //intPerms is an dec number that conatins all of the permissions | |
| //set these to your permissions map these are the binary positions of intPerms | |
| var objPerms={ | |
| "read":1 | |
| ,"update":2 | |
| ,"create":4 | |
| ,"props":16 | |
| ,"delete":64 | |
| ,"perms":65536 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //create a new window for oAuth | |
| var oAuthWindow = new BrowserWindow({ width: 480, height: 640, }); | |
| //send to the destination oauth | |
| oAuthWindow.loadURL(URL_TO_LOAD); | |
| oAuthWindow.webContents.on('did-navigate', function (objEvent,strUrl) { | |
| //console.log(objEvent,strUrl); | |
| if(strUrl.indexOf(URL_MATCH_THAT_INDICATES_COMPLETE) > -1){ | |
| oAuthWindow.hide(); | |
| //send whatever you need to back to the main window | |
| mainWindow.webContents.send('electron-msg', DATA_TO_SEND_MAIN_WINDOW_ON_COMPLETE); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "config": { | |
| "forge": { | |
| "make_targets": { | |
| "win32": [ "squirrel" ], | |
| "darwin": [ "zip" ], | |
| "linux": [ "deb","rpm" ] | |
| }, | |
| "electronPackagerConfig": { | |
| "protocols":[ | |
| { |
NewerOlder