Add tiny little javascript to toggle visibility of the list of changes

This commit is contained in:
Latif Khalifa
2012-02-12 11:25:06 +01:00
parent 1095e27b63
commit 05e1568f8c
3 changed files with 31 additions and 2 deletions

View File

@@ -4,6 +4,10 @@ html {
background-color: #1e1e1e;
}
image {
border: none;
}
body {
padding: 0;
margin: 0;

View File

@@ -82,9 +82,10 @@ Function print_build($current, $next)
<a href='" . URL_ROOT . "/" . $current->file . ".log'>Build Log</a></th>
</tr>";
if ($next) {
print '<tr><td colspan="4">';
print '<tr><td colspan="4">
<a href="javascript:void(0)" id="toggle_link_'. $current->nr . '" onclick="javascript:toggleChanges('. $current->nr . ')">Show changes &gt;&gt;</a><div style="display: none;" id="changes_' . $current->nr . '">';
print_changes($current, $next);
print "</td></tr>";
print "</div></td></tr>";
}
}

View File

@@ -38,6 +38,30 @@ class Layout
<link rel="stylesheet" type="text/css" href="<?php print URL_ROOT ?>/buildsite.css"/>
<link rel="shortcut icon" href="<?php print IMG_ROOT ?>/favicon.ico" type="image/x-icon" />
<title>Singularity Viewer Automated Build System</title>
<script type="text/javascript">
//<![CDATA[
function toggleChanges(id)
{
var change = document.getElementById("changes_" + id);
var link = document.getElementById("toggle_link_" + id);
if (change) {
if (change.style.display == "block") {
change.style.display = "none";
link.innerHTML = "Show changes &gt;&gt;";
} else {
change.style.display = "block";
link.innerHTML = "Hide changes &lt;&lt;";
}
}
return false;
}
//]]>
</script>
</head>
<body>
<div id="everything">