From: soufiane Date: Mon, 21 Jul 2025 17:11:44 +0000 (+0200) Subject: wip #7634 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=657bc1bb3f3934264f5daac922130ed952bf9026;p=fluidbook-toolbox.git wip #7634 --- diff --git a/resources/markdowneditor/js/markdowneditor.js b/resources/markdowneditor/js/markdowneditor.js index f7903601a..b9cc82f3b 100644 --- a/resources/markdowneditor/js/markdowneditor.js +++ b/resources/markdowneditor/js/markdowneditor.js @@ -143,10 +143,9 @@ MarkdownEditor.prototype = { }, setContentMarkdown: function() { - const $this = this - if(this.undo.states[this.getCurrentPage()] !== undefined || this.undo.states[this.getCurrentPage()] === null) { + if(this.undo.states[this.getCurrentPage()] !== undefined) { const state = this.undo.states[this.getCurrentPage()] - const lastKey = state.length; + const lastKey = state.length - 1; this.editor.setMarkdown(state[lastKey]) this.editor.moveCursorToStart(true) }else { diff --git a/resources/markdowneditor/js/markdowneditor.undo.js b/resources/markdowneditor/js/markdowneditor.undo.js index eff3553d3..0d0767461 100644 --- a/resources/markdowneditor/js/markdowneditor.undo.js +++ b/resources/markdowneditor/js/markdowneditor.undo.js @@ -68,7 +68,6 @@ MarkdowneditorUndo.prototype = { this.states[this.markdowneditor.getCurrentPage()] = [ this.markdowneditor.contentMarkdown ]; - console.log('ok',this.states,this.markdowneditor.editor.getMarkdown(),'ok') } let cs = this.markdowneditor.editor.getMarkdown(); diff --git a/resources/markdowneditor/style/style.sass b/resources/markdowneditor/style/style.sass index c6353ead2..f681ef024 100644 --- a/resources/markdowneditor/style/style.sass +++ b/resources/markdowneditor/style/style.sass @@ -26,6 +26,9 @@ body margin: 0 3px text-align: center color: #5d5d5d + &.disabled + color: #bbb + pointer-events: none svg position: relative top: 1px diff --git a/resources/views/fluidbook_publication/markdown_editor.blade.php b/resources/views/fluidbook_publication/markdown_editor.blade.php index 1af5f0535..05dc732af 100644 --- a/resources/views/fluidbook_publication/markdown_editor.blade.php +++ b/resources/views/fluidbook_publication/markdown_editor.blade.php @@ -1,5 +1,4 @@ @php - $content = "ok"; $fbdata=$fluidbook->getPageData()->getRawData(); $fbdata['settings']['pages']=$fbdata['pages']=$fluidbook->getPagesNumber(); $fbdata['settings']['imageFormat']=$fluidbook->getImageFormat(); @@ -78,7 +77,6 @@ @foreach($filesdata as $key => $data) @if(strstr($key,".md")) MARKDOWN_DATA["{{explode('.',$key)[0]}}"] = `{!! $data !!}`; - console.log(MARKDOWN_DATA) @endif @endforeach