Skip to content

Commit

Permalink
Update 88_Timer.pm
Browse files Browse the repository at this point in the history
  • Loading branch information
HomeAutoUser committed Dec 3, 2023
1 parent bc5acc0 commit 268beaf
Showing 1 changed file with 47 additions and 11 deletions.
58 changes: 47 additions & 11 deletions FHEM/88_Timer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -614,14 +614,14 @@ sub Timer_FW_Detail {
if ($Table_Border_Cell eq 'on') { $style_code1 = "border:1px solid #D8D8D8;"; }

for(my $spalte = 0; $spalte <= $cnt_max - 1; $spalte++) {
# Timer-Nummer - auto Breite
# auto Breite | Timer-Nummer
if ($spalte == 0) { $html.= "<td align=\"center\" style=\"$style_code1 Padding-top:3px; Padding-left:5px; text-decoration:underline\">".$names[$spalte]."</td>"; }
# Dropdown-Listen - definierte Breite
# definierte Breite | Dropdown-Listen Jahr, Monat, Tag, Std, Min, Sek
if ($spalte >= 1 && $spalte <= 6) { $html.= "<td align=\"center\" width=70 style=\"$style_code1 Padding-top:3px; text-decoration:underline\">".$names[$spalte]."</td>"; }
# auto Breite
# auto Breite | Bezeichnung, Aktion, Mo - So, aktive
if ($spalte > 6 && $spalte < $cnt_max - 1) { $html.= "<td align=\"center\" style=\"$style_code1 Padding-top:3px; text-decoration:underline\">".$names[$spalte]."</td>"; }
# aktiv - auto Breite
if ($spalte == $cnt_max - 1) { $html.= "<td align=\"center\" style=\"$style_code1 Padding-top:3px; Padding-right:5px; text-decoration:underline\">".$names[$spalte]."</td>"; }
# auto Breite | Offset
if ($spalte == $cnt_max - 1) { $html.= "<td align=\"center\" style=\"$style_code1 Padding-top:3px; Padding-right:5px; text-decoration:underline\" id=\"17\">".$names[$spalte]."</td>"; }
}
$html.= "</tr>";

Expand Down Expand Up @@ -652,7 +652,7 @@ sub Timer_FW_Detail {
$id++;

# Log3 $name, 3, "$name: FW_Detail | Zeile $zeile, id $id, select";
$html.= "<td align=\"center\" style=\"$style_code1\"><select id=\"".$id."\" onchange=\"validColumn(".$id.")\">"; # id need for java script
$html.= "<td align=\"center\" style=\"$style_code1\"><select id=\"".$id."\" onchange=\"validColumn(".$id.",".$Timers_Count.")\">"; # id need for java script
if ($spalte <= 6) { $html.= "<option>$description_all</option>"; } # Jahr, Monat, Tag, Stunde, Minute
if ($spalte == 5 || $spalte == 6) { # Stunde, Minute
$selected = $select_Value[$spalte-2] eq $designations[4] ? "selected=\"selected\"" : '';
Expand Down Expand Up @@ -733,9 +733,10 @@ sub Timer_FW_Detail {
}
/* Test eingestellter Wert fuer Ein/Ausblendung Eingabefeld*/
function validColumn(id) {
function validColumn(id,Timers_Count) {
var column_hh = (id - 4) / 20;
var column_mm = (id - 5) / 20;
var column_offset = 0;
const testValues = ["SA", "SU", "SR", "SS"];
let column_hide = false;
Expand All @@ -744,25 +745,60 @@ sub Timer_FW_Detail {
console.log("plausible column found with id " + id +" | selected: " + document.getElementById(id).value);
for (let i=0; i<testValues.length; i++) {
if(testValues[i] == document.getElementById(id).value || testValues[i] == document.getElementById(id+1).value) {
column_hide = true;
if(testValues[i] == document.getElementById(id).value) { column_hide = true; }
if(Number.isInteger(column_hh)) {
if(testValues[i] == document.getElementById(id+1).value) { column_hide = true; }
}
if(Number.isInteger(column_mm)) {
if(testValues[i] == document.getElementById(id-1).value) { column_hide = true; }
}
}
console.log(column_hide);
if(column_hide){
if(Number.isInteger(column_hh)) {
document.getElementById(column_hh * 20 + 17).type = \'number\';
} else if (Number.isInteger(column_mm)) {
document.getElementById(column_mm * 20 + 17).type = \'number\';
}
} else {
if(Number.isInteger(column_hh)) {
document.getElementById(column_hh * 20 + 17).style.display = \'none\';
} else if (Number.isInteger(column_mm)) {
document.getElementById(column_mm * 20 + 17).style.display = \'none\';
}
}
}
/*
if(column_hide){
if(Number.isInteger(column_hh)) {
document.getElementById(column_hh * 20 + 17).type = \'number\';
} else if (Number.isInteger(column_mm)) {
document.getElementById(column_mm * 20 + 17).type = \'number\';
}
document.getElementById(17).style.display = \'block\';
} else {
if(Number.isInteger(column_hh)) {
document.getElementById(column_hh * 20 + 17).type = \'hidden\';
document.getElementById(column_hh * 20 + 17).style.display = \'none\';
} else if (Number.isInteger(column_mm)) {
document.getElementById(column_mm * 20 + 17).type = \'hidden\';
document.getElementById(column_mm * 20 + 17).style.display = \'none\';
}
}
}
*/
/* loop to count offset fields */
/* for (var i2 = 1; i2 <= Timers_Count; i2++) {
if (document.getElementById(i2 * 20 + 17).value != 0) {
console.log(i2 * 20 + 17);
column_offset++;
}
};
if(column_offset == 0) {
console.log("no offset colums");
document.getElementById(17).style.display = \'none\';
}
*/
}
/* Aktion wenn Speichern */
Expand Down

0 comments on commit 268beaf

Please sign in to comment.