3 <script src=
"js/common.js"></script>
4 <style type=
"text/css">
6 border-collapse: collapse
;
9 border-top: solid
1px gray
;
10 border-left: solid
1px gray
;
13 border-top: solid
1px gray
;
14 border-bottom: solid
1px gray
;
15 border-left: solid
1px gray
;
19 border-right: solid
1px gray
;
24 padding-bottom: 0.3em;
26 border-top: solid
1px gray
;
28 font-family: monospace
;
31 background-color: lightblue
;
32 border: 1px solid gray
;
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">
60 params
= ParseParams();
62 function fix_text(str
, n
) {
64 return str
.substring(0, n
);
66 for (var i
= str
.length
; i
< n
; ++i
)
71 function get_entries() {
72 return content
.contentDocument
.getElementsByTagName("logentry");
75 function get_info(entry
) {
77 r
.rev
= entry
.getAttribute("revision");
78 r
.author
= entry
.getElementsByTagName("author")[0].textContent
;
79 r
.msg
= entry
.getElementsByTagName("msg")[0].textContent
;
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
});
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
]);
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"));
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
);
128 td
= document
.createElement("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
));
138 td
= document
.createElement("TD");
141 a
= document
.createElement("A");
142 a
.setAttribute("href", "mailto:" + info
.author
);
143 a
.appendChild(document
.createTextNode(info
.author
));
148 td
= document
.createElement("TD");
151 var p
= document
.createElement("PRE");
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"]));
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)
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
);
186 if ("mode" in params
&& params
["mode"] == "text") {
187 el
= document
.getElementById("mode_text");
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
));