]> _ Git - fluidbook-toolbox.git/commitdiff
wait #7891 11:00 markdown_editor
authorsoufiane <soufiane@cubedesigners.com>
Thu, 18 Dec 2025 11:44:50 +0000 (12:44 +0100)
committersoufiane <soufiane@cubedesigners.com>
Thu, 18 Dec 2025 11:44:50 +0000 (12:44 +0100)
app/Http/Controllers/Admin/Operations/FluidbookPublication/MarkdownOperation.php
app/Models/FluidbookPublication.php
resources/markdowneditor/js/markdowneditor.js
resources/markdowneditor/js/markdowneditor.save.js
resources/markdowneditor/js/markdowneditor.toolbar.js
resources/markdowneditor/style/style.sass
resources/views/fluidbook_publication/link_editor_icons.blade.php
resources/views/fluidbook_publication/markdown_editor.blade.php

index e737743d4a6f0d2ee11450c9b689fa663ddf9d86..c8b4458b8cd4236b1516a6177127f4a6c121c174 100644 (file)
@@ -21,7 +21,7 @@ trait MarkdownOperation
         Route::match(['get'], $segment . '/{id}/edit/markdown/versions/restore/{version}', $controller . '@restoreMarkdowns');
         Route::match(['get'], $segment . '/{id}/markdown', $controller . '@getFilesById');
         Route::match(['put'], $segment . '/{id}/save/markdown', $controller . '@saveMarkdown');
-        Route::match(['get'], $segment . '/{id}/import/markdown', $controller . '@importMarkdown');
+        Route::match(['get'], $segment . '/{id}/import/markdown/{page?}', $controller . '@importMarkdown');
     }
 
     public function markdown($id)
@@ -33,16 +33,17 @@ trait MarkdownOperation
         $token = Str::random(10);
         $contents = $this->getLatestMarkdown($id);
 
-        $fluidbook=FluidbookPublication::find($id);
+        $fluidbook = FluidbookPublication::find($id);
 
         return view('fluidbook_publication.markdown_editor', ['contents' => $contents, 'version' => 'stable', 'id' => $id, 'fluidbook' => $fluidbook, 'access' => "", 'token' => $token]);
     }
 
