suneditor
Advanced tools
Comparing version 2.36.4 to 2.36.5
@@ -6,3 +6,3 @@ { | ||
], | ||
"version": "2.36.4", | ||
"version": "2.36.5", | ||
"description": "Pure JavaScript based WYSIWYG web editor", | ||
@@ -9,0 +9,0 @@ "main": "src/suneditor.js", |
@@ -207,3 +207,3 @@ /* | ||
const isNewToolbarContainer = mergeOptions.toolbarContainer && mergeOptions.toolbarContainer !== originOptions.toolbarContainer; | ||
const isNewToolbar = mergeOptions.buttonList !== originOptions.buttonList || mergeOptions.mode !== originOptions.mode || isNewToolbarContainer; | ||
const isNewToolbar = mergeOptions.lang !== originOptions.lang || mergeOptions.buttonList !== originOptions.buttonList || mergeOptions.mode !== originOptions.mode || isNewToolbarContainer; | ||
@@ -405,27 +405,2 @@ const tool_bar = this._createToolBar(document, (isNewToolbar ? mergeOptions.buttonList : originOptions.buttonList), mergeOptions.plugins, mergeOptions); | ||
options.attributesWhitelist = (!options.attributesWhitelist || typeof options.attributesWhitelist !== 'object') ? null : options.attributesWhitelist; | ||
// @v3 | ||
// const defaultAllowStyles = { | ||
// format: ['margin-left', 'margin-right', 'text-align', 'line-height'], | ||
// rangeFormat: [], | ||
// closureRangeFormat: [], | ||
// freeFormat: [], | ||
// closureFreeFormat: [], | ||
// component: [], | ||
// span: ['font-family', 'color', 'background-color', 'font-size'] | ||
// }; | ||
// options.allowStyles = (!options.allowStyles || typeof options.allowStyles !== 'object') ? defaultAllowStyles : [defaultAllowStyles, options.allowStyles].reduce(function (_default, _new) { | ||
// for (let key in _new) { | ||
// if (!_default[key]) _default[key] = []; | ||
// const newStyle = _new[key]; | ||
// if (typeof newStyle === 'string') { | ||
// _default[key] = !newStyle ? [] : newStyle.split('|'); | ||
// } else { | ||
// for (let i = 0, len = newStyle.length, n; i < len; i++) { | ||
// n = newStyle[i]; | ||
// if (_default[key].indexOf(n) === -1) _default[key].push(n) | ||
// } | ||
// } | ||
// } | ||
// return _default; | ||
// }, {}); | ||
/** Layout */ | ||
@@ -435,2 +410,3 @@ options.mode = options.mode || 'classic'; // classic, inline, balloon, balloon-always | ||
options._editableClass = 'sun-editor-editable' + (options.rtl ? ' se-rtl' : ''); | ||
options._printClass = typeof options._printClass === 'string' ? options._printClass : null; | ||
options.toolbarWidth = options.toolbarWidth ? (util.isNumber(options.toolbarWidth) ? options.toolbarWidth + 'px' : options.toolbarWidth) : 'auto'; | ||
@@ -437,0 +413,0 @@ options.toolbarContainer = typeof options.toolbarContainer === 'string' ? document.querySelector(options.toolbarContainer) : options.toolbarContainer; |
@@ -44,16 +44,2 @@ import { Lang } from './lang/Lang'; | ||
/** | ||
* Specify the styles allowed for each format and tag. | ||
* { | ||
* format: ['margin-left', 'margin-right', 'text-align', 'line-height'], | ||
* rangeFormat: [], | ||
* closureRangeFormat: [], | ||
* freeFormat: [], | ||
* closureFreeFormat: [], | ||
* component: [], | ||
* span: ['font-family', 'color', 'background-color', 'font-size'] | ||
* } | ||
*/ | ||
// @v3 | ||
// allowStyles?: Record<string, string[]> | ||
/** | ||
* Layout | ||
@@ -503,2 +489,7 @@ * ====== | ||
icons?: Record<string, string>; | ||
/** | ||
* private options | ||
*/ | ||
_printClass?: string; | ||
} | ||
@@ -505,0 +496,0 @@ export type FormatTagName = |
@@ -126,3 +126,2 @@ /* | ||
this.context.dialog.back.style.display = 'block'; | ||
// this.context.dialog.modal.style.display = 'flex'; @v3 | ||
this.context.dialog.modal.style.display = 'block'; | ||
@@ -129,0 +128,0 @@ this.modalForm.style.display = 'block'; |
@@ -14,2 +14,6 @@ /* | ||
add: function (core, targetElement) { | ||
core.context.horizontalRule = { | ||
currentHR: null, | ||
}; | ||
/** set submenu */ | ||
@@ -57,2 +61,19 @@ let listDiv = this.setSubmenu(core); | ||
active: function (element) { | ||
if (!element) { | ||
if (this.util.hasClass(this.context.horizontalRule.currentHR, 'on')) { | ||
this.controllersOff(); | ||
} | ||
} else if (/HR/i.test(element.nodeName)) { | ||
this.context.horizontalRule.currentHR = element; | ||
if (!this.util.hasClass(element, 'on')) { | ||
this.util.addClass(element, 'on'); | ||
this.controllersOn('hr', this.util.removeClass.bind(this.util, element, 'on')); | ||
} | ||
return true; | ||
} | ||
return false; | ||
}, | ||
appendHr: function (className) { | ||
@@ -59,0 +80,0 @@ const oHr = this.util.createElement('HR'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
3623319
26352