Compare commits

..

46 Commits

Author SHA1 Message Date
akashnimare
0372befc5a bump version v0.5.7 2017-02-08 10:37:02 +05:30
akashnimare
063799a053 Updated login page title + placeholder 2017-02-07 18:37:14 +05:30
akashnimare
297b307726 update electron-builder to v13.0.0 2017-02-07 14:20:43 +05:30
akashnimare
deed66973f update electron-builder to v13.0.0 2017-02-07 14:20:17 +05:30
akashnimare
03486e438d remove release name+notes details from autoupdater 2017-02-07 14:17:04 +05:30
Akash Nimare
e113f59aad Bump electron-builder to 12.3.1 2017-02-06 02:30:35 +05:30
Akash Nimare
29ece4824a Merge pull request #105 from zulip/nsis
🎉 switched to NSIS + autoupdates
2017-02-06 01:23:55 +05:30
akashnimare
66c62c55e2 fixed logger undefined error 2017-02-06 01:09:03 +05:30
akashnimare
40852942d2 fixed releaseName undefined error 2017-02-02 16:41:52 +05:30
akashnimare
15c8591691 windows installer >> install per all users 2017-02-02 16:16:32 +05:30
akashnimare
e21902a5e3 🆙 electron-updater to 1.4.1 2017-02-02 15:37:10 +05:30
akashnimare
a5d42e8ccd log whats happening in auto-updater 2017-02-02 12:06:13 +05:30
akashnimare
0923df7250 import autoupdater 2017-02-02 11:52:27 +05:30
akashnimare
37f5258210 updated to electron-builder's latest version 2017-02-02 11:07:31 +05:30
akashnimare
19819f7d48 squirrel startup is not needed for NSIS 2017-01-28 21:21:52 +05:30
akashnimare
40f74cdac2 removed auto updater feed 2017-01-28 13:44:07 +05:30
akashnimare
e4ba3b9721 Added electron-updater dependency autoupdates 2017-01-28 13:21:41 +05:30
akashnimare
9a221585b9 set target to NSIS 2017-01-27 11:23:13 +05:30
Akash Nimare
069a0ff306 Added iconUrl to win.build 2017-01-26 02:10:17 +05:30
akashnimare
3153fb91da 🚀 Added back/forward navigation 2017-01-26 01:30:21 +05:30
Akash Nimare
92d4d27fa8 Added app icon >> windows installer 2017-01-26 00:50:50 +05:30
Akash Nimare
209fc4a65c Added squirrel-windows dependency 2017-01-26 00:47:55 +05:30
Akash Nimare
5e9ecedecd Updated electron-builder to v11.5.1 2017-01-25 23:48:30 +05:30
Akash Nimare
613df32bf1 Updated Prerequisites 2017-01-25 23:03:35 +05:30
Akash Nimare
7606f37695 Merge pull request #102 from zulip/dev
update spellchecker to v1.0.0
2017-01-25 22:55:36 +05:30
akashnimare
a2f758a46b spellchecker v1.0.0 2017-01-24 13:03:05 +05:30
akashnimare
2a477abe5f Added log-out shortcut 2017-01-14 23:43:09 +05:30
akashnimare
5f027820f4 ✏️ small typos fixed 2017-01-14 22:42:28 +05:30
Akash Nimare
9e75861546 Fixing travis test (linux) 2017-01-07 17:50:56 +05:30
akashnimare
4060596474 🎨 fixed linting errors 2017-01-07 17:27:54 +05:30
Akash Nimare
2e5888c8af Merge pull request #96 from jajodiaraghav/add_clear_cache_option
Added Clear-cache option in menu
2017-01-07 17:07:09 +05:30
Raghav Jajodia
03d1188e14 Added clear cache option 2017-01-07 17:00:03 +05:30
Raghav Jajodia
c91b0c209a Added clear cache option 2017-01-07 15:58:19 +05:30
Akash Nimare
531973194c Use stable module version
Using stable version of node modules. 
Using '*' or 'latest' in node modules version could cause unexpected results and could break your code.
2017-01-03 15:14:56 +05:30
akashnimare
4d1face275 Removed electron-context-menu 2017-01-03 14:45:04 +05:30
akashnimare
ca7503f1f0 using electron-builder v10.15.1 2017-01-03 14:42:52 +05:30
Akash Nimare
9c163b4166 Merge pull request #97 from zulip/dev
export spellchecker function
2017-01-02 19:19:11 +05:30
akashnimare
742afb1c09 export spellchecker function 2017-01-02 19:15:08 +05:30
Raghav Jajodia
f9f70f001b Added clear cache option 2017-01-02 13:50:19 +05:30
akashnimare
edf34efd86 Removed unnecessary dep. electron-dl 2016-12-31 22:26:42 +05:30
akashnimare
72ebed95da v0.5.4 2016-12-31 22:17:51 +05:30
Akash Nimare
975a6ab8bf electron-spellchecker
Downgrading since v0.7.1 is not working properly on linux.
2016-12-31 22:06:19 +05:30
akashnimare
3352301b67 :head_bandage: update electron-spellchecker 2016-12-31 20:28:09 +05:30
Akash Nimare
358260f766 Update README.md 2016-12-30 03:14:32 +05:30
Akash Nimare
b58052ce34 Merge pull request #94 from GervaisdeM/launch-script-tweak
rename zulip-electron-updater-and-launcher.sh to
2016-12-29 07:29:16 +05:30
GervaisdeM
de9ad8082b rename zulip-electron-updater-and-launcher.sh to
zulip-electron-launcher.sh

