Merge pull request #4629 from jcbrill/jbrill-gh4623-int
[scons.git] / timings / changelog.html
blob586ebadc6f3d53f27702fb97eec5a1dd7ebc71d2
1 <html>
2 <head>
3 <script src="js/common.js"></script>
4 <style type="text/css">
5 table {
6 border-collapse: collapse;
8 thead {
9 border-top: solid 1px gray;
10 border-left: solid 1px gray;
12 tbody {
13 border-top: solid 1px gray;
14 border-bottom: solid 1px gray;
15 border-left: solid 1px gray;
17 th {
18 text-align: center;
19 border-right: solid 1px gray;
21 td {
22 padding-left: 0.5em;
23 padding-top: 0.3em;
24 padding-bottom: 0.3em;
25 padding-right: 1.4em;
26 border-top: solid 1px gray;
27 vertical-align: top;
28 font-family: monospace;
30 form {
31 background-color: lightblue;
32 border: 1px solid gray;
33 padding: 2px;
35 iframe#content {
36 border: none;
37 width: 0px;
38 height: 0px;
41 form {
42 position: fixed;
43 left: 0px;
44 top: 0px;
45 width: 100%;
48 </style>
49 </head>
50 <body>
51 <form name="ui">
52 SVN path: <input id="url" type="text" name="url" value="">
53 SVN revision range: <input id="range" type="text" name="range" value="">
54 <input id="mode_text" type="radio" name="mode" value="text">text
55 <input id="mode_html" type="radio" name="mode" value="html">html
56 <input type="submit" value="Show Changelog">
57 </form>
59 <script>
60 params = ParseParams();
62 function fix_text(str, n) {
63 if (str.length > n)
64 return str.substring(0, n);
66 for (var i = str.length; i < n; ++i)
67 str = str + ' ';
68 return str;
71 function get_entries() {
72 return content.contentDocument.getElementsByTagName("logentry");
75 function get_info(entry) {
76 var r = new Object;
77 r.rev = entry.getAttribute("revision");
78 r.author = entry.getElementsByTagName("author")[0].textContent;
79 r.msg = entry.getElementsByTagName("msg")[0].textContent;
80 r.paths = [];
81 var paths = entry.getElementsByTagName("path")
82 for (var i = 0; i < paths.length; ++i) {
83 r.paths.push({"action" : paths[i].getAttribute("action"),
84 "value" : paths[i].textContent});
86 return r;
89 function render_log_callback() {
90 if ("mode" in params && params.mode == "text") {
91 var out = document.createElement("PRE");
92 document.body.appendChild(out);
94 var entries = get_entries();
95 for (var i = 0; i < entries.length; ++i) {
96 var info = get_info(entries[i]);
98 var msg = info.msg;
99 msg = msg.replace(/\n/g, ' ' );
100 msg = msg.replace(/\t/g, ' ' );
101 while (msg.charAt(0) == ' ')
102 msg = msg.substring(1);
104 var msg_clipped = msg.substring(0, 66);
105 if (msg_clipped.length < msg.length)
106 msg_clipped = msg_clipped + "...";
108 out.appendChild(document.createTextNode(
109 fix_text(info.rev, 6) + " " +
110 fix_text(info.author, 8) + " " +
111 msg_clipped + "\n"));
113 } else {
114 var table = document.createElement("TABLE");
115 table.setAttribute("class", "log");
116 document.body.appendChild(table);
118 var entries = get_entries();
119 for (var i = 0; i < entries.length; ++i) {
120 var info = get_info(entries[i]);
122 var tr = document.createElement("TR");
123 table.appendChild(tr);
125 var td, a;
127 // revision:
128 td = document.createElement("TD");
129 tr.appendChild(td);
131 a = document.createElement("A");
132 a.setAttribute("href", "http://scons.tigris.org/source/browse/scons?view=rev&revision=" + info.rev);
133 a.appendChild(document.createTextNode(info.rev));
135 td.appendChild(a);
137 // author:
138 td = document.createElement("TD");
139 tr.appendChild(td);
141 a = document.createElement("A");
142 a.setAttribute("href", "mailto:" + info.author);
143 a.appendChild(document.createTextNode(info.author));
145 td.appendChild(a);
147 // details:
148 td = document.createElement("TD");
149 tr.appendChild(td);
151 var p = document.createElement("PRE");
152 td.appendChild(p);
154 var s = info.msg;
155 p.appendChild(document.createTextNode(s));
157 for (var j = 0; j < info.paths.length; ++j) {
158 td.appendChild(document.createTextNode(info.paths[j]["action"] + " - "))
159 var a = document.createElement("A");
160 a.setAttribute("href", "http://scons.tigris.org/source/browse/scons" + info.paths[j]["value"] + "?r1=" + info.rev + "&r2=" + (info.rev - 1) + "&pathrev=" + info.rev);
161 a.appendChild(document.createTextNode(info.paths[j]["value"]));
162 td.appendChild(a);
163 td.appendChild(document.createElement("BR"));
169 function render_log() {
170 var svn_url = params["url"];
171 var svn_range = params["range"];
172 if (svn_url == undefined || svn_range == undefined)
173 return;
175 var url = "http://" + location.host + "/cgi-bin/svn-log?url=http://codf21.jail/svn/" +
176 unescape(svn_url) + "&range=" + unescape(svn_range);
178 // global 'content' variable: a hidden iframe used to fetch svn data.
179 content = document.createElement("IFRAME");
180 content.setAttribute("id", "content");
181 content.setAttribute("onload", "render_log_callback()");
182 content.setAttribute("src", url);
183 document.body.appendChild(content);
185 var el;
186 if ("mode" in params && params["mode"] == "text") {
187 el = document.getElementById("mode_text");
188 } else {
189 el = document.getElementById("mode_html");
191 el.setAttribute("checked", "1");
193 el = document.getElementById("url");
194 el.setAttribute("value", unescape(svn_url));
196 el = document.getElementById("range");
197 el.setAttribute("value", unescape(svn_range));
200 render_log()
201 </script>
202 </body>
203 </html>