我有一个带有多个tinymce编辑器(textarea)的php页面,它具有相同的classname和seperate id。我的问题是图像上传图标仅显示在最后一个编辑器上,但不显示在上面的编辑器中。我正在使用tinymce版本4.7.2。 这是我需要显示的图片上传按钮:
Here is the full image of my php page
请帮我解决这个问题。
答案 0 :(得分:0)
file_picker_callback将解决上述问题。有关参考,请参阅此链接http://www.responsivefilemanager.com/demo.php
tinymce.init({ selector:" textarea#content,textarea#details",theme:" modern",width:500,height:200, 插件:[ " advlist autolink链接图像列表charmap打印预览hr anchor pagebreak", " searchreplace wordcount visualblocks visualchars insertdatetime media nonbreaking", "表格contextmenu方向性表情符号粘贴textcolor responsivefilemanager代码" ] toolbar1:"撤消重做|粗斜体下划线| alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect&#34 ;, toolbar2:" | responsivefilemanager |链接取消链接锚点|图像媒体| forecolor backcolor |打印预览代码", image_advtab:是的, file_picker_types:'文件图片媒体', 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 (宽度> 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&#34 ;; if(typeof this.settings.filemanager_title!==& #34; undefined"&& this.settings.filemanager_title){title = this.settings.filemanager_title;} var akey =" key&#34 ;; if(typeof this.settings.filemanager_access_key!== " undefined"&& this.settings.filemanager_access_key){akey = this.settings.filemanager_access_key;} var sort_by ="&#34 ;; 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& #34 ;; if(typeof this.settings.filemanager_descending!= =" undefined"&& this.settings.filemanager_descending){descending = this.settings.filemanager_descending;} var fldr ="&#34 ;; if(typeof this.settings.filemanager_subfolder! ==" undefined"&& this.settings.filemanager_subfolder){fldr ="& fldr =" + this.settings.filemanager_subfolder;} var crossdomain =" &#34 ;; if(typeof this.settings.filemanager_crossdomain!==" undefined"&& this.settings.filemanager_crossdomain){crossdomain ="& crossdomain = 1&#34 ;;如果(window.addEventListener){window.addEventListener('消息',filemanager_onMessage,FALSE);}其他{window.attachEvent('的onMessage',filemanager_onMessage);}} tinymce.activeEditor。 windowManager.open({标题:标题,文件:this.settings.external_filemanager_path +' dialog.php类型=&#39 + + urltype'&安培;降=&#39 + +降序sort_by + FLDR +跨域+'&安培; LANG =&#39 + + this.settings.language'&安培; A密钥=' + A密钥,宽度:宽度,高度:身高,可调整大小:真,最大化:真正的,内联: 1},{setUrl:功能(URL){CB(URL);}});}, external_filemanager_path:"文件管理器/&#34 ;, filemanager_title:"响应式文件管理器" , object_resizing:false, external_plugins:{" filemanager" :" ../../../ filemanager / plugin.min.js"} });
答案 1 :(得分:0)
为什么不将responsivefilemanager添加到工具栏,然后就不需要图像
TinymceModule.withConfig({
plugins: ['link image code responsivefilemanager'],
toolbar: 'responsivefilemanager',
menubar: false,
external_filemanager_path: '.../filemanager/',
filemanager_title: 'Content Server',
filemanager_crossdomain: true,
external_plugins: {"filemanager": ".../filemanager/plugin.min.js" }
})