我不能集成tinymce编辑器和kcfinder web文件管理器。
编辑器加载正常,我可以从kcfinder上传、浏览和重命名图像。
但是当我想选择图像时什么都没有发生,url没有设置在字段上。我无法选择图像。
控制台日志中没有错误。
编辑:

当我选择image时没有任何反应:

版本Tinymce 4.9.6 Kcfinder 3.12
HTML代码
<!doctype html>
<html lang='es' >
<head>
<meta charset="utf-8">
<script src="./js/tinymce/tinymce.min.js"></script>
<script src="./js/default_tinymce.js"></script>
</head>
<body>
<form method="post" action="content-edit.php">
<textarea name="content" class="tinymce"></textarea><br>
<input type="submit">
</form>
</body>
</html>javascript js/default_tiymce.js
tinymce.init({
selector:'.tinymce',
convert_urls: false, // default 1
remove_script_host: false, // default 1
browser_spellcheck: true,
plugins: [
"advlist autolink lists link image charmap print preview anchor",
"searchreplace visualblocks code fullscreen",
"insertdatetime media table contextmenu paste",
"emoticons template paste textcolor colorpicker textpattern imagetools"
],
file_picker_callback: function(field, url, type, win) {
tinyMCE.activeEditor.windowManager.open({
file: './kcfinder/browse.php?opener=tinymce&field=' + field + '&type=' + type,
title: 'Kcfinder',
width: 700,
height: 500,
inline: true,
close_previous: false
}, {
window: win,
input: field
});
return false;
},
toolbar: "insertfile undo redo | styleselect | forecolor backcolor emoticons | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image ",
paste_data_images: true
});预期结果:当双击图像时,它应该被选中,并用图像url填充字段。
实际结果:双击图像时没有任何反应。
请帮帮我!
发布于 2019-09-28 01:54:01
好了,我终于找到了解决方案,我把tinymce集成代码替换为
javascript js/default_tiymce.js
this:tinymce.init(
{
selector:'textarea',
menubar: false,
plugins: [
"advlist autolink lists link image charmap print preview anchor",
"searchreplace visualblocks code fullscreen",
"insertdatetime media table contextmenu paste"
],
toolbar: "undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image ",
file_browser_callback: function(field, url, type, win) {
tinyMCE.activeEditor.windowManager.open({
file: './kcfinder/browse.php?opener=tinymce4&field=' + field + '&type=' + type,
title: 'KCFinder',
width: 700,
height: 500,
inline: true,
close_previous: false
}, {
window: win,
input: field
});
return false;
}
});希望它能帮助其他人
https://stackoverflow.com/questions/58124946
复制相似问题