From edfe793bc96cd9ad85bb5bc07acfd211ec87c6a6 Mon Sep 17 00:00:00 2001 From: davidlb Date: Thu, 30 Jul 2020 16:18:02 +0200 Subject: [PATCH 1/6] Visual fixes --- css/settings.css | 2 +- custom.css | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/css/settings.css b/css/settings.css index 677280e..93625ba 100644 --- a/css/settings.css +++ b/css/settings.css @@ -215,7 +215,7 @@ ul.machinon_ul li { margin-top: 10px; } -.norm-link, .norm-link a, .norm-link a:link, .norm-link a:active, .norm-link a:visited, .norm-link href, a:link { +#settings .norm-link, #settings .norm-link a, #settings .norm-link a:link, #settings .norm-link a:active, #settings .norm-link a:visited, #settings .norm-link href, #settings a:link { color: var(--main-blue-color); } diff --git a/custom.css b/custom.css index 8d4f504..18ac1a3 100644 --- a/custom.css +++ b/custom.css @@ -1481,24 +1481,21 @@ select.ui-corner-all option { /*! background-color: transparent !important; */ } -.item.statusTimeout:hover { - box-shadow: 0px 0px 0px 2px rgb(199,67,67); +.item.statusTimeout tr:hover { + box-shadow: 0px 0px 0px 2px rgb(199,67,67) !important; } /* Switch is protected */ -.item.statusProtected:hover { - box-shadow: 0px 0px 10px 2px rgb(0, 0, 139, 0.4); +.item.statusProtected tr:hover { + box-shadow: 0px 0px 10px 2px rgb(0, 0, 139, 0.4) !important; } -.item.statusProtected:hover { - box-shadow: 0px 0px 0px 2px rgb(0, 0, 139); -} /* Device has low battery */ -.item.statusLowBattery { - box-shadow: 0px 0px 10px 2px rgb(255,255,0,0.4); +.item.statusLowBattery tr { + box-shadow: 0px 0px 10px 2px rgb(255,255,0,0.4) !important; } -.item.statusLowBattery:hover { - box-shadow: 0px 0px 0px 2px rgb(255,255,0); +.item.statusLowBattery tr:hover { + box-shadow: 0px 0px 0px 2px rgb(255,255,0) !important; } .blink { From 78bd1d41f0cc824d4e02c961898c88a0c0c4b681 Mon Sep 17 00:00:00 2001 From: davidlb Date: Thu, 30 Jul 2020 18:05:36 +0200 Subject: [PATCH 2/6] Change selected navbar item style --- custom.css | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/custom.css b/custom.css index 18ac1a3..40337db 100644 --- a/custom.css +++ b/custom.css @@ -925,7 +925,7 @@ div.menu-toggle.scrolled { background-color: transparent; color: var(--main-text-color); border: none; - border-radius: 0; + border-radius: 5px; position: relative; } @@ -972,10 +972,9 @@ div.menu-toggle.scrolled { text-shadow: none; color: var(--main-text-color); background-image: none; - background-color: var(--main-blue-color); + background-color: rgba(var(--main-blue-color-values), 0.4); font-family: main-font-bold; - border: none; - border-radius: 0; + border: 1px solid var(--main-blue-color); } .nav li a img { From 1d67da9cdb4b6c03617d1f5522630e3fbdcea077 Mon Sep 17 00:00:00 2001 From: davidlb Date: Fri, 31 Jul 2020 15:48:08 +0200 Subject: [PATCH 3/6] Store color schemes in user variables too --- js/themesettings.js | 49 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/js/themesettings.js b/js/themesettings.js index 7a218f5..05b053c 100644 --- a/js/themesettings.js +++ b/js/themesettings.js @@ -316,6 +316,7 @@ function checkUserVariableThemeSettings() { var didDomoticzHaveSettings = false; var featuresVarName = "theme-" + themeFolder + "-features"; var customVarName = "theme-" + themeFolder + "-custom"; + var colorsVarName = "theme-" + themeFolder + "-colors"; $.each(data.result, function(variable, value) { if (value.Name == featuresVarName) { console.log(themeName + " - found theme feature settings in Domoticz database (user variable Idx: " + value.idx + ")"); @@ -324,11 +325,17 @@ function checkUserVariableThemeSettings() { getFeatureThemeSettings(value.idx); } if (value.Name == customVarName) { - console.log(themeName + " - found theme feature settings in Domoticz database (user variable Idx: " + value.idx + ")"); + console.log(themeName + " - found theme custom settings in Domoticz database (user variable Idx: " + value.idx + ")"); didDomoticzHaveSettings = true; theme.usercustomsvariable = value.idx; getCustomThemeSettings(value.idx); } + if (value.Name == colorsVarName) { + console.log(themeName + " - found theme colors settings in Domoticz database (user variable Idx: " + value.idx + ")"); + didDomoticzHaveSettings = true; + theme.usercolorsvariable = value.idx; + getColorsThemeSettings(value.idx); + } }); if (didDomoticzHaveSettings === false) { if (unableCreateUserVariable == false) { @@ -396,6 +403,23 @@ function storeUserVariableThemeSettings(action) { console.log(themeName + " - Ajax error wile creating or updating user variable in Domotcz."); } }); + variableURL = "json.htm?type=command¶m=" + action + "uservariable&vname=theme-" + themeFolder + "-colors&vtype=2&vvalue=" + encodeURIComponent(JSON.stringify(theme.color_scheme)); + $.ajax({ + url: variableURL, + async: false, + dataType: "json", + success: function(data) { + if (data.status == "ERR") { + bootbox.alert("Unable to create or update theme settings uservariable, Try to reset the theme"); + } + if (data.status == "OK") { + console.log(themeName + " - theme settings uservariable is updated"); + } + }, + error: function() { + console.log(themeName + " - Ajax error wile creating or updating user variable in Domotcz."); + } + }); } else { return; } @@ -463,6 +487,29 @@ function getCustomThemeSettings(idx) { }); } +function getColorsThemeSettings(idx) { + $.ajax({ + url: "json.htm?type=command¶m=getuservariable" + "&idx=" + idx, + async: true, + dataType: "json", + success: function(data) { + if (data.status == "ERR") { + console.log(themeName + " - Although they seem to exist, there was an error loading theme preferences from Domoticz"); + $.get("json.htm?type=command¶m=addlogmessage&message=Theme Error - The theme was unable to load your user variable."); + colorsVariableThemeLoaded = false; + } + if (data.status == "OK") { + theme.color_scheme = JSON.parse(data.result[0].Value) + localStorage.setObject(themeFolder + ".themeSettings", theme); + colorsVariableThemeLoaded = true; + } + }, + error: function() { + console.log(themeName + " - ERROR reading colors settings from Domoticz for theme" + theme.name + "from user variable #" + idx); + colorsVariableThemeLoaded = false; + } + }); +} function resetTheme() { if (typeof theme.userfeaturesvariable !== "undefined") { var deleteFeaturesURL = "json.htm?type=command¶m=deleteuservariable&idx=" + theme.userfeaturesvariable; From ff1dd21058022484b5287871b65ab7d0bc97e124 Mon Sep 17 00:00:00 2001 From: davidlb Date: Fri, 31 Jul 2020 16:13:00 +0200 Subject: [PATCH 4/6] Improve selector in compact mode --- custom.css | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/custom.css b/custom.css index 40337db..0040e1b 100644 --- a/custom.css +++ b/custom.css @@ -1652,9 +1652,13 @@ select.ui-corner-all option { } .btn-group { + display: flex !important; + flex-flow: wrap; + justify-content: space-evenly; padding-bottom: 1px; scrollbar-width: thin; scrollbar-color: var(--main-blue-color) var(--main-bg-color); + width: 100%; } /* Selector */ @@ -1791,22 +1795,29 @@ section.compact .row.divider { } .span3 td.input .btn-group { - display: flex !important; - flex-direction: column; + flex-flow: column; + justify-content: start; white-space: normal; margin-top: 0 !important; height: 50px; width: 100%; - scrollbar-width: thin; + scroll-snap-type: y mandatory; background: var(--main-bg-item-color) !important; } .span3 td.input .btn-group button { order: 2; border-radius: 0 !important; + scroll-snap-align: start; + scroll-snap-stop: always; } .span3 td.input .btn-group button.btn-selected { + color: var(--main-blue-color) !important; + font-family: main-font-bold; + font-size: 1rem; + font-weight: 600; + min-height: 50px; order: 1; } From 3efbc62856770d7c473f42d9ce9c68de60abaac3 Mon Sep 17 00:00:00 2001 From: davidlb Date: Fri, 31 Jul 2020 16:24:39 +0200 Subject: [PATCH 5/6] Fix inputs width --- css/settings.css | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/css/settings.css b/css/settings.css index 93625ba..56b61ce 100644 --- a/css/settings.css +++ b/css/settings.css @@ -95,11 +95,6 @@ a.resetschemebtn { background: transparent; } -#settings input[type="input"], #settings input[type="text"], #settings input[type="password"], #settings select { - width: auto !important; - max-width: 100px; -} - #textareaIcons { resize: none; width: 100%; @@ -255,6 +250,11 @@ ul.machinon_ul li { width: 100px; } + #settings input[type="input"], #settings input[type="text"], #settings input[type="password"], #settings select { + max-width: 100px; + width: auto !important; + } + code { white-space: normal; } From 4385e00102b254491941cffebcd82d28c990f258 Mon Sep 17 00:00:00 2001 From: davidlb Date: Fri, 31 Jul 2020 16:37:16 +0200 Subject: [PATCH 6/6] Bump version to 1.16.1 --- theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theme.json b/theme.json index f06fe10..f284bb7 100644 --- a/theme.json +++ b/theme.json @@ -3,7 +3,7 @@ "name": "Machinon", "description": "Machinon custom theme, simple and light", "license": "GNU General Public License v3.0", - "version":"1.16", + "version":"1.16.1", "author": "EdddieN", "homepage": "https://www.github.com/domoticz/Machinon", "wiki": "https://www.domoticz.com/wiki/Machinon_Theme",