logo

/repo|v2.5.0

Class

new CodeMirrorExt(el, options)codeMirrorExt.jsline 19

Class CodeMirrorExt

PARAMETERS
NameTypeDescription

el

HTMLElement

container jquery element

options

Object = {}

codeMirror options

Instance Methods

addWidget(selection, node, style, offset)codeMirrorExt.jsline 149

Add widget

PARAMETERS
NameTypeDescription

selection

object

Selection object

node

HTMLElement

Widget node

style

string

Adding style "over" or "bottom"

offset

number

Adding offset

blur()codeMirrorExt.jsline 86

blur focus to current Editor

focus()codeMirrorExt.jsline 79

Set focus to current Editor

getCaretPosition()codeMirrorExt.jsline 138

Get current caret position

RETURNS:
{

Object

}

getCurrentRange()codeMirrorExt.jsline 65

getCurrentRange

RETURNS:
{

Object

} - selection range

getCursor(start)codeMirrorExt.jsline 236

get code mirror cursor

PARAMETERS
NameTypeDescription

start

string = 'head'

which end of the selection. 'from'|'to'|'head'|'anchor'

RETURNS:
{

Cursor

} - code mirror cursor

getEditor()codeMirrorExt.jsline 123

Get CodeMirror instance

RETURNS:
{

CodeMirror

}

getRange()codeMirrorExt.jsline 277

Get start, end position of current selection

RETURNS:
{

Object

}

getValue()codeMirrorExt.jsline 115

Get editor value

RETURNS:
{

string

} - codeMirror text value

getWrapperElement()codeMirrorExt.jsline 227

get code mirror wrapper element

RETURNS:
{

HTMLElement

} - code mirror wrapper element

moveCursorToEnd()codeMirrorExt.jsline 243

Set cursor position to end

moveCursorToStart()codeMirrorExt.jsline 253

Set cursor position to start

off(type, func)codeMirrorExt.jsline 307

remove codemirror event handler

PARAMETERS
NameTypeDescription

type

string

event type

func

function

handler function

on(type, func)codeMirrorExt.jsline 298

add codemirror event handler

PARAMETERS
NameTypeDescription

type

string

event type

func

function

handler function

remove()codeMirrorExt.jsline 93

Remove Editor from document

replaceRelativeOffset(content, offset, overwriteLength)codeMirrorExt.jsline 177

Replace selection with replacement content and offset

PARAMETERS
NameTypeDescription

content

string

Replacement content text

offset

number

Offset

overwriteLength

number

Length to overwrite

replaceSelection(content, selection)codeMirrorExt.jsline 162

Replace selection with given replacement content

PARAMETERS
NameTypeDescription

content

string

Replacement content text

selection

object

Selection object

reset()codeMirrorExt.jsline 130

Reset Editor

scrollTop(value)codeMirrorExt.jsline 265

Scroll Editor content to Top

PARAMETERS
NameTypeDescription

value

number

Scroll amount

RETURNS:
{

number

} - changed scroll top

setHeight(height)codeMirrorExt.jsline 197

Set Editor height

PARAMETERS
NameTypeDescription

height

number

Editor height

setMinHeight(minHeight)codeMirrorExt.jsline 207

set min height

PARAMETERS
NameTypeDescription

minHeight

number

min height

setPlaceholder(placeholder)codeMirrorExt.jsline 217

Set the placeholder to CodeMirror

PARAMETERS
NameTypeDescription

placeholder

string

placeholder to set

setValue(markdown, cursorToEnd)codeMirrorExt.jsline 102

Set Editor value

PARAMETERS
NameTypeDescription

markdown

string

Markdown syntax text

cursorToEnd

boolean = true

move cursor to contents end

Resizable