|
|
@@ -65,6 +65,35 @@ export default {
|
|
|
},
|
|
|
init_instance_callback: editor => {
|
|
|
this.editor = editor;
|
|
|
+ },
|
|
|
+ file_picker_types: 'media',
|
|
|
+ relative_urls: false,
|
|
|
+ remove_script_host: false,
|
|
|
+ convert_urls: true,
|
|
|
+ file_picker_callback: (cb, value, meta) => {
|
|
|
+ var input = document.createElement('input');
|
|
|
+ input.setAttribute('type', 'file');
|
|
|
+ input.setAttribute('accept', 'video/*');
|
|
|
+ input.onchange = e => {
|
|
|
+ var file = input.files[0];
|
|
|
+
|
|
|
+ var reader = new FileReader();
|
|
|
+ reader.readAsDataURL(file);
|
|
|
+ reader.onload = () => {
|
|
|
+ let formData = new FormData();
|
|
|
+ formData.append('file', file);
|
|
|
+ this.$axios
|
|
|
+ .post('/upload/file', formData)
|
|
|
+ .then(res => {
|
|
|
+ cb(res.data);
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ });
|
|
|
+ };
|
|
|
+ };
|
|
|
+
|
|
|
+ input.click();
|
|
|
}
|
|
|
},
|
|
|
editor: null,
|