new WysiwygEditor($el, eventManager)wysiwygEditor.jsline 43
Class WysiwygEditor
PARAMETERS
Name Type Description $el
jQuery
element to insert editor
eventManager
EventManager
EventManager instance
Instance Methods
addKeyEventHandler(keyMap, handler)wysiwygEditor.jsline 113
Add key event handler
PARAMETERS
Name Type Description keyMap
stringArray.<string>
keyMap string or array of string
handler
function
handler
addWidget(range, node, style, offset)wysiwygEditor.jsline 931
Add widget to selection
PARAMETERS
Name Type Description range
Range
Range object
node
Node
Widget node
style
string
Adding style "over" or "bottom"
offset
[ number ]
Offset to adjust position
blur()wysiwygEditor.jsline 725
Remove focus of editor
breakToNewDefaultBlock(range, where)wysiwygEditor.jsline 966
Break line to new default block from passed range
PARAMETERS
Name Type Description range
Range
Range object
where
[ string ]
"before" or not
changeBlockFormatTo(targetTagName)wysiwygEditor.jsline 689
Change current range block format to passed tag
PARAMETERS
Name Type Description targetTagName
string
Target element tag name
findTextNodeFilter()wysiwygEditor.jsline 614
findTextNodeFilter
RETURNS:
{boolean
} - true or not
fixIMERange()wysiwygEditor.jsline 1125
get IME range
cjk composition causes wrong caret position.
it sets fixed IME composition range
focus()wysiwygEditor.jsline 710
Focus to editor
get$Body()wysiwygEditor.jsline 948
Get jQuery wrapped body container of Squire
RETURNS:
{JQuery
} - jquery body
getEditor()wysiwygEditor.jsline 901
Get squire
RETURNS:
{SquireExt
} - squire
getIMERange()wysiwygEditor.jsline 1109
get IME range
cjk composition causes wrong caret position.
it returns fixed IME composition rangeRETURNS:
{Range
}
getLinkAttribute()wysiwygEditor.jsline 787
Get attribute of link for wysiwyg
RETURNS:
{object
} - attribute - attribute of anchor tag
getRange()wysiwygEditor.jsline 1099
Get current Range object
RETURNS:
{Range
}
getTextObject(range)wysiwygEditor.jsline 1158
Get text object of current range
PARAMETERS
Name Type Description range
Range
Range object
RETURNS:
{WwTextObject
}
getValue()wysiwygEditor.jsline 826
Get value of wysiwyg editor
RETURNS:
{string
} - html
hasFormatWithRx(rx)wysiwygEditor.jsline 957
Check with given regexp whether current path has some format or not
PARAMETERS
Name Type Description rx
RegExp
Regexp
RETURNS:
{boolean
} - Match result
init(useDefaultHTMLSanitizer)wysiwygEditor.jsline 67
init
PARAMETERS
Name Type Description useDefaultHTMLSanitizer
boolean
whether to use default html sanitizer
insertText(text)wysiwygEditor.jsline 818
Insert given text to cursor position or selected area
PARAMETERS
Name Type Description text
string
text string to insert
isInTable(range)wysiwygEditor.jsline 1147
Check whether passed range is in table or not
PARAMETERS
Name Type Description range
Range
range
RETURNS:
{boolean
} - result
makeEmptyBlockCurrentSelection()wysiwygEditor.jsline 697
Make empty block to current selection
moveCursorToEnd()wysiwygEditor.jsline 1037
Set cursor position to end
moveCursorToStart()wysiwygEditor.jsline 1046
Set cursor position to start
postProcessForChange()wysiwygEditor.jsline 878
postProcessForChange
readySilentChange()wysiwygEditor.jsline 891
Ready to silent change
remove()wysiwygEditor.jsline 732
Remove wysiwyg editor
removeKeyEventHandler(keyMap, handler)wysiwygEditor.jsline 136
Remove key event handler.
PARAMETERS
Name Type Description keyMap
string
keyMap string
handler
function
handler
replaceContentText(container, from, to)wysiwygEditor.jsline 989
Replace textContet of node
PARAMETERS
Name Type Description container
Node
Container node
from
string
Target text to change
to
string
Replacement text
replaceRelativeOffset(content, offset, overwriteLength)wysiwygEditor.jsline 920
Replace content by relative offset
PARAMETERS
Name Type Description content
string
Content for change current selection
offset
number
Offset of current range
overwriteLength
number
Length to overwrite content
replaceSelection(content, range)wysiwygEditor.jsline 910
Replace text of passed range
PARAMETERS
Name Type Description content
string
Content for change current selection
range
Range
range
reset()wysiwygEditor.jsline 681
Reset wysiwyg editor
restoreSavedSelection()wysiwygEditor.jsline 674
Restore saved selection
saveSelection(range)wysiwygEditor.jsline 645
Save current selection before modification
PARAMETERS
Name Type Description range
Range
Range object
scrollIntoCursor()wysiwygEditor.jsline 1013
move scroll to cursor
scrollIntoView browser function may cause scrolling on document.
this function aims to replace scrollIntoView function to prevent that.
it will move the scroll of squire only.
scrollTop(value)wysiwygEditor.jsline 1056
Set cursor position to start
PARAMETERS
Name Type Description value
number
Scroll amount
RETURNS:
{boolean
}
setHeight(height)wysiwygEditor.jsline 744
Set editor height
PARAMETERS
Name Type Description height
numberstring
pixel of height or "auto"
setLinkAttribute(attribute)wysiwygEditor.jsline 779
Set attribute of link for wysiwyg
PARAMETERS
Name Type Description attribute
object
attribute of anchor tag
setMinHeight(minHeight)wysiwygEditor.jsline 760
Set min height
PARAMETERS
Name Type Description minHeight
number
min height in px
setPlaceholder(placeholder)wysiwygEditor.jsline 769
Set the placeholder to wysiwyg editor
PARAMETERS
Name Type Description placeholder
string
placeholder to set
setRange(range)wysiwygEditor.jsline 1138
set range
PARAMETERS
Name Type Description range
Range
range to set
setSelectionByContainerAndOffset(startContainer, startOffset, endContainer, endOffset)wysiwygEditor.jsline 661
set selection by start/end container/offset
PARAMETERS
Name Type Description startContainer
HTMLNode
start container
startOffset
Number
start offset
endContainer
HTMLNode
end container
endOffset
Number
end offset
RETURNS:
{Range
} - range instance
setValue(html, cursorToEnd)wysiwygEditor.jsline 796
Set value to wysiwyg editor
PARAMETERS
Name Type Description html
string
HTML text
cursorToEnd
boolean = true
move cursor to contents end
unwrapBlockTag(condition)wysiwygEditor.jsline 998
Unwrap Block tag of current range
PARAMETERS
Name Type Description condition
[ function ]
iterate with tagName