mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-19 18:56:03 +00:00
FHEMWEB: new CssFiles attribute (Forum #26350)
fhemweb_slider: no page-reload on changes (Forum #26313) git-svn-id: https://svn.fhem.de/fhem/trunk@6447 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e273b00de1
commit
37ee3824e0
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# 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.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- FHEMWEB: JavaScripts and CssFiles attributes added
|
||||||
- change: avoid updating weather information on get (59_Weather.pm)
|
- change: avoid updating weather information on get (59_Weather.pm)
|
||||||
- change: removed noshutdown=0 for HTTP connections made in 57_Calendar.pm
|
- change: removed noshutdown=0 for HTTP connections made in 57_Calendar.pm
|
||||||
and 59_Weather.pm to address issues when FHEM is behind
|
and 59_Weather.pm to address issues when FHEM is behind
|
||||||
|
@ -127,6 +127,7 @@ FHEMWEB_Initialize($)
|
|||||||
my @attrList = qw(
|
my @attrList = qw(
|
||||||
CORS:0,1
|
CORS:0,1
|
||||||
HTTPS:1,0
|
HTTPS:1,0
|
||||||
|
CssFiles
|
||||||
JavaScripts
|
JavaScripts
|
||||||
SVGcache:1,0
|
SVGcache:1,0
|
||||||
addStateEvent
|
addStateEvent
|
||||||
@ -642,7 +643,10 @@ FW_answerCall($)
|
|||||||
FW_pO "<meta http-equiv=\"refresh\" content=\"$rf\">" if($rf);
|
FW_pO "<meta http-equiv=\"refresh\" content=\"$rf\">" if($rf);
|
||||||
}
|
}
|
||||||
|
|
||||||
FW_pO "<link href=\"$FW_ME/pgm2/style.css\" rel=\"stylesheet\"/>";
|
my $cssTemplate = "<link href=\"$FW_ME/%s\" rel=\"stylesheet\"/>";
|
||||||
|
FW_pO sprintf($cssTemplate, "pgm2/style.css");
|
||||||
|
my @cssFiles = split(" ", AttrVal($FW_wname, "CssFiles", ""));
|
||||||
|
map { FW_pO sprintf($cssTemplate, $_); } @cssFiles;
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# FW Extensions
|
# FW Extensions
|
||||||
@ -3076,6 +3080,15 @@ FW_widgetOverride($$)
|
|||||||
FHEM-Server, and iPad/iPhone as Web-client.
|
FHEM-Server, and iPad/iPhone as Web-client.
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
|
<a name="CssFiles"></a>
|
||||||
|
<li>CssFiles<br>
|
||||||
|
Space separated list of .css files to be included. The filenames
|
||||||
|
are relative to the www directory. Example:
|
||||||
|
<ul><code>
|
||||||
|
attr WEB CssFiles pgm2/mystyle.css
|
||||||
|
</code></ul>
|
||||||
|
</li><br>
|
||||||
|
|
||||||
<a name="JavaScripts"></a>
|
<a name="JavaScripts"></a>
|
||||||
<li>JavaScripts<br>
|
<li>JavaScripts<br>
|
||||||
Space separated list of JavaScript files to be included. The filenames
|
Space separated list of JavaScript files to be included. The filenames
|
||||||
@ -3619,6 +3632,15 @@ FW_widgetOverride($$)
|
|||||||
beheben.
|
beheben.
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
|
<a name="CssFiles"></a>
|
||||||
|
<li>CssFiles<br>
|
||||||
|
Leerzeichen getrennte Liste von .css Dateien, die geladen werden.
|
||||||
|
Die Dateinamen sind relativ zum www Verzeichnis anzugeben. Beispiel:
|
||||||
|
<ul><code>
|
||||||
|
attr WEB CssFiles pgm2/mystyle.css
|
||||||
|
</code></ul>
|
||||||
|
</li><br>
|
||||||
|
|
||||||
<a name="JavaScripts"></a>
|
<a name="JavaScripts"></a>
|
||||||
<li>JavaScripts<br>
|
<li>JavaScripts<br>
|
||||||
Leerzeichen getrennte Liste von JavaScript Dateien, die geladen werden.
|
Leerzeichen getrennte Liste von JavaScript Dateien, die geladen werden.
|
||||||
|
@ -17,11 +17,9 @@ log(txt)
|
|||||||
function
|
function
|
||||||
addcsrf(arg)
|
addcsrf(arg)
|
||||||
{
|
{
|
||||||
var oarg=arg;
|
|
||||||
var csrf = document.body.getAttribute('fwcsrf');
|
var csrf = document.body.getAttribute('fwcsrf');
|
||||||
if(csrf && arg.indexOf('fwcsrf') < 0)
|
if(csrf && arg.indexOf('fwcsrf') < 0)
|
||||||
arg += '&fwcsrf='+csrf;
|
arg += '&fwcsrf='+csrf;
|
||||||
log(oarg+" -> "+arg);
|
|
||||||
return arg;
|
return arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,9 +86,8 @@ FW_doUpdate()
|
|||||||
if(el.nodeName.toLowerCase() == "select") {
|
if(el.nodeName.toLowerCase() == "select") {
|
||||||
// dropdown: set the selected index to the current value
|
// dropdown: set the selected index to the current value
|
||||||
for(var j=0;j<el.options.length;j++)
|
for(var j=0;j<el.options.length;j++)
|
||||||
if(el.options[j].value == d[2]) {
|
if(el.options[j].value == d[2])
|
||||||
el.selectedIndex = j;
|
el.selectedIndex = j;
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
el.innerHTML=d[2];
|
el.innerHTML=d[2];
|
||||||
@ -100,11 +97,9 @@ FW_doUpdate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var w in FW_widgets) {
|
for(var w in FW_widgets)
|
||||||
if(FW_widgets[w].updateLine) {
|
if(FW_widgets[w].updateLine)
|
||||||
FW_widgets[w].updateLine(d);
|
FW_widgets[w].updateLine(d);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(d[0].indexOf("-") == -1) // Wont contain -
|
if(d[0].indexOf("-") == -1) // Wont contain -
|
||||||
devs.push(d[0]);
|
devs.push(d[0]);
|
||||||
|
@ -93,10 +93,9 @@ FW_sliderCreate(slider, curr)
|
|||||||
document.onmousemove = oldFn1; document.onmouseup = oldFn2;
|
document.onmousemove = oldFn1; document.onmouseup = oldFn2;
|
||||||
document.ontouchmove = oldFn3; document.ontouchend = oldFn4;
|
document.ontouchmove = oldFn3; document.ontouchend = oldFn4;
|
||||||
if(cmd) {
|
if(cmd) {
|
||||||
if(cmd.substring(0,3) != "js:") {
|
if(cmd.substring(0,3) != "js:")
|
||||||
if(typeof val != "undefined")
|
if(typeof val != "undefined")
|
||||||
document.location = cmd.replace('%',val);
|
FW_cmd(cmd.replace('%',val)+"&XHR=1");
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if(typeof val != "undefined")
|
if(typeof val != "undefined")
|
||||||
slider.nextSibling.setAttribute('value', val);
|
slider.nextSibling.setAttribute('value', val);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user