Skip to content

Commit

Permalink
Merge pull request #31 from domoticz/beta
Browse files Browse the repository at this point in the history
V1.16.1
  • Loading branch information
davidlb authored Jul 31, 2020
2 parents 0091700 + 4385e00 commit a96773a
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 26 deletions.
12 changes: 6 additions & 6 deletions css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -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%;
Expand Down Expand Up @@ -215,7 +210,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);
}

Expand Down Expand Up @@ -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;
}
Expand Down
43 changes: 25 additions & 18 deletions custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -1481,24 +1480,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 {
Expand Down Expand Up @@ -1656,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 */
Expand Down Expand Up @@ -1795,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;
}

Expand Down
49 changes: 48 additions & 1 deletion js/themesettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 + ")");
Expand All @@ -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) {
Expand Down Expand Up @@ -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&param=" + 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;
}
Expand Down Expand Up @@ -463,6 +487,29 @@ function getCustomThemeSettings(idx) {
});
}

function getColorsThemeSettings(idx) {
$.ajax({
url: "json.htm?type=command&param=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&param=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&param=deleteuservariable&idx=" + theme.userfeaturesvariable;
Expand Down
2 changes: 1 addition & 1 deletion theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit a96773a

Please sign in to comment.