mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
fhemweb.js: fix RawDef/Probably assoc. with & codeMirror (Forum #81595)
git-svn-id: https://svn.fhem.de/fhem/trunk@15701 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
60601c3235
commit
9cdc24caa8
@ -235,6 +235,8 @@ FW_Define($$)
|
||||
return "Usage: define <name> FHEMWEB [IPV6:]<tcp-portnr> [global]"
|
||||
if($port !~ m/^(IPV6:)?\d+$/ || ($global && $global ne "global"));
|
||||
|
||||
FW_Undef($hash) if($hash->{OLDDEF}); # modify
|
||||
|
||||
foreach my $pe ("fhemSVG", "openautomation", "default") {
|
||||
FW_readIcons($pe);
|
||||
}
|
||||
|
@ -720,11 +720,14 @@ FW_rawDef()
|
||||
var textAreaStyle = typeof AddCodeMirror == 'function'?'opacity:0':'';
|
||||
|
||||
$("#content").append('<div id="rawDef">'+
|
||||
'<textarea id="td_rawDef" rows="25" cols="60" style="width:99%; '+textAreaStyle+'"/>'+
|
||||
'<textarea id="td_rawDef" rows="25" cols="60" style="width:99%; '+
|
||||
textAreaStyle+'"/>'+
|
||||
'<button>Execute commands</button>'+
|
||||
' Dump "Probably associated with" too <input type="checkbox">'+
|
||||
'<br><br></div>');
|
||||
|
||||
var cmVar;
|
||||
|
||||
function
|
||||
fillData(opt)
|
||||
{
|
||||
@ -749,9 +752,12 @@ FW_rawDef()
|
||||
|
||||
s.bind('input propertychange', propertychange);
|
||||
|
||||
if( typeof AddCodeMirror == 'function') {
|
||||
$('#rawDef textarea + .CodeMirror').remove();
|
||||
if(cmVar) {
|
||||
cmVar.setValue(data);
|
||||
|
||||
} else if(typeof AddCodeMirror == 'function') {
|
||||
AddCodeMirror(s, function(cm) {
|
||||
cmVar = cm;
|
||||
cm.on("change", function() {
|
||||
s.val(cm.getValue());
|
||||
propertychange();
|
||||
|
Loading…
Reference in New Issue
Block a user