|
@@ -20,7 +20,7 @@ import axios from 'axios';
|
|
// import tinymceCDN from '@/assets/tinymce.min.js'
|
|
// import tinymceCDN from '@/assets/tinymce.min.js'
|
|
|
|
|
|
// why use this cdn, detail see https://github.com/PanJiaChen/tinymce-all-in-one
|
|
// why use this cdn, detail see https://github.com/PanJiaChen/tinymce-all-in-one
|
|
-const tinymceCDN = 'https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.5/tinymce.min.js'
|
|
|
|
|
|
+const tinymceCDN = 'https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'Tinymce',
|
|
name: 'Tinymce',
|
|
@@ -135,15 +135,16 @@ export default {
|
|
height: this.height,
|
|
height: this.height,
|
|
body_class: 'panel-body',
|
|
body_class: 'panel-body',
|
|
object_resizing: true,
|
|
object_resizing: true,
|
|
|
|
+ // extended_valid_elements: 'img[style|class|src|border|alt|title|hspace|vspace|width|height|align|name|loading]',
|
|
toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar,
|
|
toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar,
|
|
menubar: this.menubar,
|
|
menubar: this.menubar,
|
|
plugins: plugins,
|
|
plugins: plugins,
|
|
- content_css : "tinymce.css",
|
|
|
|
|
|
+ // content_css : "tinymce.css",
|
|
entity_encoding : "raw",
|
|
entity_encoding : "raw",
|
|
remove_linebreaks : false,
|
|
remove_linebreaks : false,
|
|
forced_root_block: false,
|
|
forced_root_block: false,
|
|
force_br_newlines: true,
|
|
force_br_newlines: true,
|
|
- invalid_elements : "p, div, span",
|
|
|
|
|
|
+ // invalid_elements : "p, div, span",
|
|
imagetools_toolbar: 'editimage',
|
|
imagetools_toolbar: 'editimage',
|
|
end_container_on_empty_block: true,
|
|
end_container_on_empty_block: true,
|
|
powerpaste_word_import: 'clean',
|
|
powerpaste_word_import: 'clean',
|
|
@@ -160,7 +161,11 @@ export default {
|
|
// cellspacing:"0",
|
|
// cellspacing:"0",
|
|
// cellpadding:"0"
|
|
// cellpadding:"0"
|
|
// },
|
|
// },
|
|
|
|
+ automatic_uploads: false,
|
|
|
|
+ remove_linebreaks: false,
|
|
link_title: true,
|
|
link_title: true,
|
|
|
|
+ relative_urls: false,
|
|
|
|
+ paste_data_images: false,
|
|
nonbreaking_force_tab: true, // inserting nonbreaking space need Nonbreaking Space Plugin
|
|
nonbreaking_force_tab: true, // inserting nonbreaking space need Nonbreaking Space Plugin
|
|
init_instance_callback: editor => {
|
|
init_instance_callback: editor => {
|
|
if (_this.value) {
|
|
if (_this.value) {
|
|
@@ -186,8 +191,8 @@ export default {
|
|
// it will try to keep these URLs intact
|
|
// it will try to keep these URLs intact
|
|
// https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@convert_urls/
|
|
// https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@convert_urls/
|
|
// https://stackoverflow.com/questions/5196205/disable-tinymce-absolute-to-relative-url-conversions
|
|
// https://stackoverflow.com/questions/5196205/disable-tinymce-absolute-to-relative-url-conversions
|
|
- convert_urls: true,
|
|
|
|
- automatic_uploads: true
|
|
|
|
|
|
+ // convert_urls: true,
|
|
|
|
+ // automatic_uploads: true
|
|
// 整合七牛上传
|
|
// 整合七牛上传
|
|
// images_upload_handler(blobInfo, success, failure, progress) {
|
|
// images_upload_handler(blobInfo, success, failure, progress) {
|
|
// console.log("images_upload_handler" )
|
|
// console.log("images_upload_handler" )
|
|
@@ -227,7 +232,7 @@ export default {
|
|
// 上传图片
|
|
// 上传图片
|
|
axios.post(this.uploadUrl, formData, { headers: this.headers }).then(res => {
|
|
axios.post(this.uploadUrl, formData, { headers: this.headers }).then(res => {
|
|
if (res.data.code === 200) {
|
|
if (res.data.code === 200) {
|
|
- window.tinymce.get(this.tinymceId).insertContent(`<img style="width:100%" src="http://smoa.ndjsxh.cn:8888/api/preview/${res.data.data.filename}" >`)
|
|
|
|
|
|
+ window.tinymce.get(this.tinymceId).insertContent(`<img style="width:100%" src="http://smoa.ndjsxh.cn:8888/preview/${res.data.data.filename}" >`)
|
|
} else {
|
|
} else {
|
|
this.$message.error('图片上传失败,联系开发人员')
|
|
this.$message.error('图片上传失败,联系开发人员')
|
|
}
|
|
}
|