id int32 0 58k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
35,000 | MrSlide/parseSRT | src/parse-srt.js | lastNonEmptyLine | function lastNonEmptyLine (linesArray) {
let idx = linesArray.length - 1
while (idx >= 0 && !linesArray[idx]) {
idx--
}
return idx
} | javascript | function lastNonEmptyLine (linesArray) {
let idx = linesArray.length - 1
while (idx >= 0 && !linesArray[idx]) {
idx--
}
return idx
} | [
"function",
"lastNonEmptyLine",
"(",
"linesArray",
")",
"{",
"let",
"idx",
"=",
"linesArray",
".",
"length",
"-",
"1",
"while",
"(",
"idx",
">=",
"0",
"&&",
"!",
"linesArray",
"[",
"idx",
"]",
")",
"{",
"idx",
"--",
"}",
"return",
"idx",
"}"
] | Get the last non empty line number.
@private
@param {Array<String>} linesArray - All the lines.
@return {Number} - The number of the last non empty line. | [
"Get",
"the",
"last",
"non",
"empty",
"line",
"number",
"."
] | a643978ca81590496ab3e9a471256b7efe04ffe3 | https://github.com/MrSlide/parseSRT/blob/a643978ca81590496ab3e9a471256b7efe04ffe3/src/parse-srt.js#L69-L77 |
35,001 | GoblinDBRocks/GoblinDB | lib/storage/filesystem.js | writeToFile | function writeToFile(file) {
if (!writeQueue[file]) {
return;
}
// If not already saving then save, but using the object we make sure to take only
// the last changes.
// Truncate - https://stackoverflow.com/questions/35178903/overwrite-a-file-in-node-js
fs.truncate(file, err => {
const bef... | javascript | function writeToFile(file) {
if (!writeQueue[file]) {
return;
}
// If not already saving then save, but using the object we make sure to take only
// the last changes.
// Truncate - https://stackoverflow.com/questions/35178903/overwrite-a-file-in-node-js
fs.truncate(file, err => {
const bef... | [
"function",
"writeToFile",
"(",
"file",
")",
"{",
"if",
"(",
"!",
"writeQueue",
"[",
"file",
"]",
")",
"{",
"return",
";",
"}",
"// If not already saving then save, but using the object we make sure to take only",
"// the last changes.",
"// Truncate - https://stackoverflow.c... | Save db data to a file from the write queue.
@param {string} file File path.
@returns {void} Nothing | [
"Save",
"db",
"data",
"to",
"a",
"file",
"from",
"the",
"write",
"queue",
"."
] | 82e479396f49e5f2aa0b6bef0af91f1f187578ba | https://github.com/GoblinDBRocks/GoblinDB/blob/82e479396f49e5f2aa0b6bef0af91f1f187578ba/lib/storage/filesystem.js#L67-L88 |
35,002 | GoblinDBRocks/GoblinDB | lib/storage/filesystem.js | resolveAllWriteQueueCallbacks | function resolveAllWriteQueueCallbacks(file, error) {
writeQueue[file].callbacks.forEach(cb => cb(error));
} | javascript | function resolveAllWriteQueueCallbacks(file, error) {
writeQueue[file].callbacks.forEach(cb => cb(error));
} | [
"function",
"resolveAllWriteQueueCallbacks",
"(",
"file",
",",
"error",
")",
"{",
"writeQueue",
"[",
"file",
"]",
".",
"callbacks",
".",
"forEach",
"(",
"cb",
"=>",
"cb",
"(",
"error",
")",
")",
";",
"}"
] | Internal. Call to every callback of a the write queue for a file.
@param {string} file File path .
@param {string} error Error message or null.
@returns {void} Nothing. | [
"Internal",
".",
"Call",
"to",
"every",
"callback",
"of",
"a",
"the",
"write",
"queue",
"for",
"a",
"file",
"."
] | 82e479396f49e5f2aa0b6bef0af91f1f187578ba | https://github.com/GoblinDBRocks/GoblinDB/blob/82e479396f49e5f2aa0b6bef0af91f1f187578ba/lib/storage/filesystem.js#L120-L122 |
35,003 | monotonee/escape-regex-string | index.js | escapeRegexString | function escapeRegexString(unescapedString, escapeCharsRegex) {
// Validate arguments.
if (Object.prototype.toString.call(unescapedString) !== '[object String]') {
throw new TypeError('Argument 1 should be a string.');
}
if (escapeCharsRegex === undefined) {
escapeCharsRegex = defaultEsc... | javascript | function escapeRegexString(unescapedString, escapeCharsRegex) {
// Validate arguments.
if (Object.prototype.toString.call(unescapedString) !== '[object String]') {
throw new TypeError('Argument 1 should be a string.');
}
if (escapeCharsRegex === undefined) {
escapeCharsRegex = defaultEsc... | [
"function",
"escapeRegexString",
"(",
"unescapedString",
",",
"escapeCharsRegex",
")",
"{",
"// Validate arguments.",
"if",
"(",
"Object",
".",
"prototype",
".",
"toString",
".",
"call",
"(",
"unescapedString",
")",
"!==",
"'[object String]'",
")",
"{",
"throw",
"... | Escape a string literal for use as an argument in the standard RegExp constructor.
@alias module:escape-regex-string
@param {string} unescapedString - The string containing a regex pattern to be escaped.
@param {RegExp} [escapeCharsRegex] - An optional RegEx pattern containing a set of characters to escape. If not
pass... | [
"Escape",
"a",
"string",
"literal",
"for",
"use",
"as",
"an",
"argument",
"in",
"the",
"standard",
"RegExp",
"constructor",
"."
] | 9f46a7e4bb6b3b40bcd487005947235fdeaa84c6 | https://github.com/monotonee/escape-regex-string/blob/9f46a7e4bb6b3b40bcd487005947235fdeaa84c6/index.js#L26-L39 |
35,004 | observing/argh | index.js | parse | function parse(argv) {
argv = argv || process.argv.slice(2);
/**
* This is where the actual parsing happens, we can use array#reduce to
* iterate over the arguments and change it to an object. We can easily bail
* out of the loop by destroying `argv` array.
*
* @param {Object} argh The object that s... | javascript | function parse(argv) {
argv = argv || process.argv.slice(2);
/**
* This is where the actual parsing happens, we can use array#reduce to
* iterate over the arguments and change it to an object. We can easily bail
* out of the loop by destroying `argv` array.
*
* @param {Object} argh The object that s... | [
"function",
"parse",
"(",
"argv",
")",
"{",
"argv",
"=",
"argv",
"||",
"process",
".",
"argv",
".",
"slice",
"(",
"2",
")",
";",
"/**\n * This is where the actual parsing happens, we can use array#reduce to\n * iterate over the arguments and change it to an object. We can e... | Argv is a extremely light weight options parser for Node.js it's been built
for just one single purpose, parsing arguments. It does nothing more than
that.
@param {Array} argv The arguments that need to be parsed, defaults to process.argv
@returns {Object} Parsed arguments.
@api public | [
"Argv",
"is",
"a",
"extremely",
"light",
"weight",
"options",
"parser",
"for",
"Node",
".",
"js",
"it",
"s",
"been",
"built",
"for",
"just",
"one",
"single",
"purpose",
"parsing",
"arguments",
".",
"It",
"does",
"nothing",
"more",
"than",
"that",
"."
] | 74ed701a7214ad581efe3303ea65cf71998308ac | https://github.com/observing/argh/blob/74ed701a7214ad581efe3303ea65cf71998308ac/index.js#L12-L78 |
35,005 | observing/argh | index.js | insert | function insert(argh, key, value, option) {
//
// Automatic value conversion. This makes sure we store the correct "type"
//
if ('string' === typeof value && !isNaN(+value)) value = +value;
if (value === 'true' || value === 'false') value = value === 'true';
var single = option.charAt(1) !== '-'
, prop... | javascript | function insert(argh, key, value, option) {
//
// Automatic value conversion. This makes sure we store the correct "type"
//
if ('string' === typeof value && !isNaN(+value)) value = +value;
if (value === 'true' || value === 'false') value = value === 'true';
var single = option.charAt(1) !== '-'
, prop... | [
"function",
"insert",
"(",
"argh",
",",
"key",
",",
"value",
",",
"option",
")",
"{",
"//",
"// Automatic value conversion. This makes sure we store the correct \"type\"",
"//",
"if",
"(",
"'string'",
"===",
"typeof",
"value",
"&&",
"!",
"isNaN",
"(",
"+",
"value"... | Inserts the value in the argh object
@param {Object} argh The object where we store the values
@param {String} key The received command line flag
@param {String} value The command line flag's value
@param {String} option The actual option
@api private | [
"Inserts",
"the",
"value",
"in",
"the",
"argh",
"object"
] | 74ed701a7214ad581efe3303ea65cf71998308ac | https://github.com/observing/argh/blob/74ed701a7214ad581efe3303ea65cf71998308ac/index.js#L89-L123 |
35,006 | Clever-Labs/seo-checker | src/index.js | function(url, callback) {
// Check if user input protocol
if (url.indexOf('http://') < 0 && url.indexOf('https://') < 0) { // TODO: Turn this into its own function
url = 'http://' + url;
}
// Make request and fire callback
request.get(url.toLowerCase(), function(error, response, body) {
... | javascript | function(url, callback) {
// Check if user input protocol
if (url.indexOf('http://') < 0 && url.indexOf('https://') < 0) { // TODO: Turn this into its own function
url = 'http://' + url;
}
// Make request and fire callback
request.get(url.toLowerCase(), function(error, response, body) {
... | [
"function",
"(",
"url",
",",
"callback",
")",
"{",
"// Check if user input protocol",
"if",
"(",
"url",
".",
"indexOf",
"(",
"'http://'",
")",
"<",
"0",
"&&",
"url",
".",
"indexOf",
"(",
"'https://'",
")",
"<",
"0",
")",
"{",
"// TODO: Turn this into its own... | Load HTML for a single URL
Use this to fetch the contents of a single URL then
pass the result to the `meta` function or any other
code that can parse or transform the response body of
an HTTP request.
`url` [String] - URL of page to read
`callback` [Function] - Function to call on completion
Returns the response bo... | [
"Load",
"HTML",
"for",
"a",
"single",
"URL"
] | 11501c9e4a90cd014dcded8961528e3948b8930e | https://github.com/Clever-Labs/seo-checker/blob/11501c9e4a90cd014dcded8961528e3948b8930e/src/index.js#L26-L40 | |
35,007 | Clever-Labs/seo-checker | src/index.js | function(body) {
var $ = cheerio.load(body),
page = {};
// Meta signals
page.title = $('title').text() || null;
page.description = $('meta[name=description]').attr('content') || null;
page.author = $('meta[name=author]').attr('content') || null;
page.keywords = $('meta[name=keyword... | javascript | function(body) {
var $ = cheerio.load(body),
page = {};
// Meta signals
page.title = $('title').text() || null;
page.description = $('meta[name=description]').attr('content') || null;
page.author = $('meta[name=author]').attr('content') || null;
page.keywords = $('meta[name=keyword... | [
"function",
"(",
"body",
")",
"{",
"var",
"$",
"=",
"cheerio",
".",
"load",
"(",
"body",
")",
",",
"page",
"=",
"{",
"}",
";",
"// Meta signals",
"page",
".",
"title",
"=",
"$",
"(",
"'title'",
")",
".",
"text",
"(",
")",
"||",
"null",
";",
"pa... | Parse meta data from an HTTP response body
`body` [String] - The HTML of a web page to parse
Returns an object containing data related to the SEO
signals of the page that was parsed. Pass the result to
another function to determine an "SEO score". | [
"Parse",
"meta",
"data",
"from",
"an",
"HTTP",
"response",
"body"
] | 11501c9e4a90cd014dcded8961528e3948b8930e | https://github.com/Clever-Labs/seo-checker/blob/11501c9e4a90cd014dcded8961528e3948b8930e/src/index.js#L51-L80 | |
35,008 | Clever-Labs/seo-checker | src/index.js | function(url, options, callback) {
var crawler = Crawler.crawl(url.toLowerCase()),
opts = options || {},
maxPages = opts.maxPages || 10,
parsedPages = [], // Store parsed pages in this array
seoParser = this.meta, // Reference to `meta` method to ca... | javascript | function(url, options, callback) {
var crawler = Crawler.crawl(url.toLowerCase()),
opts = options || {},
maxPages = opts.maxPages || 10,
parsedPages = [], // Store parsed pages in this array
seoParser = this.meta, // Reference to `meta` method to ca... | [
"function",
"(",
"url",
",",
"options",
",",
"callback",
")",
"{",
"var",
"crawler",
"=",
"Crawler",
".",
"crawl",
"(",
"url",
".",
"toLowerCase",
"(",
")",
")",
",",
"opts",
"=",
"options",
"||",
"{",
"}",
",",
"maxPages",
"=",
"opts",
".",
"maxPa... | Generate SEO data for multiple pages of a site at once
`url` [String] - The URL to begin the crawl
`options` [Object] - Options to pass to the crawler. Uses a subset of the `simplecrawler` lib's options:
- `maxPages` [Number] - The max number of pages to crawl (defaults to 10)
- `interval` [Number] - Delay between eac... | [
"Generate",
"SEO",
"data",
"for",
"multiple",
"pages",
"of",
"a",
"site",
"at",
"once"
] | 11501c9e4a90cd014dcded8961528e3948b8930e | https://github.com/Clever-Labs/seo-checker/blob/11501c9e4a90cd014dcded8961528e3948b8930e/src/index.js#L103-L143 | |
35,009 | TourCMS/node-tourcms | node-tourcms.js | apiResponded | function apiResponded(apiResponse) {
// Convert XML to JS object
var parser = new xml2js.Parser({explicitArray:false});
parser.parseString(apiResponse, function (err, result) {
// If the method processes the response, give it back
// Otherwise call the original callback
if(typ... | javascript | function apiResponded(apiResponse) {
// Convert XML to JS object
var parser = new xml2js.Parser({explicitArray:false});
parser.parseString(apiResponse, function (err, result) {
// If the method processes the response, give it back
// Otherwise call the original callback
if(typ... | [
"function",
"apiResponded",
"(",
"apiResponse",
")",
"{",
"// Convert XML to JS object",
"var",
"parser",
"=",
"new",
"xml2js",
".",
"Parser",
"(",
"{",
"explicitArray",
":",
"false",
"}",
")",
";",
"parser",
".",
"parseString",
"(",
"apiResponse",
",",
"funct... | Process API response | [
"Process",
"API",
"response"
] | 1d23ff7ba4ed6fcda5e84f2018d27129efec4978 | https://github.com/TourCMS/node-tourcms/blob/1d23ff7ba4ed6fcda5e84f2018d27129efec4978/node-tourcms.js#L87-L101 |
35,010 | Bitcoin-com/wormhole-sdk | examples/data-retrieval/token-info-from-tx/token-info-from-tx.js | getTxInfo | async function getTxInfo() {
const retVal = await Wormhole.DataRetrieval.transaction(TXID)
console.log(`Info from TXID ${TXID}: ${JSON.stringify(retVal, null, 2)}`)
} | javascript | async function getTxInfo() {
const retVal = await Wormhole.DataRetrieval.transaction(TXID)
console.log(`Info from TXID ${TXID}: ${JSON.stringify(retVal, null, 2)}`)
} | [
"async",
"function",
"getTxInfo",
"(",
")",
"{",
"const",
"retVal",
"=",
"await",
"Wormhole",
".",
"DataRetrieval",
".",
"transaction",
"(",
"TXID",
")",
"console",
".",
"log",
"(",
"`",
"${",
"TXID",
"}",
"${",
"JSON",
".",
"stringify",
"(",
"retVal",
... | Get Token info from the TX. | [
"Get",
"Token",
"info",
"from",
"the",
"TX",
"."
] | 13dd35295b0b3a6bb84e895f96c978cbb906193b | https://github.com/Bitcoin-com/wormhole-sdk/blob/13dd35295b0b3a6bb84e895f96c978cbb906193b/examples/data-retrieval/token-info-from-tx/token-info-from-tx.js#L20-L24 |
35,011 | qixotic/s3-to-logstore | index.js | function(data, prefix) {
prefix = prefix || '';
var row = Object.keys(data).map(function(key) {
if (typeof data[key] !== 'object') {
return util.format('%s%s="%s"', prefix, key, data[key]);
}
// Flatten this nested object.
return _reformat(data[key], key + '.');
});
return row.join(' ');
} | javascript | function(data, prefix) {
prefix = prefix || '';
var row = Object.keys(data).map(function(key) {
if (typeof data[key] !== 'object') {
return util.format('%s%s="%s"', prefix, key, data[key]);
}
// Flatten this nested object.
return _reformat(data[key], key + '.');
});
return row.join(' ');
} | [
"function",
"(",
"data",
",",
"prefix",
")",
"{",
"prefix",
"=",
"prefix",
"||",
"''",
";",
"var",
"row",
"=",
"Object",
".",
"keys",
"(",
"data",
")",
".",
"map",
"(",
"function",
"(",
"key",
")",
"{",
"if",
"(",
"typeof",
"data",
"[",
"key",
... | data - json object representation of a log line. prefix - string to prefix a key with. Used in flattening nested objects. Returns a single string of concatenated key=value pairs. | [
"data",
"-",
"json",
"object",
"representation",
"of",
"a",
"log",
"line",
".",
"prefix",
"-",
"string",
"to",
"prefix",
"a",
"key",
"with",
".",
"Used",
"in",
"flattening",
"nested",
"objects",
".",
"Returns",
"a",
"single",
"string",
"of",
"concatenated"... | 5b29d237f2d9bd3f996f281488f62ccfe3f1888b | https://github.com/qixotic/s3-to-logstore/blob/5b29d237f2d9bd3f996f281488f62ccfe3f1888b/index.js#L13-L23 | |
35,012 | frank198/pomelo-upgrade | template/web-server/public/js/lib/socket.io.js | Socket | function Socket (options) {
this.options = {
port: 80
, secure: false
, document: 'document' in global ? document : false
, resource: 'socket.io'
, transports: io.transports
, 'connect timeout': 10000
, 'try multiple transports': true
, 'reconnect': true
, 're... | javascript | function Socket (options) {
this.options = {
port: 80
, secure: false
, document: 'document' in global ? document : false
, resource: 'socket.io'
, transports: io.transports
, 'connect timeout': 10000
, 'try multiple transports': true
, 'reconnect': true
, 're... | [
"function",
"Socket",
"(",
"options",
")",
"{",
"this",
".",
"options",
"=",
"{",
"port",
":",
"80",
",",
"secure",
":",
"false",
",",
"document",
":",
"'document'",
"in",
"global",
"?",
"document",
":",
"false",
",",
"resource",
":",
"'socket.io'",
",... | Create a new `Socket.IO client` which can establish a persistent
connection with a Socket.IO enabled server.
@api public | [
"Create",
"a",
"new",
"Socket",
".",
"IO",
"client",
"which",
"can",
"establish",
"a",
"persistent",
"connection",
"with",
"a",
"Socket",
".",
"IO",
"enabled",
"server",
"."
] | 6d56e02d0e61b3ffd05bd69a2337ec3a4ed9b0e5 | https://github.com/frank198/pomelo-upgrade/blob/6d56e02d0e61b3ffd05bd69a2337ec3a4ed9b0e5/template/web-server/public/js/lib/socket.io.js#L1491-L1532 |
35,013 | Urigo/meteor-native-packages | packages/ddp-client/stub_stream.js | function (name, callback) {
var self = this;
if (!self.callbacks[name])
self.callbacks[name] = [callback];
else
self.callbacks[name].push(callback);
} | javascript | function (name, callback) {
var self = this;
if (!self.callbacks[name])
self.callbacks[name] = [callback];
else
self.callbacks[name].push(callback);
} | [
"function",
"(",
"name",
",",
"callback",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"!",
"self",
".",
"callbacks",
"[",
"name",
"]",
")",
"self",
".",
"callbacks",
"[",
"name",
"]",
"=",
"[",
"callback",
"]",
";",
"else",
"self",
".",... | Methods from Stream | [
"Methods",
"from",
"Stream"
] | 8eb7fdd554aad0ff78a0dc19b9c62016d2b2e7a7 | https://github.com/Urigo/meteor-native-packages/blob/8eb7fdd554aad0ff78a0dc19b9c62016d2b2e7a7/packages/ddp-client/stub_stream.js#L11-L18 | |
35,014 | Urigo/meteor-native-packages | packages/ddp-client/stub_stream.js | function (data) {
var self = this;
if (typeof data === 'object') {
data = EJSON.stringify(data);
}
_.each(self.callbacks['message'], function (cb) {
cb(data);
});
} | javascript | function (data) {
var self = this;
if (typeof data === 'object') {
data = EJSON.stringify(data);
}
_.each(self.callbacks['message'], function (cb) {
cb(data);
});
} | [
"function",
"(",
"data",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"typeof",
"data",
"===",
"'object'",
")",
"{",
"data",
"=",
"EJSON",
".",
"stringify",
"(",
"data",
")",
";",
"}",
"_",
".",
"each",
"(",
"self",
".",
"callbacks",
"["... | Methods for tests | [
"Methods",
"for",
"tests"
] | 8eb7fdd554aad0ff78a0dc19b9c62016d2b2e7a7 | https://github.com/Urigo/meteor-native-packages/blob/8eb7fdd554aad0ff78a0dc19b9c62016d2b2e7a7/packages/ddp-client/stub_stream.js#L38-L48 | |
35,015 | Collaborne/gulp-polymer-build-utils | integrated-build.js | build | function build(config) {
return lazypipe()
.pipe(() => polymerBuild(config))
.pipe(() => addCspCompliance())
.pipe(() => addCacheBusting())
.pipe(() => optimizeAssets())
.pipe(() => injectCustomElementsEs5Adapter());
} | javascript | function build(config) {
return lazypipe()
.pipe(() => polymerBuild(config))
.pipe(() => addCspCompliance())
.pipe(() => addCacheBusting())
.pipe(() => optimizeAssets())
.pipe(() => injectCustomElementsEs5Adapter());
} | [
"function",
"build",
"(",
"config",
")",
"{",
"return",
"lazypipe",
"(",
")",
".",
"pipe",
"(",
"(",
")",
"=>",
"polymerBuild",
"(",
"config",
")",
")",
".",
"pipe",
"(",
"(",
")",
"=>",
"addCspCompliance",
"(",
")",
")",
".",
"pipe",
"(",
"(",
"... | Best practice build pipeline. This only only chains up the various build steps.
@param {Object} config Content of polymer.json
@return | [
"Best",
"practice",
"build",
"pipeline",
".",
"This",
"only",
"only",
"chains",
"up",
"the",
"various",
"build",
"steps",
"."
] | 76f83ea018f726a9e4390444deef65dbe9dde1ff | https://github.com/Collaborne/gulp-polymer-build-utils/blob/76f83ea018f726a9e4390444deef65dbe9dde1ff/integrated-build.js#L16-L23 |
35,016 | Urigo/meteor-native-packages | packages/ddp-server/stream_server.js | function (callback) {
var self = this;
self.registration_callbacks.push(callback);
_.each(self.all_sockets(), function (socket) {
callback(socket);
});
} | javascript | function (callback) {
var self = this;
self.registration_callbacks.push(callback);
_.each(self.all_sockets(), function (socket) {
callback(socket);
});
} | [
"function",
"(",
"callback",
")",
"{",
"var",
"self",
"=",
"this",
";",
"self",
".",
"registration_callbacks",
".",
"push",
"(",
"callback",
")",
";",
"_",
".",
"each",
"(",
"self",
".",
"all_sockets",
"(",
")",
",",
"function",
"(",
"socket",
")",
"... | call my callback when a new socket connects. also call it for all current connections. | [
"call",
"my",
"callback",
"when",
"a",
"new",
"socket",
"connects",
".",
"also",
"call",
"it",
"for",
"all",
"current",
"connections",
"."
] | 8eb7fdd554aad0ff78a0dc19b9c62016d2b2e7a7 | https://github.com/Urigo/meteor-native-packages/blob/8eb7fdd554aad0ff78a0dc19b9c62016d2b2e7a7/packages/ddp-server/stream_server.js#L106-L112 | |
35,017 | Urigo/meteor-native-packages | packages/ddp-server/stream_server.js | function(request /*, moreArguments */) {
// Store arguments for use within the closure below
var args = arguments;
// Rewrite /websocket and /websocket/ urls to /sockjs/websocket while
// preserving query string.
var parsedUrl = url.parse(request.url);
if (parsedUrl.path... | javascript | function(request /*, moreArguments */) {
// Store arguments for use within the closure below
var args = arguments;
// Rewrite /websocket and /websocket/ urls to /sockjs/websocket while
// preserving query string.
var parsedUrl = url.parse(request.url);
if (parsedUrl.path... | [
"function",
"(",
"request",
"/*, moreArguments */",
")",
"{",
"// Store arguments for use within the closure below",
"var",
"args",
"=",
"arguments",
";",
"// Rewrite /websocket and /websocket/ urls to /sockjs/websocket while",
"// preserving query string.",
"var",
"parsedUrl",
"=",
... | request and upgrade have different arguments passed but we only care about the first one which is always request | [
"request",
"and",
"upgrade",
"have",
"different",
"arguments",
"passed",
"but",
"we",
"only",
"care",
"about",
"the",
"first",
"one",
"which",
"is",
"always",
"request"
] | 8eb7fdd554aad0ff78a0dc19b9c62016d2b2e7a7 | https://github.com/Urigo/meteor-native-packages/blob/8eb7fdd554aad0ff78a0dc19b9c62016d2b2e7a7/packages/ddp-server/stream_server.js#L136-L151 | |
35,018 | a8m/agile | dist/agile.js | add | function add(object) {
var args = Array.prototype.slice.call(arguments, 1);
//loop through all over the arguments
forEach(args, function(value, i) {
switch(typeof object) {
case 'object':
isArray(object)
? object.push(value)
: extend(object, isObject(value) ? value : creObjec... | javascript | function add(object) {
var args = Array.prototype.slice.call(arguments, 1);
//loop through all over the arguments
forEach(args, function(value, i) {
switch(typeof object) {
case 'object':
isArray(object)
? object.push(value)
: extend(object, isObject(value) ? value : creObjec... | [
"function",
"add",
"(",
"object",
")",
"{",
"var",
"args",
"=",
"Array",
".",
"prototype",
".",
"slice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
";",
"//loop through all over the arguments",
"forEach",
"(",
"args",
",",
"function",
"(",
"value",
",",... | these methods is kind of common methods for chaining wrappers
@description
add methods get an object extend(based on type) and return it.
@param object
@returns {*}
@example
add(1,2) ==> 3
add([],1) ==> [1]
add('f','g') ==> 'fg'
add({}, {a:1}) ==> {a:1} | [
"these",
"methods",
"is",
"kind",
"of",
"common",
"methods",
"for",
"chaining",
"wrappers"
] | fcf3f8667e44c621bcdc3065c3a03b29e16851eb | https://github.com/a8m/agile/blob/fcf3f8667e44c621bcdc3065c3a03b29e16851eb/dist/agile.js#L938-L956 |
35,019 | a8m/agile | dist/agile.js | runInContext | function runInContext(context) {
// Node.js
return (typeof module === "object" && module && module.exports === context)
? module.exports = agile
// Browsers
: context[(context._) ? 'agile' : '_'] = agile;
} | javascript | function runInContext(context) {
// Node.js
return (typeof module === "object" && module && module.exports === context)
? module.exports = agile
// Browsers
: context[(context._) ? 'agile' : '_'] = agile;
} | [
"function",
"runInContext",
"(",
"context",
")",
"{",
"// Node.js",
"return",
"(",
"typeof",
"module",
"===",
"\"object\"",
"&&",
"module",
"&&",
"module",
".",
"exports",
"===",
"context",
")",
"?",
"module",
".",
"exports",
"=",
"agile",
"// Browsers",
":"... | Expose agile.js | [
"Expose",
"agile",
".",
"js"
] | fcf3f8667e44c621bcdc3065c3a03b29e16851eb | https://github.com/a8m/agile/blob/fcf3f8667e44c621bcdc3065c3a03b29e16851eb/dist/agile.js#L2708-L2714 |
35,020 | arccoza/postcss-if-media | index.js | processIfValues | function processIfValues(css, result, rule, decl, queries) {
var query = null;
var re = /(.*)\s+(?:\?if|\?)\s+media\s+(.*)/;
var re2 = /\s/g;
var hash = null;
// Check if we're working with comments.
var match = decl.value ? decl.value.match(re) : decl.text.match(re);
// console.log(match)
if(match && ... | javascript | function processIfValues(css, result, rule, decl, queries) {
var query = null;
var re = /(.*)\s+(?:\?if|\?)\s+media\s+(.*)/;
var re2 = /\s/g;
var hash = null;
// Check if we're working with comments.
var match = decl.value ? decl.value.match(re) : decl.text.match(re);
// console.log(match)
if(match && ... | [
"function",
"processIfValues",
"(",
"css",
",",
"result",
",",
"rule",
",",
"decl",
",",
"queries",
")",
"{",
"var",
"query",
"=",
"null",
";",
"var",
"re",
"=",
"/",
"(.*)\\s+(?:\\?if|\\?)\\s+media\\s+(.*)",
"/",
";",
"var",
"re2",
"=",
"/",
"\\s",
"/",... | Extract the values and add them to the list of queries. Props are grouped by their queries, so that they appear in the same @media block later. | [
"Extract",
"the",
"values",
"and",
"add",
"them",
"to",
"the",
"list",
"of",
"queries",
".",
"Props",
"are",
"grouped",
"by",
"their",
"queries",
"so",
"that",
"they",
"appear",
"in",
"the",
"same"
] | bdd4997231547cb5a82eca64c33aaec1f472c6a6 | https://github.com/arccoza/postcss-if-media/blob/bdd4997231547cb5a82eca64c33aaec1f472c6a6/index.js#L77-L104 |
35,021 | arccoza/postcss-if-media | index.js | createAtRules | function createAtRules(css, rule, queries) {
var parent = rule.parent;
var prev = rule;
for(var k in queries) {
var q = queries[k];
var at = postcss.atRule({name: 'media', params: q.arg, source: rule.source});
var qr = postcss.rule ({selector: q.sel, source: rule.source});
at.append(qr);
fo... | javascript | function createAtRules(css, rule, queries) {
var parent = rule.parent;
var prev = rule;
for(var k in queries) {
var q = queries[k];
var at = postcss.atRule({name: 'media', params: q.arg, source: rule.source});
var qr = postcss.rule ({selector: q.sel, source: rule.source});
at.append(qr);
fo... | [
"function",
"createAtRules",
"(",
"css",
",",
"rule",
",",
"queries",
")",
"{",
"var",
"parent",
"=",
"rule",
".",
"parent",
";",
"var",
"prev",
"=",
"rule",
";",
"for",
"(",
"var",
"k",
"in",
"queries",
")",
"{",
"var",
"q",
"=",
"queries",
"[",
... | The previously extracted inline queries and their associated properties are used to create @media rules below(to maintain CSS specificity) the parent rule. | [
"The",
"previously",
"extracted",
"inline",
"queries",
"and",
"their",
"associated",
"properties",
"are",
"used",
"to",
"create"
] | bdd4997231547cb5a82eca64c33aaec1f472c6a6 | https://github.com/arccoza/postcss-if-media/blob/bdd4997231547cb5a82eca64c33aaec1f472c6a6/index.js#L108-L130 |
35,022 | medialab/sandcrawler | phantom/bindings.js | getContent | function getContent() {
var h = pageInformation.response.headers || {};
if (/json/.test(h['content-type'])) {
try {
return JSON.parse(page.plainText);
}
catch (e) {
return page.content;
}
}
else {
return page.content;
}
} | javascript | function getContent() {
var h = pageInformation.response.headers || {};
if (/json/.test(h['content-type'])) {
try {
return JSON.parse(page.plainText);
}
catch (e) {
return page.content;
}
}
else {
return page.content;
}
} | [
"function",
"getContent",
"(",
")",
"{",
"var",
"h",
"=",
"pageInformation",
".",
"response",
".",
"headers",
"||",
"{",
"}",
";",
"if",
"(",
"/",
"json",
"/",
".",
"test",
"(",
"h",
"[",
"'content-type'",
"]",
")",
")",
"{",
"try",
"{",
"return",
... | Helpers
Get correct page content | [
"Helpers",
"Get",
"correct",
"page",
"content"
] | c08e19095eee42c8ce1f84685960e5ea6cb0fd1d | https://github.com/medialab/sandcrawler/blob/c08e19095eee42c8ce1f84685960e5ea6cb0fd1d/phantom/bindings.js#L159-L172 |
35,023 | medialab/sandcrawler | phantom/bindings.js | wrapFailure | function wrapFailure(reason) {
var res = {
fail: true,
url: page.url,
body: getContent(),
headers: pageInformation.response.headers,
status: pageInformation.response.status
};
if (reason)
res.reason = reason;
if (pageInformation.error)
re... | javascript | function wrapFailure(reason) {
var res = {
fail: true,
url: page.url,
body: getContent(),
headers: pageInformation.response.headers,
status: pageInformation.response.status
};
if (reason)
res.reason = reason;
if (pageInformation.error)
re... | [
"function",
"wrapFailure",
"(",
"reason",
")",
"{",
"var",
"res",
"=",
"{",
"fail",
":",
"true",
",",
"url",
":",
"page",
".",
"url",
",",
"body",
":",
"getContent",
"(",
")",
",",
"headers",
":",
"pageInformation",
".",
"response",
".",
"headers",
"... | Wrapping response helper | [
"Wrapping",
"response",
"helper"
] | c08e19095eee42c8ce1f84685960e5ea6cb0fd1d | https://github.com/medialab/sandcrawler/blob/c08e19095eee42c8ce1f84685960e5ea6cb0fd1d/phantom/bindings.js#L175-L191 |
35,024 | medialab/sandcrawler | phantom/bindings.js | wrapSuccess | function wrapSuccess(result) {
return {
url: page.url,
body: getContent(),
headers: pageInformation.response.headers,
status: pageInformation.response.status,
error: result.error ? helpers.serializeError(result.error) : null,
data: result.data
};
} | javascript | function wrapSuccess(result) {
return {
url: page.url,
body: getContent(),
headers: pageInformation.response.headers,
status: pageInformation.response.status,
error: result.error ? helpers.serializeError(result.error) : null,
data: result.data
};
} | [
"function",
"wrapSuccess",
"(",
"result",
")",
"{",
"return",
"{",
"url",
":",
"page",
".",
"url",
",",
"body",
":",
"getContent",
"(",
")",
",",
"headers",
":",
"pageInformation",
".",
"response",
".",
"headers",
",",
"status",
":",
"pageInformation",
"... | Wrapping success helper | [
"Wrapping",
"success",
"helper"
] | c08e19095eee42c8ce1f84685960e5ea6cb0fd1d | https://github.com/medialab/sandcrawler/blob/c08e19095eee42c8ce1f84685960e5ea6cb0fd1d/phantom/bindings.js#L194-L203 |
35,025 | medialab/sandcrawler | phantom/bindings.js | function(status) {
// Page is now opened
pageInformation.isOpened = true;
pageInformation.status = status;
// Failing
if (status !== 'success') {
parent.replyTo(callId, wrapFailure('fail'));
return cleanup();
}
// Wrong status code
if (!pageInformation.... | javascript | function(status) {
// Page is now opened
pageInformation.isOpened = true;
pageInformation.status = status;
// Failing
if (status !== 'success') {
parent.replyTo(callId, wrapFailure('fail'));
return cleanup();
}
// Wrong status code
if (!pageInformation.... | [
"function",
"(",
"status",
")",
"{",
"// Page is now opened",
"pageInformation",
".",
"isOpened",
"=",
"true",
";",
"pageInformation",
".",
"status",
"=",
"status",
";",
"// Failing",
"if",
"(",
"status",
"!==",
"'success'",
")",
"{",
"parent",
".",
"replyTo",... | When page load is finished | [
"When",
"page",
"load",
"is",
"finished"
] | c08e19095eee42c8ce1f84685960e5ea6cb0fd1d | https://github.com/medialab/sandcrawler/blob/c08e19095eee42c8ce1f84685960e5ea6cb0fd1d/phantom/bindings.js#L395-L426 | |
35,026 | icelab/draft-js-ast-exporter | src/processor.js | processBlockContent | function processBlockContent (block, contentState, options) {
const entityModifiers = options.entityModifiers || {}
let text = block.getText()
// Cribbed from sstur’s implementation in draft-js-export-html
// https://github.com/sstur/draft-js-export-html/blob/master/src/stateToHTML.js#L222
let charMetaList =... | javascript | function processBlockContent (block, contentState, options) {
const entityModifiers = options.entityModifiers || {}
let text = block.getText()
// Cribbed from sstur’s implementation in draft-js-export-html
// https://github.com/sstur/draft-js-export-html/blob/master/src/stateToHTML.js#L222
let charMetaList =... | [
"function",
"processBlockContent",
"(",
"block",
",",
"contentState",
",",
"options",
")",
"{",
"const",
"entityModifiers",
"=",
"options",
".",
"entityModifiers",
"||",
"{",
"}",
"let",
"text",
"=",
"block",
".",
"getText",
"(",
")",
"// Cribbed from sstur’s im... | Process the content of a ContentBlock into appropriate abstract syntax tree
nodes based on their type
@param {ContentBlock} block
@param {ContentState} contentState The draft-js ContentState object
containing this block
@param {Object} options.entityModifier Map of functions for modifying entity
data as it’s exporte... | [
"Process",
"the",
"content",
"of",
"a",
"ContentBlock",
"into",
"appropriate",
"abstract",
"syntax",
"tree",
"nodes",
"based",
"on",
"their",
"type"
] | f4745a8a3ca94b51474f21fedc0f92dbbdafd828 | https://github.com/icelab/draft-js-ast-exporter/blob/f4745a8a3ca94b51474f21fedc0f92dbbdafd828/src/processor.js#L14-L70 |
35,027 | icelab/draft-js-ast-exporter | src/processor.js | processBlocks | function processBlocks (blocks, contentState, options = {}) {
// Track block context
let context = context || []
let currentContext = context
let lastBlock = null
let lastProcessed = null
let parents = []
// Procedurally process individual blocks
blocks.forEach(processBlock)
/**
* Process an indi... | javascript | function processBlocks (blocks, contentState, options = {}) {
// Track block context
let context = context || []
let currentContext = context
let lastBlock = null
let lastProcessed = null
let parents = []
// Procedurally process individual blocks
blocks.forEach(processBlock)
/**
* Process an indi... | [
"function",
"processBlocks",
"(",
"blocks",
",",
"contentState",
",",
"options",
"=",
"{",
"}",
")",
"{",
"// Track block context",
"let",
"context",
"=",
"context",
"||",
"[",
"]",
"let",
"currentContext",
"=",
"context",
"let",
"lastBlock",
"=",
"null",
"l... | Convert the content from a series of draft-js blocks into an abstract
syntax tree
@param {Array} blocks
@param {ContentState} contentState The draft-js ContentState object
containing the blocks
@param {Object} options
@return {Array} An abstract syntax tree representing a draft-js content state | [
"Convert",
"the",
"content",
"from",
"a",
"series",
"of",
"draft",
"-",
"js",
"blocks",
"into",
"an",
"abstract",
"syntax",
"tree"
] | f4745a8a3ca94b51474f21fedc0f92dbbdafd828 | https://github.com/icelab/draft-js-ast-exporter/blob/f4745a8a3ca94b51474f21fedc0f92dbbdafd828/src/processor.js#L81-L138 |
35,028 | Geta/NestedObjectAssign | webpack.config.js | getBaseConfig | function getBaseConfig(isProd) {
// get library details from JSON config
var libraryDesc = require('./package.json').library;
var libraryEntryPoint = path.join('src', libraryDesc.entry);
// generate webpack base config
return {
entry: path.join(__dirname, libraryEntryPoint),
output: {
// ommit... | javascript | function getBaseConfig(isProd) {
// get library details from JSON config
var libraryDesc = require('./package.json').library;
var libraryEntryPoint = path.join('src', libraryDesc.entry);
// generate webpack base config
return {
entry: path.join(__dirname, libraryEntryPoint),
output: {
// ommit... | [
"function",
"getBaseConfig",
"(",
"isProd",
")",
"{",
"// get library details from JSON config",
"var",
"libraryDesc",
"=",
"require",
"(",
"'./package.json'",
")",
".",
"library",
";",
"var",
"libraryEntryPoint",
"=",
"path",
".",
"join",
"(",
"'src'",
",",
"libr... | Build base config
@param {Boolean} isProd [description]
@return {[type]} [description] | [
"Build",
"base",
"config"
] | f63a28f1a285af31c7479a5abba88ffd5d2cb39d | https://github.com/Geta/NestedObjectAssign/blob/f63a28f1a285af31c7479a5abba88ffd5d2cb39d/webpack.config.js#L67-L105 |
35,029 | jadrake75/odata-filter-parser | src/odata-parser.js | function (config) {
if (!config) {
config = {};
}
this.subject = config.subject;
this.value = config.value;
this.operator = (config.operator) ? config.operator : Operators.EQUALS;
return this;
} | javascript | function (config) {
if (!config) {
config = {};
}
this.subject = config.subject;
this.value = config.value;
this.operator = (config.operator) ? config.operator : Operators.EQUALS;
return this;
} | [
"function",
"(",
"config",
")",
"{",
"if",
"(",
"!",
"config",
")",
"{",
"config",
"=",
"{",
"}",
";",
"}",
"this",
".",
"subject",
"=",
"config",
".",
"subject",
";",
"this",
".",
"value",
"=",
"config",
".",
"value",
";",
"this",
".",
"operator... | Predicate is the basic model construct of the odata expression
@param config
@returns {Predicate}
@constructor | [
"Predicate",
"is",
"the",
"basic",
"model",
"construct",
"of",
"the",
"odata",
"expression"
] | f8e6e354bdedafe611d7fe82d5fced65ad33e19e | https://github.com/jadrake75/odata-filter-parser/blob/f8e6e354bdedafe611d7fe82d5fced65ad33e19e/src/odata-parser.js#L61-L69 | |
35,030 | Urigo/meteor-native-packages | packages/ddp-client/livedata_connection.js | function () {
var self = this;
if (!self._waitingForQuiescence())
self._flushBufferedWrites();
_.each(self._stores, function (s) {
s.saveOriginals();
});
} | javascript | function () {
var self = this;
if (!self._waitingForQuiescence())
self._flushBufferedWrites();
_.each(self._stores, function (s) {
s.saveOriginals();
});
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"!",
"self",
".",
"_waitingForQuiescence",
"(",
")",
")",
"self",
".",
"_flushBufferedWrites",
"(",
")",
";",
"_",
".",
"each",
"(",
"self",
".",
"_stores",
",",
"function",
"(",
... | Before calling a method stub, prepare all stores to track changes and allow _retrieveAndStoreOriginals to get the original versions of changed documents. | [
"Before",
"calling",
"a",
"method",
"stub",
"prepare",
"all",
"stores",
"to",
"track",
"changes",
"and",
"allow",
"_retrieveAndStoreOriginals",
"to",
"get",
"the",
"original",
"versions",
"of",
"changed",
"documents",
"."
] | 8eb7fdd554aad0ff78a0dc19b9c62016d2b2e7a7 | https://github.com/Urigo/meteor-native-packages/blob/8eb7fdd554aad0ff78a0dc19b9c62016d2b2e7a7/packages/ddp-client/livedata_connection.js#L975-L982 | |
35,031 | Urigo/meteor-native-packages | packages/ddp-client/livedata_connection.js | function() {
var self = this;
if (_.isEmpty(self._outstandingMethodBlocks))
return;
_.each(self._outstandingMethodBlocks[0].methods, function (m) {
m.sendMessage();
});
} | javascript | function() {
var self = this;
if (_.isEmpty(self._outstandingMethodBlocks))
return;
_.each(self._outstandingMethodBlocks[0].methods, function (m) {
m.sendMessage();
});
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"_",
".",
"isEmpty",
"(",
"self",
".",
"_outstandingMethodBlocks",
")",
")",
"return",
";",
"_",
".",
"each",
"(",
"self",
".",
"_outstandingMethodBlocks",
"[",
"0",
"]",
".",
"me... | Sends messages for all the methods in the first block in _outstandingMethodBlocks. | [
"Sends",
"messages",
"for",
"all",
"the",
"methods",
"in",
"the",
"first",
"block",
"in",
"_outstandingMethodBlocks",
"."
] | 8eb7fdd554aad0ff78a0dc19b9c62016d2b2e7a7 | https://github.com/Urigo/meteor-native-packages/blob/8eb7fdd554aad0ff78a0dc19b9c62016d2b2e7a7/packages/ddp-client/livedata_connection.js#L1662-L1669 | |
35,032 | jaredhanson/passport-fitbit | lib/errors/apierror.js | APIError | function APIError(message, type, field) {
Error.call(this);
Error.captureStackTrace(this, arguments.callee);
this.name = 'APIError';
this.message = message;
this.type = type;
this.field = field;
} | javascript | function APIError(message, type, field) {
Error.call(this);
Error.captureStackTrace(this, arguments.callee);
this.name = 'APIError';
this.message = message;
this.type = type;
this.field = field;
} | [
"function",
"APIError",
"(",
"message",
",",
"type",
",",
"field",
")",
"{",
"Error",
".",
"call",
"(",
"this",
")",
";",
"Error",
".",
"captureStackTrace",
"(",
"this",
",",
"arguments",
".",
"callee",
")",
";",
"this",
".",
"name",
"=",
"'APIError'",... | `APIError` error.
@constructor
@param {string} [message]
@param {string} [type]
@param {string} [field]
@access public | [
"APIError",
"error",
"."
] | 68f730ac5a834163aeb9c33f8885888de45f0a7d | https://github.com/jaredhanson/passport-fitbit/blob/68f730ac5a834163aeb9c33f8885888de45f0a7d/lib/errors/apierror.js#L10-L17 |
35,033 | Urigo/meteor-native-packages | linker.js | linkPackages | function linkPackages(dstPacksDir) {
if (!dstPacksDir) {
dstPacksDir = Path.resolve(rootDir, "packages");
}
else {
dstPacksDir = Path.resolve(cwd, dstPacksDir);
}
// Ensure destination dir
try {
Fs.mkdirSync(dstPacksDir);
}
catch (_) {}
var packNames = Fs.readdirSync(srcPacksDir);
// ... | javascript | function linkPackages(dstPacksDir) {
if (!dstPacksDir) {
dstPacksDir = Path.resolve(rootDir, "packages");
}
else {
dstPacksDir = Path.resolve(cwd, dstPacksDir);
}
// Ensure destination dir
try {
Fs.mkdirSync(dstPacksDir);
}
catch (_) {}
var packNames = Fs.readdirSync(srcPacksDir);
// ... | [
"function",
"linkPackages",
"(",
"dstPacksDir",
")",
"{",
"if",
"(",
"!",
"dstPacksDir",
")",
"{",
"dstPacksDir",
"=",
"Path",
".",
"resolve",
"(",
"rootDir",
",",
"\"packages\"",
")",
";",
"}",
"else",
"{",
"dstPacksDir",
"=",
"Path",
".",
"resolve",
"(... | Creates a symlink for each native package.
@param dstPacksDir - Synlinks' output dir. Defaults to 'packages' dir. | [
"Creates",
"a",
"symlink",
"for",
"each",
"native",
"package",
"."
] | 8eb7fdd554aad0ff78a0dc19b9c62016d2b2e7a7 | https://github.com/Urigo/meteor-native-packages/blob/8eb7fdd554aad0ff78a0dc19b9c62016d2b2e7a7/linker.js#L14-L46 |
35,034 | zotero/zotero-api-node | lib/stream.js | Stream | function Stream(options) {
/**
* Whether or not the Stream was initialized as
* a single- or multi-key stream.
*
* @property multi
* @type Boolean
*/
reader(this, 'multi', !(options && options.apiKey));
if (!this.multi) {
options.headers = options.headers || {};
options.headers['Zotero... | javascript | function Stream(options) {
/**
* Whether or not the Stream was initialized as
* a single- or multi-key stream.
*
* @property multi
* @type Boolean
*/
reader(this, 'multi', !(options && options.apiKey));
if (!this.multi) {
options.headers = options.headers || {};
options.headers['Zotero... | [
"function",
"Stream",
"(",
"options",
")",
"{",
"/**\n * Whether or not the Stream was initialized as\n * a single- or multi-key stream.\n *\n * @property multi\n * @type Boolean\n */",
"reader",
"(",
"this",
",",
"'multi'",
",",
"!",
"(",
"options",
"&&",
"options",
... | Connects to the Zotero Streaming API
by establishing a WebSocket connection.
@class Stream
@constructor
@extends Client
@param {Object} options | [
"Connects",
"to",
"the",
"Zotero",
"Streaming",
"API",
"by",
"establishing",
"a",
"WebSocket",
"connection",
"."
] | df5b03cb6b66580efa52aaa22735b0058fbfdf8d | https://github.com/zotero/zotero-api-node/blob/df5b03cb6b66580efa52aaa22735b0058fbfdf8d/lib/stream.js#L52-L104 |
35,035 | lukeed/dom-selection | dist/dom-selection.es.js | getRange | function getRange(sel) {
sel = sel || getSelection();
return sel.rangeCount > 0 ? sel.getRangeAt(0) : null;
} | javascript | function getRange(sel) {
sel = sel || getSelection();
return sel.rangeCount > 0 ? sel.getRangeAt(0) : null;
} | [
"function",
"getRange",
"(",
"sel",
")",
"{",
"sel",
"=",
"sel",
"||",
"getSelection",
"(",
")",
";",
"return",
"sel",
".",
"rangeCount",
">",
"0",
"?",
"sel",
".",
"getRangeAt",
"(",
"0",
")",
":",
"null",
";",
"}"
] | Get a Selection's Range
@see http://stackoverflow.com/questions/13949059/persisting-the-changes-of-range-objects-after-selection-in-html/13950376#13950376
@param {Selection} sel
@return {Range|null} | [
"Get",
"a",
"Selection",
"s",
"Range"
] | b926c790347ec5b58c219c64aff6c030b2266fd1 | https://github.com/lukeed/dom-selection/blob/b926c790347ec5b58c219c64aff6c030b2266fd1/dist/dom-selection.es.js#L36-L39 |
35,036 | lukeed/dom-selection | dist/dom-selection.es.js | setRange | function setRange(saved, sel) {
if (!saved) { return; }
// will make new selection, if unset
sel = sel || getSelection();
sel.removeAllRanges();
sel.addRange(saved);
} | javascript | function setRange(saved, sel) {
if (!saved) { return; }
// will make new selection, if unset
sel = sel || getSelection();
sel.removeAllRanges();
sel.addRange(saved);
} | [
"function",
"setRange",
"(",
"saved",
",",
"sel",
")",
"{",
"if",
"(",
"!",
"saved",
")",
"{",
"return",
";",
"}",
"// will make new selection, if unset",
"sel",
"=",
"sel",
"||",
"getSelection",
"(",
")",
";",
"sel",
".",
"removeAllRanges",
"(",
")",
";... | Restore a Selection Range
@see http://stackoverflow.com/questions/13949059/persisting-the-changes-of-range-objects-after-selection-in-html/13950376#13950376
@param {Range} saved
@param {Selection} sel | [
"Restore",
"a",
"Selection",
"Range"
] | b926c790347ec5b58c219c64aff6c030b2266fd1 | https://github.com/lukeed/dom-selection/blob/b926c790347ec5b58c219c64aff6c030b2266fd1/dist/dom-selection.es.js#L47-L53 |
35,037 | lukeed/dom-selection | dist/dom-selection.es.js | getRect | function getRect(sel) {
sel = sel || getSelection();
if (!sel.rangeCount) { return false; }
var range = sel.getRangeAt(0).cloneRange();
// on Webkit 'range.getBoundingClientRect()' sometimes return 0/0/0/0 - but 'range.getClientRects()' works
var rects = range.getClientRects ? range.getClientRects() : [];
for (... | javascript | function getRect(sel) {
sel = sel || getSelection();
if (!sel.rangeCount) { return false; }
var range = sel.getRangeAt(0).cloneRange();
// on Webkit 'range.getBoundingClientRect()' sometimes return 0/0/0/0 - but 'range.getClientRects()' works
var rects = range.getClientRects ? range.getClientRects() : [];
for (... | [
"function",
"getRect",
"(",
"sel",
")",
"{",
"sel",
"=",
"sel",
"||",
"getSelection",
"(",
")",
";",
"if",
"(",
"!",
"sel",
".",
"rangeCount",
")",
"{",
"return",
"false",
";",
"}",
"var",
"range",
"=",
"sel",
".",
"getRangeAt",
"(",
"0",
")",
".... | Get a Selection Rectangle
@see http://stackoverflow.com/questions/12603397/calculate-width-height-of-the-selected-text-javascript
@see http://stackoverflow.com/questions/6846230/coordinates-of-selected-text-in-browser-page
@param {Selection} sel
@return {Object|Boolean} | [
"Get",
"a",
"Selection",
"Rectangle"
] | b926c790347ec5b58c219c64aff6c030b2266fd1 | https://github.com/lukeed/dom-selection/blob/b926c790347ec5b58c219c64aff6c030b2266fd1/dist/dom-selection.es.js#L62-L84 |
35,038 | lukeed/dom-selection | dist/dom-selection.es.js | getNodes | function getNodes(sel) {
var range = getRange(sel);
if (!range) { return []; }
var node = range.startContainer;
var endNode = range.endContainer;
// Special case for a range that is contained within a single node
if (node === endNode) { return [node]; }
// Iterate nodes until we hit the end container
var nod... | javascript | function getNodes(sel) {
var range = getRange(sel);
if (!range) { return []; }
var node = range.startContainer;
var endNode = range.endContainer;
// Special case for a range that is contained within a single node
if (node === endNode) { return [node]; }
// Iterate nodes until we hit the end container
var nod... | [
"function",
"getNodes",
"(",
"sel",
")",
"{",
"var",
"range",
"=",
"getRange",
"(",
"sel",
")",
";",
"if",
"(",
"!",
"range",
")",
"{",
"return",
"[",
"]",
";",
"}",
"var",
"node",
"=",
"range",
".",
"startContainer",
";",
"var",
"endNode",
"=",
... | Get all Nodes within a Selection.
@see http://stackoverflow.com/questions/7781963/js-get-array-of-all-selected-nodes-in-contenteditable-div
@param {Selection} sel
@return {Array} | [
"Get",
"all",
"Nodes",
"within",
"a",
"Selection",
"."
] | b926c790347ec5b58c219c64aff6c030b2266fd1 | https://github.com/lukeed/dom-selection/blob/b926c790347ec5b58c219c64aff6c030b2266fd1/dist/dom-selection.es.js#L92-L116 |
35,039 | lukeed/dom-selection | dist/dom-selection.es.js | getHTML | function getHTML(sel) {
sel = sel || getSelection();
if (!sel.rangeCount || sel.isCollapsed) { return null; }
var len = sel.rangeCount;
var container = doc.createElement('div');
for (var i = 0; i < len; ++i) {
container.appendChild(sel.getRangeAt(i).cloneContents());
}
return container.innerHTML;
} | javascript | function getHTML(sel) {
sel = sel || getSelection();
if (!sel.rangeCount || sel.isCollapsed) { return null; }
var len = sel.rangeCount;
var container = doc.createElement('div');
for (var i = 0; i < len; ++i) {
container.appendChild(sel.getRangeAt(i).cloneContents());
}
return container.innerHTML;
} | [
"function",
"getHTML",
"(",
"sel",
")",
"{",
"sel",
"=",
"sel",
"||",
"getSelection",
"(",
")",
";",
"if",
"(",
"!",
"sel",
".",
"rangeCount",
"||",
"sel",
".",
"isCollapsed",
")",
"{",
"return",
"null",
";",
"}",
"var",
"len",
"=",
"sel",
".",
"... | Get the inner HTML content of a selection.
@see http://stackoverflow.com/questions/4652734/return-html-from-a-user-selected-text/4652824#4652824
@param {Selection} sel
@return {String} | [
"Get",
"the",
"inner",
"HTML",
"content",
"of",
"a",
"selection",
"."
] | b926c790347ec5b58c219c64aff6c030b2266fd1 | https://github.com/lukeed/dom-selection/blob/b926c790347ec5b58c219c64aff6c030b2266fd1/dist/dom-selection.es.js#L124-L136 |
35,040 | lukeed/dom-selection | dist/dom-selection.es.js | isWithin | function isWithin(container, sel) {
sel = sel || getSelection();
return container.contains(sel.anchorNode) && container.contains(sel.focusNode);
} | javascript | function isWithin(container, sel) {
sel = sel || getSelection();
return container.contains(sel.anchorNode) && container.contains(sel.focusNode);
} | [
"function",
"isWithin",
"(",
"container",
",",
"sel",
")",
"{",
"sel",
"=",
"sel",
"||",
"getSelection",
"(",
")",
";",
"return",
"container",
".",
"contains",
"(",
"sel",
".",
"anchorNode",
")",
"&&",
"container",
".",
"contains",
"(",
"sel",
".",
"fo... | Is the Selection within given container Node?
@param {Node} container The container node
@param {Selection} sel
@return {Boolean} | [
"Is",
"the",
"Selection",
"within",
"given",
"container",
"Node?"
] | b926c790347ec5b58c219c64aff6c030b2266fd1 | https://github.com/lukeed/dom-selection/blob/b926c790347ec5b58c219c64aff6c030b2266fd1/dist/dom-selection.es.js#L170-L173 |
35,041 | lukeed/dom-selection | dist/dom-selection.es.js | getCaretWord | function getCaretWord(sel) {
sel = sel || getSelection();
var rng = getRange(sel);
expandToWord(sel);
var str = sel.toString(); // range?
// Restore selection
setRange(rng);
return str;
} | javascript | function getCaretWord(sel) {
sel = sel || getSelection();
var rng = getRange(sel);
expandToWord(sel);
var str = sel.toString(); // range?
// Restore selection
setRange(rng);
return str;
} | [
"function",
"getCaretWord",
"(",
"sel",
")",
"{",
"sel",
"=",
"sel",
"||",
"getSelection",
"(",
")",
";",
"var",
"rng",
"=",
"getRange",
"(",
"sel",
")",
";",
"expandToWord",
"(",
"sel",
")",
";",
"var",
"str",
"=",
"sel",
".",
"toString",
"(",
")"... | Get the full word that the Caret is within.
@see http://stackoverflow.com/questions/11247737/how-can-i-get-the-word-that-the-caret-is-upon-inside-a-contenteditable-div
@param {Selection} sel
@return {String} | [
"Get",
"the",
"full",
"word",
"that",
"the",
"Caret",
"is",
"within",
"."
] | b926c790347ec5b58c219c64aff6c030b2266fd1 | https://github.com/lukeed/dom-selection/blob/b926c790347ec5b58c219c64aff6c030b2266fd1/dist/dom-selection.es.js#L211-L219 |
35,042 | lukeed/dom-selection | dist/dom-selection.es.js | isBackwards | function isBackwards(sel) {
sel = sel || getSelection();
if (isCollapsed(sel)) { return; }
// Detect if selection is backwards
var range = doc.createRange();
range.setStart(sel.anchorNode, sel.anchorOffset);
range.setEnd(sel.focusNode, sel.focusOffset);
range.detach();
// if `collapsed` then it's backwards
r... | javascript | function isBackwards(sel) {
sel = sel || getSelection();
if (isCollapsed(sel)) { return; }
// Detect if selection is backwards
var range = doc.createRange();
range.setStart(sel.anchorNode, sel.anchorOffset);
range.setEnd(sel.focusNode, sel.focusOffset);
range.detach();
// if `collapsed` then it's backwards
r... | [
"function",
"isBackwards",
"(",
"sel",
")",
"{",
"sel",
"=",
"sel",
"||",
"getSelection",
"(",
")",
";",
"if",
"(",
"isCollapsed",
"(",
"sel",
")",
")",
"{",
"return",
";",
"}",
"// Detect if selection is backwards",
"var",
"range",
"=",
"doc",
".",
"cre... | Detect the direction of the Selection
@param {Selection} sel
@return {Boolean} | [
"Detect",
"the",
"direction",
"of",
"the",
"Selection"
] | b926c790347ec5b58c219c64aff6c030b2266fd1 | https://github.com/lukeed/dom-selection/blob/b926c790347ec5b58c219c64aff6c030b2266fd1/dist/dom-selection.es.js#L226-L238 |
35,043 | lukeed/dom-selection | dist/dom-selection.es.js | snapSelected | function snapSelected(sel) {
sel = sel || getSelection();
if (isCollapsed(sel)) { return; }
var end = sel.focusNode;
var off = sel.focusOffset;
var dir = ['forward', 'backward'];
isBackwards(sel) && dir.reverse();
// modify() works on the focus of the selection
sel.collapse(sel.anchorNode, sel.anchorOffset);
... | javascript | function snapSelected(sel) {
sel = sel || getSelection();
if (isCollapsed(sel)) { return; }
var end = sel.focusNode;
var off = sel.focusOffset;
var dir = ['forward', 'backward'];
isBackwards(sel) && dir.reverse();
// modify() works on the focus of the selection
sel.collapse(sel.anchorNode, sel.anchorOffset);
... | [
"function",
"snapSelected",
"(",
"sel",
")",
"{",
"sel",
"=",
"sel",
"||",
"getSelection",
"(",
")",
";",
"if",
"(",
"isCollapsed",
"(",
"sel",
")",
")",
"{",
"return",
";",
"}",
"var",
"end",
"=",
"sel",
".",
"focusNode",
";",
"var",
"off",
"=",
... | Snap the Selection to encompass all partially-selected words.
@see http://stackoverflow.com/questions/7380190/select-whole-word-with-getselection
@param {Selection} sel | [
"Snap",
"the",
"Selection",
"to",
"encompass",
"all",
"partially",
"-",
"selected",
"words",
"."
] | b926c790347ec5b58c219c64aff6c030b2266fd1 | https://github.com/lukeed/dom-selection/blob/b926c790347ec5b58c219c64aff6c030b2266fd1/dist/dom-selection.es.js#L245-L262 |
35,044 | Urigo/meteor-native-packages | packages/ddp-server/writefence.js | function () {
var self = this;
if (self === DDPServer._CurrentWriteFence.get())
throw Error("Can't arm the current fence");
self.armed = true;
self._maybeFire();
} | javascript | function () {
var self = this;
if (self === DDPServer._CurrentWriteFence.get())
throw Error("Can't arm the current fence");
self.armed = true;
self._maybeFire();
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"self",
"===",
"DDPServer",
".",
"_CurrentWriteFence",
".",
"get",
"(",
")",
")",
"throw",
"Error",
"(",
"\"Can't arm the current fence\"",
")",
";",
"self",
".",
"armed",
"=",
"true"... | Arm the fence. Once the fence is armed, and there are no more uncommitted writes, it will activate. | [
"Arm",
"the",
"fence",
".",
"Once",
"the",
"fence",
"is",
"armed",
"and",
"there",
"are",
"no",
"more",
"uncommitted",
"writes",
"it",
"will",
"activate",
"."
] | 8eb7fdd554aad0ff78a0dc19b9c62016d2b2e7a7 | https://github.com/Urigo/meteor-native-packages/blob/8eb7fdd554aad0ff78a0dc19b9c62016d2b2e7a7/packages/ddp-server/writefence.js#L55-L61 | |
35,045 | Urigo/meteor-native-packages | packages/ddp-server/writefence.js | function () {
var self = this;
var future = new Future;
self.onAllCommitted(function () {
future['return']();
});
self.arm();
future.wait();
} | javascript | function () {
var self = this;
var future = new Future;
self.onAllCommitted(function () {
future['return']();
});
self.arm();
future.wait();
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"future",
"=",
"new",
"Future",
";",
"self",
".",
"onAllCommitted",
"(",
"function",
"(",
")",
"{",
"future",
"[",
"'return'",
"]",
"(",
")",
";",
"}",
")",
";",
"self",
".",
"arm... | Convenience function. Arms the fence, then blocks until it fires. | [
"Convenience",
"function",
".",
"Arms",
"the",
"fence",
"then",
"blocks",
"until",
"it",
"fires",
"."
] | 8eb7fdd554aad0ff78a0dc19b9c62016d2b2e7a7 | https://github.com/Urigo/meteor-native-packages/blob/8eb7fdd554aad0ff78a0dc19b9c62016d2b2e7a7/packages/ddp-server/writefence.js#L84-L92 | |
35,046 | bitinn/vdom-parser | index.js | createNode | function createNode(el, attr) {
// html comment is not currently supported by virtual-dom
if (el.nodeType === 3) {
return createVirtualTextNode(el);
// cdata or doctype is not currently supported by virtual-dom
} else if (el.nodeType === 1 || el.nodeType === 9) {
return createVirtualDomNode(el, attr);
}
// ... | javascript | function createNode(el, attr) {
// html comment is not currently supported by virtual-dom
if (el.nodeType === 3) {
return createVirtualTextNode(el);
// cdata or doctype is not currently supported by virtual-dom
} else if (el.nodeType === 1 || el.nodeType === 9) {
return createVirtualDomNode(el, attr);
}
// ... | [
"function",
"createNode",
"(",
"el",
",",
"attr",
")",
"{",
"// html comment is not currently supported by virtual-dom",
"if",
"(",
"el",
".",
"nodeType",
"===",
"3",
")",
"{",
"return",
"createVirtualTextNode",
"(",
"el",
")",
";",
"// cdata or doctype is not current... | Create vdom from dom node
@param Object el DOM element
@param String attr Attribute name that contains vdom key
@return Object VNode or VText | [
"Create",
"vdom",
"from",
"dom",
"node"
] | e7dffa55bd205642ee0a675e46e738a515764390 | https://github.com/bitinn/vdom-parser/blob/e7dffa55bd205642ee0a675e46e738a515764390/index.js#L73-L85 |
35,047 | bitinn/vdom-parser | index.js | createVirtualDomNode | function createVirtualDomNode(el, attr) {
var ns = el.namespaceURI !== HTML_NAMESPACE ? el.namespaceURI : null;
var key = attr && el.getAttribute(attr) ? el.getAttribute(attr) : null;
return new VNode(
el.tagName
, createProperties(el)
, createChildren(el, attr)
, key
, ns
);
} | javascript | function createVirtualDomNode(el, attr) {
var ns = el.namespaceURI !== HTML_NAMESPACE ? el.namespaceURI : null;
var key = attr && el.getAttribute(attr) ? el.getAttribute(attr) : null;
return new VNode(
el.tagName
, createProperties(el)
, createChildren(el, attr)
, key
, ns
);
} | [
"function",
"createVirtualDomNode",
"(",
"el",
",",
"attr",
")",
"{",
"var",
"ns",
"=",
"el",
".",
"namespaceURI",
"!==",
"HTML_NAMESPACE",
"?",
"el",
".",
"namespaceURI",
":",
"null",
";",
"var",
"key",
"=",
"attr",
"&&",
"el",
".",
"getAttribute",
"(",... | Create vnode from dom node
@param Object el DOM element
@param String attr Attribute name that contains vdom key
@return Object VNode | [
"Create",
"vnode",
"from",
"dom",
"node"
] | e7dffa55bd205642ee0a675e46e738a515764390 | https://github.com/bitinn/vdom-parser/blob/e7dffa55bd205642ee0a675e46e738a515764390/index.js#L104-L115 |
35,048 | bitinn/vdom-parser | index.js | createChildren | function createChildren(el, attr) {
var children = [];
for (var i = 0; i < el.childNodes.length; i++) {
children.push(createNode(el.childNodes[i], attr));
};
return children;
} | javascript | function createChildren(el, attr) {
var children = [];
for (var i = 0; i < el.childNodes.length; i++) {
children.push(createNode(el.childNodes[i], attr));
};
return children;
} | [
"function",
"createChildren",
"(",
"el",
",",
"attr",
")",
"{",
"var",
"children",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"el",
".",
"childNodes",
".",
"length",
";",
"i",
"++",
")",
"{",
"children",
".",
"push",
"... | Recursively create vdom
@param Object el Parent element
@param String attr Attribute name that contains vdom key
@return Array Child vnode or vtext | [
"Recursively",
"create",
"vdom"
] | e7dffa55bd205642ee0a675e46e738a515764390 | https://github.com/bitinn/vdom-parser/blob/e7dffa55bd205642ee0a675e46e738a515764390/index.js#L124-L131 |
35,049 | bitinn/vdom-parser | index.js | createProperties | function createProperties(el) {
var properties = {};
if (!el.hasAttributes()) {
return properties;
}
var ns;
if (el.namespaceURI && el.namespaceURI !== HTML_NAMESPACE) {
ns = el.namespaceURI;
}
var attr;
for (var i = 0; i < el.attributes.length; i++) {
// use built in css style parsing
if(el.attribut... | javascript | function createProperties(el) {
var properties = {};
if (!el.hasAttributes()) {
return properties;
}
var ns;
if (el.namespaceURI && el.namespaceURI !== HTML_NAMESPACE) {
ns = el.namespaceURI;
}
var attr;
for (var i = 0; i < el.attributes.length; i++) {
// use built in css style parsing
if(el.attribut... | [
"function",
"createProperties",
"(",
"el",
")",
"{",
"var",
"properties",
"=",
"{",
"}",
";",
"if",
"(",
"!",
"el",
".",
"hasAttributes",
"(",
")",
")",
"{",
"return",
"properties",
";",
"}",
"var",
"ns",
";",
"if",
"(",
"el",
".",
"namespaceURI",
... | Create properties from dom node
@param Object el DOM element
@return Object Node properties and attributes | [
"Create",
"properties",
"from",
"dom",
"node"
] | e7dffa55bd205642ee0a675e46e738a515764390 | https://github.com/bitinn/vdom-parser/blob/e7dffa55bd205642ee0a675e46e738a515764390/index.js#L139-L185 |
35,050 | bitinn/vdom-parser | index.js | createProperty | function createProperty(attr) {
var name, value, isAttr;
// using a map to find the correct case of property name
if (propertyMap[attr.name]) {
name = propertyMap[attr.name];
} else {
name = attr.name;
}
// special cases for data attribute, we default to properties.attributes.data
if (name.indexOf('data-') ... | javascript | function createProperty(attr) {
var name, value, isAttr;
// using a map to find the correct case of property name
if (propertyMap[attr.name]) {
name = propertyMap[attr.name];
} else {
name = attr.name;
}
// special cases for data attribute, we default to properties.attributes.data
if (name.indexOf('data-') ... | [
"function",
"createProperty",
"(",
"attr",
")",
"{",
"var",
"name",
",",
"value",
",",
"isAttr",
";",
"// using a map to find the correct case of property name",
"if",
"(",
"propertyMap",
"[",
"attr",
".",
"name",
"]",
")",
"{",
"name",
"=",
"propertyMap",
"[",
... | Create property from dom attribute
@param Object attr DOM attribute
@return Object Normalized attribute | [
"Create",
"property",
"from",
"dom",
"attribute"
] | e7dffa55bd205642ee0a675e46e738a515764390 | https://github.com/bitinn/vdom-parser/blob/e7dffa55bd205642ee0a675e46e738a515764390/index.js#L193-L215 |
35,051 | bitinn/vdom-parser | index.js | createPropertyNS | function createPropertyNS(attr) {
var name, value;
return {
name: attr.name
, value: attr.value
, ns: namespaceMap[attr.name] || ''
};
} | javascript | function createPropertyNS(attr) {
var name, value;
return {
name: attr.name
, value: attr.value
, ns: namespaceMap[attr.name] || ''
};
} | [
"function",
"createPropertyNS",
"(",
"attr",
")",
"{",
"var",
"name",
",",
"value",
";",
"return",
"{",
"name",
":",
"attr",
".",
"name",
",",
"value",
":",
"attr",
".",
"value",
",",
"ns",
":",
"namespaceMap",
"[",
"attr",
".",
"name",
"]",
"||",
... | Create namespaced property from dom attribute
@param Object attr DOM attribute
@return Object Normalized attribute | [
"Create",
"namespaced",
"property",
"from",
"dom",
"attribute"
] | e7dffa55bd205642ee0a675e46e738a515764390 | https://github.com/bitinn/vdom-parser/blob/e7dffa55bd205642ee0a675e46e738a515764390/index.js#L223-L231 |
35,052 | bitinn/vdom-parser | index.js | createStyleProperty | function createStyleProperty(el) {
var style = el.style;
var output = {};
for (var i = 0; i < style.length; ++i) {
var item = style.item(i);
output[item] = String(style[item]);
// hack to workaround browser inconsistency with url()
if (output[item].indexOf('url') > -1) {
output[item] = output[item].replac... | javascript | function createStyleProperty(el) {
var style = el.style;
var output = {};
for (var i = 0; i < style.length; ++i) {
var item = style.item(i);
output[item] = String(style[item]);
// hack to workaround browser inconsistency with url()
if (output[item].indexOf('url') > -1) {
output[item] = output[item].replac... | [
"function",
"createStyleProperty",
"(",
"el",
")",
"{",
"var",
"style",
"=",
"el",
".",
"style",
";",
"var",
"output",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"style",
".",
"length",
";",
"++",
"i",
")",
"{",
"var",... | Create style property from dom node
@param Object el DOM node
@return Object Normalized attribute | [
"Create",
"style",
"property",
"from",
"dom",
"node"
] | e7dffa55bd205642ee0a675e46e738a515764390 | https://github.com/bitinn/vdom-parser/blob/e7dffa55bd205642ee0a675e46e738a515764390/index.js#L239-L251 |
35,053 | IronCoreLabs/ironnode | build.js | tagRepo | function tagRepo(version) {
if (SHOULD_PUBLISH) {
shell.exec(`git tag ${version}`);
shell.exec("git push origin --tags");
} else {
console.log(`\n\nWould publish git tag as version ${version}.`);
}
} | javascript | function tagRepo(version) {
if (SHOULD_PUBLISH) {
shell.exec(`git tag ${version}`);
shell.exec("git push origin --tags");
} else {
console.log(`\n\nWould publish git tag as version ${version}.`);
}
} | [
"function",
"tagRepo",
"(",
"version",
")",
"{",
"if",
"(",
"SHOULD_PUBLISH",
")",
"{",
"shell",
".",
"exec",
"(",
"`",
"${",
"version",
"}",
"`",
")",
";",
"shell",
".",
"exec",
"(",
"\"git push origin --tags\"",
")",
";",
"}",
"else",
"{",
"console",... | Tag the repo with the current version that we're publishing | [
"Tag",
"the",
"repo",
"with",
"the",
"current",
"version",
"that",
"we",
"re",
"publishing"
] | a0c69398c75230720c4a825426d2a73925ea9053 | https://github.com/IronCoreLabs/ironnode/blob/a0c69398c75230720c4a825426d2a73925ea9053/build.js#L50-L57 |
35,054 | IronCoreLabs/ironnode | build.js | ensureNoChangesOnMasterBeforePublish | function ensureNoChangesOnMasterBeforePublish() {
//Let users try the build script as long as they're not doing an actual publish
if (!SHOULD_PUBLISH) {
return true;
}
shell.exec("git fetch origin", {silent: true});
const currentBranch = shell.exec("git symbolic-ref --short -q HEAD", {sile... | javascript | function ensureNoChangesOnMasterBeforePublish() {
//Let users try the build script as long as they're not doing an actual publish
if (!SHOULD_PUBLISH) {
return true;
}
shell.exec("git fetch origin", {silent: true});
const currentBranch = shell.exec("git symbolic-ref --short -q HEAD", {sile... | [
"function",
"ensureNoChangesOnMasterBeforePublish",
"(",
")",
"{",
"//Let users try the build script as long as they're not doing an actual publish",
"if",
"(",
"!",
"SHOULD_PUBLISH",
")",
"{",
"return",
"true",
";",
"}",
"shell",
".",
"exec",
"(",
"\"git fetch origin\"",
"... | Ensure that we're in a pristine, up-to-date repo and on the master branch before allowing user to continue. Only does
verification if user is actually trying to perform an NPM publish | [
"Ensure",
"that",
"we",
"re",
"in",
"a",
"pristine",
"up",
"-",
"to",
"-",
"date",
"repo",
"and",
"on",
"the",
"master",
"branch",
"before",
"allowing",
"user",
"to",
"continue",
".",
"Only",
"does",
"verification",
"if",
"user",
"is",
"actually",
"tryin... | a0c69398c75230720c4a825426d2a73925ea9053 | https://github.com/IronCoreLabs/ironnode/blob/a0c69398c75230720c4a825426d2a73925ea9053/build.js#L63-L88 |
35,055 | mjk/uber-rush | lib/Quote.js | Quote | function Quote(options) {
var self = this;
events.EventEmitter.call(self);
this.quote_id = options.quote_id;
this.start_time = new Date(parseInt(options.start_time,10)*1000);
this.end_time = new Date(parseInt(options.end_time,10)*1000);
this.fee = parseFloat(options.fee);
this.currency_code... | javascript | function Quote(options) {
var self = this;
events.EventEmitter.call(self);
this.quote_id = options.quote_id;
this.start_time = new Date(parseInt(options.start_time,10)*1000);
this.end_time = new Date(parseInt(options.end_time,10)*1000);
this.fee = parseFloat(options.fee);
this.currency_code... | [
"function",
"Quote",
"(",
"options",
")",
"{",
"var",
"self",
"=",
"this",
";",
"events",
".",
"EventEmitter",
".",
"call",
"(",
"self",
")",
";",
"this",
".",
"quote_id",
"=",
"options",
".",
"quote_id",
";",
"this",
".",
"start_time",
"=",
"new",
"... | A delivery quote.
@param quote_id string The ID of the quote.
@param estimated_at integer Unix timestamp of the time this quote was generated.
@param start_time integer Unix timestamp of the start of the delivery window.
@param end_time integer Unix timestamp of the end of the delivery window.
@param fee float The fee... | [
"A",
"delivery",
"quote",
"."
] | 3c43b2e8e1da428dd49e1a516f3c1588756c4576 | https://github.com/mjk/uber-rush/blob/3c43b2e8e1da428dd49e1a516f3c1588756c4576/lib/Quote.js#L23-L38 |
35,056 | layerhq/node-layer-api | lib/resources/messages.js | function(conversationId, userId, text, callback) {
send(null, conversationId, utils.messageText('user_id', userId, text), callback);
} | javascript | function(conversationId, userId, text, callback) {
send(null, conversationId, utils.messageText('user_id', userId, text), callback);
} | [
"function",
"(",
"conversationId",
",",
"userId",
",",
"text",
",",
"callback",
")",
"{",
"send",
"(",
"null",
",",
"conversationId",
",",
"utils",
".",
"messageText",
"(",
"'user_id'",
",",
"userId",
",",
"text",
")",
",",
"callback",
")",
";",
"}"
] | Send a plain text message from `userId`
@param {String} conversationId Conversation ID
@param {String} userId User ID
@param {String} text Message text
@param {Function} callback Callback function | [
"Send",
"a",
"plain",
"text",
"message",
"from",
"userId"
] | 284c161350e2cf3d3f5b45f2918798d981f1ada4 | https://github.com/layerhq/node-layer-api/blob/284c161350e2cf3d3f5b45f2918798d981f1ada4/lib/resources/messages.js#L41-L43 | |
35,057 | layerhq/node-layer-api | lib/resources/messages.js | function(conversationId, name, text, callback) {
send(null, conversationId, utils.messageText('name', name, text), callback);
} | javascript | function(conversationId, name, text, callback) {
send(null, conversationId, utils.messageText('name', name, text), callback);
} | [
"function",
"(",
"conversationId",
",",
"name",
",",
"text",
",",
"callback",
")",
"{",
"send",
"(",
"null",
",",
"conversationId",
",",
"utils",
".",
"messageText",
"(",
"'name'",
",",
"name",
",",
"text",
")",
",",
"callback",
")",
";",
"}"
] | Send a plain text message from `name`
@param {String} conversationId Conversation ID
@param {String} name Sender name
@param {String} text Message text
@param {Function} callback Callback function | [
"Send",
"a",
"plain",
"text",
"message",
"from",
"name"
] | 284c161350e2cf3d3f5b45f2918798d981f1ada4 | https://github.com/layerhq/node-layer-api/blob/284c161350e2cf3d3f5b45f2918798d981f1ada4/lib/resources/messages.js#L53-L55 | |
35,058 | layerhq/node-layer-api | lib/resources/messages.js | function(conversationId, params, callback) {
conversationId = utils.toUUID(conversationId);
if (!conversationId) return callback(new Error(utils.i18n.messages.cid));
utils.debug('Message getAll: ' + conversationId);
var queryParams = '';
if (typeof params === 'function') callback = params... | javascript | function(conversationId, params, callback) {
conversationId = utils.toUUID(conversationId);
if (!conversationId) return callback(new Error(utils.i18n.messages.cid));
utils.debug('Message getAll: ' + conversationId);
var queryParams = '';
if (typeof params === 'function') callback = params... | [
"function",
"(",
"conversationId",
",",
"params",
",",
"callback",
")",
"{",
"conversationId",
"=",
"utils",
".",
"toUUID",
"(",
"conversationId",
")",
";",
"if",
"(",
"!",
"conversationId",
")",
"return",
"callback",
"(",
"new",
"Error",
"(",
"utils",
"."... | Retrieve messages in a conversation
@param {String} conversationId Conversation ID
@param {String} [params] Query parameters
@param {Function} callback Callback function | [
"Retrieve",
"messages",
"in",
"a",
"conversation"
] | 284c161350e2cf3d3f5b45f2918798d981f1ada4 | https://github.com/layerhq/node-layer-api/blob/284c161350e2cf3d3f5b45f2918798d981f1ada4/lib/resources/messages.js#L64-L76 | |
35,059 | layerhq/node-layer-api | lib/resources/messages.js | function(messageId, conversationId, callback) {
if (!messageId) return callback(new Error(utils.i18n.messages.mid));
messageId = utils.toUUID(messageId);
if (!conversationId) return callback(new Error(utils.i18n.conversations.id));
conversationId = utils.toUUID(conversationId);
utils.debug... | javascript | function(messageId, conversationId, callback) {
if (!messageId) return callback(new Error(utils.i18n.messages.mid));
messageId = utils.toUUID(messageId);
if (!conversationId) return callback(new Error(utils.i18n.conversations.id));
conversationId = utils.toUUID(conversationId);
utils.debug... | [
"function",
"(",
"messageId",
",",
"conversationId",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"messageId",
")",
"return",
"callback",
"(",
"new",
"Error",
"(",
"utils",
".",
"i18n",
".",
"messages",
".",
"mid",
")",
")",
";",
"messageId",
"=",
"utils... | Retrieve a message in a conversation
@param {String} messageId Message ID
@param {String} conversationId Conversation ID
@param {Function} callback Callback function | [
"Retrieve",
"a",
"message",
"in",
"a",
"conversation"
] | 284c161350e2cf3d3f5b45f2918798d981f1ada4 | https://github.com/layerhq/node-layer-api/blob/284c161350e2cf3d3f5b45f2918798d981f1ada4/lib/resources/messages.js#L85-L94 | |
35,060 | layerhq/node-layer-api | lib/resources/messages.js | function(userId, messageId, callback) {
if (!userId) return callback(new Error(utils.i18n.messages.userId));
messageId = utils.toUUID(messageId);
if (!messageId) return callback(new Error(utils.i18n.messages.mid));
utils.debug('Message getFromUser: ' + userId + ', ' + messageId);
request.... | javascript | function(userId, messageId, callback) {
if (!userId) return callback(new Error(utils.i18n.messages.userId));
messageId = utils.toUUID(messageId);
if (!messageId) return callback(new Error(utils.i18n.messages.mid));
utils.debug('Message getFromUser: ' + userId + ', ' + messageId);
request.... | [
"function",
"(",
"userId",
",",
"messageId",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"userId",
")",
"return",
"callback",
"(",
"new",
"Error",
"(",
"utils",
".",
"i18n",
".",
"messages",
".",
"userId",
")",
")",
";",
"messageId",
"=",
"utils",
"."... | Retrieve a message in a conversation from a user
@param {String} userId User ID
@param {String} messageId Message ID
@param {Function} callback Callback function | [
"Retrieve",
"a",
"message",
"in",
"a",
"conversation",
"from",
"a",
"user"
] | 284c161350e2cf3d3f5b45f2918798d981f1ada4 | https://github.com/layerhq/node-layer-api/blob/284c161350e2cf3d3f5b45f2918798d981f1ada4/lib/resources/messages.js#L126-L135 | |
35,061 | medialab/sandcrawler | src/spider.js | retryJob | function retryJob(job, when) {
when = when || 'later';
// Reaching maxRetries?
if (job.req.retries >= this.options.maxRetries)
return;
// Dropping from remains
delete this.remains[job.id];
// Request
job.req.retries++;
job.state.retrying = true;
// Adding to the queue again
this.queue[when =... | javascript | function retryJob(job, when) {
when = when || 'later';
// Reaching maxRetries?
if (job.req.retries >= this.options.maxRetries)
return;
// Dropping from remains
delete this.remains[job.id];
// Request
job.req.retries++;
job.state.retrying = true;
// Adding to the queue again
this.queue[when =... | [
"function",
"retryJob",
"(",
"job",
",",
"when",
")",
"{",
"when",
"=",
"when",
"||",
"'later'",
";",
"// Reaching maxRetries?",
"if",
"(",
"job",
".",
"req",
".",
"retries",
">=",
"this",
".",
"options",
".",
"maxRetries",
")",
"return",
";",
"// Droppi... | Retrying a job | [
"Retrying",
"a",
"job"
] | c08e19095eee42c8ce1f84685960e5ea6cb0fd1d | https://github.com/medialab/sandcrawler/blob/c08e19095eee42c8ce1f84685960e5ea6cb0fd1d/src/spider.js#L241-L259 |
35,062 | medialab/sandcrawler | src/spider.js | beforeScraping | function beforeScraping(job, callback) {
return async.applyEachSeries(
this.middlewares.beforeScraping,
job.req,
callback
);
} | javascript | function beforeScraping(job, callback) {
return async.applyEachSeries(
this.middlewares.beforeScraping,
job.req,
callback
);
} | [
"function",
"beforeScraping",
"(",
"job",
",",
"callback",
")",
"{",
"return",
"async",
".",
"applyEachSeries",
"(",
"this",
".",
"middlewares",
".",
"beforeScraping",
",",
"job",
".",
"req",
",",
"callback",
")",
";",
"}"
] | Applying beforeScraping middlewares | [
"Applying",
"beforeScraping",
"middlewares"
] | c08e19095eee42c8ce1f84685960e5ea6cb0fd1d | https://github.com/medialab/sandcrawler/blob/c08e19095eee42c8ce1f84685960e5ea6cb0fd1d/src/spider.js#L262-L268 |
35,063 | medialab/sandcrawler | src/spider.js | afterScraping | function afterScraping(job, callback) {
return async.applyEachSeries(
this.middlewares.afterScraping,
job.req, job.res,
callback
);
} | javascript | function afterScraping(job, callback) {
return async.applyEachSeries(
this.middlewares.afterScraping,
job.req, job.res,
callback
);
} | [
"function",
"afterScraping",
"(",
"job",
",",
"callback",
")",
"{",
"return",
"async",
".",
"applyEachSeries",
"(",
"this",
".",
"middlewares",
".",
"afterScraping",
",",
"job",
".",
"req",
",",
"job",
".",
"res",
",",
"callback",
")",
";",
"}"
] | Applying afterScraping middlewares | [
"Applying",
"afterScraping",
"middlewares"
] | c08e19095eee42c8ce1f84685960e5ea6cb0fd1d | https://github.com/medialab/sandcrawler/blob/c08e19095eee42c8ce1f84685960e5ea6cb0fd1d/src/spider.js#L276-L282 |
35,064 | medialab/sandcrawler | src/spider.js | iterate | function iterate() {
var lastJob = this.lastJob || {},
feed = this.iterator.call(this, this.index, lastJob.req, lastJob.res);
if (feed)
this.addUrl(feed);
} | javascript | function iterate() {
var lastJob = this.lastJob || {},
feed = this.iterator.call(this, this.index, lastJob.req, lastJob.res);
if (feed)
this.addUrl(feed);
} | [
"function",
"iterate",
"(",
")",
"{",
"var",
"lastJob",
"=",
"this",
".",
"lastJob",
"||",
"{",
"}",
",",
"feed",
"=",
"this",
".",
"iterator",
".",
"call",
"(",
"this",
",",
"this",
".",
"index",
",",
"lastJob",
".",
"req",
",",
"lastJob",
".",
... | Perform an iteration | [
"Perform",
"an",
"iteration"
] | c08e19095eee42c8ce1f84685960e5ea6cb0fd1d | https://github.com/medialab/sandcrawler/blob/c08e19095eee42c8ce1f84685960e5ea6cb0fd1d/src/spider.js#L292-L298 |
35,065 | medialab/sandcrawler | src/spider.js | addUrl | function addUrl(when, feed) {
if (!types.check(feed, 'feed') && !types.check(feed, ['feed']))
throw Error('sandcrawler.spider.url(s): wrong argument.');
var a = !(feed instanceof Array) ? [feed] : feed,
c = !this.state.running ? this.initialBuffer.length : this.index,
job,
i,
l;
for ... | javascript | function addUrl(when, feed) {
if (!types.check(feed, 'feed') && !types.check(feed, ['feed']))
throw Error('sandcrawler.spider.url(s): wrong argument.');
var a = !(feed instanceof Array) ? [feed] : feed,
c = !this.state.running ? this.initialBuffer.length : this.index,
job,
i,
l;
for ... | [
"function",
"addUrl",
"(",
"when",
",",
"feed",
")",
"{",
"if",
"(",
"!",
"types",
".",
"check",
"(",
"feed",
",",
"'feed'",
")",
"&&",
"!",
"types",
".",
"check",
"(",
"feed",
",",
"[",
"'feed'",
"]",
")",
")",
"throw",
"Error",
"(",
"'sandcrawl... | Feeding the spider | [
"Feeding",
"the",
"spider"
] | c08e19095eee42c8ce1f84685960e5ea6cb0fd1d | https://github.com/medialab/sandcrawler/blob/c08e19095eee42c8ce1f84685960e5ea6cb0fd1d/src/spider.js#L426-L453 |
35,066 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | function ( a, order, prop, prop2 )
{
var out = [];
var i=0, ien=order.length;
// Could have the test in the loop for slightly smaller code, but speed
// is essential here
if ( prop2 !== undefined ) {
for ( ; i<ien ; i++ ) {
out.push( a[ order[i] ][ prop ][ prop2 ] );
}
}
else {
... | javascript | function ( a, order, prop, prop2 )
{
var out = [];
var i=0, ien=order.length;
// Could have the test in the loop for slightly smaller code, but speed
// is essential here
if ( prop2 !== undefined ) {
for ( ; i<ien ; i++ ) {
out.push( a[ order[i] ][ prop ][ prop2 ] );
}
}
else {
... | [
"function",
"(",
"a",
",",
"order",
",",
"prop",
",",
"prop2",
")",
"{",
"var",
"out",
"=",
"[",
"]",
";",
"var",
"i",
"=",
"0",
",",
"ien",
"=",
"order",
".",
"length",
";",
"// Could have the test in the loop for slightly smaller code, but speed\r",
"// is... | Basically the same as _pluck, but rather than looping over `a` we use `order` as the indexes to pick from `a` | [
"Basically",
"the",
"same",
"as",
"_pluck",
"but",
"rather",
"than",
"looping",
"over",
"a",
"we",
"use",
"order",
"as",
"the",
"indexes",
"to",
"pick",
"from",
"a"
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L179-L198 | |
35,067 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | function ( src )
{
// A faster unique method is to use object keys to identify used values,
// but this doesn't work with arrays or objects, which we must also
// consider. See jsperf.com/compare-array-unique-versions/4 for more
// information.
var
out = [],
val,
i, ien=src.length,
j, k... | javascript | function ( src )
{
// A faster unique method is to use object keys to identify used values,
// but this doesn't work with arrays or objects, which we must also
// consider. See jsperf.com/compare-array-unique-versions/4 for more
// information.
var
out = [],
val,
i, ien=src.length,
j, k... | [
"function",
"(",
"src",
")",
"{",
"// A faster unique method is to use object keys to identify used values,\r",
"// but this doesn't work with arrays or objects, which we must also\r",
"// consider. See jsperf.com/compare-array-unique-versions/4 for more\r",
"// information.\r",
"var",
"out",
... | Find the unique elements in a source array.
@param {array} src Source array
@return {array} Array of unique items
@ignore | [
"Find",
"the",
"unique",
"elements",
"in",
"a",
"source",
"array",
"."
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L235-L261 | |
35,068 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | _fnHungarianMap | function _fnHungarianMap ( o )
{
var
hungarian = 'a aa ao as b fn i m o s ',
match,
newKey,
map = {};
$.each( o, function (key, val) {
match = key.match(/^([^A-Z]+?)([A-Z])/);
if ( match && hungarian.indexOf(match[1]+' ') !== -1 )
{
newKey = key.replace( match[0], match[2]... | javascript | function _fnHungarianMap ( o )
{
var
hungarian = 'a aa ao as b fn i m o s ',
match,
newKey,
map = {};
$.each( o, function (key, val) {
match = key.match(/^([^A-Z]+?)([A-Z])/);
if ( match && hungarian.indexOf(match[1]+' ') !== -1 )
{
newKey = key.replace( match[0], match[2]... | [
"function",
"_fnHungarianMap",
"(",
"o",
")",
"{",
"var",
"hungarian",
"=",
"'a aa ao as b fn i m o s '",
",",
"match",
",",
"newKey",
",",
"map",
"=",
"{",
"}",
";",
"$",
".",
"each",
"(",
"o",
",",
"function",
"(",
"key",
",",
"val",
")",
"{",
"mat... | Create a mapping object that allows camel case parameters to be looked up
for their Hungarian counterparts. The mapping is stored in a private
parameter called `_hungarianMap` which can be accessed on the source object.
@param {object} o
@memberof DataTable#oApi | [
"Create",
"a",
"mapping",
"object",
"that",
"allows",
"camel",
"case",
"parameters",
"to",
"be",
"looked",
"up",
"for",
"their",
"Hungarian",
"counterparts",
".",
"The",
"mapping",
"is",
"stored",
"in",
"a",
"private",
"parameter",
"called",
"_hungarianMap",
"... | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L272-L296 |
35,069 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | _fnCamelToHungarian | function _fnCamelToHungarian ( src, user, force )
{
if ( ! src._hungarianMap )
{
_fnHungarianMap( src );
}
var hungarianKey;
$.each( user, function (key, val) {
hungarianKey = src._hungarianMap[ key ];
if ( hungarianKey !== undefined && (force || user[hungarianKey] === undefined) )... | javascript | function _fnCamelToHungarian ( src, user, force )
{
if ( ! src._hungarianMap )
{
_fnHungarianMap( src );
}
var hungarianKey;
$.each( user, function (key, val) {
hungarianKey = src._hungarianMap[ key ];
if ( hungarianKey !== undefined && (force || user[hungarianKey] === undefined) )... | [
"function",
"_fnCamelToHungarian",
"(",
"src",
",",
"user",
",",
"force",
")",
"{",
"if",
"(",
"!",
"src",
".",
"_hungarianMap",
")",
"{",
"_fnHungarianMap",
"(",
"src",
")",
";",
"}",
"var",
"hungarianKey",
";",
"$",
".",
"each",
"(",
"user",
",",
"... | Convert from camel case parameters to Hungarian, based on a Hungarian map
created by _fnHungarianMap.
@param {object} src The model object which holds all parameters that can be
mapped.
@param {object} user The object to convert from camel case to Hungarian.
@param {boolean} force When set to `true`, properties which a... | [
"Convert",
"from",
"camel",
"case",
"parameters",
"to",
"Hungarian",
"based",
"on",
"a",
"Hungarian",
"map",
"created",
"by",
"_fnHungarianMap",
"."
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L310-L332 |
35,070 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | _fnLanguageCompat | function _fnLanguageCompat( oLanguage )
{
var oDefaults = DataTable.defaults.oLanguage;
var zeroRecords = oLanguage.sZeroRecords;
/* Backwards compatibility - if there is no sEmptyTable given, then use the same as
* sZeroRecords - assuming that is given.
*/
if ( !oLanguage.sEmptyTable && zeroRe... | javascript | function _fnLanguageCompat( oLanguage )
{
var oDefaults = DataTable.defaults.oLanguage;
var zeroRecords = oLanguage.sZeroRecords;
/* Backwards compatibility - if there is no sEmptyTable given, then use the same as
* sZeroRecords - assuming that is given.
*/
if ( !oLanguage.sEmptyTable && zeroRe... | [
"function",
"_fnLanguageCompat",
"(",
"oLanguage",
")",
"{",
"var",
"oDefaults",
"=",
"DataTable",
".",
"defaults",
".",
"oLanguage",
";",
"var",
"zeroRecords",
"=",
"oLanguage",
".",
"sZeroRecords",
";",
"/* Backwards compatibility - if there is no sEmptyTable given, the... | Language compatibility - when certain options are given, and others aren't, we
need to duplicate the values over, in order to provide backwards compatibility
with older language files.
@param {object} oSettings dataTables settings object
@memberof DataTable#oApi | [
"Language",
"compatibility",
"-",
"when",
"certain",
"options",
"are",
"given",
"and",
"others",
"aren",
"t",
"we",
"need",
"to",
"duplicate",
"the",
"values",
"over",
"in",
"order",
"to",
"provide",
"backwards",
"compatibility",
"with",
"older",
"language",
"... | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L342-L362 |
35,071 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | function ( o, knew, old ) {
if ( o[ knew ] !== undefined ) {
o[ old ] = o[ knew ];
}
} | javascript | function ( o, knew, old ) {
if ( o[ knew ] !== undefined ) {
o[ old ] = o[ knew ];
}
} | [
"function",
"(",
"o",
",",
"knew",
",",
"old",
")",
"{",
"if",
"(",
"o",
"[",
"knew",
"]",
"!==",
"undefined",
")",
"{",
"o",
"[",
"old",
"]",
"=",
"o",
"[",
"knew",
"]",
";",
"}",
"}"
] | Map one parameter onto another
@param {object} o Object to map
@param {*} knew The new parameter name
@param {*} old The old parameter name | [
"Map",
"one",
"parameter",
"onto",
"another"
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L371-L375 | |
35,072 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | _fnCompatOpts | function _fnCompatOpts ( init )
{
_fnCompatMap( init, 'ordering', 'bSort' );
_fnCompatMap( init, 'orderMulti', 'bSortMulti' );
_fnCompatMap( init, 'orderClasses', 'bSortClasses' );
_fnCompatMap( init, 'orderCellsTop', 'bSortCellsTop' );
_fnCompatMap( init, 'order', 'aaSorting' );
_f... | javascript | function _fnCompatOpts ( init )
{
_fnCompatMap( init, 'ordering', 'bSort' );
_fnCompatMap( init, 'orderMulti', 'bSortMulti' );
_fnCompatMap( init, 'orderClasses', 'bSortClasses' );
_fnCompatMap( init, 'orderCellsTop', 'bSortCellsTop' );
_fnCompatMap( init, 'order', 'aaSorting' );
_f... | [
"function",
"_fnCompatOpts",
"(",
"init",
")",
"{",
"_fnCompatMap",
"(",
"init",
",",
"'ordering'",
",",
"'bSort'",
")",
";",
"_fnCompatMap",
"(",
"init",
",",
"'orderMulti'",
",",
"'bSortMulti'",
")",
";",
"_fnCompatMap",
"(",
"init",
",",
"'orderClasses'",
... | Provide backwards compatibility for the main DT options. Note that the new
options are mapped onto the old parameters, so this is an external interface
change only.
@param {object} init Object to map | [
"Provide",
"backwards",
"compatibility",
"for",
"the",
"main",
"DT",
"options",
".",
"Note",
"that",
"the",
"new",
"options",
"are",
"mapped",
"onto",
"the",
"old",
"parameters",
"so",
"this",
"is",
"an",
"external",
"interface",
"change",
"only",
"."
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L384-L396 |
35,073 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | _fnCompatCols | function _fnCompatCols ( init )
{
_fnCompatMap( init, 'orderable', 'bSortable' );
_fnCompatMap( init, 'orderData', 'aDataSort' );
_fnCompatMap( init, 'orderSequence', 'asSorting' );
_fnCompatMap( init, 'orderDataType', 'sortDataType' );
} | javascript | function _fnCompatCols ( init )
{
_fnCompatMap( init, 'orderable', 'bSortable' );
_fnCompatMap( init, 'orderData', 'aDataSort' );
_fnCompatMap( init, 'orderSequence', 'asSorting' );
_fnCompatMap( init, 'orderDataType', 'sortDataType' );
} | [
"function",
"_fnCompatCols",
"(",
"init",
")",
"{",
"_fnCompatMap",
"(",
"init",
",",
"'orderable'",
",",
"'bSortable'",
")",
";",
"_fnCompatMap",
"(",
"init",
",",
"'orderData'",
",",
"'aDataSort'",
")",
";",
"_fnCompatMap",
"(",
"init",
",",
"'orderSequence'... | Provide backwards compatibility for column options. Note that the new options
are mapped onto the old parameters, so this is an external interface change
only.
@param {object} init Object to map | [
"Provide",
"backwards",
"compatibility",
"for",
"column",
"options",
".",
"Note",
"that",
"the",
"new",
"options",
"are",
"mapped",
"onto",
"the",
"old",
"parameters",
"so",
"this",
"is",
"an",
"external",
"interface",
"change",
"only",
"."
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L405-L411 |
35,074 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | _fnBrowserDetect | function _fnBrowserDetect( settings )
{
var browser = settings.oBrowser;
// Scrolling feature / quirks detection
var n = $('<div/>')
.css( {
position: 'absolute',
top: 0,
left: 0,
height: 1,
width: 1,
overflow: 'hidden'
} )
.append(
$('<div/>')
.css( {
... | javascript | function _fnBrowserDetect( settings )
{
var browser = settings.oBrowser;
// Scrolling feature / quirks detection
var n = $('<div/>')
.css( {
position: 'absolute',
top: 0,
left: 0,
height: 1,
width: 1,
overflow: 'hidden'
} )
.append(
$('<div/>')
.css( {
... | [
"function",
"_fnBrowserDetect",
"(",
"settings",
")",
"{",
"var",
"browser",
"=",
"settings",
".",
"oBrowser",
";",
"// Scrolling feature / quirks detection\r",
"var",
"n",
"=",
"$",
"(",
"'<div/>'",
")",
".",
"css",
"(",
"{",
"position",
":",
"'absolute'",
",... | Browser feature detection for capabilities, quirks
@param {object} settings dataTables settings object
@memberof DataTable#oApi | [
"Browser",
"feature",
"detection",
"for",
"capabilities",
"quirks"
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L419-L464 |
35,075 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | _fnGetColumns | function _fnGetColumns( oSettings, sParam )
{
var a = [];
$.map( oSettings.aoColumns, function(val, i) {
if ( val[sParam] ) {
a.push( i );
}
} );
return a;
} | javascript | function _fnGetColumns( oSettings, sParam )
{
var a = [];
$.map( oSettings.aoColumns, function(val, i) {
if ( val[sParam] ) {
a.push( i );
}
} );
return a;
} | [
"function",
"_fnGetColumns",
"(",
"oSettings",
",",
"sParam",
")",
"{",
"var",
"a",
"=",
"[",
"]",
";",
"$",
".",
"map",
"(",
"oSettings",
".",
"aoColumns",
",",
"function",
"(",
"val",
",",
"i",
")",
"{",
"if",
"(",
"val",
"[",
"sParam",
"]",
")... | Get an array of column indexes that match a given property
@param {object} oSettings dataTables settings object
@param {string} sParam Parameter in aoColumns to look for - typically
bVisible or bSearchable
@returns {array} Array of indexes with matched properties
@memberof DataTable#oApi | [
"Get",
"an",
"array",
"of",
"column",
"indexes",
"that",
"match",
"a",
"given",
"property"
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L701-L712 |
35,076 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | _fnApplyColumnDefs | function _fnApplyColumnDefs( oSettings, aoColDefs, aoCols, fn )
{
var i, iLen, j, jLen, k, kLen, def;
// Column definitions with aTargets
if ( aoColDefs )
{
/* Loop over the definitions array - loop in reverse so first instance has priority */
for ( i=aoColDefs.length-1 ; i>=0 ; i-- )
{
... | javascript | function _fnApplyColumnDefs( oSettings, aoColDefs, aoCols, fn )
{
var i, iLen, j, jLen, k, kLen, def;
// Column definitions with aTargets
if ( aoColDefs )
{
/* Loop over the definitions array - loop in reverse so first instance has priority */
for ( i=aoColDefs.length-1 ; i>=0 ; i-- )
{
... | [
"function",
"_fnApplyColumnDefs",
"(",
"oSettings",
",",
"aoColDefs",
",",
"aoCols",
",",
"fn",
")",
"{",
"var",
"i",
",",
"iLen",
",",
"j",
",",
"jLen",
",",
"k",
",",
"kLen",
",",
"def",
";",
"// Column definitions with aTargets\r",
"if",
"(",
"aoColDefs... | Take the column definitions and static columns arrays and calculate how
they relate to column indexes. The callback function will then apply the
definition found for a column to a suitable configuration object.
@param {object} oSettings dataTables settings object
@param {array} aoColDefs The aoColumnDefs array that is ... | [
"Take",
"the",
"column",
"definitions",
"and",
"static",
"columns",
"arrays",
"and",
"calculate",
"how",
"they",
"relate",
"to",
"column",
"indexes",
".",
"The",
"callback",
"function",
"will",
"then",
"apply",
"the",
"definition",
"found",
"for",
"a",
"column... | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L779-L843 |
35,077 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | _fnGetCellData | function _fnGetCellData( oSettings, iRow, iCol, sSpecific )
{
var oCol = oSettings.aoColumns[iCol];
var oData = oSettings.aoData[iRow]._aData;
var sData = oCol.fnGetData( oData, sSpecific );
if ( sData === undefined )
{
if ( oSettings.iDrawError != oSettings.iDraw && oCol.sDefaultContent === nul... | javascript | function _fnGetCellData( oSettings, iRow, iCol, sSpecific )
{
var oCol = oSettings.aoColumns[iCol];
var oData = oSettings.aoData[iRow]._aData;
var sData = oCol.fnGetData( oData, sSpecific );
if ( sData === undefined )
{
if ( oSettings.iDrawError != oSettings.iDraw && oCol.sDefaultContent === nul... | [
"function",
"_fnGetCellData",
"(",
"oSettings",
",",
"iRow",
",",
"iCol",
",",
"sSpecific",
")",
"{",
"var",
"oCol",
"=",
"oSettings",
".",
"aoColumns",
"[",
"iCol",
"]",
";",
"var",
"oData",
"=",
"oSettings",
".",
"aoData",
"[",
"iRow",
"]",
".",
"_aD... | Get the data for a given cell from the internal cache, taking into account data mapping
@param {object} oSettings dataTables settings object
@param {int} iRow aoData row id
@param {int} iCol Column index
@param {string} sSpecific data get type ('display', 'type' 'filter' 'sort')
@returns {*} Cell data
@memberof DataTab... | [
"Get",
"the",
"data",
"for",
"a",
"given",
"cell",
"from",
"the",
"internal",
"cache",
"taking",
"into",
"account",
"data",
"mapping"
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L978-L1012 |
35,078 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | _fnInvalidateRow | function _fnInvalidateRow( settings, rowIdx, src, column )
{
var row = settings.aoData[ rowIdx ];
var i, ien;
// Are we reading last data from DOM or the data object?
if ( src === 'dom' || ((! src || src === 'auto') && row.src === 'dom') ) {
// Read the data from the DOM
row._aData = _fnGetRowE... | javascript | function _fnInvalidateRow( settings, rowIdx, src, column )
{
var row = settings.aoData[ rowIdx ];
var i, ien;
// Are we reading last data from DOM or the data object?
if ( src === 'dom' || ((! src || src === 'auto') && row.src === 'dom') ) {
// Read the data from the DOM
row._aData = _fnGetRowE... | [
"function",
"_fnInvalidateRow",
"(",
"settings",
",",
"rowIdx",
",",
"src",
",",
"column",
")",
"{",
"var",
"row",
"=",
"settings",
".",
"aoData",
"[",
"rowIdx",
"]",
";",
"var",
"i",
",",
"ien",
";",
"// Are we reading last data from DOM or the data object?\r",... | Mark cached data as invalid such that a re-read of the data will occur when
the cached data is next requested. Also update from the data source object.
@param {object} settings DataTables settings object
@param {int} rowIdx Row index to invalidate
@memberof DataTable#oApi
@todo For the modularisation of v1.11 t... | [
"Mark",
"cached",
"data",
"as",
"invalid",
"such",
"that",
"a",
"re",
"-",
"read",
"of",
"the",
"data",
"will",
"occur",
"when",
"the",
"cached",
"data",
"is",
"next",
"requested",
".",
"Also",
"update",
"from",
"the",
"data",
"source",
"object",
"."
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L1346-L1382 |
35,079 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | _fnGetRowElements | function _fnGetRowElements( settings, row )
{
var
d = [],
tds = [],
td = row.firstChild,
name, col, o, i=0, contents,
columns = settings.aoColumns;
var attr = function ( str, data, td ) {
if ( typeof str === 'string' ) {
var idx = str.indexOf('@');
if ( idx !== -1 ) {
... | javascript | function _fnGetRowElements( settings, row )
{
var
d = [],
tds = [],
td = row.firstChild,
name, col, o, i=0, contents,
columns = settings.aoColumns;
var attr = function ( str, data, td ) {
if ( typeof str === 'string' ) {
var idx = str.indexOf('@');
if ( idx !== -1 ) {
... | [
"function",
"_fnGetRowElements",
"(",
"settings",
",",
"row",
")",
"{",
"var",
"d",
"=",
"[",
"]",
",",
"tds",
"=",
"[",
"]",
",",
"td",
"=",
"row",
".",
"firstChild",
",",
"name",
",",
"col",
",",
"o",
",",
"i",
"=",
"0",
",",
"contents",
",",... | Build a data source object from an HTML row, reading the contents of the
cells that are in the row.
@param {object} settings DataTables settings object
@param {node} TR element from which to read data
@returns {object} Object with two parameters: `data` the data read, in
document order, and `cells` and array of nodes ... | [
"Build",
"a",
"data",
"source",
"object",
"from",
"an",
"HTML",
"row",
"reading",
"the",
"contents",
"of",
"the",
"cells",
"that",
"are",
"in",
"the",
"row",
"."
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L1397-L1450 |
35,080 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | _fnBuildAjax | function _fnBuildAjax( oSettings, data, fn )
{
// Compatibility with 1.9-, allow fnServerData and event to manipulate
_fnCallbackFire( oSettings, 'aoServerParams', 'serverParams', [data] );
// Convert to object based for 1.10+ if using the old scheme
if ( data && data.__legacy ) {
var tmp = {};
... | javascript | function _fnBuildAjax( oSettings, data, fn )
{
// Compatibility with 1.9-, allow fnServerData and event to manipulate
_fnCallbackFire( oSettings, 'aoServerParams', 'serverParams', [data] );
// Convert to object based for 1.10+ if using the old scheme
if ( data && data.__legacy ) {
var tmp = {};
... | [
"function",
"_fnBuildAjax",
"(",
"oSettings",
",",
"data",
",",
"fn",
")",
"{",
"// Compatibility with 1.9-, allow fnServerData and event to manipulate\r",
"_fnCallbackFire",
"(",
"oSettings",
",",
"'aoServerParams'",
",",
"'serverParams'",
",",
"[",
"data",
"]",
")",
"... | Create an Ajax call based on the table's settings, taking into account that
parameters can have multiple forms, and backwards compatibility.
@param {object} oSettings dataTables settings object
@param {array} data Data to send to the server, required by
DataTables - may be augmented by developer callbacks
@param {func... | [
"Create",
"an",
"Ajax",
"call",
"based",
"on",
"the",
"table",
"s",
"settings",
"taking",
"into",
"account",
"that",
"parameters",
"can",
"have",
"multiple",
"forms",
"and",
"backwards",
"compatibility",
"."
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L2199-L2304 |
35,081 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | _fnAjaxDataSrc | function _fnAjaxDataSrc ( oSettings, json )
{
var dataSrc = $.isPlainObject( oSettings.ajax ) && oSettings.ajax.dataSrc !== undefined ?
oSettings.ajax.dataSrc :
oSettings.sAjaxDataProp; // Compatibility with 1.9-.
// Compatibility with 1.9-. In order to read from aaData, check if the
// default ha... | javascript | function _fnAjaxDataSrc ( oSettings, json )
{
var dataSrc = $.isPlainObject( oSettings.ajax ) && oSettings.ajax.dataSrc !== undefined ?
oSettings.ajax.dataSrc :
oSettings.sAjaxDataProp; // Compatibility with 1.9-.
// Compatibility with 1.9-. In order to read from aaData, check if the
// default ha... | [
"function",
"_fnAjaxDataSrc",
"(",
"oSettings",
",",
"json",
")",
"{",
"var",
"dataSrc",
"=",
"$",
".",
"isPlainObject",
"(",
"oSettings",
".",
"ajax",
")",
"&&",
"oSettings",
".",
"ajax",
".",
"dataSrc",
"!==",
"undefined",
"?",
"oSettings",
".",
"ajax",
... | Get the data from the JSON data source to use for drawing a table. Using
`_fnGetObjectDataFn` allows the data to be sourced from a property of the
source object, or from a processing function.
@param {object} oSettings dataTables settings object
@param {object} json Data source object / array from the server
@return {... | [
"Get",
"the",
"data",
"from",
"the",
"JSON",
"data",
"source",
"to",
"use",
"for",
"drawing",
"a",
"table",
".",
"Using",
"_fnGetObjectDataFn",
"allows",
"the",
"data",
"to",
"be",
"sourced",
"from",
"a",
"property",
"of",
"the",
"source",
"object",
"or",
... | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L2494-L2509 |
35,082 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | function(nSizer) {
var style = nSizer.style;
style.paddingTop = "0";
style.paddingBottom = "0";
style.borderTopWidth = "0";
style.borderBottomWidth = "0";
style.height = 0;
} | javascript | function(nSizer) {
var style = nSizer.style;
style.paddingTop = "0";
style.paddingBottom = "0";
style.borderTopWidth = "0";
style.borderBottomWidth = "0";
style.height = 0;
} | [
"function",
"(",
"nSizer",
")",
"{",
"var",
"style",
"=",
"nSizer",
".",
"style",
";",
"style",
".",
"paddingTop",
"=",
"\"0\"",
";",
"style",
".",
"paddingBottom",
"=",
"\"0\"",
";",
"style",
".",
"borderTopWidth",
"=",
"\"0\"",
";",
"style",
".",
"bo... | Given that this is such a monster function, a lot of variables are use to try and keep the minimised size as small as possible | [
"Given",
"that",
"this",
"is",
"such",
"a",
"monster",
"function",
"a",
"lot",
"of",
"variables",
"are",
"use",
"to",
"try",
"and",
"keep",
"the",
"minimised",
"size",
"as",
"small",
"as",
"possible"
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L3473-L3480 | |
35,083 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | _fnScrollingWidthAdjust | function _fnScrollingWidthAdjust ( settings, n )
{
var scroll = settings.oScroll;
if ( scroll.sX || scroll.sY ) {
// When y-scrolling only, we want to remove the width of the scroll bar
// so the table + scroll bar will fit into the area available, otherwise
// we fix the table at its current siz... | javascript | function _fnScrollingWidthAdjust ( settings, n )
{
var scroll = settings.oScroll;
if ( scroll.sX || scroll.sY ) {
// When y-scrolling only, we want to remove the width of the scroll bar
// so the table + scroll bar will fit into the area available, otherwise
// we fix the table at its current siz... | [
"function",
"_fnScrollingWidthAdjust",
"(",
"settings",
",",
"n",
")",
"{",
"var",
"scroll",
"=",
"settings",
".",
"oScroll",
";",
"if",
"(",
"scroll",
".",
"sX",
"||",
"scroll",
".",
"sY",
")",
"{",
"// When y-scrolling only, we want to remove the width of the sc... | Adjust a table's width to take account of vertical scroll bar
@param {object} oSettings dataTables settings object
@param {node} n table node
@memberof DataTable#oApi | [
"Adjust",
"a",
"table",
"s",
"width",
"to",
"take",
"account",
"of",
"vertical",
"scroll",
"bar"
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L3986-L3997 |
35,084 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | _fnScrollBarWidth | function _fnScrollBarWidth ()
{
// On first run a static variable is set, since this is only needed once.
// Subsequent runs will just use the previously calculated value
if ( ! DataTable.__scrollbarWidth ) {
var inner = $('<p/>').css( {
width: '100%',
height: 200,
padding: 0
} )[0];
... | javascript | function _fnScrollBarWidth ()
{
// On first run a static variable is set, since this is only needed once.
// Subsequent runs will just use the previously calculated value
if ( ! DataTable.__scrollbarWidth ) {
var inner = $('<p/>').css( {
width: '100%',
height: 200,
padding: 0
} )[0];
... | [
"function",
"_fnScrollBarWidth",
"(",
")",
"{",
"// On first run a static variable is set, since this is only needed once.\r",
"// Subsequent runs will just use the previously calculated value\r",
"if",
"(",
"!",
"DataTable",
".",
"__scrollbarWidth",
")",
"{",
"var",
"inner",
"=",
... | Get the width of a scroll bar in this browser being used
@returns {int} width in pixels
@memberof DataTable#oApi | [
"Get",
"the",
"width",
"of",
"a",
"scroll",
"bar",
"in",
"this",
"browser",
"being",
"used"
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L4076-L4115 |
35,085 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | _fnSortListener | function _fnSortListener ( settings, colIdx, append, callback )
{
var col = settings.aoColumns[ colIdx ];
var sorting = settings.aaSorting;
var asSorting = col.asSorting;
var nextSortIdx;
var next = function ( a ) {
var idx = a._idx;
if ( idx === undefined ) {
idx = $.inArray( a[1], asSort... | javascript | function _fnSortListener ( settings, colIdx, append, callback )
{
var col = settings.aoColumns[ colIdx ];
var sorting = settings.aaSorting;
var asSorting = col.asSorting;
var nextSortIdx;
var next = function ( a ) {
var idx = a._idx;
if ( idx === undefined ) {
idx = $.inArray( a[1], asSort... | [
"function",
"_fnSortListener",
"(",
"settings",
",",
"colIdx",
",",
"append",
",",
"callback",
")",
"{",
"var",
"col",
"=",
"settings",
".",
"aoColumns",
"[",
"colIdx",
"]",
";",
"var",
"sorting",
"=",
"settings",
".",
"aaSorting",
";",
"var",
"asSorting",... | Function to run on user sort request
@param {object} settings dataTables settings object
@param {node} attachTo node to attach the handler to
@param {int} colIdx column sorting index
@param {boolean} [append=false] Append the requested sort to the existing
sort if true (i.e. multi-column sort)
@param {function} [callba... | [
"Function",
"to",
"run",
"on",
"user",
"sort",
"request"
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L4362-L4417 |
35,086 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | _fnLoadState | function _fnLoadState ( oSettings, oInit )
{
var i, ien;
var columns = oSettings.aoColumns;
if ( !oSettings.oFeatures.bStateSave )
{
return;
}
var oData = oSettings.fnStateLoadCallback.call( oSettings.oInstance, oSettings );
if ( !oData )
{
return;
}
/* Allow custom and ... | javascript | function _fnLoadState ( oSettings, oInit )
{
var i, ien;
var columns = oSettings.aoColumns;
if ( !oSettings.oFeatures.bStateSave )
{
return;
}
var oData = oSettings.fnStateLoadCallback.call( oSettings.oInstance, oSettings );
if ( !oData )
{
return;
}
/* Allow custom and ... | [
"function",
"_fnLoadState",
"(",
"oSettings",
",",
"oInit",
")",
"{",
"var",
"i",
",",
"ien",
";",
"var",
"columns",
"=",
"oSettings",
".",
"aoColumns",
";",
"if",
"(",
"!",
"oSettings",
".",
"oFeatures",
".",
"bStateSave",
")",
"{",
"return",
";",
"}"... | Attempt to load a saved table state
@param {object} oSettings dataTables settings object
@param {object} oInit DataTables init object so we can override settings
@memberof DataTable#oApi | [
"Attempt",
"to",
"load",
"a",
"saved",
"table",
"state"
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L4572-L4634 |
35,087 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | function ( mixed )
{
var idx, jq;
var settings = DataTable.settings;
var tables = $.map( settings, function (el, i) {
return el.nTable;
} );
if ( mixed.nTable && mixed.oApi ) {
// DataTables settings object
return [ mixed ];
}
else if ( mixed.nodeName && mixed.nodeName.toLowerCase(... | javascript | function ( mixed )
{
var idx, jq;
var settings = DataTable.settings;
var tables = $.map( settings, function (el, i) {
return el.nTable;
} );
if ( mixed.nTable && mixed.oApi ) {
// DataTables settings object
return [ mixed ];
}
else if ( mixed.nodeName && mixed.nodeName.toLowerCase(... | [
"function",
"(",
"mixed",
")",
"{",
"var",
"idx",
",",
"jq",
";",
"var",
"settings",
"=",
"DataTable",
".",
"settings",
";",
"var",
"tables",
"=",
"$",
".",
"map",
"(",
"settings",
",",
"function",
"(",
"el",
",",
"i",
")",
"{",
"return",
"el",
"... | Abstraction for `context` parameter of the `Api` constructor to allow it to
take several different forms for ease of use.
Each of the input parameter types will be converted to a DataTables settings
object where possible.
@param {string|node|jQuery|object} mixed DataTable identifier. Can be one
of:
* `string` - jQu... | [
"Abstraction",
"for",
"context",
"parameter",
"of",
"the",
"Api",
"constructor",
"to",
"allow",
"it",
"to",
"take",
"several",
"different",
"forms",
"for",
"ease",
"of",
"use",
"."
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L6339-L6371 | |
35,088 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | function ( fn )
{
if ( __arrayProto.forEach ) {
// Where possible, use the built-in forEach
__arrayProto.forEach.call( this, fn, this );
}
else {
// Compatibility for browsers without EMCA-252-5 (JS 1.6)
for ( var i=0, ien=this.length ; i<ien; i++ ) {
// In strict mode the execu... | javascript | function ( fn )
{
if ( __arrayProto.forEach ) {
// Where possible, use the built-in forEach
__arrayProto.forEach.call( this, fn, this );
}
else {
// Compatibility for browsers without EMCA-252-5 (JS 1.6)
for ( var i=0, ien=this.length ; i<ien; i++ ) {
// In strict mode the execu... | [
"function",
"(",
"fn",
")",
"{",
"if",
"(",
"__arrayProto",
".",
"forEach",
")",
"{",
"// Where possible, use the built-in forEach\r",
"__arrayProto",
".",
"forEach",
".",
"call",
"(",
"this",
",",
"fn",
",",
"this",
")",
";",
"}",
"else",
"{",
"// Compatibi... | array of table settings objects | [
"array",
"of",
"table",
"settings",
"objects"
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L6491-L6506 | |
35,089 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | function ( flatten, type, fn ) {
var
a = [], ret,
i, ien, j, jen,
context = this.context,
rows, items, item,
selector = this.selector;
// Argument shifting
if ( typeof flatten === 'string' ) {
fn = type;
type = flatten;
flatten = false;
}
for ( i=0, ien=... | javascript | function ( flatten, type, fn ) {
var
a = [], ret,
i, ien, j, jen,
context = this.context,
rows, items, item,
selector = this.selector;
// Argument shifting
if ( typeof flatten === 'string' ) {
fn = type;
type = flatten;
flatten = false;
}
for ( i=0, ien=... | [
"function",
"(",
"flatten",
",",
"type",
",",
"fn",
")",
"{",
"var",
"a",
"=",
"[",
"]",
",",
"ret",
",",
"i",
",",
"ien",
",",
"j",
",",
"jen",
",",
"context",
"=",
"this",
".",
"context",
",",
"rows",
",",
"items",
",",
"item",
",",
"select... | Internal only at the moment - relax? | [
"Internal",
"only",
"at",
"the",
"moment",
"-",
"relax?"
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L6550-L6616 | |
35,090 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | function ( selector, a )
{
// Integer is used to pick out a table by index
if ( typeof selector === 'number' ) {
return [ a[ selector ] ];
}
// Perform a jQuery selector on the table nodes
var nodes = $.map( a, function (el, i) {
return el.nTable;
} );
return $(nodes)
.filter( s... | javascript | function ( selector, a )
{
// Integer is used to pick out a table by index
if ( typeof selector === 'number' ) {
return [ a[ selector ] ];
}
// Perform a jQuery selector on the table nodes
var nodes = $.map( a, function (el, i) {
return el.nTable;
} );
return $(nodes)
.filter( s... | [
"function",
"(",
"selector",
",",
"a",
")",
"{",
"// Integer is used to pick out a table by index\r",
"if",
"(",
"typeof",
"selector",
"===",
"'number'",
")",
"{",
"return",
"[",
"a",
"[",
"selector",
"]",
"]",
";",
"}",
"// Perform a jQuery selector on the table no... | Selector for HTML tables. Apply the given selector to the give array of
DataTables settings objects.
@param {string|integer} [selector] jQuery selector string or integer
@param {array} Array of DataTables settings objects to be filtered
@return {array}
@ignore | [
"Selector",
"for",
"HTML",
"tables",
".",
"Apply",
"the",
"given",
"selector",
"to",
"the",
"give",
"array",
"of",
"DataTables",
"settings",
"objects",
"."
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L6923-L6943 | |
35,091 | altairstudios/nodeserver | admin/public/js/plugins/dataTables/jquery.dataTables.js | function ()
{
var
len = this._iDisplayLength,
start = this._iDisplayStart,
calc = start + len,
records = this.aiDisplay.length,
features = this.oFeatures,
paginate = features.bPaginate;
if ( features.bServerSide ) {
return paginate === false || len === -1 ?
... | javascript | function ()
{
var
len = this._iDisplayLength,
start = this._iDisplayStart,
calc = start + len,
records = this.aiDisplay.length,
features = this.oFeatures,
paginate = features.bPaginate;
if ( features.bServerSide ) {
return paginate === false || len === -1 ?
... | [
"function",
"(",
")",
"{",
"var",
"len",
"=",
"this",
".",
"_iDisplayLength",
",",
"start",
"=",
"this",
".",
"_iDisplayStart",
",",
"calc",
"=",
"start",
"+",
"len",
",",
"records",
"=",
"this",
".",
"aiDisplay",
".",
"length",
",",
"features",
"=",
... | Get the display end point - aiDisplay index
@type function | [
"Get",
"the",
"display",
"end",
"point",
"-",
"aiDisplay",
"index"
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/admin/public/js/plugins/dataTables/jquery.dataTables.js#L12783-L12803 | |
35,092 | layerhq/node-layer-api | lib/resources/identities.js | function(userId, callback) {
if (!userId) return callback(new Error(utils.i18n.identities.id));
utils.debug('Identities get: ' + userId);
request.get({
path: '/users/' + userId + '/identity'
}, callback);
} | javascript | function(userId, callback) {
if (!userId) return callback(new Error(utils.i18n.identities.id));
utils.debug('Identities get: ' + userId);
request.get({
path: '/users/' + userId + '/identity'
}, callback);
} | [
"function",
"(",
"userId",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"userId",
")",
"return",
"callback",
"(",
"new",
"Error",
"(",
"utils",
".",
"i18n",
".",
"identities",
".",
"id",
")",
")",
";",
"utils",
".",
"debug",
"(",
"'Identities get: '",
... | Retrieve an Identity
@param {String} userId User ID
@param {Function} callback Callback function | [
"Retrieve",
"an",
"Identity"
] | 284c161350e2cf3d3f5b45f2918798d981f1ada4 | https://github.com/layerhq/node-layer-api/blob/284c161350e2cf3d3f5b45f2918798d981f1ada4/lib/resources/identities.js#L38-L45 | |
35,093 | layerhq/node-layer-api | lib/resources/identities.js | function(userId, properties, callback) {
if (!userId) return callback(new Error(utils.i18n.identities.id));
utils.debug('Identity edit: ' + userId);
request.patch({
path: '/users/' + userId + '/identity',
body: Object.keys(properties).map(function(propertyName) {
return {
... | javascript | function(userId, properties, callback) {
if (!userId) return callback(new Error(utils.i18n.identities.id));
utils.debug('Identity edit: ' + userId);
request.patch({
path: '/users/' + userId + '/identity',
body: Object.keys(properties).map(function(propertyName) {
return {
... | [
"function",
"(",
"userId",
",",
"properties",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"userId",
")",
"return",
"callback",
"(",
"new",
"Error",
"(",
"utils",
".",
"i18n",
".",
"identities",
".",
"id",
")",
")",
";",
"utils",
".",
"debug",
"(",
"... | Edit Identity properties.
@param {String} userId User ID
@param {Object} properties Hash of properties to update
@param {Function} callback Callback function | [
"Edit",
"Identity",
"properties",
"."
] | 284c161350e2cf3d3f5b45f2918798d981f1ada4 | https://github.com/layerhq/node-layer-api/blob/284c161350e2cf3d3f5b45f2918798d981f1ada4/lib/resources/identities.js#L54-L68 | |
35,094 | altairstudios/nodeserver | core/workers/node.js | function(website) {
var self = this;
var scriptPath = path.dirname(website.script);
var script = '';
var port = website.port;
if(website.absoluteScript === false) {
scriptPath = process.cwd() + '/' + path.dirname(website.script);
}
script = path.basename(website.script);
var env = JSON.parse(JSO... | javascript | function(website) {
var self = this;
var scriptPath = path.dirname(website.script);
var script = '';
var port = website.port;
if(website.absoluteScript === false) {
scriptPath = process.cwd() + '/' + path.dirname(website.script);
}
script = path.basename(website.script);
var env = JSON.parse(JSO... | [
"function",
"(",
"website",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"scriptPath",
"=",
"path",
".",
"dirname",
"(",
"website",
".",
"script",
")",
";",
"var",
"script",
"=",
"''",
";",
"var",
"port",
"=",
"website",
".",
"port",
";",
"if"... | Start the nodejs process. Spawn the proccess and listen on a port
@param {Website} website Website to start | [
"Start",
"the",
"nodejs",
"process",
".",
"Spawn",
"the",
"proccess",
"and",
"listen",
"on",
"a",
"port"
] | 559ae91b025573ec772c51b838ee691d34abbbbb | https://github.com/altairstudios/nodeserver/blob/559ae91b025573ec772c51b838ee691d34abbbbb/core/workers/node.js#L16-L77 | |
35,095 | elidoran/comma-number | lib/index.js | commaNumber | function commaNumber(inputNumber, optionalSeparator, optionalDecimalChar) {
// we'll strip off and hold the decimal value to reattach later.
// we'll hold both the `number` value and `stringNumber` value.
let number, stringNumber, decimal
// default `separator` is a comma
const separator = optionalSeparator... | javascript | function commaNumber(inputNumber, optionalSeparator, optionalDecimalChar) {
// we'll strip off and hold the decimal value to reattach later.
// we'll hold both the `number` value and `stringNumber` value.
let number, stringNumber, decimal
// default `separator` is a comma
const separator = optionalSeparator... | [
"function",
"commaNumber",
"(",
"inputNumber",
",",
"optionalSeparator",
",",
"optionalDecimalChar",
")",
"{",
"// we'll strip off and hold the decimal value to reattach later.",
"// we'll hold both the `number` value and `stringNumber` value.",
"let",
"number",
",",
"stringNumber",
... | return a string with the provided number formatted with commas. can specify either a Number or a String. | [
"return",
"a",
"string",
"with",
"the",
"provided",
"number",
"formatted",
"with",
"commas",
".",
"can",
"specify",
"either",
"a",
"Number",
"or",
"a",
"String",
"."
] | 4aaca601ec6a69b56b61d1fb104c191b1848aadc | https://github.com/elidoran/comma-number/blob/4aaca601ec6a69b56b61d1fb104c191b1848aadc/lib/index.js#L5-L74 |
35,096 | psychobunny/nodebb-plugin-gallery | public/vendor/fancybox/jquery.fancybox.js | function () {
var coming = F.coming;
if (!coming || false === F.trigger('onCancel')) {
return;
}
F.hideLoading();
if (F.ajaxLoad) {
F.ajaxLoad.abort();
}
F.ajaxLoad = null;
if (F.imgPreload) {
F.imgPreload.onload = F.imgPreload.onerror = null;
}
if (coming.wrap) {
com... | javascript | function () {
var coming = F.coming;
if (!coming || false === F.trigger('onCancel')) {
return;
}
F.hideLoading();
if (F.ajaxLoad) {
F.ajaxLoad.abort();
}
F.ajaxLoad = null;
if (F.imgPreload) {
F.imgPreload.onload = F.imgPreload.onerror = null;
}
if (coming.wrap) {
com... | [
"function",
"(",
")",
"{",
"var",
"coming",
"=",
"F",
".",
"coming",
";",
"if",
"(",
"!",
"coming",
"||",
"false",
"===",
"F",
".",
"trigger",
"(",
"'onCancel'",
")",
")",
"{",
"return",
";",
"}",
"F",
".",
"hideLoading",
"(",
")",
";",
"if",
"... | Cancel image loading or abort ajax request | [
"Cancel",
"image",
"loading",
"or",
"abort",
"ajax",
"request"
] | 2e90f0f7a2bbfe75585bfee2cfa2df52e9a42631 | https://github.com/psychobunny/nodebb-plugin-gallery/blob/2e90f0f7a2bbfe75585bfee2cfa2df52e9a42631/public/vendor/fancybox/jquery.fancybox.js#L363-L392 | |
35,097 | psychobunny/nodebb-plugin-gallery | public/vendor/fancybox/jquery.fancybox.js | function ( direction ) {
var current = F.current;
if (current) {
if (!isString(direction)) {
direction = current.direction.next;
}
F.jumpto(current.index + 1, direction, 'next');
}
} | javascript | function ( direction ) {
var current = F.current;
if (current) {
if (!isString(direction)) {
direction = current.direction.next;
}
F.jumpto(current.index + 1, direction, 'next');
}
} | [
"function",
"(",
"direction",
")",
"{",
"var",
"current",
"=",
"F",
".",
"current",
";",
"if",
"(",
"current",
")",
"{",
"if",
"(",
"!",
"isString",
"(",
"direction",
")",
")",
"{",
"direction",
"=",
"current",
".",
"direction",
".",
"next",
";",
"... | Navigate to next gallery item | [
"Navigate",
"to",
"next",
"gallery",
"item"
] | 2e90f0f7a2bbfe75585bfee2cfa2df52e9a42631 | https://github.com/psychobunny/nodebb-plugin-gallery/blob/2e90f0f7a2bbfe75585bfee2cfa2df52e9a42631/public/vendor/fancybox/jquery.fancybox.js#L473-L483 | |
35,098 | psychobunny/nodebb-plugin-gallery | public/vendor/fancybox/jquery.fancybox.js | function ( direction ) {
var current = F.current;
if (current) {
if (!isString(direction)) {
direction = current.direction.prev;
}
F.jumpto(current.index - 1, direction, 'prev');
}
} | javascript | function ( direction ) {
var current = F.current;
if (current) {
if (!isString(direction)) {
direction = current.direction.prev;
}
F.jumpto(current.index - 1, direction, 'prev');
}
} | [
"function",
"(",
"direction",
")",
"{",
"var",
"current",
"=",
"F",
".",
"current",
";",
"if",
"(",
"current",
")",
"{",
"if",
"(",
"!",
"isString",
"(",
"direction",
")",
")",
"{",
"direction",
"=",
"current",
".",
"direction",
".",
"prev",
";",
"... | Navigate to previous gallery item | [
"Navigate",
"to",
"previous",
"gallery",
"item"
] | 2e90f0f7a2bbfe75585bfee2cfa2df52e9a42631 | https://github.com/psychobunny/nodebb-plugin-gallery/blob/2e90f0f7a2bbfe75585bfee2cfa2df52e9a42631/public/vendor/fancybox/jquery.fancybox.js#L486-L496 | |
35,099 | psychobunny/nodebb-plugin-gallery | public/vendor/fancybox/jquery.fancybox.js | function ( index, direction, router ) {
var current = F.current;
if (!current) {
return;
}
index = getScalar(index);
F.direction = direction || current.direction[ (index >= current.index ? 'next' : 'prev') ];
F.router = router || 'jumpto';
if (current.loop) {
if (index < 0) {
in... | javascript | function ( index, direction, router ) {
var current = F.current;
if (!current) {
return;
}
index = getScalar(index);
F.direction = direction || current.direction[ (index >= current.index ? 'next' : 'prev') ];
F.router = router || 'jumpto';
if (current.loop) {
if (index < 0) {
in... | [
"function",
"(",
"index",
",",
"direction",
",",
"router",
")",
"{",
"var",
"current",
"=",
"F",
".",
"current",
";",
"if",
"(",
"!",
"current",
")",
"{",
"return",
";",
"}",
"index",
"=",
"getScalar",
"(",
"index",
")",
";",
"F",
".",
"direction",... | Navigate to gallery item by index | [
"Navigate",
"to",
"gallery",
"item",
"by",
"index"
] | 2e90f0f7a2bbfe75585bfee2cfa2df52e9a42631 | https://github.com/psychobunny/nodebb-plugin-gallery/blob/2e90f0f7a2bbfe75585bfee2cfa2df52e9a42631/public/vendor/fancybox/jquery.fancybox.js#L499-L524 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.