diff --git a/assets/webconfig/content/effects.html b/assets/webconfig/content/effects.html index 4f3002e9..be45f63c 100644 --- a/assets/webconfig/content/effects.html +++ b/assets/webconfig/content/effects.html @@ -6,8 +6,54 @@

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)


-
- +
+
+
+
Effect Paths
+
+
+
+ +
+
+
+
+
+
+
+
+
+
Kodi Watch
+
+
+
+ +
+
+
+
+
+
+
+
+
+
Kodi Watch
+
+
+
+ +
+
+
+
+
+
diff --git a/assets/webconfig/content/general.html b/assets/webconfig/content/general.html index e752ef65..29e1e686 100644 --- a/assets/webconfig/content/general.html +++ b/assets/webconfig/content/general.html @@ -1,13 +1,27 @@
- +


-
- +
+
+
+
General
+
+
+
+ +
+
+
+
+
+
diff --git a/assets/webconfig/content/grabber.html b/assets/webconfig/content/grabber.html index 0b72c94a..cd3b6932 100644 --- a/assets/webconfig/content/grabber.html +++ b/assets/webconfig/content/grabber.html @@ -22,8 +22,7 @@
-
-
+
Kodi Watch
diff --git a/assets/webconfig/content/webconfig.html b/assets/webconfig/content/webconfig.html index 099d6804..fcb42dc4 100644 --- a/assets/webconfig/content/webconfig.html +++ b/assets/webconfig/content/webconfig.html @@ -6,8 +6,22 @@

Webinterface settings. Edit wisely


