Compare commits

..

242 Commits

Author SHA1 Message Date
akashnimare
0d15435408 🔖 v0.5.9 2017-04-11 01:54:39 +05:30
akashnimare
4bd6fde5b6 remove unused dependency configstore 2017-04-09 02:37:12 +05:30
Akash Nimare
e5097ace06 📝 use nvm to install nodejs #135 2017-04-05 19:48:13 +05:30
akashnimare
bcaf54b349 🔥 remove macOs swipe navigation 2017-04-01 11:19:39 -07:00
akashnimare
1f6d0762bb 🐛 fixing configstore permission issue on windows #125 [WIP] 2017-04-01 10:47:52 -07:00
akashnimare
1aa1655676 🔧 update electron-builder/updater to latest fixes #133 2017-03-31 02:02:47 +05:30
akashnimare
0ad66399d0 🐛 set valid config #133 2017-03-31 01:23:44 +05:30
akashnimare
3a6bb14224 🐛 fixing dmg build failed [WIP] #133 2017-03-31 00:47:26 +05:30
Akash Nimare
53eb8051ad Update CONTRIBUTING.md 2017-03-23 15:45:30 +05:30
Akash Nimare
ed9174f57c Merge pull request #119 from sumedh123/master
updated contributing guide
2017-03-23 15:44:10 +05:30
Akash Nimare
260d6a1906 Updated community section 2017-03-23 15:42:27 +05:30
Akash Nimare
dc53319c8e 🆙 bump electron-spellcheck to v1.0.5 2017-03-21 00:43:10 +05:30
Akash Nimare
77369536b3 Merge pull request #130 from Lplenka/master
Check if zulip server is down Fixes Issue #124
2017-03-20 12:31:18 +05:30
Lplenka
531afcb1e5 Fixed root directory's package.json 2017-03-19 17:33:53 +05:30
Lplenka
d6c4eeccf8 Code formatting done 2017-03-19 01:23:13 +05:30
Lplenka
496b906fd0 Merge branch 'master' of https://github.com/Lplenka/zulip-electron 2017-03-19 01:18:32 +05:30
Lplenka
1be29faea6 Removed spaces from imported/exported varibles & fixed the package.json in app folder 2017-03-19 01:16:07 +05:30
Akash Nimare
bc9a7c9890 update copyright 2017-03-19 00:50:50 +05:30
Lplenka
5745276dbb Code formatting done Fixes #124 2017-03-18 13:20:15 +05:30
Lplenka
acf0282aa0 Checks Server error while switching server 2017-03-18 12:40:38 +05:30
Lplenka
54d942178a Implemented function in index to check server error while loading 2017-03-18 12:32:43 +05:30
Lplenka
d84ada373e Added https node module 2017-03-18 12:22:29 +05:30
Lplenka
d4d36d0582 Removed reductant call to prefDomain() 2017-03-18 12:14:12 +05:30
Lplenka
63e6c634b9 Added Node global symbols to avoid setImmdediate Reference Error 2017-03-18 12:11:45 +05:30
Lplenka
4bc558cdbc Merge branch 'master' of https://github.com/Lplenka/zulip-electron 2017-03-18 09:04:19 +05:30
Cynthia Lin
34293fd66b Enable zulipbot build notifications.
PRs labeled with the *travis updates* label will receive build notifications from zulipbot.
2017-03-18 08:52:52 +05:30
Akash Nimare
5eba4b8200 Merge pull request #129 from synicalsyntax/patch-1
Enable zulipbot build notifications.
2017-03-18 00:48:47 +05:30
Akash Nimare
a949307820 Merge pull request #128 from Lplenka/master
show window when the web page has been rendered and window can be displayed without a visual flash.
2017-03-18 00:28:16 +05:30
Cynthia Lin
a714977b5a Enable zulipbot build notifications.
PRs labeled with the *travis updates* label will receive build notifications from zulipbot.
2017-03-11 11:46:43 -08:00
Lplenka
bfcaa51c46 🐛 🔧 linting error fixed 2017-03-11 01:55:48 +05:30
Lplenka
d7d3017bc1 Bug Fixes 2017-03-11 01:46:35 +05:30
Lalu Prasad Lenka
c7ce8fb7c8 Merge pull request #2 from zulip/master
Merging with zulip-electron origin
2017-03-07 13:42:02 +05:30
Sumedh Nimkarde
65a80de01d update Community section 2017-03-07 07:52:30 +05:30
akashnimare
f6bf210451 🔨 fixed linting errors 2017-03-06 15:18:52 +05:30
Akash Nimare
8c23ec3417 Merge pull request #122 from geeeeeeeeek/feature/#104-add-option-to-hide-tray-icon
#104 Add a menu item to toggle the tray icon.
2017-03-06 15:01:50 +05:30
Akash Nimare
97bbd809f7 Merge pull request #121 from geeeeeeeeek/bugfix/#120-fix-error-launching
#120 Fix error launching caused by missing  keyword.
2017-03-06 14:31:38 +05:30
Akash Nimare
76381cac08 Merge pull request #118 from Lplenka/master
Added localhost support fixes #78
2017-03-06 14:30:29 +05:30
Sumedh Nimkarde
13c4ceedc2 add Community section 2017-03-05 22:47:43 +05:30
Sumedh Nimkarde
f0889edf9c add zulipbot link 2017-03-05 15:38:18 +05:30
Zhongyi Tong
ab8367c946 #104 Add a menu item to toggle the tray icon. 2017-03-05 00:54:55 +08:00
Zhongyi Tong
c5887c8f71 #120 Fix error launching caused by missing keyword. 2017-03-04 23:46:26 +08:00
Sumedh Nimkarde
7b7ab03d0b add Chat section 2017-03-04 11:23:20 +05:30
Lplenka
394caa7934 Issue fix in better way 2017-03-04 10:02:27 +05:30
Lplenka
db2860b53e code formatting done 2017-03-04 01:32:34 +05:30
Lplenka
6d20df3557 Changed error message 2017-03-04 01:01:31 +05:30
Lplenka
2942cd1244 merge conflicts resolved 2017-03-04 00:44:40 +05:30
Lplenka
174049f489 issue #78 fixed 2017-03-04 00:16:41 +05:30
Lalu Prasad Lenka
21eae28999 Merge pull request #1 from zulip/master
Update from Original
2017-03-03 11:04:39 +05:30
akashnimare
f256cbcd5d Added error message when input url is null fixes #116 2017-03-02 17:35:20 +05:30
akashnimare
ff8c20f0b4 Removed unnessary code #116 2017-03-02 17:08:42 +05:30
akashnimare
9e0c17a793 🐛 fixing it in preference window #116 2017-03-02 17:05:01 +05:30
akashnimare
b4fb00aa52 🐛 show error message if input server url is null #116 2017-03-02 16:47:41 +05:30
akashnimare
13d0b5e51c Fixed linting error 2017-03-02 16:00:33 +05:30
Akash Nimare
dc15e4578c Merge pull request #115 from jajodiaraghav/offline
Display an error message if internet not working.
2017-03-02 15:36:19 +05:30
Raghav Jajodia
673da66ee9 Display error message if internet not working.
An error message with 'Try again' option is displayed
if the internet is not working.
Fixes #114
2017-02-28 23:01:13 +05:30
Akash Nimare
e397e9bfb4 Merge pull request #113 from chiragjn/master
Fix issue #112 for displaying Keyboard shortcuts
2017-02-24 14:35:48 +05:30
Chirag Jain
4eca2e9254 Fix lint errors 2017-02-24 11:31:10 +05:30
Chirag Jain
a1407826b6 Fix issue #112 for displaying Keyboard shortcuts 2017-02-24 10:57:29 +05:30
akashnimare
6d8f83798b 📦 update dependencies 2017-02-24 02:34:42 +05:30
akashnimare
bfc03c7e95 🐛 fix useragent + notifications #108 + #111 2017-02-24 02:30:13 +05:30
akashnimare
06737ce629 👌 detect Windows version (7/10) #108 2017-02-21 01:04:24 +05:30
akashnimare
6b09840347 improving usergent #108 2017-02-21 00:29:20 +05:30
akashnimare
19b5eecdcd Check if webview's url is failing travis tests on linux [WIP] #109 2017-02-18 16:51:31 +05:30
akashnimare
f443918433 🔧 added spellchecker dependencies in travis 🐧 2017-02-18 16:10:54 +05:30
akashnimare
bb74e58d63 🎨 fixed linting + #108 2017-02-18 15:56:41 +05:30
akashnimare
612e670bb5 🐛 added app version + os details in useragent #108 2017-02-18 15:17:30 +05:30
akashnimare
34bb55cb9f 🐛 set user-agent to ZulipElectron/version #108 2017-02-17 15:39:06 +05:30
akashnimare
1457e82649 📦 updated dependencies 2017-02-17 00:15:14 +05:30
akashnimare
0bdeaaba18 removed unused dependency dialogs 2017-02-17 00:02:27 +05:30
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
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
akashnimare
d6bf84c821 🆙 Linux app version 2016-12-25 02:32:01 +05:30
Akash Nimare
d5cba4096d Update README.md 2016-12-23 02:40:01 +05:30
Akash Nimare
afa12cc266 Update README.md 2016-12-23 02:38:41 +05:30
Akash Nimare
42ede5e54b typo in email 2016-12-23 02:35:56 +05:30
Akash Nimare
1549db5ce0 Merge pull request #93 from zulip/autoupdates
🎉 Autoupdates for windows
2016-12-23 02:35:01 +05:30
akashnimare
a0de440c2e Unregister shortcuts on will-quit 2016-12-23 02:10:45 +05:30
akashnimare
7e54eb89c2 manage squirrel events 2016-12-23 01:48:22 +05:30
akashnimare
f8e77dfa72 Using squirrel.windows 2016-12-23 01:32:08 +05:30
akashnimare
db6d1f300a adding windows auto-update 2016-12-22 02:30:48 +05:30
Akash Nimare
eac2b92cb6 ⬆️ Test timeout 2016-12-16 15:20:03 +05:30
Akash Nimare
a349e0e4e0 Check linux travis 2016-12-16 14:32:02 +05:30
Akash Nimare
58f35569c8 Added trusty option for linux travis 2016-12-16 03:23:20 +05:30
Akash Nimare
4a9f51aa1b Autoupdate button >> later 2016-12-16 02:01:37 +05:30
Akash Nimare
5bb05906b5 Merge pull request #92 from zulip/dev
Update master with dev branch
2016-12-16 01:59:00 +05:30
akashnimare
f80095d953 Updated travis build script 2016-12-15 20:53:35 +05:30
akashnimare
181803755a fix OSX travis build 2016-12-15 20:39:50 +05:30
akashnimare
ef30cd9624 💚 Fixing CI Build 2016-12-15 20:21:05 +05:30
akashnimare
7c82f41e87 🎨 fixed linting errors 2016-12-15 19:59:12 +05:30
akashnimare
61dfcfc3b1 🐛 unregister keyboard shortcuts 2016-12-15 01:57:20 +05:30
Akash Nimare
e3deb93730 Update Zulip server 2016-12-14 03:16:45 +05:30
Akash Nimare
d6a3e5fe1b Updated zulip server 2016-12-14 03:15:33 +05:30
akashnimare
dc15edf0cd Unsubscribe spellchekcer 2016-12-14 03:02:01 +05:30
akashnimare
e5a60cc077 📦 v0.5.2-Beta 2016-12-14 01:53:00 +05:30
akashnimare
4d5c57fa0b disable auto-updates on dev mode 2016-12-14 01:11:08 +05:30
akashnimare
98bd4fd9b9 🔥 2016-12-14 00:55:29 +05:30
akashnimare
8b808ff9b2 Added auto-updates for OSX 2016-12-14 00:49:30 +05:30
akashnimare
4a2a495738 new tray icons 2016-12-10 14:39:54 +05:30
akashnimare
309816e40a tray icon fixed 2016-12-12 19:15:36 +05:30
Akash Nimare
79a31000df 📝 Updated installation instructions 2016-12-12 18:49:40 +05:30
akashnimare
8410769fdd linux icon fixed 2016-12-10 10:42:48 +05:30
Akash Nimare
fd25ac0cc4 Added Linux app category 2016-11-25 15:08:02 +05:30
akashnimare
87797cf81e App icons + linux app arch changes 2016-11-22 22:25:29 +05:30
akashnimare
4638810127 Make updater script executable 2016-11-21 23:31:39 +05:30
akashnimare
e0c2d9f6c7 zulip-electron updater script 2016-11-21 23:16:53 +05:30
akashnimare
2c34eb8ff8 🐛 Exclude spellchecker junk 2016-11-21 23:01:38 +05:30
Akash Nimare
630bafca42 Exclude spellchecker junk 2016-11-21 16:03:33 +05:30
akashnimare
9b13547336 minor changes in build option 2 2016-11-21 04:16:29 +05:30
akashnimare
07d64fa8c0 minor changes in build option 2016-11-21 04:06:46 +05:30
akashnimare
d4cb4b1572 Added MAC appID 2016-11-20 18:50:46 +05:30
Akash Nimare
de1a24c726 Added installers feature 2016-11-20 15:49:45 +05:30
Akash Nimare
e18d30a3a9 Update README.md 2016-11-19 14:41:42 +05:30
Akash Nimare
d9b6109607 Update README.md 2016-11-19 14:40:01 +05:30
Akash Nimare
6593417189 Update README.md 2016-11-19 14:36:41 +05:30
akashnimare
779c0bcf5d Added win build script options 2016-11-19 14:31:41 +05:30
Akash Nimare
39ab6aff62 💥 2016-11-19 12:08:02 +05:30
Akash Nimare
b037d1ca1f 🎉 2016-11-19 12:07:18 +05:30
akashnimare
92d2ba7ee9 Merge branch 'master' into electron-builder 2016-11-19 11:44:03 +05:30
akashnimare
557e05db7c Apache-2.0 license 2016-11-19 10:53:23 +05:30
akashnimare
c0df294dec fixed install-app-deps error 2016-11-19 10:42:10 +05:30
akashnimare
34700969ae removed electron-rebuild 2016-11-19 04:59:04 +05:30
akashnimare
1a36230cac update with master + spellchecker 2016-11-19 04:44:51 +05:30
Akash Nimare
1b9c3afdd4 Bump up electron to v1.4.7 2016-11-19 04:24:41 +05:30
Akash Nimare
b33e36b415 ✔ Added linux app category 2016-11-18 12:22:00 +05:30
Akash Nimare
7ee9bf833e Removed unnecessary devDependencies 2016-11-18 00:01:46 +05:30
akashnimare
978128ae3e Refine linux build script 2016-11-16 04:37:06 +05:30
akashnimare
ca754d5eb9 added linux build options 2016-11-14 03:47:42 +05:30
Akash Nimare
be41b4069c Merge pull request #86 from zulip/dev
Spellchecker updated 🎉
2016-11-14 00:59:17 +05:30
akashnimare
a7cf1ddbb0 spellchecker bug fixes (linux) 2016-11-13 02:32:45 +05:30
Akash Nimare
f098ae8250 updated electron-builder version 2016-11-13 02:24:33 +05:30
Akash Nimare
84ae25ed06 Installing instructions
Rebuilding node modules is needed due to native modules.
2016-11-11 04:35:02 +05:30
akashnimare
5e5270e5ed update app version 2016-11-11 04:31:40 +05:30
akashnimare
157ffb7f34 🎉 Added spellchecker suggestions 2016-11-11 04:29:59 +05:30
Akash Nimare
70e4a11fe6 Merge pull request #83 from GervaisdeM/remove-duplicate-file
Remove duplicate of script
2016-11-10 03:06:45 +05:30
GervaisdeM
f142b5bb92 Remove duplicate of script 2016-11-09 11:46:14 -04:00
Akash Nimare
f9c9f59d09 Merge pull request #80 from GervaisdeM/add-launch-script
Created script to launch zulip-electron
2016-11-08 23:50:45 +05:30
GervaisdeM
22ea0dd9f7 renamed script 2016-11-06 16:50:33 -04:00
akashnimare
1a63839f6d asar option removed to fix spellchecker 2016-11-06 19:35:51 +05:30
GervaisdeM
8ca092c403 Changes due to PR feedback 2016-10-31 12:39:37 -03:00
GervaisdeM
474e9f0194 zulip-electron-updater-and-launcher: add script.
Script will install or update all npm dependancies to run
zulip-electron.
Fixes: #77.
2016-10-24 19:17:07 -03:00
Akash Nimare
9f70068184 🐛 spellchecker path fixed 2016-10-25 03:08:59 +05:30
akashnimare
04f6e9e6e5 added dmg bg 2016-10-22 07:50:16 +05:30
akashnimare
c05885baac dmg config setup 2016-10-22 07:22:53 +05:30
akashnimare
9908ef51eb dmg configuration 2016-10-22 04:36:12 +05:30
akashnimare
a4471f35ee Fixing App icons in build script 2016-10-22 01:02:48 +05:30
akashnimare
b9c4910dd4 Added dmg build options 2016-10-22 00:51:29 +05:30
akashnimare
5c95e35839 remove node-gyp config 2016-10-21 18:45:31 +05:30
akashnimare
e068d8e96f packaging attempt 2 2016-10-21 18:42:20 +05:30
Akash Nimare
dda491938e Merge pull request #79 from zulip/dev
🆙 updated electron to v1.4.3
2016-10-12 18:34:45 +05:30
akashnimare
71637d8e92 🆙 updated electron to v1.4.3 2016-10-12 18:03:00 +05:30
akashnimare
7cbdd9cae8 Toggle feature removed 2016-10-10 18:25:02 +05:30
akashnimare
b59cd3cf23 🐯 linting errors 2016-10-10 17:47:57 +05:30
Akash Nimare
88d50fa6a6 Bump version 2016-10-10 17:30:44 +05:30
akashnimare
ef94998d21 Removed unused JS files 2016-10-10 17:28:56 +05:30
Akash Nimare
2306514507 Merge pull request #76 from zulip/dev
Jquery bug fixed
2016-10-10 16:53:38 +05:30
akashnimare
f7e3ed8a0c 😓 Fixing Jquery bug attempt 2 2016-10-06 07:43:59 +05:30
Akash Nimare
88036f864f Merge pull request #75 from steele/version-number
Use the actual version number in About page
2016-09-27 03:07:09 +05:30
James Steele
82c6782c0d Use the actual version number in About page 2016-09-23 15:12:40 +01:00
akashnimare
a72bccadf9 linting errors 2016-09-12 06:49:49 +05:30
Akash Nimare
e55928183f CSS injected 2016-09-12 04:08:15 +05:30
Akash Nimare
ef5a44dec2 insert css 😈 2016-09-12 04:04:24 +05:30
Akash Nimare
042afdf94f Merge pull request #73 from steele/cleanup-DS_Store
Remove .DS_Store files from repo
2016-09-12 03:24:57 +05:30
James Steele
e09102456f Remove .DS_Store files from repo 2016-09-11 15:07:08 +01:00
Akash Nimare
4119f1238d Added windows test suite 2016-09-11 19:01:37 +05:30
Akash Nimare
c9b2ec0bac testing appveyor 2016-09-11 18:36:31 +05:30
Akash Nimare
54bc001d46 prune removed 2016-09-11 18:26:28 +05:30
Akash Nimare
e20194fc72 🔥 appveyor >> windows test suite 2016-09-11 18:18:48 +05:30
Akash Nimare
c1ef006e40 Merge pull request #72 from steele/travis-deps-caching
Add caching of dependencies for CI builds
2016-09-11 18:01:56 +05:30
James Steele
2523f8c5d0 Add caching of dependencies for CI builds
Based upon
https://blog.travis-ci.com/2013-12-05-speed-up-your-builds-cache-your-dependencies/
2016-09-11 10:16:54 +01:00
Akash Nimare
30f44d2791 ❤️ code style XO 2016-09-11 08:52:26 +05:30
Akash Nimare
3c7369189f Updated version 2016-09-11 06:45:35 +05:30
Akash Nimare
c8bbcf2248 Merge pull request #71 from steele/fix-travis-linux
Setup for spectron on Travis CI Linux runs
2016-09-11 06:44:03 +05:30
James Steele
62963ae563 Setup for spectron on Travis CI Linux runs
Invoke test runs via travis using a separate shell script that ensures the
a suitable frame buffer is available to run chromedriver against
2016-09-11 01:00:41 +01:00
Akash Nimare
2d43ce08ad testing travis 2016-09-11 03:04:40 +05:30
Akash Nimare
2c5459233d Merge pull request #70 from steele/host-not-domain
Restrict internal links to the same host only, not all hosts in a domain
2016-09-11 02:54:25 +05:30
Akash Nimare
56bf6fe097 Update .travis.yml 2016-09-11 02:28:14 +05:30
Akash Nimare
89bc8401db Test on multiple os 2016-09-11 02:04:36 +05:30
James Steele
39f3df5b8f Restrict internal links to the same host only
A zulip service is hosted with a particular hostname and not across a
whole domain. Internal links should respect this otherwise links to other
distinct services hosted under the same domain will be loaded by the app
and not in a separate browser window.
2016-09-10 21:32:32 +01:00
Akash Nimare
5cc3bf0dc8 Merge pull request #69 from steele/windows-test-fix
Use the standard method to get the electron app location
2016-09-11 01:54:22 +05:30
James Steele
c594979d9b Use the standard method to get the electron app location
As per the guidance at
https://github.com/electron-userland/electron-prebuilt programmatic usage
acquires the path to electron by require('electron')
2016-09-10 20:37:43 +01:00
Akash Nimare
e12ad6e1d5 Make a single instance of app 🎯 2016-09-10 10:26:28 +05:30
Akash Nimare
d62b87ec0c Show travis build status 👊 2016-09-10 09:30:09 +05:30
akashnimare
14c130d102 For the build 2016-09-10 09:07:15 +05:30
Akash Nimare
c4449570a9 Update .travis.yml 2016-09-10 08:33:52 +05:30
akashnimare
011d368fd5 travis config 2016-09-10 08:21:03 +05:30
akashnimare
0d0518fcf5 move gulp-mocha to devDependencies 2016-09-10 08:03:24 +05:30
akashnimare
f1a5bfcabf 🔥 added test 2016-09-10 07:57:09 +05:30
Akash Nimare
05d483b44c Allow displaying insecure content 2016-09-10 04:34:15 +05:30
Akash Nimare
34a62e2d10 allow http content to load 2016-09-09 08:33:17 +05:30
akashnimare
99e444aec0 🐛 open images in default browser 2016-09-09 07:19:47 +05:30
akashnimare
56940dacf4 linting errors 2016-09-07 04:57:23 +05:30
akashnimare
6e6ace049a 🐛 issue#32 2016-09-07 04:53:56 +05:30
akashnimare
5e40043e3e Typo fixed 2016-09-07 04:32:47 +05:30
Akash Nimare
55b45420bd Fixed javascript error when window closed (OSX)
This https://github.com/zulip/zulip-electron/issues/32
2016-09-01 05:36:21 +05:30
49 changed files with 847 additions and 232 deletions

