-
Notifications
You must be signed in to change notification settings - Fork 59
/
showIB.html
140 lines (97 loc) · 3.99 KB
/
showIB.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>CMSSW Integration Builds</title>
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<script type='text/javascript' src="js/jquery-2.1.1.min.js"></script>
<script type='text/javascript' src="https://netdna.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script type='text/javascript' src="js/render.js"></script>
<div class="container">
<div class="span3"></div>
<div class="col-md-10" id="results"></div>
</div>
<div class="span3">
</div>
<script>
$(document).ready(function () {
enable_tabs = function(){
//Enable tabbable tabs
$('#myTab a').click(function (e) {
e.preventDefault()
console.log('tabs')
})
// Javascript to enable link to tab
var url = document.location.toString();
if (url.match('#')) {
var hash = url.split('#')[1]
var release_name = hash.substring( 0 , hash.lastIndexOf( '_' ) )
var lastChar = release_name.charAt( release_name.length - 1 )
// the url is asking for an IB
if ( lastChar == 'X' || lastChar == 'C' ){
$('#myTab a[href=#' + release_name + ']').tab('show')
}else {
$('#myTab a[href=#' + hash + ']').tab('show') ;
}
}
// Change hash for page-reload
$('myTab a').on('shown', function (e) {
window.location.hash = e.target.hash;
})
}
paintMenu = function (structure){
console.log("painting menu bar")
menuBar = getMenuBar(structure)
$("#results").append(menuBar)
}
// Reads the file structre.json to know how to paint the menu and how to paint the tabs.
start_load = function(structure){
paintMenu(structure)
// create tab panel
var tabs = $('<ul id="myTab" class="nav nav-tabs hidden"></ul>')
//create nav tabs
var all_releases = structure.all_release_queues;
var default_release = structure.default_release;
for(var i = 0; i < all_releases.length; i++){
var release_name = all_releases[i];
//add tab
var tab_title = $('<li><a href="#'+release_name+'" data-toggle="tab">'+release_name+'</a></li>')
tabs.append(tab_title)
}
$("#results").append(tabs)
//create tab panes
var tabs_content = $('<div class="tab-content"></div>')
tabs_content.attr("id","tabs_container")
for(var i = 0; i < all_releases.length; i++){
var release_name = all_releases[i];
// make selected page active
// if default_release not present, make first page active
if ( (!default_release && i == 0) || release_name === default_release ){
var tab_pane = $('<div class="tab-pane active" id="'+release_name+'"></div>')
}else{
var tab_pane = $('<div class="tab-pane" id="'+release_name+'">')
}
var rv_exceptions_link = get_rv_exceptions_link_rq( release_name )
tab_pane.append($("<br>"))
tab_pane.append( rv_exceptions_link )
// write the titles for the release queue
var title_rel_name=$("<h1>").text(release_name)
tab_pane.append(title_rel_name)
tab_pane.append($("<hr>"))
tab_pane.append($("<br>"))
// write the comparisons for the release queue, here I read a json file per release queue
var compFileName = "data/" + release_name + ".json"
console.log( compFileName )
$.getJSON( compFileName, paintComparisons )
tabs_content.append(tab_pane)
}
$("#results").append(tabs_content)
enable_tabs()
}
$.getJSON( "data/structure.json", start_load)
})
</script>
</body>
</html>