Let each poll speed up or slow down the scale comments
A new poll setting (polls.comment_speed, 50-200 %) scales the display time of the rotating scale comments in the presentation and embed; the duration still follows the text length. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c1f9be2eef
commit
166cb475c6
10 files changed
+100
-6
No files matched your search
@@ -18,6 +18,7 @@ use Cake\ORM\Entity;
|
||||
* @property \Cake\I18n\DateTime|null $embed_seen_at
|
||||
* @property int|null $paused_slide_id
|
||||
* @property bool $is_active
|
||||
* @property int $comment_speed Speed of rotating scale comments in percent, see COMMENT_SPEEDS
|
||||
* @property \Cake\I18n\DateTime|null $last_admin_access
|
||||
* @property \Cake\I18n\DateTime $created
|
||||
* @property \Cake\I18n\DateTime $modified
|
||||
@@ -25,6 +26,14 @@ use Cake\ORM\Entity;
|
||||
*/
|
||||
class Poll extends Entity
|
||||
{
|
||||
/**
|
||||
* Selectable speeds of the rotating scale comments in percent: 100 = normal,
|
||||
* below = each comment stays longer, above = shorter (see Comments.delay() in plenario.js).
|
||||
*
|
||||
* @var list<int>
|
||||
*/
|
||||
public const COMMENT_SPEEDS = [50, 75, 100, 125, 150, 200];
|
||||
|
||||
/**
|
||||
* Only harmless fields are mass assignable. Tokens, join code and the
|
||||
* current slide are always set explicitly in code.
|
||||
@@ -35,6 +44,7 @@ class Poll extends Entity
|
||||
'title' => true,
|
||||
'email' => true,
|
||||
'is_active' => true,
|
||||
'comment_speed' => true,
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -74,6 +74,10 @@ class PollsTable extends Table
|
||||
|
||||
$validator->boolean('is_active');
|
||||
|
||||
$validator
|
||||
->integer('comment_speed')
|
||||
->inList('comment_speed', Poll::COMMENT_SPEEDS, __('Bitte wähle eine der angebotenen Geschwindigkeiten.'));
|
||||
|
||||
return $validator;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user