diff --git a/fhem/CHANGED b/fhem/CHANGED index 579875d3b..0ce3c027e 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,24 +1,35 @@ # 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: fhemweb.js rewrite based on jQuery, single-widget-implementation + - feature: SVG: multiple sources allowed, Plot-Editor + - feature: textfield-long and knob widgets - added: some new icons by Rampler - - feature: PRESENCE: new reading "presence" which contains the current (or last known) - presence state (can be "absent" or "present") - - bugfix: 70_Jabber.pm: hardening XML::Stream Process() call and fix of ssl_verify - - feature: readingsGroup: allow devspec :FILTER= expressions in device selection + - feature: PRESENCE: new reading "presence" which contains the current (or + last known) presence state (can be "absent" or "present") + - bugfix: 70_Jabber.pm: hardening XML::Stream Process() call and fix of + ssl_verify + - feature: readingsGroup: allow devspec :FILTER= expressions in device + selection - added: 73_km200.pm for the Buderus KM200 heating controller (Sailor) - feature: 70_XBMC: added command 'connect' to connect instantly - - change: FB_CALLMONITOR: use standard file read/write function to support use of configDb - - bugfix: FB_CALLMONITOR: fix phonebook file read when using configDb (Forum #30244) - - feature: 70_XBMC: added commands: openmovieid, openepisodeid, addon, jsonraw (thanks to siggi85) + - change: FB_CALLMONITOR: use standard file read/write function to support + use of configDb + - bugfix: FB_CALLMONITOR: fix phonebook file read when using configDb (Forum + #30244) + - feature: 70_XBMC: added commands: openmovieid, openepisodeid, addon, + jsonraw (thanks to siggi85) - fix: 70_XBMC: made fork attribute to close file handles correctly - feature: 70_XBMC: added mechanism to detect disconnects (TCP) - fix: 66_ECMD: avoid reading from a closed connection in ECMD_READ - - feature: 70_PIONEERAVR: readings for currentAlbum etc., more internals (network settings, moved some from readings to internals), new attributes volumeLimit & volumeLimitStraight + - feature: 70_PIONEERAVR: readings for currentAlbum etc., more internals + (network settings, moved some from readings to internals), new attributes + volumeLimit & volumeLimitStraight - added: some new icons (hourglass, frost, sani_heating_level_XX) - fix: sani_heating_boost (possibility to colorize) - feature: FB_CALLMONITOR: add remote phonebook lookup via telnet connection to FritzBox (JoWiemann). - - bugfix: 70_PIONEERAVR & 71_PIONEERAVRZONE: fixed not working set-extensions (on-for-timer,...) + - bugfix: 70_PIONEERAVR & 71_PIONEERAVRZONE: fixed not working set-extensions + (on-for-timer,...) - feature: fheminfo: report third-party modules - feature: 99_Utils.pm: add getUniqueID, getKeyValue, setKeyValue - feature: SMARTMON: additional parameters for smartctl @@ -33,7 +44,8 @@ - feature: HUEDevice: allow ct presets in webCmd new subTypes extcolordimer and ctdimer start support for Lightify bulbs - - added: SONOS and SONOSPLAYER to support Sonos Multiroom Audiosystems (Reinerlein) + - added: SONOS and SONOSPLAYER to support Sonos Multiroom Audiosystems + (Reinerlein) - change: 64_ESA2000.pm: add batterystate - added: 42_SMARTMON: Frontend to smartctl (maintainer: hexenmeister) - feature: 70_PushNotifier added line break in Messages (xusader) @@ -43,7 +55,8 @@ - bugfix: FB_CALLMONITOR: fixing not working company numbers reverse search for search.ch - bugfix: 70_PushNotifier repair set function (xusader) - - bugfix: PRESENCE: fixing not working timer, when using set [...] statusRequest + - bugfix: PRESENCE: fixing not working timer, when using set [...] + statusRequest - bugfix: FB_CALLMONITOR: fixing reverse search for klicktel.de - feature: new module 52_I2C_MCP342x.pm added (klausw) - feature: SYSMON: read cpu temp on FritzBox @@ -57,7 +70,8 @@ - feature: new module 98_logProxy.pm added (justme1968) - change: 66_ECMD: ReadyFn added (fixes issue under Windows) - change: 02_RSS: use a GUID in RSS; urlq source for img command - - feature: 70_PushNotifier improve usebility, configuration without cURL (xusader) + - feature: 70_PushNotifier improve usebility, configuration without cURL + (xusader) - bugfix: SYSMON: prevent empty line im log by userReadings - feature: 10_IT empfang (by bjoernh) - bugfix: PRESENCE: fix race condition, when delete disabled attribute and diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index 92f14ce11..f39a293e5 100755 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -16,6 +16,7 @@ sub FW_answerCall($); sub FW_dev2image($;$); sub FW_devState($$@); sub FW_digestCgi($); +sub FW_directNotify($$); sub FW_doDetail($); sub FW_fatal($); sub FW_fileList($); @@ -187,11 +188,7 @@ FHEMWEB_Initialize($) closedir(DH); } - $data{webCmdFn}{slider} = "FW_sliderFn"; - $data{webCmdFn}{timepicker} = "FW_timepickerFn"; - $data{webCmdFn}{noArg} = "FW_noArgFn"; - $data{webCmdFn}{textField} = "FW_textFieldFn"; - $data{webCmdFn}{"~dropdown"}= "FW_dropdownFn"; # Should be the last + $data{webCmdFn}{"~"} = "FW_widgetFallbackFn"; # Should be the last if($init_done) { # reload workaround foreach my $pe ("fhemSVG", "openautomation", "default") { @@ -531,7 +528,9 @@ FW_answerCall($) $ldir = "$FW_dir/pgm2" if($dir eq "css" || $dir eq "js"); # FLOORPLAN compat $ldir = "$attr{global}{modpath}/docs" if($dir eq "docs"); - if(-r "$ldir/$file.$ext") { # no return for FLOORPLAN + # pgm2 check is for jquery-ui images + my $static = ($ext =~ m/(css|js|png|jpg)/i || $dir =~ m/^pgm2/); + if(-r "$ldir/$file.$ext" || $static) { # no return for FLOORPLAN return FW_serveSpecial($file, $ext, $ldir, ($arg =~ m/nocache/) ? 0 : 1); } $arg = "/$dir/$ofile"; @@ -617,7 +616,6 @@ FW_answerCall($) } return 0; } - ############################## # FHEMWEB extensions (FLOORPLOAN, SVG_WriteGplot, etc) my $FW_contentFunc; @@ -696,18 +694,26 @@ FW_answerCall($) FW_pO "" if($rf); } + ######################## + # CSS my $cssTemplate = ""; FW_pO sprintf($cssTemplate, "pgm2/style.css"); - my @cssFiles = split(" ", AttrVal($FW_wname, "CssFiles", "")); - map { FW_pO sprintf($cssTemplate, $_); } @cssFiles; + FW_pO sprintf($cssTemplate, "pgm2/jquery-ui.min.css"); + map { FW_pO sprintf($cssTemplate, $_); } + split(" ", AttrVal($FW_wname, "CssFiles", "")); + + ######################## + # JavaScripts + my $jsTemplate = ''; + FW_pO sprintf($jsTemplate, "$FW_ME/pgm2/jquery.min.js"); + FW_pO sprintf($jsTemplate, "$FW_ME/pgm2/jquery-ui.min.js"); ######################## # FW Extensions - my $jsTemplate = ''; if(defined($data{FWEXT})) { foreach my $k (sort keys %{$data{FWEXT}}) { my $h = $data{FWEXT}{$k}; - next if($h !~ m/HASH/ || !$h->{SCRIPT}); + next if($h !~ m/HASH/ || !$h->{SCRIPT} || $h->{SCRIPT} =~ m+pgm2/jquery+); my $script = $h->{SCRIPT}; $script = ($script =~ m,^/,) ? "$FW_ME$script" : "$FW_ME/pgm2/$script"; FW_pO sprintf($jsTemplate, $script); @@ -715,21 +721,18 @@ FW_answerCall($) } ####################### - # Other JavaScripts - FW_pO sprintf($jsTemplate, "$FW_ME/pgm2/svg.js") if($FW_plotmode eq "SVG"); + # Other JavaScripts + their Attributes map { FW_pO sprintf($jsTemplate, "$FW_ME/pgm2/$_") } @FW_fhemwebjs; - $jsTemplate = ''; map { my $n = $_; $n =~ s+.*/++; $n =~ s/.js$//; $n =~ s/fhem_//; $n .= "Param"; FW_pO sprintf($jsTemplate, AttrVal($FW_wname, $n, ""), "$FW_ME/$_"); } split(" ", AttrVal($FW_wname, "JavaScripts", "")); - my $onload = AttrVal($FW_wname, "longpoll", 1) ? - "onload=\"FW_delayedStart()\"" : ""; my $csrf= ($FW_CSRF ? "fwcsrf='$defs{$FW_wname}{CSRFTOKEN}'" : ""); - FW_pO "\n
"; + my $gen = 'generated="'.(time()-1).'"'; + my $lp = 'longpoll="'.AttrVal($FW_wname,"longpoll",1).'"'; + FW_pO "\n"; if($FW_activateInform) { $cmd = "style eventMonitor $FW_activateInform"; @@ -921,7 +924,7 @@ FW_makeTable($$$@) } else { if( $title eq "Attributes" ) { FW_pO "