These versions are probably not really used by anything, but it is still
nice if they are up to date.
Signed-off-by: Wouter Born <github@maindrain.net>
#1380 introduced new code with ES6 syntax (arrow functions) that isn't supported in older browsers.
See https://github.com/openhab/openhab-webui/pull/1380#issuecomment-1166344112
Reimplement using the code from the selection widget to determine the option
(uses angularJS helpers)
Signed-off-by: Yannick Schaus <github@schaus.net>
* Add color picking to dummy and clock widget
* Add state description option to dummy widget
Closes: #1349Closes: #1293Closes: #1294
Signed-off-by: Bastiaan van Haastrecht <b.vanhaastrecht@gmail.com>
This feature is deprecated in OH3 but code remains which would break if `$rootScope.configWidgets` is left undefined.
So define it as an empty object early.
Fixes#733.
Signed-off-by: Yannick Schaus <github@schaus.net>
This adds support for the "OHApp" mobile app interface to HABPanel, and
fixes setting the main UI's dark mode by the app.
They will also call OHApp.goFullscreen()
on startup if the function exists.
Currently supported in the OHApp interface:
```js
window.OHApp = {
preferDarkMode() { return 'light' },
preferTheme() { return 'md' },
pinToHome() { alert('pinned') },
exitToApp() { alert('exit') }
goFullscreen() { console.log('Going fullscreen') }
}
```
Signed-off-by: Yannick Schaus <github@schaus.net>
This PR moves the storage backend for HABPanel's panel registry
from the service configuration to the "habpanel:panelconf" UI
components namespace, so they're accessible without authorization.
The panel registry object format is converted back and forth to
the UI components format during loading/saving.
To save, it tries to find a refresh token from the main UI stored
in LocalStorage and uses it to get access tokens - a new access
token is requested for each save. Whether or not implementing a
complete OAuth2 authorization code flow (given the refresh token
if there for use as it's the same origin as the main UI, and users
can be taught to first sign in with the main UI to be able to edit
HABPanel) can be debated and is still t.b.d.
(The code to load the configuration with the service config, like
in OH2, has been left but it is not loaded. It will also work
because it tries to get access tokens as well.)
The other options that were formally in the service configuration
have been changed as well:
- the "initial panel configuration" is now a "default"/"starred"
flag on the panel configuration itself, it can be set within
HABPanel itself (the "star" icon after the panel config name in
Settings), only one should normally be starred at any given time,
but it's not enforced - it's the admin responsibility to ensure
that.
- the "lock editing" is now tied to the presence of the refresh
token; this means, signing out in the main UI will automatically
disable the editing features in HABPanel because there's no more
possibility to get an access token to save.
Similarly, the locale is taken from /rest/ instead of the i18n
service directly.
Some missing translations have been added and some changed.
Signed-off-by: Yannick Schaus <github@schaus.net>
Include a new complete Japanese translation (thanks to koui), and partial translations and fixes in Afrikaans, Arabic, Bulgarian, Korean, Lithuanian, Ukrainian.
Signed-off-by: Yannick Schaus <github@schaus.net>
This change broadcasts the 'openhab-update' event immediately, not waiting for
the result of the /rest/items request, if the items are already populated, when
OHService.reloadItems() is called. This improves the dashboard switching latency
significantly at the expanse of reliability - some widgets (e.g. slider) might
'flicker' slighly.
Signed-off-by: Yannick Schaus <github@schaus.net>