Compare commits

..

3 Commits

Author SHA1 Message Date
Akash Nimare
3768ec6055 electron-builder: Downgrade electron-builder to v20.28.3. 2019-03-21 01:53:23 +05:30
Akash Nimare
c029e70046 windows: Update installation configuration. 2019-02-12 12:34:13 +05:30
Akash Nimare
4773ab0d15 v2.5.0: New release for Windows users. 2019-02-11 18:22:18 +05:30
43 changed files with 894 additions and 3715 deletions

View File

@@ -2,7 +2,7 @@
<!-- Please Include: -->
- **Operating System**:
- [ ] Windows
- [ ] Linux/Ubuntu
- [ ] Linux/Ubutnu
- [ ] macOS
- **Clear steps to reproduce the issue**:
- **Relevant error messages and/or screenshots**:

View File

@@ -1,25 +0,0 @@
{
"tagname-lowercase": true,
"attr-lowercase": true,
"attr-value-double-quotes": true,
"attr-value-not-empty": false,
"attr-no-duplication": true,
"doctype-first": true,
"tag-pair": true,
"empty-tag-not-self-closed": true,
"spec-char-escape": true,
"id-unique": true,
"src-not-empty": true,
"title-require": true,
"alt-require": false,
"doctype-html5": true,
"id-class-value": "dash",
"style-disabled": false,
"inline-style-disabled": false,
"inline-script-disabled": false,
"space-tab-mixed-disabled": "space4",
"id-class-ad-disabled": false,
"href-abs-or-rel": false,
"attr-unsafe-chars": true,
"head-script-disabled": true
}

View File

@@ -1,67 +0,0 @@
{
"rules": {
# Stylistic rules for CSS.
"function-comma-space-after": "always",
"function-comma-space-before": "never",
"function-max-empty-lines": 0,
"function-whitespace-after": "always",
"value-keyword-case": "lower",
"value-list-comma-newline-after": "always-multi-line",
"value-list-comma-space-after": "always-single-line",
"value-list-comma-space-before": "never",
"value-list-max-empty-lines": 0,
"unit-case": "lower",
"property-case": "lower",
"color-hex-case": "lower",
"declaration-bang-space-before": "always",
"declaration-colon-newline-after": "always-multi-line",
"declaration-colon-space-after": "always-single-line",
"declaration-colon-space-before": "never",
"declaration-block-semicolon-newline-after": "always",
"declaration-block-semicolon-space-before": "never",
"declaration-block-trailing-semicolon": "always",
"block-closing-brace-empty-line-before": "never",
"block-closing-brace-newline-after": "always",
"block-closing-brace-newline-before": "always",
"block-opening-brace-newline-after": "always",
"block-opening-brace-space-before": "always",
"selector-attribute-brackets-space-inside": "never",
"selector-attribute-operator-space-after": "never",
"selector-attribute-operator-space-before": "never",
"selector-combinator-space-after": "always",
"selector-combinator-space-before": "always",
"selector-descendant-combinator-no-non-space": true,
"selector-pseudo-class-parentheses-space-inside": "never",
"selector-pseudo-element-case": "lower",
"selector-pseudo-element-colon-notation": "double",
"selector-type-case": "lower",
"selector-list-comma-newline-after": "always",
"selector-list-comma-space-before": "never",
"media-feature-colon-space-after": "always",
"media-feature-colon-space-before": "never",
"media-feature-name-case": "lower",
"media-feature-parentheses-space-inside": "never",
"media-feature-range-operator-space-after": "always",
"media-feature-range-operator-space-before": "always",
"media-query-list-comma-newline-after": "always",
"media-query-list-comma-space-before": "never",
"at-rule-name-case": "lower",
"at-rule-name-space-after": "always",
"at-rule-semicolon-newline-after": "always",
"at-rule-semicolon-space-before": "never",
"comment-whitespace-inside": "always",
"indentation": 4,
# Limit language features
"color-no-hex": true,
"color-named": "never",
}
}

View File

