Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"description": "TinyMCE field for Backpack",
"keywords": ["laravel", "backpack"],
"require": {
"backpack/crud": "^6.0"
"backpack/crud": "^7.0.0-alpha"
},
"autoload": {
"psr-4": {
"Backpack\\TinyMCEField\\": "src/"
}
},
"minimum-stability": "stable",
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"laravel": {
Expand Down
22 changes: 16 additions & 6 deletions resources/views/fields/tinymce.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,22 @@
{{-- ########################################## --}}
{{-- 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 --}}

@push('crud_fields_styles')
{{-- include tinymce css --}}
@basset('https://raw.githubusercontent.com/tinymce/tinymce-dist/refs/tags/6.3.2/skins/ui/oxide/skin.min.css')
@basset('https://raw.githubusercontent.com/tinymce/tinymce-dist/refs/tags/6.3.2/skins/ui/oxide/content.min.css')
@endpush
{{-- FIELD JS - will be loaded in the after_scripts section --}}
@push('crud_fields_scripts')
{{-- include tinymce js --}}
@bassetArchive('https://github.com/tinymce/tinymce-dist/archive/refs/tags/6.3.2.tar.gz', 'tinymce-6.3.2')
@basset('tinymce-6.3.2/tinymce-dist-6.3.2/tinymce.min.js')
@basset('https://raw.githubusercontent.com/tinymce/tinymce-dist/refs/tags/6.3.2/tinymce.min.js', true, ['loading-order' => 1])
@basset('https://raw.githubusercontent.com/tinymce/tinymce-dist/refs/tags/6.3.2/themes/silver/theme.min.js')
@basset('https://raw.githubusercontent.com/tinymce/tinymce-dist/refs/tags/6.3.2/models/dom/model.min.js')
@basset('https://raw.githubusercontent.com/tinymce/tinymce-dist/refs/tags/6.3.2/icons/default/icons.min.js')
@basset('https://raw.githubusercontent.com/tinymce/tinymce-dist/refs/tags/6.3.2/plugins/image/plugin.min.js')
@basset('https://raw.githubusercontent.com/tinymce/tinymce-dist/refs/tags/6.3.2/plugins/link/plugin.min.js')
@basset('https://raw.githubusercontent.com/tinymce/tinymce-dist/refs/tags/6.3.2/plugins/media/plugin.min.js')
@basset('https://raw.githubusercontent.com/tinymce/tinymce-dist/refs/tags/6.3.2/plugins/anchor/plugin.min.js')

@bassetBlock('backpack/pro/fields/tinymce-field.js')
<script type="text/javascript">
Expand Down Expand Up @@ -68,8 +78,8 @@ function bpFieldInitTinyMceElement(element) {
element.trigger('change');
}

// in case there is no original event, it means the change migth have already
// ocurred, for example, when adding an image or a link from the toolbar.
// in case there is no original event, it means the change might have already
// occurred, for example, when adding an image or a link from the toolbar.
// we just make sure that the process is complete and we have content
if(!hasOriginalEvent && typeof e.level.content !== 'undefined') {
editor.save();
Expand Down Expand Up @@ -161,7 +171,7 @@ function getTinyMceEditorId()
function elFinderBrowser (callback, value, meta) {
tinymce.activeEditor.windowManager.openUrl({
title: 'elFinder 2.0',
url: '{{ backpack_url('elfinder/tinymce5') }}',
url: '{{ backpack_url("elfinder/tinymce5") }}',
width: 900,
height: 460,
onMessage: function (dialogApi, details) {
Expand Down