repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
partition
stringclasses
1 value
NaturalNode/natural
lib/natural/brill_pos_tagger/lib/RuleSet.js
RuleSet
function RuleSet(language) { var data = englishRuleSet; DEBUG && console.log(data); switch (language) { case 'EN': data = englishRuleSet; break; case 'DU': data = dutchRuleSet; break; } if (data.rules) { this.rules = {}; var that = this; data.rules.forEach(function(...
javascript
function RuleSet(language) { var data = englishRuleSet; DEBUG && console.log(data); switch (language) { case 'EN': data = englishRuleSet; break; case 'DU': data = dutchRuleSet; break; } if (data.rules) { this.rules = {}; var that = this; data.rules.forEach(function(...
[ "function", "RuleSet", "(", "language", ")", "{", "var", "data", "=", "englishRuleSet", ";", "DEBUG", "&&", "console", ".", "log", "(", "data", ")", ";", "switch", "(", "language", ")", "{", "case", "'EN'", ":", "data", "=", "englishRuleSet", ";", "bre...
Constructor takes a language abbreviation and loads the right rule set
[ "Constructor", "takes", "a", "language", "abbreviation", "and", "loads", "the", "right", "rule", "set" ]
01078b695fda3df41de26a7ac589a6478d802f1f
https://github.com/NaturalNode/natural/blob/01078b695fda3df41de26a7ac589a6478d802f1f/lib/natural/brill_pos_tagger/lib/RuleSet.js#L28-L48
train
NaturalNode/natural
lib/natural/classifiers/classifier.js
function(docs) { setTimeout(function() { self.events.emit('processedBatch', { size: docs.length, docs: totalDocs, batches: numThreads, index: finished }); }); for (var j = 0; j < docs.length; j++) { ...
javascript
function(docs) { setTimeout(function() { self.events.emit('processedBatch', { size: docs.length, docs: totalDocs, batches: numThreads, index: finished }); }); for (var j = 0; j < docs.length; j++) { ...
[ "function", "(", "docs", ")", "{", "setTimeout", "(", "function", "(", ")", "{", "self", ".", "events", ".", "emit", "(", "'processedBatch'", ",", "{", "size", ":", "docs", ".", "length", ",", "docs", ":", "totalDocs", ",", "batches", ":", "numThreads"...
Called when a batch completes processing
[ "Called", "when", "a", "batch", "completes", "processing" ]
01078b695fda3df41de26a7ac589a6478d802f1f
https://github.com/NaturalNode/natural/blob/01078b695fda3df41de26a7ac589a6478d802f1f/lib/natural/classifiers/classifier.js#L191-L204
train
NaturalNode/natural
lib/natural/classifiers/classifier.js
function(err) { if (err) { threadPool.destroy(); return callback(err); } for (var j = self.lastAdded; j < totalDocs; j++) { self.classifier.addExample(docFeatures[j], self.docs[j].label); self.events.emit('trainedWithDocument', { i...
javascript
function(err) { if (err) { threadPool.destroy(); return callback(err); } for (var j = self.lastAdded; j < totalDocs; j++) { self.classifier.addExample(docFeatures[j], self.docs[j].label); self.events.emit('trainedWithDocument', { i...
[ "function", "(", "err", ")", "{", "if", "(", "err", ")", "{", "threadPool", ".", "destroy", "(", ")", ";", "return", "callback", "(", "err", ")", ";", "}", "for", "(", "var", "j", "=", "self", ".", "lastAdded", ";", "j", "<", "totalDocs", ";", ...
Called when all batches finish processing
[ "Called", "when", "all", "batches", "finish", "processing" ]
01078b695fda3df41de26a7ac589a6478d802f1f
https://github.com/NaturalNode/natural/blob/01078b695fda3df41de26a7ac589a6478d802f1f/lib/natural/classifiers/classifier.js#L207-L228
train
NaturalNode/natural
lib/natural/classifiers/classifier.js
function(batchJson) { if (abort) return; threadPool.any.eval('docsToFeatures(' + batchJson + ');', function(err, docs) { if (err) { return onError(err); } finished++; if (docs) { docs = JSON.parse(docs); se...
javascript
function(batchJson) { if (abort) return; threadPool.any.eval('docsToFeatures(' + batchJson + ');', function(err, docs) { if (err) { return onError(err); } finished++; if (docs) { docs = JSON.parse(docs); se...
[ "function", "(", "batchJson", ")", "{", "if", "(", "abort", ")", "return", ";", "threadPool", ".", "any", ".", "eval", "(", "'docsToFeatures('", "+", "batchJson", "+", "');'", ",", "function", "(", "err", ",", "docs", ")", "{", "if", "(", "err", ")",...
Called to send a batch of docs to the threads
[ "Called", "to", "send", "a", "batch", "of", "docs", "to", "the", "threads" ]
01078b695fda3df41de26a7ac589a6478d802f1f
https://github.com/NaturalNode/natural/blob/01078b695fda3df41de26a7ac589a6478d802f1f/lib/natural/classifiers/classifier.js#L360-L380
train
NaturalNode/natural
lib/natural/tfidf/tfidf.js
isEncoding
function isEncoding(encoding) { if (typeof Buffer.isEncoding !== 'undefined') return Buffer.isEncoding(encoding); switch ((encoding + '').toLowerCase()) { case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2...
javascript
function isEncoding(encoding) { if (typeof Buffer.isEncoding !== 'undefined') return Buffer.isEncoding(encoding); switch ((encoding + '').toLowerCase()) { case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2...
[ "function", "isEncoding", "(", "encoding", ")", "{", "if", "(", "typeof", "Buffer", ".", "isEncoding", "!==", "'undefined'", ")", "return", "Buffer", ".", "isEncoding", "(", "encoding", ")", ";", "switch", "(", "(", "encoding", "+", "''", ")", ".", "toLo...
backwards compatibility for < node 0.10
[ "backwards", "compatibility", "for", "<", "node", "0", ".", "10" ]
01078b695fda3df41de26a7ac589a6478d802f1f
https://github.com/NaturalNode/natural/blob/01078b695fda3df41de26a7ac589a6478d802f1f/lib/natural/tfidf/tfidf.js#L67-L85
train
NaturalNode/natural
lib/natural/tokenizers/regexp_tokenizer.js
function(options) { var options = options || {}; this._pattern = options.pattern || this._pattern; this.discardEmpty = options.discardEmpty || true; // Match and split on GAPS not the actual WORDS this._gaps = options.gaps; if (this._gaps === undefined) { this._gaps = true; } }
javascript
function(options) { var options = options || {}; this._pattern = options.pattern || this._pattern; this.discardEmpty = options.discardEmpty || true; // Match and split on GAPS not the actual WORDS this._gaps = options.gaps; if (this._gaps === undefined) { this._gaps = true; } }
[ "function", "(", "options", ")", "{", "var", "options", "=", "options", "||", "{", "}", ";", "this", ".", "_pattern", "=", "options", ".", "pattern", "||", "this", ".", "_pattern", ";", "this", ".", "discardEmpty", "=", "options", ".", "discardEmpty", ...
Base Class for RegExp Matching
[ "Base", "Class", "for", "RegExp", "Matching" ]
01078b695fda3df41de26a7ac589a6478d802f1f
https://github.com/NaturalNode/natural/blob/01078b695fda3df41de26a7ac589a6478d802f1f/lib/natural/tokenizers/regexp_tokenizer.js#L28-L39
train
googlemaps/google-maps-services-js
lib/internal/task.js
setListener
function setListener(callback) { if (onFinish) { throw new Error('thenDo/finally called more than once'); } if (finished) { onFinish = function() {}; callback(finished.err, finished.result); } else { onFinish = function() { callback(finished.err, finished.result); }...
javascript
function setListener(callback) { if (onFinish) { throw new Error('thenDo/finally called more than once'); } if (finished) { onFinish = function() {}; callback(finished.err, finished.result); } else { onFinish = function() { callback(finished.err, finished.result); }...
[ "function", "setListener", "(", "callback", ")", "{", "if", "(", "onFinish", ")", "{", "throw", "new", "Error", "(", "'thenDo/finally called more than once'", ")", ";", "}", "if", "(", "finished", ")", "{", "onFinish", "=", "function", "(", ")", "{", "}", ...
Sets the listener that will be called with the result of this task, when finished. This function can be called at most once. @param {function(?, T)} callback
[ "Sets", "the", "listener", "that", "will", "be", "called", "with", "the", "result", "of", "this", "task", "when", "finished", ".", "This", "function", "can", "be", "called", "at", "most", "once", "." ]
1e20ccc7264e8858723dcf4971d9ad10dc9e5ff2
https://github.com/googlemaps/google-maps-services-js/blob/1e20ccc7264e8858723dcf4971d9ad10dc9e5ff2/lib/internal/task.js#L108-L120
train
googlemaps/google-maps-services-js
lib/internal/make-api-call.js
formatRequestUrl
function formatRequestUrl(path, query, useClientId) { if (channel) { query.channel = channel; } if (useClientId) { query.client = clientId; } else if (key && key.indexOf('AIza') == 0) { query.key = key; } else { throw 'Missing either a valid API key, or a client ID and secret...
javascript
function formatRequestUrl(path, query, useClientId) { if (channel) { query.channel = channel; } if (useClientId) { query.client = clientId; } else if (key && key.indexOf('AIza') == 0) { query.key = key; } else { throw 'Missing either a valid API key, or a client ID and secret...
[ "function", "formatRequestUrl", "(", "path", ",", "query", ",", "useClientId", ")", "{", "if", "(", "channel", ")", "{", "query", ".", "channel", "=", "channel", ";", "}", "if", "(", "useClientId", ")", "{", "query", ".", "client", "=", "clientId", ";"...
Adds auth information to the query, and formats it into a URL. @param {string} path @param {Object} query @param {boolean} useClientId @return {string} The formatted URL.
[ "Adds", "auth", "information", "to", "the", "query", "and", "formats", "it", "into", "a", "URL", "." ]
1e20ccc7264e8858723dcf4971d9ad10dc9e5ff2
https://github.com/googlemaps/google-maps-services-js/blob/1e20ccc7264e8858723dcf4971d9ad10dc9e5ff2/lib/internal/make-api-call.js#L175-L198
train
hgoebl/mobile-detect.js
generate/mobile-detect.template.js
function (key) { return containsIC(this.userAgents(), key) || equalIC(key, this.os()) || equalIC(key, this.phone()) || equalIC(key, this.tablet()) || containsIC(impl.findMatches(impl.mobileDetectRules.utils, this.ua), key); ...
javascript
function (key) { return containsIC(this.userAgents(), key) || equalIC(key, this.os()) || equalIC(key, this.phone()) || equalIC(key, this.tablet()) || containsIC(impl.findMatches(impl.mobileDetectRules.utils, this.ua), key); ...
[ "function", "(", "key", ")", "{", "return", "containsIC", "(", "this", ".", "userAgents", "(", ")", ",", "key", ")", "||", "equalIC", "(", "key", ",", "this", ".", "os", "(", ")", ")", "||", "equalIC", "(", "key", ",", "this", ".", "phone", "(", ...
Global test key against userAgent, os, phone, tablet and some other properties of userAgent string. @param {String} key the key (case-insensitive) of a userAgent, an operating system, phone or tablet family.<br> For a complete list of possible values, see {@link MobileDetect#userAgent}, {@link MobileDetect#os}, {@link...
[ "Global", "test", "key", "against", "userAgent", "os", "phone", "tablet", "and", "some", "other", "properties", "of", "userAgent", "string", "." ]
565480738903b9684ee365f17c888bf9092a5ca3
https://github.com/hgoebl/mobile-detect.js/blob/565480738903b9684ee365f17c888bf9092a5ca3/generate/mobile-detect.template.js#L602-L608
train
nodeca/js-yaml
lib/js-yaml/dumper.js
isPlainSafe
function isPlainSafe(c) { // Uses a subset of nb-char - c-flow-indicator - ":" - "#" // where nb-char ::= c-printable - b-char - c-byte-order-mark. return isPrintable(c) && c !== 0xFEFF // - c-flow-indicator && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET ...
javascript
function isPlainSafe(c) { // Uses a subset of nb-char - c-flow-indicator - ":" - "#" // where nb-char ::= c-printable - b-char - c-byte-order-mark. return isPrintable(c) && c !== 0xFEFF // - c-flow-indicator && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET ...
[ "function", "isPlainSafe", "(", "c", ")", "{", "// Uses a subset of nb-char - c-flow-indicator - \":\" - \"#\"", "// where nb-char ::= c-printable - b-char - c-byte-order-mark.", "return", "isPrintable", "(", "c", ")", "&&", "c", "!==", "0xFEFF", "// - c-flow-indicator", "&&", ...
Simplified test for values allowed after the first character in plain style.
[ "Simplified", "test", "for", "values", "allowed", "after", "the", "first", "character", "in", "plain", "style", "." ]
665aadda42349dcae869f12040d9b10ef18d12da
https://github.com/nodeca/js-yaml/blob/665aadda42349dcae869f12040d9b10ef18d12da/lib/js-yaml/dumper.js#L192-L205
train
nodeca/js-yaml
lib/js-yaml/dumper.js
isPlainSafeFirst
function isPlainSafeFirst(c) { // Uses a subset of ns-char - c-indicator // where ns-char = nb-char - s-white. return isPrintable(c) && c !== 0xFEFF && !isWhitespace(c) // - s-white // - (c-indicator ::= // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” && c !== CHAR_MINUS && c !== CHAR_QUESTIO...
javascript
function isPlainSafeFirst(c) { // Uses a subset of ns-char - c-indicator // where ns-char = nb-char - s-white. return isPrintable(c) && c !== 0xFEFF && !isWhitespace(c) // - s-white // - (c-indicator ::= // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” && c !== CHAR_MINUS && c !== CHAR_QUESTIO...
[ "function", "isPlainSafeFirst", "(", "c", ")", "{", "// Uses a subset of ns-char - c-indicator", "// where ns-char = nb-char - s-white.", "return", "isPrintable", "(", "c", ")", "&&", "c", "!==", "0xFEFF", "&&", "!", "isWhitespace", "(", "c", ")", "// - s-white", "// ...
Simplified test for values allowed as the first character in plain style.
[ "Simplified", "test", "for", "values", "allowed", "as", "the", "first", "character", "in", "plain", "style", "." ]
665aadda42349dcae869f12040d9b10ef18d12da
https://github.com/nodeca/js-yaml/blob/665aadda42349dcae869f12040d9b10ef18d12da/lib/js-yaml/dumper.js#L208-L236
train
nodeca/js-yaml
examples/custom_types.js
Point
function Point(x, y, z) { this.klass = 'Point'; this.x = x; this.y = y; this.z = z; }
javascript
function Point(x, y, z) { this.klass = 'Point'; this.x = x; this.y = y; this.z = z; }
[ "function", "Point", "(", "x", ",", "y", ",", "z", ")", "{", "this", ".", "klass", "=", "'Point'", ";", "this", ".", "x", "=", "x", ";", "this", ".", "y", "=", "y", ";", "this", ".", "z", "=", "z", ";", "}" ]
Let's define a couple of classes.
[ "Let", "s", "define", "a", "couple", "of", "classes", "." ]
665aadda42349dcae869f12040d9b10ef18d12da
https://github.com/nodeca/js-yaml/blob/665aadda42349dcae869f12040d9b10ef18d12da/examples/custom_types.js#L13-L18
train
fullstackreact/google-maps-react
dist/lib/arePathsEqual.js
isValidLatLng
function isValidLatLng(elem) { return elem !== null && (typeof elem === 'undefined' ? 'undefined' : _typeof(elem)) === 'object' && elem.hasOwnProperty('lat') && elem.hasOwnProperty('lng'); }
javascript
function isValidLatLng(elem) { return elem !== null && (typeof elem === 'undefined' ? 'undefined' : _typeof(elem)) === 'object' && elem.hasOwnProperty('lat') && elem.hasOwnProperty('lng'); }
[ "function", "isValidLatLng", "(", "elem", ")", "{", "return", "elem", "!==", "null", "&&", "(", "typeof", "elem", "===", "'undefined'", "?", "'undefined'", ":", "_typeof", "(", "elem", ")", ")", "===", "'object'", "&&", "elem", ".", "hasOwnProperty", "(", ...
Helper that checks whether an array consists of objects with lat and lng properties @param {object} elem the element to check @returns {boolean} whether or not it's valid
[ "Helper", "that", "checks", "whether", "an", "array", "consists", "of", "objects", "with", "lat", "and", "lng", "properties" ]
c70a04f668b644a126071c73b392b6094a430a2a
https://github.com/fullstackreact/google-maps-react/blob/c70a04f668b644a126071c73b392b6094a430a2a/dist/lib/arePathsEqual.js#L60-L62
train
ethers-io/ethers.js
utils/units.js
commify
function commify(value) { var comps = String(value).split('.'); if (comps.length > 2 || !comps[0].match(/^-?[0-9]*$/) || (comps[1] && !comps[1].match(/^[0-9]*$/)) || value === '.' || value === '-.') { errors.throwError('invalid value', errors.INVALID_ARGUMENT, { argument: 'value', value: value }); }...
javascript
function commify(value) { var comps = String(value).split('.'); if (comps.length > 2 || !comps[0].match(/^-?[0-9]*$/) || (comps[1] && !comps[1].match(/^[0-9]*$/)) || value === '.' || value === '-.') { errors.throwError('invalid value', errors.INVALID_ARGUMENT, { argument: 'value', value: value }); }...
[ "function", "commify", "(", "value", ")", "{", "var", "comps", "=", "String", "(", "value", ")", ".", "split", "(", "'.'", ")", ";", "if", "(", "comps", ".", "length", ">", "2", "||", "!", "comps", "[", "0", "]", ".", "match", "(", "/", "^-?[0-...
Some environments have issues with RegEx that contain back-tracking, so we cannot use them.
[ "Some", "environments", "have", "issues", "with", "RegEx", "that", "contain", "back", "-", "tracking", "so", "we", "cannot", "use", "them", "." ]
04c92bb8d56658b6af6d740d21c3fb331affb9c5
https://github.com/ethers-io/ethers.js/blob/04c92bb8d56658b6af6d740d21c3fb331affb9c5/utils/units.js#L58-L94
train
ethers-io/ethers.js
contract.js
resolveAddresses
function resolveAddresses(provider, value, paramType) { if (Array.isArray(paramType)) { var promises_1 = []; paramType.forEach(function (paramType, index) { var v = null; if (Array.isArray(value)) { v = value[index]; } else { ...
javascript
function resolveAddresses(provider, value, paramType) { if (Array.isArray(paramType)) { var promises_1 = []; paramType.forEach(function (paramType, index) { var v = null; if (Array.isArray(value)) { v = value[index]; } else { ...
[ "function", "resolveAddresses", "(", "provider", ",", "value", ",", "paramType", ")", "{", "if", "(", "Array", ".", "isArray", "(", "paramType", ")", ")", "{", "var", "promises_1", "=", "[", "]", ";", "paramType", ".", "forEach", "(", "function", "(", ...
Recursively replaces ENS names with promises to resolve the name and stalls until all promises have returned @TODO: Expand this to resolve any promises too
[ "Recursively", "replaces", "ENS", "names", "with", "promises", "to", "resolve", "the", "name", "and", "stalls", "until", "all", "promises", "have", "returned" ]
04c92bb8d56658b6af6d740d21c3fb331affb9c5
https://github.com/ethers-io/ethers.js/blob/04c92bb8d56658b6af6d740d21c3fb331affb9c5/contract.js#L67-L105
train
ethers-io/ethers.js
utils/hdnode.js
HDNode
function HDNode(constructorGuard, privateKey, publicKey, parentFingerprint, chainCode, index, depth, mnemonic, path) { errors.checkNew(this, HDNode); if (constructorGuard !== _constructorGuard) { throw new Error('HDNode constructor cannot be called directly'); } if (privateKe...
javascript
function HDNode(constructorGuard, privateKey, publicKey, parentFingerprint, chainCode, index, depth, mnemonic, path) { errors.checkNew(this, HDNode); if (constructorGuard !== _constructorGuard) { throw new Error('HDNode constructor cannot be called directly'); } if (privateKe...
[ "function", "HDNode", "(", "constructorGuard", ",", "privateKey", ",", "publicKey", ",", "parentFingerprint", ",", "chainCode", ",", "index", ",", "depth", ",", "mnemonic", ",", "path", ")", "{", "errors", ".", "checkNew", "(", "this", ",", "HDNode", ")", ...
This constructor should not be called directly. Please use: - fromMnemonic - fromSeed
[ "This", "constructor", "should", "not", "be", "called", "directly", "." ]
04c92bb8d56658b6af6d740d21c3fb331affb9c5
https://github.com/ethers-io/ethers.js/blob/04c92bb8d56658b6af6d740d21c3fb331affb9c5/utils/hdnode.js#L57-L80
train
ethers-io/ethers.js
wordlists/lang-ja.js
normalize
function normalize(word) { var result = ''; for (var i = 0; i < word.length; i++) { var kana = word[i]; var target = transform[kana]; if (target === false) { continue; } if (target) { kana = target; }...
javascript
function normalize(word) { var result = ''; for (var i = 0; i < word.length; i++) { var kana = word[i]; var target = transform[kana]; if (target === false) { continue; } if (target) { kana = target; }...
[ "function", "normalize", "(", "word", ")", "{", "var", "result", "=", "''", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "word", ".", "length", ";", "i", "++", ")", "{", "var", "kana", "=", "word", "[", "i", "]", ";", "var", "target"...
Normalize words using the transform
[ "Normalize", "words", "using", "the", "transform" ]
04c92bb8d56658b6af6d740d21c3fb331affb9c5
https://github.com/ethers-io/ethers.js/blob/04c92bb8d56658b6af6d740d21c3fb331affb9c5/wordlists/lang-ja.js#L64-L78
train
ethers-io/ethers.js
wordlists/lang-ja.js
sortJapanese
function sortJapanese(a, b) { a = normalize(a); b = normalize(b); if (a < b) { return -1; } if (a > b) { return 1; } return 0; }
javascript
function sortJapanese(a, b) { a = normalize(a); b = normalize(b); if (a < b) { return -1; } if (a > b) { return 1; } return 0; }
[ "function", "sortJapanese", "(", "a", ",", "b", ")", "{", "a", "=", "normalize", "(", "a", ")", ";", "b", "=", "normalize", "(", "b", ")", ";", "if", "(", "a", "<", "b", ")", "{", "return", "-", "1", ";", "}", "if", "(", "a", ">", "b", ")...
Sort how the Japanese list is sorted
[ "Sort", "how", "the", "Japanese", "list", "is", "sorted" ]
04c92bb8d56658b6af6d740d21c3fb331affb9c5
https://github.com/ethers-io/ethers.js/blob/04c92bb8d56658b6af6d740d21c3fb331affb9c5/wordlists/lang-ja.js#L80-L90
train
ethers-io/ethers.js
utils/secret-storage.js
searchPath
function searchPath(object, path) { var currentChild = object; var comps = path.toLowerCase().split('/'); for (var i = 0; i < comps.length; i++) { // Search for a child object with a case-insensitive matching key var matchingChild = null; for (var key in currentChild) { i...
javascript
function searchPath(object, path) { var currentChild = object; var comps = path.toLowerCase().split('/'); for (var i = 0; i < comps.length; i++) { // Search for a child object with a case-insensitive matching key var matchingChild = null; for (var key in currentChild) { i...
[ "function", "searchPath", "(", "object", ",", "path", ")", "{", "var", "currentChild", "=", "object", ";", "var", "comps", "=", "path", ".", "toLowerCase", "(", ")", ".", "split", "(", "'/'", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", ...
Search an Object and its children recursively, caselessly.
[ "Search", "an", "Object", "and", "its", "children", "recursively", "caselessly", "." ]
04c92bb8d56658b6af6d740d21c3fb331affb9c5
https://github.com/ethers-io/ethers.js/blob/04c92bb8d56658b6af6d740d21c3fb331affb9c5/utils/secret-storage.js#L44-L64
train
ethers-io/ethers.js
utils/properties.js
setType
function setType(object, type) { Object.defineProperty(object, '_ethersType', { configurable: false, value: type, writable: false }); }
javascript
function setType(object, type) { Object.defineProperty(object, '_ethersType', { configurable: false, value: type, writable: false }); }
[ "function", "setType", "(", "object", ",", "type", ")", "{", "Object", ".", "defineProperty", "(", "object", ",", "'_ethersType'", ",", "{", "configurable", ":", "false", ",", "value", ":", "type", ",", "writable", ":", "false", "}", ")", ";", "}" ]
There are some issues with instanceof with npm link, so we use this to ensure types are what we expect.
[ "There", "are", "some", "issues", "with", "instanceof", "with", "npm", "link", "so", "we", "use", "this", "to", "ensure", "types", "are", "what", "we", "expect", "." ]
04c92bb8d56658b6af6d740d21c3fb331affb9c5
https://github.com/ethers-io/ethers.js/blob/04c92bb8d56658b6af6d740d21c3fb331affb9c5/utils/properties.js#L21-L23
train
googlemaps/v3-utility-library
arcgislink/src/arcgislink.js
extractString_
function extractString_(full, start, end) { var i = (start === '') ? 0 : full.indexOf(start); var e = end === '' ? full.length : full.indexOf(end, i + start.length); return full.substring(i + start.length, e); }
javascript
function extractString_(full, start, end) { var i = (start === '') ? 0 : full.indexOf(start); var e = end === '' ? full.length : full.indexOf(end, i + start.length); return full.substring(i + start.length, e); }
[ "function", "extractString_", "(", "full", ",", "start", ",", "end", ")", "{", "var", "i", "=", "(", "start", "===", "''", ")", "?", "0", ":", "full", ".", "indexOf", "(", "start", ")", ";", "var", "e", "=", "end", "===", "''", "?", "full", "."...
Extract the substring from full string, between start string and end string @param {String} full @param {String} start @param {String} end
[ "Extract", "the", "substring", "from", "full", "string", "between", "start", "string", "and", "end", "string" ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/arcgislink/src/arcgislink.js#L153-L157
train
googlemaps/v3-utility-library
arcgislink/src/arcgislink.js
augmentObject_
function augmentObject_(src, dest, force) { if (src && dest) { var p; for (p in src) { if (force || !(p in dest)) { dest[p] = src[p]; } } } return dest; }
javascript
function augmentObject_(src, dest, force) { if (src && dest) { var p; for (p in src) { if (force || !(p in dest)) { dest[p] = src[p]; } } } return dest; }
[ "function", "augmentObject_", "(", "src", ",", "dest", ",", "force", ")", "{", "if", "(", "src", "&&", "dest", ")", "{", "var", "p", ";", "for", "(", "p", "in", "src", ")", "{", "if", "(", "force", "||", "!", "(", "p", "in", "dest", ")", ")",...
Add the property of the source object to destination object if not already exists. @param {Object} dest @param {Object} src @param {Boolean} force @return {Object}
[ "Add", "the", "property", "of", "the", "source", "object", "to", "destination", "object", "if", "not", "already", "exists", "." ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/arcgislink/src/arcgislink.js#L187-L197
train
googlemaps/v3-utility-library
arcgislink/src/arcgislink.js
handleErr_
function handleErr_(errback, json) { if (errback && json && json.error) { errback(json.error); } }
javascript
function handleErr_(errback, json) { if (errback && json && json.error) { errback(json.error); } }
[ "function", "handleErr_", "(", "errback", ",", "json", ")", "{", "if", "(", "errback", "&&", "json", "&&", "json", ".", "error", ")", "{", "errback", "(", "json", ".", "error", ")", ";", "}", "}" ]
handle JSON error @param {Object} errback @param {Object} json
[ "handle", "JSON", "error" ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/arcgislink/src/arcgislink.js#L214-L218
train
googlemaps/v3-utility-library
arcgislink/src/arcgislink.js
formatTimeString_
function formatTimeString_(time, endTime) { var ret = ''; if (time) { ret += (time.getTime() - time.getTimezoneOffset() * 60000); } if (endTime) { ret += ', ' + (endTime.getTime() - endTime.getTimezoneOffset() * 60000); } return ret; }
javascript
function formatTimeString_(time, endTime) { var ret = ''; if (time) { ret += (time.getTime() - time.getTimezoneOffset() * 60000); } if (endTime) { ret += ', ' + (endTime.getTime() - endTime.getTimezoneOffset() * 60000); } return ret; }
[ "function", "formatTimeString_", "(", "time", ",", "endTime", ")", "{", "var", "ret", "=", "''", ";", "if", "(", "time", ")", "{", "ret", "+=", "(", "time", ".", "getTime", "(", ")", "-", "time", ".", "getTimezoneOffset", "(", ")", "*", "60000", ")...
get REST format for 2 time @param {Date} time @param {Date} endTime
[ "get", "REST", "format", "for", "2", "time" ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/arcgislink/src/arcgislink.js#L224-L233
train
googlemaps/v3-utility-library
arcgislink/src/arcgislink.js
setNodeOpacity_
function setNodeOpacity_(node, op) { // closure compiler removed? op = Math.min(Math.max(op, 0), 1); if (node) { var st = node.style; if (typeof st.opacity !== 'undefined') { st.opacity = op; } if (typeof st.filters !== 'undefined') { st.filters.alpha.opacity = Math.floor(100 ...
javascript
function setNodeOpacity_(node, op) { // closure compiler removed? op = Math.min(Math.max(op, 0), 1); if (node) { var st = node.style; if (typeof st.opacity !== 'undefined') { st.opacity = op; } if (typeof st.filters !== 'undefined') { st.filters.alpha.opacity = Math.floor(100 ...
[ "function", "setNodeOpacity_", "(", "node", ",", "op", ")", "{", "// closure compiler removed?\r", "op", "=", "Math", ".", "min", "(", "Math", ".", "max", "(", "op", ",", "0", ")", ",", "1", ")", ";", "if", "(", "node", ")", "{", "var", "st", "=", ...
Set opacity of a node. @param {Node} node @param {Number} 0-1
[ "Set", "opacity", "of", "a", "node", "." ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/arcgislink/src/arcgislink.js#L240-L255
train
googlemaps/v3-utility-library
arcgislink/src/arcgislink.js
getLayerDefsString_
function getLayerDefsString_(defs) { var strDefs = ''; for (var x in defs) { if (defs.hasOwnProperty(x)) { if (strDefs.length > 0) { strDefs += ';'; } strDefs += (x + ':' + defs[x]); } } return strDefs; }
javascript
function getLayerDefsString_(defs) { var strDefs = ''; for (var x in defs) { if (defs.hasOwnProperty(x)) { if (strDefs.length > 0) { strDefs += ';'; } strDefs += (x + ':' + defs[x]); } } return strDefs; }
[ "function", "getLayerDefsString_", "(", "defs", ")", "{", "var", "strDefs", "=", "''", ";", "for", "(", "var", "x", "in", "defs", ")", "{", "if", "(", "defs", ".", "hasOwnProperty", "(", "x", ")", ")", "{", "if", "(", "strDefs", ".", "length", ">",...
get the layerdef text string from an object literal @param {Object} defs
[ "get", "the", "layerdef", "text", "string", "from", "an", "object", "literal" ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/arcgislink/src/arcgislink.js#L260-L271
train
googlemaps/v3-utility-library
arcgislink/src/arcgislink.js
isOverlay_
function isOverlay_(obj) { var o = obj; if (isArray_(obj) && obj.length > 0) { o = obj[0]; } if (isArray_(o) && o.length > 0) { o = o[0]; } if (o instanceof G.LatLng || o instanceof G.Marker || o instanceof G.Polyline || o instanceof G.Polygon || o instanceof G.LatLngBounds) { ...
javascript
function isOverlay_(obj) { var o = obj; if (isArray_(obj) && obj.length > 0) { o = obj[0]; } if (isArray_(o) && o.length > 0) { o = o[0]; } if (o instanceof G.LatLng || o instanceof G.Marker || o instanceof G.Polyline || o instanceof G.Polygon || o instanceof G.LatLngBounds) { ...
[ "function", "isOverlay_", "(", "obj", ")", "{", "var", "o", "=", "obj", ";", "if", "(", "isArray_", "(", "obj", ")", "&&", "obj", ".", "length", ">", "0", ")", "{", "o", "=", "obj", "[", "0", "]", ";", "}", "if", "(", "isArray_", "(", "o", ...
Is the object an Google Overlay? @param {Object} obj @return {Boolean}
[ "Is", "the", "object", "an", "Google", "Overlay?" ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/arcgislink/src/arcgislink.js#L346-L361
train
googlemaps/v3-utility-library
arcgislink/src/arcgislink.js
fromGeometryToJSON_
function fromGeometryToJSON_(geom) { function fromPointsToJSON(pts) { var arr = []; for (var i = 0, c = pts.length; i < c; i++) { arr.push('[' + pts[i][0] + ',' + pts[i][1] + ']'); } return '[' + arr.join(',') + ']'; } function fromLinesToJSON(lines) { var arr = []; for (va...
javascript
function fromGeometryToJSON_(geom) { function fromPointsToJSON(pts) { var arr = []; for (var i = 0, c = pts.length; i < c; i++) { arr.push('[' + pts[i][0] + ',' + pts[i][1] + ']'); } return '[' + arr.join(',') + ']'; } function fromLinesToJSON(lines) { var arr = []; for (va...
[ "function", "fromGeometryToJSON_", "(", "geom", ")", "{", "function", "fromPointsToJSON", "(", "pts", ")", "{", "var", "arr", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ",", "c", "=", "pts", ".", "length", ";", "i", "<", "c", ";", "i",...
From ESRI geometry format to JSON String, primarily used in Geometry service @param {Object} geom
[ "From", "ESRI", "geometry", "format", "to", "JSON", "String", "primarily", "used", "in", "Geometry", "service" ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/arcgislink/src/arcgislink.js#L447-L477
train
googlemaps/v3-utility-library
arcgislink/src/arcgislink.js
formatRequestString_
function formatRequestString_(o) { var ret; if (typeof o === 'object') { if (isArray_(o)) { ret = []; for (var i = 0, I = o.length; i < I; i++) { ret.push(formatRequestString_(o[i])); } return '[' + ret.join(',') + ']'; } else if (isOverlay_(o)) { return fromO...
javascript
function formatRequestString_(o) { var ret; if (typeof o === 'object') { if (isArray_(o)) { ret = []; for (var i = 0, I = o.length; i < I; i++) { ret.push(formatRequestString_(o[i])); } return '[' + ret.join(',') + ']'; } else if (isOverlay_(o)) { return fromO...
[ "function", "formatRequestString_", "(", "o", ")", "{", "var", "ret", ";", "if", "(", "typeof", "o", "===", "'object'", ")", "{", "if", "(", "isArray_", "(", "o", ")", ")", "{", "ret", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ",", ...
get string as rest parameter @param {Object} o
[ "get", "string", "as", "rest", "parameter" ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/arcgislink/src/arcgislink.js#L572-L599
train
googlemaps/v3-utility-library
arcgislink/src/arcgislink.js
formatParams_
function formatParams_(params) { var query = ''; if (params) { params.f = params.f || 'json'; for (var x in params) { if (params.hasOwnProperty(x) && params[x] !== null && params[x] !== undefined) { // wont sent undefined. //jslint complaint about escape cause NN does not support it. ...
javascript
function formatParams_(params) { var query = ''; if (params) { params.f = params.f || 'json'; for (var x in params) { if (params.hasOwnProperty(x) && params[x] !== null && params[x] !== undefined) { // wont sent undefined. //jslint complaint about escape cause NN does not support it. ...
[ "function", "formatParams_", "(", "params", ")", "{", "var", "query", "=", "''", ";", "if", "(", "params", ")", "{", "params", ".", "f", "=", "params", ".", "f", "||", "'json'", ";", "for", "(", "var", "x", "in", "params", ")", "{", "if", "(", ...
Format params to URL string @param {Object} params
[ "Format", "params", "to", "URL", "string" ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/arcgislink/src/arcgislink.js#L674-L687
train
googlemaps/v3-utility-library
arcgislink/src/arcgislink.js
callback_
function callback_(fn, obj) { var args = []; for (var i = 2, c = arguments.length; i < c; i++) { args.push(arguments[i]); } return function() { fn.apply(obj, args); }; }
javascript
function callback_(fn, obj) { var args = []; for (var i = 2, c = arguments.length; i < c; i++) { args.push(arguments[i]); } return function() { fn.apply(obj, args); }; }
[ "function", "callback_", "(", "fn", ",", "obj", ")", "{", "var", "args", "=", "[", "]", ";", "for", "(", "var", "i", "=", "2", ",", "c", "=", "arguments", ".", "length", ";", "i", "<", "c", ";", "i", "++", ")", "{", "args", ".", "push", "("...
create a callback closure @private @param {Object} fn @param {Object} obj
[ "create", "a", "callback", "closure" ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/arcgislink/src/arcgislink.js#L694-L702
train
googlemaps/v3-utility-library
arcgislink/src/arcgislink.js
setCopyrightInfo_
function setCopyrightInfo_(map) { var div = null; if (map) { var mvc = map.controls[G.ControlPosition.BOTTOM_RIGHT]; if (mvc) { for (var i = 0, c = mvc.getLength(); i < c; i++) { if (mvc.getAt(i).id === 'agsCopyrights') { div = mvc.getAt(i); break; } ...
javascript
function setCopyrightInfo_(map) { var div = null; if (map) { var mvc = map.controls[G.ControlPosition.BOTTOM_RIGHT]; if (mvc) { for (var i = 0, c = mvc.getLength(); i < c; i++) { if (mvc.getAt(i).id === 'agsCopyrights') { div = mvc.getAt(i); break; } ...
[ "function", "setCopyrightInfo_", "(", "map", ")", "{", "var", "div", "=", "null", ";", "if", "(", "map", ")", "{", "var", "mvc", "=", "map", ".", "controls", "[", "G", ".", "ControlPosition", ".", "BOTTOM_RIGHT", "]", ";", "if", "(", "mvc", ")", "{...
Find copyright control in the map @param {Object} map
[ "Find", "copyright", "control", "in", "the", "map" ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/arcgislink/src/arcgislink.js#L716-L772
train
googlemaps/v3-utility-library
arcgislink/examples/simpleags.js
updateTOC
function updateTOC() { if (ov && svc.hasLoaded()) { var toc = ''; var scale = 591657527.591555 / (Math.pow(2, map.getZoom()));//591657527.591555 is the scale at level 0 var layers = svc.layers; for (var i = 0; i < layers.length; i++) { var layer = layers[i]; var inScale = layer.isIn...
javascript
function updateTOC() { if (ov && svc.hasLoaded()) { var toc = ''; var scale = 591657527.591555 / (Math.pow(2, map.getZoom()));//591657527.591555 is the scale at level 0 var layers = svc.layers; for (var i = 0; i < layers.length; i++) { var layer = layers[i]; var inScale = layer.isIn...
[ "function", "updateTOC", "(", ")", "{", "if", "(", "ov", "&&", "svc", ".", "hasLoaded", "(", ")", ")", "{", "var", "toc", "=", "''", ";", "var", "scale", "=", "591657527.591555", "/", "(", "Math", ".", "pow", "(", "2", ",", "map", ".", "getZoom",...
Create layer list.
[ "Create", "layer", "list", "." ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/arcgislink/examples/simpleags.js#L89-L118
train
googlemaps/v3-utility-library
arcgislink/examples/simpleags.js
setLayerVisibility
function setLayerVisibility() { var layers = svc.layers; for (var i = 0; i < layers.length; i++) { var el = document.getElementById('layer' + layers[i].id); if (el) { layers[i].visible = (el.checked === true); } } ov.refresh(); }
javascript
function setLayerVisibility() { var layers = svc.layers; for (var i = 0; i < layers.length; i++) { var el = document.getElementById('layer' + layers[i].id); if (el) { layers[i].visible = (el.checked === true); } } ov.refresh(); }
[ "function", "setLayerVisibility", "(", ")", "{", "var", "layers", "=", "svc", ".", "layers", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "layers", ".", "length", ";", "i", "++", ")", "{", "var", "el", "=", "document", ".", "getElementById...
Check the visibility of layers and refresh map
[ "Check", "the", "visibility", "of", "layers", "and", "refresh", "map" ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/arcgislink/examples/simpleags.js#L123-L132
train
googlemaps/v3-utility-library
ExtDraggableObject/src/ExtDraggableObject.js
mouseMove_
function mouseMove_(ev) { var e=ev||event; currentX_ = formerX_+((e.pageX||(e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft))-formerMouseX_); currentY_ = formerY_+((e.pageY||(e.clientY+document.body.scrollTop+document.documentElement.scrollTop))-formerMouseY_); formerX_ = curr...
javascript
function mouseMove_(ev) { var e=ev||event; currentX_ = formerX_+((e.pageX||(e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft))-formerMouseX_); currentY_ = formerY_+((e.pageY||(e.clientY+document.body.scrollTop+document.documentElement.scrollTop))-formerMouseY_); formerX_ = curr...
[ "function", "mouseMove_", "(", "ev", ")", "{", "var", "e", "=", "ev", "||", "event", ";", "currentX_", "=", "formerX_", "+", "(", "(", "e", ".", "pageX", "||", "(", "e", ".", "clientX", "+", "document", ".", "body", ".", "scrollLeft", "+", "documen...
Handles the mousemove event. @param {event} ev The event data sent by the browser. @private
[ "Handles", "the", "mousemove", "event", "." ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/ExtDraggableObject/src/ExtDraggableObject.js#L131-L143
train
googlemaps/v3-utility-library
ExtDraggableObject/src/ExtDraggableObject.js
mouseDown_
function mouseDown_(ev) { var e=ev||event; setCursor_(true); event_.trigger(me, "mousedown", e); if (src.style.position !== "absolute") { src.style.position = "absolute"; return; } formerMouseX_ = e.pageX||(e.clientX+document.body.scrollLeft+document.documentElement.scrollLef...
javascript
function mouseDown_(ev) { var e=ev||event; setCursor_(true); event_.trigger(me, "mousedown", e); if (src.style.position !== "absolute") { src.style.position = "absolute"; return; } formerMouseX_ = e.pageX||(e.clientX+document.body.scrollLeft+document.documentElement.scrollLef...
[ "function", "mouseDown_", "(", "ev", ")", "{", "var", "e", "=", "ev", "||", "event", ";", "setCursor_", "(", "true", ")", ";", "event_", ".", "trigger", "(", "me", ",", "\"mousedown\"", ",", "e", ")", ";", "if", "(", "src", ".", "style", ".", "po...
Handles the mousedown event. @param {event} ev The event data sent by the browser. @private
[ "Handles", "the", "mousedown", "event", "." ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/ExtDraggableObject/src/ExtDraggableObject.js#L150-L177
train
googlemaps/v3-utility-library
ExtDraggableObject/src/ExtDraggableObject.js
mouseUp_
function mouseUp_(ev) { var e=ev||event; if (moving_) { setCursor_(false); event_.removeListener(mouseMoveEvent_); if (src.releaseCapture) { src.releaseCapture(); } moving_ = false; event_.trigger(me, "dragend", {mouseX: formerMouseX_, mouseY: formerMouseY_, ...
javascript
function mouseUp_(ev) { var e=ev||event; if (moving_) { setCursor_(false); event_.removeListener(mouseMoveEvent_); if (src.releaseCapture) { src.releaseCapture(); } moving_ = false; event_.trigger(me, "dragend", {mouseX: formerMouseX_, mouseY: formerMouseY_, ...
[ "function", "mouseUp_", "(", "ev", ")", "{", "var", "e", "=", "ev", "||", "event", ";", "if", "(", "moving_", ")", "{", "setCursor_", "(", "false", ")", ";", "event_", ".", "removeListener", "(", "mouseMoveEvent_", ")", ";", "if", "(", "src", ".", ...
Handles the mouseup event. @param {event} ev The event data sent by the browser. @private
[ "Handles", "the", "mouseup", "event", "." ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/ExtDraggableObject/src/ExtDraggableObject.js#L184-L197
train
googlemaps/v3-utility-library
infobox/src/infobox.js
function (e) { e.returnValue = false; if (e.preventDefault) { e.preventDefault(); } if (!me.enableEventPropagation_) { cancelHandler(e); } }
javascript
function (e) { e.returnValue = false; if (e.preventDefault) { e.preventDefault(); } if (!me.enableEventPropagation_) { cancelHandler(e); } }
[ "function", "(", "e", ")", "{", "e", ".", "returnValue", "=", "false", ";", "if", "(", "e", ".", "preventDefault", ")", "{", "e", ".", "preventDefault", "(", ")", ";", "}", "if", "(", "!", "me", ".", "enableEventPropagation_", ")", "{", "cancelHandle...
This handler ignores the current event in the InfoBox and conditionally prevents the event from being passed on to the map. It is used for the contextmenu event.
[ "This", "handler", "ignores", "the", "current", "event", "in", "the", "InfoBox", "and", "conditionally", "prevents", "the", "event", "from", "being", "passed", "on", "to", "the", "map", ".", "It", "is", "used", "for", "the", "contextmenu", "event", "." ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/infobox/src/infobox.js#L153-L166
train
googlemaps/v3-utility-library
util/docs/template/publish.js
isaTopLevelObject
function isaTopLevelObject($) {return ( ($.is("CONSTRUCTOR") && $.name.match(/^[A-Z][A-Za-z]+/)) || ($.is("FUNCTION") && $.name.match(/^[A-Z][A-Za-z]+/)) || $.comment.getTag("enum")[0] || $.comment.getTag("interface")[0] || $.isNamespace );}
javascript
function isaTopLevelObject($) {return ( ($.is("CONSTRUCTOR") && $.name.match(/^[A-Z][A-Za-z]+/)) || ($.is("FUNCTION") && $.name.match(/^[A-Z][A-Za-z]+/)) || $.comment.getTag("enum")[0] || $.comment.getTag("interface")[0] || $.isNamespace );}
[ "function", "isaTopLevelObject", "(", "$", ")", "{", "return", "(", "(", "$", ".", "is", "(", "\"CONSTRUCTOR\"", ")", "&&", "$", ".", "name", ".", "match", "(", "/", "^[A-Z][A-Za-z]+", "/", ")", ")", "||", "(", "$", ".", "is", "(", "\"FUNCTION\"", ...
Find the top-level objects - class, enum, function, interface, namespace
[ "Find", "the", "top", "-", "level", "objects", "-", "class", "enum", "function", "interface", "namespace" ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/util/docs/template/publish.js#L26-L32
train
googlemaps/v3-utility-library
util/docs/template/publish.js
isaSecondLevelObject
function isaSecondLevelObject ($) {return ( $.comment.getTag("property").length || ($.is("CONSTRUCTOR") && $.name.match(/^[A-Z][A-Za-z]+$/)) || ($.is("FUNCTION") && $.name.match(/^[a-z][A-Za-z]+$/)) || $.isConstant || ($.type == "Function" && $.is("OBJECT")) );}
javascript
function isaSecondLevelObject ($) {return ( $.comment.getTag("property").length || ($.is("CONSTRUCTOR") && $.name.match(/^[A-Z][A-Za-z]+$/)) || ($.is("FUNCTION") && $.name.match(/^[a-z][A-Za-z]+$/)) || $.isConstant || ($.type == "Function" && $.is("OBJECT")) );}
[ "function", "isaSecondLevelObject", "(", "$", ")", "{", "return", "(", "$", ".", "comment", ".", "getTag", "(", "\"property\"", ")", ".", "length", "||", "(", "$", ".", "is", "(", "\"CONSTRUCTOR\"", ")", "&&", "$", ".", "name", ".", "match", "(", "/"...
Find the second-level objects - Properties, Constructor, Methods, Constants, Events
[ "Find", "the", "second", "-", "level", "objects", "-", "Properties", "Constructor", "Methods", "Constants", "Events" ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/util/docs/template/publish.js#L35-L41
train
googlemaps/v3-utility-library
markerclusterer/src/markerclusterer.js
Cluster
function Cluster(markerClusterer) { this.markerClusterer_ = markerClusterer; this.map_ = markerClusterer.getMap(); this.gridSize_ = markerClusterer.getGridSize(); this.minClusterSize_ = markerClusterer.getMinClusterSize(); this.averageCenter_ = markerClusterer.isAverageCenter(); this.center_ = null; this....
javascript
function Cluster(markerClusterer) { this.markerClusterer_ = markerClusterer; this.map_ = markerClusterer.getMap(); this.gridSize_ = markerClusterer.getGridSize(); this.minClusterSize_ = markerClusterer.getMinClusterSize(); this.averageCenter_ = markerClusterer.isAverageCenter(); this.center_ = null; this....
[ "function", "Cluster", "(", "markerClusterer", ")", "{", "this", ".", "markerClusterer_", "=", "markerClusterer", ";", "this", ".", "map_", "=", "markerClusterer", ".", "getMap", "(", ")", ";", "this", ".", "gridSize_", "=", "markerClusterer", ".", "getGridSiz...
A cluster that contains markers. @param {MarkerClusterer} markerClusterer The markerclusterer that this cluster is associated with. @constructor @ignore
[ "A", "cluster", "that", "contains", "markers", "." ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/markerclusterer/src/markerclusterer.js#L817-L828
train
googlemaps/v3-utility-library
markerclusterer/src/markerclusterer.js
ClusterIcon
function ClusterIcon(cluster, styles, opt_padding) { cluster.getMarkerClusterer().extend(ClusterIcon, google.maps.OverlayView); this.styles_ = styles; this.padding_ = opt_padding || 0; this.cluster_ = cluster; this.center_ = null; this.map_ = cluster.getMap(); this.div_ = null; this.sums_ = null; thi...
javascript
function ClusterIcon(cluster, styles, opt_padding) { cluster.getMarkerClusterer().extend(ClusterIcon, google.maps.OverlayView); this.styles_ = styles; this.padding_ = opt_padding || 0; this.cluster_ = cluster; this.center_ = null; this.map_ = cluster.getMap(); this.div_ = null; this.sums_ = null; thi...
[ "function", "ClusterIcon", "(", "cluster", ",", "styles", ",", "opt_padding", ")", "{", "cluster", ".", "getMarkerClusterer", "(", ")", ".", "extend", "(", "ClusterIcon", ",", "google", ".", "maps", ".", "OverlayView", ")", ";", "this", ".", "styles_", "="...
A cluster icon @param {Cluster} cluster The cluster to be associated with. @param {Object} styles An object that has style properties: 'url': (string) The image url. 'height': (number) The image height. 'width': (number) The image width. 'anchor': (Array) The anchor position of the label text. 'textColor': (string) Th...
[ "A", "cluster", "icon" ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/markerclusterer/src/markerclusterer.js#L1042-L1055
train
googlemaps/v3-utility-library
markerclustererplus/src/markerclusterer.js
Cluster
function Cluster(mc) { this.markerClusterer_ = mc; this.map_ = mc.getMap(); this.gridSize_ = mc.getGridSize(); this.minClusterSize_ = mc.getMinimumClusterSize(); this.averageCenter_ = mc.getAverageCenter(); this.markers_ = []; this.center_ = null; this.bounds_ = null; this.clusterIcon_ = new ClusterIc...
javascript
function Cluster(mc) { this.markerClusterer_ = mc; this.map_ = mc.getMap(); this.gridSize_ = mc.getGridSize(); this.minClusterSize_ = mc.getMinimumClusterSize(); this.averageCenter_ = mc.getAverageCenter(); this.markers_ = []; this.center_ = null; this.bounds_ = null; this.clusterIcon_ = new ClusterIc...
[ "function", "Cluster", "(", "mc", ")", "{", "this", ".", "markerClusterer_", "=", "mc", ";", "this", ".", "map_", "=", "mc", ".", "getMap", "(", ")", ";", "this", ".", "gridSize_", "=", "mc", ".", "getGridSize", "(", ")", ";", "this", ".", "minClus...
Creates a single cluster that manages a group of proximate markers. Used internally, do not call this constructor directly. @constructor @param {MarkerClusterer} mc The <code>MarkerClusterer</code> object with which this cluster is associated.
[ "Creates", "a", "single", "cluster", "that", "manages", "a", "group", "of", "proximate", "markers", ".", "Used", "internally", "do", "not", "call", "this", "constructor", "directly", "." ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/markerclustererplus/src/markerclusterer.js#L372-L382
train
googlemaps/v3-utility-library
arcgislink/examples/find.js
find
function find(q) { removeOverlays(); if (iw) iw.close(); document.getElementById('results').innerHTML = ''; var exact = document.getElementById('exact').checked; var params = { returnGeometry: true, searchText: q, contains: !exact, layerIds: [0, 2], // city, state searchFie...
javascript
function find(q) { removeOverlays(); if (iw) iw.close(); document.getElementById('results').innerHTML = ''; var exact = document.getElementById('exact').checked; var params = { returnGeometry: true, searchText: q, contains: !exact, layerIds: [0, 2], // city, state searchFie...
[ "function", "find", "(", "q", ")", "{", "removeOverlays", "(", ")", ";", "if", "(", "iw", ")", "iw", ".", "close", "(", ")", ";", "document", ".", "getElementById", "(", "'results'", ")", ".", "innerHTML", "=", "''", ";", "var", "exact", "=", "docu...
find results ...
[ "find", "results", "..." ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/arcgislink/examples/find.js#L24-L39
train
googlemaps/v3-utility-library
keydragzoom/src/keydragzoom.js
function (h) { var computedStyle; var bw = {}; if (document.defaultView && document.defaultView.getComputedStyle) { computedStyle = h.ownerDocument.defaultView.getComputedStyle(h, ""); if (computedStyle) { // The computed styles are always in pixel units (good!) bw.top = p...
javascript
function (h) { var computedStyle; var bw = {}; if (document.defaultView && document.defaultView.getComputedStyle) { computedStyle = h.ownerDocument.defaultView.getComputedStyle(h, ""); if (computedStyle) { // The computed styles are always in pixel units (good!) bw.top = p...
[ "function", "(", "h", ")", "{", "var", "computedStyle", ";", "var", "bw", "=", "{", "}", ";", "if", "(", "document", ".", "defaultView", "&&", "document", ".", "defaultView", ".", "getComputedStyle", ")", "{", "computedStyle", "=", "h", ".", "ownerDocume...
Get the widths of the borders of an HTML element. @param {Node} h The HTML element. @return {Object} The width object {top, bottom left, right}.
[ "Get", "the", "widths", "of", "the", "borders", "of", "an", "HTML", "element", "." ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/keydragzoom/src/keydragzoom.js#L71-L100
train
googlemaps/v3-utility-library
keydragzoom/src/keydragzoom.js
function (e) { var posX = 0, posY = 0; e = e || window.event; if (typeof e.pageX !== "undefined") { posX = e.pageX; posY = e.pageY; } else if (typeof e.clientX !== "undefined") { // MSIE posX = e.clientX + scroll.x; posY = e.clientY + scroll.y; } return { ...
javascript
function (e) { var posX = 0, posY = 0; e = e || window.event; if (typeof e.pageX !== "undefined") { posX = e.pageX; posY = e.pageY; } else if (typeof e.clientX !== "undefined") { // MSIE posX = e.clientX + scroll.x; posY = e.clientY + scroll.y; } return { ...
[ "function", "(", "e", ")", "{", "var", "posX", "=", "0", ",", "posY", "=", "0", ";", "e", "=", "e", "||", "window", ".", "event", ";", "if", "(", "typeof", "e", ".", "pageX", "!==", "\"undefined\"", ")", "{", "posX", "=", "e", ".", "pageX", "...
Get the position of the mouse relative to the document. @param {Event} e The mouse event. @return {Object} The position object {left, top}.
[ "Get", "the", "position", "of", "the", "mouse", "relative", "to", "the", "document", "." ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/keydragzoom/src/keydragzoom.js#L120-L134
train
googlemaps/v3-utility-library
keydragzoom/src/keydragzoom.js
function (h) { var posX = h.offsetLeft; var posY = h.offsetTop; var parent = h.offsetParent; // Add offsets for all ancestors in the hierarchy while (parent !== null) { // Adjust for scrolling elements which may affect the map position. // // See http://www.howtocreate.co.u...
javascript
function (h) { var posX = h.offsetLeft; var posY = h.offsetTop; var parent = h.offsetParent; // Add offsets for all ancestors in the hierarchy while (parent !== null) { // Adjust for scrolling elements which may affect the map position. // // See http://www.howtocreate.co.u...
[ "function", "(", "h", ")", "{", "var", "posX", "=", "h", ".", "offsetLeft", ";", "var", "posY", "=", "h", ".", "offsetTop", ";", "var", "parent", "=", "h", ".", "offsetParent", ";", "// Add offsets for all ancestors in the hierarchy\r", "while", "(", "parent...
Get the position of an HTML element relative to the document. @param {Node} h The HTML element. @return {Object} The position object {left, top}.
[ "Get", "the", "position", "of", "an", "HTML", "element", "relative", "to", "the", "document", "." ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/keydragzoom/src/keydragzoom.js#L140-L183
train
googlemaps/v3-utility-library
keydragzoom/src/keydragzoom.js
function (obj, vals) { if (obj && vals) { for (var x in vals) { if (vals.hasOwnProperty(x)) { obj[x] = vals[x]; } } } return obj; }
javascript
function (obj, vals) { if (obj && vals) { for (var x in vals) { if (vals.hasOwnProperty(x)) { obj[x] = vals[x]; } } } return obj; }
[ "function", "(", "obj", ",", "vals", ")", "{", "if", "(", "obj", "&&", "vals", ")", "{", "for", "(", "var", "x", "in", "vals", ")", "{", "if", "(", "vals", ".", "hasOwnProperty", "(", "x", ")", ")", "{", "obj", "[", "x", "]", "=", "vals", "...
Set the properties of an object to those from another object. @param {Object} obj The target object. @param {Object} vals The source object.
[ "Set", "the", "properties", "of", "an", "object", "to", "those", "from", "another", "object", "." ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/keydragzoom/src/keydragzoom.js#L189-L198
train
googlemaps/v3-utility-library
keydragzoom/src/keydragzoom.js
function (h, op) { if (typeof op !== "undefined") { h.style.opacity = op; } if (typeof h.style.opacity !== "undefined" && h.style.opacity !== "") { h.style.filter = "alpha(opacity=" + (h.style.opacity * 100) + ")"; } }
javascript
function (h, op) { if (typeof op !== "undefined") { h.style.opacity = op; } if (typeof h.style.opacity !== "undefined" && h.style.opacity !== "") { h.style.filter = "alpha(opacity=" + (h.style.opacity * 100) + ")"; } }
[ "function", "(", "h", ",", "op", ")", "{", "if", "(", "typeof", "op", "!==", "\"undefined\"", ")", "{", "h", ".", "style", ".", "opacity", "=", "op", ";", "}", "if", "(", "typeof", "h", ".", "style", ".", "opacity", "!==", "\"undefined\"", "&&", ...
Set the opacity. If op is not passed in, this function just performs an MSIE fix. @param {Node} h The HTML element. @param {number} op The opacity value (0-1).
[ "Set", "the", "opacity", ".", "If", "op", "is", "not", "passed", "in", "this", "function", "just", "performs", "an", "MSIE", "fix", "." ]
66d4921aba3c0d5aa24d5998e485f46c34a6db27
https://github.com/googlemaps/v3-utility-library/blob/66d4921aba3c0d5aa24d5998e485f46c34a6db27/keydragzoom/src/keydragzoom.js#L204-L211
train
Flipboard/react-canvas
examples/common/touch-emulator.js
Touch
function Touch(target, identifier, pos, deltaX, deltaY) { deltaX = deltaX || 0; deltaY = deltaY || 0; this.identifier = identifier; this.target = target; this.clientX = pos.clientX + deltaX; this.clientY = pos.clientY + deltaY; this.screenX = pos.screenX + deltaX...
javascript
function Touch(target, identifier, pos, deltaX, deltaY) { deltaX = deltaX || 0; deltaY = deltaY || 0; this.identifier = identifier; this.target = target; this.clientX = pos.clientX + deltaX; this.clientY = pos.clientY + deltaY; this.screenX = pos.screenX + deltaX...
[ "function", "Touch", "(", "target", ",", "identifier", ",", "pos", ",", "deltaX", ",", "deltaY", ")", "{", "deltaX", "=", "deltaX", "||", "0", ";", "deltaY", "=", "deltaY", "||", "0", ";", "this", ".", "identifier", "=", "identifier", ";", "this", "....
create an touch point @constructor @param target @param identifier @param pos @param deltaX @param deltaY @returns {Object} touchPoint
[ "create", "an", "touch", "point" ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/examples/common/touch-emulator.js#L52-L64
train
Flipboard/react-canvas
examples/common/touch-emulator.js
fakeTouchSupport
function fakeTouchSupport() { var objs = [window, document.documentElement]; var props = ['ontouchstart', 'ontouchmove', 'ontouchcancel', 'ontouchend']; for(var o=0; o<objs.length; o++) { for(var p=0; p<props.length; p++) { if(objs[o] && objs[o][props[p]] == undefine...
javascript
function fakeTouchSupport() { var objs = [window, document.documentElement]; var props = ['ontouchstart', 'ontouchmove', 'ontouchcancel', 'ontouchend']; for(var o=0; o<objs.length; o++) { for(var p=0; p<props.length; p++) { if(objs[o] && objs[o][props[p]] == undefine...
[ "function", "fakeTouchSupport", "(", ")", "{", "var", "objs", "=", "[", "window", ",", "document", ".", "documentElement", "]", ";", "var", "props", "=", "[", "'ontouchstart'", ",", "'ontouchmove'", ",", "'ontouchcancel'", ",", "'ontouchend'", "]", ";", "for...
Simple trick to fake touch event support this is enough for most libraries like Modernizr and Hammer
[ "Simple", "trick", "to", "fake", "touch", "event", "support", "this", "is", "enough", "for", "most", "libraries", "like", "Modernizr", "and", "Hammer" ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/examples/common/touch-emulator.js#L91-L102
train
Flipboard/react-canvas
examples/common/touch-emulator.js
hasTouchSupport
function hasTouchSupport() { return ("ontouchstart" in window) || // touch events (window.Modernizr && window.Modernizr.touch) || // modernizr (navigator.msMaxTouchPoints || navigator.maxTouchPoints) > 2; // pointer events }
javascript
function hasTouchSupport() { return ("ontouchstart" in window) || // touch events (window.Modernizr && window.Modernizr.touch) || // modernizr (navigator.msMaxTouchPoints || navigator.maxTouchPoints) > 2; // pointer events }
[ "function", "hasTouchSupport", "(", ")", "{", "return", "(", "\"ontouchstart\"", "in", "window", ")", "||", "// touch events", "(", "window", ".", "Modernizr", "&&", "window", ".", "Modernizr", ".", "touch", ")", "||", "// modernizr", "(", "navigator", ".", ...
we don't have to emulate on a touch device @returns {boolean}
[ "we", "don", "t", "have", "to", "emulate", "on", "a", "touch", "device" ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/examples/common/touch-emulator.js#L108-L112
train
Flipboard/react-canvas
examples/common/touch-emulator.js
getActiveTouches
function getActiveTouches(mouseEv, eventName) { // empty list if (mouseEv.type == 'mouseup') { return new TouchList(); } var touchList = createTouchList(mouseEv); if(isMultiTouch && mouseEv.type != 'mouseup' && eventName == 'touchend') { touchList.splice(...
javascript
function getActiveTouches(mouseEv, eventName) { // empty list if (mouseEv.type == 'mouseup') { return new TouchList(); } var touchList = createTouchList(mouseEv); if(isMultiTouch && mouseEv.type != 'mouseup' && eventName == 'touchend') { touchList.splice(...
[ "function", "getActiveTouches", "(", "mouseEv", ",", "eventName", ")", "{", "// empty list", "if", "(", "mouseEv", ".", "type", "==", "'mouseup'", ")", "{", "return", "new", "TouchList", "(", ")", ";", "}", "var", "touchList", "=", "createTouchList", "(", ...
receive all active touches @param mouseEv @returns {TouchList}
[ "receive", "all", "active", "touches" ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/examples/common/touch-emulator.js#L223-L234
train
Flipboard/react-canvas
examples/common/touch-emulator.js
getChangedTouches
function getChangedTouches(mouseEv, eventName) { var touchList = createTouchList(mouseEv); // we only want to return the added/removed item on multitouch // which is the second pointer, so remove the first pointer from the touchList // // but when the mouseEv.type is mouseup, we...
javascript
function getChangedTouches(mouseEv, eventName) { var touchList = createTouchList(mouseEv); // we only want to return the added/removed item on multitouch // which is the second pointer, so remove the first pointer from the touchList // // but when the mouseEv.type is mouseup, we...
[ "function", "getChangedTouches", "(", "mouseEv", ",", "eventName", ")", "{", "var", "touchList", "=", "createTouchList", "(", "mouseEv", ")", ";", "// we only want to return the added/removed item on multitouch", "// which is the second pointer, so remove the first pointer from the...
receive a filtered set of touches with only the changed pointers @param mouseEv @param eventName @returns {TouchList}
[ "receive", "a", "filtered", "set", "of", "touches", "with", "only", "the", "changed", "pointers" ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/examples/common/touch-emulator.js#L242-L256
train
Flipboard/react-canvas
examples/common/touch-emulator.js
showTouches
function showTouches(ev) { var touch, i, el, styles; // first all visible touches for(i = 0; i < ev.touches.length; i++) { touch = ev.touches[i]; el = touchElements[touch.identifier]; if(!el) { el = touchElements[touch.identifier] = document.c...
javascript
function showTouches(ev) { var touch, i, el, styles; // first all visible touches for(i = 0; i < ev.touches.length; i++) { touch = ev.touches[i]; el = touchElements[touch.identifier]; if(!el) { el = touchElements[touch.identifier] = document.c...
[ "function", "showTouches", "(", "ev", ")", "{", "var", "touch", ",", "i", ",", "el", ",", "styles", ";", "// first all visible touches", "for", "(", "i", "=", "0", ";", "i", "<", "ev", ".", "touches", ".", "length", ";", "i", "++", ")", "{", "touch...
show the touchpoints on the screen
[ "show", "the", "touchpoints", "on", "the", "screen" ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/examples/common/touch-emulator.js#L261-L290
train
Flipboard/react-canvas
lib/FrameUtils.js
make
function make (x, y, width, height) { return new Frame(x, y, width, height); }
javascript
function make (x, y, width, height) { return new Frame(x, y, width, height); }
[ "function", "make", "(", "x", ",", "y", ",", "width", ",", "height", ")", "{", "return", "new", "Frame", "(", "x", ",", "y", ",", "width", ",", "height", ")", ";", "}" ]
Get a frame object @param {Number} x @param {Number} y @param {Number} width @param {Number} height @return {Frame}
[ "Get", "a", "frame", "object" ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/lib/FrameUtils.js#L19-L21
train
Flipboard/react-canvas
lib/FrameUtils.js
clone
function clone (frame) { return make(frame.x, frame.y, frame.width, frame.height); }
javascript
function clone (frame) { return make(frame.x, frame.y, frame.width, frame.height); }
[ "function", "clone", "(", "frame", ")", "{", "return", "make", "(", "frame", ".", "x", ",", "frame", ".", "y", ",", "frame", ".", "width", ",", "frame", ".", "height", ")", ";", "}" ]
Return a cloned frame @param {Frame} frame @return {Frame}
[ "Return", "a", "cloned", "frame" ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/lib/FrameUtils.js#L38-L40
train
Flipboard/react-canvas
lib/FrameUtils.js
intersection
function intersection (frame, otherFrame) { var x = Math.max(frame.x, otherFrame.x); var width = Math.min(frame.x + frame.width, otherFrame.x + otherFrame.width); var y = Math.max(frame.y, otherFrame.y); var height = Math.min(frame.y + frame.height, otherFrame.y + otherFrame.height); if (width >= x && height ...
javascript
function intersection (frame, otherFrame) { var x = Math.max(frame.x, otherFrame.x); var width = Math.min(frame.x + frame.width, otherFrame.x + otherFrame.width); var y = Math.max(frame.y, otherFrame.y); var height = Math.min(frame.y + frame.height, otherFrame.y + otherFrame.height); if (width >= x && height ...
[ "function", "intersection", "(", "frame", ",", "otherFrame", ")", "{", "var", "x", "=", "Math", ".", "max", "(", "frame", ".", "x", ",", "otherFrame", ".", "x", ")", ";", "var", "width", "=", "Math", ".", "min", "(", "frame", ".", "x", "+", "fram...
Compute the intersection region between 2 frames. @param {Frame} frame @param {Frame} otherFrame @return {Frame}
[ "Compute", "the", "intersection", "region", "between", "2", "frames", "." ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/lib/FrameUtils.js#L82-L91
train
Flipboard/react-canvas
lib/FrameUtils.js
union
function union (frame, otherFrame) { var x1 = Math.min(frame.x, otherFrame.x); var x2 = Math.max(frame.x + frame.width, otherFrame.x + otherFrame.width); var y1 = Math.min(frame.y, otherFrame.y); var y2 = Math.max(frame.y + frame.height, otherFrame.y + otherFrame.height); return make(x1, y1, x2 - x1, y2 - y1)...
javascript
function union (frame, otherFrame) { var x1 = Math.min(frame.x, otherFrame.x); var x2 = Math.max(frame.x + frame.width, otherFrame.x + otherFrame.width); var y1 = Math.min(frame.y, otherFrame.y); var y2 = Math.max(frame.y + frame.height, otherFrame.y + otherFrame.height); return make(x1, y1, x2 - x1, y2 - y1)...
[ "function", "union", "(", "frame", ",", "otherFrame", ")", "{", "var", "x1", "=", "Math", ".", "min", "(", "frame", ".", "x", ",", "otherFrame", ".", "x", ")", ";", "var", "x2", "=", "Math", ".", "max", "(", "frame", ".", "x", "+", "frame", "."...
Compute the union of two frames @param {Frame} frame @param {Frame} otherFrame @return {Frame}
[ "Compute", "the", "union", "of", "two", "frames" ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/lib/FrameUtils.js#L100-L106
train
Flipboard/react-canvas
lib/FrameUtils.js
intersects
function intersects (frame, otherFrame) { return !(otherFrame.x > frame.x + frame.width || otherFrame.x + otherFrame.width < frame.x || otherFrame.y > frame.y + frame.height || otherFrame.y + otherFrame.height < frame.y); }
javascript
function intersects (frame, otherFrame) { return !(otherFrame.x > frame.x + frame.width || otherFrame.x + otherFrame.width < frame.x || otherFrame.y > frame.y + frame.height || otherFrame.y + otherFrame.height < frame.y); }
[ "function", "intersects", "(", "frame", ",", "otherFrame", ")", "{", "return", "!", "(", "otherFrame", ".", "x", ">", "frame", ".", "x", "+", "frame", ".", "width", "||", "otherFrame", ".", "x", "+", "otherFrame", ".", "width", "<", "frame", ".", "x"...
Determine if 2 frames intersect each other @param {Frame} frame @param {Frame} otherFrame @return {Boolean}
[ "Determine", "if", "2", "frames", "intersect", "each", "other" ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/lib/FrameUtils.js#L115-L120
train
Flipboard/react-canvas
lib/ImageCache.js
function (hash, data) { this.length++; this.elements[hash] = { hash: hash, // Helps identifying freq: 0, data: data }; }
javascript
function (hash, data) { this.length++; this.elements[hash] = { hash: hash, // Helps identifying freq: 0, data: data }; }
[ "function", "(", "hash", ",", "data", ")", "{", "this", ".", "length", "++", ";", "this", ".", "elements", "[", "hash", "]", "=", "{", "hash", ":", "hash", ",", "// Helps identifying ", "freq", ":", "0", ",", "data", ":", "data", "}", ";", "}" ]
Push with 0 frequency
[ "Push", "with", "0", "frequency" ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/lib/ImageCache.js#L89-L96
train
Flipboard/react-canvas
lib/ImageCache.js
function (src) { var image = _instancePool.get(src); if (!image) { // Awesome LRU image = new Img(src); if (_instancePool.length >= kInstancePoolLength) { _instancePool.popLeastUsed().destructor(); } _instancePool.push(image.getOriginalSrc(), image); } return image;...
javascript
function (src) { var image = _instancePool.get(src); if (!image) { // Awesome LRU image = new Img(src); if (_instancePool.length >= kInstancePoolLength) { _instancePool.popLeastUsed().destructor(); } _instancePool.push(image.getOriginalSrc(), image); } return image;...
[ "function", "(", "src", ")", "{", "var", "image", "=", "_instancePool", ".", "get", "(", "src", ")", ";", "if", "(", "!", "image", ")", "{", "// Awesome LRU", "image", "=", "new", "Img", "(", "src", ")", ";", "if", "(", "_instancePool", ".", "lengt...
Retrieve an image from the cache @return {Img}
[ "Retrieve", "an", "image", "from", "the", "cache" ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/lib/ImageCache.js#L147-L158
train
Flipboard/react-canvas
lib/CanvasUtils.js
drawGradient
function drawGradient(ctx, x1, y1, x2, y2, colorStops, x, y, width, height) { var grad; ctx.save(); grad = ctx.createLinearGradient(x1, y1, x2, y2); colorStops.forEach(function (colorStop) { grad.addColorStop(colorStop.position, colorStop.color); }); ctx.fillStyle = grad; ctx.fillRect(x, y, width, ...
javascript
function drawGradient(ctx, x1, y1, x2, y2, colorStops, x, y, width, height) { var grad; ctx.save(); grad = ctx.createLinearGradient(x1, y1, x2, y2); colorStops.forEach(function (colorStop) { grad.addColorStop(colorStop.position, colorStop.color); }); ctx.fillStyle = grad; ctx.fillRect(x, y, width, ...
[ "function", "drawGradient", "(", "ctx", ",", "x1", ",", "y1", ",", "x2", ",", "y2", ",", "colorStops", ",", "x", ",", "y", ",", "width", ",", "height", ")", "{", "var", "grad", ";", "ctx", ".", "save", "(", ")", ";", "grad", "=", "ctx", ".", ...
Draw a linear gradient @param {CanvasContext} ctx @param {Number} x1 gradient start-x coordinate @param {Number} y1 gradient start-y coordinate @param {Number} x2 gradient end-x coordinate @param {Number} y2 gradient end-y coordinate @param {Array} colorStops Array of {(String)color, (Number)position} values @param {N...
[ "Draw", "a", "linear", "gradient" ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/lib/CanvasUtils.js#L185-L198
train
Flipboard/react-canvas
lib/DrawingUtils.js
invalidateBackingStore
function invalidateBackingStore (id) { for (var i=0, len=_backingStores.length; i < len; i++) { if (_backingStores[i].id === id) { _backingStores.splice(i, 1); break; } } }
javascript
function invalidateBackingStore (id) { for (var i=0, len=_backingStores.length; i < len; i++) { if (_backingStores[i].id === id) { _backingStores.splice(i, 1); break; } } }
[ "function", "invalidateBackingStore", "(", "id", ")", "{", "for", "(", "var", "i", "=", "0", ",", "len", "=", "_backingStores", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "if", "(", "_backingStores", "[", "i", "]", ".", "id", ...
Purge a layer's backing store from the cache. @param {String} id The layer's backingStoreId
[ "Purge", "a", "layer", "s", "backing", "store", "from", "the", "cache", "." ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/lib/DrawingUtils.js#L34-L41
train
Flipboard/react-canvas
lib/DrawingUtils.js
getBackingStoreAncestor
function getBackingStoreAncestor (layer) { while (layer) { if (layer.backingStoreId) { return layer; } layer = layer.parentLayer; } return null; }
javascript
function getBackingStoreAncestor (layer) { while (layer) { if (layer.backingStoreId) { return layer; } layer = layer.parentLayer; } return null; }
[ "function", "getBackingStoreAncestor", "(", "layer", ")", "{", "while", "(", "layer", ")", "{", "if", "(", "layer", ".", "backingStoreId", ")", "{", "return", "layer", ";", "}", "layer", "=", "layer", ".", "parentLayer", ";", "}", "return", "null", ";", ...
Find the nearest backing store ancestor for a given layer. @param {RenderLayer} layer
[ "Find", "the", "nearest", "backing", "store", "ancestor", "for", "a", "given", "layer", "." ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/lib/DrawingUtils.js#L55-L63
train
Flipboard/react-canvas
lib/DrawingUtils.js
layerContainsImage
function layerContainsImage (layer, imageUrl) { // Check the layer itself. if (layer.type === 'image' && layer.imageUrl === imageUrl) { return layer; } // Check the layer's children. if (layer.children) { for (var i=0, len=layer.children.length; i < len; i++) { if (layerContainsImage(layer.chil...
javascript
function layerContainsImage (layer, imageUrl) { // Check the layer itself. if (layer.type === 'image' && layer.imageUrl === imageUrl) { return layer; } // Check the layer's children. if (layer.children) { for (var i=0, len=layer.children.length; i < len; i++) { if (layerContainsImage(layer.chil...
[ "function", "layerContainsImage", "(", "layer", ",", "imageUrl", ")", "{", "// Check the layer itself.", "if", "(", "layer", ".", "type", "===", "'image'", "&&", "layer", ".", "imageUrl", "===", "imageUrl", ")", "{", "return", "layer", ";", "}", "// Check the ...
Check if a layer is using a given image URL. @param {RenderLayer} layer @param {String} imageUrl @return {Boolean}
[ "Check", "if", "a", "layer", "is", "using", "a", "given", "image", "URL", "." ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/lib/DrawingUtils.js#L72-L88
train
Flipboard/react-canvas
lib/DrawingUtils.js
layerContainsFontFace
function layerContainsFontFace (layer, fontFace) { // Check the layer itself. if (layer.type === 'text' && layer.fontFace && layer.fontFace.id === fontFace.id) { return layer; } // Check the layer's children. if (layer.children) { for (var i=0, len=layer.children.length; i < len; i++) { if (lay...
javascript
function layerContainsFontFace (layer, fontFace) { // Check the layer itself. if (layer.type === 'text' && layer.fontFace && layer.fontFace.id === fontFace.id) { return layer; } // Check the layer's children. if (layer.children) { for (var i=0, len=layer.children.length; i < len; i++) { if (lay...
[ "function", "layerContainsFontFace", "(", "layer", ",", "fontFace", ")", "{", "// Check the layer itself.", "if", "(", "layer", ".", "type", "===", "'text'", "&&", "layer", ".", "fontFace", "&&", "layer", ".", "fontFace", ".", "id", "===", "fontFace", ".", "...
Check if a layer is using a given FontFace. @param {RenderLayer} layer @param {FontFace} fontFace @return {Boolean}
[ "Check", "if", "a", "layer", "is", "using", "a", "given", "FontFace", "." ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/lib/DrawingUtils.js#L97-L113
train
Flipboard/react-canvas
lib/DrawingUtils.js
handleImageLoad
function handleImageLoad (imageUrl) { _backingStores.forEach(function (backingStore) { if (layerContainsImage(backingStore.layer, imageUrl)) { invalidateBackingStore(backingStore.id); } }); }
javascript
function handleImageLoad (imageUrl) { _backingStores.forEach(function (backingStore) { if (layerContainsImage(backingStore.layer, imageUrl)) { invalidateBackingStore(backingStore.id); } }); }
[ "function", "handleImageLoad", "(", "imageUrl", ")", "{", "_backingStores", ".", "forEach", "(", "function", "(", "backingStore", ")", "{", "if", "(", "layerContainsImage", "(", "backingStore", ".", "layer", ",", "imageUrl", ")", ")", "{", "invalidateBackingStor...
Invalidates the backing stores for layers which contain an image layer associated with the given imageUrl. @param {String} imageUrl
[ "Invalidates", "the", "backing", "stores", "for", "layers", "which", "contain", "an", "image", "layer", "associated", "with", "the", "given", "imageUrl", "." ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/lib/DrawingUtils.js#L121-L127
train
Flipboard/react-canvas
lib/DrawingUtils.js
handleFontLoad
function handleFontLoad (fontFace) { _backingStores.forEach(function (backingStore) { if (layerContainsFontFace(backingStore.layer, fontFace)) { invalidateBackingStore(backingStore.id); } }); }
javascript
function handleFontLoad (fontFace) { _backingStores.forEach(function (backingStore) { if (layerContainsFontFace(backingStore.layer, fontFace)) { invalidateBackingStore(backingStore.id); } }); }
[ "function", "handleFontLoad", "(", "fontFace", ")", "{", "_backingStores", ".", "forEach", "(", "function", "(", "backingStore", ")", "{", "if", "(", "layerContainsFontFace", "(", "backingStore", ".", "layer", ",", "fontFace", ")", ")", "{", "invalidateBackingSt...
Invalidates the backing stores for layers which contain a text layer associated with the given font face. @param {FontFace} fontFace
[ "Invalidates", "the", "backing", "stores", "for", "layers", "which", "contain", "a", "text", "layer", "associated", "with", "the", "given", "font", "face", "." ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/lib/DrawingUtils.js#L135-L141
train
Flipboard/react-canvas
lib/FontUtils.js
loadFont
function loadFont (fontFace, callback) { var defaultNode; var testNode; var checkFont; // See if we've previously loaded it. if (_loadedFonts[fontFace.id]) { return callback(null); } // See if we've previously failed to load it. if (_failedFonts[fontFace.id]) { return callback(_failedFonts[fon...
javascript
function loadFont (fontFace, callback) { var defaultNode; var testNode; var checkFont; // See if we've previously loaded it. if (_loadedFonts[fontFace.id]) { return callback(null); } // See if we've previously failed to load it. if (_failedFonts[fontFace.id]) { return callback(_failedFonts[fon...
[ "function", "loadFont", "(", "fontFace", ",", "callback", ")", "{", "var", "defaultNode", ";", "var", "testNode", ";", "var", "checkFont", ";", "// See if we've previously loaded it.", "if", "(", "_loadedFonts", "[", "fontFace", ".", "id", "]", ")", "{", "retu...
Load a remote font and execute a callback. @param {FontFace} fontFace The font to Load @param {Function} callback Function executed upon font Load
[ "Load", "a", "remote", "font", "and", "execute", "a", "callback", "." ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/lib/FontUtils.js#L27-L86
train
Flipboard/react-canvas
lib/layoutNode.js
layoutNode
function layoutNode (root) { var rootNode = createNode(root); computeLayout(rootNode); walkNode(rootNode); return rootNode; }
javascript
function layoutNode (root) { var rootNode = createNode(root); computeLayout(rootNode); walkNode(rootNode); return rootNode; }
[ "function", "layoutNode", "(", "root", ")", "{", "var", "rootNode", "=", "createNode", "(", "root", ")", ";", "computeLayout", "(", "rootNode", ")", ";", "walkNode", "(", "rootNode", ")", ";", "return", "rootNode", ";", "}" ]
This computes the CSS layout for a RenderLayer tree and mutates the frame objects at each node. @param {Renderlayer} root @return {Object}
[ "This", "computes", "the", "CSS", "layout", "for", "a", "RenderLayer", "tree", "and", "mutates", "the", "frame", "objects", "at", "each", "node", "." ]
0b71180b4061a55410efb4578df2b65c1bf00a8e
https://github.com/Flipboard/react-canvas/blob/0b71180b4061a55410efb4578df2b65c1bf00a8e/lib/layoutNode.js#L12-L17
train
chaijs/chai
lib/chai/utils/inspect.js
function (object) { if (typeof HTMLElement === 'object') { return object instanceof HTMLElement; } else { return object && typeof object === 'object' && 'nodeType' in object && object.nodeType === 1 && typeof object.nodeName === 'string'; } }
javascript
function (object) { if (typeof HTMLElement === 'object') { return object instanceof HTMLElement; } else { return object && typeof object === 'object' && 'nodeType' in object && object.nodeType === 1 && typeof object.nodeName === 'string'; } }
[ "function", "(", "object", ")", "{", "if", "(", "typeof", "HTMLElement", "===", "'object'", ")", "{", "return", "object", "instanceof", "HTMLElement", ";", "}", "else", "{", "return", "object", "&&", "typeof", "object", "===", "'object'", "&&", "'nodeType'",...
Returns true if object is a DOM element.
[ "Returns", "true", "if", "object", "is", "a", "DOM", "element", "." ]
6441f3df2f054da988233b0949265122b5849ad8
https://github.com/chaijs/chai/blob/6441f3df2f054da988233b0949265122b5849ad8/lib/chai/utils/inspect.js#L36-L46
train
pixelcog/parallax.js
parallax.js
Plugin
function Plugin(option) { return this.each(function () { var $this = $(this); var options = typeof option == 'object' && option; if (this == window || this == document || $this.is('body')) { Parallax.configure(options); } else if (!$this.data('px.parallax')) { options ...
javascript
function Plugin(option) { return this.each(function () { var $this = $(this); var options = typeof option == 'object' && option; if (this == window || this == document || $this.is('body')) { Parallax.configure(options); } else if (!$this.data('px.parallax')) { options ...
[ "function", "Plugin", "(", "option", ")", "{", "return", "this", ".", "each", "(", "function", "(", ")", "{", "var", "$this", "=", "$", "(", "this", ")", ";", "var", "options", "=", "typeof", "option", "==", "'object'", "&&", "option", ";", "if", "...
Parallax Plugin Definition
[ "Parallax", "Plugin", "Definition" ]
729b1f5e3dd4100e863f011990a1f1f6769fc919
https://github.com/pixelcog/parallax.js/blob/729b1f5e3dd4100e863f011990a1f1f6769fc919/parallax.js#L366-L390
train
babel/babel-loader
src/cache.js
async function(filename, compress) { const data = await readFile(filename + (compress ? ".gz" : "")); const content = compress ? await gunzip(data) : data; return JSON.parse(content.toString()); }
javascript
async function(filename, compress) { const data = await readFile(filename + (compress ? ".gz" : "")); const content = compress ? await gunzip(data) : data; return JSON.parse(content.toString()); }
[ "async", "function", "(", "filename", ",", "compress", ")", "{", "const", "data", "=", "await", "readFile", "(", "filename", "+", "(", "compress", "?", "\".gz\"", ":", "\"\"", ")", ")", ";", "const", "content", "=", "compress", "?", "await", "gunzip", ...
Read the contents from the compressed file. @async @params {String} filename
[ "Read", "the", "contents", "from", "the", "compressed", "file", "." ]
5da4fa0c673474ab14bc829f2cbe03e60e437858
https://github.com/babel/babel-loader/blob/5da4fa0c673474ab14bc829f2cbe03e60e437858/src/cache.js#L35-L40
train
babel/babel-loader
src/cache.js
async function(filename, compress, result) { const content = JSON.stringify(result); const data = compress ? await gzip(content) : content; return await writeFile(filename + (compress ? ".gz" : ""), data); }
javascript
async function(filename, compress, result) { const content = JSON.stringify(result); const data = compress ? await gzip(content) : content; return await writeFile(filename + (compress ? ".gz" : ""), data); }
[ "async", "function", "(", "filename", ",", "compress", ",", "result", ")", "{", "const", "content", "=", "JSON", ".", "stringify", "(", "result", ")", ";", "const", "data", "=", "compress", "?", "await", "gzip", "(", "content", ")", ":", "content", ";"...
Write contents into a compressed file. @async @params {String} filename @params {String} result
[ "Write", "contents", "into", "a", "compressed", "file", "." ]
5da4fa0c673474ab14bc829f2cbe03e60e437858
https://github.com/babel/babel-loader/blob/5da4fa0c673474ab14bc829f2cbe03e60e437858/src/cache.js#L49-L54
train
babel/babel-loader
src/cache.js
function(source, identifier, options) { const hash = crypto.createHash("md4"); const contents = JSON.stringify({ source, options, identifier }); hash.update(contents); return hash.digest("hex") + ".json"; }
javascript
function(source, identifier, options) { const hash = crypto.createHash("md4"); const contents = JSON.stringify({ source, options, identifier }); hash.update(contents); return hash.digest("hex") + ".json"; }
[ "function", "(", "source", ",", "identifier", ",", "options", ")", "{", "const", "hash", "=", "crypto", ".", "createHash", "(", "\"md4\"", ")", ";", "const", "contents", "=", "JSON", ".", "stringify", "(", "{", "source", ",", "options", ",", "identifier"...
Build the filename for the cached file @params {String} source File source code @params {Object} options Options used @return {String}
[ "Build", "the", "filename", "for", "the", "cached", "file" ]
5da4fa0c673474ab14bc829f2cbe03e60e437858
https://github.com/babel/babel-loader/blob/5da4fa0c673474ab14bc829f2cbe03e60e437858/src/cache.js#L64-L72
train
babel/babel-loader
src/cache.js
async function(directory, params) { const { source, options = {}, cacheIdentifier, cacheDirectory, cacheCompression, } = params; const file = path.join(directory, filename(source, cacheIdentifier, options)); try { // No errors mean that the file was previously cached // we just nee...
javascript
async function(directory, params) { const { source, options = {}, cacheIdentifier, cacheDirectory, cacheCompression, } = params; const file = path.join(directory, filename(source, cacheIdentifier, options)); try { // No errors mean that the file was previously cached // we just nee...
[ "async", "function", "(", "directory", ",", "params", ")", "{", "const", "{", "source", ",", "options", "=", "{", "}", ",", "cacheIdentifier", ",", "cacheDirectory", ",", "cacheCompression", ",", "}", "=", "params", ";", "const", "file", "=", "path", "."...
Handle the cache @params {String} directory @params {Object} params
[ "Handle", "the", "cache" ]
5da4fa0c673474ab14bc829f2cbe03e60e437858
https://github.com/babel/babel-loader/blob/5da4fa0c673474ab14bc829f2cbe03e60e437858/src/cache.js#L80-L127
train
ecomfe/echarts-gl
src/effect/TemporalSuperSampling.js
function (renderer, camera) { var viewport = renderer.viewport; var dpr = viewport.devicePixelRatio || renderer.getDevicePixelRatio(); var width = viewport.width * dpr; var height = viewport.height * dpr; var offset = this._haltonSequence[this._frame % this._haltonSequence.lengt...
javascript
function (renderer, camera) { var viewport = renderer.viewport; var dpr = viewport.devicePixelRatio || renderer.getDevicePixelRatio(); var width = viewport.width * dpr; var height = viewport.height * dpr; var offset = this._haltonSequence[this._frame % this._haltonSequence.lengt...
[ "function", "(", "renderer", ",", "camera", ")", "{", "var", "viewport", "=", "renderer", ".", "viewport", ";", "var", "dpr", "=", "viewport", ".", "devicePixelRatio", "||", "renderer", ".", "getDevicePixelRatio", "(", ")", ";", "var", "width", "=", "viewp...
Jitter camera projectionMatrix @parma {clay.Renderer} renderer @param {clay.Camera} camera
[ "Jitter", "camera", "projectionMatrix" ]
b59058e1b58d682fbbc602c084a86708b350f703
https://github.com/ecomfe/echarts-gl/blob/b59058e1b58d682fbbc602c084a86708b350f703/src/effect/TemporalSuperSampling.js#L62-L77
train
ecomfe/echarts-gl
src/util/Triangulation.js
intersectEdge
function intersectEdge(x0, y0, x1, y1, x, y) { if ((y > y0 && y > y1) || (y < y0 && y < y1)) { return -Infinity; } // Ignore horizontal line if (y1 === y0) { return -Infinity; } var dir = y1 < y0 ? 1 : -1; var t = (y - y0) / (y1 - y0); // Avoid winding error when interse...
javascript
function intersectEdge(x0, y0, x1, y1, x, y) { if ((y > y0 && y > y1) || (y < y0 && y < y1)) { return -Infinity; } // Ignore horizontal line if (y1 === y0) { return -Infinity; } var dir = y1 < y0 ? 1 : -1; var t = (y - y0) / (y1 - y0); // Avoid winding error when interse...
[ "function", "intersectEdge", "(", "x0", ",", "y0", ",", "x1", ",", "y1", ",", "x", ",", "y", ")", "{", "if", "(", "(", "y", ">", "y0", "&&", "y", ">", "y1", ")", "||", "(", "y", "<", "y0", "&&", "y", "<", "y1", ")", ")", "{", "return", ...
From x,y point cast a ray to right. and intersect with edge x0, y0, x1, y1; Return x value of intersect point
[ "From", "x", "y", "point", "cast", "a", "ray", "to", "right", ".", "and", "intersect", "with", "edge", "x0", "y0", "x1", "y1", ";", "Return", "x", "value", "of", "intersect", "point" ]
b59058e1b58d682fbbc602c084a86708b350f703
https://github.com/ecomfe/echarts-gl/blob/b59058e1b58d682fbbc602c084a86708b350f703/src/util/Triangulation.js#L12-L31
train
ecomfe/echarts-gl
src/chart/flowGL/FlowGLView.js
function (texture) { var pixels = texture.pixels; var width = texture.width; var height = texture.height; function fetchPixel(x, y, rg) { x = Math.max(Math.min(x, width - 1), 0); y = Math.max(Math.min(y, height - 1), 0); var idx = (y * (width - 1) + x...
javascript
function (texture) { var pixels = texture.pixels; var width = texture.width; var height = texture.height; function fetchPixel(x, y, rg) { x = Math.max(Math.min(x, width - 1), 0); y = Math.max(Math.min(y, height - 1), 0); var idx = (y * (width - 1) + x...
[ "function", "(", "texture", ")", "{", "var", "pixels", "=", "texture", ".", "pixels", ";", "var", "width", "=", "texture", ".", "width", ";", "var", "height", "=", "texture", ".", "height", ";", "function", "fetchPixel", "(", "x", ",", "y", ",", "rg"...
PENDING Use grid mesh ? or delaunay triangulation?
[ "PENDING", "Use", "grid", "mesh", "?", "or", "delaunay", "triangulation?" ]
b59058e1b58d682fbbc602c084a86708b350f703
https://github.com/ecomfe/echarts-gl/blob/b59058e1b58d682fbbc602c084a86708b350f703/src/chart/flowGL/FlowGLView.js#L180-L230
train
ecomfe/echarts-gl
src/util/ZRTextureAtlasSurface.js
function (el, width, height) { // FIXME Text element not consider textAlign and textVerticalAlign. // TODO, inner text, shadow var rect = el.getBoundingRect(); // FIXME aspect ratio if (width == null) { width = rect.width; } if (height == null) { ...
javascript
function (el, width, height) { // FIXME Text element not consider textAlign and textVerticalAlign. // TODO, inner text, shadow var rect = el.getBoundingRect(); // FIXME aspect ratio if (width == null) { width = rect.width; } if (height == null) { ...
[ "function", "(", "el", ",", "width", ",", "height", ")", "{", "// FIXME Text element not consider textAlign and textVerticalAlign.", "// TODO, inner text, shadow", "var", "rect", "=", "el", ".", "getBoundingRect", "(", ")", ";", "// FIXME aspect ratio", "if", "(", "widt...
Add shape to atlas @param {module:zrender/graphic/Displayable} shape @param {number} width @param {number} height @return {Array}
[ "Add", "shape", "to", "atlas" ]
b59058e1b58d682fbbc602c084a86708b350f703
https://github.com/ecomfe/echarts-gl/blob/b59058e1b58d682fbbc602c084a86708b350f703/src/util/ZRTextureAtlasSurface.js#L75-L141
train
ecomfe/echarts-gl
src/util/ZRTextureAtlasSurface.js
function (el, spriteWidth, spriteHeight) { // TODO, inner text, shadow var rect = el.getBoundingRect(); var scaleX = spriteWidth / rect.width; var scaleY = spriteHeight / rect.height; el.position = [-rect.x * scaleX, -rect.y * scaleY]; el.scale = [scaleX, scaleY]; ...
javascript
function (el, spriteWidth, spriteHeight) { // TODO, inner text, shadow var rect = el.getBoundingRect(); var scaleX = spriteWidth / rect.width; var scaleY = spriteHeight / rect.height; el.position = [-rect.x * scaleX, -rect.y * scaleY]; el.scale = [scaleX, scaleY]; ...
[ "function", "(", "el", ",", "spriteWidth", ",", "spriteHeight", ")", "{", "// TODO, inner text, shadow", "var", "rect", "=", "el", ".", "getBoundingRect", "(", ")", ";", "var", "scaleX", "=", "spriteWidth", "/", "rect", ".", "width", ";", "var", "scaleY", ...
Fit element size by correct its position and scaling @param {module:zrender/graphic/Displayable} el @param {number} spriteWidth @param {number} spriteHeight
[ "Fit", "element", "size", "by", "correct", "its", "position", "and", "scaling" ]
b59058e1b58d682fbbc602c084a86708b350f703
https://github.com/ecomfe/echarts-gl/blob/b59058e1b58d682fbbc602c084a86708b350f703/src/util/ZRTextureAtlasSurface.js#L149-L158
train
ecomfe/echarts-gl
src/util/ZRTextureAtlasSurface.js
function () { for (var i = 0; i < this._textureAtlasNodes.length; i++) { this._textureAtlasNodes[i].clear(); } this._currentNodeIdx = 0; this._zr.clear(); this._coords = {}; }
javascript
function () { for (var i = 0; i < this._textureAtlasNodes.length; i++) { this._textureAtlasNodes[i].clear(); } this._currentNodeIdx = 0; this._zr.clear(); this._coords = {}; }
[ "function", "(", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "this", ".", "_textureAtlasNodes", ".", "length", ";", "i", "++", ")", "{", "this", ".", "_textureAtlasNodes", "[", "i", "]", ".", "clear", "(", ")", ";", "}", "this", ...
Clear the texture atlas
[ "Clear", "the", "texture", "atlas" ]
b59058e1b58d682fbbc602c084a86708b350f703
https://github.com/ecomfe/echarts-gl/blob/b59058e1b58d682fbbc602c084a86708b350f703/src/util/ZRTextureAtlasSurface.js#L229-L239
train
ecomfe/echarts-gl
src/util/ZRTextureAtlasSurface.js
function () { var dpr = this._dpr; return [this._nodeWidth / this._canvas.width * dpr, this._nodeHeight / this._canvas.height * dpr]; }
javascript
function () { var dpr = this._dpr; return [this._nodeWidth / this._canvas.width * dpr, this._nodeHeight / this._canvas.height * dpr]; }
[ "function", "(", ")", "{", "var", "dpr", "=", "this", ".", "_dpr", ";", "return", "[", "this", ".", "_nodeWidth", "/", "this", ".", "_canvas", ".", "width", "*", "dpr", ",", "this", ".", "_nodeHeight", "/", "this", ".", "_canvas", ".", "height", "*...
Get coord scale after texture atlas is expanded. @return {Array.<number>}
[ "Get", "coord", "scale", "after", "texture", "atlas", "is", "expanded", "." ]
b59058e1b58d682fbbc602c084a86708b350f703
https://github.com/ecomfe/echarts-gl/blob/b59058e1b58d682fbbc602c084a86708b350f703/src/util/ZRTextureAtlasSurface.js#L345-L348
train
ecomfe/echarts-gl
src/component/common/Geo3DBuilder.js
function (idx) { var polygons = this._triangulationResults[idx - this._startIndex]; var sideVertexCount = 0; var sideTriangleCount = 0; for (var i = 0; i < polygons.length; i++) { sideVertexCount += polygons[i].points.length / 3; sideTriangleCount += polygons[i...
javascript
function (idx) { var polygons = this._triangulationResults[idx - this._startIndex]; var sideVertexCount = 0; var sideTriangleCount = 0; for (var i = 0; i < polygons.length; i++) { sideVertexCount += polygons[i].points.length / 3; sideTriangleCount += polygons[i...
[ "function", "(", "idx", ")", "{", "var", "polygons", "=", "this", ".", "_triangulationResults", "[", "idx", "-", "this", ".", "_startIndex", "]", ";", "var", "sideVertexCount", "=", "0", ";", "var", "sideTriangleCount", "=", "0", ";", "for", "(", "var", ...
Get region vertex and triangle count
[ "Get", "region", "vertex", "and", "triangle", "count" ]
b59058e1b58d682fbbc602c084a86708b350f703
https://github.com/ecomfe/echarts-gl/blob/b59058e1b58d682fbbc602c084a86708b350f703/src/component/common/Geo3DBuilder.js#L472-L491
train
mde/ejs
lib/ejs.js
getIncludePath
function getIncludePath(path, options) { var includePath; var filePath; var views = options.views; // Abs path if (path.charAt(0) == '/') { includePath = exports.resolveInclude(path.replace(/^\/*/,''), options.root || '/', true); } // Relative paths else { // Look relative to a passed filename ...
javascript
function getIncludePath(path, options) { var includePath; var filePath; var views = options.views; // Abs path if (path.charAt(0) == '/') { includePath = exports.resolveInclude(path.replace(/^\/*/,''), options.root || '/', true); } // Relative paths else { // Look relative to a passed filename ...
[ "function", "getIncludePath", "(", "path", ",", "options", ")", "{", "var", "includePath", ";", "var", "filePath", ";", "var", "views", "=", "options", ".", "views", ";", "// Abs path", "if", "(", "path", ".", "charAt", "(", "0", ")", "==", "'/'", ")",...
Get the path to the included file by Options @param {String} path specified path @param {Options} options compilation options @return {String}
[ "Get", "the", "path", "to", "the", "included", "file", "by", "Options" ]
f2c77d78d2bbd4c61e8d6fcf3df38ab528a6bdac
https://github.com/mde/ejs/blob/f2c77d78d2bbd4c61e8d6fcf3df38ab528a6bdac/lib/ejs.js#L136-L169
train
mde/ejs
lib/ejs.js
rethrow
function rethrow(err, str, flnm, lineno, esc){ var lines = str.split('\n'); var start = Math.max(lineno - 3, 0); var end = Math.min(lines.length, lineno + 3); var filename = esc(flnm); // eslint-disable-line // Error context var context = lines.slice(start, end).map(function (line, i){ var curr = i + st...
javascript
function rethrow(err, str, flnm, lineno, esc){ var lines = str.split('\n'); var start = Math.max(lineno - 3, 0); var end = Math.min(lines.length, lineno + 3); var filename = esc(flnm); // eslint-disable-line // Error context var context = lines.slice(start, end).map(function (line, i){ var curr = i + st...
[ "function", "rethrow", "(", "err", ",", "str", ",", "flnm", ",", "lineno", ",", "esc", ")", "{", "var", "lines", "=", "str", ".", "split", "(", "'\\n'", ")", ";", "var", "start", "=", "Math", ".", "max", "(", "lineno", "-", "3", ",", "0", ")", ...
Re-throw the given `err` in context to the `str` of ejs, `filename`, and `lineno`. @implements RethrowCallback @memberof module:ejs-internal @param {Error} err Error object @param {String} str EJS source @param {String} filename file name of the EJS file @param {String} lineno line number of the error @st...
[ "Re", "-", "throw", "the", "given", "err", "in", "context", "to", "the", "str", "of", "ejs", "filename", "and", "lineno", "." ]
f2c77d78d2bbd4c61e8d6fcf3df38ab528a6bdac
https://github.com/mde/ejs/blob/f2c77d78d2bbd4c61e8d6fcf3df38ab528a6bdac/lib/ejs.js#L333-L355
train
jossmac/react-images
lib/Lightbox.js
normalizeSourceSet
function normalizeSourceSet(data) { var sourceSet = data.srcSet || data.srcset; if (Array.isArray(sourceSet)) { return sourceSet.join(); } return sourceSet; }
javascript
function normalizeSourceSet(data) { var sourceSet = data.srcSet || data.srcset; if (Array.isArray(sourceSet)) { return sourceSet.join(); } return sourceSet; }
[ "function", "normalizeSourceSet", "(", "data", ")", "{", "var", "sourceSet", "=", "data", ".", "srcSet", "||", "data", ".", "srcset", ";", "if", "(", "Array", ".", "isArray", "(", "sourceSet", ")", ")", "{", "return", "sourceSet", ".", "join", "(", ")"...
consumers sometimes provide incorrect type or casing
[ "consumers", "sometimes", "provide", "incorrect", "type", "or", "casing" ]
c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3
https://github.com/jossmac/react-images/blob/c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3/lib/Lightbox.js#L76-L84
train
jossmac/react-images
examples/dist/common.js
generateCSS
function generateCSS(selector, styleTypes, stringHandlers, useImportant) { var merged = styleTypes.reduce(_util.recursiveMerge); var declarations = {}; var mediaQueries = {}; var pseudoStyles = {}; Object.keys(merged).forEach(function (key) { if (key[0] === ':') { pseudoStyles[...
javascript
function generateCSS(selector, styleTypes, stringHandlers, useImportant) { var merged = styleTypes.reduce(_util.recursiveMerge); var declarations = {}; var mediaQueries = {}; var pseudoStyles = {}; Object.keys(merged).forEach(function (key) { if (key[0] === ':') { pseudoStyles[...
[ "function", "generateCSS", "(", "selector", ",", "styleTypes", ",", "stringHandlers", ",", "useImportant", ")", "{", "var", "merged", "=", "styleTypes", ".", "reduce", "(", "_util", ".", "recursiveMerge", ")", ";", "var", "declarations", "=", "{", "}", ";", ...
Generate CSS for a selector and some styles. This function handles the media queries, pseudo selectors, and descendant styles that can be used in aphrodite styles. @param {string} selector: A base CSS selector for the styles to be generated with. @param {Object} styleTypes: A list of properties of the return type of ...
[ "Generate", "CSS", "for", "a", "selector", "and", "some", "styles", "." ]
c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3
https://github.com/jossmac/react-images/blob/c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3/examples/dist/common.js#L62-L85
train
jossmac/react-images
examples/dist/common.js
generateCSSRuleset
function generateCSSRuleset(selector, declarations, stringHandlers, useImportant) { var handledDeclarations = runStringHandlers(declarations, stringHandlers); var prefixedDeclarations = (0, _inlineStylePrefixerStatic2['default'])(handledDeclarations); var prefixedRules = (0, _util.flatten)((0, _util.objec...
javascript
function generateCSSRuleset(selector, declarations, stringHandlers, useImportant) { var handledDeclarations = runStringHandlers(declarations, stringHandlers); var prefixedDeclarations = (0, _inlineStylePrefixerStatic2['default'])(handledDeclarations); var prefixedRules = (0, _util.flatten)((0, _util.objec...
[ "function", "generateCSSRuleset", "(", "selector", ",", "declarations", ",", "stringHandlers", ",", "useImportant", ")", "{", "var", "handledDeclarations", "=", "runStringHandlers", "(", "declarations", ",", "stringHandlers", ")", ";", "var", "prefixedDeclarations", "...
Generate a CSS ruleset with the selector and containing the declarations. This function assumes that the given declarations don't contain any special children (such as media queries, pseudo-selectors, or descendant styles). Note that this method does not deal with nesting used for e.g. psuedo-selectors or media queri...
[ "Generate", "a", "CSS", "ruleset", "with", "the", "selector", "and", "containing", "the", "declarations", "." ]
c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3
https://github.com/jossmac/react-images/blob/c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3/examples/dist/common.js#L141-L199
train
jossmac/react-images
examples/dist/common.js
fontFamily
function fontFamily(val) { if (Array.isArray(val)) { return val.map(fontFamily).join(","); } else if (typeof val === "object") { injectStyleOnce(val.fontFamily, "@font-face", [val], false); return '"' + val.fontFamily + '"'; } else { return val; ...
javascript
function fontFamily(val) { if (Array.isArray(val)) { return val.map(fontFamily).join(","); } else if (typeof val === "object") { injectStyleOnce(val.fontFamily, "@font-face", [val], false); return '"' + val.fontFamily + '"'; } else { return val; ...
[ "function", "fontFamily", "(", "val", ")", "{", "if", "(", "Array", ".", "isArray", "(", "val", ")", ")", "{", "return", "val", ".", "map", "(", "fontFamily", ")", ".", "join", "(", "\",\"", ")", ";", "}", "else", "if", "(", "typeof", "val", "===...
With fontFamily we look for objects that are passed in and interpret them as @font-face rules that we need to inject. The value of fontFamily can either be a string (as normal), an object (a single font face), or an array of objects and strings.
[ "With", "fontFamily", "we", "look", "for", "objects", "that", "are", "passed", "in", "and", "interpret", "them", "as" ]
c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3
https://github.com/jossmac/react-images/blob/c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3/examples/dist/common.js#L261-L270
train
jossmac/react-images
examples/dist/common.js
animationName
function animationName(val) { if (typeof val !== "object") { return val; } // Generate a unique name based on the hash of the object. We can't // just use the hash because the name can't start with a number. // TODO(emily): this probably makes debugging hard, allow a...
javascript
function animationName(val) { if (typeof val !== "object") { return val; } // Generate a unique name based on the hash of the object. We can't // just use the hash because the name can't start with a number. // TODO(emily): this probably makes debugging hard, allow a...
[ "function", "animationName", "(", "val", ")", "{", "if", "(", "typeof", "val", "!==", "\"object\"", ")", "{", "return", "val", ";", "}", "// Generate a unique name based on the hash of the object. We can't", "// just use the hash because the name can't start with a number.", ...
With animationName we look for an object that contains keyframes and inject them as an `@keyframes` block, returning a uniquely generated name. The keyframes object should look like animationName: { from: { left: 0, top: 0, }, '50%': { left: 15, top: 5, }, to: { left: 20, top: 20, } } TODO(emily): `stringHandlers` does...
[ "With", "animationName", "we", "look", "for", "an", "object", "that", "contains", "keyframes", "and", "inject", "them", "as", "an" ]
c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3
https://github.com/jossmac/react-images/blob/c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3/examples/dist/common.js#L292-L314
train
jossmac/react-images
examples/dist/common.js
injectAndGetClassName
function injectAndGetClassName(useImportant, styleDefinitions) { // Filter out falsy values from the input, to allow for // `css(a, test && c)` var validDefinitions = styleDefinitions.filter(function (def) { return def; }); // Break if there aren't any valid styles. if (validDefinitions...
javascript
function injectAndGetClassName(useImportant, styleDefinitions) { // Filter out falsy values from the input, to allow for // `css(a, test && c)` var validDefinitions = styleDefinitions.filter(function (def) { return def; }); // Break if there aren't any valid styles. if (validDefinitions...
[ "function", "injectAndGetClassName", "(", "useImportant", ",", "styleDefinitions", ")", "{", "// Filter out falsy values from the input, to allow for", "// `css(a, test && c)`", "var", "validDefinitions", "=", "styleDefinitions", ".", "filter", "(", "function", "(", "def", ")...
Inject styles associated with the passed style definition objects, and return an associated CSS class name. @param {boolean} useImportant If true, will append !important to generated CSS output. e.g. {color: red} -> "color: red !important". @param {Object[]} styleDefinitions style definition objects as returned as pro...
[ "Inject", "styles", "associated", "with", "the", "passed", "style", "definition", "objects", "and", "return", "an", "associated", "CSS", "class", "name", "." ]
c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3
https://github.com/jossmac/react-images/blob/c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3/examples/dist/common.js#L411-L431
train
jossmac/react-images
examples/dist/common.js
murmurhash2_32_gc
function murmurhash2_32_gc(str) { var l = str.length; var h = l; var i = 0; var k = undefined; while (l >= 4) { k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24; k = (k & 0xffff) * 0x5bd1e995 ...
javascript
function murmurhash2_32_gc(str) { var l = str.length; var h = l; var i = 0; var k = undefined; while (l >= 4) { k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24; k = (k & 0xffff) * 0x5bd1e995 ...
[ "function", "murmurhash2_32_gc", "(", "str", ")", "{", "var", "l", "=", "str", ".", "length", ";", "var", "h", "=", "l", ";", "var", "i", "=", "0", ";", "var", "k", "=", "undefined", ";", "while", "(", "l", ">=", "4", ")", "{", "k", "=", "str...
JS Implementation of MurmurHash2 @author <a href="mailto:gary.court@gmail.com">Gary Court</a> @see http://github.com/garycourt/murmurhash-js @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a> @see http://sites.google.com/site/murmurhash/ @param {string} str ASCII only @return {string} Base 36 encoded hash...
[ "JS", "Implementation", "of", "MurmurHash2" ]
c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3
https://github.com/jossmac/react-images/blob/c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3/examples/dist/common.js#L608-L642
train
jossmac/react-images
examples/dist/common.js
flush
function flush() { while (index < queue.length) { var currentIndex = index; // Advance the index before calling the task. This ensures that we will // begin flushing on the next task the task throws an error. index = index + 1; queue[currentIndex].call(); // Prevent l...
javascript
function flush() { while (index < queue.length) { var currentIndex = index; // Advance the index before calling the task. This ensures that we will // begin flushing on the next task the task throws an error. index = index + 1; queue[currentIndex].call(); // Prevent l...
[ "function", "flush", "(", ")", "{", "while", "(", "index", "<", "queue", ".", "length", ")", "{", "var", "currentIndex", "=", "index", ";", "// Advance the index before calling the task. This ensures that we will", "// begin flushing on the next task the task throws an error....
The flush function processes all tasks that have been scheduled with `rawAsap` unless and until one of those tasks throws an exception. If a task throws an exception, `flush` ensures that its state will remain consistent and will resume where it left off when called again. However, `flush` does not make any arrangement...
[ "The", "flush", "function", "processes", "all", "tasks", "that", "have", "been", "scheduled", "with", "rawAsap", "unless", "and", "until", "one", "of", "those", "tasks", "throws", "an", "exception", ".", "If", "a", "task", "throws", "an", "exception", "flush...
c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3
https://github.com/jossmac/react-images/blob/c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3/examples/dist/common.js#L782-L807
train
jossmac/react-images
examples/dist/common.js
makeRequestCallFromMutationObserver
function makeRequestCallFromMutationObserver(callback) { var toggle = 1; var observer = new BrowserMutationObserver(callback); var node = document.createTextNode(""); observer.observe(node, {characterData: true}); return function requestCall() { toggle = -toggle; node.data = toggle; ...
javascript
function makeRequestCallFromMutationObserver(callback) { var toggle = 1; var observer = new BrowserMutationObserver(callback); var node = document.createTextNode(""); observer.observe(node, {characterData: true}); return function requestCall() { toggle = -toggle; node.data = toggle; ...
[ "function", "makeRequestCallFromMutationObserver", "(", "callback", ")", "{", "var", "toggle", "=", "1", ";", "var", "observer", "=", "new", "BrowserMutationObserver", "(", "callback", ")", ";", "var", "node", "=", "document", ".", "createTextNode", "(", "\"\"",...
To request a high priority event, we induce a mutation observer by toggling the text of a text node between "1" and "-1".
[ "To", "request", "a", "high", "priority", "event", "we", "induce", "a", "mutation", "observer", "by", "toggling", "the", "text", "of", "a", "text", "node", "between", "1", "and", "-", "1", "." ]
c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3
https://github.com/jossmac/react-images/blob/c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3/examples/dist/common.js#L876-L885
train
jossmac/react-images
examples/dist/common.js
makeRequestCallFromTimer
function makeRequestCallFromTimer(callback) { return function requestCall() { // We dispatch a timeout with a specified delay of 0 for engines that // can reliably accommodate that request. This will usually be snapped // to a 4 milisecond delay, but once we're flushing, there's no delay ...
javascript
function makeRequestCallFromTimer(callback) { return function requestCall() { // We dispatch a timeout with a specified delay of 0 for engines that // can reliably accommodate that request. This will usually be snapped // to a 4 milisecond delay, but once we're flushing, there's no delay ...
[ "function", "makeRequestCallFromTimer", "(", "callback", ")", "{", "return", "function", "requestCall", "(", ")", "{", "// We dispatch a timeout with a specified delay of 0 for engines that", "// can reliably accommodate that request. This will usually be snapped", "// to a 4 milisecond ...
`setTimeout` does not call the passed callback if the delay is less than approximately 7 in web workers in Firefox 8 through 18, and sometimes not even then.
[ "setTimeout", "does", "not", "call", "the", "passed", "callback", "if", "the", "delay", "is", "less", "than", "approximately", "7", "in", "web", "workers", "in", "Firefox", "8", "through", "18", "and", "sometimes", "not", "even", "then", "." ]
c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3
https://github.com/jossmac/react-images/blob/c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3/examples/dist/common.js#L927-L947
train
jossmac/react-images
examples/dist/common.js
createMergedResultFunction
function createMergedResultFunction(one, two) { return function mergedResult() { var a = one.apply(this, arguments); var b = two.apply(this, arguments); if (a == null) { return b; } else if (b == null) { return a; } var c = {}; mergeIntoWithNoDuplicateKeys(c...
javascript
function createMergedResultFunction(one, two) { return function mergedResult() { var a = one.apply(this, arguments); var b = two.apply(this, arguments); if (a == null) { return b; } else if (b == null) { return a; } var c = {}; mergeIntoWithNoDuplicateKeys(c...
[ "function", "createMergedResultFunction", "(", "one", ",", "two", ")", "{", "return", "function", "mergedResult", "(", ")", "{", "var", "a", "=", "one", ".", "apply", "(", "this", ",", "arguments", ")", ";", "var", "b", "=", "two", ".", "apply", "(", ...
Creates a function that invokes two functions and merges their return values. @param {function} one Function to invoke first. @param {function} two Function to invoke second. @return {function} Function that invokes the two argument functions. @private
[ "Creates", "a", "function", "that", "invokes", "two", "functions", "and", "merges", "their", "return", "values", "." ]
c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3
https://github.com/jossmac/react-images/blob/c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3/examples/dist/common.js#L1575-L1589
train
jossmac/react-images
examples/dist/common.js
createChainedFunction
function createChainedFunction(one, two) { return function chainedFunction() { one.apply(this, arguments); two.apply(this, arguments); }; }
javascript
function createChainedFunction(one, two) { return function chainedFunction() { one.apply(this, arguments); two.apply(this, arguments); }; }
[ "function", "createChainedFunction", "(", "one", ",", "two", ")", "{", "return", "function", "chainedFunction", "(", ")", "{", "one", ".", "apply", "(", "this", ",", "arguments", ")", ";", "two", ".", "apply", "(", "this", ",", "arguments", ")", ";", "...
Creates a function that invokes two functions and ignores their return vales. @param {function} one Function to invoke first. @param {function} two Function to invoke second. @return {function} Function that invokes the two argument functions. @private
[ "Creates", "a", "function", "that", "invokes", "two", "functions", "and", "ignores", "their", "return", "vales", "." ]
c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3
https://github.com/jossmac/react-images/blob/c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3/examples/dist/common.js#L1599-L1604
train
jossmac/react-images
examples/dist/common.js
prefixAll
function prefixAll(styles) { Object.keys(styles).forEach(function (property) { var value = styles[property]; if (value instanceof Object && !Array.isArray(value)) { // recurse through nested style objects styles[property] = prefixAll(value); } else { Object.keys(_prefixProps2.default).fo...
javascript
function prefixAll(styles) { Object.keys(styles).forEach(function (property) { var value = styles[property]; if (value instanceof Object && !Array.isArray(value)) { // recurse through nested style objects styles[property] = prefixAll(value); } else { Object.keys(_prefixProps2.default).fo...
[ "function", "prefixAll", "(", "styles", ")", "{", "Object", ".", "keys", "(", "styles", ")", ".", "forEach", "(", "function", "(", "property", ")", "{", "var", "value", "=", "styles", "[", "property", "]", ";", "if", "(", "value", "instanceof", "Object...
Returns a prefixed version of the style object using all vendor prefixes @param {Object} styles - Style object that gets prefixed properties added @returns {Object} - Style object with prefixed properties and values
[ "Returns", "a", "prefixed", "version", "of", "the", "style", "object", "using", "all", "vendor", "prefixes" ]
c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3
https://github.com/jossmac/react-images/blob/c6d9c2b9b92cc02e8fb9bfd5c0550d53aa4a14e3/examples/dist/common.js#L2673-L2700
train