Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
label: 'Tweet about IGdm',
click() {
openExternal('https://twitter.com/intent/tweet?original_referer=https%3A%2F%2Figdm.me%2F&ref_src=twsrc%5Etfw&text=Continue%20Instagram%20DMs%20on%20your%20computer&tw_p=tweetbutton&url=https%3A%2F%2Figdm.me%2F')
}
},
{
label: 'Try IGdm Pro',
click() { openExternal('https://pro.igdm.me') }
}
]
}
]
if (process.platform === 'darwin') {
template.unshift({
label: app.getName(),
submenu: [
{role: 'about'},
{type: 'separator'},
{role: 'services', submenu: []},
{type: 'separator'},
{role: 'hide'},
{role: 'hideothers'},
{role: 'unhide'},
{type: 'separator'},
{role: 'quit'}
]
})
// Edit menu
template[1].submenu.push(
{type: 'separator'},
},
{
label: 'Aide',
role: 'help',
submenu: [
{
label: 'Documentation',
click () { require('electron').shell.openExternalSync('https://barbhackk.github.io/rekord') }
}
]
}
]
if(isMac){
templateMenu.unshift({
label: app.getName(),
submenu: [
{label: 'À propos de Rekord', role: 'about'},
{type: 'separator'},
{role: 'services'},
{type: 'separator'},
{label: 'Masquer Rekord', role: 'hide'},
{label: 'Masquer les autres', role: 'hideothers'},
{label: 'Afficher tout', role: 'unhide'},
{type: 'separator'},
{label: 'Quitter Rekord', role: 'quit'}
]
});
}
function createWindow () {
// Create the browser window.
// load a few global variables
require("./bootstrap.js");
log.transports.file.level = "debug";
log.transports.file.maxSize = 1 * 1024 * 1024;
log.info(`Hello from version: ${global.APP_VERSION_BASE} running in ${global.IS_DEV ? "development" : "production"}`);
if ( global.IS_DEV ) {
app.setName(global.APP_NAME);
app.name = global.APP_NAME;
log.info(`set app name to ${app.getName()}`);
if ( testMode !== true ) {
let userDataPath = path.join(app.getPath("appData"), app.getName());
log.info(`set userData path to ${userDataPath}`);
app.setPath("userData", userDataPath);
}
}
// store our root path as a global variable so we can access it from screens
if ( process.env.BEFORE_DAWN_DIR !== undefined ) {
global.basePath = process.env.BEFORE_DAWN_DIR;
}
else {
global.basePath = app.getPath("userData");
// global.basePath = path.join(app.getPath("appData"), global.APP_DIR);
}
log.info("use base path", global.basePath);
/**
function showUpdateMessageBox (update) {
let message = 'Check it. ' + update.tag_name + ' is hot off the press. You are currently rocking v' + version + '. You might want to go an grab it.'
// Ask user to update the app
dialog.showMessageBox({
type: 'question',
icon: path.join(__dirname, 'assets/system-icons/png/64x64.png'),
buttons: [
'Let\'s do this now.', 'Remind me.', 'No, thanks. I don\'t want this update.'
],
defaultId: 0,
cancelId: 1,
message: 'Huzzah! The new "' + app.getName() + '" is available :D',
detail: message
}, response => {
if (response === 0) {
shell.openExternal('https://matthewgonzalez.github.io/what-the-port/')
} else if (response === 1) {
storage.remove('ignoreVersion')
} else if (response === 2) {
storage.set('ignoreVersion', update.tag_name)
}
})
}
unviewProfiles (oldestDate, dryRun) {
if (dryRun == null) dryRun = false
console.log('Old Viewed Profiles Count: ' + profiles.length)
let ret = 0
let temp = []
for (let i = 0; i < profiles.length; i++) {
if (profiles[i].dt > oldestDate) {
temp.push(profiles[i])
ret++
}
}
if (!dryRun) {
profiles = temp
fs.writeFile(path.join(app.getPath('appData'), app.getName(), 'profiles.json'), JSON.stringify(profiles), () => { })
}
console.log('New Viewed Profiles Count: ' + temp.length)
return ret
}
})()),
},
{
label: 'Help',
role: 'help',
submenu: [
{
label: 'Learn More',
click: () => { shell.openExternal('http://electron.atom.io'); },
},
],
},
];
if (process.platform === 'darwin') {
const name = app.getName();
template.unshift({
label: name,
submenu: [
{
label: 'About ' + name,
role: 'about',
},
{
type: 'separator',
},
{
label: 'Services',
role: 'services',
submenu: [],
},
{
}
]
},
{
role: 'help', label: i18n.t('Help'),
submenu: [
{
label: "Learn More", //i18n.t('Learn more'),
click () { electron.shell.openExternal('https://github.com/xx10t4/iota1k') }
}
]
}
]
if (process.platform === 'darwin') {
const name = app.getName()
template.unshift({
label: name,
submenu: [
{
role: 'hide', label: i18n.t('Hide') + " " + name
},
{
role: 'hideothers', label: i18n.t('Hide others')
},
{
role: 'unhide', label: i18n.t('Unhide')
},
{
type: 'separator'
},
{
{
type: 'separator'
},
checkForUpdatesItem,
{
type: 'separator'
},
{
role: 'quit',
accelerator: 'Cmd+Q'
}
]);
export const applicationMenu = Menu.buildFromTemplate([
{
label: app.getName(),
submenu: [
{
role: 'about'
},
{
type: 'separator'
},
{
label: 'Preferences…',
accelerator: 'Cmd+,',
click() {
app.kap.openPrefsWindow();
}
},
checkForUpdatesItem,
{
)
},
)
state.tray = new Tray(
systemPreferences.isDarkMode() ? trayWhiteIcon : trayIcon,
)
state.tray.setPressedImage(
systemPreferences.isDarkMode() ? trayWhiteIcon : trayIcon,
)
break
default:
state.tray = new Tray(trayWhiteIcon)
}
state.tray.setToolTip(app.getName())
state.tray.setContextMenu(Menu.buildFromTemplate(getTrayTemplate()))
state.tray.on('click', () => showMainWindow())
}
protected createWindow() {
const window = new BrowserWindow({
title: app.getName(),
height: 400,
width: 500,
icon: Constants.urls.icon,
resizable: false,
titleBarStyle: "hidden",
show: false,
center: true,
});
if (this.currentSettings) {
const setting = this.currentSettings.https || this.currentSettings.http;
if (setting) {
(window as any).currentSettings = {
url: `${setting.protocol}://${setting.host}`,
port: setting.port,
username: setting.credentials && setting.credentials.username,
password: setting.credentials && setting.credentials.password,