Javascripting support for FHEMWEB

git-svn-id: https://svn.fhem.de/fhem/trunk@438 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2009-09-13 07:20:09 +00:00
parent 6c55952ec0
commit 05f0f100cc
2 changed files with 12 additions and 0 deletions

View File

@@ -529,3 +529,4 @@
- feature: CUL: device acces code reorganized, TCP/IP support added
- feature: Pachube module from Axel
- feature: dumpdef module from Axel in contrib
- feature: javascripting support in FHEMWEB (Klaus/Axel)

View File

@@ -229,12 +229,14 @@ FW_AnswerCall($)
close(FH);
$__RETTYPE = "text/plain; charset=ISO-8859-1" if($f !~ m/\.*html$/);
return 1;
} elsif($arg =~ m,^$__ME/(.*).css,) {
open(FH, "$__dir/$1.css") || return;
pO join("", <FH>);
close(FH);
$__RETTYPE = "text/css";
return 1;
} elsif($arg =~ m,^$__ME/icons/(.*)$,) {
open(FH, "$__dir/$1") || return;
binmode (FH); # necessary for Windows
@@ -243,9 +245,18 @@ FW_AnswerCall($)
my @f_ext = split(/\./,$1); #kpb
$__RETTYPE = "image/$f_ext[-1]";
return 1;
} elsif($arg =~ m,^$__ME/(.*).js,) { #kpb java include
open(FH, "$__dir/$1.js") || return;
pO join("", <FH>);
close(FH);
$__RETTYPE = "application/javascript";
return 1;
} elsif($arg !~ m/^$__ME(.*)/) {
Log(5, "Unknown document $arg requested");
return 0;
}
##############################