2020-07-06 04:18:17 +08: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-22 01:52:49 +08:00
|
|
|
option:markdown-editor:image-upload-error-text="{{ trans('errors.image_upload_error') }}"
|
2021-05-27 01:23:27 +08:00
|
|
|
option:markdown-editor:server-upload-limit-text="{{ trans('errors.server_upload_limit') }}"
|
2020-07-06 04:18:17 +08:00
|
|
|
class="flex-fill flex code-fill">
|
2019-07-06 21:52:25 +08:00
|
|
|
|
|
|
|
<div class="markdown-editor-wrap active">
|
2022-11-28 03:52:10 +08: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>
|
2022-11-28 04:30:14 +08:00
|
|
|
<div component="dropdown" class="buttons flex-container-row items-stretch">
|
2019-07-06 21:52:25 +08:00
|
|
|
@if(config('services.drawio'))
|
2022-11-28 03:52:10 +08:00
|
|
|
<button class="text-button" type="button" data-action="insertDrawing" title="{{ trans('entities.pages_md_insert_drawing') }}">@icon('drawing')</button>
|
2019-07-06 21:52:25 +08:00
|
|
|
@endif
|
2022-11-28 03:52:10 +08: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>
|
2022-11-28 04:30:14 +08:00
|
|
|
<button refs="dropdown@toggle" class="text-button" type="button" title="{{ trans('common.more') }}">@icon('more')</button>
|
|
|
|
<div refs="dropdown@menu markdown-editor@setting-container" class="dropdown-menu" role="menu">
|
|
|
|
<div class="px-m">
|
|
|
|
@include('form.toggle-switch', ['name' => 'md-show-preview', 'label' => 'Show preview', 'value' => setting()->getForCurrentUser('md-show-preview')])
|
|
|
|
</div>
|
|
|
|
<hr class="m-none">
|
|
|
|
<div class="px-m">
|
|
|
|
@include('form.toggle-switch', ['name' => 'md-scroll-sync', 'label' => 'Sync preview scroll', 'value' => setting()->getForCurrentUser('md-scroll-sync')])
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-07-06 21:52:25 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div markdown-input class="flex flex-fill">
|
2019-12-22 22:21:18 +08:00
|
|
|
<textarea id="markdown-editor-input"
|
2022-11-27 00:43:28 +08:00
|
|
|
refs="markdown-editor@input"
|
2019-12-22 22:21:18 +08: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 21:52:25 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="markdown-editor-wrap">
|
|
|
|
<div class="editor-toolbar">
|
2022-11-28 03:52:10 +08:00
|
|
|
<div class="editor-toolbar-label text-mono px-m py-xs">{{ trans('entities.pages_md_preview') }}</div>
|
2019-07-06 21:52:25 +08:00
|
|
|
</div>
|
2022-11-27 00:43:28 +08:00
|
|
|
<iframe src="about:blank"
|
|
|
|
refs="markdown-editor@display"
|
|
|
|
class="markdown-display"
|
|
|
|
sandbox="allow-same-origin"></iframe>
|
2019-07-06 21:52:25 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@if($errors->has('markdown'))
|
|
|
|
<div class="text-neg text-small">{{ $errors->first('markdown') }}</div>
|
|
|
|
@endif
|