From 0d114ca72840588578d5714e273efea54c9fd8e6 Mon Sep 17 00:00:00 2001 From: brindosch Date: Thu, 8 Dec 2016 23:39:41 +0100 Subject: [PATCH] localStorage for i18n/access (#318) * upd * upd * . * enumtr * cleanup * upd * update js * update html * hide buttons, if browser not comp, fix typo [skip ci] * fix empty effect name --- assets/webconfig/content/colors.html | 7 +- assets/webconfig/content/effects.html | 6 +- .../content/effects_configurator.html | 2 - assets/webconfig/content/grabber.html | 7 +- assets/webconfig/content/kodiconf.html | 10 +- assets/webconfig/content/leds.html | 51 ++++---- assets/webconfig/content/network.html | 9 +- assets/webconfig/content/webconfig.html | 15 +++ assets/webconfig/i18n/de.json | 18 ++- assets/webconfig/i18n/en.json | 18 ++- assets/webconfig/index.html | 15 ++- .../js/content_effectsconfigurator.js | 105 ++++++++-------- assets/webconfig/js/content_index.js | 7 +- assets/webconfig/js/content_leds.js | 44 ++++--- assets/webconfig/js/content_webconfig.js | 19 +++ assets/webconfig/js/lib/jsoneditor.js | 9 ++ assets/webconfig/js/localStorage.js | 119 ++++++++++++++++++ assets/webconfig/js/ui_utils.js | 31 +++-- libsrc/hyperion/hyperion.schema.json | 4 + libsrc/jsonserver/JsonClientConnection.cpp | 6 + .../utils/jsonschema/QJsonSchemaChecker.cpp | 2 +- 21 files changed, 353 insertions(+), 151 deletions(-) create mode 100644 assets/webconfig/content/webconfig.html create mode 100644 assets/webconfig/js/content_webconfig.js create mode 100644 assets/webconfig/js/localStorage.js diff --git a/assets/webconfig/content/colors.html b/assets/webconfig/content/colors.html index 30ff1e4b..46c8557c 100644 --- a/assets/webconfig/content/colors.html +++ b/assets/webconfig/content/colors.html @@ -7,11 +7,8 @@

Color calibration, smoothing (color transistions) and detection of blackbars.


-
-
- -
- +
+
diff --git a/assets/webconfig/content/effects.html b/assets/webconfig/content/effects.html index 1bcd7b6d..beff7e8f 100644 --- a/assets/webconfig/content/effects.html +++ b/assets/webconfig/content/effects.html @@ -6,10 +6,8 @@

Setting up a booteffect/color that is visible after Hyperion startup. Configure a background effect/color which is active, when all capture sources are disabled (also temporarily via Kodi Watch)


-
-
- -
+
+ diff --git a/assets/webconfig/content/effects_configurator.html b/assets/webconfig/content/effects_configurator.html index 7b3562bc..4a4e4a57 100644 --- a/assets/webconfig/content/effects_configurator.html +++ b/assets/webconfig/content/effects_configurator.html @@ -6,7 +6,6 @@

Create out of the base effects new effects that are tuned to your liking. Depending on Effect there are options like color, speed, direction and more available.


-
@@ -35,7 +34,6 @@
-
diff --git a/assets/webconfig/content/grabber.html b/assets/webconfig/content/grabber.html index a089ed76..a3adf492 100644 --- a/assets/webconfig/content/grabber.html +++ b/assets/webconfig/content/grabber.html @@ -7,11 +7,8 @@

Hyperion supports two ways on how to get captured pictures for processing and output. The platform grabber which captures internal at the device you are running Hyperion on (best qualitiy) and the USB Grabber which gathers from a connected device the necessary pictures (more calibration work and configuration).


-
-
- -
- +
+
diff --git a/assets/webconfig/content/kodiconf.html b/assets/webconfig/content/kodiconf.html index 886cc1d9..f62458d9 100644 --- a/assets/webconfig/content/kodiconf.html +++ b/assets/webconfig/content/kodiconf.html @@ -10,14 +10,10 @@ HINT 1: In any case you need to enable the remote control for Kodi. Please checkout Wiki for instructions. LINK
HINT 2: If you just use a USB-Grabber you could enable the Kodi Watch for this separately at the USB-Grabber page. - -
-
- -
- +
+
- \ No newline at end of file + diff --git a/assets/webconfig/content/leds.html b/assets/webconfig/content/leds.html index ee7823d9..b2a4a57e 100644 --- a/assets/webconfig/content/leds.html +++ b/assets/webconfig/content/leds.html @@ -98,14 +98,31 @@
- +
+ +
+
+

This textfield shows by default your current loaded layout and will be overwritten if you generate a new one above. Optional you could perform further edits.

+

Don't forget to save!

+ +
+ +
+
-
+
@@ -218,21 +235,21 @@
- +
LEDs
- +
LEDs
- +
@@ -267,24 +284,6 @@
-
- -
-
-

This textfield shows by default your current loaded layout and will be overwritten if you generate a new one above. Optional you could perform further edits.

-

Don't forget to save!

- -
- -
-
@@ -293,7 +292,7 @@

LED Layout preview

-
No preview requested
+
diff --git a/assets/webconfig/content/network.html b/assets/webconfig/content/network.html index d34fd2f1..eb2b3d33 100644 --- a/assets/webconfig/content/network.html +++ b/assets/webconfig/content/network.html @@ -1,4 +1,3 @@ -
@@ -7,14 +6,10 @@

All network based settings are listed here.


-
-
- -
- +
+
- diff --git a/assets/webconfig/content/webconfig.html b/assets/webconfig/content/webconfig.html new file mode 100644 index 00000000..2d81b0fd --- /dev/null +++ b/assets/webconfig/content/webconfig.html @@ -0,0 +1,15 @@ +
+
+
+ +
+

Webinterface settings. Edit wisely

+
+
+
+ +
+
+
+ + diff --git a/assets/webconfig/i18n/de.json b/assets/webconfig/i18n/de.json index 9247882e..97d6c895 100644 --- a/assets/webconfig/i18n/de.json +++ b/assets/webconfig/i18n/de.json @@ -17,6 +17,8 @@ "general_country_nl" : "Niederlande", "general_speech_de" : "Deutsch", "general_speech_en" : "Englisch", + "general_access_default" : "Standard", + "general_access_expert" : "Experte", "general_comp_SMOOTHING" : "Glättung", "general_comp_BLACKBORDER" : "Schwarze Balken Erkennung", "general_comp_KODICHECKER" : "Kodi Überwachung", @@ -26,6 +28,9 @@ "general_comp_GRABBER" : "Plattform Aufnahme", "general_comp_V4L" : "USB Aufnahme", "general_button_savesettings" : "Einstellungen speichern", + "general_btn_ok" : "OK", + "general_btn_abort" : "Abbrechen", + "general_btn_save" : "Speichern", "dashboard_label_intro" : "Das Dashboard zeigt dir Informationen zum Systemstatus, ob Updates verfügbar sind, den Komponentenstatus sowie die letzten Blog-Posts vom Hyperion Team.", "dashboard_infobox_label_title" : "Information", "dashboard_infobox_label_currenthyp" : "Deine Hyperion Version:", @@ -55,6 +60,7 @@ "main_menu_system_token" : "System", "main_menu_input_selection_token" : "Eingabeauswahl", "main_menu_logging_token" : "Protokoll", + "main_menu_webconfig_token" : "Webkonfiguration", "conf_effects_label_intro" : "Stelle einen Effekt oder Farbe ein, der beim Starten sichtbar sein soll. Stelle einen Hintergrundeffekt/Farbe ein der erst sichtbar wird, wenn alle Bildquellen abgeschaltet sind (Das gilt ebenfalls für temporäres abschalten mithilfe der Kodi Überwachung).", "conf_leds_label_intro" : "Der LED Hardware Bereich ermöglicht eine Vielzahl von Ausgabemöglichkeiten über Raspberry Pi GPIO, USB oder Netzwerk. Erstelle ein LED Layout das zu deinem Aufbau passt und schon kann es losgehen!", "conf_leds_nav_label_ledcontroller" : "LED Steuerung", @@ -78,7 +84,6 @@ "conf_leds_layout_preview_originTEXT" : "Erstellt von: Textfeld", "conf_leds_layout_preview_originMA" : "Erstellt von: Matrix Layout (LED Wand)", "conf_leds_layout_preview_totalleds" : "LEDs gesamt: $1", - "conf_leds_layout_preview_empty" : "Es wurde keine Vorschau angefordert", "conf_leds_layout_cl_top" : "Oben", "conf_leds_layout_cl_bottom" : "Unten", "conf_leds_layout_cl_left" : "Links", @@ -105,7 +110,7 @@ "conf_leds_layout_ma_opttopright" : "Oben rechts", "conf_leds_layout_ma_optbottomleft" : "Unten links", "conf_leds_layout_ma_optbottomright" : "Unten rechts", - "conf_leds_layout_textf1" : "Das Textfeld zeigt dir dein aktuell geladenes Layout, sofern du kein neues Layout mit den Optionen oben erstellt hast. Optional kann man die Werte hier weiter bearbeiten.", + "conf_leds_layout_textf1" : "Das Textfeld zeigt dir dein aktuell geladenes Layout, sofern du kein neues Layout mit den Optionen unten erstellt hast. Optional kann man die Werte hier weiter bearbeiten.", "conf_leds_layout_textf2" : "Vergiss nicht zu speichern!", "conf_leds_test_button_toggleleds" : "LEDs", "conf_leds_test_button_togglelednumber" : "LED Nummerierung", @@ -118,6 +123,7 @@ "conf_logging_label_intro" : "Überprüfe die Meldungen im Prokotoll um zu erfahren was Hyperion gerade beschäftigt. Je nach eingestellter Protokoll-Stufe siehst du mehr oder weniger Informationen.", "conf_logging_btn_pbupload" : "Protokoll hochladen", "conf_logging_btn_autoscroll" : "Automatisch scrollen", + "conf_webconfig_label_intro" : "Einstellungen zur Webkonfiguration. Änderungen können die Erreichbarkeit des Webinterfaces beeinflussen.", "remote_label_intro" : "Die Fernbedienung ermöglicht dir während Hyperion läuft Farbe/Effekte zu starten/setzen, aber auch eine Quelle manuell festzulegen. Die Komponentensteuerung ermöglicht es dir gezielt Teile von Hyperion zu aktivieren/deaktivieren. Beachte, dass nach einem Neustart die hier durchgeführten Aktionen wieder zurückgesetzt werden.", "remote_colors_label_coloreffect" : "Farbe/Effekt:", "remote_colors_button_reset" : "Farbe/Effekt zurücksetzen", @@ -128,7 +134,7 @@ "remote_components_label_components" : "Komponentensteuerung", "remote_optgroup_usreffets" : "Benutzer Effekte", "remote_optgroup_syseffets" : "Mitgelieferte Effekte", - "remote_help_text" : "Hyperion nutzt ein Prioritätensystem um die Quelle zu wählen. Alles was du setzte hat eine Prioität (Effekte/Farben/Plattform Capture/USB Capture und Netzwerkquellen). Standartmäßig nutzt Hyperion die Quelle mit der niedrigsten Prioität. Hier hast du die Möglichkeit die Quelle manuell auszuwählen.", + "remote_help_text" : "Hyperion nutzt ein Prioritätensystem um die Quelle zu wählen. Alles was du setzte hat eine Prioität (Effekte/Farben/Plattform Capture/USB Capture und Netzwerkquellen). Standartmäßig nutzt Hyperion die Quelle mit der niedrigsten Prioität. Hier hast du die Möglichkeit die Quelle manuell auszuwählen.", "hue_button_create_user_token" : "Benutzer anlegen", "hue_press_link_modal" : "Bitte Link Taste auf der Hue Bridge drücken.", "hue_failure_connection_token" : "Connection Timeout. Bitte drücke die Taste rechtzeitig.", @@ -137,7 +143,7 @@ "hue_failure_ip_token" : "Bitte überprüfe deine IP Adresse.", "hue_label_username" : "Benutzername:", "hue_label_ip" : "Hue Bridge IP:", - "hue_help_text" : "Mit diesem Setupassistenten kannst du einen neuen User auf der Hue Bridge anlegen und deine LightIDs für die Hyperion Konfiguration herausfinden. Wenn du bereits einen eingetragenen User hast, siehst du diesen bereits untenstehend eingetragen. Du kannst allerdings jederzeit einen neuen Anlegen. Beachte: Dies ist nur ein Assistent. Du musst die Daten in die Konfiguration kopieren.", + "hue_help_text" : "Mit diesem Setupassistenten kannst du einen neuen User auf der Hue Bridge anlegen und deine LightIDs für die Hyperion Konfiguration herausfinden. Wenn du bereits einen eingetragenen User hast, siehst du diesen bereits untenstehend eingetragen. Du kannst allerdings jederzeit einen neuen Anlegen. Beachte: Dies ist nur ein Assistent. Du musst die Daten in die Konfiguration kopieren.", "effectsconfigurator_label_intro" : "Erstelle auf Grundlage der Basiseffekte neue Effekt die nach deinen Wünschen angepasst sind. Je nach Effekt stehen Optionen wie Farbe, Geschwindigkeit, oder Richtung und vieles mehr zur Auswahl.", "effectsconfigurator_label_chooseeff" : "Basis-Effekt auswählen:", "effectsconfigurator_button_saveeffect" : "Effekt speichern", @@ -190,6 +196,10 @@ "infoDialog_effconf_created_text" : "Der Effekt $1 wurde erfolgreich erstellt!", "infoDialog_effconf_invalidvalue_title" : "Fehlerhafte Werte!", "infoDialog_effconf_invalidvalue_text" : "Es wurden unzulässige Werte eingetragen, überprüfe das rot markierte Feld und versuche es erneut!", + "InfoDialog_lang_title" : "Spracheinstellung", + "InfoDialog_lang_text" : "Sollte dir die Vorauswahl der automatischen Spracherkennung nicht gefallen, kannst du die Sprache hier manuell festlegen.", + "InfoDialog_access_title" : "Zugriffsstufe", + "InfoDialog_access_text" : "Abhängig von der Stufe hast du Zugriff auf mehr oder weniger Einstellungen. Empfohlen ist 'Standard'.", "edt_dev_general_heading_title" : "Allgemeine Einstellungen", "edt_dev_general_name_title" : "Name der Konfiguration", "edt_dev_general_ledCount_title" : "Anzahl Hardware LEDs", diff --git a/assets/webconfig/i18n/en.json b/assets/webconfig/i18n/en.json index 2c1c2d04..1e390224 100644 --- a/assets/webconfig/i18n/en.json +++ b/assets/webconfig/i18n/en.json @@ -17,6 +17,8 @@ "general_country_nl" : "Netherlands", "general_speech_de" : "German", "general_speech_en" : "English", + "general_access_default" : "Default", + "general_access_expert" : "Expert", "general_comp_SMOOTHING" : "Smoothing", "general_comp_BLACKBORDER" : "Blackbar Detection", "general_comp_KODICHECKER" : "Kodi Watch", @@ -26,6 +28,9 @@ "general_comp_GRABBER" : "Platform Capture", "general_comp_V4L" : "USB Capture", "general_button_savesettings" : "Save settings", + "general_btn_ok" : "OK", + "general_btn_abort" : "Abort", + "general_btn_save" : "Save", "dashboard_label_intro" : "The dashboard give you a quick overview about the status of Hyperion and show you the latest news of the Hyperion Blog.", "dashboard_infobox_label_title" : "Information", "dashboard_infobox_label_currenthyp" : "Your Hyperion version:", @@ -55,6 +60,7 @@ "main_menu_system_token" : "System", "main_menu_input_selection_token" : "Eingabeauswahl", "main_menu_logging_token" : "Log", + "main_menu_webconfig_token" : "Webconfiguration", "conf_effects_label_intro" : "Setting up a booteffect/color that is visible after Hyperion startup. Configure a background effect/color which is active, when all capture sources are disabled (also temporarily via Kodi Watch)", "conf_leds_label_intro" : "The LED controller of youre choice is your way to output the led data via Raspberry PI GPIO, USB or network! Choose one, define your led layout and enjoy the light!", "conf_leds_nav_label_ledcontroller" : "LED Controller", @@ -78,7 +84,6 @@ "conf_leds_layout_preview_originTEXT" : "Created from: Textfield", "conf_leds_layout_preview_originMA" : "Created from: Matrix Layout(LED wall)", "conf_leds_layout_preview_totalleds" : "Totel LEDs: $1", - "conf_leds_layout_preview_empty" : "Es wurde keine Vorschau angefordert", "conf_leds_layout_cl_top" : "Top", "conf_leds_layout_cl_bottom" : "Bottom", "conf_leds_layout_cl_left" : "Left", @@ -105,7 +110,7 @@ "conf_leds_layout_ma_opttopright" : "Top right", "conf_leds_layout_ma_optbottomleft" : "Bottom left", "conf_leds_layout_ma_optbottomright" : "Bottom right", - "conf_leds_layout_textf1" : "This textfield shows by default your current loaded layout and will be overwritten if you generate a new one above. Optional you could perform further edits.", + "conf_leds_layout_textf1" : "This textfield shows by default your current loaded layout and will be overwritten if you generate a new one with the options below. Optional you could perform further edits.", "conf_leds_layout_textf2" : "Don't forget to save!", "conf_leds_test_button_toggleleds" : "toggle leds", "conf_leds_test_button_togglelednumber" : "toggle led numbers", @@ -118,6 +123,7 @@ "conf_logging_label_intro" : "Area to check log messages, depending on loglevel setting you see more or less information.", "conf_logging_btn_pbupload" : "Upload log", "conf_logging_btn_autoscroll" : "Auto scrolling", + "conf_webconfig_label_intro" : "Webconfiguration settings. Edit wisely.", "remote_label_intro" : "Set an effect/color. You could also select a source manually. The Components control give the opportunity to enable/disable components of Hyprion during runtime. All changes you made here are lost after a restart.", "remote_colors_label_coloreffect" : "Colors/Effects", "remote_colors_button_reset" : "Reset Color/Effect", @@ -128,7 +134,7 @@ "remote_components_label_components" : "Components control", "remote_optgroup_usreffets" : "User Effects", "remote_optgroup_syseffets" : "Provided Effects", - "remote_help_text" : "Hyperion uses a priority system to select a source. Everything you set has a priority (Effect/Color/Platform capture/USB capture and network sources). By default, Hyperion select sources depending on priority (lowest number reflects the current active source). Now you have the opportunity to select sources on your own.", + "remote_help_text" : "Hyperion uses a priority system to select a source. Everything you set has a priority (Effect/Color/Platform capture/USB capture and network sources). By default, Hyperion select sources depending on priority (lowest number reflects the current active source). Now you have the opportunity to select sources on your own.", "hue_button_create_user_token" : "Create User", "hue_press_link_modal" : "Please press link button on the Hue Bridge.", "hue_failure_connection_token" : "Connection Timeout. Please press the button in time.", @@ -137,7 +143,7 @@ "hue_failure_ip_token" : "Please check your IP Address.", "hue_label_username" : "Hue Bridge Username", "hue_label_ip" : "Hue Bridge IP:", - "hue_help_text" : "With this Setup Helper you can get a new User for your Hue Bridge and you can see your Lights with the IDs for Hyperion Configuration. If you already have a working User you will see it below. But you can always create a new one as well. Remember: This is only a helper. You have to copy and paste them in your config above.", + "hue_help_text" : "With this Setup Helper you can get a new User for your Hue Bridge and you can see your Lights with the IDs for Hyperion Configuration. If you already have a working User you will see it below. But you can always create a new one as well. Remember: This is only a helper. You have to copy and paste them in your config above.", "effectsconfigurator_label_intro" : "Create out of the base effects new effects that are tuned to your liking. Depending on Effect there are options like color, speed, direction and more available.", "effectsconfigurator_label_chooseeff" : "Choose Base-Effect:", "effectsconfigurator_button_saveeffect" : "Save Effect", @@ -190,6 +196,10 @@ "infoDialog_effconf_created_text" : "The effect $1 has been created successfully!", "infoDialog_effconf_invalidvalue_title" : "INVALID VALUE(S)", "infoDialog_effconf_invalidvalue_text" : "Please check for red marked input(s) and try again!", + "InfoDialog_lang_title" : "Language setting", + "InfoDialog_lang_text" : "If you don't like the result of the automatic language detection you could overwrite it here.", + "InfoDialog_access_title" : "Level setting", + "InfoDialog_access_text" : "Depending on settings level you could change more or less settings. Recommended is the default level.", "edt_dev_general_heading_title" : "General Settings", "edt_dev_general_name_title" : "Configuration name", "edt_dev_general_ledCount_title" : "Count of all hardware LEDs", diff --git a/assets/webconfig/index.html b/assets/webconfig/index.html index dbe7339f..fb2ec737 100644 --- a/assets/webconfig/index.html +++ b/assets/webconfig/index.html @@ -88,6 +88,16 @@