ElD*_*olo 5 javascript jquery tinymce
我不想tinymce
对微小的图像使用blob,因为我会将它们转换data:images
为真实图像,而img src=""
在拥有真实图像之后将替换。我如何管理它仅获取data:image
图像?可能吗?我试过了
automatic_uploads: false
Run Code Online (Sandbox Code Playgroud)
但它不会改变任何东西。
这是我的代码:
tinymce.init({
selector: strSelector + "textarea:not(#strDescription)",
paste_data_images: true,
image_advtab: true,
mode: "specific_textareas",
editor_selector: "mceEditor",
automatic_uploads: false,
file_picker_callback: function(callback, value, meta) {
if (meta.filetype == 'image') {
$('#upload').trigger('click');
$('#upload').on('change', function() {
var file = this.files[0];
var reader = new FileReader();
reader.onload = function(e) {
callback(e.target.result, {
alt: ''
});
};
reader.readAsDataURL(file);
});
}
},
plugins: [
"advlist autolink lists link image imagetools charmap preview anchor code",
"searchreplace visualblocks code fullscreen",
"insertdatetime table contextmenu paste imagetools"
],
setup: function(editor) {
editor.on('change', function() {
editor.save();
});
}
});
Run Code Online (Sandbox Code Playgroud)
Blob conversion can be disabled by adding the filter below:
TinyMCE docs: images_dataimg_filter
tinymce.init({
images_dataimg_filter: function(img) {
return img.hasAttribute('internal-blob');
}
});
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1190 次 |
最近记录: |