]> _ Git - fluidbook_tools.git/commitdiff
wip #6533 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 29 Nov 2023 07:49:46 +0000 (08:49 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 29 Nov 2023 07:49:46 +0000 (08:49 +0100)
src/Links/Link.php
src/Links/SlideshowLink.php

index f0d4013f761c20ec46a54d6a8b6bf545e797eb71..36965cb5e4912a6dd83b660b2489fa71d2e515dd 100644 (file)
@@ -70,6 +70,7 @@ class Link
     const TEXT_POPUP = 43;
     const LOTTIE = 44;
     const COPY_TO_CLIPBOARD = 45;
+    const SLIDESHOW_INLINE = 46;
 
 
     protected static string|false|null $_linksKey = null;
@@ -214,6 +215,8 @@ class Link
                     return new InlineSlideshowLink($id, $init, $compiler);
                 }
                 return new ImageLink($id, $init, $compiler);
+            case static::SLIDESHOW_INLINE:
+                return new InlineSlideshowLink($id, $init, $compiler);
             case static::FILE:
                 return new FileLink($id, $init, $compiler);
             case static::AUDIO:
@@ -654,7 +657,7 @@ class Link
     }
 
     /**
-     * @return int
+     * @return float
      */
     public function getDelay(): float
     {
index 737ff3c6f2b2fb3b96c0b9dfdd35e6072d2ccda2..602831ed6ed0d8f939352623d466516fe7cf285b 100644 (file)
@@ -5,9 +5,9 @@ namespace Fluidbook\Tools\Links;
 use Cubist\Util\Files\Files;
 use Cubist\Util\Graphics\Image;
 use Cubist\Util\Xml;
-use Illuminate\Support\Facades\Log;
 
-class SlideshowLink extends NormalLink {
+class SlideshowLink extends NormalLink
+{
 
     protected $path;
     protected $path_absolute;
@@ -16,7 +16,8 @@ class SlideshowLink extends NormalLink {
 
     protected $baseName = '';
 
-    public function getURL() {
+    public function getURL()
+    {
 
         if (empty($this->to)) {
             return '';
@@ -36,18 +37,21 @@ class SlideshowLink extends NormalLink {
         return '#/slideshow/' . $this->uid;
     }
 
-    public function getAdditionnalContent() {
-        return 'data-slideshow="' . rawurlencode($this->generateSlideshow('popup')) . '" ';
+    public function getAdditionnalContent()
+    {
+        return parent::getAdditionnalContent() . ' data-slideshow="' . rawurlencode($this->generateSlideshow('popup')) . '" ';
     }
 
-    public function getDefaultTooltip() {
+    public function getDefaultTooltip()
+    {
         return 'view slideshow';
     }
 
     /**
      * @throws \Exception
      */
-    public function generateSlideshow($context) {
+    public function generateSlideshow($context)
+    {
         $this->compiler->addSlideshowLibrary($context === 'inline');
 
         $this->allowed_extensions = ['jpg', 'png', 'jpeg', 'gif', 'svg'];
@@ -130,7 +134,8 @@ class SlideshowLink extends NormalLink {
         return $res;
     }
 
-    protected function _getSlidesFromDirectory($path) {
+    protected function _getSlidesFromDirectory($path)
+    {
         $files = Files::getRecursiveDirectoryIterator($path);
         $slides = [];
 
@@ -154,7 +159,8 @@ class SlideshowLink extends NormalLink {
     }
 
 
-    protected function _slides($slides, $options = []) {
+    protected function _slides($slides, $options = [])
+    {
         $default_options = [
             'show_captions' => true,
             'caption_size' => null,
@@ -205,11 +211,13 @@ class SlideshowLink extends NormalLink {
     }
 
 
-    protected function _orderSlidesByFilename($a, $b) {
+    protected function _orderSlidesByFilename($a, $b)
+    {
         return strcmp($a['path'], $b['path']);
     }
 
-    public function keep() {
+    public function keep()
+    {
         return true;
     }
 }