hyperbook 0.67.0 → 0.68.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/directive-multievent/multievent.js +441 -2
- package/dist/assets/store.js +1 -0
- package/dist/index.js +16 -12
- package/package.json +2 -2
|
@@ -33,6 +33,392 @@ var multievent = {
|
|
|
33
33
|
return MischObj;
|
|
34
34
|
},
|
|
35
35
|
orig: [],
|
|
36
|
+
saveState: async function (clNr) {
|
|
37
|
+
var SK = document.getElementsByClassName("multievent")[clNr];
|
|
38
|
+
if (!SK) return;
|
|
39
|
+
|
|
40
|
+
var state = {
|
|
41
|
+
vNr: multievent.vNr[clNr],
|
|
42
|
+
gesamtwertung: multievent.gesamtwertung[clNr],
|
|
43
|
+
gewertet: multievent.gewertet[clNr],
|
|
44
|
+
inputs: [],
|
|
45
|
+
buttons: [],
|
|
46
|
+
textareas: []
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// Save input values and states
|
|
50
|
+
var inputs = SK.getElementsByTagName("input");
|
|
51
|
+
for (var i = 0; i < inputs.length; i++) {
|
|
52
|
+
state.inputs.push({
|
|
53
|
+
type: inputs[i].type,
|
|
54
|
+
value: inputs[i].value,
|
|
55
|
+
checked: inputs[i].checked,
|
|
56
|
+
disabled: inputs[i].disabled,
|
|
57
|
+
id: inputs[i].id,
|
|
58
|
+
name: inputs[i].getAttribute("name"),
|
|
59
|
+
dataAttributes: {
|
|
60
|
+
markiert: inputs[i].getAttribute("data-markiert"),
|
|
61
|
+
gemischt: inputs[i].getAttribute("data-gemischt"),
|
|
62
|
+
BuchstSind: inputs[i].getAttribute("data-BuchstSind"),
|
|
63
|
+
Nummer: inputs[i].getAttribute("data-Nummer"),
|
|
64
|
+
BegriffeSind: inputs[i].getAttribute("data-BegriffeSind"),
|
|
65
|
+
Fehler: inputs[i].getAttribute("data-Fehler")
|
|
66
|
+
},
|
|
67
|
+
style: {
|
|
68
|
+
backgroundColor: inputs[i].style.backgroundColor,
|
|
69
|
+
backgroundImage: inputs[i].style.backgroundImage,
|
|
70
|
+
backgroundSize: inputs[i].style.backgroundSize,
|
|
71
|
+
color: inputs[i].style.color
|
|
72
|
+
},
|
|
73
|
+
parentStyle: inputs[i].parentNode ? {
|
|
74
|
+
backgroundColor: inputs[i].parentNode.style.backgroundColor,
|
|
75
|
+
backgroundImage: inputs[i].parentNode.style.backgroundImage,
|
|
76
|
+
backgroundSize: inputs[i].parentNode.style.backgroundSize
|
|
77
|
+
} : null,
|
|
78
|
+
siblingHTML: {
|
|
79
|
+
prev: inputs[i].previousSibling ? inputs[i].previousSibling.innerHTML : null,
|
|
80
|
+
next: inputs[i].nextSibling ? inputs[i].nextSibling.innerHTML : null
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Save button states
|
|
86
|
+
var buttons = SK.getElementsByClassName("butAnAus");
|
|
87
|
+
for (var i = 0; i < buttons.length; i++) {
|
|
88
|
+
state.buttons.push({
|
|
89
|
+
id: buttons[i].id,
|
|
90
|
+
markiert: buttons[i].getAttribute("data-markiert"),
|
|
91
|
+
gewertet: buttons[i].getAttribute("data-gewertet"),
|
|
92
|
+
style: {
|
|
93
|
+
backgroundColor: buttons[i].style.backgroundColor,
|
|
94
|
+
backgroundImage: buttons[i].style.backgroundImage,
|
|
95
|
+
color: buttons[i].style.color,
|
|
96
|
+
border: buttons[i].style.border,
|
|
97
|
+
outline: buttons[i].style.outline,
|
|
98
|
+
outlineOffset: buttons[i].style.outlineOffset,
|
|
99
|
+
display: buttons[i].style.display
|
|
100
|
+
},
|
|
101
|
+
nextSiblingHTML: buttons[i].nextSibling ? buttons[i].nextSibling.innerHTML : null
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Save word search button states
|
|
106
|
+
var suchButtons = SK.getElementsByClassName("MuEvSuBut");
|
|
107
|
+
state.suchButtons = [];
|
|
108
|
+
for (var i = 0; i < suchButtons.length; i++) {
|
|
109
|
+
state.suchButtons.push({
|
|
110
|
+
id: suchButtons[i].id,
|
|
111
|
+
markiert: suchButtons[i].getAttribute("data-markiert"),
|
|
112
|
+
gewertet: suchButtons[i].getAttribute("data-gewertet"),
|
|
113
|
+
spielAus: suchButtons[i].getAttribute("data-spielAus"),
|
|
114
|
+
style: {
|
|
115
|
+
backgroundColor: suchButtons[i].style.backgroundColor,
|
|
116
|
+
fontWeight: suchButtons[i].style.fontWeight,
|
|
117
|
+
border: suchButtons[i].style.border,
|
|
118
|
+
outline: suchButtons[i].style.outline,
|
|
119
|
+
outlineOffset: suchButtons[i].style.outlineOffset,
|
|
120
|
+
borderRadius: suchButtons[i].style.borderRadius
|
|
121
|
+
},
|
|
122
|
+
parentStyle: suchButtons[i].parentNode ? {
|
|
123
|
+
backgroundColor: suchButtons[i].parentNode.style.backgroundColor
|
|
124
|
+
} : null
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Save HangMan (Hangman) display elements
|
|
129
|
+
var haManAusg = SK.getElementsByClassName("MulEvHaManAusg");
|
|
130
|
+
state.haManAusg = [];
|
|
131
|
+
for (var i = 0; i < haManAusg.length; i++) {
|
|
132
|
+
state.haManAusg.push({
|
|
133
|
+
id: haManAusg[i].id,
|
|
134
|
+
innerHTML: haManAusg[i].innerHTML
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
var haManFehl = SK.getElementsByClassName("MulEvHaManFehl");
|
|
139
|
+
state.haManFehl = [];
|
|
140
|
+
for (var i = 0; i < haManFehl.length; i++) {
|
|
141
|
+
state.haManFehl.push({
|
|
142
|
+
id: haManFehl[i].id,
|
|
143
|
+
innerHTML: haManFehl[i].innerHTML,
|
|
144
|
+
style: {
|
|
145
|
+
textDecoration: haManFehl[i].style.textDecoration
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Save evaluation button state
|
|
151
|
+
var evalButton = document.getElementById("MuEvAuswButB" + clNr);
|
|
152
|
+
if (evalButton) {
|
|
153
|
+
state.evalButton = {
|
|
154
|
+
borderStyle: evalButton.style.border,
|
|
155
|
+
borderRadius: evalButton.style.borderRadius
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
var versucheSpan = document.getElementById("MultieventVersuche" + clNr);
|
|
160
|
+
if (versucheSpan) {
|
|
161
|
+
state.versucheStyle = {
|
|
162
|
+
fontWeight: versucheSpan.style.fontWeight
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Save hint visibility
|
|
167
|
+
var hinweisRichtig = SK.getElementsByClassName("MultieventhinweisRichtig" + clNr);
|
|
168
|
+
state.hinweisRichtig = [];
|
|
169
|
+
for (var i = 0; i < hinweisRichtig.length; i++) {
|
|
170
|
+
state.hinweisRichtig.push({
|
|
171
|
+
display: hinweisRichtig[i].style.display
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
var hinweisFalsch = SK.getElementsByClassName("MultieventhinweisFalsch" + clNr);
|
|
176
|
+
state.hinweisFalsch = [];
|
|
177
|
+
for (var i = 0; i < hinweisFalsch.length; i++) {
|
|
178
|
+
state.hinweisFalsch.push({
|
|
179
|
+
display: hinweisFalsch[i].style.display
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Save textarea values
|
|
184
|
+
var textareas = SK.getElementsByTagName("textarea");
|
|
185
|
+
for (var i = 0; i < textareas.length; i++) {
|
|
186
|
+
state.textareas.push({
|
|
187
|
+
value: textareas[i].value
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Save select values
|
|
192
|
+
var selects = SK.getElementsByTagName("select");
|
|
193
|
+
state.selects = [];
|
|
194
|
+
for (var i = 0; i < selects.length; i++) {
|
|
195
|
+
state.selects.push({
|
|
196
|
+
selectedIndex: selects[i].selectedIndex,
|
|
197
|
+
disabled: selects[i].disabled,
|
|
198
|
+
style: {
|
|
199
|
+
backgroundColor: selects[i].style.backgroundColor,
|
|
200
|
+
backgroundImage: selects[i].style.backgroundImage,
|
|
201
|
+
backgroundSize: selects[i].style.backgroundSize,
|
|
202
|
+
color: selects[i].style.color
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
await store.multievent.put({
|
|
208
|
+
id: "multievent_" + clNr + "_" + window.location.pathname,
|
|
209
|
+
state: JSON.stringify(state)
|
|
210
|
+
});
|
|
211
|
+
},
|
|
212
|
+
loadState: async function (clNr) {
|
|
213
|
+
try {
|
|
214
|
+
var record = await store.multievent.get("multievent_" + clNr + "_" + window.location.pathname);
|
|
215
|
+
if (!record) return false;
|
|
216
|
+
|
|
217
|
+
var state = JSON.parse(record.state);
|
|
218
|
+
var SK = document.getElementsByClassName("multievent")[clNr];
|
|
219
|
+
if (!SK) return false;
|
|
220
|
+
|
|
221
|
+
// Restore version number and evaluation state
|
|
222
|
+
if (state.vNr !== undefined) multievent.vNr[clNr] = state.vNr;
|
|
223
|
+
if (state.gesamtwertung !== undefined) multievent.gesamtwertung[clNr] = state.gesamtwertung;
|
|
224
|
+
if (state.gewertet !== undefined) multievent.gewertet[clNr] = state.gewertet;
|
|
225
|
+
|
|
226
|
+
// Restore inputs
|
|
227
|
+
var inputs = SK.getElementsByTagName("input");
|
|
228
|
+
for (var i = 0; i < inputs.length && i < state.inputs.length; i++) {
|
|
229
|
+
if (state.inputs[i].type === inputs[i].type) {
|
|
230
|
+
inputs[i].value = state.inputs[i].value;
|
|
231
|
+
inputs[i].checked = state.inputs[i].checked;
|
|
232
|
+
inputs[i].disabled = state.inputs[i].disabled;
|
|
233
|
+
|
|
234
|
+
// Restore data attributes
|
|
235
|
+
if (state.inputs[i].dataAttributes) {
|
|
236
|
+
var attrs = state.inputs[i].dataAttributes;
|
|
237
|
+
if (attrs.markiert) inputs[i].setAttribute("data-markiert", attrs.markiert);
|
|
238
|
+
if (attrs.gemischt) inputs[i].setAttribute("data-gemischt", attrs.gemischt);
|
|
239
|
+
if (attrs.BuchstSind) inputs[i].setAttribute("data-BuchstSind", attrs.BuchstSind);
|
|
240
|
+
if (attrs.Nummer) inputs[i].setAttribute("data-Nummer", attrs.Nummer);
|
|
241
|
+
if (attrs.BegriffeSind) inputs[i].setAttribute("data-BegriffeSind", attrs.BegriffeSind);
|
|
242
|
+
if (attrs.Fehler) inputs[i].setAttribute("data-Fehler", attrs.Fehler);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// Restore input styles
|
|
246
|
+
if (state.inputs[i].style) {
|
|
247
|
+
if (state.inputs[i].style.backgroundColor) inputs[i].style.backgroundColor = state.inputs[i].style.backgroundColor;
|
|
248
|
+
if (state.inputs[i].style.backgroundImage) inputs[i].style.backgroundImage = state.inputs[i].style.backgroundImage;
|
|
249
|
+
if (state.inputs[i].style.backgroundSize) inputs[i].style.backgroundSize = state.inputs[i].style.backgroundSize;
|
|
250
|
+
if (state.inputs[i].style.color) inputs[i].style.color = state.inputs[i].style.color;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Restore parent node styles (for radio/checkbox groups)
|
|
254
|
+
if (state.inputs[i].parentStyle && inputs[i].parentNode) {
|
|
255
|
+
if (state.inputs[i].parentStyle.backgroundColor)
|
|
256
|
+
inputs[i].parentNode.style.backgroundColor = state.inputs[i].parentStyle.backgroundColor;
|
|
257
|
+
if (state.inputs[i].parentStyle.backgroundImage)
|
|
258
|
+
inputs[i].parentNode.style.backgroundImage = state.inputs[i].parentStyle.backgroundImage;
|
|
259
|
+
if (state.inputs[i].parentStyle.backgroundSize)
|
|
260
|
+
inputs[i].parentNode.style.backgroundSize = state.inputs[i].parentStyle.backgroundSize;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// Restore sibling HTML (for error indicators)
|
|
264
|
+
if (state.inputs[i].siblingHTML) {
|
|
265
|
+
if (state.inputs[i].siblingHTML.prev !== null && inputs[i].previousSibling) {
|
|
266
|
+
inputs[i].previousSibling.innerHTML = state.inputs[i].siblingHTML.prev;
|
|
267
|
+
}
|
|
268
|
+
if (state.inputs[i].siblingHTML.next !== null && inputs[i].nextSibling) {
|
|
269
|
+
inputs[i].nextSibling.innerHTML = state.inputs[i].siblingHTML.next;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Restore buttons
|
|
276
|
+
var buttons = SK.getElementsByClassName("butAnAus");
|
|
277
|
+
for (var i = 0; i < buttons.length && i < state.buttons.length; i++) {
|
|
278
|
+
if (state.buttons[i].id === buttons[i].id) {
|
|
279
|
+
buttons[i].setAttribute("data-markiert", state.buttons[i].markiert);
|
|
280
|
+
buttons[i].setAttribute("data-gewertet", state.buttons[i].gewertet);
|
|
281
|
+
|
|
282
|
+
// Restore button styles
|
|
283
|
+
if (state.buttons[i].style) {
|
|
284
|
+
if (state.buttons[i].style.backgroundColor) buttons[i].style.backgroundColor = state.buttons[i].style.backgroundColor;
|
|
285
|
+
if (state.buttons[i].style.backgroundImage) buttons[i].style.backgroundImage = state.buttons[i].style.backgroundImage;
|
|
286
|
+
if (state.buttons[i].style.color) buttons[i].style.color = state.buttons[i].style.color;
|
|
287
|
+
if (state.buttons[i].style.border) buttons[i].style.border = state.buttons[i].style.border;
|
|
288
|
+
if (state.buttons[i].style.outline) buttons[i].style.outline = state.buttons[i].style.outline;
|
|
289
|
+
if (state.buttons[i].style.outlineOffset) buttons[i].style.outlineOffset = state.buttons[i].style.outlineOffset;
|
|
290
|
+
if (state.buttons[i].style.display) buttons[i].style.display = state.buttons[i].style.display;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Restore next sibling HTML
|
|
294
|
+
if (state.buttons[i].nextSiblingHTML !== null && buttons[i].nextSibling) {
|
|
295
|
+
buttons[i].nextSibling.innerHTML = state.buttons[i].nextSiblingHTML;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// Restore textareas
|
|
301
|
+
var textareas = SK.getElementsByTagName("textarea");
|
|
302
|
+
for (var i = 0; i < textareas.length && i < state.textareas.length; i++) {
|
|
303
|
+
textareas[i].value = state.textareas[i].value;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// Restore selects
|
|
307
|
+
var selects = SK.getElementsByTagName("select");
|
|
308
|
+
if (state.selects) {
|
|
309
|
+
for (var i = 0; i < selects.length && i < state.selects.length; i++) {
|
|
310
|
+
selects[i].selectedIndex = state.selects[i].selectedIndex;
|
|
311
|
+
selects[i].disabled = state.selects[i].disabled;
|
|
312
|
+
|
|
313
|
+
// Restore select styles
|
|
314
|
+
if (state.selects[i].style) {
|
|
315
|
+
if (state.selects[i].style.backgroundColor) selects[i].style.backgroundColor = state.selects[i].style.backgroundColor;
|
|
316
|
+
if (state.selects[i].style.backgroundImage) selects[i].style.backgroundImage = state.selects[i].style.backgroundImage;
|
|
317
|
+
if (state.selects[i].style.backgroundSize) selects[i].style.backgroundSize = state.selects[i].style.backgroundSize;
|
|
318
|
+
if (state.selects[i].style.color) selects[i].style.color = state.selects[i].style.color;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// Restore word search buttons
|
|
324
|
+
if (state.suchButtons) {
|
|
325
|
+
var suchButtons = SK.getElementsByClassName("MuEvSuBut");
|
|
326
|
+
for (var i = 0; i < suchButtons.length && i < state.suchButtons.length; i++) {
|
|
327
|
+
if (state.suchButtons[i].id === suchButtons[i].id) {
|
|
328
|
+
suchButtons[i].setAttribute("data-markiert", state.suchButtons[i].markiert);
|
|
329
|
+
suchButtons[i].setAttribute("data-gewertet", state.suchButtons[i].gewertet);
|
|
330
|
+
suchButtons[i].setAttribute("data-spielAus", state.suchButtons[i].spielAus);
|
|
331
|
+
|
|
332
|
+
// Restore word search button styles
|
|
333
|
+
if (state.suchButtons[i].style) {
|
|
334
|
+
if (state.suchButtons[i].style.backgroundColor) suchButtons[i].style.backgroundColor = state.suchButtons[i].style.backgroundColor;
|
|
335
|
+
if (state.suchButtons[i].style.fontWeight) suchButtons[i].style.fontWeight = state.suchButtons[i].style.fontWeight;
|
|
336
|
+
if (state.suchButtons[i].style.border) suchButtons[i].style.border = state.suchButtons[i].style.border;
|
|
337
|
+
if (state.suchButtons[i].style.outline) suchButtons[i].style.outline = state.suchButtons[i].style.outline;
|
|
338
|
+
if (state.suchButtons[i].style.outlineOffset) suchButtons[i].style.outlineOffset = state.suchButtons[i].style.outlineOffset;
|
|
339
|
+
if (state.suchButtons[i].style.borderRadius) suchButtons[i].style.borderRadius = state.suchButtons[i].style.borderRadius;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// Restore parent styles
|
|
343
|
+
if (state.suchButtons[i].parentStyle && suchButtons[i].parentNode) {
|
|
344
|
+
if (state.suchButtons[i].parentStyle.backgroundColor)
|
|
345
|
+
suchButtons[i].parentNode.style.backgroundColor = state.suchButtons[i].parentStyle.backgroundColor;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// Restore HangMan display elements
|
|
352
|
+
if (state.haManAusg) {
|
|
353
|
+
var haManAusg = SK.getElementsByClassName("MulEvHaManAusg");
|
|
354
|
+
for (var i = 0; i < haManAusg.length && i < state.haManAusg.length; i++) {
|
|
355
|
+
if (state.haManAusg[i].id === haManAusg[i].id) {
|
|
356
|
+
haManAusg[i].innerHTML = state.haManAusg[i].innerHTML;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
if (state.haManFehl) {
|
|
362
|
+
var haManFehl = SK.getElementsByClassName("MulEvHaManFehl");
|
|
363
|
+
for (var i = 0; i < haManFehl.length && i < state.haManFehl.length; i++) {
|
|
364
|
+
if (state.haManFehl[i].id === haManFehl[i].id) {
|
|
365
|
+
haManFehl[i].innerHTML = state.haManFehl[i].innerHTML;
|
|
366
|
+
if (state.haManFehl[i].style && state.haManFehl[i].style.textDecoration) {
|
|
367
|
+
haManFehl[i].style.textDecoration = state.haManFehl[i].style.textDecoration;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// Restore evaluation button state
|
|
374
|
+
if (state.evalButton) {
|
|
375
|
+
var evalButton = document.getElementById("MuEvAuswButB" + clNr);
|
|
376
|
+
if (evalButton) {
|
|
377
|
+
if (state.evalButton.borderStyle) evalButton.style.border = state.evalButton.borderStyle;
|
|
378
|
+
if (state.evalButton.borderRadius) evalButton.style.borderRadius = state.evalButton.borderRadius;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
if (state.versucheStyle) {
|
|
383
|
+
var versucheSpan = document.getElementById("MultieventVersuche" + clNr);
|
|
384
|
+
if (versucheSpan && state.versucheStyle.fontWeight) {
|
|
385
|
+
versucheSpan.style.fontWeight = state.versucheStyle.fontWeight;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// Restore hint visibility
|
|
390
|
+
if (state.hinweisRichtig) {
|
|
391
|
+
var hinweisRichtig = SK.getElementsByClassName("MultieventhinweisRichtig" + clNr);
|
|
392
|
+
for (var i = 0; i < hinweisRichtig.length && i < state.hinweisRichtig.length; i++) {
|
|
393
|
+
if (state.hinweisRichtig[i].display) {
|
|
394
|
+
hinweisRichtig[i].style.display = state.hinweisRichtig[i].display;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
if (state.hinweisFalsch) {
|
|
400
|
+
var hinweisFalsch = SK.getElementsByClassName("MultieventhinweisFalsch" + clNr);
|
|
401
|
+
for (var i = 0; i < hinweisFalsch.length && i < state.hinweisFalsch.length; i++) {
|
|
402
|
+
if (state.hinweisFalsch[i].display) {
|
|
403
|
+
hinweisFalsch[i].style.display = state.hinweisFalsch[i].display;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
// Update attempt counter display
|
|
409
|
+
if (state.gesamtwertung !== undefined && state.gesamtwertung > 0) {
|
|
410
|
+
var versucheEl = document.getElementById("MultieventVersuche" + clNr);
|
|
411
|
+
if (versucheEl) {
|
|
412
|
+
versucheEl.innerHTML = state.gesamtwertung;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
return true;
|
|
417
|
+
} catch (e) {
|
|
418
|
+
console.error("Error loading multievent state:", e);
|
|
419
|
+
return false;
|
|
420
|
+
}
|
|
421
|
+
},
|
|
36
422
|
butAnAus: function (butID) {
|
|
37
423
|
var but = document.getElementById(butID);
|
|
38
424
|
var markiert = but.getAttribute("data-markiert");
|
|
@@ -47,6 +433,13 @@ var multievent = {
|
|
|
47
433
|
but.style.outline = "none";
|
|
48
434
|
but.setAttribute("data-markiert", "0");
|
|
49
435
|
}
|
|
436
|
+
|
|
437
|
+
// Save state after button toggle
|
|
438
|
+
var clIndex = but.closest(".multievent");
|
|
439
|
+
if (clIndex) {
|
|
440
|
+
var index = Array.from(document.getElementsByClassName("multievent")).indexOf(clIndex);
|
|
441
|
+
multievent.saveState(index);
|
|
442
|
+
}
|
|
50
443
|
}
|
|
51
444
|
},
|
|
52
445
|
vNr: [],
|
|
@@ -64,10 +457,12 @@ var multievent = {
|
|
|
64
457
|
multievent.orig[i] = SK[i].innerHTML;
|
|
65
458
|
var VersNr = multievent.zZahl(-1, 9);
|
|
66
459
|
multievent.vNr[i] = parseInt(VersNr);
|
|
67
|
-
multievent.los(i)
|
|
460
|
+
multievent.los(i).then(function(index) {
|
|
461
|
+
return multievent.loadState(index);
|
|
462
|
+
}.bind(null, i));
|
|
68
463
|
}
|
|
69
464
|
},
|
|
70
|
-
los: function (clNr) {
|
|
465
|
+
los: async function (clNr) {
|
|
71
466
|
multievent.gesamtwertung[clNr] = 0;
|
|
72
467
|
var SK = document.getElementsByClassName("multievent"); /*Suchklasse*/
|
|
73
468
|
multievent.vNr[clNr]++;
|
|
@@ -569,6 +964,40 @@ var multievent = {
|
|
|
569
964
|
}
|
|
570
965
|
|
|
571
966
|
SK[clNr].style.display = "block";
|
|
967
|
+
|
|
968
|
+
// Add event listeners to save state on changes
|
|
969
|
+
var allInputs = SK[clNr].getElementsByTagName("input");
|
|
970
|
+
for (var j = 0; j < allInputs.length; j++) {
|
|
971
|
+
allInputs[j].addEventListener("change", function() {
|
|
972
|
+
var clIndex = this.closest(".multievent");
|
|
973
|
+
if (clIndex) {
|
|
974
|
+
var index = Array.from(document.getElementsByClassName("multievent")).indexOf(clIndex);
|
|
975
|
+
multievent.saveState(index);
|
|
976
|
+
}
|
|
977
|
+
});
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
var allTextareas = SK[clNr].getElementsByTagName("textarea");
|
|
981
|
+
for (var j = 0; j < allTextareas.length; j++) {
|
|
982
|
+
allTextareas[j].addEventListener("input", function() {
|
|
983
|
+
var clIndex = this.closest(".multievent");
|
|
984
|
+
if (clIndex) {
|
|
985
|
+
var index = Array.from(document.getElementsByClassName("multievent")).indexOf(clIndex);
|
|
986
|
+
multievent.saveState(index);
|
|
987
|
+
}
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
var allSelects = SK[clNr].getElementsByTagName("select");
|
|
992
|
+
for (var j = 0; j < allSelects.length; j++) {
|
|
993
|
+
allSelects[j].addEventListener("change", function() {
|
|
994
|
+
var clIndex = this.closest(".multievent");
|
|
995
|
+
if (clIndex) {
|
|
996
|
+
var index = Array.from(document.getElementsByClassName("multievent")).indexOf(clIndex);
|
|
997
|
+
multievent.saveState(index);
|
|
998
|
+
}
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
572
1001
|
},
|
|
573
1002
|
inpGemEing: function (WertIst, GemID) {
|
|
574
1003
|
var vIst = WertIst.replace(/\s/g, "");
|
|
@@ -1046,6 +1475,9 @@ var multievent = {
|
|
|
1046
1475
|
"<div style='font-size:large;'>" + GesWert + "</div>";
|
|
1047
1476
|
multievent.ErgAn();
|
|
1048
1477
|
}
|
|
1478
|
+
|
|
1479
|
+
// Save state after evaluation
|
|
1480
|
+
multievent.saveState(classNr);
|
|
1049
1481
|
},
|
|
1050
1482
|
ErgAus: function () {
|
|
1051
1483
|
document.getElementById("MultieventErgebnisse").style.display = "none";
|
|
@@ -1100,6 +1532,13 @@ var multievent = {
|
|
|
1100
1532
|
}
|
|
1101
1533
|
}
|
|
1102
1534
|
document.getElementById(SuID).setAttribute("data-move", "0");
|
|
1535
|
+
|
|
1536
|
+
// Save state after marking word search letters
|
|
1537
|
+
var clIndex = document.getElementById(SuID).closest(".multievent");
|
|
1538
|
+
if (clIndex) {
|
|
1539
|
+
var index = Array.from(document.getElementsByClassName("multievent")).indexOf(clIndex);
|
|
1540
|
+
multievent.saveState(index);
|
|
1541
|
+
}
|
|
1103
1542
|
}
|
|
1104
1543
|
},
|
|
1105
1544
|
tastensprung: function (Kennung, Wert) {
|
package/dist/assets/store.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -175629,15 +175629,19 @@ var readFile = (src, ctx) => {
|
|
|
175629
175629
|
try {
|
|
175630
175630
|
srcFile = external_fs_.readFileSync(external_path_.join(ctx.root, "book", src), "utf-8");
|
|
175631
175631
|
} catch (e2) {
|
|
175632
|
-
|
|
175633
|
-
|
|
175634
|
-
|
|
175635
|
-
|
|
175636
|
-
|
|
175637
|
-
|
|
175638
|
-
|
|
175639
|
-
|
|
175640
|
-
|
|
175632
|
+
try {
|
|
175633
|
+
srcFile = external_fs_.readFileSync(
|
|
175634
|
+
external_path_.join(
|
|
175635
|
+
ctx.root,
|
|
175636
|
+
"book",
|
|
175637
|
+
ctx.navigation.current?.path?.directory || "",
|
|
175638
|
+
src
|
|
175639
|
+
),
|
|
175640
|
+
"utf-8"
|
|
175641
|
+
);
|
|
175642
|
+
} catch (e3) {
|
|
175643
|
+
return null;
|
|
175644
|
+
}
|
|
175641
175645
|
}
|
|
175642
175646
|
}
|
|
175643
175647
|
return srcFile;
|
|
@@ -175702,7 +175706,7 @@ ${(code4.scripts ? [cdnLibraryUrl, ...code4.scripts] : []).map((src) => `<script
|
|
|
175702
175706
|
requestJS(file, ["code-input", "indent.min.js"]);
|
|
175703
175707
|
let srcFile = "";
|
|
175704
175708
|
if (src) {
|
|
175705
|
-
srcFile = readFile(src, ctx);
|
|
175709
|
+
srcFile = readFile(src, ctx) || "";
|
|
175706
175710
|
} else if (node3.children?.length > 0) {
|
|
175707
175711
|
srcFile = toText2(node3.children);
|
|
175708
175712
|
}
|
|
@@ -176102,7 +176106,7 @@ var remarkDirectivePyide_default = (ctx) => () => {
|
|
|
176102
176106
|
let tests = [];
|
|
176103
176107
|
let input = "";
|
|
176104
176108
|
if (src) {
|
|
176105
|
-
srcFile = readFile(src, ctx);
|
|
176109
|
+
srcFile = readFile(src, ctx) || "";
|
|
176106
176110
|
} else if (node3.children?.length > 0) {
|
|
176107
176111
|
tests = node3.children.filter((c) => c.type === "code").filter((c) => c.meta?.includes("test")).map((c, i) => ({
|
|
176108
176112
|
code: c.value,
|
|
@@ -183490,7 +183494,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"application/1d-interleaved-parityfec
|
|
|
183490
183494
|
/***/ ((module) => {
|
|
183491
183495
|
|
|
183492
183496
|
"use strict";
|
|
183493
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"hyperbook","version":"0.
|
|
183497
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"hyperbook","version":"0.68.1","author":"Mike Barkmin","homepage":"https://github.com/openpatch/hyperbook#readme","license":"MIT","bin":{"hyperbook":"./dist/index.js"},"files":["dist"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/openpatch/hyperbook.git","directory":"packages/hyperbook"},"bugs":{"url":"https://github.com/openpatch/hyperbook/issues"},"engines":{"node":">=12.22.0"},"scripts":{"version":"pnpm build","lint":"tsc --noEmit","dev":"ncc build ./index.ts -w -o dist/","build":"rimraf dist && ncc build ./index.ts -o ./dist/ --no-cache --no-source-map-register --external favicons --external sharp && node postbuild.mjs"},"dependencies":{"favicons":"^7.2.0"},"devDependencies":{"@hyperbook/fs":"workspace:*","@hyperbook/markdown":"workspace:*","@hyperbook/types":"workspace:*","@pnpm/exportable-manifest":"1000.0.6","@types/archiver":"6.0.3","@types/async-retry":"1.4.9","@types/cross-spawn":"6.0.6","@types/lunr":"^2.3.7","@types/prompts":"2.4.9","@types/tar":"6.1.13","@types/ws":"^8.5.14","@vercel/ncc":"0.38.3","archiver":"7.0.1","async-retry":"1.3.3","chalk":"5.4.1","chokidar":"4.0.3","commander":"12.1.0","cpy":"11.1.0","cross-spawn":"7.0.6","domutils":"^3.2.2","extract-zip":"^2.0.1","got":"12.6.0","htmlparser2":"^10.0.0","lunr":"^2.3.9","lunr-languages":"^1.14.0","mime":"^4.0.6","prompts":"2.4.2","rimraf":"6.0.1","tar":"7.4.3","update-check":"1.5.4","ws":"^8.18.0"}}');
|
|
183494
183498
|
|
|
183495
183499
|
/***/ })
|
|
183496
183500
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hyperbook",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.68.1",
|
|
4
4
|
"author": "Mike Barkmin",
|
|
5
5
|
"homepage": "https://github.com/openpatch/hyperbook#readme",
|
|
6
6
|
"license": "MIT",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"update-check": "1.5.4",
|
|
58
58
|
"ws": "^8.18.0",
|
|
59
59
|
"@hyperbook/fs": "0.20.0",
|
|
60
|
-
"@hyperbook/markdown": "0.
|
|
60
|
+
"@hyperbook/markdown": "0.42.1",
|
|
61
61
|
"@hyperbook/types": "0.18.0"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|