From: Vincent Vanwaelscappel Date: Tue, 11 Jun 2024 12:51:28 +0000 (+0200) Subject: wait #6954 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=e108aba9c9dc0377279adc006f5b3e78b8edafe2;p=fluidbook-toolbox.git wait #6954 @2 --- diff --git a/app/Fluidbook/Compiler/Compiler.php b/app/Fluidbook/Compiler/Compiler.php index f5671841b..777d231c4 100644 --- a/app/Fluidbook/Compiler/Compiler.php +++ b/app/Fluidbook/Compiler/Compiler.php @@ -52,6 +52,7 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError use Accessibility; use Tabs; use PDF; + use Screensaver; /** @var Lock */ protected $lock; @@ -730,6 +731,8 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError $this->log('XML Articles written'); $this->writeSlider(); $this->log('Slider written'); + $this->writeScreensaver(); + $this->log('Screensaver written'); $linksCSS = $this->writeLinks(); $this->log('Links written'); $this->writeArticles(); diff --git a/app/Fluidbook/Compiler/Screensaver.php b/app/Fluidbook/Compiler/Screensaver.php new file mode 100644 index 000000000..262ea1d77 --- /dev/null +++ b/app/Fluidbook/Compiler/Screensaver.php @@ -0,0 +1,17 @@ +config->screensaver) { + return false; + } + $this->addJsLib('screensaver', ['js/libs/fluidbook/fluidbook.screensaver.js']); + $this->vdir->copy($this->wdir . '/' . $this->config->screensaver, 'data/screensaver/' . $this->config->screensaver); + } +} diff --git a/app/Fluidbook/Farm.php b/app/Fluidbook/Farm.php index cf753ab67..3e4eea05d 100644 --- a/app/Fluidbook/Farm.php +++ b/app/Fluidbook/Farm.php @@ -22,7 +22,7 @@ class Farm protected static $_farmServers = [ ['name' => 'alphaville', 'host' => 'fluidbook-processfarm', 'port' => 9000, 'weight' => 12, 'region' => Region::EUROPE, 'local' => false], ['name' => 'brazil', 'host' => 'brazil.cubedesigners.com', 'weight' => 6, 'region' => Region::USA, 'local' => false], - ['name' => 'cloudatlats', 'host' => 'cloudatlas.cubedesigners.com', 'weight' => 4, 'region' => Region::EUROPE, 'local' => false], + ['name' => 'cloudatlas', 'host' => 'cloudatlas.cubedesigners.com', 'weight' => 4, 'region' => Region::EUROPE, 'local' => false], ['name' => 'dracula', 'host' => 'dracula.cubedesigners.com', 'weight' => 1, 'region' => Region::EUROPE, 'local' => true], ['name' => 'dobermann', 'host' => 'dobermann.cubedesigners.com', 'weight' => 6, 'region' => Region::EUROPE, 'local' => false], ['name' => 'elephantman', 'host' => 'paris.cubedesigners.com', 'weight' => 2, 'region' => Region::EUROPE, 'local' => false], diff --git a/app/Models/Traits/PublicationSettings.php b/app/Models/Traits/PublicationSettings.php index c9e82c7b9..a03f402d6 100644 --- a/app/Models/Traits/PublicationSettings.php +++ b/app/Models/Traits/PublicationSettings.php @@ -51,6 +51,8 @@ trait PublicationSettings protected static $acceptPDF = ['.pdf']; protected static $acceptZip = ['.zip']; protected static $acceptFont = ['.ttf', '.otf', '.woff', '.woff2']; + protected static $acceptLottie = ['.zip', '.html', '.json', '.lottie']; + protected static $acceptVideo = ['.mp4']; public function setSettingsFields() @@ -152,6 +154,7 @@ trait PublicationSettings $this->_archives(); $this->_form(); $this->_plv(); + $this->_screensaver(); $this->_performances(); } @@ -1916,6 +1919,15 @@ trait PublicationSettings } + protected function _screensaver() + { + $this->addSettingField('section_screensaver', FormSection::class, $this->__('Économiseur d\'écran')); + $this->addSettingField('screensaver', FilesOrURL::class, __('Animation'), ['accept' => static::$acceptVideo]); + $this->addSettingField('screensaver_sleep_time', Integer::class, __('Activer après un temps d\'inactivité'), ['when' => ['screensaver' => '_not_empty_'], 'suffix' => __('secondes'), 'default' => 60, 'min' => 1]); + $this->addSettingField('screensaver_wake_action', SelectFromArray::class, __('Action à effectuer au réveil'), ['when' => ['screensaver' => '_not_empty_'], 'default' => 'none', 'options' => ['none' => __('Aucune action'), 'page' => __('Aller à une page')]]); + $this->addSettingField('screensaver_wake_page', Text::class, __('Au réveil, aller à la page'), ['when' => ['screensaver' => '_not_empty_', 'screensaver_wake_action' => 'page'], 'default' => 1]); + } + protected function _theme() { $this->addSettingField('section_theme', FormSection::class, $this->__('Options du thème'));