diff --git a/fhem/CHANGED b/fhem/CHANGED index d5d94fd07..e3fe76370 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # 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. + - bugfix: 98_DOIFtools: fixed browser issues for Chrome and IE - feature: 98_monitoring: whitelist attribute added - feature: 93_DbRep: support of primary key (set in table history/current) - update: 88_HMCCU: Optimized reading update performance diff --git a/fhem/FHEM/98_DOIFtools.pm b/fhem/FHEM/98_DOIFtools.pm index 35090cd7f..c74cf52d7 100644 --- a/fhem/FHEM/98_DOIFtools.pm +++ b/fhem/FHEM/98_DOIFtools.pm @@ -57,11 +57,13 @@ function doiftoolsCopyToClipboard() { var txtarea = document.getElementById("console"); var start = txtarea.selectionStart; var finish = txtarea.selectionEnd; - var txt = txtarea.value.substring(start, finish); + var txt = $("textarea#console").text().substring(start, finish); var hlp = lang ? "Bitte, genau eine komplette Event-Zeile markieren." : "Please highlight exactly one complete event line"; + $('#console').attr('disabled', 'disabled'); + $('#console').removeAttr('disabled'); if(!txt) return FW_okDialog(hlp); - var redi=/^....-..-..\s..:..:..(\....)?\s([^\s]+)\s([^\s]+)\s([^\s]+:\s)?(.*)([\r\n]*)?$/; + var redi=/^....-..-..\s..:..:..(\....)?\s([^\s]+)\s([^\s]+)\s([^\s]+:\s)?(.*)([\n]*)?$/; var retdi = txt.match(redi); if(!retdi) return FW_okDialog(hlp); @@ -220,6 +222,9 @@ function doiftoolsOptChanged() { inpt.setSelectionRange(7,17+N); } } +function doiftoolsReplaceBR() { + $("textarea#console").html($("textarea#console").html().replace(/
/g,"")); +} function delbutton() { if ($('#doiftoolstype').attr('embefore') == 1) { @@ -238,6 +243,8 @@ function delbutton() { //execute $( window ).on( "load", delbutton ); $('#console').on('select', doiftoolsCopyToClipboard); + $('#console').on('mouseover',doiftoolsReplaceBR); + $('#console').on('mousedown',doiftoolsReplaceBR); EOF my $DOIFtoolsJSfuncStart = <<'EOF'; @@ -254,20 +261,20 @@ function doiftoolsAddLookUp () { var devList = JSON.parse(data); var dev = devList.Results[0]; var row = 0; - for (item in dev.Internals) { + for (var item in dev.Internals) { if (item == "DEF") {dev.Internals[item] = "
"+dev.Internals[item]+"
"} var cla = ((row++&1)?"odd":"even"); txt += ""+item+""+dev.Internals[item].replace(/\n/g,"
")+"\n"; } txt += "Readings
"; row = 0; - for (item in dev.Readings) { + for (var item in dev.Readings) { var cla = ((row++&1)?"odd":"even"); txt += "\n"; } txt += "
"+item+""+dev.Readings[item].Value+""+dev.Readings[item].Time+"
Attributes
"; row = 0; - for (item in dev.Attributes) { + for (var item in dev.Attributes) { if (item.match(/(userReadings|wait|setList)/) ) {dev.Attributes[item] = "
"+dev.Attributes[item]+"
"} var cla = ((row++&1)?"odd":"even"); txt += "\n";
"+item+""+dev.Attributes[item]+"