Show sample images for generators in menu
This commit is contained in:
parent
f08b19e54e
commit
53052fc2e0
|
@ -221,15 +221,14 @@ class BServer:
|
||||||
<link rel="stylesheet" href="https://necolas.github.io/normalize.css/4.1.1/normalize.css" type="text/css" />
|
<link rel="stylesheet" href="https://necolas.github.io/normalize.css/4.1.1/normalize.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="static/self.css" type="text/css" />
|
<link rel="stylesheet" href="static/self.css" type="text/css" />
|
||||||
<script>
|
<script>
|
||||||
function change(img_link){
|
function change(group, img_link){
|
||||||
var img = img_link.firstChild.innerHTML;
|
document.getElementById("sample-"+group).src = img_link;
|
||||||
//alert(img);
|
document.getElementById("sample-"+group).style.height = "auto";
|
||||||
document.getElementById("sample").src= "examples/" + img + ".svg";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeback(img_link){
|
function changeback(group){
|
||||||
document.getElementById("sample").src= "examples/" + img + ".svg";
|
document.getElementById("sample-" + group).src= "static/nothing.png";
|
||||||
|
document.getElementById("sample-" + group).style.height= "0px";
|
||||||
}
|
}
|
||||||
</script>""", self.scripts % len(self.groups), """
|
</script>""", self.scripts % len(self.groups), """
|
||||||
</head>
|
</head>
|
||||||
|
@ -253,10 +252,14 @@ Create boxes and more with a laser cutter!
|
||||||
<div>
|
<div>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<hr />
|
<hr />
|
||||||
<div style="width: 100%; float: left;">
|
<div style="width: 100%">
|
||||||
""" ]
|
""" ]
|
||||||
for nr, group in enumerate(self.groups):
|
for nr, group in enumerate(self.groups):
|
||||||
result.append('''<h3 onclick="showHide('%s')">%s</h3>\n<div id="%s">\n<ul>\n''' % (nr, group.title, nr))
|
result.append('''<h3 onclick="showHide('%s')">%s</h3>\n<div id="%s">\n<ul>\n''' % (nr, group.title, nr))
|
||||||
|
result.append("""
|
||||||
|
<div style="width: 20%%; float: right;">
|
||||||
|
<img width="100%%" id="sample-%s" src="static/nothing.png" alt="" />
|
||||||
|
</div>""" % (group))
|
||||||
for box in group.generators:
|
for box in group.generators:
|
||||||
name = box.__class__.__name__
|
name = box.__class__.__name__
|
||||||
if name in ("TrayLayout2", ):
|
if name in ("TrayLayout2", ):
|
||||||
|
@ -264,19 +267,13 @@ Create boxes and more with a laser cutter!
|
||||||
docs = ""
|
docs = ""
|
||||||
if box.__doc__:
|
if box.__doc__:
|
||||||
docs = " - " + box.__doc__
|
docs = " - " + box.__doc__
|
||||||
result.append(""" <li><a href="%s">%s</a>%s</li>\n""" % (
|
result.append(""" <li onmouseenter="change('%s', 'static/samples/%s.jpg')" onmouseleave="changeback('%s')"><a href="%s">%s</a>%s</li>\n""" % (
|
||||||
name, name, docs))
|
group, name, group, name, name, docs))
|
||||||
result.append("</ul>\n</div>\n")
|
result.append("</ul>\n</div>\n")
|
||||||
result.append("""
|
result.append("""
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--
|
|
||||||
<div style="width: 5%; float: left;"></div>
|
<div style="width: 5%; float: left;"></div>
|
||||||
<div style="width: 55%; float: left;">
|
|
||||||
<img id="sample" src="examples/box.svg" alt="Sample Image" />
|
|
||||||
</div>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<hr />
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 89 B |
Loading…
Reference in New Issue