From 1d596348d5cf5badeb885594c5a821bd597db9b2 Mon Sep 17 00:00:00 2001 From: soufiane Date: Thu, 31 Jul 2025 14:53:12 +0200 Subject: [PATCH] =?utf8?q?wip=20#7634=20ajout=20du=20loader=20=C3=A0=20la?= =?utf8?q?=20sauvegarde?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../markdowneditor/js/markdowneditor.save.js | 5 +++++ resources/markdowneditor/style/style.sass | 22 +++++++++++++++++++ .../link_editor_icons.blade.php | 20 +++++++++++++++++ .../markdown_editor.blade.php | 7 ++++-- 4 files changed, 52 insertions(+), 2 deletions(-) diff --git a/resources/markdowneditor/js/markdowneditor.save.js b/resources/markdowneditor/js/markdowneditor.save.js index fdf369214..f45a9ccfe 100644 --- a/resources/markdowneditor/js/markdowneditor.save.js +++ b/resources/markdowneditor/js/markdowneditor.save.js @@ -56,6 +56,8 @@ MarkdowneditorSave.prototype = { message = TRANSLATIONS.manual_save_message; } + $(".markdown-toolbar-save-block").addClass("is-saving") + $.ajax({ url: '/fluidbook-publication/' + FLUIDBOOK_DATA.id + '/save/markdown', method: 'post', data: { _method: 'put', @@ -77,6 +79,9 @@ MarkdowneditorSave.prototype = { $this.markdowneditor.hasChanged(); $this.markdowneditor.notification(TRANSLATIONS.error_save + ' : ' + error, 'error'); }, + complete: function() { + $(".markdown-toolbar-save-block").removeClass("is-saving") + } }); }, diff --git a/resources/markdowneditor/style/style.sass b/resources/markdowneditor/style/style.sass index 954b6fb7b..34e41b439 100644 --- a/resources/markdowneditor/style/style.sass +++ b/resources/markdowneditor/style/style.sass @@ -143,6 +143,22 @@ body width: 100% display: flex align-items: center + &-save-block + position: relative + min-width: 26px + &.is-saving + [data-icon="save"] + display: none + [data-icon="loading"] + display: block !important + + [data-icon="loading"] + display: none + position: absolute + left: 0 + animation: rotate 1.5s linear infinite + pointer-events: none + &-editor display: flex height: 100vh @@ -254,3 +270,9 @@ input::-webkit-inner-spin-button .ProseMirror, .toastui-editor-md-preview @include tinyscrollbars + +@keyframes rotate + from + transform: rotate(0) + to + transform: rotate(360deg) diff --git a/resources/views/fluidbook_publication/link_editor_icons.blade.php b/resources/views/fluidbook_publication/link_editor_icons.blade.php index df83965ec..a6d7c934b 100644 --- a/resources/views/fluidbook_publication/link_editor_icons.blade.php +++ b/resources/views/fluidbook_publication/link_editor_icons.blade.php @@ -87,6 +87,26 @@ Edit here : https://toolbox.fluidbook.com/tool-sprite/3/edit + + + + + + + + + + + + + + + + + +