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