Skip to content

Commit

Permalink
v2.44.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JiHong88 committed Sep 22, 2022
2 parents 1f886eb + 3745f10 commit 1fd0324
Show file tree
Hide file tree
Showing 24 changed files with 250 additions and 162 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@ plugins: [
imageGallery
]
: Plugins array. default: null {Array}
// * Custom options and default options are all treated the same.
// * When using a custom plugin and a default plugin together, register as follows.
// * {custom_plugin, ...plugins}

// Values
lang : language object. default : en {Object}
Expand All @@ -396,6 +399,10 @@ textTags : You can change the tag of the default text button. default:
value : Initial value(html string) of the edit area.
If not, the value of the "target textarea". default: null {String}
historyStackDelayTime : When recording the history stack, this is the delay time(miliseconds) since the last input. default: 400 {Number}
frameAttrbutes : Specifies the properties of the editing area DIV. default: {} {Object}
ex) {
"spellcheck": false
}

// Whitelist, Blacklist -----------------------------------------------------------------------------------------
// (You can use regular expression syntax.)
Expand Down Expand Up @@ -1018,19 +1025,22 @@ editor.noticeOpen('test notice');
editor.noticeClose();

// Copies the contents of the suneditor into a [textarea]
// * not working during enabled codeView mode
editor.save();

// Gets the suneditor's context object. Contains settings, plugins, and cached element objects
editor.getContext();

// Gets the contents of the suneditor
// * not working during enabled codeView mode
// onlyContents {Boolean}: Return only the contents of the body without headers when the "fullPage" option is true
editor.getContents(onlyContents: Boolean);
// Gets the current contents with containing parent div(div.sun-editor-editable).
// <div class="sun-editor-editable">{contents}</div>
editor.getFullContents(onlyContents: Boolean);

// Gets only the text of the suneditor contents
// * not working during enabled codeView mode
editor.getText();

// Gets a list of images uploaded to the editor
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.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "suneditor",
"version": "2.43.14",
"version": "2.44.0",
"description": "Pure JavaScript based WYSIWYG web editor",
"author": "JiHong.Lee",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion sample/html/customPlugins.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="author" content="https://github.com/JiHong88" />
<meta name="keywords" content="wysiwyg,editor,javascript,suneditor,wysiwyg eidtor,rich text editor,html editor,contenteditable,위지위그 에디터 웹에디터">
<meta name="description" content="Pure javascript wysiwyg web editor" />
Expand Down
2 changes: 1 addition & 1 deletion sample/html/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="author" content="https://github.com/JiHong88" />
<meta name="keywords" content="wysiwyg,editor,javascript,suneditor,wysiwyg eidtor,rich text editor,html editor,contenteditable,위지위그 에디터 웹에디터">
<meta name="description" content="Pure javascript wysiwyg web editor" />
Expand Down
2 changes: 1 addition & 1 deletion sample/html/getting-started.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="author" content="https://github.com/JiHong88" />
<meta name="keywords" content="wysiwyg,editor,javascript,suneditor,wysiwyg eidtor,rich text editor,html editor,contenteditable,위지위그 에디터 웹에디터">
<meta name="description" content="Pure javascript wysiwyg web editor" />
Expand Down
2 changes: 1 addition & 1 deletion sample/html/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="author" content="https://github.com/JiHong88" />
<meta name="keywords" content="wysiwyg,editor,javascript,suneditor,wysiwyg eidtor,rich text editor,html editor,contenteditable,위지위그 에디터 웹에디터">
<meta name="description" content="Pure javascript wysiwyg web editor" />
Expand Down
8 changes: 5 additions & 3 deletions sample/html/out/document-editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6933506635175446" crossorigin="anonymous"></script>
<title>JSDoc: Suneditor</title>

Expand Down Expand Up @@ -2015,7 +2015,8 @@ <h5>Parameters:</h5>
<h4 class="name" id="getContents"><span class="type-signature"></span>getContents<span
class="signature">(onlyContents)</span><span class="type-signature"> &rarr; {String}</span></h4>
<div class="description">
Gets the current contents
Gets the current contents<br>
* not working during enabled codeView mode
</div>
<h5>Parameters:</h5>
<table class="params">
Expand Down Expand Up @@ -2070,7 +2071,8 @@ <h5>Parameters:</h5>
<h4 class="name" id="getText"><span class="type-signature"></span>getText<span
class="signature">()</span><span class="type-signature"> &rarr; {String}</span></h4>
<div class="description">
Gets only the text of the suneditor contents
Gets only the text of the suneditor contents<br>
* not working during enabled codeView mode
</div>
<dl class="details"></dl>

