diff --git a/fhem/FHEM/00_CUL.pm b/fhem/FHEM/00_CUL.pm
index 44c5ae4ba..bfb68d027 100755
--- a/fhem/FHEM/00_CUL.pm
+++ b/fhem/FHEM/00_CUL.pm
@@ -1333,7 +1333,7 @@ CUL_prefix($$$)
and RAWMSG for the CUL family and RAWMSG for the FHZ.
-
connectCommand
+ connectCommand
raw culfw command sent to the CUL after a (re-)connect of the USB device,
and sending the usual initialization needed for the configured rfmode.
@@ -1643,7 +1643,7 @@ CUL_prefix($$$)
RSSI und RAWMSG für die CUL Familie und RAWMSG für FHZ.
- connectCommand
+ connectCommand
culfw Befehl, was nach dem Verbindungsaufbau mit dem USB-Gerät, nach
Senden der zum Initialisieren der konfigurierten rfmode benötigten
Befehle gesendet wird.
diff --git a/fhem/FHEM/00_FBAHAHTTP.pm b/fhem/FHEM/00_FBAHAHTTP.pm
index d5591aaa2..31d1b73bc 100644
--- a/fhem/FHEM/00_FBAHAHTTP.pm
+++ b/fhem/FHEM/00_FBAHAHTTP.pm
@@ -287,7 +287,7 @@ FBAHAHTTP_Write($$$)
disabledForIntervals
dummy
fritzbox-user
- polltime
+ polltime
measured in seconds, default is 300 i.e. 5 minutes
diff --git a/fhem/FHEM/10_ZWave.pm b/fhem/FHEM/10_ZWave.pm
index 0650bdf8c..c571132fc 100755
--- a/fhem/FHEM/10_ZWave.pm
+++ b/fhem/FHEM/10_ZWave.pm
@@ -5487,7 +5487,7 @@ s2Hex($)
do_not_notify
dummy
- eventForRaw
+ eventForRaw
Generate an an additional event for the RAW message. Can be used if
someone fears that critical notifies wont work, if FHEM changes the event
text after an update.
diff --git a/fhem/contrib/commandref_modular.pl b/fhem/contrib/commandref_modular.pl
index 271d964f2..40710fd07 100644
--- a/fhem/contrib/commandref_modular.pl
+++ b/fhem/contrib/commandref_modular.pl
@@ -5,6 +5,7 @@
use strict;
use warnings;
+my $protVersion=1;
my @lang = ("EN", "DE");
my $modDir = "FHEM";
my $now = time();
@@ -16,6 +17,7 @@ for my $lang (@lang) {
open(FH, $cmdref) || die("Cant open $cmdref: $!\n");
my $type = "";
+ my $fileVersion = 0;
while(my $l = ) {
if($l =~ m//) {
$type = $1; next;
@@ -36,12 +38,24 @@ for my $lang (@lang) {
my $type = "device";
while(my $l = ) {
$type = $1 if($l =~ m,,);
+ $fileVersion = $1 if($type && $l =~ m//);
+
if($l =~ m,(.*) | (.*) | , &&
- !$modData{$1}) { # commandref_frame has prio
+ !$modData{$1}{type}) { # commandref_frame has prio
$modData{$1}{type} = $type;
$modData{$1}{"summary$sfx"} = $2;
$modData{$1}{ts} = $cmptime;
}
+
+ if($l =~ m,]*> ([^<]+)
,) {
+ for my $ml (split(" ", $1)) {
+ my @kv=split(/[:,]/,$ml);
+ my $n = shift(@kv);
+ for my $v (@kv) {
+ $modData{$n}{modLinks}{$v} = 1;
+ }
+ }
+ }
}
close(FH);
}
@@ -51,14 +65,21 @@ for my $lang (@lang) {
next if($fName !~ m/^\d\d_(.*)\.pm$/);
my $mName = $1;
my $ts = (stat("$modDir/$fName"))[9];
- if(!$modData{$mName} || !$modData{$mName}{ts} || $modData{$mName}{ts}<$ts) {
+ if($protVersion != $fileVersion ||
+ !$modData{$mName} || !$modData{$mName}{ts} || $modData{$mName}{ts}<$ts) {
print "Checking $fName for $lang short description\n";
$modData{$mName}{type}="device" if(!$modData{$mName}{type});
+ delete($modData{$mName}{modLinks});
open(FH, "$modDir/$fName") || die("Cant open $modDir/$fName: $!\n");
+ my $ishtml;
while(my $l = ) {
+ $ishtml = 1 if($l =~ m/^=begin\s+html/);
+ next if(!$ishtml);
$modData{$mName}{type}=$1 if($l =~ m/^=item\s+(helper|command|device)/);
$modData{$mName}{$1} =$2 if($l =~ m/^=item\s+(summary[^ ]*)\s(.*)$/);
+ $modData{$mName}{modLinks}{$1} = 1
+ if($l =~ m// && $1 !~ m/^$mName/);
}
close(FH);
}
@@ -71,6 +92,7 @@ for my $lang (@lang) {
$cmdref = ">docs/commandref${sfx}.html";
open(OUT, $cmdref) || die("Cant open $cmdref: $!\n");
+ my $linkDumped = 0;
while(my $l = ) {
print OUT $l;
@@ -82,13 +104,24 @@ EOF
}
if($l =~ m,,) {
+ my @mList = sort {uc($a) cmp uc($b)} keys %modData;
+ if(!$linkDumped) {
+ my $ml = "";
+ for my $m (@mList) {
+ next if(!$modData{$m}{modLinks});
+ $ml .= " $m:".join(",", keys(%{$modData{$m}{modLinks}}));
+ }
+ print OUT "$ml
\n";
+ $linkDumped = 1;
+ }
my $type = $1;
while(my $l = ) {
last if($l !~ m/\n";
+ print OUT "\n";
my $rc = "odd";
- for my $m (sort {uc($a) cmp uc($b)} keys %modData) {
+ for my $m (@mList) {
next if(!$modData{$m}{type} || $modData{$m}{type} ne $type);
my $d = $modData{$m}{"summary$sfx"};
if(!$d) {
@@ -107,4 +140,6 @@ EOF
}
}
+ close(OUT);
+ close(IN);
}
diff --git a/fhem/www/pgm2/fhemdoc_modular.js b/fhem/www/pgm2/fhemdoc_modular.js
index 876a92538..f5d2d8606 100644
--- a/fhem/www/pgm2/fhemdoc_modular.js
+++ b/fhem/www/pgm2/fhemdoc_modular.js
@@ -1,5 +1,5 @@
-var fd_Hash={}, fd_List=[], fd_All={}, fd_AllCnt, fd_Progress=0, fd_Lang,
- fd_Offsets=[], scrolled=0;
+var fd_loadedHash={}, fd_loadedList=[], fd_all={}, fd_allCnt, fd_progress=0,
+ fd_lang, fd_offsets=[], fd_scrolled=0, fd_modLinks={};
function
@@ -34,13 +34,15 @@ fd_fC(fn, callback)
function
loadOneDoc(mname, lang)
{
+ var origLink = mname;
+
function
done(err, calc)
{
- if(fd_Progress) {
- fd_status(fd_Progress+" / "+fd_AllCnt);
- if(++fd_Progress > fd_AllCnt) {
- fd_Progress = 0;
+ if(fd_progress) {
+ fd_status(fd_progress+" / "+fd_allCnt);
+ if(++fd_progress > fd_allCnt) {
+ fd_progress = 0;
setTimeout(calcOffsets,100); // Firefox returns wrong offsets
fd_status("");
}
@@ -48,11 +50,13 @@ loadOneDoc(mname, lang)
if(calc)
setTimeout(calcOffsets,100);
if(!err)
- location.href = "#"+mname;
+ setTimeout(function(){location.href = "#"+origLink;}, 100);
}
}
- if(fd_Hash[mname] && fd_Hash[mname] == lang)
+ if(fd_modLinks[mname])
+ mname = fd_modLinks[mname];
+ if(fd_loadedHash[mname] && fd_loadedHash[mname] == lang)
return done(false, false);
fd_fC("help "+mname+" "+lang, function(ret){
@@ -62,33 +66,53 @@ loadOneDoc(mname, lang)
ret = ret.replace(/<\/?html>/g,'');
ret = ret.replace(/Keine deutsche Hilfe gefunden!
/,'');
ret = ''+ret+'
';
+ ret = ret.replace(/target="_blank"/g, ''); // revert help URL rewrite
+ ret = ret.replace(/href=".*commandref.*.html#/g, 'href="#');
- if(fd_Hash[mname])
+ if(fd_loadedHash[mname])
$("div#FD_"+mname).remove();
- if(!fd_Hash[mname])
- fd_List.push(mname);
- fd_Hash[mname] = lang;
- fd_List.sort();
+ if(!fd_loadedHash[mname])
+ fd_loadedList.push(mname);
+ fd_loadedHash[mname] = lang;
+ fd_loadedList.sort();
var idx=0;
- while(fd_List[idx] != mname)
+ while(fd_loadedList[idx] != mname)
idx++;
var toIns = "perl";
- if(idx < fd_List.length-1)
- toIns = fd_List[idx+1];
- $(ret).insertBefore("a[name="+toIns+"]");
+ if(idx < fd_loadedList.length-1)
+ toIns = fd_loadedList[idx+1];
console.log("insert "+mname+" before "+toIns);
+ $(ret).insertBefore("a[name="+toIns+"]");
+ addAHooks("div#FD_"+mname);
return done(false, true);
});
}
+function
+addAHooks(el)
+{
+ $(el).find("a[href]").each(function(){
+ var href = $(this).attr("href");
+ if(!href || href.indexOf("#") != 0)
+ return;
+ href = href.substr(1);
+ if(fd_modLinks[href] && !fd_loadedHash[href]) {
+ $(this).click(function(){
+ $("a[href=#"+href+"]").unbind('click');
+ loadOneDoc(href, fd_lang);
+ });
+ }
+ });
+}
+
function
calcOffsets()
{
- fd_Offsets=[];
- for(var i1=0; i1= viewTop && viewBottom > fd_Offsets[idx]+30)
+ while(idx= viewTop && viewBottom > fd_offsets[idx]+30)
break;
idx++;
}
- if(idx >= fd_Offsets.length) {
+ if(idx >= fd_offsets.length) {
$("a#otherLang").hide();
} else {
- var mname = fd_List[idx];
- var l1 = fd_Hash[mname], l2 = (l1=="EN" ? "DE" : "EN");
+ var mname = fd_loadedList[idx];
+ var l1 = fd_loadedHash[mname], l2 = (l1=="EN" ? "DE" : "EN");
$("a#otherLang span.mod").html(mname);
$("a#otherLang span[lang="+l1+"]").hide();
$("a#otherLang span[lang="+l2+"]").show();
@@ -126,41 +150,58 @@ function
loadOtherLang()
{
var mname = $("a#otherLang span.mod").html();
- loadOneDoc(mname, fd_Hash[mname]=="EN" ? "DE" : "EN");
+ loadOneDoc(mname, fd_loadedHash[mname]=="EN" ? "DE" : "EN");
}
$(document).ready(function(){
var p = location.pathname;
- fd_Lang = p.substring(p.indexOf("commandref")+11,p.indexOf(".html"));
- if(!fd_Lang || fd_Lang == '.')
- fd_Lang = "EN";
+ fd_lang = p.substring(p.indexOf("commandref")+11,p.indexOf(".html"));
+ if(!fd_lang || fd_lang == '.')
+ fd_lang = "EN";
- $("h3").each(function(){ fd_Hash[$(this).html()] = fd_Lang; });
+ $("div#modLinks").each(function(){
+ var a1 = $(this).html().split(" ");
+ for(var i1=0; i1