Compare commits

..

No commits in common. "main" and "v0.8.6" have entirely different histories.
main ... v0.8.6

26 changed files with 369 additions and 12051 deletions

View file

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

1
.gitignore vendored
View file

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

View file

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

View file

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

View file

@ -1,324 +0,0 @@
# 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 ([e2dff3f](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/e2dff3f308a2521af07e451b3dfb6ead85e152ea))
- _(changelog)_ Improve changelog format ([096b451](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/096b4516bf3853531f62fff9a7e291928a6b8993))
- _(package)_ Update dependencies ([088da6b](https://git.usrspace.at/XimeX/usrspace-browser-addon/commit/088da6b8889b23141e785fe53ca72ed7094c98b2))
## [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,31 +1,20 @@
# /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)
# /usr/space Web-Ext (Firefox Add-on)
## Features
- Show if someone is in the Space
- Looks for connected dynamic IPs (DHCP) (provided by backend)
- Looks for connected dynamic IPs (DHCP)
- Refreshes every 5min
- Show the next event
- Quick-Links (Homepage, Wiki, Git, Cloud, Pad)
- Quick-Links (Homepage, Wiki, Gitea, Nextcloud)
## Install
```ssh
$ git clone https://git.usrspace.at/XimeX/usrspace-browser-addon.git
# optional
$ git clone https://gitea.usrspace.at/XimeX/usrspace-browser-addon.git
$ npm i -g web-ext
$ npm i
```
## Run / Develop / Debug
```ssh
$ npm run watch:{firefox|firefox-android|chromium}
```
@ -33,38 +22,33 @@ $ 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`
Example: `npm run watch:firefox-android -- --firefox-apk=org.mozilla.fenix --firefox-device=XXXXXXXX`.
## Build
```ssh
$ npm run build
// For Firefox
$ npm run build:firefox
// For Chromium
$ npm run build:chromium
```
## Release
```ssh
$ npm version {major|minor|patch|...}
```
## 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)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 KiB

View file

@ -1,110 +0,0 @@
# 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"

View file

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

View file

@ -1,32 +0,0 @@
{
"typescript": {
"lineWidth": 128,
"quoteProps": "consistent",
"quoteStyle": "alwaysSingle",
"semiColons": "always",
"singleBodyPosition": "nextLine",
"useBraces": "always",
"useTabs": true,
"arrowFunction.useParentheses": "force",
"module.sortImportDeclarations": "maintain",
"importDeclaration.sortNamedImports": "maintain"
},
"json": {
"trailingCommas": "maintain",
"useTabs": true
},
"markdown": {},
"toml": {
"useTabs": true
},
"excludes": [
"**/node_modules",
"**/*-lock.json"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.91.0.wasm",
"https://plugins.dprint.dev/json-0.19.3.wasm",
"https://plugins.dprint.dev/markdown-0.17.1.wasm",
"https://plugins.dprint.dev/toml-0.6.2.wasm"
]
}

View file

@ -1,45 +0,0 @@
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,
},
},
];

10073
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,57 +1,39 @@
{
"name": "usrspace-browser-addon",
"description": "WebExtension for the Hacker-/Maker-Space /usr/space",
"version": "0.9.5",
"version": "0.8.6",
"dependencies": {
"webextension-polyfill": "^0.10.0"
},
"devDependencies": {
"@commitlint/cli": "^18.6.1",
"@commitlint/config-conventional": "^18.6.3",
"@commitlint/cz-commitlint": "^18.6.1",
"@types/firefox-webext-browser": "^120.0.3",
"commitizen": "^4.3.0",
"dprint": "^0.46.1",
"eslint": "^8.57.0",
"eslint-plugin-jsdoc": "^48.2.6",
"eslint-plugin-no-unsanitized": "^4.0.2",
"eslint-plugin-unicorn": "^53.0.0",
"git-cliff": "^2.2.2",
"husky": "^9.0.11",
"stylelint": "^16.6.0",
"stylelint-config-standard": "^36.0.0",
"stylelint-plugin-defensive-css": "^1.0.4",
"stylelint-plugin-logical-css": "^1.2.1",
"web-ext": "^7.12.0"
"web-ext-types": "^3.2.1"
},
"scripts": {
"copy-browser-polyfill": "cp node_modules/webextension-polyfill/dist/browser-polyfill.js src/browser-polyfill.js",
"inject-browser-polyfill": "sed -i -r 's/(<!-- \\[INJECT-BROWSER-POLYFILL] -->).*/\\1<script type=\"module\" src=\"browser-polyfill.js\"><\\/script>/' src/*.html",
"uninject-browser-polyfill": "sed -i -r 's/(<!-- \\[INJECT-BROWSER-POLYFILL] -->).+/\\1/' src/*.html",
"copy-version": "sed -i 's/^\t\"version\": \".*\",$/\t\"version\": \"'$(rg '^\t\"version\": \"(.+)\",$' -r '$1' < package.json)'\",/' src/manifest.json",
"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",
"lint": "web-ext lint -w",
"test": "echo \"Error: no test specified\" && exit 0",
"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",
"prebuild:firefox": "npm run prebuild",
"prebuild:chromium": "npm run prebuild && npm run inject-browser-polyfill",
"build:firefox": "web-ext build -i browser-polyfill.js",
"build:chromium": "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"
}
"postbuild:firefox": "npm run postbuild",
"postbuild:chromium": "npm run postbuild && npm run uninject-browser-polyfill",
"postinstall": "npm run copy-browser-polyfill",
"preversion": "npm run lint && npm test",
"version": "npm run copy-version && git add -u",
"postversion": "npm run build:firefox"
},
"repository": {
"type": "git",
"url": "https://git.usrspace.at/XimeX/usrspace-browser-addon"
"url": "https://gitea.usrspace.at/XimeX/usrspace-browser-addon"
},
"keywords": [
"/usr/space"

View file

@ -41,8 +41,8 @@
"stateNotificationMessage": {
"message": "Space ist jetzt $STATE$.",
"placeholders": {
"STATE": {
"content": "$1"
"STATE" : {
"content" : "$1"
}
}
},

View file

@ -41,8 +41,8 @@
"stateNotificationMessage": {
"message": "Space is now $STATE$.",
"placeholders": {
"STATE": {
"content": "$1"
"STATE" : {
"content" : "$1"
}
}
},

10
src/background.html Normal file
View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<title>/usr/space</title>
<!-- [INJECT-BROWSER-POLYFILL] -->
<script type="module" src="background.js"></script>
</head>
</html>

View file

@ -1,58 +1,40 @@
import { REFRESH_TIMEOUT, HOMEPAGE, API_URLS, BADGE_COLORS } from './config.js';
import Config from './config.js';
globalThis.browser ??= chrome;
document.querySelector('html').setAttribute('lang', browser.i18n.getUILanguage());
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>}
*/
async function fetchJson(url) {
const response = await fetch(url);
return response.json();
}
/**
* @param {number} days
* @returns {Promise<import("../types").Calendar>}
* @returns {Promise<Array<object>>}
*/
async function fetchCalendar(days = 28) {
const params = new URLSearchParams();
params.set('o', 'json');
function fetchCalendar(days = 28) {
let url = `${Config.calenderUrl}?o=json`;
if (days) {
params.set('r', `${days}`);
url += `&r=${days}`;
}
const response = await fetch(`${API_URLS.calender}?${params.toString()}`);
return response.json();
return fetchJson(url);
}
/**
* @returns {Promise<import("../types").SpaceApi>}
* @returns {Promise<object>}
*/
async function fetchSpaceApi() {
const response = await fetch(API_URLS.spaceApi);
return response.json();
function fetchSpaceApi() {
return fetchJson(Config.spaceApiUrl);
}
async function fetchNewData() {
if (!globalThis.navigator.onLine) {
return;
}
try {
const [resultCalendar, resultSpaceApi] = await Promise.allSettled([fetchCalendar(), fetchSpaceApi()]);
const calendarJson = (resultCalendar.status === 'fulfilled') ? resultCalendar.value : undefined;
const spaceApiJson = (resultSpaceApi.status === 'fulfilled') ? resultSpaceApi.value : undefined;
const result = await Promise.allSettled([fetchCalendar(), fetchSpaceApi()]);
const calendarJson = result[0].value;
const spaceApiJson = result[1].value;
if (spaceApiJson) {
const now = new Date();
@ -60,18 +42,24 @@ async function fetchNewData() {
new Date(event.begin) <= now && now <= new Date(event.end)
)) ?? false;
await setBadgeStatus(spaceApiJson.state.open, eventActive);
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});
/**
* @type {import("../types").Storage}
*/
const { spaceApi } = await browser.storage.session.get('spaceApi');
const {spaceApi} = await browser.storage.local.get('spaceApi');
if (spaceApi && spaceApi.state.open !== spaceApiJson.state.open) {
await createStatusChangedNotification(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 browser.storage.session.set({
await browser.storage.local.set({
calendar: calendarJson,
spaceApi: spaceApiJson,
});
@ -80,39 +68,39 @@ async function fetchNewData() {
}
}
/**
* @param {boolean} open
* @param {boolean} eventActive
*/
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 });
}
browser.runtime.onStartup.addListener(async () => {
await browser.storage.local.remove(['calendar', 'spaceApi']);
});
/**
* @param {boolean} open
* @param {Alarm} alarm
*/
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'),
});
function handleAlarm(alarm) {
if (alarm.name === 'fetchData') {
fetchNewData();
}
}
function init() {
function startFetching() {
fetchNewData();
browser.alarms.onAlarm.addListener(handleAlarm);
const now = new Date();
now.setMinutes(Math.ceil((now.getMinutes() + 1) / REFRESH_TIMEOUT) * REFRESH_TIMEOUT, 0, 0);
now.setMinutes(Math.ceil((now.getMinutes() + 1) / Config.refreshTimeout) * Config.refreshTimeout, 0, 0);
browser.alarms.create('fetchData', {
when: now.getTime(),
periodInMinutes: REFRESH_TIMEOUT,
periodInMinutes: Config.refreshTimeout,
});
}
init();
window.addEventListener('offline', async () => {
browser.alarms.onAlarm.removeListener(handleAlarm);
await browser.alarms.clear('fetchData');
});
window.addEventListener('online', () => {
startFetching();
});
if (window.navigator.onLine) {
startFetching();
}

View file

@ -1,42 +1,30 @@
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 default {
refreshTimeout: 5,
spaceApiUrl: 'https://www.usrspace.at/spaceapi.json',
calenderUrl: 'https://www.usrspace.at/calendar.php',
openColor: '#33cc33',
closedColor: '#cc3333',
eventColor: '#9933cc',
quickLinks: [
{
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-gitea',
url: 'https://gitea.usrspace.at/',
text: 'Gitea',
},
{
iconTemplateId: 'template-icon-nextcloud',
url: 'https://cloud.usrspace.at/',
text: 'Nextcloud',
},
],
};
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',
},
];

View file

@ -1,65 +0,0 @@
/* 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;
&:hover {
background-color: rgba(0, 0, 0, 0.06);
border-block: 1px solid rgba(0, 0, 0, 0.1);
}
&:hover:active {
background-color: rgba(0, 0, 0, 0.1);
}
& > .icon {
flex-grow: 0;
flex-shrink: 0;
}
& > .text {
flex-grow: 10;
}
& > .text-shortcut {
color: #808080;
font-family: "Lucida Grande", caption;
font-size: .847em;
justify-content: flex-end;
}
}

View file

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

View file

@ -1,19 +1,15 @@
@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;
@ -22,59 +18,47 @@
}
:root {
--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);
}
--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;
}
body {
inline-size: 360px;
width: 360px;
padding: 6px 12px;
color: var(--color);
background-color: var(--background);
font-family: 'Nunito Sans', sans-serif;
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);
}
}
section.no-padding {
margin: 0 -12px -6px;
}
h2 {
margin: 6px 0 4px;
}
summary {
margin: 6px 12px;
margin: 6px 12px 6px;
cursor: pointer;
& > h2 {
margin: 0;
display: inline-block;
}
}
summary > h2 {
margin: 0;
display: inline-block;
}
time {
font-style: italic;
}
svg {
vertical-align: text-bottom;
}
@ -82,45 +66,39 @@ svg {
.panel-section-list {
margin: 0 -12px;
}
.panel-list-item > .icon {
text-align: center;
inline-size: 23px;
margin-inline-end: 4px;
width: 23px;
margin-right: 4px;
}
.link {
cursor: pointer;
}
#state > svg,
#calendar > .calendar-entry > svg,
#calendar > .calendar-entry strong {
margin-inline-end: 8px;
#state > svg, #calendar > .calendar-entry > svg, #calendar > .calendar-entry strong {
margin-right: 8px;
}
#calendar {
& > .calendar-entry,
& > .calendar-entry > div > div {
display: flex;
}
& address {
display: inline;
}
#calendar > .calendar-entry {
display: flex;
}
#calendar address {
display: inline;
}
#space-api {
margin: 0;
padding: 4px 8px 8px;
block-size: 159px;
overflow-block: scroll;
scrollbar-gutter: stable;
background-color: var(--code-background);
& code {
font-family: monospace;
font-size: 10px;
white-space: break-spaces;
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);
}
}
#space-api code {
font-family: monospace;
font-size: 10px;
}

View file

@ -1,102 +1,94 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<title>/usr/space</title>
<link rel="stylesheet" href="popup.css" />
<head>
<meta charset="utf-8" />
<title>/usr/space</title>
<link rel="stylesheet" href="popup.css" />
<template id="template-icon-closed">
<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-gitea">
<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-nextcloud">
<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-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="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" />
<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>
</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>
<div>
<strong></strong>
<time datetime=""></time>
</div>
<strong></strong>
<time datetime=""></time>
</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>
</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 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>
<!-- [INJECT-BROWSER-POLYFILL] -->
<script type="module" src="popup.js"></script>
</body>
</html>

View file

@ -1,25 +1,59 @@
import { QUICK_LINKS } from './config.js';
import Config from './config.js';
globalThis.browser ??= chrome;
const dateTimeFormat = Intl.DateTimeFormat([], {dateStyle: 'medium', timeStyle: 'short'});
const dateTimeFormat = Intl.DateTimeFormat([], { dateStyle: 'medium', timeStyle: 'short' });
function setL10n() {
document.querySelector('html').setAttribute('lang', browser.i18n.getUILanguage());
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', async () => {
await init();
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');
}
function setLinks() {
const listElement = document.getElementById('link-list');
Config.quickLinks.forEach((quickLink) => {
const template = getCleanTemplateById('template-link-item');
template.querySelector('.link').dataset.url = quickLink.url;
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);
});
} else {
await init();
}
/**
* @param {Event} event
*/
async function linkElementClickListener(event) {
try {
await browser.tabs.create({url: event.currentTarget.dataset.url});
} catch (error) {
console.error(error);
}
}
async function init() {
setL10n();
setLinks();
/**
* @type {import("../types").Storage}
*/
const { calendar, spaceApi } = await browser.storage.session.get(['calendar', 'spaceApi']);
const linkElements = Array.from(document.getElementsByClassName('link'));
linkElements.forEach((linkElement) => {
linkElement.addEventListener('click', linkElementClickListener);
});
const {calendar, spaceApi} = await browser.storage.local.get(['calendar', 'spaceApi']);
if (calendar) {
updateNextEvent(calendar);
@ -29,101 +63,50 @@ async function init() {
updateState(spaceApi);
}
}
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);
}
}
init();
/**
* @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
* @param {Array<object>} nextEvents
*/
function updateNextEvent(nextEvents) {
const calendarElement = document.querySelector('#calendar');
calendarElement.textContent = '';
const calendarElement = document.getElementById('calendar');
calendarElement.innerText = '';
if (nextEvents.length === 0) {
const strongElement = document.createElement('strong');
strongElement.textContent = browser.i18n.getMessage('noEventsInNext4Weeks');
calendarElement.append(strongElement);
} else {
const nextEventDate = nextEvents[0].begin.slice(0, 10);
const nextEventDate = nextEvents[0].begin.substr(0, 10);
const nextEventDateEvents = nextEvents.filter((nextEvent) => (nextEvent.begin.startsWith(nextEventDate)));
for (const nextEventDateEvent of nextEventDateEvents) {
calendarElement.append(buildCalendarEntryElement(nextEventDateEvent));
}
nextEventDateEvents.forEach((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);
}
calendarElement.append(calendarEntryElement);
});
}
}
/**
* @param {import("../types").CalendarEntry} nextEventDateEvent
* @returns {DocumentFragment}
*/
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 {import("../types").SpaceApi} spaceApi
* @param {object} spaceApi
*/
function updateSpaceApiJson(spaceApi) {
const spaceApiElement = document.querySelector('#space-api > code');
@ -131,7 +114,7 @@ function updateSpaceApiJson(spaceApi) {
}
/**
* @param {import("../types").SpaceApi} spaceApi
* @param {object} spaceApi
*/
function updateState(spaceApi) {
const state = spaceApi.state.open ? 'open' : 'closed';
@ -149,8 +132,8 @@ function updateState(spaceApi) {
timeElement.dateTime = since.toISOString();
timeElement.textContent = dateTimeFormat.format(since);
const stateElement = document.querySelector('#state');
stateElement.textContent = '';
const stateElement = document.getElementById('state');
stateElement.innerText = '';
stateElement.append(stateElements);
}
@ -159,11 +142,11 @@ function updateState(spaceApi) {
* @returns {DocumentFragment}
*/
function getCleanTemplateById(templateId) {
const template = document.querySelector(`#${templateId}`).content.cloneNode(true);
const template = document.getElementById(templateId).content.cloneNode(true);
if (template.hasChildNodes()) {
for (const childNode of template.childNodes) {
if (childNode.nodeType !== Node.ELEMENT_NODE) {
childNode.remove();
template.removeChild(childNode);
}
}
}

View file

@ -1,27 +0,0 @@
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
View file

@ -1,939 +0,0 @@
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;
}