Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using multiple instancef of TinyMCE filemanager avilable only on last instance (since TinyMce 4.6.0) #357

Closed
kociou opened this issue May 17, 2017 · 18 comments

Comments

@kociou
Copy link

kociou commented May 17, 2017

<script>
//first instance
tinymce.init({
        "theme": "modern",
        "plugins": ["advlist autolink lists link image charmap print preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars code fullscreen", "insertdatetime media nonbreaking save table contextmenu directionality", "template paste textcolor"],
        "toolbar1": "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | media | forecolor backcolor code",
        "toolbar2": false,
        "image_advtab": true,
        "height": "450",
        "statusbar": false,
        "external_filemanager_path": "/static-local/filemanager/",
        "filemanager_title": "Manager",
        "external_plugins": {
            "filemanager": "/static-local/filemanager/plugin.min.js"
        },
        "extended_valid_elements": "blockquote[class,style],a[class|name|href|target|title|onclick|rel],script[type|src],iframe[src|style|width|height|scrolling|marginwidth|marginheight|frameborder|class],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]",
        "browser_spellcheck": true,
        "contextmenu": false,
        "selector": "#text_pl-PL",
        "language_url": "/static-local/assets/6a5e4690/langs/pl.js",
        "language": "pl"
    });


//secound instance
    tinymce.init({
        "theme": "modern",
        "plugins": ["advlist autolink lists link image charmap print preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars code fullscreen", "insertdatetime media nonbreaking save table contextmenu directionality", "template paste textcolor"],
        "toolbar1": "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | media | forecolor backcolor code",
        "toolbar2": false,
        "image_advtab": true,
        "height": "450",
        "statusbar": false,
        "external_filemanager_path": "/static-local/filemanager/",
        "filemanager_title": "Manager",
        "external_plugins": {
            "filemanager": "/static-local/filemanager/plugin.min.js"
        },
        "extended_valid_elements": "blockquote[class,style],a[class|name|href|target|title|onclick|rel],script[type|src],iframe[src|style|width|height|scrolling|marginwidth|marginheight|frameborder|class],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]",
        "browser_spellcheck": true,
        "contextmenu": false,
        "selector": "#text_en-US",
        "language_url": "/static-local/assets/6a5e4690/langs/pl.js",
        "language": "pl"
    });
</script>
@kociou kociou changed the title When using multiple instancef of TinyMCE filemanager avilable only on last instance (since TinyMce 4.6.0) 9.11.3 - When using multiple instancef of TinyMCE filemanager avilable only on last instance (since TinyMce 4.6.0) May 17, 2017
@MichalSchwarz
Copy link

I have the same problem.

@perezdans
Copy link

Yes, me too.

@Fridus
Copy link

Fridus commented Jun 22, 2017

Same problem !

@Fridus
Copy link

Fridus commented Jun 22, 2017

@trippo Could you quickly fix this ? 🙏

@gulaandrij
Copy link

same

@trippo
Copy link
Owner

trippo commented Jun 23, 2017

Hi is a problem of tinymce i think they are envious of my filemanager...
I'm investigating... but you can use the responsivefilemananger plugin
schermata 2017-06-23 alle 12 16 25

@trippo
Copy link
Owner

trippo commented Jun 23, 2017

Please also you write to tinymce support to have a reply @gulaandrij @Fridus @perezdans @MichalSchwarz @kociou

@trippo
Copy link
Owner

trippo commented Jun 23, 2017

I found a solution... you can include the filemanager call inside new api file_picker

example of tinymce init options:

filemanager_title:"Responsive Filemanager",
external_filemanager_path:"/filemanager/",
file_picker_types: 'file image media',
file_picker_callback: function(cb, value, meta) {
var width = window.innerWidth-30;
var height = window.innerHeight-60;
if(width > 1800) width=1800;
if(height > 1200) height=1200;
if(width>600){
var width_reduce = (width - 20) % 138;
width = width - width_reduce + 10;
}
var urltype=2;
if (meta.filetype=='image') { urltype=1; }
if (meta.filetype=='media') { urltype=3; }
var title="RESPONSIVE FileManager";
if (typeof this.settings.filemanager_title !== "undefined" && this.settings.filemanager_title) {
title=this.settings.filemanager_title;
}
var akey="key";
if (typeof this.settings.filemanager_access_key !== "undefined" && this.settings.filemanager_access_key) {
akey=this.settings.filemanager_access_key;
}
var sort_by="";
if (typeof this.settings.filemanager_sort_by !== "undefined" && this.settings.filemanager_sort_by) {
sort_by="&sort_by="+this.settings.filemanager_sort_by;
}
var descending="false";
if (typeof this.settings.filemanager_descending !== "undefined" && this.settings.filemanager_descending) {
descending=this.settings.filemanager_descending;
}
var fldr="";
if (typeof this.settings.filemanager_subfolder !== "undefined" && this.settings.filemanager_subfolder) {
fldr="&fldr="+this.settings.filemanager_subfolder;
}
var crossdomain="";
if (typeof this.settings.filemanager_crossdomain !== "undefined" && this.settings.filemanager_crossdomain) {
crossdomain="&crossdomain=1";
// Add handler for a message from ResponsiveFilemanager
if(window.addEventListener){
window.addEventListener('message', filemanager_onMessage, false);
} else {
window.attachEvent('onmessage', filemanager_onMessage);
}
}
tinymce.activeEditor.windowManager.open({
title: title,
file: this.settings.external_filemanager_path+'dialog.php?type='+urltype+'&descending='+descending+sort_by+fldr+crossdomain+'&lang='+this.settings.language+'&akey='+akey,
width: width,
height: height,
resizable: true,
maximizable: true,
inline: 1
}, {
setUrl: function (url) {
cb(url);
}
});
},

@TomTheRock
Copy link

TomTheRock commented Jun 23, 2017

I had the same problem, i downgrade to tinymce 4.5.7 now it worked as in the past. But anybody have a solution with the new version. I cant find the documentation for the api method on tinymce website....eyesroll

Maybe this? =>
https://www.tinymce.com/docs/api/tinymce/tinymce.plugin/

@defender11
Copy link

TomTheRock: Can you write how you got (code)?

@defender11
Copy link

TomTheRock: Where did you find tinyMce 4.5.7? (site)

@Fridus
Copy link

Fridus commented Jun 23, 2017

@defender11
Copy link

@Fridus Thanks man!

@TomTheRock
Copy link

You can always find later releases here: https://www.tinymce.com/download/older-releases/

@defender11
Copy link

@TomTheRock I did`t know this, thank you man!

@TomTheRock
Copy link

Bug is postet on git (tinymce)
tinymce/tinymce#3764

@labby
Copy link

labby commented Aug 15, 2017

This solution works for us inside LEPTON-CMS:
place following code inside tinymce.init({:
file_browser_callback: function(fieldName, url, objectType, w) { filemanager(fieldName, url, objectType, w); },
Hope this will also help others...

@YannikFirre
Copy link

#357 (comment) work with second instance but not the first.

#357 (comment) work with all instance.

@trippo trippo closed this as completed Oct 4, 2017
@trippo trippo changed the title 9.11.3 - When using multiple instancef of TinyMCE filemanager avilable only on last instance (since TinyMce 4.6.0) When using multiple instancef of TinyMCE filemanager avilable only on last instance (since TinyMce 4.6.0) Oct 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants