Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade All Deps #332

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ app.on('second-instance', () => {
});

function createMainWindow() {
const lastURL = settings.get('useYinxiang') ? url.yinxiang : url.evernote;
const lastURL = settings.getSync('useYinxiang') ? url.yinxiang : url.evernote;

const tuskWindow = new BrowserWindow(win.defaultOpts);

Expand Down
8,666 changes: 8,666 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@
"scripts": {
"postinstall": "electron-builder install-app-deps",
"test": "xo && stylelint 'src/style/*.css'",
"release": "build --publish always",
"release": "electron-builder --publish always",
"start": "electron ."
},
"dependencies": {
"auto-launch": "^5.0.1",
"auto-launch": "^5.0.5",
"decode-uri-component": "^0.2.0",
"electron-context-menu": "^0.9.0",
"electron-debug": "^1.3.0",
"electron-dl": "^1.11.0",
"electron-settings": "^3.1.4",
"turndown": "^5.0.1"
"electron-context-menu": "^2.4.0",
"electron-debug": "^3.2.0",
"electron-dl": "^3.1.0",
"electron-settings": "^4.0.2",
"turndown": "^7.0.0"
},
"devDependencies": {
"electron": "6.0.11",
"electron-builder": "21.2.0",
"stylelint": "^9.9.0",
"electron": "11.3.0",
"electron-builder": "22.9.1",
"stylelint": "^13.11.0",
"xo": "*"
},
"xo": {
Expand Down
6 changes: 3 additions & 3 deletions src/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ipc.on('toggle-sepia-mode', () => mode.sepia());
ipc.on('auto-night-mode', () => mode.autoNight());

ipc.on('toggle-side-bar', () => {
settings.set('sideBarHidden', !settings.get('sideBarHidden'));
settings.setSync('sideBarHidden', !settings.getSync('sideBarHidden'));
nav.sideBar();
});

Expand Down Expand Up @@ -173,7 +173,7 @@ ipc.on('remove-formatting', () => {
});

ipc.on('return', () => {
nav.click('#gwt-debug-Sidebar-notesButton');
nav.click('#qa-NAV_ALL_NOTEBOOKS');
});

ipc.on('search', () => {
Expand Down Expand Up @@ -209,7 +209,7 @@ document.addEventListener('keydown', e => nav.jumpToNote(e));
document.addEventListener('DOMContentLoaded', () => {
nav.zoomRestore();

if (settings.get('autoNightMode')) {
if (settings.getSync('autoNightMode')) {
mode.autoNight();
}

Expand Down
30 changes: 16 additions & 14 deletions src/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ class Dialog {
});
}

_create(options) {
return dialog.showMessageBox(
async _create (options) {
const response = await dialog.showMessageBox(
Object.assign({
cancelId: 1,
defaultId: 0,
icon: file.icon
}, options)
);

return response.response
}

_exit() {
Expand Down Expand Up @@ -73,32 +75,32 @@ class Dialog {
});
}

confirmAbout() {
if (this._about() === 1) {
async confirmAbout() {
if (await this._about() === 1) {
clipboard.writeText(this._systemInfo);
}
}

confirmExit() {
if (settings.get('requestExitConfirmation')) {
if (this._exit() === 0) {
async confirmExit() {
if (settings.getSync('requestExitConfirmation')) {
if (await this._exit() === 0) {
app.quit();
}
} else {
app.quit();
}
}

confirmActivationRestart(option, state) {
if (this._restart() === 0) {
settings.set(option, state);
async confirmActivationRestart (option, state) {
if (await this._restart() === 0) {
settings.setSync(option, state);
app.quit();
app.relaunch();
}
}

confirmSignOut() {
if (this._signOut() === 0) {
async confirmSignOut() {
if (await this._signOut() === 0) {
activate('log-out');
}
}
Expand All @@ -116,8 +118,8 @@ class Dialog {
});
}

getUpdate(version) {
if (this._update(version) === 0) {
async getUpdate(version) {
if (await this._update(version) === 0) {
shell.openExternal(release);
}
}
Expand Down
24 changes: 12 additions & 12 deletions src/menu/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,17 @@ module.exports = {
}, {
label: 'Launch on Start',
type: 'checkbox',
checked: settings.get('autoLaunch'),
checked: settings.getSync('autoLaunch'),
click(item) {
settings.set('autoLaunch', item.checked);
settings.setSync('autoLaunch', item.checked);
activate('auto-launch');
}
}, {
label: 'Launch Minimized',
type: 'checkbox',
checked: settings.get('launchMinimized'),
checked: settings.getSync('launchMinimized'),
click(item) {
settings.set('launchMinimized', item.checked);
settings.setSync('launchMinimized', item.checked);
}
}, {
type: 'separator'
Expand All @@ -162,33 +162,33 @@ module.exports = {
}, {
label: 'Enable Global Shortcut Keys',
type: 'checkbox',
checked: settings.get('useGlobalShortcuts'),
checked: settings.getSync('useGlobalShortcuts'),
click(item) {
dialog.confirmActivationRestart('useGlobalShortcuts', item.checked);
item.checked = settings.get('useGlobalShortcuts');
item.checked = settings.getSync('useGlobalShortcuts');
}
}, {
label: 'Request Exit Confirmation',
type: 'checkbox',
checked: settings.get('requestExitConfirmation'),
checked: settings.getSync('requestExitConfirmation'),
click(item) {
settings.set('requestExitConfirmation', item.checked);
settings.setSync('requestExitConfirmation', item.checked);
}
}, {
type: 'separator'
}, {
label: 'Switch to Yinxiang',
visible: !settings.get('useYinxiang'),
visible: !settings.getSync('useYinxiang'),
click() {
settings.set('useYinxiang', true);
settings.setSync('useYinxiang', true);
app.relaunch();
app.quit();
}
}, {
label: 'Switch to Evernote',
visible: settings.get('useYinxiang'),
visible: settings.getSync('useYinxiang'),
click() {
settings.set('useYinxiang', false);
settings.setSync('useYinxiang', false);
app.relaunch();
app.quit();
}
Expand Down
22 changes: 11 additions & 11 deletions src/menu/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,49 +28,49 @@ module.exports = {
}
}, {
label: 'Update Check Frequency',
enabled: !settings.get('disableAutoUpdateCheck'),
enabled: !settings.getSync('disableAutoUpdateCheck'),
submenu: [
{
label: 'Once Every 4 Hours',
type: 'checkbox',
checked: settings.get('updateCheckPeriod') === '4',
checked: settings.getSync('updateCheckPeriod') === '4',
click(item) {
dialog.confirmActivationRestart('updateCheckPeriod', '4');
item.checked = settings.get('updateCheckPeriod') === '4';
item.checked = settings.getSync('updateCheckPeriod') === '4';
}
}, {
label: 'Once Every 8 Hours',
type: 'checkbox',
checked: settings.get('updateCheckPeriod') === '8',
checked: settings.getSync('updateCheckPeriod') === '8',
click(item) {
dialog.confirmActivationRestart('updateCheckPeriod', '8');
item.checked = settings.get('updateCheckPeriod') === '8';
item.checked = settings.getSync('updateCheckPeriod') === '8';
}
}, {
label: 'Once Every 12 Hours',
type: 'checkbox',
checked: settings.get('updateCheckPeriod') === '12',
checked: settings.getSync('updateCheckPeriod') === '12',
click(item) {
dialog.confirmActivationRestart('updateCheckPeriod', '12');
item.checked = settings.get('updateCheckPeriod') === '12';
item.checked = settings.getSync('updateCheckPeriod') === '12';
}
}, {
label: 'Once a Day',
type: 'checkbox',
checked: settings.get('updateCheckPeriod') === '24',
checked: settings.getSync('updateCheckPeriod') === '24',
click(item) {
dialog.confirmActivationRestart('updateCheckPeriod', '24');
item.checked = settings.get('updateCheckPeriod') === '24';
item.checked = settings.getSync('updateCheckPeriod') === '24';
}
}
]
}, {
label: 'Disable Automatic Update Check',
type: 'checkbox',
checked: settings.get('disableAutoUpdateCheck'),
checked: settings.getSync('disableAutoUpdateCheck'),
click(item) {
dialog.confirmActivationRestart('disableAutoUpdateCheck', item.checked);
item.checked = settings.get('disableAutoUpdateCheck');
item.checked = settings.getSync('disableAutoUpdateCheck');
}
}, {
type: 'separator'
Expand Down
4 changes: 2 additions & 2 deletions src/menu/tray.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ module.exports = [
}, {
label: 'Auto Night Mode',
type: 'checkbox',
checked: settings.get('autoNightMode'),
checked: settings.getSync('autoNightMode'),
click(item) {
win.appear();
settings.set('autoNightMode', item.checked);
settings.setSync('autoNightMode', item.checked);
win.activate('auto-night-mode');
}
}, {
Expand Down
18 changes: 9 additions & 9 deletions src/menu/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ module.exports = {
}, {
label: 'Auto Night Mode',
type: 'checkbox',
checked: settings.get('autoNightMode'),
checked: settings.getSync('autoNightMode'),
accelerator: 'CmdorCtrl+Alt+N',
click(item) {
settings.set('autoNightMode', item.checked);
settings.setSync('autoNightMode', item.checked);
activate('auto-night-mode');
}
}, {
Expand All @@ -94,38 +94,38 @@ module.exports = {
}, {
label: 'Always on Top',
type: 'checkbox',
checked: settings.get('alwaysOnTop'),
checked: settings.getSync('alwaysOnTop'),
accelerator: 'CmdorCtrl+Shift+P',
click(item, focusedWindow) {
settings.set('alwaysOnTop', item.checked);
settings.setSync('alwaysOnTop', item.checked);
focusedWindow.setAlwaysOnTop(item.checked);
}
}, {
label: 'Hide Tray Icon',
type: 'checkbox',
visible: !is.darwin,
checked: settings.get('hideTray'),
checked: settings.getSync('hideTray'),
click(item) {
dialog.confirmActivationRestart('hideTray', item.checked);
item.checked = settings.get('hideTray');
item.checked = settings.getSync('hideTray');
}
}, {
type: 'separator'
}, {
label: 'Toggle Side Bar',
type: 'checkbox',
checked: !settings.get('sideBarHidden'),
checked: !settings.getSync('sideBarHidden'),
accelerator: setAcc('toggle-sidebar', 'CmdorCtrl+\\'),
click() {
activate('toggle-side-bar');
}
}, {
label: 'Toggle Menu Bar',
type: 'checkbox',
checked: !settings.get('menuBarHidden'),
checked: !settings.getSync('menuBarHidden'),
visible: !is.darwin,
click(item, focusedWindow) {
settings.set('menuBarHidden', !item.checked);
settings.setSync('menuBarHidden', !item.checked);
focusedWindow.setMenuBarVisibility(item.checked);
focusedWindow.setAutoHideMenuBar(!item.checked);
}
Expand Down
16 changes: 8 additions & 8 deletions src/mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ class Mode {
async _setFontColor(mode) {
const frame = await this.getNoteFrame();
const style = document.createElement('style');
const fontColor = settings.get(`mode.${mode}`) ? this._colors[mode] : this._colors.default;
const fontColor = settings.getSync(`mode.${mode}`) ? this._colors[mode] : this._colors.default;
style.textContent = `body {color: ${fontColor};}`;
return frame.contentDocument.head.append(style);
}

_toggle(mode) {
const modes = settings.get('mode');
const modes = settings.getSync('mode');

Object.keys(modes).forEach(x => {
settings.set(`mode.${x}`, (x === mode) ? !modes[x] : false);
document.documentElement.classList.toggle(`${x}-mode`, settings.get(`mode.${x}`));
settings.setSync(`mode.${x}`, (x === mode) ? !modes[x] : false);
document.documentElement.classList.toggle(`${x}-mode`, settings.getSync(`mode.${x}`));
});

this._setFontColor(mode);
Expand All @@ -35,12 +35,12 @@ class Mode {
_enableAutoNight() {
if (time.isDaytime()) {
this._toggle(null);
} else if (!settings.get('mode.dark')) {
} else if (!settings.getSync('mode.dark')) {
this._toggle('dark');
}

setTimeout(() => {
if (settings.get('autoNightMode')) {
if (settings.getSync('autoNightMode')) {
return this._enableAutoNight();
}
}, time.ms(time.transitionSpan()));
Expand All @@ -51,7 +51,7 @@ class Mode {
}

autoNight() {
return settings.get('autoNightMode') ? this._enableAutoNight() : this._disableAutoNight();
return settings.getSync('autoNightMode') ? this._enableAutoNight() : this._disableAutoNight();
}

black() {
Expand All @@ -78,7 +78,7 @@ class Mode {
}

restore() {
const modes = settings.get('mode');
const modes = settings.getSync('mode');
Object.keys(modes).forEach(x => {
if (modes[x]) {
this._setFontColor(x);
Expand Down
Loading