Compare commits

...

109 Commits
v0.8.2 ... main

Author SHA1 Message Date
Thomas Rupprecht e2dff3f308 ci(changelog): improve changelog format 2024-03-06 22:03:49 +01:00
Thomas Rupprecht 47a54c6cbd chore(package): update `git-cliff` 2024-03-06 21:10:23 +01:00
Thomas Rupprecht 3dc39c8656 refactor(stylelint): convert `.stylelintrc.mjs` to `stylelint.config.mjs` 2024-03-05 21:55:50 +01:00
Thomas Rupprecht adde1d82fd refactor(commitlint): convert `.commitlintrc.js` to `commitlint.config.mjs` 2024-03-05 21:52:07 +01:00
Thomas Rupprecht 5afec23598 refactor(eslint): convert `eslint.config.js` to `eslint.config.mjs` 2024-03-05 21:32:54 +01:00
Thomas Rupprecht 79c06a97e2 chore(package): update dependencies
update `@commitlint/{cli,config-conventional,cz-commitlint}`, `@types/firefox-webext-browser`, `eslint{,-plugin-jsdoc}`, `husky`
2024-03-05 21:30:08 +01:00
Thomas Rupprecht 933f7a042c chore(dprint): update dprint plugins 2024-03-05 21:22:15 +01:00
Thomas Rupprecht 8023167072 refactor(polyfill): replace `webextension-polyfill` with simple `browser` fallback to `chrome` 2024-02-25 19:46:21 +01:00
Thomas Rupprecht 923a906a9e chore(package): update dependencies
update `eslint-plugin-{jsdoc,unicorn}`, `husky`, `stylelint`
2024-02-10 18:07:49 +01:00
Thomas Rupprecht ab0a42649c chore(package): update `husky` 2024-01-27 00:50:03 +01:00
Thomas Rupprecht 03d5c06b3b chore(package): update dependencies
update `@commitlint/{cli,config-conventional,cz-commitlint}`, `eslint-plugin-jsdoc`,
`stylelint{,-plugin-defensive-css}`, `web-ext`
2024-01-27 00:40:16 +01:00
Thomas Rupprecht b9219e1bad chore(package): update dependencies
update `@commitlint/{cli,config-conventional,cz-commitlint}`, `web-ext`
2024-01-09 18:25:00 +01:00
Thomas Rupprecht 37ebd89a9a chore(package): update `eslint-plugin-jsdoc` 2024-01-03 20:43:55 +01:00
Thomas Rupprecht aad04579ef chore(package): update dependencies
update: `dprint`, `eslint{,-plugin-jsdoc,-plugin-unicorn}`,
`stylelint{,-config-standard,-plugin-defensive-css,-plugin-logical-css}`
2024-01-02 12:38:30 +01:00
Thomas Rupprecht 1cb66ecca6 chore(package): update dependencies
update: `@commitlint/{cli,config-conventional,cz-commitlint}`, `@types/firefox-webext-browser`,
`dprint`, `eslint{,-plugin-jsdoc}`, `web-ext`, dprint plugins
2023-12-04 21:32:26 +01:00
Thomas Rupprecht 48657a1283 ci(package): add fmt check to `preversion` run 2023-11-08 20:41:44 +01:00
Thomas Rupprecht 1231308d8d chore(dprint): update dprint plugins 2023-11-08 20:35:12 +01:00
Thomas Rupprecht fcc6558b7f feat(popup): set `scrollbar-gutter: stable` 2023-11-08 20:05:51 +01:00
Thomas Rupprecht b631c01873 chore(package): update dependencies
update: `@commitlint/{cli,config-conventional,cz-commitlint}`, `@types/firefox-webext-browser`,
`dprint`, `eslint{,-plugin-unicorn}`, `git-cliff`, `stylelint-plugin-defensive-css`
2023-11-08 20:03:59 +01:00
Thomas Rupprecht 637a0eb63e feat(fmt): add dprint as code formatter 2023-10-23 20:41:55 +02:00
Thomas Rupprecht 3453207e7e chore(package): update dependencies
update `@commitlint/{cli,config-conventional,cz-commitlint}`, `@types/firefox-webext-browser`
`eslint`, `git-cliff`, `stylelint{,-plugin-defensive-css}`
2023-10-23 19:50:12 +02:00
Thomas Rupprecht 3dc5236380 chore(package): update `stylelint-plugin-defensive-css`, `web-ext` 2023-09-28 16:15:44 +02:00
Thomas Rupprecht 460020f6cf style: add missing semicolon, fix codestyle in `.stylelintrc.cjs` and `types.d.ts` 2023-09-28 12:34:24 +02:00
Thomas Rupprecht 2e1fde4715 chore(package): update `@types/firefox-webext-browser`, `eslint`, `eslint-plugin-jsdoc` 2023-09-25 20:20:21 +02:00
Thomas Rupprecht 52aeb58698 refactor(popup): improve init of popup script and simplify `setLinks` 2023-09-14 02:13:49 +02:00
Thomas Rupprecht fe31d9c6ec feat(editorconfig): add `.cjs` and `.mjs` to `.editorconfig` 2023-09-14 01:19:15 +02:00
Thomas Rupprecht 9921e37605 0.9.5 2023-09-13 21:51:09 +02:00
Thomas Rupprecht c6feec3a67 fix(background): fix init on addon reload 2023-09-13 21:50:31 +02:00
Thomas Rupprecht 812a1b6110 0.9.4 2023-09-13 20:37:32 +02:00
Thomas Rupprecht 8410af011b feat: update git url from `gitea.usrspace.at` to `git.usrspace.at` 2023-09-13 20:32:23 +02:00
Thomas Rupprecht ae56bdf5bc chore(package): update `eslint`, `eslint-plugin-jsdoc` 2023-09-13 20:28:18 +02:00
Thomas Rupprecht 91e6bd10b6 feat(popup): import `extension.css` as layer via css 2023-09-13 20:19:51 +02:00
Thomas Rupprecht d97dc9da87 fix(background): fix background script init 2023-09-13 20:09:46 +02:00
Thomas Rupprecht dd95d5a0ac chore(package): update `package-lock.json` 2023-09-08 01:08:58 +02:00
Thomas Rupprecht 4037ec9631 feat(linting): add `eslint` with `unicorn`, `jsdoc`, `no-unsanitized` plugins 2023-09-08 01:00:20 +02:00
Thomas Rupprecht 2c7230fdc9 refactor(popup): general code improvements by linter hints 2023-09-08 00:49:12 +02:00
Thomas Rupprecht ea43a4cd9d chore(types): make `Calendar` types readonly 2023-09-08 00:12:19 +02:00
Thomas Rupprecht e711fb11a8 fix(package): update web-ext to support newer browser APIs and remove `addon-linter` override 2023-09-07 13:12:11 +02:00
Thomas Rupprecht 3f1300543d refactor(background): inline `fetch` and use `URLSearchParams` 2023-09-06 21:30:19 +02:00
Thomas Rupprecht b0a2a4321e 0.9.3 2023-09-06 20:56:31 +02:00
Thomas Rupprecht 9d524dde4d fix(linting): add newer version of `addon-linter` via override to support newer browser APIs 2023-09-06 20:55:12 +02:00
Thomas Rupprecht a4a0db71c5 feat(linting): add `stylelint` and add check to lint script 2023-09-06 20:34:06 +02:00
Thomas Rupprecht db0faab4db refactor(storage): use `storage.session` instead of `storage.local` 2023-09-06 20:10:55 +02:00
Thomas Rupprecht 918cf7db91 chore(package): update @commitlint/{cli,config-conventional,cz-commitlint}, git-cliff 2023-09-02 00:09:42 +02:00
Thomas Rupprecht 333e0b8d80 chore(package): update @commitlint/{cli,config-conventional,cz-commitlint} 2023-07-19 21:22:46 +02:00
Thomas Rupprecht 8c2bea5fcc chore(package): update @commitlint/{cli,config-conventional} 2023-07-04 23:42:05 +02:00
Thomas Rupprecht 6c622b4ef0 feat(popup): improve colors, refactor css, support rtl lang 2023-06-07 00:10:09 +02:00
Thomas Rupprecht cd0b5805eb chore(package): update @commitlint/{cli,config-conventional} 2023-06-06 22:06:31 +02:00
Thomas Rupprecht c7607652e9 style: improve codestyle 2023-06-01 01:49:38 +02:00
Thomas Rupprecht 0fe1aaf189 docs(readme): change README title 2023-06-01 00:03:51 +02:00
Thomas Rupprecht f3d8199b97 refactor(config): move homepage url to config 2023-06-01 00:02:31 +02:00
Thomas Rupprecht 8aa6db1275 refactor(build): improve browser-polyfill inject 2023-05-25 08:07:37 +02:00
Thomas Rupprecht 0495e25b80 docs(readme): update quick-links 2023-05-25 01:05:23 +02:00
Thomas Rupprecht dea1d1a1e6 docs(readme): add logo and screenshot to readme 2023-05-25 00:19:14 +02:00
Thomas Rupprecht a4a122a898 fix: correctly update the changelog on release 2023-05-25 00:09:11 +02:00
Thomas Rupprecht 785421117f feat(changelog): update the changelog automatically on every commit 2023-05-25 00:02:55 +02:00
Thomas Rupprecht b4e88abf53 feat(commitlint): add commitlint to enforce commit message format 2023-05-24 23:29:02 +02:00
Thomas Rupprecht 2575d48e9e 0.9.2 2023-05-24 22:05:39 +02:00
Thomas Rupprecht 2e79e02805 fix(git-cliff): fix markdown escaping in changelog 2023-05-24 21:45:33 +02:00
Thomas Rupprecht df67e402a7 doc(changelog): update changelog with new version 2023-05-24 21:43:27 +02:00
Thomas Rupprecht d2d9aa70ca refactor(popup): remove "browser_style" setting and include cleaned up extension.css 2023-05-24 20:10:35 +02:00
Thomas Rupprecht 7a707c9fb0 refactor(background): remove background.html and import directly as ES module 2023-05-24 19:42:58 +02:00
Thomas Rupprecht 0d88ee76e2 TODO: improve git-cliff config 2023-05-24 19:21:49 +02:00
Thomas Rupprecht 4bb9a19f7a chore(package): update git-cliff 2023-05-15 20:59:20 +02:00
Thomas Rupprecht 8f2f8051a5 chore(package): update web-ext 2023-04-26 00:14:38 +02:00
Thomas Rupprecht 21ef55bb0e chore(package): update @types/firefox-webext-browser and web-ext 2023-04-12 20:43:08 +02:00
Thomas Rupprecht c396c74d4a chore(package): update @types/firefox-webext-browser and add web-ext to devDependencies 2023-03-20 17:00:46 +01:00
Thomas Rupprecht ca37e153e1 chore(js): add .ts files editorconfig and fix styling 2023-02-04 18:20:45 +01:00
Thomas Rupprecht a193a6923c fix(js): replace deprecated substr() with substring() and add checks for promise results 2023-02-04 18:07:52 +01:00
Thomas Rupprecht 848e1abee4 docs(js): add type definitions for Calendar and SpaceApi 2023-02-04 18:03:49 +01:00
Thomas Rupprecht 701ec4b226 chore: unify and improve codestyle 2023-02-04 17:21:18 +01:00
Thomas Rupprecht 25708ea410 chore(ci): improve CHANGELOG config 2023-02-04 03:57:09 +01:00
Thomas Rupprecht 9541d3ee4b chore(package): update husky 2023-02-04 03:29:47 +01:00
Thomas Rupprecht 4e17127714 feat(ci): add git-cliff to update the CHANGELOG.md 2023-02-04 02:50:44 +01:00
Thomas Rupprecht bae19bff3c add pre-commit hook with husky 2023-02-03 22:51:21 +01:00
Thomas Rupprecht 7d1ecd166a 0.9.1 2023-01-22 11:45:04 +01:00
Thomas Rupprecht e985995ddd add link to Pad 2023-01-22 11:38:44 +01:00
Thomas Rupprecht 5682f2322b await init 2023-01-21 03:39:41 +01:00
Thomas Rupprecht 5ea42bccb4 replace web-ext types package 2023-01-21 03:01:29 +01:00
Thomas Rupprecht 82bcdef199 don't fetch data if offline 2023-01-21 02:10:50 +01:00
Thomas Rupprecht ad9abe3c94 extract code into setBadgeStatus and createStatusChangedNotification function 2023-01-20 17:42:45 +01:00
Thomas Rupprecht b1dc1a0d21 0.9.0 2023-01-20 17:14:00 +01:00
Thomas Rupprecht 74a0d577ee make code compatible with manifest_version v3 2023-01-20 17:12:49 +01:00
Thomas Rupprecht c91e519c08 update to manifest_version v3 2023-01-20 17:12:16 +01:00
Thomas Rupprecht a3890589b3 manifest_v3 2023-01-20 16:15:10 +01:00
Thomas Rupprecht 5e0182c513 0.8.7 2023-01-20 16:08:31 +01:00
Thomas Rupprecht c216676084 open usrspace.at homepage on install 2023-01-20 16:06:17 +01:00
Thomas Rupprecht 60c367521e remove persistent flag in manifest config 2023-01-20 16:00:08 +01:00
Thomas Rupprecht 05c6cb5cfa remove unnecessary permissions 2023-01-20 15:59:56 +01:00
Thomas Rupprecht 8202083710 use globalThis instead of window to also work in service worker 2023-01-06 02:19:12 +01:00
Thomas Rupprecht f97b9a7538 improve config 2023-01-06 02:02:50 +01:00
Thomas Rupprecht 85fd3fd86a improve badges 2023-01-05 21:51:25 +01:00
Thomas Rupprecht 5dc8680a09 improve README 2023-01-05 21:44:47 +01:00
Thomas Rupprecht 7a255136d2 add badges to README 2023-01-05 21:41:49 +01:00
Thomas Rupprecht 91fb5ac155 0.8.6 2023-01-05 19:36:57 +01:00
Thomas Rupprecht f7e38cbcc5 change addon id to currently used one 2023-01-05 19:36:33 +01:00
Thomas Rupprecht 74251335e8 0.8.5 2023-01-05 19:15:09 +01:00
Thomas Rupprecht 5e4dd40d0c add addon id 2023-01-05 19:14:02 +01:00
Thomas Rupprecht ae0c2ded1b inject browser-polyfill only in chromium builds 2023-01-05 18:40:19 +01:00
Thomas Rupprecht b749f17f35 add development docs 2023-01-05 17:37:35 +01:00
Thomas Rupprecht 9740fc47a7 improve README 2023-01-05 17:14:32 +01:00
Thomas Rupprecht 86b3b7ef5e add web-ext-config.js and add watch scripts 2023-01-05 16:40:11 +01:00
Thomas Rupprecht 39b69904ac 0.8.4 2023-01-05 14:39:04 +01:00
Thomas Rupprecht c7dcd6218b add lint script 2023-01-05 14:37:59 +01:00
Thomas Rupprecht 859f9bce19 simplify updateSpaceApiJson 2023-01-05 14:29:15 +01:00
Thomas Rupprecht 6c95aa978e change strict_min_version to v79 2023-01-05 14:11:22 +01:00
Thomas Rupprecht c07f82322d use html template tag 2023-01-05 04:31:19 +01:00
Thomas Rupprecht 35d2a0fafb 0.8.3 2023-01-05 00:39:21 +01:00
Thomas Rupprecht a5c4a0cf04 update strict_min_version to 57.0 2023-01-05 00:38:30 +01:00
27 changed files with 11318 additions and 360 deletions