Expand Down
2 changes: 1 addition & 1 deletion sample/html/out/document-module.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6933506635175446" crossorigin="anonymous"></script>
<title>JSDoc: Suneditor</title>

Expand Down
2 changes: 1 addition & 1 deletion sample/html/out/document-user.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6933506635175446" crossorigin="anonymous"></script>
<title>JSDoc: Suneditor</title>

Expand Down
2 changes: 1 addition & 1 deletion sample/html/out/document-util.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6933506635175446" crossorigin="anonymous"></script>
<title>JSDoc: Suneditor</title>

Expand Down
2 changes: 1 addition & 1 deletion sample/html/out/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6933506635175446" crossorigin="anonymous"></script>
<title>JSDoc: Home</title>

Expand Down
2 changes: 1 addition & 1 deletion sample/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="author" content="https://github.com/JiHong88" />
<meta name="keywords" content="wysiwyg,editor,javascript,suneditor,wysiwyg eidtor,rich text editor,html editor,contenteditable,위지위그 에디터 웹에디터">
<meta name="description" content="Pure javascript wysiwyg web editor" />
Expand Down
34 changes: 20 additions & 14 deletions src/assets/css/suneditor-contents.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,17 @@
direction: rtl;
}

.sun-editor-editable .se-component > figure {
direction: initial;
}

/** controllers on tag */
.sun-editor-editable td, .sun-editor-editable th,
.sun-editor-editable figure, .sun-editor-editable figcaption, .sun-editor-editable img,
.sun-editor-editable iframe, .sun-editor-editable video, .sun-editor-editable audio {
position: relative;
}

/* float */
.sun-editor-editable .__se__float-left {
float: left;
}
.sun-editor-editable .__se__float-right {
float: right;
}
.sun-editor-editable .__se__float-center {
float: center;
}
.sun-editor-editable .__se__float-none {
float: none;
}

