namespace App\Fluidbook\Compiler;
+use Fluidbook\Tools\SVG\SVGTools;
+
trait PWA
{
protected function writePWA()
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">';
}
+ if ($icon = $this->themeAsset('favicon')) {
+ $path = 'data/images/' . $icon->getFilename();
+ $res .= "\n" . ' <link rel="apple-touch-icon" href="' . $path . '">';
+ $this->vdir->copy($icon->getPathname(), $path);
+ }
return $res;
}
}
'type' => FluidbookThemeImage::class,
'label' => __('Icone (pour favicon, apps et exe)'),
'mime_types' => ['image/png'],
- 'hint' => __('Image PNG de 256x256'),
+ 'hint' => __('Image PNG de 256x256').', '.__('pas de transparence'),
'translatable' => false,
]);
$this->addField([
$this->_offline();
$this->_export();
$this->_demoLink();
+ $this->_pwa();
}
+
protected function _stats()
{
$this->addSettingField('bigsection_stats', FormSuperSection::class, $this->__('Statistiques et vie privée'));
}
+ protected function _pwa()
+ {
+ $this->addSettingField('section_pwa', FormSection::class, $this->__('Progressive Web App'));
+ $this->addSettingField('pwa_ios', Checkbox::class, $this->__('Activer sur iOS'), ['default' => false]);
+ $this->addSettingField('pwa_ios_title', Text::class, $this->__('Titre sur l\'écran d\'accueil'), ['hint' => $this->__('Il est recommandé de ne pas dépasser 10 caractères.') . ' ' . $this->__('Laisser vide pour utiliser le titre de la publication'), 'when' => ['pwa_ios' => '1']]);
+ }
+
protected function _package()
{
$this->addSettingField('section_downloads', FormSection::class, $this->__('Versions disponibles au téléchargement'));