4 /* Hide/show various bits depending on mirror/push
5 * mode in regproj.cgi: */
10 function mirror_push__click(ev, which) {
11 if (!ev) var ev = window.event;
12 if (which == 'mirror') {
13 document.getElementById('mirror_url').style.display = tr_display1;
15 document.getElementById('mirror_refs').style.display = tr_display2;
17 document.getElementById('mirror_url').style.display = 'none';
19 document.getElementById('mirror_refs').style.display = 'none';
22 function mirror_push_prepare(mr, pr) {
25 mr.onclick = function(e) { mirror_push__click(e, 'mirror') };
26 pr.onclick = function(e) { mirror_push__click(e, 'push') };
27 tr_display1 = document.getElementById('mirror_url').style.display;
29 display2 = document.getElementById('mirror_refs');
32 tr_display2 = display2.style.display;
35 function set_mirror_source(which) {
36 var radios = document.getElementsByTagName('input');
37 for (var i = 0; i < radios.length; ++i) {
38 var checkclass = ' ' + radios[i].className + ' ';
39 if (checkclass.indexOf(' mirror_sources ') >= 0) {
40 radios[i].checked = (radios[i].value == which) ? true : false;
44 window.addEvent('domready', function() {
45 mirror_push_prepare(document.getElementById('mirror_radio'),
46 document.getElementById('push_radio'));
47 if (document.getElementById('mirror_radio').checked) {
48 mirror_push__click(null, 'mirror')
50 if (document.getElementById('push_radio').checked) {
51 mirror_push__click(null, 'push')