Wiki, , : https://github.com/Studio-42/elFinder/wiki/Integration-with-TinyMCE-4.x
, TinyMCE InlinePopup, , file_browser_callback : 'elFinderBrowser' :
TinyMCE init:
file_browser_callback : elFinderBrowser
elFinderBrowser javascript:
function elFinderBrowser (field_name, url, type, win) {
tinymce.activeEditor.windowManager.open({
file: '/elfinder/elfinder.html',
title: 'elFinder 2.0',
width: 900,
height: 450,
resizable: 'yes'
}, {
setUrl: function (url) {
win.document.getElementById(field_name).value = url;
}
});
return false;
}
, , / elfinder.html :
<script type="text/javascript">
var FileBrowserDialogue = {
init: function() {
},
mySubmit: function (URL) {
top.tinymce.activeEditor.windowManager.getParams().setUrl(URL);
top.tinymce.activeEditor.windowManager.close();
}
}
$().ready(function() {
var elf = $('#elfinder').elfinder({
url: 'php/connector.php',
getFileCallback: function(file) {
FileBrowserDialogue.mySubmit(file.url);
}
}).elfinder('instance');
});
</script>