2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-12 22:56:34 +00:00

01_FHEMWEB.pm: change the room separator to -> from -- (Forum #82151)

git-svn-id: https://svn.fhem.de/fhem/trunk@15795 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2018-01-05 20:46:21 +00:00
parent ec65198aaf
commit 39b337a703
8 changed files with 30 additions and 28 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- feature: 01_FHEMWEB.pm: -> as room separator (Forum #82151)
- bugfix: 10_FRM: accept Firmata firmware without AnalogInputFirmata
- bugfix: 10_MYSENSORS_DEVICE: corrected S_LIGHT_LEVEL
- bugfix: 93_DbRep: fix "month out of range" that causes fhem crash

View File

@ -646,10 +646,7 @@ FW_AsyncOutput($$)
$ret = $1;
} else {
$ret =~ s/&/&/g;
$ret =~ s/'/'/g;
$ret =~ s/</&lt;/g;
$ret =~ s/>/&gt;/g;
$ret = FW_htmlEscape($ret);
$ret = "<pre>$ret</pre>" if($ret =~ m/\n/ );
$ret =~ s/\n/<br>/g;
}
@ -1522,10 +1519,7 @@ FW_roomOverview($)
next if($r eq "hidden" || $FW_hiddenroom{$r});
$FW_room = AttrVal($FW_wname, "defaultRoom", $r)
if(!$FW_room && $FW_ss);
my $lr = $r;
$lr =~ s/</&lt;/g;
$lr =~ s/>/&gt;/g;
push @list1, $lr;
push @list1, FW_htmlEscape($r);
push @list2, "$FW_ME?room=".urlEncode($r);
}
my $sfx = AttrVal("global", "language", "EN");
@ -1576,6 +1570,7 @@ FW_roomOverview($)
} else {
my $tblnr = 1;
my $roomEscaped = FW_htmlEscape($FW_room);
foreach(my $idx = 0; $idx < @list1; $idx++) {
my ($l1, $l2) = ($list1[$idx], $list2[$idx]);
if(!$l1) {
@ -1586,7 +1581,7 @@ FW_roomOverview($)
}
} else {
FW_pF "<tr%s>", $l1 eq $FW_room ? " class=\"sel\"" : "";
FW_pF "<tr%s>", $l1 eq $roomEscaped ? " class=\"sel\"" : "";
my $class = "menu_$l1";
$class =~ s/[^A-Z0-9]/_/gi;
@ -3152,6 +3147,7 @@ FW_htmlEscape($)
$txt =~ s/&/&amp;/g;
$txt =~ s/</&lt;/g;
$txt =~ s/>/&gt;/g;
$txt =~ s/'/&apos;/g;
# $txt =~ s/\n/<br>/g;
return $txt;
}

View File

@ -332,7 +332,7 @@ at_fhemwebFn($$$$)
my $isPerl = ($ts =~ m/^{(.*)}/);
$ts = $1 if($isPerl);
my $h1 = "<br>Change Wizard:".
my $h1 .= "<div class='makeTable wide'><span>Change wizard</span>".
"<table class='block wide' id='atWizard' nm='$hash->{NAME}' ts='$ts' ".
"rl='$hash->{RELATIVE}' ".
"pr='$hash->{PERIODIC}' ip='$isPerl' class='block wide'>".<<'EOF';
@ -385,7 +385,7 @@ EOF
my @d = split(" ",$hash->{DEF},2);
LoadModule("notify");
my ($h2, $j2) = notfy_addFWCmd($d, $d[0], 2);
return "$h1$h2</table><br>$j1$j2";
return "$h1$h2</table></div><br>$j1$j2";
}
1;

View File

@ -228,7 +228,8 @@ notify_fhemwebFn($$$$)
my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn.
my $hash = $defs{$d};
my $ret .= "Change wizard<br><table class='block wide'>";
my $ret .= "<div class='makeTable wide'><span>Change wizard</span>".
"<table class='block wide'>";
my $row = 0;
my @ra = split(/\|/, $hash->{REGEXP});
$ret .= "<tr class='".(($row++&1)?"odd":"even").
@ -274,7 +275,7 @@ notify_fhemwebFn($$$$)
$ret .= "</td></tr>";
}
my ($tr, $js) = notfy_addFWCmd($d, $hash->{REGEXP}, $row);
return "$ret$tr</table><br>$js";
return "$ret$tr</table></div><br>$js";
}
sub

View File

