question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'url' dialogs not supported in v5 (External file managers compatibility issue)

See original GitHub issue

Hi. I’m trying the all new and shiny v5 but I’ve noticed there is some huge issue in terms of compatibility with integrations for file management that were using tinyMCE.activeEditor.windowManager.open. Most of them (if not every one of them) was simply loading html file into iframe provided by tinyMCE popup. But now with the new UI Dialog that won’t work.

So what’s the proper solution to get the same result?

I found that the new UI Dialog has an Iframe component so I thought that maybe that’s the one…but the truth is I have no idea what is the reason for this component to exists. You can’t set src and applying anything at initialData just add it as a text into body of created iframe. So the result gives similar experience to the HtmlPanel (Yup, I can even insert html this way). And even if I take the random ID of the created iframe and force src to take the URL I want I can’t do anything because of the enforced dimensions. So…what’s the point of this component? Am I missing something here?

obraz

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

9reactions
mutekellimcommented, Feb 14, 2019

It’s solved by following,

file_picker_callback: FileManager // tinymce option

function FileManager(callback, value, meta) {
        var windowManagerURL = "/FilManage";// filemanager path
 
        var windowManagerCSS = '<style type="text/css">' +
            '.tox-dialog {max-width: 100%!important; width:97.5%!important; overflow: hidden; height:95%!important; border-radius:0.25em;}' +
            '.tox-dialog__header{ display:none!important; }' +// for custom header in filemanage
            '.tox-dialog__footer { display: none!important; }' +// for custom footer in filemanage
            '.tox-dialog__body { padding: 0!important; }' +
            '.tox-dialog__body-content > div { height: 100%; overflow:hidden}' + 
            '</style > ';
        window.tinymceCallBackURL = '';
        window.tinymceWindowManager = tinymce.activeEditor.windowManager;
        tinymceWindowManager.open({
            title: '',
            body: {
                type: 'panel',
                items: [{
                    type: 'htmlpanel',
                    html: windowManagerCSS+ '<iframe src="' + windowManagerURL + '"  frameborder="0" style="width:100%; height:100%"></iframe>'
                }]
            },
            buttons: [] ,
            onClose: function () {
                if (tinymceCallBackURL!='')
                    callback(tinymceCallBackURL, {}); //to set selected file path
            } 
          
        } );
    }

//In FileManage

var windowManager = top != undefined && top.tinymceWindowManager != undefined ? top.tinymceWindowManager : '';


 if (windowManager != '') {
        if (top.tinymceCallBackURL != undefined)
            top.tinymceCallBackURL = path;
            windowManager.close();
    }
6reactions
lnewsoncommented, Apr 23, 2019

We’ve just released 5.0.4, which includes the ability to create URL dialogs again! A couple things to note however, is that we’ve moved the URL dialog functionality to it’s own API: editor.windowManager.openUrl(spec) and we’ve removed the file configuration setting as it’s been replaced by url. Please let us know if you have any further questions.

Note: The docs aren’t yet available for the URL dialogs sorry, but should be live in ~2 weeks. The docs PR @TheSpyder mentioned above though contains the details for the new API.

Read more comments on GitHub >

github_iconTop Results From Across the Web

URL dialog | Docs - TinyMCE
A URL dialog is a special TinyMCE UI component which loads an external web page inside a dialog (sometimes referred to as modals...
Read more >
Transmit 5 Release Notes - Panic
Fixed an issue that could cause Transmit to hang when the file browser was set to column view, and certain rules were set...
Read more >
Fix site display issues with Compatibility View in Internet ...
Support for Internet Explorer 11 has ended on June 15, 2022. Internet Explorer 11 will no longer be accessible after February 14, 2023....
Read more >
Access documents and other files from shared storage
To show only the types of files that your app supports, specify a MIME type. Also, you can optionally specify the URI of...
Read more >
File Manager | Mendix Documentation
The file manager widget is not supported on native mobile pages. 1 Introduction A file manager is used to upload and/or download files....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found