Feature/edit scale comment #42

Merged
gnilebein merged 6 commits from feature/edit-scale-comment into main 2026-11-11 12:21:05 +01:00
2 changed files with 44 additions and 6 deletions
Showing only changes of commit e6f52a0449 - Show all commits

No files matched your search

+6 -2
View File
@@ -60,7 +60,7 @@ src/
AdminController Dashboard, Settings, Present, State-JSON, Control, QR, PDF-Export, Token rotieren, Zurücksetzen, Löschen AdminController Dashboard, Settings, Present, State-JSON, Control, QR, PDF-Export, Token rotieren, Zurücksetzen, Löschen
SlidesController Folien-CRUD, Antworten offener Fragen bzw. Skala-Auswertung (`answers`), Sortieren (Drag & Drop/Pfeiltasten via `reorder`, JSON; erfordert JS), Antworten zurücksetzen, SlidesController Folien-CRUD, Antworten offener Fragen bzw. Skala-Auswertung (`answers`), Sortieren (Drag & Drop/Pfeiltasten via `reorder`, JSON; erfordert JS), Antworten zurücksetzen,
YouTube-Link prüfen (`youtubeCheck`, JSON) YouTube-Link prüfen (`youtubeCheck`, JSON)
ParticipateController /p/{code}: Ansicht, State-JSON, Abstimmen; anonymes Cookie plenario_pid ParticipateController /p/{code}: Ansicht, State-JSON, Abstimmen, eigenen Skala-Kommentar bearbeiten; anonymes Cookie plenario_pid
EmbedController /e/{key}/{id}: eine Folie zum Einbetten (z. B. Canva), activate/heartbeat/pause/control EmbedController /e/{key}/{id}: eine Folie zum Einbetten (z. B. Canva), activate/heartbeat/pause/control
ErrorController Fehlerseiten (Templates unter templates/Error, Layout `error`) ErrorController Fehlerseiten (Templates unter templates/Error, Layout `error`)
Mailer/ PollMailer (adminLink, recovery; `sendSafely()` loggt Transportfehler statt zu werfen), Transport/FileTransport (lokal) Mailer/ PollMailer (adminLink, recovery; `sendSafely()` loggt Transportfehler statt zu werfen), Transport/FileTransport (lokal)
@@ -216,8 +216,12 @@ tests/ PHPUnit; PlenarioTestTrait erzeugt Testdaten, Fixtures
`results.comments` (Teilnehmende bekommen sie nie: Skalen liefern ihnen grundsätzlich keine `results`, siehe `PollStateService::forParticipant()`) `results.comments` (Teilnehmende bekommen sie nie: Skalen liefern ihnen grundsätzlich keine `results`, siehe `PollStateService::forParticipant()`)
(älteste zuerst, je `id`, `text`, `value` – `value` nur mit Setting `comment_ratings`, sonst `null`); `Comments` in `plenario.js` blättert sie automatisch durch (Anzeigedauer nur nach Textlänge, bewusst ohne Setting: (älteste zuerst, je `id`, `text`, `value` – `value` nur mit Setting `comment_ratings`, sonst `null`); `Comments` in `plenario.js` blättert sie automatisch durch (Anzeigedauer nur nach Textlänge, bewusst ohne Setting:
`Comments.delay()` = 2,5 s + 15 Zeichen/s, 5–30 s; Vor/Zurück/Fortsetzen geben dem Kommentar wieder die volle Zeit; „Kommentar X von N“, `Comments.delay()` = 2,5 s + 15 Zeichen/s, 5–30 s; Vor/Zurück/Fortsetzen geben dem Kommentar wieder die volle Zeit; „Kommentar X von N“,
vor/zurück/Pause, Zustand übersteht das Neu-Rendern beim Polling). Bei internem Feedback erscheinen sie erst, vor/zurück/Pause, Laufbalken bis zum Wechsel (`Comments.progress()`, setzt nach dem Neu-Rendern per negativem
`animation-delay` fort, bei Pause unsichtbar), Zustand übersteht das Neu-Rendern beim Polling). Bei internem Feedback erscheinen sie erst,
wenn der Presenter die Ergebnisse einblendet. wenn der Presenter die Ergebnisse einblendet.
Teilnehmende können ihren eigenen Kommentar ändern, ergänzen oder leeren, solange die Abstimmung offen ist
(`participate:comment` → `VoteService::editComment()`, gleiche Vorbedingungen wie `submit()`, in der Folien-Sperre);
die Bewertung selbst bleibt unveränderlich.
- **PDF-Export** (`/admin/{token}/export.pdf`, `admin:export`, `ReportService` + `PdfView`, Dompdf): Ergebnisse aller - **PDF-Export** (`/admin/{token}/export.pdf`, `admin:export`, `ReportService` + `PdfView`, Dompdf): Ergebnisse aller
interaktiven Folien (Inhaltsfolien/YouTube fehlen). Standard ist die Fassung **ohne interne Inhalte**: private Folien interaktiven Folien (Inhaltsfolien/YouTube fehlen). Standard ist die Fassung **ohne interne Inhalte**: private Folien
+38 -4
View File
@@ -303,6 +303,9 @@
timer: null, timer: null,
items: [], items: [],
node: null, node: null,
// Countdown of the comment shown (drives the progress bar across re-renders).
startedAt: 0,
duration: 0,
// Time per comment: enough to read it on the stage, within sensible bounds. // Time per comment: enough to read it on the stage, within sensible bounds.
BASE_MS: 2500, BASE_MS: 2500,
@@ -338,6 +341,10 @@
el('p', { class: 'comments__counter', 'data-comment-counter': '' }), el('p', { class: 'comments__counter', 'data-comment-counter': '' }),
el('blockquote', { class: 'comments__text', 'data-comment-text': '' }), el('blockquote', { class: 'comments__text', 'data-comment-text': '' }),
el('p', { class: 'comments__value', 'data-comment-value': '' }), el('p', { class: 'comments__value', 'data-comment-value': '' }),
// Time left until the next comment; decorative, the counter carries the information.
items.length < 2 ? null : el('div', { class: 'comments__progress', 'data-comment-progress': '', 'aria-hidden': 'true' }, [
el('div', { class: 'comments__progress-fill' })
]),
items.length < 2 ? null : el('div', { class: 'comments__nav' }, [ items.length < 2 ? null : el('div', { class: 'comments__nav' }, [
button('prev', 'Vorheriger Kommentar', '‹'), button('prev', 'Vorheriger Kommentar', '‹'),
button('toggle', '', ''), button('toggle', '', ''),
@@ -360,10 +367,10 @@
Comments.update(false); Comments.update(false);
}); });
Comments.node = node; Comments.node = node;
Comments.update(false);
if (!Comments.timer) { if (!Comments.timer) {
Comments.restart(); Comments.restart();
} }
Comments.update(false);
return node; return node;
}, },
@@ -388,18 +395,44 @@
/** (Re)start the countdown for the comment currently shown. */ /** (Re)start the countdown for the comment currently shown. */
restart: function () { restart: function () {
clearTimeout(Comments.timer); clearTimeout(Comments.timer);
Comments.startedAt = Date.now();
Comments.duration = Comments.delay(Comments.items[Comments.index]);
Comments.timer = setTimeout(function () { Comments.timer = setTimeout(function () {
if (!Comments.node || !document.body.contains(Comments.node)) { if (!Comments.node || !document.body.contains(Comments.node)) {
// Slide changed: stop until the next comment list is rendered. // Slide changed: stop until the next comment list is rendered.
Comments.timer = null; Comments.timer = null;
return; return;
} }
if (!Comments.paused && Comments.items.length > 1 && !document.hidden) { var advance = !Comments.paused && Comments.items.length > 1 && !document.hidden;
if (advance) {
Comments.step(1); Comments.step(1);
Comments.update(true);
} }
Comments.restart(); Comments.restart();
}, Comments.delay(Comments.items[Comments.index])); if (advance) {
Comments.update(true);
} else {
Comments.progress();
}
}, Comments.duration);
},
/**
* Fills the progress bar over the remaining time of the current comment.
* Picks up where it was after a re-render (negative animation delay); hidden while paused.
*/
progress: function () {
var bar = Comments.node && Comments.node.querySelector('[data-comment-progress]');
if (!bar) {
return;
}
var fill = bar.firstChild;
bar.hidden = Comments.paused;
fill.style.animation = 'none';
void fill.offsetWidth; // restart the CSS animation
if (!Comments.paused) {
var elapsed = Math.min(Date.now() - Comments.startedAt, Comments.duration);
fill.style.animation = 'comment-progress ' + Comments.duration + 'ms linear -' + elapsed + 'ms forwards';
}
}, },
update: function (animate) { update: function (animate) {
@@ -427,6 +460,7 @@
toggle.setAttribute('title', label); toggle.setAttribute('title', label);
toggle.setAttribute('aria-pressed', Comments.paused ? 'true' : 'false'); toggle.setAttribute('aria-pressed', Comments.paused ? 'true' : 'false');
} }
Comments.progress();
} }
}; };