Skip to content

Commit

Permalink
2.37.1
Browse files Browse the repository at this point in the history
  • Loading branch information
JiHong88 authored Mar 18, 2021
2 parents 95b39d3 + e727a8a commit 81031af
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "suneditor",
"version": "2.37.0",
"version": "2.37.1",
"description": "Pure JavaScript based WYSIWYG web editor",
"main": "src/suneditor.js",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion dist/css/suneditor.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/suneditor.min.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"sideEffects": [
"./src/assets/css/*.css"
],
"version": "2.37.0",
"version": "2.37.1",
"description": "Pure JavaScript based WYSIWYG web editor",
"main": "src/suneditor.js",
"keywords": [
Expand Down Expand Up @@ -35,7 +35,6 @@
"node_modules",
"bower_components"
],
"dependencies": {},
"devDependencies": {
"@babel/core": "7.0.0",
"@webpack-cli/init": "^0.2.2",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/suneditor.css
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
.sun-editor .se-controller-link .link-content a {display:inline-block; color:#4592ff; max-width:200px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; vertical-align:middle; margin-left:5px;}

/* --- select list ---------------------------------------------------------- */
.sun-editor .se-select-list {position:absolute; display:none; width:auto; max-width:100%; background-color:#fff; padding:0; margin:0; border:1px solid #bababa; -webkit-box-shadow:0 3px 9px rgba(0, 0, 0, .5); box-shadow:0 3px 9px rgba(0, 0, 0, .5); outline:0 none;}
.sun-editor .se-select-list {position:absolute; top:0px; left:0px; display:none; width:auto; max-width:100%; background-color:#fff; padding:0; margin:0; border:1px solid #bababa; -webkit-box-shadow:0 3px 9px rgba(0, 0, 0, .5); box-shadow:0 3px 9px rgba(0, 0, 0, .5); outline:0 none;}
.sun-editor .se-select-list .se-select-item {line-height:28px; min-height:28px; font-size:13px; padding:0 5px; margin:2px 0; cursor:pointer;}
.sun-editor .se-select-list.__se_select-menu-mouse-move .se-select-item:hover, .sun-editor .se-select-list:not(.__se_select-menu-mouse-move) .se-select-item.active {background-color:#e1e1e1;}
.sun-editor .se-dialog-form-files .se-select-list {width:100%;}
Expand Down
8 changes: 5 additions & 3 deletions src/lib/constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,9 @@ export default {
/** Values */
options.lang = options.lang || _defaultLang;
options.defaultTag = typeof options.defaultTag === 'string' ? options.defaultTag : 'p';
const textTags = options.textTags = [{bold: 'STRONG', underline: 'U', italic: 'EM', strike: 'DEL'}, (options.textTags || {})].reduce(function (_default, _new) {
const textTags = options.textTags = [{bold: 'STRONG', underline: 'U', italic: 'EM', strike: 'DEL', sub: 'SUB', sup: 'SUP'}, (options.textTags || {})].reduce(function (_default, _new) {
for (let key in _new) {
if (util.hasOwn(_new, key)) _default[key] = _new[key];
_default[key] = _new[key];
}
return _default;
}, {});
Expand All @@ -392,7 +392,9 @@ export default {
'i': textTags.italic,
'del': textTags.strike,
'strike': textTags.strike,
's': textTags.strike
's': textTags.strike,
'sub': textTags.sub,
'sup': textTags.sup
};
options.value = typeof options.value === 'string' ? options.value : null;
options.historyStackDelayTime = typeof options.historyStackDelayTime === 'number' ? options.historyStackDelayTime : 400;
Expand Down
6 changes: 4 additions & 2 deletions src/lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -816,8 +816,10 @@ const util = {
children.push(current);
}

for (let i = 0, len = current.children.length; i < len; i++) {
recursionFunc(current.children[i]);
if (!!current.children) {
for (let i = 0, len = current.children.length; i < len; i++) {
recursionFunc(current.children[i]);
}
}
})(element);

Expand Down
6 changes: 1 addition & 5 deletions src/plugins/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Plugin } from './Plugin';

// command
import blockquote from './command/blockquote';

Expand Down Expand Up @@ -28,7 +26,5 @@ import math from './dialog/math';
// file browser
import imageGallery from './fileBrowser/imageGallery';

declare const _plugins: Plugin[];

export { blockquote, align, font, fontSize, fontColor, hiliteColor, horizontalRule, list, table, formatBlock, lineHeight, template, paragraphStyle, textStyle, link, image, video, audio, math, imageGallery };
export default _plugins;
export default { blockquote, align, font, fontSize, fontColor, hiliteColor, horizontalRule, list, table, formatBlock, lineHeight, template, paragraphStyle, textStyle, link, image, video, audio, math, imageGallery };
10 changes: 5 additions & 5 deletions src/plugins/modules/_anchor.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
*/
'use strict';

import listMenu from './_selectMenu';
import selectMenu from './_selectMenu';

export default {
name: 'anchor',
add: function (core) {
core.addModule([listMenu]);
core.addModule([selectMenu]);

core.context.anchor = {
caller: {},
Expand Down Expand Up @@ -112,7 +112,7 @@ export default {
context.downloadCheck.addEventListener('change', anchorPlugin.onChange_downloadCheck.bind(this, context));
context.anchorText.addEventListener('input', anchorPlugin.onChangeAnchorText.bind(this, context));
context.urlInput.addEventListener('input', anchorPlugin.onChangeUrlInput.bind(this, context));
context.urlInput.addEventListener('keydown', anchorPlugin.onKeyDownUrlInput.bind(this, context, listContext));
context.urlInput.addEventListener('keydown', anchorPlugin.onKeyDownUrlInput.bind(this, listContext));
context.urlInput.addEventListener('focus', anchorPlugin.onFocusUrlInput.bind(this, context, listContext));
context.urlInput.addEventListener('blur', anchorPlugin.onBlurUrlInput.bind(this, listContext));
context.bookmarkButton.addEventListener('click', anchorPlugin.onClick_bookmarkButton.bind(this, context));
Expand Down Expand Up @@ -206,7 +206,7 @@ export default {
createHeaderList: function (contextAnchor, contextList, urlValue) {
const headers = this.util.getListChildren(this.context.element.wysiwyg, function(current) {
return /h[1-6]/i.test(current.nodeName);
}.bind(this.util));
});
if (headers.length === 0) return;

const valueRegExp = new this._w.RegExp('^' + urlValue.replace(/^#/, ''), 'i');
Expand All @@ -231,7 +231,7 @@ export default {
list.style.top = (contextAnchor.urlInput.offsetHeight + 1) + 'px';
},

onKeyDownUrlInput: function (contextAnchor, contextList, e) {
onKeyDownUrlInput: function (contextList, e) {
const keyCode = e.keyCode;
switch (keyCode) {
case 38: // up
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/modules/_selectMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default {
context.clickMethod.call(this, context.items[index]);
},

moveItem(listContext, num) {
moveItem: function (listContext, num) {
this.util.removeClass(listContext.form, '__se_select-menu-mouse-move');
num = listContext.index + num;
const menus = listContext.menus;
Expand All @@ -79,7 +79,7 @@ export default {
listContext.item = listContext.items[selectIndex];
},

getItem(listContext, index) {
getItem: function (listContext, index) {
index = (!index || index < 0) ? listContext.index : index;
return listContext.items[index];
},
Expand Down

0 comments on commit 81031af

Please sign in to comment.