2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-13 23:36:37 +00:00

01_FHEMWEB.js: add attribute confirmJSError (Forum #64541)

git-svn-id: https://svn.fhem.de/fhem/trunk@13064 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-01-14 18:16:21 +00:00
parent a2b0d10687
commit b08ea575d8
2 changed files with 22 additions and 4 deletions

View File

@ -148,6 +148,7 @@ FHEMWEB_Initialize($)
closeConn:1,0
column
confirmDelete
confirmJSError
defaultRoom
deviceOverview:always,iconOnly,onClick,never
editConfig:1,0
@ -1262,9 +1263,10 @@ FW_doDetail($)
my $h = $defs{$d};
my $t = $h->{TYPE};
$t = "MISSING" if(!defined($t));
my $cd = AttrVal($FW_wname, "confirmDelete", 1);
FW_pO "<div id=\"content\" data-confirmDelete=\"$cd\" ".
"data-webName=\"$FW_wname\">";
FW_pO "<div id=\"content\" ".
"data-confirmDelete='" .AttrVal($FW_wname,"confirmDelete",1) ."' ".
"data-confirmJSError='".AttrVal($FW_wname,"confirmJSError",1)."' ".
"data-webName='$FW_wname'>";
if($FW_ss) { # FS20MS2 special: on and off, is not the same as toggle
my $webCmd = AttrVal($d, "webCmd", undef);
@ -3207,6 +3209,13 @@ FW_widgetOverride($$)
</li>
<br>
<a name="confirmJSError"></a>
<li>confirmJSError<br>
JavaScript errors are reported in a dialog as default.
Set this attribute to 0 to disable the reporting.
</li>
<br>
<a name="CORS"></a>
<li>CORS<br>
If set to 1, FHEMWEB will supply a "Cross origin resource sharing"
@ -3944,6 +3953,14 @@ FW_widgetOverride($$)
</li>
<br>
<a name="confirmJSError"></a>
<li>confirmJSError<br>
JavaScript Fehler werden per Voreinstellung in einem Dialog gemeldet.
Durch setzen dieses Attributes auf 0 werden solche Fehler nicht
gemeldet.
</li>
<br>
<a name="CORS"></a>
<li>CORS<br>
Wenn auf 1 gestellt, wird FHEMWEB einen "Cross origin resource sharing"

View File

@ -35,7 +35,8 @@ window.onbeforeunload = function(e)
window.onerror = function(errMsg, url, lineno)
{
url = url.replace(/.*\//,'');
FW_okDialog(url+" line "+lineno+":<br>"+errMsg);
if($("div#content").attr("data-confirmJSError") != 0)
FW_okDialog(url+" line "+lineno+":<br>"+errMsg);
}