Comparing version 0.7.0 to 0.8.0
@@ -5,2 +5,3 @@ 'use strict'; | ||
const path = require('path'); | ||
const timeStamp = require('time-stamp'); | ||
const config = require('./config'); | ||
@@ -184,4 +185,57 @@ | ||
function autoNightMode() { | ||
// Switch between light and dark themes based on daytime | ||
const time = timeStamp('HHmm'); | ||
switch (time <= 1800 && time >= 600) { | ||
case true: | ||
// Switch to the light theme | ||
untoggleDark(); | ||
untoggleBlack(); | ||
untoggleSepia(); | ||
untoggleVibrant(); | ||
untoggleDarkVibrant(); | ||
break; | ||
case false: | ||
// Switch to the dark theme | ||
untoggleBlack(); | ||
untoggleSepia(); | ||
untoggleVibrant(); | ||
untoggleDarkVibrant(); | ||
config.set('darkMode', true); | ||
darkMode(); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
function untoggleAutoNightMode() { | ||
// Untoggle the auto night mode | ||
untoggleDark(); | ||
} | ||
ipc.on('auto-night-mode', () => { | ||
// Toggle on and off the auto night mode | ||
if (config.get('autoNightMode')) { | ||
autoNightMode(); | ||
} else { | ||
untoggleAutoNightMode(); | ||
} | ||
}); | ||
function toggleSideBar() { | ||
// Make side bar visible & adjust left margin | ||
document.documentElement.classList.toggle('side-bar-visible', config.get('sideBarVisible')); | ||
} | ||
ipc.on('toggle-side-bar', () => { | ||
// Toggle on and off the side bar | ||
config.set('sideBarVisible', !config.get('sideBarVisible')); | ||
toggleSideBar(); | ||
}); | ||
function toggleMenuBar() { | ||
// Activates the menu bar on the main window | ||
// Activate the menu bar on the main window | ||
ipc.send('activate-menu-bar'); | ||
@@ -191,3 +245,3 @@ } | ||
ipc.on('toggle-menu-bar', () => { | ||
// Toggles on and off the menu bar | ||
// Toggle on and off the menu bar | ||
config.set('menuBarVisible', !config.get('menuBarVisible')); | ||
@@ -293,2 +347,17 @@ toggleMenuBar(); | ||
function toggleAutoLaunch() { | ||
// Decide whether or not the app should launch on login | ||
const startup = require('./startup'); | ||
if (config.get('autoLaunch')) { | ||
// Activate app launching | ||
startup.activate(); | ||
} else { | ||
// Deactivate app launching | ||
startup.deactivate(); | ||
} | ||
} | ||
ipc.on('auto-launch', toggleAutoLaunch); | ||
ipc.on('next-note', goToNextNote); | ||
@@ -356,2 +425,8 @@ | ||
ipc.on('log-out', () => { | ||
// Log out | ||
document.querySelector('#gwt-debug-AccountMenu-avatar').click(); | ||
document.querySelector('#gwt-debug-AccountMenu-logout').click(); | ||
}); | ||
ipc.on('bold', () => { | ||
@@ -489,2 +564,8 @@ // Bold text | ||
webFrame.setZoomFactor(zoomFactor); | ||
// Toggle auto night mode | ||
if (config.get('autoNightMode')) { | ||
autoNightMode(); | ||
} | ||
// Toggle the side bar | ||
toggleSideBar(); | ||
// Toggle the menu bar | ||
@@ -491,0 +572,0 @@ toggleMenuBar(); |
@@ -12,2 +12,6 @@ 'use strict'; | ||
menuBarVisible: false, | ||
sideBarVisible: false, | ||
autoNightMode: false, | ||
autoLaunch: false, | ||
hideTray: false, | ||
darkMode: false, | ||
@@ -14,0 +18,0 @@ blackMode: false, |
{ | ||
"name": "Tusk v0.6.0", | ||
"name": "Tusk v0.8.0", | ||
"url": "https://github.com/klauscfhq/tusk/releases/latest", | ||
"version": "0.6.0" | ||
"version": "0.8.0" | ||
} |
10
index.js
@@ -105,3 +105,7 @@ 'use strict'; | ||
mainWindow = createMainWindow(); | ||
tray.create(mainWindow); | ||
if (!config.get('hideTray')) { | ||
// Check whether or not the tray | ||
// icon is set to be hidden | ||
tray.create(mainWindow); | ||
} | ||
const windowContent = mainWindow.webContents; | ||
@@ -134,2 +138,6 @@ | ||
}, ms('2m')); | ||
setInterval(() => { | ||
update.checkUpdate(); | ||
}, ms('1h')); | ||
} | ||
@@ -136,0 +144,0 @@ }); |
212
menu.js
@@ -10,16 +10,21 @@ 'use strict'; | ||
const app = electron.app; | ||
const resolve = path.resolve; | ||
const shell = electron.shell; | ||
const appName = app.getName(); | ||
const platform = process.platform; | ||
const BrowserWindow = electron.BrowserWindow; | ||
let configData; | ||
const tuskJSON = '.tusk.json'; // Config file name | ||
let defaultConfigPath; // Path to the default config file | ||
const homeDir = os.homedir(); | ||
const homeConfig = join(homeDir, tuskJSON); // Config file on home directory | ||
const defaultConfig = join(__dirname, '.', tuskJSON); // Default config file directory | ||
const tuskJSON = '.tusk.json'; // Config file name on the home directory | ||
const homeConfig = join(homeDir, tuskJSON); // Path to the config file on the home directory | ||
const keymapsDir = resolve(__dirname, 'keymaps'); // Keymaps directory | ||
const sourceURL = 'https://github.com/klauscfhq/tusk'; | ||
const homepageURL = 'https://klauscfhq.github.io/tusk'; | ||
const communityURL = 'https://gitter.im/klauscfhq/tusk'; | ||
const issueURL = 'https://github.com/klauscfhq/tusk/issues/new'; | ||
const releaseURL = 'https://github.com/klauscfhq/tusk/releases/latest'; | ||
const searchURL = 'https://github.com/search?q=+is:issue+repo:klauscfhq/tusk'; | ||
const licenseURL = 'https://github.com/klauscfhq/tusk/blob/master/license.md'; | ||
@@ -33,5 +38,28 @@ function activate(command) { | ||
function getPath() { | ||
// Retrieve the default path of the platform-dedicated config file | ||
switch (platform) { | ||
case ('darwin'): | ||
defaultConfigPath = join(keymapsDir, 'darwin.json'); | ||
break; | ||
case ('linux'): | ||
defaultConfigPath = join(keymapsDir, 'linux.json'); | ||
break; | ||
case ('win32'): | ||
defaultConfigPath = join(keymapsDir, 'win32.json'); | ||
break; | ||
default: | ||
defaultConfigPath = join(keymapsDir, 'linux.json'); | ||
break; | ||
} | ||
return defaultConfigPath; | ||
} | ||
function getConfig() { | ||
// Create a new default config file | ||
// if it does not already exist | ||
// Get the dedicated config file for each platform | ||
const defaultConfig = getPath(); | ||
// Create a new default config file if it does not already exist | ||
if (!fs.existsSync(homeConfig)) { | ||
@@ -57,11 +85,19 @@ try { | ||
function setAcc(custom, predifined) { | ||
// Return the custom or predifined shortcut keys | ||
function setAcc(custom, predefined) { | ||
// Return the custom or predefined shortcut keys | ||
if (Object.prototype.hasOwnProperty.call(tuskConfig.shortcutKeys, custom)) { | ||
return tuskConfig.shortcutKeys[custom]; | ||
} | ||
return predifined; | ||
return predefined; | ||
} | ||
const helpSubmenu = [{ | ||
label: `View License`, | ||
click() { | ||
shell.openExternal(licenseURL); | ||
} | ||
}, { | ||
label: 'Version ' + app.getVersion(), | ||
enabled: false | ||
}, { | ||
label: `Tusk Homepage`, | ||
@@ -84,6 +120,11 @@ click() { | ||
}, { | ||
label: `Latest Release`, | ||
label: `Search Issues`, | ||
click() { | ||
shell.openExternal(releaseURL); | ||
shell.openExternal(searchURL); | ||
} | ||
}, { | ||
label: `Community Discussion`, | ||
click() { | ||
shell.openExternal(communityURL); | ||
} | ||
}]; | ||
@@ -237,2 +278,10 @@ | ||
}, { | ||
label: 'Launch on Start', | ||
type: 'checkbox', | ||
checked: config.get('autoLaunch'), | ||
click(item) { | ||
config.set('autoLaunch', item.checked); | ||
activate('auto-launch'); | ||
} | ||
}, { | ||
label: 'Edit Shortcut Keys', | ||
@@ -261,2 +310,9 @@ accelerator: 'CmdorCtrl+.', | ||
} | ||
}, { | ||
type: 'separator' | ||
}, { | ||
label: 'Log out', | ||
click() { | ||
activate('log-out'); | ||
} | ||
}] | ||
@@ -299,20 +355,23 @@ }, { | ||
}, { | ||
label: 'Make Text Larger', | ||
accelerator: 'CmdOrCtrl+Plus', | ||
click() { | ||
activate('zoom-in'); | ||
} | ||
label: 'Font Size Options', | ||
submenu: [{ | ||
label: 'Make Text Larger', | ||
accelerator: 'CmdOrCtrl+Plus', | ||
click() { | ||
activate('zoom-in'); | ||
} | ||
}, { | ||
label: 'Make Text Smaller', | ||
accelerator: 'CmdOrCtrl+-', | ||
click() { | ||
activate('zoom-out'); | ||
} | ||
}, { | ||
label: 'Reset Zoom Level', | ||
accelerator: 'CmdOrCtrl+0', | ||
click() { | ||
activate('zoom-reset'); | ||
} | ||
}] | ||
}, { | ||
label: 'Make Text Smaller', | ||
accelerator: 'CmdOrCtrl+-', | ||
click() { | ||
activate('zoom-out'); | ||
} | ||
}, { | ||
label: 'Reset Zoom Level', | ||
accelerator: 'CmdOrCtrl+0', | ||
click() { | ||
activate('zoom-reset'); | ||
} | ||
}, { | ||
type: 'separator' | ||
@@ -367,2 +426,11 @@ }, { | ||
}, { | ||
label: 'Auto Night Mode', | ||
type: 'checkbox', | ||
checked: config.get('autoNightMode'), | ||
accelerator: 'CmdorCtrl+Alt+N', | ||
click(item) { | ||
config.set('autoNightMode', item.checked); | ||
activate('auto-night-mode'); | ||
} | ||
}, { | ||
type: 'separator' | ||
@@ -393,2 +461,11 @@ }, { | ||
}, { | ||
type: 'separator' | ||
}, { | ||
label: 'Toggle Side Bar', | ||
type: 'checkbox', | ||
checked: config.get('sideBarVisible'), | ||
click() { | ||
activate('toggle-side-bar'); | ||
} | ||
}, { | ||
label: 'Toggle Full Screen', | ||
@@ -675,2 +752,10 @@ accelerator: 'Ctrl+Command+F', | ||
}, { | ||
label: 'Launch on Start', | ||
type: 'checkbox', | ||
checked: config.get('autoLaunch'), | ||
click(item) { | ||
config.set('autoLaunch', item.checked); | ||
activate('auto-launch'); | ||
} | ||
}, { | ||
label: 'Edit Shortcut Keys', | ||
@@ -702,2 +787,9 @@ accelerator: 'CmdorCtrl+.', | ||
}, { | ||
label: 'Log out', | ||
click() { | ||
activate('log-out'); | ||
} | ||
}, { | ||
type: 'separator' | ||
}, { | ||
role: 'quit' | ||
@@ -741,20 +833,23 @@ }] | ||
}, { | ||
label: 'Make Text Larger', | ||
accelerator: 'CmdOrCtrl+Plus', | ||
click() { | ||
activate('zoom-in'); | ||
} | ||
label: 'Font Size Options', | ||
submenu: [{ | ||
label: 'Make Text Larger', | ||
accelerator: 'CmdOrCtrl+Plus', | ||
click() { | ||
activate('zoom-in'); | ||
} | ||
}, { | ||
label: 'Make Text Smaller', | ||
accelerator: 'CmdOrCtrl+-', | ||
click() { | ||
activate('zoom-out'); | ||
} | ||
}, { | ||
label: 'Reset Zoom Level', | ||
accelerator: 'CmdOrCtrl+0', | ||
click() { | ||
activate('zoom-reset'); | ||
} | ||
}] | ||
}, { | ||
label: 'Make Text Smaller', | ||
accelerator: 'CmdOrCtrl+-', | ||
click() { | ||
activate('zoom-out'); | ||
} | ||
}, { | ||
label: 'Reset Zoom Level', | ||
accelerator: 'CmdOrCtrl+0', | ||
click() { | ||
activate('zoom-reset'); | ||
} | ||
}, { | ||
type: 'separator' | ||
@@ -797,2 +892,11 @@ }, { | ||
}, { | ||
label: 'Auto Night Mode', | ||
type: 'checkbox', | ||
checked: config.get('autoNightMode'), | ||
accelerator: 'CmdorCtrl+Alt+N', | ||
click(item) { | ||
config.set('autoNightMode', item.checked); | ||
activate('auto-night-mode'); | ||
} | ||
}, { | ||
type: 'separator' | ||
@@ -823,2 +927,20 @@ }, { | ||
}, { | ||
label: 'Hide Tray Icon', | ||
type: 'checkbox', | ||
checked: config.get('hideTray'), | ||
click(item) { | ||
config.set('hideTray', item.checked); | ||
app.relaunch(); | ||
app.quit(); | ||
} | ||
}, { | ||
type: 'separator' | ||
}, { | ||
label: 'Toggle Side Bar', | ||
type: 'checkbox', | ||
checked: config.get('sideBarVisible'), | ||
click() { | ||
activate('toggle-side-bar'); | ||
} | ||
}, { | ||
label: 'Toggle Menu Bar', | ||
@@ -825,0 +947,0 @@ type: 'checkbox', |
{ | ||
"name": "tusk-app", | ||
"productName": "Tusk", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "๐Refined Evernote desktop app", | ||
@@ -18,12 +18,2 @@ "license": "MIT", | ||
"url": "github.com/mariocfhq" | ||
}, | ||
{ | ||
"name": "Thanasis Gkanos", | ||
"email": "athanasiosgkanos@hotmail.com", | ||
"url": "github.com/ThanasisGkanos" | ||
}, | ||
{ | ||
"name": "George Baxopoulos", | ||
"email": "baxopoulos.george@gmail.com", | ||
"url": "github.com/georgebax" | ||
} | ||
@@ -35,3 +25,5 @@ ], | ||
"pack": "build --dir", | ||
"dist": "build", | ||
"dist": "build --publish never", | ||
"clean": "node ./bin/clean.js", | ||
"authors": "./bin/update-authors.sh", | ||
"pack-all": "npm run pack:macos && npm run pack:linux && npm run pack:windows", | ||
@@ -43,19 +35,22 @@ "pack:macos": "electron-packager . --no-prune --overwrite --asar --out=dist --platform=darwin --arch=x64 --icon=static/Icon.icns && cd dist/Tusk-darwin-x64 && zip -ryXq9 ../Tusk-macos-v${npm_package_version}.zip Tusk.app && electron-installer-dmg ../Tusk-darwin-x64/Tusk.app Tusk --icon=../../static/Icon.icns && cp Tusk.dmg ../../dist", | ||
"dependencies": { | ||
"auto-launch": "^5.0.1", | ||
"chalk": "^2.3.0", | ||
"electron-config": "^1.0.0", | ||
"electron-context-menu": "^0.9.0", | ||
"electron-debug": "^1.3.0", | ||
"electron-dl": "^1.9.0", | ||
"electron-is-dev": "^0.1.2", | ||
"fs-extra": "^4.0.2", | ||
"ms": "^2.0.0", | ||
"fs-extra": "^4.0.2", | ||
"simple-get": "^2.7.0", | ||
"time-stamp": "^2.0.0", | ||
"electron-dl": "^1.9.0", | ||
"electron-is-dev": "^0.1.2", | ||
"electron-debug": "^1.3.0", | ||
"electron-config": "^1.0.0", | ||
"electron-context-menu": "^0.9.0" | ||
"time-stamp": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"xo": "^0.19.0", | ||
"electron": "^1.7.8", | ||
"electron-packager": "^9.1.0", | ||
"electron-builder": "^19.33.0", | ||
"electron-builder-squirrel-windows": "^19.33.0", | ||
"electron-installer-dmg": "^0.2.1" | ||
"electron": "1.7.8", | ||
"electron-builder": "19.33.0", | ||
"electron-builder-squirrel-windows": "19.33.0", | ||
"electron-installer-dmg": "0.2.1", | ||
"electron-packager": "9.1.0", | ||
"rimraf": "^2.6.2", | ||
"xo": "^0.19.0" | ||
}, | ||
@@ -76,3 +71,3 @@ "xo": { | ||
], | ||
"appId": "com.champloohq.tusk", | ||
"appId": "com.klauscfhq.tusk", | ||
"linux": { | ||
@@ -79,0 +74,0 @@ "category": "Office", |
<h1 align="center"> | ||
<img src="https://cdn.rawgit.com/klauscfhq/tusk/33f2eae5/media/logo.png" width="20%"><br/>Tusk | ||
</h1> | ||
<h4 align="center"> | ||
๐ Refined Evernote desktop app | ||
</h4> | ||
<div align="center"> | ||
<a href="https://github.com/klauscfhq/tusk"> | ||
<img src="https://cdn.rawgit.com/klauscfhq/tusk/33f2eae5/media/header.png" alt="Tusk" width="100%"> | ||
<img src="https://cdn.rawgit.com/klauscfhq/tusk/33f2eae5/media/note-navigation.gif" alt="Tusk" width="100%"> | ||
</a> | ||
</h1> | ||
</div> | ||
> ๐ Refined Evernote desktop app | ||
[](https://travis-ci.org/klauscfhq/tusk) [](https://ci.appveyor.com/project/klauscfhq/tusk) [](https://dependencyci.com/github/klauscfhq/tusk) [](https://github.com/klauscfhq/tusk) [](https://gitter.im/klauscfhq/tusk) [](https://github.com/klauscfhq/tusk/releases) [](https://github.com/sindresorhus/awesome-electron) | ||
[](https://travis-ci.org/klauscfhq/tusk) [](https://ci.appveyor.com/project/klauscfhq/tusk) [](https://dependencyci.com/github/klauscfhq/tusk) [](https://github.com/klauscfhq/tusk) [](https://gitter.im/klauscfhq/tusk) [](https://github.com/klauscfhq/tusk/releases) [](https://github.com/sindresorhus/awesome-electron) | ||
## Description | ||
@@ -19,26 +25,34 @@ | ||
## Features | ||
- [Vibrant Themes](#vibrant-themes) ๐ | ||
- [Sepia Theme](#sepia-theme) | ||
- [Dark Theme](#dark-theme) | ||
- [Black Theme](#black-theme) | ||
- [Focus Mode](#focus-mode) | ||
- [Compact Mode](#compact-mode) | ||
- [Note Navigation](#note-navigation) | ||
- [Note Printing](#note-printing) | ||
- [Custom Shortcut Keys](#custom-shortcut-keys) | ||
- [Scalable Interface](#scalable-interface) | ||
- [Export Notes](#export-notes) | ||
- [Yinxiang Support](#yinxiang-support) | ||
- [Auto Night Mode](#auto-night-mode) | ||
- [Keyboard Shortcuts](#keyboard-shortcuts) | ||
- [Build-in Markdown](#build-in-markdown) | ||
- [Cross Platform](https://github.com/klauscfhq/tusk/releases/latest) | ||
- Automagical Auto-updates ๐ | ||
- In-app Notifications | ||
- Background Behavior | ||
- Launch on Start | ||
- Drag and Drop Files | ||
<sup>๐ Macos only atm</sup><br/> | ||
<sup>๐ Windows only atm</sup> | ||
## Contents | ||
- [Description](#description) | ||
- [Features](#features) | ||
- [Install](#install) | ||
- [Features](#features) | ||
- [Vibrant Themes](#vibrant-themes) ๐ | ||
- [Sepia Theme](#sepia-theme) | ||
- [Dark Theme](#dark-theme) | ||
- [Black Theme](#black-theme) | ||
- [Focus Mode](#focus-mode) | ||
- [Compact Mode](#compact-mode) | ||
- [Note Navigation](#note-navigation) | ||
- [Note Printing](#note-printing) | ||
- [Custom Shortcut Keys](#custom-shortcut-keys) | ||
- [Scalable Interface](#scalable-interface) | ||
- [Export Notes](#export-notes) | ||
- [Yinxiang Support](#yinxiang-support) | ||
- [Keyboard Shortcuts](#keyboard-shortcuts) | ||
- [Build-in Markdown](#build-in-markdown) | ||
- [Cross Platform](https://github.com/klauscfhq/tusk/releases/latest) | ||
- Automagical Auto-updates ๐ | ||
- In-app Notifications | ||
- Background Behavior | ||
- Drag and Drop Files | ||
- [Related Apps](#related-apps) | ||
@@ -49,5 +63,2 @@ - [Team](#team) | ||
<sup>๐ Macos only atm</sup><br/> | ||
<sup>๐ Windows only atm</sup> | ||
## Install | ||
@@ -57,2 +68,4 @@ | ||
Macos users can also install through [homebrew-cask](https://caskroom.github.io/) `brew cask install tusk` | ||
## Features | ||
@@ -180,2 +193,6 @@ | ||
### Auto Night Mode | ||
Press <kbd>Cmd/Ctrl</kbd> <kbd>Alt</kbd> <kbd>N</kbd> and allow Tusk to intelligently adjust to your environment. | ||
### Keyboard shortcuts | ||
@@ -220,2 +237,3 @@ | ||
Increase Indentation | <kbd>Cmd/Ctrl</kbd> <kbd>Alt</kbd> <kbd>K</kbd> | ||
Activate Auto Night Mode | <kbd>Cmd/Ctrl</kbd> <kbd>Alt</kbd> <kbd>N</kbd> | ||
Make Text Larger | <kbd>Cmd/Ctrl</kbd> <kbd>Shift</kbd> <kbd>=</kbd> | ||
@@ -222,0 +240,0 @@ Export Note as PDF | <kbd>Cmd/Ctrl</kbd> <kbd>Shift</kbd> <kbd>E</kbd> |
22
tray.js
'use strict'; | ||
const path = require('path'); | ||
const electron = require('electron'); | ||
const config = require('./config'); | ||
@@ -102,4 +103,25 @@ const app = electron.app; | ||
}, { | ||
label: 'Auto Night Mode', | ||
type: 'checkbox', | ||
checked: config.get('autoNightMode'), | ||
click(item) { | ||
showWin(); | ||
config.set('autoNightMode', item.checked); | ||
activate('auto-night-mode'); | ||
} | ||
}, { | ||
type: 'separator' | ||
}, { | ||
label: 'Hide Tray Icon', | ||
type: 'checkbox', | ||
checked: config.get('hideTray'), | ||
click(item) { | ||
showWin(); | ||
config.set('hideTray', item.checked); | ||
app.relaunch(); | ||
app.quit(); | ||
} | ||
}, { | ||
type: 'separator' | ||
}, { | ||
label: `Settings`, | ||
@@ -106,0 +128,0 @@ click() { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
6463559
67
3175
300
11
7
4
+ Addedauto-launch@^5.0.1
+ Addedchalk@^2.3.0
+ Addedansi-styles@3.2.1(transitive)
+ Addedapplescript@1.0.0(transitive)
+ Addedauto-launch@5.0.6(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedsupports-color@5.5.0(transitive)
+ Addeduntildify@3.0.3(transitive)
+ Addedwinreg@1.2.4(transitive)