-    protected function getLatestMarkdown($book_id) {
-        $fluidbook=FluidbookPublication::find($book_id);
+    protected function getLatestMarkdown($book_id)
+    {
+        $fluidbook = FluidbookPublication::find($book_id);
         $dir = self::getMarkdownsDir($book_id);
         $filePath = $dir . 'latest.accessible.gz';
-        if(file_exists($filePath)) {
+        if (file_exists($filePath)) {
             if (is_file($filePath)) {
                 $file = gzdecode(file_get_contents($filePath));
                 $typeOf = gettype($file);
@@ -74,7 +75,7 @@ trait MarkdownOperation
         $base = self::getMarkdownsDir($fluidbook_id) . '/' . time();
         $latestMarkdown = self::getMarkdownsDir($fluidbook_id) . '/latest.accessible.gz';
         $latestMeta = self::getMarkdownsDir($fluidbook_id) . '/latest.meta.gz';
-        file_put_contents($base . '.accessible.gz', gzencode(json_encode($markdowns, JSON_UNESCAPED_SLASHES )));
+        file_put_contents($base . '.accessible.gz', gzencode(json_encode($markdowns, JSON_UNESCAPED_SLASHES)));
         file_put_contents($base . '.meta.gz', gzencode(json_encode($meta)));
         copy($base . '.accessible.gz', $latestMarkdown);
         copy($base . '.meta.gz', $latestMeta);
@@ -158,18 +159,27 @@ trait MarkdownOperation
         return response()->json(['success' => 'ok']);
     }
 
-    public function importMarkdown($fluidbook_id)
+    public function importMarkdown($fluidbook_id, $page)
     {
         $fluidbook = FluidbookPublication::withoutGlobalScopes()->find($fluidbook_id);
         $base = Files::mkdir($fluidbook->protected_path('fluidbookpublication/accessible/' . $fluidbook_id . '/'));
         $file = $base . 'latest.accessible.gz';
         $meta = $base . 'latest.meta.gz';
+
+        // get latest md
+        $markdowns = gzdecode(file_get_contents($file));
+        $markdowns = json_decode($markdowns, true)['pages'];
+
         Files::rmdir($file);
         Files::rmdir($meta);
-        $md = $fluidbook->getAccessibleContents();
+        $md = $fluidbook->getAccessibleContents('latest', $page);
 
-        $message = "Markdown importé";
+        if ($page) {
+            $markdowns[$page] = $md['pages'][$page];
+            $md['pages'] = $markdowns;
+        }
 
+        $message = "Markdown importé";
         $this->saveMarkdown($fluidbook_id, $message, $md['pages']);
 
         return response()->json(['success' => $md['pages']]);
index a9637bd55a30acf206a545de56c4d8e02de56299..69965a6863a76a29ef081e46f73878b7311e379b 100644 (file)
@@ -469,16 +469,23 @@ class FluidbookPublication extends ToolboxStatusModel
         }
     }
 
-    public function getAccessibleContents($revision = 'latest')
+    public function getAccessibleContents($revision = 'latest', $specificPage = null)
     {
         $base = Files::mkdir($this->protected_path('fluidbookpublication/accessible/' . $this->id . '/'));
         $file = $base . $revision . '.accessible.gz';
         $meta = $base . $revision . '.meta.gz';
-        if (!file_exists($file)) {
+        if (!file_exists($file) || $specificPage !== null) {
             if ($revision === 'latest') {
                 $json = ['pages' => []];
 
-                foreach ($this->getComposition() as $page => $d) {
+                $compo = $this->getComposition();
+                if($specificPage !== null) {
+                    $compo = array_filter($compo, function($k) use($specificPage) {
+                        return $k == $specificPage;
+                    }, ARRAY_FILTER_USE_KEY);
+                }
+
+                foreach ($compo as $page => $d) {
                     try {
                         $json['pages'][$page] = file_get_contents($this->getAccessibleFile($page));
                     }catch (\Exception $e) {
index 692002634151706ecdc63cafcf556a88f90a3eb3..d47a7cdd81786c7cfc6598c3419607ef3e6d7d5d 100644 (file)
@@ -346,13 +346,18 @@ MarkdownEditor.prototype = {
         this.my = e.pageY;
     },
 
-    importMarkdown: function() {
+    importMarkdown: function(page = null) {
         $.ajax({
-            url: '/fluidbook-publication/' + FLUIDBOOK_DATA.id + '/import/markdown/',
+            url: '/fluidbook-publication/' + FLUIDBOOK_DATA.id + '/import/markdown/'+page,
             success: function (data) {
+                $("[data-action^=import]").parent('.loading-block').removeClass('is-loading')
                 window.location.reload();
             },
         });
+    },
+
+    importSingleMarkdown: function() {
+        this.importMarkdown(this.currentPage)
     }
 }
 
index f45a9ccfef719a3145ed058d9dbe67c5972fe4a1..ef843c3fffd44ec87132129bc3ed41465b0c9e90 100644 (file)
@@ -80,7 +80,7 @@ MarkdowneditorSave.prototype = {
                 $this.markdowneditor.notification(TRANSLATIONS.error_save + ' : ' + error, 'error');
             },
             complete: function() {
-                $(".markdown-toolbar-save-block").removeClass("is-saving")
+                $(".markdown-toolbar-save-block").removeClass("is-saving is-loading")
             }
         });
     },
index 8c2eb1a06176d5b1148b3ff02d7c6aa8d4723ec9..8512bf402a8fa64dbd1a6ec55a7e7c9b230c96c1 100644 (file)
@@ -14,6 +14,7 @@ MarkdowneditorToolbar.prototype = {
         });
 
         $(document).on('click', '[data-action]', function () {
+            $(this).parent('.loading-block').addClass('is-loading')
             $this.markdowneditor.runAction($(this).data('action'), $(this).is('[data-action-args]') ? $(this).data('action-args') : []);
             return false;
         });
index 1cb0053da976a90b908fca3a255dd1cdbd275a48..ee6db70067f82c8fe7a5c19c59913b995c124142 100644 (file)
@@ -149,18 +149,37 @@ body
         &-save-block
             position: relative
             min-width: 26px
-            &.is-saving
-                [data-icon="save"]
+
+        .loading-block
+            position: relative
+            width: 26px
+            height: 26px
+            &.is-loading
+                pointer-events: none
+                [data-icon]
                     display: none
                 [data-icon="loading"]
-                    display: block !important
+                    display: flex !important
 
         [data-icon="loading"]
             display: none
             position: absolute
-            left: 0
-            animation: rotate 1.5s linear infinite
+            top: 50%
+            left: 50%
+            transform: translate(-50%,-50%)
             pointer-events: none
+            padding: 0
+            margin: 0
+            align-items: center
+            justify-content: center
+            svg
+                transform-origin: center
+                animation: rotate 1.5s linear infinite
+
+        [data-icon^=import]
+            position: relative
+            [data-icon="loading"]
+                display: flex
 
     &-editor
         display: flex
index b8ace8a399b5b8e6bbe223553ca465d5a2867f4d..23970d2a72bd4da7759adcd49fdb30c07fdd9e61 100644 (file)
@@ -25,60 +25,20 @@ Edit here : https://toolbox.fluidbook.com/tool-sprite/3/edit
             <path class="st1" d="M12,11.1c-3.8,0-7.4-.9-9.5-2.3-.4-.3-.5-.8-.2-1.2.3-.4.8-.5,1.2-.2,1.8,1.2,5,2,8.5,2s6.6-.8,8.4-2c.4-.3,1-.2,1.2.2.3.4.2,1-.2,1.2-2.1,1.4-5.6,2.3-9.4,2.3Z"/>
             <path class="st0" d="M12,5.5"/>
         </symbol><symbol id="linkeditor-start-animation" viewBox="0 0 24 24"><desc>Button Play Streamline Icon: https://streamlinehq.com</desc><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M0.75 11.998c0 2.9837 1.18526 5.8452 3.29505 7.955C6.15483 22.0628 9.01631 23.248 12 23.248c2.9837 0 5.8452 -1.1852 7.955 -3.295 2.1097 -2.1098 3.295 -4.9713 3.295 -7.955 0 -2.98364 -1.1853 -5.84512 -3.295 -7.9549C17.8452 1.93331 14.9837 0.748047 12 0.748047c-2.98369 0 -5.84517 1.185263 -7.95495 3.295053C1.93526 6.15288 0.75 9.01436 0.75 11.998Z" stroke-width="1.5"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M9 15.613c0.00026 0.314 0.0909 0.6214 0.2611 0.8853 0.17019 0.2639 0.41275 0.4733 0.6987 0.6031 0.286 0.1298 0.6032 0.1745 0.9139 0.1289 0.3107 -0.0457 0.6017 -0.1797 0.8383 -0.3863L17.25 12l-5.538 -4.84699c-0.2364 -0.20698 -0.5275 -0.34145 -0.8383 -0.38732 -0.3109 -0.04588 -0.6284 -0.0012 -0.91448 0.12867 -0.28612 0.12988 -0.52876 0.33945 -0.69888 0.60363 -0.17011 0.26419 -0.2605 0.5718 -0.26034 0.88602V15.613Z" stroke-width="1.5"></path></symbol><symbol id="linkeditor-order-horizontal" viewBox="0 0 24 24">
-            <!-- Generator: Adobe Illustrator 29.5.1, SVG Export Plug-In . SVG Version: 2.1.0 Build 141)  -->
-            <defs>
-                <style>
-                    .st0 {
-                        fill: currentColor;
-                    }
-                </style>
-            </defs>
-            <path class="st0" d="M22.9,21.3H1.1c-.3,0-.6-.2-.6-.5,0-.3.1-.6.4-.7l18.8-7.5H1.1c-.3,0-.6-.2-.6-.5,0-.3.1-.6.4-.7L19.7,3.9H1.1c-.3,0-.6-.3-.6-.6s.3-.6.6-.6h21.8c.3,0,.6.2.6.5,0,.3-.1.6-.4.7L4.3,11.4h18.6c.3,0,.6.2.6.5,0,.3-.1.6-.4.7l-18.8,7.5h18.6c.3,0,.6.3.6.6s-.3.6-.6.6Z"/>
+            <path fill="currentColor" d="M22.9,21.3H1.1c-.3,0-.6-.2-.6-.5,0-.3.1-.6.4-.7l18.8-7.5H1.1c-.3,0-.6-.2-.6-.5,0-.3.1-.6.4-.7L19.7,3.9H1.1c-.3,0-.6-.3-.6-.6s.3-.6.6-.6h21.8c.3,0,.6.2.6.5,0,.3-.1.6-.4.7L4.3,11.4h18.6c.3,0,.6.2.6.5,0,.3-.1.6-.4.7l-18.8,7.5h18.6c.3,0,.6.3.6.6s-.3.6-.6.6Z"/>
         </symbol><symbol id="linkeditor-order-vertical" viewBox="0 0 24 24">
-            <!-- Generator: Adobe Illustrator 29.5.1, SVG Export Plug-In . SVG Version: 2.1.0 Build 141)  -->
-            <defs>
-                <style>
-                    .st0 {
-                        fill: currentColor;
-                    }
-                </style>
-            </defs>
-            <path class="st0" d="M12.1,23.8s0,0-.1,0c-.3,0-.6-.4-.6-.7V5.2l-7.2,18.1c-.1.3-.5.5-.8.4-.3,0-.6-.4-.6-.7V1.5c0-.4.3-.7.7-.7s.7.3.7.7v17.9L11.5,1.2c.1-.3.5-.5.8-.4.3,0,.6.4.6.7v17.9L20.1,1.2c.1-.3.5-.5.8-.4.3,0,.6.4.6.7v21.6c0,.4-.3.7-.7.7s-.7-.3-.7-.7V5.2l-7.2,18.1c-.1.3-.4.4-.7.4Z"/>
+            <path fill="currentColor" d="M12.1,23.8s0,0-.1,0c-.3,0-.6-.4-.6-.7V5.2l-7.2,18.1c-.1.3-.5.5-.8.4-.3,0-.6-.4-.6-.7V1.5c0-.4.3-.7.7-.7s.7.3.7.7v17.9L11.5,1.2c.1-.3.5-.5.8-.4.3,0,.6.4.6.7v17.9L20.1,1.2c.1-.3.5-.5.8-.4.3,0,.6.4.6.7v21.6c0,.4-.3.7-.7.7s-.7-.3-.7-.7V5.2l-7.2,18.1c-.1.3-.4.4-.7.4Z"/>
         </symbol><symbol id="linkeditor-order-horizontal-all" viewBox="0 0 24 24">
-            <!-- Generator: Adobe Illustrator 29.5.1, SVG Export Plug-In . SVG Version: 2.1.0 Build 141)  -->
-            <defs>
-                <style>
-                    .st0 {
-                        fill: currentColor;
-                    }
-                </style>
-            </defs>
-            <path class="st0" d="M19,20H2c-.6,0-1.1-.5-1.1-1.1V1.8c0-.6.5-1.1,1.1-1.1h17c.6,0,1.1.5,1.1,1.1v17c0,.6-.5,1.1-1.1,1.1ZM2,1.7c0,0-.1,0-.1.1v17c0,0,0,.1.1.1h17c0,0,.1,0,.1-.1V1.8c0,0,0-.1-.1-.1H2Z"/>
-            <path class="st0" d="M21.9,23.2h-11.7c-.3,0-.5-.2-.5-.5s.2-.5.5-.5h11.7c.3,0,.5-.2.5-.5v-11.9c0-.3.2-.5.5-.5s.5.2.5.5v11.9c0,.8-.7,1.5-1.5,1.5Z"/>
-            <path class="st0" d="M16.2,15.6H4.8c-.2,0-.4-.2-.5-.4,0-.2,0-.5.3-.6l9-3.6H4.8c-.2,0-.4-.2-.5-.4,0-.2,0-.5.3-.6l9-3.6H4.8c-.3,0-.5-.2-.5-.5s.2-.5.5-.5h11.4c.2,0,.4.2.5.4,0,.2,0,.5-.3.6l-9,3.6h8.8c.2,0,.4.2.5.4,0,.2,0,.5-.3.6l-9,3.6h8.8c.3,0,.5.2.5.5s-.2.5-.5.5Z"/>
+            <path fill="currentColor" d="M19,20H2c-.6,0-1.1-.5-1.1-1.1V1.8c0-.6.5-1.1,1.1-1.1h17c.6,0,1.1.5,1.1,1.1v17c0,.6-.5,1.1-1.1,1.1ZM2,1.7c0,0-.1,0-.1.1v17c0,0,0,.1.1.1h17c0,0,.1,0,.1-.1V1.8c0,0,0-.1-.1-.1H2Z"/>
+            <path fill="currentColor" d="M21.9,23.2h-11.7c-.3,0-.5-.2-.5-.5s.2-.5.5-.5h11.7c.3,0,.5-.2.5-.5v-11.9c0-.3.2-.5.5-.5s.5.2.5.5v11.9c0,.8-.7,1.5-1.5,1.5Z"/>
+            <path fill="currentColor" d="M16.2,15.6H4.8c-.2,0-.4-.2-.5-.4,0-.2,0-.5.3-.6l9-3.6H4.8c-.2,0-.4-.2-.5-.4,0-.2,0-.5.3-.6l9-3.6H4.8c-.3,0-.5-.2-.5-.5s.2-.5.5-.5h11.4c.2,0,.4.2.5.4,0,.2,0,.5-.3.6l-9,3.6h8.8c.2,0,.4.2.5.4,0,.2,0,.5-.3.6l-9,3.6h8.8c.3,0,.5.2.5.5s-.2.5-.5.5Z"/>
         </symbol><symbol id="linkeditor-order-vertical-all" viewBox="0 0 24 24">
-            <!-- Generator: Adobe Illustrator 29.5.1, SVG Export Plug-In . SVG Version: 2.1.0 Build 141)  -->
-            <defs>
-                <style>
-                    .st0 {
-                        fill: currentColor;
-                    }
-                </style>
-            </defs>
-            <path class="st0" d="M19,20H2c-.6,0-1.1-.5-1.1-1.1V1.8c0-.6.5-1.1,1.1-1.1h17c.6,0,1.1.5,1.1,1.1v17c0,.6-.5,1.1-1.1,1.1ZM2,1.7c0,0-.1,0-.1.1v17c0,0,0,.1.1.1h17c0,0,.1,0,.1-.1V1.8c0,0,0-.1-.1-.1H2Z"/>
-            <path class="st0" d="M21.9,23.2h-11.7c-.3,0-.5-.2-.5-.5s.2-.5.5-.5h11.7c.3,0,.5-.2.5-.5v-11.9c0-.3.2-.5.5-.5s.5.2.5.5v11.9c0,.8-.7,1.5-1.5,1.5Z"/>
-            <path class="st0" d="M15.6,4.9v11.4c0,.2-.2.4-.4.5-.2,0-.5,0-.6-.3l-3.6-9v8.8c0,.2-.2.4-.4.5-.2,0-.5,0-.6-.3l-3.6-9v8.8c0,.3-.2.5-.5.5s-.5-.2-.5-.5V4.9c0-.2.2-.4.4-.5.2,0,.5,0,.6.3l3.6,9V4.9c0-.2.2-.4.4-.5.2,0,.5,0,.6.3l3.6,9V4.9c0-.3.2-.5.5-.5s.5.2.5.5Z"/>
+            <path fill="currentColor" d="M19,20H2c-.6,0-1.1-.5-1.1-1.1V1.8c0-.6.5-1.1,1.1-1.1h17c.6,0,1.1.5,1.1,1.1v17c0,.6-.5,1.1-1.1,1.1ZM2,1.7c0,0-.1,0-.1.1v17c0,0,0,.1.1.1h17c0,0,.1,0,.1-.1V1.8c0,0,0-.1-.1-.1H2Z"/>
+            <path fill="currentColor" d="M21.9,23.2h-11.7c-.3,0-.5-.2-.5-.5s.2-.5.5-.5h11.7c.3,0,.5-.2.5-.5v-11.9c0-.3.2-.5.5-.5s.5.2.5.5v11.9c0,.8-.7,1.5-1.5,1.5Z"/>
+            <path fill="currentColor" d="M15.6,4.9v11.4c0,.2-.2.4-.4.5-.2,0-.5,0-.6-.3l-3.6-9v8.8c0,.2-.2.4-.4.5-.2,0-.5,0-.6-.3l-3.6-9v8.8c0,.3-.2.5-.5.5s-.5-.2-.5-.5V4.9c0-.2.2-.4.4-.5.2,0,.5,0,.6.3l3.6,9V4.9c0-.2.2-.4.4-.5.2,0,.5,0,.6.3l3.6,9V4.9c0-.3.2-.5.5-.5s.5.2.5.5Z"/>
         </symbol><symbol id="linkeditor-drag-drop" viewBox="0 0 24 24">
-            <!-- Generator: Adobe Illustrator 29.5.1, SVG Export Plug-In . SVG Version: 2.1.0 Build 141)  -->
-            <defs>
-                <style>
-                    .st0 {
-                        fill: currentColor;
-                    }
-                </style>
-            </defs>
-            <path class="st0" d="M19.7,9.6H4c-.2,0-.5-.1-.6-.4,0-.2,0-.5.1-.7L11.5.7c.2-.2.6-.2.9,0l7.9,7.9c.2.2.2.4.1.7,0,.2-.3.4-.6.4ZM5.5,8.4h12.8l-6.4-6.4-6.4,6.4Z"/>
-            <path class="st0" d="M11.9,23.7c-.2,0-.3,0-.4-.2l-7.9-7.9c-.2-.2-.2-.4-.1-.7,0-.2.3-.4.6-.4h15.7c.2,0,.5.1.6.4,0,.2,0,.5-.1.7l-7.9,7.9c-.1.1-.3.2-.4.2ZM5.5,15.9l6.4,6.4,6.4-6.4H5.5Z"/>
+            <path fill="currentColor" d="M19.7,9.6H4c-.2,0-.5-.1-.6-.4,0-.2,0-.5.1-.7L11.5.7c.2-.2.6-.2.9,0l7.9,7.9c.2.2.2.4.1.7,0,.2-.3.4-.6.4ZM5.5,8.4h12.8l-6.4-6.4-6.4,6.4Z"/>
+            <path fill="currentColor" d="M11.9,23.7c-.2,0-.3,0-.4-.2l-7.9-7.9c-.2-.2-.2-.4-.1-.7,0-.2.3-.4.6-.4h15.7c.2,0,.5.1.6.4,0,.2,0,.5-.1.7l-7.9,7.9c-.1.1-.3.2-.4.2ZM5.5,15.9l6.4,6.4,6.4-6.4H5.5Z"/>
         </symbol><symbol id="linkeditor-move-start" viewBox="0 0 18 18">
             <path fill="currentColor" d="M14.7,4.4c0,0,0-.1-.1-.2,0,0-.9-.9-1.9-1.9-2.1-2.1-1.9-1.9-2.2-1.9s-.2,0-.2,0c0,0-.5.4-2,1.9-1.1,1.1-1.9,1.9-1.9,2-.2.3,0,.7.3.9,0,0,.1,0,.2,0,.3,0,.1.1,2-1.7l1.7-1.7,1.6,1.6c1,1,1.7,1.7,1.7,1.7,0,0,.1,0,.2,0,.3,0,.5,0,.7-.3,0-.1,0-.3,0-.5M14.7,9.3c0,0,0-.1,0-.2,0,0-.9-.9-1.9-1.9-1.4-1.4-1.9-1.9-1.9-1.9-.1,0-.2,0-.4,0-.2,0-.1,0-2.2,2-2.1,2.1-2,2-2,2.2,0,.1,0,.2,0,.2.1.2.3.4.6.4.1,0,.2,0,.2,0,.1,0,.2-.1,1.4-1.4l1.3-1.3v2.4c0,2,0,2.5,0,2.6-.2,1.4-1.1,2.7-2.3,3.3-.4.2-.8.3-1.2.4-.2,0-.3,0-1.7,0-1,0-1.5,0-1.6,0-.2,0-.3.2-.4.4,0,.1,0,.3,0,.5,0,.1.2.2.3.3h0s1.5,0,1.5,0c1.7,0,1.7,0,2.2-.1.8-.2,1.6-.5,2.3-1.1.2-.2.7-.6.8-.8.5-.7.9-1.5,1.1-2.3.1-.5.1-.4.1-3.2v-2.5s1.3,1.3,1.3,1.3c1.4,1.4,1.4,1.4,1.6,1.4.2,0,.4,0,.5-.2.1-.1.2-.2.2-.4,0-.1,0-.2,0-.2"/>
         </symbol><symbol id="linkeditor-move-end" viewBox="0 0 18 18">
@@ -89,25 +49,49 @@ Edit here : https://toolbox.fluidbook.com/tool-sprite/3/edit
             <path fill="currentColor" d="M3.3,17.5c0,0,.2,0,1.6,0,1.6,0,1.6,0,2,0,.9-.2,1.7-.6,2.4-1.1.2-.2.7-.6.8-.8.5-.7.9-1.5,1.1-2.3.1-.5.1,0,.1-5.6V2.6s1.3,1.3,1.3,1.3c1,1,1.4,1.3,1.4,1.4.3.1.7,0,.8-.3,0,0,0-.1,0-.3,0-.3.2-.1-2-2.3-2.1-2.1-2-2-2.3-2s-.2,0-.2,0c0,0-.4.4-2,1.9-2.2,2.2-2,2-2,2.3,0,.1,0,.2,0,.2.1.3.5.4.8.3,0,0,.5-.5,1.4-1.4l1.3-1.3v4.9c0,5.3,0,5.1,0,5.5-.1.5-.3,1-.6,1.4-.6,1-1.6,1.6-2.8,1.8,0,0-.2,0-.2,0,0,0-.7,0-1.6,0h-1.5s0,0,0,0c-.1,0-.3.2-.3.3,0,.1,0,.3,0,.5,0,.2.2.3.4.4"/>
         </symbol><symbol id="linkeditor-loading" viewBox="0 0 32 32">
             <style type="text/css">
-                .st0{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
+                .line{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
             </style>
-            <line class="st0" x1="16" y1="2" x2="16" y2="7"/>
-            <line class="st0" x1="10.6" y1="3.1" x2="12.6" y2="7.7"/>
-            <line class="st0" x1="6.1" y1="6.1" x2="9.6" y2="9.6"/>
-            <line class="st0" x1="3.1" y1="10.6" x2="7.7" y2="12.6"/>
-            <line class="st0" x1="2" y1="16" x2="7" y2="16"/>
-            <line class="st0" x1="3.1" y1="21.4" x2="7.7" y2="19.4"/>
-            <line class="st0" x1="6.1" y1="25.9" x2="9.6" y2="22.4"/>
-            <line class="st0" x1="10.6" y1="28.9" x2="12.6" y2="24.3"/>
-            <line class="st0" x1="16" y1="30" x2="16" y2="25"/>
-            <line class="st0" x1="21.4" y1="28.9" x2="19.4" y2="24.3"/>
-            <line class="st0" x1="25.9" y1="25.9" x2="22.4" y2="22.4"/>
-            <line class="st0" x1="28.9" y1="21.4" x2="24.3" y2="19.4"/>
-            <line class="st0" x1="30" y1="16" x2="25" y2="16"/>
-            <line class="st0" x1="28.9" y1="10.6" x2="24.3" y2="12.6"/>
-            <line class="st0" x1="25.9" y1="6.1" x2="22.4" y2="9.6"/>
-            <line class="st0" x1="21.4" y1="3.1" x2="19.4" y2="7.7"/>
-        </symbol><symbol id="linkeditor-import-markdown" viewBox="0 0 19.97 19.91"><path d="m.45 0-.23.02-.04.13c-.06.19-.1 2.2-.1 5.07 0 2.54.04 4.1.11 4.25.07.14.2.18.57.18.42 0 .57-.05.65-.23.05-.11.06-.34.07-1.76v-1.64s.47-.02.47-.02c.7-.03 1.4-.21 1.83-.46.28-.16.71-.6.83-.85.22-.43.3-.82.33-1.48.06-1.26-.29-2.13-1.07-2.69-.35-.25-.79-.45-1.06-.48-.33-.03-2.06-.06-2.36-.04m5.69.05c-.11.14-.12.28-.14 2.04-.01.97-.03 3.02-.03 4.56v2.79s.16.12.16.12c.25.18.4.22.93.24.78.03 1.73-.09 2.2-.26.65-.24 1.22-.88 1.45-1.61.12-.41.15-.98.15-3.07 0-2.24-.03-2.66-.18-3.13-.15-.44-.29-.67-.6-.97-.23-.22-.34-.3-.63-.44-.19-.09-.41-.19-.48-.21-.3-.09-2.75-.14-2.81-.06m6.25-.01c-.18.03-.23.08-.26.29-.04.24-.07 7.4-.03 8.24.05 1.05.05 1.06.57 1.1.31.02.48-.02.66-.17l.14-.12v-3.95h1.06c1.26-.03 1.27-.03 1.36-.31.06-.22.06-.33 0-.48-.09-.23-.3-.26-1.64-.3l-.77-.02v-3.11h.94c1.26 0 1.91-.04 2.02-.13.13-.1.18-.23.18-.51s-.05-.48-.14-.52c-.07-.03-3.87-.05-4.09-.02m-10.04 1.27c.44.07.82.33.99.66.08.16.08.19.1 1.02l.02.86-.11.2c-.22.41-.41.56-.86.68-.14.04-.44.08-.65.09l-.39.02v-3.62l.33.02c.18.01.44.04.58.07m5.81-.01c.45.06.77.27 1.05.69l.17.26-.02 2.53c-.01 2.52-.01 2.54-.09 2.75-.22.64-.71.9-1.69.9h-.24v-7.22l.29.02c.16.01.4.04.52.05m-7.7 9.56c-.15.07-.36.27-.43.4-.1.22-.05.88.13 1.5.29 1.03 1.11 2.01 2.07 2.47.37.18.64.27.94.32.28.04 1.41.1 2.26.1.35 0 .73.01.85.03l.22.02-.49.52c-.57.6-.78.86-.81 1-.06.28.11.59.39.72q.39.18 1.96-1.38c.85-.85 1.35-1.37 1.39-1.46.09-.17.09-.31 0-.47-.12-.23-1.89-2.05-2.52-2.58-.34-.29-.48-.36-.65-.34-.26.05-.56.32-.61.57-.05.23.14.49 1.02 1.39l.48.5-1.57-.02c-.86-.01-1.65-.04-1.75-.05-.38-.07-.92-.42-1.29-.84-.27-.31-.42-.64-.56-1.28-.19-.88-.22-.93-.48-1.07-.15-.08-.43-.1-.56-.04" fill-rule="evenodd" fill="currentColor"/><path fill="currentColor" d="m14.12 17.19-.95-3.78v4.09c0 .23-.05.4-.15.51s-.24.17-.4.17-.29-.06-.4-.17c-.1-.11-.15-.28-.15-.51v-4.69c0-.26.07-.43.2-.52s.32-.14.55-.14h.37c.22 0 .39.02.49.06s.18.11.22.22c.05.11.1.28.17.51l.86 3.25.86-3.25c.06-.24.12-.41.17-.51s.12-.18.22-.22.26-.06.49-.06h.37c.23 0 .41.04.54.14.13.09.2.26.2.52v4.69c0 .23-.05.4-.15.51s-.24.17-.41.17c-.16 0-.29-.06-.39-.17s-.15-.28-.15-.51v-4.09l-.95 3.78c-.06.25-.11.42-.15.54-.04.11-.11.22-.22.31s-.25.14-.44.14c-.14 0-.26-.03-.36-.09s-.17-.14-.23-.23c-.05-.09-.1-.2-.13-.31s-.06-.23-.09-.36z"/><rect fill="none" height="8.8" rx="1.03" stroke="currentColor" stroke-miterlimit="10" stroke-width=".5" width="9.76" x="9.97" y="10.85"/></symbol></svg></div>
+            <line class="line" x1="16" y1="2" x2="16" y2="7"/>
+            <line class="line" x1="10.6" y1="3.1" x2="12.6" y2="7.7"/>
+            <line class="line" x1="6.1" y1="6.1" x2="9.6" y2="9.6"/>
+            <line class="line" x1="3.1" y1="10.6" x2="7.7" y2="12.6"/>
+            <line class="line" x1="2" y1="16" x2="7" y2="16"/>
+            <line class="line" x1="3.1" y1="21.4" x2="7.7" y2="19.4"/>
+            <line class="line" x1="6.1" y1="25.9" x2="9.6" y2="22.4"/>
+            <line class="line" x1="10.6" y1="28.9" x2="12.6" y2="24.3"/>
+            <line class="line" x1="16" y1="30" x2="16" y2="25"/>
+            <line class="line" x1="21.4" y1="28.9" x2="19.4" y2="24.3"/>
+            <line class="line" x1="25.9" y1="25.9" x2="22.4" y2="22.4"/>
+            <line class="line" x1="28.9" y1="21.4" x2="24.3" y2="19.4"/>
+            <line class="line" x1="30" y1="16" x2="25" y2="16"/>
+            <line class="line" x1="28.9" y1="10.6" x2="24.3" y2="12.6"/>
+            <line class="line" x1="25.9" y1="6.1" x2="22.4" y2="9.6"/>
+            <line class="line" x1="21.4" y1="3.1" x2="19.4" y2="7.7"/>
+        </symbol><symbol id="linkeditor-auto-links" viewBox="0 0 20 20">
+            <path fill="currentColor" d="M3.9,15.7h2.7l-1.2,1.2c-0.3,0.3-0.3,0.7,0,1c0,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2l2.5-2.5
+       c0.3-0.3,0.3-0.7,0-1l-2.5-2.5c-0.3-0.3-0.7-0.3-1,0s-0.3,0.7,0,1l1.3,1.3H3.9c-1.3,0-2.4-1.1-2.4-2.4v-0.2c0-0.4-0.3-0.8-0.7-0.8
+       S0,11.1,0,11.6v0.2C0.1,14,1.8,15.7,3.9,15.7z"/>
+            <g>
+                <g>
+                    <path fill="currentColor" d="M12.7,20c-0.4,0-0.7-0.1-1-0.4l-1.5-1.5c-0.3-0.3-0.4-0.6-0.4-1s0.1-0.7,0.4-1l2.1-2.1c0.3-0.3,0.7-0.3,1,0
+                       s0.3,0.7,0,1l-2.1,2.1l1.5,1.4l2.1-2.1c0.3-0.3,0.7-0.3,1,0c0.3,0.3,0.3,0.7,0,1l-2.1,2.1C13.4,19.8,13,20,12.7,20z"/>
+                    <path fill="currentColor" d="M17,16c-0.2,0-0.4-0.1-0.5-0.2c-0.3-0.3-0.3-0.7,0-1l2.1-2.1l-1.5-1.4L15,13.4c-0.3,0.3-0.7,0.3-1,0
+                       s-0.3-0.7,0-1l2.1-2.1c0.5-0.5,1.4-0.5,2,0l1.5,1.5c0.5,0.5,0.5,1.4,0,2l-2.1,2.1C17.3,15.9,17.2,15.9,17,16L17,16z"/>
+                </g>
+                <path fill="currentColor"  d="M13.6,16.9c-0.2,0-0.4-0.1-0.5-0.2c-0.3-0.3-0.3-0.7,0-1l2.5-2.5c0.3-0.3,0.7-0.3,1,0s0.3,0.7,0,1l-2.5,2.5
+               C14,16.8,13.8,16.9,13.6,16.9z"/>
+            </g>
+            <g>
+                <path fill="currentColor" d="M6.1,0.1H4.8c-0.2,0-0.3,0.1-0.4,0.3l-1,2.9L2.3,0.4c0-0.2-0.2-0.3-0.4-0.3H0.6l1.8,4.7l-2.1,5h1.3
+               c0.2,0,0.3-0.1,0.4-0.3l1.2-3.2l1.2,3.2c0,0.2,0.2,0.3,0.4,0.3h1.3l-2-5L6.1,0.1z"/>
+                <path fill="currentColor" d="M14.4,4.3C13.4,4,13,3.6,13,2.7s0.3-1.3,1.1-1.3S15,1.6,15.3,2c0,0.1,0.3,0.3,0.6,0.1c0.2-0.2,0.4-0.3,0.4-0.3
+               c0.2-0.2,0.2-0.5,0-0.7C15.7,0.4,14.9,0,14,0c-1.8,0-2.5,1.2-2.5,2.7s0.8,2.5,2.2,2.9c1.2,0.4,1.5,0.8,1.5,1.6s-0.3,1.3-1.1,1.3
+               s-1-0.2-1.3-0.7c-0.1-0.2-0.4-0.2-0.6,0l-0.4,0.3c-0.2,0.2-0.2,0.5,0,0.7c0.6,0.8,1.4,1.1,2.5,1.1c1.7,0,2.5-1.3,2.5-2.8
+               s-0.7-2.4-2.2-2.9L14.4,4.3z"/>
+                <path fill="currentColor" d="M10.6,8.4H8.4V0.6c0-0.3-0.2-0.5-0.4-0.5H7.4C7.2,0.1,7,0.3,7,0.6v8.7c0,0.3,0.2,0.5,0.4,0.5l0,0l0,0h3.2
+               c0.2,0,0.3-0.2,0.3-0.4V8.8C10.9,8.6,10.7,8.4,10.6,8.4z"/>
+            </g>
+        </symbol><symbol id="linkeditor-import-markdown" viewBox="0 0 19.97 19.91"><path d="m.45 0-.23.02-.04.13c-.06.19-.1 2.2-.1 5.07 0 2.54.04 4.1.11 4.25.07.14.2.18.57.18.42 0 .57-.05.65-.23.05-.11.06-.34.07-1.76v-1.64s.47-.02.47-.02c.7-.03 1.4-.21 1.83-.46.28-.16.71-.6.83-.85.22-.43.3-.82.33-1.48.06-1.26-.29-2.13-1.07-2.69-.35-.25-.79-.45-1.06-.48-.33-.03-2.06-.06-2.36-.04m5.69.05c-.11.14-.12.28-.14 2.04-.01.97-.03 3.02-.03 4.56v2.79s.16.12.16.12c.25.18.4.22.93.24.78.03 1.73-.09 2.2-.26.65-.24 1.22-.88 1.45-1.61.12-.41.15-.98.15-3.07 0-2.24-.03-2.66-.18-3.13-.15-.44-.29-.67-.6-.97-.23-.22-.34-.3-.63-.44-.19-.09-.41-.19-.48-.21-.3-.09-2.75-.14-2.81-.06m6.25-.01c-.18.03-.23.08-.26.29-.04.24-.07 7.4-.03 8.24.05 1.05.05 1.06.57 1.1.31.02.48-.02.66-.17l.14-.12v-3.95h1.06c1.26-.03 1.27-.03 1.36-.31.06-.22.06-.33 0-.48-.09-.23-.3-.26-1.64-.3l-.77-.02v-3.11h.94c1.26 0 1.91-.04 2.02-.13.13-.1.18-.23.18-.51s-.05-.48-.14-.52c-.07-.03-3.87-.05-4.09-.02m-10.04 1.27c.44.07.82.33.99.66.08.16.08.19.1 1.02l.02.86-.11.2c-.22.41-.41.56-.86.68-.14.04-.44.08-.65.09l-.39.02v-3.62l.33.02c.18.01.44.04.58.07m5.81-.01c.45.06.77.27 1.05.69l.17.26-.02 2.53c-.01 2.52-.01 2.54-.09 2.75-.22.64-.71.9-1.69.9h-.24v-7.22l.29.02c.16.01.4.04.52.05m-7.7 9.56c-.15.07-.36.27-.43.4-.1.22-.05.88.13 1.5.29 1.03 1.11 2.01 2.07 2.47.37.18.64.27.94.32.28.04 1.41.1 2.26.1.35 0 .73.01.85.03l.22.02-.49.52c-.57.6-.78.86-.81 1-.06.28.11.59.39.72q.39.18 1.96-1.38c.85-.85 1.35-1.37 1.39-1.46.09-.17.09-.31 0-.47-.12-.23-1.89-2.05-2.52-2.58-.34-.29-.48-.36-.65-.34-.26.05-.56.32-.61.57-.05.23.14.49 1.02 1.39l.48.5-1.57-.02c-.86-.01-1.65-.04-1.75-.05-.38-.07-.92-.42-1.29-.84-.27-.31-.42-.64-.56-1.28-.19-.88-.22-.93-.48-1.07-.15-.08-.43-.1-.56-.04" fill-rule="evenodd" fill="currentColor"/><path fill="currentColor" d="m14.12 17.19-.95-3.78v4.09c0 .23-.05.4-.15.51s-.24.17-.4.17-.29-.06-.4-.17c-.1-.11-.15-.28-.15-.51v-4.69c0-.26.07-.43.2-.52s.32-.14.55-.14h.37c.22 0 .39.02.49.06s.18.11.22.22c.05.11.1.28.17.51l.86 3.25.86-3.25c.06-.24.12-.41.17-.51s.12-.18.22-.22.26-.06.49-.06h.37c.23 0 .41.04.54.14.13.09.2.26.2.52v4.69c0 .23-.05.4-.15.51s-.24.17-.41.17c-.16 0-.29-.06-.39-.17s-.15-.28-.15-.51v-4.09l-.95 3.78c-.06.25-.11.42-.15.54-.04.11-.11.22-.22.31s-.25.14-.44.14c-.14 0-.26-.03-.36-.09s-.17-.14-.23-.23c-.05-.09-.1-.2-.13-.31s-.06-.23-.09-.36z"/><rect fill="none" height="8.8" rx="1.03" stroke="currentColor" stroke-miterlimit="10" stroke-width=".5" width="9.76" x="9.97" y="10.85"/></symbol><symbol id="linkeditor-import-single-markdown" viewBox="0 0 19.97 19.91"><path d="m.45 0-.23.02-.04.13c-.06.19-.1 2.2-.1 5.07 0 2.54.04 4.1.11 4.25.07.14.2.18.57.18.42 0 .57-.05.65-.23.05-.11.06-.34.07-1.76v-1.64l.47-.02c.7-.03 1.4-.21 1.83-.46.28-.16.71-.6.83-.85.22-.43.3-.82.33-1.48.06-1.26-.29-2.13-1.07-2.69-.35-.25-.79-.45-1.06-.48-.33-.03-2.06-.06-2.36-.04m5.69.05c-.11.14-.12.28-.14 2.04-.01.97-.03 3.02-.03 4.56v2.79l.16.12c.25.18.4.22.93.24.78.03 1.73-.09 2.2-.26.65-.24 1.22-.88 1.45-1.61.12-.41.15-.98.15-3.07 0-2.24-.03-2.66-.18-3.13-.15-.44-.29-.67-.6-.97-.23-.22-.34-.3-.63-.44-.19-.09-.41-.19-.48-.21-.3-.09-2.75-.14-2.81-.06m6.25-.01c-.18.03-.23.08-.26.29-.04.24-.07 7.4-.03 8.24.05 1.05.05 1.06.57 1.1.31.02.48-.02.66-.17l.14-.12v-3.95h1.06c1.26-.03 1.27-.03 1.36-.31.06-.22.06-.33 0-.48-.09-.23-.3-.26-1.64-.3l-.77-.02v-3.11h.94c1.26 0 1.91-.04 2.02-.13.13-.1.18-.23.18-.51s-.05-.48-.14-.52c-.07-.03-3.87-.05-4.09-.02m-10.04 1.27c.44.07.82.33.99.66.08.16.08.19.1 1.02l.02.86-.11.2c-.22.41-.41.56-.86.68-.14.04-.44.08-.65.09l-.39.02v-3.62l.33.02c.18 0 .44.04.58.07m5.81-.01c.45.06.77.27 1.05.69l.17.26-.02 2.53c-.01 2.52-.01 2.54-.09 2.75-.22.64-.71.9-1.69.9h-.24v-7.22l.29.02c.16 0 .4.04.52.05m-7.7 9.56c-.15.07-.36.27-.43.4-.1.22-.05.88.13 1.5.29 1.03 1.11 2.01 2.07 2.47.37.18.64.27.94.32.28.04 1.41.1 2.26.1.35 0 .73.01.85.03l.22.02-.49.52c-.57.6-.78.86-.81 1-.06.28.11.59.39.72.26.12.91-.34 1.96-1.38.85-.85 1.35-1.37 1.39-1.46.09-.17.09-.31 0-.47-.12-.23-1.89-2.05-2.52-2.58-.34-.29-.48-.36-.65-.34-.26.05-.56.32-.61.57-.05.23.14.49 1.02 1.39l.48.5-1.57-.02c-.86-.01-1.65-.04-1.75-.05-.38-.07-.92-.42-1.29-.84-.27-.31-.42-.64-.56-1.28-.19-.88-.22-.93-.48-1.07-.15-.08-.43-.1-.56-.04" fill-rule="evenodd" fill="currentColor"/><path d="m13.67 17.46-.83-3.3v3.57c0 .2-.04.35-.13.45s-.21.15-.35.15-.25-.05-.35-.15c-.09-.1-.13-.24-.13-.45v-4.09c0-.23.06-.38.17-.45s.28-.12.48-.12h.32c.19 0 .34.02.43.05s.16.1.19.19c.04.1.09.24.15.45l.75 2.84.75-2.84c.05-.21.1-.36.15-.45.04-.09.1-.16.19-.19s.23-.05.43-.05h.32c.2 0 .36.03.47.12.11.08.17.23.17.45v4.09c0 .2-.04.35-.13.45s-.21.15-.36.15c-.14 0-.25-.05-.34-.15s-.13-.24-.13-.45v-3.57l-.83 3.3c-.05.22-.1.37-.13.47s-.1.19-.19.27-.22.12-.38.12c-.12 0-.23-.03-.31-.08s-.15-.12-.2-.2c-.04-.08-.09-.17-.11-.27s-.05-.2-.08-.31z" fill="currentColor"/><rect fill="none" height="7.68" rx=".9" stroke="currentColor" stroke-miterlimit="10" stroke-width=".44" width="8.52" x="9.98" y="12"/><rect fill="currentColor" height="4.61" rx="2.25" stroke="currentColor" stroke-miterlimit="10" stroke-width=".37" width="4.86" x="14.9" y="9.26"/><path d="m17.18 12.65v-2.13h.27l-.64.39c-.06.03-.11.04-.15.04-.05 0-.09-.03-.12-.06s-.06-.07-.07-.12 0-.09.01-.14c.02-.05.06-.09.11-.12l.6-.36c.06-.03.12-.06.17-.09.06-.02.11-.04.16-.04.06 0 .11.02.15.05s.06.09.06.16v2.42c0 .28-.07.46-.3.46-.19 0-.27-.2-.25-.46z" fill="#444"/></symbol></svg></div>
 <script>
     function getSpriteIcon(icon, attrs, dimensions) {
         var a = [];
index 8a4d3408fb0b151d954ef0e3cf59f727867f0c51..9f4ce561d248b4c02cb6252a259d6a0b39e30e32 100644 (file)
@@ -86,7 +86,7 @@
         <div class="markdown-editor">
             <div class="markdown-nav markdown-toolbar">
                 <nav class="markdown-toolbar-left" id="markdown-toolbar-left">
-                    <div class="markdown-toolbar-save-block">
+                    <div class="loading-block markdown-toolbar-save-block">
                         <a href="#" data-icon="save" data-action="save.save" data-tooltip="{{__('Sauvegarder')}} (Ctrl+S)"
                            data-key="ctrl+s"></a>
                         <a nohref data-icon="loading" class=""></a>
                     <a href="#" data-action="lastPage" data-icon="last-page"
                        data-tooltip="{{__('Aller à la dernière page')}}"></a>
                     <div class="separator"></div>
-                    <a href="#" data-action="importMarkdown" data-icon="import-markdown"
-                       data-tooltip="{{__('Importer le markdown')}}"></a>
+                    <div class="loading-block">
+                        <a href="#" data-action="importMarkdown" data-icon="import-markdown"
+                           data-tooltip="{{__('Importer le markdown')}}"></a>
+                        <a nohref data-icon="loading" class=""></a>
+                    </div>
+                    <div class="loading-block">
+                        <a href="#" data-action="importSingleMarkdown" data-icon="import-single-markdown"
+                           data-tooltip="{{__('Importer le markdown de la page courante')}}">
+                        </a>
+                        <a nohref data-icon="loading" class=""></a>
+                    </div>
                     <a href="#" data-action="openFluidbook" data-icon="open-fluidbook"
                        data-tooltip="{{__('Ouvrir le fluidbook à la page courante')}}"></a>
                 </nav>