Repository navigation
Expand file tree
/
Copy pathannotate_template.html
More file actions
139 lines (108 loc) · 2.38 KB
/
Copy pathannotate_template.html
File metadata and controls
139 lines (108 loc) · 2.38 KB
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
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<style>
.block {
width: 500px;
margin: 0 auto;
font-family: monospace;
clear:left;
}
.header {
background-color: #dddddd;
}
.header-cell {
padding: 5px;
}
table {
border-collapse: collapse;
background-color: #666666;
padding: 5px;
}
.python-table {
float: left;
margin-right: 10px;
}
.llvm-table {
}
.linenum {
padding-left: 10px;
padding-right: 10px;
padding-top: 5px;
padding-bottom: 5px;
}
.firstlinenum {
padding-top: 10px;
}
.lastlinenum {
padding-bottom: 10px;
}
.code {
padding-left: 10px;
padding-right: 10px;
padding-top: 5px;
padding-bottom: 5px;
}
.firstcode {
padding-top: 10px;
}
.lastcode {
padding-bottom: 10px;
}
.line {
background-color: #666666;
border:1px solid #666666;
color: rgb(227, 206, 171);
}
.meta {
float: left;
padding: 10px;
}
.type {
color: rgb(204, 147, 147);
}
</style>
<script>
$(function() {
$( document ).tooltip();
});
$(document).ready(function() {
$("[id$='llvm']").css("display", "none");
function rgb2hex(rgb) {
rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
function hex(x) {
return ("0" + parseInt(x).toString(16)).slice(-2);
}
return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
}
$(".line").click(function() {
var this_id = "." + $(this).attr("class").split(" ")[0];
var rgb_bg = $(this_id).css("background-color");
var hex_bg = rgb2hex(rgb_bg);
if (hex_bg == "#666666") {
$("[class^='id']").css("background-color", "#666666");
$(this_id).css("background-color", "#999999");
}
else {
$(this_id).css("background-color", "#666666");
}
});
});
</script>
</head>
<body>
<div class="meta">sum(2, 3)<br/>test1.py<br/>line 52</div>
<table class="python-table">
%for line in python_lines:
<tr class="id${line['num']} line python"><td class="linenum firstlinenum">${line['num']}</td><td class="code firstcode">${line['source']}</td></tr>
%endfor
</table>
<table class="llvm-table">
%for line in llvm_lines:
<tr class="id${line['num']} line llvm"><td class="code firstcode">${line['source']}</td></tr>
%endfor
</table>
</body>
</html>