logo

/repo|v1.4.10

Class

new CodeMirrorExt(el, options)codeMirrorExt.jsline 21

Class CodeMirrorExt

PARAMETERS
NameTypeDescription

el

HTMLElement

container jquery element

options

Object = {}

codeMirror options

Instance Methods

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

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 85

blur focus to current Editor

focus()codeMirrorExt.jsline 78

Set focus to current Editor

getCaretPosition()codeMirrorExt.jsline 137

Get current caret position

RETURNS:
{

Object

}

getCurrentRange()codeMirrorExt.jsline 64

getCurrentRange

RETURNS:
{

Object

} - selection range

getCursor(start)codeMirrorExt.jsline 235

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 122

Get CodeMirror instance

RETURNS:
{

CodeMirror

}

getRange()codeMirrorExt.jsline 276

Get start, end position of current selection

RETURNS:
{

Object

}

getValue()codeMirrorExt.jsline 114

Get editor value

RETURNS:
{

string

} - codeMirror text value

getWrapperElement()codeMirrorExt.jsline 226

get code mirror wrapper element

RETURNS:
{

HTMLElement

} - code mirror wrapper element

moveCursorToEnd()codeMirrorExt.jsline 242

Set cursor position to end

moveCursorToStart()codeMirrorExt.jsline 252

Set cursor position to start

off(type, func)codeMirrorExt.jsline 306

remove codemirror event handler

PARAMETERS
NameTypeDescription

type

string

event type

func

function

handler function

on(type, func)codeMirrorExt.jsline 297

add codemirror event handler

PARAMETERS
NameTypeDescription

type

string

event type

func

function

handler function

remove()codeMirrorExt.jsline 92

Remove Editor from document

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

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 161

Replace selection with given replacement content

PARAMETERS
NameTypeDescription

content

string

Replacement content text

selection

object

Selection object

reset()codeMirrorExt.jsline 129

Reset Editor

scrollTop(value)codeMirrorExt.jsline 264

Scroll Editor content to Top

PARAMETERS
NameTypeDescription

value

number

Scroll amount

RETURNS:
{

number

} - changed scroll top

setHeight(height)codeMirrorExt.jsline 196

Set Editor height

PARAMETERS
NameTypeDescription

height

number

Editor height

setMinHeight(minHeight)codeMirrorExt.jsline 206

set min height

PARAMETERS
NameTypeDescription

minHeight

number

min height

setPlaceholder(placeholder)codeMirrorExt.jsline 216

Set the placeholder to CodeMirror

PARAMETERS
NameTypeDescription

placeholder

string

placeholder to set

setValue(markdown, cursorToEnd)codeMirrorExt.jsline 101

Set Editor value

PARAMETERS
NameTypeDescription

markdown

string

Markdown syntax text

cursorToEnd

boolean = true

move cursor to contents end

Resizable