SVG: removing identical .css/.svg files by implementing better fallback on open.

git-svn-id: https://svn.fhem.de/fhem/trunk@4274 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-11-23 12:32:44 +00:00
parent 5124249c1d
commit b76991bf6d
10 changed files with 9 additions and 305 deletions

View File

@ -917,8 +917,11 @@ SVG_render($$$$$$$$$)
'xmlns:xlink="http://www.w3.org/1999/xlink" '.$flog.'>'; 'xmlns:xlink="http://www.w3.org/1999/xlink" '.$flog.'>';
my $prf = AttrVal($parent_name, "stylesheetPrefix", ""); my $prf = AttrVal($parent_name, "stylesheetPrefix", "");
my $baseStyle = $prf; $baseStyle =~ s/(touchpad|smallscreen)//;
SVG_pO "<style type=\"text/css\"><![CDATA["; SVG_pO "<style type=\"text/css\"><![CDATA[";
if(open(FH, "$parent_dir/${prf}svg_style.css") || if(open(FH, "$parent_dir/${prf}svg_style.css") ||
open(FH, "$parent_dir/${baseStyle}svg_style.css") ||
open(FH, "$parent_dir/svg_style.css")) { open(FH, "$parent_dir/svg_style.css")) {
SVG_pO join("", <FH>); SVG_pO join("", <FH>);
close(FH); close(FH);
@ -930,6 +933,7 @@ SVG_render($$$$$$$$$)
###################### ######################
# gradient definitions # gradient definitions
if(open(FH, "$parent_dir/${prf}svg_defs.svg") || if(open(FH, "$parent_dir/${prf}svg_defs.svg") ||
open(FH, "$parent_dir/${baseStyle}svg_defs.svg") ||
open(FH, "$parent_dir/svg_defs.svg")) { open(FH, "$parent_dir/svg_defs.svg")) {
SVG_pO join("", <FH>); SVG_pO join("", <FH>);
close(FH); close(FH);

View File

@ -1,43 +0,0 @@
<!-- will be included in each svg plot -->
<defs>
<linearGradient id="gr_bg" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#FFFFF7; stop-opacity:1"/>
<stop offset="100%" style="stop-color:#A7A7A7; stop-opacity:1"/>
</linearGradient>
<linearGradient id="gr_0" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#f00; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#f88; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_1" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#291; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#8f7; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_2" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#00f; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#88f; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_3" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#f0f; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#f8f; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_4" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#ff0; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#ff8; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_5" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#0ff; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#8ff; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_6" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#000; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#ccc; stop-opacity:.4"/>
</linearGradient>
</defs>

View File

@ -1,31 +0,0 @@
/* Author: Volker */
.background { fill:#444444; font-opacity: 0; }
text { font-family:Arial, Helvetica, sans-serif; font-size:12px; fill:#CCCCCC;}
text.title {font-family:Arial, Helvetica, sans-serif; font-size:16px; fill:#CCCCCC;}
text.copy { text-decoration:underline; stroke:none; fill:blue;}
text.paste { text-decoration:underline; stroke:none; fill:blue;}
polyline { stroke:black; fill:none; }
.border { stroke:black; fill:url(#gr_bg);}
.vgrid { stroke:gray; stroke-dasharray:2,6;}
.hgrid { stroke:gray; stroke-dasharray:2,6;}
.pasted { stroke:black; stroke-dasharray:1,1;}
.l0 { stroke:red; } text.l0 { stroke:none; fill:red; }
.l1 { stroke:green; } text.l1 { stroke:none; fill:green; }
.l2 { stroke:blue; } text.l2 { stroke:none; fill:blue; }
.l3 { stroke:magenta; } text.l3 { stroke:none; fill:magenta; }
.l4 { stroke:brown; } text.l4 { stroke:none; fill:brown; }
.l5 { stroke:black; } text.l5 { stroke:none; fill:black; }
.l6 { stroke:olive; } text.l6 { stroke:none; fill:olive; }
.l7 { stroke:gray; } text.l7 { stroke:none; fill:gray; }
.l8 { stroke:yellow; } text.l8 { stroke:none; fill:yellow; }
.l0fill{ stroke:#f00; fill:url(#gr_0); } text.l0fill{ stroke:none; fill:#f00; }
.l1fill{ stroke:#291; fill:url(#gr_1); } text.l1fill{ stroke:none; fill:#291; }
.l2fill{ stroke:#00f; fill:url(#gr_2); } text.l2fill{ stroke:none; fill:#00f; }
.l3fill{ stroke:#f0f; fill:url(#gr_3); } text.l3fill{ stroke:none; fill:#f0f; }
.l4fill{ stroke:#ff0; fill:url(#gr_4); } text.l4fill{ stroke:none; fill:#ff0; }
.l5fill{ stroke:#0ff; fill:url(#gr_5); } text.l5fill{ stroke:none; fill:#0ff; }
.l6fill{ stroke:#000; fill:url(#gr_6); } text.l6fill{ stroke:none; fill:#000; }

View File

@ -1,43 +0,0 @@
<!-- will be included in each svg plot -->
<defs>
<linearGradient id="gr_bg" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#FFFFF7; stop-opacity:1"/>
<stop offset="100%" style="stop-color:#A7A7A7; stop-opacity:1"/>
</linearGradient>
<linearGradient id="gr_0" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#f00; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#f88; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_1" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#291; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#8f7; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_2" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#00f; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#88f; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_3" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#f0f; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#f8f; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_4" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#ff0; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#ff8; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_5" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#0ff; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#8ff; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_6" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#000; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#ccc; stop-opacity:.4"/>
</linearGradient>
</defs>

View File

@ -1,31 +0,0 @@
/* Author: Volker */
.background { fill:#444444; font-opacity: 0; }
text { font-family:Arial, Helvetica, sans-serif; font-size:12px; fill:#CCCCCC;}
text.title {font-family:Arial, Helvetica, sans-serif; font-size:16px; fill:#CCCCCC;}
text.copy { text-decoration:underline; stroke:none; fill:blue;}
text.paste { text-decoration:underline; stroke:none; fill:blue;}
polyline { stroke:black; fill:none; }
.border { stroke:black; fill:url(#gr_bg);}
.vgrid { stroke:gray; stroke-dasharray:2,6;}
.hgrid { stroke:gray; stroke-dasharray:2,6;}
.pasted { stroke:black; stroke-dasharray:1,1;}
.l0 { stroke:red; } text.l0 { stroke:none; fill:red; }
.l1 { stroke:green; } text.l1 { stroke:none; fill:green; }
.l2 { stroke:blue; } text.l2 { stroke:none; fill:blue; }
.l3 { stroke:magenta; } text.l3 { stroke:none; fill:magenta; }
.l4 { stroke:brown; } text.l4 { stroke:none; fill:brown; }
.l5 { stroke:black; } text.l5 { stroke:none; fill:black; }
.l6 { stroke:olive; } text.l6 { stroke:none; fill:olive; }
.l7 { stroke:gray; } text.l7 { stroke:none; fill:gray; }
.l8 { stroke:yellow; } text.l8 { stroke:none; fill:yellow; }
.l0fill{ stroke:#f00; fill:url(#gr_0); } text.l0fill{ stroke:none; fill:#f00; }
.l1fill{ stroke:#291; fill:url(#gr_1); } text.l1fill{ stroke:none; fill:#291; }
.l2fill{ stroke:#00f; fill:url(#gr_2); } text.l2fill{ stroke:none; fill:#00f; }
.l3fill{ stroke:#f0f; fill:url(#gr_3); } text.l3fill{ stroke:none; fill:#f0f; }
.l4fill{ stroke:#ff0; fill:url(#gr_4); } text.l4fill{ stroke:none; fill:#ff0; }
.l5fill{ stroke:#0ff; fill:url(#gr_5); } text.l5fill{ stroke:none; fill:#0ff; }
.l6fill{ stroke:#000; fill:url(#gr_6); } text.l6fill{ stroke:none; fill:#000; }

View File

@ -1,43 +0,0 @@
<!-- will be included in each svg plot -->
<defs>
<linearGradient id="gr_bg" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#fff; stop-opacity:1"/>
<stop offset="100%" style="stop-color:#fff; stop-opacity:1"/>
</linearGradient>
<linearGradient id="gr_0" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#fc3e39; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#fc3e39; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_1" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#53d769; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#53d769; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_2" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#157efb; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#157efb; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_3" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#c34ceb; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#c34ceb; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_4" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#ff0; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#ff8; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_5" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#0ff; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#8ff; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_6" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#000; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#ccc; stop-opacity:.4"/>
</linearGradient>
</defs>

View File

@ -1,34 +0,0 @@
/* Author: Volker
Edit: fhainz
*/
.background { fill:#e5e5e5; font-opacity: 0; }
text { font-family: Helvetica; font-weight:300; font-size:12px; fill:#343434;}
text.title {font-family: Helvetica; font-weight:300; font-size:16px; fill:#343434;}
text.copy { text-decoration:underline; stroke:none; fill:blue;}
text.paste { text-decoration:underline; stroke:none; fill:blue;}
polyline { stroke:black; fill:none; }
.border { stroke:black; fill:url(#gr_bg);}
.vgrid { stroke:gray; stroke-dasharray:2,6;}
.hgrid { stroke:gray; stroke-dasharray:2,6;}
.pasted { stroke:black; stroke-dasharray:1,1;}
.l0 { stroke:#fc3e39; } text.l0 { stroke:none; fill:#fc3e39; }
.l1 { stroke:#53d769; } text.l1 { stroke:none; fill:#53d769; }
.l2 { stroke:#157efb; } text.l2 { stroke:none; fill:#157efb; }
.l3 { stroke:#c34ceb; } text.l3 { stroke:none; fill:#c34ceb; }
.l4 { stroke:brown; } text.l4 { stroke:none; fill:brown; }
.l5 { stroke:black; } text.l5 { stroke:none; fill:black; }
.l6 { stroke:olive; } text.l6 { stroke:none; fill:olive; }
.l7 { stroke:gray; } text.l7 { stroke:none; fill:gray; }
.l8 { stroke:#f7ab28; } text.l8 { stroke:none; fill:#f7ab28; }
.l0fill{ stroke:#fc3e39; fill:url(#gr_0); } text.l0fill{ stroke:none; fill:#fc3e39; }
.l1fill{ stroke:#53d769; fill:url(#gr_1); } text.l1fill{ stroke:none; fill:#53d769; }
.l2fill{ stroke:#157efb; fill:url(#gr_2); } text.l2fill{ stroke:none; fill:#157efb; }
.l3fill{ stroke:#c34ceb; fill:url(#gr_3); } text.l3fill{ stroke:none; fill:#c34ceb; }
.l4fill{ stroke:#ff0; fill:url(#gr_4); } text.l4fill{ stroke:none; fill:#ff0; }
.l5fill{ stroke:#0ff; fill:url(#gr_5); } text.l5fill{ stroke:none; fill:#0ff; }
.l6fill{ stroke:#000; fill:url(#gr_6); } text.l6fill{ stroke:none; fill:#000; }

View File

@ -1,43 +0,0 @@
<!-- will be included in each svg plot -->
<defs>
<linearGradient id="gr_bg" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#fff; stop-opacity:1"/>
<stop offset="100%" style="stop-color:#fff; stop-opacity:1"/>
</linearGradient>
<linearGradient id="gr_0" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#fc3e39; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#fc3e39; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_1" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#53d769; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#53d769; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_2" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#157efb; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#157efb; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_3" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#c34ceb; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#c34ceb; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_4" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#ff0; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#ff8; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_5" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#0ff; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#8ff; stop-opacity:.4"/>
</linearGradient>
<linearGradient id="gr_6" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#000; stop-opacity:.6"/>
<stop offset="100%" style="stop-color:#ccc; stop-opacity:.4"/>
</linearGradient>
</defs>

View File

@ -1,33 +0,0 @@
/* Author: Volker
Edit: fhainz
*/
.background { fill:#e5e5e5; font-opacity: 0; }
text { font-family: Helvetica; font-weight:300; font-size:12px; fill:#343434;}
text.title {font-family: Helvetica; font-weight:300; font-size:16px; fill:#343434;}
text.copy { text-decoration:underline; stroke:none; fill:blue;}
text.paste { text-decoration:underline; stroke:none; fill:blue;}
polyline { stroke:black; fill:none; }
.border { stroke:black; fill:url(#gr_bg);}
.vgrid { stroke:gray; stroke-dasharray:2,6;}
.hgrid { stroke:gray; stroke-dasharray:2,6;}
.pasted { stroke:black; stroke-dasharray:1,1;}
.l0 { stroke:#fc3e39; } text.l0 { stroke:none; fill:#fc3e39; }
.l1 { stroke:#53d769; } text.l1 { stroke:none; fill:#53d769; }
.l2 { stroke:#157efb; } text.l2 { stroke:none; fill:#157efb; }
.l3 { stroke:#c34ceb; } text.l3 { stroke:none; fill:#c34ceb; }
.l4 { stroke:brown; } text.l4 { stroke:none; fill:brown; }
.l5 { stroke:black; } text.l5 { stroke:none; fill:black; }
.l6 { stroke:olive; } text.l6 { stroke:none; fill:olive; }
.l7 { stroke:gray; } text.l7 { stroke:none; fill:gray; }
.l8 { stroke:#f7ab28; } text.l8 { stroke:none; fill:#f7ab28; }
.l0fill{ stroke:#fc3e39; fill:url(#gr_0); } text.l0fill{ stroke:none; fill:#fc3e39; }
.l1fill{ stroke:#53d769; fill:url(#gr_1); } text.l1fill{ stroke:none; fill:#53d769; }
.l2fill{ stroke:#157efb; fill:url(#gr_2); } text.l2fill{ stroke:none; fill:#157efb; }
.l3fill{ stroke:#c34ceb; fill:url(#gr_3); } text.l3fill{ stroke:none; fill:#c34ceb; }
.l4fill{ stroke:#ff0; fill:url(#gr_4); } text.l4fill{ stroke:none; fill:#ff0; }
.l5fill{ stroke:#0ff; fill:url(#gr_5); } text.l5fill{ stroke:none; fill:#0ff; }
.l6fill{ stroke:#000; fill:url(#gr_6); } text.l6fill{ stroke:none; fill:#000; }

View File

@ -1,16 +1,17 @@
body { background-color: #FFFFE7; body { background-color: #FFFFE7;
font-family:Arial, sans-serif; font-size:18px; font-family:Arial, sans-serif; font-size:18px; }
}
textarea { font-family:Arial, sans-serif; font-size:18px} textarea { font-family:Arial, sans-serif; font-size:18px}
input { font-family:Arial, sans-serif; font-size:18px} input { font-family:Arial, sans-serif; font-size:18px}
select { font-family:Arial, sans-serif; font-size:18px} select { font-family:Arial, sans-serif; font-size:18px}
#logo { position:absolute; top:10px; left:10px; #logo { position:absolute; top:10px; left:10px;
width:120px; height:132px; background-image:url(../icons/fhemicon.png); } width:120px; height:132px;
background-image:url(../images/default/fhemicon.png); }
#menu { position:absolute; top:152px;left:10px; width:140px; } #menu { position:absolute; top:152px;left:10px; width:140px; }
#hdr { position:absolute; top:10px; left:160px; } #hdr { position:absolute; top:10px; left:160px; }
#console { width:100%; height:100%; position:absolute; overflow-y:auto;} #console { width:100%; height:100%; position:absolute; overflow-y:auto;}
#content { position:absolute; top:50px; left:160px; bottom:20px; right:10px; } #content { position:absolute; top:50px; left:160px; bottom:20px; right:10px; }
#connect_err { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:40px; z-index: 10; } #connect_err { background-color:#000000; color:#FFFFFF;
position:absolute; top:0px; left:40px; z-index: 10; }
.devType { padding-top:20px; } .devType { padding-top:20px; }
a { color: #278727; } a { color: #278727; }