Skip to content

Commit 8f36b42

Browse files
committed
Expose bug fix
1 parent fb6cb1f commit 8f36b42

11 files changed

Lines changed: 28 additions & 24 deletions

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ Unwitnessed arrest: {{c5::
4545
1. Bla
4646
2. Bla
4747

48-
}}```
48+
}}
49+
```
4950

5051
You can of course also use FC2 if you just want some more configurability/functionality for "regular clozes".
5152

@@ -255,4 +256,5 @@ There is effectively no add-on, it's all JavaScript (and HTML/CSS) and runs 100%
255256
- 2023-03-26: Restructure code, add `context-top` and `context-bottom`, add note specific config through tags, add log option/info, add search function, add `Flexible Cloze 2 (min)` template which only has `Text` and `Back Extra` fields. Improve styling, esp. for night mode.
256257
- 2023-05-03: Fix update bug thanks to [comienzo2093](https://github.com/comienzo2093).
257258
- 2023-05-29: Fix hint bug.
258-
- 2023-05-30: Fix search bug, add `show.inactive: 'preceding'` option.
259+
- 2023-05-30: Fix search bug, add `show.inactive: 'preceding'` option.
260+
- 2023-06-05: Fix expose bug.

bin/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,4 +255,5 @@ There is effectively no add-on, it's all JavaScript (and HTML/CSS) and runs 100%
255255
- 2023-03-26: Restructure code, add `context-top` and `context-bottom`, add note specific config through tags, add log option/info, add search function, add `Flexible Cloze 2 (min)` template which only has `Text` and `Back Extra` fields. Improve styling, esp. for night mode.
256256
- 2023-05-03: Fix update bug thanks to [comienzo2093](https://github.com/comienzo2093).
257257
- 2023-05-29: Fix hint bug.
258-
- 2023-05-30: Fix search bug, add `show.inactive: 'preceding'` option.
258+
- 2023-05-30: Fix search bug, add `show.inactive: 'preceding'` option.
259+
- 2023-06-05: Fix expose bug.

bin/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
TAG_CSS_FUNC = "/*-- FC2 FUNCTIONALITY END --*/"
2222

2323
CVER = get_version()
24-
NVER = "1.2.3"
24+
NVER = "1.2.4"
2525

2626
#######################################################################
2727
# Current code base
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

bin/fc2-back.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@
284284
return;
285285
this.search = new Searcher(this.viewport, 'fc2-', this.log);
286286
this.ordinal || (this.ordinal = parseInt(this.current.dataset.ordinal));
287-
this.expose = this.generate_expose();
288287
this.content.parentElement.classList.remove(this.cfg.front ? 'back' : 'front');
289288
this.content.parentElement.classList.add(this.cfg.front ? 'front' : 'back');
290289
const tags = document.getElementById('fc2-meta-tags').innerText.split(' ');
@@ -316,12 +315,14 @@
316315
this.viewport.insertAdjacentElement('beforebegin', title);
317316
}
318317
}
318+
const expose = this.generate_expose();
319319
let active_seen = false;
320320
this.content.querySelectorAll('.cloze-inactive, .cloze').forEach(((cloze) => {
321321
const active = cloze.classList.contains('cloze');
322322
active_seen || (active_seen = active);
323-
if (this.expose(cloze) || !active && cloze.querySelector('.cloze')) {
324-
cloze.classList.remove('cloze', 'cloze-inactive');
323+
const exposed = expose(cloze);
324+
if (!active && (exposed || cloze.querySelector('.cloze'))) {
325+
cloze.classList.remove('cloze-inactive');
325326
return;
326327
}
327328
cloze.dataset.hint = this.cfg.front && active && cloze.innerHTML !== '[...]'

bin/fc2-front.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@
284284
return;
285285
this.search = new Searcher(this.viewport, 'fc2-', this.log);
286286
this.ordinal || (this.ordinal = parseInt(this.current.dataset.ordinal));
287-
this.expose = this.generate_expose();
288287
this.content.parentElement.classList.remove(this.cfg.front ? 'back' : 'front');
289288
this.content.parentElement.classList.add(this.cfg.front ? 'front' : 'back');
290289
const tags = document.getElementById('fc2-meta-tags').innerText.split(' ');
@@ -316,12 +315,14 @@
316315
this.viewport.insertAdjacentElement('beforebegin', title);
317316
}
318317
}
318+
const expose = this.generate_expose();
319319
let active_seen = false;
320320
this.content.querySelectorAll('.cloze-inactive, .cloze').forEach(((cloze) => {
321321
const active = cloze.classList.contains('cloze');
322322
active_seen || (active_seen = active);
323-
if (this.expose(cloze) || !active && cloze.querySelector('.cloze')) {
324-
cloze.classList.remove('cloze', 'cloze-inactive');
323+
const exposed = expose(cloze);
324+
if (!active && (exposed || cloze.querySelector('.cloze'))) {
325+
cloze.classList.remove('cloze-inactive');
325326
return;
326327
}
327328
cloze.dataset.hint = this.cfg.front && active && cloze.innerHTML !== '[...]'

bin/fc2m-back.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@
269269
return;
270270
this.search = new Searcher(this.viewport, 'fc2-', this.log);
271271
this.ordinal || (this.ordinal = parseInt(this.current.dataset.ordinal));
272-
this.expose = this.generate_expose();
273272
this.content.parentElement.classList.remove(this.cfg.front ? 'back' : 'front');
274273
this.content.parentElement.classList.add(this.cfg.front ? 'front' : 'back');
275274
const tags = document.getElementById('fc2-meta-tags').innerText.split(' ');
@@ -301,12 +300,14 @@
301300
this.viewport.insertAdjacentElement('beforebegin', title);
302301
}
303302
}
303+
const expose = this.generate_expose();
304304
let active_seen = false;
305305
this.content.querySelectorAll('.cloze-inactive, .cloze').forEach(((cloze) => {
306306
const active = cloze.classList.contains('cloze');
307307
active_seen || (active_seen = active);
308-
if (this.expose(cloze) || !active && cloze.querySelector('.cloze')) {
309-
cloze.classList.remove('cloze', 'cloze-inactive');
308+
const exposed = expose(cloze);
309+
if (!active && (exposed || cloze.querySelector('.cloze'))) {
310+
cloze.classList.remove('cloze-inactive');
310311
return;
311312
}
312313
cloze.dataset.hint = this.cfg.front && active && cloze.innerHTML !== '[...]'

bin/fc2m-front.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@
269269
return;
270270
this.search = new Searcher(this.viewport, 'fc2-', this.log);
271271
this.ordinal || (this.ordinal = parseInt(this.current.dataset.ordinal));
272-
this.expose = this.generate_expose();
273272
this.content.parentElement.classList.remove(this.cfg.front ? 'back' : 'front');
274273
this.content.parentElement.classList.add(this.cfg.front ? 'front' : 'back');
275274
const tags = document.getElementById('fc2-meta-tags').innerText.split(' ');
@@ -301,12 +300,14 @@
301300
this.viewport.insertAdjacentElement('beforebegin', title);
302301
}
303302
}
303+
const expose = this.generate_expose();
304304
let active_seen = false;
305305
this.content.querySelectorAll('.cloze-inactive, .cloze').forEach(((cloze) => {
306306
const active = cloze.classList.contains('cloze');
307307
active_seen || (active_seen = active);
308-
if (this.expose(cloze) || !active && cloze.querySelector('.cloze')) {
309-
cloze.classList.remove('cloze', 'cloze-inactive');
308+
const exposed = expose(cloze);
309+
if (!active && (exposed || cloze.querySelector('.cloze'))) {
310+
cloze.classList.remove('cloze-inactive');
310311
return;
311312
}
312313
cloze.dataset.hint = this.cfg.front && active && cloze.innerHTML !== '[...]'

src/py/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
TAG_CSS_FUNC = "/*-- FC2 FUNCTIONALITY END --*/"
2222

2323
CVER = get_version()
24-
NVER = "1.2.3"
24+
NVER = "1.2.4"
2525

2626
#######################################################################
2727
# Current code base

0 commit comments

Comments
 (0)