OLD | NEW |
1 /* | 1 /* |
2 Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 Use of this source code is governed by a BSD-style license that can be | 3 Use of this source code is governed by a BSD-style license that can be |
4 found in the LICENSE file. | 4 found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 /* | 7 /* |
8 * Common methods for Subversion change log JS. | 8 * Common methods for Subversion change log JS. |
9 * Requires the GCI service "svn-log" to be set up on the same web server as | 9 * Requires the GCI service "svn-log" to be set up on the same web server as |
10 * the one serving this page. | 10 * the one serving this page. |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 * colon, where the first is the from-revision and the second is the | 138 * colon, where the first is the from-revision and the second is the |
139 * to-revision. | 139 * to-revision. |
140 * @param viewvcUrl {string} URL to the ViewVC web application that can be used | 140 * @param viewvcUrl {string} URL to the ViewVC web application that can be used |
141 * to view revisions. This is used for links to revisions. | 141 * to view revisions. This is used for links to revisions. |
142 */ | 142 */ |
143 function render_log(svnRootUrl, svnPath, svnRange, viewvcUrl) { | 143 function render_log(svnRootUrl, svnPath, svnRange, viewvcUrl) { |
144 if (svnPath == undefined || svnRange == undefined) | 144 if (svnPath == undefined || svnRange == undefined) |
145 return; | 145 return; |
146 gViewvcUrl = viewvcUrl; | 146 gViewvcUrl = viewvcUrl; |
147 | 147 |
148 var url = "http://" + location.host + "/cgi-bin/svn-log?url=" + | 148 var url = "//" + location.host + "/cgi-bin/svn-log?url=" + |
149 svnRootUrl + unescape(svnPath) + "&range=" + unescape(svnRange); | 149 svnRootUrl + unescape(svnPath) + "&range=" + unescape(svnRange); |
150 | 150 |
151 // global 'gContent' variable: a hidden iframe used to fetch svn data. | 151 // global 'gContent' variable: a hidden iframe used to fetch svn data. |
152 gContent = document.createElement("IFRAME"); | 152 gContent = document.createElement("IFRAME"); |
153 gContent.setAttribute("id", "content"); | 153 gContent.setAttribute("id", "content"); |
154 gContent.setAttribute("onload", "render_log_callback_()"); | 154 gContent.setAttribute("onload", "render_log_callback_()"); |
155 gContent.setAttribute("src", url); | 155 gContent.setAttribute("src", url); |
156 document.body.appendChild(gContent); | 156 document.body.appendChild(gContent); |
157 | 157 |
158 var el; | 158 var el; |
159 if ("mode" in params && params["mode"] == "text") { | 159 if ("mode" in params && params["mode"] == "text") { |
160 el = document.getElementById("mode_text"); | 160 el = document.getElementById("mode_text"); |
161 } else { | 161 } else { |
162 el = document.getElementById("mode_html"); | 162 el = document.getElementById("mode_html"); |
163 } | 163 } |
164 el.setAttribute("checked", "1"); | 164 el.setAttribute("checked", "1"); |
165 | 165 |
166 el = document.getElementById("url"); | 166 el = document.getElementById("url"); |
167 el.setAttribute("value", unescape(svnPath)); | 167 el.setAttribute("value", unescape(svnPath)); |
168 | 168 |
169 el = document.getElementById("range"); | 169 el = document.getElementById("range"); |
170 el.setAttribute("value", unescape(svnRange)); | 170 el.setAttribute("value", unescape(svnRange)); |
171 } | 171 } |
OLD | NEW |