当我使用roxy fileman选择文件或图像时,如果我不使用tinymce source字段中的键盘,则该文件或图像不会出现在编辑器中。如果我写一个空格,然后在点击"确定"按钮之前删除它,它会很好。
如果没有触发keyup事件,则timeymce图像或链接工具不会考虑由roxy fileman给出的路径(一个好路径)!
?在Firefox或Chrome中也有同样的问题。
PHP 5.5.9, TinyMCE 4, roxyfileman 1.4.3, Ubuntu 14.04
是否有我没有正确使用的参数?
我代码:<!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>
谢谢你的帮助。
只需在conf.js中写下编辑器的名称
现在集成:"custom"替换为"INTEGRATION":
对于Roxy Fileman与CKEditor的集成,将其设置为"CKEditor",对于TinyMCE 3。对于tinymce4,设置"tinymce3"。X设置"tinymce4"。对于自定义实现设置"custom",然后填充fileman/js/custom.js中的"FileSelected()"函数-更多详细信息请参见"Roxy fileman自定义集成"。默认值为"custom"。当打开文件浏览器时,可以通过发送URL参数"integration"来覆盖此设置。
这是TinyMCEs旧file_browser_callback
的一个错误:您需要在插入链接对话框中的"文本显示"后面写一些东西,否则文件将不会出现在文本区。新的file_picker_callback
避免了这种情况,因为它"有能力更新对话框中的元数据"(见文档)。
作为旧
file_browser_callback
的解决方案,我在TinyMCEs链接插件的源代码中添加了一行,如果"要显示的文本"为空,则使用文件名作为文本。
在链接插件(tinymce'plugins'link'plugin.min.js
)中搜索u.title:null};
,并在其后面添加以下行:
if(!u.text){u.text=e.split(''/').pop()};
或短:
u.text||(u.text=e.split("/").pop());
u.text
是"Text to display"e
是完整路径split("/").pop()
删除路径并留下文件名