View File

@ -3,7 +3,7 @@
# top-most EditorConfig file
root = true
[*.{html,css,js,json,svg}]
[*.{html,css,js,cjs,mjs,json,jsonc,svg,ts,toml}]
indent_style = tab
indent_size = 2
end_of_line = lf

1
.gitignore vendored
View File

@ -1,2 +1 @@
/web-ext-artifacts
src/browser-polyfill.js

1
.husky/commit-msg Executable file
View File

@ -0,0 +1 @@
npx --no -- commitlint --edit ${1}

3
.husky/pre-commit Executable file
View File

@ -0,0 +1,3 @@
npm run lint
npm test
npm run update-changelog && git add CHANGELOG.md

322
CHANGELOG.md Normal file
View File

@ -0,0 +1,322 @@
# Changelog
All notable changes to this project will be documented in this file.
## [unreleased]
### ⛰️ Features
- *(editorconfig)* Add `.cjs` and `.mjs` to `.editorconfig` ([fe31d9c](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/fe31d9c6ecba98bea5266d9166f3fc4fce9bc2f1))
- *(fmt)* Add dprint as code formatter ([637a0eb](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/637a0eb63e83f5ca471ef5ae5587c5caa778337e))
- *(popup)* Set `scrollbar-gutter: stable` ([fcc6558](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/fcc6558b7fd1782727c525a3b090b4da825c7b34))
### 🚜 Refactor
- *(popup)* Improve init of popup script and simplify `setLinks` ([52aeb58](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/52aeb5869828e37ffdef3469ed98ae84baa1c86f))
- *(polyfill)* Replace `webextension-polyfill` with simple `browser` fallback to `chrome` ([8023167](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/8023167072199c499d61adcf5f6c245122ca7641))
- *(eslint)* Convert `eslint.config.js` to `eslint.config.mjs` ([5afec23](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/5afec2359877b44b051a7b2590202b709253882a))
- *(commitlint)* Convert `.commitlintrc.js` to `commitlint.config.mjs` ([adde1d8](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/adde1d82fdc531f17a2605423dae5e26c8c1bdfc))
- *(stylelint)* Convert `.stylelintrc.mjs` to `stylelint.config.mjs` ([3dc39c8](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/3dc39c86565b101f0621f3a18c0ee5564f4a1e9a))
### 🎨 Styling
- Add missing semicolon, fix codestyle in `.stylelintrc.cjs` and `types.d.ts` ([460020f](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/460020f6cf021cd203d7c80e4341577318a389bb))
### ⚙️ Miscellaneous Tasks
- *(package)* Update `@types/firefox-webext-browser`, `eslint`, `eslint-plugin-jsdoc` ([2e1fde4](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/2e1fde47157d48eced166d48d76ec793e048d8e5))
- *(package)* Update `stylelint-plugin-defensive-css`, `web-ext` ([3dc5236](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/3dc52363801d9c723ec3672f24acdbd2fd863ffb))
- *(package)* Update dependencies ([3453207](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/3453207e7eacf8476cb64d9ad0e5659ee65b6500))
- *(package)* Update dependencies ([b631c01](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/b631c01873b2a423138d9048f43f6def04b87f1a))
- *(dprint)* Update dprint plugins ([1231308](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/1231308d8ddb7e762e81ad61bb5fb5db7099544f))
- *(package)* Add fmt check to `preversion` run ([48657a1](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/48657a1283471f951b6e5cabd2e115918bab889f))
- *(package)* Update dependencies ([1cb66ec](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/1cb66ecca6a0274b8e5fe277504031f5dba605c4))
- *(package)* Update dependencies ([aad0457](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/aad04579ef9886e34daf4bff50b3175c48fd0d8f))
- *(package)* Update `eslint-plugin-jsdoc` ([37ebd89](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/37ebd89a9a5ed466fe9c0c5cb890a23beb3da3eb))
- *(package)* Update dependencies ([b9219e1](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/b9219e1badc367ad81b79a6545e05918f6a7932e))
- *(package)* Update dependencies ([03d5c06](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/03d5c06b3bb745f186f8fc1f04b4379b5ab186d8))
- *(package)* Update `husky` ([ab0a426](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/ab0a42649c138d9fae8bd08bf9eb6d2cc3f62516))
- *(package)* Update dependencies ([923a906](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/923a906a9ed9e6e5090730d3d2cf879ff2e425c1))
- *(dprint)* Update dprint plugins ([933f7a0](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/933f7a042c3bd787534a4129f0a2d5ae8d15bf9a))
- *(package)* Update dependencies ([79c06a9](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/79c06a97e259dc93cdcf623c4f5c90f74bd3cb1a))
- *(package)* Update `git-cliff` ([47a54c6](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/47a54c6cbd2b30de937d5a9e8e1cff53257174f1))
- *(changelog)* Improve changelog format ([4f4822a](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/4f4822a4bcab757f7acdedd2ad8f6f5781e76082))
## [0.9.5](https://git.usrspace.at/XimeX/usrspace-browser-addon/compare/v0.9.4..v0.9.5) - 2023-09-13
### 🐛 Bug Fixes
- *(background)* Fix init on addon reload ([c6feec3](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/c6feec3a679d18c4e0c37bbc92c69d2e28163d7b))
## [0.9.4](https://git.usrspace.at/XimeX/usrspace-browser-addon/compare/v0.9.3..v0.9.4) - 2023-09-13
### ⛰️ Features
- *(linting)* Add `eslint` with `unicorn`, `jsdoc`, `no-unsanitized` plugins ([4037ec9](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/4037ec96316f09ea0506dd4127876dc27aa4f537))
- *(popup)* Import `extension.css` as layer via css ([91e6bd1](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/91e6bd10b6c6b8ca1094e3e5263fecc01c20ea58))
- Update git url from `gitea.usrspace.at` to `git.usrspace.at` ([8410af0](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/8410af011b17218c76c7a1b88a5b26063b4e92be))
### 🐛 Bug Fixes
- *(package)* Update web-ext to support newer browser APIs and remove `addon-linter` override ([e711fb1](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/e711fb11a8dc20746fe397e657a394366cdcf770))
- *(background)* Fix background script init ([d97dc9d](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/d97dc9da878010d976d09f57c34072976458b2a7))
### 🚜 Refactor
- *(background)* Inline `fetch` and use `URLSearchParams` ([3f13005](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/3f1300543d95f6d31d598d1157bebf632c232318))
- *(popup)* General code improvements by linter hints ([2c7230f](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/2c7230fdc9d19e2ab045314bb741dbb531c5b84c))
### ⚙️ Miscellaneous Tasks
- *(types)* Make `Calendar` types readonly ([ea43a4c](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/ea43a4cd9d61ba820d5954a37b748f2bcdba7d3a))
- *(package)* Update `package-lock.json` ([dd95d5a](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/dd95d5a0ac710d7c5be7e3cba4b772e76429616e))
- *(package)* Update `eslint`, `eslint-plugin-jsdoc` ([ae56bdf](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/ae56bdf5bcb7ae5dc05b63bc6c47c3844321cd33))
## [0.9.3](https://git.usrspace.at/XimeX/usrspace-browser-addon/compare/v0.9.2..v0.9.3) - 2023-09-06
### ⛰️ Features
- *(commitlint)* Add commitlint to enforce commit message format ([b4e88ab](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/b4e88abf530bc2b96837b162b34950a97aa0a15a))
- *(changelog)* Update the changelog automatically on every commit ([7854211](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/785421117f498a062ee34ca2a17642628063cb37))
- *(popup)* Improve colors, refactor css, support rtl lang ([6c622b4](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/6c622b4ef0171b19c8911f9c3830b3c6e06b9748))
- *(linting)* Add `stylelint` and add check to lint script ([a4a0db7](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/a4a0db71c5e7ec86a49b19731e955d5fd662cbf5))
### 🐛 Bug Fixes
- *(linting)* Add newer version of `addon-linter` via override to support newer browser APIs ([9d524dd](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/9d524dde4d675aa3c41aa311f744fbecc563958f))
- Correctly update the changelog on release ([a4a122a](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/a4a122a8986e406c407b771769fce0579b23b5df))
### 🚜 Refactor
- *(build)* Improve browser-polyfill inject ([8aa6db1](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/8aa6db1275ee5ed83aa4656f0391205b6d08b6b4))
- *(config)* Move homepage url to config ([f3d8199](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/f3d8199b97549da696e8428659b77538ac5ea426))
- *(storage)* Use `storage.session` instead of `storage.local` ([db0faab](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/db0faab4dbb8f5816d40f154c139eaddc04d71eb))
### 📚 Documentation
- *(readme)* Add logo and screenshot to readme ([dea1d1a](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/dea1d1a1e6d045b0552c8819ea6f55c489c71a69))
- *(readme)* Update quick-links ([0495e25](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/0495e25b80c5dd2971e045b2c18c1784527b462d))
- *(readme)* Change README title ([0fe1aaf](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/0fe1aaf189bfbf6924f1ba9846347fb073d752fe))
### 🎨 Styling
- Improve codestyle ([c760765](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/c7607652e9b94d86b510c9c7c2abddf5d68132a6))
### ⚙️ Miscellaneous Tasks
- *(package)* Update @commitlint/{cli,config-conventional} ([cd0b580](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/cd0b5805eb0d8255f86d7bd78cd71f31aa3a8446))
- *(package)* Update @commitlint/{cli,config-conventional} ([8c2bea5](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/8c2bea5fcca3370ed784b2e1963902d05fde6cc7))
- *(package)* Update @commitlint/{cli,config-conventional,cz-commitlint} ([333e0b8](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/333e0b8d8062cd18e9c7b6d2a5724d01db758f12))
- *(package)* Update @commitlint/{cli,config-conventional,cz-commitlint}, git-cliff ([918cf7d](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/918cf7db9196db82b035d35ba58b3c1f3d910b90))
## [0.9.2](https://git.usrspace.at/XimeX/usrspace-browser-addon/compare/v0.9.1..v0.9.2) - 2023-05-24
### ⛰️ Features
- *(ci)* Add git-cliff to update the CHANGELOG.md ([4e17127](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/4e17127714d14aff0af1fe69f5ad7035c36895f6))
### 🐛 Bug Fixes
- *(js)* Replace deprecated substr() with substring() and add checks for promise results ([a193a69](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/a193a6923c2b37730c92d536a6d26a3c86e40425))
- *(git-cliff)* Fix markdown escaping in changelog ([2e79e02](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/2e79e02805520caec346d430dffc88884e146e03))
### 🚜 Refactor
- *(background)* Remove background.html and import directly as ES module ([7a707c9](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/7a707c9fb0a442c6f5834afcd69c866dce37495d))
- *(popup)* Remove "browser_style" setting and include cleaned up extension.css ([d2d9aa7](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/d2d9aa70caea4a77ce1f8b19858d8b98b7732a48))
### 📚 Documentation
- *(js)* Add type definitions for Calendar and SpaceApi ([848e1ab](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/848e1abee4339d5a52d3292b9a588baa9ea8e089))
- *(changelog)* Update changelog with new version ([df67e40](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/df67e402a77e97f89d796a15cf811472eace1505))
### ⚙️ Miscellaneous Tasks
- *(package)* Update husky ([9541d3e](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/9541d3ee4bd359fa5b45303e75b2075d0e8ffdc4))
- *(ci)* Improve CHANGELOG config ([25708ea](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/25708ea410080d5aeba30190f301d597e30e49c7))
- *(js)* Add .ts files editorconfig and fix styling ([ca37e15](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/ca37e153e1e3b0933c98098627795f71f5d8908e))
- *(package)* Update @types/firefox-webext-browser and add web-ext to devDependencies ([c396c74](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/c396c74d4ab2db879c2b689501f32dabf885a9a6))
- *(package)* Update @types/firefox-webext-browser and web-ext ([21ef55b](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/21ef55bb0e369ff2b6ff527fad6711698678c126))
- *(package)* Update web-ext ([8f2f805](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/8f2f8051a5ebbbb8a3796a0da811168dc9d255eb))
- *(package)* Update git-cliff ([4bb9a19](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/4bb9a19f7a71ae66b1ba9516bd460b113a1e2410))
- Unify and improve codestyle ([701ec4b](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/701ec4b226f4a8eafc4f6177f0a521ec472f1aea))
### ✳️ Other
- *(uncategorized)* Add pre-commit hook with husky ([bae19bf](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/bae19bff3c68524f64f8519bd6e60877536a755b))
- *(uncategorized)* Improve git-cliff config ([0d88ee7](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/0d88ee76e24f36deeb28e23e871f7358d800c738))
## [0.9.1](https://git.usrspace.at/XimeX/usrspace-browser-addon/compare/v0.9.0..v0.9.1) - 2023-01-22
### ✳️ Other
- *(uncategorized)* Extract code into setBadgeStatus and createStatusChangedNotification function ([ad9abe3](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/ad9abe3c946088fecea7aea5844bf7f958907271))
- *(uncategorized)* Don't fetch data if offline ([82bcdef](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/82bcdef199bd5c0ec6c2359b710c10cdc41c553b))
- *(uncategorized)* Replace web-ext types package ([5ea42bc](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/5ea42bccb4d0d17d2c7a5e03af288adf7501c0e3))
- *(uncategorized)* Await init ([5682f23](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/5682f2322be007c3b1a72c72d53311f8fd4e7423))
- *(uncategorized)* Add link to Pad ([e985995](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/e985995ddd85e904b7c984de9d13bba64ba40b03))
## [0.9.0](https://git.usrspace.at/XimeX/usrspace-browser-addon/compare/v0.8.7..v0.9.0) - 2023-01-20
### ✳️ Other
- *(uncategorized)* Manifest_v3 ([a389058](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/a3890589b3d176f663d7f3946962326abc1f9c66))
- *(uncategorized)* Update to manifest_version v3 ([c91e519](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/c91e519c0867d17c1a195b205fcb971c2c9b6b8f))
- *(uncategorized)* Make code compatible with manifest_version v3 ([74a0d57](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/74a0d577ee309145a03ada6162987fee36f3f0f6))
## [0.8.7](https://git.usrspace.at/XimeX/usrspace-browser-addon/compare/v0.8.6..v0.8.7) - 2023-01-20
### ✳️ Other
- *(uncategorized)* Add badges to README ([7a25513](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/7a255136d2ffc50d23b7dc1fe7bb63bb735099ba))
- *(uncategorized)* Improve README ([5dc8680](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/5dc8680a09fb61033de2d09cdc48d34f215572b7))
- *(uncategorized)* Improve badges ([85fd3fd](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/85fd3fd86a85e16ae1ae6a9c61b13d2fe23bbca4))
- *(uncategorized)* Improve config ([f97b9a7](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/f97b9a7538922b989f20e56c76d1105d72d9ef4d))
- *(uncategorized)* Use globalThis instead of window to also work in service worker ([8202083](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/820208371032c7e410c0f2487ad608fca74ac9aa))
- *(uncategorized)* Remove unnecessary permissions ([05c6cb5](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/05c6cb5cfa551af2a4372bc817a2b81a932fc3d0))
- *(uncategorized)* Remove persistent flag in manifest config ([60c3675](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/60c367521ea0a486f6eaecb6ba8c59cf065fb4e4))
- *(uncategorized)* Open usrspace.at homepage on install ([c216676](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/c2166760842cfb96aca4c9872a6d114c3ed98fe4))
## [0.8.6](https://git.usrspace.at/XimeX/usrspace-browser-addon/compare/v0.8.5..v0.8.6) - 2023-01-05
### ✳️ Other
- *(uncategorized)* Change addon id to currently used one ([f7e38cb](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/f7e38cbcc51d11ac96579b598dd3b7ec0e504535))
## [0.8.5](https://git.usrspace.at/XimeX/usrspace-browser-addon/compare/v0.8.4..v0.8.5) - 2023-01-05
### ✳️ Other
- *(uncategorized)* Add web-ext-config.js and add watch scripts ([86b3b7e](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/86b3b7ef5ee6863a3e976e8352e6d03f25494e6a))
- *(uncategorized)* Improve README ([9740fc4](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/9740fc47a749fc1850476085d5a885138a5ad14d))
- *(uncategorized)* Add development docs ([b749f17](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/b749f17f3581f65532b835a2995312a2bdd0d0d6))
- *(uncategorized)* Inject browser-polyfill only in chromium builds ([ae0c2de](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/ae0c2ded1b73c5dbfa2c29d011b33ad718199c9c))
- *(uncategorized)* Add addon id ([5e4dd40](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/5e4dd40d0cf26c09c9f3ffa7ad3480376240a642))
## [0.8.4](https://git.usrspace.at/XimeX/usrspace-browser-addon/compare/v0.8.3..v0.8.4) - 2023-01-05
### ✳️ Other
- *(uncategorized)* Use html template tag ([c07f823](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/c07f82322d7e89f5690b1bbda3fd298b59ed81de))
- *(uncategorized)* Change strict_min_version to v79 ([6c95aa9](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/6c95aa978e43a30f3325eac14b5af171aaba75fd))
- *(uncategorized)* Simplify updateSpaceApiJson ([859f9bc](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/859f9bce1990f101c66c6e4ab5a6041cd1bd75ca))
- *(uncategorized)* Add lint script ([c7dcd62](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/c7dcd6218b52f005965fe5417ef17c6f05033604))
## [0.8.3](https://git.usrspace.at/XimeX/usrspace-browser-addon/compare/v0.8.2..v0.8.3) - 2023-01-04
### ✳️ Other
- *(uncategorized)* Update strict_min_version to 57.0 ([a5c4a0c](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/a5c4a0cf048fbbd857ce807a2b96ec22f0a4059e))
## [0.8.2](https://git.usrspace.at/XimeX/usrspace-browser-addon/compare/v0.8.1..v0.8.2) - 2023-01-04
### ✳️ Other
- *(uncategorized)* Explicit set persistent=true and add browser_specific_settings in manifest.json ([4de8c9c](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/4de8c9c1cb71e5ed7d55616b42a79dbbb66bd29d))
- *(uncategorized)* Set html lang by browser language ([c2cc850](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/c2cc850e1f16c55d721e4e1d30cee28b656e7b16))
- *(uncategorized)* Improve popup styling ([d72359e](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/d72359e9a599fffcaa10f0bff6fc3bda41ada70e))
## [0.8.1](https://git.usrspace.at/XimeX/usrspace-browser-addon/compare/v0.8.0..v0.8.1) - 2022-12-25
### 🐛 Bug Fixes
- Fix copy-version script ([67382ea](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/67382eadc0e9a07d5f95d5d62ff2b353cfe95199))
### ✳️ Other
- *(uncategorized)* Manifest l10n ([489d675](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/489d675ba80fb87b819ee26779a728c2c1b5d7bf))
- *(uncategorized)* Faster data fetching, badge improvements ([c3cf1e9](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/c3cf1e9b9690289bf12a9fdb79ca21f563ae8867))
- *(uncategorized)* Cursor pointer on clickable elements ([b41bf2b](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/b41bf2b183da3d26eef91a7eaf5c6161539bead0))
- *(uncategorized)* Move manifest and _locales into src ([a1cf58d](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/a1cf58d8d36e7710fccea1ad35a7d3fbc4fd02f0))
- *(uncategorized)* Update package-lock ([4f717f7](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/4f717f7c8057b72e7b4f026fcba17d5277d7802e))
- *(uncategorized)* Store data in localStorage ([fc2ad7a](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/fc2ad7afad7da64a0ad3ddd81b89941ddb395f21))
- *(uncategorized)* Use storage api ([6b69d7c](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/6b69d7cd6a0d5d442ca20adedb14409ccbe71c97))
- *(uncategorized)* Use browser.alarms api ([de70d42](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/de70d42b2b38a15488d038c3a560c8f09e913b78))
- *(uncategorized)* Unfiy codestyle ([cbf21a2](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/cbf21a24ade1087cd230841c9d01fe6b814cf8df))
- *(uncategorized)* Cleanup data on startup ([45c8deb](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/45c8deb007d9b809e985b57d2942f1d1357c1405))
## [0.8.0](https://git.usrspace.at/XimeX/usrspace-browser-addon/compare/v0.7..v0.8.0) - 2022-12-24
### ✳️ Other
- *(uncategorized)* Improve code, doc, tooling ([863315d](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/863315d77c720f65cc81e7c0c8d3a40825413b1b))
- *(uncategorized)* Npm version scripts ([dc89ef4](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/dc89ef43b50762b738f6196e2456026ce0fac77d))
- *(uncategorized)* Copy browser-polyfill ([57d290c](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/57d290c744a473f7faa261aedc415d3d6a79df69))
- *(uncategorized)* Import config as module ([ea13c09](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/ea13c092896c8cf8fbe4f4154d9b148dd1c423ef))
- *(uncategorized)* Move code into src dir ([e3d6cce](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/e3d6cce769a7e456bad26ca630f6be01a329d173))
- *(uncategorized)* Add JsDoc and small code improvements ([0476519](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/0476519e996059223ff50e58e8ffeb0774e9c98f))
- *(uncategorized)* Add build script ([d898b1e](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/d898b1ea2a6efd6678b1f83b8aa00405c18c57af))
- *(uncategorized)* Improve code ([2f5e6ec](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/2f5e6ecdb1a0b515b54027937bf2b1afedf74947))
- *(uncategorized)* Remove old icons ([50d97a6](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/50d97a681e85901651006727d98bbe20b6ed1c91))
- *(uncategorized)* Add l10n ([241715e](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/241715e7accdf28472429e483592130afa523157))
- *(uncategorized)* Cleanup manifest.json ([7d36a61](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/7d36a610dc01bca0d619b39b0731c72b53cbc926))
- *(uncategorized)* Increase svg size ([e1fdc19](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/e1fdc193f5c6d90f077db90268eb109db112d7eb))
- *(uncategorized)* Set build filename ([27fe41e](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/27fe41e9b36bd687711287b2347ff29484bbb15e))
## [0.7](https://git.usrspace.at/XimeX/usrspace-browser-addon/compare/v0.4..v0.7) - 2021-11-06
### 🐛 Bug Fixes
- Fix new urls ([31e4a33](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/31e4a3375aa530ebb0179315dd7e2886bce6b401))
- Fix dates if no date is found ([c63516d](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/c63516d96291936fa8739af4a4d5fb98c76cfc69))
- Fix data, remove logging, improve code ([52e0ea1](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/52e0ea105e24bd5d5f18a2c6277bc64460eb963a))
### ✳️ Other
- *(uncategorized)* Change spaceApiUrl and nextcloud label ([562d58b](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/562d58be71f6366b000852df90cd143f7a322cab))
- *(uncategorized)* Add release info ([1b26a0e](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/1b26a0e7af4acd2b638a335ba7ae49a70936880c))
- *(uncategorized)* Add editorconfig ([a025fc9](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/a025fc9d366d7ccb905a59bfbba11907bf2f82f5))
- *(uncategorized)* Reformat code ([cfc6e98](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/cfc6e98097ab4a43acbc4d5472c9b35aca4df724))
- *(uncategorized)* Add package.json for typescript type definitions ([dcdd759](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/dcdd759e9e0517c740f39ea3c014a4ff9ba2f3e4))
- *(uncategorized)* Use template strings ([71fbce2](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/71fbce24e9b92e672aeb4e7cb10994ccfc8d3ac5))
- *(uncategorized)* Format datetime ([7aaf0d9](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/7aaf0d9840b8fcff840b6cc3d2fe4b317e3d5045))
- *(uncategorized)* Change to normal function and use async/await ([05d2d25](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/05d2d257e24fba7124680ae91216a7dc3b7207c3))
- *(uncategorized)* Use css variables and prepare for dark mode support ([50a55ff](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/50a55ff68ba5671133eda42e66093f70186f3090))
- *(uncategorized)* Add Nunito font ([c252a26](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/c252a26c18d970100f9b6f6f32f9b4be33457b7b))
- *(uncategorized)* Change icons, enable darkmode, improve styling ([1aa2ff4](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/1aa2ff4a66c0f8404526e306627e470e6114050d))
- *(uncategorized)* Update license ([d180377](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/d1803778b7fd0855b4671a1f3326d7c2b9e5cfa9))
- *(uncategorized)* Change icon ([ab49fbd](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/ab49fbda15a9b4a9ffc160122c5f5b4c82c698fb))
- *(uncategorized)* Remove old html code and load right svg ([7b95172](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/7b9517297f5761f5394cae27ef58ca264731d03d))
## [0.4](https://git.usrspace.at/XimeX/usrspace-browser-addon/compare/v0.3..v0.4) - 2019-10-04
### 🐛 Bug Fixes
- Fix wrong icon ([e50aeeb](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/e50aeeb47ecd8317925160ff055130df488fef93))
## [0.3](https://git.usrspace.at/XimeX/usrspace-browser-addon/compare/v0.2..v0.3) - 2019-10-04
### ✳️ Other
- *(uncategorized)* Improve popup content ([a195654](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/a195654b6bfcdefdcd4e046ecc1fa872e4d3a99e))
## [0.2](https://git.usrspace.at/XimeX/usrspace-browser-addon/releases/tag/v0.2) - 2019-08-28
### 🐛 Bug Fixes
- Fix icon style ([5f18a33](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/5f18a33c4c220b8e869272ae2f40761acb575ede))
- Fix compatibility with chromium based browsers ([e21dac9](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/e21dac9934c3989092077bee36d96d5aa0a02f4a))
- Fix typo ([e53b052](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/e53b0527df1d970667a5427dc612d464253d2967))
### ✳️ Other
- *(uncategorized)* Init ([956f82f](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/956f82f7443e9002081615c3068b46ac36a9c916))
- *(uncategorized)* Add first readme ([b84921f](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/b84921fd103175df1db2272d706199f2d45a6057))
- *(uncategorized)* Add LICENSE and improve README ([9381c48](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/9381c4851a45f7bb1cd696d8981ea7ec6d506bde))
- *(uncategorized)* Add icons and improve styling ([92c2e8f](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/92c2e8ffd607195b703e417abfd6b701b01d7683))
- *(uncategorized)* Improve styling ([8575efd](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/8575efd2c753d43fabc86455da618c5a9501b941))
- *(uncategorized)* Use config ([428c374](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/428c37496c7c0be23b00626562a445b9c4cb1f9c))
- *(uncategorized)* Offen/Geschlossen-Info schön im Pop-Up ([103167a](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/103167a6f1945b44782873a559157a18ed032515))
- *(uncategorized)* Add space status change notification ([213f413](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/213f4138ffbe23ec382c04c279a5f8271f0265eb))
- *(uncategorized)* Small fix ([d123a42](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/d123a42167be280fdbcfd3cf3234c53a797b9ec7))
- *(uncategorized)* Make text over icon more readable ([9b82800](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/9b828003d5684bee106beab7f9b16dfb0e437869))
- *(uncategorized)* Switch from GitLab to Gitea ([23391e0](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/23391e06ad78698c8542c6d33fb3256e0d7ebb4d))
- *(uncategorized)* Missing change from Gitlab to Gitea ([7260006](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/7260006db1fd595590055e18496c927a2e3ec789))
- *(uncategorized)* Update browser-polyfill ([a2d4832](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/a2d4832ce18c5f23f491c42b2d515eaeee0d66fd))
- *(uncategorized)* Add sections ([13219a7](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/13219a7f8e38b22ca8233a8ec13beb6e17364284))
- *(uncategorized)* Add time element for event date ([bcec944](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/bcec944781918febd7294b11a791ee7752f71d22))
- *(uncategorized)* Improve badge color ([d450b9e](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/d450b9ef228a4535c956f77abc15c334e13c47af))
- *(uncategorized)* Combine updateBadge promises ([5f3af74](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/5f3af74c078a057f9bf50d5e5d936d2dfb445f7b))
- *(uncategorized)* Check for online/offline events if fetching should be enabled ([944b99d](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/944b99d1add5800d247f0f4f1c14663e0420ea5c))
<!-- generated by git-cliff -->

