2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +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:
rudolfkoenig 2014-04-30 10:15:37 +00:00
parent 50700190ee
commit 011369fcc4
2 changed files with 8 additions and 6 deletions

View File

@ -2067,6 +2067,7 @@ FW_makeEdit($$$)
FW_pO "</td>";
$val =~ s,\\\n,\n,g;
$val = FW_htmlEscape($val);
my $eval = $val;
$eval = "<pre>$eval</pre>" if($eval =~ m/\n/);
FW_pO "<td>";
@ -2348,6 +2349,7 @@ sub
FW_htmlEscape($)
{
my ($txt) = @_;
$txt =~ s/&/&amp;/g;
$txt =~ s/</&lt;/g;
$txt =~ s/>/&gt;/g;
return $txt;

View File

@ -60,12 +60,12 @@ cm_wait()
attr[a] = userAttr[a];
loadLink("codemirror/"+attr.theme+".css");
if(ltype) {
$("head").append(
'<style type="text/css">'+
'.CodeMirror {height: ' + (window.innerHeight - 150) + 'px;}'+
'</style>');
}
$("head").append(
'<style type="text/css">'+
(ltype ?
'.CodeMirror {height: ' + (window.innerHeight - 150) + 'px;}':
'.CodeMirror {width: ' + (window.innerWidth - 300) + 'px;}')+
'</style>');
loadScript("codemirror/"+type+".js", function(){
log("Calling CodeMirror");