2
0
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:
rudolfkoenig 2013-08-08 16:34:49 +00:00
parent f85c07daa7
commit 71f9f63ba3
9 changed files with 104 additions and 33 deletions

View File

@ -379,8 +379,10 @@ CUL_Get($@)
my $type = $hash->{TYPE}; my $type = $hash->{TYPE};
return "\"get $type\" needs at least one parameter" if(@a < 2); 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 $arg = ($a[2] ? $a[2] : "");
my ($msg, $err); my ($msg, $err);

View File

@ -142,6 +142,7 @@ FHEMWEB_Initialize($)
$data{webCmdFn}{slider} = "FW_sliderFn"; $data{webCmdFn}{slider} = "FW_sliderFn";
$data{webCmdFn}{timepicker} = "FW_timepickerFn"; $data{webCmdFn}{timepicker} = "FW_timepickerFn";
$data{webCmdFn}{noArg} = "FW_noArg";
$data{webCmdFn}{"~dropdown"}= "FW_dropdownFn"; # Should be the last $data{webCmdFn}{"~dropdown"}= "FW_dropdownFn"; # Should be the last
} }
@ -703,10 +704,11 @@ FW_makeTable($$$@)
my($title, $name, $hash, $cmd) = (@_); my($title, $name, $hash, $cmd) = (@_);
return if(!$hash || !int(keys %{$hash})); 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; FW_pO $title;
my $titleid = lc($title); FW_pO "<table class=\"block wide $class\">";
$titleid =~ s/[^A-Za-z]/_/g;
FW_pO "<table class=\"block wide $titleid\">";
my $si = AttrVal("global", "showInternalValues", 0); my $si = AttrVal("global", "showInternalValues", 0);
my $row = 1; my $row = 1;
@ -758,7 +760,7 @@ FW_makeTable($$$@)
} elsif ($n eq "webCmd"){ } elsif ($n eq "webCmd"){
my $lc = "detail=$name&cmd.$name=set $name"; 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) ). join(":", map {FW_pH("$lc $_",$_,0,"",1,1)} split(":",$val) ).
"</div></td>"; "</div></td>";
@ -780,7 +782,7 @@ FW_makeTable($$$@)
FW_pO "</tr>"; FW_pO "</tr>";
} }
FW_pO "</table>"; 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 = $1 if($list =~ m/([^ ]*):slider,/); # promote a slider if available
$selEl = "room" if($list =~ m/room:/); $selEl = "room" if($list =~ m/room:/);
FW_pO "<div class='makeSelect'>";
FW_pO "<form method=\"$FW_formmethod\" ". FW_pO "<form method=\"$FW_formmethod\" ".
"action=\"$FW_ME$FW_subdir\" autocomplete=\"off\">"; "action=\"$FW_ME$FW_subdir\" autocomplete=\"off\">";
FW_pO FW_hidden("detail", $d); FW_pO FW_hidden("detail", $d);
@ -809,7 +812,7 @@ FW_makeSelect($$$$)
# Initial setting # Initial setting
FW_pO "<script type=\"text/javascript\">" . FW_pO "<script type=\"text/javascript\">" .
"FW_selChange('$selEl','$list','val.$cmd$d')</script>"; "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_pO FW_hidden("detail", $d);
FW_makeSelect($d, "set", getAllSets($d), "set"); 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("Internals", $d, $h);
FW_makeTable("Readings", $d, $h->{READINGS}); FW_makeTable("Readings", $d, $h->{READINGS});
@ -2670,6 +2673,15 @@ FW_sliderFn($$$$$)
"</td>"; "</td>";
} }
sub
FW_noArg($$$$$)
{
my ($FW_wname, $d, $FW_room, $cmd, $values) = @_;
return undef if($values !~ m/^noArg$/);
return "";
}
sub sub
FW_timepickerFn() FW_timepickerFn()
{ {
@ -3151,6 +3163,8 @@ FW_ActivateInform()
If <b>there</b> it contains some known modifiers (colon, followed If <b>there</b> it contains some known modifiers (colon, followed
by a comma separated list), then a different widget will be displayed: by a comma separated list), then a different widget will be displayed:
<ul> <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 <li>if the modifier is ":time", then a javascript driven timepicker is
displayed.</li> displayed.</li>
<li>if the modifier is of the form <li>if the modifier is of the form

View File

@ -8,6 +8,8 @@ body { background-color: #444444; background-image:url(../images/dark/darklo
a { color: #CCCCCC; text-decoration: none;} a { color: #CCCCCC; text-decoration: none;}
a:hover { color: #ffffff; } a:hover { color: #ffffff; }
.wide { width:100%; }
table.block { border:1px solid #ffffff; width: 100%; table.block { border:1px solid #ffffff; width: 100%;
background: #333333; box-shadow:5px 5px 5px #000; } background: #333333; box-shadow:5px 5px 5px #000; }
table.block tr.odd { background: #111111; } 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; } 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; } 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; } a img { border-style:none; }
.col2 { text-align:center; } .col2 { text-align:center; }
/* detail-selector & slider */ /* 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; } 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; } .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 */ /* timepicker */
.set .set { margin-bottom:2px; margin-top:3px; } .set .set { margin-bottom:2px; margin-top:3px; }
.slider { margin-left:10px; float:left; width:250px; height:26px; .slider { margin-left:10px; float:left; width:250px; height:26px;
border-style:solid; border-width:2px; border-color:#555555 } border-style:solid; border-width:2px; border-color:#555555 }
@ -63,8 +71,7 @@ select { margin-left:5px; margin-right:5px; }
height:20px; line-height:20px; height:20px; line-height:20px;
-webkit-user-select:none; -moz-user-select:none; -user-select:none; -webkit-user-select:none; -moz-user-select:none; -user-select:none;
border:2px solid; color:white; text-align:center; } 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; } svg { height:32px; width:32px; fill:#fff; }
@ -74,5 +81,8 @@ g.on { fill:red; }
.rc_body { border-style: solid; border-color: gray; border-width: 2px; .rc_body { border-style: solid; border-color: gray; border-width: 2px;
padding: 5px; background: #101010; font-size:6px;} padding: 5px; background: #101010; font-size:6px;}
.rc_button { padding: 5px 7px;} .rc_button { padding: 5px 7px;}
.rc_button img { border-style: solid; border-width: 1px; border-color: transparent; } .rc_button img { border-style: solid; border-width: 1px;
border-color: transparent; }
.rc_button img:active { border-color: gray; } .rc_button img:active { border-color: gray; }
.changed { color:red; }

View 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
};

View File

@ -59,9 +59,13 @@ div.block { border:1px solid gray; background: #F8F8E0; padding:0.7em; }
div.dist { padding-top:0.3em; } div.dist { padding-top:0.3em; }
button.dist { margin:5px; background:transparent; border:0px; cursor:pointer; } 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; } .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; .handle { position:relative; cursor:pointer; width:50px;
height:20px; line-height:20px; height:20px; line-height:20px;
-webkit-user-select:none; -moz-user-select:none; -user-select:none; -webkit-user-select:none; -moz-user-select:none; -user-select:none;

View File

@ -87,10 +87,15 @@ button.dist { margin:10px; background:transparent; border:0px; cursor:pointer; }
a img { border-style:none; } a img { border-style:none; }
/* detail-selector & slider */ /* 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; } 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; } .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 */ /* timepicker */
.set .set { margin-bottom:2px; margin-top:3px; } .set .set { margin-bottom:2px; margin-top:3px; }

View File

@ -59,9 +59,13 @@ div.block { border:1px solid gray; background: #F8F8E0; padding:0.7em; }
div.dist { padding-top:0.3em; } div.dist { padding-top:0.3em; }
button.dist { margin:5px; background:transparent; border:0px; cursor:pointer; } 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; } .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; .handle { position:relative; cursor:pointer; width:50px;
height:20px; line-height:20px; height:20px; line-height:20px;
-webkit-user-select:none; -moz-user-select:none; -user-select:none; -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; } svg { height:32px; width:32px; fill:#278727; }
g.on { fill:red; } g.on { fill:red; }
.changed { color:red; }

View File

@ -39,13 +39,19 @@ a img { border-style:none; }
.col2 { text-align:center; } .col2 { text-align:center; }
/* detail-selector & slider */ /* 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; } 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; } .slider { float:left; width:250px; height:26px; }
.set .slider { background:#F0F0D8; border-radius:8px; }
/* detail only */
.makeSelect .slider {background:#F0F0D8; border-radius:8px;}
/* timepicker */ /* timepicker */
.set .set { margin-bottom:2px; margin-top:3px; } .set .set { margin-bottom:2px; margin-top:3px; }
.changed { color:red; }
.handle { position:relative; cursor:pointer; width:50px; .handle { position:relative; cursor:pointer; width:50px;
height:20px; line-height:20px; height:20px; line-height:20px;
@ -64,3 +70,5 @@ svg.on,svg.FS20_on { fill:orange; }
.rc_button { padding: 5px 7px;} .rc_button { padding: 5px 7px;}
.rc_button img { border-style: solid; border-width: 1px; border-color: transparent; } .rc_button img { border-style: solid; border-width: 1px; border-color: transparent; }
.rc_button img:active { border-color: gray; } .rc_button img:active { border-color: gray; }
.changed { color:red; }

View File

@ -15,13 +15,15 @@ select { font-family:Arial, sans-serif; font-size:18px}
a { color: #278727; } a { color: #278727; }
.col2 { text-align:center; } .col2 { text-align:center; }
.wide { width:100%; }
table.block { border:1px solid gray; width: 100%; background: #F8F8E0; } table.block { border:1px solid gray; width: 100%; background: #F8F8E0; }
table.block tr.odd { background: #F0F0D8; } table.block tr.odd { background: #F0F0D8; }
table.block tr.sel { background: #F0F0D8; } table.block tr.sel { background: #F0F0D8; }
table { -moz-border-radius:8px; border-radius:8px; } table { -moz-border-radius:8px; border-radius:8px; }
.col1, .col2, .col3 { padding: 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 { border:1px solid gray; width: 100%; background: #D7FFFF; }
table.room tr.sel { background: #A0FFFF; } 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; } button.dist { margin:10px; background:transparent; border:0px; cursor:pointer; }
/* detail-selector & slider */ /* 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; } 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; } .slider { float:left; width:250px; height:26px; }
.set .slider { background:#F0F0D8; border-radius:8px; } /* detail only */
.makeSelect .slider {background:#F0F0D8; border-radius:8px;}
/* timepicker */ /* timepicker */
.set .set { margin-bottom:2px; margin-top:3px; } .set .set { margin-bottom:2px; margin-top:3px; }
.changed { color:red; }
.handle { position:relative; cursor:pointer; width:50px; .handle { position:relative; cursor:pointer; width:50px;
height:20px; line-height:20px; height:20px; line-height:20px;
@ -54,3 +60,5 @@ g.on { fill:red; }
.rc_button { padding: 5px 7px;} .rc_button { padding: 5px 7px;}
.rc_button img { border-style: solid; border-width: 1px; border-color: transparent; } .rc_button img { border-style: solid; border-width: 1px; border-color: transparent; }
.rc_button img:active { border-color: gray; } .rc_button img:active { border-color: gray; }
.changed { color:red; }