source: trunk/icedtea-web/tests/report-styles/index.js

Last change on this file was 418, checked in by dmik, 13 years ago

Merge icedtea-web v1.3 to trunk.

  • Property svn:eol-style set to native
File size: 2.4 KB
Line 
1function showhideMethods(inElement,toValue) {
2 var e = document.getElementById(inElement);
3 methods=e.getElementsByClassName("method");
4 for ( var i = 0; i < methods.length; i++ ) {
5 methods[i].style.display=toValue
6 }
7}
8function openAnchor() {
9 anchor=self.document.location.hash;
10 if (anchor==null || anchor=="") return;
11 stub=anchor.substring(1);
12 var logs=getLogsArray(stub);
13 logs[0].style.display="inline";
14 logs[1].style.display="inline";
15 recalcArraysWidth(logs);
16 window.location.hash=stub;
17}
18
19function negateIdDisplay(which) {
20 var e = document.getElementById(which);
21 if (e.style.display=="block") {
22 e.style.display="none"
23 } else {
24 e.style.display="block"
25 }
26}
27
28function negateIdDisplayInline(which) {
29 var e = document.getElementById(which);
30 if (e.style.display=="inline") {
31 e.style.display="none"
32 } else {
33 e.style.display="inline"
34 }
35}
36
37function setClassDisplay(which,what) {
38 var e = document.getElementsByClassName(which);
39 for ( var i = 0; i < e.length; i++ ) {
40 e[i].style.display=what
41 }
42}
43
44function negateClassBlocDisplay(which) {
45 var e = document.getElementsByClassName(which);
46 for ( var i = 0; i < e.length; i++ ) {
47 if (e[i].style.display=="block") {
48 e[i].style.display="none"
49 } else {
50 e[i].style.display="block"
51 }
52 }
53}
54
55function negateClassBlocDisplayIn(where,which) {
56 var parent = document.getElementById(where);
57 var e = parent.getElementsByClassName(which);
58 for ( var i = 0; i < e.length; i++ ) {
59 if (e[i].style.display=="block") {
60 e[i].style.display="none"
61 } else {
62 e[i].style.display="block"
63 }
64 }
65}
66
67function getLogsArray(stub) {
68 return new Array(document.getElementById(stub+".out"),document.getElementById(stub+".err"),document.getElementById(stub+".all"));
69}
70
71function recalcLogsWidth(stub) {
72 var logs=getLogsArray(stub)
73 recalcArraysWidth(logs);
74}
75function showAllLogs() {
76 var e = document.getElementsByClassName("method");
77 for ( var i = 0; i < e.length; i++ ) {
78 stub=e[i].id;
79 var logs=getLogsArray(stub)
80 logs[0].style.display="none";
81 logs[1].style.display="none"
82 logs[2].style.display="inline"
83 recalcArraysWidth(logs);
84
85 }
86}
87
88function recalcArraysWidth(logs) {
89 visible=0;
90 for ( var i = 0; i < logs.length; i++ ) {
91 if (logs[i].style.display!="none"){
92 visible++;
93 }
94 }
95 if (visible==0) return;
96 nwWidth=90/visible;
97 for ( var i = 0; i < logs.length; i++ ) {
98 if (logs[i].style.display!="none"){
99 logs[i].style.width=nwWidth+"%";
100 }
101 }
102}
Note: See TracBrowser for help on using the repository browser.