Skip to content

Commit

Permalink
v6.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sidneys committed Oct 31, 2017
1 parent 642500f commit b928876
Show file tree
Hide file tree
Showing 67 changed files with 1,408 additions and 3,154 deletions.
27 changes: 26 additions & 1 deletion RELEASENOTES.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
{
"6.3.1": {
"🍾 features": [
"Rich Notifications: Automatic Fetch & display of Favicons for all received URL pushes",
"YouTube Thumbnails: Pushed YouTube URLs include thumbnail of the linked video"
],
"💎 improved": [
"Show & focus the main window on tray menu click (Windows, Linux) (#57)"
],
"👷 internals": [
"Exposed internal tooling as atomic modules within development namespace (`@sidneys`)",
"Upgrades `node_modules`"
]
},
"6.2.7": {
"🚨 fixed": [
"Fixes rendering of release notes after update completion"
],
"💎 improved": [
"Changed application configuration file to reflect application name",
"Added `.json` extension to application configuration file"
],
"👷 internals": [
"Upgrades `node_modules`"
]
},
"6.2.6": {
"🍾 features": [
"Adds package repositories for `Debian`, `elementary OS`, `Enterprise Linux`, `Fedora`, `openSUSE`, `LinuxMint`, `Ubuntu` (Linux) (#56)"
],
"📒 documentation": [
"Adds new section: `Installation via Linux package manager`"
"Adds `README.md` section: `Installation via Linux package manager`"
],
"👷 internals": [
"Upgrades `node_modules`"
Expand Down
18 changes: 9 additions & 9 deletions app/scripts/main/components/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const { app, BrowserWindow } = electron;
* @constant
*/
const appRootPath = require('app-root-path');
const logger = require('@sidneys/logger')({ write: true });

/**
* Modules
Expand All @@ -46,15 +47,14 @@ app.disableHardwareAcceleration();
*/
/* eslint-disable no-unused-vars */
const globals = require(path.join(appRootPath['path'], 'app', 'scripts', 'main', 'components', 'globals'));
const logger = require(path.join(appRootPath.path, 'lib', 'logger'))({ write: true });
const appMenu = require(path.join(appRootPath.path, 'app', 'scripts', 'main', 'menus', 'app-menu')); // jshint ignore:line
const mainWindow = require(path.join(appRootPath.path, 'app', 'scripts', 'main', 'windows', 'main-window')); // jshint ignore:line
const configurationManager = require(path.join(appRootPath.path, 'app', 'scripts', 'main', 'managers', 'configuration-manager')); // jshint ignore:line
const trayMenu = require(path.join(appRootPath.path, 'app', 'scripts', 'main', 'menus', 'tray-menu')); // jshint ignore:line
const updaterService = require(path.join(appRootPath.path, 'app', 'scripts', 'main', 'services', 'updater-service')); // jshint ignore:line
const powerService = require(path.join(appRootPath.path, 'app', 'scripts', 'main', 'services', 'power-service')); // jshint ignore:line
const debugService = require(path.join(appRootPath.path, 'app', 'scripts', 'main', 'services', 'debug-service')); // jshint ignore:line
const snoozerService = require(path.join(appRootPath.path, 'app', 'scripts', 'main', 'services', 'snoozer-service')); // jshint ignore:line
const appMenu = require(path.join(appRootPath.path, 'app', 'scripts', 'main', 'menus', 'app-menu'));
const mainWindow = require(path.join(appRootPath.path, 'app', 'scripts', 'main', 'windows', 'main-window'));
const configurationManager = require(path.join(appRootPath.path, 'app', 'scripts', 'main', 'managers', 'configuration-manager'));
const trayMenu = require(path.join(appRootPath.path, 'app', 'scripts', 'main', 'menus', 'tray-menu'));
const updaterService = require(path.join(appRootPath.path, 'app', 'scripts', 'main', 'services', 'updater-service'));
const powerService = require(path.join(appRootPath.path, 'app', 'scripts', 'main', 'services', 'power-service'));
const debugService = require(path.join(appRootPath.path, 'app', 'scripts', 'main', 'services', 'debug-service'));
const snoozerService = require(path.join(appRootPath.path, 'app', 'scripts', 'main', 'services', 'snoozer-service'));
/* eslint-enable */


Expand Down
37 changes: 20 additions & 17 deletions app/scripts/main/managers/configuration-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/
const fs = require('fs-extra');
const path = require('path');
const util = require('util');

/**
* Modules
Expand All @@ -35,8 +34,8 @@ const electronSettings = require('electron-settings');
* Internal
* @constant
*/
const logger = require(path.join(appRootPath, 'lib', 'logger'))({ write: true });
const platformHelper = require(path.join(appRootPath, 'lib', 'platform-helper'));
const logger = require('@sidneys/logger')({ write: true });
const platformTools = require('@sidneys/platform-tools');


/**
Expand All @@ -47,26 +46,22 @@ const platformHelper = require(path.join(appRootPath, 'lib', 'platform-helper'))
const appName = global.manifest.name;
const appCurrentVersion = global.manifest.version;

/**
* Modules
* Configuration
*/
const autoLauncher = new AutoLaunch({ name: appName, mac: { useLaunchAgent: true } });
/** @namespace electronSettings.delete */
/** @namespace electronSettings.file */
/** @namespace electronSettings.get */
/** @namespace electronSettings.getAll */
/** @namespace electronSettings.set */
/** @namespace electronSettings.setAll */

/**
* Filesystem
* @constant
* @default
*/
const appLogDirectory = (new Appdirectory(appName)).userLogs();
const appSettingsFilepath = path.join(path.dirname(electronSettings.file()), `${appName}.json`);
const appSoundDirectory = path.join(appRootPath, 'sounds').replace('app.asar', 'app.asar.unpacked');

/**
* Modules
* Configuration
*/
const autoLauncher = new AutoLaunch({ name: appName, mac: { useLaunchAgent: true } });
electronSettings.setPath(appSettingsFilepath);

/**
* @constant
* @default
Expand Down Expand Up @@ -94,7 +89,7 @@ let setAppTrayOnly = (trayOnly) => {
if (!primaryWindow.getBounds()) { return; }


switch (platformHelper.type) {
switch (platformTools.type) {
case 'darwin':
if (trayOnly) {
app.dock.hide();
Expand All @@ -112,9 +107,17 @@ let setAppTrayOnly = (trayOnly) => {
}, defaultInterval);
};

/** @namespace electronSettings.delete */
/** @namespace electronSettings.deleteAll */
/** @namespace electronSettings.file */
/** @namespace electronSettings.get */
/** @namespace electronSettings.getAll */
/** @namespace electronSettings.set */
/** @namespace electronSettings.setAll */
/** @namespace electronSettings.setPath */

/**
* Configuration Items
* @namespace
*/
let configurationItems = {
/**
Expand Down
11 changes: 2 additions & 9 deletions app/scripts/main/menus/app-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,9 @@ const { app, Menu, shell, webContents } = require('electron');
* External
* @constant
*/
const appRootPath = require('app-root-path')['path'];
const Appdirectory = require('appdirectory');

/**
* Modules
* Internal
* @constant
*/
const isDebug = require(path.join(appRootPath, 'lib', 'is-env'))('debug');
const logger = require(path.join(appRootPath, 'lib', 'logger'))({ write: false });
const isDebug = require('@sidneys/is-env')('debug');
const logger = require('@sidneys/logger')({ write: false });


/**
Expand Down
58 changes: 30 additions & 28 deletions app/scripts/main/menus/tray-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ const { app, ipcMain, Menu, Tray, webContents } = require('electron');
* @constant
*/
const appRootPath = require('app-root-path')['path'];
const logger = require('@sidneys/logger')({ write: true });
const platformTools = require('@sidneys/platform-tools');

/**
* Modules
* Internal
* @constant
*/
const configurationManager = require(path.join(appRootPath, 'app', 'scripts', 'main', 'managers', 'configuration-manager'));
const logger = require(path.join(appRootPath, 'lib', 'logger'))({ write: true });
const dialogProvider = require(path.join(appRootPath, 'app', 'scripts', 'main', 'providers', 'dialog-provider'));
const platformHelper = require(path.join(appRootPath, 'lib', 'platform-helper'));


/**
Expand All @@ -53,26 +53,26 @@ const appSoundDirectory = global.filesystem.directories.sounds;
* Tray icons
* @constant
*/
const trayIconDefault = path.join(appRootPath, 'app', 'images', `${platformHelper.type}-tray-icon-default${platformHelper.templateImageExtension(platformHelper.type)}`);
const trayIconTransparent = path.join(appRootPath, 'app', 'images', `${platformHelper.type}-tray-icon-transparent${platformHelper.templateImageExtension(platformHelper.type)}`);
const trayIconTransparentPause = path.join(appRootPath, 'app', 'images', `${platformHelper.type}-tray-icon-transparent-pause${platformHelper.templateImageExtension(platformHelper.type)}`);
const trayIconDefault = path.join(appRootPath, 'app', 'images', `${platformTools.type}-tray-icon-default${platformTools.templateImageExtension(platformTools.type)}`);
const trayIconTransparent = path.join(appRootPath, 'app', 'images', `${platformTools.type}-tray-icon-transparent${platformTools.templateImageExtension(platformTools.type)}`);
const trayIconTransparentPause = path.join(appRootPath, 'app', 'images', `${platformTools.type}-tray-icon-transparent-pause${platformTools.templateImageExtension(platformTools.type)}`);

/**
* Tray images
* @constant
*/
const trayMenuItemImageAppLaunchOnStartup = path.join(appRootPath, 'app', 'images', `tray-item-appLaunchOnStartup${platformHelper.menuItemImageExtension}`);
const trayMenuItemImageAppShowBadgeCount = path.join(appRootPath, 'app', 'images', `tray-item-appShowBadgeCount${platformHelper.menuItemImageExtension}`);
const trayMenuItemImageAppTrayOnly = path.join(appRootPath, 'app', 'images', `tray-item-appTrayOnly${platformHelper.menuItemImageExtension}`);
const trayMenuItemImagePushbulletHideNotificationBody = path.join(appRootPath, 'app', 'images', `tray-item-pushbulletHideNotificationBody${platformHelper.menuItemImageExtension}`);
const trayMenuItemImagePushbulletRepeatRecentNotifications = path.join(appRootPath, 'app', 'images', `tray-item-pushbulletRepeatRecentNotifications${platformHelper.menuItemImageExtension}`);
const trayMenuItemImagePushbulletSmsEnabled = path.join(appRootPath, 'app', 'images', `tray-item-pushbulletSmsEnabled${platformHelper.menuItemImageExtension}`);
const trayMenuItemImagePushbulletSoundEnabled = path.join(appRootPath, 'app', 'images', `tray-item-pushbulletSoundEnabled${platformHelper.menuItemImageExtension}`);
const trayMenuItemImagePushbulletSoundFile = path.join(appRootPath, 'app', 'images', `tray-item-pushbulletSoundFile${platformHelper.menuItemImageExtension}`);
const trayMenuItemImageReconnect = path.join(appRootPath, 'app', 'images', `tray-item-reconnect${platformHelper.menuItemImageExtension}`);
const trayMenuItemImageReset = path.join(appRootPath, 'app', 'images', `tray-item-reset${platformHelper.menuItemImageExtension}`);
const trayMenuItemImageSnooze = path.join(appRootPath, 'app', 'images', `tray-item-snooze${platformHelper.menuItemImageExtension}`);
const trayMenuItemImageWindowTopmost = path.join(appRootPath, 'app', 'images', `tray-item-windowTopmost${platformHelper.menuItemImageExtension}`);
const trayMenuItemImageAppLaunchOnStartup = path.join(appRootPath, 'app', 'images', `tray-item-appLaunchOnStartup${platformTools.menuItemImageExtension}`);
const trayMenuItemImageAppShowBadgeCount = path.join(appRootPath, 'app', 'images', `tray-item-appShowBadgeCount${platformTools.menuItemImageExtension}`);
const trayMenuItemImageAppTrayOnly = path.join(appRootPath, 'app', 'images', `tray-item-appTrayOnly${platformTools.menuItemImageExtension}`);
const trayMenuItemImagePushbulletHideNotificationBody = path.join(appRootPath, 'app', 'images', `tray-item-pushbulletHideNotificationBody${platformTools.menuItemImageExtension}`);
const trayMenuItemImagePushbulletRepeatRecentNotifications = path.join(appRootPath, 'app', 'images', `tray-item-pushbulletRepeatRecentNotifications${platformTools.menuItemImageExtension}`);
const trayMenuItemImagePushbulletSmsEnabled = path.join(appRootPath, 'app', 'images', `tray-item-pushbulletSmsEnabled${platformTools.menuItemImageExtension}`);
const trayMenuItemImagePushbulletSoundEnabled = path.join(appRootPath, 'app', 'images', `tray-item-pushbulletSoundEnabled${platformTools.menuItemImageExtension}`);
const trayMenuItemImagePushbulletSoundFile = path.join(appRootPath, 'app', 'images', `tray-item-pushbulletSoundFile${platformTools.menuItemImageExtension}`);
const trayMenuItemImageReconnect = path.join(appRootPath, 'app', 'images', `tray-item-reconnect${platformTools.menuItemImageExtension}`);
const trayMenuItemImageReset = path.join(appRootPath, 'app', 'images', `tray-item-reset${platformTools.menuItemImageExtension}`);
const trayMenuItemImageSnooze = path.join(appRootPath, 'app', 'images', `tray-item-snooze${platformTools.menuItemImageExtension}`);
const trayMenuItemImageWindowTopmost = path.join(appRootPath, 'app', 'images', `tray-item-windowTopmost${platformTools.menuItemImageExtension}`);


/**
Expand Down Expand Up @@ -237,7 +237,7 @@ let createTrayMenuTemplate = () => {
},
{
id: 'appTrayOnly',
label: platformHelper.isMacOS ? 'Hide Dock Icon' : 'Minimize to Tray',
label: platformTools.isMacOS ? 'Hide Dock Icon' : 'Minimize to Tray',
icon: trayMenuItemImageAppTrayOnly,
type: 'checkbox',
checked: configurationManager('appTrayOnly').get(),
Expand All @@ -247,7 +247,7 @@ let createTrayMenuTemplate = () => {
},
{
id: 'appShowBadgeCount',
visible: platformHelper.isMacOS,
visible: platformTools.isMacOS,
label: 'Dock Icon Count',
icon: trayMenuItemImageAppShowBadgeCount,
type: 'checkbox',
Expand Down Expand Up @@ -357,7 +357,8 @@ class TrayMenu extends Tray {
* Init
*/
init() {
this.setToolTip(appProductName);
logger.debug('init');

this.setContextMenu(this.menu);

/**
Expand All @@ -366,15 +367,16 @@ class TrayMenu extends Tray {
this.on('click', () => {
logger.debug('TrayMenu#click');

if (platformHelper.isWindows) {
const mainWindow = getMainWindow();
if (!mainWindow) { return; }
if (platformTools.isMacOS) { return; }

if (mainWindow.isVisible()) {
mainWindow.hide();
} else {
mainWindow.show();
}
const mainWindow = getMainWindow();
if (!mainWindow) { return; }

if (mainWindow.isVisible()) {
mainWindow.hide();
} else {
mainWindow.show();
app.focus();
}
});

Expand Down
17 changes: 7 additions & 10 deletions app/scripts/main/providers/dialog-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,8 @@ const { app, BrowserWindow, dialog } = electron || electron.remote;
* External
* @constant
*/
const appRootPath = require('app-root-path')['path'];

/**
* Modules
* Internal
* @constant
*/
const logger = require(path.join(appRootPath, 'lib', 'logger'))({ write: true });
const platformHelper = require(path.join(appRootPath, 'lib', 'platform-helper'));
const logger = require('@sidneys/logger')({ write: true });
const platformTools = require('@sidneys/platform-tools');


/**
Expand All @@ -55,6 +48,8 @@ const appProductName = global.manifest.productName;
let showMessage = (title = appProductName, message = title, buttonList = ['OK'], type = 'info', callback = () => {}) => {
logger.debug('showMessage');

logger.debug('showMessage', 'title', title, 'message', message, 'buttonList', buttonList, 'type', type);

dialog.showMessageBox(BrowserWindow.getFocusedWindow(), {
type: type,
title: title,
Expand Down Expand Up @@ -145,7 +140,7 @@ let file = (dialogTitle = appProductName, extensionList = ['*'], initialFolder =
let error = (message, callback = () => {}) => {
logger.debug('error');

if (platformHelper.isMacOS) {
if (platformTools.isMacOS) {
app.dock.bounce('critical');
}

Expand Down Expand Up @@ -187,6 +182,8 @@ let info = (title, message, callback = () => {}) => {
* @public
*/
let question = (title, message, callback = () => {}) => {
logger.debug('question');

app.focus();

showMessage(title, message, ['Yes', 'No'], 'question', callback);
Expand Down
16 changes: 1 addition & 15 deletions app/scripts/main/providers/notification-provider.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
'use strict';


/**
* Modules
* Node
* @constant
*/
const path = require('path');

/**
* Modules
* Electron
Expand All @@ -22,14 +15,7 @@ const { Notification } = electron;
* @constant
*/
const _ = require('lodash');
const appRootPath = require('app-root-path')['path'];

/**
* Modules
* Internal
* @constant
*/
const logger = require(path.join(appRootPath, 'lib', 'logger'))({ write: true });
const logger = require('@sidneys/logger')({ write: true });


/**
Expand Down
Loading

0 comments on commit b928876

Please sign in to comment.