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
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Migrations\BaseMigration;
|
||||
|
||||
/**
|
||||
* Speed of the rotating scale comments in the presentation, per poll in percent
|
||||
* (100 = normal, below = slower, above = faster), see Poll::COMMENT_SPEEDS.
|
||||
*/
|
||||
class AddCommentSpeedToPolls extends BaseMigration
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$table = $this->table('polls');
|
||||
if (!$table->hasColumn('comment_speed')) {
|
||||
$table->addColumn('comment_speed', 'integer', [
|
||||
'null' => false,
|
||||
'default' => 100,
|
||||
'after' => 'is_active',
|
||||
])->update();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
$table = $this->table('polls');
|
||||
if ($table->hasColumn('comment_speed')) {
|
||||
$table->removeColumn('comment_speed')->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user