Laravel-filemanager: TinyMCE 5 support?

Created on 14 Jul 2020  路  2Comments  路  Source: UniSharp/laravel-filemanager

Please check the following instructions before submitting a bug :

And provide the followings :

  • Operating system : Windows 10
  • Laravel version : ^7.0
  • Package version : ^2.1
  • Steps to reproduce your issue : -
  • Screenshots of browser console : -

Hi, i found this #759 and it's not working... any solution?

Most helpful comment

Not battle tested.

But try adding a file_picker_callback function like this.

`file_picker_callback: function (callback, value, meta) {
let x = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
let y = window.innerHeight|| document.documentElement.clientHeight|| document.getElementsByTagName('body')[0].clientHeight;

    let type = 'image' === meta.filetype ? 'Images' : 'Files',
        url  = '/laravel-filemanager?editor=tinymce5&type=' + type;

    tinymce.activeEditor.windowManager.openUrl({
        url : url,
        title : 'Filemanager',
        width : x * 0.8,
        height : y * 0.8,
        onMessage: (api, message) => {
            callback(message.content);
        }
    });
}`

All 2 comments

Not battle tested.

But try adding a file_picker_callback function like this.

`file_picker_callback: function (callback, value, meta) {
let x = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
let y = window.innerHeight|| document.documentElement.clientHeight|| document.getElementsByTagName('body')[0].clientHeight;

    let type = 'image' === meta.filetype ? 'Images' : 'Files',
        url  = '/laravel-filemanager?editor=tinymce5&type=' + type;

    tinymce.activeEditor.windowManager.openUrl({
        url : url,
        title : 'Filemanager',
        width : x * 0.8,
        height : y * 0.8,
        onMessage: (api, message) => {
            callback(message.content);
        }
    });
}`

thanks. it's worked

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Dzhangar1980 picture Dzhangar1980  路  4Comments

phamtien9819 picture phamtien9819  路  5Comments

lunadiotic picture lunadiotic  路  3Comments

kfulk14 picture kfulk14  路  3Comments

lukaszevo picture lukaszevo  路  4Comments