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 fixShortcut(name) {
if(isMac) {
name = name.replace("Ctrl", "Cmd");
} else {
name = name.replace("Cmd", "Ctrl");
}
return name;
} | Fix shortcut. Mac use Command, others use Ctrl. | fixShortcut | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function getState(cm, pos) {
pos = pos || cm.getCursor("start");
var stat = cm.getTokenAt(pos);
if(!stat.type) return {};
var types = stat.type.split(" ");
var ret = {},
data, text;
for(var i = 0; i < types.length; i++) {
data = types[i];
if(data === "strong") {
ret.bold = true;
} else if(data === "v... | The state of CodeMirror at the given position. | getState | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function toggleFullScreen(editor) {
// Set fullscreen
var cm = editor.codemirror;
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
// Prevent scrolling on body during fullscreen active
if(cm.getOption("fullScreen")) {
saved_overflow = document.body.style.overflow;
document.body.style.overflow = "hidd... | Toggle full screen of the editor. | toggleFullScreen | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function toggleHeadingSmaller(editor) {
var cm = editor.codemirror;
_toggleHeading(cm, "smaller");
} | Action for toggling heading size: normal -> h1 -> h2 -> h3 -> h4 -> h5 -> h6 -> normal | toggleHeadingSmaller | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function toggleHeadingBigger(editor) {
var cm = editor.codemirror;
_toggleHeading(cm, "bigger");
} | Action for toggling heading size: normal -> h6 -> h5 -> h4 -> h3 -> h2 -> h1 -> normal | toggleHeadingBigger | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function cleanBlock(editor) {
var cm = editor.codemirror;
_cleanBlock(cm);
} | Action for clean block (remove headline, list, blockquote code, markers) | cleanBlock | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function isLocalStorageAvailable() {
if(typeof localStorage === "object") {
try {
localStorage.setItem("smde_localStorage", 1);
localStorage.removeItem("smde_localStorage");
} catch(e) {
return false;
}
} else {
return false;
}
return true;
} | Render editor to the given element. | isLocalStorageAvailable | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function Buffer (arg, encodingOrOffset, length) {
if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
return new Buffer(arg, encodingOrOffset, length)
}
// Common case.
if (typeof arg === 'number') {
if (typeof encodingOrOffset === 'string') {
throw new Error(
'If encoding is ... | The Buffer constructor returns instances of `Uint8Array` that have their
prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
`Uint8Array`, so the returned instances will have all the node `Buffer` methods
and the `Uint8Array` methods. Square bracket notation works as expected -- it
returns a... | Buffer | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function from (that, value, encodingOrOffset, length) {
if (typeof value === 'number') {
throw new TypeError('"value" argument must not be a number')
}
if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
return fromArrayBuffer(that, value, encodingOrOffset, length)
}
if (typeof... | The Buffer constructor returns instances of `Uint8Array` that have their
prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
`Uint8Array`, so the returned instances will have all the node `Buffer` methods
and the `Uint8Array` methods. Square bracket notation works as expected -- it
returns a... | from | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function assertSize (size) {
if (typeof size !== 'number') {
throw new TypeError('"size" argument must be a number')
}
} | Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
if value is a number.
Buffer.from(str[, encoding])
Buffer.from(array)
Buffer.from(buffer)
Buffer.from(arrayBuffer[, byteOffset[, length]]) | assertSize | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function alloc (that, size, fill, encoding) {
assertSize(size)
if (size <= 0) {
return createBuffer(that, size)
}
if (fill !== undefined) {
// Only pay attention to encoding if it's a string. This
// prevents accidentally sending in a number that would
// be interpretted as a start offset.
r... | Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
if value is a number.
Buffer.from(str[, encoding])
Buffer.from(array)
Buffer.from(buffer)
Buffer.from(arrayBuffer[, byteOffset[, length]]) | alloc | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function allocUnsafe (that, size) {
assertSize(size)
that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
if (!Buffer.TYPED_ARRAY_SUPPORT) {
for (var i = 0; i < size; i++) {
that[i] = 0
}
}
return that
} | Creates a new filled Buffer instance.
alloc(size[, fill[, encoding]]) | allocUnsafe | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function fromString (that, string, encoding) {
if (typeof encoding !== 'string' || encoding === '') {
encoding = 'utf8'
}
if (!Buffer.isEncoding(encoding)) {
throw new TypeError('"encoding" must be a valid string encoding')
}
var length = byteLength(string, encoding) | 0
that = createBuffer(that, ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | fromString | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function fromArrayLike (that, array) {
var length = checked(array.length) | 0
that = createBuffer(that, length)
for (var i = 0; i < length; i += 1) {
that[i] = array[i] & 255
}
return that
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | fromArrayLike | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function fromArrayBuffer (that, array, byteOffset, length) {
array.byteLength // this throws if `array` is not a valid ArrayBuffer
if (byteOffset < 0 || array.byteLength < byteOffset) {
throw new RangeError('\'offset\' is out of bounds')
}
if (array.byteLength < byteOffset + (length || 0)) {
throw new... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | fromArrayBuffer | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function fromObject (that, obj) {
if (Buffer.isBuffer(obj)) {
var len = checked(obj.length) | 0
that = createBuffer(that, len)
if (that.length === 0) {
return that
}
obj.copy(that, 0, 0, len)
return that
}
if (obj) {
if ((typeof ArrayBuffer !== 'undefined' &&
obj.buffe... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | fromObject | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function checked (length) {
// Note: cannot use `length < kMaxLength` here because that fails when
// length is NaN (which is otherwise coerced to zero.)
if (length >= kMaxLength()) {
throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
'size: 0x' + kMaxLength().to... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | checked | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function SlowBuffer (length) {
if (+length != length) { // eslint-disable-line eqeqeq
length = 0
}
return Buffer.alloc(+length)
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | SlowBuffer | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function byteLength (string, encoding) {
if (Buffer.isBuffer(string)) {
return string.length
}
if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
(ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
return string.byteLength
}
if (typeof string !== '... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | byteLength | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function slowToString (encoding, start, end) {
var loweredCase = false
// No need to verify that "this.length <= MAX_UINT32" since it's a read-only
// property of a typed array.
// This behaves neither like String nor Uint8Array in that we set start/end
// to their upper/lower bounds if the value passed is ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | slowToString | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function swap (b, n, m) {
var i = b[n]
b[n] = b[m]
b[m] = i
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | swap | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function arrayIndexOf (arr, val, byteOffset, encoding) {
var indexSize = 1
var arrLength = arr.length
var valLength = val.length
if (encoding !== undefined) {
encoding = String(encoding).toLowerCase()
if (encoding === 'ucs2' || encoding === 'ucs-2' ||
encoding === 'utf16le' || encoding === 'utf... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | arrayIndexOf | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function read (buf, i) {
if (indexSize === 1) {
return buf[i]
} else {
return buf.readUInt16BE(i * indexSize)
}
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | read | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function hexWrite (buf, string, offset, length) {
offset = Number(offset) || 0
var remaining = buf.length - offset
if (!length) {
length = remaining
} else {
length = Number(length)
if (length > remaining) {
length = remaining
}
}
// must be an even number of digits
var strLen = str... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | hexWrite | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function utf8Write (buf, string, offset, length) {
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | utf8Write | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function asciiWrite (buf, string, offset, length) {
return blitBuffer(asciiToBytes(string), buf, offset, length)
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | asciiWrite | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function binaryWrite (buf, string, offset, length) {
return asciiWrite(buf, string, offset, length)
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | binaryWrite | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function base64Write (buf, string, offset, length) {
return blitBuffer(base64ToBytes(string), buf, offset, length)
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | base64Write | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function ucs2Write (buf, string, offset, length) {
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | ucs2Write | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function base64Slice (buf, start, end) {
if (start === 0 && end === buf.length) {
return base64.fromByteArray(buf)
} else {
return base64.fromByteArray(buf.slice(start, end))
}
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | base64Slice | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function utf8Slice (buf, start, end) {
end = Math.min(buf.length, end)
var res = []
var i = start
while (i < end) {
var firstByte = buf[i]
var codePoint = null
var bytesPerSequence = (firstByte > 0xEF) ? 4
: (firstByte > 0xDF) ? 3
: (firstByte > 0xBF) ? 2
: 1
if (i + bytesPer... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | utf8Slice | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function decodeCodePointsArray (codePoints) {
var len = codePoints.length
if (len <= MAX_ARGUMENTS_LENGTH) {
return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
}
// Decode in chunks to avoid "call stack size exceeded".
var res = ''
var i = 0
while (i < len) {
res += Strin... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | decodeCodePointsArray | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function asciiSlice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; i++) {
ret += String.fromCharCode(buf[i] & 0x7F)
}
return ret
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | asciiSlice | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function binarySlice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; i++) {
ret += String.fromCharCode(buf[i])
}
return ret
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | binarySlice | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function hexSlice (buf, start, end) {
var len = buf.length
if (!start || start < 0) start = 0
if (!end || end < 0 || end > len) end = len
var out = ''
for (var i = start; i < end; i++) {
out += toHex(buf[i])
}
return out
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | hexSlice | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function utf16leSlice (buf, start, end) {
var bytes = buf.slice(start, end)
var res = ''
for (var i = 0; i < bytes.length; i += 2) {
res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
}
return res
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | utf16leSlice | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function checkOffset (offset, ext, length) {
if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | checkOffset | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function checkInt (buf, value, offset, ext, max, min) {
if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
if (offset + ext > buf.length) throw new RangeError('Index out of range')
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | checkInt | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function objectWriteUInt16 (buf, value, offset, littleEndian) {
if (value < 0) value = 0xffff + value + 1
for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) {
buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
(littleEndian ? i : 1 - i) * 8
}
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | objectWriteUInt16 | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function objectWriteUInt32 (buf, value, offset, littleEndian) {
if (value < 0) value = 0xffffffff + value + 1
for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) {
buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
}
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | objectWriteUInt32 | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function checkIEEE754 (buf, value, offset, ext, max, min) {
if (offset + ext > buf.length) throw new RangeError('Index out of range')
if (offset < 0) throw new RangeError('Index out of range')
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | checkIEEE754 | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function writeFloat (buf, value, offset, littleEndian, noAssert) {
if (!noAssert) {
checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
}
ieee754.write(buf, value, offset, littleEndian, 23, 4)
return offset + 4
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | writeFloat | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function writeDouble (buf, value, offset, littleEndian, noAssert) {
if (!noAssert) {
checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
}
ieee754.write(buf, value, offset, littleEndian, 52, 8)
return offset + 8
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | writeDouble | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function base64clean (str) {
// Node strips out invalid characters like \n and \t from the string, base64-js does not
str = stringtrim(str).replace(INVALID_BASE64_RE, '')
// Node converts strings with length < 2 to ''
if (str.length < 2) return ''
// Node allows for non-padded base64 strings (missing trailing... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | base64clean | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function stringtrim (str) {
if (str.trim) return str.trim()
return str.replace(/^\s+|\s+$/g, '')
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | stringtrim | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function toHex (n) {
if (n < 16) return '0' + n.toString(16)
return n.toString(16)
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | toHex | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function utf8ToBytes (string, units) {
units = units || Infinity
var codePoint
var length = string.length
var leadSurrogate = null
var bytes = []
for (var i = 0; i < length; i++) {
codePoint = string.charCodeAt(i)
// is surrogate component
if (codePoint > 0xD7FF && codePoint < 0xE000) {
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | utf8ToBytes | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function asciiToBytes (str) {
var byteArray = []
for (var i = 0; i < str.length; i++) {
// Node's code seems to be doing this and not & 0x7F..
byteArray.push(str.charCodeAt(i) & 0xFF)
}
return byteArray
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | asciiToBytes | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function utf16leToBytes (str, units) {
var c, hi, lo
var byteArray = []
for (var i = 0; i < str.length; i++) {
if ((units -= 2) < 0) break
c = str.charCodeAt(i)
hi = c >> 8
lo = c % 256
byteArray.push(lo)
byteArray.push(hi)
}
return byteArray
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | utf16leToBytes | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function base64ToBytes (str) {
return base64.toByteArray(base64clean(str))
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | base64ToBytes | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function blitBuffer (src, dst, offset, length) {
for (var i = 0; i < length; i++) {
if ((i + offset >= dst.length) || (i >= src.length)) break
dst[i + offset] = src[i]
}
return i
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | blitBuffer | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function isnan (val) {
return val !== val // eslint-disable-line no-self-compare
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | isnan | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function CodeMirrorSpellChecker(options) {
// Initialize
options = options || {};
// Verify
if(typeof options.codeMirrorInstance !== "function" || typeof options.codeMirrorInstance.defineMode !== "function") {
console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `code... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | CodeMirrorSpellChecker | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function setFullscreen(cm) {
var wrap = cm.getWrapperElement();
cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset,
width: wrap.style.width, height: wrap.style.height};
wrap.style.width = "";
wrap.style.height = "auto";
wrap.... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | setFullscreen | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function setNormal(cm) {
var wrap = cm.getWrapperElement();
wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, "");
document.documentElement.style.overflow = "";
var info = cm.state.fullScreenRestore;
wrap.style.width = info.width; wrap.style.height = info.height;
window.scrol... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | setNormal | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function clearPlaceholder(cm) {
if (cm.state.placeholder) {
cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);
cm.state.placeholder = null;
}
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | clearPlaceholder | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function setPlaceholder(cm) {
clearPlaceholder(cm);
var elt = cm.state.placeholder = document.createElement("pre");
elt.style.cssText = "height: 0; overflow: visible";
elt.className = "CodeMirror-placeholder";
var placeHolder = cm.getOption("placeholder")
if (typeof placeHolder == "string") plac... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | setPlaceholder | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function onBlur(cm) {
if (isEmpty(cm)) setPlaceholder(cm);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | onBlur | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function onChange(cm) {
var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);
wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : "");
if (empty) setPlaceholder(cm);
else clearPlaceholder(cm);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | onChange | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function isEmpty(cm) {
return (cm.lineCount() === 1) && (cm.getLine(0) === "");
} | 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 onCursorActivity(cm) {
cm.operation(function() { update(cm); });
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | onCursorActivity | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function onChange(cm) {
if (cm.state.markedSelection.length)
cm.operation(function() { clear(cm); });
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | onChange | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function coverRange(cm, from, to, addAt) {
if (cmp(from, to) == 0) return;
var array = cm.state.markedSelection;
var cls = cm.state.markedSelectionStyle;
for (var line = from.line;;) {
var start = line == from.line ? from : Pos(line, 0);
var endLine = line + CHUNK_SIZE, atEnd = endLine >= to... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | coverRange | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function clear(cm) {
var array = cm.state.markedSelection;
for (var i = 0; i < array.length; ++i) array[i].clear();
array.length = 0;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | clear | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function reset(cm) {
clear(cm);
var ranges = cm.listSelections();
for (var i = 0; i < ranges.length; i++)
coverRange(cm, ranges[i].from(), ranges[i].to());
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | reset | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function update(cm) {
if (!cm.somethingSelected()) return clear(cm);
if (cm.listSelections().length > 1) return reset(cm);
var from = cm.getCursor("start"), to = cm.getCursor("end");
var array = cm.state.markedSelection;
if (!array.length) return coverRange(cm, from, to);
var coverStart = arr... | 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 CodeMirror(place, options) {
if (!(this instanceof CodeMirror)) return new CodeMirror(place, options);
this.options = options = options ? copyObj(options) : {};
// Determine effective options based on given values and defaults.
copyObj(defaults, options, false);
setGuttersForLineNumbers(op... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | CodeMirror | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function Display(place, doc, input) {
var d = this;
this.input = input;
// Covers bottom-right square when both scrollbars are present.
d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler");
d.scrollbarFiller.setAttribute("cm-not-content", "true");
// Covers bottom of gutter when ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | Display | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function loadMode(cm) {
cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);
resetModeState(cm);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | loadMode | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function resetModeState(cm) {
cm.doc.iter(function(line) {
if (line.stateAfter) line.stateAfter = null;
if (line.styles) line.styles = null;
});
cm.doc.frontier = cm.doc.first;
startWorker(cm, 100);
cm.state.modeGen++;
if (cm.curOp) regChange(cm);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | resetModeState | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function wrappingChanged(cm) {
if (cm.options.lineWrapping) {
addClass(cm.display.wrapper, "CodeMirror-wrap");
cm.display.sizer.style.minWidth = "";
cm.display.sizerWidth = null;
} else {
rmClass(cm.display.wrapper, "CodeMirror-wrap");
findMaxLine(cm);
}
estimateLineHeights... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | wrappingChanged | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function estimateHeight(cm) {
var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;
var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);
return function(line) {
if (lineIsHidden(cm.doc, line)) return 0;
var widgetsHeight = 0;
i... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | estimateHeight | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function estimateLineHeights(cm) {
var doc = cm.doc, est = estimateHeight(cm);
doc.iter(function(line) {
var estHeight = est(line);
if (estHeight != line.height) updateLineHeight(line, estHeight);
});
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | estimateLineHeights | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function themeChanged(cm) {
cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") +
cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-");
clearCaches(cm);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | themeChanged | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function guttersChanged(cm) {
updateGutters(cm);
regChange(cm);
setTimeout(function(){alignHorizontally(cm);}, 20);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | guttersChanged | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function updateGutters(cm) {
var gutters = cm.display.gutters, specs = cm.options.gutters;
removeChildren(gutters);
for (var i = 0; i < specs.length; ++i) {
var gutterClass = specs[i];
var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass));
if (gutterClass == ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | updateGutters | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function updateGutterSpace(cm) {
var width = cm.display.gutters.offsetWidth;
cm.display.sizer.style.marginLeft = width + "px";
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | updateGutterSpace | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function lineLength(line) {
if (line.height == 0) return 0;
var len = line.text.length, merged, cur = line;
while (merged = collapsedSpanAtStart(cur)) {
var found = merged.find(0, true);
cur = found.from.line;
len += found.from.ch - found.to.ch;
}
cur = line;
while (merged = co... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | lineLength | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function findMaxLine(cm) {
var d = cm.display, doc = cm.doc;
d.maxLine = getLine(doc, doc.first);
d.maxLineLength = lineLength(d.maxLine);
d.maxLineChanged = true;
doc.iter(function(line) {
var len = lineLength(line);
if (len > d.maxLineLength) {
d.maxLineLength = len;
d.... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | findMaxLine | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function setGuttersForLineNumbers(options) {
var found = indexOf(options.gutters, "CodeMirror-linenumbers");
if (found == -1 && options.lineNumbers) {
options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]);
} else if (found > -1 && !options.lineNumbers) {
options.gutters = options.... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | setGuttersForLineNumbers | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function measureForScrollbars(cm) {
var d = cm.display, gutterW = d.gutters.offsetWidth;
var docH = Math.round(cm.doc.height + paddingVert(cm.display));
return {
clientHeight: d.scroller.clientHeight,
viewHeight: d.wrapper.clientHeight,
scrollWidth: d.scroller.scrollWidth, clientWidth: d.s... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | measureForScrollbars | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function NativeScrollbars(place, scroll, cm) {
this.cm = cm;
var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar");
var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar");
place(vert); place... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | NativeScrollbars | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function maybeDisable() {
// To find out whether the scrollbar is still visible, we
// check whether the element under the pixel in the bottom
// left corner of the scrollbar box is the scrollbar box
// itself (when the bar is still visible) or its filler child
// (when the bar i... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | maybeDisable | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function initScrollbars(cm) {
if (cm.display.scrollbars) {
cm.display.scrollbars.clear();
if (cm.display.scrollbars.addClass)
rmClass(cm.display.wrapper, cm.display.scrollbars.addClass);
}
cm.display.scrollbars = new CodeMirror.scrollbarModel[cm.options.scrollbarStyle](function(node) {
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | initScrollbars | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function updateScrollbars(cm, measure) {
if (!measure) measure = measureForScrollbars(cm);
var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;
updateScrollbarsInner(cm, measure);
for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++)... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | updateScrollbars | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function updateScrollbarsInner(cm, measure) {
var d = cm.display;
var sizes = d.scrollbars.update(measure);
d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px";
d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px";
d.heightForcer.style.borderBottom = sizes.bottom + "px solid... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | updateScrollbarsInner | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function visibleLines(display, doc, viewport) {
var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;
top = Math.floor(top - paddingTop(display));
var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;
var ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | visibleLines | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function alignHorizontally(cm) {
var display = cm.display, view = display.view;
if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;
var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;
var gutterW = display.gutters.offsetW... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | alignHorizontally | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function maybeUpdateLineNumberWidth(cm) {
if (!cm.options.lineNumbers) return false;
var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;
if (last.length != display.lineNumChars) {
var test = display.measure.appendChild(elt("div", [elt("div", last)],
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | maybeUpdateLineNumberWidth | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function lineNumberFor(options, i) {
return String(options.lineNumberFormatter(i + options.firstLineNumber));
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | lineNumberFor | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function compensateForHScroll(display) {
return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | compensateForHScroll | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function DisplayUpdate(cm, viewport, force) {
var display = cm.display;
this.viewport = viewport;
// Store some values that we'll need later (but don't want to force a relayout for)
this.visible = visibleLines(display, cm.doc, viewport);
this.editorIsHidden = !display.wrapper.offsetWidth;
this.... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | DisplayUpdate | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function maybeClipScrollbars(cm) {
var display = cm.display;
if (!display.scrollbarsClipped && display.scroller.offsetWidth) {
display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;
display.heightForcer.style.height = scrollGap(cm) + "px";
display.sizer.style.mar... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | maybeClipScrollbars | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function updateDisplayIfNeeded(cm, update) {
var display = cm.display, doc = cm.doc;
if (update.editorIsHidden) {
resetView(cm);
return false;
}
// Bail out if the visible area is already rendered and nothing changed.
if (!update.force &&
update.visible.from >= display.viewFrom... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | updateDisplayIfNeeded | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function postUpdateDisplay(cm, update) {
var viewport = update.viewport;
for (var first = true;; first = false) {
if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {
// Clip forced viewport to actual scrollable area.
if (viewport && viewport.top != null... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | postUpdateDisplay | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function updateDisplaySimple(cm, viewport) {
var update = new DisplayUpdate(cm, viewport);
if (updateDisplayIfNeeded(cm, update)) {
updateHeightsInViewport(cm);
postUpdateDisplay(cm, update);
var barMeasure = measureForScrollbars(cm);
updateSelection(cm);
updateScrollbars(cm, barMe... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | updateDisplaySimple | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function setDocumentHeight(cm, measure) {
cm.display.sizer.style.minHeight = measure.docHeight + "px";
cm.display.heightForcer.style.top = measure.docHeight + "px";
cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px";
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | setDocumentHeight | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function updateHeightsInViewport(cm) {
var display = cm.display;
var prevBottom = display.lineDiv.offsetTop;
for (var i = 0; i < display.view.length; i++) {
var cur = display.view[i], height;
if (cur.hidden) continue;
if (ie && ie_version < 8) {
var bot = cur.node.offsetTop + cur.n... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | updateHeightsInViewport | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function updateWidgetHeight(line) {
if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)
line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | updateWidgetHeight | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function getDimensions(cm) {
var d = cm.display, left = {}, width = {};
var gutterLeft = d.gutters.clientLeft;
for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {
left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;
width[cm.options.gutters[i]] = n.clientWid... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | getDimensions | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.