2020-07-05 20:18:17 +00:00
|
|
|
<div id="markdown-editor" component="markdown-editor"
|
|
|
|
option:markdown-editor:page-id="{{ $model->id ?? 0 }}"
|
|
|
|
option:markdown-editor:text-direction="{{ config('app.rtl') ? 'rtl' : 'ltr' }}"
|
2020-11-21 17:52:49 +00:00
|
|
|
option:markdown-editor:image-upload-error-text="{{ trans('errors.image_upload_error') }}"
|
2021-05-26 17:23:27 +00:00
|
|
|
option:markdown-editor:server-upload-limit-text="{{ trans('errors.server_upload_limit') }}"
|
2020-07-05 20:18:17 +00:00
|
|
|
class="flex-fill flex code-fill">
|
2019-07-06 13:52:25 +00:00
|
|
|
|
|
|
|
<div class="markdown-editor-wrap active">
|
2022-11-27 19:52:10 +00:00
|
|
|
<div class="editor-toolbar flex-container-row items-stretch justify-space-between">
|
|
|
|
<div class="editor-toolbar-label text-mono px-m py-xs flex-container-row items-center flex">
|
|
|
|
<span>{{ trans('entities.pages_md_editor') }}</span>
|
|
|
|
</div>
|
|
|
|
<div class="buttons flex-container-row items-stretch">
|
2019-07-06 13:52:25 +00:00
|
|
|
@if(config('services.drawio'))
|
2022-11-27 19:52:10 +00:00
|
|
|
<button class="text-button" type="button" data-action="insertDrawing" title="{{ trans('entities.pages_md_insert_drawing') }}">@icon('drawing')</button>
|
2019-07-06 13:52:25 +00:00
|
|
|
@endif
|
2022-11-27 19:52:10 +00:00
|
|
|
<button class="text-button" type="button" data-action="insertImage" title="{{ trans('entities.pages_md_insert_image') }}">@icon('image')</button>
|
|
|
|
<button class="text-button" type="button" data-action="insertLink" title="{{ trans('entities.pages_md_insert_link') }}">@icon('link')</button>
|
|
|
|
<button class="text-button" type="button" data-action="fullscreen" title="{{ trans('common.fullscreen') }}">@icon('fullscreen')</button>
|
2019-07-06 13:52:25 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div markdown-input class="flex flex-fill">
|
2019-12-22 14:21:18 +00:00
|
|
|
<textarea id="markdown-editor-input"
|
2022-11-26 16:43:28 +00:00
|
|
|
refs="markdown-editor@input"
|
2019-12-22 14:21:18 +00:00
|
|
|
@if($errors->has('markdown')) class="text-neg" @endif
|
|
|
|
name="markdown"
|
|
|
|
rows="5">@if(isset($model) || old('markdown')){{ old('markdown') ?? ($model->markdown === '' ? $model->html : $model->markdown) }}@endif</textarea>
|
2019-07-06 13:52:25 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="markdown-editor-wrap">
|
|
|
|
<div class="editor-toolbar">
|
2022-11-27 19:52:10 +00:00
|
|
|
<div class="editor-toolbar-label text-mono px-m py-xs">{{ trans('entities.pages_md_preview') }}</div>
|
2019-07-06 13:52:25 +00:00
|
|
|
</div>
|
2022-11-26 16:43:28 +00:00
|
|
|
<iframe src="about:blank"
|
|
|
|
refs="markdown-editor@display"
|
|
|
|
class="markdown-display"
|
|
|
|
sandbox="allow-same-origin"></iframe>
|
2019-07-06 13:52:25 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@if($errors->has('markdown'))
|
|
|
|
<div class="text-neg text-small">{{ $errors->first('markdown') }}</div>
|
|
|
|
@endif
|