The use of the Kindeditor editor is mentioned in the Kindeditor-kindeditor introduction, and the editor can be added to the document by using the Ke.show (config) method. The following is a section of source code:
Ke.show = function (args) {
Ke.init (args);
KE.event.ready (function () {ke.create (args.id);});
};
From the source you can see that there are two ways to use the editor:
Method One: ke.show (config);
Method Two: Ke.init (config); Ke.create (ID);
Regardless of the way you use the Kindeditor editor, you must configure the parameters;
Configuration parameter config can be passed in the Ke.show () and Ke.init () methods;
Configuration parameter config is an object that generally uses a literal object;
Where the ID parameter is the only one that must be configured, the other parameters can be omitted.
Parameter setup Example
Ke.show ({
ID: "Content_1",
Width: "70%",//editor widths 70%
Height: "200px",//editor height is 100px
Filtermode:false,//does not filter HTML code
Resizemode:1//Editor can only adjust height
});
Configuration parameters
1, ID
TextArea the ID of the input box must be set.
Data type: String
2, items
The toolbar of the configuration editor, where "-" indicates a line break, and "" denotes a separator.
Data type: Array
Default value:
[' Source ', ', ' Fullscreen ', ' undo ', ' Redo ', ' print ', ' cut ', ' copy ', ' Paste ',
' Plainpaste ', ' wordpaste ', ', ' ' justifyleft ', ' justifycenter ', ' justifyright ',
' Justifyfull ', ' insertorderedlist ', ' insertunorderedlist ', ' Indent ', ' outdent ', ' subscript ',
' Superscript ', ', ' SelectAll ', '-',
' title ', ' FontName ', ' fontsize ', ', ' textcolor ', ' bgcolor ', ' bold ',
' Italic ', ' underline ', ' strikethrough ', ' Removeformat ', ', ' ' image ',
' Flash ', ' media ', ' advtable ', ' hr ', ' emoticons ', ' link ', ' unlink ', ', ' about '
3, Width
The width of the editor, you can set PX or%, higher precedence than the TEXTAREA input box style sheet width.
Data type: String
Default value: TextArea the width of the input box
Note: Version 3.2 begins to support.
4, Height
The height of the editor, you can only set PX, higher than the TextArea input box style sheet high priority.
Data type: String
Default value: TextArea the height of the input box
Note: Version 3.2 begins to support.
5, MinWidth
Data type: Int
Specifies the minimum width of the editor, in PX.
Default value: 200
6, MinHeight
Data type: Int
Specifies the minimum height of the editor, in PX.
Default value: 100
7, FilterMode
Data type: Boolean
True to filter HTML code, false to allow any code to be entered.
Default value: False
Note: The default value of FilterMode for previous versions of 3.4 is true.
8, Htmltags
Specifies the HTML tags and attributes to retain. The key of the hash array is the HTML tag name, the value is an array of HTML attributes, "." The starting property represents the Style property.
Data type: Object
Default value:
{
Font: [' Color ', ' size ', ' face ', '. Background-color '],