fix(web): complete the CSP-build migration across remaining surfaces
- audio reader: scrub/volume/speed/genre-tick bindings converted to component methods (onScrubInput, setVolumeFromEvent, applyDefaultSpeedFromSelect, volumeLabel, railTickStyle, isSkipActive/isSpeedActive) — these used Number/Math/String globals that the CSP evaluator cannot resolve - fmtTime restored to the audioReader component: the unexport pass had ripped it from the Alpine.data object (time displays were dead) - book detail: cover-upload click and banner edit validation moved to component methods (triggerCoverUpload, bannerEditHasText) - admin/docs/index components: init() hooks for their x-init chains - CSP header: 'unsafe-eval' dropped — the CSP build needs no eval - e2e spec: replace test.info().annotate (unavailable in this Playwright version) with console logging
This commit is contained in:
1 parent
eb57b7208b
commit
09545ca5e1
16 files changed
+249
-234
No files matched your search
+30
-4
@@ -699,15 +699,40 @@ Alpine.data("audioReader", () => ({
|
||||
this.chooseSleep(choice);
|
||||
this.sleepOpen = false;
|
||||
},
|
||||
applyDefaultSpeedFromSelect(e: Event) {
|
||||
this.setDefaultSpeed(Number((e.target as HTMLSelectElement).value));
|
||||
},
|
||||
isDefaultSpeed(rate: number): boolean {
|
||||
return this.defaultSpeed === rate;
|
||||
},
|
||||
onScrubInput(e: Event) {
|
||||
this.scrubbing = true;
|
||||
this.scrubValue = Number((e.target as HTMLInputElement).value);
|
||||
},
|
||||
setVolumeFromEvent(e: Event) {
|
||||
this.setVolume(Number((e.target as HTMLInputElement).value));
|
||||
},
|
||||
volumeLabel(): string {
|
||||
return `Volume ${Math.round(Number(this.volume) * 100)}%`;
|
||||
},
|
||||
railTickStyle(tick: { start: number }): string {
|
||||
const span = Math.max(1, this.railTo - this.railFrom);
|
||||
return `left:${((tick.start - this.railFrom) / span) * 100}%;background-color:var(--text-secondary);opacity:0.5;`;
|
||||
},
|
||||
isSkipActive(secs: number): boolean {
|
||||
return Number(this.skipSeconds) === secs;
|
||||
},
|
||||
isSpeedActive(rate: number): boolean {
|
||||
return Number(this.speed) === rate;
|
||||
},
|
||||
isBookmarkEditing(b: { id: unknown }): boolean {
|
||||
return this.editingBookmarkId === String(b.id);
|
||||
},
|
||||
chooseSleepClockMode() {
|
||||
this.chooseSleepClock();
|
||||
this.sleepOpen = false;
|
||||
},
|
||||
|
||||
isDefaultSpeed(rate: number): boolean {
|
||||
return Number(this.defaultSpeed) === rate;
|
||||
},
|
||||
|
||||
setSkip(seconds: number) {
|
||||
this.skipSeconds = seconds;
|
||||
localStorage.setItem("audio_skip", String(seconds));
|
||||
@@ -1455,4 +1480,5 @@ Alpine.data("audioReader", () => ({
|
||||
this.pushProgress();
|
||||
}, PROGRESS_INTERVAL_MS);
|
||||
},
|
||||
fmtTime,
|
||||
}));
|
||||
Reference in new issue
Block a user