mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
FHEMWEB: get line fixed for dark, :noArg modifier added
git-svn-id: https://svn.fhem.de/fhem/trunk@3622 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
f85c07daa7
commit
71f9f63ba3
@ -379,8 +379,10 @@ CUL_Get($@)
|
||||
my $type = $hash->{TYPE};
|
||||
|
||||
return "\"get $type\" needs at least one parameter" if(@a < 2);
|
||||
return "Unknown argument $a[1], choose one of " . join(" ", sort keys %gets)
|
||||
if(!defined($gets{$a[1]}));
|
||||
if(!defined($gets{$a[1]})) {
|
||||
my @cList = map { $_ =~ m/^(file|raw)$/ ? $_ : "$_:noArg" } sort keys %gets;
|
||||
return "Unknown argument $a[1], choose one of " . join(" ", @cList);
|
||||
}
|
||||
|
||||
my $arg = ($a[2] ? $a[2] : "");
|
||||
my ($msg, $err);
|
||||
|
@ -142,6 +142,7 @@ FHEMWEB_Initialize($)
|
||||
|
||||
$data{webCmdFn}{slider} = "FW_sliderFn";
|
||||
$data{webCmdFn}{timepicker} = "FW_timepickerFn";
|
||||
$data{webCmdFn}{noArg} = "FW_noArg";
|
||||
$data{webCmdFn}{"~dropdown"}= "FW_dropdownFn"; # Should be the last
|
||||
}
|
||||
|
||||
@ -703,10 +704,11 @@ FW_makeTable($$$@)
|
||||
my($title, $name, $hash, $cmd) = (@_);
|
||||
|
||||
return if(!$hash || !int(keys %{$hash}));
|
||||
my $class = lc($title);
|
||||
$class =~ s/[^A-Za-z]/_/g;
|
||||
FW_pO "<div class='makeTable wide'>";
|
||||
FW_pO $title;
|
||||
my $titleid = lc($title);
|
||||
$titleid =~ s/[^A-Za-z]/_/g;
|
||||
FW_pO "<table class=\"block wide $titleid\">";
|
||||
FW_pO "<table class=\"block wide $class\">";
|
||||
my $si = AttrVal("global", "showInternalValues", 0);
|
||||
|
||||
my $row = 1;
|
||||
@ -758,7 +760,7 @@ FW_makeTable($$$@)
|
||||
|
||||
} elsif ($n eq "webCmd"){
|
||||
my $lc = "detail=$name&cmd.$name=set $name";
|
||||
FW_pO "<td><div name=\"$name-$n\">".
|
||||
FW_pO "<td><div name=\"$name-$n\" class=\"dval\">".
|
||||
join(":", map {FW_pH("$lc $_",$_,0,"",1,1)} split(":",$val) ).
|
||||
"</div></td>";
|
||||
|
||||
@ -780,7 +782,7 @@ FW_makeTable($$$@)
|
||||
FW_pO "</tr>";
|
||||
}
|
||||
FW_pO "</table>";
|
||||
FW_pO "<br>";
|
||||
FW_pO "</div>";
|
||||
|
||||
}
|
||||
|
||||
@ -797,6 +799,7 @@ FW_makeSelect($$$$)
|
||||
$selEl = $1 if($list =~ m/([^ ]*):slider,/); # promote a slider if available
|
||||
$selEl = "room" if($list =~ m/room:/);
|
||||
|
||||
FW_pO "<div class='makeSelect'>";
|
||||
FW_pO "<form method=\"$FW_formmethod\" ".
|
||||
"action=\"$FW_ME$FW_subdir\" autocomplete=\"off\">";
|
||||
FW_pO FW_hidden("detail", $d);
|
||||
@ -809,7 +812,7 @@ FW_makeSelect($$$$)
|
||||
# Initial setting
|
||||
FW_pO "<script type=\"text/javascript\">" .
|
||||
"FW_selChange('$selEl','$list','val.$cmd$d')</script>";
|
||||
FW_pO "</form><br><br>";
|
||||
FW_pO "</form></div>";
|
||||
}
|
||||
|
||||
##############################
|
||||
@ -849,7 +852,7 @@ FW_doDetail($)
|
||||
FW_pO FW_hidden("detail", $d);
|
||||
|
||||
FW_makeSelect($d, "set", getAllSets($d), "set");
|
||||
FW_makeSelect($d, "get", getAllGets($d), "set");
|
||||
FW_makeSelect($d, "get", getAllGets($d), "get");
|
||||
|
||||
FW_makeTable("Internals", $d, $h);
|
||||
FW_makeTable("Readings", $d, $h->{READINGS});
|
||||
@ -2670,6 +2673,15 @@ FW_sliderFn($$$$$)
|
||||
"</td>";
|
||||
}
|
||||
|
||||
sub
|
||||
FW_noArg($$$$$)
|
||||
{
|
||||
my ($FW_wname, $d, $FW_room, $cmd, $values) = @_;
|
||||
|
||||
return undef if($values !~ m/^noArg$/);
|
||||
return "";
|
||||
}
|
||||
|
||||
sub
|
||||
FW_timepickerFn()
|
||||
{
|
||||
@ -3151,6 +3163,8 @@ FW_ActivateInform()
|
||||
If <b>there</b> it contains some known modifiers (colon, followed
|
||||
by a comma separated list), then a different widget will be displayed:
|
||||
<ul>
|
||||
<li>if the modifier is ":noArg", then no further input field is
|
||||
displayed </li>
|
||||
<li>if the modifier is ":time", then a javascript driven timepicker is
|
||||
displayed.</li>
|
||||
<li>if the modifier is of the form
|
||||
|
@ -8,6 +8,8 @@ body { background-color: #444444; background-image:url(../images/dark/darklo
|
||||
|
||||
a { color: #CCCCCC; text-decoration: none;}
|
||||
a:hover { color: #ffffff; }
|
||||
.wide { width:100%; }
|
||||
|
||||
table.block { border:1px solid #ffffff; width: 100%;
|
||||
background: #333333; box-shadow:5px 5px 5px #000; }
|
||||
table.block tr.odd { background: #111111; }
|
||||
@ -45,17 +47,23 @@ div#dist { padding-top:0.3em; }
|
||||
button.dist { margin:10px; background:transparent; border:0px; cursor:pointer; }
|
||||
h2,h3,h4 { color:#EEE; line-height:1.3; margin-top:1.5em; font-family:Verdana; }
|
||||
|
||||
select.attr,input.attr,select.set,input.set { margin-bottom:10px; }
|
||||
a img { border-style:none; }
|
||||
.col2 { text-align:center; }
|
||||
|
||||
/* detail-selector & slider */
|
||||
.makeTable { display:inline; float:left; clear:left;
|
||||
margin-top:10px; margin-bottom:20px;}
|
||||
.makeSelect { display:inline; float:left; clear:left; vertical-align:middle; }
|
||||
|
||||
select { margin-left:5px; margin-right:5px; }
|
||||
.set,.attr { margin-bottom:5px; float:left; }
|
||||
.get,.set,.attr { margin-bottom:5px; float:left; }
|
||||
.slider { margin-left:10px; float:left; width:250px; height:26px; }
|
||||
.set .slider { background:#101010; border-radius:8px; }
|
||||
.get .slider,.set .slider,.attr .slider {
|
||||
background:#101010; border-radius:8px; }
|
||||
|
||||
/* timepicker */
|
||||
.set .set { margin-bottom:2px; margin-top:3px; }
|
||||
|
||||
.slider { margin-left:10px; float:left; width:250px; height:26px;
|
||||
border-style:solid; border-width:2px; border-color:#555555 }
|
||||
|
||||
@ -63,16 +71,18 @@ select { margin-left:5px; margin-right:5px; }
|
||||
height:20px; line-height:20px;
|
||||
-webkit-user-select:none; -moz-user-select:none; -user-select:none;
|
||||
border:2px solid; color:white; text-align:center; }
|
||||
.downText { margin-top:2px; }
|
||||
|
||||
.downText,.makeSelect select { margin:0.7em; }
|
||||
|
||||
|
||||
svg { height:32px; width:32px; fill:#fff; }
|
||||
g.on { fill:red; }
|
||||
|
||||
/* next lines are for remotecontrol */
|
||||
.rc_body { border-style: solid; border-color: gray; border-width: 2px;
|
||||
padding: 5px; background: #101010; font-size:6px;}
|
||||
.rc_button { padding: 5px 7px;}
|
||||
.rc_button img { border-style: solid; border-width: 1px; border-color: transparent; }
|
||||
.rc_body { border-style: solid; border-color: gray; border-width: 2px;
|
||||
padding: 5px; background: #101010; font-size:6px;}
|
||||
.rc_button { padding: 5px 7px;}
|
||||
.rc_button img { border-style: solid; border-width: 1px;
|
||||
border-color: transparent; }
|
||||
.rc_button img:active { border-color: gray; }
|
||||
|
||||
.changed { color:red; }
|
||||
|
14
fhem/www/pgm2/fhemweb_noArg.js
Normal file
14
fhem/www/pgm2/fhemweb_noArg.js
Normal file
@ -0,0 +1,14 @@
|
||||
function
|
||||
FW_noArgSelChange(name, devName, vArr)
|
||||
{
|
||||
if(vArr.length != 1 || vArr[0] != "noArg")
|
||||
return undefined;
|
||||
|
||||
var o = new Object();
|
||||
o.newEl = document.createElement('div');
|
||||
return o;
|
||||
}
|
||||
|
||||
FW_widgets['noArg'] = {
|
||||
selChange:FW_noArgSelChange
|
||||
};
|
@ -59,13 +59,17 @@ div.block { border:1px solid gray; background: #F8F8E0; padding:0.7em; }
|
||||
div.dist { padding-top:0.3em; }
|
||||
button.dist { margin:5px; background:transparent; border:0px; cursor:pointer; }
|
||||
|
||||
.set,.attr { margin-bottom:5px; float:left;}
|
||||
.makeTable { display:inline; float:left; clear:left;
|
||||
margin-top:10px; margin-bottom:20px;}
|
||||
.makeSelect { display:inline; float:left; clear:left; }
|
||||
|
||||
.get,.set,.attr { margin-bottom:5px; float:left;}
|
||||
.slider { float:right; width:320px; height:26px; }
|
||||
.set .slider { background:#F0F0D8; }
|
||||
.get .slider,.set .slider,.attr .slider { background:#F0F0D8; }
|
||||
.handle { position:relative; cursor:pointer; width:50px;
|
||||
height:20px; line-height:20px;
|
||||
-webkit-user-select:none; -moz-user-select:none; -user-select:none;
|
||||
border:3px solid; color:#278727; text-align:center; }
|
||||
|
||||
svg { height:32px; width:32px; fill:#1c7efb; }
|
||||
g.on { fill:red; }
|
||||
g.on { fill:red; }
|
||||
|
@ -87,10 +87,15 @@ button.dist { margin:10px; background:transparent; border:0px; cursor:pointer; }
|
||||
a img { border-style:none; }
|
||||
|
||||
/* detail-selector & slider */
|
||||
.makeTable { display:inline; float:left; clear:left;
|
||||
margin-top:10px; margin-bottom:20px;}
|
||||
.makeSelect { display:inline; float:left; clear:left; }
|
||||
|
||||
select { margin-left:5px; margin-right:5px; background: #fff; border:0px; }
|
||||
.set,.attr { margin-bottom:5px; float:left; }
|
||||
.get,.set,.attr { margin-bottom:5px; float:left; }
|
||||
.slider { float:left; width:250px; height:26px; }
|
||||
.set .slider { background:#F0F0D8; border-radius:8px; }
|
||||
.get .slider,.set .slider,.attr .slider {
|
||||
background:#F0F0D8; border-radius:8px; }
|
||||
/* timepicker */
|
||||
.set .set { margin-bottom:2px; margin-top:3px; }
|
||||
|
||||
@ -115,4 +120,4 @@ svg.icon { margin-left: 7px; margin-right:20px; }
|
||||
g.on { fill:#53d769; }
|
||||
|
||||
table.room svg { height:20px; width:20px; fill:#147bff; }
|
||||
table.room svg.it_raspberry_logo { height: 26px; width: 26px; }
|
||||
table.room svg.it_raspberry_logo { height: 26px; width: 26px; }
|
||||
|
@ -59,9 +59,13 @@ div.block { border:1px solid gray; background: #F8F8E0; padding:0.7em; }
|
||||
div.dist { padding-top:0.3em; }
|
||||
button.dist { margin:5px; background:transparent; border:0px; cursor:pointer; }
|
||||
|
||||
.set,.attr { margin-bottom:5px; float:left;}
|
||||
.makeTable { display:inline; float:left; clear:left;
|
||||
margin-top:10px; margin-bottom:20px;}
|
||||
.makeSelect { display:inline; float:left; clear:left; }
|
||||
|
||||
.set,.get,.attr { margin-bottom:5px; float:left;}
|
||||
.slider { float:right; width:320px; height:26px; }
|
||||
.set .slider { background:#F0F0D8; }
|
||||
.set .slider,.get slider,.attr .slider { background:#F0F0D8; }
|
||||
.handle { position:relative; cursor:pointer; width:50px;
|
||||
height:20px; line-height:20px;
|
||||
-webkit-user-select:none; -moz-user-select:none; -user-select:none;
|
||||
@ -69,3 +73,5 @@ button.dist { margin:5px; background:transparent; border:0px; cursor:pointer; }
|
||||
|
||||
svg { height:32px; width:32px; fill:#278727; }
|
||||
g.on { fill:red; }
|
||||
|
||||
.changed { color:red; }
|
||||
|
@ -39,13 +39,19 @@ a img { border-style:none; }
|
||||
.col2 { text-align:center; }
|
||||
|
||||
/* detail-selector & slider */
|
||||
.makeTable { display:inline; float:left; clear:left;
|
||||
margin-top:10px; margin-bottom:20px;}
|
||||
.makeSelect { display:inline; float:left; clear:left; }
|
||||
|
||||
select { margin-left:5px; margin-right:5px; }
|
||||
.set,.attr { margin-bottom:5px; float:left; }
|
||||
.get,.set,.attr { margin-bottom:5px; float:left; }
|
||||
.slider { float:left; width:250px; height:26px; }
|
||||
.set .slider { background:#F0F0D8; border-radius:8px; }
|
||||
|
||||
/* detail only */
|
||||
.makeSelect .slider {background:#F0F0D8; border-radius:8px;}
|
||||
|
||||
/* timepicker */
|
||||
.set .set { margin-bottom:2px; margin-top:3px; }
|
||||
.changed { color:red; }
|
||||
|
||||
.handle { position:relative; cursor:pointer; width:50px;
|
||||
height:20px; line-height:20px;
|
||||
@ -64,3 +70,5 @@ svg.on,svg.FS20_on { fill:orange; }
|
||||
.rc_button { padding: 5px 7px;}
|
||||
.rc_button img { border-style: solid; border-width: 1px; border-color: transparent; }
|
||||
.rc_button img:active { border-color: gray; }
|
||||
|
||||
.changed { color:red; }
|
||||
|
@ -15,13 +15,15 @@ select { font-family:Arial, sans-serif; font-size:18px}
|
||||
a { color: #278727; }
|
||||
.col2 { text-align:center; }
|
||||
|
||||
.wide { width:100%; }
|
||||
|
||||
table.block { border:1px solid gray; width: 100%; background: #F8F8E0; }
|
||||
table.block tr.odd { background: #F0F0D8; }
|
||||
table.block tr.sel { background: #F0F0D8; }
|
||||
table { -moz-border-radius:8px; border-radius:8px; }
|
||||
|
||||
.col1, .col2, .col3 { padding: 8px; }
|
||||
.dname, .dval { padding: 8px; font-size: 14px; }
|
||||
.dname, .dval { padding: 8px; }
|
||||
|
||||
table.room { border:1px solid gray; width: 100%; background: #D7FFFF; }
|
||||
table.room tr.sel { background: #A0FFFF; }
|
||||
@ -31,13 +33,17 @@ div.dist { padding-top:0.3em; }
|
||||
button.dist { margin:10px; background:transparent; border:0px; cursor:pointer; }
|
||||
|
||||
/* detail-selector & slider */
|
||||
.makeTable { display:inline; float:left; clear:left;
|
||||
margin-top:10px; margin-bottom:20px;}
|
||||
.makeSelect { display:inline; float:left; clear:left; }
|
||||
|
||||
select { margin-left:5px; margin-right:5px; }
|
||||
.set,.attr { margin-bottom:5px; float:left; }
|
||||
.get,.set,.attr { margin-bottom:5px; float:left; }
|
||||
.slider { float:left; width:250px; height:26px; }
|
||||
.set .slider { background:#F0F0D8; border-radius:8px; }
|
||||
/* detail only */
|
||||
.makeSelect .slider {background:#F0F0D8; border-radius:8px;}
|
||||
/* timepicker */
|
||||
.set .set { margin-bottom:2px; margin-top:3px; }
|
||||
.changed { color:red; }
|
||||
|
||||
.handle { position:relative; cursor:pointer; width:50px;
|
||||
height:20px; line-height:20px;
|
||||
@ -54,3 +60,5 @@ g.on { fill:red; }
|
||||
.rc_button { padding: 5px 7px;}
|
||||
.rc_button img { border-style: solid; border-width: 1px; border-color: transparent; }
|
||||
.rc_button img:active { border-color: gray; }
|
||||
|
||||
.changed { color:red; }
|
||||
|
Loading…
Reference in New Issue
Block a user