4 /* Hide/show various bits depending on mirror/push
5 * mode in regproj.cgi: */
8 function mirror_push__click(ev, which) {
9 if (!ev) var ev = window.event;
10 if (which == 'mirror') {
11 document.getElementById('mirror_url').style.display = tr_display;
13 document.getElementById('mirror_url').style.display = 'none';
16 function mirror_push_prepare(mr, pr) {
19 mr.onclick = function(e) { mirror_push__click(e, 'mirror') };
20 pr.onclick = function(e) { mirror_push__click(e, 'push') };
21 tr_display = document.getElementById('mirror_url').style.display;
23 function set_mirror_source(which) {
24 var radios = document.getElementsByTagName('input');
25 for (var i = 0; i < radios.length; ++i) {
26 var checkclass = ' ' + radios[i].className + ' ';
27 if (checkclass.indexOf(' mirror_sources ') >= 0) {
28 radios[i].checked = (radios[i].value == which) ? true : false;
32 window.addEvent('domready', function() {
33 mirror_push_prepare(document.getElementById('mirror_radio'),
34 document.getElementById('push_radio'));
35 if (document.getElementById('mirror_radio').checked) {
36 mirror_push__click(null, 'mirror')
38 if (document.getElementById('push_radio').checked) {
39 mirror_push__click(null, 'push')