-
- +
+
+
+
webconfig
+
+
+
+ +
+
+
+
+
+
diff --git a/assets/webconfig/css/hyperion.css b/assets/webconfig/css/hyperion.css index fa34238e..6acd40d8 100644 --- a/assets/webconfig/css/hyperion.css +++ b/assets/webconfig/css/hyperion.css @@ -29,7 +29,8 @@ table.borderless td,table.borderless th{border: none !important;} .navbar-brand{padding: 5px;padding-left:20px;height:60px;} .sidebar{margin-top:61px;padding-top:20px;} .dropdown{font-size:18px;} -@media (max-width: 767px) {.sidebar{margin-top:0px;padding-top:0px !important;} .introd{display:none}} +@media (max-width: 767px) {.sidebar{margin-top:0px;padding-top:0px !important;}} +@media (max-width: 1000px) {.introd{display:none}} .page-header{margin-top:15px;} /*Panels*/ @@ -105,7 +106,8 @@ table.borderless td,table.borderless th{border: none !important;} @media (min-width: 1500px) { .col-xxl-1, .col-xxl-2, .col-xxl-3, .col-xxl-4, .col-xxl-5, .col-xxl-6, .col-xxl-7, .col-xxl-8, .col-xxl-9, .col-xxl-10, .col-xxl-11, .col-xxl-12 { float: left; - padding:0 15px; + padding-left:15px; + padding-right:15px; } .col-xxl-12 { width: 100%; diff --git a/assets/webconfig/i18n/de.json b/assets/webconfig/i18n/de.json index b73a9191..11b7a0d7 100644 --- a/assets/webconfig/i18n/de.json +++ b/assets/webconfig/i18n/de.json @@ -27,10 +27,15 @@ "general_comp_BOBLIGHTSERVER" : "Boblight Server", "general_comp_GRABBER" : "Plattform Aufnahme", "general_comp_V4L" : "USB Aufnahme", + "general_col_red" : "rot", + "general_col_green" : "grün", + "general_col_blue" : "blau", "general_button_savesettings" : "Einstellungen speichern", "general_btn_ok" : "OK", - "general_btn_abort" : "Abbrechen", + "general_btn_cancel" : "Abbrechen", + "general_btn_continue" : "Fortfahren", "general_btn_save" : "Speichern", + "general_btn_saverestart" : "Speichern und neustarten", "general_btn_restarthyperion" : "Hyperion neustarten", "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", @@ -62,8 +67,8 @@ "main_menu_input_selection_token" : "Eingabeauswahl", "main_menu_logging_token" : "Protokoll", "main_menu_webconfig_token" : "Web konfiguration", - "conf_general_label_title" : "All Einstellungen", - "conf_general_label_intro" : " ", + "conf_general_label_title" : "Allgemeine Einstellungen", + "conf_general_label_intro" : "Grundsätzliche Einstellungen zu Hyperion oder WebUI, die in keine andere Kategorie passen.", "conf_helptable_option" : "Option", "conf_helptable_expl" : "Erklärung", "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).", @@ -200,20 +205,28 @@ "infoDialog_leds_gap_text" : "Deine LED Lücke/Position ist größer als die Anzahl der LEDs, verringere die Lückenposition und/oder Lückenlänge!", "InfoDialog_leds_validfail_title" : "JSON Überprüfung fehlgeschlagen!", "infoDialog_effconf_deleted_title" : "Effekt entnfernt!", - "infoDialog_effconf_deleted_text" : "Der Effekt $1 wurde erfolgreich entfernt!", + "infoDialog_effconf_deleted_text" : "Der Effekt \"$1\" wurde erfolgreich entfernt!", "infoDialog_effconf_created_title" : "Effekt erstellt!", - "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_effconf_created_text" : "Der Effekt \"$1\" wurde erfolgreich erstellt!", + "infoDialog_effconf_invalidvalue_title" : "Fehlerhafter Wert!", + "infoDialog_effconf_invalidvalue_text" : "Es wurde ein unzulässiger Wert 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_general_heading_title" : "Allgemeine Einstellungen", - "edt_general_name_title" : "Name der Konfiguration", "InfoDialog_nowrite_title" : "Fehler beim Schreibzugriff!", "InfoDialog_nowrite_text" : "Hyperion hat keinen Schreibzugriff auf die aktuell geladene Konfiguration. Bitte korrigiere die Dateizugriffsrechte um fortzufahren.", "InfoDialog_nowrite_foottext" : "Die Webkonfiguration wird automatisch wieder freigegeben, sobald das Problem behoben wurde!", + "infoDialog_wizrgb_title" : "Erfolg!", + "infoDialog_wizrgb_text" : "Deine RGB Byte Reihenfolge ist bereits richtig eingestellt.", + "wiz_rgb_title" : "RGB Byte Reihenfolge Assistent", + "wiz_rgb_intro1" : "Dieser Assisent wird dir dabei helfen die richtige Byte Reihenfolge für deine leds zu finden. Klicke auf Fortfahren um zu beginnen.", + "wiz_rgb_intro2" : "Wann benötigt man diesen Assistenten? Zur Erstkonfiguration oder wenn deine LEDs zb rot leuchten sollten, sie aber blau oder grün sind.", + "wiz_rgb_expl" : "Der Farbpunkt ändert alle x Sekunden die Farbe (rot, grün), zur selben Zeit ändern deine LEDs die Farbe ebenfalls. Beantworte die Fragen unten, um deine RGB Byte Reihenfolge zu überprüfen/korrigieren.", + "wiz_rgb_switchevery" : "Ändere Farbe alle...", + "wiz_rgb_q" : "Welche Farbe haben deine LEDs, wenn der Farbpunkt oben...", + "wiz_rgb_qrend" : "...rot ist?", + "wiz_rgb_qgend" : "...grün ist?", "edt_dev_general_heading_title" : "Allgemeine Einstellungen", "edt_dev_general_ledCount_title" : "Anzahl Hardware LEDs", "edt_dev_general_colorOrder_title" : "RGB Byte Reihenfolge", @@ -268,7 +281,39 @@ "edt_conf_general_priority_expl" : "Die Priorität dieser Komponente.", "edt_conf_general_port_title" : "Port", "edt_conf_general_port_expl" : "Der genutzte Port.", + "edt_conf_enum_color" : "Farbe", + "edt_conf_enum_effect" : "Effekt", + "edt_conf_enum_multicolor_mean" : "Mehrfarbig", + "edt_conf_enum_unicolor_mean" : "Einfarbig", + "edt_conf_enum_rgb" : "RGB", + "edt_conf_enum_bgr" : "BGR", + "edt_conf_enum_rbg" : "RBG", + "edt_conf_enum_brg" : "BRG", + "edt_conf_enum_gbr" : "GBR", + "edt_conf_enum_grb" : "GRB", + "edt_conf_enum_linear" : "Linear", + "edt_conf_enum_PAL" : "PAL", + "edt_conf_enum_NTSC" : "NTSC", + "edt_conf_gen_heading_title" : "Allgemeine Einstellungen", + "edt_conf_gen_name_title" : "Name der Konfiguration", + "edt_conf_gen_name_expl" : "Der Name wird verwendet, um Hyperion besser zu identifizieren. (Hilfreich bei mehreren Instanzen)", + "edt_conf_gen_showOptHelp_title" : "Zeige Erklärungen", + "edt_conf_gen_showOptHelp_expl" : "Zeige alle verfügbaren Options-Erklärungen. Empfohlen für Anfänger", "edt_conf_color_heading_title" : "Farbkalibrierung", + "edt_conf_color_channelAdjustment_header_title" : "Anpassung Farbkanäle", + "edt_conf_color_imageToLedMappingType" : "Bild2LED Zuordnungstyp", + "edt_conf_color_channelAdjustment_enable" : "Aktiviere Farbkanalanpassung", + "edt_conf_color_channelAdjustment_v4l_only" : "Nur für USB Aufnahme", + "edt_conf_color_id" : "ID", + "edt_conf_color_leds" : "LED index", + "edt_conf_color_black" : "Schwarz", + "edt_conf_color_white" : "Weiß", + "edt_conf_color_red" : "Rot", + "edt_conf_color_green" : "Grün", + "edt_conf_color_blue" : "Blau", + "edt_conf_color_cyan" : "Cyan", + "edt_conf_color_magenta" : "Magenta", + "edt_conf_color_yellow" : "Gelb", "edt_conf_smooth_heading_title" : "Glättung", "edt_conf_smooth_type_title" : "Art", "edt_conf_smooth_type_expl" : "Algorithmus der Glättung.", @@ -355,6 +400,16 @@ "edt_conf_kodic_grabScreensaver_expl" : "Wenn aktiviert, ist die Aufnahme aktiv während Kodi pausiert (Video, Musik, Diashow).", "edt_conf_kodic_enable3DDetection_title" : "Erkenne 3D", "edt_conf_kodic_enable3DDetection_expl" : "Wenn aktiviert, erkenne und wende den passenden 3D Modus an. (kein MVC und nicht für USB Aufnahme)", + "edt_conf_fge_heading_title" : "Start Effekt/Farbe", + "edt_conf_fge_type_title" : "Typ", + "edt_conf_fge_type_expl" : "Wähle zwischen einem Effekt oder einer Farbe.", + "edt_conf_fge_color_title" : "Farbe", + "edt_conf_fge_color_expl" : "Sofern der Typ \"Farbe\" ist, stelle hier eine Farbe deiner Wahl sein.", + "edt_conf_fge_effect_title" : "Effekt", + "edt_conf_fge_effect_expl" : "Sofern der Typ \"Effekt\" ist, wähle hier einen Effekt deiner Wahl. (Gilt auch für selbst erstellte)", + "edt_conf_fge_duration_ms_title" : "Dauer", + "edt_conf_fge_duration_ms_expl" : "Dauer des Effekts/Farbe beim Hyperion Start.", + "edt_conf_bge_heading_title" : "Hintergrund Effekt/Farbe", "edt_conf_fw_heading_title" : "Weiterleitung", "edt_conf_fw_json_title" : "Liste von Json zielen", "edt_conf_fw_json_expl" : "Ein Json Ziel pro Zeile. Bestehend aus IP:PORT (Beispiel: 127.0.0.1:19446)", @@ -372,6 +427,7 @@ "edt_conf_webc_heading_title" : "Web Konfiguration", "edt_conf_webc_docroot_title" : "Verzeichnis", "edt_conf_webc_docroot_expl" : "Lokaler Pfad zum WebUI Wurzelverzeichnis (Nur für WebUI Entwickler)", + "edt_conf_effp_heading_title" : "Effekt Pfade", "edt_conf_effp_paths_title" : "Effekt Pfad(e)", "edt_conf_effp_paths_itemtitle" : "Pfad", "edt_conf_effp_disable_title" : "Deaktivierte Effekte", @@ -394,6 +450,11 @@ "edt_eff_storbe_header_title" : "Stroboskop", "edt_eff_traces_header_title" : "Farbspuren", "edt_eff_x-mas_header_title" : "Weihnachten", + "edt_eff_trails_header_title" : "Spuren", + "edt_eff_enum_all" : "Alle", + "edt_eff_enum_all-together" : "Alle zusammen", + "edt_eff_enum_list" : "LED Liste", + "edt_eff_count_title" : "Anzahl", "edt_eff_color_title" : "Farbe", "edt_eff_colorrandom_title" : "Zufällige Farbe", "edt_eff_colorone_title" : "Farbe eins", @@ -428,7 +489,6 @@ "edt_eff_enableshutdown_title" : "Echtes herunterfahren", "edt_eff_length_title" : "Länge", "edt_eff_frequency_title" : "Frequenz", - "edt_eff_tails_header_title" : "Trails", "edt_eff_min_len_title" : "Minimale Länge", "edt_eff_max_len_title" : "Maximale Länge", "edt_eff_height_title" : "Höhe", diff --git a/assets/webconfig/i18n/en.json b/assets/webconfig/i18n/en.json index 4085157d..48b6ce65 100644 --- a/assets/webconfig/i18n/en.json +++ b/assets/webconfig/i18n/en.json @@ -27,10 +27,15 @@ "general_comp_BOBLIGHTSERVER" : "Boblight Server", "general_comp_GRABBER" : "Platform Capture", "general_comp_V4L" : "USB Capture", + "general_col_red" : "red", + "general_col_green" : "green", + "general_col_blue" : "blue", "general_button_savesettings" : "Save settings", "general_btn_ok" : "OK", - "general_btn_abort" : "Abort", + "general_btn_cancel" : "Cancel", + "general_btn_continue" : "Continue", "general_btn_save" : "Save", + "general_btn_saverestart" : "Save and restart", "general_btn_restarthyperion" : "Restart Hyperion", "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", @@ -62,8 +67,8 @@ "main_menu_input_selection_token" : "Input Selection", "main_menu_logging_token" : "Log", "main_menu_webconfig_token" : "Web configuration", - "conf_general_label_title" : "General setings", - "conf_general_label_intro" : " ", + "conf_general_label_title" : "General settings", + "conf_general_label_intro" : "Basic settings around Hyperion and WebUI that don't fit into another category.", "conf_helptable_option" : "Option", "conf_helptable_expl" : "Explanation", "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)", @@ -200,20 +205,28 @@ "infoDialog_leds_gap_text" : "Your gap length/position is higher than your LED count, lower the gap length or gap position!", "InfoDialog_leds_validfail_title" : "JSON Validation failed!", "infoDialog_effconf_deleted_title" : "Effect deleted!", - "infoDialog_effconf_deleted_text" : "The effect $1 has been deleted successfully!", + "infoDialog_effconf_deleted_text" : "The effect \"$1\" has been deleted successfully!", "infoDialog_effconf_created_title" : "Effect created!", - "infoDialog_effconf_created_text" : "The effect $1 has been created successfully!", - "infoDialog_effconf_invalidvalue_title" : "INVALID VALUE(S)", + "infoDialog_effconf_created_text" : "The effect \"$1\" has been created successfully!", + "infoDialog_effconf_invalidvalue_title" : "INVALID VALUE", "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_general_heading_title" : "General Settings", - "edt_general_name_title" : "Configuration name", "InfoDialog_nowrite_title" : "write permission error!", "InfoDialog_nowrite_text" : "Hyperion can't write to your current loaded configuration file. Please repair the file permissions to proceed.", "InfoDialog_nowrite_foottext" : "The WebUI will be unlocked automatically after you solved the problem!", + "infoDialog_wizrgb_title" : "Success", + "infoDialog_wizrgb_text" : "Your RGB Byte Order is already well adjusted.", + "wiz_rgb_title" : "RGB Byte Order Wizard", + "wiz_rgb_intro1" : "This wizard will guide you through the finding process of the correct color order for your leds. Click on continue to begin.", + "wiz_rgb_intro2" : "When do you need this wizard? Example: You set the color red, but you get green or blue. You could also use it for first configuration.", + "wiz_rgb_expl" : "The color dot switches every x seconds the color (red, green), at the same time your leds switch the color too. Answer the questions at the bottom to check/correct your byte order.", + "wiz_rgb_switchevery" : "Switch color every...", + "wiz_rgb_q" : "Which color show your leds, when the color dot above shows...", + "wiz_rgb_qrend" : "...red?", + "wiz_rgb_qgend" : "...green?", "edt_dev_general_heading_title" : "General Settings", "edt_dev_general_name_title" : "Configuration name", "edt_dev_general_ledCount_title" : "Count of all hardware LEDs", @@ -269,7 +282,39 @@ "edt_conf_general_priority_expl" : "The priority of this component", "edt_conf_general_port_title" : "Port", "edt_conf_general_port_expl" : "The port that is used.", + "edt_conf_enum_color" : "Color", + "edt_conf_enum_effect" : "Effect", + "edt_conf_enum_multicolor_mean" : "Multicolor", + "edt_conf_enum_unicolor_mean" : "Unicolor", + "edt_conf_enum_rgb" : "RGB", + "edt_conf_enum_bgr" : "BGR", + "edt_conf_enum_rbg" : "RBG", + "edt_conf_enum_brg" : "BRG", + "edt_conf_enum_gbr" : "GBR", + "edt_conf_enum_grb" : "GRB", + "edt_conf_enum_linear" : "Linear", + "edt_conf_enum_PAL" : "PAL", + "edt_conf_enum_NTSC" : "NTSC", + "edt_conf_gen_heading_title" : "General Settings", + "edt_conf_gen_name_title" : "Configuration name", + "edt_conf_gen_name_expl" : "A user defined name which is used to detect Hyperion. (Helpful with more than one Hyperion instance)", + "edt_conf_gen_showOptHelp_title" : "Show explanations", + "edt_conf_gen_showOptHelp_expl" : "Show all available explanations in each section. Highly recommended for beginners!", "edt_conf_color_heading_title" : "Color Calibration", + "edt_conf_color_channelAdjustment_header_title" : "Color channel adjustments", + "edt_conf_color_imageToLedMappingType" : "Image2led mapping type", + "edt_conf_color_channelAdjustment_enable" : "Enable channel adjustment", + "edt_conf_color_channelAdjustment_v4l_only" : "Assign USB Capture only", + "edt_conf_color_id" : "ID", + "edt_conf_color_leds" : "LED index", + "edt_conf_color_black" : "black", + "edt_conf_color_white" : "white", + "edt_conf_color_red" : "red", + "edt_conf_color_green" : "green", + "edt_conf_color_blue" : "blue", + "edt_conf_color_cyan" : "cyan", + "edt_conf_color_magenta" : "magenta", + "edt_conf_color_yellow" : "yellow", "edt_conf_smooth_heading_title" : "Smoothing", "edt_conf_smooth_type_title" : "Type", "edt_conf_smooth_type_expl" : "Type of smoothing.", @@ -356,6 +401,16 @@ "edt_conf_kodic_grabScreensaver_expl" : "If checked, the capturing is enabled during screensaver, else it's disabled.", "edt_conf_kodic_enable3DDetection_title" : "Detect 3D", "edt_conf_kodic_enable3DDetection_expl" : "Detect which 3D mode Kodi is running. (no MVC and not for USB capture)", + "edt_conf_fge_heading_title" : "Boot Effect/Color", + "edt_conf_fge_type_title" : "Type", + "edt_conf_fge_type_expl" : "Choose between a color of effect.", + "edt_conf_fge_color_title" : "Color", + "edt_conf_fge_color_expl" : "If type is \"Color\", set a color of your choice here.", + "edt_conf_fge_effect_title" : "Effect", + "edt_conf_fge_effect_expl" : "If type is \"Effect\", select a effect of your choice (Also self created effects).", + "edt_conf_fge_duration_ms_title" : "Duration", + "edt_conf_fge_duration_ms_expl" : "Duration of Effect/Color during Hyperion startup.", + "edt_conf_bge_heading_title" : "Background Effect/Color", "edt_conf_fw_heading_title" : "Forwarder", "edt_conf_fw_json_title" : "List of json clients", "edt_conf_fw_json_expl" : "One json target per line. Contains IP:PORT (Example: 127.0.0.1:19446)", @@ -373,6 +428,7 @@ "edt_conf_webc_heading_title" : "Web Configuration", "edt_conf_webc_docroot_title" : "Document Root", "edt_conf_webc_docroot_expl" : "Local webinterface root path (just for webui developer)", + "edt_conf_effp_heading_title" : "Effekt Paths", "edt_conf_effp_paths_title" : "Effect Path(s)", "edt_conf_effp_paths_itemtitle" : "Path", "edt_conf_effp_disable_title" : "Disabed Effects", @@ -395,6 +451,11 @@ "edt_eff_storbe_header_title" : "Strobe", "edt_eff_traces_header_title" : "Color Traces", "edt_eff_x-mas_header_title" : "X-Mas", + "edt_eff_trails_header_title" : "Trails", + "edt_eff_enum_all" : "All", + "edt_eff_enum_all-together" : "All together", + "edt_eff_enum_list" : "LED List", + "edt_eff_count_title" : "Count", "edt_eff_color_title" : "Color", "edt_eff_colorrandom_title" : "Random color", "edt_eff_colorone_title" : "Color one", @@ -429,7 +490,6 @@ "edt_eff_enableshutdown_title" : "Real shutdown", "edt_eff_length_title" : "Length", "edt_eff_frequency_title" : "Frequency", - "edt_eff_tails_header_title" : "Trails", "edt_eff_min_len_title" : "Minimal length", "edt_eff_max_len_title" : "Maximal length", "edt_eff_height_title" : "Height", diff --git a/assets/webconfig/index.html b/assets/webconfig/index.html index c1975827..faf2f32f 100644 --- a/assets/webconfig/index.html +++ b/assets/webconfig/index.html @@ -68,7 +68,7 @@ -
+
+ + @@ -262,6 +299,7 @@ + diff --git a/assets/webconfig/js/content_effects.js b/assets/webconfig/js/content_effects.js index 12be9da9..80166bb4 100644 --- a/assets/webconfig/js/content_effects.js +++ b/assets/webconfig/js/content_effects.js @@ -1,17 +1,114 @@ -var conf_editor = null; +var olddEffects = []; +var editorReady = false; +var effects_editor = null; +var confFgEff = parsedConfJSON.foregroundEffect.effect; +var confBgEff = parsedConfJSON.backgroundEffect.effect; +var foregroundEffect_editor = null; +var backgroundEffect_editor = null; + $(hyperion).one("cmd-config-getschema", function(event) { schema = parsedConfSchemaJSON.properties; - conf_editor = createJsonEditor('editor_container', { - effects : schema.effects, - initialEffect : schema.initialEffect - }, true); + effects_editor = createJsonEditor('editor_container_effects', { + effects : schema.effects + }, true, true); - $('#btn_submit').off().on('click',function() { - requestWriteConfig(conf_editor.getValue()); + foregroundEffect_editor = createJsonEditor('editor_container_foregroundEffect', { + foregroundEffect : schema.foregroundEffect + }, true, true); + + backgroundEffect_editor = createJsonEditor('editor_container_backgroundEffect', { + backgroundEffect : schema.backgroundEffect + }, true, true); + + + effects_editor.on('ready',function() { + editorReady = true; }); + + foregroundEffect_editor.on('change',function() { + var type = foregroundEffect_editor.getEditor('root.foregroundEffect.type'); + if(type.value == "color") + { + foregroundEffect_editor.getEditor('root.foregroundEffect.effect').disable(); + foregroundEffect_editor.getEditor('root.foregroundEffect.color').enable(); + } + else + { + foregroundEffect_editor.getEditor('root.foregroundEffect.effect').enable(); + foregroundEffect_editor.getEditor('root.foregroundEffect.color').disable(); + } + }); + + backgroundEffect_editor.on('change',function() { + var type = backgroundEffect_editor.getEditor('root.backgroundEffect.type'); + if(type.value == "color") + { + backgroundEffect_editor.getEditor('root.backgroundEffect.effect').disable(); + backgroundEffect_editor.getEditor('root.backgroundEffect.color').enable(); + } + else + { + backgroundEffect_editor.getEditor('root.backgroundEffect.effect').enable(); + backgroundEffect_editor.getEditor('root.backgroundEffect.color').disable(); + } + }); + + $('#btn_submit_effects').off().on('click',function() { + requestWriteConfig(effects_editor.getValue()); + }); + + $('#btn_submit_foregroundEffect').off().on('click',function() { + //requestWriteConfig(foregroundEffect_editor.getValue()); + console.log(foregroundEffect_editor.getValue()); + }); + + $('#btn_submit_backgroundEffect').off().on('click',function() { + //requestWriteConfig(backgroundEffect_editor.getValue()); + console.log(backgroundEffect_editor.getValue()); + }); + + if(showOptHelp) + { + $('#opt_expl_effects').html(createHelpTable(schema.effects.properties, ''+$.i18n("edt_conf_effp_heading_title")+' '+$.i18n("conf_helptable_expl"))); + $('#opt_expl_foregroundEffect').html(createHelpTable(schema.foregroundEffect.properties, ''+$.i18n("edt_conf_fge_heading_title")+' '+$.i18n("conf_helptable_expl"))); + $('#opt_expl_backgroundEffect').html(createHelpTable(schema.backgroundEffect.properties, ''+$.i18n("edt_conf_bge_heading_title")+' '+$.i18n("conf_helptable_expl"))); + } }); +function updateEffectlist(event){ + if(editorReady) + { + var newEffects = event.response.info.effects; + if (newEffects.length != olddEffects.length) + { + $('#root_foregroundEffect_effect').html(''); + var usrEffArr = []; + var sysEffArr = []; + + for(i = 0; i < newEffects.length; i++) + { + var effectName = newEffects[i].name; + if(!/^\:/.test(newEffects[i].file)) + usrEffArr.push(effectName); + else + sysEffArr.push(effectName); + } + $('#root_foregroundEffect_effect').append(createSel(usrEffArr, $.i18n('remote_optgroup_usreffets'))); + $('#root_foregroundEffect_effect').append(createSel(sysEffArr, $.i18n('remote_optgroup_syseffets'))); + $('#root_backgroundEffect_effect').html($('#root_foregroundEffect_effect').html()); + olddEffects = newEffects; + + $('#root_foregroundEffect_effect').val(confFgEff); + $('#root_foregroundEffect_effect').trigger('change'); + + $('#root_backgroundEffect_effect').val(confBgEff); + $('#root_backgroundEffect_effect').trigger('change'); + } + } +} + $(document).ready( function() { performTranslation(); requestServerConfigSchema(); + $(hyperion).on("cmd-serverinfo",updateEffectlist); }); diff --git a/assets/webconfig/js/content_general.js b/assets/webconfig/js/content_general.js index b0e4ab48..712fd137 100644 --- a/assets/webconfig/js/content_general.js +++ b/assets/webconfig/js/content_general.js @@ -4,13 +4,14 @@ $(hyperion).one("cmd-config-getschema", function(event) { schema = parsedConfSchemaJSON.properties; conf_editor = createJsonEditor('editor_container', { general: schema.general - }, true); - - $('#editor_container h3').remove(); + }, true, true); $('#btn_submit').off().on('click',function() { requestWriteConfig(conf_editor.getValue()); }); + + if(showOptHelp) + $('#opt_expl').html(createHelpTable(schema.general.properties, ''+$.i18n("edt_conf_gen_heading_title")+' '+$.i18n("conf_helptable_expl"))); }); diff --git a/assets/webconfig/js/content_grabber.js b/assets/webconfig/js/content_grabber.js index 6465e0fe..7c5ff060 100644 --- a/assets/webconfig/js/content_grabber.js +++ b/assets/webconfig/js/content_grabber.js @@ -19,8 +19,11 @@ $(hyperion).one("cmd-config-getschema", function(event) { requestWriteConfig(conf_editor_v4l2.getValue()); }); - $('#opt_expl_fg').html(createHelpTable(schema.framegrabber.properties, ''+$.i18n("edt_conf_fg_heading_title"))); - $('#opt_expl_v4l2').html(createHelpTable(schema.grabberV4L2.items.properties, ''+$.i18n("edt_conf_v4l2_heading_title"))); + if(showOptHelp) + { + $('#opt_expl_fg').html(createHelpTable(schema.framegrabber.properties, ''+$.i18n("edt_conf_fg_heading_title")+' '+$.i18n("conf_helptable_expl"))); + $('#opt_expl_v4l2').html(createHelpTable(schema.grabberV4L2.items.properties, ''+$.i18n("edt_conf_v4l2_heading_title")+' '+$.i18n("conf_helptable_expl"))); + } }); diff --git a/assets/webconfig/js/content_index.js b/assets/webconfig/js/content_index.js index 4fb59914..088d569f 100644 --- a/assets/webconfig/js/content_index.js +++ b/assets/webconfig/js/content_index.js @@ -2,7 +2,6 @@ $(document).ready( function() { var uiLock = false; $("#main-nav").hide(); - $("#loading_overlay").addClass("overlay"); loadContentTo("#container_connection_lost","connection_lost"); initWebSocket(); bindNavToContent("#load_dashboard","dashboard",true); @@ -22,6 +21,7 @@ $(document).ready( function() { bindNavToContent("#load_webconfig","webconfig",false); $(hyperion).on("cmd-serverinfo",function(event){ + showOptHelp = parsedConfJSON.general.showOptHelp; parsedServerInfoJSON = event.response; currentVersion = parsedServerInfoJSON.info.hyperion[0].version; cleanCurrentVersion = currentVersion.replace(/\./g, ''); diff --git a/assets/webconfig/js/content_kodi.js b/assets/webconfig/js/content_kodi.js index ec885bb4..fce20408 100644 --- a/assets/webconfig/js/content_kodi.js +++ b/assets/webconfig/js/content_kodi.js @@ -10,7 +10,8 @@ $(hyperion).one("cmd-config-getschema", function(event) { requestWriteConfig(conf_editor.getValue()); }); - $('#opt_expl').html(createHelpTable(schema.kodiVideoChecker.properties, ''+$.i18n("conf_kodi_label_title"))); + if(showOptHelp) + $('#opt_expl').html(createHelpTable(schema.kodiVideoChecker.properties, ''+$.i18n("conf_kodi_label_title")+' '+$.i18n("conf_helptable_expl"))); }); diff --git a/assets/webconfig/js/content_network.js b/assets/webconfig/js/content_network.js index 6fea33e1..fb174591 100644 --- a/assets/webconfig/js/content_network.js +++ b/assets/webconfig/js/content_network.js @@ -49,11 +49,14 @@ $(hyperion).one("cmd-config-getschema", function(event) { requestWriteConfig(conf_editor_forw.getValue()); }); - $('#opt_expl_jsonserver').html(createHelpTable(schema.jsonServer.properties, ''+$.i18n("edt_conf_js_heading_title"))); - $('#opt_expl_protoserver').html(createHelpTable(schema.protoServer.properties, ''+$.i18n("edt_conf_ps_heading_title"))); - $('#opt_expl_boblightserver').html(createHelpTable(schema.boblightServer.properties, ''+$.i18n("edt_conf_bobls_heading_title"))); - $('#opt_expl_udplistener').html(createHelpTable(schema.udpListener.properties, ''+$.i18n("edt_conf_udpl_heading_title"))); - $('#opt_expl_forwarder').html(createHelpTable(schema.forwarder.properties, ''+$.i18n("edt_conf_fw_heading_title"))); + if(showOptHelp) + { + $('#opt_expl_jsonserver').html(createHelpTable(schema.jsonServer.properties, ''+$.i18n("edt_conf_js_heading_title")+' '+$.i18n("conf_helptable_expl"))); + $('#opt_expl_protoserver').html(createHelpTable(schema.protoServer.properties, ''+$.i18n("edt_conf_ps_heading_title"))); + $('#opt_expl_boblightserver').html(createHelpTable(schema.boblightServer.properties, ''+$.i18n("edt_conf_bobls_heading_title")+' '+$.i18n("conf_helptable_expl"))); + $('#opt_expl_udplistener').html(createHelpTable(schema.udpListener.properties, ''+$.i18n("edt_conf_udpl_heading_title")+' '+$.i18n("conf_helptable_expl"))); + $('#opt_expl_forwarder').html(createHelpTable(schema.forwarder.properties, ''+$.i18n("edt_conf_fw_heading_title")+' '+$.i18n("conf_helptable_expl"))); + } }); diff --git a/assets/webconfig/js/content_webconfig.js b/assets/webconfig/js/content_webconfig.js index f145acf5..aa249074 100644 --- a/assets/webconfig/js/content_webconfig.js +++ b/assets/webconfig/js/content_webconfig.js @@ -4,11 +4,14 @@ $(hyperion).one("cmd-config-getschema", function(event) { schema = parsedConfSchemaJSON.properties; conf_editor = createJsonEditor('editor_container', { webConfig : schema.webConfig - }, true); + }, true, true); $('#btn_submit').off().on('click',function() { requestWriteConfig(conf_editor.getValue()); }); + + if(showOptHelp) + $('#opt_expl_webconfig').html(createHelpTable(schema.webConfig.properties, ''+$.i18n("edt_conf_webc_heading_title")+' '+$.i18n("conf_helptable_expl"))); }); diff --git a/assets/webconfig/js/hyperion.js b/assets/webconfig/js/hyperion.js index 6ac36607..a47ff92f 100644 --- a/assets/webconfig/js/hyperion.js +++ b/assets/webconfig/js/hyperion.js @@ -1,5 +1,6 @@ // global vars +var showOptHelp = true; var currentVersion; var cleanCurrentVersion; var latestVersion; @@ -24,7 +25,7 @@ function initRestart() { $(hyperion).off(); requestServerConfigReload(); - watchdog = 1; + watchdog = 2; $("#wrapper").fadeOut("slow"); cron(); } @@ -229,8 +230,6 @@ function requestWriteConfig(config) }); var config_str = JSON.stringify(complete_config); - console.log("save"); - console.log(config_str); sendToHyperion("config","setconfig", '"config":'+config_str); } diff --git a/assets/webconfig/js/lib/jsoneditor.js b/assets/webconfig/js/lib/jsoneditor.js index e24b41e3..324457df 100755 --- a/assets/webconfig/js/lib/jsoneditor.js +++ b/assets/webconfig/js/lib/jsoneditor.js @@ -4859,7 +4859,7 @@ JSONEditor.defaults.editors["enum"] = JSONEditor.AbstractEditor.extend({ JSONEditor.defaults.editors.select = JSONEditor.AbstractEditor.extend({ setValue: function(value,initial) { - value = this.typecast(value||''); + value = this.typecast(value||''); // Sanitize value before setting it var sanitized = value; @@ -5008,7 +5008,7 @@ JSONEditor.defaults.editors.select = JSONEditor.AbstractEditor.extend({ } // Other, not supported else { - throw "'select' editor requires the enum property to be set."; + //throw "'select' editor requires the enum property to be set."; } }, build: function() { @@ -5041,23 +5041,11 @@ JSONEditor.defaults.editors.select = JSONEditor.AbstractEditor.extend({ this.value = this.enum_values[0]; }, onInputChange: function() { - var val = this.input.value; - - var new_val; - // Invalid option, use first option instead - if(this.enum_options.indexOf(val) === -1) { - new_val = this.enum_values[0]; - } - else { - new_val = this.enum_values[this.enum_options.indexOf(val)]; - } - - // If valid hasn't changed - if(new_val === this.value) return; + var val = this.input.value; // Store new value and propogate change event - this.value = new_val; - this.onChange(true); + this.value = val; + this.onChange(true); }, setupSelect2: function() { // If the Select2 library is loaded use it when we have lots of items @@ -6358,14 +6346,20 @@ JSONEditor.AbstractTheme = Class.extend({ this.setSelectOptions(switcher, options, titles); }, setSelectOptions: function(select, options, titles) { - titles = titles || []; - select.innerHTML = ''; - for(var i=0; i= 0) { diff --git a/assets/webconfig/js/localStorage.js b/assets/webconfig/js/localStorage.js index d4d69853..650d3406 100644 --- a/assets/webconfig/js/localStorage.js +++ b/assets/webconfig/js/localStorage.js @@ -47,10 +47,11 @@ } else { - showInfoDialog('warning', "Can't store settings", "Your browser doesn't support localStorage. You can't save a specific language setting (fallback to 'auto detection') and access level (fallback to 'default'). You could still use the webinterface without further issues"); + showInfoDialog('warning', "Can't store settings", "Your browser doesn't support localStorage. You can't save a specific language setting (fallback to 'auto detection') and access level (fallback to 'default'). Some wizards may be hidden. You could still use the webinterface without further issues"); initTrans('auto'); $('#btn_setlang').toggle(); $('#btn_setaccess').toggle(); + $('#btn_wizard_byteorder').toggle(); } $('#btn_setlang').off().on('click',function() { diff --git a/assets/webconfig/js/ui_utils.js b/assets/webconfig/js/ui_utils.js index 12931cb7..4053666d 100644 --- a/assets/webconfig/js/ui_utils.js +++ b/assets/webconfig/js/ui_utils.js @@ -80,7 +80,7 @@ function showInfoDialog(type,header,message,btnid) else if (type == "select"){ $('#modal_dialog .modal-bodyicon').html('Redefine ambient light!'); $('#modal_dialog .modal-footer-button').html(''); - $('#modal_dialog .modal-footer-button').append(''); + $('#modal_dialog .modal-footer-button').append(''); } else if (type == "uilock"){ $('#modal_dialog .modal-bodyicon').html('Redefine ambient light!'); @@ -182,8 +182,10 @@ function createHelpTable(list, phead){ thead.appendChild(createTableTh($.i18n('conf_helptable_option'), $.i18n('conf_helptable_expl'))); for (key in list){ - text = list[key].title.replace('title', 'expl'); - tbody.appendChild(createTableTd($.i18n(list[key].title), $.i18n(text))); + if(list[key].access != 'system'){ + text = list[key].title.replace('title', 'expl'); + tbody.appendChild(createTableTd($.i18n(list[key].title), $.i18n(text))); + } } table.appendChild(thead); table.appendChild(tbody); diff --git a/assets/webconfig/js/wizard.js b/assets/webconfig/js/wizard.js new file mode 100644 index 00000000..a924d1f3 --- /dev/null +++ b/assets/webconfig/js/wizard.js @@ -0,0 +1,142 @@ +$(document).ready( function() { + //clear priority if people reload the page or lost connection while a wizard was active + var wizardStatus = localStorage.getItem("wizardactive"); + + $(hyperion).one("cmd-config-getschema", function(event) { + if(wizardStatus) + requestPriorityClear(); + }); + + //rgb byte order wizard + var colorIntveralId; + var new_rgb_order; + + function changeColor() + { + var color = $("#wiz_canv_color").css('background-color'); + + if (color == 'rgb(255, 0, 0)') + { + $("#wiz_canv_color").css('background-color','rgb(0, 255, 0)'); + requestSetColor('0','255','0'); + } + else + { + $("#wiz_canv_color").css('background-color','rgb(255, 0, 0)'); + requestSetColor('255','0','0'); + } + } + + function startWizardRGB() + { + $("#wizard_modal").modal({ + backdrop : "static", + keyboard: false, + show: true + }); + } + + function beginWizardRGB() + { + $("#wiz_switchtime_select").off().on('change',function() { + clearInterval(colorIntveralId); + var time = $("#wiz_switchtime_select").val(); + colorIntveralId = setInterval(function() { changeColor(); }, time*1000); + }); + + $('.wselect').change(function () { + var rgb_order = order = parsedConfJSON.device.colorOrder.split(""); + var redS = $("#wiz_r_select").val(); + var greenS = $("#wiz_g_select").val(); + + for (var i = 0; isetColor(FG_PRIORITY, ColorRgb::BLACK, 100, false); + // clear the leds + hyperion->setColor(FG_PRIORITY, ColorRgb::BLACK, 100, false); - // initial foreground effect/color - const QJsonValue fgEffectConfig = effectConfig["foreground-effect"]; + // initial foreground effect/color + if (FGEffectConfig["enable"].toBool(true)) + { + const QString fgTypeConfig = FGEffectConfig["type"].toString("effect"); + const QString fgEffectConfig = FGEffectConfig["effect"].toString("Rainbow swirl fast"); + const QJsonValue fgColorConfig = FGEffectConfig["color"]; int default_fg_duration_ms = 3000; - int fg_duration_ms = effectConfig["foreground-duration_ms"].toInt(default_fg_duration_ms); + int fg_duration_ms = FGEffectConfig["duration_ms"].toInt(default_fg_duration_ms); if (fg_duration_ms == DURATION_INFINITY) { fg_duration_ms = default_fg_duration_ms; Warning(_log, "foreground effect duration 'infinity' is forbidden, set to default value %d ms",default_fg_duration_ms); } - if ( ! fgEffectConfig.isNull() && fgEffectConfig.isArray() && FGCONFIG_ARRAY.size() == 3 ) + if ( fgTypeConfig.contains("color") ) { ColorRgb fg_color = { (uint8_t)FGCONFIG_ARRAY.at(0).toInt(0), @@ -242,19 +245,19 @@ void HyperionDaemon::startInitialEffect() hyperion->setColor(FG_PRIORITY, fg_color, fg_duration_ms, false); Info(_log,"Inital foreground color set (%d %d %d)",fg_color.red,fg_color.green,fg_color.blue); } - else if (! fgEffectConfig.isNull() && fgEffectConfig.isArray() && FGCONFIG_ARRAY.size() == 1 && FGCONFIG_ARRAY.at(0).isString()) + else { - const QString fgEffectName = FGCONFIG_ARRAY.at(0).toString(); - int result = effectConfig.contains("foreground-effect-args") -// ? hyperion->setEffect(fgEffectName, effectConfig["foreground-effect-args"], FG_PRIORITY, fg_duration_ms) - ? hyperion->setEffect(fgEffectName, _qconfig["initialEffect"].toObject()["foreground-effect-args"].toObject(), FG_PRIORITY, fg_duration_ms) - : hyperion->setEffect(fgEffectName, FG_PRIORITY, fg_duration_ms); - Info(_log,"Inital foreground effect '%s' %s", fgEffectName.toUtf8().constData(), ((result == 0) ? "started" : "failed")); + int result = hyperion->setEffect(fgEffectConfig, FG_PRIORITY, fg_duration_ms); + Info(_log,"Inital foreground effect '%s' %s", fgEffectConfig.toUtf8().constData(), ((result == 0) ? "started" : "failed")); } - - // initial background effect/color - const QJsonValue bgEffectConfig = effectConfig["background-effect"]; - if ( ! bgEffectConfig.isNull() && bgEffectConfig.isArray() && BGCONFIG_ARRAY.size() == 3 ) + } + // initial background effect/color + if (BGEffectConfig["enable"].toBool(true)) + { + const QString bgTypeConfig = BGEffectConfig["type"].toString("effect"); + const QString bgEffectConfig = BGEffectConfig["effect"].toString("Warm mood blobs"); + const QJsonValue bgColorConfig = BGEffectConfig["color"]; + if (bgTypeConfig.contains("color")) { ColorRgb bg_color = { (uint8_t)BGCONFIG_ARRAY.at(0).toInt(0), @@ -264,14 +267,10 @@ void HyperionDaemon::startInitialEffect() hyperion->setColor(BG_PRIORITY, bg_color, DURATION_INFINITY, false); Info(_log,"Inital background color set (%d %d %d)",bg_color.red,bg_color.green,bg_color.blue); } - else if (! bgEffectConfig.isNull() && bgEffectConfig.isArray() && BGCONFIG_ARRAY.size() == 1 && BGCONFIG_ARRAY.at(0).isString()) + else { - const QString bgEffectName = BGCONFIG_ARRAY.at(0).toString(); - int result = effectConfig.contains("background-effect-args") -// ? hyperion->setEffect(bgEffectName, effectConfig["background-effect-args"], BG_PRIORITY, fg_duration_ms) - ? hyperion->setEffect(bgEffectName, _qconfig["initialEffect"].toObject()["background-effect-args"].toObject(), BG_PRIORITY, DURATION_INFINITY) - : hyperion->setEffect(bgEffectName, BG_PRIORITY, DURATION_INFINITY); - Info(_log,"Inital background effect '%s' %s", bgEffectName.toUtf8().constData(), ((result == 0) ? "started" : "failed")); + int result = hyperion->setEffect(bgEffectConfig, BG_PRIORITY, DURATION_INFINITY); + Info(_log,"Inital background effect '%s' %s", bgEffectConfig.toUtf8().constData(), ((result == 0) ? "started" : "failed")); } }