]> BookStack Code Mirror - bookstack/blob - resources/views/pages/markdown-editor.blade.php
Fix build:js:watch not building at first launch in Docker
[bookstack] / resources / views / pages / markdown-editor.blade.php
1 <div id="markdown-editor" component="markdown-editor"
2      option:markdown-editor:page-id="{{ $model->id ?? 0 }}"
3      option:markdown-editor:text-direction="{{ config('app.rtl') ? 'rtl' : 'ltr' }}"
4      class="flex-fill flex code-fill">
5     @exposeTranslations([
6         'errors.image_upload_error',
7     ])
8
9     <div class="markdown-editor-wrap active">
10         <div class="editor-toolbar">
11             <span class="float left editor-toolbar-label">{{ trans('entities.pages_md_editor') }}</span>
12             <div class="float right buttons">
13                 @if(config('services.drawio'))
14                     <button class="text-button" type="button" data-action="insertDrawing">@icon('drawing'){{ trans('entities.pages_md_insert_drawing') }}</button>
15                     <span class="mx-xs text-muted">|</span>
16                 @endif
17                 <button class="text-button" type="button" data-action="insertImage">@icon('image'){{ trans('entities.pages_md_insert_image') }}</button>
18                 <span class="mx-xs text-muted">|</span>
19                 <button class="text-button" type="button" data-action="insertLink">@icon('link'){{ trans('entities.pages_md_insert_link') }}</button>
20                 <span class="mx-xs text-muted">|</span>
21                 <button class="text-button" type="button" data-action="fullscreen">@icon('fullscreen'){{ trans('common.fullscreen') }}</button>
22             </div>
23         </div>
24
25         <div markdown-input class="flex flex-fill">
26             <textarea id="markdown-editor-input"
27                       @if($errors->has('markdown')) class="text-neg" @endif
28                       name="markdown"
29                       rows="5">@if(isset($model) || old('markdown')){{ old('markdown') ?? ($model->markdown === '' ? $model->html : $model->markdown) }}@endif</textarea>
30         </div>
31
32     </div>
33
34     <div class="markdown-editor-wrap">
35         <div class="editor-toolbar">
36             <div class="editor-toolbar-label">{{ trans('entities.pages_md_preview') }}</div>
37         </div>
38         <iframe src="about:blank" class="markdown-display" sandbox="allow-same-origin"></iframe>
39     </div>
40     <input type="hidden" name="html"/>
41
42 </div>
43
44
45
46 @if($errors->has('markdown'))
47     <div class="text-neg text-small">{{ $errors->first('markdown') }}</div>
48 @endif