This file contains 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":[ | |
{ |
This file contains 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 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 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 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 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 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 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
//this is a modified electron-forge default main.js file | |
import { app, BrowserWindow, ipcMain, shell, protocol, dialog, session, clipboard, Menu } from 'electron'; | |
const metastream = require('metastream'); | |
// Keep a global reference of the window object, if you don't, the window will | |
// be closed automatically when the JavaScript object is garbage collected. | |
let mainWindow; | |
process.on('uncaughtException', (err) => { console.error(err); }); | |
const createWindow = () => { |
This file contains 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
//add data to the array like this | |
$scope.chartData=[{x:0,y:0}]; | |
$scope.chartOptions = { | |
"chart": { | |
"type": 'linePlusBarChart', | |
//...the other options... | |
"callback": function(chart){ | |
chart.dispatch.on( 'brush', function (objBrush) { | |
// objBrush.extent these are array index values! |
This file contains 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
<div style={{"background":'linear-gradient(90deg, #f00 70%, transparent 30%)'}}> {objV.label} </div> |
OlderNewer