@@ -2,20 +2,20 @@
Thanks for taking the time to contribute!
The following is a set of guidelines for contributing to Zulip's desktop Client. These are just guidelines, not rules, so use your best judgement 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 Desktop Client. These are just guidelines, not rules, so use your best judgement and feel free to propose changes to this document in a pull request.
## 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](https://jlord.dev/blog/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 setting up a development environment, setting up with the Zulip webapp project, and testing, can be read [here](https://zulip.readthedocs.io).
* If you have any questions regarding zulip-desktop, open an [issue](https://github.com/zulip/zulip-desktop/issues/new/) or ask it on [chat.zulip.org](https://chat.zulip.org/#narrow/stream/16-desktop).
* If you have any questions regarding zulip-electron, open an [issue](https://github.com/zulip/zulip-electron/issues/new/) or ask it on [chat.zulip.org](https://chat.zulip.org/#narrow/stream/16-desktop).
## Issue
Ensure the bug was not already reported by searching on GitHub under [issues](https://github.com/zulip/zulip-desktop/issues). If you're unable to find an open issue addressing the bug, open a [new issue](https://github.com/zulip/zulip-desktop/issues/new).
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 bug, open a [new issue](https://github.com/zulip/zulip-electron/issues/new).
The [zulipbot](https://github.com/zulip/zulipbot) helps to claim an 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).
@@ -38,7 +38,7 @@ For example:
## Pull Requests
Pull Requests are always welcome.
Pull Requests are always welcome.
1. When you edit the code, please run `npm run test` to check the formatting of your code before you `git commit`.
2. Ensure the PR description clearly describes the problem and solution. It should include:

View File

@@ -1,6 +1,6 @@
# Zulip Desktop Client
[![Build Status](https://travis-ci.org/zulip/zulip-desktop.svg?branch=master)](https://travis-ci.org/zulip/zulip-desktop)
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/zulip/zulip-desktop?branch=master&svg=true)](https://ci.appveyor.com/project/zulip/zulip-desktop/branch/master)
[![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)
[![project chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://chat.zulip.org)
@@ -20,7 +20,7 @@ Please see the [installation guide](https://zulipchat.com/help/desktop-app-insta
# Contribute
First, join us on the [Zulip community server](https://zulip.readthedocs.io/en/latest/contributing/chat-zulip-org.html)!
First, join us on the [Zulip community server](https://zulip.readthedocs.io/en/latest/contributing/chat-zulip-org.html)!
Also see our [contribution guidelines](./CONTRIBUTING.md) and our [development guide](./development.md).
# License

View File

@@ -159,10 +159,7 @@ app.on('ready', () => {
}
// Initialize sentry for main process
const errorReporting = ConfigUtil.getConfigItem('errorReporting');
if (errorReporting) {
sentryInit();
}
sentryInit();
const isSystemProxy = ConfigUtil.getConfigItem('useSystemProxy');
@@ -254,7 +251,6 @@ app.on('ready', () => {
ipcMain.on('toggle-menubar', (event, showMenubar) => {
mainWindow.setAutoHideMenuBar(showMenubar);
mainWindow.setMenuBarVisibility(!showMenubar);
page.send('toggle-autohide-menubar', showMenubar, true);
});
ipcMain.on('update-badge', (event, messageCount) => {
@@ -348,12 +344,6 @@ app.on('ready', () => {
ipcMain.on('realm-icon-changed', (event, serverURL, iconURL) => {
page.send('update-realm-icon', serverURL, iconURL);
});
// Using event.sender.send instead of page.send here to
// make sure the value of errorReporting is sent only once on load.
ipcMain.on('error-reporting', event => {
event.sender.send('error-reporting-val', errorReporting);
});
});
app.on('before-quit', () => {

View File

@@ -14,7 +14,7 @@ const logger = new Logger({
});
function linuxUpdateNotification() {
let url = 'https://api.github.com/repos/zulip/zulip-desktop/releases';
let url = 'https://api.github.com/repos/zulip/zulip-electron/releases';
url = ConfigUtil.getConfigItem('betaUpdate') ? url : url + '/latest';
const proxyEnabled = ConfigUtil.getConfigItem('useManualProxy') || ConfigUtil.getConfigItem('useSystemProxy');

View File

@@ -49,7 +49,7 @@ class AppMenu {
{
label: `Release Notes`,
click() {
shell.openExternal(`https://github.com/zulip/zulip-desktop/releases/tag/v${app.getVersion()}`);
shell.openExternal(`https://github.com/zulip/zulip-electron/releases/tag/v${app.getVersion()}`);
}
}, {
type: 'separator'
@@ -162,20 +162,6 @@ class AppMenu {
ConfigUtil.setConfigItem('showSidebar', newValue);
}
}
}, {
label: 'Auto hide Menu bar',
checked: ConfigUtil.getConfigItem('autoHideMenubar', false),
visible: process.platform !== 'darwin',
click(item, focusedWindow) {
if (focusedWindow) {
const newValue = !ConfigUtil.getConfigItem('autoHideMenubar');
focusedWindow.setAutoHideMenuBar(newValue);
focusedWindow.setMenuBarVisibility(!newValue);
focusedWindow.webContents.send('toggle-autohide-menubar', newValue);
ConfigUtil.setConfigItem('autoHideMenubar', newValue);
}
},
type: 'checkbox'
}];
}
@@ -195,10 +181,8 @@ class AppMenu {
},
{
label: `Help Center`,
click(focusedWindow) {
if (focusedWindow) {
AppMenu.sendAction('open-help');
}
click() {
shell.openExternal('https://zulipchat.com/help/');
}
}, {
label: 'Report an Issue',
@@ -242,28 +226,6 @@ class AppMenu {
type: 'checkbox'
});
}
initialSubmenu.push({
type: 'separator'
});
initialSubmenu.push({
label: 'Switch to Next Organization',
accelerator: `Ctrl+Tab`,
enabled: tabs[activeTabIndex].props.role === 'server',
click(item, focusedWindow) {
if (focusedWindow) {
AppMenu.sendAction('switch-server-tab', AppMenu.getNextServer(tabs, activeTabIndex));
}
}
}, {
label: 'Switch to Previous Organization',
accelerator: `Ctrl+Shift+Tab`,
enabled: tabs[activeTabIndex].props.role === 'server',
click(item, focusedWindow) {
if (focusedWindow) {
AppMenu.sendAction('switch-server-tab', AppMenu.getPreviousServer(tabs, activeTabIndex));
}
}
});
}
return initialSubmenu;
@@ -275,21 +237,6 @@ class AppMenu {
return [{
label: `${app.getName()}`,
submenu: [{
label: 'Add Organization',
accelerator: 'Cmd+Shift+N',
click(item, focusedWindow) {
if (focusedWindow) {
AppMenu.sendAction('new-server');
}
}
}, {
label: 'Toggle Do Not Disturb',
accelerator: 'Cmd+Shift+M',
click() {
const dndUtil = DNDUtil.toggle();
AppMenu.sendAction('toggle-dnd', dndUtil.dnd, dndUtil.newSettings);
}
}, {
label: 'Desktop Settings',
accelerator: 'Cmd+,',
click(item, focusedWindow) {
@@ -309,15 +256,14 @@ class AppMenu {
}, {
type: 'separator'
}, {
label: 'Copy Zulip URL',
accelerator: 'Cmd+Shift+C',
click(item, focusedWindow) {
if (focusedWindow) {
AppMenu.sendAction('copy-zulip-url');
}
label: 'Toggle Do Not Disturb',
accelerator: 'Command+Shift+M',
click() {
const dndUtil = DNDUtil.toggle();
AppMenu.sendAction('toggle-dnd', dndUtil.dnd, dndUtil.newSettings);
}
}, {
label: 'Log Out of Organization',
label: 'Log Out',
accelerator: 'Cmd+L',
enabled: enableMenu,
click(item, focusedWindow) {
@@ -386,23 +332,6 @@ class AppMenu {
return [{
label: '&File',
submenu: [{
label: 'Add Organization',
accelerator: 'Ctrl+Shift+N',
click(item, focusedWindow) {
if (focusedWindow) {
AppMenu.sendAction('new-server');
}
}
}, {
type: 'separator'
}, {
label: 'Toggle Do Not Disturb',
accelerator: 'Ctrl+Shift+M',
click() {
const dndUtil = DNDUtil.toggle();
AppMenu.sendAction('toggle-dnd', dndUtil.dnd, dndUtil.newSettings);
}
}, {
label: 'Desktop Settings',
accelerator: 'Ctrl+,',
click(item, focusedWindow) {
@@ -410,6 +339,8 @@ class AppMenu {
AppMenu.sendAction('open-settings');
}
}
}, {
type: 'separator'
}, {
label: 'Keyboard Shortcuts',
accelerator: 'Ctrl+Shift+K',
@@ -422,15 +353,14 @@ class AppMenu {
}, {
type: 'separator'
}, {
label: 'Copy Zulip URL',
accelerator: 'Ctrl+Shift+C',
click(item, focusedWindow) {
if (focusedWindow) {
AppMenu.sendAction('copy-zulip-url');
}
label: 'Toggle Do Not Disturb',
accelerator: 'Ctrl+Shift+M',
click() {
const dndUtil = DNDUtil.toggle();
AppMenu.sendAction('toggle-dnd', dndUtil.dnd, dndUtil.newSettings);
}
}, {
label: 'Log Out of Organization',
label: 'Log Out',
accelerator: 'Ctrl+L',
enabled: enableMenu,
click(item, focusedWindow) {
@@ -497,23 +427,6 @@ class AppMenu {
static checkForUpdate() {
appUpdater(true);
}
static getNextServer(tabs, activeTabIndex) {
do {
activeTabIndex = (activeTabIndex + 1) % tabs.length;
}
while (tabs[activeTabIndex].props.role !== 'server');
return activeTabIndex;
}
static getPreviousServer(tabs, activeTabIndex) {
do {
activeTabIndex = (activeTabIndex - 1 + tabs.length) % tabs.length;
}
while (tabs[activeTabIndex].props.role !== 'server');
return activeTabIndex;
}
static resetAppSettings() {
const resetAppSettingsMessage = 'By proceeding you will be removing all connected organizations and preferences from Zulip.';

2
app/package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "zulip",
"version": "3.0.0",
"version": "2.5.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,7 +1,7 @@
{
"name": "zulip",
"productName": "Zulip",
"version": "3.0.0",
"version": "2.5.0",
"description": "Zulip Desktop App",
"license": "Apache-2.0",
"copyright": "Kandra Labs, Inc.",
@@ -11,10 +11,10 @@
},
"repository": {
"type": "git",
"url": "https://github.com/zulip/zulip-desktop.git"
"url": "https://github.com/zulip/zulip-electron.git"
},
"bugs": {
"url": "https://github.com/zulip/zulip-desktop/issues"
"url": "https://github.com/zulip/zulip-electron/issues"
},
"main": "main/index.js",
"keywords": [

View File

@@ -1,47 +1,46 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/about.css">
<title>Zulip - About</title>
</head>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/about.css">
</head>
<body>
<div class="about">
<img class="logo" src="../resources/zulip.png" />
<p class="detail" id="version">v?.?.?</p>
<div class="maintenance-info">
<p class="detail maintainer">
Maintained by
<a onclick="linkInBrowser('website')">Zulip</a>
</p>
<p class="detail license">
Available under the
<a onclick="linkInBrowser('license')">Apache 2.0 License</a>
</p>
</div>
</div>
<script>
<body>
<div class="about">
<img class="logo" src="../resources/zulip.png" />
<p class="detail" id="version">v?.?.?</p>
<div class="maintenance-info">
<p class="detail maintainer">
Maintained by
<a onclick="linkInBrowser('website')">Zulip</a>
</p>
<p class="detail license">
Available under the
<a onclick="linkInBrowser('license')">Apache 2.0 License</a>
</p>
</div>
</div>
<script>
const { app } = require('electron').remote;
const { shell } = require('electron');
const version_tag = document.querySelector('#version');
version_tag.innerHTML = 'v' + app.getVersion();
const { app } = require('electron').remote;
const { shell } = require('electron');
const version_tag = document.querySelector('#version');
version_tag.innerHTML = 'v' + app.getVersion();
function linkInBrowser(type) {
let url;
switch (type) {
case 'website':
url = "https://zulipchat.com";
break;
case 'license':
url = "https://github.com/zulip/zulip-desktop/blob/master/LICENSE";
break;
}
shell.openExternal(url);
}
</script>
<script>require('./js/shared/preventdrag.js')</script>
</body>
function linkInBrowser(type) {
let url;
switch (type) {
case 'website':
url = "https://zulipchat.com";
break;
case 'license':
url = "https://github.com/zulip/zulip-electron/blob/master/LICENSE";
break;
}
shell.openExternal(url);
}
</script>
<script>require('./js/shared/preventdrag.js')</script>
</body>
</html>

View File

@@ -1,66 +1,66 @@
body {
background: rgba(250, 250, 250, 1.000);
font-family: menu, "Helvetica Neue", sans-serif;
-webkit-font-smoothing: subpixel-antialiased;
background: #fafafa;
font-family: menu, "Helvetica Neue", sans-serif;
-webkit-font-smoothing: subpixel-antialiased;
}
.logo {
display: block;
margin: -40px auto;
display: block;
margin: -40px auto;
}
#version {
color: rgba(68, 67, 67, 1.000);
font-size: 1.3em;
padding-top: 40px;
color: #444343;
font-size: 1.3em;
padding-top: 40px;
}
.about {
margin: 25vh auto;
height: 25vh;
text-align: center;
margin: 25vh auto;
height: 25vh;
text-align: center;
}
.about p {
font-size: 20px;
color: rgba(0, 0, 0, 0.62);
font-size: 20px;
color: rgba(0, 0, 0, 0.62);
}
.about img {
width: 150px;
width: 150px;
}
.detail {
text-align: center;
text-align: center;
}
.detail.maintainer {
font-size: 1.2em;
font-weight: 500;
font-size: 1.2em;
font-weight: 500;
}
.detail.license {
font-size: 0.8em;
font-size: 0.8em;
}
.maintenance-info {
cursor: pointer;
position: absolute;
width: 100%;
left: 0px;
color: rgba(68, 68, 68, 1.000);
cursor: pointer;
position: absolute;
width: 100%;
left: 0px;
color: #444;
}
.maintenance-info p {
margin: 0;
font-size: 1em;
width: 100%;
margin: 0;
font-size: 1em;
width: 100%;
}
p.detail a {
color: rgba(53, 95, 76, 1.000);
color: #355f4c;
}
p.detail a:hover {
text-decoration: underline;
text-decoration: underline;
}

View File

@@ -16,7 +16,7 @@ body {
}
.toggle-sidebar {
background: rgba(34, 44, 49, 1.000);
background: #222c31;
width: 54px;
padding: 27px 0 20px 0;
justify-content: space-between;
@@ -43,25 +43,25 @@ body {
}
#view-controls-container {
height: calc(100% - 208px);
overflow-y: hidden;
height: calc(100% - 208px);
overflow-y: hidden;
}
#view-controls-container:hover {
overflow-y: overlay;
overflow-y: overlay;
}
#view-controls-container::-webkit-scrollbar {
width: 4px;
width: 4px;
}
#view-controls-container::-webkit-scrollbar-track {
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
}
#view-controls-container::-webkit-scrollbar-thumb {
background-color: rgba(169, 169, 169, 1.000);
outline: 1px solid rgba(169, 169, 169, 1.000);
background-color: darkgrey;
outline: 1px solid slategrey;
}
@font-face {
@@ -119,12 +119,12 @@ body {
}
.action-button i {
color: rgba(108, 133, 146, 1.000);
color: #6c8592;
font-size: 28px;
}
.action-button:hover i {
color: rgba(152, 169, 179, 1.000);
color: #98a9b3;
}
.action-button.disable {
@@ -136,18 +136,18 @@ body {
}
.action-button.disable:hover i {
color: rgba(108, 133, 146, 1.000);
color: #6c8592;
}
.action-button.active {
/* background-color: rgba(255, 255, 255, 0.25); */
background-color: rgba(239, 239, 239, 1.000);
background-color: #efefef;
opacity: 0.9;
padding-right: 14px;
}
.action-button.active i {
color: rgba(28, 38, 43, 1.000);
color: #1c262b;
}
.tab:first-child {
@@ -177,7 +177,7 @@ body {
margin-top: 5px;
z-index: 11;
line-height: 31px;
color: rgba(238, 238, 238, 1.000);
color: #eee;
text-align: center;
overflow: hidden;
opacity: 0.6;
@@ -188,7 +188,7 @@ body {
font-family: Verdana;
font-weight: 600;
font-size: 22px;
border: 2px solid rgba(34, 44, 49, 1.000);
border: 2px solid #222c31;
margin-left: 17%;
width: 35px;
border-radius: 4px;
@@ -216,7 +216,7 @@ body {
.tab.active .server-tab {
opacity: 1;
background-color: rgba(100, 132, 120, 1.000);
background-color: #648478;
}
.tab .server-tab-badge.active {
@@ -224,7 +224,7 @@ body {
min-width: 11px;
padding: 0 3px;
height: 17px;
background-color: rgba(244, 67, 54, 1.000);
background-color: #f44336;
font-size: 10px;
font-family: sans-serif;
position: absolute;
@@ -232,7 +232,7 @@ body {
z-index: 15;
top: 6px;
float: right;
color: rgba(255, 255, 255, 1.000);
color: #fff;
text-align: center;
line-height: 17px;
display: block;
@@ -260,25 +260,13 @@ body {
}
.tab .server-tab-shortcut {
color: rgba(100, 132, 120, 1.000);
color: #648478;
font-size: 12px;
text-align: center;
font-family: sans-serif;
margin-bottom: 5px;
}
.refresh {
animation: rotate-loader 1s linear infinite;
}
@keyframes rotate-loader {
from {
transform: rotate(0);
}
to {
transform: rotate(-360deg);
}
}
/*******************
* Webview Area *
@@ -290,19 +278,19 @@ body {
width: 100%;
}
/* Pseudo element for loading indicator */
/*Pseudo element for loading indicator*/
#webviews-container::before {
content: "";
position: absolute;
z-index: 1;
background: rgba(255, 255, 255, 1.000) url(../img/ic_loading.gif) no-repeat;
background: #fff url(../img/ic_loading.gif) no-repeat;
background-size: 60px 60px;
background-position: center;
width: 100%;
height: 100%;
}
/* When the active webview is loaded */
/*When the active webview is loaded*/
#webviews-container.loaded::before {
opacity: 0;
z-index: -1;
@@ -340,34 +328,32 @@ webview.focus {
/* Tooltip styling */
#loading-tooltip,
#dnd-tooltip,
#back-tooltip,
#reload-tooltip,
#setting-tooltip {
font-family: sans-serif;
background: rgba(34, 44, 49, 1.000);
background: #222c31;
margin-left: 48px;
padding: 6px 8px;
position: absolute;
margin-top: 0px;
z-index: 1000;
color: rgba(255, 255, 255, 1.000);
color: white;
border-radius: 4px;
text-align: center;
width: 55px;
font-size: 14px;
}
#loading-tooltip::after,
#dnd-tooltip::after,
#back-tooltip::after,
#reload-tooltip::after,
#setting-tooltip::after {
#dnd-tooltip:after,
#back-tooltip:after,
#reload-tooltip:after,
#setting-tooltip:after {
content: " ";
border-top: 8px solid transparent;
border-bottom: 8px solid transparent;
border-right: 8px solid rgba(34, 44, 49, 1.000);
border-right: 8px solid #222c31;
position: absolute;
top: 7px;
right: 68px;
@@ -376,25 +362,25 @@ webview.focus {
#add-server-tooltip,
.server-tooltip {
font-family: 'arial';
background: rgba(34, 44, 49, 1.000);
background: #222c31;
left: 56px;
padding: 10px 20px;
position: fixed;
margin-top: 11px;
z-index: 5000 !important;
color: rgba(255, 255, 255, 1.000);
color: #fff;
border-radius: 4px;
text-align: center;
width: max-content;
font-size: 14px;
}
#add-server-tooltip::after,
.server-tooltip::after {
#add-server-tooltip:after,
.server-tooltip:after {
content: " ";
border-top: 8px solid transparent;
border-bottom: 8px solid transparent;
border-right: 8px solid rgba(34, 44, 49, 1.000);
border-right: 8px solid #222c31;
position: absolute;
top: 10px;
left: -5px;
@@ -406,14 +392,14 @@ webview.focus {
position: absolute;
width: 24px;
height: 24px;
background: rgba(34, 44, 49, 1.000);
background: #222c31;
border-radius: 20px;
cursor: pointer;
box-shadow: rgba(153, 153, 153, 1.000) 1px 1px;
box-shadow: #999 1px 1px;
}
#collapse-button i {
color: rgba(239, 239, 239, 1.000);
color: #efefef;
}
#main-container {
@@ -434,8 +420,8 @@ webview.focus {
.popup .popuptext {
visibility: hidden;
background-color: rgba(85, 85, 85, 1.000);
color: rgba(255, 255, 255, 1.000);
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 9px 0;
@@ -467,24 +453,24 @@ webview.focus {
}
send-feedback {
width: 60%;
height: 85%;
width: 60%;
height: 85%;
}
#feedback-modal {
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(68, 67, 67, 0.81);
align-items: center;
justify-content: center;
z-index: 2;
transition: all 1s ease-out;
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(68, 67, 67, 0.81);
align-items: center;
justify-content: center;
z-index: 2;
transition: all 1s ease-out;
}
#feedback-modal.show {
display: flex;
display: flex;
}

View File

@@ -1,11 +1,10 @@
html,
body {
html, body {
margin: 0;
cursor: default;
font-size: 14px;
color: rgba(51, 51, 51, 1.000);
background: rgba(255, 255, 255, 1.000);
user-select: none;
color: #333;
background: #fff;
user-select:none;
}
#content {
@@ -28,8 +27,8 @@ body {
#reconnect {
font-size: 16px;
background: rgba(0, 150, 136, 1.000);
color: rgba(255, 255, 255, 1.000);
background: #009688;
color: #fff;
width: 84px;
height: 32px;
border-radius: 5px;

View File

@@ -7,25 +7,25 @@ body {
font-family: menu, "Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased;
font-size: 14px;
background: rgba(239, 239, 239, 1.000);
background: #efefef;
letter-spacing: -.08px;
line-height: 18px;
color: rgba(139, 142, 143, 1.000);
color: #8b8e8f;
}
kbd {
display: inline-block;
border: 1px solid rgba(204, 204, 204, 1.000);
border: 1px solid #ccc;
border-radius: 4px;
font-size: 15px;
font-family: Courier New, Courier, monospace;
font-weight: bold;
white-space: nowrap;
background-color: rgba(247, 247, 247, 1.000);
color: rgba(51, 51, 51, 1.000);
background-color: #f7f7f7;
color: #333;
margin: 0 0.1em;
padding: 0.3em 0.8em;
text-shadow: 0 1px 0 rgba(255, 255, 255, 1.000);
text-shadow: 0 1px 0 #fff;
line-height: 1.4;
}
@@ -33,7 +33,7 @@ table,
th,
td {
border-collapse: collapse;
color: rgba(56, 52, 48, 1.000);
color: #383430;
}
table {
@@ -43,11 +43,11 @@ table {
}
table tr:nth-child(even) {
background-color: rgba(250, 250, 250, 1.000);
background-color: #fafafa;
}
table tr:nth-child(odd) {
background-color: rgba(255, 255, 255, 1.000);
background-color: #fff;
}
td {
@@ -103,7 +103,7 @@ td:nth-child(odd) {
display: flex;
flex-direction: column;
font-size: 16px;
background: rgba(242, 242, 242, 1.000);
background: #f2f2f2;
}
#nav-container {
@@ -112,18 +112,18 @@ td:nth-child(odd) {
.nav {
padding: 7px 0;
color: rgba(153, 153, 153, 1.000);
color: #999;
cursor: pointer;
}
.nav.active {
color: rgba(78, 191, 172, 1.000);
color: #4ebfac;
cursor: default;
position: relative;
}
.nav.active::before {
background: rgba(70, 78, 90, 1.000);
background: #464e5a;
width: 3px;
height: 18px;
position: absolute;
@@ -139,7 +139,7 @@ td:nth-child(odd) {
#settings-header {
font-size: 22px;
color: rgba(34, 44, 49, 1.000);
color: #222c31;
font-weight: bold;
text-transform: uppercase;
}
@@ -159,11 +159,11 @@ td:nth-child(odd) {
.title {
font-weight: 500;
color: rgba(34, 44, 49, 1.000);
color: #222c31;
}
.page-title {
color: rgba(34, 44, 49, 1.000);
color: #222c31;
font-size: 15px;
font-weight: bold;
padding: 4px 0 6px 0;
@@ -182,7 +182,7 @@ td:nth-child(odd) {
.sub-title {
padding: 4px 0 6px 0;
font-weight: bold;
color: rgba(97, 97, 97, 1.000);
color: #616161;
}
img.server-info-icon {
@@ -249,18 +249,14 @@ img.server-info-icon {
font-size: 14px;
border-radius: 4px;
padding: 13px;
border: rgba(237, 237, 237, 1.000) 2px solid;
border: #ededed 2px solid;
outline-width: 0;
background: transparent;
max-width: 450px;
}
.setting-input-value:focus {
border: rgba(78, 191, 172, 1.000) 2px solid;
}
.invalid-input-value:focus {
border: rgba(239, 83, 80, 1) 2px solid;
border: #4EBFAC 2px solid;
}
.manual-proxy-block {
@@ -270,7 +266,7 @@ img.server-info-icon {
.actions-container {
display: flex;
font-size: 14px;
color: rgba(35, 93, 58, 1.000);
color: #235d3a;
vertical-align: middle;
margin: 10px 0;
flex-wrap: wrap;
@@ -291,7 +287,6 @@ img.server-info-icon {
.settings-pane {
flex-grow: 1;
min-width: 550px;
}
.action:hover {
@@ -303,7 +298,7 @@ img.server-info-icon {
}
.action.disabled {
color: rgba(153, 153, 153, 1.000);
color: #999;
}
.settings-card {
@@ -311,7 +306,7 @@ img.server-info-icon {
flex-wrap: wrap;
padding: 12px 30px;
margin: 10px 0 20px 0;
background: rgba(255, 255, 255, 1.000);
background: #fff;
width: 80%;
transition: all 0.2s;
}
@@ -326,29 +321,21 @@ img.server-info-icon {
}
.red {
color: rgb(240, 148, 148);
background: rgba(255, 255, 255, 1.000);
color: #ef5350;
padding: 8px;
border: rgba(239, 83, 80, 0.5) solid 1px;
border-radius: 4px;
display: inline-block;
border: 2px solid rgb(240, 148, 148);
padding: 10px;
width: 100px;
cursor: pointer;
font-size: 1rem;
font-weight: bold;
transition: background-color 0.2s ease;
text-decoration: none;
text-align: center;
border-color: #fff;
}
.red:hover {
background-color: rgb(240, 148, 148);
color: rgba(255, 255, 255, 1.000);
background-color: rgba(230, 52, 49, 0.5);
color: #fff;
}
.green {
color: rgba(255, 255, 255, 1.000);
background: rgba(78, 191, 172, 1.000);
color: #fff;
background: #4EBFAC;
border-radius: 4px;
display: inline-block;
border: none;
@@ -363,8 +350,8 @@ img.server-info-icon {
}
.green:hover {
background-color: rgba(60, 159, 141, 1.000);
color: rgba(255, 255, 255, 1.000);
background-color: #3c9f8d;
color: #fff;
}
.w-150 {
@@ -376,9 +363,9 @@ img.server-info-icon {
}
.grey {
color: rgba(158, 158, 158, 1.000);
background: rgba(250, 250, 250, 1.000);
border: 1px solid rgba(158, 158, 158, 1.000);
color: #9E9E9E;
background: #FAFAFA;
border: 1px solid #9E9E9E;
}
.setting-row {
@@ -405,7 +392,7 @@ i.open-tab-button {
.selected-css-path,
.download-folder-path {
background: rgba(238, 238, 238, 1.000);
background: #eeeeee;
padding: 5px 10px;
margin-right: 10px;
display: flex;
@@ -445,7 +432,7 @@ i.open-tab-button {
visibility: hidden;
}
.toggle + label {
.toggle+label {
display: block;
position: relative;
cursor: pointer;
@@ -453,16 +440,16 @@ i.open-tab-button {
user-select: none;
}
input.toggle-round + label {
input.toggle-round+label {
padding: 2px;
width: 50px;
height: 25px;
background-color: rgba(221, 221, 221, 1.000);
background-color: #dddddd;
border-radius: 25px;
}
input.toggle-round + label::before,
input.toggle-round + label::after {
input.toggle-round+label:before,
input.toggle-round+label:after {
display: block;
position: absolute;
top: 2px;
@@ -471,8 +458,8 @@ input.toggle-round + label::after {
content: "";
}
input.toggle-round + label::before {
background-color: rgba(241, 241, 241, 1.000);
input.toggle-round+label:before {
background-color: #f1f1f1;
border-radius: 25px;
top: 0;
right: 0px;
@@ -480,22 +467,22 @@ input.toggle-round + label::before {
bottom: 0px;
}
input.toggle-round + label::after {
input.toggle-round+label:after {
width: 25px;
height: 25px;
background-color: rgba(255, 255, 255, 1.000);
background-color: #fff;
border-radius: 100%;
}
input.toggle-round:checked + label::before {
background-color: rgba(78, 191, 172, 1.000);
input.toggle-round:checked+label:before {
background-color: #4EBFAC;
top: 0;
right: 0px;
left: 0px;
bottom: 0px;
}
input.toggle-round:checked + label::after {
input.toggle-round:checked+label:after {
margin-left: 25px;
}
@@ -512,17 +499,17 @@ input.toggle-round:checked + label::after {
width: 100%;
height: 100%;
/* background: rgba(61, 64, 67, 15); */
background: linear-gradient(35deg, rgba(0, 59, 82, 1.000), rgba(69, 181, 155, 1.000));
background: linear-gradient(35deg, #003b52, #45b59b);
overflow: auto;
}
/* Modal Content */
.modal-container {
background-color: rgba(244, 247, 248, 1.000);
background-color: #f4f7f8;
margin: auto;
padding: 57px;
border: rgba(218, 225, 227, 1.000) 1px solid;
border: #dae1e3 1px solid;
width: 550px;
height: 370px;
border-radius: 4px;
@@ -536,7 +523,7 @@ input.toggle-round:checked + label::after {
.divider {
margin-bottom: 30px;
margin-top: 30px;
color: rgba(125, 135, 138, 1.000);
color: #7d878a;
}
.divider hr {
@@ -567,8 +554,8 @@ input.toggle-round:checked + label::after {
margin: auto;
align-items: center;
text-align: center;
color: rgba(255, 255, 255, 1.000);
background: rgba(78, 191, 172, 1.000);
color: #fff;
background: #4EBFAC;
border-color: none;
border: none;
width: 98%;
@@ -578,15 +565,15 @@ input.toggle-round:checked + label::after {
}
.server-center button:hover {
background: rgba(50, 149, 136, 1.000);
background: #329588;
}
.server-center button:focus {
background: rgba(50, 149, 136, 1.000);
background: #329588;
}
.certificates-card {
width: 80%;
width: 80%
}
.certificate-input {
@@ -613,8 +600,8 @@ input.toggle-round:checked + label::after {
padding: 0;
}
.tip:hover {
box-shadow: none;
.tip:hover{
box-shadow: none;
}
.md-14 {
@@ -689,4 +676,4 @@ input.toggle-round:checked + label::after {
.action {
margin-top: 10px;
}
}
}

View File

@@ -1,9 +1,9 @@
/* Override css rules */
.portico-wrap > .header {
.portico-wrap>.header {
display: none;
}
.portico-container > .footer {
.portico-container>.footer {
display: none;
}

View File

@@ -94,13 +94,7 @@ class WebView extends BaseComponent {
this.$el.classList.add('onload');
}
this.loading = false;
this.props.switchLoading(false, this.props.url);
this.show();
// Refocus text boxes after reload
// Remove when upstream issue https://github.com/electron/electron/issues/14474 is fixed
this.$el.blur();
this.$el.focus();
});
this.$el.addEventListener('did-fail-load', event => {
@@ -113,10 +107,6 @@ class WebView extends BaseComponent {
});
this.$el.addEventListener('did-start-loading', () => {
const isSettingPage = this.props.url.includes('renderer/preference.html');
if (!isSettingPage) {
this.props.switchLoading(true, this.props.url);
}
let userAgent = SystemUtil.getUserAgent();
if (!userAgent) {
SystemUtil.setUserAgent(this.$el.getUserAgent());
@@ -124,10 +114,6 @@ class WebView extends BaseComponent {
}
this.$el.setUserAgent(userAgent);
});
this.$el.addEventListener('did-stop-loading', () => {
this.props.switchLoading(false, this.props.url);
});
}
getBadgeCount(title) {
@@ -179,13 +165,7 @@ class WebView extends BaseComponent {
focus() {
// focus Webview and it's contents when Window regain focus.
const webContents = this.$el.getWebContents();
// HACK: webContents.isFocused() seems to be true even without the element
// being in focus. So, we check against `document.activeElement`.
if (webContents && this.$el !== document.activeElement) {
// HACK: Looks like blur needs to be called on the previously focused
// element to transfer focus correctly, in Electron v3.0.10
// See https://github.com/electron/electron/issues/15718
document.activeElement.blur();
if (webContents && !webContents.isFocused()) {
this.$el.focus();
webContents.focus();
}
@@ -234,7 +214,6 @@ class WebView extends BaseComponent {
back() {
if (this.$el.canGoBack()) {
this.$el.goBack();
this.focus();
}
}

View File

@@ -1,6 +1,6 @@
'use strict';
const { ipcRenderer, remote, clipboard, shell } = require('electron');
const { ipcRenderer, remote } = require('electron');
const isDev = require('electron-is-dev');
const { session, app, Menu, dialog } = remote;
@@ -31,7 +31,6 @@ class ServerManagerView {
const $actionsContainer = document.getElementById('actions-container');
this.$reloadButton = $actionsContainer.querySelector('#reload-action');
this.$loadingIndicator = $actionsContainer.querySelector('#loading-action');
this.$settingsButton = $actionsContainer.querySelector('#settings-action');
this.$webviewsContainer = document.getElementById('webviews-container');
this.$backButton = $actionsContainer.querySelector('#back-action');
@@ -39,7 +38,6 @@ class ServerManagerView {
this.$addServerTooltip = document.getElementById('add-server-tooltip');
this.$reloadTooltip = $actionsContainer.querySelector('#reload-tooltip');
this.$loadingTooltip = $actionsContainer.querySelector('#loading-tooltip');
this.$settingsTooltip = $actionsContainer.querySelector('#setting-tooltip');
this.$serverIconTooltip = document.getElementsByClassName('server-tooltip');
this.$backTooltip = $actionsContainer.querySelector('#back-tooltip');
@@ -51,7 +49,6 @@ class ServerManagerView {
this.$fullscreenEscapeKey = process.platform === 'darwin' ? '^⌘F' : 'F11';
this.$fullscreenPopup.innerHTML = `Press ${this.$fullscreenEscapeKey} to exit full screen`;
this.loading = {};
this.activeTabIndex = -1;
this.tabs = [];
this.functionalTabs = {};
@@ -103,19 +100,17 @@ class ServerManagerView {
initDefaultSettings() {
// Default settings which should be respected
const settingOptions = {
autoHideMenubar: false,
trayIcon: true,
useManualProxy: false,
useSystemProxy: false,
showSidebar: true,
badgeOption: true,
startAtLogin: true,
startAtLogin: false,
startMinimized: false,
enableSpellchecker: true,
showNotification: true,
autoUpdate: true,
betaUpdate: false,
errorReporting: true,
customCSS: false,
silent: false,
lastActiveTab: 0,
@@ -191,26 +186,16 @@ class ServerManagerView {
index,
tabIndex,
url: server.url,
role: 'server',
name: CommonUtil.decodeString(server.alias),
isActive: () => {
return index === this.activeTabIndex;
},
switchLoading: (loading, url) => {
if (!loading && this.loading[url]) {
this.loading[url] = false;
} else if (loading && !this.loading[url]) {
this.loading[url] = true;
}
this.showLoading(this.loading[this.tabs[this.activeTabIndex].webview.props.url]);
},
onNetworkError: this.openNetworkTroubleshooting.bind(this),
onTitleChange: this.updateBadge.bind(this),
nodeIntegration: false,
preload: true
})
}));
this.loading[server.url] = true;
}
initActions() {
@@ -251,7 +236,6 @@ class ServerManagerView {
});
this.sidebarHoverEvent(this.$addServerButton, this.$addServerTooltip, true);
this.sidebarHoverEvent(this.$loadingIndicator, this.$loadingTooltip);
this.sidebarHoverEvent(this.$settingsButton, this.$settingsTooltip);
this.sidebarHoverEvent(this.$reloadButton, this.$reloadTooltip);
this.sidebarHoverEvent(this.$backButton, this.$backTooltip);
@@ -269,10 +253,6 @@ class ServerManagerView {
return currentIndex;
}
getCurrentActiveServer() {
return this.tabs[this.activeTabIndex].webview.props.url;
}
displayInitialCharLogo($img, index) {
/*
index parameter needed because webview[data-tab-id] can increment
@@ -357,19 +337,10 @@ class ServerManagerView {
index: this.functionalTabs[tabProps.name],
tabIndex,
url: tabProps.url,
role: 'function',
name: tabProps.name,
isActive: () => {
return this.functionalTabs[tabProps.name] === this.activeTabIndex;
},
switchLoading: (loading, url) => {
if (!loading && this.loading[url]) {
this.loading[url] = false;
} else if (loading && !this.loading[url]) {
this.loading[url] = true;
}
this.showLoading(this.loading[this.tabs[this.activeTabIndex].webview.props.url]);
},
onNetworkError: this.openNetworkTroubleshooting.bind(this),
onTitleChange: this.updateBadge.bind(this),
nodeIntegration: true,
@@ -461,8 +432,6 @@ class ServerManagerView {
this.activeTabIndex = index;
this.tabs[index].activate();
this.showLoading(this.loading[this.tabs[this.activeTabIndex].webview.props.url]);
ipcRenderer.send('update-menu', {
// JSON stringify this.tabs to avoid a crash
// util.inspect is being used to handle circular references
@@ -473,16 +442,6 @@ class ServerManagerView {
});
}
showLoading(loading) {
if (!loading) {
this.$reloadButton.removeAttribute('style');
this.$loadingIndicator.style.display = 'none';
} else if (loading) {
this.$reloadButton.style.display = 'none';
this.$loadingIndicator.removeAttribute('style');
}
}
destroyTab(name, index) {
if (this.tabs[index].webview.loading) {
return;
@@ -543,15 +502,6 @@ class ServerManagerView {
ipcRenderer.send('update-badge', messageCountAll);
}
updateGeneralSettings(setting, value) {
const selector = 'webview:not([class*=disabled])';
const webview = document.querySelector(selector);
if (webview) {
const webContents = webview.getWebContents();
webContents.send(setting, value);
}
}
toggleSidebar(show) {
if (show) {
this.$sidebar.classList.remove('sidebar-hide');
@@ -562,7 +512,7 @@ class ServerManagerView {
// Toggles the dnd button icon.
toggleDNDButton(alert) {
this.$dndTooltip.textContent = (alert ? 'Disable' : 'Enable') + ' Do Not Disturb';
this.$dndTooltip.textContent = (alert ? 'Turn Off' : 'Enable') + ' Do Not Disturb';
this.$dndButton.querySelector('i').textContent = alert ? 'notifications_off' : 'notifications';
}
@@ -585,12 +535,6 @@ class ServerManagerView {
}
});
}
},
{
label: 'Copy Zulip URL',
click: () => {
clipboard.writeText(DomainUtil.getDomain(index).url);
}
}
];
const contextMenu = Menu.buildFromTemplate(template);
@@ -627,12 +571,6 @@ class ServerManagerView {
ipcRenderer.on('open-about', this.openAbout.bind(this));
ipcRenderer.on('open-help', () => {
// Open help page of current active server
const helpPage = this.getCurrentActiveServer() + '/help';
shell.openExternal(helpPage);
});
ipcRenderer.on('reload-viewer', this.reloadView.bind(this, this.tabs[this.activeTabIndex].props.index));
ipcRenderer.on('reload-current-viewer', this.reloadCurrentView.bind(this));
@@ -667,7 +605,10 @@ class ServerManagerView {
this.toggleSidebar(show);
// Toggle sidebar switch in the general settings
this.updateGeneralSettings('toggle-sidebar-setting', show);
const selector = 'webview:not([class*=disabled])';
const webview = document.querySelector(selector);
const webContents = webview.getWebContents();
webContents.send('toggle-sidebar-setting', show);
});
ipcRenderer.on('toggle-silent', (event, state) => {
@@ -684,17 +625,6 @@ class ServerManagerView {
});
});
ipcRenderer.on('toggle-autohide-menubar', (event, autoHideMenubar, updateMenu) => {
if (updateMenu) {
ipcRenderer.send('update-menu', {
tabs: this.tabsForIpc,
activeTabIndex: this.activeTabIndex
});
return;
}
this.updateGeneralSettings('toggle-menubar-setting', autoHideMenubar);
});
ipcRenderer.on('toggle-dnd', (event, state, newSettings) => {
this.toggleDNDButton(state);
ipcRenderer.send('forward-message', 'toggle-silent', newSettings.silent);
@@ -794,14 +724,6 @@ class ServerManagerView {
ipcRenderer.on('open-feedback-modal', () => {
feedbackHolder.classList.add('show');
});
ipcRenderer.on('copy-zulip-url', () => {
clipboard.writeText(this.getCurrentActiveServer());
});
ipcRenderer.on('new-server', () => {
this.openSettings('AddServer');
});
}
}

View File

@@ -4,7 +4,6 @@ const BaseSection = require(__dirname + '/base-section.js');
const DomainUtil = require(__dirname + '/../../utils/domain-util.js');
const ServerInfoForm = require(__dirname + '/server-info-form.js');
const AddCertificate = require(__dirname + '/add-certificate.js');
const FindAccounts = require(__dirname + '/find-accounts.js');
class ConnectedOrgSection extends BaseSection {
constructor(props) {
@@ -21,8 +20,6 @@ class ConnectedOrgSection extends BaseSection {
<div id="new-org-button"><button class="green sea w-250">Connect to another organization</button></div>
<div class="page-title">Add Custom Certificates</div>
<div id="add-certificate-container"></div>
<div class="page-title">Find accounts by email</div>
<div id="find-accounts-container"></div>
</div>
`;
}
@@ -41,7 +38,6 @@ class ConnectedOrgSection extends BaseSection {
this.$existingServers = document.getElementById('existing-servers');
this.$newOrgButton = document.getElementById('new-org-button');
this.$addCertificateContainer = document.getElementById('add-certificate-container');
this.$findAccountsContainer = document.getElementById('find-accounts-container');
const noServerText = 'All the connected orgnizations will appear here';
// Show noServerText if no servers are there otherwise hide it
@@ -63,7 +59,6 @@ class ConnectedOrgSection extends BaseSection {
});
this.initAddCertificate();
this.initFindAccounts();
}
initAddCertificate() {
@@ -72,11 +67,6 @@ class ConnectedOrgSection extends BaseSection {
}).init();
}
initFindAccounts() {
new FindAccounts({
$root: this.$findAccountsContainer
}).init();
}
}
module.exports = ConnectedOrgSection;

View File

@@ -1,72 +0,0 @@
'use-strict';
const { shell } = require('electron');
const BaseComponent = require(__dirname + '/../../components/base.js');
class FindAccounts extends BaseComponent {
constructor(props) {
super();
this.props = props;
}
template() {
return `
<div class="settings-card certificate-card">
<div class="certificate-input">
<div>Organization URL</div>
<input class="setting-input-value" value="zulipchat.com"/>
</div>
<div class="certificate-input">
<button class="green w-150" id="find-accounts-button">Find accounts</button>
</div>
</div>
`;
}
init() {
this.$findAccounts = this.generateNodeFromTemplate(this.template());
this.props.$root.appendChild(this.$findAccounts);
this.$findAccountsButton = this.$findAccounts.querySelector('#find-accounts-button');
this.$serverUrlField = this.$findAccounts.querySelectorAll('input.setting-input-value')[0];
this.initListeners();
}
findAccounts(url) {
if (!url) {
return;
}
if (!url.startsWith('http')) {
url = 'https://' + url;
}
shell.openExternal(url + '/accounts/find');
}
initListeners() {
this.$findAccountsButton.addEventListener('click', () => {
this.findAccounts(this.$serverUrlField.value);
});
this.$serverUrlField.addEventListener('click', () => {
if (this.$serverUrlField.value === 'zulipchat.com') {
this.$serverUrlField.setSelectionRange(0, 0);
}
});
this.$serverUrlField.addEventListener('keypress', event => {
if (event.keyCode === 13) {
this.findAccounts(this.$serverUrlField.value);
}
});
this.$serverUrlField.addEventListener('input', () => {
if (this.$serverUrlField.value) {
this.$serverUrlField.classList.remove('invalid-input-value');
} else {
this.$serverUrlField.classList.add('invalid-input-value');
}
});
}
}
module.exports = FindAccounts;

View File

@@ -24,7 +24,7 @@ class GeneralSection extends BaseSection {
<div class="setting-control"></div>
</div>
<div class="setting-row" id="menubar-option" style= "display:${process.platform === 'darwin' ? 'none' : ''}">
<div class="setting-description">Auto hide menu bar (Press Alt key to display)</div>
<div class="setting-description">Auto hide Menubar (Press Alt key to display)</div>
<div class="setting-control"></div>
</div>
<div class="setting-row" id="sidebar-option">
@@ -47,7 +47,7 @@ class GeneralSection extends BaseSection {
<div class="title">Desktop Notifications</div>
<div class="settings-card">
<div class="setting-row" id="show-notification-option">
<div class="setting-description">Show desktop notifications</div>
<div class="setting-description">Show Desktop Notifications</div>
<div class="setting-control"></div>
</div>
<div class="setting-row" id="silent-option">
@@ -83,10 +83,6 @@ class GeneralSection extends BaseSection {
</div>
<div class="title">Advanced</div>
<div class="settings-card">
<div class="setting-row" id="enable-error-reporting">
<div class="setting-description">Enable error reporting (requires restart)</div>
<div class="setting-control"></div>
</div>
<div class="setting-row" id="show-download-folder">
<div class="setting-description">Show downloaded files in file manager</div>
<div class="setting-control"></div>
@@ -124,7 +120,7 @@ class GeneralSection extends BaseSection {
<div class="setting-row" id="resetdata-option">
<div class="setting-description">This will delete all application data including all added accounts and preferences
</div>
<button class="reset-data-button red w-150">Reset App Data</button>
<button class="reset-data-button green w-150">Reset App Data</button>
</div>
</div>
</div>
@@ -149,7 +145,6 @@ class GeneralSection extends BaseSection {
this.removeCustomCSS();
this.downloadFolder();
this.showDownloadFolder();
this.enableErrorReporting();
// Platform specific settings
@@ -324,18 +319,6 @@ class GeneralSection extends BaseSection {
});
}
enableErrorReporting() {
this.generateSettingOption({
$element: document.querySelector('#enable-error-reporting .setting-control'),
value: ConfigUtil.getConfigItem('errorReporting', true),
clickHandler: () => {
const newValue = !ConfigUtil.getConfigItem('errorReporting');
ConfigUtil.setConfigItem('errorReporting', newValue);
this.enableErrorReporting();
}
});
}
clearAppDataDialog() {
const clearAppDataMessage = 'By clicking proceed you will be removing all added accounts and preferences from Zulip. When the application restarts, it will be as if you are starting Zulip for the first time.';
const getAppPath = path.join(app.getPath('appData'), app.getName());

View File

@@ -94,10 +94,6 @@ class PreferenceView extends BaseComponent {
this.handleToggle('sidebar-option', state);
});
ipcRenderer.on('toggle-menubar-setting', (event, state) => {
this.handleToggle('menubar-option', state);
});
ipcRenderer.on('toggletray', (event, state) => {
this.handleToggle('tray-option', state);
});

View File

@@ -130,14 +130,6 @@ class ShortcutsSection extends BaseSection {
<td><kbd>Option</kbd><kbd>${userOSKey}</kbd><kbd>U</kbd></td>
<td>Toggle DevTools for Active Tab</td>
</tr>
<tr>
<td><kbd>Ctrl</kbd> + <kbd>Tab</kbd></td>
<td>Switch to Next Organization</td>
</tr>
<tr>
<td><kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Tab</kbd></td>
<td>Switch to Previous Organization</td>
</tr>
</table>
<div class="setting-control"></div>
</div>
@@ -178,7 +170,6 @@ class ShortcutsSection extends BaseSection {
return `
<div class="settings-pane">
<div class="settings-card tip"><p><b><i class="material-icons md-14">settings</i>Tip: </b>These desktop app shortcuts extend the Zulip webapp's <span id="open-hotkeys-link"> keyboard shortcuts</span>.</p></div>
<div class="title">Application Shortcuts</div>
<div class="settings-card">
<table>
@@ -278,14 +269,6 @@ class ShortcutsSection extends BaseSection {
<td><kbd>${userOSKey}</kbd> + <kbd>Shift</kbd> + <kbd>U</kbd></td>
<td>Toggle DevTools for Active Tab</td>
</tr>
<tr>
<td><kbd>${userOSKey}</kbd> + <kbd>Tab</kbd></td>
<td>Switch to Next Organization</td>
</tr>
<tr>
<td><kbd>${userOSKey}</kbd> + <kbd>Shift</kbd> + <kbd>Tab</kbd></td>
<td>Switch to Previous Organization</td>
</tr>
</table>
<div class="setting-control"></div>
</div>
@@ -317,6 +300,7 @@ class ShortcutsSection extends BaseSection {
</table>
<div class="setting-control"></div>
</div>
<div class="tip"><b><i class="material-icons md-14">lightbulb_outline</i>Tip: </b>These desktop app shortcuts extend the Zulip webapp's <span id="open-hotkeys-link">keyboard shortcuts</span>.</div>
</div>
`;
}

View File

@@ -91,15 +91,8 @@ window.addEventListener('beforeunload', () => {
// electron's globalShortcut can cause unexpected results
// so adding the reload shortcut in the old-school way
// Zoom from numpad keys is not supported by electron, so adding it through listeners.
document.addEventListener('keydown', event => {
if (event.code === 'F5') {
ipcRenderer.send('forward-message', 'hard-reload');
} else if (event.ctrlKey && event.code === 'NumpadAdd') {
ipcRenderer.send('forward-message', 'zoomIn');
} else if (event.ctrlKey && event.code === 'NumpadSubtract') {
ipcRenderer.send('forward-message', 'zoomOut');
} else if (event.ctrlKey && event.code === 'Numpad0') {
ipcRenderer.send('forward-message', 'zoomActualSize');
}
});

View File

@@ -32,7 +32,14 @@ class SetupSpellChecker {
const userLanguage = ConfigUtil.getConfigItem('spellcheckerLanguage');
this.SpellCheckHandler.switchLanguage(userLanguage);
// eslint-disable-next-line no-unused-expressions
process.platform === 'darwin' ?
// On macOS, spellchecker fails to auto-detect the lanugage user is typing in
// that's why we need to mention it explicitly
this.SpellCheckHandler.switchLanguage(userLanguage) :
// On Linux and Windows, spellchecker can automatically detects the language the user is typing in
// and silently switches on the fly; thus we can start off as US English
this.SpellCheckHandler.switchLanguage('en-US');
}
const contextMenuBuilder = new ContextMenuBuilder(this.SpellCheckHandler);

View File

@@ -9,8 +9,10 @@ const escape = require('escape-html');
const Logger = require('./logger-util');
const RequestUtil = require(__dirname + '/../utils/request-util.js');
const Messages = require(__dirname + '/../../../resources/messages.js');
const CertificateUtil = require(__dirname + '/certificate-util.js');
const ProxyUtil = require(__dirname + '/proxy-util.js');
const ConfigUtil = require(__dirname + '/config-util.js');
const SystemUtil = require(__dirname + '/../utils/system-util.js');
const logger = new Logger({
file: `domain-util.log`,
@@ -62,10 +64,9 @@ class DomainUtil {
}
addDomain(server) {
const ignoreCerts = server.ignoreCerts;
return new Promise(resolve => {
if (server.icon) {
this.saveServerIcon(server, ignoreCerts).then(localIconUrl => {
this.saveServerIcon(server).then(localIconUrl => {
server.icon = localIconUrl;
this.db.push('/domains[]', server, true);
this.reloadDB();
@@ -102,89 +103,129 @@ class DomainUtil {
return false;
}
async checkCertError(domain, serverConf, error, silent) {
if (silent) {
// since getting server settings has already failed
return serverConf;
} else {
// Report error to sentry to get idea of possible certificate errors
// users get when adding the servers
logger.reportSentry(new Error(error));
const certErrorMessage = Messages.certErrorMessage(domain, error);
const certErrorDetail = Messages.certErrorDetail();
const response = await dialog.showMessageBox({
type: 'warning',
buttons: ['Yes', 'No'],
defaultId: 1,
message: certErrorMessage,
detail: certErrorDetail
});
if (response === 0) {
// set ignoreCerts parameter to true in case user responds with yes
serverConf.ignoreCerts = true;
try {
return await this.getServerSettings(domain, serverConf.ignoreCerts);
} catch (err) {
if (error === Messages.noOrgsError(domain)) {
throw new Error(error);
}
return serverConf;
}
} else {
throw new Error('Untrusted certificate.');
}
}
}
// ignoreCerts parameter helps in fetching server icon and
// other server details when user chooses to ignore certificate warnings
async checkDomain(domain, ignoreCerts = false, silent = false) {
checkDomain(domain, silent = false) {
if (!silent && this.duplicateDomain(domain)) {
// Do not check duplicate in silent mode
throw new Error('This server has been added.');
return Promise.reject('This server has been added.');
}
domain = this.formatUrl(domain);
const certificate = CertificateUtil.getCertificate(encodeURIComponent(domain));
let certificateLocation = '';
if (certificate) {
// To handle case where certificate has been moved from the location in certificates.json
try {
certificateLocation = fs.readFileSync(certificate);
} catch (err) {
logger.warn('Error while trying to get certificate: ' + err);
}
}
const proxyEnabled = ConfigUtil.getConfigItem('useManualProxy') || ConfigUtil.getConfigItem('useSystemProxy');
// If certificate for the domain exists add it as a ca key in the request's parameter else consider only domain as the parameter for request
// Add proxy as a parameter if it sbeing used.
const checkDomain = {
url: domain + '/static/audio/zulip.ogg',
ca: (certificateLocation) ? certificateLocation : '',
proxy: proxyEnabled ? ProxyUtil.getProxy(domain) : '',
ecdhCurve: 'auto',
headers: { 'User-Agent': SystemUtil.getUserAgent() }
};
const serverConf = {
icon: defaultIconUrl,
url: domain,
alias: domain,
ignoreCerts
alias: domain
};
try {
return await this.getServerSettings(domain, serverConf.ignoreCerts);
} catch (err) {
// If the domain contains following strings we just bypass the server
const whitelistDomains = [
'zulipdev.org'
];
return new Promise((resolve, reject) => {
request(checkDomain, (error, response) => {
// If the domain contains following strings we just bypass the server
const whitelistDomains = [
'zulipdev.org'
];
// make sure that error is an error or string not undefined
// so validation does not throw error.
const error = err || '';
// make sure that error is an error or string not undefined
// so validation does not throw error.
error = error || '';
const certsError = error.toString().includes('certificate');
if (domain.indexOf(whitelistDomains) >= 0 || certsError) {
try {
return await this.checkCertError(domain, serverConf, error, silent);
} catch (err) {
throw err;
const certsError = error.toString().includes('certificate');
if (!error && response.statusCode < 400) {
// Correct
this.getServerSettings(domain).then(serverSettings => {
resolve(serverSettings);
}, () => {
resolve(serverConf);
});
} else if (domain.indexOf(whitelistDomains) >= 0 || certsError) {
if (silent) {
this.getServerSettings(domain).then(serverSettings => {
resolve(serverSettings);
}, () => {
resolve(serverConf);
});
} else {
// Report error to sentry to get idea of possible certificate errors
// users get when adding the servers
logger.reportSentry(new Error(error));
const certErrorMessage = `Do you trust certificate from ${domain}? \n ${error}`;
const certErrorDetail = `The organization you're connecting to is either someone impersonating the Zulip server you entered, or the server you're trying to connect to is configured in an insecure way.
\nIf you have a valid certificate please add it from Settings>Organizations and try to add the organization again.
\nUnless you have a good reason to believe otherwise, you should not proceed.
\nYou can click here if you'd like to proceed with the connection.`;
dialog.showMessageBox({
type: 'warning',
buttons: ['Yes', 'No'],
defaultId: 1,
message: certErrorMessage,
detail: certErrorDetail
}, response => {
if (response === 0) {
this.getServerSettings(domain).then(serverSettings => {
resolve(serverSettings);
}, () => {
resolve(serverConf);
});
} else {
reject('Untrusted Certificate.');
}
});
}
} else {
const invalidZulipServerError = `${domain} does not appear to be a valid Zulip server. Make sure that \
\n (1) you can connect to that URL in a web browser and \n (2) if you need a proxy to connect to the Internet, that you've configured your proxy in the Network settings \n (3) its a zulip server \
\n (4) the server has a valid certificate, you can add custom certificates in Settings>Organizations`;
reject(invalidZulipServerError);
}
} else {
throw Messages.invalidZulipServerError(domain);
}
}
});
});
}
getServerSettings(domain, ignoreCerts = false) {
getServerSettings(domain) {
const certificate = CertificateUtil.getCertificate(encodeURIComponent(domain));
let certificateLocation = '';
if (certificate) {
// To handle case where certificate has been moved from the location in certificates.json
try {
certificateLocation = fs.readFileSync(certificate);
} catch (err) {
logger.warn('Error while trying to get certificate: ' + err);
}
}
const proxyEnabled = ConfigUtil.getConfigItem('useManualProxy') || ConfigUtil.getConfigItem('useSystemProxy');
const serverSettingsOptions = {
url: domain + '/api/v1/server_settings',
...RequestUtil.requestOptions(domain, ignoreCerts)
ca: (certificateLocation) ? certificateLocation : '',
proxy: proxyEnabled ? ProxyUtil.getProxy(domain) : '',
ecdhCurve: 'auto',
headers: { 'User-Agent': SystemUtil.getUserAgent() }
};
return new Promise((resolve, reject) => {
request(serverSettingsOptions, (error, response) => {
if (!error && response.statusCode === 200) {
@@ -195,26 +236,41 @@ class DomainUtil {
// Following check handles both the cases
icon: data.realm_icon.startsWith('/') ? data.realm_uri + data.realm_icon : data.realm_icon,
url: data.realm_uri,
alias: escape(data.realm_name),
ignoreCerts
alias: escape(data.realm_name)
});
} else {
reject(Messages.noOrgsError(domain));
}
} else {
reject(response);
reject('Zulip server version < 1.6.');
}
});
});
}
saveServerIcon(server, ignoreCerts = false) {
saveServerIcon(server) {
const url = server.icon;
const domain = server.url;
const certificate = CertificateUtil.getCertificate(encodeURIComponent(domain));
let certificateLocation = '';
if (certificate) {
// To handle case where certificate has been moved from the location in certificates.json
try {
certificateLocation = fs.readFileSync(certificate);
} catch (err) {
logger.warn('Error while trying to get certificate: ' + err);
}
}
const proxyEnabled = ConfigUtil.getConfigItem('useManualProxy') || ConfigUtil.getConfigItem('useSystemProxy');
// Add proxy and certificate as a parameter if its being used.
const serverIconOptions = {
url,
...RequestUtil.requestOptions(domain, ignoreCerts)
ca: (certificateLocation) ? certificateLocation : '',
proxy: proxyEnabled ? ProxyUtil.getProxy(url) : '',
ecdhCurve: 'auto',
headers: { 'User-Agent': SystemUtil.getUserAgent() }
};
// The save will always succeed. If url is invalid, downgrade to default icon.
@@ -249,9 +305,8 @@ class DomainUtil {
updateSavedServer(url, index) {
// Does not promise successful update
const ignoreCerts = this.getDomain(index).ignoreCerts;
this.checkDomain(url, ignoreCerts, true).then(newServerConf => {
this.saveServerIcon(newServerConf, ignoreCerts).then(localIconUrl => {
this.checkDomain(url, true).then(newServerConf => {
this.saveServerIcon(newServerConf).then(localIconUrl => {
newServerConf.icon = localIconUrl;
this.updateDomain(index, newServerConf);
this.reloadDB();

View File

@@ -1,28 +1,14 @@
const NodeConsole = require('console').Console;
const fs = require('fs');
const os = require('os');
const isDev = require('electron-is-dev');
const { initSetUp } = require('./default-util');
const { sentryInit, captureException } = require('./sentry-util');
initSetUp();
sentryInit();
let app = null;
let reportErrors = true;
if (process.type === 'renderer') {
app = require('electron').remote.app;
// Report Errors to Sentry only if it is enabled in settings
// Gets the value of reportErrors from config-util for renderer process
// For main process, sentryInit() is handled in index.js
const { ipcRenderer } = require('electron');
ipcRenderer.send('error-reporting');
ipcRenderer.on('error-reporting-val', (event, errorReporting) => {
reportErrors = errorReporting;
if (reportErrors) {
sentryInit();
}
});
} else {
app = require('electron').app;
}
@@ -44,13 +30,6 @@ class Logger {
timestamp = this.getTimestamp;
}
// Trim log according to type of process
if (process.type === 'renderer') {
requestIdleCallback(() => this.trimLog(file));
} else {
process.nextTick(() => this.trimLog(file));
}
const fileStream = fs.createWriteStream(file, { flags: 'a' });
const nodeConsole = new NodeConsole(fileStream);
@@ -107,27 +86,7 @@ class Logger {
}
reportSentry(err) {
if (reportErrors) {
captureException(err);
}
}
trimLog(file) {
fs.readFile(file, 'utf8', (err, data) => {
if (err) {
throw err;
}
const MAX_LOG_FILE_LINES = 500;
const logs = data.split(os.EOL);
const logLength = logs.length - 1;
// Keep bottom MAX_LOG_FILE_LINES of each log instance
if (logLength > MAX_LOG_FILE_LINES) {
const trimmedLogs = logs.slice(logLength - MAX_LOG_FILE_LINES);
const toWrite = trimmedLogs.join(os.EOL);
fs.writeFileSync(file, toWrite);
}
});
captureException(err);
}
}

View File

@@ -52,7 +52,7 @@ class ProxyUtil {
resolveSystemProxy(mainWindow) {
const page = mainWindow.webContents;
const ses = page.session;
const resolveProxyUrl = 'www.example.com';
const resolveProxyUrl = 'www.google.com';
// Check HTTP Proxy
const httpProxy = new Promise(resolve => {

View File

@@ -1,62 +0,0 @@
const fs = require('fs');
const Logger = require('./logger-util');
const CertificateUtil = require(__dirname + '/certificate-util.js');
const ProxyUtil = require(__dirname + '/proxy-util.js');
const ConfigUtil = require(__dirname + '/config-util.js');
const SystemUtil = require(__dirname + '/../utils/system-util.js');
const logger = new Logger({
file: `request-util.log`,
timestamp: true
});
let instance = null;
class RequestUtil {
constructor() {
if (!instance) {
instance = this;
}
return instance;
}
// ignoreCerts parameter helps in fetching server icon and
// other server details when user chooses to ignore certificate warnings
requestOptions(domain, ignoreCerts) {
domain = this.formatUrl(domain);
const certificate = CertificateUtil.getCertificate(
encodeURIComponent(domain)
);
let certificateLocation = '';
if (certificate) {
// To handle case where certificate has been moved from the location in certificates.json
try {
certificateLocation = fs.readFileSync(certificate);
} catch (err) {
logger.warn('Error while trying to get certificate: ' + err);
}
}
const proxyEnabled = ConfigUtil.getConfigItem('useManualProxy') || ConfigUtil.getConfigItem('useSystemProxy');
// If certificate for the domain exists add it as a ca key in the request's parameter else consider only domain as the parameter for request
// Add proxy as a parameter if it is being used.
return {
ca: certificateLocation ? certificateLocation : '',
proxy: proxyEnabled ? ProxyUtil.getProxy(domain) : '',
ecdhCurve: 'auto',
headers: { 'User-Agent': SystemUtil.getUserAgent() },
rejectUnauthorized: !ignoreCerts
};
}
formatUrl(domain) {
const hasPrefix = (domain.indexOf('http') === 0);
if (hasPrefix) {
return domain;
} else {
return (domain.indexOf('localhost:') >= 0) ? `http://${domain}` : `https://${domain}`;
}
}
}
module.exports = new RequestUtil();

View File

@@ -1,60 +1,56 @@
<!DOCTYPE html>
<html lang="en" class="responsive desktop">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width">
<title>Zulip</title>
<link rel="stylesheet" href="css/main.css" type="text/css" media="screen">
</head>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width">
<title>Zulip</title>
<link rel="stylesheet" href="css/main.css" type="text/css" media="screen">
</head>
<body>
<div id="content">
<div class="popup">
<span class="popuptext hidden" id="fullscreen-popup"></span>
</div>
<div id="sidebar" class="toggle-sidebar">
<div id="view-controls-container">
<div id="tabs-container"></div>
<div id="add-tab" class="tab functional-tab">
<div class="server-tab" id="add-action">
<i class="material-icons">add</i>
</div>
<span id="add-server-tooltip" style="display:none">Add organization</span>
</div>
</div>
<div id="actions-container">
<div class="action-button" id="dnd-action">
<i class="material-icons md-48">notifications</i>
<span id="dnd-tooltip" style="display:none">Do Not Disturb</span>
</div>
<div class="action-button" id="reload-action">
<i class="material-icons md-48">refresh</i>
<span id="reload-tooltip" style="display:none">Reload</span>
</div>
<div class="action-button" id="loading-action">
<i class="refresh material-icons md-48">loop</i>
<span id="loading-tooltip" style="display:none">Loading</span>
</div>
<div class="action-button disable" id="back-action">
<i class="material-icons md-48">arrow_back</i>
<span id="back-tooltip" style="display:none">Go Back</span>
</div>
<div class="action-button" id="settings-action">
<i class="material-icons md-48">settings</i>
<span id="setting-tooltip" style="display:none">Settings</span>
</div>
</div>
</div>
<div id="main-container">
<div id="webviews-container"></div>
</div>
<body>
<div id="content">
<div class="popup">
<span class="popuptext hidden" id="fullscreen-popup"></span>
</div>
<div id="sidebar" class="toggle-sidebar">
<div id="view-controls-container">
<div id="tabs-container"></div>
<div id="add-tab" class="tab functional-tab">
<div class="server-tab" id="add-action">
<i class="material-icons">add</i>
</div>
<span id="add-server-tooltip" style="display:none">Add organization</span>
</div>
</div>
<div id="actions-container">
<div class="action-button" id="dnd-action">
<i class="material-icons md-48">notifications</i>
<span id="dnd-tooltip" style="display:none">Do Not Disturb</span>
</div>
<div class="action-button" id="reload-action">
<i class="material-icons md-48">refresh</i>
<span id="reload-tooltip" style="display:none">Reload</span>
</div>
<div class="action-button disable" id="back-action">
<i class="material-icons md-48">arrow_back</i>
<span id="back-tooltip" style="display:none">Go Back</span>
</div>
<div class="action-button" id="settings-action">
<i class="material-icons md-48">settings</i>
<span id="setting-tooltip" style="display:none">Settings</span>
</div>
</div>
</div>
<div id="main-container">
<div id="webviews-container"></div>
</div>
</div>
<div id="feedback-modal">
<send-feedback></send-feedback>
</div>
</body>
<script src="js/main.js"></script>
<script>require('./js/shared/preventdrag.js')</script>
</html>
<div id="feedback-modal">
<send-feedback></send-feedback>
</div>
</body>
<script src="js/main.js"></script>
<script>require('./js/shared/preventdrag.js')</script>
</html>

View File

@@ -1,22 +1,22 @@
<!DOCTYPE html>
<html lang="en" class="responsive desktop">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width">
<title>Zulip - Network Troubleshooting</title>
<link rel="stylesheet" href="css/network.css" type="text/css" media="screen">
</head>
<body>
<div id="content">
<div id="picture"><img src="img/zulip_network.png"></div>
<div id="title">Zulip can't connect</div>
<div id="description">
<div>Your computer seems to be offline.</div>
<div>We will keep trying to reconnect, or you can try now.</div>
</div>
<div id="reconnect">Try now</div>
</div>
</body>
<script src="js/pages/network.js"></script>
<script>require('./js/shared/preventdrag.js')</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width">
<title>Zulip - Network Troubleshooting</title>
<link rel="stylesheet" href="css/network.css" type="text/css" media="screen">
</head>
<body>
<div id="content">
<div id="picture"><img src="img/zulip_network.png"></div>
<div id="title">Zulip can't connect</div>
<div id="description">
<div>Your computer seems to be offline.</div>
<div>We will keep trying to reconnect, or you can try now.</div>
</div>
<div id="reconnect">Try now</div>
</div>
</body>
<script src="js/pages/network.js"></script>
<script>require('./js/shared/preventdrag.js')</script>
</html>

View File

@@ -1,17 +1,17 @@
<!DOCTYPE html>
<html lang="en" class="responsive desktop">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width">
<title>Zulip - Settings</title>
<link rel="stylesheet" href="css/preference.css" type="text/css" media="screen">
</head>
<body>
<div id="content">
<div id="sidebar"></div>
<div id="settings-container"></div>
</div>
</body>
<script src="js/pages/preference/preference.js"></script>
<script>require('./js/shared/preventdrag.js')</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width">
<title>Zulip - Settings</title>
<link rel="stylesheet" href="css/preference.css" type="text/css" media="screen">
</head>
<body>
<div id="content">
<div id="sidebar"></div>
<div id="settings-container"></div>
</div>
</body>
<script src="js/pages/preference/preference.js"></script>
<script>require('./js/shared/preventdrag.js')</script>
</html>

View File

@@ -1,27 +0,0 @@
class Messages {
invalidZulipServerError(domain) {
return `${domain} does not appear to be a valid Zulip server. Make sure that
\n • You can connect to that URL in a web browser.\
\n • If you need a proxy to connect to the Internet, that you've configured your proxy in the Network settings.\
\n • It's a Zulip server. (The oldest supported version is 1.6).\
\n • The server has a valid certificate. (You can add custom certificates in Settings > Organizations).`;
}
noOrgsError(domain) {
return `${domain} does not have any organizations added.\
\nPlease contact your server administrator.`;
}
certErrorMessage(domain, error) {
return `Do you trust certificate from ${domain}? \n ${error}`;
}
certErrorDetail() {
return `The organization you're connecting to is either someone impersonating the Zulip server you entered, or the server you're trying to connect to is configured in an insecure way.
\nIf you have a valid certificate please add it from Settings>Organizations and try to add the organization again.
\nUnless you have a good reason to believe otherwise, you should not proceed.
\nYou can click here if you'd like to proceed with the connection.`;
}
}
module.exports = new Messages();

BIN
build/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -2,77 +2,6 @@
All notable changes to the Zulip desktop app are documented in this file.
### v3.0.0 --2019-05-20
**New features**:
* Add context menu in left sidebar.
* Enable per-user installation on Windows.
* Switch to next server on Ctrl+Tab.
* Add option to copy zulip URL.
* Allow zoom options from numpad.
* Use server language for spellchecker for all platforms.
* Allow installing app without admin privileges.
* Allow insecure requests on user request.
* Unify case across menus and settings.
**Enhancements**:
* Remove Found bug button.
* Set custom css to false by default.
* Disable beta updates if auto updates disabled
* Update menu items on setting page.
* Include certificates in all requests for icon.
* Document show sidebar shortcut properly.
* Improve organization page.
* Improve wording of adding a new org button.
* Increase width of add a new org button.
* Add eol for linebreaks on windows.
* Teach git to ignore unnecessary binary files.
* Send user-agent with request.
* Minimize to tray on startup.
* Update test config files.
* Ensure backward compatibility when using narrow.by_topic.
* Use path.sep for path separator to support Windows.
* Change the window title to contain active Realm's name.
* Use path.basename to get certificate file name.
* Disable pdf-viewer window.
* Default to starting app on login.
* Modify reset app data button.
* Add requestOptions to replace request instances.
* Workaround buggy focus switching in Electron 3.0.10.
* Reorder file menu and add option to Add Organization.
* Improve development guide.
* Implement CSS linting with stylelint.
* Add "role" key to webview property.
* Implement HTML Linting with htmlhint and fix indent.
* Limit the number of lines in log files.
* Fix focus after clicking back button.
* Remove minimize and close from File menu.
* Add config for installer name.
**Fixes**:
* Fix `request` ecdhCurve mismatch errors
* Fix typo in network error message.
* Fix context menu not working on adding new org.
* Fix reply from notification.
* Fix shorcut section horizontal alignment.
* Fix broken link in docs.
* Fix grammatical errors.
* Fix typo error in issue template.
* Fix text for Toggle DND in sidebar on hover.
* Fix focus after soft reload.
* Fix tip's place for Windows & Linux.
**Module updates**:
* Update node-json-db to v0.9.1.
* Update sentry to v0.12.1.
* Update electron-window-state to v5.0.3.
* Update electron to v3.0.10.
* Update electron-builder to v20.40.2.
* Update electron-sentry to v0.14.0.
* Update dependencies to fix minor dev security alerts.
* Update snap config.
### v2.3.82 --2018-09-25
**New features**:
@@ -363,7 +292,7 @@ electron-updater - `v2.21.8`
* Setting page and left-sidebar UI improvements
* Other minor improvements
* Other minor improvments
@@ -490,7 +419,7 @@ electron-updater - `v2.21.8`
* Fixed a bug which was caused by app's shortcuts. From now on our shortcuts won't hijack other apps shortcuts
* Removed [electron-localshortcut](https://github.com/parro-it/electron-localshortcut) completely. Now we only depend on menu accelerators for keyboard shortcuts
* Removed [electron-localshortcut](https://github.com/parro-it/electron-localshortcut) completely. Now we only depends on menu accelerators for keyboard shortcuts
* Handle certificate issue properly
@@ -691,7 +620,7 @@ electron-updater - `v2.21.8`
* Properly signed app for macOS
* Toggle tray icon
* Better error handling when no internet connection
* Better error handling when no internet connenction
@@ -705,7 +634,7 @@ electron-updater - `v2.21.8`
### v0.5.8 --2017-02-13
**Enhancements**:
**Enhacements**:
Smaller Windows installer size
<hr>
@@ -721,7 +650,7 @@ Minor improvements
### v0.5.6 --2017-02-07
**Enhancement**:
**Enhacements**:
- Using NSIS instead of [Squirrel.Windows](https://github.com/Squirrel/Squirrel.Windows) on Windows
@@ -743,9 +672,9 @@ Minor improvements
**Fixes**:
- Fixed :
- Auto-updates
- Spellchecker
- Zooming functionality
- Auto-updates
- Spellchecker
- Zooming functionality
- Removed unused node modules
- Using stable version for node modules
@@ -789,7 +718,7 @@ Minor improvements
### v0.5.1 --2016-11-23
**Enhancement**:
**Enhacements**:
- Added Spellchecker support with correct spell suggestions
@@ -830,6 +759,6 @@ Minor improvements
### v0.0.1-alpha -- 2016-08-31
**Enhancement**:
**Enhacements**:
* Added DMG installer for macOS

View File

@@ -1,6 +1,6 @@
# Development Setup
# Development setup
This is a guide to running the Zulip desktop app from source,
This is a guide to running the Zulip desktop app from a source tree,
in order to contribute to developing it.
## Prerequisites
@@ -8,7 +8,6 @@ in order to contribute to developing it.
To build and run the app from source, you'll need the following:
* [Git](http://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
* Use our [Git Guide](https://zulip.readthedocs.io/en/latest/git/setup.html) to get started with Git and GitHub.
* [Node.js](https://nodejs.org) >= v6.9.0
* [NPM](https://www.npmjs.com/get-npm) and
[node-gyp](https://github.com/nodejs/node-gyp#installation),
@@ -16,50 +15,35 @@ To build and run the app from source, you'll need the following:
* [Python](https://www.python.org/downloads/release/python-2713/)
(v2.7.x recommended)
* A C++ compiler compatible with C++11
* Development headers for the libXext, libXtst, and libxkbfile libraries, which can be installed using apt on Ubuntu using
```sh
$ sudo apt install libxext-dev libxtst-dev libxkbfile-dev libgconf-2-4
```
* Linux users also need [Snapcraft](https://snapcraft.io/)
* Development headers for the libXext, libXtst, and libxkbfile libraries
### Ubuntu/Linux and other Debian-based distributions
### Debian/Ubuntu and friends
On a system running Debian, Ubuntu, or another Debian-based Linux
distribution, you can install all dependencies through the package
manager (see [here][node-debian] for more on the first command):
manager (see [here][nodesource-install] for more on the first command):
```sh
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
$ sudo apt install git nodejs python build-essential snapcraft libxext-dev libxtst-dev libxkbfile-dev libgconf-2-4
```
[node-debian]: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
[nodesource-install]: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
### MacOS
### Other OSes
On a system running MacOS, you can refer to [official nodejs docs][node-mac] to
install nodejs. To ensure Node.js has been installed, run ```node -v``` in terminal to know your node version.
Other developers run the app on Windows, macOS, and possibly other OSes.
PRs to add specific instructions to this doc are welcome!
[node-mac]: https://nodejs.org/en/download/package-manager/#macos
If [NPM](https://www.npmjs.com/get-npm) and [node-gyp](https://github.com/nodejs/node-gyp#installation) don't come bundled with your Node.js installation, you will need to install them manually.
### Windows
- Download Node.js for Windows and install it. You can refer to the official docs [here][node-windows] to do so. To ensure Node.js has been installed, run ```node -v``` in Git Bash to know your node version.
[node-windows]: https://nodejs.org/en/download/package-manager/#windows
- Also, install install Windows-Build-Tools to compile native node modules by using
```sh
$ npm install --global windows-build-tools
```
On Windows, your C++ compiler should be Visual Studio 2015 or later.
## Download, build, and run
Clone the source locally:
```sh
$ git clone https://github.com/zulip/zulip-desktop
$ cd zulip-desktop
$ git clone https://github.com/zulip/zulip-electron
$ cd zulip-electron
```
Install project dependencies:
@@ -77,18 +61,6 @@ Start and watch changes:
$ npm run dev
```
Run tests:
```sh
$ npm test
```
## How to contribute?
Feel free to fork this repository, test it locally and then report any bugs
you find in the [issue tracker](https://github.com/zulip/zulip-desktop/issues).
You can read more about making contributions in our [Contributing Guide](./CONTRIBUTING.md).
## Troubleshooting
If you have any problems running the app, see the [most common
@@ -103,12 +75,11 @@ npm run dist
This command will produce distributable packages or installers for the
operating system you're running on:
* on Windows, a .7z nsis file and a .exe WebSetup file
* on Windows, a Windows installer file
* on macOS, a `.dmg` file
* on Linux, a plain `.zip` file as well as a `.deb` file, `.snap` file and an
`AppImage` file.
To generate all three types of files, you will need all three operating
To generate all three types, you will need all three operating
systems.
The output distributable packages appear in the `dist/` directory.
The output files appear in the `dist/` directory.

View File

@@ -21,8 +21,8 @@ C:\Windows\system32> npm install --global --production windows-build-tools
Clone the source locally:
```sh
$ git clone https://github.com/zulip/zulip-desktop
$ cd zulip-desktop
$ git clone https://github.com/zulip/zulip-electron
$ cd zulip-electron
```
Install project dependencies:

View File

@@ -1,3 +1,3 @@
### Want to contribute to this Wiki?
[Edit `/docs` files and send a pull request.](https://github.com/zulip/zulip-desktop/tree/master/docs)
[Edit `/docs` files and send a pull request.](https://github.com/zulip/zulip-electron/tree/master/docs)

View File

@@ -1,10 +1,10 @@
# How to install
**Note:** If you download from the [releases page](https://github.com/zulip/zulip-desktop/releases), be careful what version you pick. Releases that end with `-beta` are beta releases and the rest are stable.
**Note:** If you download from the [releases page](https://github.com/zulip/zulip-electron/releases), be careful what version you pick. Releases that end with `-beta` are beta releases and the rest are stable.
- **beta:** these releases are the right balance between getting new features early while staying away from nasty bugs.
- **stable:** these releases are more thoroughly tested; they receive new features later, but there's a lower chance that things will go wrong.
[LR]: https://github.com/zulip/zulip-desktop/releases
[LR]: https://github.com/zulip/zulip-electron/releases
## OS X

2964
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{
"name": "zulip",
"productName": "Zulip",
"version": "3.0.0",
"version": "2.5.0",
"main": "./app/main",
"description": "Zulip Desktop App",
"license": "Apache-2.0",
@@ -12,10 +12,10 @@
},
"repository": {
"type": "git",
"url": "https://github.com/zulip/zulip-desktop.git"
"url": "https://github.com/zulip/zulip-electron.git"
},
"bugs": {
"url": "https://github.com/zulip/zulip-desktop/issues"
"url": "https://github.com/zulip/zulip-electron/issues"
},
"engines": {
"node": ">=6.0.0"
@@ -24,10 +24,7 @@
"start": "electron app --disable-http-cache --no-electron-connect",
"reinstall": "node ./tools/reinstall-node-modules.js",
"postinstall": "electron-builder install-app-deps",
"lint-css": "stylelint app/renderer/css/*.css",
"lint-html": "./node_modules/.bin/htmlhint \"app/renderer/*.html\" ",
"lint-js": "xo",
"test": "npm run lint-html && npm run lint-css && npm run lint-js",
"test": "xo",
"test-e2e": "gulp test-e2e",
"dev": "gulp dev & nodemon --watch app/main --watch app/renderer --exec 'npm test' -e html,css,js",
"pack": "electron-builder --dir",
@@ -47,7 +44,7 @@
"!docs${/*}",
"!node_modules/@paulcbetts/cld/deps/cld${/*}"
],
"copyright": "©2019 Kandra Labs, Inc.",
"copyright": "©2017 Kandra Labs, Inc.",
"mac": {
"category": "public.app-category.productivity",
"artifactName": "${productName}-${version}-${arch}.${ext}"
@@ -62,7 +59,7 @@
"AppImage",
"snap"
],
"maintainer": "Akash Nimare <akash@zulipchat.com>",
"maintainer": "Akash Nimare <svnitakash@gmail.com>",
"artifactName": "${productName}-${version}-${arch}.${ext}"
},
"deb": {
@@ -106,13 +103,12 @@
}
],
"icon": "build/icon.ico",
"artifactName": "${productName}-Web-Setup-${version}.${ext}",
"publisherName": "Kandra Labs, Inc."
},
"nsis": {
"allowToChangeInstallationDirectory": true,
"perMachine": true,
"oneClick": false,
"perMachine": false
"allowToChangeInstallationDirectory": true
}
},
"keywords": [
@@ -125,23 +121,21 @@
],
"devDependencies": {
"assert": "1.4.1",
"cp-file": "5.0.0",
"cp-file": "^5.0.0",
"devtron": "1.4.0",
"electron": "3.1.10",
"electron-builder": "20.40.2",
"electron": "3.0.10",
"electron-builder": "20.28.3",
"electron-connect": "0.6.2",
"electron-debug": "1.4.0",
"google-translate-api": "2.3.0",
"gulp": "4.0.0",
"gulp": "^4.0.0",
"gulp-tape": "0.0.9",
"htmlhint": "0.11.0",
"is-ci": "1.0.10",
"nodemon": "1.14.11",
"is-ci": "^1.0.10",
"nodemon": "^1.14.11",
"pre-commit": "1.2.2",
"spectron": "5.0.0",
"stylelint": "9.10.1",
"tap-colorize": "1.2.0",
"tape": "4.8.0",
"spectron": "^5.0.0",
"tap-colorize": "^1.2.0",
"tape": "^4.8.0",
"xo": "0.18.2"
},
"xo": {
@@ -159,7 +153,7 @@
"max-lines": [
"warn",
{
"max": 700,
"max": 600,
"skipBlankLines": true,
"skipComments": true
}

View File

@@ -1,5 +1,5 @@
name: zulip
version: 2.3.82
version: 2.0.0
summary: Zulip Desktop Client for Linux
description: Zulip combines the immediacy of Slack with an email threading model. With Zulip, you can catch up on important conversations while ignoring irrelevant ones.
confinement: strict
@@ -34,4 +34,4 @@ parts:
- libxtst6
source: dist/linux-unpacked
after:
- desktop-gtk3
- desktop-gtk2

View File

@@ -48,10 +48,10 @@ envSetup()
# Set name of upstreamRemote
cd $workingDir
git remote -v | grep "github\.com.zulip.zulip-desktop.git (fetch)" > /dev/null 2>&1
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-desktop.git (fetch)" | awk '{ print $1 }'`
upstreamRemote=`git remote -v | grep "github\.com.zulip.zulip-electron.git (fetch)" | awk '{ print $1 }'`
else
upstreamRemote="origin"
fi