mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
FHEMWEB/codemirror: DEF Patches inspired by MarcelK (Forum #20444)
git-svn-id: https://svn.fhem.de/fhem/trunk@5703 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
50700190ee
commit
011369fcc4
@ -2067,6 +2067,7 @@ FW_makeEdit($$$)
|
|||||||
FW_pO "</td>";
|
FW_pO "</td>";
|
||||||
|
|
||||||
$val =~ s,\\\n,\n,g;
|
$val =~ s,\\\n,\n,g;
|
||||||
|
$val = FW_htmlEscape($val);
|
||||||
my $eval = $val;
|
my $eval = $val;
|
||||||
$eval = "<pre>$eval</pre>" if($eval =~ m/\n/);
|
$eval = "<pre>$eval</pre>" if($eval =~ m/\n/);
|
||||||
FW_pO "<td>";
|
FW_pO "<td>";
|
||||||
@ -2348,6 +2349,7 @@ sub
|
|||||||
FW_htmlEscape($)
|
FW_htmlEscape($)
|
||||||
{
|
{
|
||||||
my ($txt) = @_;
|
my ($txt) = @_;
|
||||||
|
$txt =~ s/&/&/g;
|
||||||
$txt =~ s/</</g;
|
$txt =~ s/</</g;
|
||||||
$txt =~ s/>/>/g;
|
$txt =~ s/>/>/g;
|
||||||
return $txt;
|
return $txt;
|
||||||
|
@ -60,12 +60,12 @@ cm_wait()
|
|||||||
attr[a] = userAttr[a];
|
attr[a] = userAttr[a];
|
||||||
|
|
||||||
loadLink("codemirror/"+attr.theme+".css");
|
loadLink("codemirror/"+attr.theme+".css");
|
||||||
if(ltype) {
|
|
||||||
$("head").append(
|
$("head").append(
|
||||||
'<style type="text/css">'+
|
'<style type="text/css">'+
|
||||||
'.CodeMirror {height: ' + (window.innerHeight - 150) + 'px;}'+
|
(ltype ?
|
||||||
|
'.CodeMirror {height: ' + (window.innerHeight - 150) + 'px;}':
|
||||||
|
'.CodeMirror {width: ' + (window.innerWidth - 300) + 'px;}')+
|
||||||
'</style>');
|
'</style>');
|
||||||
}
|
|
||||||
|
|
||||||
loadScript("codemirror/"+type+".js", function(){
|
loadScript("codemirror/"+type+".js", function(){
|
||||||
log("Calling CodeMirror");
|
log("Calling CodeMirror");
|
||||||
|
Loading…
Reference in New Issue
Block a user