From: Vincent Vanwaelscappel Date: Thu, 18 Jul 2019 14:24:50 +0000 (+0200) Subject: fix #2918 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=df17ae3a65fcaa5d662a620bf79acc6abf792236;p=cubist_cms-back.git fix #2918 @2 --- diff --git a/src/app/Magic/Fields/Markdown.php b/src/app/Magic/Fields/Markdown.php index 8c7837b..57630d0 100644 --- a/src/app/Magic/Fields/Markdown.php +++ b/src/app/Magic/Fields/Markdown.php @@ -3,10 +3,22 @@ namespace Cubist\Backpack\app\Magic\Fields; +use Cubist\Backpack\CubistBackpackServiceProvider; class Markdown extends Field { protected $_adminType = 'simplemde'; + protected $_viewNamespace = CubistBackpackServiceProvider::NAMESPACE . '::fields'; + protected $_databaseType = 'text'; protected $_translatable = true; + + protected $_simplemdeAttributes = [ + 'spellChecker' => false, + ]; + + public function getDefaultAttributes() + { + return array_merge(parent::getDefaultAttributes(), ['simplemdeAttributes' => $this->_simplemdeAttributes]); + } } diff --git a/src/resources/views/fields/simplemde.blade.php b/src/resources/views/fields/simplemde.blade.php new file mode 100644 index 0000000..ed74111 --- /dev/null +++ b/src/resources/views/fields/simplemde.blade.php @@ -0,0 +1,81 @@ + +
+ + @include('crud::inc.field_translatable_icon') + + + {{-- HINT --}} + @if (isset($field['hint'])) +

{!! $field['hint'] !!}

+ @endif +
+ + +{{-- ########################################## --}} +{{-- Extra CSS and JS for this particular field --}} +{{-- If a field type is shown multiple times on a form, the CSS and JS will only be loaded once --}} +@if ($crud->checkIfFieldIsFirstOfItsType($field)) + + {{-- FIELD CSS - will be loaded in the after_styles section --}} + @push('crud_fields_styles') + + + @endpush + + {{-- FIELD JS - will be loaded in the after_scripts section --}} + @push('crud_fields_scripts') + + + @endpush + +@endif + +{{-- End of Extra CSS and JS --}} +{{-- ########################################## --}}