code
stringlengths
24
2.07M
docstring
stringlengths
25
85.3k
func_name
stringlengths
1
92
language
stringclasses
1 value
repo
stringlengths
5
64
path
stringlengths
4
172
url
stringlengths
44
218
license
stringclasses
7 values
function addMarkedSpan(line, span) { line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; span.marker.attachLine(line); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
addMarkedSpan
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function markedSpansBefore(old, startCh, isInsert) { if (old) for (var i = 0, nw; i < old.length; ++i) { var span = old[i], marker = span.marker; var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); if (startsBefore || span.from == startCh &&...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
markedSpansBefore
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function markedSpansAfter(old, endCh, isInsert) { if (old) for (var i = 0, nw; i < old.length; ++i) { var span = old[i], marker = span.marker; var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); if (endsAfter || span.from == endCh && marker.type == "boo...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
markedSpansAfter
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function stretchSpansOverChange(doc, change) { if (change.full) return null; var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; if (!oldFirst && !oldLast) return null; var...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
stretchSpansOverChange
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function clearEmptySpans(spans) { for (var i = 0; i < spans.length; ++i) { var span = spans[i]; if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) spans.splice(i--, 1); } if (!spans.length) return null; return spans; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
clearEmptySpans
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function mergeOldSpans(doc, change) { var old = getOldSpans(doc, change); var stretched = stretchSpansOverChange(doc, change); if (!old) return stretched; if (!stretched) return old; for (var i = 0; i < old.length; ++i) { var oldCur = old[i], stretchCur = stretched[i]; if (oldCur && str...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
mergeOldSpans
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function removeReadOnlyRanges(doc, from, to) { var markers = null; doc.iter(from.line, to.line + 1, function(line) { if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) { var mark = line.markedSpans[i].marker; if (mark.readOnly && (!markers || indexOf(markers, mark) == ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
removeReadOnlyRanges
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function detachMarkedSpans(line) { var spans = line.markedSpans; if (!spans) return; for (var i = 0; i < spans.length; ++i) spans[i].marker.detachLine(line); line.markedSpans = null; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
detachMarkedSpans
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function attachMarkedSpans(line, spans) { if (!spans) return; for (var i = 0; i < spans.length; ++i) spans[i].marker.attachLine(line); line.markedSpans = spans; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
attachMarkedSpans
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function compareCollapsedMarkers(a, b) { var lenDiff = a.lines.length - b.lines.length; if (lenDiff != 0) return lenDiff; var aPos = a.find(), bPos = b.find(); var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); if (fromCmp) return -fromCmp; var toCmp = cmp(aPos.to, bPos.to) ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
compareCollapsedMarkers
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function collapsedSpanAtSide(line, start) { var sps = sawCollapsedSpans && line.markedSpans, found; if (sps) for (var sp, i = 0; i < sps.length; ++i) { sp = sps[i]; if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && (!found || compareCollapsedMarkers(found, sp.marker) < 0)) ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
collapsedSpanAtSide
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function conflictingCollapsedRange(doc, lineNo, from, to, marker) { var line = getLine(doc, lineNo); var sps = sawCollapsedSpans && line.markedSpans; if (sps) for (var i = 0; i < sps.length; ++i) { var sp = sps[i]; if (!sp.marker.collapsed) continue; var found = sp.marker.find(0); va...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
conflictingCollapsedRange
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function visualLine(line) { var merged; while (merged = collapsedSpanAtStart(line)) line = merged.find(-1, true).line; return line; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
visualLine
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function visualLineContinued(line) { var merged, lines; while (merged = collapsedSpanAtEnd(line)) { line = merged.find(1, true).line; (lines || (lines = [])).push(line); } return lines; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
visualLineContinued
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function visualLineNo(doc, lineN) { var line = getLine(doc, lineN), vis = visualLine(line); if (line == vis) return lineN; return lineNo(vis); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
visualLineNo
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function visualLineEndNo(doc, lineN) { if (lineN > doc.lastLine()) return lineN; var line = getLine(doc, lineN), merged; if (!lineIsHidden(doc, line)) return lineN; while (merged = collapsedSpanAtEnd(line)) line = merged.find(1, true).line; return lineNo(line) + 1; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
visualLineEndNo
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function lineIsHidden(doc, line) { var sps = sawCollapsedSpans && line.markedSpans; if (sps) for (var sp, i = 0; i < sps.length; ++i) { sp = sps[i]; if (!sp.marker.collapsed) continue; if (sp.from == null) return true; if (sp.marker.widgetNode) continue; if (sp.from == 0 && sp.mark...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
lineIsHidden
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function lineIsHiddenInner(doc, line, span) { if (span.to == null) { var end = span.marker.find(1, true); return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)); } if (span.marker.inclusiveRight && span.to == line.text.length) return true; for (var...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
lineIsHiddenInner
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function adjustScrollWhenAboveVisible(cm, line, diff) { if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) addToScrollPos(cm, null, diff); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
adjustScrollWhenAboveVisible
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function widgetHeight(widget) { if (widget.height != null) return widget.height; var cm = widget.doc.cm; if (!cm) return 0; if (!contains(document.body, widget.node)) { var parentStyle = "position: relative;"; if (widget.coverGutter) parentStyle += "margin-left: -" + cm.display.gutte...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
widgetHeight
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function addLineWidget(doc, handle, node, options) { var widget = new LineWidget(doc, node, options); var cm = doc.cm; if (cm && widget.noHScroll) cm.display.alignWidgets = true; changeLine(doc, handle, "widget", function(line) { var widgets = line.widgets || (line.widgets = []); if (widget....
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
addLineWidget
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function updateLine(line, text, markedSpans, estimateHeight) { line.text = text; if (line.stateAfter) line.stateAfter = null; if (line.styles) line.styles = null; if (line.order != null) line.order = null; detachMarkedSpans(line); attachMarkedSpans(line, markedSpans); var estHeight = estimat...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
updateLine
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function cleanUpLine(line) { line.parent = null; detachMarkedSpans(line); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
cleanUpLine
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function extractLineClasses(type, output) { if (type) for (;;) { var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); if (!lineClass) break; type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); var prop = lineClass[1] ? "bgClass" : "textClass...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
extractLineClasses
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function callBlankLine(mode, state) { if (mode.blankLine) return mode.blankLine(state); if (!mode.innerMode) return; var inner = CodeMirror.innerMode(mode, state); if (inner.mode.blankLine) return inner.mode.blankLine(inner.state); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
callBlankLine
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function readToken(mode, stream, state, inner) { for (var i = 0; i < 10; i++) { if (inner) inner[0] = CodeMirror.innerMode(mode, state).mode; var style = mode.token(stream, state); if (stream.pos > stream.start) return style; } throw new Error("Mode " + mode.name + " failed to advance stre...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
readToken
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function takeToken(cm, pos, precise, asArray) { function getObj(copy) { return {start: stream.start, end: stream.pos, string: stream.current(), type: style || null, state: copy ? copyState(doc.mode, state) : state}; } var doc = cm.doc, mode = doc.mode, style;...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
takeToken
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function getObj(copy) { return {start: stream.start, end: stream.pos, string: stream.current(), type: style || null, state: copy ? copyState(doc.mode, state) : state}; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
getObj
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) { var flattenSpans = mode.flattenSpans; if (flattenSpans == null) flattenSpans = cm.options.flattenSpans; var curStart = 0, curStyle = null; var stream = new StringStream(text, cm.options.tabSize), style; var inner = cm.options.addM...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
runMode
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function highlightLine(cm, line, state, forceToEnd) { // A styles array always starts with a number identifying the // mode/overlays that it is based on (for easy invalidation). var st = [cm.state.modeGen], lineClasses = {}; // Compute the base array of styles runMode(cm, line.text, cm.doc.mode, sta...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
highlightLine
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function getLineStyles(cm, line, updateFrontier) { if (!line.styles || line.styles[0] != cm.state.modeGen) { var state = getStateBefore(cm, lineNo(line)); var result = highlightLine(cm, line, line.text.length > cm.options.maxHighlightLength ? copyState(cm.doc.mode, state) : state); line.stateAfter...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
getLineStyles
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function processLine(cm, text, state, startAt) { var mode = cm.doc.mode; var stream = new StringStream(text, cm.options.tabSize); stream.start = stream.pos = startAt || 0; if (text == "") callBlankLine(mode, state); while (!stream.eol()) { readToken(mode, stream, state); stream.start = s...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
processLine
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function interpretTokenStyle(style, options) { if (!style || /^\s*$/.test(style)) return null; var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; return cache[style] || (cache[style] = style.replace(/\S+/g, "cm-$&")); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
interpretTokenStyle
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function buildLineContent(cm, lineView) { // The padding-right forces the element to have a 'border', which // is needed on Webkit to be able to get line-level bounding // rectangles for it (in measureChar). var content = elt("span", null, null, webkit ? "padding-right: .1px" : null); var builder = ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
buildLineContent
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function defaultSpecialCharPlaceholder(ch) { var token = elt("span", "\u2022", "cm-invalidchar"); token.title = "\\u" + ch.charCodeAt(0).toString(16); token.setAttribute("aria-label", token.title); return token; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
defaultSpecialCharPlaceholder
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function buildToken(builder, text, style, startStyle, endStyle, title, css) { if (!text) return; var displayText = builder.splitSpaces ? text.replace(/ {3,}/g, splitSpaces) : text; var special = builder.cm.state.specialChars, mustWrap = false; if (!special.test(text)) { builder.col += text.length;...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
buildToken
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function splitSpaces(old) { var out = " "; for (var i = 0; i < old.length - 2; ++i) out += i % 2 ? " " : "\u00a0"; out += " "; return out; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
splitSpaces
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function buildTokenBadBidi(inner, order) { return function(builder, text, style, startStyle, endStyle, title, css) { style = style ? style + " cm-force-border" : "cm-force-border"; var start = builder.pos, end = start + text.length; for (;;) { // Find the part that overlaps with the start ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
buildTokenBadBidi
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function buildCollapsedSpan(builder, size, marker, ignoreWidget) { var widget = !ignoreWidget && marker.widgetNode; if (widget) builder.map.push(builder.pos, builder.pos + size, widget); if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { if (!widget) widget = builder.conten...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
buildCollapsedSpan
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function insertLineContent(line, builder, styles) { var spans = line.markedSpans, allText = line.text, at = 0; if (!spans) { for (var i = 1; i < styles.length; i+=2) builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options)); return; ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
insertLineContent
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function isWholeLineUpdate(doc, change) { return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && (!doc.cm || doc.cm.options.wholeLineUpdateBefore); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
isWholeLineUpdate
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function updateDoc(doc, change, markedSpans, estimateHeight) { function spansFor(n) {return markedSpans ? markedSpans[n] : null;} function update(line, text, spans) { updateLine(line, text, spans, estimateHeight); signalLater(line, "change", line, change); } function linesFor(start, end) { ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
updateDoc
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function update(line, text, spans) { updateLine(line, text, spans, estimateHeight); signalLater(line, "change", line, change); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
update
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function linesFor(start, end) { for (var i = start, result = []; i < end; ++i) result.push(new Line(text[i], spansFor(i), estimateHeight)); return result; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
linesFor
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function LeafChunk(lines) { this.lines = lines; this.parent = null; for (var i = 0, height = 0; i < lines.length; ++i) { lines[i].parent = this; height += lines[i].height; } this.height = height; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
LeafChunk
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function BranchChunk(children) { this.children = children; var size = 0, height = 0; for (var i = 0; i < children.length; ++i) { var ch = children[i]; size += ch.chunkSize(); height += ch.height; ch.parent = this; } this.size = size; this.height = height; this.parent = null...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
BranchChunk
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function linkedDocs(doc, f, sharedHistOnly) { function propagate(doc, skip, sharedHist) { if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) { var rel = doc.linked[i]; if (rel.doc == skip) continue; var shared = sharedHist && rel.sharedHist; if (sharedHistOnly && !shar...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
linkedDocs
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function propagate(doc, skip, sharedHist) { if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) { var rel = doc.linked[i]; if (rel.doc == skip) continue; var shared = sharedHist && rel.sharedHist; if (sharedHistOnly && !shared) continue; f(rel.doc, shared); ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
propagate
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function attachDoc(cm, doc) { if (doc.cm) throw new Error("This document is already in use."); cm.doc = doc; doc.cm = cm; estimateLineHeights(cm); loadMode(cm); if (!cm.options.lineWrapping) findMaxLine(cm); cm.options.mode = doc.modeOption; regChange(cm); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
attachDoc
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function getLine(doc, n) { n -= doc.first; if (n < 0 || n >= doc.size) throw new Error("There is no line " + (n + doc.first) + " in the document."); for (var chunk = doc; !chunk.lines;) { for (var i = 0;; ++i) { var child = chunk.children[i], sz = child.chunkSize(); if (n < sz) { chunk...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
getLine
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function getBetween(doc, start, end) { var out = [], n = start.line; doc.iter(start.line, end.line + 1, function(line) { var text = line.text; if (n == end.line) text = text.slice(0, end.ch); if (n == start.line) text = text.slice(start.ch); out.push(text); ++n; }); return ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
getBetween
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function getLines(doc, from, to) { var out = []; doc.iter(from, to, function(line) { out.push(line.text); }); return out; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
getLines
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function updateLineHeight(line, height) { var diff = height - line.height; if (diff) for (var n = line; n; n = n.parent) n.height += diff; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
updateLineHeight
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function lineNo(line) { if (line.parent == null) return null; var cur = line.parent, no = indexOf(cur.lines, line); for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { for (var i = 0;; ++i) { if (chunk.children[i] == cur) break; no += chunk.children[i].chunkSize();...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
lineNo
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function lineAtHeight(chunk, h) { var n = chunk.first; outer: do { for (var i = 0; i < chunk.children.length; ++i) { var child = chunk.children[i], ch = child.height; if (h < ch) { chunk = child; continue outer; } h -= ch; n += child.chunkSize(); } return n; ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
lineAtHeight
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function heightAtLine(lineObj) { lineObj = visualLine(lineObj); var h = 0, chunk = lineObj.parent; for (var i = 0; i < chunk.lines.length; ++i) { var line = chunk.lines[i]; if (line == lineObj) break; else h += line.height; } for (var p = chunk.parent; p; chunk = p, p = chunk.pare...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
heightAtLine
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function getOrder(line) { var order = line.order; if (order == null) order = line.order = bidiOrdering(line.text); return order; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
getOrder
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function History(startGen) { // Arrays of change events and selections. Doing something adds an // event to done and clears undo. Undoing moves events from done // to undone, redoing moves them in the other direction. this.done = []; this.undone = []; this.undoDepth = Infinity; // Used to track ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
History
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function historyChangeFromChange(doc, change) { var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}; attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, chang...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
historyChangeFromChange
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function clearSelectionEvents(array) { while (array.length) { var last = lst(array); if (last.ranges) array.pop(); else break; } }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
clearSelectionEvents
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function lastChangeEvent(hist, force) { if (force) { clearSelectionEvents(hist.done); return lst(hist.done); } else if (hist.done.length && !lst(hist.done).ranges) { return lst(hist.done); } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { hist.done.pop(); ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
lastChangeEvent
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function addChangeToHistory(doc, change, selAfter, opId) { var hist = doc.history; hist.undone.length = 0; var time = +new Date, cur; if ((hist.lastOp == opId || hist.lastOrigin == change.origin && change.origin && ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
addChangeToHistory
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function selectionEventCanBeMerged(doc, origin, prev, sel) { var ch = origin.charAt(0); return ch == "*" || ch == "+" && prev.ranges.length == sel.ranges.length && prev.somethingSelected() == sel.somethingSelected() && new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.histor...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
selectionEventCanBeMerged
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function addSelectionToHistory(doc, sel, opId, options) { var hist = doc.history, origin = options && options.origin; // A new event is started when the previous origin does not match // the current, or the origins don't allow matching. Origins // starting with * are always merged, those starting with ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
addSelectionToHistory
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function pushSelectionToHistory(sel, dest) { var top = lst(dest); if (!(top && top.ranges && top.equals(sel))) dest.push(sel); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
pushSelectionToHistory
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function attachLocalSpans(doc, change, from, to) { var existing = change["spans_" + doc.id], n = 0; doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) { if (line.markedSpans) (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
attachLocalSpans
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function removeClearedSpans(spans) { if (!spans) return null; for (var i = 0, out; i < spans.length; ++i) { if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); } else if (out) out.push(spans[i]); } return !out ? spans : out.length ? out : null; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
removeClearedSpans
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function getOldSpans(doc, change) { var found = change["spans_" + doc.id]; if (!found) return null; for (var i = 0, nw = []; i < change.text.length; ++i) nw.push(removeClearedSpans(found[i])); return nw; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
getOldSpans
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function copyHistoryArray(events, newGroup, instantiateSel) { for (var i = 0, copy = []; i < events.length; ++i) { var event = events[i]; if (event.ranges) { copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); continue; } var changes = event.changes,...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
copyHistoryArray
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function rebaseHistSelSingle(pos, from, to, diff) { if (to < pos.line) { pos.line += diff; } else if (from < pos.line) { pos.line = from; pos.ch = 0; } }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
rebaseHistSelSingle
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function rebaseHistArray(array, from, to, diff) { for (var i = 0; i < array.length; ++i) { var sub = array[i], ok = true; if (sub.ranges) { if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; } for (var j = 0; j < sub.ranges.length; j++) { rebaseHistSelSingle...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
rebaseHistArray
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function rebaseHist(hist, change) { var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1; rebaseHistArray(hist.done, from, to, diff); rebaseHistArray(hist.undone, from, to, diff); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
rebaseHist
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function e_defaultPrevented(e) { return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
e_defaultPrevented
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function e_button(e) { var b = e.which; if (b == null) { if (e.button & 1) b = 1; else if (e.button & 2) b = 3; else if (e.button & 4) b = 2; } if (mac && e.ctrlKey && b == 1) b = 3; return b; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
e_button
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function getHandlers(emitter, type, copy) { var arr = emitter._handlers && emitter._handlers[type] if (copy) return arr && arr.length > 0 ? arr.slice() : noHandlers else return arr || noHandlers }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
getHandlers
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function signalLater(emitter, type /*, values...*/) { var arr = getHandlers(emitter, type, false) if (!arr.length) return; var args = Array.prototype.slice.call(arguments, 2), list; if (operationGroup) { list = operationGroup.delayedCallbacks; } else if (orphanDelayedCallbacks) { list = ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
signalLater
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function fireOrphanDelayed() { var delayed = orphanDelayedCallbacks; orphanDelayedCallbacks = null; for (var i = 0; i < delayed.length; ++i) delayed[i](); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
fireOrphanDelayed
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function signalDOMEvent(cm, e, override) { if (typeof e == "string") e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; signal(cm, override || e.type, cm, e); return e_defaultPrevented(e) || e.codemirrorIgnore; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
signalDOMEvent
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function signalCursorActivity(cm) { var arr = cm._handlers && cm._handlers.cursorActivity; if (!arr) return; var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); for (var i = 0; i < arr.length; ++i) if (indexOf(set, arr[i]) == -1) set.push(arr[i]); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
signalCursorActivity
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function hasHandler(emitter, type) { return getHandlers(emitter, type).length > 0 }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
hasHandler
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function eventMixin(ctor) { ctor.prototype.on = function(type, f) {on(this, type, f);}; ctor.prototype.off = function(type, f) {off(this, type, f);}; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
eventMixin
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function spaceStr(n) { while (spaceStrs.length <= n) spaceStrs.push(lst(spaceStrs) + " "); return spaceStrs[n]; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
spaceStr
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function indexOf(array, elt) { for (var i = 0; i < array.length; ++i) if (array[i] == elt) return i; return -1; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
indexOf
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function map(array, f) { var out = []; for (var i = 0; i < array.length; i++) out[i] = f(array[i], i); return out; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
map
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function createObj(base, props) { var inst; if (Object.create) { inst = Object.create(base); } else { nothing.prototype = base; inst = new nothing(); } if (props) copyObj(props, inst); return inst; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
createObj
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function copyObj(obj, target, overwrite) { if (!target) target = {}; for (var prop in obj) if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) target[prop] = obj[prop]; return target; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
copyObj
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function bind(f) { var args = Array.prototype.slice.call(arguments, 1); return function(){return f.apply(null, args);}; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
bind
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function isWordChar(ch, helper) { if (!helper) return isWordCharBasic(ch); if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) return true; return helper.test(ch); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
isWordChar
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function isEmpty(obj) { for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) return false; return true; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
isEmpty
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function elt(tag, content, className, style) { var e = document.createElement(tag); if (className) e.className = className; if (style) e.style.cssText = style; if (typeof content == "string") e.appendChild(document.createTextNode(content)); else if (content) for (var i = 0; i < content.length; ++i) ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
elt
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function removeChildren(e) { for (var count = e.childNodes.length; count > 0; --count) e.removeChild(e.firstChild); return e; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
removeChildren
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function removeChildrenAndAdd(parent, e) { return removeChildren(parent).appendChild(e); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
removeChildrenAndAdd
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function activeElt() { var activeElement = document.activeElement; while (activeElement && activeElement.root && activeElement.root.activeElement) activeElement = activeElement.root.activeElement; return activeElement; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
activeElt
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function joinClasses(a, b) { var as = a.split(" "); for (var i = 0; i < as.length; i++) if (as[i] && !classTest(as[i]).test(b)) b += " " + as[i]; return b; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
joinClasses
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function forEachCodeMirror(f) { if (!document.body.getElementsByClassName) return; var byClass = document.body.getElementsByClassName("CodeMirror"); for (var i = 0; i < byClass.length; i++) { var cm = byClass[i].CodeMirror; if (cm) f(cm); } }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
forEachCodeMirror
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function ensureGlobalHandlers() { if (globalsRegistered) return; registerGlobalHandlers(); globalsRegistered = true; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
ensureGlobalHandlers
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function registerGlobalHandlers() { // When the window resizes, we need to refresh active editors. var resizeTimer; on(window, "resize", function() { if (resizeTimer == null) resizeTimer = setTimeout(function() { resizeTimer = null; forEachCodeMirror(onResize); }, 100); }); ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
registerGlobalHandlers
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function zeroWidthElement(measure) { if (zwspSupported == null) { var test = elt("span", "\u200b"); removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); if (measure.firstChild.offsetHeight != 0) zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
zeroWidthElement
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function hasBadBidiRects(measure) { if (badBidiRects != null) return badBidiRects; var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); var r0 = range(txt, 0, 1).getBoundingClientRect(); if (!r0 || r0.left == r0.right) return false; // Safari returns null in some cases (#2780) ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
hasBadBidiRects
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT
function hasBadZoomedRects(measure) { if (badZoomedRects != null) return badZoomedRects; var node = removeChildrenAndAdd(measure, elt("span", "x")); var normal = node.getBoundingClientRect(); var fromRange = range(node, 0, 1).getBoundingClientRect(); return badZoomedRects = Math.abs(normal.left - fr...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
hasBadZoomedRects
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js
MIT