New content element option "Vollbild-Schaltfläche anzeigen" (on by default). The button only appears once the browser confirms it exposes the Fullscreen API for ordinary elements -- iOS Safari offers it for video only, so there it stays hidden rather than presenting a control that cannot work. Fitting the book to the screen needed the layout to become height-aware. Page size was derived from width alone, which at screen width puts an A4-proportioned page well below the bottom of the viewport. In fullscreen the page now fits to the available height and the narrower book is centred; pages re-render at the new size through the existing generation-stamped path. The height fit writes a max-width onto the stage, so in fullscreen the available width is measured on the parent instead -- measuring the element we just constrained would oscillate. Verified stable across repeated samples. The resize handler body moved into relayout(), shared with the fullscreen toggle. destroy() leaves fullscreen first so the browser is not left holding a node that is about to go away. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
66 lines
3.0 KiB
PHP
66 lines
3.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
$GLOBALS['TL_DCA']['tl_content']['palettes']['blatterbares_pdf'] = '{type_legend},type,headline;{flipbook_legend},flipbookPdfSrc,flipbookInitialPages,flipbookStartMode,flipbookSplitSpreads,flipbookShowNavigation,flipbookShowFullscreen,flipbookPlaySound;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},cssID;{invisible_legend:hide},invisible,start,stop';
|
|
|
|
$GLOBALS['TL_DCA']['tl_content']['fields']['flipbookPdfSrc'] = [
|
|
'label' => &$GLOBALS['TL_LANG']['tl_content']['flipbookPdfSrc'],
|
|
'exclude' => true,
|
|
'inputType' => 'fileTree',
|
|
'eval' => ['fieldType' => 'radio', 'files' => true, 'filesOnly' => true, 'extensions' => 'pdf', 'mandatory' => true, 'tl_class' => 'w50'],
|
|
'sql' => ['type' => 'binary', 'length' => 16, 'notnull' => false],
|
|
];
|
|
|
|
$GLOBALS['TL_DCA']['tl_content']['fields']['flipbookInitialPages'] = [
|
|
'label' => &$GLOBALS['TL_LANG']['tl_content']['flipbookInitialPages'],
|
|
'exclude' => true,
|
|
'inputType' => 'select',
|
|
'options' => ['2', '3', '4'],
|
|
'reference' => &$GLOBALS['TL_LANG']['tl_content']['flipbookInitialPagesOptions'],
|
|
'eval' => ['mandatory' => true, 'includeBlankOption' => false, 'tl_class' => 'w50'],
|
|
'sql' => ['type' => 'string', 'length' => 1, 'default' => '4'],
|
|
];
|
|
|
|
$GLOBALS['TL_DCA']['tl_content']['fields']['flipbookStartMode'] = [
|
|
'label' => &$GLOBALS['TL_LANG']['tl_content']['flipbookStartMode'],
|
|
'exclude' => true,
|
|
'inputType' => 'select',
|
|
'options' => ['center', 'spread'],
|
|
'reference' => &$GLOBALS['TL_LANG']['tl_content']['flipbookStartModeOptions'],
|
|
'eval' => ['mandatory' => true, 'includeBlankOption' => false, 'tl_class' => 'w50'],
|
|
'sql' => ['type' => 'string', 'length' => 16, 'default' => 'center'],
|
|
];
|
|
|
|
$GLOBALS['TL_DCA']['tl_content']['fields']['flipbookSplitSpreads'] = [
|
|
'label' => &$GLOBALS['TL_LANG']['tl_content']['flipbookSplitSpreads'],
|
|
'exclude' => true,
|
|
'inputType' => 'checkbox',
|
|
'eval' => ['tl_class' => 'w50 m12'],
|
|
'sql' => ['type' => 'string', 'length' => 1, 'fixed' => true, 'default' => '0'],
|
|
];
|
|
|
|
$GLOBALS['TL_DCA']['tl_content']['fields']['flipbookShowNavigation'] = [
|
|
'label' => &$GLOBALS['TL_LANG']['tl_content']['flipbookShowNavigation'],
|
|
'exclude' => true,
|
|
'inputType' => 'checkbox',
|
|
'eval' => ['tl_class' => 'w50 m12'],
|
|
'sql' => ['type' => 'string', 'length' => 1, 'fixed' => true, 'default' => '1'],
|
|
];
|
|
|
|
$GLOBALS['TL_DCA']['tl_content']['fields']['flipbookShowFullscreen'] = [
|
|
'label' => &$GLOBALS['TL_LANG']['tl_content']['flipbookShowFullscreen'],
|
|
'exclude' => true,
|
|
'inputType' => 'checkbox',
|
|
'eval' => ['tl_class' => 'w50 m12'],
|
|
'sql' => ['type' => 'string', 'length' => 1, 'fixed' => true, 'default' => '1'],
|
|
];
|
|
|
|
$GLOBALS['TL_DCA']['tl_content']['fields']['flipbookPlaySound'] = [
|
|
'label' => &$GLOBALS['TL_LANG']['tl_content']['flipbookPlaySound'],
|
|
'exclude' => true,
|
|
'inputType' => 'checkbox',
|
|
'eval' => ['tl_class' => 'w50 m12'],
|
|
'sql' => ['type' => 'string', 'length' => 1, 'fixed' => true, 'default' => '1'],
|
|
];
|