[WIP] Refactor project
This commit is contained in:
54
resources/views/vendor/boilerplate-media-manager/load/mceextend.blade.php
vendored
Normal file
54
resources/views/vendor/boilerplate-media-manager/load/mceextend.blade.php
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
@push('js')
|
||||
<script>
|
||||
var tinyMediaManager = {
|
||||
image_advtab: true,
|
||||
images_upload_handler: function (blobInfo, success, failure) {
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('file', blobInfo.blob(), blobInfo.filename());
|
||||
|
||||
$.ajax({
|
||||
url: '{{ route('mediamanager.ajax.mce-upload') }}',
|
||||
type: 'post',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(json){
|
||||
if (!json || typeof json.location != 'string') {
|
||||
failure('Invalid JSON');
|
||||
return;
|
||||
}
|
||||
success(json.location);
|
||||
}
|
||||
});
|
||||
},
|
||||
file_picker_callback: function (callback, value, meta) {
|
||||
tinymce.activeEditor.windowManager.openUrl({
|
||||
url: '{{ route('mediamanager.index', [], false) }}?mce=1&type=' + meta.filetype + '&selected=' + value,
|
||||
title: 'File Manager',
|
||||
width: Math.round(window.innerWidth * 0.8),
|
||||
height: Math.round(window.innerHeight * 0.8),
|
||||
onMessage: function (instance, data) {
|
||||
if (data.mceAction === 'insertMedia') {
|
||||
if (meta.filetype === 'image') {
|
||||
callback(data.url, {alt: data.name});
|
||||
}
|
||||
|
||||
if (meta.filetype === 'file') {
|
||||
callback(data.url, {text: data.name});
|
||||
}
|
||||
|
||||
if (meta.filetype === 'media') {
|
||||
callback(data.url);
|
||||
}
|
||||
}
|
||||
instance.close();
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
tinymce.defaultSettings = $.extend({}, tinymce.defaultSettings, tinyMediaManager);
|
||||
</script>
|
||||
@endpush
|
||||
5
resources/views/vendor/boilerplate-media-manager/load/tinymce.blade.php
vendored
Normal file
5
resources/views/vendor/boilerplate-media-manager/load/tinymce.blade.php
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
@if(!defined('LOAD_TINYMCE_MEDIA'))
|
||||
@include('boilerplate::load.tinymce')
|
||||
@include('boilerplate-media-manager::load.mceextend')
|
||||
@php(define('LOAD_TINYMCE_MEDIA', true))
|
||||
@endif
|
||||
Reference in New Issue
Block a user