@ -393,11 +393,11 @@ SVG_PEdit($$$$)
$ret .= "<form $pestyle id=\"pedit\" method=\"$FW_formmethod\" autocomplete=\"off\" ".
"action=\"$FW_ME/SVG_WriteGplot\">";
$ret .= "Plot Editor";
$ret .= FW_hidden("detail", $d); # go to detail after save
if(defined($FW_pos{zoom}) && defined($FW_pos{off})) { # for showData
$ret .= FW_hidden("pos", "zoom=$FW_pos{zoom};off=$FW_pos{off}");
}
$ret .= "<div class='makeTable wide'><span>Plot Editor</span>";
$ret .= "<table class=\"block wide plotEditor\">";
$ret .= "<tr class=\"even\">";
$ret .= "<td>Plot title</td>";
@ -549,7 +549,7 @@ SVG_PEdit($$$$)
FW_submit("showFileLogData", "Show preprocessed input").
"</td></tr>";
$ret .= "</table></form>";
$ret .= "</table></div></form>";
my $sl = "$FW_ME/SVG_WriteGplot?detail=$d&showFileLogData=1";
if(defined($FW_pos{zoom}) && defined($FW_pos{off})) {

View File

@ -406,12 +406,13 @@ Device specific attributes are documented in the corresponding device section.
<a name="room"></a>
<li>room<br>
Filter/group devices. Recognized by web-pgm2 and web-pgm3. A device
can appear in more than one room, in this case the rooms have to be
specified comma-separated.<br>
Filter/group devices in frontends. A device can appear in more than one
room, in this case the rooms have to be specified comma-separated.<br>
Devices in the room hidden will not appear in the web output, or set
the <a href="#hiddenroom"> FHEMWEB attribute to selectively disable
rooms for certain FHEMWEB instances.
the FHEMWEB attribute <a href="#hiddenroom">hiddenroom</a> to
selectively disable rooms for certain FHEMWEB instances.
The -&gt; string is considered as a structure separator for rooms, e.g.
"1st. floor-&gt;Master bedroom".
</li><br>
<a name="suppressReading"></a>

View File

@ -416,6 +416,7 @@ Ger&auml;t dokumentiert.
angegeben werden.<br>
Ger&auml;te, die dem Raum mit der Bezeichnung "hidden" zugeordnet
werden, erscheinen nicht auf der Webseite.
Mit -&gt; werden R&auml;ume strukturiert, z.Bsp. OG-&gt;Schlafzimmer
</li><br>
<a name="showtime"></a>

View File

@ -829,14 +829,14 @@ FW_treeMenu()
$("div#menu table.room").each(function(){ // one loop per Block
var t = this, ma = {};
$(t).find("td > div > a > span").each(function(e){
var span = this, spanTxt = $(span).html();
var ta = spanTxt.split("--");
var span = this, spanTxt = $(span).text();
var ta = spanTxt.split("->");
if(ta.length <= 1)
return;
fnd = true;
var nxt="", lst="", tr=$(span).closest("tr");
for(var i1=0; i1<ta.length-1; i1++) {
nxt += "--"+ta[i1];
nxt += "->"+ta[i1];
if(!ma[nxt]) {
$(tr).before("<tr class='menuTree closed level"+i1+"' "+
"data-mTree='"+lst+"' data-nxt='"+nxt+"'>"+
@ -861,7 +861,7 @@ FW_treeMenu()
"tr.menuTree.open { font-weight: bold; }"+
"tr.menuTree > td > div > div { "+
"display:inline-block; width:1em; height:1em; float:right;"+
"background-size: contain;"+
"background-size: contain; background-repeat: no-repeat;"+
"}"+
"</style>");
var t = $("div#menu table.room");
@ -871,9 +871,9 @@ FW_treeMenu()
.css("background-image", "url('"+arrowRight+"')");
var selRoom = $("div#content").attr("room");
if(selRoom) {
var ta = selRoom.split("--"), nxt="";
var ta = selRoom.split("->"), nxt="";
for(var i1=0; i1<ta.length-1; i1++) {
nxt += "--"+FW_escapeSelector(ta[i1]);
nxt += FW_escapeSelector("->"+ta[i1]);
treeClick($(t).find("tr.menuTree[data-nxt="+nxt+"]"));
}
}
@ -900,7 +900,7 @@ FW_escapeSelector(s)
{
if(typeof s != 'string')
return s;
return s.replace(/[ .#\[\]]/g, function(r) { return '\\'+r });
return s.replace(/[ .#\[\]>]/g, function(r) { return '\\'+r });
}
/*************** LONGPOLL START **************/
@ -1130,6 +1130,8 @@ FW_detailSelect(selEl, mayMissing)
var selVal = $(selEl).val();
var div = $(selEl).closest("div.makeSelect");
if(!div.attr("list")) // hiddenRoom=input
return;
var arg,
listArr = $(div).attr("list").split(" "),
devName = $(div).attr("dev"),