]> _ Git - fluidbook-toolbox.git/commitdiff
wait #7034 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 2 Aug 2024 07:39:54 +0000 (09:39 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 2 Aug 2024 07:39:54 +0000 (09:39 +0200)
app/Fluidbook/Compiler/PWA.php
app/Models/FluidbookTheme.php
app/Models/Traits/PublicationSettings.php

index 946a93531268560347c90bea075c8aec047aac87..e0ce37c51d1fce4879e22857065c54ec8c3a23d7 100644 (file)
@@ -2,6 +2,8 @@
 
 namespace App\Fluidbook\Compiler;
 
+use Fluidbook\Tools\SVG\SVGTools;
+
 trait PWA
 {
     protected function writePWA()
@@ -17,6 +19,11 @@ trait PWA
     <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;
     }
 }
index 96ca7e21c387373d7e58164ae76856b7526c4266..30ade502f36fe9c9da3502ad314454019c5b39b3 100644 (file)
@@ -549,7 +549,7 @@ class FluidbookTheme extends ToolboxModel
             '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([
index 436cbe88b9d2b9a86716027be6473f9f72eaeb0d..6b7bd076026f59abb1199c53f6206cb8f9dbc825 100644 (file)
@@ -167,8 +167,10 @@ trait PublicationSettings
         $this->_offline();
         $this->_export();
         $this->_demoLink();
+        $this->_pwa();
     }
 
+
     protected function _stats()
     {
         $this->addSettingField('bigsection_stats', FormSuperSection::class, $this->__('Statistiques et vie privée'));
@@ -1981,6 +1983,13 @@ trait PublicationSettings
 
     }
 
+    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'));