netrender: visibility toggle for full list of fluid and cache files in the job web page

This commit is contained in:
2009-12-21 18:14:39 +00:00
parent 90e9aee9b8
commit fc1ede345d
3 changed files with 71 additions and 8 deletions

View File

@@ -51,8 +51,19 @@ def get(handler):
output("</tr></thead>")
def rowTable(*data):
output("<tr>")
def rowTable(*data, id = None, class_style = None, extra = None):
output("<tr")
if id:
output(" id='%s'" % id)
if class_style:
output(" class='%s'" % class_style)
if extra:
output(" %s" % extra)
output(">")
for c in data:
output("<td>" + str(c) + "</td>")
@@ -172,10 +183,16 @@ def get(handler):
rowTable(file.filepath)
if tot_cache > 0:
rowTable("%i physic cache files" % tot_cache)
rowTable("%i physic cache files" % tot_cache, class_style = "toggle", extra = "onclick='toggleDisplay(&quot;.cache&quot;, &quot;none&quot;, &quot;table-row&quot;)'")
for file in job.files:
if file.filepath.endswith(".bphys"):
rowTable(os.path.split(file.filepath)[1], class_style = "cache")
if tot_fluid > 0:
rowTable("%i fluid bake files" % tot_fluid)
rowTable("%i fluid bake files" % tot_fluid, class_style = "toggle", extra = "onclick='toggleDisplay(&quot;.fluid&quot;, &quot;none&quot;, &quot;table-row&quot;)'")
for file in job.files:
if file.filepath.endswith(".bobj.gz") or file.filepath.endswith(".bvel.gz"):
rowTable(os.path.split(file.filepath)[1], class_style = "fluid")
endTable()

View File

@@ -13,7 +13,7 @@ a:hover {
}
h2 {
background-color:#ddd;
font-size:120%
font-size:120%;
padding:5px;
}
@@ -34,7 +34,7 @@ td {
padding:2px;
padding-left:10px;
padding-right:10px;
margin-left:20px
margin-left:20px;
background-color:#ddd;
}
td:hover {
@@ -49,3 +49,16 @@ button {
height: auto;
}
.toggle {
text-decoration: underline;
cursor: pointer;
}
.cache {
display: none;
}
.fluid {
display: none;
}

View File

@@ -1,10 +1,43 @@
function request(url, data) {
function request(url, data)
{
xmlhttp = new XMLHttpRequest();
xmlhttp.open("POST", url, false);
xmlhttp.send(data);
window.location.reload()
}
function edit(id, info) {
function edit(id, info)
{
request("/edit_" + id, info)
}
function returnObjById( id )
{
if (document.getElementById)
var returnVar = document.getElementById(id);
else if (document.all)
var returnVar = document.all[id];
else if (document.layers)
var returnVar = document.layers[id];
return returnVar;
}
function toggleDisplay( className, value1, value2 )
{
style = getStyle(className)
if (style.style["display"] == value1) {
style.style["display"] = value2;
} else {
style.style["display"] = value1;
}
}
function getStyle(className) {
var classes = document.styleSheets[0].rules || document.styleSheets[0].cssRules
for(var x=0;x<classes.length;x++) {
if(classes[x].selectorText==className) {
return classes[x];
}
}
}