mirror of
				https://github.com/zulip/zulip-desktop.git
				synced 2025-10-31 20:13:43 +00:00 
			
		
		
		
	Compare commits
	
		
			152 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 52a3fa6bd1 | ||
|  | c1f2ae5ef8 | ||
|  | 301fe26d80 | ||
|  | 92a2b4eae9 | ||
|  | 6e307570d0 | ||
|  | dc39c68389 | ||
|  | 73cdfa7249 | ||
|  | d9e4b0a40b | ||
|  | 0c7ce62ce1 | ||
|  | 9dd5fd2aa5 | ||
|  | 11e2635aa0 | ||
|  | b35cf13a77 | ||
|  | 814de8ad6a | ||
|  | d9dbbf2359 | ||
|  | a9c9de2dee | ||
|  | 9b626950ae | ||
|  | 45672432db | ||
|  | b5665abb3e | ||
|  | 5b30bb2a16 | ||
|  | 598aa6f4b9 | ||
|  | 2e7ed457f0 | ||
|  | bb3cad818b | ||
|  | e3d9308c21 | ||
|  | 098d35fc5c | ||
|  | eb849a7b3d | ||
|  | ab3698f56c | ||
|  | 0fdeb1fd17 | ||
|  | d270d56309 | ||
|  | 2c5b1ad297 | ||
|  | 26b226c7ae | ||
|  | 7f6699e235 | ||
|  | 339f0d19c7 | ||
|  | 86882c0741 | ||
|  | cf5a691a36 | ||
|  | 51ff949d34 | ||
|  | e5680b12f4 | ||
|  | b42f9de27d | ||
|  | 201faa9449 | ||
|  | 4125de4a60 | ||
|  | 916fab7963 | ||
|  | 15902e51f6 | ||
|  | 19705bc90b | ||
|  | a9313f4756 | ||
|  | 13b4d2037a | ||
|  | ab63ec2a4a | ||
|  | 1de4f88c6c | ||
|  | ab4381a6bf | ||
|  | d409a0bf33 | ||
|  | c40e05646e | ||
|  | 13f3818c77 | ||
|  | 4a0e590921 | ||
|  | eb19b20da2 | ||
|  | 69cb509fe5 | ||
|  | 123263e5bb | ||
|  | a26a10849d | ||
|  | da7e026550 | ||
|  | c70f6df096 | ||
|  | ef0110f8e7 | ||
|  | b7a7ca3e5c | ||
|  | 467e7b11c5 | ||
|  | 105e7e93a1 | ||
|  | a736f664c6 | ||
|  | 38c7695a99 | ||
|  | b268fe9478 | ||
|  | 981a262836 | ||
|  | 527bb5ab2f | ||
|  | e2947a0ce6 | ||
|  | 3b2c758e09 | ||
|  | 4867fc672a | ||
|  | f85f05d66b | ||
|  | 39fd0e9877 | ||
|  | f6ff112f0e | ||
|  | 6fcd1ef0d5 | ||
|  | 92260b0f97 | ||
|  | c45c9537d1 | ||
|  | 0eb4c9236e | ||
|  | 47366b7617 | ||
|  | 86e28f5b00 | ||
|  | 7072a41e01 | ||
|  | 79f6f13008 | ||
|  | 70f0170f1d | ||
|  | bc75eba2bd | ||
|  | af7272a439 | ||
|  | 9d08a13e64 | ||
|  | f98d6d7037 | ||
|  | da1cad9dff | ||
|  | 955a2eb6c7 | ||
|  | 1cf822a2b5 | ||
|  | b9baf140eb | ||
|  | 727c2335f6 | ||
|  | e8173919f8 | ||
|  | cf2f4fe9c9 | ||
|  | 47cdd5fa8b | ||
|  | 90e76fab6e | ||
|  | 193adb1901 | ||
|  | b520e12492 | ||
|  | ae642bc7ba | ||
|  | e90f3732c5 | ||
|  | 6b31a8a0c4 | ||
|  | f8758fa303 | ||
|  | d2de965106 | ||
|  | a32119b55d | ||
|  | 58049a91c4 | ||
|  | 9810d69c3b | ||
|  | d2f949d683 | ||
|  | a8c283a50b | ||
|  | dab29d4720 | ||
|  | 7fba8cfae9 | ||
|  | 32301656cc | ||
|  | 0e16283a37 | ||
|  | d86482a804 | ||
|  | 3af350e4dc | ||
|  | 39fc2053c5 | ||
|  | 044f1fd0f9 | ||
|  | 10fb0a82f9 | ||
|  | 123bd5b2c0 | ||
|  | ad771c3da8 | ||
|  | 4c58bc3aa3 | ||
|  | 9a8680d209 | ||
|  | 1569890f4d | ||
|  | 2ed400c23c | ||
|  | 70621431dc | ||
|  | 55b7e09796 | ||
|  | de2829a968 | ||
|  | 296de41779 | ||
|  | 8b9ebeee25 | ||
|  | 76e81ca337 | ||
|  | 2e7a9bb4ed | ||
|  | 77638f6287 | ||
|  | 6e8fe36876 | ||
|  | 2eea4a32a5 | ||
|  | 677dfe425c | ||
|  | 1da3ec545a | ||
|  | 3cb6ea4694 | ||
|  | 0cb7297017 | ||
|  | b8d7003446 | ||
|  | 6d27cf8c7d | ||
|  | 1ac2483cc4 | ||
|  | 4d3420dcd0 | ||
|  | 38450a9aed | ||
|  | 24de7ebb97 | ||
|  | 5a571d66d0 | ||
|  | 0ae998a51e | ||
|  | 447dd18b8b | ||
|  | 9a200dc40c | ||
|  | d42b752ac1 | ||
|  | 2f4103248d | ||
|  | 985d731d2b | ||
|  | 032f95150c | ||
|  | d1aa5778c3 | ||
|  | 13ce24b75e | ||
|  | c89ec2faf1 | 
| @@ -6,6 +6,6 @@ charset = utf-8 | ||||
| trim_trailing_whitespace = true | ||||
| insert_final_newline = true | ||||
|  | ||||
| [{*.css,*.html,*.js,*.json,*.ts}] | ||||
| [{*.cjs,*.css,*.html,*.js,*.json,*.ts}] | ||||
| indent_style = space | ||||
| indent_size = 2 | ||||
|   | ||||
							
								
								
									
										53
									
								
								.github/PULL_REQUEST_TEMPLATE.md
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										53
									
								
								.github/PULL_REQUEST_TEMPLATE.md
									
									
									
									
										vendored
									
									
								
							| @@ -1,18 +1,49 @@ | ||||
| --- | ||||
| <!-- Describe your pull request here.--> | ||||
|  | ||||
| <!-- | ||||
| Remove the fields that are not appropriate | ||||
| Please include: | ||||
| Fixes: <!-- Issue link, or clear description.--> | ||||
|  | ||||
| <!-- If the PR makes UI changes, always include one or more still screenshots to demonstrate your changes. If it seems helpful, add a screen capture of the new functionality as well. | ||||
|  | ||||
| Tooling tips: https://zulip.readthedocs.io/en/latest/tutorials/screenshot-and-gif-software.html | ||||
| --> | ||||
|  | ||||
| **What's this PR do?** | ||||
| **Screenshots and screen captures:** | ||||
|  | ||||
| **Any background context you want to provide?** | ||||
|  | ||||
| **Screenshots?** | ||||
|  | ||||
| **You have tested this PR on:** | ||||
| **Platforms this PR was tested on:** | ||||
|  | ||||
| - [ ] Windows | ||||
| - [ ] Linux/Ubuntu | ||||
| - [ ] macOS | ||||
| - [ ] Linux (specify distro) | ||||
|  | ||||
| <details> | ||||
| <summary>Self-review checklist</summary> | ||||
|  | ||||
| <!-- Prior to submitting a PR, follow our step-by-step guide to review your own code: | ||||
| https://zulip.readthedocs.io/en/latest/contributing/code-reviewing.html#how-to-review-code --> | ||||
|  | ||||
| <!-- Once you create the PR, check off all the steps below that you have completed. | ||||
| If any of these steps are not relevant or you have not completed, leave them unchecked.--> | ||||
|  | ||||
| - [ ] [Self-reviewed](https://zulip.readthedocs.io/en/latest/contributing/code-reviewing.html#how-to-review-code) the changes for clarity and maintainability | ||||
|       (variable names, code reuse, readability, etc.). | ||||
|  | ||||
| Communicate decisions, questions, and potential concerns. | ||||
|  | ||||
| - [ ] Explains differences from previous plans (e.g., issue description). | ||||
| - [ ] Highlights technical choices and bugs encountered. | ||||
| - [ ] Calls out remaining decisions and concerns. | ||||
| - [ ] Automated tests verify logic where appropriate. | ||||
|  | ||||
| Individual commits are ready for review (see [commit discipline](https://zulip.readthedocs.io/en/latest/contributing/commit-discipline.html)). | ||||
|  | ||||
| - [ ] Each commit is a coherent idea. | ||||
| - [ ] Commit message(s) explain reasoning and motivation for changes. | ||||
|  | ||||
| Completed manual review and testing of the following: | ||||
|  | ||||
| - [ ] Visual appearance of the changes. | ||||
| - [ ] Responsiveness and internationalization. | ||||
| - [ ] Strings and tooltips. | ||||
| - [ ] End-to-end functionality of buttons, interactions and flows. | ||||
| - [ ] Corner cases, error conditions, and easily imagined bugs. | ||||
| </details> | ||||
|   | ||||
							
								
								
									
										5
									
								
								.github/workflows/node.js.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.github/workflows/node.js.yml
									
									
									
									
										vendored
									
									
								
							| @@ -10,6 +10,9 @@ jobs: | ||||
|   build: | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|       - uses: actions/checkout@v2 | ||||
|       - uses: actions/setup-node@v4 | ||||
|         with: | ||||
|           node-version: lts/* | ||||
|       - uses: actions/checkout@v4 | ||||
|       - run: npm ci | ||||
|       - run: npm test | ||||
|   | ||||
							
								
								
									
										9
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -4,11 +4,9 @@ | ||||
| # npm cache directory | ||||
| .npm | ||||
|  | ||||
| # transifexrc - if user prefers it to be in working tree | ||||
| .transifexrc | ||||
|  | ||||
| # Compiled binary build directory | ||||
| dist/ | ||||
| /dist/ | ||||
| /dist-electron/ | ||||
|  | ||||
| #snap generated files | ||||
| snap/parts | ||||
| @@ -39,6 +37,3 @@ config.gypi | ||||
| # tests/package.json | ||||
|  | ||||
| .python-version | ||||
|  | ||||
| # Ignore all the typescript compiled files | ||||
| app/**/*.js | ||||
|   | ||||
| @@ -1,3 +1,3 @@ | ||||
| /app/**/*.js | ||||
| /app/translations/*.json | ||||
| /dist | ||||
| /dist-electron | ||||
| /public/translations/*.json | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| { | ||||
|   "extends": ["stylelint-config-standard", "stylelint-config-prettier"], | ||||
|   "extends": ["stylelint-config-standard"], | ||||
|   "rules": { | ||||
|     "color-named": "never", | ||||
|     "color-no-hex": true, | ||||
|   | ||||
| @@ -1,9 +0,0 @@ | ||||
| [main] | ||||
| host = https://www.transifex.com | ||||
|  | ||||
| [zulip.desktopjson] | ||||
| file_filter = app/translations/<lang>.json | ||||
| minimum_perc = 0 | ||||
| source_file = app/translations/en.json | ||||
| source_lang = en | ||||
| type = KEYVALUEJSON | ||||
| @@ -10,7 +10,7 @@ Zulip-Desktop app is built on top of [Electron](http://electron.atom.io/). If yo | ||||
|  | ||||
| ## 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). | ||||
| - The whole Zulip documentation, such as setting up a development environment, setting up with the Zulip web app 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). | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| # Zulip Desktop Client | ||||
|  | ||||
| [](https://travis-ci.com/github/zulip/zulip-desktop) | ||||
| [](https://github.com/zulip/zulip-desktop/actions/workflows/node.js.yml?query=branch%3Amain) | ||||
| [](https://ci.appveyor.com/project/zulip/zulip-desktop/branch/main) | ||||
| [](https://github.com/sindresorhus/xo) | ||||
| [](https://chat.zulip.org) | ||||
| @@ -24,9 +24,9 @@ Please see the [installation guide](https://zulip.com/help/desktop-app-install-g | ||||
|  | ||||
| # Reporting issues | ||||
|  | ||||
| This desktop client shares most of its code with the Zulip webapp. | ||||
| This desktop client shares most of its code with the Zulip web app. | ||||
| Issues in an individual organization's Zulip window should be reported | ||||
| in the [Zulip server and webapp | ||||
| in the [Zulip server and web app | ||||
| project](https://github.com/zulip/zulip/issues/new). Other | ||||
| issues in the desktop app and its settings should be reported [in this | ||||
| project](https://github.com/zulip/zulip-desktop/issues/new). | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import * as z from "zod"; | ||||
| import {z} from "zod"; | ||||
|  | ||||
| export const dndSettingsSchemata = { | ||||
|   showNotification: z.boolean(), | ||||
| @@ -37,6 +37,7 @@ export const configSchemata = { | ||||
|   useProxy: z.boolean(), | ||||
|   useSystemProxy: z.boolean(), | ||||
| }; | ||||
| export type ConfigSchemata = typeof configSchemata; | ||||
|  | ||||
| export const enterpriseConfigSchemata = { | ||||
|   ...configSchemata, | ||||
|   | ||||
| @@ -1,41 +1,47 @@ | ||||
| import fs from "node:fs"; | ||||
| import path from "node:path"; | ||||
|  | ||||
| import * as Sentry from "@sentry/electron"; | ||||
| import * as Sentry from "@sentry/core"; | ||||
| import {JsonDB} from "node-json-db"; | ||||
| import {DataError} from "node-json-db/dist/lib/Errors"; | ||||
| import type * as z from "zod"; | ||||
| import {DataError} from "node-json-db/dist/lib/Errors.js"; | ||||
| import type {z} from "zod"; | ||||
| import {app, dialog} from "zulip:remote"; | ||||
|  | ||||
| import {configSchemata} from "./config-schemata.js"; | ||||
| import * as EnterpriseUtil from "./enterprise-util.js"; | ||||
| import Logger from "./logger-util.js"; | ||||
| import {app, dialog} from "./remote.js"; | ||||
| import {type ConfigSchemata, configSchemata} from "./config-schemata.ts"; | ||||
| import * as EnterpriseUtil from "./enterprise-util.ts"; | ||||
| import Logger from "./logger-util.ts"; | ||||
|  | ||||
| export type Config = { | ||||
|   [Key in keyof typeof configSchemata]: z.output<typeof configSchemata[Key]>; | ||||
|   [Key in keyof ConfigSchemata]: z.output<ConfigSchemata[Key]>; | ||||
| }; | ||||
|  | ||||
| const logger = new Logger({ | ||||
|   file: "config-util.log", | ||||
| }); | ||||
|  | ||||
| let db: JsonDB; | ||||
| let database: JsonDB; | ||||
|  | ||||
| reloadDb(); | ||||
| reloadDatabase(); | ||||
|  | ||||
| export function getConfigItem<Key extends keyof Config>( | ||||
|   key: Key, | ||||
|   defaultValue: Config[Key], | ||||
| ): z.output<typeof configSchemata[Key]> { | ||||
| ): z.output<ConfigSchemata[Key]> { | ||||
|   try { | ||||
|     db.reload(); | ||||
|     database.reload(); | ||||
|   } catch (error: unknown) { | ||||
|     logger.error("Error while reloading settings.json: "); | ||||
|     logger.error(error); | ||||
|   } | ||||
|  | ||||
|   try { | ||||
|     return configSchemata[key].parse(db.getObject<unknown>(`/${key}`)); | ||||
|     const typedSchemata: { | ||||
|       [Key in keyof Config]: z.ZodType< | ||||
|         z.output<ConfigSchemata[Key]>, | ||||
|         z.input<ConfigSchemata[Key]> | ||||
|       >; | ||||
|     } = configSchemata; // https://github.com/colinhacks/zod/issues/5154 | ||||
|     return typedSchemata[key].parse(database.getObject<unknown>(`/${key}`)); | ||||
|   } catch (error: unknown) { | ||||
|     if (!(error instanceof DataError)) throw error; | ||||
|     setConfigItem(key, defaultValue); | ||||
| @@ -46,13 +52,13 @@ export function getConfigItem<Key extends keyof Config>( | ||||
| // This function returns whether a key exists in the configuration file (settings.json) | ||||
| export function isConfigItemExists(key: string): boolean { | ||||
|   try { | ||||
|     db.reload(); | ||||
|     database.reload(); | ||||
|   } catch (error: unknown) { | ||||
|     logger.error("Error while reloading settings.json: "); | ||||
|     logger.error(error); | ||||
|   } | ||||
|  | ||||
|   return db.exists(`/${key}`); | ||||
|   return database.exists(`/${key}`); | ||||
| } | ||||
|  | ||||
| export function setConfigItem<Key extends keyof Config>( | ||||
| @@ -66,16 +72,16 @@ export function setConfigItem<Key extends keyof Config>( | ||||
|   } | ||||
|  | ||||
|   configSchemata[key].parse(value); | ||||
|   db.push(`/${key}`, value, true); | ||||
|   db.save(); | ||||
|   database.push(`/${key}`, value, true); | ||||
|   database.save(); | ||||
| } | ||||
|  | ||||
| export function removeConfigItem(key: string): void { | ||||
|   db.delete(`/${key}`); | ||||
|   db.save(); | ||||
|   database.delete(`/${key}`); | ||||
|   database.save(); | ||||
| } | ||||
|  | ||||
| function reloadDb(): void { | ||||
| function reloadDatabase(): void { | ||||
|   const settingsJsonPath = path.join( | ||||
|     app.getPath("userData"), | ||||
|     "/config/settings.json", | ||||
| @@ -96,5 +102,5 @@ function reloadDb(): void { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   db = new JsonDB(settingsJsonPath, true, true); | ||||
|   database = new JsonDB(settingsJsonPath, true, true); | ||||
| } | ||||
|   | ||||
| @@ -1,33 +1,33 @@ | ||||
| import fs from "node:fs"; | ||||
|  | ||||
| import {app} from "./remote.js"; | ||||
| import {app} from "zulip:remote"; | ||||
|  | ||||
| let setupCompleted = false; | ||||
|  | ||||
| const zulipDir = app.getPath("userData"); | ||||
| const logDir = `${zulipDir}/Logs/`; | ||||
| const configDir = `${zulipDir}/config/`; | ||||
| const zulipDirectory = app.getPath("userData"); | ||||
| const logDirectory = `${zulipDirectory}/Logs/`; | ||||
| const configDirectory = `${zulipDirectory}/config/`; | ||||
| export const initSetUp = (): void => { | ||||
|   // If it is the first time the app is running | ||||
|   // create zulip dir in userData folder to | ||||
|   // avoid errors | ||||
|   if (!setupCompleted) { | ||||
|     if (!fs.existsSync(zulipDir)) { | ||||
|       fs.mkdirSync(zulipDir); | ||||
|     if (!fs.existsSync(zulipDirectory)) { | ||||
|       fs.mkdirSync(zulipDirectory); | ||||
|     } | ||||
|  | ||||
|     if (!fs.existsSync(logDir)) { | ||||
|       fs.mkdirSync(logDir); | ||||
|     if (!fs.existsSync(logDirectory)) { | ||||
|       fs.mkdirSync(logDirectory); | ||||
|     } | ||||
|  | ||||
|     // Migrate config files from app data folder to config folder inside app | ||||
|     // data folder. This will be done once when a user updates to the new version. | ||||
|     if (!fs.existsSync(configDir)) { | ||||
|       fs.mkdirSync(configDir); | ||||
|       const domainJson = `${zulipDir}/domain.json`; | ||||
|       const settingsJson = `${zulipDir}/settings.json`; | ||||
|       const updatesJson = `${zulipDir}/updates.json`; | ||||
|       const windowStateJson = `${zulipDir}/window-state.json`; | ||||
|     if (!fs.existsSync(configDirectory)) { | ||||
|       fs.mkdirSync(configDirectory); | ||||
|       const domainJson = `${zulipDirectory}/domain.json`; | ||||
|       const settingsJson = `${zulipDirectory}/settings.json`; | ||||
|       const updatesJson = `${zulipDirectory}/updates.json`; | ||||
|       const windowStateJson = `${zulipDirectory}/window-state.json`; | ||||
|       const configData = [ | ||||
|         { | ||||
|           path: domainJson, | ||||
| @@ -44,7 +44,7 @@ export const initSetUp = (): void => { | ||||
|       ]; | ||||
|       for (const data of configData) { | ||||
|         if (fs.existsSync(data.path)) { | ||||
|           fs.copyFileSync(data.path, configDir + data.fileName); | ||||
|           fs.copyFileSync(data.path, configDirectory + data.fileName); | ||||
|           fs.unlinkSync(data.path); | ||||
|         } | ||||
|       } | ||||
|   | ||||
| @@ -1,13 +1,13 @@ | ||||
| import process from "node:process"; | ||||
|  | ||||
| import type * as z from "zod"; | ||||
| import type {z} from "zod"; | ||||
|  | ||||
| import type {dndSettingsSchemata} from "./config-schemata.js"; | ||||
| import * as ConfigUtil from "./config-util.js"; | ||||
| import type {dndSettingsSchemata} from "./config-schemata.ts"; | ||||
| import * as ConfigUtil from "./config-util.ts"; | ||||
|  | ||||
| export type DndSettings = { | ||||
|   [Key in keyof typeof dndSettingsSchemata]: z.output< | ||||
|     typeof dndSettingsSchemata[Key] | ||||
|     (typeof dndSettingsSchemata)[Key] | ||||
|   >; | ||||
| }; | ||||
|  | ||||
|   | ||||
| @@ -2,14 +2,15 @@ import fs from "node:fs"; | ||||
| import path from "node:path"; | ||||
| import process from "node:process"; | ||||
|  | ||||
| import * as z from "zod"; | ||||
| import {z} from "zod"; | ||||
| import {dialog} from "zulip:remote"; | ||||
|  | ||||
| import {enterpriseConfigSchemata} from "./config-schemata.js"; | ||||
| import Logger from "./logger-util.js"; | ||||
| import {enterpriseConfigSchemata} from "./config-schemata.ts"; | ||||
| import Logger from "./logger-util.ts"; | ||||
|  | ||||
| type EnterpriseConfig = { | ||||
|   [Key in keyof typeof enterpriseConfigSchemata]: z.output< | ||||
|     typeof enterpriseConfigSchemata[Key] | ||||
|     (typeof enterpriseConfigSchemata)[Key] | ||||
|   >; | ||||
| }; | ||||
|  | ||||
| @@ -20,13 +21,12 @@ const logger = new Logger({ | ||||
| let enterpriseSettings: Partial<EnterpriseConfig>; | ||||
| let configFile: boolean; | ||||
|  | ||||
| reloadDb(); | ||||
| reloadDatabase(); | ||||
|  | ||||
| function reloadDb(): void { | ||||
| function reloadDatabase(): void { | ||||
|   let enterpriseFile = "/etc/zulip-desktop-config/global_config.json"; | ||||
|   if (process.platform === "win32") { | ||||
|     enterpriseFile = | ||||
|       "C:\\Program Files\\Zulip-Desktop-Config\\global_config.json"; | ||||
|     enterpriseFile = String.raw`C:\Program Files\Zulip-Desktop-Config\global_config.json`; | ||||
|   } | ||||
|  | ||||
|   enterpriseFile = path.resolve(enterpriseFile); | ||||
| @@ -40,6 +40,10 @@ function reloadDb(): void { | ||||
|         .partial() | ||||
|         .parse(data); | ||||
|     } catch (error: unknown) { | ||||
|       dialog.showErrorBox( | ||||
|         "Error loading global_config", | ||||
|         "We encountered an error while reading global_config.json, please make sure the file contains valid JSON.", | ||||
|       ); | ||||
|       logger.log("Error while JSON parsing global_config.json: "); | ||||
|       logger.log(error); | ||||
|     } | ||||
| @@ -56,7 +60,7 @@ export function getConfigItem<Key extends keyof EnterpriseConfig>( | ||||
|   key: Key, | ||||
|   defaultValue: EnterpriseConfig[Key], | ||||
| ): EnterpriseConfig[Key] { | ||||
|   reloadDb(); | ||||
|   reloadDatabase(); | ||||
|   if (!configFile) { | ||||
|     return defaultValue; | ||||
|   } | ||||
| @@ -66,7 +70,7 @@ export function getConfigItem<Key extends keyof EnterpriseConfig>( | ||||
| } | ||||
|  | ||||
| export function configItemExists(key: keyof EnterpriseConfig): boolean { | ||||
|   reloadDb(); | ||||
|   reloadDatabase(); | ||||
|   if (!configFile) { | ||||
|     return false; | ||||
|   } | ||||
|   | ||||
| @@ -3,7 +3,8 @@ import fs from "node:fs"; | ||||
| import os from "node:os"; | ||||
| import path from "node:path"; | ||||
|  | ||||
| import {html} from "./html.js"; | ||||
| import {Html, html} from "./html.ts"; | ||||
| import * as t from "./translation-util.ts"; | ||||
|  | ||||
| export async function openBrowser(url: URL): Promise<void> { | ||||
|   if (["http:", "https:", "mailto:"].includes(url.protocol)) { | ||||
| @@ -11,17 +12,17 @@ export async function openBrowser(url: URL): Promise<void> { | ||||
|   } else { | ||||
|     // For security, indirect links to non-whitelisted protocols | ||||
|     // through a real web browser via a local HTML file. | ||||
|     const dir = fs.mkdtempSync(path.join(os.tmpdir(), "zulip-redirect-")); | ||||
|     const file = path.join(dir, "redirect.html"); | ||||
|     const directory = fs.mkdtempSync(path.join(os.tmpdir(), "zulip-redirect-")); | ||||
|     const file = path.join(directory, "redirect.html"); | ||||
|     fs.writeFileSync( | ||||
|       file, | ||||
|       html` | ||||
|         <!DOCTYPE html> | ||||
|         <!doctype html> | ||||
|         <html> | ||||
|           <head> | ||||
|             <meta charset="UTF-8" /> | ||||
|             <meta http-equiv="Refresh" content="0; url=${url.href}" /> | ||||
|             <title>Redirecting</title> | ||||
|             <title>${t.__("Redirecting")}</title> | ||||
|             <style> | ||||
|               html { | ||||
|                 font-family: menu, "Helvetica Neue", sans-serif; | ||||
| @@ -29,7 +30,13 @@ export async function openBrowser(url: URL): Promise<void> { | ||||
|             </style> | ||||
|           </head> | ||||
|           <body> | ||||
|             <p>Opening <a href="${url.href}">${url.href}</a>…</p> | ||||
|             <p> | ||||
|               ${new Html({ | ||||
|                 html: t.__("Opening {{{link}}}…", { | ||||
|                   link: html`<a href="${url.href}">${url.href}</a>`.html, | ||||
|                 }), | ||||
|               })} | ||||
|             </p> | ||||
|           </body> | ||||
|         </html> | ||||
|       `.html, | ||||
| @@ -37,7 +44,7 @@ export async function openBrowser(url: URL): Promise<void> { | ||||
|     await shell.openPath(file); | ||||
|     setTimeout(() => { | ||||
|       fs.unlinkSync(file); | ||||
|       fs.rmdirSync(dir); | ||||
|       fs.rmdirSync(directory); | ||||
|     }, 15_000); | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -3,8 +3,9 @@ import fs from "node:fs"; | ||||
| import os from "node:os"; | ||||
| import process from "node:process"; | ||||
|  | ||||
| import {initSetUp} from "./default-util.js"; | ||||
| import {app} from "./remote.js"; | ||||
| import {app} from "zulip:remote"; | ||||
|  | ||||
| import {initSetUp} from "./default-util.ts"; | ||||
|  | ||||
| type LoggerOptions = { | ||||
|   file?: string; | ||||
| @@ -12,7 +13,7 @@ type LoggerOptions = { | ||||
|  | ||||
| initSetUp(); | ||||
|  | ||||
| const logDir = `${app.getPath("userData")}/Logs`; | ||||
| const logDirectory = `${app.getPath("userData")}/Logs`; | ||||
|  | ||||
| type Level = "log" | "debug" | "info" | "warn" | "error"; | ||||
|  | ||||
| @@ -22,7 +23,7 @@ export default class Logger { | ||||
|   constructor(options: LoggerOptions = {}) { | ||||
|     let {file = "console.log"} = options; | ||||
|  | ||||
|     file = `${logDir}/${file}`; | ||||
|     file = `${logDirectory}/${file}`; | ||||
|  | ||||
|     // Trim log according to type of process | ||||
|     if (process.type === "renderer") { | ||||
| @@ -37,31 +38,31 @@ export default class Logger { | ||||
|     this.nodeConsole = nodeConsole; | ||||
|   } | ||||
|  | ||||
|   _log(type: Level, ...args: unknown[]): void { | ||||
|     args.unshift(this.getTimestamp() + " |\t"); | ||||
|     args.unshift(type.toUpperCase() + " |"); | ||||
|     this.nodeConsole[type](...args); | ||||
|     console[type](...args); | ||||
|   _log(type: Level, ...arguments_: unknown[]): void { | ||||
|     arguments_.unshift(this.getTimestamp() + " |\t"); | ||||
|     arguments_.unshift(type.toUpperCase() + " |"); | ||||
|     this.nodeConsole[type](...arguments_); | ||||
|     console[type](...arguments_); | ||||
|   } | ||||
|  | ||||
|   log(...args: unknown[]): void { | ||||
|     this._log("log", ...args); | ||||
|   log(...arguments_: unknown[]): void { | ||||
|     this._log("log", ...arguments_); | ||||
|   } | ||||
|  | ||||
|   debug(...args: unknown[]): void { | ||||
|     this._log("debug", ...args); | ||||
|   debug(...arguments_: unknown[]): void { | ||||
|     this._log("debug", ...arguments_); | ||||
|   } | ||||
|  | ||||
|   info(...args: unknown[]): void { | ||||
|     this._log("info", ...args); | ||||
|   info(...arguments_: unknown[]): void { | ||||
|     this._log("info", ...arguments_); | ||||
|   } | ||||
|  | ||||
|   warn(...args: unknown[]): void { | ||||
|     this._log("warn", ...args); | ||||
|   warn(...arguments_: unknown[]): void { | ||||
|     this._log("warn", ...arguments_); | ||||
|   } | ||||
|  | ||||
|   error(...args: unknown[]): void { | ||||
|     this._log("error", ...args); | ||||
|   error(...arguments_: unknown[]): void { | ||||
|     this._log("error", ...arguments_); | ||||
|   } | ||||
|  | ||||
|   getTimestamp(): string { | ||||
|   | ||||
| @@ -1,3 +1,5 @@ | ||||
| import * as t from "./translation-util.ts"; | ||||
|  | ||||
| type DialogBoxError = { | ||||
|   title: string; | ||||
|   content: string; | ||||
| @@ -13,26 +15,24 @@ export function invalidZulipServerError(domain: string): string { | ||||
|  https://zulip.readthedocs.io/en/stable/production/ssl-certificates.html`; | ||||
| } | ||||
|  | ||||
| export function enterpriseOrgError( | ||||
|   length: number, | ||||
|   domains: string[], | ||||
| ): DialogBoxError { | ||||
| export function enterpriseOrgError(domains: string[]): DialogBoxError { | ||||
|   let domainList = ""; | ||||
|   for (const domain of domains) { | ||||
|     domainList += `• ${domain}\n`; | ||||
|   } | ||||
|  | ||||
|   return { | ||||
|     title: `Could not add the following ${ | ||||
|       length === 1 ? "organization" : "organizations" | ||||
|     }`, | ||||
|     content: `${domainList}\nPlease contact your system administrator.`, | ||||
|     title: t.__mf( | ||||
|       "{number, plural, one {Could not add # organization} other {Could not add # organizations}}", | ||||
|       {number: domains.length}, | ||||
|     ), | ||||
|     content: `${domainList}\n${t.__("Please contact your system administrator.")}`, | ||||
|   }; | ||||
| } | ||||
|  | ||||
| export function orgRemovalError(url: string): DialogBoxError { | ||||
|   return { | ||||
|     title: `Removing ${url} is a restricted operation.`, | ||||
|     content: "Please contact your system administrator.", | ||||
|     title: t.__("Removing {{{url}}} is a restricted operation.", {url}), | ||||
|     content: t.__("Please contact your system administrator."), | ||||
|   }; | ||||
| } | ||||
|   | ||||
							
								
								
									
										15
									
								
								app/common/paths.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								app/common/paths.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| import path from "node:path"; | ||||
| import process from "node:process"; | ||||
| import url from "node:url"; | ||||
|  | ||||
| export const bundlePath = __dirname; | ||||
|  | ||||
| export const publicPath = import.meta.env.DEV | ||||
|   ? path.join(bundlePath, "../public") | ||||
|   : bundlePath; | ||||
|  | ||||
| export const bundleUrl = import.meta.env.DEV | ||||
|   ? process.env.VITE_DEV_SERVER_URL | ||||
|   : url.pathToFileURL(__dirname).href + "/"; | ||||
|  | ||||
| export const publicUrl = bundleUrl; | ||||
| @@ -1,8 +0,0 @@ | ||||
| import process from "node:process"; | ||||
|  | ||||
| export const {app, dialog} = | ||||
|   process.type === "renderer" | ||||
|     ? // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires | ||||
|       (require("@electron/remote") as typeof import("@electron/remote")) | ||||
|     : // eslint-disable-next-line @typescript-eslint/no-require-imports | ||||
|       require("electron/main"); | ||||
| @@ -2,17 +2,15 @@ import path from "node:path"; | ||||
|  | ||||
| import i18n from "i18n"; | ||||
|  | ||||
| import * as ConfigUtil from "./config-util.js"; | ||||
| import * as ConfigUtil from "./config-util.ts"; | ||||
| import {publicPath} from "./paths.ts"; | ||||
|  | ||||
| i18n.configure({ | ||||
|   directory: path.join(__dirname, "../translations/"), | ||||
|   directory: path.join(publicPath, "translations/"), | ||||
|   updateFiles: false, | ||||
| }); | ||||
|  | ||||
| /* Fetches the current appLocale from settings.json */ | ||||
| const appLocale = ConfigUtil.getConfigItem("appLanguage", "en"); | ||||
| i18n.setLocale(ConfigUtil.getConfigItem("appLanguage", "en") ?? "en"); | ||||
|  | ||||
| /* If no locale present in the json, en is set default */ | ||||
| export function __(phrase: string): string { | ||||
|   return i18n.__({phrase, locale: appLocale ?? "en"}); | ||||
| } | ||||
| export {__, __mf} from "i18n"; | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| import type {DndSettings} from "./dnd-util.js"; | ||||
| import type {MenuProps, ServerConf} from "./types.js"; | ||||
| import type {DndSettings} from "./dnd-util.ts"; | ||||
| import type {MenuProperties, ServerConfig} from "./types.ts"; | ||||
|  | ||||
| export type MainMessage = { | ||||
|   "clear-app-settings": () => void; | ||||
| @@ -7,6 +7,7 @@ export type MainMessage = { | ||||
|   "fetch-user-agent": () => string; | ||||
|   "focus-app": () => void; | ||||
|   "focus-this-webview": () => void; | ||||
|   "new-clipboard-key": () => {key: Uint8Array; sig: Uint8Array}; | ||||
|   "permission-callback": (permissionCallbackId: number, grant: boolean) => void; | ||||
|   "quit-app": () => void; | ||||
|   "realm-icon-changed": (serverURL: string, iconURL: string) => void; | ||||
| @@ -20,14 +21,15 @@ export type MainMessage = { | ||||
|   toggleAutoLauncher: (AutoLaunchValue: boolean) => void; | ||||
|   "unread-count": (unreadCount: number) => void; | ||||
|   "update-badge": (messageCount: number) => void; | ||||
|   "update-menu": (props: MenuProps) => void; | ||||
|   "update-menu": (properties: MenuProperties) => void; | ||||
|   "update-taskbar-icon": (data: string, text: string) => void; | ||||
| }; | ||||
|  | ||||
| export type MainCall = { | ||||
|   "get-server-settings": (domain: string) => ServerConf; | ||||
|   "get-server-settings": (domain: string) => ServerConfig; | ||||
|   "is-online": (url: string) => boolean; | ||||
|   "save-server-icon": (iconURL: string) => string; | ||||
|   "poll-clipboard": (key: Uint8Array, sig: Uint8Array) => string | undefined; | ||||
|   "save-server-icon": (iconURL: string) => string | null; | ||||
| }; | ||||
|  | ||||
| export type RendererMessage = { | ||||
| @@ -72,9 +74,9 @@ export type RendererMessage = { | ||||
|   "toggle-silent": (state: boolean) => void; | ||||
|   "toggle-tray": (state: boolean) => void; | ||||
|   toggletray: () => void; | ||||
|   tray: (arg: number) => void; | ||||
|   tray: (argument: number) => void; | ||||
|   "update-realm-icon": (serverURL: string, iconURL: string) => void; | ||||
|   "update-realm-name": (serveRURL: string, realmName: string) => void; | ||||
|   "update-realm-name": (serverURL: string, realmName: string) => void; | ||||
|   "webview-reload": () => void; | ||||
|   zoomActualSize: () => void; | ||||
|   zoomIn: () => void; | ||||
|   | ||||
| @@ -1,26 +1,30 @@ | ||||
| export type MenuProps = { | ||||
| export type MenuProperties = { | ||||
|   tabs: TabData[]; | ||||
|   activeTabIndex?: number; | ||||
|   enableMenu?: boolean; | ||||
| }; | ||||
|  | ||||
| export type NavItem = | ||||
| export type NavigationItem = | ||||
|   | "General" | ||||
|   | "Network" | ||||
|   | "AddServer" | ||||
|   | "Organizations" | ||||
|   | "Shortcuts"; | ||||
|  | ||||
| export type ServerConf = { | ||||
| export type ServerConfig = { | ||||
|   url: string; | ||||
|   alias: string; | ||||
|   icon: string; | ||||
|   zulipVersion: string; | ||||
|   zulipFeatureLevel: number; | ||||
| }; | ||||
|  | ||||
| export type TabRole = "server" | "function"; | ||||
| export type TabPage = "Settings" | "About"; | ||||
|  | ||||
| export type TabData = { | ||||
|   role: TabRole; | ||||
|   name: string; | ||||
|   page?: TabPage; | ||||
|   label: string; | ||||
|   index: number; | ||||
| }; | ||||
|   | ||||
| @@ -2,13 +2,17 @@ import {shell} from "electron/common"; | ||||
| import {app, dialog, session} from "electron/main"; | ||||
| import process from "node:process"; | ||||
|  | ||||
| import log from "electron-log"; | ||||
| import type {UpdateDownloadedEvent, UpdateInfo} from "electron-updater"; | ||||
| import {autoUpdater} from "electron-updater"; | ||||
| import log from "electron-log/main"; | ||||
| import { | ||||
|   type UpdateDownloadedEvent, | ||||
|   type UpdateInfo, | ||||
|   autoUpdater, | ||||
| } from "electron-updater"; | ||||
|  | ||||
| import * as ConfigUtil from "../common/config-util.js"; | ||||
| import * as ConfigUtil from "../common/config-util.ts"; | ||||
| import * as t from "../common/translation-util.ts"; | ||||
|  | ||||
| import {linuxUpdateNotification} from "./linuxupdater.js"; // Required only in case of linux | ||||
| import {linuxUpdateNotification} from "./linuxupdater.ts"; // Required only in case of linux | ||||
|  | ||||
| let quitting = false; | ||||
|  | ||||
| @@ -30,10 +34,11 @@ export async function appUpdater(updateFromMenu = false): Promise<void> { | ||||
|  | ||||
|   let updateAvailable = false; | ||||
|  | ||||
|   // Log whats happening | ||||
|   log.transports.file.fileName = "updates.log"; | ||||
|   log.transports.file.level = "info"; | ||||
|   autoUpdater.logger = log; | ||||
|   // Log what's happening | ||||
|   const updateLogger = log.create({logId: "updates"}); | ||||
|   updateLogger.transports.file.fileName = "updates.log"; | ||||
|   updateLogger.transports.file.level = "info"; | ||||
|   autoUpdater.logger = updateLogger; | ||||
|  | ||||
|   // Handle auto updates for beta/pre releases | ||||
|   const isBetaUpdate = ConfigUtil.getConfigItem("betaUpdate", false); | ||||
| @@ -54,9 +59,13 @@ export async function appUpdater(updateFromMenu = false): Promise<void> { | ||||
|       } | ||||
|  | ||||
|       await dialog.showMessageBox({ | ||||
|         message: `A new version ${info.version}, of Zulip Desktop is available`, | ||||
|         detail: | ||||
|         message: t.__( | ||||
|           "A new version {{{version}}} of Zulip Desktop is available.", | ||||
|           {version: info.version}, | ||||
|         ), | ||||
|         detail: t.__( | ||||
|           "The update will be downloaded in the background. You will be notified when it is ready to be installed.", | ||||
|         ), | ||||
|       }); | ||||
|     } | ||||
|   }); | ||||
| @@ -68,8 +77,11 @@ export async function appUpdater(updateFromMenu = false): Promise<void> { | ||||
|       autoUpdater.removeAllListeners(); | ||||
|  | ||||
|       await dialog.showMessageBox({ | ||||
|         message: "No updates available", | ||||
|         detail: `You are running the latest version of Zulip Desktop.\nVersion: ${app.getVersion()}`, | ||||
|         message: t.__("No updates available."), | ||||
|         detail: t.__( | ||||
|           "You are running the latest version of Zulip Desktop.\nVersion: {{{version}}}", | ||||
|           {version: app.getVersion()}, | ||||
|         ), | ||||
|       }); | ||||
|     } | ||||
|   }); | ||||
| @@ -81,20 +93,20 @@ export async function appUpdater(updateFromMenu = false): Promise<void> { | ||||
|       autoUpdater.removeAllListeners(); | ||||
|  | ||||
|       const messageText = updateAvailable | ||||
|         ? "Unable to download the updates" | ||||
|         : "Unable to check for updates"; | ||||
|         ? t.__("Unable to download the update.") | ||||
|         : t.__("Unable to check for updates."); | ||||
|       const link = "https://zulip.com/apps/"; | ||||
|       const {response} = await dialog.showMessageBox({ | ||||
|         type: "error", | ||||
|         buttons: ["Manual Download", "Cancel"], | ||||
|         buttons: [t.__("Manual Download"), t.__("Cancel")], | ||||
|         message: messageText, | ||||
|         detail: `Error: ${error.message} | ||||
|  | ||||
| The latest version of Zulip Desktop is available at - | ||||
| https://zulip.com/apps/. | ||||
| Current Version: ${app.getVersion()}`, | ||||
|         detail: t.__( | ||||
|           "Error: {{{error}}}\n\nThe latest version of Zulip Desktop is available at:\n{{{link}}}\nCurrent version: {{{version}}}", | ||||
|           {error: error.message, link, version: app.getVersion()}, | ||||
|         ), | ||||
|       }); | ||||
|       if (response === 0) { | ||||
|         await shell.openExternal("https://zulip.com/apps/"); | ||||
|         await shell.openExternal(link); | ||||
|       } | ||||
|     } | ||||
|   }); | ||||
| @@ -104,10 +116,14 @@ Current Version: ${app.getVersion()}`, | ||||
|     // Ask user to update the app | ||||
|     const {response} = await dialog.showMessageBox({ | ||||
|       type: "question", | ||||
|       buttons: ["Install and Relaunch", "Install Later"], | ||||
|       buttons: [t.__("Install and Relaunch"), t.__("Install Later")], | ||||
|       defaultId: 0, | ||||
|       message: `A new update ${event.version} has been downloaded`, | ||||
|       detail: "It will be installed the next time you restart the application", | ||||
|       message: t.__("A new update {{{version}}} has been downloaded.", { | ||||
|         version: event.version, | ||||
|       }), | ||||
|       detail: t.__( | ||||
|         "It will be installed the next time you restart the application.", | ||||
|       ), | ||||
|     }); | ||||
|     if (response === 0) { | ||||
|       quitting = true; | ||||
|   | ||||
| @@ -1,11 +1,10 @@ | ||||
| import {nativeImage} from "electron/common"; | ||||
| import type {BrowserWindow} from "electron/main"; | ||||
| import {app} from "electron/main"; | ||||
| import {type BrowserWindow, app} from "electron/main"; | ||||
| import process from "node:process"; | ||||
|  | ||||
| import * as ConfigUtil from "../common/config-util.js"; | ||||
| import * as ConfigUtil from "../common/config-util.ts"; | ||||
|  | ||||
| import {send} from "./typed-ipc-main.js"; | ||||
| import {send} from "./typed-ipc-main.ts"; | ||||
|  | ||||
| function showBadgeCount(messageCount: number, mainWindow: BrowserWindow): void { | ||||
|   if (process.platform === "win32") { | ||||
|   | ||||
| @@ -1,17 +1,19 @@ | ||||
| import {shell} from "electron/common"; | ||||
| import type { | ||||
|   HandlerDetails, | ||||
|   SaveDialogOptions, | ||||
|   WebContents, | ||||
| import {type Event, shell} from "electron/common"; | ||||
| import { | ||||
|   type HandlerDetails, | ||||
|   Notification, | ||||
|   type SaveDialogOptions, | ||||
|   type WebContents, | ||||
|   app, | ||||
| } from "electron/main"; | ||||
| import {Notification, app} from "electron/main"; | ||||
| import fs from "node:fs"; | ||||
| import path from "node:path"; | ||||
|  | ||||
| import * as ConfigUtil from "../common/config-util.js"; | ||||
| import * as LinkUtil from "../common/link-util.js"; | ||||
| import * as ConfigUtil from "../common/config-util.ts"; | ||||
| import * as LinkUtil from "../common/link-util.ts"; | ||||
| import * as t from "../common/translation-util.ts"; | ||||
|  | ||||
| import {send} from "./typed-ipc-main.js"; | ||||
| import {send} from "./typed-ipc-main.ts"; | ||||
|  | ||||
| function isUploadsUrl(server: string, url: URL): boolean { | ||||
|   return url.origin === server && url.pathname.startsWith("/user_uploads/"); | ||||
| @@ -31,7 +33,7 @@ function downloadFile({ | ||||
|   failed(state: string): void; | ||||
| }) { | ||||
|   contents.downloadURL(url); | ||||
|   contents.session.once("will-download", async (_event: Event, item) => { | ||||
|   contents.session.once("will-download", async (_event, item) => { | ||||
|     if (ConfigUtil.getConfigItem("promptDownload", false)) { | ||||
|       const showDialogOptions: SaveDialogOptions = { | ||||
|         defaultPath: path.join(downloadPath, item.getFilename()), | ||||
| @@ -86,7 +88,7 @@ function downloadFile({ | ||||
|     }; | ||||
|  | ||||
|     item.on("updated", updatedListener); | ||||
|     item.once("done", async (_event: Event, state) => { | ||||
|     item.once("done", async (_event, state) => { | ||||
|       if (state === "completed") { | ||||
|         await completed(item.getSavePath(), path.basename(item.getSavePath())); | ||||
|       } else { | ||||
| @@ -124,8 +126,8 @@ export default function handleExternalLink( | ||||
|       downloadPath, | ||||
|       async completed(filePath: string, fileName: string) { | ||||
|         const downloadNotification = new Notification({ | ||||
|           title: "Download Complete", | ||||
|           body: `Click to show ${fileName} in folder`, | ||||
|           title: t.__("Download Complete"), | ||||
|           body: t.__("Click to show {{{fileName}}} in folder", {fileName}), | ||||
|           silent: true, // We'll play our own sound - ding.ogg | ||||
|         }); | ||||
|         downloadNotification.on("click", () => { | ||||
| @@ -148,8 +150,8 @@ export default function handleExternalLink( | ||||
|         if (state !== "cancelled") { | ||||
|           if (ConfigUtil.getConfigItem("promptDownload", false)) { | ||||
|             new Notification({ | ||||
|               title: "Download Complete", | ||||
|               body: "Download failed", | ||||
|               title: t.__("Download Complete"), | ||||
|               body: t.__("Download failed"), | ||||
|             }).show(); | ||||
|           } else { | ||||
|             contents.downloadURL(url.href); | ||||
|   | ||||
| @@ -1,25 +1,38 @@ | ||||
| import type {IpcMainEvent, WebContents} from "electron/main"; | ||||
| import {BrowserWindow, app, dialog, powerMonitor, session} from "electron/main"; | ||||
| import {clipboard} from "electron/common"; | ||||
| import { | ||||
|   BrowserWindow, | ||||
|   type IpcMainEvent, | ||||
|   type WebContents, | ||||
|   app, | ||||
|   dialog, | ||||
|   powerMonitor, | ||||
|   session, | ||||
|   webContents, | ||||
| } from "electron/main"; | ||||
| import {Buffer} from "node:buffer"; | ||||
| import crypto from "node:crypto"; | ||||
| import path from "node:path"; | ||||
| import process from "node:process"; | ||||
|  | ||||
| import * as remoteMain from "@electron/remote/main"; | ||||
| import windowStateKeeper from "electron-window-state"; | ||||
|  | ||||
| import * as ConfigUtil from "../common/config-util.js"; | ||||
| import type {RendererMessage} from "../common/typed-ipc.js"; | ||||
| import type {MenuProps} from "../common/types.js"; | ||||
| import * as ConfigUtil from "../common/config-util.ts"; | ||||
| import {bundlePath, bundleUrl, publicPath} from "../common/paths.ts"; | ||||
| import * as t from "../common/translation-util.ts"; | ||||
| import type {RendererMessage} from "../common/typed-ipc.ts"; | ||||
| import type {MenuProperties} from "../common/types.ts"; | ||||
|  | ||||
| import {appUpdater, shouldQuitForUpdate} from "./autoupdater.js"; | ||||
| import * as BadgeSettings from "./badge-settings.js"; | ||||
| import handleExternalLink from "./handle-external-link.js"; | ||||
| import * as AppMenu from "./menu.js"; | ||||
| import {_getServerSettings, _isOnline, _saveServerIcon} from "./request.js"; | ||||
| import {sentryInit} from "./sentry.js"; | ||||
| import {setAutoLaunch} from "./startup.js"; | ||||
| import {ipcMain, send} from "./typed-ipc-main.js"; | ||||
| import {appUpdater, shouldQuitForUpdate} from "./autoupdater.ts"; | ||||
| import * as BadgeSettings from "./badge-settings.ts"; | ||||
| import handleExternalLink from "./handle-external-link.ts"; | ||||
| import * as AppMenu from "./menu.ts"; | ||||
| import {_getServerSettings, _isOnline, _saveServerIcon} from "./request.ts"; | ||||
| import {sentryInit} from "./sentry.ts"; | ||||
| import {setAutoLaunch} from "./startup.ts"; | ||||
| import {ipcMain, send} from "./typed-ipc-main.ts"; | ||||
|  | ||||
| import "gatemaker/electron-setup"; // eslint-disable-line import/no-unassigned-import | ||||
| import "gatemaker/electron-setup.js"; // eslint-disable-line import-x/no-unassigned-import | ||||
|  | ||||
| // eslint-disable-next-line @typescript-eslint/naming-convention | ||||
| const {GDK_BACKEND} = process.env; | ||||
| @@ -35,13 +48,13 @@ let badgeCount: number; | ||||
|  | ||||
| let isQuitting = false; | ||||
|  | ||||
| // Load this url in main window | ||||
| const mainUrl = "file://" + path.join(__dirname, "../renderer", "main.html"); | ||||
| // Load this file in main window | ||||
| const mainUrl = new URL("app/renderer/main.html", bundleUrl).href; | ||||
|  | ||||
| const permissionCallbacks = new Map<number, (grant: boolean) => void>(); | ||||
| let nextPermissionCallbackId = 0; | ||||
|  | ||||
| const appIcon = path.join(__dirname, "../resources", "Icon"); | ||||
| const appIcon = path.join(publicPath, "resources/Icon"); | ||||
|  | ||||
| const iconPath = (): string => | ||||
|   appIcon + (process.platform === "win32" ? ".ico" : ".png"); | ||||
| @@ -74,7 +87,7 @@ function createMainWindow(): BrowserWindow { | ||||
|     minWidth: 500, | ||||
|     minHeight: 400, | ||||
|     webPreferences: { | ||||
|       preload: require.resolve("../renderer/js/main"), | ||||
|       preload: path.join(bundlePath, "renderer.cjs"), | ||||
|       sandbox: false, | ||||
|       webviewTag: true, | ||||
|     }, | ||||
| @@ -98,7 +111,14 @@ function createMainWindow(): BrowserWindow { | ||||
|       event.preventDefault(); | ||||
|  | ||||
|       if (process.platform === "darwin") { | ||||
|         app.hide(); | ||||
|         if (win.isFullScreen()) { | ||||
|           win.setFullScreen(false); | ||||
|           win.once("leave-full-screen", () => { | ||||
|             app.hide(); | ||||
|           }); | ||||
|         } else { | ||||
|           app.hide(); | ||||
|         } | ||||
|       } else { | ||||
|         win.hide(); | ||||
|       } | ||||
| @@ -166,7 +186,7 @@ function createMainWindow(): BrowserWindow { | ||||
|  | ||||
|   ipcMain.on( | ||||
|     "permission-callback", | ||||
|     (event: Event, permissionCallbackId: number, grant: boolean) => { | ||||
|     (event, permissionCallbackId: number, grant: boolean) => { | ||||
|       permissionCallbacks.get(permissionCallbackId)?.(grant); | ||||
|       permissionCallbacks.delete(permissionCallbackId); | ||||
|     }, | ||||
| @@ -177,7 +197,7 @@ function createMainWindow(): BrowserWindow { | ||||
|     mainWindow.show(); | ||||
|   }); | ||||
|  | ||||
|   app.on("web-contents-created", (_event: Event, contents: WebContents) => { | ||||
|   app.on("web-contents-created", (_event, contents: WebContents) => { | ||||
|     contents.setWindowOpenHandler((details) => { | ||||
|       handleExternalLink(contents, details, page); | ||||
|       return {action: "deny"}; | ||||
| @@ -201,6 +221,42 @@ function createMainWindow(): BrowserWindow { | ||||
|   configureSpellChecker(); | ||||
|   ipcMain.on("configure-spell-checker", configureSpellChecker); | ||||
|  | ||||
|   const clipboardSigKey = crypto.randomBytes(32); | ||||
|  | ||||
|   ipcMain.on("new-clipboard-key", (event) => { | ||||
|     const key = crypto.randomBytes(32); | ||||
|     const hmac = crypto.createHmac("sha256", clipboardSigKey); | ||||
|     hmac.update(key); | ||||
|     event.returnValue = {key, sig: hmac.digest()}; | ||||
|   }); | ||||
|  | ||||
|   ipcMain.handle("poll-clipboard", (event, key, sig) => { | ||||
|     // Check that the key was generated here. | ||||
|     const hmac = crypto.createHmac("sha256", clipboardSigKey); | ||||
|     hmac.update(key); | ||||
|     if (!crypto.timingSafeEqual(sig, hmac.digest())) return; | ||||
|  | ||||
|     try { | ||||
|       // Check that the data on the clipboard was encrypted to the key. | ||||
|       const data = Buffer.from(clipboard.readText(), "hex"); | ||||
|       const iv = data.subarray(0, 12); | ||||
|       const ciphertext = data.subarray(12, -16); | ||||
|       const authTag = data.subarray(-16); | ||||
|       const decipher = crypto.createDecipheriv("aes-256-gcm", key, iv, { | ||||
|         authTagLength: 16, | ||||
|       }); | ||||
|       decipher.setAuthTag(authTag); | ||||
|       return ( | ||||
|         decipher.update(ciphertext, undefined, "utf8") + decipher.final("utf8") | ||||
|       ); | ||||
|     } catch { | ||||
|       // If the parsing or decryption failed in any way, | ||||
|       // the correct token hasn’t been copied yet; try | ||||
|       // again next time. | ||||
|       return undefined; | ||||
|     } | ||||
|   }); | ||||
|  | ||||
|   AppMenu.setMenu({ | ||||
|     tabs: [], | ||||
|   }); | ||||
| @@ -251,18 +307,25 @@ function createMainWindow(): BrowserWindow { | ||||
|   app.on( | ||||
|     "certificate-error", | ||||
|     ( | ||||
|       event: Event, | ||||
|       webContents: WebContents, | ||||
|       urlString: string, | ||||
|       error: string, | ||||
|       event, | ||||
|       webContents, | ||||
|       urlString, | ||||
|       error, | ||||
|       certificate, | ||||
|       callback, | ||||
|       isMainFrame, | ||||
|       // eslint-disable-next-line max-params | ||||
|     ) => { | ||||
|       const url = new URL(urlString); | ||||
|       dialog.showErrorBox( | ||||
|         "Certificate error", | ||||
|         `The server presented an invalid certificate for ${url.origin}: | ||||
|  | ||||
| ${error}`, | ||||
|       ); | ||||
|       if (isMainFrame) { | ||||
|         const url = new URL(urlString); | ||||
|         dialog.showErrorBox( | ||||
|           t.__("Certificate error"), | ||||
|           t.__( | ||||
|             "The server presented an invalid certificate for {{{origin}}}:\n\n{{{error}}}", | ||||
|             {origin: url.origin, error}, | ||||
|           ), | ||||
|         ); | ||||
|       } | ||||
|     }, | ||||
|   ); | ||||
|  | ||||
| @@ -321,24 +384,21 @@ ${error}`, | ||||
|     BadgeSettings.updateBadge(badgeCount, mainWindow); | ||||
|   }); | ||||
|  | ||||
|   ipcMain.on("toggle-menubar", (_event: IpcMainEvent, showMenubar: boolean) => { | ||||
|   ipcMain.on("toggle-menubar", (_event, showMenubar: boolean) => { | ||||
|     mainWindow.autoHideMenuBar = showMenubar; | ||||
|     mainWindow.setMenuBarVisibility(!showMenubar); | ||||
|     send(page, "toggle-autohide-menubar", showMenubar, true); | ||||
|   }); | ||||
|  | ||||
|   ipcMain.on("update-badge", (_event: IpcMainEvent, messageCount: number) => { | ||||
|   ipcMain.on("update-badge", (_event, messageCount: number) => { | ||||
|     badgeCount = messageCount; | ||||
|     BadgeSettings.updateBadge(badgeCount, mainWindow); | ||||
|     send(page, "tray", messageCount); | ||||
|   }); | ||||
|  | ||||
|   ipcMain.on( | ||||
|     "update-taskbar-icon", | ||||
|     (_event: IpcMainEvent, data: string, text: string) => { | ||||
|       BadgeSettings.updateTaskbarIcon(data, text, mainWindow); | ||||
|     }, | ||||
|   ); | ||||
|   ipcMain.on("update-taskbar-icon", (_event, data: string, text: string) => { | ||||
|     BadgeSettings.updateTaskbarIcon(data, text, mainWindow); | ||||
|   }); | ||||
|  | ||||
|   ipcMain.on( | ||||
|     "forward-message", | ||||
| @@ -351,40 +411,52 @@ ${error}`, | ||||
|     }, | ||||
|   ); | ||||
|  | ||||
|   ipcMain.on("update-menu", (_event: IpcMainEvent, props: MenuProps) => { | ||||
|     AppMenu.setMenu(props); | ||||
|     if (props.activeTabIndex !== undefined) { | ||||
|       const activeTab = props.tabs[props.activeTabIndex]; | ||||
|       mainWindow.setTitle(`Zulip - ${activeTab.name}`); | ||||
|     } | ||||
|   }); | ||||
|  | ||||
|   ipcMain.on( | ||||
|     "toggleAutoLauncher", | ||||
|     async (_event: IpcMainEvent, AutoLaunchValue: boolean) => { | ||||
|       await setAutoLaunch(AutoLaunchValue); | ||||
|     "forward-to", | ||||
|     <Channel extends keyof RendererMessage>( | ||||
|       _event: IpcMainEvent, | ||||
|       webContentsId: number, | ||||
|       listener: Channel, | ||||
|       ...parameters: Parameters<RendererMessage[Channel]> | ||||
|     ) => { | ||||
|       const contents = webContents.fromId(webContentsId); | ||||
|       if (contents !== undefined) { | ||||
|         send(contents, listener, ...parameters); | ||||
|       } | ||||
|     }, | ||||
|   ); | ||||
|  | ||||
|   ipcMain.on("update-menu", (_event, properties: MenuProperties) => { | ||||
|     AppMenu.setMenu(properties); | ||||
|     if (properties.activeTabIndex !== undefined) { | ||||
|       const activeTab = properties.tabs[properties.activeTabIndex]; | ||||
|       mainWindow.setTitle(`Zulip - ${activeTab.label}`); | ||||
|     } | ||||
|   }); | ||||
|  | ||||
|   ipcMain.on("toggleAutoLauncher", async (_event, AutoLaunchValue: boolean) => { | ||||
|     await setAutoLaunch(AutoLaunchValue); | ||||
|   }); | ||||
|  | ||||
|   ipcMain.on( | ||||
|     "realm-name-changed", | ||||
|     (_event: IpcMainEvent, serverURL: string, realmName: string) => { | ||||
|     (_event, serverURL: string, realmName: string) => { | ||||
|       send(page, "update-realm-name", serverURL, realmName); | ||||
|     }, | ||||
|   ); | ||||
|  | ||||
|   ipcMain.on( | ||||
|     "realm-icon-changed", | ||||
|     (_event: IpcMainEvent, serverURL: string, iconURL: string) => { | ||||
|     (_event, serverURL: string, iconURL: string) => { | ||||
|       send(page, "update-realm-icon", serverURL, iconURL); | ||||
|     }, | ||||
|   ); | ||||
|  | ||||
|   ipcMain.on("save-last-tab", (_event: IpcMainEvent, index: number) => { | ||||
|   ipcMain.on("save-last-tab", (_event, index: number) => { | ||||
|     ConfigUtil.setConfigItem("lastActiveTab", index); | ||||
|   }); | ||||
|  | ||||
|   ipcMain.on("focus-this-webview", (event: IpcMainEvent) => { | ||||
|   ipcMain.on("focus-this-webview", (event) => { | ||||
|     send(page, "focus-webview-with-id", event.sender.id); | ||||
|     mainWindow.show(); | ||||
|   }); | ||||
|   | ||||
| @@ -3,26 +3,27 @@ import fs from "node:fs"; | ||||
| import path from "node:path"; | ||||
|  | ||||
| import {JsonDB} from "node-json-db"; | ||||
| import {DataError} from "node-json-db/dist/lib/Errors"; | ||||
| import {DataError} from "node-json-db/dist/lib/Errors.js"; | ||||
|  | ||||
| import Logger from "../common/logger-util.js"; | ||||
| import Logger from "../common/logger-util.ts"; | ||||
| import * as t from "../common/translation-util.ts"; | ||||
|  | ||||
| const logger = new Logger({ | ||||
|   file: "linux-update-util.log", | ||||
| }); | ||||
|  | ||||
| let db: JsonDB; | ||||
| let database: JsonDB; | ||||
|  | ||||
| reloadDb(); | ||||
| reloadDatabase(); | ||||
|  | ||||
| export function getUpdateItem( | ||||
|   key: string, | ||||
|   defaultValue: true | null = null, | ||||
| ): true | null { | ||||
|   reloadDb(); | ||||
|   reloadDatabase(); | ||||
|   let value: unknown; | ||||
|   try { | ||||
|     value = db.getObject<unknown>(`/${key}`); | ||||
|     value = database.getObject<unknown>(`/${key}`); | ||||
|   } catch (error: unknown) { | ||||
|     if (!(error instanceof DataError)) throw error; | ||||
|   } | ||||
| @@ -36,16 +37,16 @@ export function getUpdateItem( | ||||
| } | ||||
|  | ||||
| export function setUpdateItem(key: string, value: true | null): void { | ||||
|   db.push(`/${key}`, value, true); | ||||
|   reloadDb(); | ||||
|   database.push(`/${key}`, value, true); | ||||
|   reloadDatabase(); | ||||
| } | ||||
|  | ||||
| export function removeUpdateItem(key: string): void { | ||||
|   db.delete(`/${key}`); | ||||
|   reloadDb(); | ||||
|   database.delete(`/${key}`); | ||||
|   reloadDatabase(); | ||||
| } | ||||
|  | ||||
| function reloadDb(): void { | ||||
| function reloadDatabase(): void { | ||||
|   const linuxUpdateJsonPath = path.join( | ||||
|     app.getPath("userData"), | ||||
|     "/config/updates.json", | ||||
| @@ -57,13 +58,13 @@ function reloadDb(): void { | ||||
|     if (fs.existsSync(linuxUpdateJsonPath)) { | ||||
|       fs.unlinkSync(linuxUpdateJsonPath); | ||||
|       dialog.showErrorBox( | ||||
|         "Error saving update notifications.", | ||||
|         "We encountered an error while saving the update notifications.", | ||||
|         t.__("Error saving update notifications"), | ||||
|         t.__("We encountered an error while saving the update notifications."), | ||||
|       ); | ||||
|       logger.error("Error while JSON parsing updates.json: "); | ||||
|       logger.error(error); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   db = new JsonDB(linuxUpdateJsonPath, true, true); | ||||
|   database = new JsonDB(linuxUpdateJsonPath, true, true); | ||||
| } | ||||
|   | ||||
| @@ -1,15 +1,13 @@ | ||||
| import type {Session} from "electron/main"; | ||||
| import {Notification, app, net} from "electron/main"; | ||||
| import {Notification, type Session, app} from "electron/main"; | ||||
|  | ||||
| import getStream from "get-stream"; | ||||
| import * as semver from "semver"; | ||||
| import * as z from "zod"; | ||||
| import {z} from "zod"; | ||||
|  | ||||
| import * as ConfigUtil from "../common/config-util.js"; | ||||
| import Logger from "../common/logger-util.js"; | ||||
| import * as ConfigUtil from "../common/config-util.ts"; | ||||
| import Logger from "../common/logger-util.ts"; | ||||
| import * as t from "../common/translation-util.ts"; | ||||
|  | ||||
| import * as LinuxUpdateUtil from "./linux-update-util.js"; | ||||
| import {fetchResponse} from "./request.js"; | ||||
| import * as LinuxUpdateUtil from "./linux-update-util.ts"; | ||||
|  | ||||
| const logger = new Logger({ | ||||
|   file: "linux-update-util.log", | ||||
| @@ -20,13 +18,13 @@ export async function linuxUpdateNotification(session: Session): Promise<void> { | ||||
|   url = ConfigUtil.getConfigItem("betaUpdate", false) ? url : url + "/latest"; | ||||
|  | ||||
|   try { | ||||
|     const response = await fetchResponse(net.request({url, session})); | ||||
|     if (response.statusCode !== 200) { | ||||
|       logger.log("Linux update response status: ", response.statusCode); | ||||
|     const response = await session.fetch(url); | ||||
|     if (!response.ok) { | ||||
|       logger.log("Linux update response status: ", response.status); | ||||
|       return; | ||||
|     } | ||||
|  | ||||
|     const data: unknown = JSON.parse(await getStream(response)); | ||||
|     const data: unknown = await response.json(); | ||||
|     /* eslint-disable @typescript-eslint/naming-convention */ | ||||
|     const latestVersion = ConfigUtil.getConfigItem("betaUpdate", false) | ||||
|       ? z.array(z.object({tag_name: z.string()})).parse(data)[0].tag_name | ||||
| @@ -37,8 +35,11 @@ export async function linuxUpdateNotification(session: Session): Promise<void> { | ||||
|       const notified = LinuxUpdateUtil.getUpdateItem(latestVersion); | ||||
|       if (notified === null) { | ||||
|         new Notification({ | ||||
|           title: "Zulip Update", | ||||
|           body: `A new version ${latestVersion} is available. Please update using your package manager.`, | ||||
|           title: t.__("Zulip Update"), | ||||
|           body: t.__( | ||||
|             "A new version {{{version}}} is available. Please update using your package manager.", | ||||
|             {version: latestVersion}, | ||||
|           ), | ||||
|         }).show(); | ||||
|         LinuxUpdateUtil.setUpdateItem(latestVersion, true); | ||||
|       } | ||||
|   | ||||
| @@ -1,18 +1,22 @@ | ||||
| import {shell} from "electron/common"; | ||||
| import type {MenuItemConstructorOptions} from "electron/main"; | ||||
| import {BrowserWindow, Menu, app} from "electron/main"; | ||||
| import { | ||||
|   BrowserWindow, | ||||
|   Menu, | ||||
|   type MenuItemConstructorOptions, | ||||
|   app, | ||||
| } from "electron/main"; | ||||
| import process from "node:process"; | ||||
|  | ||||
| import AdmZip from "adm-zip"; | ||||
|  | ||||
| import * as ConfigUtil from "../common/config-util.js"; | ||||
| import * as DNDUtil from "../common/dnd-util.js"; | ||||
| import * as t from "../common/translation-util.js"; | ||||
| import type {RendererMessage} from "../common/typed-ipc.js"; | ||||
| import type {MenuProps, TabData} from "../common/types.js"; | ||||
| import * as ConfigUtil from "../common/config-util.ts"; | ||||
| import * as DNDUtil from "../common/dnd-util.ts"; | ||||
| import * as t from "../common/translation-util.ts"; | ||||
| import type {RendererMessage} from "../common/typed-ipc.ts"; | ||||
| import type {MenuProperties, TabData} from "../common/types.ts"; | ||||
|  | ||||
| import {appUpdater} from "./autoupdater.js"; | ||||
| import {send} from "./typed-ipc-main.js"; | ||||
| import {appUpdater} from "./autoupdater.ts"; | ||||
| import {send} from "./typed-ipc-main.ts"; | ||||
|  | ||||
| const appName = app.name; | ||||
|  | ||||
| @@ -66,7 +70,7 @@ function getToolsSubmenu(): MenuItemConstructorOptions[] { | ||||
|       click() { | ||||
|         const zip = new AdmZip(); | ||||
|         const date = new Date(); | ||||
|         const dateString = date.toLocaleDateString().replace(/\//g, "-"); | ||||
|         const dateString = date.toLocaleDateString().replaceAll("/", "-"); | ||||
|  | ||||
|         // Create a zip file of all the logs and config data | ||||
|         zip.addLocalFolder(`${app.getPath("appData")}/${appName}/Logs`); | ||||
| @@ -90,7 +94,7 @@ function getToolsSubmenu(): MenuItemConstructorOptions[] { | ||||
|       accelerator: | ||||
|         process.platform === "darwin" ? "Alt+Command+I" : "Ctrl+Shift+I", | ||||
|       click(_item, focusedWindow) { | ||||
|         if (focusedWindow) { | ||||
|         if (focusedWindow instanceof BrowserWindow) { | ||||
|           focusedWindow.webContents.openDevTools({mode: "undocked"}); | ||||
|         } | ||||
|       }, | ||||
| @@ -218,7 +222,7 @@ function getViewSubmenu(): MenuItemConstructorOptions[] { | ||||
|     { | ||||
|       label: t.__("Toggle Tray Icon"), | ||||
|       click(_item, focusedWindow) { | ||||
|         if (focusedWindow) { | ||||
|         if (focusedWindow instanceof BrowserWindow) { | ||||
|           send(focusedWindow.webContents, "toggletray"); | ||||
|         } | ||||
|       }, | ||||
| @@ -227,7 +231,7 @@ function getViewSubmenu(): MenuItemConstructorOptions[] { | ||||
|       label: t.__("Toggle Sidebar"), | ||||
|       accelerator: "CommandOrControl+Shift+S", | ||||
|       click(_item, focusedWindow) { | ||||
|         if (focusedWindow) { | ||||
|         if (focusedWindow instanceof BrowserWindow) { | ||||
|           const newValue = !ConfigUtil.getConfigItem("showSidebar", true); | ||||
|           send(focusedWindow.webContents, "toggle-sidebar", newValue); | ||||
|           ConfigUtil.setConfigItem("showSidebar", newValue); | ||||
| @@ -239,7 +243,7 @@ function getViewSubmenu(): MenuItemConstructorOptions[] { | ||||
|       checked: ConfigUtil.getConfigItem("autoHideMenubar", false), | ||||
|       visible: process.platform !== "darwin", | ||||
|       click(_item, focusedWindow) { | ||||
|         if (focusedWindow) { | ||||
|         if (focusedWindow instanceof BrowserWindow) { | ||||
|           const newValue = !ConfigUtil.getConfigItem("autoHideMenubar", false); | ||||
|           focusedWindow.autoHideMenuBar = newValue; | ||||
|           focusedWindow.setMenuBarVisibility(!newValue); | ||||
| @@ -314,12 +318,12 @@ function getWindowSubmenu( | ||||
|       if (tab === undefined) continue; | ||||
|  | ||||
|       // Do not add functional tab settings to list of windows in menu bar | ||||
|       if (tab.role === "function" && tab.name === "Settings") { | ||||
|       if (tab.role === "function" && tab.page === "Settings") { | ||||
|         continue; | ||||
|       } | ||||
|  | ||||
|       initialSubmenu.push({ | ||||
|         label: tab.name, | ||||
|         label: tab.label, | ||||
|         accelerator: | ||||
|           tab.role === "function" ? "" : `${shortcutKey} + ${tab.index + 1}`, | ||||
|         checked: tab.index === activeTabIndex, | ||||
| @@ -368,8 +372,10 @@ function getWindowSubmenu( | ||||
|   return initialSubmenu; | ||||
| } | ||||
|  | ||||
| function getDarwinTpl(props: MenuProps): MenuItemConstructorOptions[] { | ||||
|   const {tabs, activeTabIndex, enableMenu = false} = props; | ||||
| function getDarwinTpl( | ||||
|   properties: MenuProperties, | ||||
| ): MenuItemConstructorOptions[] { | ||||
|   const {tabs, activeTabIndex, enableMenu = false} = properties; | ||||
|  | ||||
|   return [ | ||||
|     { | ||||
| @@ -533,8 +539,8 @@ function getDarwinTpl(props: MenuProps): MenuItemConstructorOptions[] { | ||||
|   ]; | ||||
| } | ||||
|  | ||||
| function getOtherTpl(props: MenuProps): MenuItemConstructorOptions[] { | ||||
|   const {tabs, activeTabIndex, enableMenu = false} = props; | ||||
| function getOtherTpl(properties: MenuProperties): MenuItemConstructorOptions[] { | ||||
|   const {tabs, activeTabIndex, enableMenu = false} = properties; | ||||
|   return [ | ||||
|     { | ||||
|       label: t.__("File"), | ||||
| @@ -683,7 +689,7 @@ function getOtherTpl(props: MenuProps): MenuItemConstructorOptions[] { | ||||
|  | ||||
| function sendAction<Channel extends keyof RendererMessage>( | ||||
|   channel: Channel, | ||||
|   ...args: Parameters<RendererMessage[Channel]> | ||||
|   ...arguments_: Parameters<RendererMessage[Channel]> | ||||
| ): void { | ||||
|   const win = BrowserWindow.getAllWindows()[0]; | ||||
|  | ||||
| @@ -691,7 +697,7 @@ function sendAction<Channel extends keyof RendererMessage>( | ||||
|     win.restore(); | ||||
|   } | ||||
|  | ||||
|   send(win.webContents, channel, ...args); | ||||
|   send(win.webContents, channel, ...arguments_); | ||||
| } | ||||
|  | ||||
| async function checkForUpdate(): Promise<void> { | ||||
| @@ -714,9 +720,11 @@ function getPreviousServer(tabs: TabData[], activeTabIndex: number): number { | ||||
|   return activeTabIndex; | ||||
| } | ||||
|  | ||||
| export function setMenu(props: MenuProps): void { | ||||
| export function setMenu(properties: MenuProperties): void { | ||||
|   const tpl = | ||||
|     process.platform === "darwin" ? getDarwinTpl(props) : getOtherTpl(props); | ||||
|     process.platform === "darwin" | ||||
|       ? getDarwinTpl(properties) | ||||
|       : getOtherTpl(properties); | ||||
|   const menu = Menu.buildFromTemplate(tpl); | ||||
|   Menu.setApplicationMenu(menu); | ||||
| } | ||||
|   | ||||
| @@ -1,43 +1,25 @@ | ||||
| import type {ClientRequest, IncomingMessage, Session} from "electron/main"; | ||||
| import {app, net} from "electron/main"; | ||||
| import {type Session, app} from "electron/main"; | ||||
| import fs from "node:fs"; | ||||
| import path from "node:path"; | ||||
| import stream from "node:stream"; | ||||
| import util from "node:util"; | ||||
| import {Readable} from "node:stream"; | ||||
| import {pipeline} from "node:stream/promises"; | ||||
| import type {ReadableStream} from "node:stream/web"; | ||||
|  | ||||
| import * as Sentry from "@sentry/electron"; | ||||
| import getStream from "get-stream"; | ||||
| import * as z from "zod"; | ||||
| import * as Sentry from "@sentry/electron/main"; | ||||
| import {z} from "zod"; | ||||
|  | ||||
| import Logger from "../common/logger-util.js"; | ||||
| import * as Messages from "../common/messages.js"; | ||||
| import type {ServerConf} from "../common/types.js"; | ||||
|  | ||||
| export async function fetchResponse( | ||||
|   request: ClientRequest, | ||||
| ): Promise<IncomingMessage> { | ||||
|   return new Promise((resolve, reject) => { | ||||
|     request.on("response", resolve); | ||||
|     request.on("abort", () => { | ||||
|       reject(new Error("Request aborted")); | ||||
|     }); | ||||
|     request.on("error", reject); | ||||
|     request.end(); | ||||
|   }); | ||||
| } | ||||
|  | ||||
| const pipeline = util.promisify(stream.pipeline); | ||||
| import Logger from "../common/logger-util.ts"; | ||||
| import * as Messages from "../common/messages.ts"; | ||||
| import type {ServerConfig} from "../common/types.ts"; | ||||
|  | ||||
| /* Request: domain-util */ | ||||
|  | ||||
| const defaultIconUrl = "../renderer/img/icon.png"; | ||||
|  | ||||
| const logger = new Logger({ | ||||
|   file: "domain-util.log", | ||||
| }); | ||||
|  | ||||
| const generateFilePath = (url: string): string => { | ||||
|   const dir = `${app.getPath("userData")}/server-icons`; | ||||
|   const directory = `${app.getPath("userData")}/server-icons`; | ||||
|   const extension = path.extname(url).split("?")[0]; | ||||
|  | ||||
|   let hash = 5381; | ||||
| @@ -49,35 +31,38 @@ const generateFilePath = (url: string): string => { | ||||
|   } | ||||
|  | ||||
|   // Create 'server-icons' directory if not existed | ||||
|   if (!fs.existsSync(dir)) { | ||||
|     fs.mkdirSync(dir); | ||||
|   if (!fs.existsSync(directory)) { | ||||
|     fs.mkdirSync(directory); | ||||
|   } | ||||
|  | ||||
|   // eslint-disable-next-line no-bitwise | ||||
|   return `${dir}/${hash >>> 0}${extension}`; | ||||
|   return `${directory}/${hash >>> 0}${extension}`; | ||||
| }; | ||||
|  | ||||
| export const _getServerSettings = async ( | ||||
|   domain: string, | ||||
|   session: Session, | ||||
| ): Promise<ServerConf> => { | ||||
|   const response = await fetchResponse( | ||||
|     net.request({ | ||||
|       url: domain + "/api/v1/server_settings", | ||||
|       session, | ||||
|     }), | ||||
|   ); | ||||
|   if (response.statusCode !== 200) { | ||||
| ): Promise<ServerConfig> => { | ||||
|   const response = await session.fetch(domain + "/api/v1/server_settings"); | ||||
|   if (!response.ok) { | ||||
|     throw new Error(Messages.invalidZulipServerError(domain)); | ||||
|   } | ||||
|  | ||||
|   const data: unknown = JSON.parse(await getStream(response)); | ||||
|   const data: unknown = await response.json(); | ||||
|   /* eslint-disable @typescript-eslint/naming-convention */ | ||||
|   const {realm_name, realm_uri, realm_icon} = z | ||||
|   const { | ||||
|     realm_name, | ||||
|     realm_uri, | ||||
|     realm_icon, | ||||
|     zulip_version, | ||||
|     zulip_feature_level, | ||||
|   } = z | ||||
|     .object({ | ||||
|       realm_name: z.string(), | ||||
|       realm_uri: z.string(), | ||||
|       realm_uri: z.url(), | ||||
|       realm_icon: z.string(), | ||||
|       zulip_version: z.string().default("unknown"), | ||||
|       zulip_feature_level: z.number().default(0), | ||||
|     }) | ||||
|     .parse(data); | ||||
|   /* eslint-enable @typescript-eslint/naming-convention */ | ||||
| @@ -88,28 +73,33 @@ export const _getServerSettings = async ( | ||||
|     icon: realm_icon.startsWith("/") ? realm_uri + realm_icon : realm_icon, | ||||
|     url: realm_uri, | ||||
|     alias: realm_name, | ||||
|     zulipVersion: zulip_version, | ||||
|     zulipFeatureLevel: zulip_feature_level, | ||||
|   }; | ||||
| }; | ||||
|  | ||||
| export const _saveServerIcon = async ( | ||||
|   url: string, | ||||
|   session: Session, | ||||
| ): Promise<string> => { | ||||
| ): Promise<string | null> => { | ||||
|   try { | ||||
|     const response = await fetchResponse(net.request({url, session})); | ||||
|     if (response.statusCode !== 200) { | ||||
|     const response = await session.fetch(url); | ||||
|     if (!response.ok) { | ||||
|       logger.log("Could not get server icon."); | ||||
|       return defaultIconUrl; | ||||
|       return null; | ||||
|     } | ||||
|  | ||||
|     const filePath = generateFilePath(url); | ||||
|     await pipeline(response, fs.createWriteStream(filePath)); | ||||
|     await pipeline( | ||||
|       Readable.fromWeb(response.body as ReadableStream<Uint8Array>), | ||||
|       fs.createWriteStream(filePath), | ||||
|     ); | ||||
|     return filePath; | ||||
|   } catch (error: unknown) { | ||||
|     logger.log("Could not get server icon."); | ||||
|     logger.log(error); | ||||
|     Sentry.captureException(error); | ||||
|     return defaultIconUrl; | ||||
|     return null; | ||||
|   } | ||||
| }; | ||||
|  | ||||
| @@ -120,16 +110,10 @@ export const _isOnline = async ( | ||||
|   session: Session, | ||||
| ): Promise<boolean> => { | ||||
|   try { | ||||
|     const response = await fetchResponse( | ||||
|       net.request({ | ||||
|         method: "HEAD", | ||||
|         url: `${url}/api/v1/server_settings`, | ||||
|         session, | ||||
|       }), | ||||
|     ); | ||||
|     const isValidResponse = | ||||
|       response.statusCode >= 200 && response.statusCode < 400; | ||||
|     return isValidResponse; | ||||
|     const response = await session.fetch(`${url}/api/v1/server_settings`, { | ||||
|       method: "HEAD", | ||||
|     }); | ||||
|     return response.ok; | ||||
|   } catch (error: unknown) { | ||||
|     logger.log(error); | ||||
|     return false; | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| import {app} from "electron/main"; | ||||
|  | ||||
| import * as Sentry from "@sentry/electron"; | ||||
| import * as Sentry from "@sentry/electron/main"; | ||||
|  | ||||
| import {getConfigItem} from "../common/config-util.js"; | ||||
| import {getConfigItem} from "../common/config-util.ts"; | ||||
|  | ||||
| export const sentryInit = (): void => { | ||||
|   Sentry.init({ | ||||
|   | ||||
| @@ -3,7 +3,7 @@ import process from "node:process"; | ||||
|  | ||||
| import AutoLaunch from "auto-launch"; | ||||
|  | ||||
| import * as ConfigUtil from "../common/config-util.js"; | ||||
| import * as ConfigUtil from "../common/config-util.ts"; | ||||
|  | ||||
| export const setAutoLaunch = async ( | ||||
|   AutoLaunchValue: boolean, | ||||
|   | ||||
| @@ -1,9 +1,7 @@ | ||||
| import type { | ||||
|   IpcMainEvent, | ||||
|   IpcMainInvokeEvent, | ||||
|   WebContents, | ||||
| } from "electron/main"; | ||||
| import { | ||||
|   type IpcMainEvent, | ||||
|   type IpcMainInvokeEvent, | ||||
|   type WebContents, | ||||
|   ipcMain as untypedIpcMain, // eslint-disable-line no-restricted-imports | ||||
| } from "electron/main"; | ||||
|  | ||||
| @@ -14,14 +12,20 @@ import type { | ||||
| } from "../common/typed-ipc.js"; | ||||
|  | ||||
| type MainListener<Channel extends keyof MainMessage> = | ||||
|   MainMessage[Channel] extends (...args: infer Args) => infer Return | ||||
|     ? (event: IpcMainEvent & {returnValue: Return}, ...args: Args) => void | ||||
|   MainMessage[Channel] extends (...arguments_: infer Arguments) => infer Return | ||||
|     ? ( | ||||
|         event: IpcMainEvent & {returnValue: Return}, | ||||
|         ...arguments_: Arguments | ||||
|       ) => void | ||||
|     : never; | ||||
|  | ||||
| type MainHandler<Channel extends keyof MainCall> = MainCall[Channel] extends ( | ||||
|   ...args: infer Args | ||||
|   ...arguments_: infer Arguments | ||||
| ) => infer Return | ||||
|   ? (event: IpcMainInvokeEvent, ...args: Args) => Return | Promise<Return> | ||||
|   ? ( | ||||
|       event: IpcMainInvokeEvent, | ||||
|       ...arguments_: Arguments | ||||
|     ) => Return | Promise<Return> | ||||
|   : never; | ||||
|  | ||||
| export const ipcMain: { | ||||
| @@ -30,7 +34,16 @@ export const ipcMain: { | ||||
|     listener: <Channel extends keyof RendererMessage>( | ||||
|       event: IpcMainEvent, | ||||
|       channel: Channel, | ||||
|       ...args: Parameters<RendererMessage[Channel]> | ||||
|       ...arguments_: Parameters<RendererMessage[Channel]> | ||||
|     ) => void, | ||||
|   ): void; | ||||
|   on( | ||||
|     channel: "forward-to", | ||||
|     listener: <Channel extends keyof RendererMessage>( | ||||
|       event: IpcMainEvent, | ||||
|       webContentsId: number, | ||||
|       channel: Channel, | ||||
|       ...arguments_: Parameters<RendererMessage[Channel]> | ||||
|     ) => void, | ||||
|   ): void; | ||||
|   on<Channel extends keyof MainMessage>( | ||||
| @@ -60,16 +73,16 @@ export const ipcMain: { | ||||
| export function send<Channel extends keyof RendererMessage>( | ||||
|   contents: WebContents, | ||||
|   channel: Channel, | ||||
|   ...args: Parameters<RendererMessage[Channel]> | ||||
|   ...arguments_: Parameters<RendererMessage[Channel]> | ||||
| ): void { | ||||
|   contents.send(channel, ...args); | ||||
|   contents.send(channel, ...arguments_); | ||||
| } | ||||
|  | ||||
| export function sendToFrame<Channel extends keyof RendererMessage>( | ||||
|   contents: WebContents, | ||||
|   frameId: number | [number, number], | ||||
|   channel: Channel, | ||||
|   ...args: Parameters<RendererMessage[Channel]> | ||||
|   ...arguments_: Parameters<RendererMessage[Channel]> | ||||
| ): void { | ||||
|   contents.sendToFrame(frameId, channel, ...args); | ||||
|   contents.sendToFrame(frameId, channel, ...arguments_); | ||||
| } | ||||
|   | ||||
							
								
								
									
										9
									
								
								app/renderer/about.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								app/renderer/about.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| <!doctype html> | ||||
| <meta charset="UTF-8" /> | ||||
| <link rel="stylesheet" href="css/about.css" /> | ||||
|  | ||||
| <!-- Initially hidden to prevent FOUC --> | ||||
| <div class="about" hidden> | ||||
|   <img class="logo" src="../resources/zulip.png" /> | ||||
|   <p class="detail" id="version"></p> | ||||
| </div> | ||||
| @@ -47,7 +47,6 @@ | ||||
| } | ||||
|  | ||||
| .maintenance-info { | ||||
|   cursor: pointer; | ||||
|   position: absolute; | ||||
|   width: 100%; | ||||
|   left: 0; | ||||
|   | ||||
| @@ -2,7 +2,9 @@ | ||||
|   font-family: "Material Icons"; | ||||
|   font-style: normal; | ||||
|   font-weight: 400; | ||||
|   src: local("Material Icons"), local("MaterialIcons-Regular"), | ||||
|   src: | ||||
|     local("Material Icons"), | ||||
|     local("MaterialIcons-Regular"), | ||||
|     url("../fonts/MaterialIcons-Regular.ttf") format("truetype"); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -44,6 +44,7 @@ body { | ||||
|  | ||||
| #view-controls-container { | ||||
|   height: calc(100% - 208px); | ||||
|   scrollbar-gutter: stable both-edges; | ||||
|   overflow-y: hidden; | ||||
| } | ||||
|  | ||||
| @@ -52,16 +53,15 @@ body { | ||||
| } | ||||
|  | ||||
| #view-controls-container::-webkit-scrollbar-track { | ||||
|   box-shadow: inset 0 0 6px rgb(0 0 0 / 30%); | ||||
|   background-color: rgb(0 0 0 / 30%); | ||||
| } | ||||
|  | ||||
| #view-controls-container::-webkit-scrollbar-thumb { | ||||
|   background-color: rgb(169 169 169 / 100%); | ||||
|   outline: 1px solid rgb(169 169 169 / 100%); | ||||
| } | ||||
|  | ||||
| #view-controls-container:hover { | ||||
|   overflow-y: overlay; | ||||
|   overflow-y: scroll; | ||||
| } | ||||
|  | ||||
| /******************* | ||||
| @@ -85,7 +85,7 @@ body { | ||||
|   line-height: 1; | ||||
|   text-transform: none; | ||||
|   letter-spacing: normal; | ||||
|   word-wrap: normal; | ||||
|   overflow-wrap: normal; | ||||
|   white-space: nowrap; | ||||
|   direction: ltr; | ||||
|  | ||||
| @@ -114,12 +114,20 @@ body { | ||||
| } | ||||
|  | ||||
| .action-button i { | ||||
|   color: rgb(108 133 146 / 100%); | ||||
|   color: hsl(200.53deg 14.96% 49.8%); | ||||
|   font-size: 28px; | ||||
| } | ||||
|  | ||||
| .action-button:hover i { | ||||
|   color: rgb(152 169 179 / 100%); | ||||
|   color: hsl(202.22deg 15.08% 64.9%); | ||||
| } | ||||
|  | ||||
| .action-button > .dnd-on { | ||||
|   color: hsl(200.53deg 14.96% 85%); | ||||
| } | ||||
|  | ||||
| .action-button:hover > .dnd-on { | ||||
|   color: hsl(202.22deg 15.08% 95%); | ||||
| } | ||||
|  | ||||
| .action-button.active { | ||||
| @@ -290,7 +298,9 @@ body { | ||||
|   content: ""; | ||||
|   position: absolute; | ||||
|   z-index: 1; | ||||
|   background: rgb(255 255 255 / 100%) url("../img/ic_loading.gif") no-repeat; | ||||
|  | ||||
|   /* Spinner is released under loading.io free License: https://loading.io/license/#free-license */ | ||||
|   background: rgb(255 255 255 / 100%) url("../img/ic_loading.svg") no-repeat; | ||||
|   background-size: 60px 60px; | ||||
|   background-position: center; | ||||
|   width: 100%; | ||||
| @@ -303,7 +313,7 @@ body { | ||||
|   visibility: hidden; | ||||
| } | ||||
|  | ||||
| webview, | ||||
| .webview-pane, | ||||
| .functional-view { | ||||
|   position: absolute; | ||||
|   width: 100%; | ||||
| @@ -312,7 +322,16 @@ webview, | ||||
|   visibility: hidden; | ||||
| } | ||||
|  | ||||
| webview.active, | ||||
| .webview-pane { | ||||
|   display: flex; | ||||
|   flex-direction: column; | ||||
| } | ||||
|  | ||||
| .webview-pane > webview { | ||||
|   flex: 1; | ||||
| } | ||||
|  | ||||
| .webview-pane.active, | ||||
| .functional-view.active { | ||||
|   z-index: 1; | ||||
|   visibility: visible; | ||||
| @@ -322,6 +341,30 @@ webview.focus { | ||||
|   outline: 0 solid transparent; | ||||
| } | ||||
|  | ||||
| .webview-unsupported { | ||||
|   background: rgb(254 243 199); | ||||
|   border: 1px solid rgb(253 230 138); | ||||
|   color: rgb(69 26 3); | ||||
|   font-family: system-ui; | ||||
|   font-size: 14px; | ||||
|   display: flex; | ||||
| } | ||||
|  | ||||
| .webview-unsupported[hidden] { | ||||
|   display: none; | ||||
| } | ||||
|  | ||||
| .webview-unsupported-message { | ||||
|   padding: 0.3em; | ||||
|   flex: 1; | ||||
|   text-align: center; | ||||
| } | ||||
|  | ||||
| .webview-unsupported-dismiss { | ||||
|   padding: 0.3em; | ||||
|   cursor: pointer; | ||||
| } | ||||
|  | ||||
| /* Tooltip styling */ | ||||
|  | ||||
| #loading-tooltip, | ||||
|   | ||||
| @@ -1,3 +1,5 @@ | ||||
| @import url("@yaireo/tagify/dist/tagify.css"); | ||||
|  | ||||
| :host { | ||||
|   contain: strict; | ||||
|   display: flow-root; | ||||
| @@ -9,7 +11,12 @@ | ||||
|   background: rgb(239 239 239 / 100%); | ||||
|   letter-spacing: -0.08px; | ||||
|   line-height: 18px; | ||||
|   color: rgb(139 142 143 / 100%); | ||||
|   color: rgb(34 44 49 / 100%); | ||||
|  | ||||
|   /* Copied from https://github.com/yairEO/tagify/blob/v4.17.7/src/tagify.scss#L4-L8 */ | ||||
|   --tagify-dd-color-primary: rgb(53 149 246); | ||||
|   --tagify-dd-bg-color: rgb(255 255 255); | ||||
|   --tagify-dd-item-pad: 0.3em 0.5em; | ||||
| } | ||||
|  | ||||
| kbd { | ||||
| @@ -61,7 +68,7 @@ td:nth-child(odd) { | ||||
|   line-height: 1; | ||||
|   text-transform: none; | ||||
|   letter-spacing: normal; | ||||
|   word-wrap: normal; | ||||
|   overflow-wrap: normal; | ||||
|   white-space: nowrap; | ||||
|   direction: ltr; | ||||
|  | ||||
| @@ -94,7 +101,7 @@ td:nth-child(odd) { | ||||
|  | ||||
| .nav { | ||||
|   padding: 7px 0; | ||||
|   color: rgb(153 153 153 / 100%); | ||||
|   color: rgb(70 78 90 / 100%); | ||||
|   cursor: pointer; | ||||
| } | ||||
|  | ||||
| @@ -300,7 +307,9 @@ img.server-info-icon { | ||||
| } | ||||
|  | ||||
| .settings-card:hover { | ||||
|   box-shadow: 0 2px 5px 0 rgb(0 0 0 / 16%), 0 2px 0 0 rgb(0 0 0 / 12%); | ||||
|   box-shadow: | ||||
|     0 2px 5px 0 rgb(0 0 0 / 16%), | ||||
|     0 2px 0 0 rgb(0 0 0 / 12%); | ||||
| } | ||||
|  | ||||
| .hidden { | ||||
| @@ -475,10 +484,7 @@ input.toggle-round + label::after { | ||||
| input.toggle-round + label::before { | ||||
|   background-color: rgb(241 241 241 / 100%); | ||||
|   border-radius: 25px; | ||||
|   top: 0; | ||||
|   right: 0; | ||||
|   left: 0; | ||||
|   bottom: 0; | ||||
|   inset: 0; | ||||
| } | ||||
|  | ||||
| input.toggle-round + label::after { | ||||
| @@ -490,10 +496,7 @@ input.toggle-round + label::after { | ||||
|  | ||||
| input.toggle-round:checked + label::before { | ||||
|   background-color: rgb(78 191 172 / 100%); | ||||
|   top: 0; | ||||
|   right: 0; | ||||
|   left: 0; | ||||
|   bottom: 0; | ||||
|   inset: 0; | ||||
| } | ||||
|  | ||||
| input.toggle-round:checked + label::after { | ||||
| @@ -575,7 +578,6 @@ input.toggle-round:checked + label::after { | ||||
|   text-align: center; | ||||
|   color: rgb(255 255 255 / 100%); | ||||
|   background: rgb(78 191 172 / 100%); | ||||
|   border-color: none; | ||||
|   border: none; | ||||
|   width: 98%; | ||||
|   height: 46px; | ||||
| @@ -651,7 +653,7 @@ i.open-network-button { | ||||
| } | ||||
|  | ||||
| /* responsive grid */ | ||||
| @media (min-width: 500px) and (max-width: 720px) { | ||||
| @media (width >= 500px) and (width <= 720px) { | ||||
|   #new-server-container { | ||||
|     padding-left: 0; | ||||
|     width: 60vw; | ||||
| @@ -663,7 +665,7 @@ i.open-network-button { | ||||
|   } | ||||
| } | ||||
|  | ||||
| @media (max-width: 500px) { | ||||
| @media (width <= 500px) { | ||||
|   #new-server-container { | ||||
|     padding-left: 0; | ||||
|     width: 54%; | ||||
| @@ -674,7 +676,7 @@ i.open-network-button { | ||||
|   } | ||||
| } | ||||
|  | ||||
| @media (max-width: 650px) { | ||||
| @media (width <= 650px) { | ||||
|   .selected-css-path, | ||||
|   .download-folder-path { | ||||
|     margin-right: 15px; | ||||
| @@ -689,7 +691,7 @@ i.open-network-button { | ||||
|   } | ||||
| } | ||||
|  | ||||
| @media (max-width: 720px) { | ||||
| @media (width <= 720px) { | ||||
|   .modal-container { | ||||
|     width: 60vw; | ||||
|     padding: 40px; | ||||
| @@ -712,7 +714,7 @@ i.open-network-button { | ||||
|   } | ||||
| } | ||||
|  | ||||
| @media (max-width: 600px) { | ||||
| @media (width <= 600px) { | ||||
|   .divider { | ||||
|     margin-left: 4%; | ||||
|   } | ||||
| @@ -724,7 +726,7 @@ i.open-network-button { | ||||
|   } | ||||
| } | ||||
|  | ||||
| @media (max-width: 900px) { | ||||
| @media (width <= 900px) { | ||||
|   .settings-card { | ||||
|     flex-direction: column; | ||||
|     align-items: center; | ||||
| @@ -760,3 +762,9 @@ i.open-network-button { | ||||
|   top: 0; | ||||
|   bottom: 0; | ||||
| } | ||||
|  | ||||
| .settings-tagify-dropdown { | ||||
|   position: relative; | ||||
|   z-index: 9999; | ||||
|   height: 0; | ||||
| } | ||||
|   | ||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 22 KiB | 
							
								
								
									
										8
									
								
								app/renderer/img/ic_loading.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								app/renderer/img/ic_loading.svg
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin: auto; background: rgba(0, 0, 0, 0) none repeat scroll 0% 0%; display: block; shape-rendering: auto; animation-play-state: running; animation-delay: 0s;" width="150px" height="150px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"> | ||||
| <circle cx="50" cy="50" fill="none" stroke="#759ed4" stroke-width="10" r="42" stroke-dasharray="197.92033717615698 67.97344572538566" style="animation-play-state: running; animation-delay: 0s;"> | ||||
|   <animateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1s" values="0 50 50;360 50 50" keyTimes="0;1" style="animation-play-state: running; animation-delay: 0s;"></animateTransform> | ||||
| </circle> | ||||
| <!-- Created with loading.io (https://loading.io/spinner/rolling/-bar-circle-curve-round-rotate) --> | ||||
| <!-- "The Rolling spinner is released under loading.io free License." (https://loading.io/license/#free-license) --> | ||||
| </svg> | ||||
| After Width: | Height: | Size: 1018 B | 
| @@ -1,6 +1,4 @@ | ||||
| import {clipboard} from "electron/common"; | ||||
| import {Buffer} from "node:buffer"; | ||||
| import crypto from "node:crypto"; | ||||
| import {ipcRenderer} from "./typed-ipc-renderer.ts"; | ||||
|  | ||||
| // This helper is exposed via electron_bridge for use in the social | ||||
| // login flow. | ||||
| @@ -22,7 +20,7 @@ export type ClipboardDecrypter = { | ||||
|   pasted: Promise<string>; | ||||
| }; | ||||
|  | ||||
| export class ClipboardDecrypterImpl implements ClipboardDecrypter { | ||||
| export class ClipboardDecrypterImplementation implements ClipboardDecrypter { | ||||
|   version: number; | ||||
|   key: Uint8Array; | ||||
|   pasted: Promise<string>; | ||||
| @@ -30,15 +28,13 @@ export class ClipboardDecrypterImpl implements ClipboardDecrypter { | ||||
|   constructor(_: number) { | ||||
|     // At this time, the only version is 1. | ||||
|     this.version = 1; | ||||
|     this.key = crypto.randomBytes(32); | ||||
|     const {key, sig} = ipcRenderer.sendSync("new-clipboard-key"); | ||||
|     this.key = key; | ||||
|     this.pasted = new Promise((resolve) => { | ||||
|       let interval: NodeJS.Timeout | null = null; | ||||
|       const startPolling = () => { | ||||
|         if (interval === null) { | ||||
|           interval = setInterval(poll, 1000); | ||||
|         } | ||||
|  | ||||
|         poll(); | ||||
|         interval ??= setInterval(poll, 1000); | ||||
|         void poll(); | ||||
|       }; | ||||
|  | ||||
|       const stopPolling = () => { | ||||
| @@ -48,30 +44,9 @@ export class ClipboardDecrypterImpl implements ClipboardDecrypter { | ||||
|         } | ||||
|       }; | ||||
|  | ||||
|       const poll = () => { | ||||
|         let plaintext; | ||||
|  | ||||
|         try { | ||||
|           const data = Buffer.from(clipboard.readText(), "hex"); | ||||
|           const iv = data.slice(0, 12); | ||||
|           const ciphertext = data.slice(12, -16); | ||||
|           const authTag = data.slice(-16); | ||||
|           const decipher = crypto.createDecipheriv( | ||||
|             "aes-256-gcm", | ||||
|             this.key, | ||||
|             iv, | ||||
|             {authTagLength: 16}, | ||||
|           ); | ||||
|           decipher.setAuthTag(authTag); | ||||
|           plaintext = | ||||
|             decipher.update(ciphertext, undefined, "utf8") + | ||||
|             decipher.final("utf8"); | ||||
|         } catch { | ||||
|           // If the parsing or decryption failed in any way, | ||||
|           // the correct token hasn’t been copied yet; try | ||||
|           // again next time. | ||||
|           return; | ||||
|         } | ||||
|       const poll = async () => { | ||||
|         const plaintext = await ipcRenderer.invoke("poll-clipboard", key, sig); | ||||
|         if (plaintext === undefined) return; | ||||
|  | ||||
|         window.removeEventListener("focus", startPolling); | ||||
|         window.removeEventListener("blur", stopPolling); | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import type {Html} from "../../../common/html.js"; | ||||
| import type {Html} from "../../../common/html.ts"; | ||||
|  | ||||
| export function generateNodeFromHtml(html: Html): Element { | ||||
|   const wrapper = document.createElement("div"); | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import {clipboard} from "electron/common"; | ||||
| import {type Event, clipboard} from "electron/common"; | ||||
| import type {WebContents} from "electron/main"; | ||||
| import type { | ||||
|   ContextMenuParams, | ||||
| @@ -6,18 +6,18 @@ import type { | ||||
| } from "electron/renderer"; | ||||
| import process from "node:process"; | ||||
|  | ||||
| import {Menu} from "@electron/remote"; | ||||
| import {BrowserWindow, Menu} from "@electron/remote"; | ||||
|  | ||||
| import * as t from "../../../common/translation-util.js"; | ||||
| import * as t from "../../../common/translation-util.ts"; | ||||
|  | ||||
| export const contextMenu = ( | ||||
|   webContents: WebContents, | ||||
|   event: Event, | ||||
|   props: ContextMenuParams, | ||||
|   properties: ContextMenuParams, | ||||
| ) => { | ||||
|   const isText = props.selectionText !== ""; | ||||
|   const isLink = props.linkURL !== ""; | ||||
|   const linkUrl = isLink ? new URL(props.linkURL) : undefined; | ||||
|   const isText = properties.selectionText !== ""; | ||||
|   const isLink = properties.linkURL !== ""; | ||||
|   const linkUrl = isLink ? new URL(properties.linkURL) : undefined; | ||||
|  | ||||
|   const makeSuggestion = (suggestion: string) => ({ | ||||
|     label: suggestion, | ||||
| @@ -30,19 +30,21 @@ export const contextMenu = ( | ||||
|   let menuTemplate: MenuItemConstructorOptions[] = [ | ||||
|     { | ||||
|       label: t.__("Add to Dictionary"), | ||||
|       visible: props.isEditable && isText && props.misspelledWord.length > 0, | ||||
|       visible: | ||||
|         properties.isEditable && isText && properties.misspelledWord.length > 0, | ||||
|       click(_item) { | ||||
|         webContents.session.addWordToSpellCheckerDictionary( | ||||
|           props.misspelledWord, | ||||
|           properties.misspelledWord, | ||||
|         ); | ||||
|       }, | ||||
|     }, | ||||
|     { | ||||
|       type: "separator", | ||||
|       visible: props.isEditable && isText && props.misspelledWord.length > 0, | ||||
|       visible: | ||||
|         properties.isEditable && isText && properties.misspelledWord.length > 0, | ||||
|     }, | ||||
|     { | ||||
|       label: `${t.__("Look Up")} "${props.selectionText}"`, | ||||
|       label: `${t.__("Look Up")} "${properties.selectionText}"`, | ||||
|       visible: process.platform === "darwin" && isText, | ||||
|       click(_item) { | ||||
|         webContents.showDefinitionForSelection(); | ||||
| @@ -55,7 +57,7 @@ export const contextMenu = ( | ||||
|     { | ||||
|       label: t.__("Cut"), | ||||
|       visible: isText, | ||||
|       enabled: props.isEditable, | ||||
|       enabled: properties.isEditable, | ||||
|       accelerator: "CommandOrControl+X", | ||||
|       click(_item) { | ||||
|         webContents.cut(); | ||||
| @@ -64,7 +66,7 @@ export const contextMenu = ( | ||||
|     { | ||||
|       label: t.__("Copy"), | ||||
|       accelerator: "CommandOrControl+C", | ||||
|       enabled: props.editFlags.canCopy, | ||||
|       enabled: properties.editFlags.canCopy, | ||||
|       click(_item) { | ||||
|         webContents.copy(); | ||||
|       }, | ||||
| @@ -72,7 +74,7 @@ export const contextMenu = ( | ||||
|     { | ||||
|       label: t.__("Paste"), // Bug: Paste replaces text | ||||
|       accelerator: "CommandOrControl+V", | ||||
|       enabled: props.isEditable, | ||||
|       enabled: properties.isEditable, | ||||
|       click() { | ||||
|         webContents.paste(); | ||||
|       }, | ||||
| @@ -88,44 +90,37 @@ export const contextMenu = ( | ||||
|       visible: isLink, | ||||
|       click(_item) { | ||||
|         clipboard.write({ | ||||
|           bookmark: props.linkText, | ||||
|           bookmark: properties.linkText, | ||||
|           text: | ||||
|             linkUrl?.protocol === "mailto:" ? linkUrl.pathname : props.linkURL, | ||||
|             linkUrl?.protocol === "mailto:" | ||||
|               ? linkUrl.pathname | ||||
|               : properties.linkURL, | ||||
|         }); | ||||
|       }, | ||||
|     }, | ||||
|     { | ||||
|       label: t.__("Copy Image"), | ||||
|       visible: props.mediaType === "image", | ||||
|       visible: properties.mediaType === "image", | ||||
|       click(_item) { | ||||
|         webContents.copyImageAt(props.x, props.y); | ||||
|         webContents.copyImageAt(properties.x, properties.y); | ||||
|       }, | ||||
|     }, | ||||
|     { | ||||
|       label: t.__("Copy Image URL"), | ||||
|       visible: props.mediaType === "image", | ||||
|       visible: properties.mediaType === "image", | ||||
|       click(_item) { | ||||
|         clipboard.write({ | ||||
|           bookmark: props.srcURL, | ||||
|           text: props.srcURL, | ||||
|           bookmark: properties.srcURL, | ||||
|           text: properties.srcURL, | ||||
|         }); | ||||
|       }, | ||||
|     }, | ||||
|     { | ||||
|       type: "separator", | ||||
|       visible: isLink || props.mediaType === "image", | ||||
|     }, | ||||
|     { | ||||
|       label: t.__("Services"), | ||||
|       visible: process.platform === "darwin", | ||||
|       role: "services", | ||||
|     }, | ||||
|   ]; | ||||
|  | ||||
|   if (props.misspelledWord) { | ||||
|     if (props.dictionarySuggestions.length > 0) { | ||||
|   if (properties.misspelledWord) { | ||||
|     if (properties.dictionarySuggestions.length > 0) { | ||||
|       const suggestions: MenuItemConstructorOptions[] = | ||||
|         props.dictionarySuggestions.map((suggestion: string) => | ||||
|         properties.dictionarySuggestions.map((suggestion: string) => | ||||
|           makeSuggestion(suggestion), | ||||
|         ); | ||||
|       menuTemplate = [...suggestions, ...menuTemplate]; | ||||
| @@ -137,7 +132,7 @@ export const contextMenu = ( | ||||
|     } | ||||
|   } | ||||
|   // Hide the invisible separators on Linux and Windows | ||||
|   // Electron has a bug which ignores visible: false parameter for separator menuitems. So we remove them here. | ||||
|   // Electron has a bug which ignores visible: false parameter for separator menu items. So we remove them here. | ||||
|   // https://github.com/electron/electron/issues/5869 | ||||
|   // https://github.com/electron/electron/issues/6906 | ||||
|  | ||||
| @@ -145,5 +140,11 @@ export const contextMenu = ( | ||||
|     (menuItem) => menuItem.visible ?? true, | ||||
|   ); | ||||
|   const menu = Menu.buildFromTemplate(filteredMenuTemplate); | ||||
|   menu.popup(); | ||||
|   menu.popup({ | ||||
|     window: BrowserWindow.fromWebContents(webContents) ?? undefined, | ||||
|     frame: properties.frame ?? undefined, | ||||
|     x: properties.x, | ||||
|     y: properties.y, | ||||
|     sourceType: properties.menuSourceType, | ||||
|   }); | ||||
| }; | ||||
|   | ||||
| @@ -1,26 +1,26 @@ | ||||
| import type {Html} from "../../../common/html.js"; | ||||
| import {html} from "../../../common/html.js"; | ||||
| import {type Html, html} from "../../../common/html.ts"; | ||||
| import type {TabPage} from "../../../common/types.ts"; | ||||
|  | ||||
| import {generateNodeFromHtml} from "./base.js"; | ||||
| import type {TabProps} from "./tab.js"; | ||||
| import Tab from "./tab.js"; | ||||
| import {generateNodeFromHtml} from "./base.ts"; | ||||
| import Tab, {type TabProperties} from "./tab.ts"; | ||||
|  | ||||
| export type FunctionalTabProps = { | ||||
| export type FunctionalTabProperties = { | ||||
|   $view: Element; | ||||
| } & TabProps; | ||||
|   page: TabPage; | ||||
| } & TabProperties; | ||||
|  | ||||
| export default class FunctionalTab extends Tab { | ||||
|   $view: Element; | ||||
|   $el: Element; | ||||
|   $closeButton?: Element; | ||||
|  | ||||
|   constructor({$view, ...props}: FunctionalTabProps) { | ||||
|     super(props); | ||||
|   constructor({$view, ...properties}: FunctionalTabProperties) { | ||||
|     super(properties); | ||||
|  | ||||
|     this.$view = $view; | ||||
|     this.$el = generateNodeFromHtml(this.templateHtml()); | ||||
|     if (this.props.name !== "Settings") { | ||||
|       this.props.$root.append(this.$el); | ||||
|     if (properties.page !== "Settings") { | ||||
|       this.properties.$root.append(this.$el); | ||||
|       this.$closeButton = this.$el.querySelector(".server-tab-badge")!; | ||||
|       this.registerListeners(); | ||||
|     } | ||||
| @@ -43,12 +43,12 @@ export default class FunctionalTab extends Tab { | ||||
|  | ||||
|   templateHtml(): Html { | ||||
|     return html` | ||||
|       <div class="tab functional-tab" data-tab-id="${this.props.tabIndex}"> | ||||
|       <div class="tab functional-tab" data-tab-id="${this.properties.tabIndex}"> | ||||
|         <div class="server-tab-badge close-button"> | ||||
|           <i class="material-icons">close</i> | ||||
|         </div> | ||||
|         <div class="server-tab"> | ||||
|           <i class="material-icons">${this.props.materialIcon}</i> | ||||
|           <i class="material-icons">${this.properties.materialIcon}</i> | ||||
|         </div> | ||||
|       </div> | ||||
|     `; | ||||
| @@ -65,8 +65,8 @@ export default class FunctionalTab extends Tab { | ||||
|       this.$closeButton?.classList.remove("active"); | ||||
|     }); | ||||
|  | ||||
|     this.$closeButton?.addEventListener("click", (event: Event) => { | ||||
|       this.props.onDestroy?.(); | ||||
|     this.$closeButton?.addEventListener("click", (event) => { | ||||
|       this.properties.onDestroy?.(); | ||||
|       event.stopPropagation(); | ||||
|     }); | ||||
|   } | ||||
|   | ||||
| @@ -1,30 +1,32 @@ | ||||
| import process from "node:process"; | ||||
|  | ||||
| import type {Html} from "../../../common/html.js"; | ||||
| import {html} from "../../../common/html.js"; | ||||
| import {ipcRenderer} from "../typed-ipc-renderer.js"; | ||||
| import {type Html, html} from "../../../common/html.ts"; | ||||
| import {ipcRenderer} from "../typed-ipc-renderer.ts"; | ||||
|  | ||||
| import {generateNodeFromHtml} from "./base.js"; | ||||
| import type {TabProps} from "./tab.js"; | ||||
| import Tab from "./tab.js"; | ||||
| import type WebView from "./webview.js"; | ||||
| import {generateNodeFromHtml} from "./base.ts"; | ||||
| import Tab, {type TabProperties} from "./tab.ts"; | ||||
| import type WebView from "./webview.ts"; | ||||
|  | ||||
| export type ServerTabProps = { | ||||
| export type ServerTabProperties = { | ||||
|   webview: Promise<WebView>; | ||||
| } & TabProps; | ||||
| } & TabProperties; | ||||
|  | ||||
| export default class ServerTab extends Tab { | ||||
|   webview: Promise<WebView>; | ||||
|   $el: Element; | ||||
|   $name: Element; | ||||
|   $icon: HTMLImageElement; | ||||
|   $badge: Element; | ||||
|  | ||||
|   constructor({webview, ...props}: ServerTabProps) { | ||||
|     super(props); | ||||
|   constructor({webview, ...properties}: ServerTabProperties) { | ||||
|     super(properties); | ||||
|  | ||||
|     this.webview = webview; | ||||
|     this.$el = generateNodeFromHtml(this.templateHtml()); | ||||
|     this.props.$root.append(this.$el); | ||||
|     this.properties.$root.append(this.$el); | ||||
|     this.registerListeners(); | ||||
|     this.$name = this.$el.querySelector(".server-tooltip")!; | ||||
|     this.$icon = this.$el.querySelector(".server-icons")!; | ||||
|     this.$badge = this.$el.querySelector(".server-tab-badge")!; | ||||
|   } | ||||
|  | ||||
| @@ -40,24 +42,34 @@ export default class ServerTab extends Tab { | ||||
|  | ||||
|   override async destroy(): Promise<void> { | ||||
|     await super.destroy(); | ||||
|     (await this.webview).$el.remove(); | ||||
|     (await this.webview).destroy(); | ||||
|   } | ||||
|  | ||||
|   templateHtml(): Html { | ||||
|     return html` | ||||
|       <div class="tab" data-tab-id="${this.props.tabIndex}"> | ||||
|       <div class="tab" data-tab-id="${this.properties.tabIndex}"> | ||||
|         <div class="server-tooltip" style="display:none"> | ||||
|           ${this.props.name} | ||||
|           ${this.properties.label} | ||||
|         </div> | ||||
|         <div class="server-tab-badge"></div> | ||||
|         <div class="server-tab"> | ||||
|           <img class="server-icons" src="${this.props.icon}" /> | ||||
|           <img class="server-icons" src="${this.properties.icon}" /> | ||||
|         </div> | ||||
|         <div class="server-tab-shortcut">${this.generateShortcutText()}</div> | ||||
|       </div> | ||||
|     `; | ||||
|   } | ||||
|  | ||||
|   setLabel(label: string): void { | ||||
|     this.properties.label = label; | ||||
|     this.$name.textContent = label; | ||||
|   } | ||||
|  | ||||
|   setIcon(icon: string): void { | ||||
|     this.properties.icon = icon; | ||||
|     this.$icon.src = icon; | ||||
|   } | ||||
|  | ||||
|   updateBadge(count: number): void { | ||||
|     this.$badge.textContent = count > 999 ? "1K+" : count.toString(); | ||||
|     this.$badge.classList.toggle("active", count > 0); | ||||
| @@ -65,11 +77,11 @@ export default class ServerTab extends Tab { | ||||
|  | ||||
|   generateShortcutText(): string { | ||||
|     // Only provide shortcuts for server [0..9] | ||||
|     if (this.props.index >= 9) { | ||||
|     if (this.properties.index >= 9) { | ||||
|       return ""; | ||||
|     } | ||||
|  | ||||
|     const shownIndex = this.props.index + 1; | ||||
|     const shownIndex = this.properties.index + 1; | ||||
|  | ||||
|     // Array index == Shown index - 1 | ||||
|     ipcRenderer.send("switch-server-tab", shownIndex - 1); | ||||
|   | ||||
| @@ -1,9 +1,10 @@ | ||||
| import type {TabRole} from "../../../common/types.js"; | ||||
| import type {TabPage, TabRole} from "../../../common/types.ts"; | ||||
|  | ||||
| export type TabProps = { | ||||
| export type TabProperties = { | ||||
|   role: TabRole; | ||||
|   page?: TabPage; | ||||
|   icon?: string; | ||||
|   name: string; | ||||
|   label: string; | ||||
|   $root: Element; | ||||
|   onClick: () => void; | ||||
|   index: number; | ||||
| @@ -17,17 +18,17 @@ export type TabProps = { | ||||
| export default abstract class Tab { | ||||
|   abstract $el: Element; | ||||
|  | ||||
|   constructor(readonly props: TabProps) {} | ||||
|   constructor(readonly properties: TabProperties) {} | ||||
|  | ||||
|   registerListeners(): void { | ||||
|     this.$el.addEventListener("click", this.props.onClick); | ||||
|     this.$el.addEventListener("click", this.properties.onClick); | ||||
|  | ||||
|     if (this.props.onHover !== undefined) { | ||||
|       this.$el.addEventListener("mouseover", this.props.onHover); | ||||
|     if (this.properties.onHover !== undefined) { | ||||
|       this.$el.addEventListener("mouseover", this.properties.onHover); | ||||
|     } | ||||
|  | ||||
|     if (this.props.onHoverOut !== undefined) { | ||||
|       this.$el.addEventListener("mouseout", this.props.onHoverOut); | ||||
|     if (this.properties.onHoverOut !== undefined) { | ||||
|       this.$el.addEventListener("mouseout", this.properties.onHoverOut); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -1,25 +1,24 @@ | ||||
| import type {WebContents} from "electron/main"; | ||||
| import fs from "node:fs"; | ||||
| import path from "node:path"; | ||||
| import process from "node:process"; | ||||
|  | ||||
| import * as remote from "@electron/remote"; | ||||
| import {app, dialog} from "@electron/remote"; | ||||
|  | ||||
| import * as ConfigUtil from "../../../common/config-util.js"; | ||||
| import type {Html} from "../../../common/html.js"; | ||||
| import {html} from "../../../common/html.js"; | ||||
| import type {RendererMessage} from "../../../common/typed-ipc.js"; | ||||
| import type {TabRole} from "../../../common/types.js"; | ||||
| import {ipcRenderer} from "../typed-ipc-renderer.js"; | ||||
| import * as SystemUtil from "../utils/system-util.js"; | ||||
| import * as ConfigUtil from "../../../common/config-util.ts"; | ||||
| import {type Html, html} from "../../../common/html.ts"; | ||||
| import * as t from "../../../common/translation-util.ts"; | ||||
| import type {RendererMessage} from "../../../common/typed-ipc.ts"; | ||||
| import type {TabRole} from "../../../common/types.ts"; | ||||
| import preloadCss from "../../css/preload.css?raw"; | ||||
| import {ipcRenderer} from "../typed-ipc-renderer.ts"; | ||||
| import * as SystemUtil from "../utils/system-util.ts"; | ||||
|  | ||||
| import {generateNodeFromHtml} from "./base.js"; | ||||
| import {contextMenu} from "./context-menu.js"; | ||||
| import {generateNodeFromHtml} from "./base.ts"; | ||||
| import {contextMenu} from "./context-menu.ts"; | ||||
|  | ||||
| const shouldSilentWebview = ConfigUtil.getConfigItem("silent", false); | ||||
|  | ||||
| type WebViewProps = { | ||||
| type WebViewProperties = { | ||||
|   $root: Element; | ||||
|   rootWebContents: WebContents; | ||||
|   index: number; | ||||
| @@ -32,35 +31,46 @@ type WebViewProps = { | ||||
|   preload?: string; | ||||
|   onTitleChange: () => void; | ||||
|   hasPermission?: (origin: string, permission: string) => boolean; | ||||
|   unsupportedMessage?: string; | ||||
| }; | ||||
|  | ||||
| export default class WebView { | ||||
|   static templateHtml(props: WebViewProps): Html { | ||||
|   static templateHtml(properties: WebViewProperties): Html { | ||||
|     return html` | ||||
|       <webview | ||||
|         data-tab-id="${props.tabIndex}" | ||||
|         src="${props.url}" | ||||
|         ${props.preload === undefined | ||||
|           ? html`` | ||||
|           : html`preload="${props.preload}" webpreferences="sandbox=no"`} | ||||
|         partition="persist:webviewsession" | ||||
|         allowpopups | ||||
|       > | ||||
|       </webview> | ||||
|       <div class="webview-pane"> | ||||
|         <div | ||||
|           class="webview-unsupported" | ||||
|           ${properties.unsupportedMessage === undefined ? html`hidden` : html``} | ||||
|         > | ||||
|           <span class="webview-unsupported-message" | ||||
|             >${properties.unsupportedMessage ?? ""}</span | ||||
|           > | ||||
|           <span class="webview-unsupported-dismiss">×</span> | ||||
|         </div> | ||||
|         <webview | ||||
|           data-tab-id="${properties.tabIndex}" | ||||
|           src="${properties.url}" | ||||
|           ${properties.preload === undefined | ||||
|             ? html`` | ||||
|             : html`preload="${properties.preload}"`} | ||||
|           partition="persist:webviewsession" | ||||
|           allowpopups | ||||
|         > | ||||
|         </webview> | ||||
|       </div> | ||||
|     `; | ||||
|   } | ||||
|  | ||||
|   static async create(props: WebViewProps): Promise<WebView> { | ||||
|     const $element = generateNodeFromHtml( | ||||
|       WebView.templateHtml(props), | ||||
|   static async create(properties: WebViewProperties): Promise<WebView> { | ||||
|     const $pane = generateNodeFromHtml( | ||||
|       WebView.templateHtml(properties), | ||||
|     ) as HTMLElement; | ||||
|     props.$root.append($element); | ||||
|     properties.$root.append($pane); | ||||
|  | ||||
|     // Wait for did-navigate rather than did-attach to work around | ||||
|     // https://github.com/electron/electron/issues/31918 | ||||
|     const $webview: HTMLElement = $pane.querySelector(":scope > webview")!; | ||||
|     await new Promise<void>((resolve) => { | ||||
|       $element.addEventListener( | ||||
|         "did-navigate", | ||||
|       $webview.addEventListener( | ||||
|         "did-attach", | ||||
|         () => { | ||||
|           resolve(); | ||||
|         }, | ||||
| @@ -79,50 +89,147 @@ export default class WebView { | ||||
|     } | ||||
|  | ||||
|     const selector = `webview[data-tab-id="${CSS.escape( | ||||
|       `${props.tabIndex}`, | ||||
|       `${properties.tabIndex}`, | ||||
|     )}"]`; | ||||
|     const webContentsId: unknown = | ||||
|       await props.rootWebContents.executeJavaScript( | ||||
|       await properties.rootWebContents.executeJavaScript( | ||||
|         `(${getWebContentsIdFunction.toString()})(${JSON.stringify(selector)})`, | ||||
|       ); | ||||
|     if (typeof webContentsId !== "number") { | ||||
|       throw new TypeError("Failed to get WebContents ID"); | ||||
|     } | ||||
|  | ||||
|     return new WebView(props, $element, webContentsId); | ||||
|     return new WebView(properties, $pane, $webview, webContentsId); | ||||
|   } | ||||
|  | ||||
|   zoomFactor: number; | ||||
|   badgeCount: number; | ||||
|   loading: boolean; | ||||
|   customCss: string | false | null; | ||||
|   $webviewsContainer: DOMTokenList; | ||||
|   $el: HTMLElement; | ||||
|   webContentsId: number; | ||||
|   badgeCount = 0; | ||||
|   loading = true; | ||||
|   private customCss: string | false | null; | ||||
|   private readonly $webviewsContainer: DOMTokenList; | ||||
|   private readonly $unsupported: HTMLElement; | ||||
|   private readonly $unsupportedMessage: HTMLElement; | ||||
|   private readonly $unsupportedDismiss: HTMLElement; | ||||
|   private unsupportedDismissed = false; | ||||
|  | ||||
|   private constructor( | ||||
|     readonly props: WebViewProps, | ||||
|     $element: HTMLElement, | ||||
|     webContentsId: number, | ||||
|     readonly properties: WebViewProperties, | ||||
|     private readonly $pane: HTMLElement, | ||||
|     private readonly $webview: HTMLElement, | ||||
|     readonly webContentsId: number, | ||||
|   ) { | ||||
|     this.zoomFactor = 1; | ||||
|     this.loading = true; | ||||
|     this.badgeCount = 0; | ||||
|     this.customCss = ConfigUtil.getConfigItem("customCSS", null); | ||||
|     this.$webviewsContainer = document.querySelector( | ||||
|       "#webviews-container", | ||||
|     )!.classList; | ||||
|     this.$el = $element; | ||||
|     this.webContentsId = webContentsId; | ||||
|     this.$unsupported = $pane.querySelector(".webview-unsupported")!; | ||||
|     this.$unsupportedMessage = $pane.querySelector( | ||||
|       ".webview-unsupported-message", | ||||
|     )!; | ||||
|     this.$unsupportedDismiss = $pane.querySelector( | ||||
|       ".webview-unsupported-dismiss", | ||||
|     )!; | ||||
|  | ||||
|     this.registerListeners(); | ||||
|   } | ||||
|  | ||||
|   getWebContents(): WebContents { | ||||
|     return remote.webContents.fromId(this.webContentsId); | ||||
|   destroy(): void { | ||||
|     this.$pane.remove(); | ||||
|   } | ||||
|  | ||||
|   registerListeners(): void { | ||||
|   getWebContents(): WebContents { | ||||
|     return remote.webContents.fromId(this.webContentsId)!; | ||||
|   } | ||||
|  | ||||
|   showNotificationSettings(): void { | ||||
|     this.send("show-notification-settings"); | ||||
|     this.focus(); | ||||
|   } | ||||
|  | ||||
|   focus(): void { | ||||
|     this.$webview.focus(); | ||||
|     // Work around https://github.com/electron/electron/issues/31918 | ||||
|     this.$webview.shadowRoot?.querySelector("iframe")?.focus(); | ||||
|   } | ||||
|  | ||||
|   hide(): void { | ||||
|     this.$pane.classList.remove("active"); | ||||
|   } | ||||
|  | ||||
|   load(): void { | ||||
|     this.show(); | ||||
|   } | ||||
|  | ||||
|   zoomIn(): void { | ||||
|     this.getWebContents().zoomLevel += 0.5; | ||||
|   } | ||||
|  | ||||
|   zoomOut(): void { | ||||
|     this.getWebContents().zoomLevel -= 0.5; | ||||
|   } | ||||
|  | ||||
|   zoomActualSize(): void { | ||||
|     this.getWebContents().zoomLevel = 0; | ||||
|   } | ||||
|  | ||||
|   logOut(): void { | ||||
|     this.send("logout"); | ||||
|   } | ||||
|  | ||||
|   showKeyboardShortcuts(): void { | ||||
|     this.send("show-keyboard-shortcuts"); | ||||
|     this.focus(); | ||||
|   } | ||||
|  | ||||
|   openDevTools(): void { | ||||
|     this.getWebContents().openDevTools(); | ||||
|   } | ||||
|  | ||||
|   back(): void { | ||||
|     if (this.getWebContents().navigationHistory.canGoBack()) { | ||||
|       this.getWebContents().navigationHistory.goBack(); | ||||
|       this.focus(); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   canGoBackButton(): void { | ||||
|     const $backButton = document.querySelector( | ||||
|       "#actions-container #back-action", | ||||
|     )!; | ||||
|     $backButton.classList.toggle( | ||||
|       "disable", | ||||
|       !this.getWebContents().navigationHistory.canGoBack(), | ||||
|     ); | ||||
|   } | ||||
|  | ||||
|   forward(): void { | ||||
|     if (this.getWebContents().navigationHistory.canGoForward()) { | ||||
|       this.getWebContents().navigationHistory.goForward(); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   reload(): void { | ||||
|     this.hide(); | ||||
|     // Shows the loading indicator till the webview is reloaded | ||||
|     this.$webviewsContainer.remove("loaded"); | ||||
|     this.loading = true; | ||||
|     this.properties.switchLoading(true, this.properties.url); | ||||
|     this.getWebContents().reload(); | ||||
|   } | ||||
|  | ||||
|   setUnsupportedMessage(unsupportedMessage: string | undefined) { | ||||
|     this.$unsupported.hidden = | ||||
|       unsupportedMessage === undefined || this.unsupportedDismissed; | ||||
|     this.$unsupportedMessage.textContent = unsupportedMessage ?? ""; | ||||
|   } | ||||
|  | ||||
|   send<Channel extends keyof RendererMessage>( | ||||
|     channel: Channel, | ||||
|     ...arguments_: Parameters<RendererMessage[Channel]> | ||||
|   ): void { | ||||
|     ipcRenderer.send("forward-to", this.webContentsId, channel, ...arguments_); | ||||
|   } | ||||
|  | ||||
|   private registerListeners(): void { | ||||
|     const webContents = this.getWebContents(); | ||||
|  | ||||
|     if (shouldSilentWebview) { | ||||
| @@ -131,24 +238,21 @@ export default class WebView { | ||||
|  | ||||
|     webContents.on("page-title-updated", (_event, title) => { | ||||
|       this.badgeCount = this.getBadgeCount(title); | ||||
|       this.props.onTitleChange(); | ||||
|       this.properties.onTitleChange(); | ||||
|     }); | ||||
|  | ||||
|     this.$el.addEventListener("did-navigate-in-page", () => { | ||||
|     this.$webview.addEventListener("did-navigate-in-page", () => { | ||||
|       this.canGoBackButton(); | ||||
|     }); | ||||
|  | ||||
|     this.$el.addEventListener("did-navigate", () => { | ||||
|     this.$webview.addEventListener("did-navigate", () => { | ||||
|       this.canGoBackButton(); | ||||
|     }); | ||||
|  | ||||
|     webContents.on("page-favicon-updated", (_event, favicons) => { | ||||
|       // This returns a string of favicons URL. If there is a PM counts in unread messages then the URL would be like | ||||
|       // https://chat.zulip.org/static/images/favicon/favicon-pms.png | ||||
|       if ( | ||||
|         favicons[0].indexOf("favicon-pms") > 0 && | ||||
|         process.platform === "darwin" | ||||
|       ) { | ||||
|       if (favicons[0].indexOf("favicon-pms") > 0 && app.dock !== undefined) { | ||||
|         // This api is only supported on macOS | ||||
|         app.dock.setBadge("●"); | ||||
|         // Bounce the dock | ||||
| @@ -162,9 +266,9 @@ export default class WebView { | ||||
|       contextMenu(webContents, event, menuParameters); | ||||
|     }); | ||||
|  | ||||
|     this.$el.addEventListener("dom-ready", () => { | ||||
|     this.$webview.addEventListener("dom-ready", () => { | ||||
|       this.loading = false; | ||||
|       this.props.switchLoading(false, this.props.url); | ||||
|       this.properties.switchLoading(false, this.properties.url); | ||||
|       this.show(); | ||||
|     }); | ||||
|  | ||||
| @@ -173,47 +277,50 @@ export default class WebView { | ||||
|         SystemUtil.connectivityError.includes(errorDescription); | ||||
|       if (hasConnectivityError) { | ||||
|         console.error("error", errorDescription); | ||||
|         if (!this.props.url.includes("network.html")) { | ||||
|           this.props.onNetworkError(this.props.index); | ||||
|         if (!this.properties.url.includes("network.html")) { | ||||
|           this.properties.onNetworkError(this.properties.index); | ||||
|         } | ||||
|       } | ||||
|     }); | ||||
|  | ||||
|     this.$el.addEventListener("did-start-loading", () => { | ||||
|       this.props.switchLoading(true, this.props.url); | ||||
|     this.$webview.addEventListener("did-start-loading", () => { | ||||
|       this.properties.switchLoading(true, this.properties.url); | ||||
|     }); | ||||
|  | ||||
|     this.$el.addEventListener("did-stop-loading", () => { | ||||
|       this.props.switchLoading(false, this.props.url); | ||||
|     this.$webview.addEventListener("did-stop-loading", () => { | ||||
|       this.properties.switchLoading(false, this.properties.url); | ||||
|     }); | ||||
|  | ||||
|     this.$unsupportedDismiss.addEventListener("click", () => { | ||||
|       this.unsupportedDismissed = true; | ||||
|       this.$unsupported.hidden = true; | ||||
|     }); | ||||
|  | ||||
|     webContents.on("zoom-changed", (event, zoomDirection) => { | ||||
|       if (zoomDirection === "in") this.zoomIn(); | ||||
|       else if (zoomDirection === "out") this.zoomOut(); | ||||
|     }); | ||||
|   } | ||||
|  | ||||
|   getBadgeCount(title: string): number { | ||||
|   private getBadgeCount(title: string): number { | ||||
|     const messageCountInTitle = /^\((\d+)\)/.exec(title); | ||||
|     return messageCountInTitle ? Number(messageCountInTitle[1]) : 0; | ||||
|   } | ||||
|  | ||||
|   showNotificationSettings(): void { | ||||
|     this.send("show-notification-settings"); | ||||
|   } | ||||
|  | ||||
|   show(): void { | ||||
|   private show(): void { | ||||
|     // Do not show WebView if another tab was selected and this tab should be in background. | ||||
|     if (!this.props.isActive()) { | ||||
|     if (!this.properties.isActive()) { | ||||
|       return; | ||||
|     } | ||||
|  | ||||
|     // To show or hide the loading indicator in the the active tab | ||||
|     // To show or hide the loading indicator in the active tab | ||||
|     this.$webviewsContainer.toggle("loaded", !this.loading); | ||||
|  | ||||
|     this.$el.classList.add("active"); | ||||
|     this.$pane.classList.add("active"); | ||||
|     this.focus(); | ||||
|     this.props.onTitleChange(); | ||||
|     this.properties.onTitleChange(); | ||||
|     // Injecting preload css in webview to override some css rules | ||||
|     (async () => | ||||
|       this.getWebContents().insertCSS( | ||||
|         fs.readFileSync(path.join(__dirname, "/../../css/preload.css"), "utf8"), | ||||
|       ))(); | ||||
|     (async () => this.getWebContents().insertCSS(preloadCss))(); | ||||
|  | ||||
|     // Get customCSS again from config util to avoid warning user again | ||||
|     const customCss = ConfigUtil.getConfigItem("customCSS", null); | ||||
| @@ -223,92 +330,13 @@ export default class WebView { | ||||
|         this.customCss = null; | ||||
|         ConfigUtil.setConfigItem("customCSS", null); | ||||
|  | ||||
|         const errorMessage = "The custom css previously set is deleted!"; | ||||
|         dialog.showErrorBox("custom css file deleted!", errorMessage); | ||||
|         const errorMessage = t.__("The custom CSS previously set is deleted."); | ||||
|         dialog.showErrorBox(t.__("Custom CSS file deleted"), errorMessage); | ||||
|         return; | ||||
|       } | ||||
|  | ||||
|       (async () => | ||||
|         this.getWebContents().insertCSS( | ||||
|           fs.readFileSync(path.resolve(__dirname, customCss), "utf8"), | ||||
|         ))(); | ||||
|         this.getWebContents().insertCSS(fs.readFileSync(customCss, "utf8")))(); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   focus(): void { | ||||
|     this.$el.focus(); | ||||
|     // Work around https://github.com/electron/electron/issues/31918 | ||||
|     this.$el.shadowRoot?.querySelector("iframe")?.focus(); | ||||
|   } | ||||
|  | ||||
|   hide(): void { | ||||
|     this.$el.classList.remove("active"); | ||||
|   } | ||||
|  | ||||
|   load(): void { | ||||
|     this.show(); | ||||
|   } | ||||
|  | ||||
|   zoomIn(): void { | ||||
|     this.zoomFactor += 0.1; | ||||
|     this.getWebContents().setZoomFactor(this.zoomFactor); | ||||
|   } | ||||
|  | ||||
|   zoomOut(): void { | ||||
|     this.zoomFactor -= 0.1; | ||||
|     this.getWebContents().setZoomFactor(this.zoomFactor); | ||||
|   } | ||||
|  | ||||
|   zoomActualSize(): void { | ||||
|     this.zoomFactor = 1; | ||||
|     this.getWebContents().setZoomFactor(this.zoomFactor); | ||||
|   } | ||||
|  | ||||
|   logOut(): void { | ||||
|     this.send("logout"); | ||||
|   } | ||||
|  | ||||
|   showKeyboardShortcuts(): void { | ||||
|     this.send("show-keyboard-shortcuts"); | ||||
|   } | ||||
|  | ||||
|   openDevTools(): void { | ||||
|     this.getWebContents().openDevTools(); | ||||
|   } | ||||
|  | ||||
|   back(): void { | ||||
|     if (this.getWebContents().canGoBack()) { | ||||
|       this.getWebContents().goBack(); | ||||
|       this.focus(); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   canGoBackButton(): void { | ||||
|     const $backButton = document.querySelector( | ||||
|       "#actions-container #back-action", | ||||
|     )!; | ||||
|     $backButton.classList.toggle("disable", !this.getWebContents().canGoBack()); | ||||
|   } | ||||
|  | ||||
|   forward(): void { | ||||
|     if (this.getWebContents().canGoForward()) { | ||||
|       this.getWebContents().goForward(); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   reload(): void { | ||||
|     this.hide(); | ||||
|     // Shows the loading indicator till the webview is reloaded | ||||
|     this.$webviewsContainer.remove("loaded"); | ||||
|     this.loading = true; | ||||
|     this.props.switchLoading(true, this.props.url); | ||||
|     this.getWebContents().reload(); | ||||
|   } | ||||
|  | ||||
|   send<Channel extends keyof RendererMessage>( | ||||
|     channel: Channel, | ||||
|     ...args: Parameters<RendererMessage[Channel]> | ||||
|   ): void { | ||||
|     ipcRenderer.sendTo(this.webContentsId, channel, ...args); | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1,15 +1,17 @@ | ||||
| import {EventEmitter} from "node:events"; | ||||
|  | ||||
| import type {ClipboardDecrypter} from "./clipboard-decrypter.js"; | ||||
| import {ClipboardDecrypterImpl} from "./clipboard-decrypter.js"; | ||||
| import type {NotificationData} from "./notification/index.js"; | ||||
| import {newNotification} from "./notification/index.js"; | ||||
| import {ipcRenderer} from "./typed-ipc-renderer.js"; | ||||
| import { | ||||
|   type ClipboardDecrypter, | ||||
|   ClipboardDecrypterImplementation, | ||||
| } from "./clipboard-decrypter.ts"; | ||||
| import {type NotificationData, newNotification} from "./notification/index.ts"; | ||||
| import {ipcRenderer} from "./typed-ipc-renderer.ts"; | ||||
|  | ||||
| type ListenerType = (...args: any[]) => void; | ||||
| type ListenerType = (...arguments_: any[]) => void; | ||||
|  | ||||
| /* eslint-disable @typescript-eslint/naming-convention */ | ||||
| export type ElectronBridge = { | ||||
|   send_event: (eventName: string | symbol, ...args: unknown[]) => boolean; | ||||
|   send_event: (eventName: string | symbol, ...arguments_: unknown[]) => boolean; | ||||
|   on_event: (eventName: string, listener: ListenerType) => void; | ||||
|   new_notification: ( | ||||
|     title: string, | ||||
| @@ -22,6 +24,7 @@ export type ElectronBridge = { | ||||
|   set_send_notification_reply_message_supported: (value: boolean) => void; | ||||
|   decrypt_clipboard: (version: number) => ClipboardDecrypter; | ||||
| }; | ||||
| /* eslint-enable @typescript-eslint/naming-convention */ | ||||
|  | ||||
| let notificationReplySupported = false; | ||||
| // Indicates if the user is idle or not | ||||
| @@ -29,12 +32,12 @@ let idle = false; | ||||
| // Indicates the time at which user was last active | ||||
| let lastActive = Date.now(); | ||||
|  | ||||
| export const bridgeEvents = new EventEmitter(); | ||||
| export const bridgeEvents = new EventEmitter(); // eslint-disable-line unicorn/prefer-event-target | ||||
|  | ||||
| /* eslint-disable @typescript-eslint/naming-convention */ | ||||
| const electron_bridge: ElectronBridge = { | ||||
|   send_event: (eventName: string | symbol, ...args: unknown[]): boolean => | ||||
|     bridgeEvents.emit(eventName, ...args), | ||||
|   send_event: (eventName: string | symbol, ...arguments_: unknown[]): boolean => | ||||
|     bridgeEvents.emit(eventName, ...arguments_), | ||||
|  | ||||
|   on_event(eventName: string, listener: ListenerType): void { | ||||
|     bridgeEvents.on(eventName, listener); | ||||
| @@ -58,7 +61,7 @@ const electron_bridge: ElectronBridge = { | ||||
|   }, | ||||
|  | ||||
|   decrypt_clipboard: (version: number): ClipboardDecrypter => | ||||
|     new ClipboardDecrypterImpl(version), | ||||
|     new ClipboardDecrypterImplementation(version), | ||||
| }; | ||||
| /* eslint-enable @typescript-eslint/naming-convention */ | ||||
|  | ||||
| @@ -105,7 +108,7 @@ ipcRenderer.on("set-idle", () => { | ||||
|  | ||||
| // This follows node's idiomatic implementation of event | ||||
| // emitters to make event handling more simpler instead of using | ||||
| // functions zulip side will emit event using ElectronBrigde.send_event | ||||
| // functions zulip side will emit event using ElectronBridge.send_event | ||||
| // which is alias of .emit and on this side we can handle the data by adding | ||||
| // a listener for the event. | ||||
| export default electron_bridge; | ||||
|   | ||||
| @@ -1,113 +0,0 @@ | ||||
| "use strict"; | ||||
|  | ||||
| type ElectronBridge = import("./electron-bridge.js").ElectronBridge; | ||||
|  | ||||
| type CompatElectronBridge = { | ||||
|   readonly idle_on_system: boolean; | ||||
|   readonly last_active_on_system: number; | ||||
|   send_notification_reply_message_supported: boolean; | ||||
| } & ElectronBridge; | ||||
|  | ||||
| (() => { | ||||
|   const zulipWindow = window as typeof window & { | ||||
|     electron_bridge: CompatElectronBridge; | ||||
|     raw_electron_bridge: ElectronBridge; | ||||
|   }; | ||||
|  | ||||
|   /* eslint-disable @typescript-eslint/naming-convention */ | ||||
|   const electron_bridge: CompatElectronBridge = { | ||||
|     ...zulipWindow.raw_electron_bridge, | ||||
|  | ||||
|     get idle_on_system(): boolean { | ||||
|       return this.get_idle_on_system(); | ||||
|     }, | ||||
|  | ||||
|     get last_active_on_system(): number { | ||||
|       return this.get_last_active_on_system(); | ||||
|     }, | ||||
|  | ||||
|     get send_notification_reply_message_supported(): boolean { | ||||
|       return this.get_send_notification_reply_message_supported(); | ||||
|     }, | ||||
|  | ||||
|     set send_notification_reply_message_supported(value: boolean) { | ||||
|       this.set_send_notification_reply_message_supported(value); | ||||
|     }, | ||||
|   }; | ||||
|   /* eslint-enable @typescript-eslint/naming-convention */ | ||||
|  | ||||
|   zulipWindow.electron_bridge = electron_bridge; | ||||
|  | ||||
|   function attributeListener<T extends EventTarget>( | ||||
|     type: string, | ||||
|   ): PropertyDescriptor { | ||||
|     const handlers = new WeakMap<T, (event: Event) => unknown>(); | ||||
|  | ||||
|     function listener(this: T, event: Event): void { | ||||
|       if (handlers.get(this)!.call(this, event) === false) { | ||||
|         event.preventDefault(); | ||||
|       } | ||||
|     } | ||||
|  | ||||
|     return { | ||||
|       configurable: true, | ||||
|       enumerable: true, | ||||
|       get(this: T) { | ||||
|         return handlers.get(this); | ||||
|       }, | ||||
|       set(this: T, value: unknown) { | ||||
|         if (typeof value === "function") { | ||||
|           if (!handlers.has(this)) { | ||||
|             this.addEventListener(type, listener); | ||||
|           } | ||||
|  | ||||
|           handlers.set(this, value as (event: Event) => unknown); | ||||
|         } else if (handlers.has(this)) { | ||||
|           this.removeEventListener(type, listener); | ||||
|           handlers.delete(this); | ||||
|         } | ||||
|       }, | ||||
|     }; | ||||
|   } | ||||
|  | ||||
|   // eslint-disable-next-line @typescript-eslint/naming-convention | ||||
|   const NativeNotification = Notification; | ||||
|  | ||||
|   class InjectedNotification extends EventTarget { | ||||
|     static get permission(): NotificationPermission { | ||||
|       return NativeNotification.permission; | ||||
|     } | ||||
|  | ||||
|     static async requestPermission( | ||||
|       callback?: NotificationPermissionCallback, | ||||
|     ): Promise<NotificationPermission> { | ||||
|       if (callback) { | ||||
|         callback(await Promise.resolve(NativeNotification.permission)); | ||||
|       } | ||||
|  | ||||
|       return NativeNotification.permission; | ||||
|     } | ||||
|  | ||||
|     constructor(title: string, options: NotificationOptions = {}) { | ||||
|       super(); | ||||
|       Object.assign( | ||||
|         this, | ||||
|         electron_bridge.new_notification( | ||||
|           title, | ||||
|           options, | ||||
|           (type: string, eventInit: EventInit) => | ||||
|             this.dispatchEvent(new Event(type, eventInit)), | ||||
|         ), | ||||
|       ); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   Object.defineProperties(InjectedNotification.prototype, { | ||||
|     onclick: attributeListener("click"), | ||||
|     onclose: attributeListener("close"), | ||||
|     onerror: attributeListener("error"), | ||||
|     onshow: attributeListener("show"), | ||||
|   }); | ||||
|  | ||||
|   window.Notification = InjectedNotification as unknown as typeof Notification; | ||||
| })(); | ||||
| @@ -1,30 +1,42 @@ | ||||
| import "./zod-config.ts"; // eslint-disable-line import-x/no-unassigned-import | ||||
|  | ||||
| import {clipboard} from "electron/common"; | ||||
| import path from "node:path"; | ||||
| import process from "node:process"; | ||||
| import url from "node:url"; | ||||
|  | ||||
| import {Menu, app, dialog, session} from "@electron/remote"; | ||||
| import * as remote from "@electron/remote"; | ||||
| import * as Sentry from "@sentry/electron"; | ||||
| import * as Sentry from "@sentry/electron/renderer"; | ||||
|  | ||||
| import type {Config} from "../../common/config-util.js"; | ||||
| import * as ConfigUtil from "../../common/config-util.js"; | ||||
| import * as DNDUtil from "../../common/dnd-util.js"; | ||||
| import type {DndSettings} from "../../common/dnd-util.js"; | ||||
| import * as EnterpriseUtil from "../../common/enterprise-util.js"; | ||||
| import * as LinkUtil from "../../common/link-util.js"; | ||||
| import Logger from "../../common/logger-util.js"; | ||||
| import * as Messages from "../../common/messages.js"; | ||||
| import type {NavItem, ServerConf, TabData} from "../../common/types.js"; | ||||
| import type {Config} from "../../common/config-util.ts"; | ||||
| import * as ConfigUtil from "../../common/config-util.ts"; | ||||
| import * as DNDUtil from "../../common/dnd-util.ts"; | ||||
| import type {DndSettings} from "../../common/dnd-util.ts"; | ||||
| import * as EnterpriseUtil from "../../common/enterprise-util.ts"; | ||||
| import {html} from "../../common/html.ts"; | ||||
| import * as LinkUtil from "../../common/link-util.ts"; | ||||
| import Logger from "../../common/logger-util.ts"; | ||||
| import * as Messages from "../../common/messages.ts"; | ||||
| import {bundlePath, bundleUrl} from "../../common/paths.ts"; | ||||
| import * as t from "../../common/translation-util.ts"; | ||||
| import type { | ||||
|   NavigationItem, | ||||
|   ServerConfig, | ||||
|   TabData, | ||||
|   TabPage, | ||||
| } from "../../common/types.js"; | ||||
| import defaultIcon from "../img/icon.png"; | ||||
|  | ||||
| import FunctionalTab from "./components/functional-tab.js"; | ||||
| import ServerTab from "./components/server-tab.js"; | ||||
| import WebView from "./components/webview.js"; | ||||
| import {AboutView} from "./pages/about.js"; | ||||
| import {PreferenceView} from "./pages/preference/preference.js"; | ||||
| import {initializeTray} from "./tray.js"; | ||||
| import {ipcRenderer} from "./typed-ipc-renderer.js"; | ||||
| import * as DomainUtil from "./utils/domain-util.js"; | ||||
| import ReconnectUtil from "./utils/reconnect-util.js"; | ||||
| import FunctionalTab from "./components/functional-tab.ts"; | ||||
| import ServerTab from "./components/server-tab.ts"; | ||||
| import WebView from "./components/webview.ts"; | ||||
| import {AboutView} from "./pages/about.ts"; | ||||
| import {PreferenceView} from "./pages/preference/preference.ts"; | ||||
| import {initializeTray} from "./tray.ts"; | ||||
| import {ipcRenderer} from "./typed-ipc-renderer.ts"; | ||||
| import * as DomainUtil from "./utils/domain-util.ts"; | ||||
| import ReconnectUtil from "./utils/reconnect-util.ts"; | ||||
|  | ||||
| Sentry.init({}); | ||||
|  | ||||
| @@ -44,12 +56,13 @@ const logger = new Logger({ | ||||
|   file: "errors.log", | ||||
| }); | ||||
|  | ||||
| const rendererDirectory = path.resolve(__dirname, ".."); | ||||
| type ServerOrFunctionalTab = ServerTab | FunctionalTab; | ||||
|  | ||||
| const rootWebContents = remote.getCurrentWebContents(); | ||||
|  | ||||
| const dingSound = new Audio("../resources/sounds/ding.ogg"); | ||||
| const dingSound = new Audio( | ||||
|   new URL("resources/sounds/ding.ogg", bundleUrl).href, | ||||
| ); | ||||
|  | ||||
| export class ServerManagerView { | ||||
|   $addServerButton: HTMLButtonElement; | ||||
| @@ -69,11 +82,10 @@ export class ServerManagerView { | ||||
|   $dndTooltip: HTMLElement; | ||||
|   $sidebar: Element; | ||||
|   $fullscreenPopup: Element; | ||||
|   $fullscreenEscapeKey: string; | ||||
|   loading: Set<string>; | ||||
|   activeTabIndex: number; | ||||
|   tabs: ServerOrFunctionalTab[]; | ||||
|   functionalTabs: Map<string, number>; | ||||
|   functionalTabs: Map<TabPage, number>; | ||||
|   tabIndex: number; | ||||
|   presetOrgs: string[]; | ||||
|   preferenceView?: PreferenceView; | ||||
| @@ -110,8 +122,10 @@ export class ServerManagerView { | ||||
|     this.$sidebar = document.querySelector("#sidebar")!; | ||||
|  | ||||
|     this.$fullscreenPopup = document.querySelector("#fullscreen-popup")!; | ||||
|     this.$fullscreenEscapeKey = process.platform === "darwin" ? "^⌘F" : "F11"; | ||||
|     this.$fullscreenPopup.textContent = `Press ${this.$fullscreenEscapeKey} to exit full screen`; | ||||
|     this.$fullscreenPopup.textContent = t.__( | ||||
|       "Press {{{exitKey}}} to exit full screen", | ||||
|       {exitKey: process.platform === "darwin" ? "^⌘F" : "F11"}, | ||||
|     ); | ||||
|  | ||||
|     this.loading = new Set(); | ||||
|     this.activeTabIndex = -1; | ||||
| @@ -152,12 +166,12 @@ export class ServerManagerView { | ||||
|       ConfigUtil.getConfigItem("useSystemProxy", false) | ||||
|         ? {mode: "system"} | ||||
|         : ConfigUtil.getConfigItem("useManualProxy", false) | ||||
|         ? { | ||||
|             pacScript: ConfigUtil.getConfigItem("proxyPAC", ""), | ||||
|             proxyRules: ConfigUtil.getConfigItem("proxyRules", ""), | ||||
|             proxyBypassRules: ConfigUtil.getConfigItem("proxyBypass", ""), | ||||
|           } | ||||
|         : {mode: "direct"}, | ||||
|           ? { | ||||
|               pacScript: ConfigUtil.getConfigItem("proxyPAC", ""), | ||||
|               proxyRules: ConfigUtil.getConfigItem("proxyRules", ""), | ||||
|               proxyBypassRules: ConfigUtil.getConfigItem("proxyBypass", ""), | ||||
|             } | ||||
|           : {mode: "direct"}, | ||||
|     ); | ||||
|   } | ||||
|  | ||||
| @@ -244,13 +258,16 @@ export class ServerManagerView { | ||||
|     // promise of addition resolves in both cases, but we consider it rejected | ||||
|     // if the resolved value is false | ||||
|     try { | ||||
|       const serverConf = await DomainUtil.checkDomain(domain); | ||||
|       await DomainUtil.addDomain(serverConf); | ||||
|       const serverConfig = await DomainUtil.checkDomain(domain); | ||||
|       await DomainUtil.addDomain(serverConfig); | ||||
|       return true; | ||||
|     } catch (error: unknown) { | ||||
|       logger.error(error); | ||||
|       logger.error( | ||||
|         `Could not add ${domain}. Please contact your system administrator.`, | ||||
|         t.__( | ||||
|           "Could not add {{{domain}}}. Please contact your system administrator.", | ||||
|           {domain}, | ||||
|         ), | ||||
|       ); | ||||
|       return false; | ||||
|     } | ||||
| @@ -279,12 +296,9 @@ export class ServerManagerView { | ||||
|         // ask them before reloading the app | ||||
|         const {response} = await dialog.showMessageBox({ | ||||
|           type: "question", | ||||
|           buttons: ["Yes", "Later"], | ||||
|           buttons: [t.__("Yes"), t.__("Later")], | ||||
|           defaultId: 0, | ||||
|           message: | ||||
|             "New server" + | ||||
|             (domainsAdded.length > 1 ? "s" : "") + | ||||
|             " added. Reload app now?", | ||||
|           message: t.__("New servers added. Reload app now?"), | ||||
|         }); | ||||
|         if (response === 0) { | ||||
|           ipcRenderer.send("reload-full-app"); | ||||
| @@ -303,10 +317,7 @@ export class ServerManagerView { | ||||
|         failedDomains.push(org); | ||||
|       } | ||||
|  | ||||
|       const {title, content} = Messages.enterpriseOrgError( | ||||
|         domainsAdded.length, | ||||
|         failedDomains, | ||||
|       ); | ||||
|       const {title, content} = Messages.enterpriseOrgError(failedDomains); | ||||
|       dialog.showErrorBox(title, content); | ||||
|       if (DomainUtil.getDomains().length === 0) { | ||||
|         // No orgs present, stop showing loading gif | ||||
| @@ -319,7 +330,18 @@ export class ServerManagerView { | ||||
|     const servers = DomainUtil.getDomains(); | ||||
|     if (servers.length > 0) { | ||||
|       for (const [i, server] of servers.entries()) { | ||||
|         this.initServer(server, i); | ||||
|         const tab = this.initServer(server, i); | ||||
|         (async () => { | ||||
|           const serverConfig = await DomainUtil.updateSavedServer( | ||||
|             server.url, | ||||
|             i, | ||||
|           ); | ||||
|           tab.setLabel(serverConfig.alias); | ||||
|           tab.setIcon(DomainUtil.iconAsUrl(serverConfig.icon)); | ||||
|           (await tab.webview).setUnsupportedMessage( | ||||
|             DomainUtil.getUnsupportedMessage(serverConfig), | ||||
|           ); | ||||
|         })(); | ||||
|       } | ||||
|  | ||||
|       // Open last active tab | ||||
| @@ -328,11 +350,7 @@ export class ServerManagerView { | ||||
|         lastActiveTab = 0; | ||||
|       } | ||||
|  | ||||
|       // `checkDomain()` and `webview.load()` for lastActiveTab before the others | ||||
|       await DomainUtil.updateSavedServer( | ||||
|         servers[lastActiveTab].url, | ||||
|         lastActiveTab, | ||||
|       ); | ||||
|       // `webview.load()` for lastActiveTab before the others | ||||
|       await this.activateTab(lastActiveTab); | ||||
|       await Promise.all( | ||||
|         servers.map(async (server, i) => { | ||||
| @@ -342,7 +360,6 @@ export class ServerManagerView { | ||||
|             return; | ||||
|           } | ||||
|  | ||||
|           await DomainUtil.updateSavedServer(server.url, i); | ||||
|           const tab = this.tabs[i]; | ||||
|           if (tab instanceof ServerTab) (await tab.webview).load(); | ||||
|         }), | ||||
| @@ -357,51 +374,54 @@ export class ServerManagerView { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   initServer(server: ServerConf, index: number): void { | ||||
|   initServer(server: ServerConfig, index: number): ServerTab { | ||||
|     const tabIndex = this.getTabIndex(); | ||||
|     this.tabs.push( | ||||
|       new ServerTab({ | ||||
|         role: "server", | ||||
|         icon: server.icon, | ||||
|         name: server.alias, | ||||
|         $root: this.$tabsContainer, | ||||
|         onClick: this.activateLastTab.bind(this, index), | ||||
|     const tab = new ServerTab({ | ||||
|       role: "server", | ||||
|       icon: DomainUtil.iconAsUrl(server.icon), | ||||
|       label: server.alias, | ||||
|       $root: this.$tabsContainer, | ||||
|       onClick: this.activateLastTab.bind(this, index), | ||||
|       index, | ||||
|       tabIndex, | ||||
|       onHover: this.onHover.bind(this, index), | ||||
|       onHoverOut: this.onHoverOut.bind(this, index), | ||||
|       webview: WebView.create({ | ||||
|         $root: this.$webviewsContainer, | ||||
|         rootWebContents, | ||||
|         index, | ||||
|         tabIndex, | ||||
|         onHover: this.onHover.bind(this, index), | ||||
|         onHoverOut: this.onHoverOut.bind(this, index), | ||||
|         webview: WebView.create({ | ||||
|           $root: this.$webviewsContainer, | ||||
|           rootWebContents, | ||||
|           index, | ||||
|           tabIndex, | ||||
|           url: server.url, | ||||
|           role: "server", | ||||
|           hasPermission: (origin: string, permission: string) => | ||||
|             origin === server.url && permission === "notifications", | ||||
|           isActive: () => index === this.activeTabIndex, | ||||
|           switchLoading: async (loading: boolean, url: string) => { | ||||
|             if (loading) { | ||||
|               this.loading.add(url); | ||||
|             } else { | ||||
|               this.loading.delete(url); | ||||
|             } | ||||
|         url: server.url, | ||||
|         role: "server", | ||||
|         hasPermission: (origin: string, permission: string) => | ||||
|           origin === server.url && | ||||
|           permission === "notifications" && | ||||
|           ConfigUtil.getConfigItem("showNotification", true), | ||||
|         isActive: () => index === this.activeTabIndex, | ||||
|         switchLoading: async (loading: boolean, url: string) => { | ||||
|           if (loading) { | ||||
|             this.loading.add(url); | ||||
|           } else { | ||||
|             this.loading.delete(url); | ||||
|           } | ||||
|  | ||||
|             const tab = this.tabs[this.activeTabIndex]; | ||||
|             this.showLoading( | ||||
|               tab instanceof ServerTab && | ||||
|                 this.loading.has((await tab.webview).props.url), | ||||
|             ); | ||||
|           }, | ||||
|           onNetworkError: async (index: number) => { | ||||
|             await this.openNetworkTroubleshooting(index); | ||||
|           }, | ||||
|           onTitleChange: this.updateBadge.bind(this), | ||||
|           preload: "js/preload.js", | ||||
|         }), | ||||
|           const tab = this.tabs[this.activeTabIndex]; | ||||
|           this.showLoading( | ||||
|             tab instanceof ServerTab && | ||||
|               this.loading.has((await tab.webview).properties.url), | ||||
|           ); | ||||
|         }, | ||||
|         onNetworkError: async (index: number) => { | ||||
|           await this.openNetworkTroubleshooting(index); | ||||
|         }, | ||||
|         onTitleChange: this.updateBadge.bind(this), | ||||
|         preload: url.pathToFileURL(path.join(bundlePath, "preload.cjs")).href, | ||||
|         unsupportedMessage: DomainUtil.getUnsupportedMessage(server), | ||||
|       }), | ||||
|     ); | ||||
|     }); | ||||
|     this.tabs.push(tab); | ||||
|     this.loading.add(server.url); | ||||
|     return tab; | ||||
|   } | ||||
|  | ||||
|   initActions(): void { | ||||
| @@ -415,7 +435,7 @@ export class ServerManagerView { | ||||
|       document.querySelectorAll(".server-icons"); | ||||
|     for (const [index, $serverImg] of $serverImgs.entries()) { | ||||
|       this.addContextMenu($serverImg, index); | ||||
|       if ($serverImg.src.includes("img/icon.png")) { | ||||
|       if ($serverImg.src === defaultIcon) { | ||||
|         this.displayInitialCharLogo($serverImg, index); | ||||
|       } | ||||
|  | ||||
| @@ -471,7 +491,7 @@ export class ServerManagerView { | ||||
|  | ||||
|   async getCurrentActiveServer(): Promise<string> { | ||||
|     const tab = this.tabs[this.activeTabIndex]; | ||||
|     return tab instanceof ServerTab ? (await tab.webview).props.url : ""; | ||||
|     return tab instanceof ServerTab ? (await tab.webview).properties.url : ""; | ||||
|   } | ||||
|  | ||||
|   displayInitialCharLogo($img: HTMLImageElement, index: number): void { | ||||
| @@ -489,13 +509,12 @@ export class ServerManagerView { | ||||
|     const realmName = $webview.getAttribute("name"); | ||||
|  | ||||
|     if (realmName === null) { | ||||
|       $img.src = "/img/icon.png"; | ||||
|       $img.src = defaultIcon; | ||||
|       return; | ||||
|     } | ||||
|  | ||||
|     $altIcon.textContent = realmName.charAt(0) || "Z"; | ||||
|     $altIcon.classList.add("server-icon"); | ||||
|     $altIcon.classList.add("alt-icon"); | ||||
|     $altIcon.classList.add("server-icon", "alt-icon"); | ||||
|  | ||||
|     $img.remove(); | ||||
|     $parent.append($altIcon); | ||||
| @@ -540,36 +559,38 @@ export class ServerManagerView { | ||||
|     this.$serverIconTooltip[index].style.display = "none"; | ||||
|   } | ||||
|  | ||||
|   async openFunctionalTab(tabProps: { | ||||
|     name: string; | ||||
|   async openFunctionalTab(tabProperties: { | ||||
|     label: string; | ||||
|     page: TabPage; | ||||
|     materialIcon: string; | ||||
|     makeView: () => Element; | ||||
|     makeView: () => Promise<Element>; | ||||
|     destroyView: () => void; | ||||
|   }): Promise<void> { | ||||
|     if (this.functionalTabs.has(tabProps.name)) { | ||||
|       await this.activateTab(this.functionalTabs.get(tabProps.name)!); | ||||
|     if (this.functionalTabs.has(tabProperties.page)) { | ||||
|       await this.activateTab(this.functionalTabs.get(tabProperties.page)!); | ||||
|       return; | ||||
|     } | ||||
|  | ||||
|     const index = this.tabs.length; | ||||
|     this.functionalTabs.set(tabProps.name, index); | ||||
|     this.functionalTabs.set(tabProperties.page, index); | ||||
|  | ||||
|     const tabIndex = this.getTabIndex(); | ||||
|     const $view = tabProps.makeView(); | ||||
|     const $view = await tabProperties.makeView(); | ||||
|     this.$webviewsContainer.append($view); | ||||
|  | ||||
|     this.tabs.push( | ||||
|       new FunctionalTab({ | ||||
|         role: "function", | ||||
|         materialIcon: tabProps.materialIcon, | ||||
|         name: tabProps.name, | ||||
|         materialIcon: tabProperties.materialIcon, | ||||
|         label: tabProperties.label, | ||||
|         page: tabProperties.page, | ||||
|         $root: this.$tabsContainer, | ||||
|         index, | ||||
|         tabIndex, | ||||
|         onClick: this.activateTab.bind(this, index), | ||||
|         onDestroy: async () => { | ||||
|           await this.destroyTab(tabProps.name, index); | ||||
|           tabProps.destroyView(); | ||||
|           await this.destroyFunctionalTab(tabProperties.page, index); | ||||
|           tabProperties.destroyView(); | ||||
|         }, | ||||
|         $view, | ||||
|       }), | ||||
| @@ -579,15 +600,18 @@ export class ServerManagerView { | ||||
|     // closed when the functional tab DOM is ready, handled in webview.js | ||||
|     this.$webviewsContainer.classList.remove("loaded"); | ||||
|  | ||||
|     await this.activateTab(this.functionalTabs.get(tabProps.name)!); | ||||
|     await this.activateTab(this.functionalTabs.get(tabProperties.page)!); | ||||
|   } | ||||
|  | ||||
|   async openSettings(nav: NavItem = "General"): Promise<void> { | ||||
|   async openSettings( | ||||
|     navigationItem: NavigationItem = "General", | ||||
|   ): Promise<void> { | ||||
|     await this.openFunctionalTab({ | ||||
|       name: "Settings", | ||||
|       page: "Settings", | ||||
|       label: t.__("Settings"), | ||||
|       materialIcon: "settings", | ||||
|       makeView: () => { | ||||
|         this.preferenceView = new PreferenceView(); | ||||
|       makeView: async () => { | ||||
|         this.preferenceView = await PreferenceView.create(); | ||||
|         this.preferenceView.$view.classList.add("functional-view"); | ||||
|         return this.preferenceView.$view; | ||||
|       }, | ||||
| @@ -597,16 +621,17 @@ export class ServerManagerView { | ||||
|       }, | ||||
|     }); | ||||
|     this.$settingsButton.classList.add("active"); | ||||
|     this.preferenceView!.handleNavigation(nav); | ||||
|     this.preferenceView!.handleNavigation(navigationItem); | ||||
|   } | ||||
|  | ||||
|   async openAbout(): Promise<void> { | ||||
|     let aboutView: AboutView; | ||||
|     await this.openFunctionalTab({ | ||||
|       name: "About", | ||||
|       page: "About", | ||||
|       label: t.__("About"), | ||||
|       materialIcon: "sentiment_very_satisfied", | ||||
|       makeView() { | ||||
|         aboutView = new AboutView(); | ||||
|       async makeView() { | ||||
|         aboutView = await AboutView.create(); | ||||
|         aboutView.$view.classList.add("functional-view"); | ||||
|         return aboutView.$view; | ||||
|       }, | ||||
| @@ -624,7 +649,7 @@ export class ServerManagerView { | ||||
|     reconnectUtil.pollInternetAndReload(); | ||||
|     await webview | ||||
|       .getWebContents() | ||||
|       .loadURL(`file://${rendererDirectory}/network.html`); | ||||
|       .loadURL(new URL("app/renderer/network.html", bundleUrl).href); | ||||
|   } | ||||
|  | ||||
|   async activateLastTab(index: number): Promise<void> { | ||||
| @@ -636,13 +661,14 @@ export class ServerManagerView { | ||||
|  | ||||
|   // Returns this.tabs in an way that does | ||||
|   // not crash app when this.tabs is passed into | ||||
|   // ipcRenderer. Something about webview, and props.webview | ||||
|   // ipcRenderer. Something about webview, and properties.webview | ||||
|   // properties in ServerTab causes the app to crash. | ||||
|   get tabsForIpc(): TabData[] { | ||||
|     return this.tabs.map((tab) => ({ | ||||
|       role: tab.props.role, | ||||
|       name: tab.props.name, | ||||
|       index: tab.props.index, | ||||
|       role: tab.properties.role, | ||||
|       page: tab.properties.page, | ||||
|       label: tab.properties.label, | ||||
|       index: tab.properties.index, | ||||
|     })); | ||||
|   } | ||||
|  | ||||
| @@ -660,8 +686,8 @@ export class ServerManagerView { | ||||
|       if (hideOldTab) { | ||||
|         // If old tab is functional tab Settings, remove focus from the settings icon at sidebar bottom | ||||
|         if ( | ||||
|           this.tabs[this.activeTabIndex].props.role === "function" && | ||||
|           this.tabs[this.activeTabIndex].props.name === "Settings" | ||||
|           this.tabs[this.activeTabIndex].properties.role === "function" && | ||||
|           this.tabs[this.activeTabIndex].properties.page === "Settings" | ||||
|         ) { | ||||
|           this.$settingsButton.classList.remove("active"); | ||||
|         } | ||||
| @@ -685,7 +711,7 @@ export class ServerManagerView { | ||||
|  | ||||
|     this.showLoading( | ||||
|       tab instanceof ServerTab && | ||||
|         this.loading.has((await tab.webview).props.url), | ||||
|         this.loading.has((await tab.webview).properties.url), | ||||
|     ); | ||||
|  | ||||
|     ipcRenderer.send("update-menu", { | ||||
| @@ -694,7 +720,7 @@ export class ServerManagerView { | ||||
|       tabs: this.tabsForIpc, | ||||
|       activeTabIndex: this.activeTabIndex, | ||||
|       // Following flag controls whether a menu item should be enabled or not | ||||
|       enableMenu: tab.props.role === "server", | ||||
|       enableMenu: tab.properties.role === "server", | ||||
|     }); | ||||
|   } | ||||
|  | ||||
| @@ -703,7 +729,7 @@ export class ServerManagerView { | ||||
|     this.$loadingIndicator.classList.toggle("hidden", !loading); | ||||
|   } | ||||
|  | ||||
|   async destroyTab(name: string, index: number): Promise<void> { | ||||
|   async destroyFunctionalTab(page: TabPage, index: number): Promise<void> { | ||||
|     const tab = this.tabs[index]; | ||||
|     if (tab instanceof ServerTab && (await tab.webview).loading) { | ||||
|       return; | ||||
| @@ -711,8 +737,8 @@ export class ServerManagerView { | ||||
|  | ||||
|     await tab.destroy(); | ||||
|  | ||||
|     delete this.tabs[index]; | ||||
|     this.functionalTabs.delete(name); | ||||
|     delete this.tabs[index]; // eslint-disable-line @typescript-eslint/no-array-delete | ||||
|     this.functionalTabs.delete(page); | ||||
|  | ||||
|     // Issue #188: If the functional tab was not focused, do not activate another tab. | ||||
|     if (this.activeTabIndex === index) { | ||||
| @@ -736,7 +762,7 @@ export class ServerManagerView { | ||||
|  | ||||
|   async reloadView(): Promise<void> { | ||||
|     // Save and remember the index of last active tab so that we can use it later | ||||
|     const lastActiveTab = this.tabs[this.activeTabIndex].props.index; | ||||
|     const lastActiveTab = this.tabs[this.activeTabIndex].properties.index; | ||||
|     ConfigUtil.setConfigItem("lastActiveTab", lastActiveTab); | ||||
|  | ||||
|     // Destroy the current view and re-initiate it | ||||
| @@ -772,11 +798,17 @@ export class ServerManagerView { | ||||
|  | ||||
|   // Toggles the dnd button icon. | ||||
|   toggleDndButton(alert: boolean): void { | ||||
|     this.$dndTooltip.textContent = | ||||
|       (alert ? "Disable" : "Enable") + " Do Not Disturb"; | ||||
|     this.$dndButton.querySelector("i")!.textContent = alert | ||||
|       ? "notifications_off" | ||||
|       : "notifications"; | ||||
|     this.$dndTooltip.textContent = alert | ||||
|       ? t.__("Disable Do Not Disturb") | ||||
|       : t.__("Enable Do Not Disturb"); | ||||
|     const $dndIcon = this.$dndButton.querySelector("i")!; | ||||
|     $dndIcon.textContent = alert ? "notifications_off" : "notifications"; | ||||
|  | ||||
|     if (alert) { | ||||
|       $dndIcon.classList.add("dnd-on"); | ||||
|     } else { | ||||
|       $dndIcon.classList.remove("dnd-on"); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   async isLoggedIn(tabIndex: number): Promise<boolean> { | ||||
| @@ -792,13 +824,15 @@ export class ServerManagerView { | ||||
|       event.preventDefault(); | ||||
|       const template = [ | ||||
|         { | ||||
|           label: "Disconnect organization", | ||||
|           label: t.__("Disconnect organization"), | ||||
|           async click() { | ||||
|             const {response} = await dialog.showMessageBox({ | ||||
|               type: "warning", | ||||
|               buttons: ["YES", "NO"], | ||||
|               buttons: [t.__("Yes"), t.__("No")], | ||||
|               defaultId: 0, | ||||
|               message: "Are you sure you want to disconnect this organization?", | ||||
|               message: t.__( | ||||
|                 "Are you sure you want to disconnect this organization?", | ||||
|               ), | ||||
|             }); | ||||
|             if (response === 0) { | ||||
|               if (DomainUtil.removeDomain(index)) { | ||||
| @@ -813,7 +847,7 @@ export class ServerManagerView { | ||||
|           }, | ||||
|         }, | ||||
|         { | ||||
|           label: "Notification settings", | ||||
|           label: t.__("Notification settings"), | ||||
|           enabled: await this.isLoggedIn(index), | ||||
|           click: async () => { | ||||
|             // Switch to tab whose icon was right-clicked | ||||
| @@ -824,7 +858,7 @@ export class ServerManagerView { | ||||
|           }, | ||||
|         }, | ||||
|         { | ||||
|           label: "Copy Zulip URL", | ||||
|           label: t.__("Copy Zulip URL"), | ||||
|           click() { | ||||
|             clipboard.writeText(DomainUtil.getDomain(index).url); | ||||
|           }, | ||||
| @@ -914,7 +948,7 @@ export class ServerManagerView { | ||||
|     ipcRenderer.on( | ||||
|       "permission-request", | ||||
|       async ( | ||||
|         event: Event, | ||||
|         event, | ||||
|         { | ||||
|           webContentsId, | ||||
|           origin, | ||||
| @@ -936,7 +970,7 @@ export class ServerManagerView { | ||||
|                     const webview = await tab.webview; | ||||
|                     return ( | ||||
|                       webview.webContentsId === webContentsId && | ||||
|                       webview.props.hasPermission?.(origin, permission) | ||||
|                       webview.properties.hasPermission?.(origin, permission) | ||||
|                     ); | ||||
|                   }), | ||||
|                 ) | ||||
| @@ -963,10 +997,7 @@ export class ServerManagerView { | ||||
|       await LinkUtil.openBrowser(new URL("https://zulip.com/help/")); | ||||
|     }); | ||||
|  | ||||
|     ipcRenderer.on( | ||||
|       "reload-viewer", | ||||
|       this.reloadView.bind(this, this.tabs[this.activeTabIndex].props.index), | ||||
|     ); | ||||
|     ipcRenderer.on("reload-viewer", this.reloadView.bind(this)); | ||||
|  | ||||
|     ipcRenderer.on("reload-current-viewer", this.reloadCurrentView.bind(this)); | ||||
|  | ||||
| @@ -974,7 +1005,7 @@ export class ServerManagerView { | ||||
|       ipcRenderer.send("reload-full-app"); | ||||
|     }); | ||||
|  | ||||
|     ipcRenderer.on("switch-server-tab", async (event: Event, index: number) => { | ||||
|     ipcRenderer.on("switch-server-tab", async (event, index: number) => { | ||||
|       await this.activateLastTab(index); | ||||
|     }); | ||||
|  | ||||
| @@ -982,23 +1013,23 @@ export class ServerManagerView { | ||||
|       await this.openSettings("AddServer"); | ||||
|     }); | ||||
|  | ||||
|     ipcRenderer.on("reload-proxy", async (event: Event, showAlert: boolean) => { | ||||
|     ipcRenderer.on("reload-proxy", async (event, showAlert: boolean) => { | ||||
|       await this.loadProxy(); | ||||
|       if (showAlert) { | ||||
|         await dialog.showMessageBox({ | ||||
|           message: "Proxy settings saved!", | ||||
|           buttons: ["OK"], | ||||
|           message: t.__("Proxy settings saved."), | ||||
|           buttons: [t.__("OK")], | ||||
|         }); | ||||
|         ipcRenderer.send("reload-full-app"); | ||||
|       } | ||||
|     }); | ||||
|  | ||||
|     ipcRenderer.on("toggle-sidebar", async (event: Event, show: boolean) => { | ||||
|     ipcRenderer.on("toggle-sidebar", async (event, show: boolean) => { | ||||
|       // Toggle the left sidebar | ||||
|       this.toggleSidebar(show); | ||||
|     }); | ||||
|  | ||||
|     ipcRenderer.on("toggle-silent", async (event: Event, state: boolean) => | ||||
|     ipcRenderer.on("toggle-silent", async (event, state: boolean) => | ||||
|       Promise.all( | ||||
|         this.tabs.map(async (tab) => { | ||||
|           if (tab instanceof ServerTab) | ||||
| @@ -1009,7 +1040,7 @@ export class ServerManagerView { | ||||
|  | ||||
|     ipcRenderer.on( | ||||
|       "toggle-autohide-menubar", | ||||
|       async (event: Event, autoHideMenubar: boolean, updateMenu: boolean) => { | ||||
|       async (event, autoHideMenubar: boolean, updateMenu: boolean) => { | ||||
|         if (updateMenu) { | ||||
|           ipcRenderer.send("update-menu", { | ||||
|             tabs: this.tabsForIpc, | ||||
| @@ -1021,11 +1052,7 @@ export class ServerManagerView { | ||||
|  | ||||
|     ipcRenderer.on( | ||||
|       "toggle-dnd", | ||||
|       async ( | ||||
|         event: Event, | ||||
|         state: boolean, | ||||
|         newSettings: Partial<DndSettings>, | ||||
|       ) => { | ||||
|       async (event, state: boolean, newSettings: Partial<DndSettings>) => { | ||||
|         this.toggleDndButton(state); | ||||
|         ipcRenderer.send( | ||||
|           "forward-message", | ||||
| @@ -1037,16 +1064,11 @@ export class ServerManagerView { | ||||
|  | ||||
|     ipcRenderer.on( | ||||
|       "update-realm-name", | ||||
|       (event: Event, serverURL: string, realmName: string) => { | ||||
|       (event, serverURL: string, realmName: string) => { | ||||
|         for (const [index, domain] of DomainUtil.getDomains().entries()) { | ||||
|           if (domain.url.includes(serverURL)) { | ||||
|             const serverTooltipSelector = ".tab .server-tooltip"; | ||||
|             const serverTooltips = document.querySelectorAll( | ||||
|               serverTooltipSelector, | ||||
|             ); | ||||
|             serverTooltips[index].textContent = realmName; | ||||
|             this.tabs[index].props.name = realmName; | ||||
|  | ||||
|           if (domain.url === serverURL) { | ||||
|             const tab = this.tabs[index]; | ||||
|             if (tab instanceof ServerTab) tab.setLabel(realmName); | ||||
|             domain.alias = realmName; | ||||
|             DomainUtil.updateDomain(index, domain); | ||||
|             // Update the realm name also on the Window menu | ||||
| @@ -1061,18 +1083,15 @@ export class ServerManagerView { | ||||
|  | ||||
|     ipcRenderer.on( | ||||
|       "update-realm-icon", | ||||
|       async (event: Event, serverURL: string, iconURL: string) => { | ||||
|       async (event, serverURL: string, iconURL: string) => { | ||||
|         await Promise.all( | ||||
|           DomainUtil.getDomains().map(async (domain, index) => { | ||||
|             if (domain.url.includes(serverURL)) { | ||||
|               const localIconUrl: string = await DomainUtil.saveServerIcon( | ||||
|                 iconURL, | ||||
|               ); | ||||
|               const serverImgsSelector = ".tab .server-icons"; | ||||
|               const serverImgs: NodeListOf<HTMLImageElement> = | ||||
|                 document.querySelectorAll(serverImgsSelector); | ||||
|               serverImgs[index].src = localIconUrl; | ||||
|               domain.icon = localIconUrl; | ||||
|             if (domain.url === serverURL) { | ||||
|               const localIconPath = await DomainUtil.saveServerIcon(iconURL); | ||||
|               const tab = this.tabs[index]; | ||||
|               if (tab instanceof ServerTab) | ||||
|                 tab.setIcon(DomainUtil.iconAsUrl(localIconPath)); | ||||
|               domain.icon = localIconPath; | ||||
|               DomainUtil.updateDomain(index, domain); | ||||
|             } | ||||
|           }), | ||||
| @@ -1089,61 +1108,56 @@ export class ServerManagerView { | ||||
|       this.$fullscreenPopup.classList.remove("show"); | ||||
|     }); | ||||
|  | ||||
|     ipcRenderer.on( | ||||
|       "focus-webview-with-id", | ||||
|       async (event: Event, webviewId: number) => | ||||
|         Promise.all( | ||||
|           this.tabs.map(async (tab) => { | ||||
|             if ( | ||||
|               tab instanceof ServerTab && | ||||
|               (await tab.webview).webContentsId === webviewId | ||||
|             ) { | ||||
|               const concurrentTab: HTMLButtonElement = document.querySelector( | ||||
|                 `div[data-tab-id="${CSS.escape(`${tab.props.tabIndex}`)}"]`, | ||||
|               )!; | ||||
|               concurrentTab.click(); | ||||
|             } | ||||
|           }), | ||||
|         ), | ||||
|     ipcRenderer.on("focus-webview-with-id", async (event, webviewId: number) => | ||||
|       Promise.all( | ||||
|         this.tabs.map(async (tab) => { | ||||
|           if ( | ||||
|             tab instanceof ServerTab && | ||||
|             (await tab.webview).webContentsId === webviewId | ||||
|           ) { | ||||
|             const concurrentTab: HTMLButtonElement = document.querySelector( | ||||
|               `div[data-tab-id="${CSS.escape(`${tab.properties.tabIndex}`)}"]`, | ||||
|             )!; | ||||
|             concurrentTab.click(); | ||||
|           } | ||||
|         }), | ||||
|       ), | ||||
|     ); | ||||
|  | ||||
|     ipcRenderer.on( | ||||
|       "render-taskbar-icon", | ||||
|       (event: Event, messageCount: number) => { | ||||
|         // Create a canvas from unread messagecounts | ||||
|         function createOverlayIcon(messageCount: number): HTMLCanvasElement { | ||||
|           const canvas = document.createElement("canvas"); | ||||
|           canvas.height = 128; | ||||
|           canvas.width = 128; | ||||
|           canvas.style.letterSpacing = "-5px"; | ||||
|           const ctx = canvas.getContext("2d")!; | ||||
|           ctx.fillStyle = "#f42020"; | ||||
|           ctx.beginPath(); | ||||
|           ctx.ellipse(64, 64, 64, 64, 0, 0, 2 * Math.PI); | ||||
|           ctx.fill(); | ||||
|           ctx.textAlign = "center"; | ||||
|           ctx.fillStyle = "white"; | ||||
|           if (messageCount > 99) { | ||||
|             ctx.font = "65px Helvetica"; | ||||
|             ctx.fillText("99+", 64, 85); | ||||
|           } else if (messageCount < 10) { | ||||
|             ctx.font = "90px Helvetica"; | ||||
|             ctx.fillText(String(Math.min(99, messageCount)), 64, 96); | ||||
|           } else { | ||||
|             ctx.font = "85px Helvetica"; | ||||
|             ctx.fillText(String(Math.min(99, messageCount)), 64, 90); | ||||
|           } | ||||
|  | ||||
|           return canvas; | ||||
|     ipcRenderer.on("render-taskbar-icon", (event, messageCount: number) => { | ||||
|       // Create a canvas from unread message counts | ||||
|       function createOverlayIcon(messageCount: number): HTMLCanvasElement { | ||||
|         const canvas = document.createElement("canvas"); | ||||
|         canvas.height = 128; | ||||
|         canvas.width = 128; | ||||
|         canvas.style.letterSpacing = "-5px"; | ||||
|         const context = canvas.getContext("2d")!; | ||||
|         context.fillStyle = "#f42020"; | ||||
|         context.beginPath(); | ||||
|         context.ellipse(64, 64, 64, 64, 0, 0, 2 * Math.PI); | ||||
|         context.fill(); | ||||
|         context.textAlign = "center"; | ||||
|         context.fillStyle = "white"; | ||||
|         if (messageCount > 99) { | ||||
|           context.font = "65px Helvetica"; | ||||
|           context.fillText("99+", 64, 85); | ||||
|         } else if (messageCount < 10) { | ||||
|           context.font = "90px Helvetica"; | ||||
|           context.fillText(String(Math.min(99, messageCount)), 64, 96); | ||||
|         } else { | ||||
|           context.font = "85px Helvetica"; | ||||
|           context.fillText(String(Math.min(99, messageCount)), 64, 90); | ||||
|         } | ||||
|  | ||||
|         ipcRenderer.send( | ||||
|           "update-taskbar-icon", | ||||
|           createOverlayIcon(messageCount).toDataURL(), | ||||
|           String(messageCount), | ||||
|         ); | ||||
|       }, | ||||
|     ); | ||||
|         return canvas; | ||||
|       } | ||||
|  | ||||
|       ipcRenderer.send( | ||||
|         "update-taskbar-icon", | ||||
|         createOverlayIcon(messageCount).toDataURL(), | ||||
|         String(messageCount), | ||||
|       ); | ||||
|     }); | ||||
|  | ||||
|     ipcRenderer.on("copy-zulip-url", async () => { | ||||
|       clipboard.writeText(await this.getCurrentActiveServer()); | ||||
| @@ -1180,6 +1194,62 @@ export class ServerManagerView { | ||||
| } | ||||
|  | ||||
| window.addEventListener("load", async () => { | ||||
|   document.body.innerHTML = html` | ||||
|     <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" | ||||
|               >${t.__("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" | ||||
|               >${t.__("Do Not Disturb")}</span | ||||
|             > | ||||
|           </div> | ||||
|           <div class="action-button hidden" id="reload-action"> | ||||
|             <i class="material-icons md-48">refresh</i> | ||||
|             <span id="reload-tooltip" style="display: none" | ||||
|               >${t.__("Reload")}</span | ||||
|             > | ||||
|           </div> | ||||
|           <div class="action-button disable" id="loading-action"> | ||||
|             <i class="refresh material-icons md-48">loop</i> | ||||
|             <span id="loading-tooltip" style="display: none" | ||||
|               >${t.__("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" | ||||
|               >${t.__("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" | ||||
|               >${t.__("Settings")}</span | ||||
|             > | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div id="main-container"> | ||||
|         <div id="webviews-container"></div> | ||||
|       </div> | ||||
|     </div> | ||||
|   `.html; | ||||
|  | ||||
|   const serverManagerView = new ServerManagerView(); | ||||
|   await serverManagerView.init(); | ||||
| }); | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import {ipcRenderer} from "../typed-ipc-renderer.js"; | ||||
| import {ipcRenderer} from "../typed-ipc-renderer.ts"; | ||||
|  | ||||
| export type NotificationData = { | ||||
|   close: () => void; | ||||
| @@ -18,10 +18,10 @@ export function newNotification( | ||||
| ): NotificationData { | ||||
|   const notification = new Notification(title, {...options, silent: true}); | ||||
|   for (const type of ["click", "close", "error", "show"]) { | ||||
|     notification.addEventListener(type, (ev: Event) => { | ||||
|     notification.addEventListener(type, (event) => { | ||||
|       if (type === "click") ipcRenderer.send("focus-this-webview"); | ||||
|       if (!dispatch(type, ev)) { | ||||
|         ev.preventDefault(); | ||||
|       if (!dispatch(type, event)) { | ||||
|         event.preventDefault(); | ||||
|       } | ||||
|     }); | ||||
|   } | ||||
|   | ||||
| @@ -1,41 +1,50 @@ | ||||
| import {app} from "@electron/remote"; | ||||
|  | ||||
| import {html} from "../../../common/html.js"; | ||||
| import {Html, html} from "../../../common/html.ts"; | ||||
| import {bundleUrl} from "../../../common/paths.ts"; | ||||
| import * as t from "../../../common/translation-util.ts"; | ||||
| import {generateNodeFromHtml} from "../components/base.ts"; | ||||
|  | ||||
| export class AboutView { | ||||
|   static async create(): Promise<AboutView> { | ||||
|     return new AboutView( | ||||
|       await (await fetch(new URL("app/renderer/about.html", bundleUrl))).text(), | ||||
|     ); | ||||
|   } | ||||
|  | ||||
|   readonly $view: HTMLElement; | ||||
|  | ||||
|   constructor() { | ||||
|   private constructor(templateHtml: string) { | ||||
|     this.$view = document.createElement("div"); | ||||
|     const $shadow = this.$view.attachShadow({mode: "open"}); | ||||
|     $shadow.innerHTML = html` | ||||
|       <link rel="stylesheet" href="css/about.css" /> | ||||
|       <!-- Initially hidden to prevent FOUC --> | ||||
|       <div class="about" hidden> | ||||
|         <img class="logo" src="../resources/zulip.png" /> | ||||
|         <p class="detail" id="version">v${app.getVersion()}</p> | ||||
|         <div class="maintenance-info"> | ||||
|           <p class="detail maintainer"> | ||||
|             Maintained by | ||||
|             <a | ||||
|               href="https://zulip.com" | ||||
|               target="_blank" | ||||
|               rel="noopener noreferrer" | ||||
|               >Zulip</a | ||||
|             > | ||||
|           </p> | ||||
|           <p class="detail license"> | ||||
|             Available under the | ||||
|             <a | ||||
|               href="https://github.com/zulip/zulip-desktop/blob/main/LICENSE" | ||||
|               target="_blank" | ||||
|               rel="noopener noreferrer" | ||||
|               >Apache 2.0 License</a | ||||
|             > | ||||
|           </p> | ||||
|         </div> | ||||
|     $shadow.innerHTML = templateHtml; | ||||
|     $shadow.querySelector("#version")!.textContent = `v${app.getVersion()}`; | ||||
|     const maintenanceInfoHtml = html` | ||||
|       <div class="maintenance-info"> | ||||
|         <p class="detail maintainer"> | ||||
|           ${new Html({ | ||||
|             html: t.__("Maintained by {{{link}}}Zulip{{{endLink}}}", { | ||||
|               link: '<a href="https://zulip.com" target="_blank" rel="noopener noreferrer">', | ||||
|               endLink: "</a>", | ||||
|             }), | ||||
|           })} | ||||
|         </p> | ||||
|         <p class="detail license"> | ||||
|           ${new Html({ | ||||
|             html: t.__( | ||||
|               "Available under the {{{link}}}Apache 2.0 License{{{endLink}}}", | ||||
|               { | ||||
|                 link: '<a href="https://github.com/zulip/zulip-desktop/blob/main/LICENSE" target="_blank" rel="noopener noreferrer">', | ||||
|                 endLink: "</a>", | ||||
|               }, | ||||
|             ), | ||||
|           })} | ||||
|         </p> | ||||
|       </div> | ||||
|     `.html; | ||||
|     `; | ||||
|     $shadow | ||||
|       .querySelector(".about")! | ||||
|       .append(generateNodeFromHtml(maintenanceInfoHtml)); | ||||
|   } | ||||
|  | ||||
|   destroy() { | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import {ipcRenderer} from "../typed-ipc-renderer.js"; | ||||
| import {ipcRenderer} from "../typed-ipc-renderer.ts"; | ||||
|  | ||||
| export function init( | ||||
|   $reconnectButton: Element, | ||||
|   | ||||
| @@ -1,17 +1,17 @@ | ||||
| import type {Html} from "../../../../common/html.js"; | ||||
| import {html} from "../../../../common/html.js"; | ||||
| import {generateNodeFromHtml} from "../../components/base.js"; | ||||
| import {ipcRenderer} from "../../typed-ipc-renderer.js"; | ||||
| import {type Html, html} from "../../../../common/html.ts"; | ||||
| import * as t from "../../../../common/translation-util.ts"; | ||||
| import {generateNodeFromHtml} from "../../components/base.ts"; | ||||
| import {ipcRenderer} from "../../typed-ipc-renderer.ts"; | ||||
|  | ||||
| type BaseSectionProps = { | ||||
| type BaseSectionProperties = { | ||||
|   $element: HTMLElement; | ||||
|   disabled?: boolean; | ||||
|   value: boolean; | ||||
|   clickHandler: () => void; | ||||
| }; | ||||
|  | ||||
| export function generateSettingOption(props: BaseSectionProps): void { | ||||
|   const {$element, disabled, value, clickHandler} = props; | ||||
| export function generateSettingOption(properties: BaseSectionProperties): void { | ||||
|   const {$element, disabled, value, clickHandler} = properties; | ||||
|  | ||||
|   $element.textContent = ""; | ||||
|  | ||||
| @@ -30,10 +30,9 @@ export function generateOptionHtml( | ||||
|   disabled?: boolean, | ||||
| ): Html { | ||||
|   const labelHtml = disabled | ||||
|     ? // eslint-disable-next-line unicorn/template-indent | ||||
|       html`<label | ||||
|     ? html`<label | ||||
|         class="disallowed" | ||||
|         title="Setting locked by system administrator." | ||||
|         title="${t.__("Setting locked by system administrator.")}" | ||||
|       ></label>` | ||||
|     : html`<label></label>`; | ||||
|   if (settingOption) { | ||||
|   | ||||
| @@ -1,19 +1,19 @@ | ||||
| import {html} from "../../../../common/html.js"; | ||||
| import * as t from "../../../../common/translation-util.js"; | ||||
| import {ipcRenderer} from "../../typed-ipc-renderer.js"; | ||||
| import * as DomainUtil from "../../utils/domain-util.js"; | ||||
| import {html} from "../../../../common/html.ts"; | ||||
| import * as t from "../../../../common/translation-util.ts"; | ||||
| import {ipcRenderer} from "../../typed-ipc-renderer.ts"; | ||||
| import * as DomainUtil from "../../utils/domain-util.ts"; | ||||
|  | ||||
| import {reloadApp} from "./base-section.js"; | ||||
| import {initFindAccounts} from "./find-accounts.js"; | ||||
| import {initServerInfoForm} from "./server-info-form.js"; | ||||
| import {reloadApp} from "./base-section.ts"; | ||||
| import {initFindAccounts} from "./find-accounts.ts"; | ||||
| import {initServerInfoForm} from "./server-info-form.ts"; | ||||
|  | ||||
| type ConnectedOrgSectionProps = { | ||||
| type ConnectedOrgSectionProperties = { | ||||
|   $root: Element; | ||||
| }; | ||||
|  | ||||
| export function initConnectedOrgSection({ | ||||
|   $root, | ||||
| }: ConnectedOrgSectionProps): void { | ||||
| }: ConnectedOrgSectionProperties): void { | ||||
|   $root.textContent = ""; | ||||
|  | ||||
|   const servers = DomainUtil.getDomains(); | ||||
| @@ -21,7 +21,7 @@ export function initConnectedOrgSection({ | ||||
|     <div class="settings-pane" id="server-settings-pane"> | ||||
|       <div class="page-title">${t.__("Connected organizations")}</div> | ||||
|       <div class="title" id="existing-servers"> | ||||
|         ${t.__("All the connected orgnizations will appear here.")} | ||||
|         ${t.__("All the connected organizations will appear here.")} | ||||
|       </div> | ||||
|       <div id="server-info-container"></div> | ||||
|       <div id="new-org-button"> | ||||
| @@ -42,7 +42,9 @@ export function initConnectedOrgSection({ | ||||
|     "#find-accounts-container", | ||||
|   )!; | ||||
|  | ||||
|   const noServerText = t.__("All the connected orgnizations will appear here"); | ||||
|   const noServerText = t.__( | ||||
|     "All the connected organizations will appear here.", | ||||
|   ); | ||||
|   // Show noServerText if no servers are there otherwise hide it | ||||
|   $existingServers.textContent = servers.length === 0 ? noServerText : ""; | ||||
|  | ||||
|   | ||||
| @@ -1,9 +1,9 @@ | ||||
| import {html} from "../../../../common/html.js"; | ||||
| import * as LinkUtil from "../../../../common/link-util.js"; | ||||
| import * as t from "../../../../common/translation-util.js"; | ||||
| import {generateNodeFromHtml} from "../../components/base.js"; | ||||
| import {html} from "../../../../common/html.ts"; | ||||
| import * as LinkUtil from "../../../../common/link-util.ts"; | ||||
| import * as t from "../../../../common/translation-util.ts"; | ||||
| import {generateNodeFromHtml} from "../../components/base.ts"; | ||||
|  | ||||
| type FindAccountsProps = { | ||||
| type FindAccountsProperties = { | ||||
|   $root: Element; | ||||
| }; | ||||
|  | ||||
| @@ -19,7 +19,7 @@ async function findAccounts(url: string): Promise<void> { | ||||
|   await LinkUtil.openBrowser(new URL("/accounts/find", url)); | ||||
| } | ||||
|  | ||||
| export function initFindAccounts(props: FindAccountsProps): void { | ||||
| export function initFindAccounts(properties: FindAccountsProperties): void { | ||||
|   const $findAccounts = generateNodeFromHtml(html` | ||||
|     <div class="settings-card certificate-card"> | ||||
|       <div class="certificate-input"> | ||||
| @@ -33,7 +33,7 @@ export function initFindAccounts(props: FindAccountsProps): void { | ||||
|       </div> | ||||
|     </div> | ||||
|   `); | ||||
|   props.$root.append($findAccounts); | ||||
|   properties.$root.append($findAccounts); | ||||
|   const $findAccountsButton = $findAccounts.querySelector( | ||||
|     "#find-accounts-button", | ||||
|   )!; | ||||
|   | ||||
| @@ -6,25 +6,24 @@ import process from "node:process"; | ||||
| import * as remote from "@electron/remote"; | ||||
| import {app, dialog, session} from "@electron/remote"; | ||||
| import Tagify from "@yaireo/tagify"; | ||||
| import ISO6391 from "iso-639-1"; | ||||
| import * as z from "zod"; | ||||
| import {z} from "zod"; | ||||
|  | ||||
| import * as ConfigUtil from "../../../../common/config-util.js"; | ||||
| import * as EnterpriseUtil from "../../../../common/enterprise-util.js"; | ||||
| import {html} from "../../../../common/html.js"; | ||||
| import * as t from "../../../../common/translation-util.js"; | ||||
| import supportedLocales from "../../../../translations/supported-locales.json"; | ||||
| import {ipcRenderer} from "../../typed-ipc-renderer.js"; | ||||
| import supportedLocales from "../../../../../public/translations/supported-locales.json"; | ||||
| import * as ConfigUtil from "../../../../common/config-util.ts"; | ||||
| import * as EnterpriseUtil from "../../../../common/enterprise-util.ts"; | ||||
| import {html} from "../../../../common/html.ts"; | ||||
| import * as t from "../../../../common/translation-util.ts"; | ||||
| import {ipcRenderer} from "../../typed-ipc-renderer.ts"; | ||||
|  | ||||
| import {generateSelectHtml, generateSettingOption} from "./base-section.js"; | ||||
| import {generateSelectHtml, generateSettingOption} from "./base-section.ts"; | ||||
|  | ||||
| const currentBrowserWindow = remote.getCurrentWindow(); | ||||
|  | ||||
| type GeneralSectionProps = { | ||||
| type GeneralSectionProperties = { | ||||
|   $root: Element; | ||||
| }; | ||||
|  | ||||
| export function initGeneralSection({$root}: GeneralSectionProps): void { | ||||
| export function initGeneralSection({$root}: GeneralSectionProperties): void { | ||||
|   $root.innerHTML = html` | ||||
|     <div class="settings-pane"> | ||||
|       <div class="title">${t.__("Appearance")}</div> | ||||
| @@ -57,7 +56,7 @@ export function initGeneralSection({$root}: GeneralSectionProps): void { | ||||
|         </div> | ||||
|         <div class="setting-row" id="badge-option"> | ||||
|           <div class="setting-description"> | ||||
|             ${t.__("Show app unread badge")} | ||||
|             ${t.__("Show unread count badge on app icon")} | ||||
|           </div> | ||||
|           <div class="setting-control"></div> | ||||
|         </div> | ||||
| @@ -356,7 +355,8 @@ export function initGeneralSection({$root}: GeneralSectionProps): void { | ||||
|         const newValue = !ConfigUtil.getConfigItem("silent", true); | ||||
|         ConfigUtil.setConfigItem("silent", newValue); | ||||
|         updateSilentOption(); | ||||
|         ipcRenderer.sendTo( | ||||
|         ipcRenderer.send( | ||||
|           "forward-to", | ||||
|           currentBrowserWindow.webContents.id, | ||||
|           "toggle-silent", | ||||
|           newValue, | ||||
| @@ -455,14 +455,13 @@ export function initGeneralSection({$root}: GeneralSectionProps): void { | ||||
|  | ||||
|   async function customCssDialog(): Promise<void> { | ||||
|     const showDialogOptions: OpenDialogOptions = { | ||||
|       title: "Select file", | ||||
|       title: t.__("Select file"), | ||||
|       properties: ["openFile"], | ||||
|       filters: [{name: "CSS file", extensions: ["css"]}], | ||||
|       filters: [{name: t.__("CSS file"), extensions: ["css"]}], | ||||
|     }; | ||||
|  | ||||
|     const {filePaths, canceled} = await dialog.showOpenDialog( | ||||
|       showDialogOptions, | ||||
|     ); | ||||
|     const {filePaths, canceled} = | ||||
|       await dialog.showOpenDialog(showDialogOptions); | ||||
|     if (!canceled) { | ||||
|       ConfigUtil.setConfigItem("customCSS", filePaths[0]); | ||||
|       ipcRenderer.send("forward-message", "hard-reload"); | ||||
| @@ -525,13 +524,12 @@ export function initGeneralSection({$root}: GeneralSectionProps): void { | ||||
|  | ||||
|   async function downloadFolderDialog(): Promise<void> { | ||||
|     const showDialogOptions: OpenDialogOptions = { | ||||
|       title: "Select Download Location", | ||||
|       title: t.__("Select Download Location"), | ||||
|       properties: ["openDirectory"], | ||||
|     }; | ||||
|  | ||||
|     const {filePaths, canceled} = await dialog.showOpenDialog( | ||||
|       showDialogOptions, | ||||
|     ); | ||||
|     const {filePaths, canceled} = | ||||
|       await dialog.showOpenDialog(showDialogOptions); | ||||
|     if (!canceled) { | ||||
|       ConfigUtil.setConfigItem("downloadsPath", filePaths[0]); | ||||
|       const downloadFolderPath: HTMLElement = $root.querySelector( | ||||
| @@ -563,15 +561,16 @@ export function initGeneralSection({$root}: GeneralSectionProps): void { | ||||
|   } | ||||
|  | ||||
|   async function factoryResetSettings(): Promise<void> { | ||||
|     const clearAppDataMessage = | ||||
|       "When the application restarts, it will be as if you have just downloaded Zulip app."; | ||||
|     const clearAppDataMessage = t.__( | ||||
|       "When the application restarts, it will be as if you have just downloaded the Zulip app.", | ||||
|     ); | ||||
|     const getAppPath = path.join(app.getPath("appData"), app.name); | ||||
|  | ||||
|     const {response} = await dialog.showMessageBox({ | ||||
|       type: "warning", | ||||
|       buttons: ["YES", "NO"], | ||||
|       buttons: [t.__("Yes"), t.__("No")], | ||||
|       defaultId: 0, | ||||
|       message: "Are you sure?", | ||||
|       message: t.__("Are you sure?"), | ||||
|       detail: clearAppDataMessage, | ||||
|     }); | ||||
|     if (response === 0) { | ||||
| @@ -592,7 +591,7 @@ export function initGeneralSection({$root}: GeneralSectionProps): void { | ||||
|   } | ||||
|  | ||||
|   function initSpellChecker(): void { | ||||
|     // The elctron API is a no-op on macOS and macOS default spellchecker is used. | ||||
|     // The Electron API is a no-op on macOS and macOS default spellchecker is used. | ||||
|     if (process.platform === "darwin") { | ||||
|       const note: HTMLElement = $root.querySelector("#note")!; | ||||
|       note.append(t.__("On macOS, the OS spellchecker is used.")); | ||||
| @@ -610,7 +609,9 @@ export function initGeneralSection({$root}: GeneralSectionProps): void { | ||||
|       const spellDiv: HTMLElement = $root.querySelector("#spellcheck-langs")!; | ||||
|       spellDiv.innerHTML += html` | ||||
|         <div class="setting-description">${t.__("Spellchecker Languages")}</div> | ||||
|         <input name="spellcheck" placeholder="Enter Languages" /> | ||||
|         <div id="spellcheck-langs-value"> | ||||
|           <input name="spellcheck" placeholder="${t.__("Enter Languages")}" /> | ||||
|         </div> | ||||
|       `.html; | ||||
|  | ||||
|       const availableLanguages = session.fromPartition( | ||||
| @@ -618,26 +619,23 @@ export function initGeneralSection({$root}: GeneralSectionProps): void { | ||||
|       ).availableSpellCheckerLanguages; | ||||
|       let languagePairs = new Map<string, string>(); | ||||
|       for (const l of availableLanguages) { | ||||
|         if (ISO6391.validate(l)) { | ||||
|           languagePairs.set(ISO6391.getName(l), l); | ||||
|         } | ||||
|         const locale = new Intl.Locale(l.replaceAll("_", "-")); | ||||
|         let displayName = new Intl.DisplayNames([locale], { | ||||
|           type: "language", | ||||
|         }).of(locale.language); | ||||
|         if (displayName === undefined) continue; | ||||
|         displayName = displayName.replace(/^./u, (firstChar) => | ||||
|           firstChar.toLocaleUpperCase(locale), | ||||
|         ); | ||||
|         if (locale.script !== undefined) | ||||
|           displayName += ` (${new Intl.DisplayNames([locale], {type: "script"}).of(locale.script)})`; | ||||
|         if (locale.region !== undefined) | ||||
|           displayName += ` (${new Intl.DisplayNames([locale], {type: "region"}).of(locale.region)})`; | ||||
|         languagePairs.set(displayName, l); | ||||
|       } | ||||
|  | ||||
|       // Manually set names for languages not available in ISO6391 | ||||
|       languagePairs.set("English (AU)", "en-AU"); | ||||
|       languagePairs.set("English (CA)", "en-CA"); | ||||
|       languagePairs.set("English (GB)", "en-GB"); | ||||
|       languagePairs.set("English (US)", "en-US"); | ||||
|       languagePairs.set("Spanish (Latin America)", "es-419"); | ||||
|       languagePairs.set("Spanish (Argentina)", "es-AR"); | ||||
|       languagePairs.set("Spanish (Mexico)", "es-MX"); | ||||
|       languagePairs.set("Spanish (US)", "es-US"); | ||||
|       languagePairs.set("Portuguese (Brazil)", "pt-BR"); | ||||
|       languagePairs.set("Portuguese (Portugal)", "pt-PT"); | ||||
|       languagePairs.set("Serbo-Croatian", "sh"); | ||||
|  | ||||
|       languagePairs = new Map( | ||||
|         [...languagePairs].sort((a, b) => (a[0] < b[0] ? -1 : 1)), | ||||
|         [...languagePairs].sort((a, b) => a[0].localeCompare(b[1])), | ||||
|       ); | ||||
|  | ||||
|       const tagField: HTMLInputElement = $root.querySelector( | ||||
| @@ -652,8 +650,20 @@ export function initGeneralSection({$root}: GeneralSectionProps): void { | ||||
|           maxItems: Number.POSITIVE_INFINITY, | ||||
|           closeOnSelect: false, | ||||
|           highlightFirst: true, | ||||
|           position: "manual", | ||||
|           classname: "settings-tagify-dropdown", | ||||
|         }, | ||||
|       }); | ||||
|       tagify.DOM.input.addEventListener("focus", () => { | ||||
|         tagify.dropdown.show(); | ||||
|         $root | ||||
|           .querySelector("#spellcheck-langs-value")! | ||||
|           .append(tagify.DOM.dropdown); | ||||
|       }); | ||||
|       tagify.DOM.input.addEventListener("blur", () => { | ||||
|         tagify.dropdown.hide(true); | ||||
|         tagify.DOM.dropdown.remove(); | ||||
|       }); | ||||
|  | ||||
|       const configuredLanguages: string[] = ( | ||||
|         ConfigUtil.getConfigItem("spellcheckerLanguages", null) ?? [] | ||||
|   | ||||
| @@ -1,74 +1,74 @@ | ||||
| import type {Html} from "../../../../common/html.js"; | ||||
| import {html} from "../../../../common/html.js"; | ||||
| import * as t from "../../../../common/translation-util.js"; | ||||
| import type {NavItem} from "../../../../common/types.js"; | ||||
| import {generateNodeFromHtml} from "../../components/base.js"; | ||||
| import {type Html, html} from "../../../../common/html.ts"; | ||||
| import * as t from "../../../../common/translation-util.ts"; | ||||
| import type {NavigationItem} from "../../../../common/types.ts"; | ||||
| import {generateNodeFromHtml} from "../../components/base.ts"; | ||||
|  | ||||
| type PreferenceNavProps = { | ||||
| type PreferenceNavigationProperties = { | ||||
|   $root: Element; | ||||
|   onItemSelected: (navItem: NavItem) => void; | ||||
|   onItemSelected: (navigationItem: NavigationItem) => void; | ||||
| }; | ||||
|  | ||||
| export default class PreferenceNav { | ||||
|   navItems: NavItem[]; | ||||
| export default class PreferenceNavigation { | ||||
|   navigationItems: Array<{navigationItem: NavigationItem; label: string}>; | ||||
|   $el: Element; | ||||
|   constructor(private readonly props: PreferenceNavProps) { | ||||
|     this.navItems = [ | ||||
|       "General", | ||||
|       "Network", | ||||
|       "AddServer", | ||||
|       "Organizations", | ||||
|       "Shortcuts", | ||||
|   constructor(private readonly properties: PreferenceNavigationProperties) { | ||||
|     this.navigationItems = [ | ||||
|       {navigationItem: "General", label: t.__("General")}, | ||||
|       {navigationItem: "Network", label: t.__("Network")}, | ||||
|       {navigationItem: "AddServer", label: t.__("Add Organization")}, | ||||
|       {navigationItem: "Organizations", label: t.__("Organizations")}, | ||||
|       {navigationItem: "Shortcuts", label: t.__("Shortcuts")}, | ||||
|     ]; | ||||
|  | ||||
|     this.$el = generateNodeFromHtml(this.templateHtml()); | ||||
|     this.props.$root.append(this.$el); | ||||
|     this.properties.$root.append(this.$el); | ||||
|     this.registerListeners(); | ||||
|   } | ||||
|  | ||||
|   templateHtml(): Html { | ||||
|     const navItemsHtml = html``.join( | ||||
|       this.navItems.map( | ||||
|         (navItem) => html` | ||||
|           <div class="nav" id="nav-${navItem}">${t.__(navItem)}</div> | ||||
|         `, | ||||
|     const navigationItemsHtml = html``.join( | ||||
|       this.navigationItems.map( | ||||
|         ({navigationItem, label}) => | ||||
|           html`<div class="nav" id="nav-${navigationItem}">${label}</div>`, | ||||
|       ), | ||||
|     ); | ||||
|  | ||||
|     return html` | ||||
|       <div> | ||||
|         <div id="settings-header">${t.__("Settings")}</div> | ||||
|         <div id="nav-container">${navItemsHtml}</div> | ||||
|         <div id="nav-container">${navigationItemsHtml}</div> | ||||
|       </div> | ||||
|     `; | ||||
|   } | ||||
|  | ||||
|   registerListeners(): void { | ||||
|     for (const navItem of this.navItems) { | ||||
|       const $item = this.$el.querySelector(`#nav-${CSS.escape(navItem)}`)!; | ||||
|     for (const {navigationItem} of this.navigationItems) { | ||||
|       const $item = this.$el.querySelector( | ||||
|         `#nav-${CSS.escape(navigationItem)}`, | ||||
|       )!; | ||||
|       $item.addEventListener("click", () => { | ||||
|         this.props.onItemSelected(navItem); | ||||
|         this.properties.onItemSelected(navigationItem); | ||||
|       }); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   select(navItemToSelect: NavItem): void { | ||||
|     for (const navItem of this.navItems) { | ||||
|       if (navItem === navItemToSelect) { | ||||
|         this.activate(navItem); | ||||
|   select(navigationItemToSelect: NavigationItem): void { | ||||
|     for (const {navigationItem} of this.navigationItems) { | ||||
|       if (navigationItem === navigationItemToSelect) { | ||||
|         this.activate(navigationItem); | ||||
|       } else { | ||||
|         this.deactivate(navItem); | ||||
|         this.deactivate(navigationItem); | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   activate(navItem: NavItem): void { | ||||
|     const $item = this.$el.querySelector(`#nav-${CSS.escape(navItem)}`)!; | ||||
|   activate(navigationItem: NavigationItem): void { | ||||
|     const $item = this.$el.querySelector(`#nav-${CSS.escape(navigationItem)}`)!; | ||||
|     $item.classList.add("active"); | ||||
|   } | ||||
|  | ||||
|   deactivate(navItem: NavItem): void { | ||||
|     const $item = this.$el.querySelector(`#nav-${CSS.escape(navItem)}`)!; | ||||
|   deactivate(navigationItem: NavigationItem): void { | ||||
|     const $item = this.$el.querySelector(`#nav-${CSS.escape(navigationItem)}`)!; | ||||
|     $item.classList.remove("active"); | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1,15 +1,15 @@ | ||||
| import * as ConfigUtil from "../../../../common/config-util.js"; | ||||
| import {html} from "../../../../common/html.js"; | ||||
| import * as t from "../../../../common/translation-util.js"; | ||||
| import {ipcRenderer} from "../../typed-ipc-renderer.js"; | ||||
| import * as ConfigUtil from "../../../../common/config-util.ts"; | ||||
| import {html} from "../../../../common/html.ts"; | ||||
| import * as t from "../../../../common/translation-util.ts"; | ||||
| import {ipcRenderer} from "../../typed-ipc-renderer.ts"; | ||||
|  | ||||
| import {generateSettingOption} from "./base-section.js"; | ||||
| import {generateSettingOption} from "./base-section.ts"; | ||||
|  | ||||
| type NetworkSectionProps = { | ||||
| type NetworkSectionProperties = { | ||||
|   $root: Element; | ||||
| }; | ||||
|  | ||||
| export function initNetworkSection({$root}: NetworkSectionProps): void { | ||||
| export function initNetworkSection({$root}: NetworkSectionProperties): void { | ||||
|   $root.innerHTML = html` | ||||
|     <div class="settings-pane"> | ||||
|       <div class="title">${t.__("Proxy")}</div> | ||||
| @@ -28,7 +28,7 @@ export function initNetworkSection({$root}: NetworkSectionProps): void { | ||||
|         </div> | ||||
|         <div class="manual-proxy-block"> | ||||
|           <div class="setting-row" id="proxy-pac-option"> | ||||
|             <span class="setting-input-key">PAC ${t.__("script")}</span> | ||||
|             <span class="setting-input-key">${t.__("PAC script")}</span> | ||||
|             <input | ||||
|               class="setting-input-value" | ||||
|               placeholder="e.g. foobar.com/pacfile.js" | ||||
|   | ||||
| @@ -1,18 +1,21 @@ | ||||
| import {dialog} from "@electron/remote"; | ||||
|  | ||||
| import {html} from "../../../../common/html.js"; | ||||
| import * as LinkUtil from "../../../../common/link-util.js"; | ||||
| import * as t from "../../../../common/translation-util.js"; | ||||
| import {generateNodeFromHtml} from "../../components/base.js"; | ||||
| import {ipcRenderer} from "../../typed-ipc-renderer.js"; | ||||
| import * as DomainUtil from "../../utils/domain-util.js"; | ||||
| import {html} from "../../../../common/html.ts"; | ||||
| import * as LinkUtil from "../../../../common/link-util.ts"; | ||||
| import * as t from "../../../../common/translation-util.ts"; | ||||
| import {generateNodeFromHtml} from "../../components/base.ts"; | ||||
| import {ipcRenderer} from "../../typed-ipc-renderer.ts"; | ||||
| import * as DomainUtil from "../../utils/domain-util.ts"; | ||||
|  | ||||
| type NewServerFormProps = { | ||||
| type NewServerFormProperties = { | ||||
|   $root: Element; | ||||
|   onChange: () => void; | ||||
| }; | ||||
|  | ||||
| export function initNewServerForm({$root, onChange}: NewServerFormProps): void { | ||||
| export function initNewServerForm({ | ||||
|   $root, | ||||
|   onChange, | ||||
| }: NewServerFormProperties): void { | ||||
|   const $newServerForm = generateNodeFromHtml(html` | ||||
|     <div class="server-input-container"> | ||||
|       <div class="title">${t.__("Organization URL")}</div> | ||||
| @@ -20,7 +23,9 @@ export function initNewServerForm({$root, onChange}: NewServerFormProps): void { | ||||
|         <input | ||||
|           class="setting-input-value" | ||||
|           autofocus | ||||
|           placeholder="your-organization.zulipchat.com or zulip.your-organization.com" | ||||
|           placeholder="${t.__( | ||||
|             "your-organization.zulipchat.com or zulip.your-organization.com", | ||||
|           )}" | ||||
|         /> | ||||
|       </div> | ||||
|       <div class="server-center"> | ||||
| @@ -57,24 +62,24 @@ export function initNewServerForm({$root, onChange}: NewServerFormProps): void { | ||||
|   )!; | ||||
|  | ||||
|   async function submitFormHandler(): Promise<void> { | ||||
|     $saveServerButton.textContent = "Connecting..."; | ||||
|     let serverConf; | ||||
|     $saveServerButton.textContent = t.__("Connecting…"); | ||||
|     let serverConfig; | ||||
|     try { | ||||
|       serverConf = await DomainUtil.checkDomain($newServerUrl.value.trim()); | ||||
|       serverConfig = await DomainUtil.checkDomain($newServerUrl.value.trim()); | ||||
|     } catch (error: unknown) { | ||||
|       $saveServerButton.textContent = "Connect"; | ||||
|       $saveServerButton.textContent = t.__("Connect"); | ||||
|       await dialog.showMessageBox({ | ||||
|         type: "error", | ||||
|         message: | ||||
|           error instanceof Error | ||||
|             ? `${error.name}: ${error.message}` | ||||
|             : "Unknown error", | ||||
|         buttons: ["OK"], | ||||
|             : t.__("Unknown error"), | ||||
|         buttons: [t.__("OK")], | ||||
|       }); | ||||
|       return; | ||||
|     } | ||||
|  | ||||
|     await DomainUtil.addDomain(serverConf); | ||||
|     await DomainUtil.addDomain(serverConfig); | ||||
|     onChange(); | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -1,46 +1,37 @@ | ||||
| import type {IpcRendererEvent} from "electron/renderer"; | ||||
| import process from "node:process"; | ||||
|  | ||||
| import type {DndSettings} from "../../../../common/dnd-util.js"; | ||||
| import {html} from "../../../../common/html.js"; | ||||
| import type {NavItem} from "../../../../common/types.js"; | ||||
| import {ipcRenderer} from "../../typed-ipc-renderer.js"; | ||||
| import type {DndSettings} from "../../../../common/dnd-util.ts"; | ||||
| import {bundleUrl} from "../../../../common/paths.ts"; | ||||
| import type {NavigationItem} from "../../../../common/types.ts"; | ||||
| import {ipcRenderer} from "../../typed-ipc-renderer.ts"; | ||||
|  | ||||
| import {initConnectedOrgSection} from "./connected-org-section.js"; | ||||
| import {initGeneralSection} from "./general-section.js"; | ||||
| import Nav from "./nav.js"; | ||||
| import {initNetworkSection} from "./network-section.js"; | ||||
| import {initServersSection} from "./servers-section.js"; | ||||
| import {initShortcutsSection} from "./shortcuts-section.js"; | ||||
| import {initConnectedOrgSection} from "./connected-org-section.ts"; | ||||
| import {initGeneralSection} from "./general-section.ts"; | ||||
| import Nav from "./nav.ts"; | ||||
| import {initNetworkSection} from "./network-section.ts"; | ||||
| import {initServersSection} from "./servers-section.ts"; | ||||
| import {initShortcutsSection} from "./shortcuts-section.ts"; | ||||
|  | ||||
| export class PreferenceView { | ||||
|   static async create(): Promise<PreferenceView> { | ||||
|     return new PreferenceView( | ||||
|       await ( | ||||
|         await fetch(new URL("app/renderer/preference.html", bundleUrl)) | ||||
|       ).text(), | ||||
|     ); | ||||
|   } | ||||
|  | ||||
|   readonly $view: HTMLElement; | ||||
|   private readonly $shadow: ShadowRoot; | ||||
|   private readonly $settingsContainer: Element; | ||||
|   private readonly nav: Nav; | ||||
|   private navItem: NavItem = "General"; | ||||
|   private navigationItem: NavigationItem = "General"; | ||||
|  | ||||
|   constructor() { | ||||
|   private constructor(templateHtml: string) { | ||||
|     this.$view = document.createElement("div"); | ||||
|     this.$shadow = this.$view.attachShadow({mode: "open"}); | ||||
|     this.$shadow.innerHTML = html` | ||||
|       <link | ||||
|         rel="stylesheet" | ||||
|         href="${require.resolve("../../../css/fonts.css")}" | ||||
|       /> | ||||
|       <link | ||||
|         rel="stylesheet" | ||||
|         href="${require.resolve("../../../css/preference.css")}" | ||||
|       /> | ||||
|       <link | ||||
|         rel="stylesheet" | ||||
|         href="${require.resolve("@yaireo/tagify/dist/tagify.css")}" | ||||
|       /> | ||||
|       <!-- Initially hidden to prevent FOUC --> | ||||
|       <div id="content" hidden> | ||||
|         <div id="sidebar"></div> | ||||
|         <div id="settings-container"></div> | ||||
|       </div> | ||||
|     `.html; | ||||
|     this.$shadow.innerHTML = templateHtml; | ||||
|  | ||||
|     const $sidebarContainer = this.$shadow.querySelector("#sidebar")!; | ||||
|     this.$settingsContainer = this.$shadow.querySelector( | ||||
| @@ -56,13 +47,13 @@ export class PreferenceView { | ||||
|     ipcRenderer.on("toggle-autohide-menubar", this.handleToggleMenubar); | ||||
|     ipcRenderer.on("toggle-dnd", this.handleToggleDnd); | ||||
|  | ||||
|     this.handleNavigation(this.navItem); | ||||
|     this.handleNavigation(this.navigationItem); | ||||
|   } | ||||
|  | ||||
|   handleNavigation = (navItem: NavItem): void => { | ||||
|     this.navItem = navItem; | ||||
|     this.nav.select(navItem); | ||||
|     switch (navItem) { | ||||
|   handleNavigation = (navigationItem: NavigationItem): void => { | ||||
|     this.navigationItem = navigationItem; | ||||
|     this.nav.select(navigationItem); | ||||
|     switch (navigationItem) { | ||||
|       case "AddServer": { | ||||
|         initServersSection({ | ||||
|           $root: this.$settingsContainer, | ||||
| @@ -97,13 +88,9 @@ export class PreferenceView { | ||||
|         }); | ||||
|         break; | ||||
|       } | ||||
|  | ||||
|       default: { | ||||
|         ((n: never) => n)(navItem); | ||||
|       } | ||||
|     } | ||||
|  | ||||
|     window.location.hash = `#${navItem}`; | ||||
|     location.hash = `#${navigationItem}`; | ||||
|   }; | ||||
|  | ||||
|   handleToggleTray(state: boolean) { | ||||
| @@ -125,16 +112,22 @@ export class PreferenceView { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   private readonly handleToggleSidebar = (_event: Event, state: boolean) => { | ||||
|   private readonly handleToggleSidebar = ( | ||||
|     _event: IpcRendererEvent, | ||||
|     state: boolean, | ||||
|   ) => { | ||||
|     this.handleToggle("sidebar-option", state); | ||||
|   }; | ||||
|  | ||||
|   private readonly handleToggleMenubar = (_event: Event, state: boolean) => { | ||||
|   private readonly handleToggleMenubar = ( | ||||
|     _event: IpcRendererEvent, | ||||
|     state: boolean, | ||||
|   ) => { | ||||
|     this.handleToggle("menubar-option", state); | ||||
|   }; | ||||
|  | ||||
|   private readonly handleToggleDnd = ( | ||||
|     _event: Event, | ||||
|     _event: IpcRendererEvent, | ||||
|     _state: boolean, | ||||
|     newSettings: Partial<DndSettings>, | ||||
|   ) => { | ||||
|   | ||||
| @@ -1,34 +1,37 @@ | ||||
| import {dialog} from "@electron/remote"; | ||||
|  | ||||
| import {html} from "../../../../common/html.js"; | ||||
| import * as Messages from "../../../../common/messages.js"; | ||||
| import * as t from "../../../../common/translation-util.js"; | ||||
| import type {ServerConf} from "../../../../common/types.js"; | ||||
| import {generateNodeFromHtml} from "../../components/base.js"; | ||||
| import {ipcRenderer} from "../../typed-ipc-renderer.js"; | ||||
| import * as DomainUtil from "../../utils/domain-util.js"; | ||||
| import {html} from "../../../../common/html.ts"; | ||||
| import * as Messages from "../../../../common/messages.ts"; | ||||
| import * as t from "../../../../common/translation-util.ts"; | ||||
| import type {ServerConfig} from "../../../../common/types.ts"; | ||||
| import {generateNodeFromHtml} from "../../components/base.ts"; | ||||
| import {ipcRenderer} from "../../typed-ipc-renderer.ts"; | ||||
| import * as DomainUtil from "../../utils/domain-util.ts"; | ||||
|  | ||||
| type ServerInfoFormProps = { | ||||
| type ServerInfoFormProperties = { | ||||
|   $root: Element; | ||||
|   server: ServerConf; | ||||
|   server: ServerConfig; | ||||
|   index: number; | ||||
|   onChange: () => void; | ||||
| }; | ||||
|  | ||||
| export function initServerInfoForm(props: ServerInfoFormProps): void { | ||||
| export function initServerInfoForm(properties: ServerInfoFormProperties): void { | ||||
|   const $serverInfoForm = generateNodeFromHtml(html` | ||||
|     <div class="settings-card"> | ||||
|       <div class="server-info-left"> | ||||
|         <img class="server-info-icon" src="${props.server.icon}" /> | ||||
|         <img | ||||
|           class="server-info-icon" | ||||
|           src="${DomainUtil.iconAsUrl(properties.server.icon)}" | ||||
|         /> | ||||
|         <div class="server-info-row"> | ||||
|           <span class="server-info-alias">${props.server.alias}</span> | ||||
|           <span class="server-info-alias">${properties.server.alias}</span> | ||||
|           <i class="material-icons open-tab-button">open_in_new</i> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="server-info-right"> | ||||
|         <div class="server-info-row server-url"> | ||||
|           <span class="server-url-info" title="${props.server.url}" | ||||
|             >${props.server.url}</span | ||||
|           <span class="server-url-info" title="${properties.server.url}" | ||||
|             >${properties.server.url}</span | ||||
|           > | ||||
|         </div> | ||||
|         <div class="server-info-row"> | ||||
| @@ -45,21 +48,21 @@ export function initServerInfoForm(props: ServerInfoFormProps): void { | ||||
|     ".server-delete-action", | ||||
|   )!; | ||||
|   const $openServerButton = $serverInfoForm.querySelector(".open-tab-button")!; | ||||
|   props.$root.append($serverInfoForm); | ||||
|   properties.$root.append($serverInfoForm); | ||||
|  | ||||
|   $deleteServerButton.addEventListener("click", async () => { | ||||
|     const {response} = await dialog.showMessageBox({ | ||||
|       type: "warning", | ||||
|       buttons: [t.__("YES"), t.__("NO")], | ||||
|       buttons: [t.__("Yes"), t.__("No")], | ||||
|       defaultId: 0, | ||||
|       message: t.__("Are you sure you want to disconnect this organization?"), | ||||
|     }); | ||||
|     if (response === 0) { | ||||
|       if (DomainUtil.removeDomain(props.index)) { | ||||
|       if (DomainUtil.removeDomain(properties.index)) { | ||||
|         ipcRenderer.send("reload-full-app"); | ||||
|       } else { | ||||
|         const {title, content} = Messages.orgRemovalError( | ||||
|           DomainUtil.getDomain(props.index).url, | ||||
|           DomainUtil.getDomain(properties.index).url, | ||||
|         ); | ||||
|         dialog.showErrorBox(title, content); | ||||
|       } | ||||
| @@ -67,14 +70,14 @@ export function initServerInfoForm(props: ServerInfoFormProps): void { | ||||
|   }); | ||||
|  | ||||
|   $openServerButton.addEventListener("click", () => { | ||||
|     ipcRenderer.send("forward-message", "switch-server-tab", props.index); | ||||
|     ipcRenderer.send("forward-message", "switch-server-tab", properties.index); | ||||
|   }); | ||||
|  | ||||
|   $serverInfoAlias.addEventListener("click", () => { | ||||
|     ipcRenderer.send("forward-message", "switch-server-tab", props.index); | ||||
|     ipcRenderer.send("forward-message", "switch-server-tab", properties.index); | ||||
|   }); | ||||
|  | ||||
|   $serverIcon.addEventListener("click", () => { | ||||
|     ipcRenderer.send("forward-message", "switch-server-tab", props.index); | ||||
|     ipcRenderer.send("forward-message", "switch-server-tab", properties.index); | ||||
|   }); | ||||
| } | ||||
|   | ||||
| @@ -1,14 +1,14 @@ | ||||
| import {html} from "../../../../common/html.js"; | ||||
| import * as t from "../../../../common/translation-util.js"; | ||||
| import {html} from "../../../../common/html.ts"; | ||||
| import * as t from "../../../../common/translation-util.ts"; | ||||
|  | ||||
| import {reloadApp} from "./base-section.js"; | ||||
| import {initNewServerForm} from "./new-server-form.js"; | ||||
| import {reloadApp} from "./base-section.ts"; | ||||
| import {initNewServerForm} from "./new-server-form.ts"; | ||||
|  | ||||
| type ServersSectionProps = { | ||||
| type ServersSectionProperties = { | ||||
|   $root: Element; | ||||
| }; | ||||
|  | ||||
| export function initServersSection({$root}: ServersSectionProps): void { | ||||
| export function initServersSection({$root}: ServersSectionProperties): void { | ||||
|   $root.innerHTML = html` | ||||
|     <div class="add-server-modal"> | ||||
|       <div class="modal-container"> | ||||
|   | ||||
| @@ -1,15 +1,17 @@ | ||||
| import process from "node:process"; | ||||
|  | ||||
| import {html} from "../../../../common/html.js"; | ||||
| import * as LinkUtil from "../../../../common/link-util.js"; | ||||
| import * as t from "../../../../common/translation-util.js"; | ||||
| import {html} from "../../../../common/html.ts"; | ||||
| import * as LinkUtil from "../../../../common/link-util.ts"; | ||||
| import * as t from "../../../../common/translation-util.ts"; | ||||
|  | ||||
| type ShortcutsSectionProps = { | ||||
| type ShortcutsSectionProperties = { | ||||
|   $root: Element; | ||||
| }; | ||||
|  | ||||
| // eslint-disable-next-line complexity | ||||
| export function initShortcutsSection({$root}: ShortcutsSectionProps): void { | ||||
| export function initShortcutsSection({ | ||||
|   $root, | ||||
| }: ShortcutsSectionProperties): void { | ||||
|   const cmdOrCtrl = process.platform === "darwin" ? "⌘" : "Ctrl"; | ||||
|  | ||||
|   $root.innerHTML = html` | ||||
|   | ||||
| @@ -1,68 +1,21 @@ | ||||
| import {contextBridge, webFrame} from "electron/renderer"; | ||||
| import fs from "node:fs"; | ||||
| import {contextBridge} from "electron/renderer"; | ||||
|  | ||||
| import electron_bridge, {bridgeEvents} from "./electron-bridge.js"; | ||||
| import * as NetworkError from "./pages/network.js"; | ||||
| import {ipcRenderer} from "./typed-ipc-renderer.js"; | ||||
| import electron_bridge, {bridgeEvents} from "./electron-bridge.ts"; | ||||
| import * as NetworkError from "./pages/network.ts"; | ||||
| import {ipcRenderer} from "./typed-ipc-renderer.ts"; | ||||
|  | ||||
| contextBridge.exposeInMainWorld("raw_electron_bridge", electron_bridge); | ||||
| contextBridge.exposeInMainWorld("electron_bridge", electron_bridge); | ||||
|  | ||||
| ipcRenderer.on("logout", () => { | ||||
|   if (bridgeEvents.emit("logout")) { | ||||
|     return; | ||||
|   } | ||||
|  | ||||
|   // Create the menu for the below | ||||
|   const dropdown: HTMLElement = document.querySelector(".dropdown-toggle")!; | ||||
|   dropdown.click(); | ||||
|  | ||||
|   const nodes: NodeListOf<HTMLElement> = document.querySelectorAll( | ||||
|     ".dropdown-menu li:last-child a", | ||||
|   ); | ||||
|   nodes[nodes.length - 1].click(); | ||||
|   bridgeEvents.emit("logout"); | ||||
| }); | ||||
|  | ||||
| ipcRenderer.on("show-keyboard-shortcuts", () => { | ||||
|   if (bridgeEvents.emit("show-keyboard-shortcuts")) { | ||||
|     return; | ||||
|   } | ||||
|  | ||||
|   // Create the menu for the below | ||||
|   const node: HTMLElement = document.querySelector( | ||||
|     "a[data-overlay-trigger=keyboard-shortcuts]", | ||||
|   )!; | ||||
|   // Additional check | ||||
|   if (node.textContent!.trim().toLowerCase() === "keyboard shortcuts (?)") { | ||||
|     node.click(); | ||||
|   } else { | ||||
|     // Atleast click the dropdown | ||||
|     const dropdown: HTMLElement = document.querySelector(".dropdown-toggle")!; | ||||
|     dropdown.click(); | ||||
|   } | ||||
|   bridgeEvents.emit("show-keyboard-shortcuts"); | ||||
| }); | ||||
|  | ||||
| ipcRenderer.on("show-notification-settings", () => { | ||||
|   if (bridgeEvents.emit("show-notification-settings")) { | ||||
|     return; | ||||
|   } | ||||
|  | ||||
|   // Create the menu for the below | ||||
|   const dropdown: HTMLElement = document.querySelector(".dropdown-toggle")!; | ||||
|   dropdown.click(); | ||||
|  | ||||
|   const nodes: NodeListOf<HTMLElement> = document.querySelectorAll( | ||||
|     ".dropdown-menu li a", | ||||
|   ); | ||||
|   nodes[2].click(); | ||||
|  | ||||
|   const notificationItem: NodeListOf<HTMLElement> = document.querySelectorAll( | ||||
|     ".normal-settings-list li div", | ||||
|   ); | ||||
|  | ||||
|   // Wait until the notification dom element shows up | ||||
|   setTimeout(() => { | ||||
|     notificationItem[2].click(); | ||||
|   }, 100); | ||||
|   bridgeEvents.emit("show-notification-settings"); | ||||
| }); | ||||
|  | ||||
| window.addEventListener("load", () => { | ||||
| @@ -74,8 +27,3 @@ window.addEventListener("load", () => { | ||||
|   const $settingsButton = document.querySelector("#settings")!; | ||||
|   NetworkError.init($reconnectButton, $settingsButton); | ||||
| }); | ||||
|  | ||||
| (async () => | ||||
|   webFrame.executeJavaScript( | ||||
|     fs.readFileSync(require.resolve("./injected"), "utf8"), | ||||
|   ))(); | ||||
|   | ||||
| @@ -1,24 +1,21 @@ | ||||
| import type {NativeImage} from "electron/common"; | ||||
| import {nativeImage} from "electron/common"; | ||||
| import {type NativeImage, nativeImage} from "electron/common"; | ||||
| import type {Tray as ElectronTray} from "electron/main"; | ||||
| import path from "node:path"; | ||||
| import process from "node:process"; | ||||
|  | ||||
| import {BrowserWindow, Menu, Tray} from "@electron/remote"; | ||||
|  | ||||
| import * as ConfigUtil from "../../common/config-util.js"; | ||||
| import type {RendererMessage} from "../../common/typed-ipc.js"; | ||||
| import * as ConfigUtil from "../../common/config-util.ts"; | ||||
| import {publicPath} from "../../common/paths.ts"; | ||||
| import * as t from "../../common/translation-util.ts"; | ||||
| import type {RendererMessage} from "../../common/typed-ipc.ts"; | ||||
|  | ||||
| import type {ServerManagerView} from "./main.js"; | ||||
| import {ipcRenderer} from "./typed-ipc-renderer.js"; | ||||
| import type {ServerManagerView} from "./main.ts"; | ||||
| import {ipcRenderer} from "./typed-ipc-renderer.ts"; | ||||
|  | ||||
| let tray: ElectronTray | null = null; | ||||
|  | ||||
| const iconDir = "../../resources/tray"; | ||||
|  | ||||
| const traySuffix = "tray"; | ||||
|  | ||||
| const appIcon = path.join(__dirname, iconDir, traySuffix); | ||||
| const appIcon = path.join(publicPath, "resources/tray/tray"); | ||||
|  | ||||
| const iconPath = (): string => { | ||||
|   if (process.platform === "linux") { | ||||
| @@ -67,8 +64,8 @@ const config = { | ||||
|   thick: process.platform === "win32", | ||||
| }; | ||||
|  | ||||
| const renderCanvas = function (arg: number): HTMLCanvasElement { | ||||
|   config.unreadCount = arg; | ||||
| const renderCanvas = function (argument: number): HTMLCanvasElement { | ||||
|   config.unreadCount = argument; | ||||
|  | ||||
|   const size = config.size * config.pixelRatio; | ||||
|   const padding = size * 0.05; | ||||
| @@ -82,30 +79,34 @@ const renderCanvas = function (arg: number): HTMLCanvasElement { | ||||
|   const canvas = document.createElement("canvas"); | ||||
|   canvas.width = size; | ||||
|   canvas.height = size; | ||||
|   const ctx = canvas.getContext("2d")!; | ||||
|   const context = canvas.getContext("2d")!; | ||||
|  | ||||
|   // Circle | ||||
|   // If (!config.thick || config.thick && hasCount) { | ||||
|   ctx.beginPath(); | ||||
|   ctx.arc(center, center, size / 2 - padding, 0, 2 * Math.PI, false); | ||||
|   ctx.fillStyle = backgroundColor; | ||||
|   ctx.fill(); | ||||
|   ctx.lineWidth = size / (config.thick ? 10 : 20); | ||||
|   ctx.strokeStyle = backgroundColor; | ||||
|   ctx.stroke(); | ||||
|   context.beginPath(); | ||||
|   context.arc(center, center, size / 2 - padding, 0, 2 * Math.PI, false); | ||||
|   context.fillStyle = backgroundColor; | ||||
|   context.fill(); | ||||
|   context.lineWidth = size / (config.thick ? 10 : 20); | ||||
|   context.strokeStyle = backgroundColor; | ||||
|   context.stroke(); | ||||
|   // Count or Icon | ||||
|   if (hasCount) { | ||||
|     ctx.fillStyle = color; | ||||
|     ctx.textAlign = "center"; | ||||
|     context.fillStyle = color; | ||||
|     context.textAlign = "center"; | ||||
|     if (config.unreadCount > 99) { | ||||
|       ctx.font = `${config.thick ? "bold " : ""}${size * 0.4}px Helvetica`; | ||||
|       ctx.fillText("99+", center, center + size * 0.15); | ||||
|       context.font = `${config.thick ? "bold " : ""}${size * 0.4}px Helvetica`; | ||||
|       context.fillText("99+", center, center + size * 0.15); | ||||
|     } else if (config.unreadCount < 10) { | ||||
|       ctx.font = `${config.thick ? "bold " : ""}${size * 0.5}px Helvetica`; | ||||
|       ctx.fillText(String(config.unreadCount), center, center + size * 0.2); | ||||
|       context.font = `${config.thick ? "bold " : ""}${size * 0.5}px Helvetica`; | ||||
|       context.fillText(String(config.unreadCount), center, center + size * 0.2); | ||||
|     } else { | ||||
|       ctx.font = `${config.thick ? "bold " : ""}${size * 0.5}px Helvetica`; | ||||
|       ctx.fillText(String(config.unreadCount), center, center + size * 0.15); | ||||
|       context.font = `${config.thick ? "bold " : ""}${size * 0.5}px Helvetica`; | ||||
|       context.fillText( | ||||
|         String(config.unreadCount), | ||||
|         center, | ||||
|         center + size * 0.15, | ||||
|       ); | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -117,12 +118,12 @@ const renderCanvas = function (arg: number): HTMLCanvasElement { | ||||
|  * @param arg: Unread count | ||||
|  * @return the native image | ||||
|  */ | ||||
| const renderNativeImage = function (arg: number): NativeImage { | ||||
| const renderNativeImage = function (argument: number): NativeImage { | ||||
|   if (process.platform === "win32") { | ||||
|     return nativeImage.createFromPath(winUnreadTrayIconPath()); | ||||
|   } | ||||
|  | ||||
|   const canvas = renderCanvas(arg); | ||||
|   const canvas = renderCanvas(argument); | ||||
|   const pngData = nativeImage | ||||
|     .createFromDataURL(canvas.toDataURL("image/png")) | ||||
|     .toPNG(); | ||||
| @@ -133,7 +134,7 @@ const renderNativeImage = function (arg: number): NativeImage { | ||||
|  | ||||
| function sendAction<Channel extends keyof RendererMessage>( | ||||
|   channel: Channel, | ||||
|   ...args: Parameters<RendererMessage[Channel]> | ||||
|   ...arguments_: Parameters<RendererMessage[Channel]> | ||||
| ): void { | ||||
|   const win = BrowserWindow.getAllWindows()[0]; | ||||
|  | ||||
| @@ -141,19 +142,19 @@ function sendAction<Channel extends keyof RendererMessage>( | ||||
|     win.restore(); | ||||
|   } | ||||
|  | ||||
|   ipcRenderer.sendTo(win.webContents.id, channel, ...args); | ||||
|   ipcRenderer.send("forward-to", win.webContents.id, channel, ...arguments_); | ||||
| } | ||||
|  | ||||
| const createTray = function (): void { | ||||
|   const contextMenu = Menu.buildFromTemplate([ | ||||
|     { | ||||
|       label: "Zulip", | ||||
|       label: t.__("Zulip"), | ||||
|       click() { | ||||
|         ipcRenderer.send("focus-app"); | ||||
|       }, | ||||
|     }, | ||||
|     { | ||||
|       label: "Settings", | ||||
|       label: t.__("Settings"), | ||||
|       click() { | ||||
|         ipcRenderer.send("focus-app"); | ||||
|         sendAction("open-settings"); | ||||
| @@ -163,7 +164,7 @@ const createTray = function (): void { | ||||
|       type: "separator", | ||||
|     }, | ||||
|     { | ||||
|       label: "Quit", | ||||
|       label: t.__("Quit"), | ||||
|       click() { | ||||
|         ipcRenderer.send("quit-app"); | ||||
|       }, | ||||
| @@ -179,7 +180,7 @@ const createTray = function (): void { | ||||
| }; | ||||
|  | ||||
| export function initializeTray(serverManagerView: ServerManagerView) { | ||||
|   ipcRenderer.on("destroytray", (_event: Event) => { | ||||
|   ipcRenderer.on("destroytray", () => { | ||||
|     if (!tray) { | ||||
|       return; | ||||
|     } | ||||
| @@ -192,22 +193,27 @@ export function initializeTray(serverManagerView: ServerManagerView) { | ||||
|     } | ||||
|   }); | ||||
|  | ||||
|   ipcRenderer.on("tray", (_event: Event, arg: number): void => { | ||||
|   ipcRenderer.on("tray", (_event, argument: number): void => { | ||||
|     if (!tray) { | ||||
|       return; | ||||
|     } | ||||
|  | ||||
|     // We don't want to create tray from unread messages on macOS since it already has dock badges. | ||||
|     if (process.platform === "linux" || process.platform === "win32") { | ||||
|       if (arg === 0) { | ||||
|         unread = arg; | ||||
|       if (argument === 0) { | ||||
|         unread = argument; | ||||
|         tray.setImage(iconPath()); | ||||
|         tray.setToolTip("No unread messages"); | ||||
|         tray.setToolTip(t.__("No unread messages")); | ||||
|       } else { | ||||
|         unread = arg; | ||||
|         const image = renderNativeImage(arg); | ||||
|         unread = argument; | ||||
|         const image = renderNativeImage(argument); | ||||
|         tray.setImage(image); | ||||
|         tray.setToolTip(`${arg} unread messages`); | ||||
|         tray.setToolTip( | ||||
|           t.__mf( | ||||
|             "{number, plural, one {# unread message} other {# unread messages}}", | ||||
|             {number: `${argument}`}, | ||||
|           ), | ||||
|         ); | ||||
|       } | ||||
|     } | ||||
|   }); | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| import type {IpcRendererEvent} from "electron/renderer"; | ||||
| import { | ||||
|   type IpcRendererEvent, | ||||
|   ipcRenderer as untypedIpcRenderer, // eslint-disable-line no-restricted-imports | ||||
| } from "electron/renderer"; | ||||
|  | ||||
| @@ -10,8 +10,8 @@ import type { | ||||
| } from "../../common/typed-ipc.js"; | ||||
|  | ||||
| type RendererListener<Channel extends keyof RendererMessage> = | ||||
|   RendererMessage[Channel] extends (...args: infer Args) => void | ||||
|     ? (event: IpcRendererEvent, ...args: Args) => void | ||||
|   RendererMessage[Channel] extends (...arguments_: infer Arguments) => void | ||||
|     ? (event: IpcRendererEvent, ...arguments_: Arguments) => void | ||||
|     : never; | ||||
|  | ||||
| export const ipcRenderer: { | ||||
| @@ -35,19 +35,25 @@ export const ipcRenderer: { | ||||
|   send<Channel extends keyof RendererMessage>( | ||||
|     channel: "forward-message", | ||||
|     rendererChannel: Channel, | ||||
|     ...args: Parameters<RendererMessage[Channel]> | ||||
|     ...arguments_: Parameters<RendererMessage[Channel]> | ||||
|   ): void; | ||||
|   send<Channel extends keyof RendererMessage>( | ||||
|     channel: "forward-to", | ||||
|     webContentsId: number, | ||||
|     rendererChannel: Channel, | ||||
|     ...arguments_: Parameters<RendererMessage[Channel]> | ||||
|   ): void; | ||||
|   send<Channel extends keyof MainMessage>( | ||||
|     channel: Channel, | ||||
|     ...args: Parameters<MainMessage[Channel]> | ||||
|     ...arguments_: Parameters<MainMessage[Channel]> | ||||
|   ): void; | ||||
|   invoke<Channel extends keyof MainCall>( | ||||
|     channel: Channel, | ||||
|     ...args: Parameters<MainCall[Channel]> | ||||
|     ...arguments_: Parameters<MainCall[Channel]> | ||||
|   ): Promise<ReturnType<MainCall[Channel]>>; | ||||
|   sendSync<Channel extends keyof MainMessage>( | ||||
|     channel: Channel, | ||||
|     ...args: Parameters<MainMessage[Channel]> | ||||
|     ...arguments_: Parameters<MainMessage[Channel]> | ||||
|   ): ReturnType<MainMessage[Channel]>; | ||||
|   postMessage<Channel extends keyof MainMessage>( | ||||
|     channel: Channel, | ||||
| @@ -56,13 +62,8 @@ export const ipcRenderer: { | ||||
|       : never, | ||||
|     transfer?: MessagePort[], | ||||
|   ): void; | ||||
|   sendTo<Channel extends keyof RendererMessage>( | ||||
|     webContentsId: number, | ||||
|     channel: Channel, | ||||
|     ...args: Parameters<RendererMessage[Channel]> | ||||
|   ): void; | ||||
|   sendToHost<Channel extends keyof RendererMessage>( | ||||
|     channel: Channel, | ||||
|     ...args: Parameters<RendererMessage[Channel]> | ||||
|     ...arguments_: Parameters<RendererMessage[Channel]> | ||||
|   ): void; | ||||
| } = untypedIpcRenderer; | ||||
|   | ||||
| @@ -2,68 +2,78 @@ import fs from "node:fs"; | ||||
| import path from "node:path"; | ||||
|  | ||||
| import {app, dialog} from "@electron/remote"; | ||||
| import * as Sentry from "@sentry/electron"; | ||||
| import * as Sentry from "@sentry/electron/renderer"; | ||||
| import {JsonDB} from "node-json-db"; | ||||
| import {DataError} from "node-json-db/dist/lib/Errors"; | ||||
| import * as z from "zod"; | ||||
| import {DataError} from "node-json-db/dist/lib/Errors.js"; | ||||
| import {z} from "zod"; | ||||
|  | ||||
| import * as EnterpriseUtil from "../../../common/enterprise-util.js"; | ||||
| import Logger from "../../../common/logger-util.js"; | ||||
| import * as Messages from "../../../common/messages.js"; | ||||
| import type {ServerConf} from "../../../common/types.js"; | ||||
| import {ipcRenderer} from "../typed-ipc-renderer.js"; | ||||
| import * as EnterpriseUtil from "../../../common/enterprise-util.ts"; | ||||
| import Logger from "../../../common/logger-util.ts"; | ||||
| import * as Messages from "../../../common/messages.ts"; | ||||
| import * as t from "../../../common/translation-util.ts"; | ||||
| import type {ServerConfig} from "../../../common/types.ts"; | ||||
| import defaultIcon from "../../img/icon.png"; | ||||
| import {ipcRenderer} from "../typed-ipc-renderer.ts"; | ||||
|  | ||||
| const logger = new Logger({ | ||||
|   file: "domain-util.log", | ||||
| }); | ||||
|  | ||||
| const defaultIconUrl = "../renderer/img/icon.png"; | ||||
| // For historical reasons, we store this string in domain.json to denote a | ||||
| // missing icon; it does not change with the actual icon location. | ||||
| export const defaultIconSentinel = "../renderer/img/icon.png"; | ||||
|  | ||||
| const serverConfSchema = z.object({ | ||||
|   url: z.string(), | ||||
| const serverConfigSchema = z.object({ | ||||
|   url: z.url(), | ||||
|   alias: z.string(), | ||||
|   icon: z.string(), | ||||
|   zulipVersion: z.string().default("unknown"), | ||||
|   zulipFeatureLevel: z.number().default(0), | ||||
| }); | ||||
|  | ||||
| let db!: JsonDB; | ||||
| let database!: JsonDB; | ||||
|  | ||||
| reloadDb(); | ||||
| reloadDatabase(); | ||||
|  | ||||
| // Migrate from old schema | ||||
| try { | ||||
|   const oldDomain = db.getObject<unknown>("/domain"); | ||||
|   const oldDomain = database.getObject<unknown>("/domain"); | ||||
|   if (typeof oldDomain === "string") { | ||||
|     (async () => { | ||||
|       await addDomain({ | ||||
|         alias: "Zulip", | ||||
|         url: oldDomain, | ||||
|       }); | ||||
|       db.delete("/domain"); | ||||
|       database.delete("/domain"); | ||||
|     })(); | ||||
|   } | ||||
| } catch (error: unknown) { | ||||
|   if (!(error instanceof DataError)) throw error; | ||||
| } | ||||
|  | ||||
| export function getDomains(): ServerConf[] { | ||||
|   reloadDb(); | ||||
| export function getDomains(): ServerConfig[] { | ||||
|   reloadDatabase(); | ||||
|   try { | ||||
|     return serverConfSchema.array().parse(db.getObject<unknown>("/domains")); | ||||
|     return serverConfigSchema | ||||
|       .array() | ||||
|       .parse(database.getObject<unknown>("/domains")); | ||||
|   } catch (error: unknown) { | ||||
|     if (!(error instanceof DataError)) throw error; | ||||
|     return []; | ||||
|   } | ||||
| } | ||||
|  | ||||
| export function getDomain(index: number): ServerConf { | ||||
|   reloadDb(); | ||||
|   return serverConfSchema.parse(db.getObject<unknown>(`/domains[${index}]`)); | ||||
| export function getDomain(index: number): ServerConfig { | ||||
|   reloadDatabase(); | ||||
|   return serverConfigSchema.parse( | ||||
|     database.getObject<unknown>(`/domains[${index}]`), | ||||
|   ); | ||||
| } | ||||
|  | ||||
| export function updateDomain(index: number, server: ServerConf): void { | ||||
|   reloadDb(); | ||||
|   serverConfSchema.parse(server); | ||||
|   db.push(`/domains[${index}]`, server, true); | ||||
| export function updateDomain(index: number, server: ServerConfig): void { | ||||
|   reloadDatabase(); | ||||
|   serverConfigSchema.parse(server); | ||||
|   database.push(`/domains[${index}]`, server, true); | ||||
| } | ||||
|  | ||||
| export async function addDomain(server: { | ||||
| @@ -74,20 +84,20 @@ export async function addDomain(server: { | ||||
|   if (server.icon) { | ||||
|     const localIconUrl = await saveServerIcon(server.icon); | ||||
|     server.icon = localIconUrl; | ||||
|     serverConfSchema.parse(server); | ||||
|     db.push("/domains[]", server, true); | ||||
|     reloadDb(); | ||||
|     serverConfigSchema.parse(server); | ||||
|     database.push("/domains[]", server, true); | ||||
|     reloadDatabase(); | ||||
|   } else { | ||||
|     server.icon = defaultIconUrl; | ||||
|     serverConfSchema.parse(server); | ||||
|     db.push("/domains[]", server, true); | ||||
|     reloadDb(); | ||||
|     server.icon = defaultIconSentinel; | ||||
|     serverConfigSchema.parse(server); | ||||
|     database.push("/domains[]", server, true); | ||||
|     reloadDatabase(); | ||||
|   } | ||||
| } | ||||
|  | ||||
| export function removeDomains(): void { | ||||
|   db.delete("/domains"); | ||||
|   reloadDb(); | ||||
|   database.delete("/domains"); | ||||
|   reloadDatabase(); | ||||
| } | ||||
|  | ||||
| export function removeDomain(index: number): boolean { | ||||
| @@ -95,8 +105,8 @@ export function removeDomain(index: number): boolean { | ||||
|     return false; | ||||
|   } | ||||
|  | ||||
|   db.delete(`/domains[${index}]`); | ||||
|   reloadDb(); | ||||
|   database.delete(`/domains[${index}]`); | ||||
|   reloadDatabase(); | ||||
|   return true; | ||||
| } | ||||
|  | ||||
| @@ -109,7 +119,7 @@ export function duplicateDomain(domain: string): boolean { | ||||
| export async function checkDomain( | ||||
|   domain: string, | ||||
|   silent = false, | ||||
| ): Promise<ServerConf> { | ||||
| ): Promise<ServerConfig> { | ||||
|   if (!silent && duplicateDomain(domain)) { | ||||
|     // Do not check duplicate in silent mode | ||||
|     throw new Error("This server has been added."); | ||||
| @@ -124,36 +134,43 @@ export async function checkDomain( | ||||
|   } | ||||
| } | ||||
|  | ||||
| async function getServerSettings(domain: string): Promise<ServerConf> { | ||||
| async function getServerSettings(domain: string): Promise<ServerConfig> { | ||||
|   return ipcRenderer.invoke("get-server-settings", domain); | ||||
| } | ||||
|  | ||||
| export async function saveServerIcon(iconURL: string): Promise<string> { | ||||
|   return ipcRenderer.invoke("save-server-icon", iconURL); | ||||
|   return ( | ||||
|     (await ipcRenderer.invoke("save-server-icon", iconURL)) ?? | ||||
|     defaultIconSentinel | ||||
|   ); | ||||
| } | ||||
|  | ||||
| export async function updateSavedServer( | ||||
|   url: string, | ||||
|   index: number, | ||||
| ): Promise<void> { | ||||
| ): Promise<ServerConfig> { | ||||
|   // Does not promise successful update | ||||
|   const oldIcon = getDomain(index).icon; | ||||
|   const serverConfig = getDomain(index); | ||||
|   const oldIcon = serverConfig.icon; | ||||
|   try { | ||||
|     const newServerConf = await checkDomain(url, true); | ||||
|     const localIconUrl = await saveServerIcon(newServerConf.icon); | ||||
|     if (!oldIcon || localIconUrl !== "../renderer/img/icon.png") { | ||||
|       newServerConf.icon = localIconUrl; | ||||
|       updateDomain(index, newServerConf); | ||||
|       reloadDb(); | ||||
|     const newServerConfig = await checkDomain(url, true); | ||||
|     const localIconUrl = await saveServerIcon(newServerConfig.icon); | ||||
|     if (!oldIcon || localIconUrl !== defaultIconSentinel) { | ||||
|       newServerConfig.icon = localIconUrl; | ||||
|       updateDomain(index, newServerConfig); | ||||
|       reloadDatabase(); | ||||
|     } | ||||
|  | ||||
|     return newServerConfig; | ||||
|   } catch (error: unknown) { | ||||
|     logger.log("Could not update server icon."); | ||||
|     logger.log(error); | ||||
|     Sentry.captureException(error); | ||||
|     return serverConfig; | ||||
|   } | ||||
| } | ||||
|  | ||||
| function reloadDb(): void { | ||||
| function reloadDatabase(): void { | ||||
|   const domainJsonPath = path.join( | ||||
|     app.getPath("userData"), | ||||
|     "config/domain.json", | ||||
| @@ -165,9 +182,10 @@ function reloadDb(): void { | ||||
|     if (fs.existsSync(domainJsonPath)) { | ||||
|       fs.unlinkSync(domainJsonPath); | ||||
|       dialog.showErrorBox( | ||||
|         "Error saving new organization", | ||||
|         "There seems to be error while saving new organization, " + | ||||
|           "you may have to re-add your previous organizations back.", | ||||
|         t.__("Error saving new organization"), | ||||
|         t.__( | ||||
|           "There was an error while saving the new organization. You may have to add your previous organizations again.", | ||||
|         ), | ||||
|       ); | ||||
|       logger.error("Error while JSON parsing domain.json: "); | ||||
|       logger.error(error); | ||||
| @@ -175,7 +193,7 @@ function reloadDb(): void { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   db = new JsonDB(domainJsonPath, true, true); | ||||
|   database = new JsonDB(domainJsonPath, true, true); | ||||
| } | ||||
|  | ||||
| export function formatUrl(domain: string): string { | ||||
| @@ -189,3 +207,30 @@ export function formatUrl(domain: string): string { | ||||
|  | ||||
|   return `https://${domain}`; | ||||
| } | ||||
|  | ||||
| export function getUnsupportedMessage( | ||||
|   server: ServerConfig, | ||||
| ): string | undefined { | ||||
|   if (server.zulipFeatureLevel < 65 /* Zulip Server 4.0 */) { | ||||
|     const realm = new URL(server.url).hostname; | ||||
|     return t.__( | ||||
|       "{{{server}}} runs an outdated Zulip Server version {{{version}}}. It may not fully work in this app.", | ||||
|       {server: realm, version: server.zulipVersion}, | ||||
|     ); | ||||
|   } | ||||
|  | ||||
|   return undefined; | ||||
| } | ||||
|  | ||||
| export function iconAsUrl(iconPath: string): string { | ||||
|   if (iconPath === defaultIconSentinel) return defaultIcon; | ||||
|  | ||||
|   try { | ||||
|     return `data:application/octet-stream;base64,${fs.readFileSync( | ||||
|       iconPath, | ||||
|       "base64", | ||||
|     )}`; | ||||
|   } catch { | ||||
|     return defaultIcon; | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1,9 +1,10 @@ | ||||
| import * as backoff from "backoff"; | ||||
|  | ||||
| import {html} from "../../../common/html.js"; | ||||
| import Logger from "../../../common/logger-util.js"; | ||||
| import type WebView from "../components/webview.js"; | ||||
| import {ipcRenderer} from "../typed-ipc-renderer.js"; | ||||
| import {html} from "../../../common/html.ts"; | ||||
| import Logger from "../../../common/logger-util.ts"; | ||||
| import * as t from "../../../common/translation-util.ts"; | ||||
| import type WebView from "../components/webview.ts"; | ||||
| import {ipcRenderer} from "../typed-ipc-renderer.ts"; | ||||
|  | ||||
| const logger = new Logger({ | ||||
|   file: "domain-util.log", | ||||
| @@ -15,7 +16,7 @@ export default class ReconnectUtil { | ||||
|   fibonacciBackoff: backoff.Backoff; | ||||
|  | ||||
|   constructor(webview: WebView) { | ||||
|     this.url = webview.props.url; | ||||
|     this.url = webview.properties.url; | ||||
|     this.alreadyReloaded = false; | ||||
|     this.fibonacciBackoff = backoff.fibonacci({ | ||||
|       initialDelay: 5000, | ||||
| @@ -55,8 +56,10 @@ export default class ReconnectUtil { | ||||
|     const errorMessageHolder = document.querySelector("#description"); | ||||
|     if (errorMessageHolder) { | ||||
|       errorMessageHolder.innerHTML = html` | ||||
|         <div>Your internet connection doesn't seem to work properly!</div> | ||||
|         <div>Verify that it works and then click try again.</div> | ||||
|         <div> | ||||
|           ${t.__("Your internet connection doesn't seem to work properly!")} | ||||
|         </div> | ||||
|         <div>${t.__("Verify that it works and then click Reconnect.")}</div> | ||||
|       `.html; | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import {ipcRenderer} from "../typed-ipc-renderer.js"; | ||||
| import {ipcRenderer} from "../typed-ipc-renderer.ts"; | ||||
|  | ||||
| export const connectivityError: string[] = [ | ||||
|   "ERR_INTERNET_DISCONNECTED", | ||||
|   | ||||
							
								
								
									
										6
									
								
								app/renderer/js/zod-config.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								app/renderer/js/zod-config.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| import * as z from "zod"; | ||||
|  | ||||
| // In an Electron preload script, Content-Security-Policy only takes effect | ||||
| // after the page has loaded, which breaks Zod's detection of whether eval is | ||||
| // allowed. | ||||
| z.config({jitless: true}); | ||||
| @@ -1,56 +1,16 @@ | ||||
| <!DOCTYPE html> | ||||
| <!doctype html> | ||||
| <html lang="en" class="responsive desktop"> | ||||
|   <head> | ||||
|     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||||
|     <meta | ||||
|       http-equiv="Content-Security-Policy" | ||||
|       content="default-src 'none'; connect-src 'self'; font-src 'self'; img-src 'self' data:; script-src 'self'; style-src 'self' 'unsafe-inline'" | ||||
|     /> | ||||
|     <meta name="viewport" content="width=device-width" /> | ||||
|     <title>Zulip</title> | ||||
|     <link rel="stylesheet" href="css/fonts.css" /> | ||||
|     <link rel="stylesheet" href="css/main.css" type="text/css" media="screen" /> | ||||
|     <link rel="stylesheet" href="css/main.css" /> | ||||
|   </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 hidden" 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="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> | ||||
|     </div> | ||||
|   </body> | ||||
|   <body></body> | ||||
| </html> | ||||
|   | ||||
| @@ -1,7 +1,11 @@ | ||||
| <!DOCTYPE html> | ||||
| <!doctype html> | ||||
| <html lang="en" class="responsive desktop"> | ||||
|   <head> | ||||
|     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||||
|     <meta | ||||
|       http-equiv="Content-Security-Policy" | ||||
|       content="default-src 'none'; connect-src 'self'; img-src 'self'; script-src 'self'; style-src 'self'" | ||||
|     /> | ||||
|     <meta name="viewport" content="width=device-width" /> | ||||
|     <title>Zulip - Network Troubleshooting</title> | ||||
|     <link | ||||
|   | ||||
							
								
								
									
										10
									
								
								app/renderer/preference.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								app/renderer/preference.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | ||||
| <!doctype html> | ||||
| <meta charset="UTF-8" /> | ||||
| <link rel="stylesheet" href="css/fonts.css" /> | ||||
| <link rel="stylesheet" href="css/preference.css" /> | ||||
|  | ||||
| <!-- Initially hidden to prevent FOUC --> | ||||
| <div id="content" hidden> | ||||
|   <div id="sidebar"></div> | ||||
|   <div id="settings-container"></div> | ||||
| </div> | ||||
										
											Binary file not shown.
										
									
								
							| @@ -1,20 +0,0 @@ | ||||
| # How to help translate Zulip Desktop | ||||
|  | ||||
| These are _generated_ files (\*) that contain translations of the strings in | ||||
| the app. | ||||
|  | ||||
| You can help translate Zulip Desktop into your language! We do our | ||||
| translations in Transifex, which is a nice web app for collaborating on | ||||
| translations; a maintainer then syncs those translations into this repo. | ||||
| To help out, [join the Zulip project on | ||||
| Transifex](https://www.transifex.com/zulip/zulip/) and enter translations | ||||
| there. More details in the [Zulip contributor docs](https://zulip.readthedocs.io/en/latest/translating/translating.html#translators-workflow). | ||||
|  | ||||
| Within that Transifex project, if you'd like to focus on Zulip Desktop, look | ||||
| at `desktop.json`. The other resources there are for the Zulip web/mobile | ||||
| app, where translations are also very welcome. | ||||
|  | ||||
| (\*) One file is an exception: `en.json` is manually maintained as a | ||||
| list of (English) messages in the source code, and is used when we upload to | ||||
| Transifex a list of strings to be translated. It doesn't contain any | ||||
| translations. | ||||
| @@ -1,134 +0,0 @@ | ||||
| { | ||||
| 	"About Zulip": "Über Zulip", | ||||
| 	"Actual Size": "Tatsächliche Größe", | ||||
| 	"Add Custom Certificates": "Eigene Zertifikate hinzufügen", | ||||
| 	"Add Organization": "Organisation hinzufügen", | ||||
| 	"Add a Zulip organization": "Zulip-Organisation hinzufügen", | ||||
| 	"Add custom CSS": "Eigenes CSS hinzufügen", | ||||
| 	"Advanced": "Erweitert", | ||||
| 	"All the connected organizations will appear here": "Alle verbundenen Organisationen erscheinen hier", | ||||
| 	"Always start minimized": "Immer minimiert öffnen", | ||||
| 	"App Updates": "App Updates", | ||||
| 	"Appearance": "Erscheinungsbild", | ||||
| 	"Application Shortcuts": "App-Verknüpfungen", | ||||
| 	"Are you sure you want to disconnect this organization?": "Bist du dir sicher, dass du die Verbindung zur Organisation trennen möchtest?", | ||||
| 	"Auto hide Menu bar": "Menü automatisch verstecken", | ||||
| 	"Auto hide menu bar (Press Alt key to display)": "Menü automatisch verstecken (zum Anzeigen die Alt-Taste drücken)", | ||||
| 	"Back": "Zurück", | ||||
| 	"Bounce dock on new private message": "Im Dock hüpfen, wenn neue private Nachrichten eingehen", | ||||
| 	"Certificate file": "Zertifikatsdatei", | ||||
| 	"Change": "Ändern", | ||||
| 	"Check for Updates": "Auf Updates prüfen", | ||||
| 	"Close": "Schließen", | ||||
| 	"Connect": "Verbinden", | ||||
| 	"Connect to another organization": "Mit einer anderen Organisation verbinden", | ||||
| 	"Connected organizations": "Verbundene Organisationen", | ||||
| 	"Copy": "Kopieren", | ||||
| 	"Copy Zulip URL": "Zulip-URL kopieren", | ||||
| 	"Create a new organization": "Eine neue Organisation erstellen", | ||||
| 	"Cut": "Ausschneiden", | ||||
| 	"Default download location": "Voreingestelltes Ziel für Downloads", | ||||
| 	"Delete": "Löschen", | ||||
| 	"Desktop App Settings": "Einstellungen für Desktop-App", | ||||
| 	"Desktop Notifications": "Desktopbenachrichtigungen", | ||||
| 	"Desktop Settings": "Desktop-Einstellungen", | ||||
| 	"Disconnect": "Verbindung trennen", | ||||
| 	"Download App Logs": "Logdateien der App herunterladen", | ||||
| 	"Edit": "Bearbeiten", | ||||
| 	"Edit Shortcuts": "Tastenkürzel bearbeiten", | ||||
| 	"Enable auto updates": "Automatisch aktualisieren", | ||||
| 	"Enable error reporting (requires restart)": "Fehlerberichte aktivieren (erfordert Neustart)", | ||||
| 	"Enable spellchecker (requires restart)": "Rechtschreibprüfung aktivieren (erfordert Neustart)", | ||||
| 	"Factory Reset": "Alle Einstellungen auf Standardwerte zurücksetzen", | ||||
| 	"File": "Datei", | ||||
| 	"Find accounts": "Accounts finden", | ||||
| 	"Find accounts by email": "Accounts anhand E-Mail-Adresse finden", | ||||
| 	"Flash taskbar on new message": "Farbliche Hervorhebung in Taskbar bei neuen Nachrichten", | ||||
| 	"Forward": "Weiter", | ||||
| 	"Functionality": "Funktionalität", | ||||
| 	"General": "Allgemein", | ||||
| 	"Get beta updates": "Auf Betaversionen aktualisieren", | ||||
| 	"Hard Reload": "Komplett neu laden", | ||||
| 	"Help": "Hilfe", | ||||
| 	"Help Center": "Hilfe-Zentrum", | ||||
| 	"History": "Verlauf", | ||||
| 	"History Shortcuts": "Kurzbefehle für Verlauf", | ||||
| 	"Keyboard Shortcuts": "Tastenkürzel", | ||||
| 	"Log Out": "Abmelden", | ||||
| 	"Log Out of Organization": "Von Organisation abmelden", | ||||
| 	"Manual proxy configuration": "Manuelle Proxy-Konfiguration", | ||||
| 	"Minimize": "Minimieren", | ||||
| 	"Mute all sounds from Zulip": "Alle Zulip-Klänge stummschalten", | ||||
| 	"NO": "NEIN", | ||||
| 	"Network": "Netzwerk", | ||||
| 	"OR": "ODER", | ||||
| 	"Organization URL": "URL der Organisation", | ||||
| 	"Organizations": "Organisationen", | ||||
| 	"Paste": "Einfügen", | ||||
| 	"Paste and Match Style": "Ohne Formatierung einfügen", | ||||
| 	"Proxy": "Proxy", | ||||
| 	"Proxy bypass rules": "Proxy-Ausnahmen", | ||||
| 	"Proxy rules": "Proxy-Regeln", | ||||
| 	"Quit": "Beenden", | ||||
| 	"Quit Zulip": "Zulip beenden", | ||||
| 	"Redo": "Wiederholen", | ||||
| 	"Release Notes": "Hinweise zur Versionsfreigabe", | ||||
| 	"Reload": "Neu laden", | ||||
| 	"Report an Issue": "Ein Problem melden", | ||||
| 	"Save": "Speichern", | ||||
| 	"Select All": "Alles auswählen", | ||||
| 	"Settings": "Einstellungen", | ||||
| 	"Shortcuts": "Kurzbefehle", | ||||
| 	"Show App Logs": "Logdateien der App anzeigen", | ||||
| 	"Show app icon in system tray": "App-Icon in Systemleiste anzeigen", | ||||
| 	"Show app unread badge": "Anzahl ungelesener Nachrichten in App-Icon einblenden", | ||||
| 	"Show desktop notifications": "Desktopbenachrichtigungen anzeigen", | ||||
| 	"Show downloaded files in file manager": "Heruntergeladene Dateien in Dateimanager anzeigen", | ||||
| 	"Show sidebar": "Seitenleiste anzeigen", | ||||
| 	"Start app at login": "App beim Login automatisch starten", | ||||
| 	"Switch to Next Organization": "Zur nächsten Organisation wechseln", | ||||
| 	"Switch to Previous Organization": "Zur vorhergehenden Organisation wechseln", | ||||
| 	"These desktop app shortcuts extend the Zulip webapp's": "Dies sind zusätzliche Kurzbefehle in der Desktop-App gegenüber der Web-App", | ||||
| 	"This will delete all application data including all added accounts and preferences": "Hiermit werden alle Anwendungsdaten einschließlich aller Accounts und Einstellungen gelöscht", | ||||
| 	"Tip": "Tipp", | ||||
| 	"Toggle DevTools for Active Tab": "Entwickler-Tools für aktiven Tab umschalten", | ||||
| 	"Toggle DevTools for Zulip App": "Entwickler-Tools für Zulip-App umschalten", | ||||
| 	"Toggle Do Not Disturb": "Nicht-Stören-Modus umschalten", | ||||
| 	"Toggle Full Screen": "Vollbildschirm umschalten", | ||||
| 	"Toggle Sidebar": "Seitenleiste umschalten", | ||||
| 	"Toggle Tray Icon": "Tray-Icon umschalten", | ||||
| 	"Tools": "Extras", | ||||
| 	"Undo": "Rückgängig", | ||||
| 	"Upload": "Hochladen", | ||||
| 	"Use system proxy settings (requires restart)": "Systemweite Proxy-Einstellungen verwenden (erfordert Neustart)", | ||||
| 	"View": "Ansicht", | ||||
| 	"View Shortcuts": "Tastenkürzel anzeigen", | ||||
| 	"Window": "Fenster", | ||||
| 	"Window Shortcuts": "Kurzbefehle für Fenster", | ||||
| 	"YES": "JA", | ||||
| 	"Zoom In": "Vergrößern", | ||||
| 	"Zoom Out": "Verkleinern", | ||||
| 	"Zulip Help": "Hilfe zu Zulip", | ||||
| 	"keyboard shortcuts": "Tastenkürzel", | ||||
| 	"script": "Skript", | ||||
| 	"Quit when the window is closed": "Beim Schließen des Fensters beenden", | ||||
| 	"Ask where to save files before downloading": "Fragen, wo heruntergeladene Dateien gespeichert werden sollen", | ||||
| 	"Services": "Dienste", | ||||
| 	"Hide": "Verbergen", | ||||
| 	"Hide Others": "Andere verbergen", | ||||
| 	"Unhide": "Nicht mehr verbergen", | ||||
| 	"AddServer": "ServerHinzufügen", | ||||
| 	"App language (requires restart)": "Sprache der App (benötigt Neustart)", | ||||
| 	"Factory Reset Data": "Auf Werkseinstellung zurücksetzen", | ||||
| 	"Reset the application, thus deleting all the connected organizations, accounts, and certificates.": "Die App wird zurückgesetzt, somit werden alle verbundenen Organisationen, Konten und Zertifikate gelöscht.", | ||||
| 	"On macOS, the OS spellchecker is used.": "In macOS wird die OS Rechtschreibprüfung verwendet.", | ||||
| 	"Change the language from System Preferences → Keyboard → Text → Spelling.": "Ändere die Spracheinstellung über Systemeinstellungen → Tastatur → Text → Rechtschreibung.", | ||||
| 	"Copy Link": "Link kopieren", | ||||
| 	"Copy Image": "Bild kopieren", | ||||
| 	"Copy Image URL": "Bild-URL kopieren", | ||||
| 	"No Suggestion Found": "Keine Vorschläge gefunden", | ||||
| 	"You can select a maximum of 3 languages for spellchecking.": "Du kannst höchstens 3 Sprachen für die Rechtschreibprüfung auswählen.", | ||||
| 	"Spellchecker Languages": "Sprachen für die Rechtschreibprüfung", | ||||
| 	"Add to Dictionary": "Zum Wörterbuch hinzufügen", | ||||
| 	"Look Up": "Nachschlagen" | ||||
| } | ||||
| @@ -1,134 +0,0 @@ | ||||
| { | ||||
| 	"About Zulip": "About Zulip", | ||||
| 	"Actual Size": "Actual Size", | ||||
| 	"Add Custom Certificates": "Add Custom Certificates", | ||||
| 	"Add Organization": "Add Organization", | ||||
| 	"Add a Zulip organization": "Add a Zulip organization", | ||||
| 	"Add custom CSS": "Add custom CSS", | ||||
| 	"Advanced": "Advanced", | ||||
| 	"All the connected organizations will appear here": "All the connected organizations will appear here", | ||||
| 	"Always start minimized": "Always start minimized", | ||||
| 	"App Updates": "App Updates", | ||||
| 	"Appearance": "Appearance", | ||||
| 	"Application Shortcuts": "Application Shortcuts", | ||||
| 	"Are you sure you want to disconnect this organization?": "Are you sure you want to disconnect this organization?", | ||||
| 	"Auto hide Menu bar": "Auto hide Menu bar", | ||||
| 	"Auto hide menu bar (Press Alt key to display)": "Auto hide menu bar (Press Alt key to display)", | ||||
| 	"Back": "Back", | ||||
| 	"Bounce dock on new private message": "Bounce dock on new private message", | ||||
| 	"Certificate file": "Certificate file", | ||||
| 	"Change": "Change", | ||||
| 	"Check for Updates": "Check for Updates", | ||||
| 	"Close": "Close", | ||||
| 	"Connect": "Connect", | ||||
| 	"Connect to another organization": "Connect to another organization", | ||||
| 	"Connected organizations": "Connected organizations", | ||||
| 	"Copy": "Copy", | ||||
| 	"Copy Zulip URL": "Copy Zulip URL", | ||||
| 	"Create a new organization": "Create a new organization", | ||||
| 	"Cut": "Cut", | ||||
| 	"Default download location": "Default download location", | ||||
| 	"Delete": "Delete", | ||||
| 	"Desktop App Settings": "Desktop App Settings", | ||||
| 	"Desktop Notifications": "Desktop Notifications", | ||||
| 	"Desktop Settings": "Desktop Settings", | ||||
| 	"Disconnect": "Disconnect", | ||||
| 	"Download App Logs": "Download App Logs", | ||||
| 	"Edit": "Edit", | ||||
| 	"Edit Shortcuts": "Edit Shortcuts", | ||||
| 	"Enable auto updates": "Enable auto updates", | ||||
| 	"Enable error reporting (requires restart)": "Enable error reporting (requires restart)", | ||||
| 	"Enable spellchecker (requires restart)": "Enable spellchecker (requires restart)", | ||||
| 	"Factory Reset": "Factory Reset", | ||||
| 	"File": "File", | ||||
| 	"Find accounts": "Find accounts", | ||||
| 	"Find accounts by email": "Find accounts by email", | ||||
| 	"Flash taskbar on new message": "Flash taskbar on new message", | ||||
| 	"Forward": "Forward", | ||||
| 	"Functionality": "Functionality", | ||||
| 	"General": "General", | ||||
| 	"Get beta updates": "Get beta updates", | ||||
| 	"Hard Reload": "Hard Reload", | ||||
| 	"Help": "Help", | ||||
| 	"Help Center": "Help Center", | ||||
| 	"History": "History", | ||||
| 	"History Shortcuts": "History Shortcuts", | ||||
| 	"Keyboard Shortcuts": "Keyboard Shortcuts", | ||||
| 	"Log Out": "Log Out", | ||||
| 	"Log Out of Organization": "Log Out of Organization", | ||||
| 	"Manual proxy configuration": "Manual proxy configuration", | ||||
| 	"Minimize": "Minimize", | ||||
| 	"Mute all sounds from Zulip": "Mute all sounds from Zulip", | ||||
| 	"NO": "NO", | ||||
| 	"Network": "Network", | ||||
| 	"OR": "OR", | ||||
| 	"Organization URL": "Organization URL", | ||||
| 	"Organizations": "Organizations", | ||||
| 	"Paste": "Paste", | ||||
| 	"Paste and Match Style": "Paste and Match Style", | ||||
| 	"Proxy": "Proxy", | ||||
| 	"Proxy bypass rules": "Proxy bypass rules", | ||||
| 	"Proxy rules": "Proxy rules", | ||||
| 	"Quit": "Quit", | ||||
| 	"Quit Zulip": "Quit Zulip", | ||||
| 	"Redo": "Redo", | ||||
| 	"Release Notes": "Release Notes", | ||||
| 	"Reload": "Reload", | ||||
| 	"Report an Issue": "Report an Issue", | ||||
| 	"Save": "Save", | ||||
| 	"Select All": "Select All", | ||||
| 	"Settings": "Settings", | ||||
| 	"Shortcuts": "Shortcuts", | ||||
| 	"Show App Logs": "Show App Logs", | ||||
| 	"Show app icon in system tray": "Show app icon in system tray", | ||||
| 	"Show app unread badge": "Show app unread badge", | ||||
| 	"Show desktop notifications": "Show desktop notifications", | ||||
| 	"Show downloaded files in file manager": "Show downloaded files in file manager", | ||||
| 	"Show sidebar": "Show sidebar", | ||||
| 	"Start app at login": "Start app at login", | ||||
| 	"Switch to Next Organization": "Switch to Next Organization", | ||||
| 	"Switch to Previous Organization": "Switch to Previous Organization", | ||||
| 	"These desktop app shortcuts extend the Zulip webapp's": "These desktop app shortcuts extend the Zulip webapp's", | ||||
| 	"This will delete all application data including all added accounts and preferences": "This will delete all application data including all added accounts and preferences", | ||||
| 	"Tip": "Tip", | ||||
| 	"Toggle DevTools for Active Tab": "Toggle DevTools for Active Tab", | ||||
| 	"Toggle DevTools for Zulip App": "Toggle DevTools for Zulip App", | ||||
| 	"Toggle Do Not Disturb": "Toggle Do Not Disturb", | ||||
| 	"Toggle Full Screen": "Toggle Full Screen", | ||||
| 	"Toggle Sidebar": "Toggle Sidebar", | ||||
| 	"Toggle Tray Icon": "Toggle Tray Icon", | ||||
| 	"Tools": "Tools", | ||||
| 	"Undo": "Undo", | ||||
| 	"Upload": "Upload", | ||||
| 	"Use system proxy settings (requires restart)": "Use system proxy settings (requires restart)", | ||||
| 	"View": "View", | ||||
| 	"View Shortcuts": "View Shortcuts", | ||||
| 	"Window": "Window", | ||||
| 	"Window Shortcuts": "Window Shortcuts", | ||||
| 	"YES": "YES", | ||||
| 	"Zoom In": "Zoom In", | ||||
| 	"Zoom Out": "Zoom Out", | ||||
| 	"Zulip Help": "Zulip Help", | ||||
| 	"keyboard shortcuts": "keyboard shortcuts", | ||||
| 	"script": "script", | ||||
| 	"Quit when the window is closed": "Quit when the window is closed", | ||||
| 	"Ask where to save files before downloading": "Ask where to save files before downloading", | ||||
| 	"Services": "Services", | ||||
| 	"Hide": "Hide", | ||||
| 	"Hide Others": "Hide Others", | ||||
| 	"Unhide": "Unhide", | ||||
| 	"AddServer": "AddServer", | ||||
| 	"App language (requires restart)": "App language (requires restart)", | ||||
| 	"Factory Reset Data": "Factory Reset Data", | ||||
| 	"Reset the application, thus deleting all the connected organizations, accounts, and certificates.": "Reset the application, thus deleting all the connected organizations, accounts, and certificates.", | ||||
| 	"On macOS, the OS spellchecker is used.": "On macOS, the OS spellchecker is used.", | ||||
| 	"Change the language from System Preferences → Keyboard → Text → Spelling.": "Change the language from System Preferences → Keyboard → Text → Spelling.", | ||||
| 	"Copy Link": "Copy Link", | ||||
| 	"Copy Image": "Copy Image", | ||||
| 	"Copy Image URL": "Copy Image URL", | ||||
| 	"No Suggestion Found": "No Suggestion Found", | ||||
| 	"You can select a maximum of 3 languages for spellchecking.": "You can select a maximum of 3 languages for spellchecking.", | ||||
| 	"Spellchecker Languages": "Spellchecker Languages", | ||||
| 	"Add to Dictionary": "Add to Dictionary", | ||||
| 	"Look Up": "Look Up" | ||||
| } | ||||
| @@ -1,119 +0,0 @@ | ||||
| { | ||||
| 	"About Zulip": "About Zulip", | ||||
| 	"Actual Size": "Actual Size", | ||||
| 	"Add Custom Certificates": "Add Custom Certificates", | ||||
| 	"Add Organization": "Add Organization", | ||||
| 	"Add a Zulip organization": "Add a Zulip organization", | ||||
| 	"Add custom CSS": "Add custom CSS", | ||||
| 	"Advanced": "Advanced", | ||||
| 	"All the connected organizations will appear here": "All the connected organizations will appear here", | ||||
| 	"Always start minimized": "Always start minimized", | ||||
| 	"App Updates": "App Updates", | ||||
| 	"Appearance": "Appearance", | ||||
| 	"Application Shortcuts": "Application Shortcuts", | ||||
| 	"Are you sure you want to disconnect this organization?": "Are you sure you want to disconnect this organization?", | ||||
| 	"Auto hide Menu bar": "Auto hide Menu bar", | ||||
| 	"Auto hide menu bar (Press Alt key to display)": "Auto hide menu bar (Press Alt key to display)", | ||||
| 	"Back": "Back", | ||||
| 	"Bounce dock on new private message": "Bounce dock on new private message", | ||||
| 	"Certificate file": "Certificate file", | ||||
| 	"Change": "Change", | ||||
| 	"Check for Updates": "Check for Updates", | ||||
| 	"Close": "Close", | ||||
| 	"Connect": "Connect", | ||||
| 	"Connect to another organization": "Connect to another organization", | ||||
| 	"Connected organizations": "Connected organizations", | ||||
| 	"Copy": "Copy", | ||||
| 	"Copy Zulip URL": "Copy Zulip URL", | ||||
| 	"Create a new organization": "Create a new organization", | ||||
| 	"Cut": "Cut", | ||||
| 	"Default download location": "Default download location", | ||||
| 	"Delete": "Delete", | ||||
| 	"Desktop App Settings": "Desktop App Settings", | ||||
| 	"Desktop Notifications": "Desktop Notifications", | ||||
| 	"Desktop Settings": "Desktop Settings", | ||||
| 	"Disconnect": "Disconnect", | ||||
| 	"Download App Logs": "Download App Logs", | ||||
| 	"Edit": "Edit", | ||||
| 	"Edit Shortcuts": "Edit Shortcuts", | ||||
| 	"Enable auto updates": "Enable auto updates", | ||||
| 	"Enable error reporting (requires restart)": "Enable error reporting (requires restart)", | ||||
| 	"Enable spellchecker (requires restart)": "Enable spellchecker (requires restart)", | ||||
| 	"Factory Reset": "Factory Reset", | ||||
| 	"File": "File", | ||||
| 	"Find accounts": "Find accounts", | ||||
| 	"Find accounts by email": "Find accounts by email", | ||||
| 	"Flash taskbar on new message": "Flash taskbar on new message", | ||||
| 	"Forward": "Forward", | ||||
| 	"Functionality": "Functionality", | ||||
| 	"General": "General", | ||||
| 	"Get beta updates": "Get beta updates", | ||||
| 	"Hard Reload": "Hard Reload", | ||||
| 	"Help": "Help", | ||||
| 	"Help Center": "Help Center", | ||||
| 	"History": "History", | ||||
| 	"History Shortcuts": "History Shortcuts", | ||||
| 	"Keyboard Shortcuts": "Keyboard Shortcuts", | ||||
| 	"Log Out": "Log Out", | ||||
| 	"Log Out of Organization": "Log Out of Organization", | ||||
| 	"Manual proxy configuration": "Manual proxy configuration", | ||||
| 	"Minimize": "Minimize", | ||||
| 	"Mute all sounds from Zulip": "Mute all sounds from Zulip", | ||||
| 	"NO": "NO", | ||||
| 	"Network": "Network", | ||||
| 	"OR": "OR", | ||||
| 	"Organization URL": "Organization URL", | ||||
| 	"Organizations": "Organizations", | ||||
| 	"Paste": "Paste", | ||||
| 	"Paste and Match Style": "Paste and Match Style", | ||||
| 	"Proxy": "Proxy", | ||||
| 	"Proxy bypass rules": "Proxy bypass rules", | ||||
| 	"Proxy rules": "Proxy rules", | ||||
| 	"Quit": "Quit", | ||||
| 	"Quit Zulip": "Quit Zulip", | ||||
| 	"Redo": "Redo", | ||||
| 	"Release Notes": "Release Notes", | ||||
| 	"Reload": "Reload", | ||||
| 	"Report an Issue": "Report an Issue", | ||||
| 	"Reset App Data": "Reset App Data", | ||||
| 	"Reset App Settings": "Reset App Settings", | ||||
| 	"Reset Application Data": "Reset Application Data", | ||||
| 	"Save": "Save", | ||||
| 	"Select All": "Select All", | ||||
| 	"Settings": "Settings", | ||||
| 	"Shortcuts": "Shortcuts", | ||||
| 	"Show App Logs": "Show App Logs", | ||||
| 	"Show app icon in system tray": "Show app icon in system tray", | ||||
| 	"Show app unread badge": "Show app unread badge", | ||||
| 	"Show desktop notifications": "Show desktop notifications", | ||||
| 	"Show downloaded files in file manager": "Show downloaded files in file manager", | ||||
| 	"Show sidebar": "Show sidebar", | ||||
| 	"Start app at login": "Start app at login", | ||||
| 	"Switch to Next Organization": "Switch to Next Organization", | ||||
| 	"Switch to Previous Organization": "Switch to Previous Organization", | ||||
| 	"These desktop app shortcuts extend the Zulip webapp's": "These desktop app shortcuts extend the Zulip webapp's", | ||||
| 	"This will delete all application data including all added accounts and preferences": "This will delete all application data including all added accounts and preferences", | ||||
| 	"Tip": "Tip", | ||||
| 	"Toggle DevTools for Active Tab": "Toggle DevTools for Active Tab", | ||||
| 	"Toggle DevTools for Zulip App": "Toggle DevTools for Zulip App", | ||||
| 	"Toggle Do Not Disturb": "Toggle Do Not Disturb", | ||||
| 	"Toggle Full Screen": "Toggle Full Screen", | ||||
| 	"Toggle Sidebar": "Toggle Sidebar", | ||||
| 	"Toggle Tray Icon": "Toggle Tray Icon", | ||||
| 	"Tools": "Tools", | ||||
| 	"Undo": "Undo", | ||||
| 	"Upload": "Upload", | ||||
| 	"Use system proxy settings (requires restart)": "Use system proxy settings (requires restart)", | ||||
| 	"View": "View", | ||||
| 	"View Shortcuts": "View Shortcuts", | ||||
| 	"Window": "Window", | ||||
| 	"Window Shortcuts": "Window Shortcuts", | ||||
| 	"YES": "YES", | ||||
| 	"Zoom In": "Zoom In", | ||||
| 	"Zoom Out": "Zoom Out", | ||||
| 	"Zulip Help": "Zulip Help", | ||||
| 	"keyboard shortcuts": "keyboard shortcuts", | ||||
| 	"script": "script", | ||||
| 	"Quit when the window is closed": "Quit when the window is closed", | ||||
| 	"Ask where to save files before downloading": "Ask where to save files before downloading" | ||||
| } | ||||
| @@ -1,134 +0,0 @@ | ||||
| { | ||||
| 	"About Zulip": "Acerca de Zulip", | ||||
| 	"Actual Size": "Tamaño actual", | ||||
| 	"Add Custom Certificates": "Añadir certificados personalizados", | ||||
| 	"Add Organization": "Añadir organización", | ||||
| 	"Add a Zulip organization": "Añadir una organización de Zulip", | ||||
| 	"Add custom CSS": "Añadir CSS personalizado", | ||||
| 	"Advanced": "Avanzado", | ||||
| 	"All the connected organizations will appear here": "Todas las organizaciones conectadas aparecerán aquí", | ||||
| 	"Always start minimized": "Iniciar siempre minimizado", | ||||
| 	"App Updates": "Actualizaciones de la aplicación", | ||||
| 	"Appearance": "Apariencia", | ||||
| 	"Application Shortcuts": "Atajos de la aplicación", | ||||
| 	"Are you sure you want to disconnect this organization?": "Estas seguro de desconectar esta organización?", | ||||
| 	"Auto hide Menu bar": "Ocultar la barra de menú automáticamente", | ||||
| 	"Auto hide menu bar (Press Alt key to display)": "Ocultar la barra de menú automáticamente (mantén tecla Alt para mostrar)", | ||||
| 	"Back": "Atrás", | ||||
| 	"Bounce dock on new private message": "Rebotar dock cuando se reciba un nuevo mensaje privado", | ||||
| 	"Certificate file": "Archivo de certificado", | ||||
| 	"Change": "Cambiar", | ||||
| 	"Check for Updates": "Comprobar actualizaciones", | ||||
| 	"Close": "Cerrar", | ||||
| 	"Connect": "Conectar", | ||||
| 	"Connect to another organization": "Conectar a otra organización", | ||||
| 	"Connected organizations": "Organizaciones conectada", | ||||
| 	"Copy": "Copiar", | ||||
| 	"Copy Zulip URL": "Copiar URL de Zulip", | ||||
| 	"Create a new organization": "Crear una nueva organización", | ||||
| 	"Cut": "Cortar", | ||||
| 	"Default download location": "Ubicación por defecto de descargas", | ||||
| 	"Delete": "Eliminar", | ||||
| 	"Desktop App Settings": "Ajustes de la aplicación de escritorio", | ||||
| 	"Desktop Notifications": "Notificaciones de escritorio", | ||||
| 	"Desktop Settings": "Ajustes de escritorio", | ||||
| 	"Disconnect": "Desconectar", | ||||
| 	"Download App Logs": "Descargar registros de la aplicación", | ||||
| 	"Edit": "Editar", | ||||
| 	"Edit Shortcuts": "Editar atajos", | ||||
| 	"Enable auto updates": "Activar actualizaciones automáticas", | ||||
| 	"Enable error reporting (requires restart)": "Activar reporte de fallos (necesita reinicio)", | ||||
| 	"Enable spellchecker (requires restart)": "Activar corrector ortográfico (necesita reinicio)", | ||||
| 	"Factory Reset": "Reinicio de fábrica", | ||||
| 	"File": "Archivo", | ||||
| 	"Find accounts": "Encontrar cuentas", | ||||
| 	"Find accounts by email": "Encontrar cuentas por correo electrónico", | ||||
| 	"Flash taskbar on new message": "Hacer que la barra de tareas parpadee cuando se reciba un mensaje nuevo", | ||||
| 	"Forward": "Reenviar", | ||||
| 	"Functionality": "Funcionalidad", | ||||
| 	"General": "General", | ||||
| 	"Get beta updates": "Obtener actualizaciones beta", | ||||
| 	"Hard Reload": "Recarga forzosa", | ||||
| 	"Help": "Ayuda", | ||||
| 	"Help Center": "Centro de ayuda", | ||||
| 	"History": "Historial", | ||||
| 	"History Shortcuts": "Atajos del historial", | ||||
| 	"Keyboard Shortcuts": "Atajos de teclado", | ||||
| 	"Log Out": "Cerrar sesión", | ||||
| 	"Log Out of Organization": "Cerrar sesión de organización", | ||||
| 	"Manual proxy configuration": "Configuración de proxy manual", | ||||
| 	"Minimize": "Minimizar", | ||||
| 	"Mute all sounds from Zulip": "Silenciar todos los sonidos de Zulip", | ||||
| 	"NO": "NO", | ||||
| 	"Network": "Red", | ||||
| 	"OR": "O", | ||||
| 	"Organization URL": "URL de la organización", | ||||
| 	"Organizations": "Organizaciones", | ||||
| 	"Paste": "Pegar", | ||||
| 	"Paste and Match Style": "Pegar y mantener estilo", | ||||
| 	"Proxy": "Proxy", | ||||
| 	"Proxy bypass rules": "Reglas para ignorar proxy", | ||||
| 	"Proxy rules": "Reglas del proxy", | ||||
| 	"Quit": "Cerrar", | ||||
| 	"Quit Zulip": "Cerrar Zulip", | ||||
| 	"Redo": "Rehacer", | ||||
| 	"Release Notes": "Notas de la versión", | ||||
| 	"Reload": "Recargar", | ||||
| 	"Report an Issue": "Informar de un error", | ||||
| 	"Save": "Guardar", | ||||
| 	"Select All": "Seleccionar todo", | ||||
| 	"Settings": "Ajustes", | ||||
| 	"Shortcuts": "Atajos de teclado", | ||||
| 	"Show App Logs": "Mostrar registros de la aplicación", | ||||
| 	"Show app icon in system tray": "Mostrar un icono de la aplicación en la bandeja del sistema", | ||||
| 	"Show app unread badge": "Mostrar un globo en el icono si hay mensajes sin leer", | ||||
| 	"Show desktop notifications": "Mostrar notificaciones de escritorio", | ||||
| 	"Show downloaded files in file manager": "Mostrar archivos descargados en el explorador", | ||||
| 	"Show sidebar": "Mostrar barra lateral", | ||||
| 	"Start app at login": "Lanzar aplicación al inicio", | ||||
| 	"Switch to Next Organization": "Cambiar a la siguiente organización", | ||||
| 	"Switch to Previous Organization": "Cambiar a la anterior organización", | ||||
| 	"These desktop app shortcuts extend the Zulip webapp's": "Estos atajos de la aplicación de escritorio extienden los ya existentes en Zulip", | ||||
| 	"This will delete all application data including all added accounts and preferences": "Esto borrará todos los datos de la aplicación, incluyendo cuentas añadidas y preferencia", | ||||
| 	"Tip": "Consej", | ||||
| 	"Toggle DevTools for Active Tab": "Activar/desactivar herramientas de desarrollador para la pestaña activa", | ||||
| 	"Toggle DevTools for Zulip App": "Activar/desactivar herramientas de desarrollador para la aplicación de Zulip", | ||||
| 	"Toggle Do Not Disturb": "Activar/desactivar no molestar", | ||||
| 	"Toggle Full Screen": "Activar/desactivar pantalla completa", | ||||
| 	"Toggle Sidebar": "Activar/desactivar barra lateral", | ||||
| 	"Toggle Tray Icon": "Activar/desactivar icono en bandeja del sistema", | ||||
| 	"Tools": "Herramientas", | ||||
| 	"Undo": "Deshacer", | ||||
| 	"Upload": "Subir", | ||||
| 	"Use system proxy settings (requires restart)": "Usar ajustes de proxy del sistema (necesita reinicio)", | ||||
| 	"View": "Ver", | ||||
| 	"View Shortcuts": "Ver atajos", | ||||
| 	"Window": "Ventana", | ||||
| 	"Window Shortcuts": "Atajos de ventana", | ||||
| 	"YES": "SÍ", | ||||
| 	"Zoom In": "Aumentar zoom", | ||||
| 	"Zoom Out": "Reducir zoom", | ||||
| 	"Zulip Help": "Ayuda sobre Zulip", | ||||
| 	"keyboard shortcuts": "atajos de teclado", | ||||
| 	"script": "script", | ||||
| 	"Quit when the window is closed": "Salir cuando la ventana se cierre", | ||||
| 	"Ask where to save files before downloading": "Preguntar dónde guardar los archivos antes de descargar", | ||||
| 	"Services": "Servicios", | ||||
| 	"Hide": "Ocultar", | ||||
| 	"Hide Others": "Ocultar otros", | ||||
| 	"Unhide": "Dejar de ocultar", | ||||
| 	"AddServer": "AddServer", | ||||
| 	"App language (requires restart)": "Idioma de la aplicación (requiere reinicio)", | ||||
| 	"Factory Reset Data": "Factory Reset Data", | ||||
| 	"Reset the application, thus deleting all the connected organizations, accounts, and certificates.": "Reinicia la aplicación, borrando todas las organizaciones, cuentas y certificados conectados.", | ||||
| 	"On macOS, the OS spellchecker is used.": "En macOS se utiliza la verificación ortográfica del sistema operativo.", | ||||
| 	"Change the language from System Preferences → Keyboard → Text → Spelling.": "Modifica el idioma en Preferencias del sistema → Teclado → Texto → Ortografía.", | ||||
| 	"Copy Link": "Copiar enlace", | ||||
| 	"Copy Image": "Copiar imagen", | ||||
| 	"Copy Image URL": "Copiar URL de la imagen", | ||||
| 	"No Suggestion Found": "No se encontró ninguna sugerencia", | ||||
| 	"You can select a maximum of 3 languages for spellchecking.": "Puedes elegir un máximo de 3 idiomas para la verificación ortográfica.", | ||||
| 	"Spellchecker Languages": "Idiomas de verificación ortográfica", | ||||
| 	"Add to Dictionary": "Añadir al diccionario", | ||||
| 	"Look Up": "Consultar" | ||||
| } | ||||
| @@ -1,134 +0,0 @@ | ||||
| { | ||||
| 	"About Zulip": "درباره Zulip ", | ||||
| 	"Actual Size": "اندازه واقعی", | ||||
| 	"Add Custom Certificates": "اضافه کردن مجوز دلخواه", | ||||
| 	"Add Organization": "اضافه کردن سازمان", | ||||
| 	"Add a Zulip organization": "اضافه کردن سازمان Zulip", | ||||
| 	"Add custom CSS": "اضافه کردن CSS دلخواه", | ||||
| 	"Advanced": "پیشرفته", | ||||
| 	"All the connected organizations will appear here": "همه سازمانهای متصل شده اینجا نمایش داده میشوند", | ||||
| 	"Always start minimized": "همواره به صورت کوچک شده اجرا شو", | ||||
| 	"App Updates": "بهروزرسانیهای برنامه", | ||||
| 	"Appearance": "شمایل", | ||||
| 	"Application Shortcuts": "میانبرهای برنامه", | ||||
| 	"Are you sure you want to disconnect this organization?": "آیا از قطع ارتباط از سازمان اطمینان دارید؟", | ||||
| 	"Auto hide Menu bar": "مخفیسازی خودکار نوار منو", | ||||
| 	"Auto hide menu bar (Press Alt key to display)": "مخفیسازی خودکار نوار منو (برای نمایش دکمه Alt را بزنید)", | ||||
| 	"Back": "عقب", | ||||
| 	"Bounce dock on new private message": "Bounce dock on new private message", | ||||
| 	"Certificate file": "فایل مجوز", | ||||
| 	"Change": "تغییر دادن", | ||||
| 	"Check for Updates": "بررسی برای بهروزرسانی", | ||||
| 	"Close": "بستن", | ||||
| 	"Connect": "اتصال", | ||||
| 	"Connect to another organization": "اتصال به یک سازمان دیگر", | ||||
| 	"Connected organizations": "سازمانهای وصل شده", | ||||
| 	"Copy": "رونوشت", | ||||
| 	"Copy Zulip URL": "رونوشت از Zulip URL", | ||||
| 	"Create a new organization": "ایجاد سازمان جدید", | ||||
| 	"Cut": "بریدن", | ||||
| 	"Default download location": "محل پیشفرض دانلود", | ||||
| 	"Delete": "حذف", | ||||
| 	"Desktop App Settings": "Desktop App Settings", | ||||
| 	"Desktop Notifications": "اطلاعرسانیهای دسکتاپ", | ||||
| 	"Desktop Settings": "تنظیمات دسکتاپ", | ||||
| 	"Disconnect": "Disconnect", | ||||
| 	"Download App Logs": "Download App Logs", | ||||
| 	"Edit": "ویرایش", | ||||
| 	"Edit Shortcuts": "ویرایش میانبرها", | ||||
| 	"Enable auto updates": "Enable auto updates", | ||||
| 	"Enable error reporting (requires restart)": "Enable error reporting (requires restart)", | ||||
| 	"Enable spellchecker (requires restart)": "Enable spellchecker (requires restart)", | ||||
| 	"Factory Reset": "Factory Reset", | ||||
| 	"File": "فایل", | ||||
| 	"Find accounts": "پیدا کردن حساب های کاربری ", | ||||
| 	"Find accounts by email": "Find accounts by email", | ||||
| 	"Flash taskbar on new message": "Flash taskbar on new message", | ||||
| 	"Forward": "Forward", | ||||
| 	"Functionality": "Functionality", | ||||
| 	"General": "عمومی", | ||||
| 	"Get beta updates": "Get beta updates", | ||||
| 	"Hard Reload": "Hard Reload", | ||||
| 	"Help": "کمک", | ||||
| 	"Help Center": "مرکز کمک", | ||||
| 	"History": "تاریخچه ", | ||||
| 	"History Shortcuts": "تاریخچه میانبرها", | ||||
| 	"Keyboard Shortcuts": "میانبرهای صفحهکلید", | ||||
| 	"Log Out": "خروج", | ||||
| 	"Log Out of Organization": "Log Out of Organization", | ||||
| 	"Manual proxy configuration": "Manual proxy configuration", | ||||
| 	"Minimize": "Minimize", | ||||
| 	"Mute all sounds from Zulip": "Mute all sounds from Zulip", | ||||
| 	"NO": "NO", | ||||
| 	"Network": "Network", | ||||
| 	"OR": "یا", | ||||
| 	"Organization URL": "URL سازمان", | ||||
| 	"Organizations": "Organizations", | ||||
| 	"Paste": "Paste", | ||||
| 	"Paste and Match Style": "Paste and Match Style", | ||||
| 	"Proxy": "Proxy", | ||||
| 	"Proxy bypass rules": "Proxy bypass rules", | ||||
| 	"Proxy rules": "Proxy rules", | ||||
| 	"Quit": "Quit", | ||||
| 	"Quit Zulip": "Quit Zulip", | ||||
| 	"Redo": "Redo", | ||||
| 	"Release Notes": "Release Notes", | ||||
| 	"Reload": "Reload", | ||||
| 	"Report an Issue": "Report an Issue", | ||||
| 	"Save": "ذخیره", | ||||
| 	"Select All": "Select All", | ||||
| 	"Settings": "تنظیمات", | ||||
| 	"Shortcuts": "Shortcuts", | ||||
| 	"Show App Logs": "Show App Logs", | ||||
| 	"Show app icon in system tray": "Show app icon in system tray", | ||||
| 	"Show app unread badge": "Show app unread badge", | ||||
| 	"Show desktop notifications": "Show desktop notifications", | ||||
| 	"Show downloaded files in file manager": "Show downloaded files in file manager", | ||||
| 	"Show sidebar": "Show sidebar", | ||||
| 	"Start app at login": "Start app at login", | ||||
| 	"Switch to Next Organization": "Switch to Next Organization", | ||||
| 	"Switch to Previous Organization": "Switch to Previous Organization", | ||||
| 	"These desktop app shortcuts extend the Zulip webapp's": "These desktop app shortcuts extend the Zulip webapp's", | ||||
| 	"This will delete all application data including all added accounts and preferences": "This will delete all application data including all added accounts and preferences", | ||||
| 	"Tip": "Tip", | ||||
| 	"Toggle DevTools for Active Tab": "Toggle DevTools for Active Tab", | ||||
| 	"Toggle DevTools for Zulip App": "Toggle DevTools for Zulip App", | ||||
| 	"Toggle Do Not Disturb": "Toggle Do Not Disturb", | ||||
| 	"Toggle Full Screen": "Toggle Full Screen", | ||||
| 	"Toggle Sidebar": "Toggle Sidebar", | ||||
| 	"Toggle Tray Icon": "Toggle Tray Icon", | ||||
| 	"Tools": "Tools", | ||||
| 	"Undo": "Undo", | ||||
| 	"Upload": "Upload", | ||||
| 	"Use system proxy settings (requires restart)": "Use system proxy settings (requires restart)", | ||||
| 	"View": "View", | ||||
| 	"View Shortcuts": "View Shortcuts", | ||||
| 	"Window": "Window", | ||||
| 	"Window Shortcuts": "Window Shortcuts", | ||||
| 	"YES": "YES", | ||||
| 	"Zoom In": "Zoom In", | ||||
| 	"Zoom Out": "Zoom Out", | ||||
| 	"Zulip Help": "Zulip Help", | ||||
| 	"keyboard shortcuts": "keyboard shortcuts", | ||||
| 	"script": "script", | ||||
| 	"Quit when the window is closed": "Quit when the window is closed", | ||||
| 	"Ask where to save files before downloading": "Ask where to save files before downloading", | ||||
| 	"Services": "Services", | ||||
| 	"Hide": "Hide", | ||||
| 	"Hide Others": "Hide Others", | ||||
| 	"Unhide": "Unhide", | ||||
| 	"AddServer": "AddServer", | ||||
| 	"App language (requires restart)": "App language (requires restart)", | ||||
| 	"Factory Reset Data": "Factory Reset Data", | ||||
| 	"Reset the application, thus deleting all the connected organizations, accounts, and certificates.": "Reset the application, thus deleting all the connected organizations, accounts, and certificates.", | ||||
| 	"On macOS, the OS spellchecker is used.": "On macOS, the OS spellchecker is used.", | ||||
| 	"Change the language from System Preferences → Keyboard → Text → Spelling.": "Change the language from System Preferences → Keyboard → Text → Spelling.", | ||||
| 	"Copy Link": "Copy Link", | ||||
| 	"Copy Image": "Copy Image", | ||||
| 	"Copy Image URL": "Copy Image URL", | ||||
| 	"No Suggestion Found": "No Suggestion Found", | ||||
| 	"You can select a maximum of 3 languages for spellchecking.": "You can select a maximum of 3 languages for spellchecking.", | ||||
| 	"Spellchecker Languages": "Spellchecker Languages", | ||||
| 	"Add to Dictionary": "Add to Dictionary", | ||||
| 	"Look Up": "Look Up" | ||||
| } | ||||
| @@ -1,134 +0,0 @@ | ||||
| { | ||||
| 	"About Zulip": "Tietoa Zulipista", | ||||
| 	"Actual Size": "Varsinainen koko", | ||||
| 	"Add Custom Certificates": "Lisää omia sertifikaatteja", | ||||
| 	"Add Organization": "Lisää organisaatio", | ||||
| 	"Add a Zulip organization": "Lisää Zulip-organisaatio", | ||||
| 	"Add custom CSS": "Lisää oma CSS", | ||||
| 	"Advanced": "Edistynyt", | ||||
| 	"All the connected organizations will appear here": "All the connected organizations will appear here", | ||||
| 	"Always start minimized": "Aloita aina pienennettynä", | ||||
| 	"App Updates": "Sovellspäivitykset", | ||||
| 	"Appearance": "Ulkonäkö", | ||||
| 	"Application Shortcuts": "Sovellusoikotiet", | ||||
| 	"Are you sure you want to disconnect this organization?": "Are you sure you want to disconnect this organization?", | ||||
| 	"Auto hide Menu bar": "Auto hide Menu bar", | ||||
| 	"Auto hide menu bar (Press Alt key to display)": "Auto hide menu bar (Press Alt key to display)", | ||||
| 	"Back": "Back", | ||||
| 	"Bounce dock on new private message": "Bounce dock on new private message", | ||||
| 	"Certificate file": "Certificate file", | ||||
| 	"Change": "Muuta", | ||||
| 	"Check for Updates": "Check for Updates", | ||||
| 	"Close": "Sulje", | ||||
| 	"Connect": "Yhdistä", | ||||
| 	"Connect to another organization": "Connect to another organization", | ||||
| 	"Connected organizations": "Connected organizations", | ||||
| 	"Copy": "Kopioi", | ||||
| 	"Copy Zulip URL": "Kopioi Zulip-URL", | ||||
| 	"Create a new organization": "Luo uusi organisaatio", | ||||
| 	"Cut": "Leikkaa", | ||||
| 	"Default download location": "Default download location", | ||||
| 	"Delete": "Poista", | ||||
| 	"Desktop App Settings": "Desktop App Settings", | ||||
| 	"Desktop Notifications": "Desktop Notifications", | ||||
| 	"Desktop Settings": "Desktop Settings", | ||||
| 	"Disconnect": "Katkaise", | ||||
| 	"Download App Logs": "Download App Logs", | ||||
| 	"Edit": "Muokkaa", | ||||
| 	"Edit Shortcuts": "Edit Shortcuts", | ||||
| 	"Enable auto updates": "Enable auto updates", | ||||
| 	"Enable error reporting (requires restart)": "Enable error reporting (requires restart)", | ||||
| 	"Enable spellchecker (requires restart)": "Enable spellchecker (requires restart)", | ||||
| 	"Factory Reset": "Factory Reset", | ||||
| 	"File": "Tiedosto", | ||||
| 	"Find accounts": "Löydä tilit", | ||||
| 	"Find accounts by email": "Find accounts by email", | ||||
| 	"Flash taskbar on new message": "Flash taskbar on new message", | ||||
| 	"Forward": "Forward", | ||||
| 	"Functionality": "Functionality", | ||||
| 	"General": "General", | ||||
| 	"Get beta updates": "Get beta updates", | ||||
| 	"Hard Reload": "Hard Reload", | ||||
| 	"Help": "Ohje", | ||||
| 	"Help Center": "Tukikeskus", | ||||
| 	"History": "History", | ||||
| 	"History Shortcuts": "History Shortcuts", | ||||
| 	"Keyboard Shortcuts": "Keyboard Shortcuts", | ||||
| 	"Log Out": "Log Out", | ||||
| 	"Log Out of Organization": "Log Out of Organization", | ||||
| 	"Manual proxy configuration": "Manual proxy configuration", | ||||
| 	"Minimize": "Minimize", | ||||
| 	"Mute all sounds from Zulip": "Mute all sounds from Zulip", | ||||
| 	"NO": "EI", | ||||
| 	"Network": "Network", | ||||
| 	"OR": "TAI", | ||||
| 	"Organization URL": "Organisaation URL", | ||||
| 	"Organizations": "Organisaatiot", | ||||
| 	"Paste": "Liitä", | ||||
| 	"Paste and Match Style": "Liitä ja täsmää tyylit", | ||||
| 	"Proxy": "Välipalvelin", | ||||
| 	"Proxy bypass rules": "Proxy bypass rules", | ||||
| 	"Proxy rules": "Proxy rules", | ||||
| 	"Quit": "Lopeta", | ||||
| 	"Quit Zulip": "Lopeta Zulip", | ||||
| 	"Redo": "Toista", | ||||
| 	"Release Notes": "Release Notes", | ||||
| 	"Reload": "Lataa uudelleen", | ||||
| 	"Report an Issue": "Report an Issue", | ||||
| 	"Save": "Tallenna", | ||||
| 	"Select All": "Valitse kaikki", | ||||
| 	"Settings": "Asetukset", | ||||
| 	"Shortcuts": "Oikopolut", | ||||
| 	"Show App Logs": "Show App Logs", | ||||
| 	"Show app icon in system tray": "Show app icon in system tray", | ||||
| 	"Show app unread badge": "Show app unread badge", | ||||
| 	"Show desktop notifications": "Show desktop notifications", | ||||
| 	"Show downloaded files in file manager": "Show downloaded files in file manager", | ||||
| 	"Show sidebar": "Show sidebar", | ||||
| 	"Start app at login": "Start app at login", | ||||
| 	"Switch to Next Organization": "Switch to Next Organization", | ||||
| 	"Switch to Previous Organization": "Switch to Previous Organization", | ||||
| 	"These desktop app shortcuts extend the Zulip webapp's": "These desktop app shortcuts extend the Zulip webapp's", | ||||
| 	"This will delete all application data including all added accounts and preferences": "This will delete all application data including all added accounts and preferences", | ||||
| 	"Tip": "Vinkki", | ||||
| 	"Toggle DevTools for Active Tab": "Toggle DevTools for Active Tab", | ||||
| 	"Toggle DevTools for Zulip App": "Toggle DevTools for Zulip App", | ||||
| 	"Toggle Do Not Disturb": "Toggle Do Not Disturb", | ||||
| 	"Toggle Full Screen": "Toggle Full Screen", | ||||
| 	"Toggle Sidebar": "Toggle Sidebar", | ||||
| 	"Toggle Tray Icon": "Toggle Tray Icon", | ||||
| 	"Tools": "Työkalut", | ||||
| 	"Undo": "Peru", | ||||
| 	"Upload": "Upload", | ||||
| 	"Use system proxy settings (requires restart)": "Use system proxy settings (requires restart)", | ||||
| 	"View": "Näytä", | ||||
| 	"View Shortcuts": "View Shortcuts", | ||||
| 	"Window": "Ikkuna", | ||||
| 	"Window Shortcuts": "Window Shortcuts", | ||||
| 	"YES": "KYLLÄ", | ||||
| 	"Zoom In": "Zoom In", | ||||
| 	"Zoom Out": "Zoom Out", | ||||
| 	"Zulip Help": "Zulip Help", | ||||
| 	"keyboard shortcuts": "keyboard shortcuts", | ||||
| 	"script": "script", | ||||
| 	"Quit when the window is closed": "Quit when the window is closed", | ||||
| 	"Ask where to save files before downloading": "Ask where to save files before downloading", | ||||
| 	"Services": "Services", | ||||
| 	"Hide": "Hide", | ||||
| 	"Hide Others": "Hide Others", | ||||
| 	"Unhide": "Unhide", | ||||
| 	"AddServer": "AddServer", | ||||
| 	"App language (requires restart)": "App language (requires restart)", | ||||
| 	"Factory Reset Data": "Factory Reset Data", | ||||
| 	"Reset the application, thus deleting all the connected organizations, accounts, and certificates.": "Reset the application, thus deleting all the connected organizations, accounts, and certificates.", | ||||
| 	"On macOS, the OS spellchecker is used.": "On macOS, the OS spellchecker is used.", | ||||
| 	"Change the language from System Preferences → Keyboard → Text → Spelling.": "Change the language from System Preferences → Keyboard → Text → Spelling.", | ||||
| 	"Copy Link": "Copy Link", | ||||
| 	"Copy Image": "Copy Image", | ||||
| 	"Copy Image URL": "Copy Image URL", | ||||
| 	"No Suggestion Found": "No Suggestion Found", | ||||
| 	"You can select a maximum of 3 languages for spellchecking.": "You can select a maximum of 3 languages for spellchecking.", | ||||
| 	"Spellchecker Languages": "Spellchecker Languages", | ||||
| 	"Add to Dictionary": "Add to Dictionary", | ||||
| 	"Look Up": "Look Up" | ||||
| } | ||||
| @@ -1,134 +0,0 @@ | ||||
| { | ||||
| 	"About Zulip": "About Zulip", | ||||
| 	"Actual Size": "Actual Size", | ||||
| 	"Add Custom Certificates": "Add Custom Certificates", | ||||
| 	"Add Organization": "Add Organization", | ||||
| 	"Add a Zulip organization": "Add a Zulip organization", | ||||
| 	"Add custom CSS": "Add custom CSS", | ||||
| 	"Advanced": "Advanced", | ||||
| 	"All the connected organizations will appear here": "All the connected organizations will appear here", | ||||
| 	"Always start minimized": "Always start minimized", | ||||
| 	"App Updates": "App Updates", | ||||
| 	"Appearance": "Appearance", | ||||
| 	"Application Shortcuts": "Application Shortcuts", | ||||
| 	"Are you sure you want to disconnect this organization?": "Are you sure you want to disconnect this organization?", | ||||
| 	"Auto hide Menu bar": "Auto hide Menu bar", | ||||
| 	"Auto hide menu bar (Press Alt key to display)": "Auto hide menu bar (Press Alt key to display)", | ||||
| 	"Back": "Back", | ||||
| 	"Bounce dock on new private message": "Bounce dock on new private message", | ||||
| 	"Certificate file": "Certificate file", | ||||
| 	"Change": "Change", | ||||
| 	"Check for Updates": "Check for Updates", | ||||
| 	"Close": "Close", | ||||
| 	"Connect": "Connect", | ||||
| 	"Connect to another organization": "Connect to another organization", | ||||
| 	"Connected organizations": "Connected organizations", | ||||
| 	"Copy": "Copy", | ||||
| 	"Copy Zulip URL": "Copy Zulip URL", | ||||
| 	"Create a new organization": "Create a new organization", | ||||
| 	"Cut": "Cut", | ||||
| 	"Default download location": "Default download location", | ||||
| 	"Delete": "Delete", | ||||
| 	"Desktop App Settings": "Desktop App Settings", | ||||
| 	"Desktop Notifications": "Desktop Notifications", | ||||
| 	"Desktop Settings": "Desktop Settings", | ||||
| 	"Disconnect": "Disconnect", | ||||
| 	"Download App Logs": "Download App Logs", | ||||
| 	"Edit": "Edit", | ||||
| 	"Edit Shortcuts": "Edit Shortcuts", | ||||
| 	"Enable auto updates": "Enable auto updates", | ||||
| 	"Enable error reporting (requires restart)": "Enable error reporting (requires restart)", | ||||
| 	"Enable spellchecker (requires restart)": "Enable spellchecker (requires restart)", | ||||
| 	"Factory Reset": "Factory Reset", | ||||
| 	"File": "File", | ||||
| 	"Find accounts": "Find accounts", | ||||
| 	"Find accounts by email": "Find accounts by email", | ||||
| 	"Flash taskbar on new message": "Flash taskbar on new message", | ||||
| 	"Forward": "Forward", | ||||
| 	"Functionality": "Functionality", | ||||
| 	"General": "General", | ||||
| 	"Get beta updates": "Get beta updates", | ||||
| 	"Hard Reload": "Hard Reload", | ||||
| 	"Help": "Help", | ||||
| 	"Help Center": "Help Center", | ||||
| 	"History": "History", | ||||
| 	"History Shortcuts": "History Shortcuts", | ||||
| 	"Keyboard Shortcuts": "Keyboard Shortcuts", | ||||
| 	"Log Out": "Log Out", | ||||
| 	"Log Out of Organization": "Log Out of Organization", | ||||
| 	"Manual proxy configuration": "Manual proxy configuration", | ||||
| 	"Minimize": "Minimize", | ||||
| 	"Mute all sounds from Zulip": "Mute all sounds from Zulip", | ||||
| 	"NO": "NO", | ||||
| 	"Network": "Network", | ||||
| 	"OR": "OR", | ||||
| 	"Organization URL": "Organization URL", | ||||
| 	"Organizations": "Organizations", | ||||
| 	"Paste": "Paste", | ||||
| 	"Paste and Match Style": "Paste and Match Style", | ||||
| 	"Proxy": "Proxy", | ||||
| 	"Proxy bypass rules": "Proxy bypass rules", | ||||
| 	"Proxy rules": "Proxy rules", | ||||
| 	"Quit": "Quit", | ||||
| 	"Quit Zulip": "Quit Zulip", | ||||
| 	"Redo": "Redo", | ||||
| 	"Release Notes": "Release Notes", | ||||
| 	"Reload": "Reload", | ||||
| 	"Report an Issue": "Report an Issue", | ||||
| 	"Save": "Save", | ||||
| 	"Select All": "Select All", | ||||
| 	"Settings": "Settings", | ||||
| 	"Shortcuts": "Shortcuts", | ||||
| 	"Show App Logs": "Show App Logs", | ||||
| 	"Show app icon in system tray": "Show app icon in system tray", | ||||
| 	"Show app unread badge": "Show app unread badge", | ||||
| 	"Show desktop notifications": "Show desktop notifications", | ||||
| 	"Show downloaded files in file manager": "Show downloaded files in file manager", | ||||
| 	"Show sidebar": "Show sidebar", | ||||
| 	"Start app at login": "Start app at login", | ||||
| 	"Switch to Next Organization": "Switch to Next Organization", | ||||
| 	"Switch to Previous Organization": "Switch to Previous Organization", | ||||
| 	"These desktop app shortcuts extend the Zulip webapp's": "These desktop app shortcuts extend the Zulip webapp's", | ||||
| 	"This will delete all application data including all added accounts and preferences": "This will delete all application data including all added accounts and preferences", | ||||
| 	"Tip": "Tip", | ||||
| 	"Toggle DevTools for Active Tab": "Toggle DevTools for Active Tab", | ||||
| 	"Toggle DevTools for Zulip App": "Toggle DevTools for Zulip App", | ||||
| 	"Toggle Do Not Disturb": "Toggle Do Not Disturb", | ||||
| 	"Toggle Full Screen": "Toggle Full Screen", | ||||
| 	"Toggle Sidebar": "Toggle Sidebar", | ||||
| 	"Toggle Tray Icon": "Toggle Tray Icon", | ||||
| 	"Tools": "Tools", | ||||
| 	"Undo": "Undo", | ||||
| 	"Upload": "Upload", | ||||
| 	"Use system proxy settings (requires restart)": "Use system proxy settings (requires restart)", | ||||
| 	"View": "View", | ||||
| 	"View Shortcuts": "View Shortcuts", | ||||
| 	"Window": "Window", | ||||
| 	"Window Shortcuts": "Window Shortcuts", | ||||
| 	"YES": "YES", | ||||
| 	"Zoom In": "Zoom In", | ||||
| 	"Zoom Out": "Zoom Out", | ||||
| 	"Zulip Help": "Zulip Help", | ||||
| 	"keyboard shortcuts": "keyboard shortcuts", | ||||
| 	"script": "script", | ||||
| 	"Quit when the window is closed": "Quit when the window is closed", | ||||
| 	"Ask where to save files before downloading": "Ask where to save files before downloading", | ||||
| 	"Services": "Services", | ||||
| 	"Hide": "Hide", | ||||
| 	"Hide Others": "Hide Others", | ||||
| 	"Unhide": "Unhide", | ||||
| 	"AddServer": "AddServer", | ||||
| 	"App language (requires restart)": "App language (requires restart)", | ||||
| 	"Factory Reset Data": "Factory Reset Data", | ||||
| 	"Reset the application, thus deleting all the connected organizations, accounts, and certificates.": "Reset the application, thus deleting all the connected organizations, accounts, and certificates.", | ||||
| 	"On macOS, the OS spellchecker is used.": "On macOS, the OS spellchecker is used.", | ||||
| 	"Change the language from System Preferences → Keyboard → Text → Spelling.": "Change the language from System Preferences → Keyboard → Text → Spelling.", | ||||
| 	"Copy Link": "Copy Link", | ||||
| 	"Copy Image": "Copy Image", | ||||
| 	"Copy Image URL": "Copy Image URL", | ||||
| 	"No Suggestion Found": "No Suggestion Found", | ||||
| 	"You can select a maximum of 3 languages for spellchecking.": "You can select a maximum of 3 languages for spellchecking.", | ||||
| 	"Spellchecker Languages": "Spellchecker Languages", | ||||
| 	"Add to Dictionary": "Add to Dictionary", | ||||
| 	"Look Up": "Look Up" | ||||
| } | ||||
| @@ -1,134 +0,0 @@ | ||||
| { | ||||
| 	"About Zulip": "O Zulipie", | ||||
| 	"Actual Size": "Rzeczywisty rozmiar", | ||||
| 	"Add Custom Certificates": "Dodaj niestandardowe certyfikaty", | ||||
| 	"Add Organization": "Dodaj organizację", | ||||
| 	"Add a Zulip organization": "Dodaj organizację Zulip", | ||||
| 	"Add custom CSS": "Dodaj niestandardowy CSS", | ||||
| 	"Advanced": "zaawansowane", | ||||
| 	"All the connected organizations will appear here": "Tutaj pojawią się wszystkie połączone organizacje", | ||||
| 	"Always start minimized": "Zawsze zaczynaj zminimalizowany", | ||||
| 	"App Updates": "Aktualizacje aplikacji", | ||||
| 	"Appearance": "Wygląd", | ||||
| 	"Application Shortcuts": "Skróty do aplikacji", | ||||
| 	"Are you sure you want to disconnect this organization?": "Czy na pewno chcesz odłączyć tę organizację?", | ||||
| 	"Auto hide Menu bar": "Automatyczne ukrywanie paska menu", | ||||
| 	"Auto hide menu bar (Press Alt key to display)": "Automatyczne ukrywanie paska menu (naciśnij klawisz Alt, aby wyświetlić)", | ||||
| 	"Back": "Wstecz", | ||||
| 	"Bounce dock on new private message": "Dok odbijania na nowej prywatnej wiadomości", | ||||
| 	"Certificate file": "Plik certyfikatu", | ||||
| 	"Change": "Zmiana", | ||||
| 	"Check for Updates": "Sprawdź aktualizacje", | ||||
| 	"Close": "Zamknij", | ||||
| 	"Connect": "Połączyć", | ||||
| 	"Connect to another organization": "Połącz się z inną organizacją", | ||||
| 	"Connected organizations": "Połączone organizacje", | ||||
| 	"Copy": "Kopiuj", | ||||
| 	"Copy Zulip URL": "Skopiuj adres URL Zulip", | ||||
| 	"Create a new organization": "Utwórz nową organizację", | ||||
| 	"Cut": "Wytnij", | ||||
| 	"Default download location": "Domyślna lokalizacja pobierania", | ||||
| 	"Delete": "Usuń", | ||||
| 	"Desktop App Settings": "Ustawienia aplikacji desktopowej", | ||||
| 	"Desktop Notifications": "Powiadomienia na pulpicie", | ||||
| 	"Desktop Settings": "Ustawienia pulpitu", | ||||
| 	"Disconnect": "Rozłącz", | ||||
| 	"Download App Logs": "Pobierz logi aplikacji", | ||||
| 	"Edit": "Edytuj", | ||||
| 	"Edit Shortcuts": "Edytuj skróty", | ||||
| 	"Enable auto updates": "Włącz automatyczne aktualizacje", | ||||
| 	"Enable error reporting (requires restart)": "Włącz raportowanie błędów (wymaga ponownego uruchomienia)", | ||||
| 	"Enable spellchecker (requires restart)": "Włącz sprawdzanie pisowni (wymaga ponownego uruchomienia)", | ||||
| 	"Factory Reset": "przywrócenie ustawień fabrycznych", | ||||
| 	"File": "Plik", | ||||
| 	"Find accounts": "Znajdź konta", | ||||
| 	"Find accounts by email": "Znajdź konta po adresach email", | ||||
| 	"Flash taskbar on new message": "Błyskaj w pasku zadań przy nowej wiadomości", | ||||
| 	"Forward": "Naprzód", | ||||
| 	"Functionality": "Funkcjonalność", | ||||
| 	"General": "Ogólne", | ||||
| 	"Get beta updates": "Pobierz aktualizacje beta", | ||||
| 	"Hard Reload": "Twarde przeładowanie", | ||||
| 	"Help": "Pomoc", | ||||
| 	"Help Center": "Centrum pomocy", | ||||
| 	"History": "Historia", | ||||
| 	"History Shortcuts": "Skróty historii", | ||||
| 	"Keyboard Shortcuts": "Skróty klawiszowe", | ||||
| 	"Log Out": "Wyloguj", | ||||
| 	"Log Out of Organization": "Wyloguj się z organizacji", | ||||
| 	"Manual proxy configuration": "Ręczna konfiguracja proxy", | ||||
| 	"Minimize": "Zminimalizuj", | ||||
| 	"Mute all sounds from Zulip": "Wycisz wszystkie dźwięki z Zulipa", | ||||
| 	"NO": "NIE", | ||||
| 	"Network": "Sieć", | ||||
| 	"OR": "LUB", | ||||
| 	"Organization URL": "Adres URL organizacji", | ||||
| 	"Organizations": "Organizacje", | ||||
| 	"Paste": "Wklej", | ||||
| 	"Paste and Match Style": "Wklej i dopasuj styl", | ||||
| 	"Proxy": "Proxy", | ||||
| 	"Proxy bypass rules": "Zasady omijania proxy", | ||||
| 	"Proxy rules": "Reguły proxy", | ||||
| 	"Quit": "Wyjdź", | ||||
| 	"Quit Zulip": "Wyjdź z Zulipa", | ||||
| 	"Redo": "Ponów", | ||||
| 	"Release Notes": "Informacje o wydaniu", | ||||
| 	"Reload": "Przeładuj", | ||||
| 	"Report an Issue": "Zgłoś problem", | ||||
| 	"Save": "Zapisz", | ||||
| 	"Select All": "Zaznacz wszystko", | ||||
| 	"Settings": "Ustawienia", | ||||
| 	"Shortcuts": "Skróty", | ||||
| 	"Show App Logs": "Pokaż dzienniki aplikacji", | ||||
| 	"Show app icon in system tray": "Pokaż ikonę aplikacji w zasobniku systemowym", | ||||
| 	"Show app unread badge": "Pokaż nieprzeczytane na ikonie aplikacji", | ||||
| 	"Show desktop notifications": "Pokaż powiadomienia na pulpicie", | ||||
| 	"Show downloaded files in file manager": "Pokaż pobrane pliki w menedżerze plików", | ||||
| 	"Show sidebar": "Pokaż pasek boczny", | ||||
| 	"Start app at login": "Uruchom aplikację przy logowaniu", | ||||
| 	"Switch to Next Organization": "Przełącz na następną organizację", | ||||
| 	"Switch to Previous Organization": "Przełącz na poprzednią organizację", | ||||
| 	"These desktop app shortcuts extend the Zulip webapp's": "Poniższe skróty są dostępne tylko w kliencie Zulip", | ||||
| 	"This will delete all application data including all added accounts and preferences": "Spowoduje to usunięcie wszystkich danych aplikacji, w tym wszystkich dodanych kont i preferencji", | ||||
| 	"Tip": "Wskazówka", | ||||
| 	"Toggle DevTools for Active Tab": "Włącz/wyłącz DevTools w aktywnej zakładce", | ||||
| 	"Toggle DevTools for Zulip App": "Włącz/wyłącz DevTools dla klienta Zulip", | ||||
| 	"Toggle Do Not Disturb": "Przełącz nie przeszkadzać", | ||||
| 	"Toggle Full Screen": "Przełącz tryb pełnoekranowy", | ||||
| 	"Toggle Sidebar": "Przełącz pasek boczny", | ||||
| 	"Toggle Tray Icon": "Przełącz ikonę tacy", | ||||
| 	"Tools": "Narzędzia", | ||||
| 	"Undo": "Cofnij", | ||||
| 	"Upload": "Przekazać plik", | ||||
| 	"Use system proxy settings (requires restart)": "Użyj ustawień systemowych proxy (wymaga restartu aplikacji)", | ||||
| 	"View": "Widok", | ||||
| 	"View Shortcuts": "Wyświetl skróty", | ||||
| 	"Window": "Okno", | ||||
| 	"Window Shortcuts": "Skróty do okien", | ||||
| 	"YES": "TAK", | ||||
| 	"Zoom In": "Powiększ", | ||||
| 	"Zoom Out": "Pomniejsz", | ||||
| 	"Zulip Help": "Pomoc Zulip", | ||||
| 	"keyboard shortcuts": "Skróty klawiszowe", | ||||
| 	"script": "skrypt", | ||||
| 	"Quit when the window is closed": "Wyłącz przy zamykaniu okna", | ||||
| 	"Ask where to save files before downloading": "Zapytaj przed pobraniem gdzie zachować pliki", | ||||
| 	"Services": "Services", | ||||
| 	"Hide": "Hide", | ||||
| 	"Hide Others": "Hide Others", | ||||
| 	"Unhide": "Unhide", | ||||
| 	"AddServer": "AddServer", | ||||
| 	"App language (requires restart)": "App language (requires restart)", | ||||
| 	"Factory Reset Data": "Factory Reset Data", | ||||
| 	"Reset the application, thus deleting all the connected organizations, accounts, and certificates.": "Reset the application, thus deleting all the connected organizations, accounts, and certificates.", | ||||
| 	"On macOS, the OS spellchecker is used.": "On macOS, the OS spellchecker is used.", | ||||
| 	"Change the language from System Preferences → Keyboard → Text → Spelling.": "Change the language from System Preferences → Keyboard → Text → Spelling.", | ||||
| 	"Copy Link": "Copy Link", | ||||
| 	"Copy Image": "Copy Image", | ||||
| 	"Copy Image URL": "Copy Image URL", | ||||
| 	"No Suggestion Found": "No Suggestion Found", | ||||
| 	"You can select a maximum of 3 languages for spellchecking.": "You can select a maximum of 3 languages for spellchecking.", | ||||
| 	"Spellchecker Languages": "Spellchecker Languages", | ||||
| 	"Add to Dictionary": "Add to Dictionary", | ||||
| 	"Look Up": "Look Up" | ||||
| } | ||||
| @@ -1,134 +0,0 @@ | ||||
| { | ||||
| 	"About Zulip": "Sobre o Zulip", | ||||
| 	"Actual Size": "Tamanho atual", | ||||
| 	"Add Custom Certificates": "Adicionar certificados personalizados", | ||||
| 	"Add Organization": "Adicionar Organização", | ||||
| 	"Add a Zulip organization": "Adicione uma organização Zulip", | ||||
| 	"Add custom CSS": "Adicionar CSS personalizado", | ||||
| 	"Advanced": "Avançado", | ||||
| 	"All the connected organizations will appear here": "Todas as organizações conectadas aparecerão aqui", | ||||
| 	"Always start minimized": "Começar sempre minimizado", | ||||
| 	"App Updates": "Atualizações de aplicativos", | ||||
| 	"Appearance": "Aparência", | ||||
| 	"Application Shortcuts": "Atalhos de aplicativos", | ||||
| 	"Are you sure you want to disconnect this organization?": "Tem certeza de que deseja desconectar essa organização?", | ||||
| 	"Auto hide Menu bar": "Auto ocultar barra de Menu", | ||||
| 	"Auto hide menu bar (Press Alt key to display)": "Ocultar barra de menu automaticamente (pressione a tecla Alt para exibir)", | ||||
| 	"Back": "De volta", | ||||
| 	"Bounce dock on new private message": "Bounce doca em nova mensagem privada", | ||||
| 	"Certificate file": "Arquivo de certificado", | ||||
| 	"Change": "mudança", | ||||
| 	"Check for Updates": "Verificar se há atualizações", | ||||
| 	"Close": "Fechar", | ||||
| 	"Connect": "Conectar", | ||||
| 	"Connect to another organization": "Conecte-se a outra organização", | ||||
| 	"Connected organizations": "Organizações conectadas", | ||||
| 	"Copy": "Copiar", | ||||
| 	"Copy Zulip URL": "Copiar URL do Zulip", | ||||
| 	"Create a new organization": "Crie uma nova organização", | ||||
| 	"Cut": "Cortar", | ||||
| 	"Default download location": "Local de download padrão", | ||||
| 	"Delete": "Excluir", | ||||
| 	"Desktop App Settings": "Configurações do aplicativo de desktop", | ||||
| 	"Desktop Notifications": "Notificações da área de trabalho", | ||||
| 	"Desktop Settings": "Configurações da área de trabalho", | ||||
| 	"Disconnect": "desconectar", | ||||
| 	"Download App Logs": "Download de registros de aplicativos", | ||||
| 	"Edit": "Editar", | ||||
| 	"Edit Shortcuts": "Editar atalhos", | ||||
| 	"Enable auto updates": "Ativar atualizações automáticas", | ||||
| 	"Enable error reporting (requires restart)": "Ativar relatório de erros (requer reinicialização)", | ||||
| 	"Enable spellchecker (requires restart)": "Ativar verificação ortográfica (requer reinicialização)", | ||||
| 	"Factory Reset": "Restauração de fábrica", | ||||
| 	"File": "Arquivo", | ||||
| 	"Find accounts": "Encontrar contas", | ||||
| 	"Find accounts by email": "Encontre contas por email", | ||||
| 	"Flash taskbar on new message": "Barra de tarefas em Flash na nova mensagem", | ||||
| 	"Forward": "frente", | ||||
| 	"Functionality": "Funcionalidade", | ||||
| 	"General": "Geral", | ||||
| 	"Get beta updates": "Receba atualizações beta", | ||||
| 	"Hard Reload": "Hard Reload", | ||||
| 	"Help": "Socorro", | ||||
| 	"Help Center": "Centro de ajuda", | ||||
| 	"History": "História", | ||||
| 	"History Shortcuts": "Atalhos da História", | ||||
| 	"Keyboard Shortcuts": "Atalhos do teclado", | ||||
| 	"Log Out": "Sair", | ||||
| 	"Log Out of Organization": "Sair da organização", | ||||
| 	"Manual proxy configuration": "Configuração manual de proxy", | ||||
| 	"Minimize": "Minimizar", | ||||
| 	"Mute all sounds from Zulip": "Silencie todos os sons de Zulip", | ||||
| 	"NO": "NÃO", | ||||
| 	"Network": "Rede", | ||||
| 	"OR": "OU", | ||||
| 	"Organization URL": "URL da organização", | ||||
| 	"Organizations": "Organizações", | ||||
| 	"Paste": "Colar", | ||||
| 	"Paste and Match Style": "Colar e combinar estilo", | ||||
| 	"Proxy": "Procuração", | ||||
| 	"Proxy bypass rules": "Regras de desvio de proxy", | ||||
| 	"Proxy rules": "Regras de proxy", | ||||
| 	"Quit": "Sair", | ||||
| 	"Quit Zulip": "Saia de Zulip", | ||||
| 	"Redo": "Refazer", | ||||
| 	"Release Notes": "Notas de Lançamento", | ||||
| 	"Reload": "recarregar", | ||||
| 	"Report an Issue": "Comunicar um problema", | ||||
| 	"Save": "Salve ", | ||||
| 	"Select All": "Selecionar tudo", | ||||
| 	"Settings": "Configurações", | ||||
| 	"Shortcuts": "Atalhos", | ||||
| 	"Show App Logs": "Mostrar registros do aplicativo", | ||||
| 	"Show app icon in system tray": "Mostrar ícone do aplicativo na bandeja do sistema", | ||||
| 	"Show app unread badge": "Mostrar crachá não lido do aplicativo", | ||||
| 	"Show desktop notifications": "Mostrar notificações da área de trabalho", | ||||
| 	"Show downloaded files in file manager": "Mostrar arquivos baixados no gerenciador de arquivos", | ||||
| 	"Show sidebar": "Mostrar barra lateral", | ||||
| 	"Start app at login": "Inicie o aplicativo no login", | ||||
| 	"Switch to Next Organization": "Mudar para a próxima organização", | ||||
| 	"Switch to Previous Organization": "Mudar para a organização anterior", | ||||
| 	"These desktop app shortcuts extend the Zulip webapp's": "Esses atalhos para aplicativos de desktop estendem o aplicativo da web do Zulip", | ||||
| 	"This will delete all application data including all added accounts and preferences": "Isso excluirá todos os dados do aplicativo, incluindo todas as contas e preferências adicionadas", | ||||
| 	"Tip": "Gorjeta", | ||||
| 	"Toggle DevTools for Active Tab": "Alternar DevTools para a guia ativa", | ||||
| 	"Toggle DevTools for Zulip App": "Alternar DevTools para Zulip App", | ||||
| 	"Toggle Do Not Disturb": "Alternar não perturbe", | ||||
| 	"Toggle Full Screen": "Alternar para o modo tela cheia", | ||||
| 	"Toggle Sidebar": "Alternar Barra Lateral", | ||||
| 	"Toggle Tray Icon": "Alternar ícone da bandeja", | ||||
| 	"Tools": "Ferramentas", | ||||
| 	"Undo": "Desfazer", | ||||
| 	"Upload": "Envio", | ||||
| 	"Use system proxy settings (requires restart)": "Use as configurações de proxy do sistema (requer reinicialização)", | ||||
| 	"View": "Visão", | ||||
| 	"View Shortcuts": "Exibir atalhos", | ||||
| 	"Window": "Janela", | ||||
| 	"Window Shortcuts": "Atalhos de janela", | ||||
| 	"YES": "SIM", | ||||
| 	"Zoom In": "Mais Zoom", | ||||
| 	"Zoom Out": "Reduzir o zoom", | ||||
| 	"Zulip Help": "Zulip Ajuda", | ||||
| 	"keyboard shortcuts": "atalhos do teclado", | ||||
| 	"script": "roteiro", | ||||
| 	"Quit when the window is closed": "Sair quando fechar a janela", | ||||
| 	"Ask where to save files before downloading": "Ask where to save files before downloading", | ||||
| 	"Services": "Services", | ||||
| 	"Hide": "Hide", | ||||
| 	"Hide Others": "Hide Others", | ||||
| 	"Unhide": "Unhide", | ||||
| 	"AddServer": "AddServer", | ||||
| 	"App language (requires restart)": "App language (requires restart)", | ||||
| 	"Factory Reset Data": "Factory Reset Data", | ||||
| 	"Reset the application, thus deleting all the connected organizations, accounts, and certificates.": "Reset the application, thus deleting all the connected organizations, accounts, and certificates.", | ||||
| 	"On macOS, the OS spellchecker is used.": "On macOS, the OS spellchecker is used.", | ||||
| 	"Change the language from System Preferences → Keyboard → Text → Spelling.": "Change the language from System Preferences → Keyboard → Text → Spelling.", | ||||
| 	"Copy Link": "Copy Link", | ||||
| 	"Copy Image": "Copy Image", | ||||
| 	"Copy Image URL": "Copy Image URL", | ||||
| 	"No Suggestion Found": "No Suggestion Found", | ||||
| 	"You can select a maximum of 3 languages for spellchecking.": "You can select a maximum of 3 languages for spellchecking.", | ||||
| 	"Spellchecker Languages": "Spellchecker Languages", | ||||
| 	"Add to Dictionary": "Add to Dictionary", | ||||
| 	"Look Up": "Look Up" | ||||
| } | ||||
| @@ -1,134 +0,0 @@ | ||||
| { | ||||
| 	"About Zulip": "О Zulip", | ||||
| 	"Actual Size": "Актуальный размер", | ||||
| 	"Add Custom Certificates": "Добавить собственные сертификаты", | ||||
| 	"Add Organization": "Добавить организацию", | ||||
| 	"Add a Zulip organization": "Добавить организацию Zulip", | ||||
| 	"Add custom CSS": "Добавить собственный CSS", | ||||
| 	"Advanced": "Дополнительно", | ||||
| 	"All the connected organizations will appear here": "Все связанные организации будут появляться здесь", | ||||
| 	"Always start minimized": "Запускать свернуто", | ||||
| 	"App Updates": "Обновления", | ||||
| 	"Appearance": "Вид", | ||||
| 	"Application Shortcuts": "Горячие клавиши", | ||||
| 	"Are you sure you want to disconnect this organization?": "Вы уверены, что хотите отключить эту организацию?", | ||||
| 	"Auto hide Menu bar": "Скрывать меню", | ||||
| 	"Auto hide menu bar (Press Alt key to display)": "Скрывать меню (для показа нажмите Alt)", | ||||
| 	"Back": "Назад", | ||||
| 	"Bounce dock on new private message": "Показывать док при поступлении нового личного сообщения", | ||||
| 	"Certificate file": "Файл сертификата", | ||||
| 	"Change": "Изменить", | ||||
| 	"Check for Updates": "Проверить наличие обновлений", | ||||
| 	"Close": "Закрыть", | ||||
| 	"Connect": "Подключиться", | ||||
| 	"Connect to another organization": "Подключиться к другой организации", | ||||
| 	"Connected organizations": "Подключенные организации", | ||||
| 	"Copy": "Копировать", | ||||
| 	"Copy Zulip URL": "Скопировать ссылку на сервер Zulip", | ||||
| 	"Create a new organization": "Создать новую организацию", | ||||
| 	"Cut": "Вырезать", | ||||
| 	"Default download location": "Папка для загрузки", | ||||
| 	"Delete": "Удалить", | ||||
| 	"Desktop App Settings": "Настройки приложения", | ||||
| 	"Desktop Notifications": "Оповещения на рабочем столе", | ||||
| 	"Desktop Settings": "Настройки рабочего стола", | ||||
| 	"Disconnect": "Отключиться", | ||||
| 	"Download App Logs": "Скачать логи приложения", | ||||
| 	"Edit": "Изменить", | ||||
| 	"Edit Shortcuts": "Редактировать горячие клавиши", | ||||
| 	"Enable auto updates": "Включить автообновление", | ||||
| 	"Enable error reporting (requires restart)": "Включить сообщения об ошибках (потребуется перезапуск)", | ||||
| 	"Enable spellchecker (requires restart)": "Включить проверку орфографии (потребуется перезапуск)", | ||||
| 	"Factory Reset": "Сброс настроек", | ||||
| 	"File": "Файл", | ||||
| 	"Find accounts": "Найти учетные записи", | ||||
| 	"Find accounts by email": "Искать учетные записи по адресу электронной почты", | ||||
| 	"Flash taskbar on new message": "Высвечивать панель задач при новом сообщении", | ||||
| 	"Forward": "Вперед", | ||||
| 	"Functionality": "Функциональность", | ||||
| 	"General": "Общее", | ||||
| 	"Get beta updates": "Получать бета-обновления", | ||||
| 	"Hard Reload": "Жесткая перезагрузка", | ||||
| 	"Help": "Помощь", | ||||
| 	"Help Center": "Центр поддержки", | ||||
| 	"History": "История", | ||||
| 	"History Shortcuts": "Горячие клавишы по истории", | ||||
| 	"Keyboard Shortcuts": "Горячие клавишы", | ||||
| 	"Log Out": "Выйти из учетной записи", | ||||
| 	"Log Out of Organization": "Выйти из организации", | ||||
| 	"Manual proxy configuration": "Ручная настройка прокси", | ||||
| 	"Minimize": "Свернуть", | ||||
| 	"Mute all sounds from Zulip": "Выключить все звуки Zulip", | ||||
| 	"NO": "НЕТ", | ||||
| 	"Network": "Сеть", | ||||
| 	"OR": "ИЛИ", | ||||
| 	"Organization URL": "URL организации", | ||||
| 	"Organizations": "Организации", | ||||
| 	"Paste": "Вставить", | ||||
| 	"Paste and Match Style": "Вставить с соблюдением стиля", | ||||
| 	"Proxy": "Прокси", | ||||
| 	"Proxy bypass rules": "Правила обхода прокси", | ||||
| 	"Proxy rules": "Правила прокси", | ||||
| 	"Quit": "Выход", | ||||
| 	"Quit Zulip": "Выйти из Zulip", | ||||
| 	"Redo": "Исправить", | ||||
| 	"Release Notes": "Описание обновлений", | ||||
| 	"Reload": "Перезагрузить", | ||||
| 	"Report an Issue": "Сообщить об ошибке", | ||||
| 	"Save": "Сохранить", | ||||
| 	"Select All": "Выделить все", | ||||
| 	"Settings": "Настройки", | ||||
| 	"Shortcuts": "Горячие клавиши", | ||||
| 	"Show App Logs": "Показать логи приложения", | ||||
| 	"Show app icon in system tray": "Показывать приложение в области уведомлений", | ||||
| 	"Show app unread badge": "Показывать значок о непрочитанных сообщениях", | ||||
| 	"Show desktop notifications": "Показывать всплывающие оповещения", | ||||
| 	"Show downloaded files in file manager": "Показать скаченные файлы в менеджере закачек", | ||||
| 	"Show sidebar": "Показывать боковую панель", | ||||
| 	"Start app at login": "Запускать приложение при входе в систему", | ||||
| 	"Switch to Next Organization": "Перейти к следующей организации", | ||||
| 	"Switch to Previous Organization": "Перейти к предыдущей организации", | ||||
| 	"These desktop app shortcuts extend the Zulip webapp's": "Эти ярлыки приложения для рабочего стола дополняют функционал сетевого приложения Zulip", | ||||
| 	"This will delete all application data including all added accounts and preferences": "Этим удаляются все данные приложения, включая данные всех подключенных аккаунтов и настройки.", | ||||
| 	"Tip": "Совет", | ||||
| 	"Toggle DevTools for Active Tab": "Переключить инструменты разработчика для активной вкладки", | ||||
| 	"Toggle DevTools for Zulip App": "Переключить инструменты разработчика для приложения Zulip", | ||||
| 	"Toggle Do Not Disturb": "Переключить режим \"не мешать\"", | ||||
| 	"Toggle Full Screen": "Переключить полный экран", | ||||
| 	"Toggle Sidebar": "Переключить боковую панель", | ||||
| 	"Toggle Tray Icon": "Переключить иконку в области уведомлений", | ||||
| 	"Tools": "Инструменты", | ||||
| 	"Undo": "Отменить", | ||||
| 	"Upload": "Загрузить", | ||||
| 	"Use system proxy settings (requires restart)": "Использовать системные настройки прокси (необходима перезагрузка)", | ||||
| 	"View": "Вид", | ||||
| 	"View Shortcuts": "Посмотреть горячие клавишы", | ||||
| 	"Window": "Окно", | ||||
| 	"Window Shortcuts": "Ярлыки окна", | ||||
| 	"YES": "ДА", | ||||
| 	"Zoom In": "Увеличить масштаб", | ||||
| 	"Zoom Out": "Уменьшить масштаб", | ||||
| 	"Zulip Help": "Помощь по Zulip", | ||||
| 	"keyboard shortcuts": "Горячие клавиши", | ||||
| 	"script": "скрипт", | ||||
| 	"Quit when the window is closed": "Выйти, когда окно будет закрыто", | ||||
| 	"Ask where to save files before downloading": "Спрашивать, где сохранять файлы перед скачиванием", | ||||
| 	"Services": "Сервисы", | ||||
| 	"Hide": "Скрыть", | ||||
| 	"Hide Others": "Скрыть другие", | ||||
| 	"Unhide": "Не скрывать", | ||||
| 	"AddServer": "Добавить Сервер", | ||||
| 	"App language (requires restart)": "Язык приложения (требует перезапуска)", | ||||
| 	"Factory Reset Data": "Сброс данных приложения", | ||||
| 	"Reset the application, thus deleting all the connected organizations, accounts, and certificates.": "Сбросить все настройки приложения, и удалить все подключенные организации, учетные записи и сертификаты.", | ||||
| 	"On macOS, the OS spellchecker is used.": "На macOS используется орфографический корректор OS.", | ||||
| 	"Change the language from System Preferences → Keyboard → Text → Spelling.": "Настройте язык, следуя меню Настройки системы → Клавиатура → Текст → Орфография.", | ||||
| 	"Copy Link": "Скопировать ссылку", | ||||
| 	"Copy Image": "Скопировать изображение", | ||||
| 	"Copy Image URL": "Скопировать ссылку на изображение", | ||||
| 	"No Suggestion Found": "Предложений не найдено", | ||||
| 	"You can select a maximum of 3 languages for spellchecking.": "Вы можете выбрать не более 3-х языков для проверки орфографии.", | ||||
| 	"Spellchecker Languages": "Языки для проверки орфографии", | ||||
| 	"Add to Dictionary": "Добавить в словарь", | ||||
| 	"Look Up": "Искать" | ||||
| } | ||||
| @@ -1,134 +0,0 @@ | ||||
| { | ||||
| 	"About Zulip": "О Зулипу", | ||||
| 	"Actual Size": "Стварна величина", | ||||
| 	"Add Custom Certificates": "Додајте прилагођене цертификате", | ||||
| 	"Add Organization": "Додај организацију", | ||||
| 	"Add a Zulip organization": "Додајте Зулип организацију", | ||||
| 	"Add custom CSS": "Додајте прилагођени ЦСС", | ||||
| 	"Advanced": "Напредно", | ||||
| 	"All the connected organizations will appear here": "Овде ће се појавити све повезане организације", | ||||
| 	"Always start minimized": "Увек започните минимизирано", | ||||
| 	"App Updates": "Апп Упдатес", | ||||
| 	"Appearance": "Изглед", | ||||
| 	"Application Shortcuts": "Пречице за апликације", | ||||
| 	"Are you sure you want to disconnect this organization?": "Јесте ли сигурни да желите прекинути везу с овом организацијом?", | ||||
| 	"Auto hide Menu bar": "Ауто хиде Мену бар", | ||||
| 	"Auto hide menu bar (Press Alt key to display)": "Аутоматско скривање траке менија (притисните тастер Алт да бисте приказали)", | ||||
| 	"Back": "Назад", | ||||
| 	"Bounce dock on new private message": "Одскочите у нову приватну поруку", | ||||
| 	"Certificate file": "Датотека сертификата", | ||||
| 	"Change": "Цханге", | ||||
| 	"Check for Updates": "Провери ажурирања", | ||||
| 	"Close": "Близу", | ||||
| 	"Connect": "Повежи", | ||||
| 	"Connect to another organization": "Повежите се са другом организацијом", | ||||
| 	"Connected organizations": "Повезане организације", | ||||
| 	"Copy": "Копирај", | ||||
| 	"Copy Zulip URL": "Цопи Зулип УРЛ", | ||||
| 	"Create a new organization": "Направите нову организацију", | ||||
| 	"Cut": "Цут", | ||||
| 	"Default download location": "Дефаулт довнлоад лоцатион", | ||||
| 	"Delete": "Обриши", | ||||
| 	"Desktop App Settings": "Подешавања апликације за десктоп рачунаре", | ||||
| 	"Desktop Notifications": "Обавештења о радној површини", | ||||
| 	"Desktop Settings": "Десктоп Сеттингс", | ||||
| 	"Disconnect": "Дисцоннецт", | ||||
| 	"Download App Logs": "Довнлоад Апп Логс", | ||||
| 	"Edit": "Уредити", | ||||
| 	"Edit Shortcuts": "Уреди пречице", | ||||
| 	"Enable auto updates": "Омогући аутоматско ажурирање", | ||||
| 	"Enable error reporting (requires restart)": "Омогући извештавање о грешкама (захтева поновно покретање)", | ||||
| 	"Enable spellchecker (requires restart)": "Омогући провјеру правописа (захтијева поновно покретање)", | ||||
| 	"Factory Reset": "Фацтори Ресет", | ||||
| 	"File": "Филе", | ||||
| 	"Find accounts": "Нађи рачуне", | ||||
| 	"Find accounts by email": "Пронађите рачуне путем е-поште", | ||||
| 	"Flash taskbar on new message": "Фласх трака задатака у новој поруци", | ||||
| 	"Forward": "Напријед", | ||||
| 	"Functionality": "Функционалност", | ||||
| 	"General": "Генерал", | ||||
| 	"Get beta updates": "Набавите бета ажурирања", | ||||
| 	"Hard Reload": "Хард Релоад", | ||||
| 	"Help": "Помоћ", | ||||
| 	"Help Center": "Центар за помоћ", | ||||
| 	"History": "Хистори", | ||||
| 	"History Shortcuts": "Историјске пречице", | ||||
| 	"Keyboard Shortcuts": "Пречице на тастатури", | ||||
| 	"Log Out": "Одјавити се", | ||||
| 	"Log Out of Organization": "Одјавите се из организације", | ||||
| 	"Manual proxy configuration": "Мануал проки цонфигуратион", | ||||
| 	"Minimize": "Минимизе", | ||||
| 	"Mute all sounds from Zulip": "Искључите све звукове из Зулипа", | ||||
| 	"NO": "НЕ", | ||||
| 	"Network": "Мрежа", | ||||
| 	"OR": "ОР", | ||||
| 	"Organization URL": "УРЛ организације", | ||||
| 	"Organizations": "Организације", | ||||
| 	"Paste": "Пасте", | ||||
| 	"Paste and Match Style": "Залепите и подесите стил", | ||||
| 	"Proxy": "Заступник", | ||||
| 	"Proxy bypass rules": "Проки бипасс правила", | ||||
| 	"Proxy rules": "Проки рулес", | ||||
| 	"Quit": "Одустати", | ||||
| 	"Quit Zulip": "Куит Зулип", | ||||
| 	"Redo": "Редо", | ||||
| 	"Release Notes": "Релеасе Нотес", | ||||
| 	"Reload": "Освежи", | ||||
| 	"Report an Issue": "Пријавите проблем", | ||||
| 	"Save": "сачувати", | ||||
| 	"Select All": "Изабери све", | ||||
| 	"Settings": "Подешавања", | ||||
| 	"Shortcuts": "Пречице", | ||||
| 	"Show App Logs": "Прикажи дневнике апликација", | ||||
| 	"Show app icon in system tray": "Покажи икону апликације у системској палети", | ||||
| 	"Show app unread badge": "Покажи непрочитану значку апликације", | ||||
| 	"Show desktop notifications": "Прикажи обавештења радне површине", | ||||
| 	"Show downloaded files in file manager": "Прикажи преузете датотеке у управитељу датотека", | ||||
| 	"Show sidebar": "Схов сидебар", | ||||
| 	"Start app at login": "Покрените апликацију приликом пријављивања", | ||||
| 	"Switch to Next Organization": "Пребаци се на следећу организацију", | ||||
| 	"Switch to Previous Organization": "Пребаци се на претходну организацију", | ||||
| 	"These desktop app shortcuts extend the Zulip webapp's": "Пречице за десктоп апликације проширују Зулип вебаппове", | ||||
| 	"This will delete all application data including all added accounts and preferences": "Ово ће избрисати све податке о апликацији, укључујући све додатне налоге и поставке", | ||||
| 	"Tip": "Савет", | ||||
| 	"Toggle DevTools for Active Tab": "Пребаци ДевТоолс за Ацтиве Таб", | ||||
| 	"Toggle DevTools for Zulip App": "Пребаци ДевТоолс за Зулип Апп", | ||||
| 	"Toggle Do Not Disturb": "Тоггле До Нот Дистурб", | ||||
| 	"Toggle Full Screen": "Тоггле Фулл Сцреен", | ||||
| 	"Toggle Sidebar": "Тоггле Сидебар", | ||||
| 	"Toggle Tray Icon": "Тоггле Траи Ицон", | ||||
| 	"Tools": "Алати", | ||||
| 	"Undo": "Ундо", | ||||
| 	"Upload": "Отпремити", | ||||
| 	"Use system proxy settings (requires restart)": "Користи поставке системског прокија (потребно је поново покренути)", | ||||
| 	"View": "Поглед", | ||||
| 	"View Shortcuts": "Прикажи пречице", | ||||
| 	"Window": "Прозор", | ||||
| 	"Window Shortcuts": "Пречице за прозор", | ||||
| 	"YES": "ДА", | ||||
| 	"Zoom In": "Увеличати", | ||||
| 	"Zoom Out": "Зоом Оут", | ||||
| 	"Zulip Help": "Зулип Хелп", | ||||
| 	"keyboard shortcuts": "пречице на тастатури", | ||||
| 	"script": "скрипта", | ||||
| 	"Quit when the window is closed": "Quit when the window is closed", | ||||
| 	"Ask where to save files before downloading": "Ask where to save files before downloading", | ||||
| 	"Services": "Services", | ||||
| 	"Hide": "Hide", | ||||
| 	"Hide Others": "Hide Others", | ||||
| 	"Unhide": "Unhide", | ||||
| 	"AddServer": "AddServer", | ||||
| 	"App language (requires restart)": "App language (requires restart)", | ||||
| 	"Factory Reset Data": "Factory Reset Data", | ||||
| 	"Reset the application, thus deleting all the connected organizations, accounts, and certificates.": "Reset the application, thus deleting all the connected organizations, accounts, and certificates.", | ||||
| 	"On macOS, the OS spellchecker is used.": "On macOS, the OS spellchecker is used.", | ||||
| 	"Change the language from System Preferences → Keyboard → Text → Spelling.": "Change the language from System Preferences → Keyboard → Text → Spelling.", | ||||
| 	"Copy Link": "Copy Link", | ||||
| 	"Copy Image": "Copy Image", | ||||
| 	"Copy Image URL": "Copy Image URL", | ||||
| 	"No Suggestion Found": "No Suggestion Found", | ||||
| 	"You can select a maximum of 3 languages for spellchecking.": "You can select a maximum of 3 languages for spellchecking.", | ||||
| 	"Spellchecker Languages": "Spellchecker Languages", | ||||
| 	"Add to Dictionary": "Add to Dictionary", | ||||
| 	"Look Up": "Look Up" | ||||
| } | ||||
| @@ -1,43 +0,0 @@ | ||||
| { | ||||
|     "ar": "عربى", | ||||
|     "bg": "български", | ||||
|     "ca": "català", | ||||
|     "cs": "česky", | ||||
|     "da": "Dansk", | ||||
|     "de": "Deutsch", | ||||
|     "el_GR": "Greek (Greece)", | ||||
|     "el": "Ελληνικά", | ||||
|     "en_GB": "English (UK)", | ||||
|     "en": "English (US)", | ||||
|     "es": "Español", | ||||
|     "fa": "فارسی", | ||||
|     "fi": "suomi", | ||||
|     "fr": "français", | ||||
|     "gl": "Galego", | ||||
|     "hi": "हिन्दी", | ||||
|     "hr": "Croata", | ||||
|     "hu": "Magyar", | ||||
|     "id_ID": "Indonesian (Indonesia)", | ||||
|     "it": "Italiano", | ||||
|     "ja": "日本語", | ||||
|     "ko": "한국어" , | ||||
|     "lt": "Lietuvis" , | ||||
|     "ml": "മലയാളം", | ||||
|     "nb_NO": "norsk (Norge)", | ||||
|     "nl": "Nederlands", | ||||
|     "pl": "Polski", | ||||
|     "pt": "Português", | ||||
|     "ro": "Română", | ||||
|     "ru": "Русский", | ||||
|     "sk": "Slovak", | ||||
|     "sr": "српски", | ||||
|     "sv": "svenska", | ||||
|     "ta": "தமிழ்", | ||||
|     "tr": "Türkçe", | ||||
|     "uk": "Українська", | ||||
|     "uz": "O'zbek", | ||||
|     "vi": "Tiếng Việt", | ||||
|     "zh_TW": "中文 (傳統的)", | ||||
|     "zh-Hans": "简体中文", | ||||
|     "zh-Hant": "繁體中文" | ||||
| } | ||||
| @@ -1,134 +0,0 @@ | ||||
| { | ||||
| 	"About Zulip": "ஜூலிப் பற்றி", | ||||
| 	"Actual Size": "உண்மையான அளவு", | ||||
| 	"Add Custom Certificates": "தனிப்பயன் சான்றிதழ்களைச் சேர்க்கவும்", | ||||
| 	"Add Organization": "அமைப்பைச் சேர்", | ||||
| 	"Add a Zulip organization": "ஒரு ஜூலிப் அமைப்பைச் சேர்க்கவும்", | ||||
| 	"Add custom CSS": "தனிப்பயன் CSS ஐச் சேர்க்கவும்", | ||||
| 	"Advanced": "மேம்பட்ட", | ||||
| 	"All the connected organizations will appear here": "இணைக்கப்பட்ட அனைத்து அமைப்புகளும் இங்கே தோன்றும்", | ||||
| 	"Always start minimized": "எப்போதும் குறைக்கத் தொடங்குங்கள்", | ||||
| 	"App Updates": "பயன்பாட்டு புதுப்பிப்புகள்", | ||||
| 	"Appearance": "தோற்றம்", | ||||
| 	"Application Shortcuts": "பயன்பாட்டு குறுக்குவழிகள்", | ||||
| 	"Are you sure you want to disconnect this organization?": "இந்த அமைப்பைத் துண்டிக்க விரும்புகிறீர்களா?", | ||||
| 	"Auto hide Menu bar": "தானாக மறை பட்டி பட்டி", | ||||
| 	"Auto hide menu bar (Press Alt key to display)": "தானாக மறை மெனு பட்டியை (காண்பிக்க Alt விசையை அழுத்தவும்)", | ||||
| 	"Back": "மீண்டும்", | ||||
| 	"Bounce dock on new private message": "புதிய தனிப்பட்ட செய்தியில் கப்பல்துறை பவுன்ஸ்", | ||||
| 	"Certificate file": "சான்றிதழ் கோப்பு", | ||||
| 	"Change": "மாற்றம்", | ||||
| 	"Check for Updates": "புதுப்பிப்புகளைச் சரிபார்க்கவும்", | ||||
| 	"Close": "நெருக்கமான", | ||||
| 	"Connect": "இணைக்கவும்", | ||||
| 	"Connect to another organization": "வேறொரு நிறுவனத்துடன் இணைக்கவும்", | ||||
| 	"Connected organizations": "இணைக்கப்பட்ட நிறுவனங்கள்", | ||||
| 	"Copy": "நகல்", | ||||
| 	"Copy Zulip URL": "ஜூலிப் URL ஐ நகலெடுக்கவும்", | ||||
| 	"Create a new organization": "புதிய அமைப்பை உருவாக்கவும்", | ||||
| 	"Cut": "வெட்டு", | ||||
| 	"Default download location": "இயல்புநிலை பதிவிறக்க இடம்", | ||||
| 	"Delete": "அழி", | ||||
| 	"Desktop App Settings": "டெஸ்க்டாப் பயன்பாட்டு அமைப்புகள்", | ||||
| 	"Desktop Notifications": "டெஸ்க்டாப் அறிவிப்புகள்", | ||||
| 	"Desktop Settings": "டெஸ்க்டாப் அமைப்புகள்", | ||||
| 	"Disconnect": "துண்டி", | ||||
| 	"Download App Logs": "பயன்பாட்டு பதிவுகள் பதிவிறக்கவும்", | ||||
| 	"Edit": "தொகு", | ||||
| 	"Edit Shortcuts": "குறுக்குவழிகளைத் திருத்து", | ||||
| 	"Enable auto updates": "தானியங்கு புதுப்பிப்புகளை இயக்கு", | ||||
| 	"Enable error reporting (requires restart)": "பிழை அறிக்கையை இயக்கு (மறுதொடக்கம் தேவை)", | ||||
| 	"Enable spellchecker (requires restart)": "எழுத்துப்பிழை சரிபார்ப்பை இயக்கு (மறுதொடக்கம் தேவை)", | ||||
| 	"Factory Reset": "தொழிற்சாலை மீட்டமைப்பு", | ||||
| 	"File": "கோப்பு", | ||||
| 	"Find accounts": "கணக்குகளைக் கண்டறியவும்", | ||||
| 	"Find accounts by email": "மின்னஞ்சல் மூலம் கணக்குகளைக் கண்டறியவும்", | ||||
| 	"Flash taskbar on new message": "புதிய செய்தியில் ஃபிளாஷ் பணிப்பட்டி", | ||||
| 	"Forward": "முன்னோக்கி", | ||||
| 	"Functionality": "செயல்பாடு", | ||||
| 	"General": "பொது", | ||||
| 	"Get beta updates": "பீட்டா புதுப்பிப்புகளைப் பெறுங்கள்", | ||||
| 	"Hard Reload": "கடின மறுஏற்றம்", | ||||
| 	"Help": "உதவி", | ||||
| 	"Help Center": "உதவி மையம்", | ||||
| 	"History": "வரலாறு", | ||||
| 	"History Shortcuts": "வரலாறு குறுக்குவழிகள்", | ||||
| 	"Keyboard Shortcuts": "விசைப்பலகை குறுக்குவழிகள்", | ||||
| 	"Log Out": "வெளியேறு", | ||||
| 	"Log Out of Organization": "நிறுவனத்திலிருந்து வெளியேறு", | ||||
| 	"Manual proxy configuration": "கையேடு ப்ராக்ஸி உள்ளமைவு", | ||||
| 	"Minimize": "குறைத்தல்", | ||||
| 	"Mute all sounds from Zulip": "ஜூலிப்பிலிருந்து எல்லா ஒலிகளையும் முடக்கு", | ||||
| 	"NO": "இல்லை", | ||||
| 	"Network": "வலைப்பின்னல்", | ||||
| 	"OR": "அல்லது", | ||||
| 	"Organization URL": "அமைப்பு URL", | ||||
| 	"Organizations": "அமைப்புக்கள்", | ||||
| 	"Paste": "ஒட்டு", | ||||
| 	"Paste and Match Style": "ஒட்டு மற்றும் போட்டி நடை", | ||||
| 	"Proxy": "பதிலாள்", | ||||
| 	"Proxy bypass rules": "ப்ராக்ஸி பைபாஸ் விதிகள்", | ||||
| 	"Proxy rules": "ப்ராக்ஸி விதிகள்", | ||||
| 	"Quit": "விட்டுவிட", | ||||
| 	"Quit Zulip": "ஜூலிப்பை விட்டு வெளியேறு", | ||||
| 	"Redo": "மீண்டும் செய்", | ||||
| 	"Release Notes": "வெளியீட்டு குறிப்புகள்", | ||||
| 	"Reload": "ஏற்றவும்", | ||||
| 	"Report an Issue": "ஒரு சிக்கலைப் புகாரளிக்கவும்", | ||||
| 	"Save": "சேமி", | ||||
| 	"Select All": "அனைத்தையும் தெரிவுசெய்", | ||||
| 	"Settings": "அமைப்புகள்", | ||||
| 	"Shortcuts": "குறுக்குவழிகள்", | ||||
| 	"Show App Logs": "பயன்பாட்டு பதிவுகளைக் காட்டு", | ||||
| 	"Show app icon in system tray": "கணினி தட்டில் பயன்பாட்டு ஐகானைக் காட்டு", | ||||
| 	"Show app unread badge": "பயன்பாட்டை படிக்காத பேட்ஜைக் காட்டு", | ||||
| 	"Show desktop notifications": "டெஸ்க்டாப் அறிவிப்புகளைக் காண்பி", | ||||
| 	"Show downloaded files in file manager": "பதிவிறக்கிய கோப்புகளை கோப்பு நிர்வாகியில் காண்பி", | ||||
| 	"Show sidebar": "பக்கப்பட்டியைக் காட்டு", | ||||
| 	"Start app at login": "உள்நுழைவில் பயன்பாட்டைத் தொடங்கவும்", | ||||
| 	"Switch to Next Organization": "அடுத்த அமைப்புக்கு மாறவும்", | ||||
| 	"Switch to Previous Organization": "முந்தைய அமைப்புக்கு மாறவும்", | ||||
| 	"These desktop app shortcuts extend the Zulip webapp's": "இந்த டெஸ்க்டாப் பயன்பாட்டு குறுக்குவழிகள் ஜூலிப் வெப்ஆப்பை நீட்டிக்கின்றன", | ||||
| 	"This will delete all application data including all added accounts and preferences": "இது அனைத்து சேர்க்கப்பட்ட கணக்குகள் மற்றும் விருப்பத்தேர்வுகள் உட்பட அனைத்து பயன்பாட்டு தரவையும் நீக்கும்", | ||||
| 	"Tip": "குறிப்பு", | ||||
| 	"Toggle DevTools for Active Tab": "செயலில் தாவலுக்கு DevTools ஐ மாற்று", | ||||
| 	"Toggle DevTools for Zulip App": "ஜூலிப் பயன்பாட்டிற்கான DevTools ஐ மாற்று", | ||||
| 	"Toggle Do Not Disturb": "தொந்தரவு செய்ய வேண்டாம் என்பதை நிலைமாற்று", | ||||
| 	"Toggle Full Screen": "மாற்று முழுத்திரை", | ||||
| 	"Toggle Sidebar": "பக்கப்பட்டியை நிலைமாற்று", | ||||
| 	"Toggle Tray Icon": "தட்டு ஐகானை மாற்று", | ||||
| 	"Tools": "கருவிகள்", | ||||
| 	"Undo": "செயல்தவிர்", | ||||
| 	"Upload": "பதிவேற்றம்", | ||||
| 	"Use system proxy settings (requires restart)": "கணினி ப்ராக்ஸி அமைப்புகளைப் பயன்படுத்தவும் (மறுதொடக்கம் தேவை)", | ||||
| 	"View": "காண்க", | ||||
| 	"View Shortcuts": "குறுக்குவழிகளைக் காண்க", | ||||
| 	"Window": "ஜன்னல்", | ||||
| 	"Window Shortcuts": "சாளர குறுக்குவழிகள்", | ||||
| 	"YES": "ஆம்", | ||||
| 	"Zoom In": "பெரிதாக்க", | ||||
| 	"Zoom Out": "பெரிதாக்கு", | ||||
| 	"Zulip Help": "ஜூலிப் உதவி", | ||||
| 	"keyboard shortcuts": "விசைப்பலகை குறுக்குவழிகள்", | ||||
| 	"script": "ஸ்கிரிப்ட்", | ||||
| 	"Quit when the window is closed": "Quit when the window is closed", | ||||
| 	"Ask where to save files before downloading": "Ask where to save files before downloading", | ||||
| 	"Services": "Services", | ||||
| 	"Hide": "Hide", | ||||
| 	"Hide Others": "Hide Others", | ||||
| 	"Unhide": "Unhide", | ||||
| 	"AddServer": "AddServer", | ||||
| 	"App language (requires restart)": "App language (requires restart)", | ||||
| 	"Factory Reset Data": "Factory Reset Data", | ||||
| 	"Reset the application, thus deleting all the connected organizations, accounts, and certificates.": "Reset the application, thus deleting all the connected organizations, accounts, and certificates.", | ||||
| 	"On macOS, the OS spellchecker is used.": "On macOS, the OS spellchecker is used.", | ||||
| 	"Change the language from System Preferences → Keyboard → Text → Spelling.": "Change the language from System Preferences → Keyboard → Text → Spelling.", | ||||
| 	"Copy Link": "Copy Link", | ||||
| 	"Copy Image": "Copy Image", | ||||
| 	"Copy Image URL": "Copy Image URL", | ||||
| 	"No Suggestion Found": "No Suggestion Found", | ||||
| 	"You can select a maximum of 3 languages for spellchecking.": "You can select a maximum of 3 languages for spellchecking.", | ||||
| 	"Spellchecker Languages": "Spellchecker Languages", | ||||
| 	"Add to Dictionary": "Add to Dictionary", | ||||
| 	"Look Up": "Look Up" | ||||
| } | ||||
| @@ -1,134 +0,0 @@ | ||||
| { | ||||
| 	"About Zulip": "Про Zulip", | ||||
| 	"Actual Size": "Фактичний розмір", | ||||
| 	"Add Custom Certificates": "Додати власні сертифікати", | ||||
| 	"Add Organization": "Додати організацію", | ||||
| 	"Add a Zulip organization": "Додати організацію Zulip", | ||||
| 	"Add custom CSS": "Додати власний CSS", | ||||
| 	"Advanced": "Розширені", | ||||
| 	"All the connected organizations will appear here": "Усі підключені організації з’являться тут", | ||||
| 	"Always start minimized": "Запускати мінімізованим", | ||||
| 	"App Updates": "Оновлення додатку", | ||||
| 	"Appearance": "Зовнішній вигляд", | ||||
| 	"Application Shortcuts": "Клавіатурні скорочення програми", | ||||
| 	"Are you sure you want to disconnect this organization?": "Ви дійсно хочете відключити цю організацію?", | ||||
| 	"Auto hide Menu bar": "Автоматично приховувати рядок меню", | ||||
| 	"Auto hide menu bar (Press Alt key to display)": "Автоматичне приховування панелі меню (клавіша Alt для відображення)", | ||||
| 	"Back": "Назад", | ||||
| 	"Bounce dock on new private message": "Bounce dock on new private message", | ||||
| 	"Certificate file": "Файл сертифіката", | ||||
| 	"Change": "Змінити", | ||||
| 	"Check for Updates": "Перевірити наявність оновлень", | ||||
| 	"Close": "Закрити", | ||||
| 	"Connect": "Під'єднати", | ||||
| 	"Connect to another organization": "Під'єднатися до іншої організації", | ||||
| 	"Connected organizations": "Під'єднані організації", | ||||
| 	"Copy": "Копіювати", | ||||
| 	"Copy Zulip URL": "Скопіювати URL-адресу Zulip", | ||||
| 	"Create a new organization": "Створити нову організацію", | ||||
| 	"Cut": "Вирізати", | ||||
| 	"Default download location": "Місце завантаження за замовчуванням", | ||||
| 	"Delete": "Видалити", | ||||
| 	"Desktop App Settings": "Desktop App Settings", | ||||
| 	"Desktop Notifications": "Сповіщення на робочому столі", | ||||
| 	"Desktop Settings": "Налаштування", | ||||
| 	"Disconnect": "Від'єднати", | ||||
| 	"Download App Logs": "Завантажити журнали додатку", | ||||
| 	"Edit": "Редагувати", | ||||
| 	"Edit Shortcuts": "Клавіатурні скорочення редагування", | ||||
| 	"Enable auto updates": "Увімкнути автоматичне оновлення", | ||||
| 	"Enable error reporting (requires restart)": "Увімкнути повідомлення про помилки (потрібен перезапуск)", | ||||
| 	"Enable spellchecker (requires restart)": "Увімкнути перевірку орфографії (потрібен перезапуск)", | ||||
| 	"Factory Reset": "Скинути до заводських", | ||||
| 	"File": "Файл", | ||||
| 	"Find accounts": "Знайти облікові записи", | ||||
| 	"Find accounts by email": "Знайти облікові записи за електронною поштою", | ||||
| 	"Flash taskbar on new message": "Блимати на панелі завдань при новому повідомленні", | ||||
| 	"Forward": "Вперед", | ||||
| 	"Functionality": "Функціональність", | ||||
| 	"General": "Загальні", | ||||
| 	"Get beta updates": "Отримувати бета-оновлення", | ||||
| 	"Hard Reload": "Жорстке перезавантаження", | ||||
| 	"Help": "Довідка", | ||||
| 	"Help Center": "Центр допомоги", | ||||
| 	"History": "Історія", | ||||
| 	"History Shortcuts": "Клавіатурні скорочення історії", | ||||
| 	"Keyboard Shortcuts": "Клавіатурні скорочення", | ||||
| 	"Log Out": "Вийти", | ||||
| 	"Log Out of Organization": "Вийти з організації", | ||||
| 	"Manual proxy configuration": "Ручні налаштування проксі-сервера", | ||||
| 	"Minimize": "Мінімізувати", | ||||
| 	"Mute all sounds from Zulip": "Заглушити всі звуки від Zulip", | ||||
| 	"NO": "НІ", | ||||
| 	"Network": "Мережа", | ||||
| 	"OR": "АБО", | ||||
| 	"Organization URL": "URL-адреса організації", | ||||
| 	"Organizations": "Організації", | ||||
| 	"Paste": "Вставити", | ||||
| 	"Paste and Match Style": "Вставити з відповідним стилем", | ||||
| 	"Proxy": "Проксі", | ||||
| 	"Proxy bypass rules": "Правила обходу проксі", | ||||
| 	"Proxy rules": "Правила проксі", | ||||
| 	"Quit": "Вийти", | ||||
| 	"Quit Zulip": "Вийти з Zulip", | ||||
| 	"Redo": "Повторити", | ||||
| 	"Release Notes": "Примітки до випуску", | ||||
| 	"Reload": "Перезавантажити", | ||||
| 	"Report an Issue": "Повідомити про проблему", | ||||
| 	"Save": "Зберегти", | ||||
| 	"Select All": "Вибрати все", | ||||
| 	"Settings": "Налаштування", | ||||
| 	"Shortcuts": "Клавіатурні скорочення", | ||||
| 	"Show App Logs": "Показати журнали програми", | ||||
| 	"Show app icon in system tray": "Показувати значок програми в системному треї", | ||||
| 	"Show app unread badge": "Показувати значок непрочитаних повідомлень", | ||||
| 	"Show desktop notifications": "Показувати сповіщення на робочому столі", | ||||
| 	"Show downloaded files in file manager": "Показувати завантажені файли в файловому менеджері", | ||||
| 	"Show sidebar": "Показувати бічну панель", | ||||
| 	"Start app at login": "Запускати програму при вході в систему", | ||||
| 	"Switch to Next Organization": "Перемкнутись до наступної організації", | ||||
| 	"Switch to Previous Organization": "Перемкнути на попередню організацію", | ||||
| 	"These desktop app shortcuts extend the Zulip webapp's": "These desktop app shortcuts extend the Zulip webapp's", | ||||
| 	"This will delete all application data including all added accounts and preferences": "Це видалить усі дані програми, включаючи всі додані облікові записи та налаштування", | ||||
| 	"Tip": "Порада", | ||||
| 	"Toggle DevTools for Active Tab": "Увімкнути DevTools для активної вкладки", | ||||
| 	"Toggle DevTools for Zulip App": "Увімкнути DevTools для додатку Zulip", | ||||
| 	"Toggle Do Not Disturb": "Режим «Не турбувати»", | ||||
| 	"Toggle Full Screen": "Повноекранний режим", | ||||
| 	"Toggle Sidebar": "Перемкнути бічну панель", | ||||
| 	"Toggle Tray Icon": "Перемкнути значок в треї", | ||||
| 	"Tools": "Інструменти", | ||||
| 	"Undo": "Назад", | ||||
| 	"Upload": "Завантажити", | ||||
| 	"Use system proxy settings (requires restart)": "Використовувати системні налаштування проксі (потрібен перезапуск)", | ||||
| 	"View": "Вигляд", | ||||
| 	"View Shortcuts": "Клавіатурні скорочення вигляду", | ||||
| 	"Window": "Вікно", | ||||
| 	"Window Shortcuts": "Клавіатурні скороченн вікна", | ||||
| 	"YES": "ТАК", | ||||
| 	"Zoom In": "Збільшити", | ||||
| 	"Zoom Out": "Зменшити", | ||||
| 	"Zulip Help": "Довідка Zulip", | ||||
| 	"keyboard shortcuts": "клавіатурні скорочення", | ||||
| 	"script": "скрипт", | ||||
| 	"Quit when the window is closed": "Виходити, коли вікно закрите", | ||||
| 	"Ask where to save files before downloading": "Запитувати, куди зберігати файли перед завантаженням", | ||||
| 	"Services": "Services", | ||||
| 	"Hide": "Hide", | ||||
| 	"Hide Others": "Hide Others", | ||||
| 	"Unhide": "Unhide", | ||||
| 	"AddServer": "AddServer", | ||||
| 	"App language (requires restart)": "App language (requires restart)", | ||||
| 	"Factory Reset Data": "Factory Reset Data", | ||||
| 	"Reset the application, thus deleting all the connected organizations, accounts, and certificates.": "Reset the application, thus deleting all the connected organizations, accounts, and certificates.", | ||||
| 	"On macOS, the OS spellchecker is used.": "On macOS, the OS spellchecker is used.", | ||||
| 	"Change the language from System Preferences → Keyboard → Text → Spelling.": "Change the language from System Preferences → Keyboard → Text → Spelling.", | ||||
| 	"Copy Link": "Copy Link", | ||||
| 	"Copy Image": "Copy Image", | ||||
| 	"Copy Image URL": "Copy Image URL", | ||||
| 	"No Suggestion Found": "No Suggestion Found", | ||||
| 	"You can select a maximum of 3 languages for spellchecking.": "You can select a maximum of 3 languages for spellchecking.", | ||||
| 	"Spellchecker Languages": "Spellchecker Languages", | ||||
| 	"Add to Dictionary": "Add to Dictionary", | ||||
| 	"Look Up": "Look Up" | ||||
| } | ||||
| @@ -1,134 +0,0 @@ | ||||
| { | ||||
| 	"About Zulip": "Giới thiệu", | ||||
| 	"Actual Size": "Kích thước thực", | ||||
| 	"Add Custom Certificates": "Thêm chứng chỉ tự tùy chỉnh", | ||||
| 	"Add Organization": "Thêm nhóm", | ||||
| 	"Add a Zulip organization": "Thêm nhóm Zulip", | ||||
| 	"Add custom CSS": "Thêm chỉnh sửa CSS", | ||||
| 	"Advanced": "Nâng cao", | ||||
| 	"All the connected organizations will appear here": "Tất cả các nhóm đã kết nối sẽ hiển thị tại đây", | ||||
| 	"Always start minimized": "Luôn thu nhỏ", | ||||
| 	"App Updates": "Cập nhật", | ||||
| 	"Appearance": "Giao diện", | ||||
| 	"Application Shortcuts": "Phím tắt", | ||||
| 	"Are you sure you want to disconnect this organization?": "Bạn có chắc muốn ngừng kết nối với nhóm này?", | ||||
| 	"Auto hide Menu bar": "Tự động ẩn thanh công cụ", | ||||
| 	"Auto hide menu bar (Press Alt key to display)": "Tự động ẩn thanh công cụ (Ấn phím Alt để hiển thị)", | ||||
| 	"Back": "Quay lại", | ||||
| 	"Bounce dock on new private message": "Bounce dock trên tin nhắn mới", | ||||
| 	"Certificate file": "Giấy chứng nhận", | ||||
| 	"Change": "Thay đổi", | ||||
| 	"Check for Updates": "Kiểm tra cập nhật", | ||||
| 	"Close": "Tắt", | ||||
| 	"Connect": "Kết nối", | ||||
| 	"Connect to another organization": "Kết nối với tổ chức khác", | ||||
| 	"Connected organizations": "Tổ chức kết nối", | ||||
| 	"Copy": "Sao chép", | ||||
| 	"Copy Zulip URL": "Sao chép đường dẫn", | ||||
| 	"Create a new organization": "Tạo nhóm mới", | ||||
| 	"Cut": "Cắt", | ||||
| 	"Default download location": "Nơi lưu tập tin mặc định", | ||||
| 	"Delete": "Xóa", | ||||
| 	"Desktop App Settings": "Desktop App Settings", | ||||
| 	"Desktop Notifications": "Thông báo trên giao diện máy tính", | ||||
| 	"Desktop Settings": "Cài đặt ứng dụng", | ||||
| 	"Disconnect": "Ngắt kết nối", | ||||
| 	"Download App Logs": "Download App Logs", | ||||
| 	"Edit": "Chỉnh sửa", | ||||
| 	"Edit Shortcuts": "Edit Shortcuts", | ||||
| 	"Enable auto updates": "Enable auto updates", | ||||
| 	"Enable error reporting (requires restart)": "Enable error reporting (requires restart)", | ||||
| 	"Enable spellchecker (requires restart)": "Enable spellchecker (requires restart)", | ||||
| 	"Factory Reset": "Factory Reset", | ||||
| 	"File": "File", | ||||
| 	"Find accounts": "Find accounts", | ||||
| 	"Find accounts by email": "Find accounts by email", | ||||
| 	"Flash taskbar on new message": "Flash taskbar on new message", | ||||
| 	"Forward": "Forward", | ||||
| 	"Functionality": "Functionality", | ||||
| 	"General": "General", | ||||
| 	"Get beta updates": "Get beta updates", | ||||
| 	"Hard Reload": "Hard Reload", | ||||
| 	"Help": "Help", | ||||
| 	"Help Center": "Help Center", | ||||
| 	"History": "History", | ||||
| 	"History Shortcuts": "History Shortcuts", | ||||
| 	"Keyboard Shortcuts": "Keyboard Shortcuts", | ||||
| 	"Log Out": "Log Out", | ||||
| 	"Log Out of Organization": "Log Out of Organization", | ||||
| 	"Manual proxy configuration": "Manual proxy configuration", | ||||
| 	"Minimize": "Minimize", | ||||
| 	"Mute all sounds from Zulip": "Mute all sounds from Zulip", | ||||
| 	"NO": "NO", | ||||
| 	"Network": "Network", | ||||
| 	"OR": "OR", | ||||
| 	"Organization URL": "Organization URL", | ||||
| 	"Organizations": "Organizations", | ||||
| 	"Paste": "Paste", | ||||
| 	"Paste and Match Style": "Paste and Match Style", | ||||
| 	"Proxy": "Proxy", | ||||
| 	"Proxy bypass rules": "Proxy bypass rules", | ||||
| 	"Proxy rules": "Proxy rules", | ||||
| 	"Quit": "Thoát", | ||||
| 	"Quit Zulip": "Thoát khỏi Zulip", | ||||
| 	"Redo": "Thực hiện lại", | ||||
| 	"Release Notes": "Release Notes", | ||||
| 	"Reload": "Tải lại", | ||||
| 	"Report an Issue": "Report an Issue", | ||||
| 	"Save": "Lưu", | ||||
| 	"Select All": "Select All", | ||||
| 	"Settings": "Cài đặt", | ||||
| 	"Shortcuts": "Shortcuts", | ||||
| 	"Show App Logs": "Show App Logs", | ||||
| 	"Show app icon in system tray": "Show app icon in system tray", | ||||
| 	"Show app unread badge": "Show app unread badge", | ||||
| 	"Show desktop notifications": "Show desktop notifications", | ||||
| 	"Show downloaded files in file manager": "Show downloaded files in file manager", | ||||
| 	"Show sidebar": "Show sidebar", | ||||
| 	"Start app at login": "Start app at login", | ||||
| 	"Switch to Next Organization": "Switch to Next Organization", | ||||
| 	"Switch to Previous Organization": "Switch to Previous Organization", | ||||
| 	"These desktop app shortcuts extend the Zulip webapp's": "These desktop app shortcuts extend the Zulip webapp's", | ||||
| 	"This will delete all application data including all added accounts and preferences": "Mọi dữ liệu trong ứng dụng, bao gồm tất cả tài khoản và tùy chỉnh được thêm vào, sẽ bị xóa", | ||||
| 	"Tip": "Mẹo", | ||||
| 	"Toggle DevTools for Active Tab": "Toggle DevTools for Active Tab", | ||||
| 	"Toggle DevTools for Zulip App": "Toggle DevTools for Zulip App", | ||||
| 	"Toggle Do Not Disturb": "Toggle Do Not Disturb", | ||||
| 	"Toggle Full Screen": "Toggle Full Screen", | ||||
| 	"Toggle Sidebar": "Toggle Sidebar", | ||||
| 	"Toggle Tray Icon": "Toggle Tray Icon", | ||||
| 	"Tools": "Công cụ", | ||||
| 	"Undo": "Hủy thay đổi", | ||||
| 	"Upload": "Tải lên", | ||||
| 	"Use system proxy settings (requires restart)": "Chọn cài đặt system proxy (Yêu cầu khởi động lại)", | ||||
| 	"View": "Xem", | ||||
| 	"View Shortcuts": "Hiển thị phím tắt", | ||||
| 	"Window": "Ứng dụng Window", | ||||
| 	"Window Shortcuts": "Phím tắt trong Windows", | ||||
| 	"YES": "Có", | ||||
| 	"Zoom In": "Phóng to", | ||||
| 	"Zoom Out": "Thu nhỏ", | ||||
| 	"Zulip Help": "Trợ giúp", | ||||
| 	"keyboard shortcuts": "Phím tắt bàn phím", | ||||
| 	"script": "script", | ||||
| 	"Quit when the window is closed": "Thoát khi cửa sổ tắt", | ||||
| 	"Ask where to save files before downloading": "Ask where to save files before downloading", | ||||
| 	"Services": "Services", | ||||
| 	"Hide": "Hide", | ||||
| 	"Hide Others": "Hide Others", | ||||
| 	"Unhide": "Unhide", | ||||
| 	"AddServer": "AddServer", | ||||
| 	"App language (requires restart)": "App language (requires restart)", | ||||
| 	"Factory Reset Data": "Factory Reset Data", | ||||
| 	"Reset the application, thus deleting all the connected organizations, accounts, and certificates.": "Reset the application, thus deleting all the connected organizations, accounts, and certificates.", | ||||
| 	"On macOS, the OS spellchecker is used.": "On macOS, the OS spellchecker is used.", | ||||
| 	"Change the language from System Preferences → Keyboard → Text → Spelling.": "Change the language from System Preferences → Keyboard → Text → Spelling.", | ||||
| 	"Copy Link": "Copy Link", | ||||
| 	"Copy Image": "Copy Image", | ||||
| 	"Copy Image URL": "Copy Image URL", | ||||
| 	"No Suggestion Found": "No Suggestion Found", | ||||
| 	"You can select a maximum of 3 languages for spellchecking.": "You can select a maximum of 3 languages for spellchecking.", | ||||
| 	"Spellchecker Languages": "Spellchecker Languages", | ||||
| 	"Add to Dictionary": "Add to Dictionary", | ||||
| 	"Look Up": "Look Up" | ||||
| } | ||||
| @@ -1,134 +0,0 @@ | ||||
| { | ||||
| 	"About Zulip": "关于Zulip", | ||||
| 	"Actual Size": "真实大小", | ||||
| 	"Add Custom Certificates": "添加自定义证书\n\n", | ||||
| 	"Add Organization": "添加组织\n\n", | ||||
| 	"Add a Zulip organization": "添加Zulip组织\n\n", | ||||
| 	"Add custom CSS": "添加自定义样式(CSS)", | ||||
| 	"Advanced": "高级", | ||||
| 	"All the connected organizations will appear here": "All the connected organizations will appear here", | ||||
| 	"Always start minimized": "Always start minimized", | ||||
| 	"App Updates": "应用更新", | ||||
| 	"Appearance": "Appearance", | ||||
| 	"Application Shortcuts": "快捷键", | ||||
| 	"Are you sure you want to disconnect this organization?": "Are you sure you want to disconnect this organization?", | ||||
| 	"Auto hide Menu bar": "Auto hide Menu bar", | ||||
| 	"Auto hide menu bar (Press Alt key to display)": "Auto hide menu bar (Press Alt key to display)", | ||||
| 	"Back": "后退", | ||||
| 	"Bounce dock on new private message": "Bounce dock on new private message", | ||||
| 	"Certificate file": "Certificate file", | ||||
| 	"Change": "更改", | ||||
| 	"Check for Updates": "检查更新...", | ||||
| 	"Close": "关闭", | ||||
| 	"Connect": "连接", | ||||
| 	"Connect to another organization": "连接到另一个组织", | ||||
| 	"Connected organizations": "连接的组织", | ||||
| 	"Copy": "复制", | ||||
| 	"Copy Zulip URL": "复制Zulip地址(URL)", | ||||
| 	"Create a new organization": "创建新的组织", | ||||
| 	"Cut": "剪切", | ||||
| 	"Default download location": "缺省下载位置", | ||||
| 	"Delete": "删除", | ||||
| 	"Desktop App Settings": "Desktop App Settings", | ||||
| 	"Desktop Notifications": "Desktop Notifications", | ||||
| 	"Desktop Settings": "Desktop Settings", | ||||
| 	"Disconnect": "断开", | ||||
| 	"Download App Logs": "Download App Logs", | ||||
| 	"Edit": "编辑", | ||||
| 	"Edit Shortcuts": "Edit Shortcuts", | ||||
| 	"Enable auto updates": "Enable auto updates", | ||||
| 	"Enable error reporting (requires restart)": "Enable error reporting (requires restart)", | ||||
| 	"Enable spellchecker (requires restart)": "Enable spellchecker (requires restart)", | ||||
| 	"Factory Reset": "Factory Reset", | ||||
| 	"File": "文件", | ||||
| 	"Find accounts": "查找账户", | ||||
| 	"Find accounts by email": "Find accounts by email", | ||||
| 	"Flash taskbar on new message": "Flash taskbar on new message", | ||||
| 	"Forward": "Forward", | ||||
| 	"Functionality": "Functionality", | ||||
| 	"General": "General", | ||||
| 	"Get beta updates": "Get beta updates", | ||||
| 	"Hard Reload": "Hard Reload", | ||||
| 	"Help": "Help", | ||||
| 	"Help Center": "Help Center", | ||||
| 	"History": "历史消息", | ||||
| 	"History Shortcuts": "History Shortcuts", | ||||
| 	"Keyboard Shortcuts": "Keyboard Shortcuts", | ||||
| 	"Log Out": "退出", | ||||
| 	"Log Out of Organization": "Log Out of Organization", | ||||
| 	"Manual proxy configuration": "Manual proxy configuration", | ||||
| 	"Minimize": "最小化", | ||||
| 	"Mute all sounds from Zulip": "Mute all sounds from Zulip", | ||||
| 	"NO": "NO", | ||||
| 	"Network": "Network", | ||||
| 	"OR": "或", | ||||
| 	"Organization URL": "社群网址", | ||||
| 	"Organizations": "Organizations", | ||||
| 	"Paste": "粘贴", | ||||
| 	"Paste and Match Style": "粘贴并匹配格式", | ||||
| 	"Proxy": "Proxy", | ||||
| 	"Proxy bypass rules": "Proxy bypass rules", | ||||
| 	"Proxy rules": "Proxy rules", | ||||
| 	"Quit": "Quit", | ||||
| 	"Quit Zulip": "Quit Zulip", | ||||
| 	"Redo": "Redo", | ||||
| 	"Release Notes": "Release Notes", | ||||
| 	"Reload": "Reload", | ||||
| 	"Report an Issue": "Report an Issue", | ||||
| 	"Save": "保存", | ||||
| 	"Select All": "全选", | ||||
| 	"Settings": "设置", | ||||
| 	"Shortcuts": "Shortcuts", | ||||
| 	"Show App Logs": "Show App Logs", | ||||
| 	"Show app icon in system tray": "Show app icon in system tray", | ||||
| 	"Show app unread badge": "Show app unread badge", | ||||
| 	"Show desktop notifications": "Show desktop notifications", | ||||
| 	"Show downloaded files in file manager": "Show downloaded files in file manager", | ||||
| 	"Show sidebar": "显示侧边栏", | ||||
| 	"Start app at login": "Start app at login", | ||||
| 	"Switch to Next Organization": "Switch to Next Organization", | ||||
| 	"Switch to Previous Organization": "Switch to Previous Organization", | ||||
| 	"These desktop app shortcuts extend the Zulip webapp's": "These desktop app shortcuts extend the Zulip webapp's", | ||||
| 	"This will delete all application data including all added accounts and preferences": "This will delete all application data including all added accounts and preferences", | ||||
| 	"Tip": "Tip", | ||||
| 	"Toggle DevTools for Active Tab": "Toggle DevTools for Active Tab", | ||||
| 	"Toggle DevTools for Zulip App": "Toggle DevTools for Zulip App", | ||||
| 	"Toggle Do Not Disturb": "Toggle Do Not Disturb", | ||||
| 	"Toggle Full Screen": "Toggle Full Screen", | ||||
| 	"Toggle Sidebar": "Toggle Sidebar", | ||||
| 	"Toggle Tray Icon": "Toggle Tray Icon", | ||||
| 	"Tools": "工具", | ||||
| 	"Undo": "撤销", | ||||
| 	"Upload": "上传", | ||||
| 	"Use system proxy settings (requires restart)": "Use system proxy settings (requires restart)", | ||||
| 	"View": "View", | ||||
| 	"View Shortcuts": "View Shortcuts", | ||||
| 	"Window": "Window", | ||||
| 	"Window Shortcuts": "Window Shortcuts", | ||||
| 	"YES": "确认", | ||||
| 	"Zoom In": "Zoom In", | ||||
| 	"Zoom Out": "Zoom Out", | ||||
| 	"Zulip Help": "Zulip Help", | ||||
| 	"keyboard shortcuts": "keyboard shortcuts", | ||||
| 	"script": "script", | ||||
| 	"Quit when the window is closed": "Quit when the window is closed", | ||||
| 	"Ask where to save files before downloading": "Ask where to save files before downloading", | ||||
| 	"Services": "Services", | ||||
| 	"Hide": "Hide", | ||||
| 	"Hide Others": "Hide Others", | ||||
| 	"Unhide": "Unhide", | ||||
| 	"AddServer": "AddServer", | ||||
| 	"App language (requires restart)": "App language (requires restart)", | ||||
| 	"Factory Reset Data": "Factory Reset Data", | ||||
| 	"Reset the application, thus deleting all the connected organizations, accounts, and certificates.": "Reset the application, thus deleting all the connected organizations, accounts, and certificates.", | ||||
| 	"On macOS, the OS spellchecker is used.": "On macOS, the OS spellchecker is used.", | ||||
| 	"Change the language from System Preferences → Keyboard → Text → Spelling.": "Change the language from System Preferences → Keyboard → Text → Spelling.", | ||||
| 	"Copy Link": "Copy Link", | ||||
| 	"Copy Image": "Copy Image", | ||||
| 	"Copy Image URL": "Copy Image URL", | ||||
| 	"No Suggestion Found": "No Suggestion Found", | ||||
| 	"You can select a maximum of 3 languages for spellchecking.": "You can select a maximum of 3 languages for spellchecking.", | ||||
| 	"Spellchecker Languages": "Spellchecker Languages", | ||||
| 	"Add to Dictionary": "Add to Dictionary", | ||||
| 	"Look Up": "Look Up" | ||||
| } | ||||
| @@ -1,134 +0,0 @@ | ||||
| { | ||||
| 	"About Zulip": "關於 Zulip", | ||||
| 	"Actual Size": "Actual Size", | ||||
| 	"Add Custom Certificates": "Add Custom Certificates", | ||||
| 	"Add Organization": "Add Organization", | ||||
| 	"Add a Zulip organization": "Add a Zulip organization", | ||||
| 	"Add custom CSS": "Add custom CSS", | ||||
| 	"Advanced": "Advanced", | ||||
| 	"All the connected organizations will appear here": "All the connected organizations will appear here", | ||||
| 	"Always start minimized": "Always start minimized", | ||||
| 	"App Updates": "App Updates", | ||||
| 	"Appearance": "Appearance", | ||||
| 	"Application Shortcuts": "Application Shortcuts", | ||||
| 	"Are you sure you want to disconnect this organization?": "Are you sure you want to disconnect this organization?", | ||||
| 	"Auto hide Menu bar": "Auto hide Menu bar", | ||||
| 	"Auto hide menu bar (Press Alt key to display)": "Auto hide menu bar (Press Alt key to display)", | ||||
| 	"Back": "Back", | ||||
| 	"Bounce dock on new private message": "Bounce dock on new private message", | ||||
| 	"Certificate file": "Certificate file", | ||||
| 	"Change": "Change", | ||||
| 	"Check for Updates": "Check for Updates", | ||||
| 	"Close": "關閉", | ||||
| 	"Connect": "Connect", | ||||
| 	"Connect to another organization": "Connect to another organization", | ||||
| 	"Connected organizations": "Connected organizations", | ||||
| 	"Copy": "Copy", | ||||
| 	"Copy Zulip URL": "Copy Zulip URL", | ||||
| 	"Create a new organization": "Create a new organization", | ||||
| 	"Cut": "Cut", | ||||
| 	"Default download location": "Default download location", | ||||
| 	"Delete": "Delete", | ||||
| 	"Desktop App Settings": "Desktop App Settings", | ||||
| 	"Desktop Notifications": "Desktop Notifications", | ||||
| 	"Desktop Settings": "Desktop Settings", | ||||
| 	"Disconnect": "Disconnect", | ||||
| 	"Download App Logs": "Download App Logs", | ||||
| 	"Edit": "Edit", | ||||
| 	"Edit Shortcuts": "Edit Shortcuts", | ||||
| 	"Enable auto updates": "Enable auto updates", | ||||
| 	"Enable error reporting (requires restart)": "Enable error reporting (requires restart)", | ||||
| 	"Enable spellchecker (requires restart)": "Enable spellchecker (requires restart)", | ||||
| 	"Factory Reset": "Factory Reset", | ||||
| 	"File": "File", | ||||
| 	"Find accounts": "尋找帳戶", | ||||
| 	"Find accounts by email": "Find accounts by email", | ||||
| 	"Flash taskbar on new message": "Flash taskbar on new message", | ||||
| 	"Forward": "Forward", | ||||
| 	"Functionality": "Functionality", | ||||
| 	"General": "General", | ||||
| 	"Get beta updates": "Get beta updates", | ||||
| 	"Hard Reload": "Hard Reload", | ||||
| 	"Help": "Help", | ||||
| 	"Help Center": "Help Center", | ||||
| 	"History": "History", | ||||
| 	"History Shortcuts": "History Shortcuts", | ||||
| 	"Keyboard Shortcuts": "Keyboard Shortcuts", | ||||
| 	"Log Out": "Log Out", | ||||
| 	"Log Out of Organization": "Log Out of Organization", | ||||
| 	"Manual proxy configuration": "Manual proxy configuration", | ||||
| 	"Minimize": "Minimize", | ||||
| 	"Mute all sounds from Zulip": "Mute all sounds from Zulip", | ||||
| 	"NO": "NO", | ||||
| 	"Network": "Network", | ||||
| 	"OR": "OR", | ||||
| 	"Organization URL": "Organization URL", | ||||
| 	"Organizations": "Organizations", | ||||
| 	"Paste": "Paste", | ||||
| 	"Paste and Match Style": "Paste and Match Style", | ||||
| 	"Proxy": "Proxy", | ||||
| 	"Proxy bypass rules": "Proxy bypass rules", | ||||
| 	"Proxy rules": "Proxy rules", | ||||
| 	"Quit": "Quit", | ||||
| 	"Quit Zulip": "Quit Zulip", | ||||
| 	"Redo": "Redo", | ||||
| 	"Release Notes": "Release Notes", | ||||
| 	"Reload": "Reload", | ||||
| 	"Report an Issue": "Report an Issue", | ||||
| 	"Save": "Save", | ||||
| 	"Select All": "Select All", | ||||
| 	"Settings": "設定", | ||||
| 	"Shortcuts": "Shortcuts", | ||||
| 	"Show App Logs": "Show App Logs", | ||||
| 	"Show app icon in system tray": "Show app icon in system tray", | ||||
| 	"Show app unread badge": "Show app unread badge", | ||||
| 	"Show desktop notifications": "Show desktop notifications", | ||||
| 	"Show downloaded files in file manager": "Show downloaded files in file manager", | ||||
| 	"Show sidebar": "Show sidebar", | ||||
| 	"Start app at login": "Start app at login", | ||||
| 	"Switch to Next Organization": "Switch to Next Organization", | ||||
| 	"Switch to Previous Organization": "Switch to Previous Organization", | ||||
| 	"These desktop app shortcuts extend the Zulip webapp's": "These desktop app shortcuts extend the Zulip webapp's", | ||||
| 	"This will delete all application data including all added accounts and preferences": "This will delete all application data including all added accounts and preferences", | ||||
| 	"Tip": "Tip", | ||||
| 	"Toggle DevTools for Active Tab": "Toggle DevTools for Active Tab", | ||||
| 	"Toggle DevTools for Zulip App": "Toggle DevTools for Zulip App", | ||||
| 	"Toggle Do Not Disturb": "Toggle Do Not Disturb", | ||||
| 	"Toggle Full Screen": "Toggle Full Screen", | ||||
| 	"Toggle Sidebar": "Toggle Sidebar", | ||||
| 	"Toggle Tray Icon": "Toggle Tray Icon", | ||||
| 	"Tools": "Tools", | ||||
| 	"Undo": "Undo", | ||||
| 	"Upload": "Upload", | ||||
| 	"Use system proxy settings (requires restart)": "Use system proxy settings (requires restart)", | ||||
| 	"View": "View", | ||||
| 	"View Shortcuts": "View Shortcuts", | ||||
| 	"Window": "Window", | ||||
| 	"Window Shortcuts": "Window Shortcuts", | ||||
| 	"YES": "YES", | ||||
| 	"Zoom In": "Zoom In", | ||||
| 	"Zoom Out": "Zoom Out", | ||||
| 	"Zulip Help": "Zulip Help", | ||||
| 	"keyboard shortcuts": "keyboard shortcuts", | ||||
| 	"script": "script", | ||||
| 	"Quit when the window is closed": "Quit when the window is closed", | ||||
| 	"Ask where to save files before downloading": "Ask where to save files before downloading", | ||||
| 	"Services": "Services", | ||||
| 	"Hide": "Hide", | ||||
| 	"Hide Others": "Hide Others", | ||||
| 	"Unhide": "Unhide", | ||||
| 	"AddServer": "AddServer", | ||||
| 	"App language (requires restart)": "App language (requires restart)", | ||||
| 	"Factory Reset Data": "Factory Reset Data", | ||||
| 	"Reset the application, thus deleting all the connected organizations, accounts, and certificates.": "Reset the application, thus deleting all the connected organizations, accounts, and certificates.", | ||||
| 	"On macOS, the OS spellchecker is used.": "On macOS, the OS spellchecker is used.", | ||||
| 	"Change the language from System Preferences → Keyboard → Text → Spelling.": "Change the language from System Preferences → Keyboard → Text → Spelling.", | ||||
| 	"Copy Link": "Copy Link", | ||||
| 	"Copy Image": "Copy Image", | ||||
| 	"Copy Image URL": "Copy Image URL", | ||||
| 	"No Suggestion Found": "No Suggestion Found", | ||||
| 	"You can select a maximum of 3 languages for spellchecking.": "You can select a maximum of 3 languages for spellchecking.", | ||||
| 	"Spellchecker Languages": "Spellchecker Languages", | ||||
| 	"Add to Dictionary": "Add to Dictionary", | ||||
| 	"Look Up": "Look Up" | ||||
| } | ||||
| @@ -1,134 +0,0 @@ | ||||
| { | ||||
| 	"About Zulip": "關於 Zulip", | ||||
| 	"Actual Size": "實際大小", | ||||
| 	"Add Custom Certificates": "新增自定義證書", | ||||
| 	"Add Organization": "新增組織", | ||||
| 	"Add a Zulip organization": "新增 Zulip 組織", | ||||
| 	"Add custom CSS": "新增自定義 CSS", | ||||
| 	"Advanced": "\b\b進階", | ||||
| 	"All the connected organizations will appear here": "所有已連結的組織將會顯示於此", | ||||
| 	"Always start minimized": "始終最小化開啟", | ||||
| 	"App Updates": "應用程式更新", | ||||
| 	"Appearance": "外觀", | ||||
| 	"Application Shortcuts": "應用程式快捷鍵", | ||||
| 	"Are you sure you want to disconnect this organization?": "您確定要斷開與此組織之連結?", | ||||
| 	"Auto hide Menu bar": "自動隱藏功能選單", | ||||
| 	"Auto hide menu bar (Press Alt key to display)": "自動隱藏功能選單(按 Alt 鍵顯示)", | ||||
| 	"Back": "返回", | ||||
| 	"Bounce dock on new private message": "Bounce dock on 新的私人訊息", | ||||
| 	"Certificate file": "證書檔案", | ||||
| 	"Change": "修改", | ||||
| 	"Check for Updates": "檢查更新", | ||||
| 	"Close": "關閉", | ||||
| 	"Connect": "連結", | ||||
| 	"Connect to another organization": "連結至其他組織", | ||||
| 	"Connected organizations": "已連結的組織", | ||||
| 	"Copy": "複製", | ||||
| 	"Copy Zulip URL": "複製 Zulip 網址", | ||||
| 	"Create a new organization": "新增組織", | ||||
| 	"Cut": "剪下", | ||||
| 	"Default download location": "預設下載位置", | ||||
| 	"Delete": "刪除", | ||||
| 	"Desktop App Settings": "桌面版應用程式設定", | ||||
| 	"Desktop Notifications": "桌面版通知", | ||||
| 	"Desktop Settings": "桌面版設定", | ||||
| 	"Disconnect": "斷開連結", | ||||
| 	"Download App Logs": "下載應用程式紀錄", | ||||
| 	"Edit": "編輯", | ||||
| 	"Edit Shortcuts": "編輯快捷鍵", | ||||
| 	"Enable auto updates": "啟用自動更新", | ||||
| 	"Enable error reporting (requires restart)": "啟用錯誤回報(需要重新啟動)", | ||||
| 	"Enable spellchecker (requires restart)": "啟用拼字檢查(需要重新啟動)", | ||||
| 	"Factory Reset": "初始化", | ||||
| 	"File": "檔案", | ||||
| 	"Find accounts": "查詢帳號", | ||||
| 	"Find accounts by email": "用 email 查詢帳號", | ||||
| 	"Flash taskbar on new message": "有新訊息時閃爍任務欄", | ||||
| 	"Forward": "轉發", | ||||
| 	"Functionality": "功能性", | ||||
| 	"General": "通用", | ||||
| 	"Get beta updates": "取得 beta 更新", | ||||
| 	"Hard Reload": "強制重新載入", | ||||
| 	"Help": "幫助", | ||||
| 	"Help Center": "幫助中心", | ||||
| 	"History": "歷史", | ||||
| 	"History Shortcuts": "歷史快捷鍵", | ||||
| 	"Keyboard Shortcuts": "Keyboard 快捷鍵", | ||||
| 	"Log Out": "登出", | ||||
| 	"Log Out of Organization": "登出此組織", | ||||
| 	"Manual proxy configuration": "proxy 設定", | ||||
| 	"Minimize": "最小化", | ||||
| 	"Mute all sounds from Zulip": "將所有 Zulip 音效靜音", | ||||
| 	"NO": "否", | ||||
| 	"Network": "網路", | ||||
| 	"OR": "或", | ||||
| 	"Organization URL": "組織網址", | ||||
| 	"Organizations": "組織", | ||||
| 	"Paste": "貼上", | ||||
| 	"Paste and Match Style": "貼上並套用樣式", | ||||
| 	"Proxy": "Proxy", | ||||
| 	"Proxy bypass rules": "Proxy 白名單規則", | ||||
| 	"Proxy rules": "Proxy 規則", | ||||
| 	"Quit": "退出", | ||||
| 	"Quit Zulip": "退出 Zulip", | ||||
| 	"Redo": "重做", | ||||
| 	"Release Notes": "發行公告", | ||||
| 	"Reload": "重新載入", | ||||
| 	"Report an Issue": "回報問題", | ||||
| 	"Save": "儲存", | ||||
| 	"Select All": "選擇全部", | ||||
| 	"Settings": "設定", | ||||
| 	"Shortcuts": "快捷鍵", | ||||
| 	"Show App Logs": "顯示應用程式記錄", | ||||
| 	"Show app icon in system tray": "顯示應用程式圖示在系統夾", | ||||
| 	"Show app unread badge": "顯示應用程式未讀標記", | ||||
| 	"Show desktop notifications": "顯示桌面版通知", | ||||
| 	"Show downloaded files in file manager": "顯示下載檔案於檔案管理中", | ||||
| 	"Show sidebar": "顯示側邊欄", | ||||
| 	"Start app at login": "登入時開啟應用程式", | ||||
| 	"Switch to Next Organization": "切換至後一個組織", | ||||
| 	"Switch to Previous Organization": "切換至前一個組織", | ||||
| 	"These desktop app shortcuts extend the Zulip webapp's": "這些桌面版快捷鍵是從 Zulip web 版應用程式擴展而來", | ||||
| 	"This will delete all application data including all added accounts and preferences": "這樣將會刪除所有應用程式的資料,包含所有帳號跟其設定", | ||||
| 	"Tip": "提示", | ||||
| 	"Toggle DevTools for Active Tab": "切換 DevTools for Active Tab", | ||||
| 	"Toggle DevTools for Zulip App": "切換 DevTools for Zulip App", | ||||
| 	"Toggle Do Not Disturb": "切換勿擾模式", | ||||
| 	"Toggle Full Screen": "切換全螢幕", | ||||
| 	"Toggle Sidebar": "切換側邊欄", | ||||
| 	"Toggle Tray Icon": "切換夾圖示", | ||||
| 	"Tools": "工具", | ||||
| 	"Undo": "復原", | ||||
| 	"Upload": "上傳", | ||||
| 	"Use system proxy settings (requires restart)": "使用系統 proxy 設定(需要重新啟動)", | ||||
| 	"View": "檢視", | ||||
| 	"View Shortcuts": "檢視快捷鍵", | ||||
| 	"Window": "視窗", | ||||
| 	"Window Shortcuts": "視窗快捷鍵", | ||||
| 	"YES": "是", | ||||
| 	"Zoom In": "放大", | ||||
| 	"Zoom Out": "縮小", | ||||
| 	"Zulip Help": "Zulip 幫助", | ||||
| 	"keyboard shortcuts": "鍵盤快捷鍵", | ||||
| 	"script": "script", | ||||
| 	"Quit when the window is closed": "當關閉視窗時退出", | ||||
| 	"Ask where to save files before downloading": "下載前詢問檔案儲存位置", | ||||
| 	"Services": "服務", | ||||
| 	"Hide": "隱藏", | ||||
| 	"Hide Others": "隱藏其他", | ||||
| 	"Unhide": "取消隱藏", | ||||
| 	"AddServer": "新增伺服器", | ||||
| 	"App language (requires restart)": "應用程式語言(需要重新啟動)", | ||||
| 	"Factory Reset Data": "設定初始化", | ||||
| 	"Reset the application, thus deleting all the connected organizations, accounts, and certificates.": "重置應用程式,此操作將刪除:已連結的組織、帳號、跟證書", | ||||
| 	"On macOS, the OS spellchecker is used.": "在 macOS 下使用作業系統的拼字檢查", | ||||
| 	"Change the language from System Preferences → Keyboard → Text → Spelling.": "變更語言:System Preferences → Keyboard → Text → Spelling.", | ||||
| 	"Copy Link": "複製網址", | ||||
| 	"Copy Image": "複製圖", | ||||
| 	"Copy Image URL": "複製圖網址", | ||||
| 	"No Suggestion Found": "找不到建議事項", | ||||
| 	"You can select a maximum of 3 languages for spellchecking.": "您最多可以選擇 3 個語言拼字檢查", | ||||
| 	"Spellchecker Languages": "需要拼字檢查的語言", | ||||
| 	"Add to Dictionary": "新增至資料夾", | ||||
| 	"Look Up": "查詢" | ||||
| } | ||||
							
								
								
									
										
											BIN
										
									
								
								build/icon-macos.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								build/icon-macos.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 20 KiB | 
							
								
								
									
										1
									
								
								build/icon-macos.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								build/icon-macos.svg
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="-100 -100 1024 1024"><defs><linearGradient id="a" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#50adff"/><stop offset="1" stop-color="#7877fc"/></linearGradient><mask id="b"><rect x="-100" y="-100" width="1024" height="1024" fill="#fff"/><path d="M566.66 527.25c0 33.03-24.23 60.05-53.84 60.05H260.29c-29.61 0-53.84-27.02-53.84-60.05 0-20.22 9.09-38.2 22.93-49.09l134.37-120c2.5-2.14 5.74 1.31 3.94 4.19l-49.29 98.69c-1.38 2.76.41 6.16 3.25 6.16h191.18c29.61 0 53.83 27.03 53.83 60.05zm0-281.39c0 20.22-9.09 38.2-22.93 49.09l-134.37 120c-2.5 2.14-5.74-1.31-3.94-4.19l49.29-98.69c1.38-2.76-.41-6.16-3.25-6.16H260.29c-29.61 0-53.84-27.02-53.84-60.05s24.23-60.05 53.84-60.05h252.54c29.61 0 53.83 27.02 53.83 60.05z" transform="scale(1.0658112582781456)" fill="#000"/></mask><path id="c" d="M824 257c0-64 0-104-14-141A173 173 0 00708 14C671 0 631 0 567 0H257C193 0 153 0 116 14A173 173 0 0014 116C0 153 0 193 0 257V567c0 64 0 104 14 141A173 173 0 00116 810c37 14 77 14 141 14H567c64 0 104 0 141-14A173 173 0 00810 708c14-37 14-77 14-141Z"/><filter id="d"><feGaussianBlur in="SourceGraphic" stdDeviation="10"/></filter><filter id="e"><feGaussianBlur in="SourceGraphic" stdDeviation="5"/></filter></defs><use href="#c" transform="translate(0 10)" fill-opacity="0.3" filter="url(#d)"/><rect x="120" y="120" width="584" height="584" fill="#fff" /><g filter="url(#e)"><rect x="120" y="120" width="584" height="584" fill="#32497f" mask="url(#b)" transform="translate(0 5)"/></g><use href="#c" mask="url(#b)" fill="url(#a)"/></svg> | ||||
| After Width: | Height: | Size: 1.5 KiB | 
							
								
								
									
										
											BIN
										
									
								
								build/icon.icns
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								build/icon.icns
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 60 KiB | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 4.4 KiB | 
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user