Move test-framework to its own repository
Signed-off-by: Robert Baldyga <baldyga.r@gmail.com>
This commit is contained in:
35
log/template/iterations/iteration.html
Normal file
35
log/template/iterations/iteration.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<!--
|
||||
Copyright(c) 2019-2021 Intel Corporation
|
||||
SPDX-License-Identifier: BSD-3-Clause
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>[title]</title>
|
||||
<link rel="stylesheet" type="text/css" href="../main.css"/>
|
||||
<script src="../main.js"></script>
|
||||
<meta charset="UTF-8"/>
|
||||
</head>
|
||||
<body onload="onLoadDocument();">
|
||||
<div class="floating">
|
||||
<b>View: </b>
|
||||
<select id="mode-selector" onchange="selectMode();">
|
||||
<option style="background-color: white; color: black;" value="info">Info</option>
|
||||
<option style="background-color: white; color: black" value="debug">Debug</option>
|
||||
</select>
|
||||
<b>Errors: </b>
|
||||
<button onclick="previousError()"><</button>
|
||||
<select id="error-list-selector" onchange="errorSelected('error-list-selector')">
|
||||
<option value="top" class="empty">-empty-</option>
|
||||
</select>
|
||||
<button onclick="nextError()">></button>
|
||||
</div>
|
||||
<br/>
|
||||
<a name="top"><h1 class="iteration-title" style="border-bottom: 4px solid rgba(255, 0, 0, 1)">[title]</h1></a>
|
||||
<div class="iteration-status">Iteration status: [status]</div>
|
||||
<div class="iteration-execution-time">Execution time: [time] [s]</div>
|
||||
<section class="iteration-chapters" id="iteration-chapters">
|
||||
<h2>Groups:</h2>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
37
log/template/iterations/setup.html
Normal file
37
log/template/iterations/setup.html
Normal file
@@ -0,0 +1,37 @@
|
||||
<!--
|
||||
Copyright(c) 2019-2021 Intel Corporation
|
||||
SPDX-License-Identifier: BSD-3-Clause
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Setup</title>
|
||||
<link rel="stylesheet" type="text/css" href="../main.css"/>
|
||||
<meta charset="UTF-8"/>
|
||||
<script src="../main.js"></script>
|
||||
</head>
|
||||
<body onload="onLoadDocument();">
|
||||
<div class="floating">
|
||||
<b>View: </b>
|
||||
<select id="mode-selector" onchange="selectMode();">
|
||||
<option style="background-color: white; color: black;" value="info">Info</option>
|
||||
<option style="background-color: white; color: black" value="debug">Debug</option>
|
||||
</select>
|
||||
<b>Errors: </b>
|
||||
<button onclick="previousError()"><</button>
|
||||
<select id="error-list-selector" onchange="errorSelected('error-list-selector')">
|
||||
<option value="top">-empty-</option>
|
||||
</select>
|
||||
<button onclick="nextError()">></button>
|
||||
</div>
|
||||
<br/>
|
||||
<a name="top">
|
||||
<h1 class="iteration-title" style="border-bottom: 4px solid rgba(255, 0, 0, 1)">Test summary</h1>
|
||||
</a>
|
||||
<div class="iteration-status">Iteration status: [STATUS]</div>
|
||||
<div class="iteration-execution-time">Execution time: [time] [s]</div>
|
||||
<section class="iteration-chapters" id="iteration-chapters">
|
||||
<h2>Groups:</h2>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
383
log/template/main.css
Normal file
383
log/template/main.css
Normal file
@@ -0,0 +1,383 @@
|
||||
/*
|
||||
Copyright(c) 2019-2021 Intel Corporation
|
||||
SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #F0F0F0;
|
||||
font-family: Calibri;
|
||||
color: black;
|
||||
}
|
||||
|
||||
div { display: block; }
|
||||
|
||||
h2 { margin: 0; padding: 0; }
|
||||
h4 { margin: 0; padding: 0; }
|
||||
|
||||
div.meta-container {
|
||||
margin-left: 502px;
|
||||
min-width: 500px;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
div.main-layaut {
|
||||
float: right;
|
||||
width: 100%;
|
||||
background-color: #FDFDFD;
|
||||
height: 100vh;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
div.sidebar {
|
||||
float: left;
|
||||
width: 500px;
|
||||
height: 100vh;
|
||||
margin-left: -502px;
|
||||
border: 4px;
|
||||
background-color: #F0F0F0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
text-align: center;
|
||||
color: white;
|
||||
overflow-x: hidden;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
div.sidebar-hide {
|
||||
padding: 3px;
|
||||
height: 20px;
|
||||
margin: 5px auto;
|
||||
font-family: Consolas;
|
||||
font-weight: normal;
|
||||
font-size: 15px;
|
||||
color: white;
|
||||
text-shadow: 1px 1px 3px black;
|
||||
background-color: rgb(40,80,180);
|
||||
cursor: default;
|
||||
border: 2px solid silver;
|
||||
border-radius: 25px;
|
||||
}
|
||||
|
||||
div.sidebar-show { color: balck; height: 50%; }
|
||||
|
||||
div.sidebar-test { overflow-x: hidden; overflow-y: hidden;}
|
||||
|
||||
div.sidebar-test-title {
|
||||
padding: 10px;
|
||||
height: 40px;
|
||||
margin: 5px auto;
|
||||
background-color: rgb(40,80,180);
|
||||
font-size: 100%;
|
||||
border: 2px solid silver;
|
||||
border-radius: 25px;
|
||||
}
|
||||
|
||||
div.sidebar-test-status {
|
||||
padding: 3px;
|
||||
height: 20px;
|
||||
background-color: green;
|
||||
border: 2px solid silver;
|
||||
border-radius: 25px;
|
||||
}
|
||||
|
||||
div.sidebar-tested-build {
|
||||
color: black;
|
||||
border-radius: 25px;
|
||||
width: 80%;
|
||||
margin: 5px auto;
|
||||
padding: 25px;
|
||||
background-color: #F7F7F7;
|
||||
border: 1px solid silver;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
overflow: hidden;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.sidebar-test-iteration {
|
||||
padding: 3px;
|
||||
height: 20px;
|
||||
margin: 5px auto;
|
||||
font-family: Consolas;
|
||||
font-weight: normal;
|
||||
font-size: 15px;
|
||||
color: white;
|
||||
text-shadow: 1px 1px 3px black;
|
||||
background-color: rgb(40,80,180);
|
||||
cursor: default;
|
||||
border: 2px solid silver;
|
||||
border-radius: 25px;
|
||||
}
|
||||
|
||||
.debug { display: none; }
|
||||
|
||||
select.sidebar-iteration-list {
|
||||
margin: 5px auto;
|
||||
background-color: white;
|
||||
color: black;
|
||||
width: 90%;
|
||||
}
|
||||
select.warning { background-color: #ff0; color: black; }
|
||||
select.workaround { background-color: #fff8dc; color: black; }
|
||||
select.skip { background-color: silver; color: black; }
|
||||
select.fail { background-color: red; color: white; }
|
||||
select.blocked { background-color: #7030a0; color: white; }
|
||||
select.exception { background-color: #e29517; color: white; }
|
||||
select.critical { background-color: #002060; color: white; }
|
||||
|
||||
option {
|
||||
background-color: green;
|
||||
color: white;
|
||||
margin: 2px;
|
||||
}
|
||||
option.warning { background-color: #ff0; color: black; }
|
||||
option.workaround { background-color: #fff8dc; color: black; }
|
||||
option.skip { background-color: silver; color: black; }
|
||||
option.error { background-color: red; color: white; }
|
||||
option.blocked { background-color: #7030a0; color: white; }
|
||||
option.exception { background-color: #e29517; color: white; }
|
||||
select.critical { background-color: #002060; color: white; }
|
||||
|
||||
a.iteration-selector {
|
||||
border: 2px solid silver;
|
||||
border-radius: 40px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
vertical-align: middle;
|
||||
display: table-cell;
|
||||
color: white;
|
||||
background-color: green;
|
||||
text-shadow: 0 0 3px black;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
line-height: 1em;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
a.warning { background-color: #ff0; }
|
||||
a.workaround { background-color: #fff8dc; }
|
||||
a.skip { background-color: silver; }
|
||||
a.fail { background-color: red; }
|
||||
a.exception { background-color: #e29517; }
|
||||
a.blocked { background-color: #7030a0; }
|
||||
a.critical { background-color: #002060; }
|
||||
a.selected { border: 2px solid black; }
|
||||
|
||||
select.error-list-selector { background-color: silver; }
|
||||
|
||||
div.test-chapter-step {
|
||||
margin: 4px auto;
|
||||
border-style: solid;
|
||||
border-color: #8CB9AE;
|
||||
border-radius: 10px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
div.sidebar-copyright {
|
||||
position: absolute;
|
||||
background-color: #DDD;
|
||||
text-align: center;
|
||||
padding: 4px;
|
||||
color: #888;
|
||||
bottom: 0;
|
||||
font-size: 12px;
|
||||
font-family: Consolas;
|
||||
}
|
||||
|
||||
div.floating {
|
||||
right: 0;
|
||||
border: 3px solid silver;
|
||||
width: 40%;
|
||||
text-align: center;
|
||||
vertical-align: top;
|
||||
position: fixed;
|
||||
background-color : #F0F0F0;
|
||||
border-bottom: 1px solid #999;
|
||||
z-index: 999;
|
||||
color: #333;
|
||||
box-shadow: 0 0px 6px gray;
|
||||
}
|
||||
|
||||
h1 {
|
||||
display: block;
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.iteration-selector {
|
||||
margin: 5px auto;
|
||||
}
|
||||
|
||||
div.iteration-status {
|
||||
padding: 3px;
|
||||
height: 20px;
|
||||
background-color: green;
|
||||
border: 2px solid silver;
|
||||
border-radius: 25px;
|
||||
color: white;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h1.iteration-title { text-align: center; }
|
||||
|
||||
div.iteration-execution-time { text-align: center; }
|
||||
|
||||
section.iteration-chapters {
|
||||
border-radius: 25px;
|
||||
width: 80%;
|
||||
margin: 10px auto;
|
||||
padding: 25px;
|
||||
background-color: #F7F7F7;
|
||||
border: 1px solid silver;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
ul.iteration-content {
|
||||
list-style-type: none;
|
||||
border-left-color: green;
|
||||
border-left-style: solid;
|
||||
margin: 0px;
|
||||
}
|
||||
ul.warning { border-left-color: #ff0; }
|
||||
ul.workaround { border-left-color: #fff8dc; }
|
||||
ul.skip { border-left-color: silver; }
|
||||
ul.fail { border-left-color: red; }
|
||||
ul.blocked { border-left-color: #7030a0; }
|
||||
ul.critical { border-left-color: #002060; }
|
||||
ul.exception { border-left-color: #e29517; }
|
||||
|
||||
li.iteration-content {
|
||||
border-color: rgba(192, 192, 192, 1);
|
||||
background-color: rgba(238, 238, 238, 1);
|
||||
display: block;
|
||||
margin: 2px auto;
|
||||
border: 1px solid #C0C0C0;
|
||||
padding: 3px 6px;
|
||||
font-family: Calibri;
|
||||
font-size: 16px;
|
||||
line-height: 1.15em;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
overflow: hidden;
|
||||
border-left-color: green;
|
||||
border-left-style: solid;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
div.test-group-step {
|
||||
color: black;
|
||||
background-color: #8CB9AE;
|
||||
border: 1px solid #5C8880;
|
||||
font-size: 18px;
|
||||
letter-spacing: 2px;
|
||||
cursor: pointer;
|
||||
margin: 4px;
|
||||
border-radius: 10px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
overflow-wrap: break-word;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
div.warning { background-color: #ff0; color: black; }
|
||||
div.workaround { background-color: #fff8dc; color: black; }
|
||||
div.skip { background-color: silver; color: black; }
|
||||
div.fail { background-color: red; color: white; }
|
||||
div.blocked { background-color: #7030a0; color: white; }
|
||||
div.critical { background-color: #002060; color: white; }
|
||||
div.exception { background-color: #e29517; color: white; }
|
||||
|
||||
a.top-marker { cursor: pointer; float: right; }
|
||||
|
||||
a.top-time-marker {
|
||||
word-wrap: break-word;
|
||||
float: right;
|
||||
}
|
||||
|
||||
li.test-step {
|
||||
color: black;
|
||||
border-color: rgba(192, 192, 192, 1);
|
||||
background-color: rgba(238, 238, 238, 1);
|
||||
display: block;
|
||||
margin: 4px auto;
|
||||
border: 1px solid #C0C0C0;
|
||||
padding: 3px 6px;
|
||||
font-family: Calibri;
|
||||
font-size: 16px;
|
||||
line-height: 1.15em;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
overflow: hidden;
|
||||
border-left-color: green;
|
||||
border-left-style: solid;
|
||||
border-radius: 10px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px
|
||||
}
|
||||
li.warning { background-color: #ff0; border-left-color: #ff0; }
|
||||
li.workaround { background-color: #fff8dc; border-left-color: #fff8dc; }
|
||||
li.skip { background-color: silver; border-left-color: silver; }
|
||||
li.fail {
|
||||
background-color: red;
|
||||
border-left-color: red;
|
||||
color: white;
|
||||
}
|
||||
li.blocked {
|
||||
background-color: #7030a0;
|
||||
border-left-color: #7030a0;
|
||||
color: white;
|
||||
}
|
||||
li.exception {
|
||||
background-color: #e29517;
|
||||
border-left-color: #e29517;
|
||||
color: white;
|
||||
}
|
||||
|
||||
li.critical {
|
||||
background-color: #002060;
|
||||
border-left-color: #002060;
|
||||
color: white;
|
||||
}
|
||||
|
||||
div.ts-iteration {
|
||||
float: left;
|
||||
margin: 2px auto;
|
||||
border: 1px solid silver;
|
||||
padding: 3px 3px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div.ts-total-time {
|
||||
margin: 2px auto;
|
||||
border: 1px solid silver;
|
||||
padding: 3px 3px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div.ts-time {
|
||||
float: left;
|
||||
font-size: 12px;
|
||||
margin: 2px auto;
|
||||
border: 1px solid #A7A7A7;
|
||||
padding: 3px 3px;
|
||||
}
|
||||
|
||||
div.ts-msg {
|
||||
font-size: 16px;
|
||||
font-family: Courier;
|
||||
margin: 2px auto;
|
||||
border: 1px solid #A7A7A7;
|
||||
padding: 3px 3px;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
}
|
44
log/template/main.html
Normal file
44
log/template/main.html
Normal file
@@ -0,0 +1,44 @@
|
||||
<!--
|
||||
Copyright(c) 2019-2021 Intel Corporation
|
||||
SPDX-License-Identifier: BSD-3-Clause
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>[test title]</title>
|
||||
<link rel="stylesheet" type="text/css" href="main.css">
|
||||
<meta charset="UTF-8"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="meta-container">
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-test" id="sidebar-test">
|
||||
<div class="sidebar-show" style="display:none" onclick="sidebarCtrl('sidebar-hide', 'sidebar-show')">>></div>
|
||||
<div class="sidebar-test-title">Test title: </div>
|
||||
<div class="sidebar-test-status">Test status: </div>
|
||||
<div class="sidebar-tested-build" id="sidebar-tested-build">
|
||||
<h2>Build:</h2>
|
||||
</div>
|
||||
<div class="sidebar-hide" id=sidebar-hide" onclick="sidebarCtrl('sidebar-hide', 'sidebar-show')"><<</div>
|
||||
<div class="sidebar-show" style="display:none" onclick="sidebarCtrl('sidebar-hide', 'sidebar-show')">>></div>
|
||||
</div>
|
||||
<div class="sidebar-test-iteration">Executed iterations:</div>
|
||||
<select id="sidebar-iteration-list" class="sidebar-iteration-list" onchange="selectIterationFromSelect()" onclick="clickSelectIteration()">
|
||||
<option value="M">Setup</option>
|
||||
</select>
|
||||
<div id="iteration-selector">
|
||||
<a class="iteration-selector" onclick="selectIteration('M')">M</a>
|
||||
</div>
|
||||
<div class="sidebar-copyright" id="sidebar-copyright">
|
||||
SPDX-License-Identifier: BSD-3-Clause
|
||||
<br>
|
||||
Copyright © 2015-2021 Intel Corporation
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-layaut">
|
||||
<iframe id="main-view" src="iterations/setup.html" width="100%" height="99%"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
<script src="main.js"></script>
|
||||
</body>
|
||||
</html>
|
223
log/template/main.js
Normal file
223
log/template/main.js
Normal file
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
Copyright(c) 2019-2021 Intel Corporation
|
||||
SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
function onLoadDocument() {
|
||||
hideDebug();
|
||||
}
|
||||
|
||||
function selectMode() {
|
||||
var selector = document.getElementById('mode-selector');
|
||||
if (selector.value.includes('info')) {
|
||||
hideDebug();
|
||||
} else {
|
||||
showDebug();
|
||||
}
|
||||
}
|
||||
|
||||
function hideDebug() {
|
||||
var debugTestStepArray = document.getElementsByTagName('li');
|
||||
for (i = 0; i < debugTestStepArray.length; i ++) {
|
||||
if(debugTestStepArray[i].className.includes('debug')) {
|
||||
debugTestStepArray[i].style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function showDebug() {
|
||||
var debugTestStepArray = document.getElementsByTagName('li');
|
||||
for (i = 0; i < debugTestStepArray.length; i ++) {
|
||||
if(debugTestStepArray[i].className.includes('debug')) {
|
||||
debugTestStepArray[i].style.display = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function sidebarCtrl(ctrlHideId, ctrlShowClass) {
|
||||
var metaContainer = document.getElementsByClassName("meta-container")[0];
|
||||
var sidebar = document.getElementsByClassName('sidebar')[0];
|
||||
var sidebarTest = document.getElementById('sidebar-test');
|
||||
var ctrlHide = document.getElementById(ctrlHideId);
|
||||
var ctrlShowSet = document.getElementsByClassName(ctrlShowClass);
|
||||
|
||||
if(sidebar.style.width.includes('15px')) {
|
||||
showSidebar(metaContainer, sidebar, ctrlHide, ctrlShowSet, sidebarTest);
|
||||
} else {
|
||||
hideSidebar(metaContainer, sidebar, ctrlHide, ctrlShowSet, sidebarTest);
|
||||
}
|
||||
}
|
||||
|
||||
function showSidebar(mContainer, sidebar, ctrlHide, ctrlShowSet, sidebarTest) {
|
||||
sidebar.style.cursor = 'default';
|
||||
mContainer.style.marginLeft = '';
|
||||
sidebarTest.style.width = '';
|
||||
sidebarTest.style.height = '';
|
||||
sidebar.style.height = '';
|
||||
sidebar.style.marginLeft = '';
|
||||
sidebar.style.width = '';
|
||||
var i;
|
||||
for (i = 0; i < sidebarTest.children.length; i++) {
|
||||
sidebarTest.children[i].style.display = '';
|
||||
}
|
||||
document.getElementById('iteration-selector').style.display = '';
|
||||
document.getElementById('sidebar-iteration-list').style.display = '';
|
||||
document.getElementById('sidebar-copyright').style.display = '';
|
||||
for(i = 0; i < ctrlShowSet.length; i ++) {
|
||||
ctrlShowSet[i].style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function hideSidebar(mContainer, sidebar, ctrlHide, ctrlShowSet, sidebarTest) {
|
||||
document.getElementById('iteration-selector').style.display = 'none';
|
||||
document.getElementById('sidebar-iteration-list').style.display = 'none';
|
||||
document.getElementById('sidebar-copyright').style.display = 'none';
|
||||
var i;
|
||||
for (i = 0; i < sidebarTest.children.length; i++) {
|
||||
sidebarTest.children[i].style.display = 'none';
|
||||
}
|
||||
sidebarTest.style.display = '';
|
||||
for(i = 0; i < ctrlShowSet.length; i ++) {
|
||||
ctrlShowSet[i].style.display = '';
|
||||
ctrlShowSet[i].style.color = 'black';
|
||||
}
|
||||
sidebar.style.width = '15px';
|
||||
sidebar.style.marginLeft = '-15px';
|
||||
sidebar.style.height = '100%';
|
||||
sidebarTest.style.height = '100%';
|
||||
sidebarTest.style.width = '100%';
|
||||
mContainer.style.marginLeft = '16px';
|
||||
sidebar.style.cursor = 'pointer';
|
||||
}
|
||||
|
||||
function previousError() {
|
||||
var errorSelector = document.getElementById("error-list-selector");
|
||||
if (errorSelector.length > 1) {
|
||||
var id = errorSelector.selectedIndex;
|
||||
if (id - 1 > 0) {
|
||||
errorSelector.selectedIndex = (id - 1);
|
||||
} else {
|
||||
errorSelector.selectedIndex = (errorSelector.length - 1);
|
||||
}
|
||||
errorSelected('error-list-selector');
|
||||
}
|
||||
}
|
||||
|
||||
function nextError() {
|
||||
var errorSelector = document.getElementById("error-list-selector");
|
||||
if (errorSelector.length > 1) {
|
||||
var id = errorSelector.selectedIndex;
|
||||
if (id + 1 < errorSelector.length) {
|
||||
errorSelector.selectedIndex = (id + 1);
|
||||
} else {
|
||||
errorSelector.selectedIndex = 1;
|
||||
}
|
||||
errorSelected('error-list-selector');
|
||||
}
|
||||
}
|
||||
|
||||
function selectIterationFromSelect() {
|
||||
var element = document.getElementById("sidebar-iteration-list");
|
||||
loadDocument(element.value);
|
||||
updateIterationSelector(element);
|
||||
}
|
||||
|
||||
function clickSelectIteration() {
|
||||
var element = document.getElementById("sidebar-iteration-list");
|
||||
for (i = 0; i < element.length; i ++) {
|
||||
option = element[i];
|
||||
var cls = option.getAttribute('class');
|
||||
switch(cls) {
|
||||
case "warning":
|
||||
option.style.backgroundColor = "yellow";
|
||||
option.style.color = "black";
|
||||
break;
|
||||
case "skip":
|
||||
option.style.backgroundColor = "silver";
|
||||
option.style.color = "black";
|
||||
break;
|
||||
case "fail":
|
||||
option.style.backgroundColor = "red";
|
||||
option.style.color = "white";
|
||||
break;
|
||||
case "exception":
|
||||
option.style.backgroundColor = "blueviolet";
|
||||
option.style.color = "white";
|
||||
break;
|
||||
default:
|
||||
option.style.backgroundColor = "white";
|
||||
option.style.color = "black";
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
function selectIteration(iteration) {
|
||||
var selectElement = document.getElementById("sidebar-iteration-list");
|
||||
var docId = loadDocument(iteration);
|
||||
selectElement.selectedIndex = docId;
|
||||
updateIterationSelector(selectElement);
|
||||
}
|
||||
|
||||
function loadDocument(fileId) {
|
||||
var result = 0;
|
||||
if(fileId == 'M') {
|
||||
document.getElementById("main-view").src = "iterations/setup.html";
|
||||
} else {
|
||||
var id = pad(fileId, 3);
|
||||
document.getElementById("main-view").src = "iterations/iteration_" + id + ".html";
|
||||
result = parseInt(fileId);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function updateIterationSelector(element) {
|
||||
var index = element.selectedIndex
|
||||
var option_class = element[index].getAttribute('class')
|
||||
if (option_class != null) {
|
||||
element.setAttribute('class', "sidebar-iteration-list " + option_class);
|
||||
} else {
|
||||
element.setAttribute('class', "sidebar-iteration-list");
|
||||
}
|
||||
}
|
||||
|
||||
function errorSelected(selectorId) {
|
||||
var newLocation = document.getElementById(selectorId).value;
|
||||
window.location.hash = newLocation;
|
||||
}
|
||||
|
||||
function pad(strNumber, padding) {
|
||||
while((strNumber.length + 1) <= padding) {
|
||||
strNumber = "0" + strNumber;
|
||||
}
|
||||
return strNumber;
|
||||
}
|
||||
|
||||
function showHide(id) {
|
||||
var ulElement = document.getElementById(id);
|
||||
if(ulElement.style.display == 'none') {
|
||||
ulElement.style.display = '';
|
||||
} else {
|
||||
ulElement.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function chapterClick(id) {
|
||||
var id_array = id.split('.');
|
||||
var node_id = "";
|
||||
var i = 0;
|
||||
var destinationElement = document.getElementById(id);
|
||||
if (destinationElement.style.display == 'none') {
|
||||
do {
|
||||
node_id += id_array[i];
|
||||
var ele = document.getElementById(node_id);
|
||||
ele.style.display = '';
|
||||
node_id += '.';
|
||||
i += 1;
|
||||
} while (i < id_array.length);
|
||||
window.location = '#' + id;
|
||||
} else {
|
||||
destinationElement.style.display = 'none';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user