- KE
Global variable/namespace.
Type:Object - KE.version
Editor version.
Type:String - KE.lang
Language information.
Type Object - KE.scriptPath
Path of kindeditor.js.
Type:String - KE.browser
Browser type/version information. KE.browser.VERSION, KE.browser.IE, KE.browser.WEBKIT, KE.browser.GECKO, KE.browser.OPERA
Type:Object - KE.setting
Editor configuration information.
Type:Object - KE.g
Colloction of editor variables, including all attributes defined here , as well as the following variables. These variables can be access by KE.g[id].
For example:KE.g["content_1"].iframeDoc is editor(with id "content_1") iframe document object.
Type:Object
Member Variables:- container: Editor parent element.
- iframe: Editor iframe object.
- iframeWin: Window object of editor iframe.
- iframeDoc: Document object of editor iframe.
- keSel: Current KE.selection object.
- keRange: Current KE.range object.
- sel: Current browser selection object.
- range: Current browser range object.
- hideDiv: Parent div object of popup dialog.
- yesButton: [Yes] button of popup dialog.
- noButton: [No] button of pouup dialog.
- previewButton: [Preview] button of pouup dialog.
- maskDiv: Gray mask(div) for popup dialog.
- undoStack: Undo records.
- redoStack: Redo records.
- KE.plugin
Plugins loaded.
Type:Object - KE.$(id, doc)
To get element by id. Equal to doc.getElementById.
Parameters
id:String. Id of element.
doc:Object, document object where element is at. Optional, document by default
return:
Object,element object - KE.$$(name, doc)
Create element object, Equal to doc.createElement.
Parameters
name:String,element tag name
doc:Object,document object where element is at. Optional, document by default.
return:
Object,element object - KE.event.add(el, event, listener)
Add event listener to an element.
Parameters
el:Object, listener to be added to.
event:String, event type, for example, "click","change","mousedown".
listener:Function, event handler.
return:none - KE.event.remove(el, event, listener)
Remove event listener from an element.
Parameters
el:Object, listener to be removed from.
event:String,event type, for example, "click","change","mousedown".
listener:Function, event handler.
return:none - KE.event.input(el, func)
Add listener for end user inputting.
Parameters
el:Object, listener to be added to.
func:Function, event handler for user inputting.
return:none - KE.event.ctrl(el, key, func)
Add event listener for Ctrl+[?] event.
Parameters
el:Object,listener to be added to.
key:String, alpha from A to Z.
func:Function,event handler.
return:none - KE.event.ready(func)
Add event listener for DOMContentLoaded of document or equivalence.
Parameters
func:Function, event handler.
return:none - KE.each(obj, func)
Go through all the members of an object, and apply func to these memebers.
Parameters
obj:Object, object to go through
func:Function, function applied to members. Parameters are key/value.
return:none - KE.eachNode(node, func)
Go through all the children of a node.
Parameters
node:Object, parent node to go through
func:Function, function applied to children. Paramter is node(children node)
return:none - KE.format.getHtml(html, htmlTags)
Convert HTML to XHTML. When htmlTags is specified, those not defined in htmlTags will be ignored.
Parameters
html:String. HTML to be convert.
htmlTags:Object. Filter criteria, optional.
return:
String,XHTML string. - KE.util.getDocumentElement()
Get document element object.
Parameters:none
return:
Object,element object - KE.util.getDocumentWidth()
Get width of current page.
Parameters:none
return:
Int,document width, in pixel. - KE.util.getDocumentHeight()
Get height of current page.
Parameters:none
return:
Int,document height. - KE.util.loadStyle(path)
Load a css file into current page.
Parameters
path:String. URL of css.
return:none - KE.util.inArray(str, arr)
Determine if string exists in an array.
Parameters
str:String
arr:Array
return:
Boolean, true for existing. - KE.util.trim(str)
This function returns a string with whitespace stripped from the beginning and end of str.
Parameters
str:String
return:String - KE.util.getJsKey(key)
Convert css attributes in CSS to JavaScript class member name. For example, KE.util.getJsKey("font-size") will return "fontSize".
Parameters
key:String
return:String - KE.util.escape(html)
Escape special character in HTML string.
Parameters
html:String,HTML string.
return:String - KE.util.getElementPos(el)
Get cordinate of an element.
Parameters
el:Object,element object
return:Object - KE.util.getCoords(ev)
Get cursor coordination.
Parameters
ev:Object, event object
return:Object - KE.util.setOpacity(el, opacity)
Set element opacity.
Parameters
el:Object,element
opacity:Int. Opacity index, range from 0 ot 100.
return:none - KE.util.getIframeDoc(iframe)
Get iframe document object.
Parameters
iframe:Object,iframe
return:Object - KE.util.rgbToHex(str)
Convert RGB color formate to Hex formate.
Parameters
str:String,RGB color.
return:String - KE.util.createRange(doc)
Create range for doc.
Parameters
doc:Object,document object
return:Object,range object - KE.util.getFullHtml(id, tagLineMode)
Get initial html text from editor's iframe.
Parameters
id:String. Editor id.
tagLineMode:Boolean,true for displaying tag's outline.
return:String - KE.util.getData(id)
Get HTML from editor.
Parameters
id:String. Editor id.
return:String - KE.util.getSrcData(id)
Get raw HTML from editor. That equals to innerHTML of editor's iframe.
Parameters
id:String. Editor id.
return:String - KE.util.getPureData(id)
Get text from editor without html tag.
Parameters
id:String. Editor id.
return:String - KE.util.setData(id)
Fill TEXTAREA with html generated by editor.
Parameters
id:String. Editor id.
return:none - KE.util.focus(id)
Let editor get focus.
Parameters
id:String, editor id.
return:none - KE.util.selection(id)
Save current selection to KE.g[id].sel,KE.g[id].range,KE.g[id].keSel,KE.g[id].keRange.
Parameters
id:String,ID of editor.
return:none - KE.util.select(id)
Select an range, for IE only.
Parameters
id:String, editor id.
return:none - KE.util.execCommand(id, cmd, value)
Execute browser command. See API of document.execCommand for different browser.
Parameters
id:String, id of editor.
cmd:String, same as execCommand of browser.
value:String, same as execCommand of browser.
return:none - KE.util.insertHtml(id, html)
Insert HTML to current cursor.
Parameters
id:String. Id of editor
html:String. HTML to be inserted.
return:none
KE.util.selection(id) must be called before this function is called, because KE.g[id].sel and KE.g[id].range need to be set. - KE.create(id, mode)
Create an editor.
Parameters
id:String. Id of editor.
mode:Int. Optional. 1 for creating editor at the end of body section. 0 or default for creating editor in front of TEXTAREA.
return:none - KE.remove(id, mode)
Remove editor.
Parameters
id:String. Editor id.
mode:Int. Optional. 1 for removing editor at the end of body section. 0 or default for removing editor in front of TEXTAREA.
return:none - KE.init(config)
Set configuration for initialization.
Parameters
config:Object. Editor attributes. See attributes for more.
return:none - KE.show(config)
Create and show editor up. This function will call KE.init first. When dom is loaded, KE.create will be call to show editor.
Parameters
config:Object. Editor attributes. See attributes for more.
return:none - KE.selection(win, doc)
KindEditor selection class for get/set current range.
Parameters
win:Object,window object
doc:Object,document object
Member properties:- sel:Object. Browser selection object of current selection.
- range:Object. Browser range object of current selection.
- keRange:Object. KindEditor range object of current selection. See KE.range for more.
- addRange(keRange): Set current selection.
- focus(): Reselect. IE supported only.
- KE.range(doc)
Universal range class for different types of browsers.
Parameters
doc:Object,document object
Member properties:- startNode:Object. Start node.
- startPos:Int. Position of start node.
- endNode:Object. End node.
- endPos:Int. Position of end node.
- getParentElement(): Get direct paren node that holds range.
- getNodeList(): Get node list within range.
- comparePoints(how, range): Compare with opsition of another range. Parameter how could be "START_TO_START", "START_TO_END", "END_TO_START","END_TO_END".
- setStart(node, pos): Set start point of range.
- setEnd(node, pos):Set end point of range.
- selectNode(node):Set one node as range's start point and end point.
- extractContents():Extract content form range.
- cloneContents():Copy content of range.
- getText():Get text from range.
- KE.cmd(id)
KindEditor command class.
Parameters
id:String. Editor id.
Member properties:- doc:Object. Document of editor iframe.
- keSel:Int. Kind editor selection object
- keRange:Object. KindEditor range object of current selection
- wrap(tagName, attributes): Wrap current selection with given tagName. Inline tag supported only. Parameter tagName is tag name. Parameter attributes is a attribute array for tagName.
- remove(tags): Remove tags from current selection.
Variables
Functions
Classes