From 325d1996c61843ed7d0f3af5948cfa31c1b6892c Mon Sep 17 00:00:00 2001 From: Pascal Widdershoven Date: Mon, 15 Feb 2016 08:38:21 +0100 Subject: [PATCH 1/7] Add default Mac application menu All Mac apps generally have this menu, allows to hide the app with the default shortcut. --- src/main/menus/app.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/main/menus/app.js b/src/main/menus/app.js index 68fdb8a4..e56dec54 100644 --- a/src/main/menus/app.js +++ b/src/main/menus/app.js @@ -7,6 +7,24 @@ var createTemplate = function(mainWindow) { var app_name = electron.app.getName(); var first_menu_name = (process.platform === 'darwin') ? app_name : 'File'; var template = []; + + const platformAppMenu = process.platform === 'darwin' ? [{ + type: 'separator' + }, { + label: 'Hide ' + app_name, + accelerator: 'Command+H', + selector: 'hide:' + }, { + label: 'Hide Others', + accelerator: 'Command+Shift+H', + selector: 'hideOtherApplications:' + }, { + label: 'Show All', + selector: 'unhideAllApplications:' + }, { + type: 'separator' + }] : []; + template.push({ label: first_menu_name, submenu: [{ @@ -17,7 +35,7 @@ var createTemplate = function(mainWindow) { click: function(item, focusedWindow) { mainWindow.loadURL('file://' + __dirname + '/browser/settings.html'); } - }, { + }, ...platformAppMenu, { label: 'Quit', accelerator: 'CmdOrCtrl+Q', click: function(item, focusedWindow) { From 3168135082773d4a06cf5d195b47252c76db2bbd Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Tue, 16 Feb 2016 21:19:13 +0900 Subject: [PATCH 2/7] Update version to 1.0.6 --- package.json | 2 +- src/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 50b9969c..3f3ae747 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron-mattermost", - "version": "1.0.5", + "version": "1.0.6", "description": "Electron-based desktop application for Mattermost", "main": "main.js", "author": "Yuya Ochiai", diff --git a/src/package.json b/src/package.json index 806c7c98..724014f4 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "electron-mattermost", - "version": "1.0.5", + "version": "1.0.6", "description": "Electron-based desktop application for Mattermost", "main": "main.js", "author": "Yuya Ochiai", From 9fdf2106b27744e1d3cff677cc94972f3657fedc Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Fri, 19 Feb 2016 00:20:19 +0900 Subject: [PATCH 3/7] Update CONTRIBUTING.md --- CONTRIBUTING.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ad8293a5..e77ffb3a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,23 +1,30 @@ # Contributing Guidelines -Thank you for your contributing! My requirements are few things. Please read them. +Thank you for your contributing! My requests are few things. Please read below. ## Issue -Thank you for feedback. When you report a problem, please pay attention to fowllowing points. +Thank you for feedback. When you report a problem, please pay attention to following points. ### Does it happen on web browsers? (especially Chrome) -electron-mattermost is based on Electron. It integrates Chrome as a browser window. If the problem appears on web browsers, it may be the issue for Mattermost (or Chrome). +electron-mattermost is based on Electron. It integrates Chrome as a browser window. +If the problem appears on web browsers, it may be the issue for Mattermost (or Chrome). + +### Try "Clear Cache and Reload" +It's available as `Ctrl(Command) + Shift + R`. +Some layout problems are caused by browser cache. +Especially, this kind of issue might happen when you have updated Mattermost server. ### Write detailed information -Following points are important to understand the problem. +Following points are very helpful to understand the problem. +* How to reproduce, step-by-step +* Expected behavior (or what is wrong) +* Screenshots (for GUI issues) * electron-mattermost version * OS * Mattermost version -* Expected behavior (or what is wrong) -* How to reproduce, step-by-step ## Pull request -PR is welcome. +PR is welcome. Thank you for your great works! When you edit the code, please run `npm run prettify` before your `git commit`. Codes will be formatted. From 3e49f6935ba3e9c0325773f682a450cc05c230c9 Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Fri, 19 Feb 2016 00:41:59 +0900 Subject: [PATCH 4/7] Update README.md --- README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e40dbc20..5aa8c8de 100644 --- a/README.md +++ b/README.md @@ -7,18 +7,17 @@ ### Desktop integration * Tabs for multiple teams -* Notifications - * Desktop Notification - * Windows 10: Toast - * Windows 7-8.1: Balloon - * OS X: Notification Center - * Linux: libnotify ([Electron's notification spec](http://electron.atom.io/docs/v0.36.0/tutorial/desktop-environment-integration/#linux)) - * Badges for unread channels +* Desktop Notification + * Windows 10: Toast + * Windows 7-8.1: Balloon (fallback behavior, so lesser support) + * OS X: Notification Center + * Linux: libnotify ([Electron's notification spec](http://electron.atom.io/docs/v0.36.0/tutorial/desktop-environment-integration/#linux)) +* Badges for unread channels and mention * Resident application ### Pre-packaged You don't have to install any other software. - +Packages are available at [release page](http://github.com/yuya-oc/electron-mattermost/releases). ## Usage From f8f525c6df3e60f6bd6e08413bd7f2e1b5e5eebe Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Fri, 19 Feb 2016 00:59:40 +0900 Subject: [PATCH 5/7] Fix "Toggle Fullscreen" not working win.setFullScreenable() is necessary from Electron v0.36.6. fix #37 --- src/main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.js b/src/main.js index c071f3fe..8dd38c02 100644 --- a/src/main.js +++ b/src/main.js @@ -121,10 +121,15 @@ app.on('ready', function() { window_options = {}; } window_options.icon = path.resolve(__dirname, 'resources/appicon.png'); + window_options.fullScreenable = true; mainWindow = new BrowserWindow(window_options); + mainWindow.setFullScreenable(true); // fullscreenable option has no effect. if (window_options.maximized) { mainWindow.maximize(); } + if (window_options.fullscreen) { + mainWindow.setFullScreen(true); + } // and load the index.html of the app. mainWindow.loadURL('file://' + __dirname + '/browser/index.html'); From 81baf05c78cabc6a314254a523bd1813479dea57 Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Sat, 20 Feb 2016 21:41:00 +0900 Subject: [PATCH 6/7] Fix desktop notification not working with Mattermost 2.0 Fix #36 Notification.permission was missing in override --- src/browser/webview/mattermost.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/browser/webview/mattermost.js b/src/browser/webview/mattermost.js index 6e6f8bf5..859472da 100644 --- a/src/browser/webview/mattermost.js +++ b/src/browser/webview/mattermost.js @@ -115,6 +115,7 @@ function overrideNotificationWithBalloon() { options: options }); }; + Notification.permission = NativeNotification.permission; Notification.requestPermission = function(callback) { callback('granted'); }; @@ -126,6 +127,7 @@ function overrideNotification() { Notification = function(title, options) { this.notification = new NativeNotification(title, options); }; + Notification.permission = NativeNotification.permission; Notification.requestPermission = function(callback) { callback('granted'); }; From 0661caef55632131f589dae31c5fdc84bf402dd4 Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Sat, 20 Feb 2016 21:47:49 +0900 Subject: [PATCH 7/7] Update version to 1.0.7 --- package.json | 2 +- src/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3f3ae747..08bc167b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron-mattermost", - "version": "1.0.6", + "version": "1.0.7", "description": "Electron-based desktop application for Mattermost", "main": "main.js", "author": "Yuya Ochiai", diff --git a/src/package.json b/src/package.json index 724014f4..9ecbd50b 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "electron-mattermost", - "version": "1.0.6", + "version": "1.0.7", "description": "Electron-based desktop application for Mattermost", "main": "main.js", "author": "Yuya Ochiai",