Compare commits

..

38 Commits

Author SHA1 Message Date
akashnimare
e2286b6110 🚀 windows build script + nsis web installer 2017-02-14 00:28:06 +05:30
akashnimare
27ba3f3068 removed squirrel events code 2017-02-14 00:22:40 +05:30
akashnimare
9859315fea improve logging in autoupdater[WIP] 2017-02-13 23:54:47 +05:30
akashnimare
73d18dde9e init v0.5.8 + updated dependencies 2017-02-13 20:13:33 +05:30
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
Raghav Jajodia
f9f70f001b Added clear cache option 2017-01-02 13:50:19 +05:30
13 changed files with 149 additions and 53 deletions

View File

@@ -14,10 +14,10 @@ multi-account, auto-updates etc.
## Prerequisites
* node >= v6.3.1
* npm >= 3.10.3
* If you're on Debian or Ubuntu, you'll also need to install
`nodejs-legacy`:
* python (v2.7.x recommended)
* If you're on Debian or Ubuntu, you'll need to install following packages:
```sh
$ sudo apt-get install nodejs-legacy
$ sudo apt-get install nodejs-legacy build-essential libxext-dev libxtst-dev libxkbfile-dev
```
## Installation

View File

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

View File

@@ -29,7 +29,7 @@ window.addDomain = function () {
ipcRenderer.send('new-domain', domain);
} else {
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,11 +16,6 @@ const {appUpdater} = require('./autoupdater');
const db = new JsonDB(app.getPath('userData') + '/domain.json', true, true);
const data = db.getData('/');
// Handling squirrel.windows events on windows
if (require('electron-squirrel-startup')) {
app.quit();
}
// adds debug features like hotkeys for triggering dev tools and reload
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 electron = require('electron');
const {dialog} = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const shell = electron.shell;
@@ -19,6 +21,14 @@ function sendAction(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 = [
{
label: 'Reload',
@@ -134,8 +144,15 @@ const darwinTpl = [
{
type: 'separator'
},
{
label: 'Clear Cache',
click() {
clearCache();
}
},
{
label: 'Log Out',
accelerator: 'Cmd+L',
click(item, focusedWindow) {
if (focusedWindow) {
sendAction('log-out');
@@ -263,8 +280,15 @@ const otherTpl = [
{
type: 'separator'
},
{
label: 'Clear Cache',
click() {
clearCache();
}
},
{
label: 'Log Out',
accelerator: 'Ctrl+L',
click(item, focusedWindow) {
if (focusedWindow) {
sendAction('log-out');
@@ -312,7 +336,6 @@ const otherTpl = [
{
role: 'selectall'
}
]
},
{

View File

@@ -3,6 +3,10 @@ const ipcRenderer = require('electron').ipcRenderer;
const {webFrame} = require('electron');
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

View File

@@ -1,11 +1,11 @@
{
"name": "zulip",
"productName": "Zulip",
"version": "0.5.4",
"version": "0.5.8",
"description": "Zulip Desktop App",
"license": "Apache-2.0",
"email":"<svnitakash@gmail.com>",
"copyright": "©2016 Kandra Labs, Inc.",
"copyright": "©2017 Kandra Labs, Inc.",
"author": {
"name": "Akash Nimare",
"email": "svnitakash@gmail.com"
@@ -28,14 +28,15 @@
],
"dependencies": {
"electron-is-dev": "0.1.2",
"electron-squirrel-startup": "1.0.0",
"electron-updater": "1.6.2",
"electron-log": "1.3.0",
"configstore": "2.1.0",
"dialogs": "1.1.14",
"electron-debug": "1.1.0",
"electron-localshortcut": "0.6.1",
"node-json-db": "0.7.3",
"request": "2.79.0",
"electron-spellchecker": "0.7.0",
"electron-spellchecker": "1.0.0",
"wurl": "2.1.0"
}
}

View File

@@ -18,12 +18,12 @@
<section class="content">
<section class="server">
<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">
<fieldset>
<div class="control-group control-required">
<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 class="control-group">

View File

@@ -42,7 +42,7 @@ function addDomain() {
} else {
document.getElementById('pic').style.display = 'none';
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="form">
<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();">
Switch</button>
<img id="pic" src="img/loader.gif" />

View File

@@ -1,7 +1,7 @@
{
"name": "zulip",
"productName": "Zulip",
"version": "0.5.4",
"version": "0.5.8",
"description": "Zulip Desktop App",
"license": "Apache-2.0",
"email":"<svnitakash@gmail.com>",
@@ -24,6 +24,7 @@
"dev": "gulp dev",
"pack": "build --dir",
"dist": "build",
"build:win": "build --win nsis-web --ia32 --x64",
"travis": "cd ./scripts && ./travis-build-test.sh"
},
"build": {
@@ -33,7 +34,7 @@
"**/*",
"!node_modules/@paulcbetts/cld/deps/cld${/*}"
],
"copyright": "©2016 Kandra Labs, Inc.",
"copyright": "©2017 Kandra Labs, Inc.",
"mac": {
"category": "public.app-category.productivity"
},
@@ -43,7 +44,7 @@
"packageCategory": "GNOME;GTK;Network;InstantMessaging",
"description": "Zulip Desktop Client for Linux",
"target" : ["deb", "AppImage"],
"version" : "0.5.4",
"version" : "0.5.8",
"title" : "Zulip",
"license": "Apache-2.0",
"maintainer": "Akash Nimare <svnitakash@gmail.com>"
@@ -67,8 +68,13 @@
]
},
"win": {
"target": "squirrel",
"icon": "build/icon.ico"
"target": "nsis",
"icon": "build/icon.ico",
"iconUrl": "https://raw.githubusercontent.com/zulip/zulip-electron/master/build/icon.ico"
},
"nsis": {
"perMachine": true,
"oneClick": false
}
},
"keywords": [
@@ -82,7 +88,7 @@
"devDependencies": {
"assert": "^1.4.1",
"devtron": "^1.1.0",
"electron-builder": "10.15.1",
"electron-builder": "13.6.0",
"electron": "1.4.7",
"electron-connect": "^0.4.6",
"gulp": "^3.9.1",
@@ -98,7 +104,7 @@
"rules": {
"max-lines": [
"warn",
350
500
],
"no-warning-comments": 0,
"no-else-return": 0,
@@ -108,7 +114,8 @@
}
],
"ignore": [
"tests/*.js"
"tests/*.js",
"app/main/macos-swipe-navigation.js"
],
"envs": [
"node",
@@ -116,4 +123,4 @@
"mocha"
]
}
}
}

View File

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