diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/abmahn.js | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/js/abmahn.js b/js/abmahn.js index bad69a8..c33ed70 100644 --- a/js/abmahn.js +++ b/js/abmahn.js | |||
@@ -55,6 +55,15 @@ function ensureContent() { | |||
55 | return missing; | 55 | return missing; |
56 | } | 56 | } |
57 | 57 | ||
58 | function ensureCheckbox() { | ||
59 | var checked = 0; | ||
60 | for(var i = 0;i<arguments.length; i++) | ||
61 | if (getCheck(arguments[i])) | ||
62 | ++checked; | ||
63 | return checked; | ||
64 | } | ||
65 | |||
66 | |||
58 | // Code is heavily inspired by | 67 | // Code is heavily inspired by |
59 | // https://github.com/alicelieutier/smoothScroll/blob/master/smoothscroll.js | 68 | // https://github.com/alicelieutier/smoothScroll/blob/master/smoothscroll.js |
60 | function scrollTo(end) { | 69 | function scrollTo(end) { |
@@ -139,13 +148,25 @@ function step_3_done() { | |||
139 | } | 148 | } |
140 | 149 | ||
141 | function step_4_done() { | 150 | function step_4_done() { |
142 | addClass('wrapper', 'stepdone-4'); | 151 | if (ensureCheckbox('alibi_urlaub', 'alibi_ausserhalb', 'alibi_nichtzuhause', 'alibi_arbeit', 'alibi_besuch', |
143 | head_5_click(); | 152 | 'alibi_keinendgeraet', 'alibi_nichtwohnhaft')==0) { |
153 | setClass('step4-missing', 'warnmiss'); | ||
154 | } else { | ||
155 | setClass('step4-missing', 'hidden'); | ||
156 | addClass('wrapper', 'stepdone-4'); | ||
157 | head_5_click(); | ||
158 | } | ||
144 | } | 159 | } |
145 | 160 | ||
146 | function step_5_done() { | 161 | function step_5_done() { |
147 | addClass('wrapper', 'stepdone-5'); | 162 | if (ensureCheckbox('alibi_freifunk', 'alibi_tornode', 'alibi_offeneswifi', 'alibi_familie', 'alibi_wg', |
148 | head_6_click(); | 163 | 'alibi_nachbarn', 'alibi_fluechtlingshilfe')==0) { |
164 | setClass('step5-missing', 'warnmiss'); | ||
165 | } else { | ||
166 | setClass('step5-missing', 'hidden'); | ||
167 | addClass('wrapper', 'stepdone-5'); | ||
168 | head_6_click(); | ||
169 | } | ||
149 | } | 170 | } |
150 | 171 | ||
151 | function step_6_done() { | 172 | function step_6_done() { |