View File

@ -1,34 +1,70 @@
# /usr/space Web-Ext (Firefox Add-on)
# /usr/space Web-Extension (Browser Add-on)
[![Mozilla Add-on](https://img.shields.io/amo/v/usr-space?style=for-the-badge)](https://addons.mozilla.org/de/firefox/addon/usr-space/)
[![Mozilla Add-on](https://img.shields.io/amo/dw/usr-space?style=for-the-badge)](https://addons.mozilla.org/de/firefox/addon/usr-space/)
[![Mozilla Add-on](https://img.shields.io/amo/users/usr-space?style=for-the-badge)](https://addons.mozilla.org/de/firefox/addon/usr-space/)
[![Mozilla Add-on](https://img.shields.io/amo/stars/usr-space?style=for-the-badge)](https://addons.mozilla.org/de/firefox/addon/usr-space/)
![Browser Screenshot](assets/screenshot.png)
## Features
- Show if someone is in the Space
- Looks for connected dynamic IPs (DHCP)
- Looks for connected dynamic IPs (DHCP) (provided by backend)
- Refreshes every 5min
- Show the next event
- Quick-Links (Homepage, Wiki, Gitea, Nextcloud)
- Quick-Links (Homepage, Wiki, Git, Cloud, Pad)
## Install
```ssh
$ git clone https://gitea.usrspace.at/XimeX/usrspace-browser-addon.git
$ npm install -g web-ext
$ npm install
$ git clone https://git.usrspace.at/XimeX/usrspace-browser-addon.git
# optional
$ npm i -g web-ext
$ npm i
```
- Open `about:debugging` or `about:debugging-new` in Firefox
- Click `Load Temporary Add-on...`
- Navigate to Add-on Repository
- Open `manifest.json`
- Use it
## Run / Develop / Debug
```ssh
$ npm run watch:{firefox|firefox-android|chromium}
```
If more options are needed add them after a `--`.
Some useful options:
- `--devtools`
- `--firefox-apk=...`
- `--android-device=...`
Example: `npm run watch:firefox-android -- --firefox-apk=org.mozilla.fenix --firefox-device=XXXXXXXX`
## Build
```ssh
$ npm run build
```
## Release
```ssh
$ npm version {major|minor|patch|...}
$ web-ext build
```
## Developent Docs
- [Getting started](https://extensionworkshop.com/documentation/develop/getting-started-with-web-ext/)
- [web-ext command reference](https://extensionworkshop.com/documentation/develop/web-ext-command-reference/)
- [WebExtensions MDN Docu](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions)
## Credits
Used icons from Bootstrap
https://github.com/twbs/icons/blob/main/LICENSE.md
## License
MIT
![Logo](assets/logo.png)

BIN
assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
assets/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 KiB

110
cliff.toml Normal file
View File

@ -0,0 +1,110 @@
# git-cliff ~ configuration file
# https://git-cliff.org/docs/configuration
#
# Lines starting with "#" are comments.
# Configuration options are organized into tables and keys.
# See documentation for more information on available options.
[changelog]
# changelog header
header = """
# Changelog\n
All notable changes to this project will be documented in this file.\n
"""
# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
body = """
{%- macro remote_url() -%}
https://git.usrspace.at/XimeX/usrspace-browser-addon
{%- endmacro -%}
{% macro print_commit(commit) -%}
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
{% if commit.breaking %}[**breaking**] {% endif %}\
{{ commit.message | trim | upper_first }} \
([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\
{% endmacro -%}
{% if version %}\
{% if previous.version %}\
## [{{ version | trim_start_matches(pat="v") }}]\
({{ self::remote_url() }}/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [{{ version | trim_start_matches(pat="v") }}]\
({{ self::remote_url() }}/releases/tag/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
{% endif %}\
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{% for commit in commits
| filter(attribute="scope") %}
{{ self::print_commit(commit=commit) }}
{%- endfor -%}
{% raw %}\n{% endraw %}\
{%- for commit in commits %}
{%- if not commit.scope -%}
{{ self::print_commit(commit=commit) }}
{% endif -%}
{% endfor -%}
{% endfor %}\n
"""
# template for the changelog footer
footer = """
<!-- generated by git-cliff -->
"""
# remove the leading and trailing whitespace from the templates
trim = true
# postprocessors
# postprocessors = [
# { pattern = '<REPO>', replace = "https://git.usrspace.at/XimeX/usrspace-browser-addon" }, # replace repository URL
# ]
[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = false
# process each line of a commit as an individual commit
split_commits = false
# regex for preprocessing the commit messages
# commit_preprocessors = [
# { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" },
# ]
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^feat", group = "<!-- 0 -->⛰️ Features" },
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
{ message = "^[0-9]+.[0-9]+.[0-9]+", skip = true },
{ message = "^release v0.[0-9]", skip = true },
{ message = "^Merge branch ", skip = true },
{ message = "^chore\\(deps.*\\)", skip = true },
{ message = "^chore\\(pr\\)", skip = true },
{ message = "^chore\\(pull\\)", skip = true },
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
{ message = ".*", group = "<!-- 9 -->✳️ Other", default_scope = "uncategorized" },
]
# protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# regex for matching git tags
tag_pattern = "v[0-9].*"
# regex for skipping tags
skip_tags = ""
# regex for ignoring tags
ignore_tags = ""
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"

3
commitlint.config.mjs Normal file
View File

@ -0,0 +1,3 @@
export default {
extends: ['@commitlint/config-conventional'],
};

31
dprint.jsonc Normal file
View File

@ -0,0 +1,31 @@
{
"typescript": {
"lineWidth": 128,
"quoteProps": "consistent",
"quoteStyle": "alwaysSingle",
"semiColons": "always",
"singleBodyPosition": "nextLine",
"useBraces": "always",
"useTabs": true,
"arrowFunction.useParentheses": "force",
"importDeclaration.sortNamedImports": "maintain"
},
"json": {
"trailingCommas": "maintain",
"useTabs": true
},
"markdown": {},
"toml": {
"useTabs": true
},
"excludes": [
"**/node_modules",
"**/*-lock.json"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.89.3.wasm",
"https://plugins.dprint.dev/json-0.19.2.wasm",
"https://plugins.dprint.dev/markdown-0.16.4.wasm",
"https://plugins.dprint.dev/toml-0.6.1.wasm"
]
}

45
eslint.config.mjs Normal file
View File

@ -0,0 +1,45 @@
import globals from 'globals';
import js from '@eslint/js';
import unicorn from 'eslint-plugin-unicorn';
import jsdoc from 'eslint-plugin-jsdoc';
import noUnsanitized from 'eslint-plugin-no-unsanitized';
export default [
{
files: ['**/*.js'],
languageOptions: {
globals: {
...globals.browser,
...globals.commonjs,
...globals.webextensions,
},
},
plugins: {
unicorn,
jsdoc,
'no-unsanitized': noUnsanitized,
},
rules: {
// ### ESLint (https://eslint.org/docs/latest/rules/)
...js.configs.recommended.rules,
// ### Unicorn (https://github.com/sindresorhus/eslint-plugin-unicorn#rules)
...unicorn.configs.recommended.rules,
'unicorn/no-nested-ternary': 'off',
'unicorn/no-null': 'off',
'unicorn/prefer-module': 'off',
'unicorn/prevent-abbreviations': 'off',
// ### JSDoc (https://github.com/gajus/eslint-plugin-jsdoc/tree/main#user-content-eslint-plugin-jsdoc-rules)
...jsdoc.configs['flat/recommended-error'].rules,
'jsdoc/check-indentation': 'error',
'jsdoc/require-asterisk-prefix': 'error',
'jsdoc/require-jsdoc': ['error', { exemptEmptyFunctions: true }],
'jsdoc/require-param-description': 'off',
'jsdoc/require-returns-description': 'off',
// ### no-unsanitized (https://github.com/mozilla/eslint-plugin-no-unsanitized#rule-details)
...noUnsanitized.configs.DOM.rules,
},
},
];

9271
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,28 +1,57 @@
{
"name": "usrspace-browser-addon",
"description": "WebExtension for the Hacker-/Maker-Space /usr/space",
"version": "0.8.2",
"dependencies": {
"webextension-polyfill": "^0.10.0"
},
"version": "0.9.5",
"devDependencies": {
"web-ext-types": "^3.2.1"
"@commitlint/cli": "^18.6.1",
"@commitlint/config-conventional": "^18.6.2",
"@commitlint/cz-commitlint": "^18.6.1",
"@types/firefox-webext-browser": "^120.0.2",
"commitizen": "^4.3.0",
"dprint": "^0.45.0",
"eslint": "^8.57.0",
"eslint-plugin-jsdoc": "^48.2.0",
"eslint-plugin-no-unsanitized": "^4.0.2",
"eslint-plugin-unicorn": "^51.0.1",
"git-cliff": "^2.1.2",
"husky": "^9.0.11",
"stylelint": "^16.2.1",
"stylelint-config-standard": "^36.0.0",
"stylelint-plugin-defensive-css": "^1.0.2",
"stylelint-plugin-logical-css": "^1.0.0",
"web-ext": "^7.11.0"
},
"scripts": {
"copy-browser-polyfill": "cp node_modules/webextension-polyfill/dist/browser-polyfill.js src/browser-polyfill.js",
"copy-version": "sed -i 's/^\t\"version\": \".*\",$/\t\"version\": \"'$(rg '^\t\"version\": \"(.+)\",$' -r '$1' < package.json)'\",/' src/manifest.json",
"prebuild": "cp LICENSE.txt src/",
"build": "web-ext build -o -s src/ -n \"_usr_space-{version}.zip\"",
"postbuild": "rm src/LICENSE.txt",
"update-changelog": "npm exec git-cliff > CHANGELOG.md",
"lint": "npm run lint:web-ext && npm run lint:js && npm run lint:css",
"lint:web-ext": "web-ext lint -w",
"lint:js": "eslint .",
"lint:css": "stylelint \"src/*.css\"",
"fmt": "dprint fmt",
"fmt:check": "dprint check",
"fmt:update": "dprint config update",
"test": "echo \"Error: no test specified\" && exit 0",
"postinstall": "npm run copy-browser-polyfill",
"preversion": "npm test",
"version": "npm run copy-version && git add -u",
"postversion": "npm run build"
"watch:firefox": "web-ext run -t firefox-desktop",
"watch:firefox-android": "web-ext run -t firefox-android",
"watch:chromium": "web-ext run -t chromium",
"prebuild": "cp LICENSE.txt src/",
"build": "web-ext build",
"postbuild": "rm src/LICENSE.txt",
"preversion": "npm run fmt:check && npm run lint && npm test",
"version": "npm run copy-version && npm run update-changelog && git add CHANGELOG.md src/manifest.json",
"postversion": "npm run build",
"prepare": "husky",
"commit": "git-cz"
},
"config": {
"commitizen": {
"path": "@commitlint/cz-commitlint"
}
},
"repository": {
"type": "git",
"url": "https://gitea.usrspace.at/XimeX/usrspace-browser-addon"
"url": "https://git.usrspace.at/XimeX/usrspace-browser-addon"
},
"keywords": [
"/usr/space"

View File

@ -20,6 +20,9 @@
"nextEvent": {
"message": "Nächstes Event"
},
"event": {
"message": "Event"
},
"spaceApiJson": {
"message": "Space-API JSON"
},
@ -38,8 +41,8 @@
"stateNotificationMessage": {
"message": "Space ist jetzt $STATE$.",
"placeholders": {
"STATE" : {
"content" : "$1"
"STATE": {
"content": "$1"
}
}
},

View File

@ -20,6 +20,9 @@
"nextEvent": {
"message": "Next Event"
},
"event": {
"message": "Event"
},
"spaceApiJson": {
"message": "Space-API JSON"
},
@ -38,8 +41,8 @@
"stateNotificationMessage": {
"message": "Space is now $STATE$.",
"placeholders": {
"STATE" : {
"content" : "$1"
"STATE": {
"content": "$1"
}
}
},

View File

@ -1,9 +0,0 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<title>/usr/space</title>
<script type="module" src="browser-polyfill.js"></script>
<script type="module" src="background.js"></script>
</head>
</html>

View File

@ -1,40 +1,58 @@
import Config from './config.js';
import { REFRESH_TIMEOUT, HOMEPAGE, API_URLS, BADGE_COLORS } from './config.js';
document.querySelector('html').setAttribute('lang', browser.i18n.getUILanguage());
globalThis.browser ??= chrome;
browser.runtime.onInstalled.addListener(async (details) => {
init();
if (details.reason === 'install') {
await browser.tabs.create({
url: HOMEPAGE,
});
}
});
browser.runtime.onStartup.addListener(() => {
init();
});
browser.alarms.onAlarm.addListener((alarm) => {
if (alarm.name === 'fetchData') {
fetchNewData();
}
});
/**
* @param {string} url
* @returns {Promise<any>}
* @param {number} days
* @returns {Promise<import("../types").Calendar>}
*/
async function fetchJson(url) {
const response = await fetch(url);
async function fetchCalendar(days = 28) {
const params = new URLSearchParams();
params.set('o', 'json');
if (days) {
params.set('r', `${days}`);
}
const response = await fetch(`${API_URLS.calender}?${params.toString()}`);
return response.json();
}
/**
* @param {number} days
* @returns {Promise<Array<object>>}
* @returns {Promise<import("../types").SpaceApi>}
*/
function fetchCalendar(days = 28) {
let url = `${Config.calenderUrl}?o=json`;
if (days) {
url += `&r=${days}`;
}
return fetchJson(url);
}
/**
* @returns {Promise<object>}
*/
function fetchSpaceApi() {
return fetchJson(Config.spaceApiUrl);
async function fetchSpaceApi() {
const response = await fetch(API_URLS.spaceApi);
return response.json();
}
async function fetchNewData() {
if (!globalThis.navigator.onLine) {
return;
}
try {
const result = await Promise.allSettled([fetchCalendar(), fetchSpaceApi()]);
const calendarJson = result[0].value;
const spaceApiJson = result[1].value;
const [resultCalendar, resultSpaceApi] = await Promise.allSettled([fetchCalendar(), fetchSpaceApi()]);
const calendarJson = (resultCalendar.status === 'fulfilled') ? resultCalendar.value : undefined;
const spaceApiJson = (resultSpaceApi.status === 'fulfilled') ? resultSpaceApi.value : undefined;
if (spaceApiJson) {
const now = new Date();
@ -42,24 +60,18 @@ async function fetchNewData() {
new Date(event.begin) <= now && now <= new Date(event.end)
)) ?? false;
const badgeText = browser.i18n.getMessage(spaceApiJson.state.open ? 'badgeOpen' : eventActive ? 'badgeEvent' : 'badgeClosed');
const badgeBgColor = spaceApiJson.state.open ? Config.openColor : eventActive ? Config.eventColor : Config.closedColor;
await browser.browserAction.setBadgeText({text: badgeText});
await browser.browserAction.setBadgeBackgroundColor({color: badgeBgColor});
await setBadgeStatus(spaceApiJson.state.open, eventActive);
const {spaceApi} = await browser.storage.local.get('spaceApi');
/**
* @type {import("../types").Storage}
*/
const { spaceApi } = await browser.storage.session.get('spaceApi');
if (spaceApi && spaceApi.state.open !== spaceApiJson.state.open) {
const state = browser.i18n.getMessage(spaceApiJson.state.open ? 'open' : 'closed');
await browser.notifications.create('status-change', {
type: 'basic',
title: browser.i18n.getMessage('stateNotificationTitle'),
message: browser.i18n.getMessage('stateNotificationMessage', state),
iconUrl: browser.runtime.getURL('icons/favicon.svg'),
});
await createStatusChangedNotification(spaceApiJson.state.open);
}
}
await browser.storage.local.set({
await browser.storage.session.set({
calendar: calendarJson,
spaceApi: spaceApiJson,
});
@ -68,39 +80,39 @@ async function fetchNewData() {
}
}
browser.runtime.onStartup.addListener(async () => {
await browser.storage.local.remove(['calendar', 'spaceApi']);
});
/**
* @param {Alarm} alarm
* @param {boolean} open
* @param {boolean} eventActive
*/
function handleAlarm(alarm) {
if (alarm.name === 'fetchData') {
fetchNewData();
}
async function setBadgeStatus(open, eventActive) {
const badgeText = browser.i18n.getMessage(open ? 'badgeOpen' : eventActive ? 'badgeEvent' : 'badgeClosed');
const badgeBgColor = open ? BADGE_COLORS.open : eventActive ? BADGE_COLORS.event : BADGE_COLORS.closed;
await browser.action.setBadgeText({ text: badgeText });
await browser.action.setBadgeBackgroundColor({ color: badgeBgColor });
}
function startFetching() {
fetchNewData();
browser.alarms.onAlarm.addListener(handleAlarm);
const now = new Date();
now.setMinutes(Math.ceil((now.getMinutes() + 1) / Config.refreshTimeout) * Config.refreshTimeout, 0, 0);
browser.alarms.create('fetchData', {
when: now.getTime(),
periodInMinutes: Config.refreshTimeout,
/**
* @param {boolean} open
*/
async function createStatusChangedNotification(open) {
const stateL10n = browser.i18n.getMessage(open ? 'open' : 'closed');
await browser.notifications.create('status-changed', {
type: 'basic',
title: browser.i18n.getMessage('stateNotificationTitle'),
message: browser.i18n.getMessage('stateNotificationMessage', stateL10n),
iconUrl: browser.runtime.getURL('icons/favicon.svg'),
});
}
window.addEventListener('offline', async () => {
browser.alarms.onAlarm.removeListener(handleAlarm);
await browser.alarms.clear('fetchData');
});
window.addEventListener('online', () => {
startFetching();
});
if (window.navigator.onLine) {
startFetching();
function init() {
fetchNewData();
const now = new Date();
now.setMinutes(Math.ceil((now.getMinutes() + 1) / REFRESH_TIMEOUT) * REFRESH_TIMEOUT, 0, 0);
browser.alarms.create('fetchData', {
when: now.getTime(),
periodInMinutes: REFRESH_TIMEOUT,
});
}
init();

View File

@ -1,26 +1,42 @@
export default {
refreshTimeout: 5,
spaceApiUrl: 'https://www.usrspace.at/spaceapi.json',
calenderUrl: 'https://www.usrspace.at/calendar.php',
openColor: '#33cc33',
closedColor: '#cc3333',
eventColor: '#9933cc',
quickLinks: [
{
url: 'https://www.usrspace.at/',
text: 'Homepage',
},
{
url: 'https://wiki.usrspace.at/',
text: 'Wiki',
},
{
url: 'https://gitea.usrspace.at/',
text: 'Gitea',
},
{
url: 'https://cloud.usrspace.at/',
text: 'Nextcloud',
},
],
export const REFRESH_TIMEOUT = 5;
export const HOMEPAGE = 'https://www.usrspace.at/';
export const API_URLS = {
spaceApi: 'https://www.usrspace.at/spaceapi.json',
calender: 'https://www.usrspace.at/calendar.php',
};
export const BADGE_COLORS = {
open: '#33cc33',
closed: '#cc3333',
event: '#9933cc',
};
export const QUICK_LINKS = [
{
iconTemplateId: 'template-icon-homepage',
url: 'https://www.usrspace.at/',
text: 'Homepage',
},
{
iconTemplateId: 'template-icon-wiki',
url: 'https://wiki.usrspace.at/',
text: 'Wiki',
},
{
iconTemplateId: 'template-icon-git',
url: 'https://git.usrspace.at/',
text: 'Git',
},
{
iconTemplateId: 'template-icon-cloud',
url: 'https://cloud.usrspace.at/',
text: 'Cloud',
},
{
iconTemplateId: 'template-icon-pad',
url: 'https://pads.usrspace.at/',
text: 'Pad',
},
];

65
src/extension.css Normal file
View File

@ -0,0 +1,65 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* stylelint-disable */
/* Global */
html,
body {
background: transparent;
box-sizing: border-box;
color: #222426;
cursor: default;
display: flex;
flex-direction: column;
font: caption;
margin: 0;
padding: 0;
user-select: none;
}
body * {
box-sizing: border-box;
text-align: start;
}
/* Panel Section - List */
.panel-section-list {
display: flex;
flex-direction: column;
padding: 4px 0;
}
.panel-list-item {
align-items: center;
display: flex;
flex-direction: row;
height: 24px;
padding: 0 16px;
}
.panel-list-item:hover {
background-color: rgba(0, 0, 0, 0.06);
border-block: 1px solid rgba(0, 0, 0, 0.1);
}
.panel-list-item:hover:active {
background-color: rgba(0, 0, 0, 0.1);
}
.panel-list-item > .icon {
flex-grow: 0;
flex-shrink: 0;
}
.panel-list-item > .text {
flex-grow: 10;
}
.panel-list-item > .text-shortcut {
color: #808080;
font-family: "Lucida Grande", caption;
font-size: .847em;
justify-content: flex-end;
}

View File

@ -1,40 +1,34 @@
{
"manifest_version": 2,
"manifest_version": 3,
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "0.8.2",
"version": "0.9.5",
"icons": {
"48": "icons/favicon.svg",
"96": "icons/favicon.svg"
},
"background": {
"page": "background.html",
"persistent": true
"type": "module",
"scripts": ["background.js"]
},
"browser_action": {
"browser_style": true,
"action": {
"default_title": "__MSG_buttonTitle__",
"default_icon": "icons/favicon.svg",
"default_area": "navbar",
"default_popup": "popup.html"
},
"default_locale": "de",
"permissions": [
"https://www.usrspace.at/*",
"alarms",
"notifications",
"storage",
"webRequest"
],
"permissions": ["alarms", "notifications", "storage"],
"author": "Thomas Rupprecht",
"homepage_url": "https://gitea.usrspace.at/XimeX/usrspace-browser-addon",
"homepage_url": "https://git.usrspace.at/XimeX/usrspace-browser-addon",
"developer": {
"name": "Thomas Rupprecht",
"url": "https://blog.ximex.at/"
},
"browser_specific_settings": {
"gecko": {
"strict_min_version": "48.0"
"id": "{c9a907ad-a047-4cf6-8b5d-95097d31aa5b}",
"strict_min_version": "115.0"
}
}
}

View File

@ -1,15 +1,19 @@
@import url('extension.css') layer(extension);
@font-face {
font-family: 'Nunito Sans';
font-style: normal;
font-weight: normal;
src: url('font/Nunito-Regular.ttf') format('truetype');
}
@font-face {
font-family: 'Nunito Sans';
font-style: normal;
font-weight: bold;
src: url('font/Nunito-Bold.ttf') format('truetype');
}
@font-face {
font-family: 'Nunito Sans';
font-style: italic;
@ -18,47 +22,59 @@
}
:root {
--light-blue: #2AA1BF;
--dark-blue: #095C81;
--light-color: #0C0C0C;
--dark-color: #FFFFFF;
--light-background: #F9F9F9;
--dark-background: #4A4A4A;
--light-code-background: #EBEBEB;
--dark-code-background: #383838;
--light-blue: #2aa1bf;
--dark-blue: #095c81;
--light-color: #15141a;
--dark-color: #fbfbfe;
--light-background: #ffffff;
--dark-background: #42414d;
--light-code-background: #f0f0f4;
--dark-code-background: #2b2a33;
--color: var(--light-color);
--background: var(--light-background);
--code-background: var(--light-code-background);
}
@media (prefers-color-scheme: dark) {
:root {
--color: var(--dark-color);
--background: var(--dark-background);
--code-background: var(--dark-code-background);
}
}
body {
width: 360px;
inline-size: 360px;
padding: 6px 12px;
color: var(--light-color);
background-color: var(--light-background);
font-family: 'Nunito Sans';
}
@media (prefers-color-scheme: dark) {
body {
color: var(--dark-color);
background-color: var(--dark-background);
}
color: var(--color);
background-color: var(--background);
font-family: 'Nunito Sans', sans-serif;
}
section.no-padding {
margin: 0 -12px -6px;
}
h2 {
margin: 6px 0 4px;
}
summary {
margin: 6px 12px 6px;
margin: 6px 12px;
cursor: pointer;
}
summary > h2 {
margin: 0;
display: inline-block;
}
time {
font-style: italic;
}
svg {
vertical-align: text-bottom;
}
@ -66,39 +82,43 @@ svg {
.panel-section-list {
margin: 0 -12px;
}
.panel-list-item > .icon {
text-align: center;
width: 23px;
margin-right: 4px;
inline-size: 23px;
margin-inline-end: 4px;
}
.link {
cursor: pointer;
}
#state > svg, #calendar > .calendar-entry > svg, #calendar > .calendar-entry strong {
margin-right: 8px;
#state > svg,
#calendar > .calendar-entry > svg,
#calendar > .calendar-entry strong {
margin-inline-end: 8px;
}
#calendar > .calendar-entry {
#calendar > .calendar-entry,
#calendar > .calendar-entry > div > div {
display: flex;
}
#calendar address {
display: inline;
}
#space-api {
margin: 0;
padding: 0 8px;
height: 122px;
overflow-x: hidden;
overflow-y: scroll;
background-color: var(--light-code-background);
}
@media (prefers-color-scheme: dark) {
#space-api {
background-color: var(--dark-code-background);
}
padding: 4px 8px 8px;
block-size: 159px;
overflow-block: scroll;
scrollbar-gutter: stable;
background-color: var(--code-background);
}
#space-api code {
font-family: monospace;
font-size: 10px;
white-space: break-spaces;
}

View File

@ -1,69 +1,102 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<title>/usr/space</title>
<link rel="stylesheet" href="popup.css" />
</head>
<body>
<section>
<h2 id="currentState"></h2>
<div id="state"></div>
</section>
<section>
<h2 id="links"></h2>
<ul class="panel-section panel-section-list">
<li class="panel-list-item link" data-url="https://www.usrspace.at/">
<div class="icon">
<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" fill="currentColor" viewBox="0 0 16 16" role="img" aria-label="Homepage">
<path fill-rule="evenodd" d="m8 3.293 6 6V13.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 13.5V9.293l6-6zm5-.793V6l-2-2V2.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5z"/>
<path fill-rule="evenodd" d="M7.293 1.5a1 1 0 0 1 1.414 0l6.647 6.646a.5.5 0 0 1-.708.708L8 2.207 1.354 8.854a.5.5 0 1 1-.708-.708L7.293 1.5z"/>
</svg>
</div>
<div class="text">Homepage</div>
<div class="text-shortcut"></div>
</li>
<li class="panel-list-item link" data-url="https://wiki.usrspace.at/">
<div class="icon">
<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" viewBox="0 0 640 512" fill="currentColor" role="img" aria-level="Wiki">
<path d="M640 51.2l-.3 12.2c-28.1.8-45 15.8-55.8 40.3-25 57.8-103.3 240-155.3 358.6H415l-81.9-193.1c-32.5 63.6-68.3 130-99.2 193.1-.3.3-15 0-15-.3C172 352.3 122.8 243.4 75.8 133.4 64.4 106.7 26.4 63.4.2 63.7c0-3.1-.3-10-.3-14.2h161.9v13.9c-19.2 1.1-52.8 13.3-43.3 34.2 21.9 49.7 103.6 240.3 125.6 288.6 15-29.7 57.8-109.2 75.3-142.8-13.9-28.3-58.6-133.9-72.8-160-9.7-17.8-36.1-19.4-55.8-19.7V49.8l142.5.3v13.1c-19.4.6-38.1 7.8-29.4 26.1 18.9 40 30.6 68.1 48.1 104.7 5.6-10.8 34.7-69.4 48.1-100.8 8.9-20.6-3.9-28.6-38.6-29.4.3-3.6 0-10.3.3-13.6 44.4-.3 111.1-.3 123.1-.6v13.6c-22.5.8-45.8 12.8-58.1 31.7l-59.2 122.8c6.4 16.1 63.3 142.8 69.2 156.7L559.2 91.8c-8.6-23.1-36.4-28.1-47.2-28.3V49.6l127.8 1.1.2.5z"/>
</svg>
</div>
<div class="text">Wiki</div>
<div class="text-shortcut"></div>
</li>
<li class="panel-list-item link" data-url="https://gitea.usrspace.at/">
<div class="icon">
<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" fill="currentColor" viewBox="0 0 16 16" role="img" aria-label="Gitea">
<path d="M15.698 7.287 8.712.302a1.03 1.03 0 0 0-1.457 0l-1.45 1.45 1.84 1.84a1.223 1.223 0 0 1 1.55 1.56l1.773 1.774a1.224 1.224 0 0 1 1.267 2.025 1.226 1.226 0 0 1-2.002-1.334L8.58 5.963v4.353a1.226 1.226 0 1 1-1.008-.036V5.887a1.226 1.226 0 0 1-.666-1.608L5.093 2.465l-4.79 4.79a1.03 1.03 0 0 0 0 1.457l6.986 6.986a1.03 1.03 0 0 0 1.457 0l6.953-6.953a1.031 1.031 0 0 0 0-1.457"/>
</svg>
</div>
<div class="text">Gitea</div>
<div class="text-shortcut"></div>
</li>
<li class="panel-list-item link" data-url="https://cloud.usrspace.at/">
<div class="icon">
<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" fill="currentColor" viewBox="0 0 16 16" role="img" aria-label="Nextcloud">
<path d="M4.406 3.342A5.53 5.53 0 0 1 8 2c2.69 0 4.923 2 5.166 4.579C14.758 6.804 16 8.137 16 9.773 16 11.569 14.502 13 12.687 13H3.781C1.708 13 0 11.366 0 9.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383z"/>
</svg>
</div>
<div class="text">Nextcloud</div>
<div class="text-shortcut"></div>
</li>
</ul>
</section>
<section>
<h2 id="nextEvent"></h2>
<div id="calendar"></div>
</section>
<section class="no-padding">
<details>
<summary><h2 id="spaceApiJson"></h2></summary>
<pre id="space-api"><code></code></pre>
</details>
</section>
<head>
<meta charset="utf-8" />
<title>/usr/space</title>
<link rel="stylesheet" href="popup.css" />
<script type="module" src="browser-polyfill.js"></script>
<script type="module" src="popup.js"></script>
</body>
<template id="template-icon-closed">
<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" fill="currentColor" viewBox="0 0 16 16" role="img" aria-label="">
<path d="M3 2a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v13h1.5a.5.5 0 0 1 0 1h-13a.5.5 0 0 1 0-1H3V2zm1 13h8V2H4v13z" />
<path d="M9 9a1 1 0 1 0 2 0 1 1 0 0 0-2 0z" />
</svg>
</template>
<template id="template-icon-open">
<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" fill="currentColor" viewBox="0 0 16 16" role="img" aria-label="">
<path d="M8.5 10c-.276 0-.5-.448-.5-1s.224-1 .5-1 .5.448.5 1-.224 1-.5 1z" />
<path d="M10.828.122A.5.5 0 0 1 11 .5V1h.5A1.5 1.5 0 0 1 13 2.5V15h1.5a.5.5 0 0 1 0 1h-13a.5.5 0 0 1 0-1H3V1.5a.5.5 0 0 1 .43-.495l7-1a.5.5 0 0 1 .398.117zM11.5 2H11v13h1V2.5a.5.5 0 0 0-.5-.5zM4 1.934V15h6V1.077l-6 .857z" />
</svg>
</template>
<template id="template-state">
<svg></svg>
<span></span>
<time datetime=""></time>
</template>
<template id="template-icon-homepage">
<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" fill="currentColor" viewBox="0 0 16 16" role="img" aria-label="">
<path fill-rule="evenodd" d="m8 3.293 6 6V13.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 13.5V9.293l6-6zm5-.793V6l-2-2V2.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5z" />
<path fill-rule="evenodd" d="M7.293 1.5a1 1 0 0 1 1.414 0l6.647 6.646a.5.5 0 0 1-.708.708L8 2.207 1.354 8.854a.5.5 0 1 1-.708-.708L7.293 1.5z" />
</svg>
</template>
<template id="template-icon-wiki">
<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" viewBox="0 0 640 512" fill="currentColor" role="img" aria-level="">
<path d="M640 51.2l-.3 12.2c-28.1.8-45 15.8-55.8 40.3-25 57.8-103.3 240-155.3 358.6H415l-81.9-193.1c-32.5 63.6-68.3 130-99.2 193.1-.3.3-15 0-15-.3C172 352.3 122.8 243.4 75.8 133.4 64.4 106.7 26.4 63.4.2 63.7c0-3.1-.3-10-.3-14.2h161.9v13.9c-19.2 1.1-52.8 13.3-43.3 34.2 21.9 49.7 103.6 240.3 125.6 288.6 15-29.7 57.8-109.2 75.3-142.8-13.9-28.3-58.6-133.9-72.8-160-9.7-17.8-36.1-19.4-55.8-19.7V49.8l142.5.3v13.1c-19.4.6-38.1 7.8-29.4 26.1 18.9 40 30.6 68.1 48.1 104.7 5.6-10.8 34.7-69.4 48.1-100.8 8.9-20.6-3.9-28.6-38.6-29.4.3-3.6 0-10.3.3-13.6 44.4-.3 111.1-.3 123.1-.6v13.6c-22.5.8-45.8 12.8-58.1 31.7l-59.2 122.8c6.4 16.1 63.3 142.8 69.2 156.7L559.2 91.8c-8.6-23.1-36.4-28.1-47.2-28.3V49.6l127.8 1.1.2.5z" />
</svg>
</template>
<template id="template-icon-git">
<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" fill="currentColor" viewBox="0 0 16 16" role="img" aria-label="">
<path d="M15.698 7.287 8.712.302a1.03 1.03 0 0 0-1.457 0l-1.45 1.45 1.84 1.84a1.223 1.223 0 0 1 1.55 1.56l1.773 1.774a1.224 1.224 0 0 1 1.267 2.025 1.226 1.226 0 0 1-2.002-1.334L8.58 5.963v4.353a1.226 1.226 0 1 1-1.008-.036V5.887a1.226 1.226 0 0 1-.666-1.608L5.093 2.465l-4.79 4.79a1.03 1.03 0 0 0 0 1.457l6.986 6.986a1.03 1.03 0 0 0 1.457 0l6.953-6.953a1.031 1.031 0 0 0 0-1.457" />
</svg>
</template>
<template id="template-icon-cloud">
<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" fill="currentColor" viewBox="0 0 16 16" role="img" aria-label="">
<path d="M4.406 3.342A5.53 5.53 0 0 1 8 2c2.69 0 4.923 2 5.166 4.579C14.758 6.804 16 8.137 16 9.773 16 11.569 14.502 13 12.687 13H3.781C1.708 13 0 11.366 0 9.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383z" />
</svg>
</template>
<template id="template-icon-pad">
<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" fill="currentColor" viewBox="0 0 16 16" role="img" aria-label="">
<path fill-rule="evenodd" d="M8 0c-.69 0-1.843.265-2.928.56-1.11.3-2.229.655-2.887.87a1.54 1.54 0 0 0-1.044 1.262c-.596 4.477.787 7.795 2.465 9.99a11.777 11.777 0 0 0 2.517 2.453c.386.273.744.482 1.048.625.28.132.581.24.829.24s.548-.108.829-.24a7.159 7.159 0 0 0 1.048-.625 11.775 11.775 0 0 0 2.517-2.453c1.678-2.195 3.061-5.513 2.465-9.99a1.541 1.541 0 0 0-1.044-1.263 62.467 62.467 0 0 0-2.887-.87C9.843.266 8.69 0 8 0zm0 5a1.5 1.5 0 0 1 .5 2.915l.385 1.99a.5.5 0 0 1-.491.595h-.788a.5.5 0 0 1-.49-.595l.384-1.99A1.5 1.5 0 0 1 8 5z" />
</svg>
</template>
<template id="template-link-item">
<li class="panel-list-item link" data-url="">
<div class="icon"></div>
<div class="text"></div>
<div class="text-shortcut"></div>
</li>
</template>
<template id="template-calendar-entry">
<div class="calendar-entry">
<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" fill="currentColor" viewBox="0 0 16 16" role="img" aria-label="">
<path d="M11 6.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1z" />
<path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z" />
</svg>
<div>
<div>
<strong></strong>
<time datetime=""></time>
</div>
</div>
</div>
</template>
<template id="template-calendar-entry-location">
<div>
(
<address></address>
)
</div>
</template>
</head>
<body>
<section>
<h2 id="currentState"></h2>
<div id="state"></div>
</section>
<section>
<h2 id="links"></h2>
<ul id="link-list" class="panel-section-list"></ul>
</section>
<section>
<h2 id="nextEvent"></h2>
<div id="calendar"></div>
</section>
<section class="no-padding">
<details>
<summary><h2 id="spaceApiJson"></h2></summary>
<pre id="space-api"><code></code></pre>
</details>
</section>
<script type="module" src="popup.js"></script>
</body>
</html>

View File

@ -1,57 +1,25 @@
const calendarSVG =
`<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" fill="currentColor" viewBox="0 0 16 16" role="img" aria-label="Kalender">
<path d="M11 6.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1z"/>
<path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"/>
</svg>`
;
const doorClosedSVG =
`<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" fill="currentColor" viewBox="0 0 16 16" role="img" aria-label="Geschlossen">
<path d="M3 2a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v13h1.5a.5.5 0 0 1 0 1h-13a.5.5 0 0 1 0-1H3V2zm1 13h8V2H4v13z"/>
<path d="M9 9a1 1 0 1 0 2 0 1 1 0 0 0-2 0z"/>
</svg>`
;
const doorOpenSVG =
`<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" fill="currentColor" viewBox="0 0 16 16" role="img" aria-label="Offen">
<path d="M8.5 10c-.276 0-.5-.448-.5-1s.224-1 .5-1 .5.448.5 1-.224 1-.5 1z"/>
<path d="M10.828.122A.5.5 0 0 1 11 .5V1h.5A1.5 1.5 0 0 1 13 2.5V15h1.5a.5.5 0 0 1 0 1h-13a.5.5 0 0 1 0-1H3V1.5a.5.5 0 0 1 .43-.495l7-1a.5.5 0 0 1 .398.117zM11.5 2H11v13h1V2.5a.5.5 0 0 0-.5-.5zM4 1.934V15h6V1.077l-6 .857z"/>
</svg>`
;
import { QUICK_LINKS } from './config.js';
const dateTimeFormat = Intl.DateTimeFormat([], {dateStyle: 'medium', timeStyle: 'short'});
globalThis.browser ??= chrome;
function setL10n() {
document.querySelector('html').setAttribute('lang', browser.i18n.getUILanguage());
const dateTimeFormat = Intl.DateTimeFormat([], { dateStyle: 'medium', timeStyle: 'short' });
const loadingText = browser.i18n.getMessage('loading');
document.getElementById('state').textContent = loadingText;
document.getElementById('calendar').textContent = loadingText;
document.querySelector('#space-api > code').textContent = loadingText;
document.getElementById('currentState').textContent = browser.i18n.getMessage('currentState');
document.getElementById('links').textContent = browser.i18n.getMessage('links');
document.getElementById('nextEvent').textContent = browser.i18n.getMessage('nextEvent');
document.getElementById('spaceApiJson').textContent = browser.i18n.getMessage('spaceApiJson');
}
/**
* @param {Event} event
*/
async function linkElementClickListener(event) {
try {
await browser.tabs.create({url: event.currentTarget.dataset.url});
} catch (error) {
console.error(error);
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', async () => {
await init();
});
} else {
await init();
}
async function init() {
setL10n();
setLinks();
const linkElements = Array.from(document.getElementsByClassName('link'));
linkElements.forEach((linkElement) => {
linkElement.addEventListener('click', linkElementClickListener);
});
const {calendar, spaceApi} = await browser.storage.local.get(['calendar', 'spaceApi']);
/**
* @type {import("../types").Storage}
*/
const { calendar, spaceApi } = await browser.storage.session.get(['calendar', 'spaceApi']);
if (calendar) {
updateNextEvent(calendar);
@ -61,87 +29,143 @@ async function init() {
updateState(spaceApi);
}
}
init();
function setL10n() {
document.querySelector('html').setAttribute('lang', browser.i18n.getUILanguage());
const loadingText = browser.i18n.getMessage('loading');
document.querySelector('#state').textContent = loadingText;
document.querySelector('#calendar').textContent = loadingText;
document.querySelector('#space-api > code').textContent = loadingText;
document.querySelector('#currentState').textContent = browser.i18n.getMessage('currentState');
document.querySelector('#links').textContent = browser.i18n.getMessage('links');
document.querySelector('#nextEvent').textContent = browser.i18n.getMessage('nextEvent');
document.querySelector('#spaceApiJson').textContent = browser.i18n.getMessage('spaceApiJson');
}
function setLinks() {
const listElement = document.querySelector('#link-list');
for (const quickLink of QUICK_LINKS) {
const template = getCleanTemplateById('template-link-item');
const linkElement = template.querySelector('.link');
linkElement.dataset.url = quickLink.url;
linkElement.addEventListener('click', linkElementClickListener);
const svgIcon = getCleanTemplateById(quickLink.iconTemplateId);
svgIcon.querySelector('svg').setAttribute('aria-label', quickLink.text);
template.querySelector('.icon').append(svgIcon);
template.querySelector('.text').textContent = quickLink.text;
listElement.append(template);
}
}
/**
* @param {Array<object>} nextEvents
* @param {Event} event
*/
async function linkElementClickListener(event) {
try {
await browser.tabs.create({ url: event.currentTarget.dataset.url });
} catch (error) {
console.error(error);
}
}
/**
* @param {import("../types").Calendar} nextEvents
*/
function updateNextEvent(nextEvents) {
const calendarElement = document.getElementById('calendar');
calendarElement.innerText = '';
const calendarElement = document.querySelector('#calendar');
calendarElement.textContent = '';
if (nextEvents.length === 0) {
const strongElement = document.createElement('strong');
strongElement.textContent = browser.i18n.getMessage('noEventsInNext4Weeks');
calendarElement.append(strongElement);
} else {
const nextEventDate = nextEvents[0].begin.substr(0, 10);
const nextEventDate = nextEvents[0].begin.slice(0, 10);
const nextEventDateEvents = nextEvents.filter((nextEvent) => (nextEvent.begin.startsWith(nextEventDate)));
nextEventDateEvents.forEach((nextEventDateEvent) => {
const calenderEntryElement = document.createElement('div');
calenderEntryElement.classList.add('calendar-entry');
calenderEntryElement.innerHTML = calendarSVG;
const containerElement = document.createElement('div');
calenderEntryElement.append(containerElement);
const strongElement = document.createElement('strong');
strongElement.textContent = nextEventDateEvent.name;
const beginDate = new Date(nextEventDateEvent.begin);
const timeElement = document.createElement('time');
timeElement.dateTime = beginDate.toISOString();
timeElement.textContent = dateTimeFormat.format(beginDate);
const titleElement = document.createElement('div');
titleElement.append(strongElement, timeElement);
containerElement.append(titleElement);
if (nextEventDateEvent.location) {
const locationElement = document.createElement('div');
const addressElement = document.createElement('address');
addressElement.textContent = nextEventDateEvent.location;
const parenthesesOpenNode = document.createTextNode('(');
const parenthesesCloseNode = document.createTextNode(')');
locationElement.append(parenthesesOpenNode, addressElement, parenthesesCloseNode);
containerElement.append(locationElement);
}
calendarElement.append(calenderEntryElement);
});
for (const nextEventDateEvent of nextEventDateEvents) {
calendarElement.append(buildCalendarEntryElement(nextEventDateEvent));
}
}
}
/**
* @param {object} spaceApi
* @param {import("../types").CalendarEntry} nextEventDateEvent
* @returns {DocumentFragment}
*/
function updateSpaceApiJson(spaceApi) {
const json = JSON.stringify(spaceApi, null, 2)
.replace(/ /g, '&nbsp;')
.replace(/\n/g, '<br/>');
const spaceApiElement = document.querySelector('#space-api > code');
spaceApiElement.innerHTML = json;
// const jsonNode = document.createTextNode(json);
// spaceApiElement.innerText = '';
// spaceApiElement.append(jsonNode);
function buildCalendarEntryElement(nextEventDateEvent) {
const calendarEntryElement = getCleanTemplateById('template-calendar-entry');
calendarEntryElement.querySelector('svg').setAttribute('aria-label', browser.i18n.getMessage('event'));
calendarEntryElement.querySelector('strong').textContent = nextEventDateEvent.name;
const timeElement = calendarEntryElement.querySelector('time');
const beginDate = new Date(nextEventDateEvent.begin);
timeElement.dateTime = beginDate.toISOString();
timeElement.textContent = dateTimeFormat.format(beginDate);
if (nextEventDateEvent.location) {
const locationElement = getCleanTemplateById('template-calendar-entry-location');
locationElement.querySelector('address').textContent = nextEventDateEvent.location;
calendarEntryElement.querySelector('.calendar-entry > div').append(locationElement);
}
return calendarEntryElement;
}
/**
* @param {object} spaceApi
* @param {import("../types").SpaceApi} spaceApi
*/
function updateSpaceApiJson(spaceApi) {
const spaceApiElement = document.querySelector('#space-api > code');
spaceApiElement.textContent = JSON.stringify(spaceApi, null, 2);
}
/**
* @param {import("../types").SpaceApi} spaceApi
*/
function updateState(spaceApi) {
const stateIcon = spaceApi.state.open ? doorOpenSVG : doorClosedSVG;
const stateTextNode = document.createTextNode(browser.i18n.getMessage(spaceApi.state.open ? 'openSince' : 'closedSince'));
const state = spaceApi.state.open ? 'open' : 'closed';
const stateElements = getCleanTemplateById('template-state');
const svgIconState = getCleanTemplateById(`template-icon-${state}`);
svgIconState.querySelector('svg').setAttribute('aria-label', browser.i18n.getMessage(state));
stateElements.querySelector('svg').replaceWith(svgIconState);
stateElements.querySelector('span').textContent = browser.i18n.getMessage(spaceApi.state.open ? 'openSince' : 'closedSince');
const timeElement = stateElements.querySelector('time');
const since = new Date(spaceApi.state.lastchange * 1000);
const timeElement = document.createElement('time');
timeElement.dateTime = since.toISOString();
timeElement.textContent = dateTimeFormat.format(since);
const stateElement = document.getElementById('state');
stateElement.innerHTML = stateIcon;
stateElement.append(stateTextNode, timeElement);
const stateElement = document.querySelector('#state');
stateElement.textContent = '';
stateElement.append(stateElements);
}
/**
* @param {string} templateId
* @returns {DocumentFragment}
*/
function getCleanTemplateById(templateId) {
const template = document.querySelector(`#${templateId}`).content.cloneNode(true);
if (template.hasChildNodes()) {
for (const childNode of template.childNodes) {
if (childNode.nodeType !== Node.ELEMENT_NODE) {
childNode.remove();
}
}
}
return template;
}

27
stylelint.config.mjs Normal file
View File

@ -0,0 +1,27 @@
export default {
extends: ['stylelint-config-standard'],
plugins: ['stylelint-plugin-defensive-css', 'stylelint-plugin-logical-css'],
rules: {
'custom-property-empty-line-before': null,
'color-hex-length': 'long',
'plugin/use-defensive-css': [true, {
'accidental-hover': false,
'background-repeat': true,
'custom-property-fallbacks': false,
'flex-wrapping': false,
'scroll-chaining': false,
'scrollbar-gutter': true,
'vendor-prefix-grouping': true,
}],
'plugin/use-logical-properties-and-values': [true, {
'severity': 'warning',
'disable-auto-fix': true,
'ignore': ['overflow-y', 'overflow-x'],
}],
'plugin/use-logical-units': [true, {
'severity': 'warning',
'disable-auto-fix': true,
'ignore': ['dvh', 'dvw'],
}],
},
};

939
types.d.ts vendored Normal file
View File

@ -0,0 +1,939 @@
export type Storage = {
calendar?: Calendar | undefined;
spaceApi?: SpaceApi | undefined;
};
export type Calendar = readonly CalendarEntry[];
export type CalendarEntry = {
readonly begin: string;
readonly begin_date: `${number}.${number}.${number}`;
readonly begin_time: `${number}:${number}`;
readonly end: string;
readonly end_date: `${number}.${number}.${number}`;
readonly end_time: `${number}:${number}`;
readonly name: string;
readonly description: string | null;
readonly location: string | null;
};
/**
* SpaceAPI v14
*/
export interface SpaceApi {
/**
* The versions your SpaceAPI endpoint supports
*/
api_compatibility: string[];
/**
* The name of your space
*/
space: string;
/**
* URL to your space logo
*/
logo: string;
/**
* URL to your space website
*/
url: string;
/**
* Position data such as a postal address or geographic coordinates
*/
location: {
/**
* The postal address of your space (street, block, housenumber, zip code, city, whatever you usually need in your country, and the country itself).<br>Examples: <ul><li>Netzladen e.V., Breite Straße 74, 53111 Bonn, Germany</li></ul>
*/
address?: string;
/**
* Latitude of your space location, in degree with decimal places. Use positive values for locations north of the equator, negative values for locations south of equator.
*/
lat: number;
/**
* Longitude of your space location, in degree with decimal places. Use positive values for locations east of Greenwich, and negative values for locations west of Greenwich.
*/
lon: number;
/**
* The timezone the space is located in. It should be formatted according to the <a target="_blank" href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">TZ database location names</a>.
*/
timezone?: string;
[k: string]: unknown;
};
/**
* A flag indicating if the hackerspace uses SpaceFED, a federated login scheme so that visiting hackers can use the space WiFi with their home space credentials.
*/
spacefed?: {
/**
* See the <a target="_blank" href="https://spacefed.net/index.php/Category:Howto/Spacenet">wiki</a>.
*/
spacenet: boolean;
/**
* See the <a target="_blank" href="https://spacefed.net/index.php?title=Spacesaml">wiki</a>.
*/
spacesaml: boolean;
[k: string]: unknown;
};
/**
* URL(s) of webcams in your space
*/
cam?: [string, ...string[]];
/**
* A collection of status-related data: actual open/closed status, icons, last change timestamp etc.
*/
state?: {
/**
* A flag which indicates whether the space is currently open or closed. The state 'undefined' can be achieved by omitting this field. A missing 'open' property carries the semantics of a temporary unavailability of the state, whereas the absence of the 'state' property itself means the state is generally not implemented for this space. This field is also allowed to explicitly have the value null for backwards compatibility with older schema versions, but this is deprecated and will be removed in a future version.
*/
open?: boolean | null;
/**
* The Unix timestamp when the space status changed most recently
*/
lastchange?: number;
/**
* The person who lastly changed the state e.g. opened or closed the space
*/
trigger_person?: string;
/**
* An additional free-form string, could be something like <samp>'open for public'</samp>, <samp>'members only'</samp> or whatever you want it to be
*/
message?: string;
/**
* Icons that show the status graphically
*/
icon?: {
/**
* The URL to your customized space logo showing an open space
*/
open: string;
/**
* The URL to your customized space logo showing a closed space
*/
closed: string;
[k: string]: unknown;
};
[k: string]: unknown;
};
/**
* Events which happened recently in your space and which could be interesting to the public, like 'User X has entered/triggered/did something at timestamp Z'
*/
events?: {
/**
* Name or other identity of the subject (e.g. <samp>J. Random Hacker</samp>, <samp>fridge</samp>, <samp>3D printer</samp>, )
*/
name: string;
/**
* Action (e.g. <samp>check-in</samp>, <samp>check-out</samp>, <samp>finish-print</samp>, ). Define your own actions and use them consistently, canonical actions are not (yet) specified
*/
type: string;
/**
* Unix timestamp when the event occurred
*/
timestamp: number;
/**
* A custom text field to give more information about the event
*/
extra?: string;
[k: string]: unknown;
}[];
/**
* Contact information about your space
*/
contact: {
/**
* Phone number, including country code with a leading plus sign
*/
phone?: string;
/**
* URI for Voice-over-IP via SIP
*/
sip?: string;
/**
* Persons who carry a key and are able to open the space upon request. One of the fields irc_nick, phone, email or twitter must be specified.
*/
keymasters?: [
{
/**
* Real name
*/
name?: string;
/**
* Contact the person with this nickname directly in irc if available. The irc channel to be used is defined in the contact/irc field.
*/
irc_nick?: string;
/**
* Phone number, including country code with a leading plus sign
*/
phone?: string;
/**
* Email address which can be base64 encoded
*/
email?: string;
/**
* Twitter username with leading <code>@</code>
*/
twitter?: string;
/**
* XMPP (Jabber) ID
*/
xmpp?: string;
/**
* Mastodon username
*/
mastodon?: string;
/**
* Matrix username (including domain)
*/
matrix?: string;
[k: string]: unknown;
},
...{
/**
* Real name
*/
name?: string;
/**
* Contact the person with this nickname directly in irc if available. The irc channel to be used is defined in the contact/irc field.
*/
irc_nick?: string;
/**
* Phone number, including country code with a leading plus sign
*/
phone?: string;
/**
* Email address which can be base64 encoded
*/
email?: string;
/**
* Twitter username with leading <code>@</code>
*/
twitter?: string;
/**
* XMPP (Jabber) ID
*/
xmpp?: string;
/**
* Mastodon username
*/
mastodon?: string;
/**
* Matrix username (including domain)
*/
matrix?: string;
[k: string]: unknown;
}[],
];
/**
* URL of the IRC channel
*/
irc?: string;
/**
* Twitter username with leading <code>@</code>
*/
twitter?: string;
/**
* Mastodon username
*/
mastodon?: string;
/**
* Facebook account URL
*/
facebook?: string;
/**
* Identi.ca or StatusNet account, in the form <samp>yourspace@example.org</samp>
*/
identica?: string;
/**
* Foursquare ID, in the form <samp>4d8a9114d85f3704eab301dc</samp>
*/
foursquare?: string;
/**
* E-mail address for contacting your space. If this is a mailing list consider to use the contact/ml field.
*/
email?: string;
/**
* The e-mail address of your mailing list. If you use Google Groups then the e-mail looks like <samp>your-group@googlegroups.com</samp>.
*/
ml?: string;
/**
* A public Jabber/XMPP multi-user chatroom in the form <samp>chatroom@conference.example.net</samp>
*/
xmpp?: string;
/**
* A separate email address for issue reports. This value can be Base64-encoded.
*/
issue_mail?: string;
/**
* A URL to find information about the Space in the Gopherspace
*/
gopher?: string;
/**
* Matrix channel/community for the Hackerspace
*/
matrix?: string;
/**
* URL to a Mumble server/channel, as specified in https://wiki.mumble.info/wiki/Mumble_URL
*/
mumble?: string;
[k: string]: unknown;
};
/**
* Data of various sensors in your space (e.g. temperature, humidity, amount of Club-Mate left, ). The only canonical property is the <em>temp</em> property, additional sensor types may be defined by you. In this case, you are requested to share your definition for inclusion in this specification.
*/
sensors?: {
/**
* Temperature sensor. To convert from one unit of temperature to another consider <a href="http://en.wikipedia.org/wiki/Temperature_conversion_formulas" target="_blank">Wikipedia</a>.
*/
temperature?: {
/**
* The sensor value
*/
value: number;
/**
* The unit of the sensor value
*/
unit: '°C' | '°F' | 'K' | '°De' | '°N' | '°R' | '°Ré' | '°Rø';
/**
* The location of your sensor
*/
location: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* Sensor type to indicate if a certain door is locked
*/
door_locked?: {
/**
* The sensor value
*/
value: boolean;
/**
* The location of your sensor
*/
location: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* Barometer sensor
*/
barometer?: {
/**
* The sensor value
*/
value: number;
/**
* The unit of pressure used by your sensor<br>Note: The <code>hPA</code> unit is deprecated and should not be used anymore. Use the correct <code>hPa</code> unit instead.
*/
unit: 'hPa' | 'hPA';
/**
* The location of your sensor
*/
location: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* Compound radiation sensor. Check this <a rel="nofollow" href="https://sites.google.com/site/diygeigercounter/gm-tubes-supported" target="_blank">resource</a>.
*/
radiation?: {
/**
* An alpha sensor
*/
alpha?: {
/**
* Observed counts per minute (ocpm) or actual radiation value. If the value are the observed counts then the dead_time and conversion_factor fields must be defined as well. CPM formula: <div>cpm = ocpm ( 1 + 1 / (1 - ocpm x dead_time) )</div> Conversion formula: <div>µSv/h = cpm x conversion_factor</div>
*/
value: number;
/**
* Choose the appropriate unit for your radiation sensor instance
*/
unit: 'cpm' | 'r/h' | 'µSv/h' | 'mSv/a' | 'µSv/a';
/**
* The dead time in µs. See the description of the value field to see how to use the dead time.
*/
dead_time?: number;
/**
* The conversion from the <em>cpm</em> unit to another unit hardly depends on your tube type. See the description of the value field to see how to use the conversion factor. <strong>Note:</strong> only trust your manufacturer if it comes to the actual factor value. The internet seems <a rel="nofollow" href="http://sapporohibaku.wordpress.com/2011/10/15/conversion-factor/" target="_blank">full of wrong copy & pastes</a>, don't even trust your neighbour hackerspace. If in doubt ask the tube manufacturer.
*/
conversion_factor?: number;
/**
* The location of your sensor
*/
location?: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* A beta sensor
*/
beta?: {
/**
* Observed counts per minute (ocpm) or actual radiation value. If the value are the observed counts then the dead_time and conversion_factor fields must be defined as well. CPM formula: <div>cpm = ocpm ( 1 + 1 / (1 - ocpm x dead_time) )</div> Conversion formula: <div>µSv/h = cpm x conversion_factor</div>
*/
value: number;
/**
* Choose the appropriate unit for your radiation sensor instance
*/
unit: 'cpm' | 'r/h' | 'µSv/h' | 'mSv/a' | 'µSv/a';
/**
* The dead time in µs. See the description of the value field to see how to use the dead time.
*/
dead_time?: number;
/**
* The conversion from the <em>cpm</em> unit to another unit hardly depends on your tube type. See the description of the value field to see how to use the conversion factor. <strong>Note:</strong> only trust your manufacturer if it comes to the actual factor value. The internet seems <a rel="nofollow" href="http://sapporohibaku.wordpress.com/2011/10/15/conversion-factor/" target="_blank">full of wrong copy & pastes</a>, don't even trust your neighbour hackerspace. If in doubt ask the tube manufacturer.
*/
conversion_factor?: number;
/**
* The location of your sensor
*/
location?: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* A gamma sensor
*/
gamma?: {
/**
* Observed counts per minute (ocpm) or actual radiation value. If the value are the observed counts then the dead_time and conversion_factor fields must be defined as well. CPM formula: <div>cpm = ocpm ( 1 + 1 / (1 - ocpm x dead_time) )</div> Conversion formula: <div>µSv/h = cpm x conversion_factor</div>
*/
value: number;
/**
* Choose the appropriate unit for your radiation sensor instance
*/
unit: 'cpm' | 'r/h' | 'µSv/h' | 'mSv/a' | 'µSv/a';
/**
* The dead time in µs. See the description of the value field to see how to use the dead time.
*/
dead_time?: number;
/**
* The conversion from the <em>cpm</em> unit to another unit hardly depends on your tube type. See the description of the value field to see how to use the conversion factor. <strong>Note:</strong> only trust your manufacturer if it comes to the actual factor value. The internet seems <a rel="nofollow" href="http://sapporohibaku.wordpress.com/2011/10/15/conversion-factor/" target="_blank">full of wrong copy & pastes</a>, don't even trust your neighbour hackerspace. If in doubt ask the tube manufacturer.
*/
conversion_factor?: number;
/**
* The location of your sensor
*/
location?: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* A sensor which cannot filter beta and gamma radiation separately.
*/
beta_gamma?: {
/**
* Observed counts per minute (ocpm) or actual radiation value. If the value are the observed counts then the dead_time and conversion_factor fields must be defined as well. CPM formula: <div>cpm = ocpm ( 1 + 1 / (1 - ocpm x dead_time) )</div> Conversion formula: <div>µSv/h = cpm x conversion_factor</div>
*/
value: number;
/**
* Choose the appropriate unit for your radiation sensor instance
*/
unit: 'cpm' | 'r/h' | 'µSv/h' | 'mSv/a' | 'µSv/a';
/**
* The dead time in µs. See the description of the value field to see how to use the dead time.
*/
dead_time?: number;
/**
* The conversion from the <em>cpm</em> unit to another unit hardly depends on your tube type. See the description of the value field to see how to use the conversion factor. <strong>Note:</strong> only trust your manufacturer if it comes to the actual factor value. The internet seems <a rel="nofollow" href="http://sapporohibaku.wordpress.com/2011/10/15/conversion-factor/" target="_blank">full of wrong copy & pastes</a>, don't even trust your neighbour hackerspace. If in doubt ask the tube manufacturer.
*/
conversion_factor?: number;
/**
* The location of your sensor
*/
location?: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
[k: string]: unknown;
};
/**
* Humidity sensor
*/
humidity?: {
/**
* The sensor value
*/
value: number;
/**
* The unit of the sensor value. You should always define the unit though if the sensor is a flag of a boolean type then you can of course omit it.
*/
unit: '%';
/**
* The location of your sensor
*/
location: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* How much Mate and beer is in your fridge?
*/
beverage_supply?: {
/**
* The sensor value
*/
value: number;
/**
* The unit, either <samp>btl</samp> for bottles or <samp>crt</samp> for crates
*/
unit: 'btl' | 'crt';
/**
* The location of your sensor
*/
location?: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* The power consumption of a specific device or of your whole space
*/
power_consumption?: {
/**
* The sensor value
*/
value: number;
/**
* The unit of the sensor value. You should always define the unit though if the sensor is a flag of a boolean type then you can of course omit it.
*/
unit: 'mW' | 'W' | 'VA';
/**
* The location of your sensor
*/
location: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* Your wind sensor
*/
wind?: {
properties: {
speed: {
/**
* The sensor value
*/
value: number;
/**
* The unit of the sensor value. You should always define the unit though if the sensor is a flag of a boolean type then you can of course omit it.
*/
unit: 'm/s' | 'km/h' | 'kn';
[k: string]: unknown;
};
gust: {
/**
* The sensor value
*/
value: number;
/**
* The unit of the sensor value. You should always define the unit though if the sensor is a flag of a boolean type then you can of course omit it.
*/
unit: 'm/s' | 'km/h' | 'kn';
[k: string]: unknown;
};
/**
* The wind direction in degrees
*/
direction: {
/**
* The sensor value
*/
value: number;
/**
* The unit of the sensor value. You should always define the unit though if the sensor is a flag of a boolean type then you can of course omit it.
*/
unit: '°';
[k: string]: unknown;
};
/**
* Height above mean sea level
*/
elevation: {
/**
* The sensor value
*/
value: number;
/**
* The unit of the sensor value. You should always define the unit though if the sensor is a flag of a boolean type then you can of course omit it.
*/
unit: 'm';
[k: string]: unknown;
};
[k: string]: unknown;
};
/**
* The location of your sensor
*/
location: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* This sensor type is to specify the currently active ethernet or wireless network devices. You can create different instances for each network type.
*/
network_connections?: {
/**
* This field is optional but you can use it to the network type such as <samp>wifi</samp> or <samp>cable</samp>. You can even expose the number of <a href="https://spacefed.net/wiki/index.php/Spacenet" target="_blank">spacenet</a>-authenticated connections.
*/
type?: 'wifi' | 'cable' | 'spacenet';
/**
* The amount of network connections.
*/
value: number;
/**
* The machines that are currently connected with the network.
*/
machines?: {
/**
* The machine name.
*/
name?: string;
/**
* The machine's MAC address of the format <samp>D3:3A:DB:EE:FF:00</samp>.
*/
mac: string;
[k: string]: unknown;
}[];
/**
* The location of your sensor
*/
location?: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* How rich is your hackerspace?
*/
account_balance?: {
/**
* How much?
*/
value: number;
/**
* What's the currency? It should be formatted according to <a href="https://en.wikipedia.org/wiki/ISO_4217" target="_blank">ISO 4217</a> short-code format.
*/
unit: string;
/**
* If you have more than one account you can use this field to specify where it is.
*/
location?: string;
/**
* Give your sensor instance a name.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* Specify the number of space members.
*/
total_member_count?: {
/**
* The amount of your space members.
*/
value: number;
/**
* Specify the location if your hackerspace has different departments (for whatever reason). This field is for one department. Every department should have its own sensor instance.
*/
location?: string;
/**
* You can use this field to specify if this sensor instance counts active or inactive members.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* Specify the number of people that are currently in your space. Optionally you can define a list of names.
*/
people_now_present?: {
/**
* The amount of present people.
*/
value: number;
/**
* If you use multiple sensor instances for different rooms, use this field to indicate the location.
*/
location?: string;
/**
* Give this sensor a name if necessary at all. Use the location field for the rooms. This field is not intended to be used for names of hackerspace members. Use the field 'names' instead.
*/
name?: string;
/**
* List of hackerspace members that are currently occupying the space.
*/
names?: [string, ...string[]];
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* The current network traffic, in bits/second or packets/second (or both)
*/
network_traffic?: [
{
properties: {
bits_per_second?: {
/**
* The measurement value, in bits/second
*/
value: number;
/**
* The maximum available throughput in bits/second, e.g. as sold by your ISP
*/
maximum?: number;
[k: string]: unknown;
};
packets_per_second?: {
/**
* The measurement value, in packets/second
*/
value: number;
[k: string]: unknown;
};
[k: string]: unknown;
};
/**
* Name of the measurement, e.g. to distinguish between upstream and downstream traffic
*/
name?: string;
/**
* Location the measurement relates to, e.g. <samp>WiFi</samp> or <samp>Uplink</samp>
*/
location?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
},
...{
properties: {
bits_per_second?: {
/**
* The measurement value, in bits/second
*/
value: number;
/**
* The maximum available throughput in bits/second, e.g. as sold by your ISP
*/
maximum?: number;
[k: string]: unknown;
};
packets_per_second?: {
/**
* The measurement value, in packets/second
*/
value: number;
[k: string]: unknown;
};
[k: string]: unknown;
};
/**
* Name of the measurement, e.g. to distinguish between upstream and downstream traffic
*/
name?: string;
/**
* Location the measurement relates to, e.g. <samp>WiFi</samp> or <samp>Uplink</samp>
*/
location?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[],
];
[k: string]: unknown;
};
/**
* Feeds where users can get updates of your space
*/
feeds?: {
blog?: {
/**
* Type of the feed
*/
type?: string;
/**
* Feed URL
*/
url: string;
[k: string]: unknown;
};
wiki?: {
/**
* Type of the feed
*/
type?: string;
/**
* Feed URL
*/
url: string;
[k: string]: unknown;
};
calendar?: {
/**
* Type of the feed
*/
type?: string;
/**
* Feed URL
*/
url: string;
[k: string]: unknown;
};
flickr?: {
/**
* Type of the feed
*/
type?: string;
/**
* Feed URL
*/
url: string;
[k: string]: unknown;
};
[k: string]: unknown;
};
/**
* Your project sites (links to GitHub, wikis or wherever your projects are hosted)
*/
projects?: string[];
/**
* Arbitrary links that you'd like to share
*/
links?: {
/**
* The link name
*/
name: string;
/**
* An extra field for a more detailed description of the link
*/
description?: string;
/**
* The URL
*/
url: string;
[k: string]: unknown;
}[];
/**
* A list of the different membership plans your hackerspace might have. Set the value according to your billing process. For example, if your membership fee is 10 per month, but you bill it yearly (aka. the member pays the fee once per year), set the amount to 120 an the billing_interval to yearly.
*/
membership_plans?: {
/**
* The name of the membership plan
*/
name: string;
/**
* How much does this plan cost?
*/
value: number;
/**
* What's the currency? It should be formatted according to <a href="https://en.wikipedia.org/wiki/ISO_4217" target="_blank">ISO 4217</a> short-code format.
*/
currency: string;
/**
* How often is the membership billed? If you select other, please specify in the description what your billing interval is.
*/
billing_interval: 'yearly' | 'monthly' | 'weekly' | 'daily' | 'hourly' | 'other';
/**
* A free form string
*/
description?: string;
[k: string]: unknown;
}[];
[k: string]: unknown;
}

7
web-ext-config.js Normal file
View File

@ -0,0 +1,7 @@
module.exports = {
sourceDir: 'src/',
build: {
overwriteDest: true,
filename: '_usr_space-{version}.zip',
},
};