-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwizzard.js
108 lines (97 loc) · 3.25 KB
/
wizzard.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
let daten_andere_rechte = false;
let daten_urhg = false;
let datenbank = false;
let datenbankwerk = false;
function showImpress() {
document.getElementById('impressDiv').style.display = 'block';
document.getElementById('wizzardDiv').style.display = 'none';
}
function closeImpress() {
document.getElementById('impressDiv').style.display = 'none';
document.getElementById('wizzardDiv').style.display = 'block';
}
function showTabs(tabIds) {
console.log('showing tabs', tabIds);
// hide all tabs
document.querySelectorAll('.tab').forEach(el => {
el.classList.remove('show');
});
// deactive all circles
document.querySelectorAll('.step').forEach(el => {
el.classList.remove('active');
});
for (var tabId of tabIds) {
// show tab
document.getElementById(tabId).classList.add('show');
// set step circle to `active`
if (tabId.startsWith('tab_')) {
document.getElementById(tabId.replace('tab_', 'step_')).classList.add('active');
}
}
}
function showTab(tabId) {
showTabs([tabId]);
}
function step(tab, val) {
if (tab === 'tab_0') { // einführung
document.getElementById('step_0').className += ' completed';
showTab('tab_1');
} else if (tab === 'tab_1') { // daten
daten_andere_rechte = (val === 'no');
if (daten_andere_rechte) {
document.getElementById('step_1').className += ' completed red';
showTabs(['data_other_rights_div', 'links', 'repeat']);
} else {
document.getElementById('step_1').className += ' completed green';
showTab('tab_2');
}
} else if (tab === 'tab_2') { // datensätze
daten_urhg = (val === 'yes');
document.getElementById('step_2').className += ' completed green';
showTab('tab_3');
}
else if (tab === 'tab_3') { // datenbank
datenbank = (val === 'yes');
document.getElementById('step_3').className += ' completed green';
showTab('tab_4');
} else if (tab === 'tab_4') { // datenbankwerk
datenbankwerk = (val === 'yes');
document.getElementById('step_4').className += ' completed green';
showTabs(['links', 'infos', 'repeat']);
if (
daten_urhg === false &&
datenbank === false &&
datenbankwerk === false) {
// daten
document.getElementById('data').style.display = 'block';
} else if (
daten_urhg === true &&
datenbank === false &&
datenbankwerk === false) {
// daten urhg
document.getElementById('data_urhg').style.display = 'block';
} else if (
daten_urhg === false &&
datenbank === true &&
datenbankwerk === false) {
// daten & datenbank
document.getElementById('data_database').style.display = 'block';
} else if (
daten_urhg === true &&
datenbank === true &&
datenbankwerk === false) {
// daten urhg & datenbank
document.getElementById('data_urhg_database').style.display = 'block';
} else if (
daten_urhg === false &&
datenbankwerk === true) {
// daten & datenbankwerk
document.getElementById('data_database_work').style.display = 'block';
} else if (
daten_urhg === true &&
datenbankwerk === true) {
// daten urgh & datenbankwerk
document.getElementById('data_urhg_database_work').style.display = 'block';
}
}
}