When I select a file or an image with the roxy fileman, the file or the image doesn't appear in the editor if I don't use the keyboard in the tinymce source field. It works fine if I write a space and I delete it before clicking the "Ok" button.
The path (a good path) given by roxy fileman isn't considered by the tinymce image or link tool if a keyup event isn't triggered ! ?
Same problem in Firefox or Chrome.
PHP 5.5.9, TinyMCE 4, roxyfileman 1.4.3, Ubuntu 14.04
Is there a parameter that I don't use correctly ?
My code:
<!DOCTYPE html>
<html>
<head>
<title>Test TinyMCE</title>
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="js/tinymce/tinymce.min.js"></script>
<!-- place in header of your html document -->
</head>
<body>
<textarea id="tinymce" name="tinymce" rows="60" cols="80">
</textarea>
<script>
// This must be set to the absolute path from the site root.
var roxyFileman = '/public/fileman/index.html?integration=tinymce4';
$(function() {
tinyMCE.init({language: 'fr_FR', selector: '#tinymce', plugins: 'link image',
toolbar: "link | image", file_browser_callback: RoxyFileBrowser});
});
function RoxyFileBrowser(field_name, url, type, win) {
var cmsURL = roxyFileman; // script URL - use an absolute path!
if (cmsURL.indexOf("?") < 0) {
cmsURL = cmsURL + "?type=" + type;
}
else {
cmsURL = cmsURL + "&type=" + type;
}
cmsURL += '&input=' + field_name + '&value=' + win.document.getElementById(field_name).value;
tinyMCE.activeEditor.windowManager.open({
file: cmsURL,
title: 'Images / Fichiers',
width: 850, // Your dimensions may differ - toy around with them!
height: 650,
resizable: "yes",
plugins: "media",
inline: "yes", // This parameter only has an effect if you use the inlinepopups plugin!
close_previous: "no"
}, {
window: win,
input: field_name
});
return false;
}
</script>
</body>
</html>
Thanks for your help.
</div>
Just write down the name of editor in conf.js
right now INTEGRATION : "custom" replace it with "INTEGRATION":
For Roxy Fileman integration with CKEditor set this to "ckeditor", for TinyMCE 3.x set "tinymce3", for TinyMCE 4.x set "tinymce4". For custom implementation set "custom", then fill "FileSelected()" function located in fileman/js/custom.js - for more details see "Roxy Fileman custom integration". The default value is "custom". This setting could be overriden by sending URL parameter "integration" when openning the file browser.
It's a bug by TinyMCEs old file_browser_callback
: you need to write something behind "Text to display" in the insert link dialog, otherwise the file won't appear in the textarea. The new file_picker_callback
avoids this, because it "has the ability to update meta data inside the dialogs" (see doc).
Solution
As a workaround with the old file_browser_callback
I added a line to the source of TinyMCEs link plugin to use the filename as text if the "Text to display" is empty.
Search in the link plugin (tinymce\plugins\link\plugin.min.js
) for u.title:null};
and add this line behind it:
if(!u.text){u.text=e.split('\/').pop()};
or shorter:
u.text||(u.text=e.split("/").pop());
Explanationu.text
is the "Text to display"e
is the complete pathsplit("/").pop()
removes the path and leaves the filename