3
.gitignore vendored
View File

@@ -1,7 +1,8 @@
node_modules node_modules
npm-debug.log npm-debug.log
domain.json domain.json
dist
config.gypi
// osx garbage // osx garbage
*.DS_Store *.DS_Store

View File

@@ -1,3 +1,38 @@
sudo: required
dist: trusty
os:
- osx
- linux
addons:
apt:
packages:
- build-essential
- libxext-dev
- libxtst-dev
- libxkbfile-dev
language: node_js language: node_js
node_js: node_js:
- 'node' - '6'
before_install:
- npm install -g gulp
- npm install
cache:
directories:
- node_modules
- app/node_modules
- $HOME/.electron
- $HOME/.cache
script:
- npm run travis
notifications:
webhooks:
urls:
- https://zulip.org/zulipbot/travis
on_success: always
on_failure: always

View File

@@ -1,16 +1,24 @@
#Contributing Guidelines # Contributing Guidelines
Thanks for taking the time to contribute! Thanks for taking the time to contribute!
The following is a set of guidelines for contributing to zulip-electron. These are just guidelines, not rules, use your best judgment and feel free to propose changes to this document in a pull request. The following is a set of guidelines for contributing to zulip-electron. These are just guidelines, not rules, use your best judgement and feel free to propose changes to this document in a pull request.
## Getting Started ## Getting Started
Zulip-Desktop app is built on top of [Electron](http://electron.atom.io/). If you are new to Electron please head over to [this](http://jlord.us/essential-electron/) great article. Zulip-Desktop app is built on top of [Electron](http://electron.atom.io/). If you are new to Electron please head over to [this](http://jlord.us/essential-electron/) great article.
## Community
* The whole zulip documentation such as development environment, setting up with zulip project, testing, code of conduct can be read [here](https://zulip.readthedocs.io).
* If you have any questions regarding zulip-electron, open an [issue](https://github.com/zulip/zulip-electron/issues/new/) or ask it [here](https://chat.zulip.org/#narrow/stream/electron).
## Issue ## Issue
Ensure the bug was not already reported by searching on GitHub under [Issues](https://github.com/zulip/zulip-electron/issues). If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/zulip/zulip-electron/issues/new). Please pay attention to following points while opening an issue. Ensure the bug was not already reported by searching on GitHub under [Issues](https://github.com/zulip/zulip-electron/issues). If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/zulip/zulip-electron/issues/new). Please pay attention to following points while opening an issue.
The [Zulipbot](https://github.com/zulip/zulipbot) helps to claim the issue by commenting the following in the comment section: "**@zulipbot** claim". **@zulipbot** will assign you to the issue and label the issue as **in progress**. For more details, check out [**@zulipbot**](https://github.com/zulip/zulipbot).
### Does it happen on web browsers? (especially Chrome) ### Does it happen on web browsers? (especially Chrome)
Zulip-Desktop is based on Electron, which integrates the Chrome engine within a standalone application. Zulip-Desktop is based on Electron, which integrates the Chrome engine within a standalone application.
If the problem you encounter can be reproduced on web browsers, it may be an issue with Zulip web app. If the problem you encounter can be reproduced on web browsers, it may be an issue with Zulip web app.

View File

@@ -1,13 +1,27 @@
# Zulip Desktop Client # Zulip Desktop Client
[![Build Status](https://travis-ci.org/zulip/zulip-electron.svg?branch=master)](https://travis-ci.org/zulip/zulip-electron)
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/zulip/zulip-electron?branch=master&svg=true)](https://ci.appveyor.com/project/akashnimare/zulip-electron/branch/master)
[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
This is an experimental replacement for the [Zulip Desktop This is an experimental replacement for the [Zulip Desktop
app](https://github.com/zulip/zulip-desktop) implemented in app](https://github.com/zulip/zulip-desktop) implemented in
[Electron](http://electron.atom.io/). [Electron](http://electron.atom.io/).eeee
The goal is to achieve feature-compatibility with the old desktop app The goal is to achieve feature-compatibility with the old desktop app
and then start adding cool features like easy support for and then start adding cool features like easy support for
multi-account, auto-updates etc. multi-account, auto-updates etc.
## Prerequisites
* node >= v6.3.1
> Use [nvm](https://github.com/creationix/nvm) to install the current stable version of node
* python (v2.7.x recommended)
* If you're on Debian or Ubuntu, you'll need to install following packages:
```sh
$ sudo apt-get install build-essential libxext-dev libxtst-dev libxkbfile-dev
```
## Installation ## Installation
Clone the source locally: Clone the source locally:
@@ -16,14 +30,6 @@ Clone the source locally:
$ git clone https://github.com/zulip/zulip-electron $ git clone https://github.com/zulip/zulip-electron
$ cd zulip-electron $ cd zulip-electron
``` ```
If you're on Debian or Ubuntu, you'll also need to install
`nodejs-legacy`:
Use your package manager to install `npm`.
```sh
$ sudo apt-get install npm nodejs-legacy
```
Install project dependencies: Install project dependencies:
@@ -41,19 +47,32 @@ Start and watch changes
```sh ```sh
$ npm run dev $ npm run dev
``` ```
# Making a release
To package app into an installer use command:
```
npm run dist
```
It will start the packaging process for operating system you are running this command on. Ready for distribution file (e.g. dmg, windows installer, deb package) will be outputted to `dist` directory.
You can create Windows installer only when running on Windows, the same is true for Linux and OSX. So to generate all three installers you need all three operating systems.
## Features ## Features
- [x] Native Notifications - [x] Native Notifications
- [x] Spell Checker - [x] SpellChecker
- [x] Keyboard Shortcuts - [x] OSX/Win/Linux installer
- Default shortcuts - <kbd>cmdOrctrl + k </kbd> - [x] Automatic Updates (macOS/Windows)
- Change Zulip Server: <kbd>cmdOrctrl + ,</kbd> - [x] Keyboard shortcuts
- Back: <kbd>cmdOrctrl + [</kbd>
- Forward: <kbd>cmdOrctrl + ]</kbd> Description | Keys
- [ ] OSX/Win/Linux installer -----------------------| -----------------------
- [ ] Launch on OS startup Default shortcuts | <kbd>Cmd/Ctrl</kbd> <kbd>k</kbd>
- [ ] Automatic Updates Change Zulip Server | <kbd>Cmd/Ctrl</kbd> <kbd>,</kbd>
Back | <kbd>Cmd/Ctrl</kbd> <kbd>[</kbd>
Forward | <kbd>Cmd/Ctrl</kbd> <kbd>]</kbd>
## Contribute ## Contribute

BIN
app/.DS_Store vendored

Binary file not shown.

47
app/main/autoupdater.js Normal file
View File

@@ -0,0 +1,47 @@
'use strict';
const {app, dialog} = require('electron');
const {autoUpdater} = require('electron-updater');
function appUpdater() {
// Log whats happening
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
// eslint-disable-next-line no-unused-vars
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: 'It will be installed the next time you restart the application'
}, response => {
if (response === 0) {
setTimeout(() => autoUpdater.quitAndInstall(), 1);
}
});
});
// init for updates
autoUpdater.checkForUpdates();
}
exports = module.exports = {
appUpdater
};

48
app/main/domain.js Normal file
View File

@@ -0,0 +1,48 @@
const {app} = require('electron').remote;
const ipcRenderer = require('electron').ipcRenderer;
const JsonDB = require('node-json-db');
const request = require('request');
const db = new JsonDB(app.getPath('userData') + '/domain.json', true, true);
const data = db.getData('/');
console.log(data.domain);
window.addDomain = function () {
let newDomain = document.getElementById('url').value;
newDomain = newDomain.replace(/^https?:\/\//, '');
newDomain = newDomain.replace(/^http?:\/\//, '');
if (newDomain === '') {
document.getElementById('server-status').innerHTML = 'Please input a value';
} else {
document.getElementById('main').innerHTML = 'Checking...';
if (newDomain.indexOf('localhost:') >= 0) {
const domain = 'http://' + newDomain;
const checkDomain = domain + '/static/audio/zulip.ogg';
request(checkDomain, (error, response) => {
if (!error && response.statusCode !== 404) {
document.getElementById('main').innerHTML = 'Connect';
db.push('/domain', domain);
ipcRenderer.send('new-domain', domain);
} else {
document.getElementById('main').innerHTML = 'Connect';
document.getElementById('server-status').innerHTML = 'Not a valid Zulip Local Server.';
}
});
// });
} else {
const domain = 'https://' + newDomain;
const checkDomain = domain + '/static/audio/zulip.ogg';
request(checkDomain, (error, response) => {
if (!error && response.statusCode !== 404) {
document.getElementById('main').innerHTML = 'Connect';
db.push('/domain', domain);
ipcRenderer.send('new-domain', domain);
} else {
document.getElementById('main').innerHTML = 'Connect';
document.getElementById('server-status').innerHTML = 'Not a valid Zulip Server.';
}
});
}
}
};

View File

@@ -1,36 +1,128 @@
'use strict'; 'use strict';
const path = require('path'); const path = require('path');
const fs = require('fs');
const os = require('os');
const electron = require('electron'); const electron = require('electron');
const {app} = require('electron'); const {app} = require('electron');
const electronLocalshortcut = require('electron-localshortcut');
const ipc = require('electron').ipcMain; const ipc = require('electron').ipcMain;
const Configstore = require('configstore'); const {dialog} = require('electron');
const https = require('https');
const http = require('http');
const electronLocalshortcut = require('electron-localshortcut');
const Configstore = require('electron-config');
const JsonDB = require('node-json-db'); const JsonDB = require('node-json-db');
const SpellChecker = require('simple-spellchecker'); const isDev = require('electron-is-dev');
const tray = require('./tray'); const tray = require('./tray');
const appMenu = require('./menu'); const appMenu = require('./menu');
const link = require('./link-helper'); const {linkIsInternal, skipImages} = require('./link-helper');
const {appUpdater} = require('./autoupdater');
const {linkIsInternal} = link;
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('/');
// 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')();
require('electron-context-menu')();
const conf = new Configstore('Zulip-Desktop'); const conf = new Configstore();
// spellchecker enabled function userOS() {
let myDictionary = null; if (os.platform() === 'darwin') {
return 'Mac';
}
if (os.platform() === 'linux') {
return 'Linux';
}
if (os.platform() === 'win32' || os.platform() === 'win64') {
if (parseFloat(os.release()) < 6.2) {
return 'Windows 7';
} else {
return 'Windows 10';
}
}
}
// setting userAgent so that server-side code can identify the desktop app
const isUserAgent = 'ZulipElectron/' + app.getVersion() + ' ' + userOS();
// prevent window being garbage collected // prevent window being garbage collected
let mainWindow; let mainWindow;
let targetLink; let targetLink;
// Load this url in main window // Load this url in main window
const targetUrl = 'file://' + path.join(__dirname, '../renderer', 'index.html'); const staticURL = 'file://' + path.join(__dirname, '../renderer', 'index.html');
const targetURL = function () {
if (data.domain === undefined) {
return staticURL;
}
return data.domain;
};
function serverError(targetURL) {
if (targetURL.indexOf('localhost:') < 0 && data.domain) {
const req = https.request(targetURL + '/static/audio/zulip.ogg', res => {
console.log('Server StatusCode:', res.statusCode);
console.log('You are connected to:', res.req._headers.host);
if (res.statusCode >= 500 && res.statusCode <= 599) {
return dialog.showErrorBox('SERVER IS DOWN!', 'We are getting a ' + res.statusCode + ' error status from the server ' + res.req._headers.host + '. Please try again after some time or you may switch server.');
}
});
req.on('error', e => {
console.error(e);
});
req.end();
} else if (data.domain) {
const req = http.request(targetURL + '/static/audio/zulip.ogg', res => {
console.log('Server StatusCode:', res.statusCode);
console.log('You are connected to:', res.req._headers.host);
});
req.on('error', e => {
console.error(e);
});
req.end();
}
}
function checkConnectivity() {
return dialog.showMessageBox({
title: 'Internet connection problem',
message: 'No internet available! Try again?',
type: 'warning',
buttons: ['Try again', 'Close'],
defaultId: 0
}, index => {
if (index === 0) {
mainWindow.webContents.reload();
}
if (index === 1) {
app.quit();
}
});
}
function checkConnection() {
// eslint-disable-next-line no-unused-vars
mainWindow.webContents.on('did-fail-load', (event, errorCode, errorDescription, validatedURL) => {
if (errorDescription === 'ERR_INTERNET_DISCONNECTED' || errorDescription === 'ERR_PROXY_CONNECTION_FAILED') {
console.log('Error Description:' + errorDescription);
checkConnectivity();
}
});
}
const isAlreadyRunning = app.makeSingleInstance(() => {
if (mainWindow) {
if (mainWindow.isMinimized()) {
mainWindow.restore();
}
mainWindow.show();
}
});
if (isAlreadyRunning) {
app.quit();
}
function checkWindowURL() { function checkWindowURL() {
if (data.domain !== undefined) { if (data.domain !== undefined) {
@@ -39,17 +131,19 @@ function checkWindowURL() {
return targetLink; return targetLink;
} }
const APP_ICON = path.join(__dirname, '../resources', 'Icon'); function isWindowsOrmacOS() {
return process.platform === 'darwin' || process.platform === 'win32';
}
const spellDict = path.join(__dirname, '../../node_modules/simple-spellchecker/dict'); const APP_ICON = path.join(__dirname, '../resources', 'Icon');
const iconPath = () => { const iconPath = () => {
return APP_ICON + (process.platform === 'win32' ? '.ico' : '.png'); return APP_ICON + (process.platform === 'win32' ? '.ico' : '.png');
}; };
function onClosed() { function onClosed() {
// dereference the window // Dereference the window
// for multiple windows store them in an array // For multiple windows, store them in an array
mainWindow = null; mainWindow = null;
} }
@@ -77,12 +171,23 @@ function createMainWindow() {
minHeight: 400, minHeight: 400,
webPreferences: { webPreferences: {
preload: path.join(__dirname, 'preload.js'), preload: path.join(__dirname, 'preload.js'),
nodeIntegration: true, plugins: true,
plugins: true allowDisplayingInsecureContent: true,
} nodeIntegration: false
},
show: false
});
win.once('ready-to-show', () => {
win.show();
});
serverError(targetURL());
win.loadURL(targetURL(), {
userAgent: isUserAgent + ' ' + win.webContents.getUserAgent()
}); });
win.loadURL(targetUrl);
win.on('closed', onClosed); win.on('closed', onClosed);
win.setTitle('Zulip'); win.setTitle('Zulip');
@@ -134,6 +239,8 @@ function createMainWindow() {
app.commandLine.appendSwitch('ignore-certificate-errors', 'true'); app.commandLine.appendSwitch('ignore-certificate-errors', 'true');
app.on('window-all-closed', () => { app.on('window-all-closed', () => {
// unregister all the shortcuts so that they don't interfare with other apps
electronLocalshortcut.unregisterAll(mainWindow);
if (process.platform !== 'darwin') { if (process.platform !== 'darwin') {
app.quit(); app.quit();
} }
@@ -148,24 +255,10 @@ app.on('activate', () => {
app.on('ready', () => { app.on('ready', () => {
electron.Menu.setApplicationMenu(appMenu); electron.Menu.setApplicationMenu(appMenu);
mainWindow = createMainWindow(); mainWindow = createMainWindow();
tray.create(mainWindow); tray.create();
const page = mainWindow.webContents; const page = mainWindow.webContents;
// Add spellcheck dictionary
SpellChecker.getDictionary('en-US', spellDict, (err, result) => {
if (!err) {
myDictionary = result;
}
});
// Define function for consult the dictionary.
ipc.on('checkspell', (event, word) => {
if (myDictionary !== null && word !== null) {
event.returnValue = myDictionary.spellCheck(word);
}
});
// TODO - use global shortcut instead // TODO - use global shortcut instead
electronLocalshortcut.register(mainWindow, 'CommandOrControl+R', () => { electronLocalshortcut.register(mainWindow, 'CommandOrControl+R', () => {
mainWindow.reload(); mainWindow.reload();
@@ -183,33 +276,46 @@ app.on('ready', () => {
} }
}); });
// electronLocalshortcut.register(mainWindow, 'CommandOrControl+=', () => { page.on('dom-ready', () => {
// page.send('zoomIn'); page.insertCSS(fs.readFileSync(path.join(__dirname, 'preload.css'), 'utf8'));
// }); mainWindow.show();
});
// electronLocalshortcut.register(mainWindow, 'CommandOrControl+-', () => {
// page.send('zoomOut');
// });
// electronLocalshortcut.register(mainWindow, 'CommandOrControl+0', () => {
// page.send('zoomActualSize');
// });
page.on('new-window', (event, url) => { page.on('new-window', (event, url) => {
if (mainWindow.useDefaultWindowBehaviour) { if (linkIsInternal(checkWindowURL(), url) && url.match(skipImages) === null) {
mainWindow.useDefaultWindowBehaviour = false;
return;
}
if (linkIsInternal(checkWindowURL(), url)) {
event.preventDefault(); event.preventDefault();
return mainWindow.loadURL(url); return mainWindow.loadURL(url);
} }
event.preventDefault(); event.preventDefault();
electron.shell.openExternal(url); electron.shell.openExternal(url);
}); });
page.once('did-frame-finish-load', () => {
const checkOS = isWindowsOrmacOS();
if (checkOS && !isDev) {
// Initate auto-updates on MacOS and Windows
appUpdater();
}
});
checkConnection();
});
app.on('will-quit', () => {
// unregister all the shortcuts so that they don't interfare with other apps
electronLocalshortcut.unregisterAll(mainWindow);
}); });
ipc.on('new-domain', (e, domain) => { ipc.on('new-domain', (e, domain) => {
// mainWindow.loadURL(domain);
if (!mainWindow) {
mainWindow = createMainWindow();
mainWindow.loadURL(domain); mainWindow.loadURL(domain);
} else if (mainWindow.isMinimized()) {
mainWindow.loadURL(domain);
mainWindow.show();
} else {
mainWindow.loadURL(domain);
serverError(domain);
}
targetLink = domain; targetLink = domain;
}); });

View File

@@ -2,11 +2,14 @@ const wurl = require('wurl');
// Check link if it's internal/external // Check link if it's internal/external
function linkIsInternal(currentUrl, newUrl) { function linkIsInternal(currentUrl, newUrl) {
const currentDomain = wurl('domain', currentUrl); const currentDomain = wurl('hostname', currentUrl);
const newDomain = wurl('domain', newUrl); const newDomain = wurl('hostname', newUrl);
return currentDomain === newDomain; return currentDomain === newDomain;
} }
// We'll be needing this to open images in default browser
const skipImages = '.jpg|.gif|.png|.jpeg|.JPG|.PNG';
exports = module.exports = { exports = module.exports = {
linkIsInternal linkIsInternal, skipImages
}; };

View File

@@ -2,10 +2,13 @@
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;
const appName = app.getName(); const appName = app.getName();
const tray = require('./tray');
const {addDomain, about} = require('./windowmanager'); const {addDomain, about} = require('./windowmanager');
@@ -19,10 +22,17 @@ 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',
accelerator: 'CmdOrCtrl+R',
click(item, focusedWindow) { click(item, focusedWindow) {
if (focusedWindow) { if (focusedWindow) {
focusedWindow.reload(); focusedWindow.reload();
@@ -65,6 +75,14 @@ const viewSubmenu = [
{ {
type: 'separator' type: 'separator'
}, },
{
label: 'Toggle Tray Icon',
click(item, focusedWindow) {
if (focusedWindow) {
tray.toggle();
}
}
},
{ {
label: 'Toggle Developer Tools', label: 'Toggle Developer Tools',
accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I', accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
@@ -119,11 +137,9 @@ const darwinTpl = [
{ {
label: 'Change Zulip Server', label: 'Change Zulip Server',
accelerator: 'Cmd+,', accelerator: 'Cmd+,',
click(item, focusedWindow) { click() {
if (focusedWindow) {
addDomain(); addDomain();
} }
}
}, },
{ {
label: 'Keyboard shortcuts', label: 'Keyboard shortcuts',
@@ -137,8 +153,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');
@@ -247,11 +270,9 @@ const otherTpl = [
{ {
label: 'Change Zulip Server', label: 'Change Zulip Server',
accelerator: 'Ctrl+,', accelerator: 'Ctrl+,',
click(item, focusedWindow) { click() {
if (focusedWindow) {
addDomain(); addDomain();
} }
}
}, },
{ {
type: 'separator' type: 'separator'
@@ -268,8 +289,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');
@@ -317,7 +345,6 @@ const otherTpl = [
{ {
role: 'selectall' role: 'selectall'
} }
] ]
}, },
{ {

1
app/main/preload.css Normal file
View File

@@ -0,0 +1 @@
/* We'll be overriding default styling so that app look more native * /

View File

@@ -1,18 +1,19 @@
'use strict'; 'use strict';
const ipcRenderer = require('electron').ipcRenderer; const ipcRenderer = require('electron').ipcRenderer;
const webFrame = require('electron').webFrame; const {webFrame} = require('electron');
const {spellChecker} = require('./spellchecker');
// Implement spellcheck using electron api const _setImmediate = setImmediate;
const _clearImmediate = clearImmediate;
webFrame.setSpellCheckProvider('en-US', false, { process.once('loaded', () => {
spellCheck: text => { global.setImmediate = _setImmediate;
const res = ipcRenderer.sendSync('checkspell', text); global.clearImmediate = _clearImmediate;
return res === null ? true : res;
}
}); });
// Handle zooming functionality // 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);
}; };
@@ -25,7 +26,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();
}); });
@@ -48,8 +49,18 @@ ipcRenderer.on('log-out', () => {
ipcRenderer.on('shortcut', () => { ipcRenderer.on('shortcut', () => {
// create the menu for the below // create the menu for the below
const node = document.querySelector('a[data-overlay-trigger=keyboard-shortcuts]');
// additional check
if (node.text.trim().toLowerCase() === 'keyboard shortcuts') {
node.click();
} else {
// atleast click the dropdown
document.querySelector('.dropdown-toggle').click(); document.querySelector('.dropdown-toggle').click();
}
const nodes = document.querySelectorAll('.dropdown-menu li:nth-child(4) a'); });
nodes[nodes.length - 1].click();
// To prevent failing this script on linux we need to load it after the document loaded
document.addEventListener('DOMContentLoaded', () => {
// init spellchecker
spellChecker();
}); });

27
app/main/spellchecker.js Normal file
View File

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

View File

@@ -6,21 +6,16 @@ const {addDomain, about} = require('./windowmanager');
let tray = null; let tray = null;
const APP_ICON = path.join(__dirname, '../resources', 'Icon'); const APP_ICON = path.join(__dirname, '../resources/tray', 'tray');
const iconPath = () => { const iconPath = () => {
return APP_ICON + (process.platform === 'win32' ? '.ico' : '.png'); if (process.platform === 'linux') {
return APP_ICON + 'linux.png';
}
return APP_ICON + (process.platform === 'win32' ? 'win.ico' : 'osx.png');
}; };
exports.create = () => { const createHandler = () => {
// Noone is using this feature. so let's hide it for now.
// const toggleWin = () => {
// if (win.isVisible()) {
// win.hide();
// } else {
// win.show();
// }
// };
const contextMenu = electron.Menu.buildFromTemplate([ const contextMenu = electron.Menu.buildFromTemplate([
{ {
label: 'About', label: 'About',
@@ -33,11 +28,9 @@ exports.create = () => {
}, },
{ {
label: 'Change Zulip server', label: 'Change Zulip server',
click(item, focusedWindow) { click() {
if (focusedWindow) {
addDomain(); addDomain();
} }
}
}, },
{ {
type: 'separator' type: 'separator'
@@ -66,3 +59,23 @@ exports.create = () => {
tray.setContextMenu(contextMenu); tray.setContextMenu(contextMenu);
}; };
const destroyHandler = () => {
tray.destroy();
if (tray.isDestroyed()) {
tray = null;
} else {
throw new Error('Tray icon not properly destroyed.');
}
};
const toggleHandler = () => {
if (tray) {
destroyHandler();
} else {
createHandler();
}
};
exports.create = createHandler;
exports.destroy = destroyHandler;
exports.toggle = toggleHandler;

View File

@@ -2,6 +2,11 @@
const path = require('path'); const path = require('path');
const electron = require('electron'); const electron = require('electron');
const APP_ICON = path.join(__dirname, '../resources', 'Icon');
const iconPath = () => {
return APP_ICON + (process.platform === 'win32' ? '.ico' : '.png');
};
let domainWindow; let domainWindow;
let aboutWindow; let aboutWindow;
@@ -14,10 +19,14 @@ function onClosed() {
// Change Zulip server Window // Change Zulip server Window
function createdomainWindow() { function createdomainWindow() {
const domainwin = new electron.BrowserWindow({ const domainwin = new electron.BrowserWindow({
title: 'Switch Server',
frame: false, frame: false,
height: 300, height: 300,
resizable: false, resizable: false,
width: 400 width: 400,
show: false,
icon: iconPath()
}); });
const domainURL = 'file://' + path.join(__dirname, '../renderer', 'pref.html'); const domainURL = 'file://' + path.join(__dirname, '../renderer', 'pref.html');
domainwin.loadURL(domainURL); domainwin.loadURL(domainURL);
@@ -25,13 +34,20 @@ function createdomainWindow() {
return domainwin; return domainwin;
} }
// Call this window onClick addDomain in tray // Call this window onClick addDomain in tray
function addDomain() { function addDomain() {
domainWindow = createdomainWindow(); domainWindow = createdomainWindow();
domainWindow.once('ready-to-show', () => {
domainWindow.show(); domainWindow.show();
});
setTimeout(() => {
if (domainWindow !== null) {
if (!domainWindow.isDestroyed()) {
domainWindow.destroy();
}
}
}, 15000);
} }
// About window // About window
function createAboutWindow() { function createAboutWindow() {
const aboutwin = new electron.BrowserWindow({ const aboutwin = new electron.BrowserWindow({
@@ -61,9 +77,9 @@ function createAboutWindow() {
// Call this onClick About in tray // Call this onClick About in tray
function about() { function about() {
aboutWindow = createAboutWindow(); aboutWindow = createAboutWindow();
aboutWindow.once('ready-to-show', () => {
aboutWindow.show(); aboutWindow.show();
});
} }
exports = module.exports = { exports = module.exports = {addDomain, about};
addDomain, about
};

42
app/package.json Normal file
View File

@@ -0,0 +1,42 @@
{
"name": "zulip",
"productName": "Zulip",
"version": "0.5.9",
"description": "Zulip Desktop App",
"license": "Apache-2.0",
"email": "<svnitakash@gmail.com>",
"copyright": "©2017 Kandra Labs, Inc.",
"author": {
"name": "Akash Nimare",
"email": "svnitakash@gmail.com"
},
"repository": {
"type": "git",
"url": "https://github.com/zulip/zulip-electron.git"
},
"bugs": {
"url": "https://github.com/zulip/zulip-electron/issues"
},
"main": "main/index.js",
"keywords": [
"Zulip",
"Group Chat app",
"electron-app",
"electron",
"Desktop app",
"InstantMessaging"
],
"dependencies": {
"electron-config":"0.2.1",
"electron-debug": "1.1.0",
"electron-is-dev": "0.1.2",
"electron-localshortcut": "1.0.0",
"electron-log": "1.3.0",
"electron-spellchecker": "1.0.5",
"electron-updater": "1.11.2",
"https": "^1.0.0",
"node-json-db": "0.7.3",
"request": "2.79.0",
"wurl": "2.1.0"
}
}

View File

@@ -7,13 +7,17 @@
<body> <body>
<div class="about"> <div class="about">
<center><img src="../resources/zulip.png"></center> <center><img src="../resources/zulip.png"></center>
<center><p class="detail"> Version : 0.0.1 </p> <center><p class="detail" id="version"> Version : ?.?.? </p>
<center><p class="detail"> License : Apache </p> <center><p class="detail"> License : Apache </p>
<center><p class="detail"> Maintainer : Zulip </p> <center><p class="detail"> Maintainer : Zulip </p>
<p class="left"><a class="bug" onclick="linkInBrowser()" href="#">Found bug?</a></p> <p class="left"><a class="bug" onclick="linkInBrowser()" href="#">Found bug?</a></p>
</div> </div>
<script> <script>
const app = require('electron').remote.app;
const version_tag = document.getElementById('version');
version_tag.innerHTML = ' Version : ' + app.getVersion() + ' ';
function linkInBrowser(event) { function linkInBrowser(event) {
const shell = require('electron').shell; const shell = require('electron').shell;

View File

@@ -72,12 +72,3 @@ button:focus {
left: 25%; left: 25%;
text-align: center; text-align: center;
} }
#pic {
width: 20px;
left: 36%;
margin-left: 4px;
top: 63%;
display: none;
position: absolute;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -6,17 +6,6 @@
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
<title>Login - Zulip</title> <title>Login - Zulip</title>
<link rel="stylesheet" href="css/main.css" type="text/css" media="screen"> <link rel="stylesheet" href="css/main.css" type="text/css" media="screen">
<script type="text/javascript">
const JsonDB = require('node-json-db');
const {app} = require('electron').remote;
const db = new JsonDB(app.getPath('userData') + '/domain.json', true, true);
const data = db.getData('/');
if (data.domain) {
window.location.href = data.domain;
}
</script>
<script>require('electron-connect').client.create()</script>
</head> </head>
<body class="container-layout"> <body class="container-layout">
<div class="section-main"> <div class="section-main">
@@ -29,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="zulip.tabbott.net"> <input type="text" id="url" autofocus="autofocus" spellcheck="false" placeholder="Server URL">
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
@@ -49,6 +38,5 @@
</section> </section>
</section> </section>
</div> </div>
<script src="js/main.js"></script>
</body> </body>
</html> </html>

View File

@@ -1,30 +0,0 @@
/* global app */
// eslint-disable-next-line no-unused-vars
function addDomain() {
const request = require('request');
const ipcRenderer = require('electron').ipcRenderer;
const JsonDB = require('node-json-db');
const db = new JsonDB(app.getPath('userData') + '/domain.json', true, true);
document.getElementById('main').innerHTML = 'checking...';
let newDomain = document.getElementById('url').value;
newDomain = newDomain.replace(/^https?:\/\//, '');
const domain = 'https://' + newDomain;
const checkDomain = domain + '/static/audio/zulip.ogg';
request(checkDomain, (error, response) => {
if (!error && response.statusCode !== 404) {
document.getElementById('main').innerHTML = 'Connect';
db.push('/domain', domain);
ipcRenderer.send('new-domain', domain);
// window.location.href = domain;
} else {
document.getElementById('main').innerHTML = 'Connect';
document.getElementById('server-status').innerHTML = 'Not a vaild Zulip Server.';
}
});
}

View File

@@ -1,4 +1,5 @@
'use strict'; 'use strict';
// eslint-disable-next-line import/no-extraneous-dependencies
const {remote} = require('electron'); const {remote} = require('electron');
const prefWindow = remote.getCurrentWindow(); const prefWindow = remote.getCurrentWindow();
@@ -13,33 +14,54 @@ document.addEventListener('keydown', event => {
} }
}); });
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
function addDomain() { window.prefDomain = function () {
const request = require('request'); const request = require('request');
// eslint-disable-next-line import/no-extraneous-dependencies
const ipcRenderer = require('electron').ipcRenderer; const ipcRenderer = require('electron').ipcRenderer;
const JsonDB = require('node-json-db'); const JsonDB = require('node-json-db');
const {app} = require('electron').remote; // eslint-disable-next-line import/no-extraneous-dependencies
const {
app
} = require('electron').remote;
const db = new JsonDB(app.getPath('userData') + '/domain.json', true, true); const db = new JsonDB(app.getPath('userData') + '/domain.json', true, true);
document.getElementById('main').innerHTML = 'checking...';
document.getElementById('pic').style.display = 'block';
let newDomain = document.getElementById('url').value; let newDomain = document.getElementById('url').value;
newDomain = newDomain.replace(/^https?:\/\//, ''); newDomain = newDomain.replace(/^https?:\/\//, '');
newDomain = newDomain.replace(/^http?:\/\//, '');
const domain = 'https://' + newDomain; if (newDomain === '') {
document.getElementById('urladded').innerHTML = 'Please input a value';
} else {
document.getElementById('main').innerHTML = 'Checking...';
if (newDomain.indexOf('localhost:') >= 0) {
const domain = 'http://' + newDomain;
const checkDomain = domain + '/static/audio/zulip.ogg'; const checkDomain = domain + '/static/audio/zulip.ogg';
request(checkDomain, (error, response) => { request(checkDomain, (error, response) => {
if (!error && response.statusCode !== 404) { if (!error && response.statusCode !== 404) {
document.getElementById('pic').style.display = 'none';
document.getElementById('main').innerHTML = 'Switch'; document.getElementById('main').innerHTML = 'Switch';
document.getElementById('urladded').innerHTML = 'Switched to ' + newDomain; document.getElementById('urladded').innerHTML = 'Switched to ' + newDomain;
db.push('/domain', domain); db.push('/domain', domain);
ipcRenderer.send('new-domain', domain); ipcRenderer.send('new-domain', domain);
} else { } else {
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 Local Server.';
} }
}); });
} } else {
const domain = 'https://' + newDomain;
const checkDomain = domain + '/static/audio/zulip.ogg';
request(checkDomain, (error, response) => {
if (!error && response.statusCode !== 404) {
document.getElementById('main').innerHTML = 'Switch';
document.getElementById('urladded').innerHTML = 'Switched to ' + newDomain;
db.push('/domain', domain);
ipcRenderer.send('new-domain', domain);
} else {
document.getElementById('main').innerHTML = 'Switch';
document.getElementById('urladded').innerHTML = 'Not a valid Zulip Server.';
}
});
}
}
};

View File

@@ -3,17 +3,14 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<link rel="stylesheet" href="css/pref.css"> <link rel="stylesheet" href="css/pref.css">
<script type="text/javascript">
</script>
</head> </head>
<body> <body>
<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="prefDomain(); return false">
<input id="url" type="text" placeholder="zulip.example.com"> <input id="url" type="text" placeholder="Server URL">
<button type="submit" id="main" value="Submit" onclick="addDomain();"> <button type="submit" id="main" value="Submit">
Switch</button> Switch</button>
<img id="pic" src="img/loader.gif" />
</form> </form>
<p id="urladded"><p> <p id="urladded"><p>
</div> </div>

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 B

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

23
appveyor.yml Normal file
View File

@@ -0,0 +1,23 @@
version: build{build}
platform:
- x64
os: Previous Visual Studio 2015
cache:
- node_modules
install:
- ps: Install-Product node 6 x64
- git reset --hard HEAD
- npm install npm -g
- node --version
- npm --version
- python --version
- npm install
- npm install -g gulp
build: off
test_script:
- npm run test

BIN
build/appdmg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
build/icon.icns Normal file

Binary file not shown.

BIN
build/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

BIN
build/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

3
build/icons/1024x1024.png Executable file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1b92ae5c6e5fb0e5b7fcdb46fe102fa0ca7f4d150016cf1a461c0e86921bc731
size 163336

BIN
build/icons/128x128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
build/icons/16x16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 B

BIN
build/icons/24x24.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
build/icons/256x256.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
build/icons/32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
build/icons/48x48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
build/icons/512x512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
build/icons/64x64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
build/icons/96x96.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
build/zulip.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -1,5 +1,6 @@
'use strict'; 'use strict';
const gulp = require('gulp'); const gulp = require('gulp');
const mocha = require('gulp-mocha');
const electron = require('electron-connect').server.create({ const electron = require('electron-connect').server.create({
verbose: true verbose: true
}); });
@@ -27,4 +28,9 @@ gulp.task('reload:renderer', done => {
done(); done();
}); });
gulp.task('default', ['dev']); // Test app using mocha+spectron
gulp.task('test', () => {
return gulp.src('tests/index.js').pipe(mocha());
});
gulp.task('default', ['dev', 'test']);

View File

@@ -1,9 +1,16 @@
{ {
"name": "Zulip-Desktop", "name": "zulip",
"productName": "Zulip", "productName": "Zulip",
"version": "0.3.1", "version": "0.5.9",
"main": "./app/main",
"description": "Zulip Desktop App", "description": "Zulip Desktop App",
"license": "MIT", "license": "Apache-2.0",
"email": "<svnitakash@gmail.com>",
"copyright": "©2017 Kandra Labs, Inc.",
"author": {
"name": "Akash Nimare",
"email": "svnitakash@gmail.com"
},
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/zulip/zulip-electron.git" "url": "https://github.com/zulip/zulip-electron.git"
@@ -11,38 +18,84 @@
"bugs": { "bugs": {
"url": "https://github.com/zulip/zulip-electron/issues" "url": "https://github.com/zulip/zulip-electron/issues"
}, },
"main": "app/main/index.js",
"scripts": { "scripts": {
"test": "xo", "start": "electron ./app/main",
"start": "electron .", "postinstall": "install-app-deps",
"test": "gulp test && xo",
"dev": "gulp dev", "dev": "gulp dev",
"build:osx": "electron-packager . --out=dist --app-version=$npm_package_version --prune --asar --icon=app/resources/Icon.icns --overwrite --platform=darwin --arch=x64", "pack": "build --dir",
"build": "electron-packager . --out=dist --app-version=$npm_package_version --prune --asar --overwrite --all" "dist": "build",
"build:win": "build --win nsis-web --ia32 --x64",
"travis": "cd ./scripts && ./travis-build-test.sh"
},
"build": {
"appId": "org.zulip.zulip-electron",
"asar": true,
"files": [
"**/*",
"!node_modules/@paulcbetts/cld/deps/cld${/*}"
],
"copyright": "©2017 Kandra Labs, Inc.",
"mac": {
"category": "public.app-category.productivity"
},
"linux": {
"category": "",
"packageCategory": "GNOME;GTK;Network;InstantMessaging",
"description": "Zulip Desktop Client for Linux",
"target": [
"deb",
"AppImage"
],
"maintainer": "Akash Nimare <svnitakash@gmail.com>"
},
"deb": {
"synopsis": "Zulip Desktop App"
},
"dmg": {
"background": "build/appdmg.png",
"icon": "build/icon.icns",
"iconSize": 128,
"contents": [
{
"x": 380,
"y": 240,
"type": "link",
"path": "/Applications"
},
{
"x": 122,
"y": 240,
"type": "file"
}
]
},
"win": {
"target": "nsis",
"icon": "build/icon.ico"
},
"nsis": {
"perMachine": true,
"oneClick": false
}
}, },
"keywords": [ "keywords": [
"Zulip", "Zulip",
"Group Chat app", "Group Chat app",
"electron-app", "electron-app",
"electron" "electron",
"Desktop app",
"InstantMessaging"
], ],
"dependencies": {
"configstore": "^2.0.0",
"dialogs": "1.1.14",
"electron-context-menu": "0.4.0",
"electron-debug": "^1.0.0",
"electron-dl": "^0.2.0",
"electron-localshortcut": "^0.6.1",
"node-json-db": "^0.7.2",
"request": "^2.74.0",
"simple-spellchecker": "^0.9.0",
"wurl": "^2.1.0"
},
"devDependencies": { "devDependencies": {
"assert": "^1.4.1",
"devtron": "^1.1.0", "devtron": "^1.1.0",
"electron": "1.3.3", "electron-builder": "16.6.0",
"electron": "1.4.15",
"electron-connect": "^0.4.6", "electron-connect": "^0.4.6",
"electron-packager": "^7.0.0",
"gulp": "^3.9.1", "gulp": "^3.9.1",
"gulp-mocha": "^3.0.1",
"spectron": "^3.3.0",
"xo": "*" "xo": "*"
}, },
"xo": { "xo": {
@@ -53,15 +106,23 @@
"rules": { "rules": {
"max-lines": [ "max-lines": [
"warn", "warn",
350 500
], ],
"no-warning-comments": 0 "no-warning-comments": 0,
"no-else-return": 0,
"import/no-unresolved": 0,
"import/no-extraneous-dependencies": 0
} }
} }
], ],
"ignore": [
"tests/*.js",
"app/main/macos-swipe-navigation.js"
],
"envs": [ "envs": [
"node", "node",
"browser" "browser",
"mocha"
] ]
} }
} }

10
scripts/travis-build-test.sh Executable file
View File

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

27
tests/index.js Normal file
View File

@@ -0,0 +1,27 @@
const assert = require('assert')
const Application = require('spectron').Application
describe('application launch', function () {
this.timeout(15000)
beforeEach(function () {
this.app = new Application({
path: require('electron'),
args: [__dirname + '/../app/renderer/index.html']
})
return this.app.start()
})
afterEach(function () {
if (this.app && this.app.isRunning()) {
return this.app.stop()
}
})
it('shows an initial window', function () {
return this.app.client.getWindowCount().then(function (count) {
assert.equal(count, 1)
})
})
})

109
zulip-electron-launcher.sh Executable file
View File

@@ -0,0 +1,109 @@
#!/bin/bash
# Zulip Beta Client Launcher
# This script ensures that you have the latest version of the specified branch
# (defaults to master if none specified) and then updates or installs all your
# required npm modules.
# I recommend symlinking this script into your PATH.
# {{{ showUsage()
showUsage()
{
echo "Usage: $0 <branch_name>"
echo "Example: $0 dev"
exit 1
}
# }}}
# {{{ envSetup()
envSetup()
{
defaultBranch="master"
startingDir=`pwd`
requirePop=0
# Check command line arguments
if [ "$#" -gt "1" ]
then
showUsage
elif [ "$#" -eq "1" ]
then
myBranch=$1
else
myBranch=$defaultBranch
fi
# Set workingDir
if [ -L $0 ]
then
realPath=`ls -l $0 | cut -d '>' -f 2`
workingDir=`dirname $realPath`
else
workingDir="."
fi
# Set name of upstreamRemote
cd $workingDir
git remote -v | grep "github\.com.zulip.zulip-electron.git (fetch)" > /dev/null 2>&1
if [ $? -eq 0 ]
then
upstreamRemote=`git remote -v | grep "github\.com.zulip.zulip-electron.git (fetch)" | awk '{ print $1 }'`
else
upstreamRemote="origin"
fi
}
# }}}
# {{{ gitCheckout()
gitCheckout()
{
git fetch $upstreamRemote
git checkout $myBranch
git rebase $upstreamRemote/master
if [ $? -gt 0 ]
then
echo "Stashing uncommitted changes and doing a new git pull"
git stash && requirePop=1
git rebase $upstreamRemote/master
fi
}
# }}}
# {{{ npmInstallStart()
npmInstallStart()
{
npm install
npm start &
}
# }}}
# {{{ cleanUp()
cleanUp()
{
# Switch back to branch we started on
git checkout -
# Pop if we stashed
if [ $requirePop -eq 1 ]
then
echo "Popping out uncommitted changes"
git stash pop
fi
# Return the whatever dir we started in
cd $startingDir
}
# }}}
envSetup $*
gitCheckout
npmInstallStart
cleanUp