repo
stringclasses
195 values
path
stringlengths
4
99
func_name
stringlengths
0
41
original_string
stringlengths
72
56.1k
language
stringclasses
1 value
code
stringlengths
72
56.1k
code_tokens
listlengths
25
8.12k
docstring
stringlengths
2
12.5k
docstring_tokens
listlengths
1
449
sha
stringclasses
197 values
url
stringlengths
88
186
partition
stringclasses
1 value
summary
stringlengths
8
338
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
SeleniumHQ/selenium
third_party/js/mozmill/shared-modules/modal-dialog.js
mdObserver
function mdObserver(aOpener, aCallback) { this._opener = aOpener; this._callback = aCallback; this._timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); this.exception = null; this.finished = false; }
javascript
function mdObserver(aOpener, aCallback) { this._opener = aOpener; this._callback = aCallback; this._timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); this.exception = null; this.finished = false; }
[ "function", "mdObserver", "(", "aOpener", ",", "aCallback", ")", "{", "this", ".", "_opener", "=", "aOpener", ";", "this", ".", "_callback", "=", "aCallback", ";", "this", ".", "_timer", "=", "Cc", "[", "\"@mozilla.org/timer;1\"", "]", ".", "createInstance",...
Observer object to find the modal dialog spawned by a controller @constructor @class Observer used to find a modal dialog @param {object} aOpener Window which is the opener of the modal dialog @param {function} aCallback The callback handler to use to interact with the modal dialog
[ "Observer", "object", "to", "find", "the", "modal", "dialog", "spawned", "by", "a", "controller" ]
38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd
https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/modal-dialog.js#L55-L62
train
A function that is called when the md - observer is ready.
[ 30522, 3853, 9108, 16429, 8043, 6299, 1006, 20118, 11837, 2121, 1010, 9353, 8095, 5963, 1007, 1063, 2023, 1012, 1035, 16181, 1027, 20118, 11837, 2121, 1025, 2023, 1012, 1035, 2655, 5963, 1027, 9353, 8095, 5963, 1025, 2023, 1012, 1035, 25309...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
ecomfe/zrender
src/Element.js
function (zr) { this.__zr = zr; // 添加动画 var animators = this.animators; if (animators) { for (var i = 0; i < animators.length; i++) { zr.animation.addAnimator(animators[i]); } } if (this.clipPath) { this.clipPath.addSelfToZr(zr); } }
javascript
function (zr) { this.__zr = zr; // 添加动画 var animators = this.animators; if (animators) { for (var i = 0; i < animators.length; i++) { zr.animation.addAnimator(animators[i]); } } if (this.clipPath) { this.clipPath.addSelfToZr(zr); } }
[ "function", "(", "zr", ")", "{", "this", ".", "__zr", "=", "zr", ";", "// 添加动画", "var", "animators", "=", "this", ".", "animators", ";", "if", "(", "animators", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "animators", ".", "length"...
Add self from zrender instance. Not recursively because it will be invoked when element added to storage. @param {module:zrender/ZRender} zr
[ "Add", "self", "from", "zrender", "instance", ".", "Not", "recursively", "because", "it", "will", "be", "invoked", "when", "element", "added", "to", "storage", "." ]
30321b57cba3149c30eacb0c1e18276f0f001b9f
https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/Element.js#L222-L235
train
ZRZR 动画动画动画动画动画动画动画动画动画动画动画动画动画动画动画动
[ 30522, 3853, 1006, 1062, 2099, 1007, 1063, 2023, 1012, 1035, 1035, 1062, 2099, 1027, 1062, 2099, 1025, 1013, 1013, 100, 1779, 100, 100, 13075, 25132, 2015, 1027, 2023, 1012, 25132, 2015, 1025, 2065, 1006, 25132, 2015, 1007, 1063, 2005, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/core/format/NumberFormat.js
parseNumberAndUnit
function parseNumberAndUnit(mUnitPatterns, sValue) { var oBestMatch = { numberValue: undefined, cldrCode: [] }; if (typeof sValue !== "string") { return oBestMatch; } var iBestLength = Number.POSITIVE_INFINITY; var sUnitCode, sKey; for (sUnitCode in mUnitPatterns) { for (sKey in mUnitPatterns[sUnitCode]) { //use only unit patterns if (sKey.indexOf("unitPattern") === 0) { var sUnitPattern = mUnitPatterns[sUnitCode][sKey]; // IMPORTANT: // To increase performance we are using native string operations instead of regex, // to match the patterns against the input. // // sample input: e.g. "mi 12 tsd. ms²" // unit pattern: e.g. "mi {0} ms²" // The smallest resulting number (String length) will be the best match var iNumberPatternIndex = sUnitPattern.indexOf("{0}"); var bContainsExpression = iNumberPatternIndex > -1; if (bContainsExpression) { //escape regex characters to match it properly var sPrefix = sUnitPattern.substring(0, iNumberPatternIndex); var sPostfix = sUnitPattern.substring(iNumberPatternIndex + "{0}".length); var bMatches = sValue.startsWith(sPrefix) && sValue.endsWith(sPostfix); var match = bMatches && sValue.substring(sPrefix.length, sValue.length - sPostfix.length); if (match) { //get the match with the shortest result. // e.g. 1km -> (.+)m -> "1k" -> length 2 // e.g. 1km -> (.+)km -> "1" -> length 1 if (match.length < iBestLength) { iBestLength = match.length; oBestMatch.numberValue = match; oBestMatch.cldrCode = [sUnitCode]; } else if (match.length === iBestLength && oBestMatch.cldrCode.indexOf(sUnitCode) === -1) { //ambiguous unit (en locale) // e.g. 100 c -> (.+) c -> duration-century // e.g. 100 c -> (.+) c -> volume-cup oBestMatch.cldrCode.push(sUnitCode); } } } else if (sUnitPattern === sValue) { oBestMatch.cldrCode = [sUnitCode]; //for units which do not have a number representation, get the number from the pattern var sNumber; if (sKey.endsWith("-zero")) { sNumber = "0"; } else if (sKey.endsWith("-one")) { sNumber = "1"; } else if (sKey.endsWith("-two")) { sNumber = "2"; } oBestMatch.numberValue = sNumber; return oBestMatch; } } } } return oBestMatch; }
javascript
function parseNumberAndUnit(mUnitPatterns, sValue) { var oBestMatch = { numberValue: undefined, cldrCode: [] }; if (typeof sValue !== "string") { return oBestMatch; } var iBestLength = Number.POSITIVE_INFINITY; var sUnitCode, sKey; for (sUnitCode in mUnitPatterns) { for (sKey in mUnitPatterns[sUnitCode]) { //use only unit patterns if (sKey.indexOf("unitPattern") === 0) { var sUnitPattern = mUnitPatterns[sUnitCode][sKey]; // IMPORTANT: // To increase performance we are using native string operations instead of regex, // to match the patterns against the input. // // sample input: e.g. "mi 12 tsd. ms²" // unit pattern: e.g. "mi {0} ms²" // The smallest resulting number (String length) will be the best match var iNumberPatternIndex = sUnitPattern.indexOf("{0}"); var bContainsExpression = iNumberPatternIndex > -1; if (bContainsExpression) { //escape regex characters to match it properly var sPrefix = sUnitPattern.substring(0, iNumberPatternIndex); var sPostfix = sUnitPattern.substring(iNumberPatternIndex + "{0}".length); var bMatches = sValue.startsWith(sPrefix) && sValue.endsWith(sPostfix); var match = bMatches && sValue.substring(sPrefix.length, sValue.length - sPostfix.length); if (match) { //get the match with the shortest result. // e.g. 1km -> (.+)m -> "1k" -> length 2 // e.g. 1km -> (.+)km -> "1" -> length 1 if (match.length < iBestLength) { iBestLength = match.length; oBestMatch.numberValue = match; oBestMatch.cldrCode = [sUnitCode]; } else if (match.length === iBestLength && oBestMatch.cldrCode.indexOf(sUnitCode) === -1) { //ambiguous unit (en locale) // e.g. 100 c -> (.+) c -> duration-century // e.g. 100 c -> (.+) c -> volume-cup oBestMatch.cldrCode.push(sUnitCode); } } } else if (sUnitPattern === sValue) { oBestMatch.cldrCode = [sUnitCode]; //for units which do not have a number representation, get the number from the pattern var sNumber; if (sKey.endsWith("-zero")) { sNumber = "0"; } else if (sKey.endsWith("-one")) { sNumber = "1"; } else if (sKey.endsWith("-two")) { sNumber = "2"; } oBestMatch.numberValue = sNumber; return oBestMatch; } } } } return oBestMatch; }
[ "function", "parseNumberAndUnit", "(", "mUnitPatterns", ",", "sValue", ")", "{", "var", "oBestMatch", "=", "{", "numberValue", ":", "undefined", ",", "cldrCode", ":", "[", "]", "}", ";", "if", "(", "typeof", "sValue", "!==", "\"string\"", ")", "{", "return...
Returns the cldr code and the number value by checking each pattern and finding the best match. 1. iterate over each unit pattern, e.g. "{0}m", "{0}km" 1a. convert it to a reg exp pattern, e.g. "^(.+)m$" 1b. match it with the input "12km" and store the value "12k" and the unit value "m" 1c. do this for each pattern and update the best result if a better match is found A better match means most of the unit value matched and the number match is shorter. E.g. input: 12km matches for the pattern "^(.+)m$" and the resulting value is "12k" while the pattern "^(.+)km$" results in "12". Since pattern "^(.+)km$" returns a shorter result it is considered the better match. Note: the cldr data is not distinct in its patterns. E.g. "100 c" could be in "en_gb" either 100 units of "volume-cup" or "duration-century" both having the same pattern "{0} c" Therefore best matches will be returned in an array. @param {object} mUnitPatterns the unit patterns @param {string} sValue The value e.g. "12 km" @return {object} An object containing the unit codes (key: <code>[cldrCode]</code>) and the number value (key: <code>numberValue</code>). Values are <code>undefined</code> or an empty array if not found. E.g. <code>{ numberValue: 12, cldrCode: [length-kilometer] }</code>
[ "Returns", "the", "cldr", "code", "and", "the", "number", "value", "by", "checking", "each", "pattern", "and", "finding", "the", "best", "match", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/format/NumberFormat.js#L1884-L1955
train
Parses the input value and returns the best match
[ 30522, 3853, 11968, 5054, 29440, 5685, 19496, 2102, 1006, 14163, 3490, 25856, 20097, 3619, 1010, 17917, 2389, 5657, 1007, 1063, 13075, 15578, 3367, 18900, 2818, 1027, 1063, 2193, 10175, 5657, 1024, 6151, 28344, 1010, 18856, 13626, 16044, 1024...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
facebook/relay
packages/relay-runtime/util/getRelayHandleKey.js
getRelayHandleKey
function getRelayHandleKey( handleName: string, key: ?string, fieldName: ?string, ): string { if (key && key !== DEFAULT_HANDLE_KEY) { return `__${key}_${handleName}`; } invariant( fieldName != null, 'getRelayHandleKey: Expected either `fieldName` or `key` in `handle` to be provided', ); return `__${fieldName}_${handleName}`; }
javascript
function getRelayHandleKey( handleName: string, key: ?string, fieldName: ?string, ): string { if (key && key !== DEFAULT_HANDLE_KEY) { return `__${key}_${handleName}`; } invariant( fieldName != null, 'getRelayHandleKey: Expected either `fieldName` or `key` in `handle` to be provided', ); return `__${fieldName}_${handleName}`; }
[ "function", "getRelayHandleKey", "(", "handleName", ":", "string", ",", "key", ":", "?", "string", ",", "fieldName", ":", "?", "string", ",", ")", ":", "string", "{", "if", "(", "key", "&&", "key", "!==", "DEFAULT_HANDLE_KEY", ")", "{", "return", "`", ...
@internal Helper to create a unique name for a handle field based on the handle name, handle key and source field.
[ "@internal" ]
7fb9be5182b9650637d7b92ead9a42713ac30aa4
https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-runtime/util/getRelayHandleKey.js#L23-L37
train
Returns the key for a relay handle
[ 30522, 3853, 2131, 16570, 4710, 11774, 2571, 14839, 1006, 5047, 18442, 1024, 5164, 1010, 3145, 1024, 1029, 5164, 1010, 2492, 18442, 1024, 1029, 5164, 1010, 1007, 1024, 5164, 1063, 2065, 1006, 3145, 1004, 1004, 3145, 999, 1027, 1027, 12398, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
TryGhost/Ghost
core/server/data/importer/index.js
function (directory) { // Globs match content in the root or inside a single directory var extMatchesBase = glob.sync(this.getExtensionGlob(this.getExtensions(), ROOT_OR_SINGLE_DIR), {cwd: directory}), extMatchesAll = glob.sync( this.getExtensionGlob(this.getExtensions(), ALL_DIRS), {cwd: directory} ), dirMatches = glob.sync( this.getDirectoryGlob(this.getDirectories(), ROOT_OR_SINGLE_DIR), {cwd: directory} ), oldRoonMatches = glob.sync(this.getDirectoryGlob(['drafts', 'published', 'deleted'], ROOT_OR_SINGLE_DIR), {cwd: directory}); // This is a temporary extra message for the old format roon export which doesn't work with Ghost if (oldRoonMatches.length > 0) { throw new common.errors.UnsupportedMediaTypeError({message: common.i18n.t('errors.data.importer.index.unsupportedRoonExport')}); } // If this folder contains importable files or a content or images directory if (extMatchesBase.length > 0 || (dirMatches.length > 0 && extMatchesAll.length > 0)) { return true; } if (extMatchesAll.length < 1) { throw new common.errors.UnsupportedMediaTypeError({message: common.i18n.t('errors.data.importer.index.noContentToImport')}); } throw new common.errors.UnsupportedMediaTypeError({message: common.i18n.t('errors.data.importer.index.invalidZipStructure')}); }
javascript
function (directory) { // Globs match content in the root or inside a single directory var extMatchesBase = glob.sync(this.getExtensionGlob(this.getExtensions(), ROOT_OR_SINGLE_DIR), {cwd: directory}), extMatchesAll = glob.sync( this.getExtensionGlob(this.getExtensions(), ALL_DIRS), {cwd: directory} ), dirMatches = glob.sync( this.getDirectoryGlob(this.getDirectories(), ROOT_OR_SINGLE_DIR), {cwd: directory} ), oldRoonMatches = glob.sync(this.getDirectoryGlob(['drafts', 'published', 'deleted'], ROOT_OR_SINGLE_DIR), {cwd: directory}); // This is a temporary extra message for the old format roon export which doesn't work with Ghost if (oldRoonMatches.length > 0) { throw new common.errors.UnsupportedMediaTypeError({message: common.i18n.t('errors.data.importer.index.unsupportedRoonExport')}); } // If this folder contains importable files or a content or images directory if (extMatchesBase.length > 0 || (dirMatches.length > 0 && extMatchesAll.length > 0)) { return true; } if (extMatchesAll.length < 1) { throw new common.errors.UnsupportedMediaTypeError({message: common.i18n.t('errors.data.importer.index.noContentToImport')}); } throw new common.errors.UnsupportedMediaTypeError({message: common.i18n.t('errors.data.importer.index.invalidZipStructure')}); }
[ "function", "(", "directory", ")", "{", "// Globs match content in the root or inside a single directory", "var", "extMatchesBase", "=", "glob", ".", "sync", "(", "this", ".", "getExtensionGlob", "(", "this", ".", "getExtensions", "(", ")", ",", "ROOT_OR_SINGLE_DIR", ...
Checks the content of a zip folder to see if it is valid. Importable content includes any files or directories which the handlers can process Importable content must be found either in the root, or inside one base directory @param {String} directory @returns {Promise}
[ "Checks", "the", "content", "of", "a", "zip", "folder", "to", "see", "if", "it", "is", "valid", ".", "Importable", "content", "includes", "any", "files", "or", "directories", "which", "the", "handlers", "can", "process", "Importable", "content", "must", "be"...
bb7bb55cf3e60af99ebbc56099928827b58461bc
https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/data/importer/index.js#L138-L165
train
Returns true if the directory contains importable files or images
[ 30522, 3853, 1006, 14176, 1007, 1063, 1013, 1013, 1043, 4135, 5910, 2674, 4180, 1999, 1996, 7117, 2030, 2503, 1037, 2309, 14176, 13075, 4654, 29418, 10649, 2229, 15058, 1027, 1043, 4135, 2497, 1012, 26351, 1006, 2023, 1012, 2131, 10288, 290...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
angular/material
src/core/util/animation/animate.js
function (source, destination) { if (!source) return null; destination = destination || {}; angular.forEach('left top right bottom width height'.split(' '), function (key) { destination[key] = Math.round(source[key]); }); destination.width = destination.width || (destination.right - destination.left); destination.height = destination.height || (destination.bottom - destination.top); return destination; }
javascript
function (source, destination) { if (!source) return null; destination = destination || {}; angular.forEach('left top right bottom width height'.split(' '), function (key) { destination[key] = Math.round(source[key]); }); destination.width = destination.width || (destination.right - destination.left); destination.height = destination.height || (destination.bottom - destination.top); return destination; }
[ "function", "(", "source", ",", "destination", ")", "{", "if", "(", "!", "source", ")", "return", "null", ";", "destination", "=", "destination", "||", "{", "}", ";", "angular", ".", "forEach", "(", "'left top right bottom width height'", ".", "split", "(", ...
Clone the Rect and calculate the height/width if needed
[ "Clone", "the", "Rect", "and", "calculate", "the", "height", "/", "width", "if", "needed" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/animation/animate.js#L220-L233
train
Returns the nearest ancestor of source
[ 30522, 3853, 1006, 3120, 1010, 7688, 1007, 1063, 2065, 1006, 999, 3120, 1007, 2709, 19701, 1025, 7688, 1027, 7688, 1064, 1064, 1063, 1065, 1025, 16108, 1012, 18921, 6776, 1006, 1005, 2187, 2327, 2157, 3953, 9381, 4578, 1005, 1012, 3975, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
facebook/create-react-app
packages/react-dev-utils/webpackHotDevClient.js
handleSuccess
function handleSuccess() { clearOutdatedErrors(); var isHotUpdate = !isFirstCompilation; isFirstCompilation = false; hasCompileErrors = false; // Attempt to apply hot updates or reload. if (isHotUpdate) { tryApplyUpdates(function onHotUpdateSuccess() { // Only dismiss it when we're sure it's a hot update. // Otherwise it would flicker right before the reload. tryDismissErrorOverlay(); }); } }
javascript
function handleSuccess() { clearOutdatedErrors(); var isHotUpdate = !isFirstCompilation; isFirstCompilation = false; hasCompileErrors = false; // Attempt to apply hot updates or reload. if (isHotUpdate) { tryApplyUpdates(function onHotUpdateSuccess() { // Only dismiss it when we're sure it's a hot update. // Otherwise it would flicker right before the reload. tryDismissErrorOverlay(); }); } }
[ "function", "handleSuccess", "(", ")", "{", "clearOutdatedErrors", "(", ")", ";", "var", "isHotUpdate", "=", "!", "isFirstCompilation", ";", "isFirstCompilation", "=", "false", ";", "hasCompileErrors", "=", "false", ";", "// Attempt to apply hot updates or reload.", "...
Successful compilation.
[ "Successful", "compilation", "." ]
57ef103440c24e41b0d7dc82b7ad7fc1dc817eca
https://github.com/facebook/create-react-app/blob/57ef103440c24e41b0d7dc82b7ad7fc1dc817eca/packages/react-dev-utils/webpackHotDevClient.js#L97-L112
train
Handle the success of the compilation.
[ 30522, 3853, 16024, 14194, 9623, 2015, 1006, 1007, 1063, 3154, 5833, 13701, 4063, 29165, 2015, 1006, 1007, 1025, 13075, 2003, 12326, 6279, 13701, 1027, 999, 2003, 8873, 12096, 9006, 8197, 13490, 1025, 2003, 8873, 12096, 9006, 8197, 13490, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
openlayers/openlayers
src/ol/format/TopoJSON.js
readMultiLineStringGeometry
function readMultiLineStringGeometry(object, arcs) { const coordinates = []; for (let i = 0, ii = object['arcs'].length; i < ii; ++i) { coordinates[i] = concatenateArcs(object['arcs'][i], arcs); } return new MultiLineString(coordinates); }
javascript
function readMultiLineStringGeometry(object, arcs) { const coordinates = []; for (let i = 0, ii = object['arcs'].length; i < ii; ++i) { coordinates[i] = concatenateArcs(object['arcs'][i], arcs); } return new MultiLineString(coordinates); }
[ "function", "readMultiLineStringGeometry", "(", "object", ",", "arcs", ")", "{", "const", "coordinates", "=", "[", "]", ";", "for", "(", "let", "i", "=", "0", ",", "ii", "=", "object", "[", "'arcs'", "]", ".", "length", ";", "i", "<", "ii", ";", "+...
Create a multi-linestring from a TopoJSON geometry object. @param {TopoJSONMultiLineString} object TopoJSON object. @param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs. @return {MultiLineString} Geometry.
[ "Create", "a", "multi", "-", "linestring", "from", "a", "TopoJSON", "geometry", "object", "." ]
f366eaea522388fb575b11010e69d309164baca7
https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/src/ol/format/TopoJSON.js#L245-L251
train
Read a multi line string geometry from an object
[ 30522, 3853, 3191, 12274, 7096, 18622, 5267, 18886, 3070, 3351, 8462, 11129, 1006, 4874, 1010, 29137, 1007, 1063, 9530, 3367, 12093, 1027, 1031, 1033, 1025, 2005, 1006, 2292, 1045, 1027, 1014, 1010, 2462, 1027, 4874, 1031, 1005, 29137, 1005...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
eslint/eslint
lib/rules/curly.js
isOneLiner
function isOneLiner(node) { const first = sourceCode.getFirstToken(node), last = sourceCode.getLastToken(node); return first.loc.start.line === last.loc.end.line; }
javascript
function isOneLiner(node) { const first = sourceCode.getFirstToken(node), last = sourceCode.getLastToken(node); return first.loc.start.line === last.loc.end.line; }
[ "function", "isOneLiner", "(", "node", ")", "{", "const", "first", "=", "sourceCode", ".", "getFirstToken", "(", "node", ")", ",", "last", "=", "sourceCode", ".", "getLastToken", "(", "node", ")", ";", "return", "first", ".", "loc", ".", "start", ".", ...
Determines if a given node is a one-liner. @param {ASTNode} node The node to check. @returns {boolean} True if the node is a one-liner. @private
[ "Determines", "if", "a", "given", "node", "is", "a", "one", "-", "liner", "." ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/curly.js#L99-L104
train
Check if node is a one - liner
[ 30522, 3853, 11163, 11877, 26455, 1006, 13045, 1007, 1063, 9530, 3367, 2034, 1027, 3120, 16044, 1012, 2131, 8873, 12096, 18715, 2368, 1006, 13045, 1007, 1010, 2197, 1027, 3120, 16044, 1012, 2131, 8523, 9284, 7520, 1006, 13045, 1007, 1025, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
angular/material
release.js
getNewVersion
function getNewVersion () { header(); const options = getVersionOptions(oldVersion); let key, version; log(`The current version is ${oldVersion.cyan}.`); log(''); log('What should the next version be?'); for (key in options) { log((+key + 1) + ') ' + options[ key ].cyan); } log(''); write('Please select a new version: '); const type = prompt(); if (options[ type - 1 ]) version = options[ type - 1 ]; else if (type.match(/^\d+\.\d+\.\d+(-rc\.?\d+)?$/)) version = type; else throw new Error('Your entry was invalid.'); log(''); log('The new version will be ' + version.cyan + '.'); write(`Is this correct? ${"[yes/no]".cyan} `); return prompt() === 'yes' ? version : getNewVersion(); function getVersionOptions (version) { return version.match(/-rc\.?\d+$/) ? [increment(version, 'rc'), increment(version, 'minor')] : [increment(version, 'patch'), addRC(increment(version, 'minor'))]; function increment (versionString, type) { const version = parseVersion(versionString); if (version.rc) { switch (type) { case 'minor': version.rc = 0; break; case 'rc': version.rc++; break; } } else { version[ type ]++; // reset any version numbers lower than the one changed switch (type) { case 'minor': version.patch = 0; case 'patch': version.rc = 0; } } return getVersionString(version); function parseVersion (version) { const parts = version.split(/-rc\.|\./g); return { string: version, major: parts[ 0 ], minor: parts[ 1 ], patch: parts[ 2 ], rc: parts[ 3 ] || 0 }; } function getVersionString (version) { let str = version.major + '.' + version.minor + '.' + version.patch; if (version.rc) str += '-rc.' + version.rc; return str; } } function addRC (str) { return str + '-rc.1'; } } }
javascript
function getNewVersion () { header(); const options = getVersionOptions(oldVersion); let key, version; log(`The current version is ${oldVersion.cyan}.`); log(''); log('What should the next version be?'); for (key in options) { log((+key + 1) + ') ' + options[ key ].cyan); } log(''); write('Please select a new version: '); const type = prompt(); if (options[ type - 1 ]) version = options[ type - 1 ]; else if (type.match(/^\d+\.\d+\.\d+(-rc\.?\d+)?$/)) version = type; else throw new Error('Your entry was invalid.'); log(''); log('The new version will be ' + version.cyan + '.'); write(`Is this correct? ${"[yes/no]".cyan} `); return prompt() === 'yes' ? version : getNewVersion(); function getVersionOptions (version) { return version.match(/-rc\.?\d+$/) ? [increment(version, 'rc'), increment(version, 'minor')] : [increment(version, 'patch'), addRC(increment(version, 'minor'))]; function increment (versionString, type) { const version = parseVersion(versionString); if (version.rc) { switch (type) { case 'minor': version.rc = 0; break; case 'rc': version.rc++; break; } } else { version[ type ]++; // reset any version numbers lower than the one changed switch (type) { case 'minor': version.patch = 0; case 'patch': version.rc = 0; } } return getVersionString(version); function parseVersion (version) { const parts = version.split(/-rc\.|\./g); return { string: version, major: parts[ 0 ], minor: parts[ 1 ], patch: parts[ 2 ], rc: parts[ 3 ] || 0 }; } function getVersionString (version) { let str = version.major + '.' + version.minor + '.' + version.patch; if (version.rc) str += '-rc.' + version.rc; return str; } } function addRC (str) { return str + '-rc.1'; } } }
[ "function", "getNewVersion", "(", ")", "{", "header", "(", ")", ";", "const", "options", "=", "getVersionOptions", "(", "oldVersion", ")", ";", "let", "key", ",", "version", ";", "log", "(", "`", "${", "oldVersion", ".", "cyan", "}", "`", ")", ";", "...
prompts the user for the new version
[ "prompts", "the", "user", "for", "the", "new", "version" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/release.js#L114-L179
train
Get the new version
[ 30522, 3853, 2131, 2638, 2860, 27774, 1006, 1007, 1063, 20346, 1006, 1007, 1025, 9530, 3367, 7047, 1027, 2131, 27774, 7361, 9285, 1006, 2214, 27774, 1007, 1025, 2292, 3145, 1010, 2544, 1025, 8833, 1006, 1036, 1996, 2783, 2544, 2003, 1002, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
ecomfe/zrender
src/graphic/helper/text.js
renderPlainText
function renderPlainText(hostEl, ctx, text, style, rect, prevEl) { 'use strict'; var needDrawBg = needDrawBackground(style); var prevStyle; var checkCache = false; var cachedByMe = ctx.__attrCachedBy === ContextCachedBy.PLAIN_TEXT; // Only take and check cache for `Text` el, but not RectText. if (prevEl !== WILL_BE_RESTORED) { if (prevEl) { prevStyle = prevEl.style; checkCache = !needDrawBg && cachedByMe && prevStyle; } // Prevent from using cache in `Style::bind`, because of the case: // ctx property is modified by other properties than `Style::bind` // used, and Style::bind is called next. ctx.__attrCachedBy = needDrawBg ? ContextCachedBy.NONE : ContextCachedBy.PLAIN_TEXT; } // Since this will be restored, prevent from using these props to check cache in the next // entering of this method. But do not need to clear other cache like `Style::bind`. else if (cachedByMe) { ctx.__attrCachedBy = ContextCachedBy.NONE; } var styleFont = style.font || DEFAULT_FONT; // PENDING // Only `Text` el set `font` and keep it (`RectText` will restore). So theoretically // we can make font cache on ctx, which can cache for text el that are discontinuous. // But layer save/restore needed to be considered. // if (styleFont !== ctx.__fontCache) { // ctx.font = styleFont; // if (prevEl !== WILL_BE_RESTORED) { // ctx.__fontCache = styleFont; // } // } if (!checkCache || styleFont !== (prevStyle.font || DEFAULT_FONT)) { ctx.font = styleFont; } // Use the final font from context-2d, because the final // font might not be the style.font when it is illegal. // But get `ctx.font` might be time consuming. var computedFont = hostEl.__computedFont; if (hostEl.__styleFont !== styleFont) { hostEl.__styleFont = styleFont; computedFont = hostEl.__computedFont = ctx.font; } var textPadding = style.textPadding; var textLineHeight = style.textLineHeight; var contentBlock = hostEl.__textCotentBlock; if (!contentBlock || hostEl.__dirtyText) { contentBlock = hostEl.__textCotentBlock = textContain.parsePlainText( text, computedFont, textPadding, textLineHeight, style.truncate ); } var outerHeight = contentBlock.outerHeight; var textLines = contentBlock.lines; var lineHeight = contentBlock.lineHeight; var boxPos = getBoxPosition(outerHeight, style, rect); var baseX = boxPos.baseX; var baseY = boxPos.baseY; var textAlign = boxPos.textAlign || 'left'; var textVerticalAlign = boxPos.textVerticalAlign; // Origin of textRotation should be the base point of text drawing. applyTextRotation(ctx, style, rect, baseX, baseY); var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign); var textX = baseX; var textY = boxY; if (needDrawBg || textPadding) { // Consider performance, do not call getTextWidth util necessary. var textWidth = textContain.getWidth(text, computedFont); var outerWidth = textWidth; textPadding && (outerWidth += textPadding[1] + textPadding[3]); var boxX = textContain.adjustTextX(baseX, outerWidth, textAlign); needDrawBg && drawBackground(hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight); if (textPadding) { textX = getTextXForPadding(baseX, textAlign, textPadding); textY += textPadding[0]; } } // Always set textAlign and textBase line, because it is difficute to calculate // textAlign from prevEl, and we dont sure whether textAlign will be reset if // font set happened. ctx.textAlign = textAlign; // Force baseline to be "middle". Otherwise, if using "top", the // text will offset downward a little bit in font "Microsoft YaHei". ctx.textBaseline = 'middle'; // Set text opacity ctx.globalAlpha = style.opacity || 1; // Always set shadowBlur and shadowOffset to avoid leak from displayable. for (var i = 0; i < SHADOW_STYLE_COMMON_PROPS.length; i++) { var propItem = SHADOW_STYLE_COMMON_PROPS[i]; var styleProp = propItem[0]; var ctxProp = propItem[1]; var val = style[styleProp]; if (!checkCache || val !== prevStyle[styleProp]) { ctx[ctxProp] = fixShadow(ctx, ctxProp, val || propItem[2]); } } // `textBaseline` is set as 'middle'. textY += lineHeight / 2; var textStrokeWidth = style.textStrokeWidth; var textStrokeWidthPrev = checkCache ? prevStyle.textStrokeWidth : null; var strokeWidthChanged = !checkCache || textStrokeWidth !== textStrokeWidthPrev; var strokeChanged = !checkCache || strokeWidthChanged || style.textStroke !== prevStyle.textStroke; var textStroke = getStroke(style.textStroke, textStrokeWidth); var textFill = getFill(style.textFill); if (textStroke) { if (strokeWidthChanged) { ctx.lineWidth = textStrokeWidth; } if (strokeChanged) { ctx.strokeStyle = textStroke; } } if (textFill) { if (!checkCache || style.textFill !== prevStyle.textFill) { ctx.fillStyle = textFill; } } // Optimize simply, in most cases only one line exists. if (textLines.length === 1) { // Fill after stroke so the outline will not cover the main part. textStroke && ctx.strokeText(textLines[0], textX, textY); textFill && ctx.fillText(textLines[0], textX, textY); } else { for (var i = 0; i < textLines.length; i++) { // Fill after stroke so the outline will not cover the main part. textStroke && ctx.strokeText(textLines[i], textX, textY); textFill && ctx.fillText(textLines[i], textX, textY); textY += lineHeight; } } }
javascript
function renderPlainText(hostEl, ctx, text, style, rect, prevEl) { 'use strict'; var needDrawBg = needDrawBackground(style); var prevStyle; var checkCache = false; var cachedByMe = ctx.__attrCachedBy === ContextCachedBy.PLAIN_TEXT; // Only take and check cache for `Text` el, but not RectText. if (prevEl !== WILL_BE_RESTORED) { if (prevEl) { prevStyle = prevEl.style; checkCache = !needDrawBg && cachedByMe && prevStyle; } // Prevent from using cache in `Style::bind`, because of the case: // ctx property is modified by other properties than `Style::bind` // used, and Style::bind is called next. ctx.__attrCachedBy = needDrawBg ? ContextCachedBy.NONE : ContextCachedBy.PLAIN_TEXT; } // Since this will be restored, prevent from using these props to check cache in the next // entering of this method. But do not need to clear other cache like `Style::bind`. else if (cachedByMe) { ctx.__attrCachedBy = ContextCachedBy.NONE; } var styleFont = style.font || DEFAULT_FONT; // PENDING // Only `Text` el set `font` and keep it (`RectText` will restore). So theoretically // we can make font cache on ctx, which can cache for text el that are discontinuous. // But layer save/restore needed to be considered. // if (styleFont !== ctx.__fontCache) { // ctx.font = styleFont; // if (prevEl !== WILL_BE_RESTORED) { // ctx.__fontCache = styleFont; // } // } if (!checkCache || styleFont !== (prevStyle.font || DEFAULT_FONT)) { ctx.font = styleFont; } // Use the final font from context-2d, because the final // font might not be the style.font when it is illegal. // But get `ctx.font` might be time consuming. var computedFont = hostEl.__computedFont; if (hostEl.__styleFont !== styleFont) { hostEl.__styleFont = styleFont; computedFont = hostEl.__computedFont = ctx.font; } var textPadding = style.textPadding; var textLineHeight = style.textLineHeight; var contentBlock = hostEl.__textCotentBlock; if (!contentBlock || hostEl.__dirtyText) { contentBlock = hostEl.__textCotentBlock = textContain.parsePlainText( text, computedFont, textPadding, textLineHeight, style.truncate ); } var outerHeight = contentBlock.outerHeight; var textLines = contentBlock.lines; var lineHeight = contentBlock.lineHeight; var boxPos = getBoxPosition(outerHeight, style, rect); var baseX = boxPos.baseX; var baseY = boxPos.baseY; var textAlign = boxPos.textAlign || 'left'; var textVerticalAlign = boxPos.textVerticalAlign; // Origin of textRotation should be the base point of text drawing. applyTextRotation(ctx, style, rect, baseX, baseY); var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign); var textX = baseX; var textY = boxY; if (needDrawBg || textPadding) { // Consider performance, do not call getTextWidth util necessary. var textWidth = textContain.getWidth(text, computedFont); var outerWidth = textWidth; textPadding && (outerWidth += textPadding[1] + textPadding[3]); var boxX = textContain.adjustTextX(baseX, outerWidth, textAlign); needDrawBg && drawBackground(hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight); if (textPadding) { textX = getTextXForPadding(baseX, textAlign, textPadding); textY += textPadding[0]; } } // Always set textAlign and textBase line, because it is difficute to calculate // textAlign from prevEl, and we dont sure whether textAlign will be reset if // font set happened. ctx.textAlign = textAlign; // Force baseline to be "middle". Otherwise, if using "top", the // text will offset downward a little bit in font "Microsoft YaHei". ctx.textBaseline = 'middle'; // Set text opacity ctx.globalAlpha = style.opacity || 1; // Always set shadowBlur and shadowOffset to avoid leak from displayable. for (var i = 0; i < SHADOW_STYLE_COMMON_PROPS.length; i++) { var propItem = SHADOW_STYLE_COMMON_PROPS[i]; var styleProp = propItem[0]; var ctxProp = propItem[1]; var val = style[styleProp]; if (!checkCache || val !== prevStyle[styleProp]) { ctx[ctxProp] = fixShadow(ctx, ctxProp, val || propItem[2]); } } // `textBaseline` is set as 'middle'. textY += lineHeight / 2; var textStrokeWidth = style.textStrokeWidth; var textStrokeWidthPrev = checkCache ? prevStyle.textStrokeWidth : null; var strokeWidthChanged = !checkCache || textStrokeWidth !== textStrokeWidthPrev; var strokeChanged = !checkCache || strokeWidthChanged || style.textStroke !== prevStyle.textStroke; var textStroke = getStroke(style.textStroke, textStrokeWidth); var textFill = getFill(style.textFill); if (textStroke) { if (strokeWidthChanged) { ctx.lineWidth = textStrokeWidth; } if (strokeChanged) { ctx.strokeStyle = textStroke; } } if (textFill) { if (!checkCache || style.textFill !== prevStyle.textFill) { ctx.fillStyle = textFill; } } // Optimize simply, in most cases only one line exists. if (textLines.length === 1) { // Fill after stroke so the outline will not cover the main part. textStroke && ctx.strokeText(textLines[0], textX, textY); textFill && ctx.fillText(textLines[0], textX, textY); } else { for (var i = 0; i < textLines.length; i++) { // Fill after stroke so the outline will not cover the main part. textStroke && ctx.strokeText(textLines[i], textX, textY); textFill && ctx.fillText(textLines[i], textX, textY); textY += lineHeight; } } }
[ "function", "renderPlainText", "(", "hostEl", ",", "ctx", ",", "text", ",", "style", ",", "rect", ",", "prevEl", ")", "{", "'use strict'", ";", "var", "needDrawBg", "=", "needDrawBackground", "(", "style", ")", ";", "var", "prevStyle", ";", "var", "checkCa...
Avoid setting to ctx according to prevEl if possible for performance in scenarios of large amount text.
[ "Avoid", "setting", "to", "ctx", "according", "to", "prevEl", "if", "possible", "for", "performance", "in", "scenarios", "of", "large", "amount", "text", "." ]
30321b57cba3149c30eacb0c1e18276f0f001b9f
https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/graphic/helper/text.js#L81-L234
train
Render plain text
[ 30522, 3853, 17552, 24759, 22325, 10288, 2102, 1006, 21071, 1010, 14931, 2595, 1010, 3793, 1010, 2806, 1010, 28667, 2102, 1010, 3653, 15985, 1007, 1063, 1005, 2224, 9384, 1005, 1025, 13075, 2342, 7265, 2860, 2497, 2290, 1027, 2342, 7265, 28...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js
function(oList, iLevel){ oList._iLevel = iLevel; var aLists = oList.getSubLists(); for (var i = 0; i < aLists.length; i++) { setLevel(aLists[i], iLevel + 1); } }
javascript
function(oList, iLevel){ oList._iLevel = iLevel; var aLists = oList.getSubLists(); for (var i = 0; i < aLists.length; i++) { setLevel(aLists[i], iLevel + 1); } }
[ "function", "(", "oList", ",", "iLevel", ")", "{", "oList", ".", "_iLevel", "=", "iLevel", ";", "var", "aLists", "=", "oList", ".", "getSubLists", "(", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "aLists", ".", "length", ";", "i", ...
Sets the level of the list and its sublists
[ "Sets", "the", "level", "of", "the", "list", "and", "its", "sublists" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1223-L1229
train
Sets the level of the list
[ 30522, 3853, 1006, 19330, 2923, 1010, 17869, 15985, 1007, 1063, 19330, 2923, 1012, 1035, 17869, 15985, 1027, 17869, 15985, 1025, 13075, 4862, 12837, 1027, 19330, 2923, 1012, 4152, 12083, 27103, 1006, 1007, 1025, 2005, 1006, 13075, 1045, 1027,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/base/ExpressionParser.js
error
function error(sMessage, sInput, iAt) { var oError = new SyntaxError(sMessage); oError.at = iAt; oError.text = sInput; if (iAt !== undefined) { sMessage += " at position " + iAt; } Log.error(sMessage, sInput, sExpressionParser); throw oError; }
javascript
function error(sMessage, sInput, iAt) { var oError = new SyntaxError(sMessage); oError.at = iAt; oError.text = sInput; if (iAt !== undefined) { sMessage += " at position " + iAt; } Log.error(sMessage, sInput, sExpressionParser); throw oError; }
[ "function", "error", "(", "sMessage", ",", "sInput", ",", "iAt", ")", "{", "var", "oError", "=", "new", "SyntaxError", "(", "sMessage", ")", ";", "oError", ".", "at", "=", "iAt", ";", "oError", ".", "text", "=", "sInput", ";", "if", "(", "iAt", "!=...
Throws a SyntaxError with the given <code>sMessage</code> as <code>message</code>, its <code>at</code> property set to <code>iAt</code> and its <code>text</code> property to <code>sInput</code>. In addition, logs a corresponding error message to the console with <code>sInput</code> as details. @param {string} sMessage - the error message @param {string} sInput - the input string @param {int} [iAt] - the index in the input string where the error occurred; the index starts counting at 1 to be consistent with positions provided in tokenizer error messages.
[ "Throws", "a", "SyntaxError", "with", "the", "given", "<code", ">", "sMessage<", "/", "code", ">", "as", "<code", ">", "message<", "/", "code", ">", "its", "<code", ">", "at<", "/", "code", ">", "property", "set", "to", "<code", ">", "iAt<", "/", "co...
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/ExpressionParser.js#L491-L501
train
Error handler for syntax error
[ 30522, 3853, 7561, 1006, 15488, 7971, 4270, 1010, 8254, 18780, 1010, 30524, 1025, 2065, 1006, 24264, 2102, 999, 1027, 1027, 6151, 28344, 1007, 1063, 15488, 7971, 4270, 1009, 1027, 1000, 2012, 2597, 1000, 1009, 24264, 2102, 1025, 1065, 8833,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jakesgordon/javascript-state-machine
src/config.js
Config
function Config(options, StateMachine) { options = options || {}; this.options = options; // preserving original options can be useful (e.g visualize plugin) this.defaults = StateMachine.defaults; this.states = []; this.transitions = []; this.map = {}; this.lifecycle = this.configureLifecycle(); this.init = this.configureInitTransition(options.init); this.data = this.configureData(options.data); this.methods = this.configureMethods(options.methods); this.map[this.defaults.wildcard] = {}; this.configureTransitions(options.transitions || []); this.plugins = this.configurePlugins(options.plugins, StateMachine.plugin); }
javascript
function Config(options, StateMachine) { options = options || {}; this.options = options; // preserving original options can be useful (e.g visualize plugin) this.defaults = StateMachine.defaults; this.states = []; this.transitions = []; this.map = {}; this.lifecycle = this.configureLifecycle(); this.init = this.configureInitTransition(options.init); this.data = this.configureData(options.data); this.methods = this.configureMethods(options.methods); this.map[this.defaults.wildcard] = {}; this.configureTransitions(options.transitions || []); this.plugins = this.configurePlugins(options.plugins, StateMachine.plugin); }
[ "function", "Config", "(", "options", ",", "StateMachine", ")", "{", "options", "=", "options", "||", "{", "}", ";", "this", ".", "options", "=", "options", ";", "// preserving original options can be useful (e.g visualize plugin)", "this", ".", "defaults", "=", "...
-------------------------------------------------------------------------------------------------
[ "-------------------------------------------------------------------------------------------------" ]
0d603577423244228cebcd62e60dbbfff27c6ea3
https://github.com/jakesgordon/javascript-state-machine/blob/0d603577423244228cebcd62e60dbbfff27c6ea3/src/config.js#L10-L30
train
Config constructor.
[ 30522, 3853, 9530, 8873, 2290, 1006, 7047, 1010, 2110, 22911, 14014, 1007, 1063, 7047, 1027, 7047, 1064, 1064, 1063, 1065, 1025, 2023, 1012, 7047, 1027, 7047, 1025, 1013, 1013, 15224, 2434, 7047, 2064, 2022, 6179, 1006, 1041, 1012, 1043, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.rta/src/sap/ui/rta/plugin/RTAElementMover.js
fnIsValidForMove
function fnIsValidForMove(oOverlay, bOnRegistration) { var bValid = false, oDesignTimeMetadata = oOverlay.getDesignTimeMetadata(), oParentElementOverlay = oOverlay.getParentElementOverlay(); if (!oDesignTimeMetadata || !oParentElementOverlay) { return false; } var oRelevantContainer = oOverlay.getRelevantContainer(); var oRelevantContainerOverlay = OverlayRegistry.getOverlay(oRelevantContainer); if (!oRelevantContainerOverlay) { return false; } bValid = this.isMoveAvailableOnRelevantContainer(oOverlay); if (bValid) { bValid = this.oBasePlugin.hasStableId(oOverlay) && this.oBasePlugin.hasStableId(oParentElementOverlay) && this.oBasePlugin.hasStableId(oRelevantContainerOverlay); } // element is only valid for move if it can be moved to somewhere else if (bValid) { var aOverlays = OverlayUtil.findAllUniqueAggregationOverlaysInContainer(oOverlay, oRelevantContainerOverlay); var aValidAggregationOverlays = aOverlays.filter(function(oAggregationOverlay) { return this.checkTargetZone(oAggregationOverlay, oOverlay, bOnRegistration); }.bind(this)); if (aValidAggregationOverlays.length < 1) { bValid = false; } else if (aValidAggregationOverlays.length === 1) { var aVisibleOverlays = aValidAggregationOverlays[0].getChildren().filter(function(oChildOverlay) { var oChildElement = oChildOverlay.getElement(); // At least one sibling has to be visible and still attached to the parent // In some edge cases, the child element is not available anymore (element already got destroyed) return (oChildElement && oChildElement.getVisible() && oChildElement.getParent()); }); bValid = aVisibleOverlays.length > 1; } } return bValid; }
javascript
function fnIsValidForMove(oOverlay, bOnRegistration) { var bValid = false, oDesignTimeMetadata = oOverlay.getDesignTimeMetadata(), oParentElementOverlay = oOverlay.getParentElementOverlay(); if (!oDesignTimeMetadata || !oParentElementOverlay) { return false; } var oRelevantContainer = oOverlay.getRelevantContainer(); var oRelevantContainerOverlay = OverlayRegistry.getOverlay(oRelevantContainer); if (!oRelevantContainerOverlay) { return false; } bValid = this.isMoveAvailableOnRelevantContainer(oOverlay); if (bValid) { bValid = this.oBasePlugin.hasStableId(oOverlay) && this.oBasePlugin.hasStableId(oParentElementOverlay) && this.oBasePlugin.hasStableId(oRelevantContainerOverlay); } // element is only valid for move if it can be moved to somewhere else if (bValid) { var aOverlays = OverlayUtil.findAllUniqueAggregationOverlaysInContainer(oOverlay, oRelevantContainerOverlay); var aValidAggregationOverlays = aOverlays.filter(function(oAggregationOverlay) { return this.checkTargetZone(oAggregationOverlay, oOverlay, bOnRegistration); }.bind(this)); if (aValidAggregationOverlays.length < 1) { bValid = false; } else if (aValidAggregationOverlays.length === 1) { var aVisibleOverlays = aValidAggregationOverlays[0].getChildren().filter(function(oChildOverlay) { var oChildElement = oChildOverlay.getElement(); // At least one sibling has to be visible and still attached to the parent // In some edge cases, the child element is not available anymore (element already got destroyed) return (oChildElement && oChildElement.getVisible() && oChildElement.getParent()); }); bValid = aVisibleOverlays.length > 1; } } return bValid; }
[ "function", "fnIsValidForMove", "(", "oOverlay", ",", "bOnRegistration", ")", "{", "var", "bValid", "=", "false", ",", "oDesignTimeMetadata", "=", "oOverlay", ".", "getDesignTimeMetadata", "(", ")", ",", "oParentElementOverlay", "=", "oOverlay", ".", "getParentEleme...
Check if the element is editable for the move @param {sap.ui.dt.Overlay} oOverlay The overlay being moved or the aggregation overlay @param {boolean} bOnRegistration if embedded, false if not @return {boolean} true if editable
[ "Check", "if", "the", "element", "is", "editable", "for", "the", "move" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/plugin/RTAElementMover.js#L108-L153
train
Checks if the given Overlay is valid for move.
[ 30522, 3853, 1042, 8977, 10175, 3593, 14192, 21818, 1006, 1051, 7840, 8485, 1010, 14753, 2890, 24063, 8156, 1007, 1063, 13075, 1038, 10175, 3593, 1027, 6270, 1010, 24040, 5332, 16206, 7292, 11368, 8447, 2696, 1027, 1051, 7840, 8485, 1012, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/incubator-echarts
src/util/graphic.js
centerGraphic
function centerGraphic(rect, boundingRect) { // Set rect to center, keep width / height ratio. var aspect = boundingRect.width / boundingRect.height; var width = rect.height * aspect; var height; if (width <= rect.width) { height = rect.height; } else { width = rect.width; height = width / aspect; } var cx = rect.x + rect.width / 2; var cy = rect.y + rect.height / 2; return { x: cx - width / 2, y: cy - height / 2, width: width, height: height }; }
javascript
function centerGraphic(rect, boundingRect) { // Set rect to center, keep width / height ratio. var aspect = boundingRect.width / boundingRect.height; var width = rect.height * aspect; var height; if (width <= rect.width) { height = rect.height; } else { width = rect.width; height = width / aspect; } var cx = rect.x + rect.width / 2; var cy = rect.y + rect.height / 2; return { x: cx - width / 2, y: cy - height / 2, width: width, height: height }; }
[ "function", "centerGraphic", "(", "rect", ",", "boundingRect", ")", "{", "// Set rect to center, keep width / height ratio.", "var", "aspect", "=", "boundingRect", ".", "width", "/", "boundingRect", ".", "height", ";", "var", "width", "=", "rect", ".", "height", "...
Get position of centered element in bounding box. @param {Object} rect element local bounding box @param {Object} boundingRect constraint bounding box @return {Object} element position containing x, y, width, and height
[ "Get", "position", "of", "centered", "element", "in", "bounding", "box", "." ]
4d0ea095dc3929cb6de40c45748826e7999c7aa8
https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/util/graphic.js#L130-L151
train
Center the image in the cluster
[ 30522, 3853, 2415, 14773, 1006, 28667, 2102, 1010, 5391, 2075, 2890, 6593, 1007, 1063, 1013, 1013, 2275, 28667, 2102, 2000, 2415, 1010, 2562, 9381, 1013, 4578, 6463, 1012, 13075, 7814, 1027, 5391, 2075, 2890, 6593, 1012, 9381, 1013, 5391, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js
function (oInterface, oPathValue) { var bExpression = oPathValue.asExpression, aParts = [], oResult, aResults = []; // needed so that we can safely call the forEach Basics.expectType(oPathValue, "array"); oPathValue.value.forEach(function (oUnused, i) { // an embedded concat must use expression binding oResult = Expression.parameter(oInterface, oPathValue, i); // if any parameter is type expression, the concat must become expression, too bExpression = bExpression || oResult.result === "expression"; aResults.push(oResult); }); // convert the results to strings after we know whether the result is expression aResults.forEach(function (oResult) { if (bExpression) { // the expression might have a lower operator precedence than '+' Expression.wrapExpression(oResult); } if (oResult.type !== 'edm:Null') { // ignore null (otherwise the string 'null' would appear in expressions) aParts.push(Basics.resultToString(oResult, bExpression, oPathValue.withType)); } }); oResult = bExpression ? {result : "expression", value : aParts.join("+")} : {result : "composite", value : aParts.join("")}; oResult.type = "Edm.String"; return oResult; }
javascript
function (oInterface, oPathValue) { var bExpression = oPathValue.asExpression, aParts = [], oResult, aResults = []; // needed so that we can safely call the forEach Basics.expectType(oPathValue, "array"); oPathValue.value.forEach(function (oUnused, i) { // an embedded concat must use expression binding oResult = Expression.parameter(oInterface, oPathValue, i); // if any parameter is type expression, the concat must become expression, too bExpression = bExpression || oResult.result === "expression"; aResults.push(oResult); }); // convert the results to strings after we know whether the result is expression aResults.forEach(function (oResult) { if (bExpression) { // the expression might have a lower operator precedence than '+' Expression.wrapExpression(oResult); } if (oResult.type !== 'edm:Null') { // ignore null (otherwise the string 'null' would appear in expressions) aParts.push(Basics.resultToString(oResult, bExpression, oPathValue.withType)); } }); oResult = bExpression ? {result : "expression", value : aParts.join("+")} : {result : "composite", value : aParts.join("")}; oResult.type = "Edm.String"; return oResult; }
[ "function", "(", "oInterface", ",", "oPathValue", ")", "{", "var", "bExpression", "=", "oPathValue", ".", "asExpression", ",", "aParts", "=", "[", "]", ",", "oResult", ",", "aResults", "=", "[", "]", ";", "// needed so that we can safely call the forEach", "Basi...
Handling of "14.5.3.1.1 Function odata.concat". @param {sap.ui.core.util.XMLPreprocessor.IContext|sap.ui.model.Context} oInterface the callback interface related to the current formatter call @param {object} oPathValue path and value information pointing to the parameters array (see Expression object) @returns {object} the result object
[ "Handling", "of", "14", ".", "5", ".", "3", ".", "1", ".", "1", "Function", "odata", ".", "concat", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js#L190-L221
train
Converts an array of parameters to strings
[ 30522, 3853, 1006, 1051, 18447, 2121, 12172, 1010, 6728, 8988, 10175, 5657, 1007, 1063, 13075, 2022, 2595, 20110, 3258, 1027, 6728, 8988, 10175, 5657, 1012, 2004, 10288, 20110, 3258, 1010, 4237, 2015, 1027, 1031, 1033, 1010, 10848, 23722, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.m/src/sap/m/HyphenationSupport.js
diffTexts
function diffTexts(mTextsMain, mTextsToDiff) { var aDiffs = []; Object.keys(mTextsMain).forEach(function(sKey) { if (!(sKey in mTextsToDiff && mTextsMain[sKey] === mTextsToDiff[sKey])) { aDiffs.push(sKey); } }); return aDiffs; }
javascript
function diffTexts(mTextsMain, mTextsToDiff) { var aDiffs = []; Object.keys(mTextsMain).forEach(function(sKey) { if (!(sKey in mTextsToDiff && mTextsMain[sKey] === mTextsToDiff[sKey])) { aDiffs.push(sKey); } }); return aDiffs; }
[ "function", "diffTexts", "(", "mTextsMain", ",", "mTextsToDiff", ")", "{", "var", "aDiffs", "=", "[", "]", ";", "Object", ".", "keys", "(", "mTextsMain", ")", ".", "forEach", "(", "function", "(", "sKey", ")", "{", "if", "(", "!", "(", "sKey", "in", ...
Checks which keys are not present in mTextsToDiff or their values are different @param {map} mTextsMain The map of texts to compare @param {map} mTextsToDiff The map of texts to compare against @returns {Array} An array containing all keys for which there is difference @private
[ "Checks", "which", "keys", "are", "not", "present", "in", "mTextsToDiff", "or", "their", "values", "are", "different" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/HyphenationSupport.js#L89-L97
train
diff text objects
[ 30522, 3853, 4487, 4246, 18209, 2015, 1006, 11047, 10288, 3215, 24238, 1010, 11047, 10288, 3215, 3406, 4305, 4246, 1007, 1063, 13075, 27133, 21807, 1027, 1031, 1033, 1025, 4874, 1012, 6309, 1006, 11047, 10288, 3215, 24238, 1007, 1012, 18921, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
dcloudio/mui
js/mui.jsonp.js
function(url, data, jsonpParam, callbacnName) { if (jsonpParam) { url = url.replace(jsonpParam + '=?', jsonpParam + '=' + callbacnName); } else { data['callback'] = callbacnName; } var buffer = []; for (var key in data) { buffer.push(key + '=' + encodeURIComponent(data[key])); } return url + (url.indexOf('?') > -1 ? '&' : '?') + buffer.join('&'); }
javascript
function(url, data, jsonpParam, callbacnName) { if (jsonpParam) { url = url.replace(jsonpParam + '=?', jsonpParam + '=' + callbacnName); } else { data['callback'] = callbacnName; } var buffer = []; for (var key in data) { buffer.push(key + '=' + encodeURIComponent(data[key])); } return url + (url.indexOf('?') > -1 ? '&' : '?') + buffer.join('&'); }
[ "function", "(", "url", ",", "data", ",", "jsonpParam", ",", "callbacnName", ")", "{", "if", "(", "jsonpParam", ")", "{", "url", "=", "url", ".", "replace", "(", "jsonpParam", "+", "'=?'", ",", "jsonpParam", "+", "'='", "+", "callbacnName", ")", ";", ...
转换 URL,JSONP 只支持 get 方式的 queryString ,需将 data 拼入 url
[ "转换", "URL,JSONP", "只支持", "get", "方式的", "queryString", "需将", "data", "拼入", "url" ]
ff74c90a1671a552f3604b1288bf38a4126312d0
https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/js/mui.jsonp.js#L30-L41
train
Add callback to url
[ 30522, 3853, 1006, 24471, 2140, 1010, 2951, 1010, 1046, 3385, 13944, 6444, 1010, 2655, 3676, 2278, 9516, 4168, 1007, 1063, 2065, 1006, 1046, 3385, 13944, 6444, 1007, 1063, 24471, 2140, 1027, 24471, 2140, 1012, 5672, 1006, 1046, 3385, 13944,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/jquery.sap.history.js
onHashChange
function onHashChange(sHash){ var oRoute, iStep, oParsedHash, iNewHashIndex, sNavType; //handle the nonbookmarkable hash if (currentHash === undefined) { //url with hash opened from bookmark oParsedHash = parseHashToObject(sHash); if (!oParsedHash || !oParsedHash.bBookmarkable) { if (jQuery.isFunction(defaultHandler)) { defaultHandler(jQuery.sap.history.NavType.Bookmark); } return; } } if (sHash.length === 0) { if (jQuery.isFunction(defaultHandler)) { defaultHandler(jQuery.sap.history.NavType.Back); } } else { //application restored from bookmark with non-empty hash, and later navigates back to the first hash token //the defaultHandler should be triggered iNewHashIndex = hashHistory.indexOf(sHash); if (iNewHashIndex === 0) { oParsedHash = parseHashToObject(sHash); if (!oParsedHash || !oParsedHash.bBookmarkable) { if (jQuery.isFunction(defaultHandler)) { defaultHandler(jQuery.sap.history.NavType.Back); } return; } } //need to handle when iNewHashIndex equals -1. //This happens when user navigates out the current application, and later navigates back. //In this case, the hashHistory is an empty array. if (isVirtualHash(sHash)) { //this is a virtual history, should do the skipping calculation if (isVirtualHash(currentHash)) { //go back to the first one that is not virtual iStep = calcStepsToRealHistory(sHash, false); window.history.go(iStep); } else { var sameFamilyRegex = new RegExp(escapeRegExp(currentHash + skipSuffix) + "[0-9]*$"); if (sameFamilyRegex.test(sHash)) { //going forward //search forward in history for the first non-virtual hash //if there is, change to that one window.history.go //if not, stay and return false iStep = calcStepsToRealHistory(sHash, true); if (iStep) { window.history.go(iStep); } else { window.history.back(); } } else { //going backward //search backward for the first non-virtual hash and there must be one iStep = calcStepsToRealHistory(sHash, false); window.history.go(iStep); } } } else { if (iNewHashIndex === -1) { sNavType = jQuery.sap.history.NavType.Unknown; hashHistory.push(sHash); } else { if (hashHistory.indexOf(currentHash, iNewHashIndex + 1) === -1) { sNavType = jQuery.sap.history.NavType.Forward; } else { sNavType = jQuery.sap.history.NavType.Back; } } oParsedHash = parseHashToObject(sHash); if (oParsedHash) { oRoute = findRouteByIdentifier(oParsedHash.sIdentifier); if (oRoute) { oRoute.action.apply(null, [oParsedHash.oStateData, sNavType]); } } else { Log.error("hash format error! The current Hash: " + sHash); } } } }
javascript
function onHashChange(sHash){ var oRoute, iStep, oParsedHash, iNewHashIndex, sNavType; //handle the nonbookmarkable hash if (currentHash === undefined) { //url with hash opened from bookmark oParsedHash = parseHashToObject(sHash); if (!oParsedHash || !oParsedHash.bBookmarkable) { if (jQuery.isFunction(defaultHandler)) { defaultHandler(jQuery.sap.history.NavType.Bookmark); } return; } } if (sHash.length === 0) { if (jQuery.isFunction(defaultHandler)) { defaultHandler(jQuery.sap.history.NavType.Back); } } else { //application restored from bookmark with non-empty hash, and later navigates back to the first hash token //the defaultHandler should be triggered iNewHashIndex = hashHistory.indexOf(sHash); if (iNewHashIndex === 0) { oParsedHash = parseHashToObject(sHash); if (!oParsedHash || !oParsedHash.bBookmarkable) { if (jQuery.isFunction(defaultHandler)) { defaultHandler(jQuery.sap.history.NavType.Back); } return; } } //need to handle when iNewHashIndex equals -1. //This happens when user navigates out the current application, and later navigates back. //In this case, the hashHistory is an empty array. if (isVirtualHash(sHash)) { //this is a virtual history, should do the skipping calculation if (isVirtualHash(currentHash)) { //go back to the first one that is not virtual iStep = calcStepsToRealHistory(sHash, false); window.history.go(iStep); } else { var sameFamilyRegex = new RegExp(escapeRegExp(currentHash + skipSuffix) + "[0-9]*$"); if (sameFamilyRegex.test(sHash)) { //going forward //search forward in history for the first non-virtual hash //if there is, change to that one window.history.go //if not, stay and return false iStep = calcStepsToRealHistory(sHash, true); if (iStep) { window.history.go(iStep); } else { window.history.back(); } } else { //going backward //search backward for the first non-virtual hash and there must be one iStep = calcStepsToRealHistory(sHash, false); window.history.go(iStep); } } } else { if (iNewHashIndex === -1) { sNavType = jQuery.sap.history.NavType.Unknown; hashHistory.push(sHash); } else { if (hashHistory.indexOf(currentHash, iNewHashIndex + 1) === -1) { sNavType = jQuery.sap.history.NavType.Forward; } else { sNavType = jQuery.sap.history.NavType.Back; } } oParsedHash = parseHashToObject(sHash); if (oParsedHash) { oRoute = findRouteByIdentifier(oParsedHash.sIdentifier); if (oRoute) { oRoute.action.apply(null, [oParsedHash.oStateData, sNavType]); } } else { Log.error("hash format error! The current Hash: " + sHash); } } } }
[ "function", "onHashChange", "(", "sHash", ")", "{", "var", "oRoute", ",", "iStep", ",", "oParsedHash", ",", "iNewHashIndex", ",", "sNavType", ";", "//handle the nonbookmarkable hash", "if", "(", "currentHash", "===", "undefined", ")", "{", "//url with hash opened fr...
This is the main function that handles the hash change event. @private
[ "This", "is", "the", "main", "function", "that", "handles", "the", "hash", "change", "event", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/jquery.sap.history.js#L577-L669
train
This function is called when the hash is changed
[ 30522, 3853, 2006, 14949, 16257, 18003, 2063, 1006, 21146, 4095, 1007, 1063, 13075, 20298, 10421, 1010, 21541, 13699, 1010, 6728, 11650, 2098, 14949, 2232, 1010, 1999, 7974, 14949, 10606, 3207, 2595, 1010, 1055, 2532, 2615, 13874, 1025, 1013,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
nhn/tui.editor
src/js/wysiwygCommands/code.js
styleCode
function styleCode(editor, sq) { if (!sq.hasFormat('PRE') && sq.hasFormat('code')) { sq.changeFormat(null, {tag: 'code'}); removeUnnecessaryCodeInNextToRange(editor.getSelection().cloneRange()); } else if (!sq.hasFormat('a') && !sq.hasFormat('PRE')) { if (sq.hasFormat('b')) { sq.removeBold(); } else if (sq.hasFormat('i')) { sq.removeItalic(); } sq.changeFormat({tag: 'code'}); const range = sq.getSelection().cloneRange(); range.setStart(range.endContainer, range.endOffset); range.collapse(true); sq.setSelection(range); } }
javascript
function styleCode(editor, sq) { if (!sq.hasFormat('PRE') && sq.hasFormat('code')) { sq.changeFormat(null, {tag: 'code'}); removeUnnecessaryCodeInNextToRange(editor.getSelection().cloneRange()); } else if (!sq.hasFormat('a') && !sq.hasFormat('PRE')) { if (sq.hasFormat('b')) { sq.removeBold(); } else if (sq.hasFormat('i')) { sq.removeItalic(); } sq.changeFormat({tag: 'code'}); const range = sq.getSelection().cloneRange(); range.setStart(range.endContainer, range.endOffset); range.collapse(true); sq.setSelection(range); } }
[ "function", "styleCode", "(", "editor", ",", "sq", ")", "{", "if", "(", "!", "sq", ".", "hasFormat", "(", "'PRE'", ")", "&&", "sq", ".", "hasFormat", "(", "'code'", ")", ")", "{", "sq", ".", "changeFormat", "(", "null", ",", "{", "tag", ":", "'co...
Style code. @param {object} editor - editor instance @param {object} sq - squire editor instance
[ "Style", "code", "." ]
e75ab08c2a7ab07d1143e318f7cde135c5e3002e
https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/wysiwygCommands/code.js#L62-L81
train
Style code in the editor
[ 30522, 3853, 2806, 16044, 1006, 3559, 1010, 5490, 1007, 1063, 2065, 1006, 999, 5490, 1012, 2038, 14192, 4017, 1006, 1005, 3653, 1005, 1007, 1004, 1004, 5490, 1012, 2038, 14192, 4017, 1006, 1005, 3642, 1005, 1007, 1007, 1063, 5490, 1012, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
angular/material
src/components/menu/js/menuServiceProvider.js
calculateMenuPosition
function calculateMenuPosition(el, opts) { var containerNode = el[0], openMenuNode = el[0].firstElementChild, openMenuNodeRect = openMenuNode.getBoundingClientRect(), boundryNode = $document[0].body, boundryNodeRect = boundryNode.getBoundingClientRect(); var menuStyle = $window.getComputedStyle(openMenuNode); var originNode = opts.target[0].querySelector(prefixer.buildSelector('md-menu-origin')) || opts.target[0], originNodeRect = originNode.getBoundingClientRect(); var bounds = { left: boundryNodeRect.left + MENU_EDGE_MARGIN, top: Math.max(boundryNodeRect.top, 0) + MENU_EDGE_MARGIN, bottom: Math.max(boundryNodeRect.bottom, Math.max(boundryNodeRect.top, 0) + boundryNodeRect.height) - MENU_EDGE_MARGIN, right: boundryNodeRect.right - MENU_EDGE_MARGIN }; var alignTarget, alignTargetRect = { top:0, left : 0, right:0, bottom:0 }, existingOffsets = { top:0, left : 0, right:0, bottom:0 }; var positionMode = opts.mdMenuCtrl.positionMode(); if (positionMode.top === 'target' || positionMode.left === 'target' || positionMode.left === 'target-right') { alignTarget = firstVisibleChild(); if (alignTarget) { // TODO: Allow centering on an arbitrary node, for now center on first menu-item's child alignTarget = alignTarget.firstElementChild || alignTarget; alignTarget = alignTarget.querySelector(prefixer.buildSelector('md-menu-align-target')) || alignTarget; alignTargetRect = alignTarget.getBoundingClientRect(); existingOffsets = { top: parseFloat(containerNode.style.top || 0), left: parseFloat(containerNode.style.left || 0) }; } } var position = {}; var transformOrigin = 'top '; switch (positionMode.top) { case 'target': position.top = existingOffsets.top + originNodeRect.top - alignTargetRect.top; break; case 'cascade': position.top = originNodeRect.top - parseFloat(menuStyle.paddingTop) - originNode.style.top; break; case 'bottom': position.top = originNodeRect.top + originNodeRect.height; break; default: throw new Error('Invalid target mode "' + positionMode.top + '" specified for md-menu on Y axis.'); } var rtl = ($mdUtil.bidi() === 'rtl'); switch (positionMode.left) { case 'target': position.left = existingOffsets.left + originNodeRect.left - alignTargetRect.left; transformOrigin += rtl ? 'right' : 'left'; break; case 'target-left': position.left = originNodeRect.left; transformOrigin += 'left'; break; case 'target-right': position.left = originNodeRect.right - openMenuNodeRect.width + (openMenuNodeRect.right - alignTargetRect.right); transformOrigin += 'right'; break; case 'cascade': var willFitRight = rtl ? (originNodeRect.left - openMenuNodeRect.width) < bounds.left : (originNodeRect.right + openMenuNodeRect.width) < bounds.right; position.left = willFitRight ? originNodeRect.right - originNode.style.left : originNodeRect.left - originNode.style.left - openMenuNodeRect.width; transformOrigin += willFitRight ? 'left' : 'right'; break; case 'right': if (rtl) { position.left = originNodeRect.right - originNodeRect.width; transformOrigin += 'left'; } else { position.left = originNodeRect.right - openMenuNodeRect.width; transformOrigin += 'right'; } break; case 'left': if (rtl) { position.left = originNodeRect.right - openMenuNodeRect.width; transformOrigin += 'right'; } else { position.left = originNodeRect.left; transformOrigin += 'left'; } break; default: throw new Error('Invalid target mode "' + positionMode.left + '" specified for md-menu on X axis.'); } var offsets = opts.mdMenuCtrl.offsets(); position.top += offsets.top; position.left += offsets.left; clamp(position); var scaleX = Math.round(100 * Math.min(originNodeRect.width / containerNode.offsetWidth, 1.0)) / 100; var scaleY = Math.round(100 * Math.min(originNodeRect.height / containerNode.offsetHeight, 1.0)) / 100; return { top: Math.round(position.top), left: Math.round(position.left), // Animate a scale out if we aren't just repositioning transform: !opts.alreadyOpen ? $mdUtil.supplant('scale({0},{1})', [scaleX, scaleY]) : undefined, transformOrigin: transformOrigin }; /** * Clamps the repositioning of the menu within the confines of * bounding element (often the screen/body) */ function clamp(pos) { pos.top = Math.max(Math.min(pos.top, bounds.bottom - containerNode.offsetHeight), bounds.top); pos.left = Math.max(Math.min(pos.left, bounds.right - containerNode.offsetWidth), bounds.left); } /** * Gets the first visible child in the openMenuNode * Necessary incase menu nodes are being dynamically hidden */ function firstVisibleChild() { for (var i = 0; i < openMenuNode.children.length; ++i) { if ($window.getComputedStyle(openMenuNode.children[i]).display != 'none') { return openMenuNode.children[i]; } } } }
javascript
function calculateMenuPosition(el, opts) { var containerNode = el[0], openMenuNode = el[0].firstElementChild, openMenuNodeRect = openMenuNode.getBoundingClientRect(), boundryNode = $document[0].body, boundryNodeRect = boundryNode.getBoundingClientRect(); var menuStyle = $window.getComputedStyle(openMenuNode); var originNode = opts.target[0].querySelector(prefixer.buildSelector('md-menu-origin')) || opts.target[0], originNodeRect = originNode.getBoundingClientRect(); var bounds = { left: boundryNodeRect.left + MENU_EDGE_MARGIN, top: Math.max(boundryNodeRect.top, 0) + MENU_EDGE_MARGIN, bottom: Math.max(boundryNodeRect.bottom, Math.max(boundryNodeRect.top, 0) + boundryNodeRect.height) - MENU_EDGE_MARGIN, right: boundryNodeRect.right - MENU_EDGE_MARGIN }; var alignTarget, alignTargetRect = { top:0, left : 0, right:0, bottom:0 }, existingOffsets = { top:0, left : 0, right:0, bottom:0 }; var positionMode = opts.mdMenuCtrl.positionMode(); if (positionMode.top === 'target' || positionMode.left === 'target' || positionMode.left === 'target-right') { alignTarget = firstVisibleChild(); if (alignTarget) { // TODO: Allow centering on an arbitrary node, for now center on first menu-item's child alignTarget = alignTarget.firstElementChild || alignTarget; alignTarget = alignTarget.querySelector(prefixer.buildSelector('md-menu-align-target')) || alignTarget; alignTargetRect = alignTarget.getBoundingClientRect(); existingOffsets = { top: parseFloat(containerNode.style.top || 0), left: parseFloat(containerNode.style.left || 0) }; } } var position = {}; var transformOrigin = 'top '; switch (positionMode.top) { case 'target': position.top = existingOffsets.top + originNodeRect.top - alignTargetRect.top; break; case 'cascade': position.top = originNodeRect.top - parseFloat(menuStyle.paddingTop) - originNode.style.top; break; case 'bottom': position.top = originNodeRect.top + originNodeRect.height; break; default: throw new Error('Invalid target mode "' + positionMode.top + '" specified for md-menu on Y axis.'); } var rtl = ($mdUtil.bidi() === 'rtl'); switch (positionMode.left) { case 'target': position.left = existingOffsets.left + originNodeRect.left - alignTargetRect.left; transformOrigin += rtl ? 'right' : 'left'; break; case 'target-left': position.left = originNodeRect.left; transformOrigin += 'left'; break; case 'target-right': position.left = originNodeRect.right - openMenuNodeRect.width + (openMenuNodeRect.right - alignTargetRect.right); transformOrigin += 'right'; break; case 'cascade': var willFitRight = rtl ? (originNodeRect.left - openMenuNodeRect.width) < bounds.left : (originNodeRect.right + openMenuNodeRect.width) < bounds.right; position.left = willFitRight ? originNodeRect.right - originNode.style.left : originNodeRect.left - originNode.style.left - openMenuNodeRect.width; transformOrigin += willFitRight ? 'left' : 'right'; break; case 'right': if (rtl) { position.left = originNodeRect.right - originNodeRect.width; transformOrigin += 'left'; } else { position.left = originNodeRect.right - openMenuNodeRect.width; transformOrigin += 'right'; } break; case 'left': if (rtl) { position.left = originNodeRect.right - openMenuNodeRect.width; transformOrigin += 'right'; } else { position.left = originNodeRect.left; transformOrigin += 'left'; } break; default: throw new Error('Invalid target mode "' + positionMode.left + '" specified for md-menu on X axis.'); } var offsets = opts.mdMenuCtrl.offsets(); position.top += offsets.top; position.left += offsets.left; clamp(position); var scaleX = Math.round(100 * Math.min(originNodeRect.width / containerNode.offsetWidth, 1.0)) / 100; var scaleY = Math.round(100 * Math.min(originNodeRect.height / containerNode.offsetHeight, 1.0)) / 100; return { top: Math.round(position.top), left: Math.round(position.left), // Animate a scale out if we aren't just repositioning transform: !opts.alreadyOpen ? $mdUtil.supplant('scale({0},{1})', [scaleX, scaleY]) : undefined, transformOrigin: transformOrigin }; /** * Clamps the repositioning of the menu within the confines of * bounding element (often the screen/body) */ function clamp(pos) { pos.top = Math.max(Math.min(pos.top, bounds.bottom - containerNode.offsetHeight), bounds.top); pos.left = Math.max(Math.min(pos.left, bounds.right - containerNode.offsetWidth), bounds.left); } /** * Gets the first visible child in the openMenuNode * Necessary incase menu nodes are being dynamically hidden */ function firstVisibleChild() { for (var i = 0; i < openMenuNode.children.length; ++i) { if ($window.getComputedStyle(openMenuNode.children[i]).display != 'none') { return openMenuNode.children[i]; } } } }
[ "function", "calculateMenuPosition", "(", "el", ",", "opts", ")", "{", "var", "containerNode", "=", "el", "[", "0", "]", ",", "openMenuNode", "=", "el", "[", "0", "]", ".", "firstElementChild", ",", "openMenuNodeRect", "=", "openMenuNode", ".", "getBoundingC...
Computes menu position and sets the style on the menu container @param {HTMLElement} el - the menu container element @param {object} opts - the interim element options object
[ "Computes", "menu", "position", "and", "sets", "the", "style", "on", "the", "menu", "container" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/menu/js/menuServiceProvider.js#L442-L576
train
Calculates the position of the menu in the DOM
[ 30522, 3853, 18422, 3549, 6279, 19234, 1006, 3449, 1010, 23569, 2015, 1007, 1063, 13075, 11661, 3630, 3207, 1027, 3449, 1031, 1014, 1033, 1010, 2330, 3549, 27819, 3207, 1027, 3449, 1031, 1014, 1033, 1012, 2034, 12260, 3672, 19339, 1010, 233...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
firebase/firebase-js-sdk
packages/auth/demo/public/script.js
onSetPersistence
function onSetPersistence() { var type = $('#persistence-type').val(); try { auth.setPersistence(type).then(function() { log('Persistence state change to "' + type + '".'); alertSuccess('Persistence state change to "' + type + '".'); }, function(error) { alertError('Error: ' + error.code); }); } catch (error) { alertError('Error: ' + error.code); } }
javascript
function onSetPersistence() { var type = $('#persistence-type').val(); try { auth.setPersistence(type).then(function() { log('Persistence state change to "' + type + '".'); alertSuccess('Persistence state change to "' + type + '".'); }, function(error) { alertError('Error: ' + error.code); }); } catch (error) { alertError('Error: ' + error.code); } }
[ "function", "onSetPersistence", "(", ")", "{", "var", "type", "=", "$", "(", "'#persistence-type'", ")", ".", "val", "(", ")", ";", "try", "{", "auth", ".", "setPersistence", "(", "type", ")", ".", "then", "(", "function", "(", ")", "{", "log", "(", ...
Changes the Auth state persistence to the specified one.
[ "Changes", "the", "Auth", "state", "persistence", "to", "the", "specified", "one", "." ]
491598a499813dacc23724de5e237ec220cc560e
https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L289-L301
train
Set persistence state
[ 30522, 3853, 14447, 7347, 27870, 5897, 1006, 1007, 1063, 13075, 2828, 1027, 1002, 1006, 1005, 1001, 28297, 1011, 2828, 1005, 1007, 1012, 11748, 1006, 1007, 1025, 3046, 1063, 8740, 2705, 1012, 2275, 7347, 27870, 5897, 1006, 2828, 1007, 1012,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Freeboard/freeboard
js/freeboard.thirdparty.js
function(inst, date, defaultDate) { var offsetNumeric = function(offset) { var date = new Date(); date.setDate(date.getDate() + offset); return date; }, offsetString = function(offset) { try { return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), offset, $.datepicker._getFormatConfig(inst)); } catch (e) { // Ignore } var date = (offset.toLowerCase().match(/^c/) ? $.datepicker._getDate(inst) : null) || new Date(), year = date.getFullYear(), month = date.getMonth(), day = date.getDate(), pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, matches = pattern.exec(offset); while (matches) { switch (matches[2] || "d") { case "d" : case "D" : day += parseInt(matches[1],10); break; case "w" : case "W" : day += parseInt(matches[1],10) * 7; break; case "m" : case "M" : month += parseInt(matches[1],10); day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); break; case "y": case "Y" : year += parseInt(matches[1],10); day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); break; } matches = pattern.exec(offset); } return new Date(year, month, day); }, newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) : (typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime())))); newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate); if (newDate) { newDate.setHours(0); newDate.setMinutes(0); newDate.setSeconds(0); newDate.setMilliseconds(0); } return this._daylightSavingAdjust(newDate); }
javascript
function(inst, date, defaultDate) { var offsetNumeric = function(offset) { var date = new Date(); date.setDate(date.getDate() + offset); return date; }, offsetString = function(offset) { try { return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), offset, $.datepicker._getFormatConfig(inst)); } catch (e) { // Ignore } var date = (offset.toLowerCase().match(/^c/) ? $.datepicker._getDate(inst) : null) || new Date(), year = date.getFullYear(), month = date.getMonth(), day = date.getDate(), pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, matches = pattern.exec(offset); while (matches) { switch (matches[2] || "d") { case "d" : case "D" : day += parseInt(matches[1],10); break; case "w" : case "W" : day += parseInt(matches[1],10) * 7; break; case "m" : case "M" : month += parseInt(matches[1],10); day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); break; case "y": case "Y" : year += parseInt(matches[1],10); day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); break; } matches = pattern.exec(offset); } return new Date(year, month, day); }, newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) : (typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime())))); newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate); if (newDate) { newDate.setHours(0); newDate.setMinutes(0); newDate.setSeconds(0); newDate.setMilliseconds(0); } return this._daylightSavingAdjust(newDate); }
[ "function", "(", "inst", ",", "date", ",", "defaultDate", ")", "{", "var", "offsetNumeric", "=", "function", "(", "offset", ")", "{", "var", "date", "=", "new", "Date", "(", ")", ";", "date", ".", "setDate", "(", "date", ".", "getDate", "(", ")", "...
/* A date may be specified as an exact value or a relative one.
[ "/", "*", "A", "date", "may", "be", "specified", "as", "an", "exact", "value", "or", "a", "relative", "one", "." ]
38789f6e8bd3d04f7d3b2c3427e509d00f2610fc
https://github.com/Freeboard/freeboard/blob/38789f6e8bd3d04f7d3b2c3427e509d00f2610fc/js/freeboard.thirdparty.js#L9062-L9115
train
This function is used to set the date property of the datepicker object.
[ 30522, 3853, 1006, 16021, 2102, 1010, 3058, 1010, 12398, 13701, 1007, 1063, 13075, 16396, 19172, 22420, 1027, 3853, 1006, 16396, 1007, 1063, 13075, 3058, 1027, 2047, 3058, 1006, 1007, 1025, 3058, 1012, 2275, 13701, 1006, 3058, 1012, 2131, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/incubator-echarts
src/chart/sankey/sankeyLayout.js
computeNodeBreadths
function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) { // Used to mark whether the edge is deleted. if it is deleted, // the value is 0, otherwise it is 1. var remainEdges = []; // Storage each node's indegree. var indegreeArr = []; //Used to storage the node with indegree is equal to 0. var zeroIndegrees = []; var nextTargetNode = []; var x = 0; var kx = 0; for (var i = 0; i < edges.length; i++) { remainEdges[i] = 1; } for (i = 0; i < nodes.length; i++) { indegreeArr[i] = nodes[i].inEdges.length; if (indegreeArr[i] === 0) { zeroIndegrees.push(nodes[i]); } } var maxNodeDepth = -1; // Traversing nodes using topological sorting to calculate the // horizontal(if orient === 'horizontal') or vertical(if orient === 'vertical') // position of the nodes. while (zeroIndegrees.length) { for (var idx = 0; idx < zeroIndegrees.length; idx++) { var node = zeroIndegrees[idx]; var item = node.hostGraph.data.getRawDataItem(node.dataIndex); var isItemDepth = item.depth != null && item.depth >= 0; if (isItemDepth && item.depth > maxNodeDepth) { maxNodeDepth = item.depth; } node.setLayout({depth: isItemDepth ? item.depth : x}, true); orient === 'vertical' ? node.setLayout({dy: nodeWidth}, true) : node.setLayout({dx: nodeWidth}, true); for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) { var edge = node.outEdges[edgeIdx]; var indexEdge = edges.indexOf(edge); remainEdges[indexEdge] = 0; var targetNode = edge.node2; var nodeIndex = nodes.indexOf(targetNode); if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) { nextTargetNode.push(targetNode); } } } ++x; zeroIndegrees = nextTargetNode; nextTargetNode = []; } for (i = 0; i < remainEdges.length; i++) { if (remainEdges[i] === 1) { throw new Error('Sankey is a DAG, the original data has cycle!'); } } var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1; if (nodeAlign && nodeAlign !== 'left') { adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth); } var kx = orient === 'vertical' ? (height - nodeWidth) / maxDepth : (width - nodeWidth) / maxDepth; scaleNodeBreadths(nodes, kx, orient); }
javascript
function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) { // Used to mark whether the edge is deleted. if it is deleted, // the value is 0, otherwise it is 1. var remainEdges = []; // Storage each node's indegree. var indegreeArr = []; //Used to storage the node with indegree is equal to 0. var zeroIndegrees = []; var nextTargetNode = []; var x = 0; var kx = 0; for (var i = 0; i < edges.length; i++) { remainEdges[i] = 1; } for (i = 0; i < nodes.length; i++) { indegreeArr[i] = nodes[i].inEdges.length; if (indegreeArr[i] === 0) { zeroIndegrees.push(nodes[i]); } } var maxNodeDepth = -1; // Traversing nodes using topological sorting to calculate the // horizontal(if orient === 'horizontal') or vertical(if orient === 'vertical') // position of the nodes. while (zeroIndegrees.length) { for (var idx = 0; idx < zeroIndegrees.length; idx++) { var node = zeroIndegrees[idx]; var item = node.hostGraph.data.getRawDataItem(node.dataIndex); var isItemDepth = item.depth != null && item.depth >= 0; if (isItemDepth && item.depth > maxNodeDepth) { maxNodeDepth = item.depth; } node.setLayout({depth: isItemDepth ? item.depth : x}, true); orient === 'vertical' ? node.setLayout({dy: nodeWidth}, true) : node.setLayout({dx: nodeWidth}, true); for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) { var edge = node.outEdges[edgeIdx]; var indexEdge = edges.indexOf(edge); remainEdges[indexEdge] = 0; var targetNode = edge.node2; var nodeIndex = nodes.indexOf(targetNode); if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) { nextTargetNode.push(targetNode); } } } ++x; zeroIndegrees = nextTargetNode; nextTargetNode = []; } for (i = 0; i < remainEdges.length; i++) { if (remainEdges[i] === 1) { throw new Error('Sankey is a DAG, the original data has cycle!'); } } var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1; if (nodeAlign && nodeAlign !== 'left') { adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth); } var kx = orient === 'vertical' ? (height - nodeWidth) / maxDepth : (width - nodeWidth) / maxDepth; scaleNodeBreadths(nodes, kx, orient); }
[ "function", "computeNodeBreadths", "(", "nodes", ",", "edges", ",", "nodeWidth", ",", "width", ",", "height", ",", "orient", ",", "nodeAlign", ")", "{", "// Used to mark whether the edge is deleted. if it is deleted,", "// the value is 0, otherwise it is 1.", "var", "remain...
Compute the x-position for each node. Here we use Kahn algorithm to detect cycle when we traverse the node to computer the initial x position. @param {module:echarts/data/Graph~Node} nodes node of sankey view @param {number} nodeWidth the dx of the node @param {number} width the whole width of the area to draw the view
[ "Compute", "the", "x", "-", "position", "for", "each", "node", "." ]
4d0ea095dc3929cb6de40c45748826e7999c7aa8
https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/sankey/sankeyLayout.js#L110-L179
train
Compute the breadths of nodes
[ 30522, 3853, 24134, 3630, 3207, 27035, 26830, 1006, 14164, 1010, 7926, 1010, 13045, 9148, 11927, 2232, 1010, 9381, 1010, 4578, 1010, 16865, 1010, 13045, 11475, 16206, 1007, 1063, 1013, 1013, 2109, 2000, 2928, 3251, 1996, 3341, 2003, 17159, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/language/CSSUtils.js
getRangeSelectors
function getRangeSelectors(range) { // There's currently no immediate way to access a given line in a Document, because it's just // stored as a string. Eventually, we should have Documents cache the lines in the document // as well, or make them use CodeMirror documents which do the same thing. var i, startIndex = 0, endIndex, text = range.document.getText(); for (i = 0; i < range.startLine; i++) { startIndex = text.indexOf("\n", startIndex) + 1; } endIndex = startIndex; // Go one line past the end line. We'll extract text up to but not including the last newline. for (i = range.startLine + 1; i <= range.endLine + 1; i++) { endIndex = text.indexOf("\n", endIndex) + 1; } var allSelectors = extractAllSelectors(text.substring(startIndex, endIndex)); // There should only be one rule in the range, and if there are multiple selectors for // the first rule, they'll all be recorded in the "selectorGroup" for the first selector, // so we only need to look at the first one. return (allSelectors.length ? allSelectors[0].selectorGroup || allSelectors[0].selector : ""); }
javascript
function getRangeSelectors(range) { // There's currently no immediate way to access a given line in a Document, because it's just // stored as a string. Eventually, we should have Documents cache the lines in the document // as well, or make them use CodeMirror documents which do the same thing. var i, startIndex = 0, endIndex, text = range.document.getText(); for (i = 0; i < range.startLine; i++) { startIndex = text.indexOf("\n", startIndex) + 1; } endIndex = startIndex; // Go one line past the end line. We'll extract text up to but not including the last newline. for (i = range.startLine + 1; i <= range.endLine + 1; i++) { endIndex = text.indexOf("\n", endIndex) + 1; } var allSelectors = extractAllSelectors(text.substring(startIndex, endIndex)); // There should only be one rule in the range, and if there are multiple selectors for // the first rule, they'll all be recorded in the "selectorGroup" for the first selector, // so we only need to look at the first one. return (allSelectors.length ? allSelectors[0].selectorGroup || allSelectors[0].selector : ""); }
[ "function", "getRangeSelectors", "(", "range", ")", "{", "// There's currently no immediate way to access a given line in a Document, because it's just", "// stored as a string. Eventually, we should have Documents cache the lines in the document", "// as well, or make them use CodeMirror documents ...
Given a TextRange, extracts the selector(s) for the rule in the range and returns it. Assumes the range only contains one rule; if there's more than one, it will return the selector(s) for the first rule. @param {TextRange} range The range to extract the selector(s) from. @return {string} The selector(s) for the rule in the range.
[ "Given", "a", "TextRange", "extracts", "the", "selector", "(", "s", ")", "for", "the", "rule", "in", "the", "range", "and", "returns", "it", ".", "Assumes", "the", "range", "only", "contains", "one", "rule", ";", "if", "there", "s", "more", "than", "on...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CSSUtils.js#L1826-L1845
train
Get the selectors for a given range
[ 30522, 3853, 2131, 24388, 6810, 2571, 24817, 1006, 2846, 1007, 1063, 1013, 1013, 2045, 1005, 1055, 2747, 2053, 6234, 2126, 2000, 3229, 1037, 2445, 2240, 1999, 1037, 6254, 1010, 2138, 2009, 1005, 1055, 2074, 1013, 1013, 8250, 2004, 1037, 5...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SheetJS/js-xlsx
xlsx.js
parse_WsBool
function parse_WsBool(blob, length, opts) { var flags = opts && opts.biff == 8 || length == 2 ? blob.read_shift(2) : (blob.l += length, 0); return { fDialog: flags & 0x10 }; }
javascript
function parse_WsBool(blob, length, opts) { var flags = opts && opts.biff == 8 || length == 2 ? blob.read_shift(2) : (blob.l += length, 0); return { fDialog: flags & 0x10 }; }
[ "function", "parse_WsBool", "(", "blob", ",", "length", ",", "opts", ")", "{", "var", "flags", "=", "opts", "&&", "opts", ".", "biff", "==", "8", "||", "length", "==", "2", "?", "blob", ".", "read_shift", "(", "2", ")", ":", "(", "blob", ".", "l"...
/* [MS-XLS] 2.4.351
[ "/", "*", "[", "MS", "-", "XLS", "]", "2", ".", "4", ".", "351" ]
9a6d8a1d3d80c78dad5201fb389316f935279cdc
https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L5794-L5797
train
WSBool Parse a boolean from a blob
[ 30522, 3853, 11968, 3366, 1035, 1059, 19022, 13669, 1006, 1038, 4135, 2497, 1010, 3091, 1010, 23569, 2015, 1007, 1063, 13075, 9245, 1027, 23569, 2015, 1004, 1004, 23569, 2015, 1012, 12170, 4246, 1027, 1027, 1022, 1064, 1064, 3091, 1027, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
third_party/js/mozmill/shared-modules/sessionstore.js
aboutSessionRestore_getWindows
function aboutSessionRestore_getWindows() { var windows = [ ]; var tree = this.tabList.getNode(); for (var ii = 0; ii < tree.view.rowCount; ii++) { if (tree.view.isContainer(ii)) { windows.push({ index: windows.length, listIndex : ii, open: tree.view.isContainerOpen(ii), restore: tree.view.getCellValue(ii, tree.columns.getColumnAt(0)), title: tree.view.getCellText(ii, tree.columns.getColumnAt(2)) }); } } return windows; }
javascript
function aboutSessionRestore_getWindows() { var windows = [ ]; var tree = this.tabList.getNode(); for (var ii = 0; ii < tree.view.rowCount; ii++) { if (tree.view.isContainer(ii)) { windows.push({ index: windows.length, listIndex : ii, open: tree.view.isContainerOpen(ii), restore: tree.view.getCellValue(ii, tree.columns.getColumnAt(0)), title: tree.view.getCellText(ii, tree.columns.getColumnAt(2)) }); } } return windows; }
[ "function", "aboutSessionRestore_getWindows", "(", ")", "{", "var", "windows", "=", "[", "]", ";", "var", "tree", "=", "this", ".", "tabList", ".", "getNode", "(", ")", ";", "for", "(", "var", "ii", "=", "0", ";", "ii", "<", "tree", ".", "view", "....
Get restorable windows @returns List of windows @type {array of object}
[ "Get", "restorable", "windows" ]
38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd
https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/sessionstore.js#L194-L211
train
Get windows from the restore table
[ 30522, 3853, 2055, 8583, 10992, 28533, 5686, 1035, 2131, 11101, 15568, 1006, 1007, 1063, 13075, 3645, 1027, 1031, 1033, 1025, 13075, 3392, 1027, 2023, 1012, 21628, 9863, 1012, 2131, 3630, 3207, 1006, 1007, 1025, 2005, 1006, 13075, 2462, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
ColorlibHQ/AdminLTE
plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js
_handleAttributes
function _handleAttributes(oldNode, newNode, rule, clearInternals) { var attributes = {}, // fresh new set of attributes to set on newNode setClass = rule.set_class, // classes to set addClass = rule.add_class, // add classes based on existing attributes addStyle = rule.add_style, // add styles based on existing attributes setAttributes = rule.set_attributes, // attributes to set on the current node allowedClasses = currentRules.classes, i = 0, classes = [], styles = [], newClasses = [], oldClasses = [], classesLength, newClassesLength, currentClass, newClass, attributeName, method; if (setAttributes) { attributes = wysihtml5.lang.object(setAttributes).clone(); } // check/convert values of attributes attributes = wysihtml5.lang.object(attributes).merge(_checkAttributes(oldNode, rule.check_attributes)).get(); if (setClass) { classes.push(setClass); } if (addClass) { for (attributeName in addClass) { method = addClassMethods[addClass[attributeName]]; if (!method) { continue; } newClass = method(wysihtml5.dom.getAttribute(oldNode, attributeName)); if (typeof(newClass) === "string") { classes.push(newClass); } } } if (addStyle) { for (attributeName in addStyle) { method = addStyleMethods[addStyle[attributeName]]; if (!method) { continue; } newStyle = method(wysihtml5.dom.getAttribute(oldNode, attributeName)); if (typeof(newStyle) === "string") { styles.push(newStyle); } } } if (typeof(allowedClasses) === "string" && allowedClasses === "any" && oldNode.getAttribute("class")) { if (currentRules.classes_blacklist) { oldClasses = oldNode.getAttribute("class"); if (oldClasses) { classes = classes.concat(oldClasses.split(WHITE_SPACE_REG_EXP)); } classesLength = classes.length; for (; i<classesLength; i++) { currentClass = classes[i]; if (!currentRules.classes_blacklist[currentClass]) { newClasses.push(currentClass); } } if (newClasses.length) { attributes["class"] = wysihtml5.lang.array(newClasses).unique().join(" "); } } else { attributes["class"] = oldNode.getAttribute("class"); } } else { // make sure that wysihtml5 temp class doesn't get stripped out if (!clearInternals) { allowedClasses["_wysihtml5-temp-placeholder"] = 1; allowedClasses["_rangySelectionBoundary"] = 1; allowedClasses["wysiwyg-tmp-selected-cell"] = 1; } // add old classes last oldClasses = oldNode.getAttribute("class"); if (oldClasses) { classes = classes.concat(oldClasses.split(WHITE_SPACE_REG_EXP)); } classesLength = classes.length; for (; i<classesLength; i++) { currentClass = classes[i]; if (allowedClasses[currentClass]) { newClasses.push(currentClass); } } if (newClasses.length) { attributes["class"] = wysihtml5.lang.array(newClasses).unique().join(" "); } } // remove table selection class if present if (attributes["class"] && clearInternals) { attributes["class"] = attributes["class"].replace("wysiwyg-tmp-selected-cell", ""); if ((/^\s*$/g).test(attributes["class"])) { delete attributes["class"]; } } if (styles.length) { attributes["style"] = wysihtml5.lang.array(styles).unique().join(" "); } // set attributes on newNode for (attributeName in attributes) { // Setting attributes can cause a js error in IE under certain circumstances // eg. on a <img> under https when it's new attribute value is non-https // TODO: Investigate this further and check for smarter handling try { newNode.setAttribute(attributeName, attributes[attributeName]); } catch(e) {} } // IE8 sometimes loses the width/height attributes when those are set before the "src" // so we make sure to set them again if (attributes.src) { if (typeof(attributes.width) !== "undefined") { newNode.setAttribute("width", attributes.width); } if (typeof(attributes.height) !== "undefined") { newNode.setAttribute("height", attributes.height); } } }
javascript
function _handleAttributes(oldNode, newNode, rule, clearInternals) { var attributes = {}, // fresh new set of attributes to set on newNode setClass = rule.set_class, // classes to set addClass = rule.add_class, // add classes based on existing attributes addStyle = rule.add_style, // add styles based on existing attributes setAttributes = rule.set_attributes, // attributes to set on the current node allowedClasses = currentRules.classes, i = 0, classes = [], styles = [], newClasses = [], oldClasses = [], classesLength, newClassesLength, currentClass, newClass, attributeName, method; if (setAttributes) { attributes = wysihtml5.lang.object(setAttributes).clone(); } // check/convert values of attributes attributes = wysihtml5.lang.object(attributes).merge(_checkAttributes(oldNode, rule.check_attributes)).get(); if (setClass) { classes.push(setClass); } if (addClass) { for (attributeName in addClass) { method = addClassMethods[addClass[attributeName]]; if (!method) { continue; } newClass = method(wysihtml5.dom.getAttribute(oldNode, attributeName)); if (typeof(newClass) === "string") { classes.push(newClass); } } } if (addStyle) { for (attributeName in addStyle) { method = addStyleMethods[addStyle[attributeName]]; if (!method) { continue; } newStyle = method(wysihtml5.dom.getAttribute(oldNode, attributeName)); if (typeof(newStyle) === "string") { styles.push(newStyle); } } } if (typeof(allowedClasses) === "string" && allowedClasses === "any" && oldNode.getAttribute("class")) { if (currentRules.classes_blacklist) { oldClasses = oldNode.getAttribute("class"); if (oldClasses) { classes = classes.concat(oldClasses.split(WHITE_SPACE_REG_EXP)); } classesLength = classes.length; for (; i<classesLength; i++) { currentClass = classes[i]; if (!currentRules.classes_blacklist[currentClass]) { newClasses.push(currentClass); } } if (newClasses.length) { attributes["class"] = wysihtml5.lang.array(newClasses).unique().join(" "); } } else { attributes["class"] = oldNode.getAttribute("class"); } } else { // make sure that wysihtml5 temp class doesn't get stripped out if (!clearInternals) { allowedClasses["_wysihtml5-temp-placeholder"] = 1; allowedClasses["_rangySelectionBoundary"] = 1; allowedClasses["wysiwyg-tmp-selected-cell"] = 1; } // add old classes last oldClasses = oldNode.getAttribute("class"); if (oldClasses) { classes = classes.concat(oldClasses.split(WHITE_SPACE_REG_EXP)); } classesLength = classes.length; for (; i<classesLength; i++) { currentClass = classes[i]; if (allowedClasses[currentClass]) { newClasses.push(currentClass); } } if (newClasses.length) { attributes["class"] = wysihtml5.lang.array(newClasses).unique().join(" "); } } // remove table selection class if present if (attributes["class"] && clearInternals) { attributes["class"] = attributes["class"].replace("wysiwyg-tmp-selected-cell", ""); if ((/^\s*$/g).test(attributes["class"])) { delete attributes["class"]; } } if (styles.length) { attributes["style"] = wysihtml5.lang.array(styles).unique().join(" "); } // set attributes on newNode for (attributeName in attributes) { // Setting attributes can cause a js error in IE under certain circumstances // eg. on a <img> under https when it's new attribute value is non-https // TODO: Investigate this further and check for smarter handling try { newNode.setAttribute(attributeName, attributes[attributeName]); } catch(e) {} } // IE8 sometimes loses the width/height attributes when those are set before the "src" // so we make sure to set them again if (attributes.src) { if (typeof(attributes.width) !== "undefined") { newNode.setAttribute("width", attributes.width); } if (typeof(attributes.height) !== "undefined") { newNode.setAttribute("height", attributes.height); } } }
[ "function", "_handleAttributes", "(", "oldNode", ",", "newNode", ",", "rule", ",", "clearInternals", ")", "{", "var", "attributes", "=", "{", "}", ",", "// fresh new set of attributes to set on newNode", "setClass", "=", "rule", ".", "set_class", ",", "// classes to...
TODO: refactor. Too long to read
[ "TODO", ":", "refactor", ".", "Too", "long", "to", "read" ]
19113c3cbc19a7afe0cfd3158d647064d2d30661
https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L6312-L6450
train
handle attributes on the current node
[ 30522, 3853, 1035, 5047, 19321, 3089, 8569, 4570, 1006, 2214, 3630, 3207, 1010, 2047, 3630, 3207, 1010, 3627, 1010, 3154, 18447, 11795, 9777, 1007, 1063, 13075, 12332, 1027, 1063, 1065, 1010, 1013, 1013, 4840, 2047, 2275, 1997, 12332, 2000,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Dogfalo/materialize
extras/noUiSlider/nouislider.js
eventTap
function eventTap ( event ) { // The tap event shouldn't propagate up event.stopPropagation(); var proposal = calcPointToPercentage(event.calcPoint); var handleNumber = getClosestHandle(proposal); // Tackle the case that all handles are 'disabled'. if ( handleNumber === false ) { return false; } // Flag the slider as it is now in a transitional state. // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that. if ( !options.events.snap ) { addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration); } setHandle(handleNumber, proposal, true, true); setZindex(); fireEvent('slide', handleNumber, true); fireEvent('set', handleNumber, true); fireEvent('change', handleNumber, true); fireEvent('update', handleNumber, true); if ( options.events.snap ) { eventStart(event, { handleNumbers: [handleNumber] }); } }
javascript
function eventTap ( event ) { // The tap event shouldn't propagate up event.stopPropagation(); var proposal = calcPointToPercentage(event.calcPoint); var handleNumber = getClosestHandle(proposal); // Tackle the case that all handles are 'disabled'. if ( handleNumber === false ) { return false; } // Flag the slider as it is now in a transitional state. // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that. if ( !options.events.snap ) { addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration); } setHandle(handleNumber, proposal, true, true); setZindex(); fireEvent('slide', handleNumber, true); fireEvent('set', handleNumber, true); fireEvent('change', handleNumber, true); fireEvent('update', handleNumber, true); if ( options.events.snap ) { eventStart(event, { handleNumbers: [handleNumber] }); } }
[ "function", "eventTap", "(", "event", ")", "{", "// The tap event shouldn't propagate up", "event", ".", "stopPropagation", "(", ")", ";", "var", "proposal", "=", "calcPointToPercentage", "(", "event", ".", "calcPoint", ")", ";", "var", "handleNumber", "=", "getCl...
Move closest handle to tapped location.
[ "Move", "closest", "handle", "to", "tapped", "location", "." ]
1122efadad8f1433d404696f7613e3cc13fb83a4
https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/extras/noUiSlider/nouislider.js#L1607-L1638
train
Tackle the slider.
[ 30522, 3853, 2724, 2696, 2361, 1006, 2724, 1007, 1063, 1013, 1013, 1996, 11112, 2724, 5807, 1005, 1056, 17678, 16098, 2618, 2039, 2724, 1012, 2644, 21572, 4502, 12540, 1006, 1007, 1025, 13075, 6378, 1027, 10250, 21906, 25785, 14399, 2121, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
eslint/eslint
lib/rules/no-mixed-operators.js
includesBothInAGroup
function includesBothInAGroup(groups, left, right) { return groups.some(group => group.indexOf(left) !== -1 && group.indexOf(right) !== -1); }
javascript
function includesBothInAGroup(groups, left, right) { return groups.some(group => group.indexOf(left) !== -1 && group.indexOf(right) !== -1); }
[ "function", "includesBothInAGroup", "(", "groups", ",", "left", ",", "right", ")", "{", "return", "groups", ".", "some", "(", "group", "=>", "group", ".", "indexOf", "(", "left", ")", "!==", "-", "1", "&&", "group", ".", "indexOf", "(", "right", ")", ...
Checks whether any group which includes both given operator exists or not. @param {Array.<string[]>} groups - A list of groups to check. @param {string} left - An operator. @param {string} right - Another operator. @returns {boolean} `true` if such group existed.
[ "Checks", "whether", "any", "group", "which", "includes", "both", "given", "operator", "exists", "or", "not", "." ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-mixed-operators.js#L64-L66
train
Returns true if the given group includes both left and right
[ 30522, 3853, 2950, 18384, 10606, 8490, 22107, 1006, 2967, 1010, 2187, 1010, 2157, 1007, 1063, 2709, 2967, 1012, 2070, 1006, 2177, 1027, 1028, 2177, 1012, 5950, 11253, 1006, 2187, 1007, 999, 1027, 1027, 1011, 1015, 1004, 1004, 2177, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/extensibility/ExtensionManager.js
remove
function remove(id) { var result = new $.Deferred(); if (extensions[id] && extensions[id].installInfo) { Package.remove(extensions[id].installInfo.path) .done(function () { extensions[id].installInfo = null; result.resolve(); exports.trigger("statusChange", id); }) .fail(function (err) { result.reject(err); }); } else { result.reject(StringUtils.format(Strings.EXTENSION_NOT_INSTALLED, id)); } return result.promise(); }
javascript
function remove(id) { var result = new $.Deferred(); if (extensions[id] && extensions[id].installInfo) { Package.remove(extensions[id].installInfo.path) .done(function () { extensions[id].installInfo = null; result.resolve(); exports.trigger("statusChange", id); }) .fail(function (err) { result.reject(err); }); } else { result.reject(StringUtils.format(Strings.EXTENSION_NOT_INSTALLED, id)); } return result.promise(); }
[ "function", "remove", "(", "id", ")", "{", "var", "result", "=", "new", "$", ".", "Deferred", "(", ")", ";", "if", "(", "extensions", "[", "id", "]", "&&", "extensions", "[", "id", "]", ".", "installInfo", ")", "{", "Package", ".", "remove", "(", ...
Removes the installed extension with the given id. @param {string} id The id of the extension to remove. @return {$.Promise} A promise that's resolved when the extension is removed or rejected with an error if there's a problem with the removal.
[ "Removes", "the", "installed", "extension", "with", "the", "given", "id", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/ExtensionManager.js#L396-L412
train
Remove extension
[ 30522, 3853, 6366, 1006, 8909, 1007, 1063, 13075, 2765, 1027, 2047, 1002, 1012, 13366, 28849, 2094, 1006, 1007, 1025, 2065, 1006, 14305, 1031, 8909, 1033, 1004, 1004, 14305, 1031, 8909, 1033, 1012, 16500, 2378, 14876, 1007, 1063, 7427, 1012...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
third_party/js/mozmill/shared-modules/addons.js
addonsManager_setCategory
function addonsManager_setCategory(aSpec) { var spec = aSpec || { }; var category = spec.category; var waitFor = (spec.waitFor == undefined) ? true : spec.waitFor; if (!category) throw new Error(arguments.callee.name + ": Category not specified."); this._controller.click(category); if (waitFor) this.waitForCategory({category: category}); }
javascript
function addonsManager_setCategory(aSpec) { var spec = aSpec || { }; var category = spec.category; var waitFor = (spec.waitFor == undefined) ? true : spec.waitFor; if (!category) throw new Error(arguments.callee.name + ": Category not specified."); this._controller.click(category); if (waitFor) this.waitForCategory({category: category}); }
[ "function", "addonsManager_setCategory", "(", "aSpec", ")", "{", "var", "spec", "=", "aSpec", "||", "{", "}", ";", "var", "category", "=", "spec", ".", "category", ";", "var", "waitFor", "=", "(", "spec", ".", "waitFor", "==", "undefined", ")", "?", "t...
Select the given category @param {object} aSpec Information for selecting a category Elements: category - Category element waitFor - Wait until the category has been selected [optional - default: true]
[ "Select", "the", "given", "category" ]
38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd
https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/addons.js#L698-L710
train
Sets the category of the add - ons
[ 30522, 3853, 5587, 5644, 24805, 4590, 1035, 2275, 16280, 20255, 2100, 1006, 2004, 5051, 2278, 1007, 1063, 13075, 28699, 1027, 2004, 5051, 2278, 1064, 1064, 1063, 1065, 1025, 13075, 4696, 1027, 28699, 1012, 4696, 1025, 13075, 3524, 29278, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
vuejs/vue-devtools
src/util.js
internalSearchArray
function internalSearchArray (array, searchTerm, seen, depth) { if (depth > SEARCH_MAX_DEPTH) { return false } let match = false let value for (let i = 0; i < array.length; i++) { value = array[i] match = internalSearchCheck(searchTerm, null, value, seen, depth + 1) if (match) { break } } return match }
javascript
function internalSearchArray (array, searchTerm, seen, depth) { if (depth > SEARCH_MAX_DEPTH) { return false } let match = false let value for (let i = 0; i < array.length; i++) { value = array[i] match = internalSearchCheck(searchTerm, null, value, seen, depth + 1) if (match) { break } } return match }
[ "function", "internalSearchArray", "(", "array", ",", "searchTerm", ",", "seen", ",", "depth", ")", "{", "if", "(", "depth", ">", "SEARCH_MAX_DEPTH", ")", "{", "return", "false", "}", "let", "match", "=", "false", "let", "value", "for", "(", "let", "i", ...
Executes a search on each value of the provided array @param {*} array Search target @param {string} searchTerm Search string @param {Map<any,boolean>} seen Map containing the search result to prevent stack overflow by walking on the same object multiple times @param {number} depth Deep search depth level, which is capped to prevent performance issues @returns {boolean} Search match
[ "Executes", "a", "search", "on", "each", "value", "of", "the", "provided", "array" ]
4de4b86388453cd07f0c1bf967d43a4dd4b011c9
https://github.com/vuejs/vue-devtools/blob/4de4b86388453cd07f0c1bf967d43a4dd4b011c9/src/util.js#L447-L461
train
Internal search function
[ 30522, 3853, 4722, 17310, 11140, 2906, 9447, 1006, 9140, 1010, 3945, 3334, 2213, 1010, 2464, 1010, 5995, 1007, 1063, 2065, 1006, 5995, 1028, 3945, 1035, 4098, 1035, 5995, 1007, 1063, 2709, 6270, 1065, 2292, 2674, 1027, 6270, 2292, 3643, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
nodejs/node-gyp
lib/install.js
eaccesFallback
function eaccesFallback (err) { var noretry = '--node_gyp_internal_noretry' if (-1 !== argv.indexOf(noretry)) return cb(err) var tmpdir = os.tmpdir() gyp.devDir = path.resolve(tmpdir, '.node-gyp') log.warn('EACCES', 'user "%s" does not have permission to access the dev dir "%s"', os.userInfo().username, devDir) log.warn('EACCES', 'attempting to reinstall using temporary dev dir "%s"', gyp.devDir) if (process.cwd() == tmpdir) { log.verbose('tmpdir == cwd', 'automatically will remove dev files after to save disk space') gyp.todo.push({ name: 'remove', args: argv }) } gyp.commands.install([noretry].concat(argv), cb) }
javascript
function eaccesFallback (err) { var noretry = '--node_gyp_internal_noretry' if (-1 !== argv.indexOf(noretry)) return cb(err) var tmpdir = os.tmpdir() gyp.devDir = path.resolve(tmpdir, '.node-gyp') log.warn('EACCES', 'user "%s" does not have permission to access the dev dir "%s"', os.userInfo().username, devDir) log.warn('EACCES', 'attempting to reinstall using temporary dev dir "%s"', gyp.devDir) if (process.cwd() == tmpdir) { log.verbose('tmpdir == cwd', 'automatically will remove dev files after to save disk space') gyp.todo.push({ name: 'remove', args: argv }) } gyp.commands.install([noretry].concat(argv), cb) }
[ "function", "eaccesFallback", "(", "err", ")", "{", "var", "noretry", "=", "'--node_gyp_internal_noretry'", "if", "(", "-", "1", "!==", "argv", ".", "indexOf", "(", "noretry", ")", ")", "return", "cb", "(", "err", ")", "var", "tmpdir", "=", "os", ".", ...
The EACCES fallback is a workaround for npm's `sudo` behavior, where it drops the permissions before invoking any child processes (like node-gyp). So what happens is the "nobody" user doesn't have permission to create the dev dir. As a fallback, make the tmpdir() be the dev dir for this installation. This is not ideal, but at least the compilation will succeed...
[ "The", "EACCES", "fallback", "is", "a", "workaround", "for", "npm", "s", "sudo", "behavior", "where", "it", "drops", "the", "permissions", "before", "invoking", "any", "child", "processes", "(", "like", "node", "-", "gyp", ")", ".", "So", "what", "happens"...
721eb691cf15556cc2700eda0558d5bad5f84232
https://github.com/nodejs/node-gyp/blob/721eb691cf15556cc2700eda0558d5bad5f84232/lib/install.js#L400-L412
train
fallback to install
[ 30522, 3853, 19413, 9468, 2229, 13976, 5963, 1006, 9413, 2099, 1007, 1063, 13075, 4496, 3388, 2854, 1027, 1005, 1011, 1011, 13045, 1035, 1043, 22571, 1035, 4722, 1035, 4496, 3388, 2854, 1005, 2065, 1006, 1011, 1015, 999, 1027, 1027, 12098, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/project/ProjectModel.js
_getFSObject
function _getFSObject(path) { if (!path) { return path; } else if (_pathIsFile(path)) { return FileSystem.getFileForPath(path); } return FileSystem.getDirectoryForPath(path); }
javascript
function _getFSObject(path) { if (!path) { return path; } else if (_pathIsFile(path)) { return FileSystem.getFileForPath(path); } return FileSystem.getDirectoryForPath(path); }
[ "function", "_getFSObject", "(", "path", ")", "{", "if", "(", "!", "path", ")", "{", "return", "path", ";", "}", "else", "if", "(", "_pathIsFile", "(", "path", ")", ")", "{", "return", "FileSystem", ".", "getFileForPath", "(", "path", ")", ";", "}", ...
@private Gets the FileSystem object (either a File or Directory) based on the path provided. @param {string} path Path to retrieve
[ "@private" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectModel.js#L156-L163
train
Get the fs object for a given path
[ 30522, 3853, 1035, 2131, 10343, 16429, 20614, 1006, 4130, 1007, 1063, 2065, 1006, 999, 4130, 1007, 1063, 2709, 4130, 1025, 1065, 2842, 2065, 1006, 1035, 4130, 2483, 8873, 2571, 1006, 4130, 1007, 1007, 1063, 2709, 6764, 27268, 6633, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aws/aws-sdk-js
lib/request.js
eachItem
function eachItem(callback) { var self = this; function wrappedCallback(err, data) { if (err) return callback(err, null); if (data === null) return callback(null, null); var config = self.service.paginationConfig(self.operation); var resultKey = config.resultKey; if (Array.isArray(resultKey)) resultKey = resultKey[0]; var items = jmespath.search(data, resultKey); var continueIteration = true; AWS.util.arrayEach(items, function(item) { continueIteration = callback(null, item); if (continueIteration === false) { return AWS.util.abort; } }); return continueIteration; } this.eachPage(wrappedCallback); }
javascript
function eachItem(callback) { var self = this; function wrappedCallback(err, data) { if (err) return callback(err, null); if (data === null) return callback(null, null); var config = self.service.paginationConfig(self.operation); var resultKey = config.resultKey; if (Array.isArray(resultKey)) resultKey = resultKey[0]; var items = jmespath.search(data, resultKey); var continueIteration = true; AWS.util.arrayEach(items, function(item) { continueIteration = callback(null, item); if (continueIteration === false) { return AWS.util.abort; } }); return continueIteration; } this.eachPage(wrappedCallback); }
[ "function", "eachItem", "(", "callback", ")", "{", "var", "self", "=", "this", ";", "function", "wrappedCallback", "(", "err", ",", "data", ")", "{", "if", "(", "err", ")", "return", "callback", "(", "err", ",", "null", ")", ";", "if", "(", "data", ...
Enumerates over individual items of a request, paging the responses if necessary. @api experimental @since v1.4.0
[ "Enumerates", "over", "individual", "items", "of", "a", "request", "paging", "the", "responses", "if", "necessary", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/request.js#L515-L536
train
Iterates over all items in the resource
[ 30522, 3853, 2169, 4221, 2213, 1006, 2655, 5963, 1007, 1063, 13075, 2969, 1027, 2023, 1025, 3853, 5058, 9289, 20850, 8684, 1006, 9413, 2099, 1010, 2951, 1007, 1063, 2065, 1006, 9413, 2099, 1007, 2709, 2655, 5963, 1006, 9413, 2099, 1010, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/core/support/controls/InteractionTree.js
initializePopOverInteractionData
function initializePopOverInteractionData() { var $li = jQuery(this).parent().parent(); var index = parseInt($li.attr('data-interaction-index')); var interaction = that.interactions[index]; if (!interaction) { return; } durationText.setText(that.formatDuration(interaction.duration)); processingText.setText(that.formatDuration(interaction.duration - interaction.roundtrip)); requestTimeText.setText(that.formatDuration(interaction.requestTime)); roundtripText.setText(that.formatDuration(interaction.roundtrip)); bytesReceivedText.setText(interaction.bytesReceived); requestNumberText.setText(interaction.requests.length); startTimeText.setText(that.formatTime(interaction.start)); }
javascript
function initializePopOverInteractionData() { var $li = jQuery(this).parent().parent(); var index = parseInt($li.attr('data-interaction-index')); var interaction = that.interactions[index]; if (!interaction) { return; } durationText.setText(that.formatDuration(interaction.duration)); processingText.setText(that.formatDuration(interaction.duration - interaction.roundtrip)); requestTimeText.setText(that.formatDuration(interaction.requestTime)); roundtripText.setText(that.formatDuration(interaction.roundtrip)); bytesReceivedText.setText(interaction.bytesReceived); requestNumberText.setText(interaction.requests.length); startTimeText.setText(that.formatTime(interaction.start)); }
[ "function", "initializePopOverInteractionData", "(", ")", "{", "var", "$li", "=", "jQuery", "(", "this", ")", ".", "parent", "(", ")", ".", "parent", "(", ")", ";", "var", "index", "=", "parseInt", "(", "$li", ".", "attr", "(", "'data-interaction-index'", ...
/* eslint-enable no-loop-func
[ "/", "*", "eslint", "-", "enable", "no", "-", "loop", "-", "func" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/controls/InteractionTree.js#L795-L814
train
Initializes the popover interaction data
[ 30522, 3853, 3988, 4697, 16340, 7840, 18447, 6906, 7542, 2850, 2696, 1006, 1007, 1063, 13075, 1002, 5622, 1027, 1046, 4226, 2854, 1006, 2023, 1007, 1012, 6687, 1006, 1007, 1012, 6687, 1006, 1007, 1025, 13075, 5950, 1027, 11968, 20240, 3372,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
ColorlibHQ/AdminLTE
plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js
function(command, commandValue) { var obj = wysihtml5.commands[command], args = wysihtml5.lang.array(arguments).get(), method = obj && obj.state; if (method) { args.unshift(this.composer); return method.apply(obj, args); } else { try { // try/catch for buggy firefox return this.doc.queryCommandState(command); } catch(e) { return false; } } }
javascript
function(command, commandValue) { var obj = wysihtml5.commands[command], args = wysihtml5.lang.array(arguments).get(), method = obj && obj.state; if (method) { args.unshift(this.composer); return method.apply(obj, args); } else { try { // try/catch for buggy firefox return this.doc.queryCommandState(command); } catch(e) { return false; } } }
[ "function", "(", "command", ",", "commandValue", ")", "{", "var", "obj", "=", "wysihtml5", ".", "commands", "[", "command", "]", ",", "args", "=", "wysihtml5", ".", "lang", ".", "array", "(", "arguments", ")", ".", "get", "(", ")", ",", "method", "="...
Check whether the current command is active If the caret is within a bold text, then calling this with command "bold" should return true @param {String} command The command string which to check (eg. "bold", "italic", "insertUnorderedList") @param {String} [commandValue] The command value parameter (eg. for "insertImage" the image src) @return {Boolean} Whether the command is active @example var isCurrentSelectionBold = commands.state("bold");
[ "Check", "whether", "the", "current", "command", "is", "active", "If", "the", "caret", "is", "within", "a", "bold", "text", "then", "calling", "this", "with", "command", "bold", "should", "return", "true" ]
19113c3cbc19a7afe0cfd3158d647064d2d30661
https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L10256-L10271
train
Returns true if the command is in the cache
[ 30522, 3853, 1006, 3094, 1010, 3094, 10175, 5657, 1007, 1063, 13075, 27885, 3501, 1027, 1059, 7274, 19190, 21246, 2140, 2629, 1012, 10954, 1031, 3094, 1033, 1010, 12098, 5620, 1027, 1059, 7274, 19190, 21246, 2140, 2629, 1012, 11374, 1012, 9...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.rta/src/sap/ui/rta/plugin/RenameHandler.js
function (bRestoreFocus, oEvent) { if (!this._bBlurOrKeyDownStarted) { this._bBlurOrKeyDownStarted = true; if (oEvent) { RenameHandler._preventDefault.call(this, oEvent); RenameHandler._stopPropagation.call(this, oEvent); } return this._emitLabelChangeEvent() .then(function (fnErrorHandler) { this.stopEdit(bRestoreFocus); if (typeof fnErrorHandler === "function") { fnErrorHandler(); // contains startEdit() and valueStateMessage } }.bind(this)); } return Promise.resolve(); }
javascript
function (bRestoreFocus, oEvent) { if (!this._bBlurOrKeyDownStarted) { this._bBlurOrKeyDownStarted = true; if (oEvent) { RenameHandler._preventDefault.call(this, oEvent); RenameHandler._stopPropagation.call(this, oEvent); } return this._emitLabelChangeEvent() .then(function (fnErrorHandler) { this.stopEdit(bRestoreFocus); if (typeof fnErrorHandler === "function") { fnErrorHandler(); // contains startEdit() and valueStateMessage } }.bind(this)); } return Promise.resolve(); }
[ "function", "(", "bRestoreFocus", ",", "oEvent", ")", "{", "if", "(", "!", "this", ".", "_bBlurOrKeyDownStarted", ")", "{", "this", ".", "_bBlurOrKeyDownStarted", "=", "true", ";", "if", "(", "oEvent", ")", "{", "RenameHandler", ".", "_preventDefault", ".", ...
Handles events after rename has been performed @param {boolean} bRestoreFocus - to restore focus to overlay after rename completes @private
[ "Handles", "events", "after", "rename", "has", "been", "performed" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/plugin/RenameHandler.js#L291-L307
train
Handles the event that the label has changed.
[ 30522, 3853, 1006, 22451, 5686, 14876, 7874, 1010, 1051, 18697, 3372, 1007, 1063, 2065, 1006, 999, 2023, 1012, 1035, 22861, 7630, 29165, 14839, 7698, 14117, 3064, 1007, 1063, 2023, 1012, 1035, 22861, 7630, 29165, 14839, 7698, 14117, 3064, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jgraph/mxgraph
javascript/mxClient.js
function(value, nodeName, attributeName, attributeValue) { if (value != null && !isNaN(value.nodeType) && (nodeName == null || value.nodeName.toLowerCase() == nodeName.toLowerCase())) { return attributeName == null || value.getAttribute(attributeName) == attributeValue; } return false; }
javascript
function(value, nodeName, attributeName, attributeValue) { if (value != null && !isNaN(value.nodeType) && (nodeName == null || value.nodeName.toLowerCase() == nodeName.toLowerCase())) { return attributeName == null || value.getAttribute(attributeName) == attributeValue; } return false; }
[ "function", "(", "value", ",", "nodeName", ",", "attributeName", ",", "attributeValue", ")", "{", "if", "(", "value", "!=", "null", "&&", "!", "isNaN", "(", "value", ".", "nodeType", ")", "&&", "(", "nodeName", "==", "null", "||", "value", ".", "nodeNa...
Function: isNode Returns true if the given value is an XML node with the node name and if the optional attribute has the specified value. This implementation assumes that the given value is a DOM node if the nodeType property is numeric, that is, if isNaN returns false for value.nodeType. Parameters: value - Object that should be examined as a node. nodeName - String that specifies the node name. attributeName - Optional attribute name to check. attributeValue - Optional attribute value to check.
[ "Function", ":", "isNode" ]
33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44
https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L2578-L2588
train
Checks if the value is a valid node
[ 30522, 3853, 1006, 3643, 1010, 13045, 18442, 1010, 17961, 18442, 1010, 17961, 10175, 5657, 1007, 1063, 2065, 1006, 3643, 999, 1027, 19701, 1004, 1004, 999, 3475, 2319, 1006, 3643, 1012, 13045, 13874, 1007, 1004, 1004, 1006, 13045, 18442, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/type/DateTimeBase.js
getErrorMessage
function getErrorMessage(oType) { return sap.ui.getCore().getLibraryResourceBundle().getText( isDateOnly(oType) ? "EnterDate" : "EnterDateTime", [oType.formatValue(isDateOnly(oType) ? oDemoDate : oDemoDateTime, "string")]); }
javascript
function getErrorMessage(oType) { return sap.ui.getCore().getLibraryResourceBundle().getText( isDateOnly(oType) ? "EnterDate" : "EnterDateTime", [oType.formatValue(isDateOnly(oType) ? oDemoDate : oDemoDateTime, "string")]); }
[ "function", "getErrorMessage", "(", "oType", ")", "{", "return", "sap", ".", "ui", ".", "getCore", "(", ")", ".", "getLibraryResourceBundle", "(", ")", ".", "getText", "(", "isDateOnly", "(", "oType", ")", "?", "\"EnterDate\"", ":", "\"EnterDateTime\"", ",",...
/* Returns the matching locale-dependent error message for the type based on the constraints. @param {sap.ui.model.odata.type.DateTimeBase} oType The type @returns {string} The locale-dependent error message
[ "/", "*", "Returns", "the", "matching", "locale", "-", "dependent", "error", "message", "for", "the", "type", "based", "on", "the", "constraints", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/type/DateTimeBase.js#L39-L43
train
Returns the error message for the given type
[ 30522, 3853, 2131, 2121, 29165, 7834, 3736, 3351, 1006, 27178, 18863, 1007, 1063, 2709, 20066, 1012, 21318, 1012, 2131, 17345, 1006, 1007, 1012, 2131, 29521, 19848, 16363, 6499, 3126, 3401, 27265, 2571, 1006, 1007, 1012, 2131, 18209, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/extensibility/node/ExtensionManagerDomain.js
_cmdDownloadFile
function _cmdDownloadFile(downloadId, url, proxy, callback, pCallback) { // Backwards compatibility check, added in 0.37 if (typeof proxy === "function") { callback = proxy; proxy = undefined; } if (pendingDownloads[downloadId]) { callback(Errors.DOWNLOAD_ID_IN_USE, null); return; } var req = request.get({ url: url, encoding: null, proxy: proxy }, // Note: we could use the traditional "response"/"data"/"end" events too if we wanted to stream data // incrementally, limit download size, etc. - but the simple callback is good enough for our needs. function (error, response, body) { if (error) { // Usually means we never got a response - server is down, no DNS entry, etc. _endDownload(downloadId, Errors.NO_SERVER_RESPONSE); return; } if (response.statusCode !== 200) { _endDownload(downloadId, [Errors.BAD_HTTP_STATUS, response.statusCode]); return; } var stream = temp.createWriteStream("brackets"); if (!stream) { _endDownload(downloadId, Errors.CANNOT_WRITE_TEMP); return; } pendingDownloads[downloadId].localPath = stream.path; pendingDownloads[downloadId].outStream = stream; stream.write(body); _endDownload(downloadId); }); pendingDownloads[downloadId] = { request: req, callback: callback }; }
javascript
function _cmdDownloadFile(downloadId, url, proxy, callback, pCallback) { // Backwards compatibility check, added in 0.37 if (typeof proxy === "function") { callback = proxy; proxy = undefined; } if (pendingDownloads[downloadId]) { callback(Errors.DOWNLOAD_ID_IN_USE, null); return; } var req = request.get({ url: url, encoding: null, proxy: proxy }, // Note: we could use the traditional "response"/"data"/"end" events too if we wanted to stream data // incrementally, limit download size, etc. - but the simple callback is good enough for our needs. function (error, response, body) { if (error) { // Usually means we never got a response - server is down, no DNS entry, etc. _endDownload(downloadId, Errors.NO_SERVER_RESPONSE); return; } if (response.statusCode !== 200) { _endDownload(downloadId, [Errors.BAD_HTTP_STATUS, response.statusCode]); return; } var stream = temp.createWriteStream("brackets"); if (!stream) { _endDownload(downloadId, Errors.CANNOT_WRITE_TEMP); return; } pendingDownloads[downloadId].localPath = stream.path; pendingDownloads[downloadId].outStream = stream; stream.write(body); _endDownload(downloadId); }); pendingDownloads[downloadId] = { request: req, callback: callback }; }
[ "function", "_cmdDownloadFile", "(", "downloadId", ",", "url", ",", "proxy", ",", "callback", ",", "pCallback", ")", "{", "// Backwards compatibility check, added in 0.37", "if", "(", "typeof", "proxy", "===", "\"function\"", ")", "{", "callback", "=", "proxy", ";...
Implements "downloadFile" command, asynchronously.
[ "Implements", "downloadFile", "command", "asynchronously", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/ExtensionManagerDomain.js#L386-L429
train
Download a file from the server
[ 30522, 3853, 1035, 4642, 14141, 12384, 11066, 8873, 2571, 1006, 8816, 3593, 1010, 24471, 2140, 1010, 24540, 1010, 2655, 5963, 1010, 7473, 8095, 5963, 1007, 1063, 1013, 1013, 11043, 21778, 4638, 1010, 2794, 1999, 1014, 1012, 4261, 2065, 1006...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
goldfire/howler.js
dist/howler.js
function() { var self = this; var url = null; // If no audio is available, quit immediately. if (Howler.noAudio) { self._emit('loaderror', null, 'No audio support.'); return; } // Make sure our source is in an array. if (typeof self._src === 'string') { self._src = [self._src]; } // Loop through the sources and pick the first one that is compatible. for (var i=0; i<self._src.length; i++) { var ext, str; if (self._format && self._format[i]) { // If an extension was specified, use that instead. ext = self._format[i]; } else { // Make sure the source is a string. str = self._src[i]; if (typeof str !== 'string') { self._emit('loaderror', null, 'Non-string found in selected audio sources - ignoring.'); continue; } // Extract the file extension from the URL or base64 data URI. ext = /^data:audio\/([^;,]+);/i.exec(str); if (!ext) { ext = /\.([^.]+)$/.exec(str.split('?', 1)[0]); } if (ext) { ext = ext[1].toLowerCase(); } } // Log a warning if no extension was found. if (!ext) { console.warn('No file extension was found. Consider using the "format" property or specify an extension.'); } // Check if this extension is available. if (ext && Howler.codecs(ext)) { url = self._src[i]; break; } } if (!url) { self._emit('loaderror', null, 'No codec support for selected audio sources.'); return; } self._src = url; self._state = 'loading'; // If the hosting page is HTTPS and the source isn't, // drop down to HTML5 Audio to avoid Mixed Content errors. if (window.location.protocol === 'https:' && url.slice(0, 5) === 'http:') { self._html5 = true; self._webAudio = false; } // Create a new sound object and add it to the pool. new Sound(self); // Load and decode the audio data for playback. if (self._webAudio) { loadBuffer(self); } return self; }
javascript
function() { var self = this; var url = null; // If no audio is available, quit immediately. if (Howler.noAudio) { self._emit('loaderror', null, 'No audio support.'); return; } // Make sure our source is in an array. if (typeof self._src === 'string') { self._src = [self._src]; } // Loop through the sources and pick the first one that is compatible. for (var i=0; i<self._src.length; i++) { var ext, str; if (self._format && self._format[i]) { // If an extension was specified, use that instead. ext = self._format[i]; } else { // Make sure the source is a string. str = self._src[i]; if (typeof str !== 'string') { self._emit('loaderror', null, 'Non-string found in selected audio sources - ignoring.'); continue; } // Extract the file extension from the URL or base64 data URI. ext = /^data:audio\/([^;,]+);/i.exec(str); if (!ext) { ext = /\.([^.]+)$/.exec(str.split('?', 1)[0]); } if (ext) { ext = ext[1].toLowerCase(); } } // Log a warning if no extension was found. if (!ext) { console.warn('No file extension was found. Consider using the "format" property or specify an extension.'); } // Check if this extension is available. if (ext && Howler.codecs(ext)) { url = self._src[i]; break; } } if (!url) { self._emit('loaderror', null, 'No codec support for selected audio sources.'); return; } self._src = url; self._state = 'loading'; // If the hosting page is HTTPS and the source isn't, // drop down to HTML5 Audio to avoid Mixed Content errors. if (window.location.protocol === 'https:' && url.slice(0, 5) === 'http:') { self._html5 = true; self._webAudio = false; } // Create a new sound object and add it to the pool. new Sound(self); // Load and decode the audio data for playback. if (self._webAudio) { loadBuffer(self); } return self; }
[ "function", "(", ")", "{", "var", "self", "=", "this", ";", "var", "url", "=", "null", ";", "// If no audio is available, quit immediately.", "if", "(", "Howler", ".", "noAudio", ")", "{", "self", ".", "_emit", "(", "'loaderror'", ",", "null", ",", "'No au...
Load the audio file. @return {Howler}
[ "Load", "the", "audio", "file", "." ]
030db918dd8ce640afd57e172418472497e8f113
https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L624-L701
train
Load the audio file.
[ 30522, 3853, 1006, 1007, 1063, 13075, 2969, 1027, 2023, 1025, 13075, 24471, 2140, 1027, 19701, 1025, 1013, 1013, 2065, 2053, 5746, 2003, 2800, 1010, 8046, 3202, 1012, 2065, 1006, 22912, 2121, 1012, 2053, 19513, 3695, 1007, 1063, 2969, 1012,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/incubator-echarts
src/coord/parallel/Parallel.js
function (data, callback, start, end) { start == null && (start = 0); end == null && (end = data.count()); var axesMap = this._axesMap; var dimensions = this.dimensions; var dataDimensions = []; var axisModels = []; zrUtil.each(dimensions, function (axisDim) { dataDimensions.push(data.mapDimension(axisDim)); axisModels.push(axesMap.get(axisDim).model); }); var hasActiveSet = this.hasAxisBrushed(); for (var dataIndex = start; dataIndex < end; dataIndex++) { var activeState; if (!hasActiveSet) { activeState = 'normal'; } else { activeState = 'active'; var values = data.getValues(dataDimensions, dataIndex); for (var j = 0, lenj = dimensions.length; j < lenj; j++) { var state = axisModels[j].getActiveState(values[j]); if (state === 'inactive') { activeState = 'inactive'; break; } } } callback(activeState, dataIndex); } }
javascript
function (data, callback, start, end) { start == null && (start = 0); end == null && (end = data.count()); var axesMap = this._axesMap; var dimensions = this.dimensions; var dataDimensions = []; var axisModels = []; zrUtil.each(dimensions, function (axisDim) { dataDimensions.push(data.mapDimension(axisDim)); axisModels.push(axesMap.get(axisDim).model); }); var hasActiveSet = this.hasAxisBrushed(); for (var dataIndex = start; dataIndex < end; dataIndex++) { var activeState; if (!hasActiveSet) { activeState = 'normal'; } else { activeState = 'active'; var values = data.getValues(dataDimensions, dataIndex); for (var j = 0, lenj = dimensions.length; j < lenj; j++) { var state = axisModels[j].getActiveState(values[j]); if (state === 'inactive') { activeState = 'inactive'; break; } } } callback(activeState, dataIndex); } }
[ "function", "(", "data", ",", "callback", ",", "start", ",", "end", ")", "{", "start", "==", "null", "&&", "(", "start", "=", "0", ")", ";", "end", "==", "null", "&&", "(", "end", "=", "data", ".", "count", "(", ")", ")", ";", "var", "axesMap",...
Travel data for one time, get activeState of each data item. @param {module:echarts/data/List} data @param {Functio} cb param: {string} activeState 'active' or 'inactive' or 'normal' {number} dataIndex @param {number} [start=0] the start dataIndex that travel from. @param {number} [end=data.count()] the next dataIndex of the last dataIndex will be travel.
[ "Travel", "data", "for", "one", "time", "get", "activeState", "of", "each", "data", "item", "." ]
4d0ea095dc3929cb6de40c45748826e7999c7aa8
https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/parallel/Parallel.js#L359-L396
train
get active state
[ 30522, 3853, 1006, 2951, 1010, 2655, 5963, 1010, 2707, 1010, 2203, 1007, 1063, 2707, 1027, 1027, 19701, 1004, 1004, 1006, 2707, 1027, 1014, 1007, 1025, 2203, 1027, 1027, 19701, 1004, 1004, 1006, 2203, 1027, 2951, 1012, 4175, 1006, 1007, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/extensibility/node/ExtensionManagerDomain.js
_cmdInstall
function _cmdInstall(packagePath, destinationDirectory, options, callback, pCallback, _doUpdate) { if (!options || !options.disabledDirectory || !options.apiVersion || !options.systemExtensionDirectory) { callback(new Error(Errors.MISSING_REQUIRED_OPTIONS), null); return; } function validateCallback(err, validationResult) { validationResult.localPath = packagePath; // This is a wrapper for the callback that will delete the temporary // directory to which the package was unzipped. function deleteTempAndCallback(err) { if (validationResult.extractDir) { fs.remove(validationResult.extractDir); delete validationResult.extractDir; } callback(err, validationResult); } // If there was trouble at the validation stage, we stop right away. if (err || validationResult.errors.length > 0) { validationResult.installationStatus = Statuses.FAILED; deleteTempAndCallback(err); return; } // Prefers the package.json name field, but will take the zip // file's name if that's all that's available. var extensionName, guessedName; if (options.nameHint) { guessedName = path.basename(options.nameHint, ".zip"); } else { guessedName = path.basename(packagePath, ".zip"); } if (validationResult.metadata) { extensionName = validationResult.metadata.name; } else { extensionName = guessedName; } validationResult.name = extensionName; var installDirectory = path.join(destinationDirectory, extensionName), legacyDirectory = path.join(destinationDirectory, guessedName), systemInstallDirectory = path.join(options.systemExtensionDirectory, extensionName); if (validationResult.metadata && validationResult.metadata.engines && validationResult.metadata.engines.brackets) { var compatible = semver.satisfies(options.apiVersion, validationResult.metadata.engines.brackets); if (!compatible) { installDirectory = path.join(options.disabledDirectory, extensionName); validationResult.installationStatus = Statuses.DISABLED; validationResult.disabledReason = Errors.API_NOT_COMPATIBLE; _removeAndInstall(packagePath, installDirectory, validationResult, deleteTempAndCallback); return; } } // The "legacy" stuff should go away after all of the commonly used extensions // have been upgraded with package.json files. var hasLegacyPackage = validationResult.metadata && legacyPackageCheck(legacyDirectory); // If the extension is already there, we signal to the front end that it's already installed // unless the front end has signaled an intent to update. if (hasLegacyPackage || fs.existsSync(installDirectory) || fs.existsSync(systemInstallDirectory)) { if (_doUpdate === true) { if (hasLegacyPackage) { // When there's a legacy installed extension, remove it first, // then also remove any new-style directory the user may have. // This helps clean up if the user is in a state where they have // both legacy and new extensions installed. fs.remove(legacyDirectory, function (err) { if (err) { deleteTempAndCallback(err); return; } _removeAndInstall(packagePath, installDirectory, validationResult, deleteTempAndCallback); }); } else { _removeAndInstall(packagePath, installDirectory, validationResult, deleteTempAndCallback); } } else if (hasLegacyPackage) { validationResult.installationStatus = Statuses.NEEDS_UPDATE; validationResult.name = guessedName; deleteTempAndCallback(null); } else { _checkExistingInstallation(validationResult, installDirectory, systemInstallDirectory, deleteTempAndCallback); } } else { // Regular installation with no conflicts. validationResult.disabledReason = null; _performInstall(packagePath, installDirectory, validationResult, deleteTempAndCallback); } } validate(packagePath, options, validateCallback); }
javascript
function _cmdInstall(packagePath, destinationDirectory, options, callback, pCallback, _doUpdate) { if (!options || !options.disabledDirectory || !options.apiVersion || !options.systemExtensionDirectory) { callback(new Error(Errors.MISSING_REQUIRED_OPTIONS), null); return; } function validateCallback(err, validationResult) { validationResult.localPath = packagePath; // This is a wrapper for the callback that will delete the temporary // directory to which the package was unzipped. function deleteTempAndCallback(err) { if (validationResult.extractDir) { fs.remove(validationResult.extractDir); delete validationResult.extractDir; } callback(err, validationResult); } // If there was trouble at the validation stage, we stop right away. if (err || validationResult.errors.length > 0) { validationResult.installationStatus = Statuses.FAILED; deleteTempAndCallback(err); return; } // Prefers the package.json name field, but will take the zip // file's name if that's all that's available. var extensionName, guessedName; if (options.nameHint) { guessedName = path.basename(options.nameHint, ".zip"); } else { guessedName = path.basename(packagePath, ".zip"); } if (validationResult.metadata) { extensionName = validationResult.metadata.name; } else { extensionName = guessedName; } validationResult.name = extensionName; var installDirectory = path.join(destinationDirectory, extensionName), legacyDirectory = path.join(destinationDirectory, guessedName), systemInstallDirectory = path.join(options.systemExtensionDirectory, extensionName); if (validationResult.metadata && validationResult.metadata.engines && validationResult.metadata.engines.brackets) { var compatible = semver.satisfies(options.apiVersion, validationResult.metadata.engines.brackets); if (!compatible) { installDirectory = path.join(options.disabledDirectory, extensionName); validationResult.installationStatus = Statuses.DISABLED; validationResult.disabledReason = Errors.API_NOT_COMPATIBLE; _removeAndInstall(packagePath, installDirectory, validationResult, deleteTempAndCallback); return; } } // The "legacy" stuff should go away after all of the commonly used extensions // have been upgraded with package.json files. var hasLegacyPackage = validationResult.metadata && legacyPackageCheck(legacyDirectory); // If the extension is already there, we signal to the front end that it's already installed // unless the front end has signaled an intent to update. if (hasLegacyPackage || fs.existsSync(installDirectory) || fs.existsSync(systemInstallDirectory)) { if (_doUpdate === true) { if (hasLegacyPackage) { // When there's a legacy installed extension, remove it first, // then also remove any new-style directory the user may have. // This helps clean up if the user is in a state where they have // both legacy and new extensions installed. fs.remove(legacyDirectory, function (err) { if (err) { deleteTempAndCallback(err); return; } _removeAndInstall(packagePath, installDirectory, validationResult, deleteTempAndCallback); }); } else { _removeAndInstall(packagePath, installDirectory, validationResult, deleteTempAndCallback); } } else if (hasLegacyPackage) { validationResult.installationStatus = Statuses.NEEDS_UPDATE; validationResult.name = guessedName; deleteTempAndCallback(null); } else { _checkExistingInstallation(validationResult, installDirectory, systemInstallDirectory, deleteTempAndCallback); } } else { // Regular installation with no conflicts. validationResult.disabledReason = null; _performInstall(packagePath, installDirectory, validationResult, deleteTempAndCallback); } } validate(packagePath, options, validateCallback); }
[ "function", "_cmdInstall", "(", "packagePath", ",", "destinationDirectory", ",", "options", ",", "callback", ",", "pCallback", ",", "_doUpdate", ")", "{", "if", "(", "!", "options", "||", "!", "options", ".", "disabledDirectory", "||", "!", "options", ".", "...
Implements the "install" command in the "extensions" domain. There is no need to call validate independently. Validation is the first thing that is done here. After the extension is validated, it is installed in destinationDirectory unless the extension is already present there. If it is already present, a determination is made about whether the package being installed is an update. If it does appear to be an update, then result.installationStatus is set to NEEDS_UPDATE. If not, then it's set to ALREADY_INSTALLED. If the installation succeeds, then result.installationStatus is set to INSTALLED. The extension is unzipped into a directory in destinationDirectory with the name of the extension (the name is derived either from package.json or the name of the zip file). The destinationDirectory will be created if it does not exist. @param {string} Absolute path to the package zip file @param {string} the destination directory @param {{disabledDirectory: !string, apiVersion: !string, nameHint: ?string, systemExtensionDirectory: !string}} additional settings to control the installation @param {function} callback (err, result) @param {function} pCallback (msg) callback for notifications about operation progress @param {boolean} _doUpdate private argument to signal that an update should be performed
[ "Implements", "the", "install", "command", "in", "the", "extensions", "domain", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/ExtensionManagerDomain.js#L217-L313
train
Installs a package. zip to the specified destination directory.
[ 30522, 3853, 1035, 4642, 8718, 9153, 3363, 1006, 7427, 15069, 1010, 7688, 4305, 2890, 16761, 2100, 1010, 7047, 1010, 2655, 5963, 1010, 7473, 8095, 5963, 1010, 1035, 2079, 6279, 13701, 1007, 1063, 2065, 1006, 999, 7047, 1064, 1064, 999, 70...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
third_party/js/mozmill/shared-modules/addons.js
addonsManager_disableAddon
function addonsManager_disableAddon(aSpec) { var spec = aSpec || { }; spec.button = "disable"; var button = this.getAddonButton(spec); this._controller.click(button); }
javascript
function addonsManager_disableAddon(aSpec) { var spec = aSpec || { }; spec.button = "disable"; var button = this.getAddonButton(spec); this._controller.click(button); }
[ "function", "addonsManager_disableAddon", "(", "aSpec", ")", "{", "var", "spec", "=", "aSpec", "||", "{", "}", ";", "spec", ".", "button", "=", "\"disable\"", ";", "var", "button", "=", "this", ".", "getAddonButton", "(", "spec", ")", ";", "this", ".", ...
Disables the specified add-on @param {object} aSpec Information on which add-on to operate on Elements: addon - Add-on element
[ "Disables", "the", "specified", "add", "-", "on" ]
38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd
https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/addons.js#L361-L367
train
Disable an add - on
[ 30522, 3853, 5587, 5644, 24805, 4590, 1035, 4487, 19150, 4215, 5280, 1006, 2004, 5051, 2278, 1007, 1063, 13075, 28699, 1027, 2004, 5051, 2278, 1064, 1064, 1063, 1065, 1025, 28699, 1012, 6462, 1027, 1000, 4487, 19150, 1000, 1025, 13075, 6462...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/utils/StringMatch.js
findSpecialCharacters
function findSpecialCharacters(str) { var i, c; // the beginning of the string is always special var specials = [0]; // lastSegmentSpecialsIndex starts off with the assumption that // there are no segments var lastSegmentSpecialsIndex = 0; // used to track down the camelCase changeovers var lastWasLowerCase = false; for (i = 0; i < str.length; i++) { c = str[i]; if (c === "/") { // new segment means this character and the next are special specials.push(i++); specials.push(i); lastSegmentSpecialsIndex = specials.length - 1; lastWasLowerCase = false; } else if (c === "." || c === "-" || c === "_") { // _, . and - are separators so they are // special and so is the next character specials.push(i); if (str[i + 1] !== "/") { // if the next key is a slash, handle it separately // see #10871 specials.push(++i); } lastWasLowerCase = false; } else if (c.toUpperCase() === c) { // this is the check for camelCase changeovers if (lastWasLowerCase) { specials.push(i); } lastWasLowerCase = false; } else { lastWasLowerCase = true; } } return { specials: specials, lastSegmentSpecialsIndex: lastSegmentSpecialsIndex }; }
javascript
function findSpecialCharacters(str) { var i, c; // the beginning of the string is always special var specials = [0]; // lastSegmentSpecialsIndex starts off with the assumption that // there are no segments var lastSegmentSpecialsIndex = 0; // used to track down the camelCase changeovers var lastWasLowerCase = false; for (i = 0; i < str.length; i++) { c = str[i]; if (c === "/") { // new segment means this character and the next are special specials.push(i++); specials.push(i); lastSegmentSpecialsIndex = specials.length - 1; lastWasLowerCase = false; } else if (c === "." || c === "-" || c === "_") { // _, . and - are separators so they are // special and so is the next character specials.push(i); if (str[i + 1] !== "/") { // if the next key is a slash, handle it separately // see #10871 specials.push(++i); } lastWasLowerCase = false; } else if (c.toUpperCase() === c) { // this is the check for camelCase changeovers if (lastWasLowerCase) { specials.push(i); } lastWasLowerCase = false; } else { lastWasLowerCase = true; } } return { specials: specials, lastSegmentSpecialsIndex: lastSegmentSpecialsIndex }; }
[ "function", "findSpecialCharacters", "(", "str", ")", "{", "var", "i", ",", "c", ";", "// the beginning of the string is always special", "var", "specials", "=", "[", "0", "]", ";", "// lastSegmentSpecialsIndex starts off with the assumption that", "// there are no segments",...
/* Identifies the "special" characters in the given string. Special characters for matching purposes are: * the first character * "/" and the character following the "/" * "_", "." and "-" and the character following it * an uppercase character that follows a lowercase one (think camelCase) The returned object contains an array called "specials". This array is a list of indexes into the original string where all of the special characters are. It also has a property "lastSegmentSpecialsIndex" which is an index into the specials array that denotes which location is the beginning of the last path segment. (This is used to allow scanning of the last segment's specials separately.) @param {string} input string to break apart (e.g. filename that is being searched) @return {{specials:Array.<number>, lastSegmentSpecialsIndex:number}}
[ "/", "*", "Identifies", "the", "special", "characters", "in", "the", "given", "string", ".", "Special", "characters", "for", "matching", "purposes", "are", ":" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/StringMatch.js#L61-L106
train
find special characters in the string
[ 30522, 3853, 4858, 5051, 13247, 7507, 22648, 7747, 1006, 2358, 2099, 1007, 1063, 13075, 1045, 1010, 1039, 1025, 1013, 1013, 1996, 2927, 1997, 1996, 5164, 2003, 2467, 2569, 13075, 19247, 1027, 1031, 1014, 1033, 1025, 1013, 1013, 16180, 13910...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
tensorflow/tfjs-models
body-pix/demos/index.js
setupFPS
function setupFPS() { stats.showPanel(0); // 0: fps, 1: ms, 2: mb, 3+: custom if (guiState.showFps) { document.body.appendChild(stats.dom); } }
javascript
function setupFPS() { stats.showPanel(0); // 0: fps, 1: ms, 2: mb, 3+: custom if (guiState.showFps) { document.body.appendChild(stats.dom); } }
[ "function", "setupFPS", "(", ")", "{", "stats", ".", "showPanel", "(", "0", ")", ";", "// 0: fps, 1: ms, 2: mb, 3+: custom", "if", "(", "guiState", ".", "showFps", ")", "{", "document", ".", "body", ".", "appendChild", "(", "stats", ".", "dom", ")", ";", ...
Sets up a frames per second panel on the top-left of the window
[ "Sets", "up", "a", "frames", "per", "second", "panel", "on", "the", "top", "-", "left", "of", "the", "window" ]
af194797c90cc5bcac1060d3cd41b0258a34c7dc
https://github.com/tensorflow/tfjs-models/blob/af194797c90cc5bcac1060d3cd41b0258a34c7dc/body-pix/demos/index.js#L342-L347
train
Setup the FPS panel
[ 30522, 3853, 16437, 22540, 2015, 1006, 1007, 1063, 26319, 1012, 2265, 9739, 2884, 1006, 1014, 1007, 1025, 1013, 1013, 1014, 1024, 1042, 4523, 1010, 1015, 1024, 5796, 1010, 1016, 1024, 16914, 1010, 1017, 1009, 1024, 7661, 2065, 1006, 30524, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
summernote/summernote
src/js/summernote.js
function() { const type = $.type(lists.head(arguments)); const isExternalAPICalled = type === 'string'; const hasInitOptions = type === 'object'; const options = $.extend({}, $.summernote.options, hasInitOptions ? lists.head(arguments) : {}); // Update options options.langInfo = $.extend(true, {}, $.summernote.lang['en-US'], $.summernote.lang[options.lang]); options.icons = $.extend(true, {}, $.summernote.options.icons, options.icons); options.tooltip = options.tooltip === 'auto' ? !env.isSupportTouch : options.tooltip; this.each((idx, note) => { const $note = $(note); if (!$note.data('summernote')) { const context = new Context($note, options); $note.data('summernote', context); $note.data('summernote').triggerEvent('init', context.layoutInfo); } }); const $note = this.first(); if ($note.length) { const context = $note.data('summernote'); if (isExternalAPICalled) { return context.invoke.apply(context, lists.from(arguments)); } else if (options.focus) { context.invoke('editor.focus'); } } return this; }
javascript
function() { const type = $.type(lists.head(arguments)); const isExternalAPICalled = type === 'string'; const hasInitOptions = type === 'object'; const options = $.extend({}, $.summernote.options, hasInitOptions ? lists.head(arguments) : {}); // Update options options.langInfo = $.extend(true, {}, $.summernote.lang['en-US'], $.summernote.lang[options.lang]); options.icons = $.extend(true, {}, $.summernote.options.icons, options.icons); options.tooltip = options.tooltip === 'auto' ? !env.isSupportTouch : options.tooltip; this.each((idx, note) => { const $note = $(note); if (!$note.data('summernote')) { const context = new Context($note, options); $note.data('summernote', context); $note.data('summernote').triggerEvent('init', context.layoutInfo); } }); const $note = this.first(); if ($note.length) { const context = $note.data('summernote'); if (isExternalAPICalled) { return context.invoke.apply(context, lists.from(arguments)); } else if (options.focus) { context.invoke('editor.focus'); } } return this; }
[ "function", "(", ")", "{", "const", "type", "=", "$", ".", "type", "(", "lists", ".", "head", "(", "arguments", ")", ")", ";", "const", "isExternalAPICalled", "=", "type", "===", "'string'", ";", "const", "hasInitOptions", "=", "type", "===", "'object'",...
Summernote API @param {Object|String} @return {this}
[ "Summernote", "API" ]
8dcafb8107453006b905ef697a529c42e76beb3f
https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/summernote.js#L13-L45
train
This method is called by the summernote API to initialize the context
[ 30522, 3853, 1006, 1007, 1063, 9530, 3367, 2828, 1027, 1002, 1012, 2828, 1006, 7201, 1012, 2132, 1006, 9918, 1007, 1007, 1025, 9530, 3367, 2003, 10288, 16451, 7911, 24330, 24164, 2094, 1027, 2828, 1027, 1027, 1027, 1005, 5164, 1005, 1025, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Microsoft/BotFramework-WebChat
packages/component/src/Activity/SendStatus.js
sendFailed
function sendFailed(language, replace) { const text = localize('SEND_FAILED_KEY', language); const retry = localize('Retry', language); const match = /\{Retry\}/.exec(text); if (match) { return ( <React.Fragment> { text.substr(0, match.index) } { replace(retry) } { text.substr(match.index + match[0].length) } </React.Fragment> ); } else { return text; } }
javascript
function sendFailed(language, replace) { const text = localize('SEND_FAILED_KEY', language); const retry = localize('Retry', language); const match = /\{Retry\}/.exec(text); if (match) { return ( <React.Fragment> { text.substr(0, match.index) } { replace(retry) } { text.substr(match.index + match[0].length) } </React.Fragment> ); } else { return text; } }
[ "function", "sendFailed", "(", "language", ",", "replace", ")", "{", "const", "text", "=", "localize", "(", "'SEND_FAILED_KEY'", ",", "language", ")", ";", "const", "retry", "=", "localize", "(", "'Retry'", ",", "language", ")", ";", "const", "match", "=",...
TODO: [P4] Currently, this is the only place which use a templated string We could refactor this into a general component if there are more templated strings
[ "TODO", ":", "[", "P4", "]", "Currently", "this", "is", "the", "only", "place", "which", "use", "a", "templated", "string", "We", "could", "refactor", "this", "into", "a", "general", "component", "if", "there", "are", "more", "templated", "strings" ]
8bc934d3d07d1ca901d52b5e3a9481fddcdbd91e
https://github.com/Microsoft/BotFramework-WebChat/blob/8bc934d3d07d1ca901d52b5e3a9481fddcdbd91e/packages/component/src/Activity/SendStatus.js#L12-L28
train
Send failed message
[ 30522, 3853, 4604, 7011, 18450, 1006, 2653, 1010, 5672, 1007, 1063, 9530, 3367, 3793, 1027, 2334, 4697, 1006, 1005, 4604, 1035, 3478, 1035, 3145, 1005, 1010, 2653, 1007, 1025, 9530, 3367, 2128, 11129, 1027, 2334, 4697, 1006, 1005, 2128, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SheetJS/js-xlsx
xlsx.js
write_BrtCellIgnoreEC
function write_BrtCellIgnoreEC(ref) { var o = new_buf(24); o.write_shift(4, 4); o.write_shift(4, 1); write_UncheckedRfX(ref, o); return o; }
javascript
function write_BrtCellIgnoreEC(ref) { var o = new_buf(24); o.write_shift(4, 4); o.write_shift(4, 1); write_UncheckedRfX(ref, o); return o; }
[ "function", "write_BrtCellIgnoreEC", "(", "ref", ")", "{", "var", "o", "=", "new_buf", "(", "24", ")", ";", "o", ".", "write_shift", "(", "4", ",", "4", ")", ";", "o", ".", "write_shift", "(", "4", ",", "1", ")", ";", "write_UncheckedRfX", "(", "re...
/* [MS-XLSB] 2.4.309 BrtCellIgnoreEC
[ "/", "*", "[", "MS", "-", "XLSB", "]", "2", ".", "4", ".", "309", "BrtCellIgnoreEC" ]
9a6d8a1d3d80c78dad5201fb389316f935279cdc
https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L13745-L13751
train
Write a BrtCellIgnoreEC to the buffer
[ 30522, 3853, 4339, 1035, 7987, 13535, 13348, 26745, 9910, 2278, 1006, 25416, 1007, 1063, 13075, 1051, 1027, 2047, 1035, 20934, 2546, 1006, 2484, 1007, 1025, 1051, 1012, 4339, 1035, 5670, 1006, 1018, 1010, 1018, 1007, 1025, 1051, 1012, 4339,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
openlayers/openlayers
src/ol/format/TopoJSON.js
transformArc
function transformArc(arc, scale, translate) { let x = 0; let y = 0; for (let i = 0, ii = arc.length; i < ii; ++i) { const vertex = arc[i]; x += vertex[0]; y += vertex[1]; vertex[0] = x; vertex[1] = y; transformVertex(vertex, scale, translate); } }
javascript
function transformArc(arc, scale, translate) { let x = 0; let y = 0; for (let i = 0, ii = arc.length; i < ii; ++i) { const vertex = arc[i]; x += vertex[0]; y += vertex[1]; vertex[0] = x; vertex[1] = y; transformVertex(vertex, scale, translate); } }
[ "function", "transformArc", "(", "arc", ",", "scale", ",", "translate", ")", "{", "let", "x", "=", "0", ";", "let", "y", "=", "0", ";", "for", "(", "let", "i", "=", "0", ",", "ii", "=", "arc", ".", "length", ";", "i", "<", "ii", ";", "++", ...
Apply a linear transform to an arc. The provided arc is modified in place. @param {Array<import("../coordinate.js").Coordinate>} arc Arc. @param {Array<number>} scale Scale for each dimension. @param {Array<number>} translate Translation for each dimension.
[ "Apply", "a", "linear", "transform", "to", "an", "arc", ".", "The", "provided", "arc", "is", "modified", "in", "place", "." ]
f366eaea522388fb575b11010e69d309164baca7
https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/src/ol/format/TopoJSON.js#L381-L392
train
Transform an arc
[ 30522, 3853, 10938, 2906, 2278, 1006, 8115, 1010, 4094, 1010, 17637, 1007, 1063, 2292, 1060, 1027, 1014, 1025, 2292, 1061, 1027, 1014, 1025, 2005, 1006, 2292, 1045, 1027, 1014, 1010, 2462, 1027, 8115, 1012, 3091, 1025, 1045, 1026, 2462, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js
scopeLookup
function scopeLookup(sQualifiedName, sPropertyName) { var sSchema; /* * Sets <code>vLocation</code> and delegates to {@link log}. */ function logWithLocation() { vLocation = vLocation || sTarget && sPropertyName && sTarget + "/" + sPropertyName; return log.apply(this, arguments); } vBindingParameterType = vResult && vResult.$Type; if (that.bSupportReferences && !(sQualifiedName in mScope)) { // unknown qualified name: maybe schema is referenced and can be included? sSchema = schema(sQualifiedName); vResult = getOrFetchSchema(that, mScope, sSchema, logWithLocation); } if (sQualifiedName in mScope) { sTarget = sName = sSchemaChildName = sQualifiedName; vResult = oSchemaChild = mScope[sSchemaChildName]; if (!isThenable(vResult)) { return true; // qualified name found, steps may continue } } if (isThenable(vResult) && vResult.isPending()) { // load on demand still pending (else it must be rejected at this point) return logWithLocation(DEBUG, "Waiting for ", sSchema); } return logWithLocation(WARNING, "Unknown qualified name ", sQualifiedName); }
javascript
function scopeLookup(sQualifiedName, sPropertyName) { var sSchema; /* * Sets <code>vLocation</code> and delegates to {@link log}. */ function logWithLocation() { vLocation = vLocation || sTarget && sPropertyName && sTarget + "/" + sPropertyName; return log.apply(this, arguments); } vBindingParameterType = vResult && vResult.$Type; if (that.bSupportReferences && !(sQualifiedName in mScope)) { // unknown qualified name: maybe schema is referenced and can be included? sSchema = schema(sQualifiedName); vResult = getOrFetchSchema(that, mScope, sSchema, logWithLocation); } if (sQualifiedName in mScope) { sTarget = sName = sSchemaChildName = sQualifiedName; vResult = oSchemaChild = mScope[sSchemaChildName]; if (!isThenable(vResult)) { return true; // qualified name found, steps may continue } } if (isThenable(vResult) && vResult.isPending()) { // load on demand still pending (else it must be rejected at this point) return logWithLocation(DEBUG, "Waiting for ", sSchema); } return logWithLocation(WARNING, "Unknown qualified name ", sQualifiedName); }
[ "function", "scopeLookup", "(", "sQualifiedName", ",", "sPropertyName", ")", "{", "var", "sSchema", ";", "/*\n\t\t\t\t * Sets <code>vLocation</code> and delegates to {@link log}.\n\t\t\t\t */", "function", "logWithLocation", "(", ")", "{", "vLocation", "=", "vLocation", "||",...
/* Looks up the given qualified name in the global scope. @param {string} sQualifiedName A qualified name @param {string} [sPropertyName] Where the qualified name was found @returns {boolean} Whether to continue after scope lookup
[ "/", "*", "Looks", "up", "the", "given", "qualified", "name", "in", "the", "global", "scope", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js#L1168-L1201
train
This function is called by the scope constructor to look up a qualified name in the scope.
[ 30522, 3853, 9531, 4135, 21940, 2361, 1006, 5490, 8787, 7810, 18442, 1010, 11867, 18981, 15010, 18442, 1007, 1063, 13075, 7020, 5403, 2863, 1025, 1013, 1008, 1008, 4520, 1026, 3642, 1028, 1058, 4135, 10719, 1026, 1013, 3642, 1028, 1998, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/extensions/default/RecentProjects/main.js
keydownHook
function keydownHook(event) { var keyHandled = false; switch (event.keyCode) { case KeyEvent.DOM_VK_UP: selectNextItem(-1); keyHandled = true; break; case KeyEvent.DOM_VK_DOWN: selectNextItem(+1); keyHandled = true; break; case KeyEvent.DOM_VK_ENTER: case KeyEvent.DOM_VK_RETURN: if ($dropdownItem) { $dropdownItem.trigger("click"); } keyHandled = true; break; case KeyEvent.DOM_VK_BACK_SPACE: case KeyEvent.DOM_VK_DELETE: if ($dropdownItem) { removeSelectedItem(event); keyHandled = true; } break; } if (keyHandled) { event.stopImmediatePropagation(); event.preventDefault(); } return keyHandled; }
javascript
function keydownHook(event) { var keyHandled = false; switch (event.keyCode) { case KeyEvent.DOM_VK_UP: selectNextItem(-1); keyHandled = true; break; case KeyEvent.DOM_VK_DOWN: selectNextItem(+1); keyHandled = true; break; case KeyEvent.DOM_VK_ENTER: case KeyEvent.DOM_VK_RETURN: if ($dropdownItem) { $dropdownItem.trigger("click"); } keyHandled = true; break; case KeyEvent.DOM_VK_BACK_SPACE: case KeyEvent.DOM_VK_DELETE: if ($dropdownItem) { removeSelectedItem(event); keyHandled = true; } break; } if (keyHandled) { event.stopImmediatePropagation(); event.preventDefault(); } return keyHandled; }
[ "function", "keydownHook", "(", "event", ")", "{", "var", "keyHandled", "=", "false", ";", "switch", "(", "event", ".", "keyCode", ")", "{", "case", "KeyEvent", ".", "DOM_VK_UP", ":", "selectNextItem", "(", "-", "1", ")", ";", "keyHandled", "=", "true", ...
Handles the Key Down events @param {KeyboardEvent} event @return {boolean} True if the key was handled
[ "Handles", "the", "Key", "Down", "events" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L210-L243
train
keydown hook for the keydown event
[ 30522, 3853, 3145, 7698, 6806, 6559, 1006, 2724, 1007, 1063, 13075, 3145, 11774, 3709, 1027, 6270, 1025, 6942, 1006, 2724, 1012, 3145, 16044, 1007, 1063, 2553, 3145, 18697, 3372, 1012, 14383, 1035, 1058, 2243, 1035, 2039, 1024, 7276, 2638, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/brackets.js
_beforeHTMLReady
function _beforeHTMLReady() { // Add the platform (mac, win or linux) to the body tag so we can have platform-specific CSS rules $("body").addClass("platform-" + brackets.platform); // Browser-hosted version may also have different CSS (e.g. since '#titlebar' is shown) if (brackets.inBrowser) { $("body").addClass("in-browser"); } else { $("body").addClass("in-appshell"); } // Enable/Disable HTML Menus if (brackets.nativeMenus) { $("body").addClass("has-appshell-menus"); } else { // (issue #5310) workaround for bootstrap dropdown: prevent the menu item to grab // the focus -- override jquery focus implementation for top-level menu items (function () { var defaultFocus = $.fn.focus; $.fn.focus = function () { if (!this.hasClass("dropdown-toggle")) { return defaultFocus.apply(this, arguments); } }; }()); } // Localize MainViewHTML and inject into <BODY> tag $("body").html(Mustache.render(MainViewHTML, { shouldAddAA: (brackets.platform === "mac"), Strings: Strings })); // Update title $("title").text(brackets.config.app_title); // Respond to dragging & dropping files/folders onto the window by opening them. If we don't respond // to these events, the file would load in place of the Brackets UI DragAndDrop.attachHandlers(); // TODO: (issue 269) to support IE, need to listen to document instead (and even then it may not work when focus is in an input field?) $(window).focus(function () { // This call to syncOpenDocuments() *should* be a no-op now that we have // file watchers, but is still here as a safety net. FileSyncManager.syncOpenDocuments(); }); // Prevent unhandled middle button clicks from triggering native behavior // Example: activating AutoScroll (see #510) $("html").on("mousedown", ".inline-widget", function (e) { if (e.button === 1) { e.preventDefault(); } }); // The .no-focus style is added to clickable elements that should // not steal focus. Calling preventDefault() on mousedown prevents // focus from going to the click target. $("html").on("mousedown", ".no-focus", function (e) { // Text fields should always be focusable. var $target = $(e.target), isFormElement = $target.is("input") || $target.is("textarea") || $target.is("select"); if (!isFormElement) { e.preventDefault(); } }); // Prevent clicks on any link from navigating to a different page (which could lose unsaved // changes). We can't use a simple .on("click", "a") because of http://bugs.jquery.com/ticket/3861: // jQuery hides non-left clicks from such event handlers, yet middle-clicks still cause CEF to // navigate. Also, a capture handler is more reliable than bubble. window.document.body.addEventListener("click", function (e) { // Check parents too, in case link has inline formatting tags var node = e.target, url; while (node) { if (node.tagName === "A") { url = node.getAttribute("href"); if (url && !url.match(/^#/)) { NativeApp.openURLInDefaultBrowser(url); } e.preventDefault(); break; } node = node.parentElement; } }, true); // Prevent extensions from using window.open() to insecurely load untrusted web content var real_windowOpen = window.open; window.open = function (url) { // Allow file:// URLs, relative URLs (implicitly file: also), and about:blank if (!url.match(/^file:\/\//) && !url.match(/^about:blank/) && url.indexOf(":") !== -1) { throw new Error("Brackets-shell is not a secure general purpose web browser. Use NativeApp.openURLInDefaultBrowser() to open URLs in the user's main browser"); } return real_windowOpen.apply(window, arguments); }; // jQuery patch to shim deprecated usage of $() on EventDispatchers var DefaultCtor = jQuery.fn.init; jQuery.fn.init = function (firstArg, secondArg) { var jQObject = new DefaultCtor(firstArg, secondArg); // Is this a Brackets EventDispatcher object? (not a DOM node or other object) if (firstArg && firstArg._EventDispatcher) { // Patch the jQ wrapper object so it calls EventDispatcher's APIs instead of jQuery's jQObject.on = firstArg.on.bind(firstArg); jQObject.one = firstArg.one.bind(firstArg); jQObject.off = firstArg.off.bind(firstArg); // Don't offer legacy support for trigger()/triggerHandler() on core model objects; extensions // shouldn't be doing that anyway since it's basically poking at private API // Console warning, since $() is deprecated for EventDispatcher objects // (pass true to only print once per caller, and index 4 since the extension caller is deeper in the stack than usual) DeprecationWarning.deprecationWarning("Deprecated: Do not use $().on/off() on Brackets modules and model objects. Call on()/off() directly on the object without a $() wrapper.", true, 4); } return jQObject; }; }
javascript
function _beforeHTMLReady() { // Add the platform (mac, win or linux) to the body tag so we can have platform-specific CSS rules $("body").addClass("platform-" + brackets.platform); // Browser-hosted version may also have different CSS (e.g. since '#titlebar' is shown) if (brackets.inBrowser) { $("body").addClass("in-browser"); } else { $("body").addClass("in-appshell"); } // Enable/Disable HTML Menus if (brackets.nativeMenus) { $("body").addClass("has-appshell-menus"); } else { // (issue #5310) workaround for bootstrap dropdown: prevent the menu item to grab // the focus -- override jquery focus implementation for top-level menu items (function () { var defaultFocus = $.fn.focus; $.fn.focus = function () { if (!this.hasClass("dropdown-toggle")) { return defaultFocus.apply(this, arguments); } }; }()); } // Localize MainViewHTML and inject into <BODY> tag $("body").html(Mustache.render(MainViewHTML, { shouldAddAA: (brackets.platform === "mac"), Strings: Strings })); // Update title $("title").text(brackets.config.app_title); // Respond to dragging & dropping files/folders onto the window by opening them. If we don't respond // to these events, the file would load in place of the Brackets UI DragAndDrop.attachHandlers(); // TODO: (issue 269) to support IE, need to listen to document instead (and even then it may not work when focus is in an input field?) $(window).focus(function () { // This call to syncOpenDocuments() *should* be a no-op now that we have // file watchers, but is still here as a safety net. FileSyncManager.syncOpenDocuments(); }); // Prevent unhandled middle button clicks from triggering native behavior // Example: activating AutoScroll (see #510) $("html").on("mousedown", ".inline-widget", function (e) { if (e.button === 1) { e.preventDefault(); } }); // The .no-focus style is added to clickable elements that should // not steal focus. Calling preventDefault() on mousedown prevents // focus from going to the click target. $("html").on("mousedown", ".no-focus", function (e) { // Text fields should always be focusable. var $target = $(e.target), isFormElement = $target.is("input") || $target.is("textarea") || $target.is("select"); if (!isFormElement) { e.preventDefault(); } }); // Prevent clicks on any link from navigating to a different page (which could lose unsaved // changes). We can't use a simple .on("click", "a") because of http://bugs.jquery.com/ticket/3861: // jQuery hides non-left clicks from such event handlers, yet middle-clicks still cause CEF to // navigate. Also, a capture handler is more reliable than bubble. window.document.body.addEventListener("click", function (e) { // Check parents too, in case link has inline formatting tags var node = e.target, url; while (node) { if (node.tagName === "A") { url = node.getAttribute("href"); if (url && !url.match(/^#/)) { NativeApp.openURLInDefaultBrowser(url); } e.preventDefault(); break; } node = node.parentElement; } }, true); // Prevent extensions from using window.open() to insecurely load untrusted web content var real_windowOpen = window.open; window.open = function (url) { // Allow file:// URLs, relative URLs (implicitly file: also), and about:blank if (!url.match(/^file:\/\//) && !url.match(/^about:blank/) && url.indexOf(":") !== -1) { throw new Error("Brackets-shell is not a secure general purpose web browser. Use NativeApp.openURLInDefaultBrowser() to open URLs in the user's main browser"); } return real_windowOpen.apply(window, arguments); }; // jQuery patch to shim deprecated usage of $() on EventDispatchers var DefaultCtor = jQuery.fn.init; jQuery.fn.init = function (firstArg, secondArg) { var jQObject = new DefaultCtor(firstArg, secondArg); // Is this a Brackets EventDispatcher object? (not a DOM node or other object) if (firstArg && firstArg._EventDispatcher) { // Patch the jQ wrapper object so it calls EventDispatcher's APIs instead of jQuery's jQObject.on = firstArg.on.bind(firstArg); jQObject.one = firstArg.one.bind(firstArg); jQObject.off = firstArg.off.bind(firstArg); // Don't offer legacy support for trigger()/triggerHandler() on core model objects; extensions // shouldn't be doing that anyway since it's basically poking at private API // Console warning, since $() is deprecated for EventDispatcher objects // (pass true to only print once per caller, and index 4 since the extension caller is deeper in the stack than usual) DeprecationWarning.deprecationWarning("Deprecated: Do not use $().on/off() on Brackets modules and model objects. Call on()/off() directly on the object without a $() wrapper.", true, 4); } return jQObject; }; }
[ "function", "_beforeHTMLReady", "(", ")", "{", "// Add the platform (mac, win or linux) to the body tag so we can have platform-specific CSS rules", "$", "(", "\"body\"", ")", ".", "addClass", "(", "\"platform-\"", "+", "brackets", ".", "platform", ")", ";", "// Browser-hoste...
Setup event handlers prior to dispatching AppInit.HTML_READY
[ "Setup", "event", "handlers", "prior", "to", "dispatching", "AppInit", ".", "HTML_READY" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/brackets.js#L369-L487
train
Before HTML ready
[ 30522, 3853, 1035, 2077, 11039, 19968, 16416, 5149, 1006, 1007, 1063, 1013, 1013, 5587, 1996, 4132, 1006, 6097, 1010, 2663, 2030, 11603, 1007, 2000, 1996, 2303, 6415, 2061, 2057, 2064, 2031, 4132, 1011, 3563, 20116, 2015, 3513, 1002, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.unified/src/sap/ui/unified/CalendarTimeInterval.js
_renderTimesRow
function _renderTimesRow(bSkipFocus){ var oDate = this._getFocusedDate(); var oTimesRow = this.getAggregation("timesRow"); if (!bSkipFocus) { oTimesRow.setDate(CalendarUtils._createLocalDate(oDate, true)); } else { oTimesRow.displayDate(CalendarUtils._createLocalDate(oDate, true)); } // change header buttons _updateHeader.call(this); }
javascript
function _renderTimesRow(bSkipFocus){ var oDate = this._getFocusedDate(); var oTimesRow = this.getAggregation("timesRow"); if (!bSkipFocus) { oTimesRow.setDate(CalendarUtils._createLocalDate(oDate, true)); } else { oTimesRow.displayDate(CalendarUtils._createLocalDate(oDate, true)); } // change header buttons _updateHeader.call(this); }
[ "function", "_renderTimesRow", "(", "bSkipFocus", ")", "{", "var", "oDate", "=", "this", ".", "_getFocusedDate", "(", ")", ";", "var", "oTimesRow", "=", "this", ".", "getAggregation", "(", "\"timesRow\"", ")", ";", "if", "(", "!", "bSkipFocus", ")", "{", ...
/* sets the date in the used Month controls @param {boolean} bSkipFocus if set no focus is set to the date
[ "/", "*", "sets", "the", "date", "in", "the", "used", "Month", "controls" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.unified/src/sap/ui/unified/CalendarTimeInterval.js#L1287-L1301
train
Render the times row
[ 30522, 3853, 1035, 17552, 7292, 21338, 5004, 1006, 18667, 3211, 14376, 10085, 2271, 1007, 1063, 13075, 1051, 13701, 1027, 2023, 1012, 1035, 2131, 14876, 7874, 22367, 3686, 1006, 1007, 1025, 13075, 27178, 14428, 21338, 5004, 1027, 2023, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/core/util/reflection/BaseTreeModifier.js
function(oElement, sType) { var oInstance = ObjectPath.get(sType); if (typeof oInstance === "function") { return oElement instanceof oInstance; } else { return false; } }
javascript
function(oElement, sType) { var oInstance = ObjectPath.get(sType); if (typeof oInstance === "function") { return oElement instanceof oInstance; } else { return false; } }
[ "function", "(", "oElement", ",", "sType", ")", "{", "var", "oInstance", "=", "ObjectPath", ".", "get", "(", "sType", ")", ";", "if", "(", "typeof", "oInstance", "===", "\"function\"", ")", "{", "return", "oElement", "instanceof", "oInstance", ";", "}", ...
Checks if the element is an instance of the type. @param {object} oElement - Element to be checked @param {string} sType - Type that the element should be checked against @returns {boolean} <code>true</code> if the element is an instance of the type
[ "Checks", "if", "the", "element", "is", "an", "instance", "of", "the", "type", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/reflection/BaseTreeModifier.js#L266-L273
train
Returns true if the given element is an instance of the given type
[ 30522, 3853, 1006, 30524, 18863, 1007, 1025, 2065, 1006, 2828, 11253, 1051, 7076, 26897, 1027, 1027, 1027, 1000, 3853, 1000, 1007, 1063, 2709, 1051, 12260, 3672, 6013, 11253, 1051, 7076, 26897, 1025, 1065, 2842, 1063, 2709, 6270, 1025, 1065...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
third_party/js/mozmill/shared-modules/downloads.js
downloadManager_cleanAll
function downloadManager_cleanAll(downloads) { // Cancel any active downloads this.cancelActiveDownloads(); // If no downloads have been specified retrieve the list from the database if (downloads === undefined || downloads.length == 0) downloads = this.getAllDownloads(); else downloads = downloads.concat(this.getAllDownloads()); // Delete all files referred to in the Download Manager this.deleteDownloadedFiles(downloads); // Clean any entries from the Download Manager database this.cleanUp(); }
javascript
function downloadManager_cleanAll(downloads) { // Cancel any active downloads this.cancelActiveDownloads(); // If no downloads have been specified retrieve the list from the database if (downloads === undefined || downloads.length == 0) downloads = this.getAllDownloads(); else downloads = downloads.concat(this.getAllDownloads()); // Delete all files referred to in the Download Manager this.deleteDownloadedFiles(downloads); // Clean any entries from the Download Manager database this.cleanUp(); }
[ "function", "downloadManager_cleanAll", "(", "downloads", ")", "{", "// Cancel any active downloads", "this", ".", "cancelActiveDownloads", "(", ")", ";", "// If no downloads have been specified retrieve the list from the database", "if", "(", "downloads", "===", "undefined", "...
Cancel any active downloads, remove the files, and clean up the Download Manager database @param {Array of download} downloads Downloaded files which should be deleted (optional)
[ "Cancel", "any", "active", "downloads", "remove", "the", "files", "and", "clean", "up", "the", "Download", "Manager", "database" ]
38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd
https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/downloads.js#L132-L147
train
Clean all the downloaded files
[ 30522, 3853, 8816, 24805, 4590, 1035, 4550, 8095, 1006, 22956, 1007, 1063, 1013, 1013, 17542, 2151, 3161, 22956, 2023, 1012, 17542, 19620, 7698, 11066, 2015, 1006, 1007, 1025, 1013, 1013, 2065, 2053, 22956, 2031, 2042, 9675, 12850, 1996, 28...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
pagekit/vue-resource
dist/vue-resource.esm.js
query
function query (options$$1, next) { var urlParams = Object.keys(Url.options.params), query = {}, url = next(options$$1); each(options$$1.params, function (value, key) { if (urlParams.indexOf(key) === -1) { query[key] = value; } }); query = Url.params(query); if (query) { url += (url.indexOf('?') == -1 ? '?' : '&') + query; } return url; }
javascript
function query (options$$1, next) { var urlParams = Object.keys(Url.options.params), query = {}, url = next(options$$1); each(options$$1.params, function (value, key) { if (urlParams.indexOf(key) === -1) { query[key] = value; } }); query = Url.params(query); if (query) { url += (url.indexOf('?') == -1 ? '?' : '&') + query; } return url; }
[ "function", "query", "(", "options$$1", ",", "next", ")", "{", "var", "urlParams", "=", "Object", ".", "keys", "(", "Url", ".", "options", ".", "params", ")", ",", "query", "=", "{", "}", ",", "url", "=", "next", "(", "options$$1", ")", ";", "each"...
Query Parameter Transform.
[ "Query", "Parameter", "Transform", "." ]
fe268fa1d6053ede5f34aef9a11e1a424a70446c
https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L463-L480
train
Query the url for the resource
[ 30522, 3853, 23032, 1006, 7047, 1002, 1002, 1015, 1010, 2279, 1007, 1063, 13075, 24471, 14277, 5400, 5244, 1027, 4874, 1012, 6309, 1006, 24471, 2140, 1012, 7047, 1012, 11498, 5244, 1007, 1010, 23032, 1027, 1063, 1065, 1010, 24471, 2140, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/extensions/default/RecentProjects/main.js
renderDelete
function renderDelete() { return $("<div id='recent-folder-delete' class='trash-icon'>&times;</div>") .mouseup(function (e) { // Don't let the click bubble upward. e.stopPropagation(); // Remove the project from the preferences. var recentProjects = getRecentProjects(), index = recentProjects.indexOf($(this).parent().data("path")), newProjects = [], i; for (i = 0; i < recentProjects.length; i++) { if (i !== index) { newProjects.push(recentProjects[i]); } } PreferencesManager.setViewState("recentProjects", newProjects); $(this).closest("li").remove(); checkHovers(e.pageX, e.pageY); if (newProjects.length === 1) { $dropdown.find(".divider").remove(); } }); }
javascript
function renderDelete() { return $("<div id='recent-folder-delete' class='trash-icon'>&times;</div>") .mouseup(function (e) { // Don't let the click bubble upward. e.stopPropagation(); // Remove the project from the preferences. var recentProjects = getRecentProjects(), index = recentProjects.indexOf($(this).parent().data("path")), newProjects = [], i; for (i = 0; i < recentProjects.length; i++) { if (i !== index) { newProjects.push(recentProjects[i]); } } PreferencesManager.setViewState("recentProjects", newProjects); $(this).closest("li").remove(); checkHovers(e.pageX, e.pageY); if (newProjects.length === 1) { $dropdown.find(".divider").remove(); } }); }
[ "function", "renderDelete", "(", ")", "{", "return", "$", "(", "\"<div id='recent-folder-delete' class='trash-icon'>&times;</div>\"", ")", ".", "mouseup", "(", "function", "(", "e", ")", "{", "// Don't let the click bubble upward.", "e", ".", "stopPropagation", "(", ")"...
Create the "delete" button that shows up when you hover over a project.
[ "Create", "the", "delete", "button", "that", "shows", "up", "when", "you", "hover", "over", "a", "project", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L114-L138
train
Render the delete button
[ 30522, 3853, 17552, 9247, 12870, 1006, 1007, 1063, 2709, 1002, 1006, 1000, 1026, 4487, 2615, 8909, 1027, 1005, 3522, 1011, 19622, 1011, 3972, 12870, 1005, 2465, 1027, 1005, 11669, 1011, 12696, 1005, 1028, 1004, 2335, 1025, 1026, 1013, 4487,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.layout/src/sap/ui/layout/form/FormElement.js
_fieldOnAfterRendering
function _fieldOnAfterRendering(oEvent){ // call function of parent (if assigned) var oParent = this.oElement.getParent(); if (oParent && oParent.contentOnAfterRendering) { oParent.contentOnAfterRendering( this.oElement, oEvent.srcControl); } }
javascript
function _fieldOnAfterRendering(oEvent){ // call function of parent (if assigned) var oParent = this.oElement.getParent(); if (oParent && oParent.contentOnAfterRendering) { oParent.contentOnAfterRendering( this.oElement, oEvent.srcControl); } }
[ "function", "_fieldOnAfterRendering", "(", "oEvent", ")", "{", "// call function of parent (if assigned)", "var", "oParent", "=", "this", ".", "oElement", ".", "getParent", "(", ")", ";", "if", "(", "oParent", "&&", "oParent", ".", "contentOnAfterRendering", ")", ...
/* If onAfterRendering of a field is processed the Form (layout) might need to change it.
[ "/", "*", "If", "onAfterRendering", "of", "a", "field", "is", "processed", "the", "Form", "(", "layout", ")", "might", "need", "to", "change", "it", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.layout/src/sap/ui/layout/form/FormElement.js#L490-L498
train
called after the field is rendered
[ 30522, 3853, 1035, 2492, 7856, 6199, 28849, 11563, 2075, 1006, 1051, 18697, 3372, 1007, 1063, 1013, 1013, 2655, 3853, 1997, 6687, 1006, 2065, 4137, 1007, 13075, 6728, 12069, 3372, 1027, 2023, 1012, 1051, 12260, 3672, 1012, 2131, 19362, 4765...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aws/aws-sdk-js
doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/doctools.js
function() { var path = document.location.pathname; var parts = path.split(/\//); $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { if (this == '..') parts.pop(); }); var url = parts.join('/'); return path.substring(url.lastIndexOf('/') + 1, path.length - 1); }
javascript
function() { var path = document.location.pathname; var parts = path.split(/\//); $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { if (this == '..') parts.pop(); }); var url = parts.join('/'); return path.substring(url.lastIndexOf('/') + 1, path.length - 1); }
[ "function", "(", ")", "{", "var", "path", "=", "document", ".", "location", ".", "pathname", ";", "var", "parts", "=", "path", ".", "split", "(", "/", "\\/", "/", ")", ";", "$", ".", "each", "(", "DOCUMENTATION_OPTIONS", ".", "URL_ROOT", ".", "split"...
get the current relative url
[ "get", "the", "current", "relative", "url" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/doctools.js#L230-L239
train
Get the current page
[ 30522, 3853, 1006, 1007, 1063, 13075, 4130, 1027, 6254, 1012, 3295, 1012, 4130, 18442, 1025, 13075, 3033, 1027, 4130, 1012, 3975, 1006, 1013, 1032, 1013, 1013, 1007, 1025, 1002, 1012, 2169, 1006, 12653, 1035, 7047, 1012, 24471, 2140, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
transloadit/uppy
examples/transloadit/main.js
openModal
function openModal () { robodog.pick({ restrictions: { allowedFileTypes: ['.png'] }, waitForEncoding: true, params: { auth: { key: TRANSLOADIT_KEY }, template_id: TEMPLATE_ID }, providers: [ 'webcam' ] // if providers need custom config // webcam: { // option: 'whatever' // } }).then(console.log, console.error) }
javascript
function openModal () { robodog.pick({ restrictions: { allowedFileTypes: ['.png'] }, waitForEncoding: true, params: { auth: { key: TRANSLOADIT_KEY }, template_id: TEMPLATE_ID }, providers: [ 'webcam' ] // if providers need custom config // webcam: { // option: 'whatever' // } }).then(console.log, console.error) }
[ "function", "openModal", "(", ")", "{", "robodog", ".", "pick", "(", "{", "restrictions", ":", "{", "allowedFileTypes", ":", "[", "'.png'", "]", "}", ",", "waitForEncoding", ":", "true", ",", "params", ":", "{", "auth", ":", "{", "key", ":", "TRANSLOAD...
robodog.modal
[ "robodog", ".", "modal" ]
7ae18bf992d544a64da998f033258ec09a3de275
https://github.com/transloadit/uppy/blob/7ae18bf992d544a64da998f033258ec09a3de275/examples/transloadit/main.js#L81-L99
train
open modal
[ 30522, 3853, 2330, 5302, 9305, 1006, 1007, 1063, 6487, 7716, 8649, 1012, 4060, 1006, 1063, 9259, 1024, 1063, 3039, 8873, 7485, 18863, 2015, 1024, 1031, 1005, 1012, 1052, 3070, 1005, 1033, 1065, 1010, 3524, 29278, 2368, 3597, 4667, 1024, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/extensions/default/NavigationAndHistory/main.js
_handlePaneMerge
function _handlePaneMerge(e, paneId) { var index; var targetPaneId = MainViewManager.FIRST_PANE; $.each(_mrofList, function (itrIndex, value) { if (value && value.paneId === paneId) { // We have got an entry which needs merge // Before modifying the actual pane info check if an entry exists with same target pane index = _.findIndex(_mrofList, function (record) { return (record && record.file === value.file && record.paneId === targetPaneId); }); if (index !== -1) { // A duplicate entry found, remove the current one instead of updating _mrofList[index] = null; } else { // Update with merged pane info _mrofList[itrIndex].paneId = targetPaneId; } } }); // Clean the null/undefined entries _mrofList = _mrofList.filter(function (e) {return e; }); PreferencesManager.setViewState(OPEN_FILES_VIEW_STATE, _mrofList, _getPrefsContext(), true); }
javascript
function _handlePaneMerge(e, paneId) { var index; var targetPaneId = MainViewManager.FIRST_PANE; $.each(_mrofList, function (itrIndex, value) { if (value && value.paneId === paneId) { // We have got an entry which needs merge // Before modifying the actual pane info check if an entry exists with same target pane index = _.findIndex(_mrofList, function (record) { return (record && record.file === value.file && record.paneId === targetPaneId); }); if (index !== -1) { // A duplicate entry found, remove the current one instead of updating _mrofList[index] = null; } else { // Update with merged pane info _mrofList[itrIndex].paneId = targetPaneId; } } }); // Clean the null/undefined entries _mrofList = _mrofList.filter(function (e) {return e; }); PreferencesManager.setViewState(OPEN_FILES_VIEW_STATE, _mrofList, _getPrefsContext(), true); }
[ "function", "_handlePaneMerge", "(", "e", ",", "paneId", ")", "{", "var", "index", ";", "var", "targetPaneId", "=", "MainViewManager", ".", "FIRST_PANE", ";", "$", ".", "each", "(", "_mrofList", ",", "function", "(", "itrIndex", ",", "value", ")", "{", "...
Merges the entries to a single pane if split view have been merged Then purges duplicate entries in mrof list
[ "Merges", "the", "entries", "to", "a", "single", "pane", "if", "split", "view", "have", "been", "merged", "Then", "purges", "duplicate", "entries", "in", "mrof", "list" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L701-L723
train
Merge the pane info with the current pane info
[ 30522, 3853, 1035, 5047, 9739, 21382, 20800, 1006, 1041, 1010, 6090, 7416, 2094, 1007, 1063, 13075, 5950, 1025, 13075, 4539, 9739, 7416, 2094, 1027, 2364, 8584, 24805, 4590, 1012, 2034, 1035, 6090, 2063, 1025, 1002, 1012, 2169, 1006, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aframevr/aframe
src/components/cursor.js
function (evt) { // Raycast again for touch. if (this.data.rayOrigin === 'mouse' && evt.type === 'touchstart') { this.onMouseMove(evt); this.el.components.raycaster.checkIntersections(); evt.preventDefault(); } this.twoWayEmit(EVENTS.MOUSEDOWN); this.cursorDownEl = this.intersectedEl; }
javascript
function (evt) { // Raycast again for touch. if (this.data.rayOrigin === 'mouse' && evt.type === 'touchstart') { this.onMouseMove(evt); this.el.components.raycaster.checkIntersections(); evt.preventDefault(); } this.twoWayEmit(EVENTS.MOUSEDOWN); this.cursorDownEl = this.intersectedEl; }
[ "function", "(", "evt", ")", "{", "// Raycast again for touch.", "if", "(", "this", ".", "data", ".", "rayOrigin", "===", "'mouse'", "&&", "evt", ".", "type", "===", "'touchstart'", ")", "{", "this", ".", "onMouseMove", "(", "evt", ")", ";", "this", ".",...
Trigger mousedown and keep track of the mousedowned entity.
[ "Trigger", "mousedown", "and", "keep", "track", "of", "the", "mousedowned", "entity", "." ]
24acc78a7299a4cdfe3ef617f4d40ddf6275c992
https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/cursor.js#L225-L235
train
Mouse move event handler
[ 30522, 3853, 1006, 23408, 2102, 1007, 1063, 1013, 1013, 4097, 10526, 2153, 2005, 3543, 1012, 2065, 1006, 2023, 1012, 2951, 1012, 4097, 10050, 11528, 1027, 1027, 1027, 1005, 8000, 1005, 1004, 1004, 23408, 2102, 1012, 2828, 1027, 1027, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
ReactiveX/rxjs
docs_app/src/app/search/search-worker.js
handleMessage
function handleMessage(message) { var type = message.data.type; var id = message.data.id; var payload = message.data.payload; switch(type) { case 'load-index': makeRequest(SEARCH_TERMS_URL, function(searchInfo) { index = createIndex(loadIndex(searchInfo)); self.postMessage({type: type, id: id, payload: true}); }); break; case 'query-index': self.postMessage({type: type, id: id, payload: {query: payload, results: queryIndex(payload)}}); break; default: self.postMessage({type: type, id: id, payload: {error: 'invalid message type'}}) } }
javascript
function handleMessage(message) { var type = message.data.type; var id = message.data.id; var payload = message.data.payload; switch(type) { case 'load-index': makeRequest(SEARCH_TERMS_URL, function(searchInfo) { index = createIndex(loadIndex(searchInfo)); self.postMessage({type: type, id: id, payload: true}); }); break; case 'query-index': self.postMessage({type: type, id: id, payload: {query: payload, results: queryIndex(payload)}}); break; default: self.postMessage({type: type, id: id, payload: {error: 'invalid message type'}}) } }
[ "function", "handleMessage", "(", "message", ")", "{", "var", "type", "=", "message", ".", "data", ".", "type", ";", "var", "id", "=", "message", ".", "data", ".", "id", ";", "var", "payload", "=", "message", ".", "data", ".", "payload", ";", "switch...
The worker receives a message to load the index and to query the index
[ "The", "worker", "receives", "a", "message", "to", "load", "the", "index", "and", "to", "query", "the", "index" ]
1037a1d1e6b80c7218e7ffdf8c0d96a612653a4f
https://github.com/ReactiveX/rxjs/blob/1037a1d1e6b80c7218e7ffdf8c0d96a612653a4f/docs_app/src/app/search/search-worker.js#L42-L59
train
handle a message from the cluster
[ 30522, 3853, 5047, 7834, 3736, 3351, 1006, 4471, 1007, 1063, 13075, 2828, 1027, 4471, 1012, 2951, 1012, 2828, 1025, 13075, 8909, 1027, 4471, 1012, 2951, 1012, 8909, 1025, 13075, 18093, 1027, 4471, 1012, 2951, 1012, 18093, 1025, 6942, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/widgets/Dialogs.js
showModalDialog
function showModalDialog(dlgClass, title, message, buttons, autoDismiss) { var templateVars = { dlgClass: dlgClass, title: title || "", message: message || "", buttons: buttons || [{ className: DIALOG_BTN_CLASS_PRIMARY, id: DIALOG_BTN_OK, text: Strings.OK }] }; var template = Mustache.render(DialogTemplate, templateVars); return showModalDialogUsingTemplate(template, autoDismiss); }
javascript
function showModalDialog(dlgClass, title, message, buttons, autoDismiss) { var templateVars = { dlgClass: dlgClass, title: title || "", message: message || "", buttons: buttons || [{ className: DIALOG_BTN_CLASS_PRIMARY, id: DIALOG_BTN_OK, text: Strings.OK }] }; var template = Mustache.render(DialogTemplate, templateVars); return showModalDialogUsingTemplate(template, autoDismiss); }
[ "function", "showModalDialog", "(", "dlgClass", ",", "title", ",", "message", ",", "buttons", ",", "autoDismiss", ")", "{", "var", "templateVars", "=", "{", "dlgClass", ":", "dlgClass", ",", "title", ":", "title", "||", "\"\"", ",", "message", ":", "messag...
Creates a new general purpose modal dialog using the default template and the template variables given as parameters as described. @param {string} dlgClass A class name identifier for the dialog. Typically one of DefaultDialogs.* @param {string=} title The title of the dialog. Can contain HTML markup. Defaults to "". @param {string=} message The message to display in the dialog. Can contain HTML markup. Defaults to "". @param {Array.<{className: string, id: string, text: string}>=} buttons An array of buttons where each button has a class, id and text property. The id is used in "data-button-id". Defaults to a single Ok button. Typically className is one of DIALOG_BTN_CLASS_*, id is one of DIALOG_BTN_* @param {boolean=} autoDismiss Whether to automatically dismiss the dialog when one of the buttons is clicked. Default true. If false, you'll need to manually handle button clicks and the Esc key, and dismiss the dialog yourself when ready by calling `close()` on the returned dialog. @return {Dialog}
[ "Creates", "a", "new", "general", "purpose", "modal", "dialog", "using", "the", "default", "template", "and", "the", "template", "variables", "given", "as", "parameters", "as", "described", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/widgets/Dialogs.js#L397-L407
train
Show a modal dialog
[ 30522, 3853, 2265, 5302, 9305, 27184, 8649, 1006, 21469, 18195, 27102, 1010, 2516, 1010, 4471, 1010, 11287, 1010, 8285, 10521, 15630, 2015, 1007, 1063, 13075, 23561, 10755, 2015, 1027, 1063, 21469, 18195, 27102, 1024, 21469, 18195, 27102, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aws/aws-sdk-js
features/extra/cleanup.js
function() { var fs = require('fs'); var path = require('path'); var fixturePath = path.resolve('./features/extra/fixtures/tmp'); if (fs.existsSync(fixturePath)) { fs.readdirSync(fixturePath).forEach(function(file) { fs.unlinkSync(path.join(fixturePath, file)); }); fs.rmdirSync(fixturePath); } }
javascript
function() { var fs = require('fs'); var path = require('path'); var fixturePath = path.resolve('./features/extra/fixtures/tmp'); if (fs.existsSync(fixturePath)) { fs.readdirSync(fixturePath).forEach(function(file) { fs.unlinkSync(path.join(fixturePath, file)); }); fs.rmdirSync(fixturePath); } }
[ "function", "(", ")", "{", "var", "fs", "=", "require", "(", "'fs'", ")", ";", "var", "path", "=", "require", "(", "'path'", ")", ";", "var", "fixturePath", "=", "path", ".", "resolve", "(", "'./features/extra/fixtures/tmp'", ")", ";", "if", "(", "fs",...
Delete fixtures
[ "Delete", "fixtures" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/features/extra/cleanup.js#L33-L43
train
Remove all the fixtures
[ 30522, 3853, 1006, 1007, 1063, 13075, 1042, 2015, 1027, 5478, 1006, 1005, 1042, 2015, 1005, 1007, 1025, 13075, 4130, 1027, 5478, 1006, 1005, 4130, 1005, 1007, 1025, 13075, 15083, 15069, 1027, 4130, 1012, 10663, 1006, 1005, 1012, 1013, 2838,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
wuchangming/spy-debugger
buildin_modules/weinre/web/client/StylesSidebarPane.js
shouldCommitValueSemicolon
function shouldCommitValueSemicolon(text, cursorPosition) { // FIXME: should this account for semicolons inside comments? var openQuote = ""; for (var i = 0; i < cursorPosition; ++i) { var ch = text[i]; if (ch === "\\" && openQuote !== "") ++i; // skip next character inside string else if (!openQuote && (ch === "\"" || ch === "'")) openQuote = ch; else if (openQuote === ch) openQuote = ""; } return !openQuote; }
javascript
function shouldCommitValueSemicolon(text, cursorPosition) { // FIXME: should this account for semicolons inside comments? var openQuote = ""; for (var i = 0; i < cursorPosition; ++i) { var ch = text[i]; if (ch === "\\" && openQuote !== "") ++i; // skip next character inside string else if (!openQuote && (ch === "\"" || ch === "'")) openQuote = ch; else if (openQuote === ch) openQuote = ""; } return !openQuote; }
[ "function", "shouldCommitValueSemicolon", "(", "text", ",", "cursorPosition", ")", "{", "// FIXME: should this account for semicolons inside comments?", "var", "openQuote", "=", "\"\"", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "cursorPosition", ";", "++...
remove color swatch and the like
[ "remove", "color", "swatch", "and", "the", "like" ]
55c1dda0dff0c44920673711656ddfd7ff03c307
https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/client/StylesSidebarPane.js#L1550-L1564
train
check if the character at cursorPosition is a backslash
[ 30522, 3853, 2323, 9006, 22930, 10175, 15808, 23238, 25778, 2239, 1006, 3793, 1010, 12731, 25301, 14536, 19234, 1007, 1063, 1013, 1013, 8081, 4168, 1024, 2323, 2023, 4070, 2005, 4100, 25778, 5644, 2503, 7928, 1029, 13075, 2330, 28940, 12184, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/model/TreeBindingAdapter.js
function() { // ensure only TreeBindings are enhanced which have not been enhanced yet if (!(this instanceof TreeBinding) || this._bIsAdapted) { return; } // apply the methods of the adapters prototype to the TreeBinding instance for (var fn in TreeBindingAdapter.prototype) { if (TreeBindingAdapter.prototype.hasOwnProperty(fn)) { this[fn] = TreeBindingAdapter.prototype[fn]; } } // make sure we have a parameter object this.mParameters = this.mParameters || {}; // initialize the contexts this._aRowIndexMap = []; //Store length and threshold for all requests this._iThreshold = 0; this._iPageSize = 0; //set the default auto expand mode this.setAutoExpandMode(this.mParameters.autoExpandMode || TreeAutoExpandMode.Sequential); //default value for collapse recursive if (this.mParameters.collapseRecursive === undefined) { this.bCollapseRecursive = true; } else { this.bCollapseRecursive = !!this.mParameters.collapseRecursive; } //create general tree structure this._createTreeState(); this._bIsAdapted = true; }
javascript
function() { // ensure only TreeBindings are enhanced which have not been enhanced yet if (!(this instanceof TreeBinding) || this._bIsAdapted) { return; } // apply the methods of the adapters prototype to the TreeBinding instance for (var fn in TreeBindingAdapter.prototype) { if (TreeBindingAdapter.prototype.hasOwnProperty(fn)) { this[fn] = TreeBindingAdapter.prototype[fn]; } } // make sure we have a parameter object this.mParameters = this.mParameters || {}; // initialize the contexts this._aRowIndexMap = []; //Store length and threshold for all requests this._iThreshold = 0; this._iPageSize = 0; //set the default auto expand mode this.setAutoExpandMode(this.mParameters.autoExpandMode || TreeAutoExpandMode.Sequential); //default value for collapse recursive if (this.mParameters.collapseRecursive === undefined) { this.bCollapseRecursive = true; } else { this.bCollapseRecursive = !!this.mParameters.collapseRecursive; } //create general tree structure this._createTreeState(); this._bIsAdapted = true; }
[ "function", "(", ")", "{", "// ensure only TreeBindings are enhanced which have not been enhanced yet", "if", "(", "!", "(", "this", "instanceof", "TreeBinding", ")", "||", "this", ".", "_bIsAdapted", ")", "{", "return", ";", "}", "// apply the methods of the adapters pro...
Adapter for TreeBindings to add the ListBinding functionality and use the tree structure in list based controls. @alias sap.ui.model.TreeBindingAdapter @class @experimental This module is only for experimental and internal use! @protected
[ "Adapter", "for", "TreeBindings", "to", "add", "the", "ListBinding", "functionality", "and", "use", "the", "tree", "structure", "in", "list", "based", "controls", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/TreeBindingAdapter.js#L35-L73
train
Creates a new TreeBinding instance
[ 30522, 3853, 1006, 1007, 1063, 1013, 1013, 5676, 2069, 3392, 8428, 4667, 2015, 2024, 9412, 2029, 2031, 2025, 2042, 9412, 2664, 2065, 1006, 999, 1006, 2023, 6013, 11253, 3392, 8428, 4667, 1007, 1064, 1064, 2023, 1012, 1035, 20377, 8447, 13...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/language/XMLUtils.js
getValueQuery
function getValueQuery(tagInfo) { var query; if (tagInfo.token.string === "=") { return ""; } // Remove quotation marks in query. query = tagInfo.token.string.substr(1, tagInfo.offset - 1); // Get the last option to use as a query to support multiple options. return query.split(/\s+/).slice(-1)[0]; }
javascript
function getValueQuery(tagInfo) { var query; if (tagInfo.token.string === "=") { return ""; } // Remove quotation marks in query. query = tagInfo.token.string.substr(1, tagInfo.offset - 1); // Get the last option to use as a query to support multiple options. return query.split(/\s+/).slice(-1)[0]; }
[ "function", "getValueQuery", "(", "tagInfo", ")", "{", "var", "query", ";", "if", "(", "tagInfo", ".", "token", ".", "string", "===", "\"=\"", ")", "{", "return", "\"\"", ";", "}", "// Remove quotation marks in query.", "query", "=", "tagInfo", ".", "token",...
Return the query text of a value. @param {!{token: Object, tokenType: number, offset: number, exclusionList: Array.<string>, tagName: string, attrName: string, shouldReplace: boolean}} @return {string} The query to use to matching hints.
[ "Return", "the", "query", "text", "of", "a", "value", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/XMLUtils.js#L278-L288
train
Get the value query from the tagInfo
[ 30522, 3853, 2131, 10175, 5657, 4226, 2854, 1006, 6415, 2378, 14876, 1007, 1063, 13075, 23032, 1025, 2065, 1006, 6415, 2378, 14876, 1012, 19204, 1012, 5164, 1027, 1027, 1027, 1000, 1027, 1000, 1007, 1063, 2709, 1000, 1000, 1025, 1065, 1013,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
javascript/selenium-core/scripts/selenium-api.js
getFailureMessage
function getFailureMessage(exceptionMessage) { var msg = 'Snapsie failed: '; if (exceptionMessage) { if (exceptionMessage == "Automation server can't create object") { msg += 'Is it installed? Does it have permission to run ' + 'as an add-on? See http://snapsie.sourceforge.net/'; } else { msg += exceptionMessage; } } else { msg += 'Undocumented error'; } return msg; }
javascript
function getFailureMessage(exceptionMessage) { var msg = 'Snapsie failed: '; if (exceptionMessage) { if (exceptionMessage == "Automation server can't create object") { msg += 'Is it installed? Does it have permission to run ' + 'as an add-on? See http://snapsie.sourceforge.net/'; } else { msg += exceptionMessage; } } else { msg += 'Undocumented error'; } return msg; }
[ "function", "getFailureMessage", "(", "exceptionMessage", ")", "{", "var", "msg", "=", "'Snapsie failed: '", ";", "if", "(", "exceptionMessage", ")", "{", "if", "(", "exceptionMessage", "==", "\"Automation server can't create object\"", ")", "{", "msg", "+=", "'Is i...
targeting snapsIE >= 0.2
[ "targeting", "snapsIE", ">", "=", "0", ".", "2" ]
38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd
https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/selenium-api.js#L2982-L2998
train
getFailureMessage - returns a message that was passed to snapsie
[ 30522, 3853, 2131, 7011, 4014, 5397, 7834, 3736, 3351, 1006, 6453, 7834, 3736, 3351, 1007, 1063, 13075, 5796, 2290, 1027, 1005, 20057, 2666, 3478, 1024, 1005, 1025, 2065, 1006, 6453, 7834, 3736, 3351, 1007, 1063, 2065, 1006, 6453, 7834, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
markdown-it/markdown-it
support/demo_template/index.js
injectLineNumbers
function injectLineNumbers(tokens, idx, options, env, slf) { var line; if (tokens[idx].map && tokens[idx].level === 0) { line = tokens[idx].map[0]; tokens[idx].attrJoin('class', 'line'); tokens[idx].attrSet('data-line', String(line)); } return slf.renderToken(tokens, idx, options, env, slf); }
javascript
function injectLineNumbers(tokens, idx, options, env, slf) { var line; if (tokens[idx].map && tokens[idx].level === 0) { line = tokens[idx].map[0]; tokens[idx].attrJoin('class', 'line'); tokens[idx].attrSet('data-line', String(line)); } return slf.renderToken(tokens, idx, options, env, slf); }
[ "function", "injectLineNumbers", "(", "tokens", ",", "idx", ",", "options", ",", "env", ",", "slf", ")", "{", "var", "line", ";", "if", "(", "tokens", "[", "idx", "]", ".", "map", "&&", "tokens", "[", "idx", "]", ".", "level", "===", "0", ")", "{...
Inject line numbers for sync scroll. Notes: - We track only headings and paragraphs on first level. That's enough. - Footnotes content causes jumps. Level limit filter it automatically.
[ "Inject", "line", "numbers", "for", "sync", "scroll", ".", "Notes", ":", "-", "We", "track", "only", "headings", "and", "paragraphs", "on", "first", "level", ".", "That", "s", "enough", ".", "-", "Footnotes", "content", "causes", "jumps", ".", "Level", "...
ba6830ba13fb92953a91fb90318964ccd15b82c4
https://github.com/markdown-it/markdown-it/blob/ba6830ba13fb92953a91fb90318964ccd15b82c4/support/demo_template/index.js#L169-L177
train
Inject line numbers into the tokens
[ 30522, 3853, 1999, 20614, 4179, 19172, 17198, 1006, 19204, 2015, 1010, 8909, 2595, 1010, 7047, 1010, 4372, 2615, 1010, 22889, 2546, 1007, 1063, 13075, 2240, 1025, 2065, 1006, 19204, 2015, 1031, 8909, 2595, 1033, 1012, 4949, 1004, 1004, 1920...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
keplergl/kepler.gl
scripts/action-table-maker.js
addActionCreator
function addActionCreator(path, actionMap, filePath) { const {node, parentPath} = path; if (node.arguments.length && parentPath.node && parentPath.node.id) { const action = parentPath.node.id.name; const firstArg = node.arguments[0]; const actionType = firstArg.property ? firstArg.property.name : firstArg.name; const {loc} = parentPath.node actionMap[actionType] = actionMap[actionType] || createActionNode(actionType); actionMap[actionType].action = {name: action, path: `${filePath}#L${loc.start.line}-L${loc.end.line}`}; } }
javascript
function addActionCreator(path, actionMap, filePath) { const {node, parentPath} = path; if (node.arguments.length && parentPath.node && parentPath.node.id) { const action = parentPath.node.id.name; const firstArg = node.arguments[0]; const actionType = firstArg.property ? firstArg.property.name : firstArg.name; const {loc} = parentPath.node actionMap[actionType] = actionMap[actionType] || createActionNode(actionType); actionMap[actionType].action = {name: action, path: `${filePath}#L${loc.start.line}-L${loc.end.line}`}; } }
[ "function", "addActionCreator", "(", "path", ",", "actionMap", ",", "filePath", ")", "{", "const", "{", "node", ",", "parentPath", "}", "=", "path", ";", "if", "(", "node", ".", "arguments", ".", "length", "&&", "parentPath", ".", "node", "&&", "parentPa...
Parse createAction function to add action to action type @param {*} path @param {*} actionMap @param {*} filePath
[ "Parse", "createAction", "function", "to", "add", "action", "to", "action", "type" ]
779238435707cc54335c2d00001e4b9334b314aa
https://github.com/keplergl/kepler.gl/blob/779238435707cc54335c2d00001e4b9334b314aa/scripts/action-table-maker.js#L99-L112
train
Add action creator
[ 30522, 3853, 5587, 18908, 3258, 16748, 8844, 1006, 4130, 1010, 2895, 2863, 2361, 1010, 5371, 15069, 1007, 1063, 9530, 3367, 1063, 13045, 1010, 6687, 15069, 1065, 1027, 4130, 1025, 2065, 1006, 13045, 1012, 9918, 1012, 3091, 1004, 1004, 6687,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
angular/material
src/core/services/gesture/gesture.js
gestureEnd
function gestureEnd(ev) { if (!pointer || !typesMatch(ev, pointer)) return; updatePointerState(ev, pointer); pointer.endTime = +Date.now(); if (ev.type !== 'pointercancel') { runHandlers('end', ev); } lastPointer = pointer; pointer = null; }
javascript
function gestureEnd(ev) { if (!pointer || !typesMatch(ev, pointer)) return; updatePointerState(ev, pointer); pointer.endTime = +Date.now(); if (ev.type !== 'pointercancel') { runHandlers('end', ev); } lastPointer = pointer; pointer = null; }
[ "function", "gestureEnd", "(", "ev", ")", "{", "if", "(", "!", "pointer", "||", "!", "typesMatch", "(", "ev", ",", "pointer", ")", ")", "return", ";", "updatePointerState", "(", "ev", ",", "pointer", ")", ";", "pointer", ".", "endTime", "=", "+", "Da...
/* If an end event happens of the right type, update the pointer, run endHandlers, and save the pointer as 'lastPointer'
[ "/", "*", "If", "an", "end", "event", "happens", "of", "the", "right", "type", "update", "the", "pointer", "run", "endHandlers", "and", "save", "the", "pointer", "as", "lastPointer" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/gesture/gesture.js#L681-L693
train
End gesture event handler
[ 30522, 3853, 9218, 10497, 1006, 23408, 1007, 1063, 2065, 1006, 999, 20884, 1064, 1064, 999, 4127, 18900, 2818, 1006, 23408, 1010, 20884, 1007, 1007, 2709, 1025, 10651, 8400, 2545, 12259, 1006, 23408, 1010, 20884, 1007, 1025, 20884, 1012, 22...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
nhn/tui.editor
src/js/wysiwygCommands/tableRemoveRow.js
focusToFirstTd
function focusToFirstTd(sq, range, $tr, tableMgr) { const nextFocusCell = $tr.find('td').get(0); range.setStart(nextFocusCell, 0); range.collapse(true); tableMgr.setLastCellNode(nextFocusCell); sq.setSelection(range); }
javascript
function focusToFirstTd(sq, range, $tr, tableMgr) { const nextFocusCell = $tr.find('td').get(0); range.setStart(nextFocusCell, 0); range.collapse(true); tableMgr.setLastCellNode(nextFocusCell); sq.setSelection(range); }
[ "function", "focusToFirstTd", "(", "sq", ",", "range", ",", "$tr", ",", "tableMgr", ")", "{", "const", "nextFocusCell", "=", "$tr", ".", "find", "(", "'td'", ")", ".", "get", "(", "0", ")", ";", "range", ".", "setStart", "(", "nextFocusCell", ",", "0...
Focus to first TD in given TR @param {SquireExt} sq Squire instance @param {Range} range Range object @param {jQuery} $tr jQuery wrapped TR @param {object} tableMgr Table manager
[ "Focus", "to", "first", "TD", "in", "given", "TR" ]
e75ab08c2a7ab07d1143e318f7cde135c5e3002e
https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/wysiwygCommands/tableRemoveRow.js#L53-L60
train
Focus to first TD
[ 30522, 3853, 3579, 3406, 8873, 12096, 2102, 2094, 1006, 5490, 1010, 2846, 1010, 1002, 19817, 1010, 2795, 24798, 2099, 1007, 1063, 9530, 3367, 2279, 14876, 7874, 29109, 2140, 1027, 1002, 19817, 1012, 2424, 1006, 1005, 14595, 1005, 1007, 1012...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/incubator-echarts
src/component/tooltip/TooltipContent.js
function () { // FIXME // Move this logic to ec main? var container = this._container; var stl = container.currentStyle || document.defaultView.getComputedStyle(container); var domStyle = container.style; if (domStyle.position !== 'absolute' && stl.position !== 'absolute') { domStyle.position = 'relative'; } // Hide the tooltip // PENDING // this.hide(); }
javascript
function () { // FIXME // Move this logic to ec main? var container = this._container; var stl = container.currentStyle || document.defaultView.getComputedStyle(container); var domStyle = container.style; if (domStyle.position !== 'absolute' && stl.position !== 'absolute') { domStyle.position = 'relative'; } // Hide the tooltip // PENDING // this.hide(); }
[ "function", "(", ")", "{", "// FIXME", "// Move this logic to ec main?", "var", "container", "=", "this", ".", "_container", ";", "var", "stl", "=", "container", ".", "currentStyle", "||", "document", ".", "defaultView", ".", "getComputedStyle", "(", "container", ...
Update when tooltip is rendered
[ "Update", "when", "tooltip", "is", "rendered" ]
4d0ea095dc3929cb6de40c45748826e7999c7aa8
https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/component/tooltip/TooltipContent.js#L194-L207
train
Set the tooltip to relative
[ 30522, 3853, 1006, 1007, 1063, 1013, 1013, 8081, 4168, 1013, 1013, 2693, 2023, 7961, 2000, 14925, 2364, 1029, 13075, 11661, 1027, 2023, 1012, 1035, 11661, 1025, 13075, 2358, 2140, 1027, 11661, 1012, 14731, 27983, 1064, 1064, 6254, 1012, 123...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js
requireFor
function requireFor(oElement) { var mAlias2URN = {}, oAttribute = oElement.getAttributeNodeNS(sNAMESPACE, "require"), sModuleNames, aURNs; function asyncRequire() { return new SyncPromise(function (resolve) { // Note: currently there is no way to detect failure sap.ui.require(aURNs, function (/*oModule,...*/) { var aModules = arguments; Object.keys(mAlias2URN).forEach(function (sAlias, i) { oScope[sAlias] = aModules[i]; }); resolve(); }); }); } if (oAttribute && oAttribute.value) { sModuleNames = oAttribute.value; // Note: remove the attribute because it might look like a binding and must not // reach visitAttributes oElement.removeAttributeNode(oAttribute); if (sModuleNames[0] === "{") { mAlias2URN = JSTokenizer.parseJS(sModuleNames); aURNs = Object.keys(mAlias2URN).map(function (sAlias) { return mAlias2URN[sAlias]; }); return asyncRequire(); } // map dot-separated module names to slash-separated Unified Resource Names aURNs = sModuleNames.split(" ").map(function (sModuleName) { return sModuleName.replace(/\./g, "/"); }); if (!oViewInfo.sync) { return asyncRequire(); } aURNs.forEach(sap.ui.requireSync); } return oSyncPromiseResolved; }
javascript
function requireFor(oElement) { var mAlias2URN = {}, oAttribute = oElement.getAttributeNodeNS(sNAMESPACE, "require"), sModuleNames, aURNs; function asyncRequire() { return new SyncPromise(function (resolve) { // Note: currently there is no way to detect failure sap.ui.require(aURNs, function (/*oModule,...*/) { var aModules = arguments; Object.keys(mAlias2URN).forEach(function (sAlias, i) { oScope[sAlias] = aModules[i]; }); resolve(); }); }); } if (oAttribute && oAttribute.value) { sModuleNames = oAttribute.value; // Note: remove the attribute because it might look like a binding and must not // reach visitAttributes oElement.removeAttributeNode(oAttribute); if (sModuleNames[0] === "{") { mAlias2URN = JSTokenizer.parseJS(sModuleNames); aURNs = Object.keys(mAlias2URN).map(function (sAlias) { return mAlias2URN[sAlias]; }); return asyncRequire(); } // map dot-separated module names to slash-separated Unified Resource Names aURNs = sModuleNames.split(" ").map(function (sModuleName) { return sModuleName.replace(/\./g, "/"); }); if (!oViewInfo.sync) { return asyncRequire(); } aURNs.forEach(sap.ui.requireSync); } return oSyncPromiseResolved; }
[ "function", "requireFor", "(", "oElement", ")", "{", "var", "mAlias2URN", "=", "{", "}", ",", "oAttribute", "=", "oElement", ".", "getAttributeNodeNS", "(", "sNAMESPACE", ",", "\"require\"", ")", ",", "sModuleNames", ",", "aURNs", ";", "function", "asyncRequir...
Load required modules for the given element (a)synchronously, according to its "template:require" attribute which may contain either a space separated list of dot-separated module names or a JSON representation of a map from alias to slash-separated Unified Resource Names (URNs). In the first case, the resulting modules must be accessed from the global namespace. In the second case, they are available as local names (AMD style) similar to <template:alias> instructions. @param {Element} oElement any XML DOM element @returns {sap.ui.base.SyncPromise} A sync promise which resolves with <code>undefined</code> as soon as all required modules have been loaded @throws {Error} If loading fails in sync mode
[ "Load", "required", "modules", "for", "the", "given", "element", "(", "a", ")", "synchronously", "according", "to", "its", "template", ":", "require", "attribute", "which", "may", "contain", "either", "a", "space", "separated", "list", "of", "dot", "-", "sep...
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js#L1272-L1315
train
This function is called by sap. ui. require to determine the module name of the module.
[ 30522, 3853, 5478, 29278, 1006, 1051, 12260, 3672, 1007, 1063, 13075, 16007, 3022, 2475, 14287, 1027, 1063, 1065, 1010, 1051, 19321, 3089, 8569, 2618, 1027, 1051, 12260, 3672, 1012, 2131, 19321, 3089, 8569, 6528, 10244, 3619, 1006, 1055, 18...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js
escapeCssUrlChar
function escapeCssUrlChar(ch) { return cssUrlChars[ch] || (cssUrlChars[ch] = (ch < '\x10' ? '%0' : '%') + ch.charCodeAt(0).toString(16)); }
javascript
function escapeCssUrlChar(ch) { return cssUrlChars[ch] || (cssUrlChars[ch] = (ch < '\x10' ? '%0' : '%') + ch.charCodeAt(0).toString(16)); }
[ "function", "escapeCssUrlChar", "(", "ch", ")", "{", "return", "cssUrlChars", "[", "ch", "]", "||", "(", "cssUrlChars", "[", "ch", "]", "=", "(", "ch", "<", "'\\x10'", "?", "'%0'", ":", "'%'", ")", "+", "ch", ".", "charCodeAt", "(", "0", ")", ".", ...
Maps chars to URI escaped equivalents: "\n" -> "%0a". @private
[ "Maps", "chars", "to", "URI", "escaped", "equivalents", ":", "\\", "n", "-", ">", "%0a", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js#L857-L861
train
Escape a CSS URL character
[ 30522, 3853, 4019, 6169, 26210, 29358, 2906, 1006, 10381, 1007, 1063, 2709, 20116, 26210, 29358, 11650, 1031, 10381, 1033, 1064, 1064, 1006, 20116, 26210, 29358, 11650, 1031, 10381, 1033, 1027, 1006, 10381, 1026, 1005, 1032, 1060, 10790, 1005...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/editor/CodeHintManager.js
_handleKeydownEvent
function _handleKeydownEvent(jqEvent, editor, event) { keyDownEditor = editor; if (!(event.ctrlKey || event.altKey || event.metaKey) && (event.keyCode === KeyEvent.DOM_VK_ENTER || event.keyCode === KeyEvent.DOM_VK_RETURN || event.keyCode === KeyEvent.DOM_VK_TAB)) { lastChar = String.fromCharCode(event.keyCode); } }
javascript
function _handleKeydownEvent(jqEvent, editor, event) { keyDownEditor = editor; if (!(event.ctrlKey || event.altKey || event.metaKey) && (event.keyCode === KeyEvent.DOM_VK_ENTER || event.keyCode === KeyEvent.DOM_VK_RETURN || event.keyCode === KeyEvent.DOM_VK_TAB)) { lastChar = String.fromCharCode(event.keyCode); } }
[ "function", "_handleKeydownEvent", "(", "jqEvent", ",", "editor", ",", "event", ")", "{", "keyDownEditor", "=", "editor", ";", "if", "(", "!", "(", "event", ".", "ctrlKey", "||", "event", ".", "altKey", "||", "event", ".", "metaKey", ")", "&&", "(", "e...
Handles keys related to displaying, searching, and navigating the hint list. This gets called before handleChange. TODO: Ideally, we'd get a more semantic event from the editor that told us what changed so that we could do all of this logic without looking at key events. Then, the purposes of handleKeyEvent and handleChange could be combined. Doing this well requires changing CodeMirror. @param {Event} jqEvent @param {Editor} editor @param {KeyboardEvent} event
[ "Handles", "keys", "related", "to", "displaying", "searching", "and", "navigating", "the", "hint", "list", ".", "This", "gets", "called", "before", "handleChange", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/CodeHintManager.js#L556-L564
train
Handles a keydown event.
[ 30522, 3853, 1035, 5047, 14839, 7698, 18697, 3372, 1006, 1046, 4160, 18697, 3372, 1010, 3559, 1010, 2724, 1007, 1063, 3145, 7698, 2098, 15660, 1027, 3559, 1025, 2065, 1006, 999, 1006, 2724, 1012, 14931, 12190, 14839, 1064, 1064, 2724, 1012,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
lovell/sharp
lib/operation.js
blur
function blur (sigma) { if (!is.defined(sigma)) { // No arguments: default to mild blur this.options.blurSigma = -1; } else if (is.bool(sigma)) { // Boolean argument: apply mild blur? this.options.blurSigma = sigma ? -1 : 0; } else if (is.number(sigma) && is.inRange(sigma, 0.3, 1000)) { // Numeric argument: specific sigma this.options.blurSigma = sigma; } else { throw new Error('Invalid blur sigma (0.3 - 1000.0) ' + sigma); } return this; }
javascript
function blur (sigma) { if (!is.defined(sigma)) { // No arguments: default to mild blur this.options.blurSigma = -1; } else if (is.bool(sigma)) { // Boolean argument: apply mild blur? this.options.blurSigma = sigma ? -1 : 0; } else if (is.number(sigma) && is.inRange(sigma, 0.3, 1000)) { // Numeric argument: specific sigma this.options.blurSigma = sigma; } else { throw new Error('Invalid blur sigma (0.3 - 1000.0) ' + sigma); } return this; }
[ "function", "blur", "(", "sigma", ")", "{", "if", "(", "!", "is", ".", "defined", "(", "sigma", ")", ")", "{", "// No arguments: default to mild blur", "this", ".", "options", ".", "blurSigma", "=", "-", "1", ";", "}", "else", "if", "(", "is", ".", "...
Blur the image. When used without parameters, performs a fast, mild blur of the output image. When a `sigma` is provided, performs a slower, more accurate Gaussian blur. @param {Number} [sigma] a value between 0.3 and 1000 representing the sigma of the Gaussian mask, where `sigma = 1 + radius / 2`. @returns {Sharp} @throws {Error} Invalid parameters
[ "Blur", "the", "image", ".", "When", "used", "without", "parameters", "performs", "a", "fast", "mild", "blur", "of", "the", "output", "image", ".", "When", "a", "sigma", "is", "provided", "performs", "a", "slower", "more", "accurate", "Gaussian", "blur", "...
05d76eeadfe54713606a615185b2da047923406b
https://github.com/lovell/sharp/blob/05d76eeadfe54713606a615185b2da047923406b/lib/operation.js#L157-L171
train
Blur the image from the specified sigma
[ 30522, 3853, 14819, 1006, 13201, 1007, 1063, 2065, 1006, 999, 2003, 1012, 4225, 1006, 13201, 1007, 1007, 1063, 1013, 1013, 2053, 9918, 1024, 12398, 2000, 10256, 14819, 2023, 1012, 7047, 1012, 14819, 5332, 21693, 2050, 1027, 1011, 1015, 1025...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
GitbookIO/gitbook
lib/models/templateBlock.js
extractKwargs
function extractKwargs(args) { var last = args[args.length - 1]; return (is.object(last) && last.__keywords)? args.pop() : {}; }
javascript
function extractKwargs(args) { var last = args[args.length - 1]; return (is.object(last) && last.__keywords)? args.pop() : {}; }
[ "function", "extractKwargs", "(", "args", ")", "{", "var", "last", "=", "args", "[", "args", ".", "length", "-", "1", "]", ";", "return", "(", "is", ".", "object", "(", "last", ")", "&&", "last", ".", "__keywords", ")", "?", "args", ".", "pop", "...
Extract kwargs from an arguments array @param {Array} args @return {Object}
[ "Extract", "kwargs", "from", "an", "arguments", "array" ]
6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4
https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/models/templateBlock.js#L276-L279
train
Extract keywords from arguments
[ 30522, 3853, 14817, 2243, 9028, 5620, 1006, 12098, 5620, 1007, 1063, 13075, 2197, 30524, 3769, 1006, 1007, 1024, 1063, 1065, 1025, 1065, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/core/routing/Router.js
function(oData, fnFunction, oListener) { return this.attachEvent(Router.M_EVENTS.BYPASSED, oData, fnFunction, oListener); }
javascript
function(oData, fnFunction, oListener) { return this.attachEvent(Router.M_EVENTS.BYPASSED, oData, fnFunction, oListener); }
[ "function", "(", "oData", ",", "fnFunction", ",", "oListener", ")", "{", "return", "this", ".", "attachEvent", "(", "Router", ".", "M_EVENTS", ".", "BYPASSED", ",", "oData", ",", "fnFunction", ",", "oListener", ")", ";", "}" ]
The 'bypassed' event is fired, when no route of the router matches the changed URL hash @name sap.ui.core.routing.Router#bypassed @event @param {sap.ui.base.Event} oEvent @param {sap.ui.base.EventProvider} oEvent.getSource @param {object} oEvent.getParameters @param {string} oEvent.getParameters.hash the current URL hash which did not match any route @public Attach event-handler <code>fnFunction</code> to the 'bypassed' event of this <code>sap.ui.core.routing.Router</code>.<br/> The event will get fired, if none of the routes of the routes is matching. <br/> @param {object} [oData] The object, that should be passed along with the event-object when firing the event. @param {function} fnFunction The function to call, when the event occurs. This function will be called on the oListener-instance (if present) or in a 'static way'. @param {object} [oListener] Object on which to call the given function. If empty, this router is used. @return {sap.ui.core.routing.Router} <code>this</code> to allow method chaining @public
[ "The", "bypassed", "event", "is", "fired", "when", "no", "route", "of", "the", "router", "matches", "the", "changed", "URL", "hash" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/Router.js#L949-L951
train
attaches the bypassed event to the router
[ 30522, 3853, 1006, 1051, 2850, 2696, 1010, 1042, 2078, 11263, 27989, 1010, 19330, 27870, 3678, 1007, 1063, 2709, 2023, 1012, 29489, 15338, 1006, 2799, 2099, 1012, 1049, 1035, 2824, 1012, 27539, 1010, 1051, 2850, 2696, 1010, 1042, 2078, 1126...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/extensibility/ExtensionManager.js
cleanAvailableUpdates
function cleanAvailableUpdates(updates) { return updates.reduce(function (arr, updateInfo) { var extDefinition = extensions[updateInfo.id]; if (!extDefinition || !extDefinition.installInfo) { // extension has been uninstalled in the meantime return arr; } var installedVersion = extDefinition.installInfo.metadata.version; if (semver.lt(installedVersion, updateInfo.registryVersion)) { arr.push(updateInfo); } return arr; }, []); }
javascript
function cleanAvailableUpdates(updates) { return updates.reduce(function (arr, updateInfo) { var extDefinition = extensions[updateInfo.id]; if (!extDefinition || !extDefinition.installInfo) { // extension has been uninstalled in the meantime return arr; } var installedVersion = extDefinition.installInfo.metadata.version; if (semver.lt(installedVersion, updateInfo.registryVersion)) { arr.push(updateInfo); } return arr; }, []); }
[ "function", "cleanAvailableUpdates", "(", "updates", ")", "{", "return", "updates", ".", "reduce", "(", "function", "(", "arr", ",", "updateInfo", ")", "{", "var", "extDefinition", "=", "extensions", "[", "updateInfo", ".", "id", "]", ";", "if", "(", "!", ...
Takes the array returned from getAvailableUpdates() as an input and removes those entries that are no longer current - when currently installed version of an extension is equal or newer than registryVersion returned by getAvailableUpdates(). This function is designed to work without the necessity to download extension registry @param {Array.<{id: string, installVersion: string, registryVersion: string}>} updates previous output of getAvailableUpdates() @return {Array.<{id: string, installVersion: string, registryVersion: string}>} filtered input as function description
[ "Takes", "the", "array", "returned", "from", "getAvailableUpdates", "()", "as", "an", "input", "and", "removes", "those", "entries", "that", "are", "no", "longer", "current", "-", "when", "currently", "installed", "version", "of", "an", "extension", "is", "equ...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/ExtensionManager.js#L722-L737
train
cleanAvailableUpdates - clean the available updates
[ 30522, 3853, 4550, 12462, 11733, 3468, 6279, 27122, 1006, 14409, 1007, 1063, 2709, 14409, 1012, 5547, 1006, 3853, 1006, 12098, 2099, 1010, 10651, 2378, 14876, 1007, 1063, 13075, 4654, 2102, 30524, 16294, 22753, 1064, 1064, 999, 4654, 2102, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Shopify/draggable
src/Draggable/Plugins/Mirror/Mirror.js
resetMirror
function resetMirror({mirror, source, options, ...args}) { return withPromise((resolve) => { let offsetHeight; let offsetWidth; if (options.constrainDimensions) { const computedSourceStyles = getComputedStyle(source); offsetHeight = computedSourceStyles.getPropertyValue('height'); offsetWidth = computedSourceStyles.getPropertyValue('width'); } mirror.style.position = 'fixed'; mirror.style.pointerEvents = 'none'; mirror.style.top = 0; mirror.style.left = 0; mirror.style.margin = 0; if (options.constrainDimensions) { mirror.style.height = offsetHeight; mirror.style.width = offsetWidth; } resolve({mirror, source, options, ...args}); }); }
javascript
function resetMirror({mirror, source, options, ...args}) { return withPromise((resolve) => { let offsetHeight; let offsetWidth; if (options.constrainDimensions) { const computedSourceStyles = getComputedStyle(source); offsetHeight = computedSourceStyles.getPropertyValue('height'); offsetWidth = computedSourceStyles.getPropertyValue('width'); } mirror.style.position = 'fixed'; mirror.style.pointerEvents = 'none'; mirror.style.top = 0; mirror.style.left = 0; mirror.style.margin = 0; if (options.constrainDimensions) { mirror.style.height = offsetHeight; mirror.style.width = offsetWidth; } resolve({mirror, source, options, ...args}); }); }
[ "function", "resetMirror", "(", "{", "mirror", ",", "source", ",", "options", ",", "...", "args", "}", ")", "{", "return", "withPromise", "(", "(", "resolve", ")", "=>", "{", "let", "offsetHeight", ";", "let", "offsetWidth", ";", "if", "(", "options", ...
Applys mirror styles @param {Object} state @param {HTMLElement} state.mirror @param {HTMLElement} state.source @param {Object} state.options @return {Promise} @private
[ "Applys", "mirror", "styles" ]
ecc04b2cdb8b5009664862472ff8cb237c38cfeb
https://github.com/Shopify/draggable/blob/ecc04b2cdb8b5009664862472ff8cb237c38cfeb/src/Draggable/Plugins/Mirror/Mirror.js#L366-L390
train
Reset mirror to its default values
[ 30522, 3853, 25141, 14503, 29165, 1006, 1063, 5259, 1010, 3120, 1010, 7047, 1010, 1012, 1012, 1012, 12098, 5620, 1065, 1007, 1063, 2709, 2007, 21572, 28732, 1006, 1006, 10663, 1007, 1027, 1028, 1063, 2292, 16396, 26036, 13900, 1025, 2292, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/thirdparty/less.js
expectChar
function expectChar(arg, msg) { if (input.charAt(i) === arg) { skipWhitespace(1); return arg; } error(msg || "expected '" + arg + "' got '" + input.charAt(i) + "'"); }
javascript
function expectChar(arg, msg) { if (input.charAt(i) === arg) { skipWhitespace(1); return arg; } error(msg || "expected '" + arg + "' got '" + input.charAt(i) + "'"); }
[ "function", "expectChar", "(", "arg", ",", "msg", ")", "{", "if", "(", "input", ".", "charAt", "(", "i", ")", "===", "arg", ")", "{", "skipWhitespace", "(", "1", ")", ";", "return", "arg", ";", "}", "error", "(", "msg", "||", "\"expected '\"", "+",...
Specialization of expect()
[ "Specialization", "of", "expect", "()" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/less.js#L266-L272
train
expectChar - Check if the character is a valid character
[ 30522, 3853, 5987, 7507, 2099, 1006, 12098, 2290, 1010, 5796, 2290, 1007, 1063, 2065, 1006, 7953, 1012, 25869, 4017, 1006, 1045, 1007, 1027, 1027, 1027, 12098, 2290, 1007, 1063, 13558, 2860, 16584, 2229, 15327, 1006, 1015, 1007, 1025, 2709,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
openlayers/openlayers
examples/wms-custom-proj.js
DECtoSEX
function DECtoSEX(angle) { // Extract DMS const deg = parseInt(angle, 10); const min = parseInt((angle - deg) * 60, 10); const sec = (((angle - deg) * 60) - min) * 60; // Result in degrees sex (dd.mmss) return deg + min / 100 + sec / 10000; }
javascript
function DECtoSEX(angle) { // Extract DMS const deg = parseInt(angle, 10); const min = parseInt((angle - deg) * 60, 10); const sec = (((angle - deg) * 60) - min) * 60; // Result in degrees sex (dd.mmss) return deg + min / 100 + sec / 10000; }
[ "function", "DECtoSEX", "(", "angle", ")", "{", "// Extract DMS", "const", "deg", "=", "parseInt", "(", "angle", ",", "10", ")", ";", "const", "min", "=", "parseInt", "(", "(", "angle", "-", "deg", ")", "*", "60", ",", "10", ")", ";", "const", "sec...
Convert DEC angle to SEX DMS
[ "Convert", "DEC", "angle", "to", "SEX", "DMS" ]
f366eaea522388fb575b11010e69d309164baca7
https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/examples/wms-custom-proj.js#L193-L203
train
Convert DMS angle to sex
[ 30522, 3853, 11703, 22282, 2595, 1006, 6466, 1007, 1063, 1013, 1013, 14817, 1040, 5244, 9530, 3367, 2139, 2290, 1027, 11968, 20240, 3372, 1006, 6466, 1010, 2184, 1007, 1025, 9530, 3367, 8117, 1027, 11968, 20240, 3372, 1006, 1006, 6466, 1011...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/JSUtils/HintUtils.js
annotateKeywords
function annotateKeywords(keywords) { return keywords.map(function (t) { t.keyword = true; t.origin = "ecmascript"; return t; }); }
javascript
function annotateKeywords(keywords) { return keywords.map(function (t) { t.keyword = true; t.origin = "ecmascript"; return t; }); }
[ "function", "annotateKeywords", "(", "keywords", ")", "{", "return", "keywords", ".", "map", "(", "function", "(", "t", ")", "{", "t", ".", "keyword", "=", "true", ";", "t", ".", "origin", "=", "\"ecmascript\"", ";", "return", "t", ";", "}", ")", ";"...
/* Annotate a list of tokens as keywords @param {Array.<Object>} keyword - list of keyword tokens @return {Array.<Object>} - the input array; to each object in the array a new keyword {boolean} property has been added to indicate that the hint is a keyword.
[ "/", "*", "Annotate", "a", "list", "of", "tokens", "as", "keywords" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/HintUtils.js#L166-L172
train
annotate keywords with a keyword
[ 30522, 3853, 5754, 17287, 23125, 3240, 22104, 1006, 3145, 22104, 1007, 1063, 2709, 3145, 22104, 1012, 4949, 1006, 3853, 1006, 1056, 1007, 1063, 1056, 1012, 3145, 18351, 1027, 2995, 1025, 1056, 1012, 4761, 1027, 1000, 14925, 9335, 23235, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/incubator-echarts
src/component/helper/BrushTargetManager.js
getScales
function getScales(xyMinMaxCurr, xyMinMaxOrigin) { var sizeCurr = getSize(xyMinMaxCurr); var sizeOrigin = getSize(xyMinMaxOrigin); var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]]; isNaN(scales[0]) && (scales[0] = 1); isNaN(scales[1]) && (scales[1] = 1); return scales; }
javascript
function getScales(xyMinMaxCurr, xyMinMaxOrigin) { var sizeCurr = getSize(xyMinMaxCurr); var sizeOrigin = getSize(xyMinMaxOrigin); var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]]; isNaN(scales[0]) && (scales[0] = 1); isNaN(scales[1]) && (scales[1] = 1); return scales; }
[ "function", "getScales", "(", "xyMinMaxCurr", ",", "xyMinMaxOrigin", ")", "{", "var", "sizeCurr", "=", "getSize", "(", "xyMinMaxCurr", ")", ";", "var", "sizeOrigin", "=", "getSize", "(", "xyMinMaxOrigin", ")", ";", "var", "scales", "=", "[", "sizeCurr", "[",...
We have to process scale caused by dataZoom manually, although it might be not accurate.
[ "We", "have", "to", "process", "scale", "caused", "by", "dataZoom", "manually", "although", "it", "might", "be", "not", "accurate", "." ]
4d0ea095dc3929cb6de40c45748826e7999c7aa8
https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/component/helper/BrushTargetManager.js#L445-L452
train
Returns the scales of the image
[ 30522, 3853, 4152, 9289, 2229, 1006, 1060, 24335, 2378, 17848, 10841, 12171, 1010, 1060, 24335, 2378, 17848, 10050, 11528, 1007, 1063, 13075, 2946, 10841, 12171, 1027, 4152, 4697, 1006, 1060, 24335, 2378, 17848, 10841, 12171, 1007, 1025, 1307...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
material-components/material-components-web
scripts/cherry-pick-commits.js
attemptCherryPicks
async function attemptCherryPicks(tag, list, mode) { const results = { successful: [], conflicted: [], skipped: [], }; console.log(`Checking out ${tag}`); await simpleGit.checkout([tag]); for (const logLine of list) { if (shouldSkipCommit(logLine, mode)) { results.skipped.push(logLine); continue; } try { await simpleGit.raw(['cherry-pick', '-x', logLine.hash]); results.successful.push(logLine); } catch (e) { // Detect conflicted cherry-picks and abort them (e.message contains the command's output) if (e.message.includes(CONFLICT_MESSAGE)) { results.conflicted.push(logLine); await simpleGit.raw(['cherry-pick', '--abort']); } else if (e.message.includes('is a merge')) { const logCommand = `\`git log --oneline --graph ${logLine.hash}\``; console.warn(`Merge commit found! Run ${logCommand} and take note of commits on each parent,`); console.warn('then compare to your detached history afterwards to ensure no commits of interest were skipped.'); results.skipped.push(logLine); } else { console.error(`${logLine.hash} unexpected failure!`, e); } } } return results; }
javascript
async function attemptCherryPicks(tag, list, mode) { const results = { successful: [], conflicted: [], skipped: [], }; console.log(`Checking out ${tag}`); await simpleGit.checkout([tag]); for (const logLine of list) { if (shouldSkipCommit(logLine, mode)) { results.skipped.push(logLine); continue; } try { await simpleGit.raw(['cherry-pick', '-x', logLine.hash]); results.successful.push(logLine); } catch (e) { // Detect conflicted cherry-picks and abort them (e.message contains the command's output) if (e.message.includes(CONFLICT_MESSAGE)) { results.conflicted.push(logLine); await simpleGit.raw(['cherry-pick', '--abort']); } else if (e.message.includes('is a merge')) { const logCommand = `\`git log --oneline --graph ${logLine.hash}\``; console.warn(`Merge commit found! Run ${logCommand} and take note of commits on each parent,`); console.warn('then compare to your detached history afterwards to ensure no commits of interest were skipped.'); results.skipped.push(logLine); } else { console.error(`${logLine.hash} unexpected failure!`, e); } } } return results; }
[ "async", "function", "attemptCherryPicks", "(", "tag", ",", "list", ",", "mode", ")", "{", "const", "results", "=", "{", "successful", ":", "[", "]", ",", "conflicted", ":", "[", "]", ",", "skipped", ":", "[", "]", ",", "}", ";", "console", ".", "l...
Checks out the given tag and attempts to cherry-pick each commit in the list against it. If a conflict is encountered, that cherry-pick is aborted and processing moves on to the next commit.
[ "Checks", "out", "the", "given", "tag", "and", "attempts", "to", "cherry", "-", "pick", "each", "commit", "in", "the", "list", "against", "it", ".", "If", "a", "conflict", "is", "encountered", "that", "cherry", "-", "pick", "is", "aborted", "and", "proce...
9f8b9ae5103ff86de4f6a5cb02e700d6eb851e5f
https://github.com/material-components/material-components-web/blob/9f8b9ae5103ff86de4f6a5cb02e700d6eb851e5f/scripts/cherry-pick-commits.js#L122-L158
train
Attempts to cherry - picks the specified branch
[ 30522, 2004, 6038, 2278, 3853, 3535, 7474, 2854, 24330, 5705, 1006, 6415, 1010, 2862, 1010, 5549, 1007, 1063, 9530, 3367, 3463, 1027, 1063, 3144, 1024, 1031, 1033, 1010, 4736, 2098, 1024, 1031, 1033, 1010, 16791, 1024, 1031, 1033, 1010, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.fl/src/sap/ui/fl/Utils.js
function (ascii) { var asciiArray = ascii.split(","); var parsedString = ""; jQuery.each(asciiArray, function (index, asciiChar) { parsedString += String.fromCharCode(asciiChar); }); return parsedString; }
javascript
function (ascii) { var asciiArray = ascii.split(","); var parsedString = ""; jQuery.each(asciiArray, function (index, asciiChar) { parsedString += String.fromCharCode(asciiChar); }); return parsedString; }
[ "function", "(", "ascii", ")", "{", "var", "asciiArray", "=", "ascii", ".", "split", "(", "\",\"", ")", ";", "var", "parsedString", "=", "\"\"", ";", "jQuery", ".", "each", "(", "asciiArray", ",", "function", "(", "index", ",", "asciiChar", ")", "{", ...
Converts ASCII coding into a string. Required for restoring stored code extensions @param {String} ascii string containing ascii code valid numbers separated by ',' @returns {String} parsedString parsed string
[ "Converts", "ASCII", "coding", "into", "a", "string", ".", "Required", "for", "restoring", "stored", "code", "extensions" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/Utils.js#L816-L826
train
Parse the given ascii string
[ 30522, 3853, 1006, 2004, 6895, 2072, 1007, 1063, 13075, 2004, 6895, 2401, 11335, 2100, 1027, 2004, 6895, 2072, 1012, 3975, 1006, 1000, 1010, 1000, 1007, 1025, 13075, 11968, 6924, 3367, 4892, 1027, 1000, 1000, 1025, 1046, 4226, 2854, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
javascript/atoms/dom.js
getOverflowParent
function getOverflowParent(e) { var position = bot.dom.getEffectiveStyle(e, 'position'); if (position == 'fixed') { treatAsFixedPosition = true; // Fixed-position element may only overflow the viewport. return e == htmlElem ? null : htmlElem; } else { var parent = bot.dom.getParentElement(e); while (parent && !canBeOverflowed(parent)) { parent = bot.dom.getParentElement(parent); } return parent; } function canBeOverflowed(container) { // The HTML element can always be overflowed. if (container == htmlElem) { return true; } // An element cannot overflow an element with an inline or contents display style. var containerDisplay = /** @type {string} */ ( bot.dom.getEffectiveStyle(container, 'display')); if (goog.string.startsWith(containerDisplay, 'inline') || (containerDisplay == 'contents')) { return false; } // An absolute-positioned element cannot overflow a static-positioned one. if (position == 'absolute' && bot.dom.getEffectiveStyle(container, 'position') == 'static') { return false; } return true; } }
javascript
function getOverflowParent(e) { var position = bot.dom.getEffectiveStyle(e, 'position'); if (position == 'fixed') { treatAsFixedPosition = true; // Fixed-position element may only overflow the viewport. return e == htmlElem ? null : htmlElem; } else { var parent = bot.dom.getParentElement(e); while (parent && !canBeOverflowed(parent)) { parent = bot.dom.getParentElement(parent); } return parent; } function canBeOverflowed(container) { // The HTML element can always be overflowed. if (container == htmlElem) { return true; } // An element cannot overflow an element with an inline or contents display style. var containerDisplay = /** @type {string} */ ( bot.dom.getEffectiveStyle(container, 'display')); if (goog.string.startsWith(containerDisplay, 'inline') || (containerDisplay == 'contents')) { return false; } // An absolute-positioned element cannot overflow a static-positioned one. if (position == 'absolute' && bot.dom.getEffectiveStyle(container, 'position') == 'static') { return false; } return true; } }
[ "function", "getOverflowParent", "(", "e", ")", "{", "var", "position", "=", "bot", ".", "dom", ".", "getEffectiveStyle", "(", "e", ",", "'position'", ")", ";", "if", "(", "position", "==", "'fixed'", ")", "{", "treatAsFixedPosition", "=", "true", ";", "...
Return the closest ancestor that the given element may overflow.
[ "Return", "the", "closest", "ancestor", "that", "the", "given", "element", "may", "overflow", "." ]
38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd
https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/atoms/dom.js#L655-L688
train
Returns the parent element of the element that can overflow the viewport.
[ 30522, 3853, 2131, 7840, 12314, 19362, 4765, 1006, 1041, 1007, 1063, 13075, 2597, 1027, 28516, 1012, 14383, 1012, 2131, 12879, 25969, 24653, 27983, 1006, 1041, 1010, 1005, 2597, 1005, 1007, 1025, 2065, 1006, 2597, 1027, 1027, 1005, 4964, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
goldfire/howler.js
examples/3d/js/controls.js
function(event) { var touches = event.touches[0]; // Reset the states. this.touchEnd(event); // Determine which key to simulate. if (touches.pageY < window.innerHeight * 0.3) { this.key(true, {keyCode: 38}); } else if (touches.pageY > window.innerHeight * 0.7) { this.key(true, {keyCode: 40}); } else if (touches.pageX < window.innerWidth * 0.5) { this.key(true, {keyCode: 37}); } else if (touches.pageX > window.innerWidth * 0.5) { this.key(true, {keyCode: 39}); } }
javascript
function(event) { var touches = event.touches[0]; // Reset the states. this.touchEnd(event); // Determine which key to simulate. if (touches.pageY < window.innerHeight * 0.3) { this.key(true, {keyCode: 38}); } else if (touches.pageY > window.innerHeight * 0.7) { this.key(true, {keyCode: 40}); } else if (touches.pageX < window.innerWidth * 0.5) { this.key(true, {keyCode: 37}); } else if (touches.pageX > window.innerWidth * 0.5) { this.key(true, {keyCode: 39}); } }
[ "function", "(", "event", ")", "{", "var", "touches", "=", "event", ".", "touches", "[", "0", "]", ";", "// Reset the states.", "this", ".", "touchEnd", "(", "event", ")", ";", "// Determine which key to simulate.", "if", "(", "touches", ".", "pageY", "<", ...
Listen for touch events and determine which key to simulate. @param {Object} event DOM event data including the position touched.
[ "Listen", "for", "touch", "events", "and", "determine", "which", "key", "to", "simulate", "." ]
030db918dd8ce640afd57e172418472497e8f113
https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/examples/3d/js/controls.js#L55-L71
train
Touch end handler
[ 30522, 3853, 1006, 2724, 1007, 1063, 13075, 12817, 1027, 2724, 1012, 12817, 1031, 1014, 1033, 1025, 1013, 1013, 25141, 1996, 2163, 1012, 2023, 1012, 3543, 10497, 1006, 2724, 1007, 1025, 1013, 1013, 5646, 2029, 3145, 2000, 26633, 1012, 2065,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/search/FindInFilesUI.js
_searchIfRequired
function _searchIfRequired() { if (!FindUtils.isInstantSearchDisabled() && _findBar && _findBar._options.multifile && !_findBar._options.replace) { setTimeout(_defferedSearch, 100); } }
javascript
function _searchIfRequired() { if (!FindUtils.isInstantSearchDisabled() && _findBar && _findBar._options.multifile && !_findBar._options.replace) { setTimeout(_defferedSearch, 100); } }
[ "function", "_searchIfRequired", "(", ")", "{", "if", "(", "!", "FindUtils", ".", "isInstantSearchDisabled", "(", ")", "&&", "_findBar", "&&", "_findBar", ".", "_options", ".", "multifile", "&&", "!", "_findBar", ".", "_options", ".", "replace", ")", "{", ...
Schedules a search on search scope/filter changes. Have to schedule as when we listen to this event, the file filters might not have been updated yet.
[ "Schedules", "a", "search", "on", "search", "scope", "/", "filter", "changes", ".", "Have", "to", "schedule", "as", "when", "we", "listen", "to", "this", "event", "the", "file", "filters", "might", "not", "have", "been", "updated", "yet", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindInFilesUI.js#L447-L451
train
Search if required
[ 30522, 3853, 1035, 3945, 10128, 2890, 15549, 5596, 1006, 1007, 1063, 2065, 1006, 999, 2424, 21823, 4877, 1012, 2003, 7076, 5794, 3215, 14644, 2818, 10521, 3085, 2094, 1006, 1007, 1004, 1004, 1035, 2424, 8237, 1004, 1004, 1035, 2424, 8237, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
radare/radare2
shlr/www/graph/js-graph-it.js
findCanvas
function findCanvas(canvasId) { for (var i = 0; i < canvases.length; i++) if(canvases[i].id == canvasId) return canvases[i]; return null; }
javascript
function findCanvas(canvasId) { for (var i = 0; i < canvases.length; i++) if(canvases[i].id == canvasId) return canvases[i]; return null; }
[ "function", "findCanvas", "(", "canvasId", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "canvases", ".", "length", ";", "i", "++", ")", "if", "(", "canvases", "[", "i", "]", ".", "id", "==", "canvasId", ")", "return", "canvases", "[...
/* Utility functions
[ "/", "*", "Utility", "functions" ]
bf5e3028810a0ec7c267c6fe4bfad639b4819e35
https://github.com/radare/radare2/blob/bf5e3028810a0ec7c267c6fe4bfad639b4819e35/shlr/www/graph/js-graph-it.js#L1173-L1178
train
Find canvas by id
[ 30522, 3853, 2424, 9336, 12044, 1006, 10683, 3593, 1007, 1063, 2005, 1006, 13075, 1045, 1027, 1014, 1025, 1045, 1026, 10683, 2229, 1012, 3091, 1025, 1045, 1009, 1009, 1007, 2065, 1006, 10683, 2229, 1031, 1045, 1033, 1012, 8909, 1027, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
GeekyAnts/vue-native-core
dist/react-vue-helper.js
transitionGroupWeb
function transitionGroupWeb (Component, createElement) { return (function (Component) { function TransitionGroup () { Component.apply(this, arguments); } if ( Component ) TransitionGroup.__proto__ = Component; TransitionGroup.prototype = Object.create( Component && Component.prototype ); TransitionGroup.prototype.constructor = TransitionGroup; TransitionGroup.prototype.render = function render () { var tag = this.props.tag || 'span'; return createElement(tag, null) }; return TransitionGroup; }(Component)) }
javascript
function transitionGroupWeb (Component, createElement) { return (function (Component) { function TransitionGroup () { Component.apply(this, arguments); } if ( Component ) TransitionGroup.__proto__ = Component; TransitionGroup.prototype = Object.create( Component && Component.prototype ); TransitionGroup.prototype.constructor = TransitionGroup; TransitionGroup.prototype.render = function render () { var tag = this.props.tag || 'span'; return createElement(tag, null) }; return TransitionGroup; }(Component)) }
[ "function", "transitionGroupWeb", "(", "Component", ",", "createElement", ")", "{", "return", "(", "function", "(", "Component", ")", "{", "function", "TransitionGroup", "(", ")", "{", "Component", ".", "apply", "(", "this", ",", "arguments", ")", ";", "}", ...
unfinished
[ "unfinished" ]
a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e
https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/dist/react-vue-helper.js#L2377-L2394
train
The transitionGroupWeb is a wrapper around the React. createElement method
[ 30522, 3853, 6653, 17058, 8545, 2497, 1006, 6922, 1010, 3443, 12260, 3672, 1007, 1063, 2709, 1006, 3853, 1006, 6922, 1007, 1063, 3853, 6653, 17058, 1006, 1007, 1063, 6922, 1012, 6611, 1006, 2023, 1010, 9918, 1007, 1025, 1065, 2065, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
GitbookIO/gitbook
lib/api/decodeConfig.js
decodeGlobal
function decodeGlobal(config, result) { var values = result.values; delete values.generator; delete values.output; return config.updateValues(values); }
javascript
function decodeGlobal(config, result) { var values = result.values; delete values.generator; delete values.output; return config.updateValues(values); }
[ "function", "decodeGlobal", "(", "config", ",", "result", ")", "{", "var", "values", "=", "result", ".", "values", ";", "delete", "values", ".", "generator", ";", "delete", "values", ".", "output", ";", "return", "config", ".", "updateValues", "(", "values...
Decode changes from a JS API to a config object @param {Config} config @param {Object} result: result from API @return {Config}
[ "Decode", "changes", "from", "a", "JS", "API", "to", "a", "config", "object" ]
6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4
https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/api/decodeConfig.js#L8-L15
train
Decode a global result
[ 30522, 3853, 21933, 3207, 23296, 16429, 2389, 1006, 9530, 8873, 2290, 1010, 2765, 1007, 1063, 13075, 5300, 1027, 2765, 1012, 5300, 1025, 3972, 12870, 5300, 1012, 13103, 1025, 3972, 12870, 5300, 1012, 6434, 1025, 2709, 9530, 8873, 2290, 1012...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/core/cache/LRUPersistentCache.js
deleteMetadataForEntry
function deleteMetadataForEntry(self, key) { var iIndex = self._metadata.__byKey__[key]; delete self._metadata.__byKey__[key]; delete self._metadata.__byIndex__[iIndex]; seekMetadataLRU(self); }
javascript
function deleteMetadataForEntry(self, key) { var iIndex = self._metadata.__byKey__[key]; delete self._metadata.__byKey__[key]; delete self._metadata.__byIndex__[iIndex]; seekMetadataLRU(self); }
[ "function", "deleteMetadataForEntry", "(", "self", ",", "key", ")", "{", "var", "iIndex", "=", "self", ".", "_metadata", ".", "__byKey__", "[", "key", "]", ";", "delete", "self", ".", "_metadata", ".", "__byKey__", "[", "key", "]", ";", "delete", "self",...
Deletes all metadata for given key @param self the instance @param key the key for the entry
[ "Deletes", "all", "metadata", "for", "given", "key" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/cache/LRUPersistentCache.js#L820-L825
train
Delete metadata for the given key
[ 30522, 3853, 3972, 12870, 11368, 8447, 2696, 29278, 4765, 2854, 1006, 2969, 1010, 3145, 1007, 1063, 13075, 2462, 13629, 2595, 1027, 2969, 1012, 1035, 27425, 1012, 1035, 1035, 2011, 14839, 1035, 1035, 1031, 30524, 1035, 1035, 1031, 3145, 103...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.layout/src/sap/ui/layout/form/ColumnLayout.js
function(aRows, iField, oLD, oOptions, iLabelSize) { var iRemain = 0; var oRow; for (i = 0; i < aRows.length; i++) { if (iField >= aRows[i].first && iField <= aRows[i].last) { oRow = aRows[i]; break; } } if (!oLD) { oOptions.Size = Math.floor(oRow.availableCells / oRow.defaultFields); } if (iField === oRow.first && iField > 0) { oOptions.Break = true; if (iLabelSize > 0 && iLabelSize < iColumns && oOptions.Size <= iColumns - iLabelSize) { oOptions.Space = iLabelSize; } } if (iField === oRow.firstDefault) { // add remaining cells to first default field iRemain = oRow.availableCells - oRow.defaultFields * oOptions.Size; if (iRemain > 0) { oOptions.Size = oOptions.Size + iRemain; } } }
javascript
function(aRows, iField, oLD, oOptions, iLabelSize) { var iRemain = 0; var oRow; for (i = 0; i < aRows.length; i++) { if (iField >= aRows[i].first && iField <= aRows[i].last) { oRow = aRows[i]; break; } } if (!oLD) { oOptions.Size = Math.floor(oRow.availableCells / oRow.defaultFields); } if (iField === oRow.first && iField > 0) { oOptions.Break = true; if (iLabelSize > 0 && iLabelSize < iColumns && oOptions.Size <= iColumns - iLabelSize) { oOptions.Space = iLabelSize; } } if (iField === oRow.firstDefault) { // add remaining cells to first default field iRemain = oRow.availableCells - oRow.defaultFields * oOptions.Size; if (iRemain > 0) { oOptions.Size = oOptions.Size + iRemain; } } }
[ "function", "(", "aRows", ",", "iField", ",", "oLD", ",", "oOptions", ",", "iLabelSize", ")", "{", "var", "iRemain", "=", "0", ";", "var", "oRow", ";", "for", "(", "i", "=", "0", ";", "i", "<", "aRows", ".", "length", ";", "i", "++", ")", "{", ...
determine size of Field
[ "determine", "size", "of", "Field" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.layout/src/sap/ui/layout/form/ColumnLayout.js#L506-L533
train
This function is called by the layout to determine if the field is a default field
[ 30522, 3853, 1006, 12098, 15568, 1010, 2065, 12891, 1010, 2214, 1010, 1051, 7361, 9285, 1010, 6335, 16336, 4877, 4697, 1007, 1063, 13075, 20868, 14545, 2378, 1027, 1014, 1025, 13075, 20298, 2860, 1025, 2005, 1006, 1045, 1027, 1014, 1025, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...