Last change
on this file since 25027 was 25027, checked in by jmt12, 12 years ago |
Adding the packages directory, and within it a configured version of dokuwiki all ready to run
|
File size:
1.1 KB
|
Line | |
---|
1 | /**
|
---|
2 | * Hide list subscription style if target is a page
|
---|
3 | *
|
---|
4 | * @author Adrian Lang <[email protected]>
|
---|
5 | */
|
---|
6 |
|
---|
7 | addInitEvent(function () {
|
---|
8 | var form = $('subscribe__form');
|
---|
9 | if (!form) {
|
---|
10 | return;
|
---|
11 | }
|
---|
12 |
|
---|
13 | var styleradios = {};
|
---|
14 |
|
---|
15 | function update_state() {
|
---|
16 | if (!this.checked) {
|
---|
17 | return;
|
---|
18 | }
|
---|
19 | if (this.value.match(/:$/)) {
|
---|
20 | styleradios.list.parentNode.style.display = '';
|
---|
21 | } else {
|
---|
22 | styleradios.list.parentNode.style.display = 'none';
|
---|
23 | if (styleradios.list.checked) {
|
---|
24 | styleradios.digest.checked = 'checked';
|
---|
25 | }
|
---|
26 | }
|
---|
27 | }
|
---|
28 |
|
---|
29 | var cur_sel = null;
|
---|
30 |
|
---|
31 | var inputs = form.getElementsByTagName('input');
|
---|
32 | for (var i = 0; i < inputs.length ; ++i) {
|
---|
33 | switch (inputs[i].name) {
|
---|
34 | case 'sub_target':
|
---|
35 | addEvent(inputs[i], 'click', update_state);
|
---|
36 | if (inputs[i].checked) {
|
---|
37 | cur_sel = inputs[i];
|
---|
38 | }
|
---|
39 | break;
|
---|
40 | case 'sub_style':
|
---|
41 | styleradios[inputs[i].value] = inputs[i];
|
---|
42 | break;
|
---|
43 | }
|
---|
44 | }
|
---|
45 | update_state.call(cur_sel);
|
---|
46 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.