/** span */
.sun-editor-editable span {
display: inline;
Expand Down Expand Up @@ -364,6 +354,22 @@
-webkit-box-shadow:0 0 0 0.2rem #80bdff; box-shadow:0 0 0 0.2rem #3f9dff; transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

/* float */
.sun-editor-editable .__se__float-left {
float: left;
margin-right: 4px;
}
.sun-editor-editable .__se__float-right {
float: right;
margin-left: 4px;
}
.sun-editor-editable .__se__float-center {
float: center;
}
.sun-editor-editable .__se__float-none {
float: none;
}

/** image, video .. */
.sun-editor-editable img, .sun-editor-editable iframe, .sun-editor-editable video, .sun-editor-editable audio {
display: block;
Expand Down
18 changes: 15 additions & 3 deletions src/assets/css/suneditor.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* font color #333, background color: #fff */
/* grey color #e1e1e1 , #d1d1d1 , #c1c1c1 , #b1b1b1 */
/* blue color #c7deff , #80bdff , #3f9dff , #4592ff, #407dd1, #3288ff */
/* red color #b94a48 , #f2dede , #eed3d7 */
/* red color #b94a48 , #f2dede , #eed3d7, #d9534f */

/** --- suneditor main */
.sun-editor {width:auto; height:auto; box-sizing:border-box; font-family:Helvetica Neue; border:1px solid #dadada; background-color:#FFF; color:#000; user-select:none; -o-user-select:none; -moz-user-select:none; -khtml-user-select:none; -webkit-user-select:none; -ms-user-select:none;}
Expand Down Expand Up @@ -459,8 +459,8 @@

/** --- tooltip */
.sun-editor .se-tooltip {position:relative; overflow:visible;}
.sun-editor .se-tooltip .se-tooltip-inner {visibility:hidden; position:absolute; display:block; width:auto; top:120%; left:50%; background:transparent; opacity:0; z-index:1; line-height:1.5; transition:opacity 0.5s; margin:0; padding:0; bottom:auto; float:none; pointer-events:none; backface-visibility:hidden; -webkit-backface-visibility:hidden; -moz-backface-visibility:hidden;}
.sun-editor .se-tooltip .se-tooltip-inner .se-tooltip-text {position:relative; display:inline-block; width:auto; left:-50%; font-size:0.9em; margin:0; padding:4px 6px; border-radius:2px; background-color:#333; color:#fff; text-align:center; line-height:unset; white-space:nowrap; cursor:auto;}
.sun-editor .se-tooltip .se-tooltip-inner {visibility:hidden; position:absolute; display:block; width:auto; height:auto; top:120%; left:50%; background:transparent; opacity:0; z-index:1; line-height:1.5; transition:opacity 0.5s; margin:0; padding:0; bottom:auto; float:none; pointer-events:none; backface-visibility:hidden; -webkit-backface-visibility:hidden; -moz-backface-visibility:hidden;}
.sun-editor .se-tooltip .se-tooltip-inner .se-tooltip-text {position:relative; display:inline-block; width:auto; height:auto; left:-50%; font-size:0.9em; margin:0; padding:4px 6px; border-radius:2px; background-color:#333; color:#fff; text-align:center; line-height:unset; white-space:nowrap; cursor:auto;}
.sun-editor .se-tooltip .se-tooltip-inner .se-tooltip-text::after {content:""; position:absolute; bottom:100%; left:50%; margin-left:-5px; border-width:5px; border-style:solid; border-color:transparent transparent #333 transparent;}
.sun-editor .se-tooltip:hover .se-tooltip-inner {visibility:visible; opacity:1;}
.sun-editor .se-tooltip .se-tooltip-inner .se-tooltip-text .se-shortcut {display:block !important;}
Expand Down Expand Up @@ -501,6 +501,7 @@

/* dialog--- */
.sun-editor.se-rtl .se-dialog * {direction:rtl;}
.sun-editor.se-rtl .se-dialog .se-dialog-inner .se-dialog-form .se-video-ratio {margin-left:0; margin-right:4px;}
/* dialog - header */
.sun-editor.se-rtl .se-dialog .se-dialog-inner .se-dialog-header .se-dialog-close {float:left;}
.sun-editor.se-rtl .se-dialog .se-dialog-inner .se-dialog-header .se-modal-title {float:right;}
Expand Down Expand Up @@ -535,6 +536,17 @@
.sun-editor .se-btn-module-border.module-float-right {float:right;}


/** --- error ---------------------------------------------------------- */
.sun-editor .se-error {color:#d9534f;}
.sun-editor input.se-error:focus, select.se-error:focus, textarea.se-error:focus {
border: 1px solid #f2dede;
outline: 0;
-webkit-box-shadow: 0 0 0 0.2rem #eed3d7;
box-shadow: 0 0 0 0.2rem #eed3d7;
transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}


/** ---------------------------------------------------------- menu items style ---------------------------------------------------------- */
/** hr menu items */
.sun-editor hr.__se__solid {
Expand Down
3 changes: 2 additions & 1 deletion src/lib/constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ export default {
options.lang = options.lang || _defaultLang;
options.value = typeof options.value === 'string' ? options.value : null;
options.historyStackDelayTime = typeof options.historyStackDelayTime === 'number' ? options.historyStackDelayTime : 400;
options.frameAttrbutes = options.frameAttrbutes || {};
// tag style
options.defaultTag = typeof options.defaultTag === 'string' && options.defaultTag.length > 0 ? options.defaultTag : 'p';
const textTags = options.textTags = [{bold: 'STRONG', underline: 'U', italic: 'EM', strike: 'DEL', sub: 'SUB', sup: 'SUP'}, (options.textTags || {})].reduce(function (_default, _new) {
Expand Down Expand Up @@ -511,7 +512,7 @@ export default {
options.lineHeights = !options.lineHeights ? null : options.lineHeights;
options.paragraphStyles = !options.paragraphStyles ? null : options.paragraphStyles;
options.textStyles = !options.textStyles ? null : options.textStyles;
options.fontSizeUnit = typeof options.fontSizeUnit === 'string' ? (options.fontSizeUnit.trim() || 'px') : 'px';
options.fontSizeUnit = typeof options.fontSizeUnit === 'string' ? (options.fontSizeUnit.trim().toLowerCase() || 'px') : 'px';
options.alignItems = typeof options.alignItems === 'object' ? options.alignItems : (options.rtl ? ['right', 'center', 'left', 'justify'] : ['left', 'center', 'right', 'justify']);
/** Image */
options.imageResizing = options.imageResizing === undefined ? true : options.imageResizing;
Expand Down
Loading

0 comments on commit 1fd0324

Please sign in to comment.