chore: unify and improve codestyle

This commit is contained in:
Thomas Rupprecht 2023-02-04 17:09:47 +01:00
parent 25708ea410
commit 701ec4b226
11 changed files with 169 additions and 151 deletions

View File

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

View File

@ -5,36 +5,41 @@ All notable changes to this project will be documented in this file.
## [unreleased]
### Features
- Add git-cliff to update the CHANGELOG.md
### Miscellaneous Tasks
- Update husky
- Improve CHANGELOG config
- Unify and improve codestyle
### Other
- Add pre-commit hook with husky
- Add pre-commit hook with husky
## [v0.9.1](https://gitea.usrspace.at/XimeX/usrspace-browser-addon/releases/tag/v0.9.1) - 2023-01-22
### Other
- Extract code into setBadgeStatus and createStatusChangedNotification function
- Don't fetch data if offline
- Replace web-ext types package
- Await init
- Add link to Pad
## [v0.9.0](https://gitea.usrspace.at/XimeX/usrspace-browser-addon/releases/tag/v0.9.0) - 2023-01-20
### Other
- Manifest_v3
- Update to manifest_version v3
- Make code compatible with manifest_version v3
## [v0.8.7](https://gitea.usrspace.at/XimeX/usrspace-browser-addon/releases/tag/v0.8.7) - 2023-01-20
### Other
- Add badges to README
- Improve README
- Improve badges
@ -44,52 +49,53 @@ All notable changes to this project will be documented in this file.
- Remove persistent flag in manifest config
- Open usrspace.at homepage on install
## [v0.8.6](https://gitea.usrspace.at/XimeX/usrspace-browser-addon/releases/tag/v0.8.6) - 2023-01-05
### Other
- Change addon id to currently used one
- Change addon id to currently used one
## [v0.8.5](https://gitea.usrspace.at/XimeX/usrspace-browser-addon/releases/tag/v0.8.5) - 2023-01-05
### Other
- Add web-ext-config.js and add watch scripts
- Improve README
- Add development docs
- Inject browser-polyfill only in chromium builds
- Add addon id
## [v0.8.4](https://gitea.usrspace.at/XimeX/usrspace-browser-addon/releases/tag/v0.8.4) - 2023-01-05
### Other
- Use html template tag
- Change strict_min_version to v79
- Simplify updateSpaceApiJson
- Add lint script
## [v0.8.3](https://gitea.usrspace.at/XimeX/usrspace-browser-addon/releases/tag/v0.8.3) - 2023-01-04
### Other
- Update strict_min_version to 57.0
- Update strict_min_version to 57.0
## [v0.8.2](https://gitea.usrspace.at/XimeX/usrspace-browser-addon/releases/tag/v0.8.2) - 2023-01-04
### Other
- Explicit set persistent=true and add browser_specific_settings in manifest.json
- Set html lang by browser language
- Improve popup styling
## [v0.8.1](https://gitea.usrspace.at/XimeX/usrspace-browser-addon/releases/tag/v0.8.1) - 2022-12-25
### Bug Fixes
- Fix copy-version script
### Other
- Manifest l10n
- Faster data fetching, badge improvements
- Cursor pointer on clickable elements
@ -101,10 +107,10 @@ All notable changes to this project will be documented in this file.
- Unfiy codestyle
- Cleanup data on startup
## [v0.8.0](https://gitea.usrspace.at/XimeX/usrspace-browser-addon/releases/tag/v0.8.0) - 2022-12-24
### Other
- Improve code, doc, tooling
- Npm version scripts
- Copy browser-polyfill
@ -119,15 +125,16 @@ All notable changes to this project will be documented in this file.
- Increase svg size
- Set build filename
## [v0.7](https://gitea.usrspace.at/XimeX/usrspace-browser-addon/releases/tag/v0.7) - 2021-11-06
### Bug Fixes
- Fix new urls
- Fix dates if no date is found
- Fix data, remove logging, improve code
### Other
- Change spaceApiUrl and nextcloud label
- Add release info
- Add editorconfig
@ -143,27 +150,28 @@ All notable changes to this project will be documented in this file.
- Change icon
- Remove old html code and load right svg
## [v0.4](https://gitea.usrspace.at/XimeX/usrspace-browser-addon/releases/tag/v0.4) - 2019-10-04
### Bug Fixes
- Fix wrong icon
- Fix wrong icon
## [v0.3](https://gitea.usrspace.at/XimeX/usrspace-browser-addon/releases/tag/v0.3) - 2019-10-04
### Other
- Improve popup content
- Improve popup content
## [v0.2](https://gitea.usrspace.at/XimeX/usrspace-browser-addon/releases/tag/v0.2) - 2019-08-28
### Bug Fixes
- Fix icon style
- Fix compatibility with chromium based browsers
- Fix typo
### Other
- Init
- Add first readme
- Add LICENSE and improve README
@ -183,5 +191,4 @@ All notable changes to this project will be documented in this file.
- Combine updateBadge promises
- Check for online/offline events if fetching should be enabled
<!-- generated by git-cliff -->

View File

@ -6,6 +6,7 @@
[![Mozilla Add-on](https://img.shields.io/amo/stars/usr-space?style=for-the-badge)](https://addons.mozilla.org/de/firefox/addon/usr-space/)
## Features
- Show if someone is in the Space
- Looks for connected dynamic IPs (DHCP) (provided by backend)
- Refreshes every 5min
@ -13,6 +14,7 @@
- Quick-Links (Homepage, Wiki, Gitea, Nextcloud)
## Install
```ssh
$ git clone https://gitea.usrspace.at/XimeX/usrspace-browser-addon.git
$ npm i -g web-ext
@ -20,6 +22,7 @@ $ npm i
```
## Run / Develop / Debug
```ssh
$ npm run watch:{firefox|firefox-android|chromium}
```
@ -27,6 +30,7 @@ $ npm run watch:{firefox|firefox-android|chromium}
If more options are needed add them after a `--`.
Some useful options:
- `--devtools`
- `--firefox-apk=...`
- `--android-device=...`
@ -34,6 +38,7 @@ Some useful options:
Example: `npm run watch:firefox-android -- --firefox-apk=org.mozilla.fenix --firefox-device=XXXXXXXX`
## Build
```ssh
// For Firefox
$ npm run build:firefox
@ -42,18 +47,22 @@ $ 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

View File

@ -16,11 +16,11 @@ body = """
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
### {{ group | upper_first }}\n
{% for commit in commits %}\
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first | trim_end }}
{% endfor %}\
{% endfor %}\n\n
{% endfor %}\n
"""
# remove the leading and trailing whitespace from the template
trim = true

View File

@ -18,13 +18,13 @@
}
:root {
--light-blue: #2AA1BF;
--dark-blue: #095C81;
--light-color: #0C0C0C;
--dark-color: #FFFFFF;
--light-background: #F9F9F9;
--dark-background: #4A4A4A;
--light-code-background: #EBEBEB;
--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;
}
@ -75,7 +75,9 @@ svg {
cursor: pointer;
}
#state > svg, #calendar > .calendar-entry > svg, #calendar > .calendar-entry strong {
#state > svg,
#calendar > .calendar-entry > svg,
#calendar > .calendar-entry strong {
margin-right: 8px;
}
#calendar > .calendar-entry {