changed `npm upgrade` to `npm install`
2016-12-27 00:39:06 -04:00
15 changed files with 191 additions and 75 deletions

View File

@@ -14,10 +14,10 @@ multi-account, auto-updates etc.
## Prerequisites ## Prerequisites
* node >= v6.3.1 * node >= v6.3.1
* npm >= 3.10.3 * npm >= 3.10.3
* If you're on Debian or Ubuntu, you'll also need to install * python (v2.7.x recommended)
`nodejs-legacy`: * If you're on Debian or Ubuntu, you'll need to install following packages:
```sh ```sh
$ sudo apt-get install nodejs-legacy $ sudo apt-get install nodejs-legacy build-essential libxext-dev libxtst-dev libxkbfile-dev
``` ```
## Installation ## Installation
@@ -61,7 +61,7 @@ You can create Windows installer only when running on Windows, the same is true
- [x] Native Notifications - [x] Native Notifications
- [x] SpellChecker - [x] SpellChecker
- [x] OSX/Win/Linux installer - [x] OSX/Win/Linux installer
- [x] Automatic Updates (macOS) - [x] Automatic Updates (macOS/Windows)
- [x] Keyboard shortcuts - [x] Keyboard shortcuts
Description | Keys Description | Keys

View File

@@ -1,40 +1,46 @@
'use strict'; 'use strict';
const os = require('os'); // const os = require('os');
const {app, autoUpdater, dialog} = require('electron'); const {app, dialog} = require('electron');
const {autoUpdater} = require('electron-updater');
const version = app.getVersion(); // We don't need to call all of these since it's automatically handled by electron-updater
const platform = os.platform() + '_' + os.arch(); // usually returns darwin_64 // const version = app.getVersion();
// const platform = os.platform() + '_' + os.arch(); // usually returns darwin_64
const updaterFeedURL = 'http://zulipdesktop.herokuapp.com/update/' + platform + '/' + version; // const updaterFeedURL = 'http://zulipdesktop.herokuapp.com/update/' + platform + '/' + version;
function appUpdater() { function appUpdater() {
autoUpdater.setFeedURL(updaterFeedURL); // autoUpdater.setFeedURL(updaterFeedURL);
// Log whats happening // Log whats happening
const log = require('electron-log');
log.transports.file.level = 'info';
autoUpdater.logger = log;
// TODO send autoUpdater events to renderer so that we could // TODO send autoUpdater events to renderer so that we could
// it could console log in developer tools // it could console log in developer tools
/*
autoUpdater.on('error', err => console.log(err)); autoUpdater.on('error', err => console.log(err));
autoUpdater.on('checking-for-update', () => console.log('checking-for-update')); autoUpdater.on('checking-for-update', () => console.log('checking-for-update'));
autoUpdater.on('update-available', () => console.log('update-available')); autoUpdater.on('update-available', () => console.log('update-available'));
autoUpdater.on('update-not-available', () => console.log('update-not-available')); autoUpdater.on('update-not-available', () => console.log('update-not-available'));
*/
// Ask the user if update is available // Ask the user if update is available
autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => { autoUpdater.on('update-downloaded', (event, info) => {
let message = app.getName() + ' ' + releaseName + ' is now available. It will be installed the next time you restart the application.'; // let message = app.getName() + ' ' + info.releaseName + ' is now available. It will be installed the next time you restart the application.';
if (releaseNotes) { // if (info.releaseNotes) {
const splitNotes = releaseNotes.split(/[^\r]\n/); // const splitNotes = info.releaseNotes.split(/[^\r]\n/);
message += '\n\nRelease notes:\n'; // message += '\n\nRelease notes:\n';
splitNotes.forEach(notes => { // splitNotes.forEach(notes => {
message += notes + '\n\n'; // message += notes + '\n\n';
}); // });
} // }
// Ask user to update the app // Ask user to update the app
dialog.showMessageBox({ dialog.showMessageBox({
type: 'question', type: 'question',
buttons: ['Install and Relaunch', 'Later'], buttons: ['Install and Relaunch', 'Later'],
defaultId: 0, defaultId: 0,
message: 'A new version of ' + app.getName() + ' has been downloaded', message: 'A new version of ' + app.getName() + ' has been downloaded',
detail: message detail: 'It will be installed the next time you restart the application'
}, response => { }, response => {
if (response === 0) { if (response === 0) {
setTimeout(() => autoUpdater.quitAndInstall(), 1); setTimeout(() => autoUpdater.quitAndInstall(), 1);

View File

@@ -29,7 +29,7 @@ window.addDomain = function () {
ipcRenderer.send('new-domain', domain); ipcRenderer.send('new-domain', domain);
} else { } else {
document.getElementById('main').innerHTML = 'Connect'; document.getElementById('main').innerHTML = 'Connect';
document.getElementById('server-status').innerHTML = 'Not a vaild Zulip Server.'; document.getElementById('server-status').innerHTML = 'Not a valid Zulip Server.';
} }
}); });
}; };

View File

@@ -16,10 +16,11 @@ const {appUpdater} = require('./autoupdater');
const db = new JsonDB(app.getPath('userData') + '/domain.json', true, true); const db = new JsonDB(app.getPath('userData') + '/domain.json', true, true);
const data = db.getData('/'); const data = db.getData('/');
// Handling squirrel.windows events on windows /* Handling squirrel.windows events on windows
Update - Not needed for NSIS
if (require('electron-squirrel-startup')) { if (require('electron-squirrel-startup')) {
app.quit(); app.quit();
} } */
// adds debug features like hotkeys for triggering dev tools and reload // adds debug features like hotkeys for triggering dev tools and reload
require('electron-debug')(); require('electron-debug')();

View File

@@ -0,0 +1,69 @@
// Adopted from
// https://github.com/wozaki/twitter-js-apps/blob/9bc00eafd575fd180dc7a450e1b1daf425e67b80/redux/src/main/renderer/registries/electron/swipeNavigatorImpl.js
'use strict'
const {remote} = require('electron');
const THRESHOLD_DELTA_X = 70;
const THRESHOLD_LIMIT_DELTA_Y = 50;
const THRESHOLD_TIME = 50;
// TODO avoid module global state
let tracking = false;
let deltaX = 0;
let deltaY = 0;
let startTime = 0;
let time = 0;
module.exports.register = function register() {
remote.getCurrentWindow()
.on('scroll-touch-begin', onScrollBegin)
.on('scroll-touch-end', onScrollEnd)
.on('swipe', onSwipe)
window.addEventListener('wheel', onMouseWheel, {passive: true});
window.addEventListener('beforeunload', remove);
}
const remove = module.exports.remove = function remove() {
remote.getCurrentWindow()
.removeListener('scroll-touch-begin', onScrollBegin)
.removeListener('scroll-touch-end', onScrollEnd)
.removeListener('swipe', onSwipe)
window.removeEventListener('mousewheel', onMouseWheel);
window.removeEventListener('beforeunload', remove);
}
function onSwipe(e, direction) {
if (direction === 'left')
remote.getCurrentWebContents().goBack()
else if (direction === 'right')
remote.getCurrentWebContents().goForward()
}
function onMouseWheel(e) {
if (tracking) {
deltaX = deltaX + e.deltaX
deltaY = deltaY + e.deltaY
time = (new Date()).getTime() - startTime
}
}
function onScrollBegin() {
tracking = true
startTime = (new Date()).getTime()
}
function onScrollEnd() {
if (time > THRESHOLD_TIME && tracking && Math.abs(deltaY) < THRESHOLD_LIMIT_DELTA_Y)
if (deltaX > THRESHOLD_DELTA_X)
remote.getCurrentWebContents().goForward()
else if (deltaX < -THRESHOLD_DELTA_X)
remote.getCurrentWebContents().goBack()
tracking = false
deltaX = 0
deltaY = 0
startTime = 0
}

View File

@@ -2,6 +2,8 @@
const os = require('os'); const os = require('os');
const electron = require('electron'); const electron = require('electron');
const {dialog} = require('electron');
const app = electron.app; const app = electron.app;
const BrowserWindow = electron.BrowserWindow; const BrowserWindow = electron.BrowserWindow;
const shell = electron.shell; const shell = electron.shell;
@@ -19,6 +21,14 @@ function sendAction(action) {
win.webContents.send(action); win.webContents.send(action);
} }
function clearCache() {
const win = BrowserWindow.getAllWindows()[0];
const ses = win.webContents.session;
ses.clearCache(() => {
dialog.showMessageBox({type: 'info', buttons: [], message: 'Cache cleared!'});
});
}
const viewSubmenu = [ const viewSubmenu = [
{ {
label: 'Reload', label: 'Reload',
@@ -134,8 +144,15 @@ const darwinTpl = [
{ {
type: 'separator' type: 'separator'
}, },
{
label: 'Clear Cache',
click() {
clearCache();
}
},
{ {
label: 'Log Out', label: 'Log Out',
accelerator: 'Cmd+L',
click(item, focusedWindow) { click(item, focusedWindow) {
if (focusedWindow) { if (focusedWindow) {
sendAction('log-out'); sendAction('log-out');
@@ -263,8 +280,15 @@ const otherTpl = [
{ {
type: 'separator' type: 'separator'
}, },
{
label: 'Clear Cache',
click() {
clearCache();
}
},
{ {
label: 'Log Out', label: 'Log Out',
accelerator: 'Ctrl+L',
click(item, focusedWindow) { click(item, focusedWindow) {
if (focusedWindow) { if (focusedWindow) {
sendAction('log-out'); sendAction('log-out');
@@ -312,7 +336,6 @@ const otherTpl = [
{ {
role: 'selectall' role: 'selectall'
} }
] ]
}, },
{ {

View File

@@ -1,8 +1,15 @@
'use strict'; 'use strict';
const ipcRenderer = require('electron').ipcRenderer; const ipcRenderer = require('electron').ipcRenderer;
const {webFrame} = require('electron'); const {webFrame} = require('electron');
// Handle zooming functionality const {spellChecker} = require('./spellchecker');
// enable swipe back/forward navigation on macOS
require('./macos-swipe-navigation.js').register();
// eslint-disable-next-line import/no-unassigned-import
require('./domain');
// handle zooming functionality
const zoomIn = () => { const zoomIn = () => {
webFrame.setZoomFactor(webFrame.getZoomFactor() + 0.1); webFrame.setZoomFactor(webFrame.getZoomFactor() + 0.1);
}; };
@@ -15,7 +22,7 @@ const zoomActualSize = () => {
webFrame.setZoomFactor(1); webFrame.setZoomFactor(1);
}; };
// Get zooming actions from main process // get zooming actions from main process
ipcRenderer.on('zoomIn', () => { ipcRenderer.on('zoomIn', () => {
zoomIn(); zoomIn();
}); });
@@ -46,7 +53,6 @@ ipcRenderer.on('shortcut', () => {
// To prevent failing this script on linux we need to load it after the document loaded // To prevent failing this script on linux we need to load it after the document loaded
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
require('./spellchecker')(); // init spellchecker
spellChecker();
}); });
require('./domain')();

View File

@@ -1,22 +1,27 @@
const {SpellCheckHandler, ContextMenuListener, ContextMenuBuilder} = require('electron-spellchecker'); const {SpellCheckHandler, ContextMenuListener, ContextMenuBuilder} = require('electron-spellchecker');
// Implement spellcheck using electron api function spellChecker() {
// Implement spellcheck using electron api
window.spellCheckHandler = new SpellCheckHandler();
window.spellCheckHandler.attachToInput();
window.spellCheckHandler = new SpellCheckHandler(); // Start off as US English
window.spellCheckHandler.attachToInput(); window.spellCheckHandler.switchLanguage('en-US');
// Start off as US English const contextMenuBuilder = new ContextMenuBuilder(window.spellCheckHandler);
window.spellCheckHandler.switchLanguage('en-US'); const contextMenuListener = new ContextMenuListener(info => {
const contextMenuBuilder = new ContextMenuBuilder(window.spellCheckHandler);
const contextMenuListener = new ContextMenuListener(info => {
contextMenuBuilder.showPopupMenu(info); contextMenuBuilder.showPopupMenu(info);
}); });
// Clean up events after you navigate away from this page; // Clean up events after you navigate away from this page;
// otherwise, you may experience errors // otherwise, you may experience errors
window.addEventListener('beforeunload', () => { window.addEventListener('beforeunload', () => {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
spellCheckHandler.unsubscribe(); spellCheckHandler.unsubscribe();
contextMenuListener.unsubscribe(); contextMenuListener.unsubscribe();
}); });
}
exports = module.exports = {
spellChecker
};

View File

@@ -1,7 +1,7 @@
{ {
"name": "zulip", "name": "zulip",
"productName": "Zulip", "productName": "Zulip",
"version": "0.5.3", "version": "0.5.7-beta",
"description": "Zulip Desktop App", "description": "Zulip Desktop App",
"license": "Apache-2.0", "license": "Apache-2.0",
"email":"<svnitakash@gmail.com>", "email":"<svnitakash@gmail.com>",
@@ -27,17 +27,16 @@
"InstantMessaging" "InstantMessaging"
], ],
"dependencies": { "dependencies": {
"electron-is-dev": "*", "electron-is-dev": "0.1.2",
"electron-squirrel-startup":"*", "electron-updater": "1.4.1",
"configstore": "^2.0.0", "electron-log": "1.3.0",
"configstore": "2.1.0",
"dialogs": "1.1.14", "dialogs": "1.1.14",
"electron-context-menu": "0.4.0", "electron-debug": "1.1.0",
"electron-debug": "^1.0.0", "electron-localshortcut": "0.6.1",
"electron-dl": "^0.2.0", "node-json-db": "0.7.3",
"electron-localshortcut": "^0.6.1", "request": "2.79.0",
"node-json-db": "^0.7.2", "electron-spellchecker": "1.0.0",
"request": "^2.74.0", "wurl": "2.1.0"
"electron-spellchecker": "^0.5.12",
"wurl": "^2.1.0"
} }
} }

View File

@@ -18,12 +18,12 @@
<section class="content"> <section class="content">
<section class="server"> <section class="server">
<div class="container"> <div class="container">
<h1>Login to Zulip Server</h1> <h1>Enter your Zulip Server URL</h1>
<form id="frm-signInForm" class="form-large" onsubmit="addDomain(); return false"> <form id="frm-signInForm" class="form-large" onsubmit="addDomain(); return false">
<fieldset> <fieldset>
<div class="control-group control-required"> <div class="control-group control-required">
<div class="control-field"> <div class="control-field">
<input type="text" id="url" autofocus="autofocus" spellcheck="false" placeholder="chat.zulip.org"> <input type="text" id="url" autofocus="autofocus" spellcheck="false" placeholder="Server URL">
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">

View File

@@ -42,7 +42,7 @@ function addDomain() {
} else { } else {
document.getElementById('pic').style.display = 'none'; document.getElementById('pic').style.display = 'none';
document.getElementById('main').innerHTML = 'Switch'; document.getElementById('main').innerHTML = 'Switch';
document.getElementById('urladded').innerHTML = 'Not a vaild Zulip Server.'; document.getElementById('urladded').innerHTML = 'Not a valid Zulip Server.';
} }
}); });
} }

View File

@@ -10,7 +10,7 @@
<div class="close" id="close-button">Close</div> <div class="close" id="close-button">Close</div>
<div class="form"> <div class="form">
<form onsubmit="addDomain(); return false"> <form onsubmit="addDomain(); return false">
<input id="url" type="text" placeholder="chat.zulip.org"> <input id="url" type="text" placeholder="Server URL">
<button type="submit" id="main" value="Submit" onclick="addDomain();"> <button type="submit" id="main" value="Submit" onclick="addDomain();">
Switch</button> Switch</button>
<img id="pic" src="img/loader.gif" /> <img id="pic" src="img/loader.gif" />

View File

@@ -1,7 +1,7 @@
{ {
"name": "zulip", "name": "zulip",
"productName": "Zulip", "productName": "Zulip",
"version": "0.5.3", "version": "0.5.7-beta",
"description": "Zulip Desktop App", "description": "Zulip Desktop App",
"license": "Apache-2.0", "license": "Apache-2.0",
"email":"<svnitakash@gmail.com>", "email":"<svnitakash@gmail.com>",
@@ -43,7 +43,7 @@
"packageCategory": "GNOME;GTK;Network;InstantMessaging", "packageCategory": "GNOME;GTK;Network;InstantMessaging",
"description": "Zulip Desktop Client for Linux", "description": "Zulip Desktop Client for Linux",
"target" : ["deb", "AppImage"], "target" : ["deb", "AppImage"],
"version" : "0.5.3", "version" : "0.5.7-beta",
"title" : "Zulip", "title" : "Zulip",
"license": "Apache-2.0", "license": "Apache-2.0",
"maintainer": "Akash Nimare <svnitakash@gmail.com>" "maintainer": "Akash Nimare <svnitakash@gmail.com>"
@@ -67,8 +67,13 @@
] ]
}, },
"win": { "win": {
"target": "squirrel", "target": "nsis",
"icon": "build/icon.ico" "icon": "build/icon.ico",
"iconUrl": "https://raw.githubusercontent.com/zulip/zulip-electron/master/build/icon.ico"
},
"nsis": {
"perMachine": true,
"oneClick": false
} }
}, },
"keywords": [ "keywords": [
@@ -82,7 +87,7 @@
"devDependencies": { "devDependencies": {
"assert": "^1.4.1", "assert": "^1.4.1",
"devtron": "^1.1.0", "devtron": "^1.1.0",
"electron-builder": "*", "electron-builder": "13.0.0",
"electron": "1.4.7", "electron": "1.4.7",
"electron-connect": "^0.4.6", "electron-connect": "^0.4.6",
"gulp": "^3.9.1", "gulp": "^3.9.1",
@@ -98,7 +103,7 @@
"rules": { "rules": {
"max-lines": [ "max-lines": [
"warn", "warn",
350 500
], ],
"no-warning-comments": 0, "no-warning-comments": 0,
"no-else-return": 0, "no-else-return": 0,
@@ -108,7 +113,8 @@
} }
], ],
"ignore": [ "ignore": [
"tests/*.js" "tests/*.js",
"app/main/macos-swipe-navigation.js"
], ],
"envs": [ "envs": [
"node", "node",

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
export {no_proxy,NO_PROXY}="127.0.0.1,localhost"
export DISPLAY=:99.0 export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start sh -e /etc/init.d/xvfb start
sleep 3 sleep 3

View File

@@ -74,11 +74,11 @@ gitCheckout()
} }
# }}} # }}}
# {{{ npmUpgradeStart() # {{{ npmInstallStart()
npmUpgradeStart() npmInstallStart()
{ {
npm upgrade npm install
npm start & npm start &
} }
@@ -105,5 +105,5 @@ cleanUp()
envSetup $* envSetup $*
gitCheckout gitCheckout
npmUpgradeStart npmInstallStart
cleanUp cleanUp