repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
partition
stringclasses
1 value
Vincit/objection.js
lib/model/modelQueryProps.js
convertAndMergeHiddenQueryProps
function convertAndMergeHiddenQueryProps(model, json, omitProps, builder) { const queryProps = model[QUERY_PROPS_PROPERTY]; if (!queryProps) { // The model has no query properties. return json; } const modelClass = model.constructor; const keys = Object.keys(queryProps); for (let i = 0, l = keys....
javascript
function convertAndMergeHiddenQueryProps(model, json, omitProps, builder) { const queryProps = model[QUERY_PROPS_PROPERTY]; if (!queryProps) { // The model has no query properties. return json; } const modelClass = model.constructor; const keys = Object.keys(queryProps); for (let i = 0, l = keys....
[ "function", "convertAndMergeHiddenQueryProps", "(", "model", ",", "json", ",", "omitProps", ",", "builder", ")", "{", "const", "queryProps", "=", "model", "[", "QUERY_PROPS_PROPERTY", "]", ";", "if", "(", "!", "queryProps", ")", "{", "// The model has no query pro...
Converts and merges the query props that were split from the model and stored into QUERY_PROPS_PROPERTY.
[ "Converts", "and", "merges", "the", "query", "props", "that", "were", "split", "from", "the", "model", "and", "stored", "into", "QUERY_PROPS_PROPERTY", "." ]
868f0e13d51c03033100ac9796f165630657ad90
https://github.com/Vincit/objection.js/blob/868f0e13d51c03033100ac9796f165630657ad90/lib/model/modelQueryProps.js#L88-L109
train
Vincit/objection.js
lib/model/modelQueryProps.js
queryPropToKnexRaw
function queryPropToKnexRaw(queryProp, builder) { if (!queryProp) { return queryProp; } if (queryProp.isObjectionQueryBuilderBase) { return buildObjectionQueryBuilder(queryProp, builder); } else if (isKnexRawConvertable(queryProp)) { return buildKnexRawConvertable(queryProp, builder); } else { ...
javascript
function queryPropToKnexRaw(queryProp, builder) { if (!queryProp) { return queryProp; } if (queryProp.isObjectionQueryBuilderBase) { return buildObjectionQueryBuilder(queryProp, builder); } else if (isKnexRawConvertable(queryProp)) { return buildKnexRawConvertable(queryProp, builder); } else { ...
[ "function", "queryPropToKnexRaw", "(", "queryProp", ",", "builder", ")", "{", "if", "(", "!", "queryProp", ")", "{", "return", "queryProp", ";", "}", "if", "(", "queryProp", ".", "isObjectionQueryBuilderBase", ")", "{", "return", "buildObjectionQueryBuilder", "(...
Converts a query property into a knex `raw` instance.
[ "Converts", "a", "query", "property", "into", "a", "knex", "raw", "instance", "." ]
868f0e13d51c03033100ac9796f165630657ad90
https://github.com/Vincit/objection.js/blob/868f0e13d51c03033100ac9796f165630657ad90/lib/model/modelQueryProps.js#L112-L124
train
ZijianHe/koa-router
lib/layer.js
Layer
function Layer(path, methods, middleware, opts) { this.opts = opts || {}; this.name = this.opts.name || null; this.methods = []; this.paramNames = []; this.stack = Array.isArray(middleware) ? middleware : [middleware]; methods.forEach(function(method) { var l = this.methods.push(method.toUpperCase()); ...
javascript
function Layer(path, methods, middleware, opts) { this.opts = opts || {}; this.name = this.opts.name || null; this.methods = []; this.paramNames = []; this.stack = Array.isArray(middleware) ? middleware : [middleware]; methods.forEach(function(method) { var l = this.methods.push(method.toUpperCase()); ...
[ "function", "Layer", "(", "path", ",", "methods", ",", "middleware", ",", "opts", ")", "{", "this", ".", "opts", "=", "opts", "||", "{", "}", ";", "this", ".", "name", "=", "this", ".", "opts", ".", "name", "||", "null", ";", "this", ".", "method...
Initialize a new routing Layer with given `method`, `path`, and `middleware`. @param {String|RegExp} path Path string or regular expression. @param {Array} methods Array of HTTP verbs. @param {Array} middleware Layer callback/middleware or series of. @param {Object=} opts @param {String=} opts.name route name @param {...
[ "Initialize", "a", "new", "routing", "Layer", "with", "given", "method", "path", "and", "middleware", "." ]
49498ff35138edb218b90b58dd99dfe9b53ae916
https://github.com/ZijianHe/koa-router/blob/49498ff35138edb218b90b58dd99dfe9b53ae916/lib/layer.js#L21-L50
train
dropbox/zxcvbn
demo/mustache.js
debug
function debug(e, template, line, file) { file = file || "<template>"; var lines = template.split("\n"), start = Math.max(line - 3, 0), end = Math.min(lines.length, line + 3), context = lines.slice(start, end); var c; for (var i = 0, len = context.length; i < len; ++i) { ...
javascript
function debug(e, template, line, file) { file = file || "<template>"; var lines = template.split("\n"), start = Math.max(line - 3, 0), end = Math.min(lines.length, line + 3), context = lines.slice(start, end); var c; for (var i = 0, len = context.length; i < len; ++i) { ...
[ "function", "debug", "(", "e", ",", "template", ",", "line", ",", "file", ")", "{", "file", "=", "file", "||", "\"<template>\"", ";", "var", "lines", "=", "template", ".", "split", "(", "\"\\n\"", ")", ",", "start", "=", "Math", ".", "max", "(", "l...
Adds the `template`, `line`, and `file` properties to the given error object and alters the message to provide more useful debugging information.
[ "Adds", "the", "template", "line", "and", "file", "properties", "to", "the", "given", "error", "object", "and", "alters", "the", "message", "to", "provide", "more", "useful", "debugging", "information", "." ]
67c4ece9efc40c9d0a1d7d995b2b22a91be500c2
https://github.com/dropbox/zxcvbn/blob/67c4ece9efc40c9d0a1d7d995b2b22a91be500c2/demo/mustache.js#L102-L122
train
dropbox/zxcvbn
demo/mustache.js
lookup
function lookup(name, stack, defaultValue) { if (name === ".") { return stack[stack.length - 1]; } var names = name.split("."); var lastIndex = names.length - 1; var target = names[lastIndex]; var value, context, i = stack.length, j, localStack; while (i) { localStack = stack.s...
javascript
function lookup(name, stack, defaultValue) { if (name === ".") { return stack[stack.length - 1]; } var names = name.split("."); var lastIndex = names.length - 1; var target = names[lastIndex]; var value, context, i = stack.length, j, localStack; while (i) { localStack = stack.s...
[ "function", "lookup", "(", "name", ",", "stack", ",", "defaultValue", ")", "{", "if", "(", "name", "===", "\".\"", ")", "{", "return", "stack", "[", "stack", ".", "length", "-", "1", "]", ";", "}", "var", "names", "=", "name", ".", "split", "(", ...
Looks up the value of the given `name` in the given context `stack`.
[ "Looks", "up", "the", "value", "of", "the", "given", "name", "in", "the", "given", "context", "stack", "." ]
67c4ece9efc40c9d0a1d7d995b2b22a91be500c2
https://github.com/dropbox/zxcvbn/blob/67c4ece9efc40c9d0a1d7d995b2b22a91be500c2/demo/mustache.js#L127-L168
train
dropbox/zxcvbn
demo/mustache.js
_compile
function _compile(template, options) { var args = "view,partials,stack,lookup,escapeHTML,renderSection,render"; var body = parse(template, options); var fn = new Function(args, body); // This anonymous function wraps the generated function so we can do // argument coercion, setup some variables, an...
javascript
function _compile(template, options) { var args = "view,partials,stack,lookup,escapeHTML,renderSection,render"; var body = parse(template, options); var fn = new Function(args, body); // This anonymous function wraps the generated function so we can do // argument coercion, setup some variables, an...
[ "function", "_compile", "(", "template", ",", "options", ")", "{", "var", "args", "=", "\"view,partials,stack,lookup,escapeHTML,renderSection,render\"", ";", "var", "body", "=", "parse", "(", "template", ",", "options", ")", ";", "var", "fn", "=", "new", "Functi...
Used by `compile` to generate a reusable function for the given `template`.
[ "Used", "by", "compile", "to", "generate", "a", "reusable", "function", "for", "the", "given", "template", "." ]
67c4ece9efc40c9d0a1d7d995b2b22a91be500c2
https://github.com/dropbox/zxcvbn/blob/67c4ece9efc40c9d0a1d7d995b2b22a91be500c2/demo/mustache.js#L471-L490
train
AliasIO/Wappalyzer
src/wappalyzer.js
addDetected
function addDetected(app, pattern, type, value, key) { app.detected = true; // Set confidence level app.confidence[`${type} ${key ? `${key} ` : ''}${pattern.regex}`] = pattern.confidence === undefined ? 100 : parseInt(pattern.confidence, 10); // Detect version number if (pattern.version) { const version...
javascript
function addDetected(app, pattern, type, value, key) { app.detected = true; // Set confidence level app.confidence[`${type} ${key ? `${key} ` : ''}${pattern.regex}`] = pattern.confidence === undefined ? 100 : parseInt(pattern.confidence, 10); // Detect version number if (pattern.version) { const version...
[ "function", "addDetected", "(", "app", ",", "pattern", ",", "type", ",", "value", ",", "key", ")", "{", "app", ".", "detected", "=", "true", ";", "// Set confidence level", "app", ".", "confidence", "[", "`", "${", "type", "}", "${", "key", "?", "`", ...
Mark application as detected, set confidence and version
[ "Mark", "application", "as", "detected", "set", "confidence", "and", "version" ]
47c1c22712f3108c194444f11c0ca317d5df8b9a
https://github.com/AliasIO/Wappalyzer/blob/47c1c22712f3108c194444f11c0ca317d5df8b9a/src/wappalyzer.js#L32-L68
train
AliasIO/Wappalyzer
src/drivers/webextension/js/driver.js
getOption
function getOption(name, defaultValue = null) { return new Promise(async (resolve, reject) => { let value = defaultValue; try { const option = await browser.storage.local.get(name); if (option[name] !== undefined) { value = option[name]; } } catch (error) { wappalyzer.log...
javascript
function getOption(name, defaultValue = null) { return new Promise(async (resolve, reject) => { let value = defaultValue; try { const option = await browser.storage.local.get(name); if (option[name] !== undefined) { value = option[name]; } } catch (error) { wappalyzer.log...
[ "function", "getOption", "(", "name", ",", "defaultValue", "=", "null", ")", "{", "return", "new", "Promise", "(", "async", "(", "resolve", ",", "reject", ")", "=>", "{", "let", "value", "=", "defaultValue", ";", "try", "{", "const", "option", "=", "aw...
Get a value from localStorage
[ "Get", "a", "value", "from", "localStorage" ]
47c1c22712f3108c194444f11c0ca317d5df8b9a
https://github.com/AliasIO/Wappalyzer/blob/47c1c22712f3108c194444f11c0ca317d5df8b9a/src/drivers/webextension/js/driver.js#L43-L61
train
AliasIO/Wappalyzer
src/drivers/webextension/js/driver.js
setOption
function setOption(name, value) { return new Promise(async (resolve, reject) => { try { await browser.storage.local.set({ [name]: value }); } catch (error) { wappalyzer.log(error.message, 'driver', 'error'); return reject(error.message); } return resolve(); }); }
javascript
function setOption(name, value) { return new Promise(async (resolve, reject) => { try { await browser.storage.local.set({ [name]: value }); } catch (error) { wappalyzer.log(error.message, 'driver', 'error'); return reject(error.message); } return resolve(); }); }
[ "function", "setOption", "(", "name", ",", "value", ")", "{", "return", "new", "Promise", "(", "async", "(", "resolve", ",", "reject", ")", "=>", "{", "try", "{", "await", "browser", ".", "storage", ".", "local", ".", "set", "(", "{", "[", "name", ...
Set a value in localStorage
[ "Set", "a", "value", "in", "localStorage" ]
47c1c22712f3108c194444f11c0ca317d5df8b9a
https://github.com/AliasIO/Wappalyzer/blob/47c1c22712f3108c194444f11c0ca317d5df8b9a/src/drivers/webextension/js/driver.js#L66-L78
train
AliasIO/Wappalyzer
src/drivers/webextension/js/driver.js
openTab
function openTab(args) { browser.tabs.create({ url: args.url, active: args.background === undefined || !args.background, }); }
javascript
function openTab(args) { browser.tabs.create({ url: args.url, active: args.background === undefined || !args.background, }); }
[ "function", "openTab", "(", "args", ")", "{", "browser", ".", "tabs", ".", "create", "(", "{", "url", ":", "args", ".", "url", ",", "active", ":", "args", ".", "background", "===", "undefined", "||", "!", "args", ".", "background", ",", "}", ")", "...
Open a tab
[ "Open", "a", "tab" ]
47c1c22712f3108c194444f11c0ca317d5df8b9a
https://github.com/AliasIO/Wappalyzer/blob/47c1c22712f3108c194444f11c0ca317d5df8b9a/src/drivers/webextension/js/driver.js#L83-L88
train
AliasIO/Wappalyzer
src/drivers/webextension/js/driver.js
post
async function post(url, body) { try { const response = await fetch(url, { method: 'POST', body: JSON.stringify(body), }); wappalyzer.log(`POST ${url}: ${response.status}`, 'driver'); } catch (error) { wappalyzer.log(`POST ${url}: ${error}`, 'driver', 'error'); } }
javascript
async function post(url, body) { try { const response = await fetch(url, { method: 'POST', body: JSON.stringify(body), }); wappalyzer.log(`POST ${url}: ${response.status}`, 'driver'); } catch (error) { wappalyzer.log(`POST ${url}: ${error}`, 'driver', 'error'); } }
[ "async", "function", "post", "(", "url", ",", "body", ")", "{", "try", "{", "const", "response", "=", "await", "fetch", "(", "url", ",", "{", "method", ":", "'POST'", ",", "body", ":", "JSON", ".", "stringify", "(", "body", ")", ",", "}", ")", ";...
Make a POST request
[ "Make", "a", "POST", "request" ]
47c1c22712f3108c194444f11c0ca317d5df8b9a
https://github.com/AliasIO/Wappalyzer/blob/47c1c22712f3108c194444f11c0ca317d5df8b9a/src/drivers/webextension/js/driver.js#L93-L104
train
vuex-orm/vuex-orm
dist/vuex-orm.esm.js
function (it, S) { if (!_isObject(it)) return it; var fn, val; if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val; if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val; if (!S && typeof (fn = it.toString) == 'function' && !_isObject...
javascript
function (it, S) { if (!_isObject(it)) return it; var fn, val; if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val; if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val; if (!S && typeof (fn = it.toString) == 'function' && !_isObject...
[ "function", "(", "it", ",", "S", ")", "{", "if", "(", "!", "_isObject", "(", "it", ")", ")", "return", "it", ";", "var", "fn", ",", "val", ";", "if", "(", "S", "&&", "typeof", "(", "fn", "=", "it", ".", "toString", ")", "==", "'function'", "&...
instead of the ES6 spec version, we didn't implement @@toPrimitive case and the second argument - flag - preferred type is a string
[ "instead", "of", "the", "ES6", "spec", "version", "we", "didn", "t", "implement" ]
36ab228a09566b1f6cdce9cec90d5795760120cb
https://github.com/vuex-orm/vuex-orm/blob/36ab228a09566b1f6cdce9cec90d5795760120cb/dist/vuex-orm.esm.js#L57-L64
train
vuex-orm/vuex-orm
dist/vuex-orm.esm.js
isEmpty
function isEmpty(data) { if (Array.isArray(data)) { return data.length === 0; } return Object.keys(data).length === 0; }
javascript
function isEmpty(data) { if (Array.isArray(data)) { return data.length === 0; } return Object.keys(data).length === 0; }
[ "function", "isEmpty", "(", "data", ")", "{", "if", "(", "Array", ".", "isArray", "(", "data", ")", ")", "{", "return", "data", ".", "length", "===", "0", ";", "}", "return", "Object", ".", "keys", "(", "data", ")", ".", "length", "===", "0", ";"...
Check if the given array or object is empty.
[ "Check", "if", "the", "given", "array", "or", "object", "is", "empty", "." ]
36ab228a09566b1f6cdce9cec90d5795760120cb
https://github.com/vuex-orm/vuex-orm/blob/36ab228a09566b1f6cdce9cec90d5795760120cb/dist/vuex-orm.esm.js#L532-L537
train
vuex-orm/vuex-orm
dist/vuex-orm.esm.js
forOwn
function forOwn(object, iteratee) { Object.keys(object).forEach(function (key) { return iteratee(object[key], key, object); }); }
javascript
function forOwn(object, iteratee) { Object.keys(object).forEach(function (key) { return iteratee(object[key], key, object); }); }
[ "function", "forOwn", "(", "object", ",", "iteratee", ")", "{", "Object", ".", "keys", "(", "object", ")", ".", "forEach", "(", "function", "(", "key", ")", "{", "return", "iteratee", "(", "object", "[", "key", "]", ",", "key", ",", "object", ")", ...
Iterates over own enumerable string keyed properties of an object and invokes `iteratee` for each property.
[ "Iterates", "over", "own", "enumerable", "string", "keyed", "properties", "of", "an", "object", "and", "invokes", "iteratee", "for", "each", "property", "." ]
36ab228a09566b1f6cdce9cec90d5795760120cb
https://github.com/vuex-orm/vuex-orm/blob/36ab228a09566b1f6cdce9cec90d5795760120cb/dist/vuex-orm.esm.js#L542-L544
train
vuex-orm/vuex-orm
dist/vuex-orm.esm.js
map
function map(object, iteratee) { return Object.keys(object).map(function (key) { return iteratee(object[key], key, object); }); }
javascript
function map(object, iteratee) { return Object.keys(object).map(function (key) { return iteratee(object[key], key, object); }); }
[ "function", "map", "(", "object", ",", "iteratee", ")", "{", "return", "Object", ".", "keys", "(", "object", ")", ".", "map", "(", "function", "(", "key", ")", "{", "return", "iteratee", "(", "object", "[", "key", "]", ",", "key", ",", "object", ")...
Create an array from the object.
[ "Create", "an", "array", "from", "the", "object", "." ]
36ab228a09566b1f6cdce9cec90d5795760120cb
https://github.com/vuex-orm/vuex-orm/blob/36ab228a09566b1f6cdce9cec90d5795760120cb/dist/vuex-orm.esm.js#L548-L552
train
vuex-orm/vuex-orm
dist/vuex-orm.esm.js
orderBy
function orderBy(collection, keys, directions) { var index = -1; var result = collection.map(function (value) { var criteria = keys.map(function (key) { return value[key]; }); return { criteria: criteria, index: ++index, value: value }; }); return baseSortBy(result, function (object, oth...
javascript
function orderBy(collection, keys, directions) { var index = -1; var result = collection.map(function (value) { var criteria = keys.map(function (key) { return value[key]; }); return { criteria: criteria, index: ++index, value: value }; }); return baseSortBy(result, function (object, oth...
[ "function", "orderBy", "(", "collection", ",", "keys", ",", "directions", ")", "{", "var", "index", "=", "-", "1", ";", "var", "result", "=", "collection", ".", "map", "(", "function", "(", "value", ")", "{", "var", "criteria", "=", "keys", ".", "map...
Creates an array of elements, sorted in specified order by the results of running each element in a collection thru each iteratee.
[ "Creates", "an", "array", "of", "elements", "sorted", "in", "specified", "order", "by", "the", "results", "of", "running", "each", "element", "in", "a", "collection", "thru", "each", "iteratee", "." ]
36ab228a09566b1f6cdce9cec90d5795760120cb
https://github.com/vuex-orm/vuex-orm/blob/36ab228a09566b1f6cdce9cec90d5795760120cb/dist/vuex-orm.esm.js#L583-L592
train
vuex-orm/vuex-orm
dist/vuex-orm.esm.js
groupBy
function groupBy(collection, iteratee) { return collection.reduce(function (records, record) { var key = iteratee(record); if (records[key] === undefined) { records[key] = []; } records[key].push(record); return records; }, {}); }
javascript
function groupBy(collection, iteratee) { return collection.reduce(function (records, record) { var key = iteratee(record); if (records[key] === undefined) { records[key] = []; } records[key].push(record); return records; }, {}); }
[ "function", "groupBy", "(", "collection", ",", "iteratee", ")", "{", "return", "collection", ".", "reduce", "(", "function", "(", "records", ",", "record", ")", "{", "var", "key", "=", "iteratee", "(", "record", ")", ";", "if", "(", "records", "[", "ke...
Creates an object composed of keys generated from the results of running each element of collection thru iteratee.
[ "Creates", "an", "object", "composed", "of", "keys", "generated", "from", "the", "results", "of", "running", "each", "element", "of", "collection", "thru", "iteratee", "." ]
36ab228a09566b1f6cdce9cec90d5795760120cb
https://github.com/vuex-orm/vuex-orm/blob/36ab228a09566b1f6cdce9cec90d5795760120cb/dist/vuex-orm.esm.js#L597-L606
train
vuex-orm/vuex-orm
dist/vuex-orm.esm.js
Type
function Type(model, value, mutator) { var _this = _super.call(this, model) /* istanbul ignore next */ || this; /** * Whether if the attribute can accept `null` as a value. */ _this.isNullable = false; _this.value = value; _this.mutator = mutator; return...
javascript
function Type(model, value, mutator) { var _this = _super.call(this, model) /* istanbul ignore next */ || this; /** * Whether if the attribute can accept `null` as a value. */ _this.isNullable = false; _this.value = value; _this.mutator = mutator; return...
[ "function", "Type", "(", "model", ",", "value", ",", "mutator", ")", "{", "var", "_this", "=", "_super", ".", "call", "(", "this", ",", "model", ")", "/* istanbul ignore next */", "||", "this", ";", "/**\n * Whether if the attribute can accept `null` as a va...
Create a new type instance.
[ "Create", "a", "new", "type", "instance", "." ]
36ab228a09566b1f6cdce9cec90d5795760120cb
https://github.com/vuex-orm/vuex-orm/blob/36ab228a09566b1f6cdce9cec90d5795760120cb/dist/vuex-orm.esm.js#L685-L694
train
vuex-orm/vuex-orm
dist/vuex-orm.esm.js
Attr
function Attr(model, value, mutator) { var _this = _super.call(this, model, value, mutator) /* istanbul ignore next */ || this; _this.value = value; return _this; }
javascript
function Attr(model, value, mutator) { var _this = _super.call(this, model, value, mutator) /* istanbul ignore next */ || this; _this.value = value; return _this; }
[ "function", "Attr", "(", "model", ",", "value", ",", "mutator", ")", "{", "var", "_this", "=", "_super", ".", "call", "(", "this", ",", "model", ",", "value", ",", "mutator", ")", "/* istanbul ignore next */", "||", "this", ";", "_this", ".", "value", ...
Create a new attr instance.
[ "Create", "a", "new", "attr", "instance", "." ]
36ab228a09566b1f6cdce9cec90d5795760120cb
https://github.com/vuex-orm/vuex-orm/blob/36ab228a09566b1f6cdce9cec90d5795760120cb/dist/vuex-orm.esm.js#L717-L721
train
vuex-orm/vuex-orm
dist/vuex-orm.esm.js
HasOne
function HasOne(model, related, foreignKey, localKey) { var _this = _super.call(this, model) /* istanbul ignore next */ || this; _this.related = _this.model.relation(related); _this.foreignKey = foreignKey; _this.localKey = localKey; return _this; }
javascript
function HasOne(model, related, foreignKey, localKey) { var _this = _super.call(this, model) /* istanbul ignore next */ || this; _this.related = _this.model.relation(related); _this.foreignKey = foreignKey; _this.localKey = localKey; return _this; }
[ "function", "HasOne", "(", "model", ",", "related", ",", "foreignKey", ",", "localKey", ")", "{", "var", "_this", "=", "_super", ".", "call", "(", "this", ",", "model", ")", "/* istanbul ignore next */", "||", "this", ";", "_this", ".", "related", "=", "...
Create a new has one instance.
[ "Create", "a", "new", "has", "one", "instance", "." ]
36ab228a09566b1f6cdce9cec90d5795760120cb
https://github.com/vuex-orm/vuex-orm/blob/36ab228a09566b1f6cdce9cec90d5795760120cb/dist/vuex-orm.esm.js#L956-L962
train
vuex-orm/vuex-orm
dist/vuex-orm.esm.js
HasManyBy
function HasManyBy(model, parent, foreignKey, ownerKey) { var _this = _super.call(this, model) /* istanbul ignore next */ || this; _this.parent = _this.model.relation(parent); _this.foreignKey = foreignKey; _this.ownerKey = ownerKey; return _this; }
javascript
function HasManyBy(model, parent, foreignKey, ownerKey) { var _this = _super.call(this, model) /* istanbul ignore next */ || this; _this.parent = _this.model.relation(parent); _this.foreignKey = foreignKey; _this.ownerKey = ownerKey; return _this; }
[ "function", "HasManyBy", "(", "model", ",", "parent", ",", "foreignKey", ",", "ownerKey", ")", "{", "var", "_this", "=", "_super", ".", "call", "(", "this", ",", "model", ")", "/* istanbul ignore next */", "||", "this", ";", "_this", ".", "parent", "=", ...
Create a new has many by instance.
[ "Create", "a", "new", "has", "many", "by", "instance", "." ]
36ab228a09566b1f6cdce9cec90d5795760120cb
https://github.com/vuex-orm/vuex-orm/blob/36ab228a09566b1f6cdce9cec90d5795760120cb/dist/vuex-orm.esm.js#L1216-L1222
train
vuex-orm/vuex-orm
dist/vuex-orm.esm.js
HasManyThrough
function HasManyThrough(model, related, through, firstKey, secondKey, localKey, secondLocalKey) { var _this = _super.call(this, model) /* istanbul ignore next */ || this; _this.related = _this.model.relation(related); _this.through = _this.model.relation(through); _this.firstKey = firstK...
javascript
function HasManyThrough(model, related, through, firstKey, secondKey, localKey, secondLocalKey) { var _this = _super.call(this, model) /* istanbul ignore next */ || this; _this.related = _this.model.relation(related); _this.through = _this.model.relation(through); _this.firstKey = firstK...
[ "function", "HasManyThrough", "(", "model", ",", "related", ",", "through", ",", "firstKey", ",", "secondKey", ",", "localKey", ",", "secondLocalKey", ")", "{", "var", "_this", "=", "_super", ".", "call", "(", "this", ",", "model", ")", "/* istanbul ignore n...
Create a new has many through instance.
[ "Create", "a", "new", "has", "many", "through", "instance", "." ]
36ab228a09566b1f6cdce9cec90d5795760120cb
https://github.com/vuex-orm/vuex-orm/blob/36ab228a09566b1f6cdce9cec90d5795760120cb/dist/vuex-orm.esm.js#L1288-L1297
train
vuex-orm/vuex-orm
dist/vuex-orm.esm.js
MorphTo
function MorphTo(model, id, type) { var _this = _super.call(this, model) /* istanbul ignore next */ || this; _this.id = id; _this.type = type; return _this; }
javascript
function MorphTo(model, id, type) { var _this = _super.call(this, model) /* istanbul ignore next */ || this; _this.id = id; _this.type = type; return _this; }
[ "function", "MorphTo", "(", "model", ",", "id", ",", "type", ")", "{", "var", "_this", "=", "_super", ".", "call", "(", "this", ",", "model", ")", "/* istanbul ignore next */", "||", "this", ";", "_this", ".", "id", "=", "id", ";", "_this", ".", "typ...
Create a new morph to instance.
[ "Create", "a", "new", "morph", "to", "instance", "." ]
36ab228a09566b1f6cdce9cec90d5795760120cb
https://github.com/vuex-orm/vuex-orm/blob/36ab228a09566b1f6cdce9cec90d5795760120cb/dist/vuex-orm.esm.js#L1480-L1485
train
vuex-orm/vuex-orm
dist/vuex-orm.esm.js
denormalizeImmutable
function denormalizeImmutable(schema, input, unvisit) { return Object.keys(schema).reduce(function (object, key) { // Immutable maps cast keys to strings on write so we need to ensure // we're accessing them using string keys. var stringKey = '' + key; if (object.has(stringKey)) { return object...
javascript
function denormalizeImmutable(schema, input, unvisit) { return Object.keys(schema).reduce(function (object, key) { // Immutable maps cast keys to strings on write so we need to ensure // we're accessing them using string keys. var stringKey = '' + key; if (object.has(stringKey)) { return object...
[ "function", "denormalizeImmutable", "(", "schema", ",", "input", ",", "unvisit", ")", "{", "return", "Object", ".", "keys", "(", "schema", ")", ".", "reduce", "(", "function", "(", "object", ",", "key", ")", "{", "// Immutable maps cast keys to strings on write ...
Denormalize an immutable entity. @param {Schema} schema @param {Immutable.Map|Immutable.Record} input @param {function} unvisit @param {function} getDenormalizedEntity @return {Immutable.Map|Immutable.Record}
[ "Denormalize", "an", "immutable", "entity", "." ]
36ab228a09566b1f6cdce9cec90d5795760120cb
https://github.com/vuex-orm/vuex-orm/blob/36ab228a09566b1f6cdce9cec90d5795760120cb/dist/vuex-orm.esm.js#L2553-L2565
train
vuex-orm/vuex-orm
dist/vuex-orm.esm.js
Query
function Query(state, entity) { /** * Primary key ids to filter records by. It is used for filtering records * direct key lookup when a user is trying to fetch records by its * primary key. * * It should not be used if there is a logic which prevents index usage, for...
javascript
function Query(state, entity) { /** * Primary key ids to filter records by. It is used for filtering records * direct key lookup when a user is trying to fetch records by its * primary key. * * It should not be used if there is a logic which prevents index usage, for...
[ "function", "Query", "(", "state", ",", "entity", ")", "{", "/**\n * Primary key ids to filter records by. It is used for filtering records\n * direct key lookup when a user is trying to fetch records by its\n * primary key.\n *\n * It should not be used if th...
Create a new Query instance.
[ "Create", "a", "new", "Query", "instance", "." ]
36ab228a09566b1f6cdce9cec90d5795760120cb
https://github.com/vuex-orm/vuex-orm/blob/36ab228a09566b1f6cdce9cec90d5795760120cb/dist/vuex-orm.esm.js#L3769-L3823
train
vuex-orm/vuex-orm
dist/vuex-orm.esm.js
function (context, payload) { var state = context.state; var entity = state.$name; return context.dispatch(state.$connection + "/insertOrUpdate", __assign({ entity: entity }, payload), { root: true }); }
javascript
function (context, payload) { var state = context.state; var entity = state.$name; return context.dispatch(state.$connection + "/insertOrUpdate", __assign({ entity: entity }, payload), { root: true }); }
[ "function", "(", "context", ",", "payload", ")", "{", "var", "state", "=", "context", ".", "state", ";", "var", "entity", "=", "state", ".", "$name", ";", "return", "context", ".", "dispatch", "(", "state", ".", "$connection", "+", "\"/insertOrUpdate\"", ...
Insert or update given data to the state. Unlike `insert`, this method will not replace existing data within the state, but it will update only the submitted data with the same primary key.
[ "Insert", "or", "update", "given", "data", "to", "the", "state", ".", "Unlike", "insert", "this", "method", "will", "not", "replace", "existing", "data", "within", "the", "state", "but", "it", "will", "update", "only", "the", "submitted", "data", "with", "...
36ab228a09566b1f6cdce9cec90d5795760120cb
https://github.com/vuex-orm/vuex-orm/blob/36ab228a09566b1f6cdce9cec90d5795760120cb/dist/vuex-orm.esm.js#L4717-L4721
train
vuex-orm/vuex-orm
dist/vuex-orm.esm.js
function (state, payload) { var entity = payload.entity; var data = payload.data; var options = OptionsBuilder.createPersistOptions(payload); var result = payload.result; result.data = (new Query(state, entity)).create(data, options); }
javascript
function (state, payload) { var entity = payload.entity; var data = payload.data; var options = OptionsBuilder.createPersistOptions(payload); var result = payload.result; result.data = (new Query(state, entity)).create(data, options); }
[ "function", "(", "state", ",", "payload", ")", "{", "var", "entity", "=", "payload", ".", "entity", ";", "var", "data", "=", "payload", ".", "data", ";", "var", "options", "=", "OptionsBuilder", ".", "createPersistOptions", "(", "payload", ")", ";", "var...
Save given data to the store by replacing all existing records in the store. If you want to save data without replacing existing records, use the `insert` method instead.
[ "Save", "given", "data", "to", "the", "store", "by", "replacing", "all", "existing", "records", "in", "the", "store", ".", "If", "you", "want", "to", "save", "data", "without", "replacing", "existing", "records", "use", "the", "insert", "method", "instead", ...
36ab228a09566b1f6cdce9cec90d5795760120cb
https://github.com/vuex-orm/vuex-orm/blob/36ab228a09566b1f6cdce9cec90d5795760120cb/dist/vuex-orm.esm.js#L4903-L4909
train
vuex-orm/vuex-orm
dist/vuex-orm.esm.js
Schema
function Schema(model) { var _this = this; /** * List of generated schemas. */ this.schemas = {}; this.model = model; var models = model.database().models(); Object.keys(models).forEach(function (name) { _this.one(models[name]); }); }
javascript
function Schema(model) { var _this = this; /** * List of generated schemas. */ this.schemas = {}; this.model = model; var models = model.database().models(); Object.keys(models).forEach(function (name) { _this.one(models[name]); }); }
[ "function", "Schema", "(", "model", ")", "{", "var", "_this", "=", "this", ";", "/**\n * List of generated schemas.\n */", "this", ".", "schemas", "=", "{", "}", ";", "this", ".", "model", "=", "model", ";", "var", "models", "=", "model", "."...
Create a new schema instance.
[ "Create", "a", "new", "schema", "instance", "." ]
36ab228a09566b1f6cdce9cec90d5795760120cb
https://github.com/vuex-orm/vuex-orm/blob/36ab228a09566b1f6cdce9cec90d5795760120cb/dist/vuex-orm.esm.js#L5041-L5050
train
sdelements/lets-chat
media/js/util/message.js
encodeEntities
function encodeEntities(value) { return value. replace(/&/g, '&amp;'). replace(surrogatePairRegexp, function(value) { var hi = value.charCodeAt(0), low = value.charCodeAt(1); return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x1...
javascript
function encodeEntities(value) { return value. replace(/&/g, '&amp;'). replace(surrogatePairRegexp, function(value) { var hi = value.charCodeAt(0), low = value.charCodeAt(1); return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x1...
[ "function", "encodeEntities", "(", "value", ")", "{", "return", "value", ".", "replace", "(", "/", "&", "/", "g", ",", "'&amp;'", ")", ".", "replace", "(", "surrogatePairRegexp", ",", "function", "(", "value", ")", "{", "var", "hi", "=", "value", ".", ...
Message Text Formatting
[ "Message", "Text", "Formatting" ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/util/message.js#L19-L32
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function(value, token) { var score, pos; if (!value) return 0; value = String(value || ''); pos = value.search(token.regex); if (pos === -1) return 0; score = token.string.length / value.length; if (pos === 0) score += 0.5; return score; }
javascript
function(value, token) { var score, pos; if (!value) return 0; value = String(value || ''); pos = value.search(token.regex); if (pos === -1) return 0; score = token.string.length / value.length; if (pos === 0) score += 0.5; return score; }
[ "function", "(", "value", ",", "token", ")", "{", "var", "score", ",", "pos", ";", "if", "(", "!", "value", ")", "return", "0", ";", "value", "=", "String", "(", "value", "||", "''", ")", ";", "pos", "=", "value", ".", "search", "(", "token", "...
Calculates how close of a match the given value is against a search token. @param {mixed} value @param {object} token @return {number}
[ "Calculates", "how", "close", "of", "a", "match", "the", "given", "value", "is", "against", "a", "search", "token", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L133-L143
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function(a, b) { if (typeof a === 'number' && typeof b === 'number') { return a > b ? 1 : (a < b ? -1 : 0); } a = asciifold(String(a || '')); b = asciifold(String(b || '')); if (a > b) return 1; if (b > a) return -1; return 0; }
javascript
function(a, b) { if (typeof a === 'number' && typeof b === 'number') { return a > b ? 1 : (a < b ? -1 : 0); } a = asciifold(String(a || '')); b = asciifold(String(b || '')); if (a > b) return 1; if (b > a) return -1; return 0; }
[ "function", "(", "a", ",", "b", ")", "{", "if", "(", "typeof", "a", "===", "'number'", "&&", "typeof", "b", "===", "'number'", ")", "{", "return", "a", ">", "b", "?", "1", ":", "(", "a", "<", "b", "?", "-", "1", ":", "0", ")", ";", "}", "...
utilities - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[ "utilities", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-" ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L390-L399
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function(self, types, fn) { var type; var trigger = self.trigger; var event_args = {}; // override trigger method self.trigger = function() { var type = arguments[0]; if (types.indexOf(type) !== -1) { event_args[type] = arguments; } else { return trigger.apply(self, arguments); } }; ...
javascript
function(self, types, fn) { var type; var trigger = self.trigger; var event_args = {}; // override trigger method self.trigger = function() { var type = arguments[0]; if (types.indexOf(type) !== -1) { event_args[type] = arguments; } else { return trigger.apply(self, arguments); } }; ...
[ "function", "(", "self", ",", "types", ",", "fn", ")", "{", "var", "type", ";", "var", "trigger", "=", "self", ".", "trigger", ";", "var", "event_args", "=", "{", "}", ";", "// override trigger method", "self", ".", "trigger", "=", "function", "(", ")"...
Debounce all fired events types listed in `types` while executing the provided `fn`. @param {object} self @param {array} types @param {function} fn
[ "Debounce", "all", "fired", "events", "types", "listed", "in", "types", "while", "executing", "the", "provided", "fn", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L864-L889
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function($from, $to, properties) { var i, n, styles = {}; if (properties) { for (i = 0, n = properties.length; i < n; i++) { styles[properties[i]] = $from.css(properties[i]); } } else { styles = $from.css(); } $to.css(styles); }
javascript
function($from, $to, properties) { var i, n, styles = {}; if (properties) { for (i = 0, n = properties.length; i < n; i++) { styles[properties[i]] = $from.css(properties[i]); } } else { styles = $from.css(); } $to.css(styles); }
[ "function", "(", "$from", ",", "$to", ",", "properties", ")", "{", "var", "i", ",", "n", ",", "styles", "=", "{", "}", ";", "if", "(", "properties", ")", "{", "for", "(", "i", "=", "0", ",", "n", "=", "properties", ".", "length", ";", "i", "<...
Copies CSS properties from one element to another. @param {object} $from @param {object} $to @param {array} properties
[ "Copies", "CSS", "properties", "from", "one", "element", "to", "another", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L942-L952
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function() { var self = this; var field_label = self.settings.labelField; var field_optgroup = self.settings.optgroupLabelField; var templates = { 'optgroup': function(data) { return '<div class="optgroup">' + data.html + '</div>'; }, 'optgroup_header': function(data, escape) { retur...
javascript
function() { var self = this; var field_label = self.settings.labelField; var field_optgroup = self.settings.optgroupLabelField; var templates = { 'optgroup': function(data) { return '<div class="optgroup">' + data.html + '</div>'; }, 'optgroup_header': function(data, escape) { retur...
[ "function", "(", ")", "{", "var", "self", "=", "this", ";", "var", "field_label", "=", "self", ".", "settings", ".", "labelField", ";", "var", "field_optgroup", "=", "self", ".", "settings", ".", "optgroupLabelField", ";", "var", "templates", "=", "{", "...
Sets up default rendering functions.
[ "Sets", "up", "default", "rendering", "functions", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L1330-L1354
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function() { var key, fn, callbacks = { 'initialize' : 'onInitialize', 'change' : 'onChange', 'item_add' : 'onItemAdd', 'item_remove' : 'onItemRemove', 'clear' : 'onClear', 'option_add' : 'onOptionAdd', 'option_remove' : 'onOptionRemove', 'opt...
javascript
function() { var key, fn, callbacks = { 'initialize' : 'onInitialize', 'change' : 'onChange', 'item_add' : 'onItemAdd', 'item_remove' : 'onItemRemove', 'clear' : 'onClear', 'option_add' : 'onOptionAdd', 'option_remove' : 'onOptionRemove', 'opt...
[ "function", "(", ")", "{", "var", "key", ",", "fn", ",", "callbacks", "=", "{", "'initialize'", ":", "'onInitialize'", ",", "'change'", ":", "'onChange'", ",", "'item_add'", ":", "'onItemAdd'", ",", "'item_remove'", ":", "'onItemRemove'", ",", "'clear'", ":"...
Maps fired events to callbacks provided in the settings used when creating the control.
[ "Maps", "fired", "events", "to", "callbacks", "provided", "in", "the", "settings", "used", "when", "creating", "the", "control", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L1360-L1387
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function(e) { var self = this; var defaultPrevented = e.isDefaultPrevented(); var $target = $(e.target); if (self.isFocused) { // retain focus by preventing native handling. if the // event target is the input it should not be modified. // otherwise, text selection within the input won't work....
javascript
function(e) { var self = this; var defaultPrevented = e.isDefaultPrevented(); var $target = $(e.target); if (self.isFocused) { // retain focus by preventing native handling. if the // event target is the input it should not be modified. // otherwise, text selection within the input won't work....
[ "function", "(", "e", ")", "{", "var", "self", "=", "this", ";", "var", "defaultPrevented", "=", "e", ".", "isDefaultPrevented", "(", ")", ";", "var", "$target", "=", "$", "(", "e", ".", "target", ")", ";", "if", "(", "self", ".", "isFocused", ")",...
Triggered when the main control element has a mouse down event. @param {object} e @return {boolean}
[ "Triggered", "when", "the", "main", "control", "element", "has", "a", "mouse", "down", "event", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L1414-L1440
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function(e) { var value, $target, $option, self = this; if (e.preventDefault) { e.preventDefault(); e.stopPropagation(); } $target = $(e.currentTarget); if ($target.hasClass('create')) { self.createItem(null, function() { if (self.settings.closeAfterSelect) { self.close(); ...
javascript
function(e) { var value, $target, $option, self = this; if (e.preventDefault) { e.preventDefault(); e.stopPropagation(); } $target = $(e.currentTarget); if ($target.hasClass('create')) { self.createItem(null, function() { if (self.settings.closeAfterSelect) { self.close(); ...
[ "function", "(", "e", ")", "{", "var", "value", ",", "$target", ",", "$option", ",", "self", "=", "this", ";", "if", "(", "e", ".", "preventDefault", ")", "{", "e", ".", "preventDefault", "(", ")", ";", "e", ".", "stopPropagation", "(", ")", ";", ...
Triggered when the user clicks on an option in the autocomplete dropdown menu. @param {object} e @returns {boolean}
[ "Triggered", "when", "the", "user", "clicks", "on", "an", "option", "in", "the", "autocomplete", "dropdown", "menu", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L1713-L1741
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function(e) { var self = this; if (self.isLocked) return; if (self.settings.mode === 'multi') { e.preventDefault(); self.setActiveItem(e.currentTarget, e); } }
javascript
function(e) { var self = this; if (self.isLocked) return; if (self.settings.mode === 'multi') { e.preventDefault(); self.setActiveItem(e.currentTarget, e); } }
[ "function", "(", "e", ")", "{", "var", "self", "=", "this", ";", "if", "(", "self", ".", "isLocked", ")", "return", ";", "if", "(", "self", ".", "settings", ".", "mode", "===", "'multi'", ")", "{", "e", ".", "preventDefault", "(", ")", ";", "self...
Triggered when the user clicks on an item that has been selected. @param {object} e @returns {boolean}
[ "Triggered", "when", "the", "user", "clicks", "on", "an", "item", "that", "has", "been", "selected", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L1750-L1758
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function(value) { var $input = this.$control_input; var changed = $input.val() !== value; if (changed) { $input.val(value).triggerHandler('update'); this.lastValue = value; } }
javascript
function(value) { var $input = this.$control_input; var changed = $input.val() !== value; if (changed) { $input.val(value).triggerHandler('update'); this.lastValue = value; } }
[ "function", "(", "value", ")", "{", "var", "$input", "=", "this", ".", "$control_input", ";", "var", "changed", "=", "$input", ".", "val", "(", ")", "!==", "value", ";", "if", "(", "changed", ")", "{", "$input", ".", "val", "(", "value", ")", ".", ...
Sets the input field of the control to the specified value. @param {string} value
[ "Sets", "the", "input", "field", "of", "the", "control", "to", "the", "specified", "value", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L1790-L1797
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function(value, silent) { var events = silent ? [] : ['change']; debounce_events(this, events, function() { this.clear(); this.addItems(value, silent); }); }
javascript
function(value, silent) { var events = silent ? [] : ['change']; debounce_events(this, events, function() { this.clear(); this.addItems(value, silent); }); }
[ "function", "(", "value", ",", "silent", ")", "{", "var", "events", "=", "silent", "?", "[", "]", ":", "[", "'change'", "]", ";", "debounce_events", "(", "this", ",", "events", ",", "function", "(", ")", "{", "this", ".", "clear", "(", ")", ";", ...
Resets the selected items to the given value. @param {mixed} value
[ "Resets", "the", "selected", "items", "to", "the", "given", "value", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L1820-L1827
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function($item, e) { var self = this; var eventName; var i, idx, begin, end, item, swap; var $last; if (self.settings.mode === 'single') return; $item = $($item); // clear the active selection if (!$item.length) { $(self.$activeItems).removeClass('active'); self.$activeItems = []; ...
javascript
function($item, e) { var self = this; var eventName; var i, idx, begin, end, item, swap; var $last; if (self.settings.mode === 'single') return; $item = $($item); // clear the active selection if (!$item.length) { $(self.$activeItems).removeClass('active'); self.$activeItems = []; ...
[ "function", "(", "$item", ",", "e", ")", "{", "var", "self", "=", "this", ";", "var", "eventName", ";", "var", "i", ",", "idx", ",", "begin", ",", "end", ",", "item", ",", "swap", ";", "var", "$last", ";", "if", "(", "self", ".", "settings", "....
Sets the selected item. @param {object} $item @param {object} e (optional)
[ "Sets", "the", "selected", "item", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L1835-L1892
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function() { var self = this; self.setTextboxValue(''); self.$control_input.css({opacity: 0, position: 'absolute', left: self.rtl ? 10000 : -10000}); self.isInputHidden = true; }
javascript
function() { var self = this; self.setTextboxValue(''); self.$control_input.css({opacity: 0, position: 'absolute', left: self.rtl ? 10000 : -10000}); self.isInputHidden = true; }
[ "function", "(", ")", "{", "var", "self", "=", "this", ";", "self", ".", "setTextboxValue", "(", "''", ")", ";", "self", ".", "$control_input", ".", "css", "(", "{", "opacity", ":", "0", ",", "position", ":", "'absolute'", ",", "left", ":", "self", ...
Hides the input element out of view, while retaining its focus.
[ "Hides", "the", "input", "element", "out", "of", "view", "while", "retaining", "its", "focus", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L1952-L1958
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function() { var self = this; if (self.isDisabled) return; self.ignoreFocus = true; self.$control_input[0].focus(); window.setTimeout(function() { self.ignoreFocus = false; self.onFocus(); }, 0); }
javascript
function() { var self = this; if (self.isDisabled) return; self.ignoreFocus = true; self.$control_input[0].focus(); window.setTimeout(function() { self.ignoreFocus = false; self.onFocus(); }, 0); }
[ "function", "(", ")", "{", "var", "self", "=", "this", ";", "if", "(", "self", ".", "isDisabled", ")", "return", ";", "self", ".", "ignoreFocus", "=", "true", ";", "self", ".", "$control_input", "[", "0", "]", ".", "focus", "(", ")", ";", "window",...
Gives the control focus.
[ "Gives", "the", "control", "focus", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L1971-L1981
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function(query) { var i, value, score, result, calculateScore; var self = this; var settings = self.settings; var options = this.getSearchOptions(); // validate user-provided result scoring function if (settings.score) { calculateScore = self.settings.score.apply(this, [query]); if (typ...
javascript
function(query) { var i, value, score, result, calculateScore; var self = this; var settings = self.settings; var options = this.getSearchOptions(); // validate user-provided result scoring function if (settings.score) { calculateScore = self.settings.score.apply(this, [query]); if (typ...
[ "function", "(", "query", ")", "{", "var", "i", ",", "value", ",", "score", ",", "result", ",", "calculateScore", ";", "var", "self", "=", "this", ";", "var", "settings", "=", "self", ".", "settings", ";", "var", "options", "=", "this", ".", "getSear...
Searches through available options and returns a sorted array of matches. Returns an object containing: - query {string} - tokens {array} - total {int} - items {array} @param {string} query @returns {object}
[ "Searches", "through", "available", "options", "and", "returns", "a", "sorted", "array", "of", "matches", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L2041-L2074
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function(data) { var key = hash_key(data[this.settings.optgroupValueField]); if (!key) return false; data.$order = data.$order || ++this.order; this.optgroups[key] = data; return key; }
javascript
function(data) { var key = hash_key(data[this.settings.optgroupValueField]); if (!key) return false; data.$order = data.$order || ++this.order; this.optgroups[key] = data; return key; }
[ "function", "(", "data", ")", "{", "var", "key", "=", "hash_key", "(", "data", "[", "this", ".", "settings", ".", "optgroupValueField", "]", ")", ";", "if", "(", "!", "key", ")", "return", "false", ";", "data", ".", "$order", "=", "data", ".", "$or...
Registers an option group to the pool of option groups. @param {object} data @return {boolean|string}
[ "Registers", "an", "option", "group", "to", "the", "pool", "of", "option", "groups", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L2251-L2258
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function(id, data) { data[this.settings.optgroupValueField] = id; if (id = this.registerOptionGroup(data)) { this.trigger('optgroup_add', id, data); } }
javascript
function(id, data) { data[this.settings.optgroupValueField] = id; if (id = this.registerOptionGroup(data)) { this.trigger('optgroup_add', id, data); } }
[ "function", "(", "id", ",", "data", ")", "{", "data", "[", "this", ".", "settings", ".", "optgroupValueField", "]", "=", "id", ";", "if", "(", "id", "=", "this", ".", "registerOptionGroup", "(", "data", ")", ")", "{", "this", ".", "trigger", "(", "...
Registers a new optgroup for options to be bucketed into. @param {string} id @param {object} data
[ "Registers", "a", "new", "optgroup", "for", "options", "to", "be", "bucketed", "into", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L2267-L2272
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function(value, data) { var self = this; var $item, $item_new; var value_new, index_item, cache_items, cache_options, order_old; value = hash_key(value); value_new = hash_key(data[self.settings.valueField]); // sanity checks if (value === null) return; if (!self.options.hasOwnProperty(va...
javascript
function(value, data) { var self = this; var $item, $item_new; var value_new, index_item, cache_items, cache_options, order_old; value = hash_key(value); value_new = hash_key(data[self.settings.valueField]); // sanity checks if (value === null) return; if (!self.options.hasOwnProperty(va...
[ "function", "(", "value", ",", "data", ")", "{", "var", "self", "=", "this", ";", "var", "$item", ",", "$item_new", ";", "var", "value_new", ",", "index_item", ",", "cache_items", ",", "cache_options", ",", "order_old", ";", "value", "=", "hash_key", "("...
Updates an option available for selection. If it is visible in the selected items or options dropdown, it will be re-rendered automatically. @param {string} value @param {object} data
[ "Updates", "an", "option", "available", "for", "selection", ".", "If", "it", "is", "visible", "in", "the", "selected", "items", "or", "options", "dropdown", "it", "will", "be", "re", "-", "rendered", "automatically", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L2304-L2358
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function(value, silent) { var self = this; value = hash_key(value); var cache_items = self.renderCache['item']; var cache_options = self.renderCache['option']; if (cache_items) delete cache_items[value]; if (cache_options) delete cache_options[value]; delete self.userOptions[value]; delete s...
javascript
function(value, silent) { var self = this; value = hash_key(value); var cache_items = self.renderCache['item']; var cache_options = self.renderCache['option']; if (cache_items) delete cache_items[value]; if (cache_options) delete cache_options[value]; delete self.userOptions[value]; delete s...
[ "function", "(", "value", ",", "silent", ")", "{", "var", "self", "=", "this", ";", "value", "=", "hash_key", "(", "value", ")", ";", "var", "cache_items", "=", "self", ".", "renderCache", "[", "'item'", "]", ";", "var", "cache_options", "=", "self", ...
Removes a single option. @param {string} value @param {boolean} silent
[ "Removes", "a", "single", "option", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L2366-L2380
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function() { var self = this; self.loadedSearches = {}; self.userOptions = {}; self.renderCache = {}; self.options = self.sifter.items = {}; self.lastQuery = null; self.trigger('option_clear'); self.clear(); }
javascript
function() { var self = this; self.loadedSearches = {}; self.userOptions = {}; self.renderCache = {}; self.options = self.sifter.items = {}; self.lastQuery = null; self.trigger('option_clear'); self.clear(); }
[ "function", "(", ")", "{", "var", "self", "=", "this", ";", "self", ".", "loadedSearches", "=", "{", "}", ";", "self", ".", "userOptions", "=", "{", "}", ";", "self", ".", "renderCache", "=", "{", "}", ";", "self", ".", "options", "=", "self", "....
Clears all options.
[ "Clears", "all", "options", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L2385-L2395
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function(value, $els) { value = hash_key(value); if (typeof value !== 'undefined' && value !== null) { for (var i = 0, n = $els.length; i < n; i++) { if ($els[i].getAttribute('data-value') === value) { return $($els[i]); } } } return $(); }
javascript
function(value, $els) { value = hash_key(value); if (typeof value !== 'undefined' && value !== null) { for (var i = 0, n = $els.length; i < n; i++) { if ($els[i].getAttribute('data-value') === value) { return $($els[i]); } } } return $(); }
[ "function", "(", "value", ",", "$els", ")", "{", "value", "=", "hash_key", "(", "value", ")", ";", "if", "(", "typeof", "value", "!==", "'undefined'", "&&", "value", "!==", "null", ")", "{", "for", "(", "var", "i", "=", "0", ",", "n", "=", "$els"...
Finds the first element with a "data-value" attribute that matches the given value. @param {mixed} value @param {object} $els @return {object}
[ "Finds", "the", "first", "element", "with", "a", "data", "-", "value", "attribute", "that", "matches", "the", "given", "value", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L2431-L2443
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function(values, silent) { var items = $.isArray(values) ? values : [values]; for (var i = 0, n = items.length; i < n; i++) { this.isPending = (i < n - 1); this.addItem(items[i], silent); } }
javascript
function(values, silent) { var items = $.isArray(values) ? values : [values]; for (var i = 0, n = items.length; i < n; i++) { this.isPending = (i < n - 1); this.addItem(items[i], silent); } }
[ "function", "(", "values", ",", "silent", ")", "{", "var", "items", "=", "$", ".", "isArray", "(", "values", ")", "?", "values", ":", "[", "values", "]", ";", "for", "(", "var", "i", "=", "0", ",", "n", "=", "items", ".", "length", ";", "i", ...
"Selects" multiple items at once. Adds them to the list at the current caret position. @param {string} value @param {boolean} silent
[ "Selects", "multiple", "items", "at", "once", ".", "Adds", "them", "to", "the", "list", "at", "the", "current", "caret", "position", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L2463-L2469
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function(input, triggerDropdown) { var self = this; var caret = self.caretPos; input = input || $.trim(self.$control_input.val() || ''); var callback = arguments[arguments.length - 1]; if (typeof callback !== 'function') callback = function() {}; if (typeof triggerDropdown !== 'boolean') { tr...
javascript
function(input, triggerDropdown) { var self = this; var caret = self.caretPos; input = input || $.trim(self.$control_input.val() || ''); var callback = arguments[arguments.length - 1]; if (typeof callback !== 'function') callback = function() {}; if (typeof triggerDropdown !== 'boolean') { tr...
[ "function", "(", "input", ",", "triggerDropdown", ")", "{", "var", "self", "=", "this", ";", "var", "caret", "=", "self", ".", "caretPos", ";", "input", "=", "input", "||", "$", ".", "trim", "(", "self", ".", "$control_input", ".", "val", "(", ")", ...
Invokes the `create` method provided in the selectize options that should provide the data for the new item, given the user input. Once this completes, it will be added to the item list. @param {string} value @param {boolean} [triggerDropdown] @param {function} [callback] @return {boolean}
[ "Invokes", "the", "create", "method", "provided", "in", "the", "selectize", "options", "that", "should", "provide", "the", "data", "for", "the", "new", "item", "given", "the", "user", "input", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L2584-L2631
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function() { var invalid, self = this; if (self.isRequired) { if (self.items.length) self.isInvalid = false; self.$control_input.prop('required', invalid); } self.refreshClasses(); }
javascript
function() { var invalid, self = this; if (self.isRequired) { if (self.items.length) self.isInvalid = false; self.$control_input.prop('required', invalid); } self.refreshClasses(); }
[ "function", "(", ")", "{", "var", "invalid", ",", "self", "=", "this", ";", "if", "(", "self", ".", "isRequired", ")", "{", "if", "(", "self", ".", "items", ".", "length", ")", "self", ".", "isInvalid", "=", "false", ";", "self", ".", "$control_inp...
Updates all state-dependent attributes and CSS classes.
[ "Updates", "all", "state", "-", "dependent", "attributes", "and", "CSS", "classes", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L2651-L2658
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function() { var self = this; var isFull = self.isFull(); var isLocked = self.isLocked; self.$wrapper .toggleClass('rtl', self.rtl); self.$control .toggleClass('focus', self.isFocused) .toggleClass('disabled', self.isDisabled) .toggleClass('required', self.isRequired) .toggl...
javascript
function() { var self = this; var isFull = self.isFull(); var isLocked = self.isLocked; self.$wrapper .toggleClass('rtl', self.rtl); self.$control .toggleClass('focus', self.isFocused) .toggleClass('disabled', self.isDisabled) .toggleClass('required', self.isRequired) .toggl...
[ "function", "(", ")", "{", "var", "self", "=", "this", ";", "var", "isFull", "=", "self", ".", "isFull", "(", ")", ";", "var", "isLocked", "=", "self", ".", "isLocked", ";", "self", ".", "$wrapper", ".", "toggleClass", "(", "'rtl'", ",", "self", "....
Updates all state-dependent CSS classes.
[ "Updates", "all", "state", "-", "dependent", "CSS", "classes", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L2663-L2684
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function() { var self = this; if (self.isLocked || self.isOpen || (self.settings.mode === 'multi' && self.isFull())) return; self.focus(); self.isOpen = true; self.refreshState(); self.$dropdown.css({visibility: 'hidden', display: 'block'}); self.positionDropdown(); self.$dropdown.css({visibil...
javascript
function() { var self = this; if (self.isLocked || self.isOpen || (self.settings.mode === 'multi' && self.isFull())) return; self.focus(); self.isOpen = true; self.refreshState(); self.$dropdown.css({visibility: 'hidden', display: 'block'}); self.positionDropdown(); self.$dropdown.css({visibil...
[ "function", "(", ")", "{", "var", "self", "=", "this", ";", "if", "(", "self", ".", "isLocked", "||", "self", ".", "isOpen", "||", "(", "self", ".", "settings", ".", "mode", "===", "'multi'", "&&", "self", ".", "isFull", "(", ")", ")", ")", "retu...
Shows the autocomplete dropdown containing the available options.
[ "Shows", "the", "autocomplete", "dropdown", "containing", "the", "available", "options", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L2746-L2757
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function() { var $control = this.$control; var offset = this.settings.dropdownParent === 'body' ? $control.offset() : $control.position(); offset.top += $control.outerHeight(true); this.$dropdown.css({ width : $control.outerWidth(), top : offset.top, left : offset.left }); }
javascript
function() { var $control = this.$control; var offset = this.settings.dropdownParent === 'body' ? $control.offset() : $control.position(); offset.top += $control.outerHeight(true); this.$dropdown.css({ width : $control.outerWidth(), top : offset.top, left : offset.left }); }
[ "function", "(", ")", "{", "var", "$control", "=", "this", ".", "$control", ";", "var", "offset", "=", "this", ".", "settings", ".", "dropdownParent", "===", "'body'", "?", "$control", ".", "offset", "(", ")", ":", "$control", ".", "position", "(", ")"...
Calculates and applies the appropriate position of the dropdown.
[ "Calculates", "and", "applies", "the", "appropriate", "position", "of", "the", "dropdown", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L2782-L2792
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function($el) { var caret = Math.min(this.caretPos, this.items.length); if (caret === 0) { this.$control.prepend($el); } else { $(this.$control[0].childNodes[caret]).before($el); } this.setCaret(caret + 1); }
javascript
function($el) { var caret = Math.min(this.caretPos, this.items.length); if (caret === 0) { this.$control.prepend($el); } else { $(this.$control[0].childNodes[caret]).before($el); } this.setCaret(caret + 1); }
[ "function", "(", "$el", ")", "{", "var", "caret", "=", "Math", ".", "min", "(", "this", ".", "caretPos", ",", "this", ".", "items", ".", "length", ")", ";", "if", "(", "caret", "===", "0", ")", "{", "this", ".", "$control", ".", "prepend", "(", ...
A helper method for inserting an element at the current caret position. @param {object} $el
[ "A", "helper", "method", "for", "inserting", "an", "element", "at", "the", "current", "caret", "position", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L2822-L2830
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function(i) { var self = this; if (self.settings.mode === 'single') { i = self.items.length; } else { i = Math.max(0, Math.min(self.items.length, i)); } if(!self.isPending) { // the input must be moved by leaving it in place and moving the // siblings, due to the fact that focus canno...
javascript
function(i) { var self = this; if (self.settings.mode === 'single') { i = self.items.length; } else { i = Math.max(0, Math.min(self.items.length, i)); } if(!self.isPending) { // the input must be moved by leaving it in place and moving the // siblings, due to the fact that focus canno...
[ "function", "(", "i", ")", "{", "var", "self", "=", "this", ";", "if", "(", "self", ".", "settings", ".", "mode", "===", "'single'", ")", "{", "i", "=", "self", ".", "items", ".", "length", ";", "}", "else", "{", "i", "=", "Math", ".", "max", ...
Moves the caret to the specified index. @param {int} i
[ "Moves", "the", "caret", "to", "the", "specified", "index", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L2968-L2994
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function() { var self = this; self.$input.prop('disabled', true); self.$control_input.prop('disabled', true).prop('tabindex', -1); self.isDisabled = true; self.lock(); }
javascript
function() { var self = this; self.$input.prop('disabled', true); self.$control_input.prop('disabled', true).prop('tabindex', -1); self.isDisabled = true; self.lock(); }
[ "function", "(", ")", "{", "var", "self", "=", "this", ";", "self", ".", "$input", ".", "prop", "(", "'disabled'", ",", "true", ")", ";", "self", ".", "$control_input", ".", "prop", "(", "'disabled'", ",", "true", ")", ".", "prop", "(", "'tabindex'",...
Disables user input on the control completely. While disabled, it cannot receive focus.
[ "Disables", "user", "input", "on", "the", "control", "completely", ".", "While", "disabled", "it", "cannot", "receive", "focus", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L3018-L3024
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function() { var self = this; self.$input.prop('disabled', false); self.$control_input.prop('disabled', false).prop('tabindex', self.tabIndex); self.isDisabled = false; self.unlock(); }
javascript
function() { var self = this; self.$input.prop('disabled', false); self.$control_input.prop('disabled', false).prop('tabindex', self.tabIndex); self.isDisabled = false; self.unlock(); }
[ "function", "(", ")", "{", "var", "self", "=", "this", ";", "self", ".", "$input", ".", "prop", "(", "'disabled'", ",", "false", ")", ";", "self", ".", "$control_input", ".", "prop", "(", "'disabled'", ",", "false", ")", ".", "prop", "(", "'tabindex'...
Enables the control so that it can respond to focus and user input.
[ "Enables", "the", "control", "so", "that", "it", "can", "respond", "to", "focus", "and", "user", "input", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L3030-L3036
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function() { var self = this; var eventNS = self.eventNS; var revertSettings = self.revertSettings; self.trigger('destroy'); self.off(); self.$wrapper.remove(); self.$dropdown.remove(); self.$input .html('') .append(revertSettings.$children) .removeAttr('tabindex') .removeCla...
javascript
function() { var self = this; var eventNS = self.eventNS; var revertSettings = self.revertSettings; self.trigger('destroy'); self.off(); self.$wrapper.remove(); self.$dropdown.remove(); self.$input .html('') .append(revertSettings.$children) .removeAttr('tabindex') .removeCla...
[ "function", "(", ")", "{", "var", "self", "=", "this", ";", "var", "eventNS", "=", "self", ".", "eventNS", ";", "var", "revertSettings", "=", "self", ".", "revertSettings", ";", "self", ".", "trigger", "(", "'destroy'", ")", ";", "self", ".", "off", ...
Completely destroys the control and unbinds all event listeners so that it can be garbage collected.
[ "Completely", "destroys", "the", "control", "and", "unbinds", "all", "event", "listeners", "so", "that", "it", "can", "be", "garbage", "collected", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L3043-L3069
train
sdelements/lets-chat
media/js/vendor/selectize/selectize.js
function(input) { var self = this; if (!self.settings.create) return false; var filter = self.settings.createFilter; return input.length && (typeof filter !== 'function' || filter.apply(self, [input])) && (typeof filter !== 'string' || new RegExp(filter).test(input)) && (!(filter instanceof RegE...
javascript
function(input) { var self = this; if (!self.settings.create) return false; var filter = self.settings.createFilter; return input.length && (typeof filter !== 'function' || filter.apply(self, [input])) && (typeof filter !== 'string' || new RegExp(filter).test(input)) && (!(filter instanceof RegE...
[ "function", "(", "input", ")", "{", "var", "self", "=", "this", ";", "if", "(", "!", "self", ".", "settings", ".", "create", ")", "return", "false", ";", "var", "filter", "=", "self", ".", "settings", ".", "createFilter", ";", "return", "input", ".",...
Determines whether or not to display the create item prompt, given a user input. @param {string} input @return {boolean}
[ "Determines", "whether", "or", "not", "to", "display", "the", "create", "item", "prompt", "given", "a", "user", "input", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/selectize/selectize.js#L3147-L3155
train
sdelements/lets-chat
media/js/vendor/bootstrap-daterangepicker/daterangepicker.js
function (e) { var el = $(e.target); var date = moment(el.val(), this.format); if (!date.isValid()) return; var startDate, endDate; if (el.attr('name') === 'daterangepicker_start') { startDate = date; endDate = this.endDate; ...
javascript
function (e) { var el = $(e.target); var date = moment(el.val(), this.format); if (!date.isValid()) return; var startDate, endDate; if (el.attr('name') === 'daterangepicker_start') { startDate = date; endDate = this.endDate; ...
[ "function", "(", "e", ")", "{", "var", "el", "=", "$", "(", "e", ".", "target", ")", ";", "var", "date", "=", "moment", "(", "el", ".", "val", "(", ")", ",", "this", ".", "format", ")", ";", "if", "(", "!", "date", ".", "isValid", "(", ")",...
when a date is typed into the start to end date textboxes
[ "when", "a", "date", "is", "typed", "into", "the", "start", "to", "end", "date", "textboxes" ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/bootstrap-daterangepicker/daterangepicker.js#L675-L689
train
sdelements/lets-chat
media/js/vendor/jquery-validate/jquery.validate.js
function( element, method ) { return $( element ).data( "msg" + method[ 0 ].toUpperCase() + method.substring( 1 ).toLowerCase() ) || $( element ).data("msg"); }
javascript
function( element, method ) { return $( element ).data( "msg" + method[ 0 ].toUpperCase() + method.substring( 1 ).toLowerCase() ) || $( element ).data("msg"); }
[ "function", "(", "element", ",", "method", ")", "{", "return", "$", "(", "element", ")", ".", "data", "(", "\"msg\"", "+", "method", "[", "0", "]", ".", "toUpperCase", "(", ")", "+", "method", ".", "substring", "(", "1", ")", ".", "toLowerCase", "(...
return the custom message for the given element and validation method specified in the element's HTML5 data attribute return the generic message if present and no method specific message is present
[ "return", "the", "custom", "message", "for", "the", "given", "element", "and", "validation", "method", "specified", "in", "the", "element", "s", "HTML5", "data", "attribute", "return", "the", "generic", "message", "if", "present", "and", "no", "method", "speci...
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/jquery-validate/jquery.validate.js#L627-L630
train
sdelements/lets-chat
media/js/vendor/jquery-validate/jquery.validate.js
function( name, method ) { var m = this.settings.messages[name]; return m && (m.constructor === String ? m : m[method]); }
javascript
function( name, method ) { var m = this.settings.messages[name]; return m && (m.constructor === String ? m : m[method]); }
[ "function", "(", "name", ",", "method", ")", "{", "var", "m", "=", "this", ".", "settings", ".", "messages", "[", "name", "]", ";", "return", "m", "&&", "(", "m", ".", "constructor", "===", "String", "?", "m", ":", "m", "[", "method", "]", ")", ...
return the custom message for the given element name and validation method
[ "return", "the", "custom", "message", "for", "the", "given", "element", "name", "and", "validation", "method" ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/jquery-validate/jquery.validate.js#L633-L636
train
sdelements/lets-chat
media/js/vendor/lodash/lodash.underscore.js
compareAscending
function compareAscending(a, b) { var ac = a.criteria, bc = b.criteria, index = -1, length = ac.length; while (++index < length) { var value = ac[index], other = bc[index]; if (value !== other) { if (value > other || typeof value == 'undefined') { ...
javascript
function compareAscending(a, b) { var ac = a.criteria, bc = b.criteria, index = -1, length = ac.length; while (++index < length) { var value = ac[index], other = bc[index]; if (value !== other) { if (value > other || typeof value == 'undefined') { ...
[ "function", "compareAscending", "(", "a", ",", "b", ")", "{", "var", "ac", "=", "a", ".", "criteria", ",", "bc", "=", "b", ".", "criteria", ",", "index", "=", "-", "1", ",", "length", "=", "ac", ".", "length", ";", "while", "(", "++", "index", ...
Used by `sortBy` to compare transformed `collection` elements, stable sorting them in ascending order. @private @param {Object} a The object to compare to `b`. @param {Object} b The object to compare to `a`. @returns {number} Returns the sort order indicator of `1` or `-1`.
[ "Used", "by", "sortBy", "to", "compare", "transformed", "collection", "elements", "stable", "sorting", "them", "in", "ascending", "order", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/lodash/lodash.underscore.js#L116-L142
train
sdelements/lets-chat
media/js/vendor/lodash/lodash.underscore.js
slice
function slice(array, start, end) { start || (start = 0); if (typeof end == 'undefined') { end = array ? array.length : 0; } var index = -1, length = end - start || 0, result = Array(length < 0 ? 0 : length); while (++index < length) { result[index] = array[start + index...
javascript
function slice(array, start, end) { start || (start = 0); if (typeof end == 'undefined') { end = array ? array.length : 0; } var index = -1, length = end - start || 0, result = Array(length < 0 ? 0 : length); while (++index < length) { result[index] = array[start + index...
[ "function", "slice", "(", "array", ",", "start", ",", "end", ")", "{", "start", "||", "(", "start", "=", "0", ")", ";", "if", "(", "typeof", "end", "==", "'undefined'", ")", "{", "end", "=", "array", "?", "array", ".", "length", ":", "0", ";", ...
Slices the `collection` from the `start` index up to, but not including, the `end` index. Note: This function is used instead of `Array#slice` to support node lists in IE < 9 and to ensure dense arrays are returned. @private @param {Array|Object|string} collection The collection to slice. @param {number} start The st...
[ "Slices", "the", "collection", "from", "the", "start", "index", "up", "to", "but", "not", "including", "the", "end", "index", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/lodash/lodash.underscore.js#L169-L182
train
sdelements/lets-chat
media/js/vendor/lodash/lodash.underscore.js
createAggregator
function createAggregator(setter) { return function(collection, callback, thisArg) { var result = {}; callback = createCallback(callback, thisArg, 3); var index = -1, length = collection ? collection.length : 0; if (typeof length == 'number') { while (++index < length) { ...
javascript
function createAggregator(setter) { return function(collection, callback, thisArg) { var result = {}; callback = createCallback(callback, thisArg, 3); var index = -1, length = collection ? collection.length : 0; if (typeof length == 'number') { while (++index < length) { ...
[ "function", "createAggregator", "(", "setter", ")", "{", "return", "function", "(", "collection", ",", "callback", ",", "thisArg", ")", "{", "var", "result", "=", "{", "}", ";", "callback", "=", "createCallback", "(", "callback", ",", "thisArg", ",", "3", ...
Creates a function that aggregates a collection, creating an object composed of keys generated from the results of running each element of the collection through a callback. The given `setter` function sets the keys and values of the composed object. @private @param {Function} setter The setter function. @returns {Fun...
[ "Creates", "a", "function", "that", "aggregates", "a", "collection", "creating", "an", "object", "composed", "of", "keys", "generated", "from", "the", "results", "of", "running", "each", "element", "of", "the", "collection", "through", "a", "callback", ".", "T...
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/lodash/lodash.underscore.js#L775-L795
train
sdelements/lets-chat
media/js/vendor/lodash/lodash.underscore.js
invert
function invert(object) { var index = -1, props = keys(object), length = props.length, result = {}; while (++index < length) { var key = props[index]; result[object[key]] = key; } return result; }
javascript
function invert(object) { var index = -1, props = keys(object), length = props.length, result = {}; while (++index < length) { var key = props[index]; result[object[key]] = key; } return result; }
[ "function", "invert", "(", "object", ")", "{", "var", "index", "=", "-", "1", ",", "props", "=", "keys", "(", "object", ")", ",", "length", "=", "props", ".", "length", ",", "result", "=", "{", "}", ";", "while", "(", "++", "index", "<", "length"...
Creates an object composed of the inverted keys and values of the given object. @static @memberOf _ @category Objects @param {Object} object The object to invert. @returns {Object} Returns the created inverted object. @example _.invert({ 'first': 'fred', 'second': 'barney' }); // => { 'fred': 'first', 'barney': 'seco...
[ "Creates", "an", "object", "composed", "of", "the", "inverted", "keys", "and", "values", "of", "the", "given", "object", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/lodash/lodash.underscore.js#L1266-L1277
train
sdelements/lets-chat
media/js/vendor/lodash/lodash.underscore.js
isBoolean
function isBoolean(value) { return value === true || value === false || value && typeof value == 'object' && toString.call(value) == boolClass || false; }
javascript
function isBoolean(value) { return value === true || value === false || value && typeof value == 'object' && toString.call(value) == boolClass || false; }
[ "function", "isBoolean", "(", "value", ")", "{", "return", "value", "===", "true", "||", "value", "===", "false", "||", "value", "&&", "typeof", "value", "==", "'object'", "&&", "toString", ".", "call", "(", "value", ")", "==", "boolClass", "||", "false"...
Checks if `value` is a boolean value. @static @memberOf _ @category Objects @param {*} value The value to check. @returns {boolean} Returns `true` if the `value` is a boolean value, else `false`. @example _.isBoolean(null); // => false
[ "Checks", "if", "value", "is", "a", "boolean", "value", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/lodash/lodash.underscore.js#L1292-L1295
train
sdelements/lets-chat
media/js/vendor/lodash/lodash.underscore.js
isString
function isString(value) { return typeof value == 'string' || value && typeof value == 'object' && toString.call(value) == stringClass || false; }
javascript
function isString(value) { return typeof value == 'string' || value && typeof value == 'object' && toString.call(value) == stringClass || false; }
[ "function", "isString", "(", "value", ")", "{", "return", "typeof", "value", "==", "'string'", "||", "value", "&&", "typeof", "value", "==", "'object'", "&&", "toString", ".", "call", "(", "value", ")", "==", "stringClass", "||", "false", ";", "}" ]
Checks if `value` is a string. @static @memberOf _ @category Objects @param {*} value The value to check. @returns {boolean} Returns `true` if the `value` is a string, else `false`. @example _.isString('fred'); // => true
[ "Checks", "if", "value", "is", "a", "string", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/lodash/lodash.underscore.js#L1593-L1596
train
sdelements/lets-chat
media/js/vendor/lodash/lodash.underscore.js
values
function values(object) { var index = -1, props = keys(object), length = props.length, result = Array(length); while (++index < length) { result[index] = object[props[index]]; } return result; }
javascript
function values(object) { var index = -1, props = keys(object), length = props.length, result = Array(length); while (++index < length) { result[index] = object[props[index]]; } return result; }
[ "function", "values", "(", "object", ")", "{", "var", "index", "=", "-", "1", ",", "props", "=", "keys", "(", "object", ")", ",", "length", "=", "props", ".", "length", ",", "result", "=", "Array", "(", "length", ")", ";", "while", "(", "++", "in...
Creates an array composed of the own enumerable property values of `object`. @static @memberOf _ @category Objects @param {Object} object The object to inspect. @returns {Array} Returns an array of property values. @example _.values({ 'one': 1, 'two': 2, 'three': 3 }); // => [1, 2, 3] (property order is not guarantee...
[ "Creates", "an", "array", "composed", "of", "the", "own", "enumerable", "property", "values", "of", "object", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/lodash/lodash.underscore.js#L1741-L1751
train
sdelements/lets-chat
media/js/vendor/lodash/lodash.underscore.js
where
function where(collection, properties, first) { return (first && isEmpty(properties)) ? undefined : (first ? find : filter)(collection, properties); }
javascript
function where(collection, properties, first) { return (first && isEmpty(properties)) ? undefined : (first ? find : filter)(collection, properties); }
[ "function", "where", "(", "collection", ",", "properties", ",", "first", ")", "{", "return", "(", "first", "&&", "isEmpty", "(", "properties", ")", ")", "?", "undefined", ":", "(", "first", "?", "find", ":", "filter", ")", "(", "collection", ",", "prop...
Performs a deep comparison of each element in a `collection` to the given `properties` object, returning an array of all elements that have equivalent property values. @static @memberOf _ @type Function @category Collections @param {Array|Object|string} collection The collection to iterate over. @param {Object} props ...
[ "Performs", "a", "deep", "comparison", "of", "each", "element", "in", "a", "collection", "to", "the", "given", "properties", "object", "returning", "an", "array", "of", "all", "elements", "that", "have", "equivalent", "property", "values", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/lodash/lodash.underscore.js#L2870-L2874
train
sdelements/lets-chat
media/js/vendor/lodash/lodash.underscore.js
defer
function defer(func) { if (!isFunction(func)) { throw new TypeError; } var args = slice(arguments, 1); return setTimeout(function() { func.apply(undefined, args); }, 1); }
javascript
function defer(func) { if (!isFunction(func)) { throw new TypeError; } var args = slice(arguments, 1); return setTimeout(function() { func.apply(undefined, args); }, 1); }
[ "function", "defer", "(", "func", ")", "{", "if", "(", "!", "isFunction", "(", "func", ")", ")", "{", "throw", "new", "TypeError", ";", "}", "var", "args", "=", "slice", "(", "arguments", ",", "1", ")", ";", "return", "setTimeout", "(", "function", ...
Defers executing the `func` function until the current call stack has cleared. Additional arguments will be provided to `func` when it is invoked. @static @memberOf _ @category Functions @param {Function} func The function to defer. @param {...*} [arg] Arguments to invoke the function with. @returns {number} Returns t...
[ "Defers", "executing", "the", "func", "function", "until", "the", "current", "call", "stack", "has", "cleared", ".", "Additional", "arguments", "will", "be", "provided", "to", "func", "when", "it", "is", "invoked", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/lodash/lodash.underscore.js#L3947-L3953
train
sdelements/lets-chat
media/js/vendor/lodash/lodash.underscore.js
result
function result(object, key) { if (object) { var value = object[key]; return isFunction(value) ? object[key]() : value; } }
javascript
function result(object, key) { if (object) { var value = object[key]; return isFunction(value) ? object[key]() : value; } }
[ "function", "result", "(", "object", ",", "key", ")", "{", "if", "(", "object", ")", "{", "var", "value", "=", "object", "[", "key", "]", ";", "return", "isFunction", "(", "value", ")", "?", "object", "[", "key", "]", "(", ")", ":", "value", ";",...
Resolves the value of property `key` on `object`. If `key` is a function it will be invoked with the `this` binding of `object` and its result returned, else the property value is returned. If `object` is falsey then `undefined` is returned. @static @memberOf _ @category Utilities @param {Object} object The object to ...
[ "Resolves", "the", "value", "of", "property", "key", "on", "object", ".", "If", "key", "is", "a", "function", "it", "will", "be", "invoked", "with", "the", "this", "binding", "of", "object", "and", "its", "result", "returned", "else", "the", "property", ...
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/lodash/lodash.underscore.js#L4446-L4451
train
sdelements/lets-chat
media/js/vendor/lodash/lodash.underscore.js
template
function template(text, data, options) { var _ = lodash, settings = _.templateSettings; text = String(text || ''); options = defaults({}, options, settings); var index = 0, source = "__p += '", variable = options.variable; var reDelimiters = RegExp( (options.escape |...
javascript
function template(text, data, options) { var _ = lodash, settings = _.templateSettings; text = String(text || ''); options = defaults({}, options, settings); var index = 0, source = "__p += '", variable = options.variable; var reDelimiters = RegExp( (options.escape |...
[ "function", "template", "(", "text", ",", "data", ",", "options", ")", "{", "var", "_", "=", "lodash", ",", "settings", "=", "_", ".", "templateSettings", ";", "text", "=", "String", "(", "text", "||", "''", ")", ";", "options", "=", "defaults", "(",...
A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code. Note: In the development build, `_.template` utilizes sourceURLs for easier debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl For more ...
[ "A", "micro", "-", "templating", "method", "that", "handles", "arbitrary", "delimiters", "preserves", "whitespace", "and", "correctly", "escapes", "quotes", "within", "interpolated", "code", "." ]
318d2ed0852d2f299fc76b32f2240371ccee95ad
https://github.com/sdelements/lets-chat/blob/318d2ed0852d2f299fc76b32f2240371ccee95ad/media/js/vendor/lodash/lodash.underscore.js#L4539-L4593
train
brianc/node-postgres
lib/result.js
function (rowMode, types) { this.command = null this.rowCount = null this.oid = null this.rows = [] this.fields = [] this._parsers = [] this._types = types this.RowCtor = null this.rowAsArray = rowMode === 'array' if (this.rowAsArray) { this.parseRow = this._parseRowAsArray } }
javascript
function (rowMode, types) { this.command = null this.rowCount = null this.oid = null this.rows = [] this.fields = [] this._parsers = [] this._types = types this.RowCtor = null this.rowAsArray = rowMode === 'array' if (this.rowAsArray) { this.parseRow = this._parseRowAsArray } }
[ "function", "(", "rowMode", ",", "types", ")", "{", "this", ".", "command", "=", "null", "this", ".", "rowCount", "=", "null", "this", ".", "oid", "=", "null", "this", ".", "rows", "=", "[", "]", "this", ".", "fields", "=", "[", "]", "this", ".",...
result object returned from query in the 'end' event and also passed as second argument to provided callback
[ "result", "object", "returned", "from", "query", "in", "the", "end", "event", "and", "also", "passed", "as", "second", "argument", "to", "provided", "callback" ]
4b530a9e0fb317567766260a2c57e28c88d55861
https://github.com/brianc/node-postgres/blob/4b530a9e0fb317567766260a2c57e28c88d55861/lib/result.js#L15-L28
train
brianc/node-postgres
lib/utils.js
arrayString
function arrayString (val) { var result = '{' for (var i = 0; i < val.length; i++) { if (i > 0) { result = result + ',' } if (val[i] === null || typeof val[i] === 'undefined') { result = result + 'NULL' } else if (Array.isArray(val[i])) { result = result + arrayString(val[i]) }...
javascript
function arrayString (val) { var result = '{' for (var i = 0; i < val.length; i++) { if (i > 0) { result = result + ',' } if (val[i] === null || typeof val[i] === 'undefined') { result = result + 'NULL' } else if (Array.isArray(val[i])) { result = result + arrayString(val[i]) }...
[ "function", "arrayString", "(", "val", ")", "{", "var", "result", "=", "'{'", "for", "(", "var", "i", "=", "0", ";", "i", "<", "val", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "result", "=", "result", "+", ...
convert a JS array to a postgres array literal uses comma separator so won't work for types like box that use a different array separator.
[ "convert", "a", "JS", "array", "to", "a", "postgres", "array", "literal", "uses", "comma", "separator", "so", "won", "t", "work", "for", "types", "like", "box", "that", "use", "a", "different", "array", "separator", "." ]
4b530a9e0fb317567766260a2c57e28c88d55861
https://github.com/brianc/node-postgres/blob/4b530a9e0fb317567766260a2c57e28c88d55861/lib/utils.js#L25-L43
train
nicolodavis/boardgame.io
src/client/debug/debug.js
SanitizeCtx
function SanitizeCtx(ctx) { let r = {}; for (const key in ctx) { if (!key.startsWith('_')) { r[key] = ctx[key]; } } return r; }
javascript
function SanitizeCtx(ctx) { let r = {}; for (const key in ctx) { if (!key.startsWith('_')) { r[key] = ctx[key]; } } return r; }
[ "function", "SanitizeCtx", "(", "ctx", ")", "{", "let", "r", "=", "{", "}", ";", "for", "(", "const", "key", "in", "ctx", ")", "{", "if", "(", "!", "key", ".", "startsWith", "(", "'_'", ")", ")", "{", "r", "[", "key", "]", "=", "ctx", "[", ...
Removes all the keys in ctx that begin with a _.
[ "Removes", "all", "the", "keys", "in", "ctx", "that", "begin", "with", "a", "_", "." ]
e46f19552ede4751af97e2fac8086add3bed220a
https://github.com/nicolodavis/boardgame.io/blob/e46f19552ede4751af97e2fac8086add3bed220a/src/client/debug/debug.js#L25-L33
train
nicolodavis/boardgame.io
examples/react-web/src/ui/chess3d/game.js
Load
function Load(pgn) { let chess = null; if (Chess.Chess) { chess = new Chess.Chess(); } else { chess = new Chess(); } chess.load_pgn(pgn); return chess; }
javascript
function Load(pgn) { let chess = null; if (Chess.Chess) { chess = new Chess.Chess(); } else { chess = new Chess(); } chess.load_pgn(pgn); return chess; }
[ "function", "Load", "(", "pgn", ")", "{", "let", "chess", "=", "null", ";", "if", "(", "Chess", ".", "Chess", ")", "{", "chess", "=", "new", "Chess", ".", "Chess", "(", ")", ";", "}", "else", "{", "chess", "=", "new", "Chess", "(", ")", ";", ...
Helper to instantiate chess.js correctly on both browser and Node.
[ "Helper", "to", "instantiate", "chess", ".", "js", "correctly", "on", "both", "browser", "and", "Node", "." ]
e46f19552ede4751af97e2fac8086add3bed220a
https://github.com/nicolodavis/boardgame.io/blob/e46f19552ede4751af97e2fac8086add3bed220a/examples/react-web/src/ui/chess3d/game.js#L14-L23
train
loadimpact/k6
samples/pantheon.js
doLogin
function doLogin() { // Request the login page. let res = http.get(baseURL + "/user/login"); check(res, { "title is correct": (res) => res.html("title").text() == "User account | David li commerce-test", }); // TODO: Add attr() to k6/html! // Extract hidden input fields. let formBuildID = res.body.match('name...
javascript
function doLogin() { // Request the login page. let res = http.get(baseURL + "/user/login"); check(res, { "title is correct": (res) => res.html("title").text() == "User account | David li commerce-test", }); // TODO: Add attr() to k6/html! // Extract hidden input fields. let formBuildID = res.body.match('name...
[ "function", "doLogin", "(", ")", "{", "// Request the login page.", "let", "res", "=", "http", ".", "get", "(", "baseURL", "+", "\"/user/login\"", ")", ";", "check", "(", "res", ",", "{", "\"title is correct\"", ":", "(", "res", ")", "=>", "res", ".", "h...
Request the login page and perform a user login
[ "Request", "the", "login", "page", "and", "perform", "a", "user", "login" ]
03645ba7059a4ca9eb22035f5adb52f1a91e7534
https://github.com/loadimpact/k6/blob/03645ba7059a4ca9eb22035f5adb52f1a91e7534/samples/pantheon.js#L130-L161
train
loadimpact/k6
samples/pantheon.js
doCategory
function doCategory(category) { check(http.get(category.url), { "title is correct": (res) => res.html("title").text() == category.title, }); for (prodName in category.products) { if (Math.random() <= category.products[prodName].chance) { group(prodName, function() { doProductPage(category.products[prodName])...
javascript
function doCategory(category) { check(http.get(category.url), { "title is correct": (res) => res.html("title").text() == category.title, }); for (prodName in category.products) { if (Math.random() <= category.products[prodName].chance) { group(prodName, function() { doProductPage(category.products[prodName])...
[ "function", "doCategory", "(", "category", ")", "{", "check", "(", "http", ".", "get", "(", "category", ".", "url", ")", ",", "{", "\"title is correct\"", ":", "(", "res", ")", "=>", "res", ".", "html", "(", "\"title\"", ")", ".", "text", "(", ")", ...
Load a product category page, then potentially load some product pages
[ "Load", "a", "product", "category", "page", "then", "potentially", "load", "some", "product", "pages" ]
03645ba7059a4ca9eb22035f5adb52f1a91e7534
https://github.com/loadimpact/k6/blob/03645ba7059a4ca9eb22035f5adb52f1a91e7534/samples/pantheon.js#L164-L174
train
loadimpact/k6
samples/pantheon.js
doProductPage
function doProductPage(product) { let res = http.get(product.url); check(res, { "title is correct": (res) => res.html("title").text() == product.title, }); if (Math.random() <= product.chance) { let formBuildID = res.body.match('name="form_build_id" value="(.*)"')[1]; let formID = res.body.match('name="form_i...
javascript
function doProductPage(product) { let res = http.get(product.url); check(res, { "title is correct": (res) => res.html("title").text() == product.title, }); if (Math.random() <= product.chance) { let formBuildID = res.body.match('name="form_build_id" value="(.*)"')[1]; let formID = res.body.match('name="form_i...
[ "function", "doProductPage", "(", "product", ")", "{", "let", "res", "=", "http", ".", "get", "(", "product", ".", "url", ")", ";", "check", "(", "res", ",", "{", "\"title is correct\"", ":", "(", "res", ")", "=>", "res", ".", "html", "(", "\"title\"...
Load product page and potentially add product to cart
[ "Load", "product", "page", "and", "potentially", "add", "product", "to", "cart" ]
03645ba7059a4ca9eb22035f5adb52f1a91e7534
https://github.com/loadimpact/k6/blob/03645ba7059a4ca9eb22035f5adb52f1a91e7534/samples/pantheon.js#L177-L191
train
loadimpact/k6
samples/pantheon.js
addProductToCart
function addProductToCart(url, productID, formID, formBuildID, formToken) { let formdata = { product_id: productID, form_id: formID, form_build_id: formBuildID, form_token: formToken, quantity: 1, op: "Add to cart", }; let headers = { "Content-Type": "application/x-www-form-urlencoded" }; let res = http...
javascript
function addProductToCart(url, productID, formID, formBuildID, formToken) { let formdata = { product_id: productID, form_id: formID, form_build_id: formBuildID, form_token: formToken, quantity: 1, op: "Add to cart", }; let headers = { "Content-Type": "application/x-www-form-urlencoded" }; let res = http...
[ "function", "addProductToCart", "(", "url", ",", "productID", ",", "formID", ",", "formBuildID", ",", "formToken", ")", "{", "let", "formdata", "=", "{", "product_id", ":", "productID", ",", "form_id", ":", "formID", ",", "form_build_id", ":", "formBuildID", ...
Add a product to our shopping cart
[ "Add", "a", "product", "to", "our", "shopping", "cart" ]
03645ba7059a4ca9eb22035f5adb52f1a91e7534
https://github.com/loadimpact/k6/blob/03645ba7059a4ca9eb22035f5adb52f1a91e7534/samples/pantheon.js#L194-L209
train
loadimpact/k6
samples/pantheon.js
doLogout
function doLogout() { check(http.get(baseURL + "/user/logout"), { "logout succeeded": (res) => res.body.includes('<a href="/user/login">Log in') }) || fail("logout failed"); }
javascript
function doLogout() { check(http.get(baseURL + "/user/logout"), { "logout succeeded": (res) => res.body.includes('<a href="/user/login">Log in') }) || fail("logout failed"); }
[ "function", "doLogout", "(", ")", "{", "check", "(", "http", ".", "get", "(", "baseURL", "+", "\"/user/logout\"", ")", ",", "{", "\"logout succeeded\"", ":", "(", "res", ")", "=>", "res", ".", "body", ".", "includes", "(", "'<a href=\"/user/login\">Log in'",...
Log out the user
[ "Log", "out", "the", "user" ]
03645ba7059a4ca9eb22035f5adb52f1a91e7534
https://github.com/loadimpact/k6/blob/03645ba7059a4ca9eb22035f5adb52f1a91e7534/samples/pantheon.js#L321-L325
train
immutable-js/immutable-js
src/Hash.js
hashNumber
function hashNumber(n) { if (n !== n || n === Infinity) { return 0; } let hash = n | 0; if (hash !== n) { hash ^= n * 0xffffffff; } while (n > 0xffffffff) { n /= 0xffffffff; hash ^= n; } return smi(hash); }
javascript
function hashNumber(n) { if (n !== n || n === Infinity) { return 0; } let hash = n | 0; if (hash !== n) { hash ^= n * 0xffffffff; } while (n > 0xffffffff) { n /= 0xffffffff; hash ^= n; } return smi(hash); }
[ "function", "hashNumber", "(", "n", ")", "{", "if", "(", "n", "!==", "n", "||", "n", "===", "Infinity", ")", "{", "return", "0", ";", "}", "let", "hash", "=", "n", "|", "0", ";", "if", "(", "hash", "!==", "n", ")", "{", "hash", "^=", "n", "...
Compress arbitrarily large numbers into smi hashes.
[ "Compress", "arbitrarily", "large", "numbers", "into", "smi", "hashes", "." ]
751082fd0d392f14f7fa567d5fad6edd8f94bd79
https://github.com/immutable-js/immutable-js/blob/751082fd0d392f14f7fa567d5fad6edd8f94bd79/src/Hash.js#L49-L62
train
immutable-js/immutable-js
src/Hash.js
getIENodeHash
function getIENodeHash(node) { if (node && node.nodeType > 0) { switch (node.nodeType) { case 1: // Element return node.uniqueID; case 9: // Document return node.documentElement && node.documentElement.uniqueID; } } }
javascript
function getIENodeHash(node) { if (node && node.nodeType > 0) { switch (node.nodeType) { case 1: // Element return node.uniqueID; case 9: // Document return node.documentElement && node.documentElement.uniqueID; } } }
[ "function", "getIENodeHash", "(", "node", ")", "{", "if", "(", "node", "&&", "node", ".", "nodeType", ">", "0", ")", "{", "switch", "(", "node", ".", "nodeType", ")", "{", "case", "1", ":", "// Element", "return", "node", ".", "uniqueID", ";", "case"...
IE has a `uniqueID` property on DOM nodes. We can construct the hash from it and avoid memory leaks from the IE cloneNode bug.
[ "IE", "has", "a", "uniqueID", "property", "on", "DOM", "nodes", ".", "We", "can", "construct", "the", "hash", "from", "it", "and", "avoid", "memory", "leaks", "from", "the", "IE", "cloneNode", "bug", "." ]
751082fd0d392f14f7fa567d5fad6edd8f94bd79
https://github.com/immutable-js/immutable-js/blob/751082fd0d392f14f7fa567d5fad6edd8f94bd79/src/Hash.js#L178-L187
train
immutable-js/immutable-js
pages/src/docs/src/TypeDocumentation.js
getTypePropMap
function getTypePropMap(def) { var map = {}; def && def.extends && def.extends.forEach(e => { var superModule = defs.Immutable; e.name.split('.').forEach(part => { superModule = superModule && superModule.module && superModule.module[part]; }); var superInterface = ...
javascript
function getTypePropMap(def) { var map = {}; def && def.extends && def.extends.forEach(e => { var superModule = defs.Immutable; e.name.split('.').forEach(part => { superModule = superModule && superModule.module && superModule.module[part]; }); var superInterface = ...
[ "function", "getTypePropMap", "(", "def", ")", "{", "var", "map", "=", "{", "}", ";", "def", "&&", "def", ".", "extends", "&&", "def", ".", "extends", ".", "forEach", "(", "e", "=>", "{", "var", "superModule", "=", "defs", ".", "Immutable", ";", "e...
Get a map from super type parameter to concrete type definition. This is used when rendering inherited type definitions to ensure contextually relevant information. Example: type A<T> implements B<number, T> type B<K, V> implements C<K, V, V> type C<X, Y, Z> parse C: {} parse B: { C<X: K C<Y: V C<Z: V } parse A: {...
[ "Get", "a", "map", "from", "super", "type", "parameter", "to", "concrete", "type", "definition", ".", "This", "is", "used", "when", "rendering", "inherited", "type", "definitions", "to", "ensure", "contextually", "relevant", "information", "." ]
751082fd0d392f14f7fa567d5fad6edd8f94bd79
https://github.com/immutable-js/immutable-js/blob/751082fd0d392f14f7fa567d5fad6edd8f94bd79/pages/src/docs/src/TypeDocumentation.js#L303-L330
train
szimek/signature_pad
docs/js/app.js
resizeCanvas
function resizeCanvas() { // When zoomed out to less than 100%, for some very strange reason, // some browsers report devicePixelRatio as less than 1 // and only part of the canvas is cleared then. var ratio = Math.max(window.devicePixelRatio || 1, 1); // This part causes the canvas to be cleared canvas.w...
javascript
function resizeCanvas() { // When zoomed out to less than 100%, for some very strange reason, // some browsers report devicePixelRatio as less than 1 // and only part of the canvas is cleared then. var ratio = Math.max(window.devicePixelRatio || 1, 1); // This part causes the canvas to be cleared canvas.w...
[ "function", "resizeCanvas", "(", ")", "{", "// When zoomed out to less than 100%, for some very strange reason,", "// some browsers report devicePixelRatio as less than 1", "// and only part of the canvas is cleared then.", "var", "ratio", "=", "Math", ".", "max", "(", "window", ".",...
Adjust canvas coordinate space taking into account pixel ratio, to make it look crisp on mobile devices. This also causes canvas to be cleared.
[ "Adjust", "canvas", "coordinate", "space", "taking", "into", "account", "pixel", "ratio", "to", "make", "it", "look", "crisp", "on", "mobile", "devices", ".", "This", "also", "causes", "canvas", "to", "be", "cleared", "." ]
028b538179ac1a56b190fb40b39821b8c39145b7
https://github.com/szimek/signature_pad/blob/028b538179ac1a56b190fb40b39821b8c39145b7/docs/js/app.js#L18-L35
train
react-native-community/cli
packages/platform-ios/src/commands/logIOS/index.js
logIOS
async function logIOS() { const rawDevices = execFileSync( 'xcrun', ['simctl', 'list', 'devices', '--json'], {encoding: 'utf8'}, ); const {devices} = JSON.parse(rawDevices); const device = findAvailableDevice(devices); if (device === undefined) { logger.error('No active iOS device found'); ...
javascript
async function logIOS() { const rawDevices = execFileSync( 'xcrun', ['simctl', 'list', 'devices', '--json'], {encoding: 'utf8'}, ); const {devices} = JSON.parse(rawDevices); const device = findAvailableDevice(devices); if (device === undefined) { logger.error('No active iOS device found'); ...
[ "async", "function", "logIOS", "(", ")", "{", "const", "rawDevices", "=", "execFileSync", "(", "'xcrun'", ",", "[", "'simctl'", ",", "'list'", ",", "'devices'", ",", "'--json'", "]", ",", "{", "encoding", ":", "'utf8'", "}", ",", ")", ";", "const", "{"...
Starts iOS device syslog tail
[ "Starts", "iOS", "device", "syslog", "tail" ]
c3ed10c0e2d5c7bfe68312093347fbf7e61aa7a7
https://github.com/react-native-community/cli/blob/c3ed10c0e2d5c7bfe68312093347fbf7e61aa7a7/packages/platform-ios/src/commands/logIOS/index.js#L29-L45
train
react-native-community/cli
packages/cli/src/cliEntry.js
printHelpInformation
function printHelpInformation(examples, pkg) { let cmdName = this._name; if (this._alias) { cmdName = `${cmdName}|${this._alias}`; } const sourceInformation = pkg ? [`${chalk.bold('Source:')} ${pkg.name}@${pkg.version}`, ''] : []; let output = [ chalk.bold(`react-native ${cmdName}`), thi...
javascript
function printHelpInformation(examples, pkg) { let cmdName = this._name; if (this._alias) { cmdName = `${cmdName}|${this._alias}`; } const sourceInformation = pkg ? [`${chalk.bold('Source:')} ${pkg.name}@${pkg.version}`, ''] : []; let output = [ chalk.bold(`react-native ${cmdName}`), thi...
[ "function", "printHelpInformation", "(", "examples", ",", "pkg", ")", "{", "let", "cmdName", "=", "this", ".", "_name", ";", "if", "(", "this", ".", "_alias", ")", "{", "cmdName", "=", "`", "${", "cmdName", "}", "${", "this", ".", "_alias", "}", "`",...
Custom printHelpInformation command inspired by internal Commander.js one modified to suit our needs
[ "Custom", "printHelpInformation", "command", "inspired", "by", "internal", "Commander", ".", "js", "one", "modified", "to", "suit", "our", "needs" ]
c3ed10c0e2d5c7bfe68312093347fbf7e61aa7a7
https://github.com/react-native-community/cli/blob/c3ed10c0e2d5c7bfe68312093347fbf7e61aa7a7/packages/cli/src/cliEntry.js#L56-L83
train
react-native-community/cli
packages/cli/src/tools/copyFiles.js
copyBinaryFile
function copyBinaryFile(srcPath, destPath, cb) { let cbCalled = false; // const {mode} = fs.statSync(srcPath); const readStream = fs.createReadStream(srcPath); const writeStream = fs.createWriteStream(destPath); readStream.on('error', err => { done(err); }); writeStream.on('error', err => { done(e...
javascript
function copyBinaryFile(srcPath, destPath, cb) { let cbCalled = false; // const {mode} = fs.statSync(srcPath); const readStream = fs.createReadStream(srcPath); const writeStream = fs.createWriteStream(destPath); readStream.on('error', err => { done(err); }); writeStream.on('error', err => { done(e...
[ "function", "copyBinaryFile", "(", "srcPath", ",", "destPath", ",", "cb", ")", "{", "let", "cbCalled", "=", "false", ";", "// const {mode} = fs.statSync(srcPath);", "const", "readStream", "=", "fs", ".", "createReadStream", "(", "srcPath", ")", ";", "const", "wr...
Same as 'cp' on Unix. Don't do any replacements.
[ "Same", "as", "cp", "on", "Unix", ".", "Don", "t", "do", "any", "replacements", "." ]
c3ed10c0e2d5c7bfe68312093347fbf7e61aa7a7
https://github.com/react-native-community/cli/blob/c3ed10c0e2d5c7bfe68312093347fbf7e61aa7a7/packages/cli/src/tools/copyFiles.js#L54-L79
train
react-native-community/cli
packages/cli/src/commands/server/copyToClipBoard.js
copyToClipBoard
function copyToClipBoard(content) { switch (process.platform) { case 'darwin': { const child = spawn('pbcopy', []); child.stdin.end(Buffer.from(content, 'utf8')); return true; } case 'win32': { const child = spawn('clip', []); child.stdin.end(Buffer.from(content, 'utf8')); ...
javascript
function copyToClipBoard(content) { switch (process.platform) { case 'darwin': { const child = spawn('pbcopy', []); child.stdin.end(Buffer.from(content, 'utf8')); return true; } case 'win32': { const child = spawn('clip', []); child.stdin.end(Buffer.from(content, 'utf8')); ...
[ "function", "copyToClipBoard", "(", "content", ")", "{", "switch", "(", "process", ".", "platform", ")", "{", "case", "'darwin'", ":", "{", "const", "child", "=", "spawn", "(", "'pbcopy'", ",", "[", "]", ")", ";", "child", ".", "stdin", ".", "end", "...
Copy the content to host system clipboard.
[ "Copy", "the", "content", "to", "host", "system", "clipboard", "." ]
c3ed10c0e2d5c7bfe68312093347fbf7e61aa7a7
https://github.com/react-native-community/cli/blob/c3ed10c0e2d5c7bfe68312093347fbf7e61aa7a7/packages/cli/src/commands/server/copyToClipBoard.js#L21-L41
train
react-native-community/cli
packages/cli/src/commands/upgrade/legacyUpgrade.js
upgradeProjectFiles
function upgradeProjectFiles(projectDir, projectName) { // Just overwrite copyProjectTemplateAndReplace( path.dirname(require.resolve('react-native/template')), projectDir, projectName, {upgrade: true}, ); }
javascript
function upgradeProjectFiles(projectDir, projectName) { // Just overwrite copyProjectTemplateAndReplace( path.dirname(require.resolve('react-native/template')), projectDir, projectName, {upgrade: true}, ); }
[ "function", "upgradeProjectFiles", "(", "projectDir", ",", "projectName", ")", "{", "// Just overwrite", "copyProjectTemplateAndReplace", "(", "path", ".", "dirname", "(", "require", ".", "resolve", "(", "'react-native/template'", ")", ")", ",", "projectDir", ",", "...
Once all checks passed, upgrade the project files.
[ "Once", "all", "checks", "passed", "upgrade", "the", "project", "files", "." ]
c3ed10c0e2d5c7bfe68312093347fbf7e61aa7a7
https://github.com/react-native-community/cli/blob/c3ed10c0e2d5c7bfe68312093347fbf7e61aa7a7/packages/cli/src/commands/upgrade/legacyUpgrade.js#L132-L140
train
gnab/remark
src/remark/components/styler/styler.js
styleDocument
function styleDocument () { var headElement, styleElement, style; // Bail out if document has already been styled if (getRemarkStylesheet()) { return; } headElement = document.getElementsByTagName('head')[0]; styleElement = document.createElement('style'); styleElement.type = 'text/css'; // Set t...
javascript
function styleDocument () { var headElement, styleElement, style; // Bail out if document has already been styled if (getRemarkStylesheet()) { return; } headElement = document.getElementsByTagName('head')[0]; styleElement = document.createElement('style'); styleElement.type = 'text/css'; // Set t...
[ "function", "styleDocument", "(", ")", "{", "var", "headElement", ",", "styleElement", ",", "style", ";", "// Bail out if document has already been styled", "if", "(", "getRemarkStylesheet", "(", ")", ")", "{", "return", ";", "}", "headElement", "=", "document", "...
Applies bundled styles to document
[ "Applies", "bundled", "styles", "to", "document" ]
4432b423e38ca7537bf834880b3fa1cdaea5f8a7
https://github.com/gnab/remark/blob/4432b423e38ca7537bf834880b3fa1cdaea5f8a7/src/remark/components/styler/styler.js#L11-L39
train
gnab/remark
src/remark/components/styler/styler.js
getRemarkStylesheet
function getRemarkStylesheet () { var i, l = document.styleSheets.length; for (i = 0; i < l; ++i) { if (document.styleSheets[i].title === 'remark') { return document.styleSheets[i]; } } }
javascript
function getRemarkStylesheet () { var i, l = document.styleSheets.length; for (i = 0; i < l; ++i) { if (document.styleSheets[i].title === 'remark') { return document.styleSheets[i]; } } }
[ "function", "getRemarkStylesheet", "(", ")", "{", "var", "i", ",", "l", "=", "document", ".", "styleSheets", ".", "length", ";", "for", "(", "i", "=", "0", ";", "i", "<", "l", ";", "++", "i", ")", "{", "if", "(", "document", ".", "styleSheets", "...
Locates the embedded remark stylesheet
[ "Locates", "the", "embedded", "remark", "stylesheet" ]
4432b423e38ca7537bf834880b3fa1cdaea5f8a7
https://github.com/gnab/remark/blob/4432b423e38ca7537bf834880b3fa1cdaea5f8a7/src/remark/components/styler/styler.js#L50-L58
train
gnab/remark
src/remark/components/styler/styler.js
getPageRule
function getPageRule (stylesheet) { var i, l = stylesheet.cssRules.length; for (i = 0; i < l; ++i) { if (stylesheet.cssRules[i] instanceof window.CSSPageRule) { return stylesheet.cssRules[i]; } } }
javascript
function getPageRule (stylesheet) { var i, l = stylesheet.cssRules.length; for (i = 0; i < l; ++i) { if (stylesheet.cssRules[i] instanceof window.CSSPageRule) { return stylesheet.cssRules[i]; } } }
[ "function", "getPageRule", "(", "stylesheet", ")", "{", "var", "i", ",", "l", "=", "stylesheet", ".", "cssRules", ".", "length", ";", "for", "(", "i", "=", "0", ";", "i", "<", "l", ";", "++", "i", ")", "{", "if", "(", "stylesheet", ".", "cssRules...
Locates the CSS @page rule
[ "Locates", "the", "CSS" ]
4432b423e38ca7537bf834880b3fa1cdaea5f8a7
https://github.com/gnab/remark/blob/4432b423e38ca7537bf834880b3fa1cdaea5f8a7/src/remark/components/styler/styler.js#L61-L69
train
dabeng/OrgChart
dist/js/jquery.orgchart.js
function ($node, relation) { if (!$node || !($node instanceof $) || !$node.is('.node')) { return $(); } if (relation === 'parent') { return $node.closest('.nodes').parent().children(':first').find('.node'); } else if (relation === 'children') { return $node.closest('tr')....
javascript
function ($node, relation) { if (!$node || !($node instanceof $) || !$node.is('.node')) { return $(); } if (relation === 'parent') { return $node.closest('.nodes').parent().children(':first').find('.node'); } else if (relation === 'children') { return $node.closest('tr')....
[ "function", "(", "$node", ",", "relation", ")", "{", "if", "(", "!", "$node", "||", "!", "(", "$node", "instanceof", "$", ")", "||", "!", "$node", ".", "is", "(", "'.node'", ")", ")", "{", "return", "$", "(", ")", ";", "}", "if", "(", "relation...
find the related nodes
[ "find", "the", "related", "nodes" ]
188a8e4ba6dd0979588474765edb01891d85a38d
https://github.com/dabeng/OrgChart/blob/188a8e4ba6dd0979588474765edb01891d85a38d/dist/js/jquery.orgchart.js#L443-L456
train
dabeng/OrgChart
dist/js/jquery.orgchart.js
function ($node) { var $upperLevel = $node.closest('.nodes').siblings(); if ($upperLevel.eq(0).find('.spinner').length) { $node.closest('.orgchart').data('inAjax', false); } // hide the sibling nodes if (this.getNodeState($node, 'siblings').visible) { this.hideSiblings($nod...
javascript
function ($node) { var $upperLevel = $node.closest('.nodes').siblings(); if ($upperLevel.eq(0).find('.spinner').length) { $node.closest('.orgchart').data('inAjax', false); } // hide the sibling nodes if (this.getNodeState($node, 'siblings').visible) { this.hideSiblings($nod...
[ "function", "(", "$node", ")", "{", "var", "$upperLevel", "=", "$node", ".", "closest", "(", "'.nodes'", ")", ".", "siblings", "(", ")", ";", "if", "(", "$upperLevel", ".", "eq", "(", "0", ")", ".", "find", "(", "'.spinner'", ")", ".", "length", ")...
recursively hide the ancestor node and sibling nodes of the specified node
[ "recursively", "hide", "the", "ancestor", "node", "and", "sibling", "nodes", "of", "the", "specified", "node" ]
188a8e4ba6dd0979588474765edb01891d85a38d
https://github.com/dabeng/OrgChart/blob/188a8e4ba6dd0979588474765edb01891d85a38d/dist/js/jquery.orgchart.js#L462-L483
train
dabeng/OrgChart
dist/js/jquery.orgchart.js
function ($node) { // just show only one superior level var $upperLevel = $node.closest('.nodes').siblings().removeClass('hidden'); // just show only one line $upperLevel.eq(2).children().slice(1, -1).addClass('hidden'); // show parent node with animation var $parent = $upperLevel.eq...
javascript
function ($node) { // just show only one superior level var $upperLevel = $node.closest('.nodes').siblings().removeClass('hidden'); // just show only one line $upperLevel.eq(2).children().slice(1, -1).addClass('hidden'); // show parent node with animation var $parent = $upperLevel.eq...
[ "function", "(", "$node", ")", "{", "// just show only one superior level", "var", "$upperLevel", "=", "$node", ".", "closest", "(", "'.nodes'", ")", ".", "siblings", "(", ")", ".", "removeClass", "(", "'hidden'", ")", ";", "// just show only one line", "$upperLev...
show the parent node of the specified node
[ "show", "the", "parent", "node", "of", "the", "specified", "node" ]
188a8e4ba6dd0979588474765edb01891d85a38d
https://github.com/dabeng/OrgChart/blob/188a8e4ba6dd0979588474765edb01891d85a38d/dist/js/jquery.orgchart.js#L492-L501
train