id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
14,100
datproject/dat-node
lib/storage.js
defaultStorage
function defaultStorage (storage, opts) { // Use custom storage or ram if (typeof storage !== 'string') return storage if (opts.temp) return ram if (opts.latest === false) { // Store as SLEEP files inluding content.data return { metadata: function (name, opts) { // I don't think we want th...
javascript
function defaultStorage (storage, opts) { // Use custom storage or ram if (typeof storage !== 'string') return storage if (opts.temp) return ram if (opts.latest === false) { // Store as SLEEP files inluding content.data return { metadata: function (name, opts) { // I don't think we want th...
[ "function", "defaultStorage", "(", "storage", ",", "opts", ")", "{", "// Use custom storage or ram", "if", "(", "typeof", "storage", "!==", "'string'", ")", "return", "storage", "if", "(", "opts", ".", "temp", ")", "return", "ram", "if", "(", "opts", ".", ...
Parse the storage argument and return storage for hyperdrive. By default, uses dat-secret-storage to storage secret keys in user's home directory. @param {string|object} storage - Storage for hyperdrive. `string` is a directory or file. Directory: `/my-data`, storage will be in `/my-data/.dat`. Single File: `/my-file.z...
[ "Parse", "the", "storage", "argument", "and", "return", "storage", "for", "hyperdrive", ".", "By", "default", "uses", "dat", "-", "secret", "-", "storage", "to", "storage", "secret", "keys", "in", "user", "s", "home", "directory", "." ]
c5f377309ead92cbef57f726795e2d85e0720b24
https://github.com/datproject/dat-node/blob/c5f377309ead92cbef57f726795e2d85e0720b24/lib/storage.js#L21-L60
14,101
gka/d3-jetpack
src/polygonClip.js
polygonClosed
function polygonClosed(coordinates) { var a = coordinates[0], b = coordinates[coordinates.length - 1]; return !(a[0] - b[0] || a[1] - b[1]); }
javascript
function polygonClosed(coordinates) { var a = coordinates[0], b = coordinates[coordinates.length - 1]; return !(a[0] - b[0] || a[1] - b[1]); }
[ "function", "polygonClosed", "(", "coordinates", ")", "{", "var", "a", "=", "coordinates", "[", "0", "]", ",", "b", "=", "coordinates", "[", "coordinates", ".", "length", "-", "1", "]", ";", "return", "!", "(", "a", "[", "0", "]", "-", "b", "[", ...
Returns true if the polygon is closed.
[ "Returns", "true", "if", "the", "polygon", "is", "closed", "." ]
2f68acf9805650bed7bd21aa293d32709f36833c
https://github.com/gka/d3-jetpack/blob/2f68acf9805650bed7bd21aa293d32709f36833c/src/polygonClip.js#L54-L58
14,102
krispo/angular-nvd3
dist/angular-nvd3.js
function (data){ // set data if (!arguments.length) { if (scope.options.chart.type === 'sunburstChart') { data = angular.copy(scope.data); } else { ...
javascript
function (data){ // set data if (!arguments.length) { if (scope.options.chart.type === 'sunburstChart') { data = angular.copy(scope.data); } else { ...
[ "function", "(", "data", ")", "{", "// set data", "if", "(", "!", "arguments", ".", "length", ")", "{", "if", "(", "scope", ".", "options", ".", "chart", ".", "type", "===", "'sunburstChart'", ")", "{", "data", "=", "angular", ".", "copy", "(", "scop...
Update chart with new data
[ "Update", "chart", "with", "new", "data" ]
19e6d97d2db1f92e84a18e3980c2c4e3f6329ae8
https://github.com/krispo/angular-nvd3/blob/19e6d97d2db1f92e84a18e3980c2c4e3f6329ae8/dist/angular-nvd3.js#L237-L276
14,103
krispo/angular-nvd3
dist/angular-nvd3.js
function (){ element.find('.title').remove(); element.find('.subtitle').remove(); element.find('.caption').remove(); element.empty(); // remove tooltip if exists ...
javascript
function (){ element.find('.title').remove(); element.find('.subtitle').remove(); element.find('.caption').remove(); element.empty(); // remove tooltip if exists ...
[ "function", "(", ")", "{", "element", ".", "find", "(", "'.title'", ")", ".", "remove", "(", ")", ";", "element", ".", "find", "(", "'.subtitle'", ")", ".", "remove", "(", ")", ";", "element", ".", "find", "(", "'.caption'", ")", ".", "remove", "("...
Fully clear directive element
[ "Fully", "clear", "directive", "element" ]
19e6d97d2db1f92e84a18e3980c2c4e3f6329ae8
https://github.com/krispo/angular-nvd3/blob/19e6d97d2db1f92e84a18e3980c2c4e3f6329ae8/dist/angular-nvd3.js#L279-L303
14,104
krispo/angular-nvd3
dist/angular-nvd3.js
configure
function configure(chart, options, chartType){ if (chart && options){ angular.forEach(chart, function(value, key){ if (key[0] === '_'); else if (key === 'dispatch') { i...
javascript
function configure(chart, options, chartType){ if (chart && options){ angular.forEach(chart, function(value, key){ if (key[0] === '_'); else if (key === 'dispatch') { i...
[ "function", "configure", "(", "chart", ",", "options", ",", "chartType", ")", "{", "if", "(", "chart", "&&", "options", ")", "{", "angular", ".", "forEach", "(", "chart", ",", "function", "(", "value", ",", "key", ")", "{", "if", "(", "key", "[", "...
Configure the chart model with the passed options
[ "Configure", "the", "chart", "model", "with", "the", "passed", "options" ]
19e6d97d2db1f92e84a18e3980c2c4e3f6329ae8
https://github.com/krispo/angular-nvd3/blob/19e6d97d2db1f92e84a18e3980c2c4e3f6329ae8/dist/angular-nvd3.js#L313-L353
14,105
krispo/angular-nvd3
dist/angular-nvd3.js
configureWrapper
function configureWrapper(name){ var _ = nvd3Utils.deepExtend(defaultWrapper(name), scope.options[name] || {}); if (scope._config.extended) scope.options[name] = _; var wrapElement = angular.element('<div></div>').html(_['html'] || '') ...
javascript
function configureWrapper(name){ var _ = nvd3Utils.deepExtend(defaultWrapper(name), scope.options[name] || {}); if (scope._config.extended) scope.options[name] = _; var wrapElement = angular.element('<div></div>').html(_['html'] || '') ...
[ "function", "configureWrapper", "(", "name", ")", "{", "var", "_", "=", "nvd3Utils", ".", "deepExtend", "(", "defaultWrapper", "(", "name", ")", ",", "scope", ".", "options", "[", "name", "]", "||", "{", "}", ")", ";", "if", "(", "scope", ".", "_conf...
Configure 'title', 'subtitle', 'caption'. nvd3 has no sufficient models for it yet.
[ "Configure", "title", "subtitle", "caption", ".", "nvd3", "has", "no", "sufficient", "models", "for", "it", "yet", "." ]
19e6d97d2db1f92e84a18e3980c2c4e3f6329ae8
https://github.com/krispo/angular-nvd3/blob/19e6d97d2db1f92e84a18e3980c2c4e3f6329ae8/dist/angular-nvd3.js#L370-L387
14,106
krispo/angular-nvd3
dist/angular-nvd3.js
configureStyles
function configureStyles(){ var _ = nvd3Utils.deepExtend(defaultStyles(), scope.options['styles'] || {}); if (scope._config.extended) scope.options['styles'] = _; angular.forEach(_.classes, function(value, key){ value ...
javascript
function configureStyles(){ var _ = nvd3Utils.deepExtend(defaultStyles(), scope.options['styles'] || {}); if (scope._config.extended) scope.options['styles'] = _; angular.forEach(_.classes, function(value, key){ value ...
[ "function", "configureStyles", "(", ")", "{", "var", "_", "=", "nvd3Utils", ".", "deepExtend", "(", "defaultStyles", "(", ")", ",", "scope", ".", "options", "[", "'styles'", "]", "||", "{", "}", ")", ";", "if", "(", "scope", ".", "_config", ".", "ext...
Add some styles to the whole directive element
[ "Add", "some", "styles", "to", "the", "whole", "directive", "element" ]
19e6d97d2db1f92e84a18e3980c2c4e3f6329ae8
https://github.com/krispo/angular-nvd3/blob/19e6d97d2db1f92e84a18e3980c2c4e3f6329ae8/dist/angular-nvd3.js#L390-L400
14,107
krispo/angular-nvd3
dist/angular-nvd3.js
defaultWrapper
function defaultWrapper(_){ switch (_){ case 'title': return { enable: false, text: 'Write Your Title', className: 'h4', css: { ...
javascript
function defaultWrapper(_){ switch (_){ case 'title': return { enable: false, text: 'Write Your Title', className: 'h4', css: { ...
[ "function", "defaultWrapper", "(", "_", ")", "{", "switch", "(", "_", ")", "{", "case", "'title'", ":", "return", "{", "enable", ":", "false", ",", "text", ":", "'Write Your Title'", ",", "className", ":", "'h4'", ",", "css", ":", "{", "width", ":", ...
Default values for 'title', 'subtitle', 'caption'
[ "Default", "values", "for", "title", "subtitle", "caption" ]
19e6d97d2db1f92e84a18e3980c2c4e3f6329ae8
https://github.com/krispo/angular-nvd3/blob/19e6d97d2db1f92e84a18e3980c2c4e3f6329ae8/dist/angular-nvd3.js#L403-L431
14,108
krispo/angular-nvd3
dist/angular-nvd3.js
dataWatchFn
function dataWatchFn(newData, oldData) { if (newData !== oldData){ if (!scope._config.disabled) { scope._config.refreshDataOnly ? scope.api.update() : scope.api.refresh(); // if wanted to refresh data only, use update method, otherwise ...
javascript
function dataWatchFn(newData, oldData) { if (newData !== oldData){ if (!scope._config.disabled) { scope._config.refreshDataOnly ? scope.api.update() : scope.api.refresh(); // if wanted to refresh data only, use update method, otherwise ...
[ "function", "dataWatchFn", "(", "newData", ",", "oldData", ")", "{", "if", "(", "newData", "!==", "oldData", ")", "{", "if", "(", "!", "scope", ".", "_config", ".", "disabled", ")", "{", "scope", ".", "_config", ".", "refreshDataOnly", "?", "scope", "....
Watching on data changing
[ "Watching", "on", "data", "changing" ]
19e6d97d2db1f92e84a18e3980c2c4e3f6329ae8
https://github.com/krispo/angular-nvd3/blob/19e6d97d2db1f92e84a18e3980c2c4e3f6329ae8/dist/angular-nvd3.js#L454-L460
14,109
yaronn/xml-crypto
lib/signed-xml.js
FileKeyInfo
function FileKeyInfo(file) { this.file = file this.getKeyInfo = function(key, prefix) { prefix = prefix || '' prefix = prefix ? prefix + ':' : prefix return "<" + prefix + "X509Data></" + prefix + "X509Data>" } this.getKey = function(keyInfo) { return fs.readFileSync(this.file) } }
javascript
function FileKeyInfo(file) { this.file = file this.getKeyInfo = function(key, prefix) { prefix = prefix || '' prefix = prefix ? prefix + ':' : prefix return "<" + prefix + "X509Data></" + prefix + "X509Data>" } this.getKey = function(keyInfo) { return fs.readFileSync(this.file) } }
[ "function", "FileKeyInfo", "(", "file", ")", "{", "this", ".", "file", "=", "file", "this", ".", "getKeyInfo", "=", "function", "(", "key", ",", "prefix", ")", "{", "prefix", "=", "prefix", "||", "''", "prefix", "=", "prefix", "?", "prefix", "+", "':...
A key info provider implementation
[ "A", "key", "info", "provider", "implementation" ]
40bd9e8f8787c9c996572fe5937572506b9e43d1
https://github.com/yaronn/xml-crypto/blob/40bd9e8f8787c9c996572fe5937572506b9e43d1/lib/signed-xml.js#L17-L29
14,110
yaronn/xml-crypto
lib/signed-xml.js
RSASHA512
function RSASHA512() { /** * Sign the given string using the given key * */ this.getSignature = function(signedInfo, signingKey) { var signer = crypto.createSign("RSA-SHA512") signer.update(signedInfo) var res = signer.sign(signingKey, 'base64') return res } /** * Verify the given sign...
javascript
function RSASHA512() { /** * Sign the given string using the given key * */ this.getSignature = function(signedInfo, signingKey) { var signer = crypto.createSign("RSA-SHA512") signer.update(signedInfo) var res = signer.sign(signingKey, 'base64') return res } /** * Verify the given sign...
[ "function", "RSASHA512", "(", ")", "{", "/**\n * Sign the given string using the given key\n *\n */", "this", ".", "getSignature", "=", "function", "(", "signedInfo", ",", "signingKey", ")", "{", "var", "signer", "=", "crypto", ".", "createSign", "(", "\"RSA-SHA512...
Signature algorithm implementation
[ "Signature", "algorithm", "implementation" ]
40bd9e8f8787c9c996572fe5937572506b9e43d1
https://github.com/yaronn/xml-crypto/blob/40bd9e8f8787c9c996572fe5937572506b9e43d1/lib/signed-xml.js#L151-L178
14,111
yaronn/xml-crypto
lib/signed-xml.js
findAncestorNs
function findAncestorNs(doc, docSubsetXpath){ var docSubset = xpath.select(docSubsetXpath, doc); if(!Array.isArray(docSubset) || docSubset.length < 1){ return []; } // Remove duplicate on ancestor namespace var ancestorNs = collectAncestorNamespaces(docSubset[0]); var ancestorNsWithoutDuplicate = ...
javascript
function findAncestorNs(doc, docSubsetXpath){ var docSubset = xpath.select(docSubsetXpath, doc); if(!Array.isArray(docSubset) || docSubset.length < 1){ return []; } // Remove duplicate on ancestor namespace var ancestorNs = collectAncestorNamespaces(docSubset[0]); var ancestorNsWithoutDuplicate = ...
[ "function", "findAncestorNs", "(", "doc", ",", "docSubsetXpath", ")", "{", "var", "docSubset", "=", "xpath", ".", "select", "(", "docSubsetXpath", ",", "doc", ")", ";", "if", "(", "!", "Array", ".", "isArray", "(", "docSubset", ")", "||", "docSubset", "....
Extract ancestor namespaces in order to import it to root of document subset which is being canonicalized for non-exclusive c14n. @param {object} doc - Usually a product from `new DOMParser().parseFromString()` @param {string} docSubsetXpath - xpath query to get document subset being canonicalized @returns {Array} i.e...
[ "Extract", "ancestor", "namespaces", "in", "order", "to", "import", "it", "to", "root", "of", "document", "subset", "which", "is", "being", "canonicalized", "for", "non", "-", "exclusive", "c14n", "." ]
40bd9e8f8787c9c996572fe5937572506b9e43d1
https://github.com/yaronn/xml-crypto/blob/40bd9e8f8787c9c996572fe5937572506b9e43d1/lib/signed-xml.js#L210-L255
14,112
yaronn/xml-crypto
lib/signed-xml.js
SignedXml
function SignedXml(idMode, options) { this.options = options || {}; this.idMode = idMode this.references = [] this.id = 0 this.signingKey = null this.signatureAlgorithm = this.options.signatureAlgorithm || "http://www.w3.org/2000/09/xmldsig#rsa-sha1"; this.keyInfoProvider = null this.canonicalizationAlg...
javascript
function SignedXml(idMode, options) { this.options = options || {}; this.idMode = idMode this.references = [] this.id = 0 this.signingKey = null this.signatureAlgorithm = this.options.signatureAlgorithm || "http://www.w3.org/2000/09/xmldsig#rsa-sha1"; this.keyInfoProvider = null this.canonicalizationAlg...
[ "function", "SignedXml", "(", "idMode", ",", "options", ")", "{", "this", ".", "options", "=", "options", "||", "{", "}", ";", "this", ".", "idMode", "=", "idMode", "this", ".", "references", "=", "[", "]", "this", ".", "id", "=", "0", "this", ".",...
Xml signature implementation @param {string} idMode. Value of "wssecurity" will create/validate id's with the ws-security namespace @param {object} options. Initial configurations
[ "Xml", "signature", "implementation" ]
40bd9e8f8787c9c996572fe5937572506b9e43d1
https://github.com/yaronn/xml-crypto/blob/40bd9e8f8787c9c996572fe5937572506b9e43d1/lib/signed-xml.js#L288-L307
14,113
susielu/d3-annotation
indexRollupNext.js
wrap
function wrap(text, width, wrapSplitter) { var lineHeight = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1.2; text.each(function () { var text = select(this), words = text.text().split(wrapSplitter || /[ \t\r\n]+/).reverse().filter(function (w) { return w !== ""; }); ...
javascript
function wrap(text, width, wrapSplitter) { var lineHeight = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1.2; text.each(function () { var text = select(this), words = text.text().split(wrapSplitter || /[ \t\r\n]+/).reverse().filter(function (w) { return w !== ""; }); ...
[ "function", "wrap", "(", "text", ",", "width", ",", "wrapSplitter", ")", "{", "var", "lineHeight", "=", "arguments", ".", "length", ">", "3", "&&", "arguments", "[", "3", "]", "!==", "undefined", "?", "arguments", "[", "3", "]", ":", "1.2", ";", "tex...
Text wrapping code adapted from Mike Bostock
[ "Text", "wrapping", "code", "adapted", "from", "Mike", "Bostock" ]
5279464dfac828443988d4b2695beff46b02618d
https://github.com/susielu/d3-annotation/blob/5279464dfac828443988d4b2695beff46b02618d/indexRollupNext.js#L1862-L1885
14,114
siddii/angular-timer
bower_components/angular-scenario/jstd-scenario-adapter.js
JstdPlugin
function JstdPlugin() { var nop = function() {}; this.reportResult = nop; this.reportEnd = nop; this.runScenario = nop; this.name = 'Angular Scenario Adapter'; /** * Called for each JSTD TestCase * * Handles only SCENARIO_TYPE test cases. There should be only one fake TestCase. * Runs all sce...
javascript
function JstdPlugin() { var nop = function() {}; this.reportResult = nop; this.reportEnd = nop; this.runScenario = nop; this.name = 'Angular Scenario Adapter'; /** * Called for each JSTD TestCase * * Handles only SCENARIO_TYPE test cases. There should be only one fake TestCase. * Runs all sce...
[ "function", "JstdPlugin", "(", ")", "{", "var", "nop", "=", "function", "(", ")", "{", "}", ";", "this", ".", "reportResult", "=", "nop", ";", "this", ".", "reportEnd", "=", "nop", ";", "this", ".", "runScenario", "=", "nop", ";", "this", ".", "nam...
Plugin for JSTestDriver Connection point between scenario's jstd output and jstestdriver. @see jstestdriver.PluginRegistrar
[ "Plugin", "for", "JSTestDriver", "Connection", "point", "between", "scenario", "s", "jstd", "output", "and", "jstestdriver", "." ]
d58fbf8c3325f63e1fdb250ed1f1a0676c8344de
https://github.com/siddii/angular-timer/blob/d58fbf8c3325f63e1fdb250ed1f1a0676c8344de/bower_components/angular-scenario/jstd-scenario-adapter.js#L58-L96
14,115
siddii/angular-timer
bower_components/jquery/src/css.js
css_defaultDisplay
function css_defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible ifra...
javascript
function css_defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible ifra...
[ "function", "css_defaultDisplay", "(", "nodeName", ")", "{", "var", "doc", "=", "document", ",", "display", "=", "elemdisplay", "[", "nodeName", "]", ";", "if", "(", "!", "display", ")", "{", "display", "=", "actualDisplay", "(", "nodeName", ",", "doc", ...
Try to determine the default display value of an element
[ "Try", "to", "determine", "the", "default", "display", "value", "of", "an", "element" ]
d58fbf8c3325f63e1fdb250ed1f1a0676c8344de
https://github.com/siddii/angular-timer/blob/d58fbf8c3325f63e1fdb250ed1f1a0676c8344de/bower_components/jquery/src/css.js#L418-L447
14,116
siddii/angular-timer
bower_components/jquery/src/css.js
actualDisplay
function actualDisplay( name, doc ) { var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), display = jQuery.css( elem[0], "display" ); elem.remove(); return display; }
javascript
function actualDisplay( name, doc ) { var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), display = jQuery.css( elem[0], "display" ); elem.remove(); return display; }
[ "function", "actualDisplay", "(", "name", ",", "doc", ")", "{", "var", "elem", "=", "jQuery", "(", "doc", ".", "createElement", "(", "name", ")", ")", ".", "appendTo", "(", "doc", ".", "body", ")", ",", "display", "=", "jQuery", ".", "css", "(", "e...
Called ONLY from within css_defaultDisplay
[ "Called", "ONLY", "from", "within", "css_defaultDisplay" ]
d58fbf8c3325f63e1fdb250ed1f1a0676c8344de
https://github.com/siddii/angular-timer/blob/d58fbf8c3325f63e1fdb250ed1f1a0676c8344de/bower_components/jquery/src/css.js#L450-L455
14,117
siddii/angular-timer
bower_components/jquery/src/core.js
function( code ) { var script, indirect = eval; code = jQuery.trim( code ); if ( code ) { // If the code includes a valid, prologue position // strict mode pragma, execute code by injecting a // script tag into the document. if ( code.indexOf("use strict") === 1 ) { script = document.createE...
javascript
function( code ) { var script, indirect = eval; code = jQuery.trim( code ); if ( code ) { // If the code includes a valid, prologue position // strict mode pragma, execute code by injecting a // script tag into the document. if ( code.indexOf("use strict") === 1 ) { script = document.createE...
[ "function", "(", "code", ")", "{", "var", "script", ",", "indirect", "=", "eval", ";", "code", "=", "jQuery", ".", "trim", "(", "code", ")", ";", "if", "(", "code", ")", "{", "// If the code includes a valid, prologue position", "// strict mode pragma, execute c...
Evaluates a script in a global context
[ "Evaluates", "a", "script", "in", "a", "global", "context" ]
d58fbf8c3325f63e1fdb250ed1f1a0676c8344de
https://github.com/siddii/angular-timer/blob/d58fbf8c3325f63e1fdb250ed1f1a0676c8344de/bower_components/jquery/src/core.js#L508-L528
14,118
siddii/angular-timer
bower_components/jquery/speed/benchmark.js
benchmark
function benchmark(fn, times, name){ fn = fn.toString(); var s = fn.indexOf('{')+1, e = fn.lastIndexOf('}'); fn = fn.substring(s,e); return benchmarkString(fn, times, name); }
javascript
function benchmark(fn, times, name){ fn = fn.toString(); var s = fn.indexOf('{')+1, e = fn.lastIndexOf('}'); fn = fn.substring(s,e); return benchmarkString(fn, times, name); }
[ "function", "benchmark", "(", "fn", ",", "times", ",", "name", ")", "{", "fn", "=", "fn", ".", "toString", "(", ")", ";", "var", "s", "=", "fn", ".", "indexOf", "(", "'{'", ")", "+", "1", ",", "e", "=", "fn", ".", "lastIndexOf", "(", "'}'", "...
Runs a function many times without the function call overhead
[ "Runs", "a", "function", "many", "times", "without", "the", "function", "call", "overhead" ]
d58fbf8c3325f63e1fdb250ed1f1a0676c8344de
https://github.com/siddii/angular-timer/blob/d58fbf8c3325f63e1fdb250ed1f1a0676c8344de/bower_components/jquery/speed/benchmark.js#L2-L9
14,119
siddii/angular-timer
dist/assets/js/angular-timer-all.min.js
getCzechForm
function getCzechForm (c) { if (c === 1) { return 0 } else if (Math.floor(c) !== c) { return 1 } else if (c % 10 >= 2 && c % 10 <= 4 && c % 100 < 10) { return 2 } else { return 3 } }
javascript
function getCzechForm (c) { if (c === 1) { return 0 } else if (Math.floor(c) !== c) { return 1 } else if (c % 10 >= 2 && c % 10 <= 4 && c % 100 < 10) { return 2 } else { return 3 } }
[ "function", "getCzechForm", "(", "c", ")", "{", "if", "(", "c", "===", "1", ")", "{", "return", "0", "}", "else", "if", "(", "Math", ".", "floor", "(", "c", ")", "!==", "c", ")", "{", "return", "1", "}", "else", "if", "(", "c", "%", "10", "...
Internal helper function for Czech language.
[ "Internal", "helper", "function", "for", "Czech", "language", "." ]
d58fbf8c3325f63e1fdb250ed1f1a0676c8344de
https://github.com/siddii/angular-timer/blob/d58fbf8c3325f63e1fdb250ed1f1a0676c8344de/dist/assets/js/angular-timer-all.min.js#L489-L499
14,120
siddii/angular-timer
dist/assets/js/angular-timer-all.min.js
getPolishForm
function getPolishForm (c) { if (c === 1) { return 0 } else if (Math.floor(c) !== c) { return 1 } else if (c % 10 >= 2 && c % 10 <= 4 && !(c % 100 > 10 && c % 100 < 20)) { return 2 } else { return 3 } }
javascript
function getPolishForm (c) { if (c === 1) { return 0 } else if (Math.floor(c) !== c) { return 1 } else if (c % 10 >= 2 && c % 10 <= 4 && !(c % 100 > 10 && c % 100 < 20)) { return 2 } else { return 3 } }
[ "function", "getPolishForm", "(", "c", ")", "{", "if", "(", "c", "===", "1", ")", "{", "return", "0", "}", "else", "if", "(", "Math", ".", "floor", "(", "c", ")", "!==", "c", ")", "{", "return", "1", "}", "else", "if", "(", "c", "%", "10", ...
Internal helper function for Polish language.
[ "Internal", "helper", "function", "for", "Polish", "language", "." ]
d58fbf8c3325f63e1fdb250ed1f1a0676c8344de
https://github.com/siddii/angular-timer/blob/d58fbf8c3325f63e1fdb250ed1f1a0676c8344de/dist/assets/js/angular-timer-all.min.js#L502-L512
14,121
siddii/angular-timer
dist/assets/js/angular-timer-all.min.js
getSlavicForm
function getSlavicForm (c) { if (Math.floor(c) !== c) { return 2 } else if ((c % 100 >= 5 && c % 100 <= 20) || (c % 10 >= 5 && c % 10 <= 9) || c % 10 === 0) { return 0 } else if (c % 10 === 1) { return 1 } else if (c > 1) { return 2 } else { return 0 } }
javascript
function getSlavicForm (c) { if (Math.floor(c) !== c) { return 2 } else if ((c % 100 >= 5 && c % 100 <= 20) || (c % 10 >= 5 && c % 10 <= 9) || c % 10 === 0) { return 0 } else if (c % 10 === 1) { return 1 } else if (c > 1) { return 2 } else { return 0 } }
[ "function", "getSlavicForm", "(", "c", ")", "{", "if", "(", "Math", ".", "floor", "(", "c", ")", "!==", "c", ")", "{", "return", "2", "}", "else", "if", "(", "(", "c", "%", "100", ">=", "5", "&&", "c", "%", "100", "<=", "20", ")", "||", "("...
Internal helper function for Russian and Ukranian languages.
[ "Internal", "helper", "function", "for", "Russian", "and", "Ukranian", "languages", "." ]
d58fbf8c3325f63e1fdb250ed1f1a0676c8344de
https://github.com/siddii/angular-timer/blob/d58fbf8c3325f63e1fdb250ed1f1a0676c8344de/dist/assets/js/angular-timer-all.min.js#L515-L527
14,122
siddii/angular-timer
dist/assets/js/angular-timer-all.min.js
getLithuanianForm
function getLithuanianForm (c) { if (c === 1 || (c % 10 === 1 && c % 100 > 20)) { return 0 } else if (Math.floor(c) !== c || (c % 10 >= 2 && c % 100 > 20) || (c % 10 >= 2 && c % 100 < 10)) { return 1 } else { return 2 } }
javascript
function getLithuanianForm (c) { if (c === 1 || (c % 10 === 1 && c % 100 > 20)) { return 0 } else if (Math.floor(c) !== c || (c % 10 >= 2 && c % 100 > 20) || (c % 10 >= 2 && c % 100 < 10)) { return 1 } else { return 2 } }
[ "function", "getLithuanianForm", "(", "c", ")", "{", "if", "(", "c", "===", "1", "||", "(", "c", "%", "10", "===", "1", "&&", "c", "%", "100", ">", "20", ")", ")", "{", "return", "0", "}", "else", "if", "(", "Math", ".", "floor", "(", "c", ...
Internal helper function for Lithuanian language.
[ "Internal", "helper", "function", "for", "Lithuanian", "language", "." ]
d58fbf8c3325f63e1fdb250ed1f1a0676c8344de
https://github.com/siddii/angular-timer/blob/d58fbf8c3325f63e1fdb250ed1f1a0676c8344de/dist/assets/js/angular-timer-all.min.js#L530-L538
14,123
siddii/angular-timer
bower_components/momentjs/min/moment-with-locales.js
makeDateFromString
function makeDateFromString(config) { parseISO(config); if (config._isValid === false) { delete config._isValid; moment.createFromInputFallback(config); } }
javascript
function makeDateFromString(config) { parseISO(config); if (config._isValid === false) { delete config._isValid; moment.createFromInputFallback(config); } }
[ "function", "makeDateFromString", "(", "config", ")", "{", "parseISO", "(", "config", ")", ";", "if", "(", "config", ".", "_isValid", "===", "false", ")", "{", "delete", "config", ".", "_isValid", ";", "moment", ".", "createFromInputFallback", "(", "config",...
date from iso format or fallback
[ "date", "from", "iso", "format", "or", "fallback" ]
d58fbf8c3325f63e1fdb250ed1f1a0676c8344de
https://github.com/siddii/angular-timer/blob/d58fbf8c3325f63e1fdb250ed1f1a0676c8344de/bower_components/momentjs/min/moment-with-locales.js#L1672-L1678
14,124
siddii/angular-timer
bower_components/momentjs/min/moment-with-locales.js
function (key) { var newLocaleData; if (key === undefined) { return this._locale._abbr; } else { newLocaleData = moment.localeData(key); if (newLocaleData != null) { this._locale = newLocaleData; } ...
javascript
function (key) { var newLocaleData; if (key === undefined) { return this._locale._abbr; } else { newLocaleData = moment.localeData(key); if (newLocaleData != null) { this._locale = newLocaleData; } ...
[ "function", "(", "key", ")", "{", "var", "newLocaleData", ";", "if", "(", "key", "===", "undefined", ")", "{", "return", "this", ".", "_locale", ".", "_abbr", ";", "}", "else", "{", "newLocaleData", "=", "moment", ".", "localeData", "(", "key", ")", ...
If passed a locale key, it will set the locale for this instance. Otherwise, it will return the locale configuration variables for this instance.
[ "If", "passed", "a", "locale", "key", "it", "will", "set", "the", "locale", "for", "this", "instance", ".", "Otherwise", "it", "will", "return", "the", "locale", "configuration", "variables", "for", "this", "instance", "." ]
d58fbf8c3325f63e1fdb250ed1f1a0676c8344de
https://github.com/siddii/angular-timer/blob/d58fbf8c3325f63e1fdb250ed1f1a0676c8344de/bower_components/momentjs/min/moment-with-locales.js#L2647-L2659
14,125
siddii/angular-timer
bower_components/momentjs/min/moment-with-locales.js
function (number) { var b = number, output = '', lookup = [ '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed ...
javascript
function (number) { var b = number, output = '', lookup = [ '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed ...
[ "function", "(", "number", ")", "{", "var", "b", "=", "number", ",", "output", "=", "''", ",", "lookup", "=", "[", "''", ",", "'af'", ",", "'il'", ",", "'ydd'", ",", "'ydd'", ",", "'ed'", ",", "'ed'", ",", "'ed'", ",", "'fed'", ",", "'fed'", ",...
traditional ordinal numbers above 31 are not commonly used in colloquial Welsh
[ "traditional", "ordinal", "numbers", "above", "31", "are", "not", "commonly", "used", "in", "colloquial", "Welsh" ]
d58fbf8c3325f63e1fdb250ed1f1a0676c8344de
https://github.com/siddii/angular-timer/blob/d58fbf8c3325f63e1fdb250ed1f1a0676c8344de/bower_components/momentjs/min/moment-with-locales.js#L4491-L4510
14,126
antvis/data-set
src/transform/kernel-smooth/regression.js
weight
function weight(kernel, bandwidth, x_0, x_i) { const arg = (x_i - x_0) / bandwidth; return kernel(arg); }
javascript
function weight(kernel, bandwidth, x_0, x_i) { const arg = (x_i - x_0) / bandwidth; return kernel(arg); }
[ "function", "weight", "(", "kernel", ",", "bandwidth", ",", "x_0", ",", "x_i", ")", "{", "const", "arg", "=", "(", "x_i", "-", "x_0", ")", "/", "bandwidth", ";", "return", "kernel", "(", "arg", ")", ";", "}" ]
calculates weight for i-th obs
[ "calculates", "weight", "for", "i", "-", "th", "obs" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/src/transform/kernel-smooth/regression.js#L39-L42
14,127
antvis/data-set
demos/assets/g2.js
copy
function copy(out, a) { out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[3]; out[4] = a[4]; out[5] = a[5]; out[6] = a[6]; out[7] = a[7]; out[8] = a[8]; return out; }
javascript
function copy(out, a) { out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[3]; out[4] = a[4]; out[5] = a[5]; out[6] = a[6]; out[7] = a[7]; out[8] = a[8]; return out; }
[ "function", "copy", "(", "out", ",", "a", ")", "{", "out", "[", "0", "]", "=", "a", "[", "0", "]", ";", "out", "[", "1", "]", "=", "a", "[", "1", "]", ";", "out", "[", "2", "]", "=", "a", "[", "2", "]", ";", "out", "[", "3", "]", "=...
Copy the values from one mat3 to another @param {mat3} out the receiving matrix @param {mat3} a the source matrix @returns {mat3} out
[ "Copy", "the", "values", "from", "one", "mat3", "to", "another" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L16688-L16699
14,128
antvis/data-set
demos/assets/g2.js
fromValues
function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) { var out = new glMatrix.ARRAY_TYPE(9); out[0] = m00; out[1] = m01; out[2] = m02; out[3] = m10; out[4] = m11; out[5] = m12; out[6] = m20; out[7] = m21; out[8] = m22; return out; }
javascript
function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) { var out = new glMatrix.ARRAY_TYPE(9); out[0] = m00; out[1] = m01; out[2] = m02; out[3] = m10; out[4] = m11; out[5] = m12; out[6] = m20; out[7] = m21; out[8] = m22; return out; }
[ "function", "fromValues", "(", "m00", ",", "m01", ",", "m02", ",", "m10", ",", "m11", ",", "m12", ",", "m20", ",", "m21", ",", "m22", ")", "{", "var", "out", "=", "new", "glMatrix", ".", "ARRAY_TYPE", "(", "9", ")", ";", "out", "[", "0", "]", ...
Create a new mat3 with the given values @param {Number} m00 Component in column 0, row 0 position (index 0) @param {Number} m01 Component in column 0, row 1 position (index 1) @param {Number} m02 Component in column 0, row 2 position (index 2) @param {Number} m10 Component in column 1, row 0 position (index 3) @param ...
[ "Create", "a", "new", "mat3", "with", "the", "given", "values" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L16715-L16727
14,129
antvis/data-set
demos/assets/g2.js
set
function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) { out[0] = m00; out[1] = m01; out[2] = m02; out[3] = m10; out[4] = m11; out[5] = m12; out[6] = m20; out[7] = m21; out[8] = m22; return out; }
javascript
function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) { out[0] = m00; out[1] = m01; out[2] = m02; out[3] = m10; out[4] = m11; out[5] = m12; out[6] = m20; out[7] = m21; out[8] = m22; return out; }
[ "function", "set", "(", "out", ",", "m00", ",", "m01", ",", "m02", ",", "m10", ",", "m11", ",", "m12", ",", "m20", ",", "m21", ",", "m22", ")", "{", "out", "[", "0", "]", "=", "m00", ";", "out", "[", "1", "]", "=", "m01", ";", "out", "[",...
Set the components of a mat3 to the given values @param {mat3} out the receiving matrix @param {Number} m00 Component in column 0, row 0 position (index 0) @param {Number} m01 Component in column 0, row 1 position (index 1) @param {Number} m02 Component in column 0, row 2 position (index 2) @param {Number} m10 Compone...
[ "Set", "the", "components", "of", "a", "mat3", "to", "the", "given", "values" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L16744-L16755
14,130
antvis/data-set
demos/assets/g2.js
identity
function identity(out) { out[0] = 1; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = 1; out[5] = 0; out[6] = 0; out[7] = 0; out[8] = 1; return out; }
javascript
function identity(out) { out[0] = 1; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = 1; out[5] = 0; out[6] = 0; out[7] = 0; out[8] = 1; return out; }
[ "function", "identity", "(", "out", ")", "{", "out", "[", "0", "]", "=", "1", ";", "out", "[", "1", "]", "=", "0", ";", "out", "[", "2", "]", "=", "0", ";", "out", "[", "3", "]", "=", "0", ";", "out", "[", "4", "]", "=", "1", ";", "ou...
Set a mat3 to the identity matrix @param {mat3} out the receiving matrix @returns {mat3} out
[ "Set", "a", "mat3", "to", "the", "identity", "matrix" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L16763-L16774
14,131
antvis/data-set
demos/assets/g2.js
transpose
function transpose(out, a) { // If we are transposing ourselves we can skip a few steps but have to cache some values if (out === a) { var a01 = a[1], a02 = a[2], a12 = a[5]; out[1] = a[3]; out[2] = a[6]; out[3] = a01; out[5] = a[7]; out[6] = a02; out[7] = a12; } else {...
javascript
function transpose(out, a) { // If we are transposing ourselves we can skip a few steps but have to cache some values if (out === a) { var a01 = a[1], a02 = a[2], a12 = a[5]; out[1] = a[3]; out[2] = a[6]; out[3] = a01; out[5] = a[7]; out[6] = a02; out[7] = a12; } else {...
[ "function", "transpose", "(", "out", ",", "a", ")", "{", "// If we are transposing ourselves we can skip a few steps but have to cache some values", "if", "(", "out", "===", "a", ")", "{", "var", "a01", "=", "a", "[", "1", "]", ",", "a02", "=", "a", "[", "2", ...
Transpose the values of a mat3 @param {mat3} out the receiving matrix @param {mat3} a the source matrix @returns {mat3} out
[ "Transpose", "the", "values", "of", "a", "mat3" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L16783-L16808
14,132
antvis/data-set
demos/assets/g2.js
multiply
function multiply(out, a, b) { var a00 = a[0], a01 = a[1], a02 = a[2]; var a10 = a[3], a11 = a[4], a12 = a[5]; var a20 = a[6], a21 = a[7], a22 = a[8]; var b00 = b[0], b01 = b[1], b02 = b[2]; var b10 = b[3], b11 = b[4], b12 = b[5]; var b20 = b[6], ...
javascript
function multiply(out, a, b) { var a00 = a[0], a01 = a[1], a02 = a[2]; var a10 = a[3], a11 = a[4], a12 = a[5]; var a20 = a[6], a21 = a[7], a22 = a[8]; var b00 = b[0], b01 = b[1], b02 = b[2]; var b10 = b[3], b11 = b[4], b12 = b[5]; var b20 = b[6], ...
[ "function", "multiply", "(", "out", ",", "a", ",", "b", ")", "{", "var", "a00", "=", "a", "[", "0", "]", ",", "a01", "=", "a", "[", "1", "]", ",", "a02", "=", "a", "[", "2", "]", ";", "var", "a10", "=", "a", "[", "3", "]", ",", "a11", ...
Multiplies two mat3's @param {mat3} out the receiving matrix @param {mat3} a the first operand @param {mat3} b the second operand @returns {mat3} out
[ "Multiplies", "two", "mat3", "s" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L16910-L16943
14,133
antvis/data-set
demos/assets/g2.js
rotate
function rotate(out, a, rad) { var a00 = a[0], a01 = a[1], a02 = a[2], a10 = a[3], a11 = a[4], a12 = a[5], a20 = a[6], a21 = a[7], a22 = a[8], s = Math.sin(rad), c = Math.cos(rad); out[0] = c * a00 + s * a10; out[1] = c * a01 + s * a11; out[2] = c * a...
javascript
function rotate(out, a, rad) { var a00 = a[0], a01 = a[1], a02 = a[2], a10 = a[3], a11 = a[4], a12 = a[5], a20 = a[6], a21 = a[7], a22 = a[8], s = Math.sin(rad), c = Math.cos(rad); out[0] = c * a00 + s * a10; out[1] = c * a01 + s * a11; out[2] = c * a...
[ "function", "rotate", "(", "out", ",", "a", ",", "rad", ")", "{", "var", "a00", "=", "a", "[", "0", "]", ",", "a01", "=", "a", "[", "1", "]", ",", "a02", "=", "a", "[", "2", "]", ",", "a10", "=", "a", "[", "3", "]", ",", "a11", "=", "...
Rotates a mat3 by the given angle @param {mat3} out the receiving matrix @param {mat3} a the matrix to rotate @param {Number} rad the angle to rotate the matrix by @returns {mat3} out
[ "Rotates", "a", "mat3", "by", "the", "given", "angle" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L16988-L17013
14,134
antvis/data-set
demos/assets/g2.js
scale
function scale(out, a, v) { var x = v[0], y = v[1]; out[0] = x * a[0]; out[1] = x * a[1]; out[2] = x * a[2]; out[3] = y * a[3]; out[4] = y * a[4]; out[5] = y * a[5]; out[6] = a[6]; out[7] = a[7]; out[8] = a[8]; return out; }
javascript
function scale(out, a, v) { var x = v[0], y = v[1]; out[0] = x * a[0]; out[1] = x * a[1]; out[2] = x * a[2]; out[3] = y * a[3]; out[4] = y * a[4]; out[5] = y * a[5]; out[6] = a[6]; out[7] = a[7]; out[8] = a[8]; return out; }
[ "function", "scale", "(", "out", ",", "a", ",", "v", ")", "{", "var", "x", "=", "v", "[", "0", "]", ",", "y", "=", "v", "[", "1", "]", ";", "out", "[", "0", "]", "=", "x", "*", "a", "[", "0", "]", ";", "out", "[", "1", "]", "=", "x"...
Scales the mat3 by the dimensions in the given vec2 @param {mat3} out the receiving matrix @param {mat3} a the matrix to rotate @param {vec2} v the vec2 to scale the matrix by @returns {mat3} out
[ "Scales", "the", "mat3", "by", "the", "dimensions", "in", "the", "given", "vec2" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L17023-L17039
14,135
antvis/data-set
demos/assets/g2.js
fromMat2d
function fromMat2d(out, a) { out[0] = a[0]; out[1] = a[1]; out[2] = 0; out[3] = a[2]; out[4] = a[3]; out[5] = 0; out[6] = a[4]; out[7] = a[5]; out[8] = 1; return out; }
javascript
function fromMat2d(out, a) { out[0] = a[0]; out[1] = a[1]; out[2] = 0; out[3] = a[2]; out[4] = a[3]; out[5] = 0; out[6] = a[4]; out[7] = a[5]; out[8] = 1; return out; }
[ "function", "fromMat2d", "(", "out", ",", "a", ")", "{", "out", "[", "0", "]", "=", "a", "[", "0", "]", ";", "out", "[", "1", "]", "=", "a", "[", "1", "]", ";", "out", "[", "2", "]", "=", "0", ";", "out", "[", "3", "]", "=", "a", "[",...
Copies the values from a mat2d into a mat3 @param {mat3} out the receiving matrix @param {mat2d} a the matrix to copy @returns {mat3} out
[ "Copies", "the", "values", "from", "a", "mat2d", "into", "a", "mat3" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L17127-L17140
14,136
antvis/data-set
demos/assets/g2.js
projection
function projection(out, width, height) { out[0] = 2 / width; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = -2 / height; out[5] = 0; out[6] = -1; out[7] = 1; out[8] = 1; return out; }
javascript
function projection(out, width, height) { out[0] = 2 / width; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = -2 / height; out[5] = 0; out[6] = -1; out[7] = 1; out[8] = 1; return out; }
[ "function", "projection", "(", "out", ",", "width", ",", "height", ")", "{", "out", "[", "0", "]", "=", "2", "/", "width", ";", "out", "[", "1", "]", "=", "0", ";", "out", "[", "2", "]", "=", "0", ";", "out", "[", "3", "]", "=", "0", ";",...
Generates a 2D projection matrix with the given bounds @param {mat3} out mat3 frustum matrix will be written into @param {number} width Width of your gl context @param {number} height Height of gl context @returns {mat3} out
[ "Generates", "a", "2D", "projection", "matrix", "with", "the", "given", "bounds" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L17254-L17265
14,137
antvis/data-set
demos/assets/g2.js
str
function str(a) { return 'mat3(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ', ' + a[4] + ', ' + a[5] + ', ' + a[6] + ', ' + a[7] + ', ' + a[8] + ')'; }
javascript
function str(a) { return 'mat3(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ', ' + a[4] + ', ' + a[5] + ', ' + a[6] + ', ' + a[7] + ', ' + a[8] + ')'; }
[ "function", "str", "(", "a", ")", "{", "return", "'mat3('", "+", "a", "[", "0", "]", "+", "', '", "+", "a", "[", "1", "]", "+", "', '", "+", "a", "[", "2", "]", "+", "', '", "+", "a", "[", "3", "]", "+", "', '", "+", "a", "[", "4", "]",...
Returns a string representation of a mat3 @param {mat3} a matrix to represent as a string @returns {String} string representation of the matrix
[ "Returns", "a", "string", "representation", "of", "a", "mat3" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L17273-L17275
14,138
antvis/data-set
demos/assets/g2.js
add
function add(out, a, b) { out[0] = a[0] + b[0]; out[1] = a[1] + b[1]; out[2] = a[2] + b[2]; out[3] = a[3] + b[3]; out[4] = a[4] + b[4]; out[5] = a[5] + b[5]; out[6] = a[6] + b[6]; out[7] = a[7] + b[7]; out[8] = a[8] + b[8]; return out; }
javascript
function add(out, a, b) { out[0] = a[0] + b[0]; out[1] = a[1] + b[1]; out[2] = a[2] + b[2]; out[3] = a[3] + b[3]; out[4] = a[4] + b[4]; out[5] = a[5] + b[5]; out[6] = a[6] + b[6]; out[7] = a[7] + b[7]; out[8] = a[8] + b[8]; return out; }
[ "function", "add", "(", "out", ",", "a", ",", "b", ")", "{", "out", "[", "0", "]", "=", "a", "[", "0", "]", "+", "b", "[", "0", "]", ";", "out", "[", "1", "]", "=", "a", "[", "1", "]", "+", "b", "[", "1", "]", ";", "out", "[", "2", ...
Adds two mat3's @param {mat3} out the receiving matrix @param {mat3} a the first operand @param {mat3} b the second operand @returns {mat3} out
[ "Adds", "two", "mat3", "s" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L17295-L17306
14,139
antvis/data-set
demos/assets/g2.js
subtract
function subtract(out, a, b) { out[0] = a[0] - b[0]; out[1] = a[1] - b[1]; out[2] = a[2] - b[2]; out[3] = a[3] - b[3]; out[4] = a[4] - b[4]; out[5] = a[5] - b[5]; out[6] = a[6] - b[6]; out[7] = a[7] - b[7]; out[8] = a[8] - b[8]; return out; }
javascript
function subtract(out, a, b) { out[0] = a[0] - b[0]; out[1] = a[1] - b[1]; out[2] = a[2] - b[2]; out[3] = a[3] - b[3]; out[4] = a[4] - b[4]; out[5] = a[5] - b[5]; out[6] = a[6] - b[6]; out[7] = a[7] - b[7]; out[8] = a[8] - b[8]; return out; }
[ "function", "subtract", "(", "out", ",", "a", ",", "b", ")", "{", "out", "[", "0", "]", "=", "a", "[", "0", "]", "-", "b", "[", "0", "]", ";", "out", "[", "1", "]", "=", "a", "[", "1", "]", "-", "b", "[", "1", "]", ";", "out", "[", ...
Subtracts matrix b from matrix a @param {mat3} out the receiving matrix @param {mat3} a the first operand @param {mat3} b the second operand @returns {mat3} out
[ "Subtracts", "matrix", "b", "from", "matrix", "a" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L17316-L17327
14,140
antvis/data-set
demos/assets/g2.js
multiplyScalar
function multiplyScalar(out, a, b) { out[0] = a[0] * b; out[1] = a[1] * b; out[2] = a[2] * b; out[3] = a[3] * b; out[4] = a[4] * b; out[5] = a[5] * b; out[6] = a[6] * b; out[7] = a[7] * b; out[8] = a[8] * b; return out; }
javascript
function multiplyScalar(out, a, b) { out[0] = a[0] * b; out[1] = a[1] * b; out[2] = a[2] * b; out[3] = a[3] * b; out[4] = a[4] * b; out[5] = a[5] * b; out[6] = a[6] * b; out[7] = a[7] * b; out[8] = a[8] * b; return out; }
[ "function", "multiplyScalar", "(", "out", ",", "a", ",", "b", ")", "{", "out", "[", "0", "]", "=", "a", "[", "0", "]", "*", "b", ";", "out", "[", "1", "]", "=", "a", "[", "1", "]", "*", "b", ";", "out", "[", "2", "]", "=", "a", "[", "...
Multiply each element of the matrix by a scalar. @param {mat3} out the receiving matrix @param {mat3} a the matrix to scale @param {Number} b amount to scale the matrix's elements by @returns {mat3} out
[ "Multiply", "each", "element", "of", "the", "matrix", "by", "a", "scalar", "." ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L17337-L17348
14,141
antvis/data-set
demos/assets/g2.js
multiplyScalarAndAdd
function multiplyScalarAndAdd(out, a, b, scale) { out[0] = a[0] + b[0] * scale; out[1] = a[1] + b[1] * scale; out[2] = a[2] + b[2] * scale; out[3] = a[3] + b[3] * scale; out[4] = a[4] + b[4] * scale; out[5] = a[5] + b[5] * scale; out[6] = a[6] + b[6] * scale; out[7] = a[7] + b[7] * scale; out[8] = a[8...
javascript
function multiplyScalarAndAdd(out, a, b, scale) { out[0] = a[0] + b[0] * scale; out[1] = a[1] + b[1] * scale; out[2] = a[2] + b[2] * scale; out[3] = a[3] + b[3] * scale; out[4] = a[4] + b[4] * scale; out[5] = a[5] + b[5] * scale; out[6] = a[6] + b[6] * scale; out[7] = a[7] + b[7] * scale; out[8] = a[8...
[ "function", "multiplyScalarAndAdd", "(", "out", ",", "a", ",", "b", ",", "scale", ")", "{", "out", "[", "0", "]", "=", "a", "[", "0", "]", "+", "b", "[", "0", "]", "*", "scale", ";", "out", "[", "1", "]", "=", "a", "[", "1", "]", "+", "b"...
Adds two mat3's after multiplying each element of the second operand by a scalar value. @param {mat3} out the receiving vector @param {mat3} a the first operand @param {mat3} b the second operand @param {Number} scale the amount to scale b's elements by before adding @returns {mat3} out
[ "Adds", "two", "mat3", "s", "after", "multiplying", "each", "element", "of", "the", "second", "operand", "by", "a", "scalar", "value", "." ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L17359-L17370
14,142
antvis/data-set
demos/assets/g2.js
equals
function equals(a, b) { var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5], a6 = a[6], a7 = a[7], a8 = a[8]; var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b...
javascript
function equals(a, b) { var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5], a6 = a[6], a7 = a[7], a8 = a[8]; var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b...
[ "function", "equals", "(", "a", ",", "b", ")", "{", "var", "a0", "=", "a", "[", "0", "]", ",", "a1", "=", "a", "[", "1", "]", ",", "a2", "=", "a", "[", "2", "]", ",", "a3", "=", "a", "[", "3", "]", ",", "a4", "=", "a", "[", "4", "]"...
Returns whether or not the matrices have approximately the same elements in the same position. @param {mat3} a The first matrix. @param {mat3} b The second matrix. @returns {Boolean} True if the matrices are equal, false otherwise.
[ "Returns", "whether", "or", "not", "the", "matrices", "have", "approximately", "the", "same", "elements", "in", "the", "same", "position", "." ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L17390-L17410
14,143
antvis/data-set
demos/assets/g2.js
add
function add(out, a, b) { out[0] = a[0] + b[0]; out[1] = a[1] + b[1]; out[2] = a[2] + b[2]; return out; }
javascript
function add(out, a, b) { out[0] = a[0] + b[0]; out[1] = a[1] + b[1]; out[2] = a[2] + b[2]; return out; }
[ "function", "add", "(", "out", ",", "a", ",", "b", ")", "{", "out", "[", "0", "]", "=", "a", "[", "0", "]", "+", "b", "[", "0", "]", ";", "out", "[", "1", "]", "=", "a", "[", "1", "]", "+", "b", "[", "1", "]", ";", "out", "[", "2", ...
Adds two vec3's @param {vec3} out the receiving vector @param {vec3} a the first operand @param {vec3} b the second operand @returns {vec3} out
[ "Adds", "two", "vec3", "s" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L17591-L17596
14,144
antvis/data-set
demos/assets/g2.js
subtract
function subtract(out, a, b) { out[0] = a[0] - b[0]; out[1] = a[1] - b[1]; out[2] = a[2] - b[2]; return out; }
javascript
function subtract(out, a, b) { out[0] = a[0] - b[0]; out[1] = a[1] - b[1]; out[2] = a[2] - b[2]; return out; }
[ "function", "subtract", "(", "out", ",", "a", ",", "b", ")", "{", "out", "[", "0", "]", "=", "a", "[", "0", "]", "-", "b", "[", "0", "]", ";", "out", "[", "1", "]", "=", "a", "[", "1", "]", "-", "b", "[", "1", "]", ";", "out", "[", ...
Subtracts vector b from vector a @param {vec3} out the receiving vector @param {vec3} a the first operand @param {vec3} b the second operand @returns {vec3} out
[ "Subtracts", "vector", "b", "from", "vector", "a" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L17606-L17611
14,145
antvis/data-set
demos/assets/g2.js
multiply
function multiply(out, a, b) { out[0] = a[0] * b[0]; out[1] = a[1] * b[1]; out[2] = a[2] * b[2]; return out; }
javascript
function multiply(out, a, b) { out[0] = a[0] * b[0]; out[1] = a[1] * b[1]; out[2] = a[2] * b[2]; return out; }
[ "function", "multiply", "(", "out", ",", "a", ",", "b", ")", "{", "out", "[", "0", "]", "=", "a", "[", "0", "]", "*", "b", "[", "0", "]", ";", "out", "[", "1", "]", "=", "a", "[", "1", "]", "*", "b", "[", "1", "]", ";", "out", "[", ...
Multiplies two vec3's @param {vec3} out the receiving vector @param {vec3} a the first operand @param {vec3} b the second operand @returns {vec3} out
[ "Multiplies", "two", "vec3", "s" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L17621-L17626
14,146
antvis/data-set
demos/assets/g2.js
ceil
function ceil(out, a) { out[0] = Math.ceil(a[0]); out[1] = Math.ceil(a[1]); out[2] = Math.ceil(a[2]); return out; }
javascript
function ceil(out, a) { out[0] = Math.ceil(a[0]); out[1] = Math.ceil(a[1]); out[2] = Math.ceil(a[2]); return out; }
[ "function", "ceil", "(", "out", ",", "a", ")", "{", "out", "[", "0", "]", "=", "Math", ".", "ceil", "(", "a", "[", "0", "]", ")", ";", "out", "[", "1", "]", "=", "Math", ".", "ceil", "(", "a", "[", "1", "]", ")", ";", "out", "[", "2", ...
Math.ceil the components of a vec3 @param {vec3} out the receiving vector @param {vec3} a vector to ceil @returns {vec3} out
[ "Math", ".", "ceil", "the", "components", "of", "a", "vec3" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L17650-L17655
14,147
antvis/data-set
demos/assets/g2.js
floor
function floor(out, a) { out[0] = Math.floor(a[0]); out[1] = Math.floor(a[1]); out[2] = Math.floor(a[2]); return out; }
javascript
function floor(out, a) { out[0] = Math.floor(a[0]); out[1] = Math.floor(a[1]); out[2] = Math.floor(a[2]); return out; }
[ "function", "floor", "(", "out", ",", "a", ")", "{", "out", "[", "0", "]", "=", "Math", ".", "floor", "(", "a", "[", "0", "]", ")", ";", "out", "[", "1", "]", "=", "Math", ".", "floor", "(", "a", "[", "1", "]", ")", ";", "out", "[", "2"...
Math.floor the components of a vec3 @param {vec3} out the receiving vector @param {vec3} a vector to floor @returns {vec3} out
[ "Math", ".", "floor", "the", "components", "of", "a", "vec3" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L17664-L17669
14,148
antvis/data-set
demos/assets/g2.js
round
function round(out, a) { out[0] = Math.round(a[0]); out[1] = Math.round(a[1]); out[2] = Math.round(a[2]); return out; }
javascript
function round(out, a) { out[0] = Math.round(a[0]); out[1] = Math.round(a[1]); out[2] = Math.round(a[2]); return out; }
[ "function", "round", "(", "out", ",", "a", ")", "{", "out", "[", "0", "]", "=", "Math", ".", "round", "(", "a", "[", "0", "]", ")", ";", "out", "[", "1", "]", "=", "Math", ".", "round", "(", "a", "[", "1", "]", ")", ";", "out", "[", "2"...
Math.round the components of a vec3 @param {vec3} out the receiving vector @param {vec3} a vector to round @returns {vec3} out
[ "Math", ".", "round", "the", "components", "of", "a", "vec3" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L17708-L17713
14,149
antvis/data-set
demos/assets/g2.js
scale
function scale(out, a, b) { out[0] = a[0] * b; out[1] = a[1] * b; out[2] = a[2] * b; return out; }
javascript
function scale(out, a, b) { out[0] = a[0] * b; out[1] = a[1] * b; out[2] = a[2] * b; return out; }
[ "function", "scale", "(", "out", ",", "a", ",", "b", ")", "{", "out", "[", "0", "]", "=", "a", "[", "0", "]", "*", "b", ";", "out", "[", "1", "]", "=", "a", "[", "1", "]", "*", "b", ";", "out", "[", "2", "]", "=", "a", "[", "2", "]"...
Scales a vec3 by a scalar number @param {vec3} out the receiving vector @param {vec3} a the vector to scale @param {Number} b amount to scale the vector by @returns {vec3} out
[ "Scales", "a", "vec3", "by", "a", "scalar", "number" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L17723-L17728
14,150
antvis/data-set
demos/assets/g2.js
hermite
function hermite(out, a, b, c, d, t) { var factorTimes2 = t * t; var factor1 = factorTimes2 * (2 * t - 3) + 1; var factor2 = factorTimes2 * (t - 2) + t; var factor3 = factorTimes2 * (t - 1); var factor4 = factorTimes2 * (3 - 2 * t); out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4...
javascript
function hermite(out, a, b, c, d, t) { var factorTimes2 = t * t; var factor1 = factorTimes2 * (2 * t - 3) + 1; var factor2 = factorTimes2 * (t - 2) + t; var factor3 = factorTimes2 * (t - 1); var factor4 = factorTimes2 * (3 - 2 * t); out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4...
[ "function", "hermite", "(", "out", ",", "a", ",", "b", ",", "c", ",", "d", ",", "t", ")", "{", "var", "factorTimes2", "=", "t", "*", "t", ";", "var", "factor1", "=", "factorTimes2", "*", "(", "2", "*", "t", "-", "3", ")", "+", "1", ";", "va...
Performs a hermite interpolation with two control points @param {vec3} out the receiving vector @param {vec3} a the first operand @param {vec3} b the second operand @param {vec3} c the third operand @param {vec3} d the fourth operand @param {Number} t interpolation amount, in the range [0-1], between the two inputs @r...
[ "Performs", "a", "hermite", "interpolation", "with", "two", "control", "points" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L17900-L17912
14,151
antvis/data-set
demos/assets/g2.js
rotate
function rotate(out, a, b, c) { //Translate point to the origin var p0 = a[0] - b[0], p1 = a[1] - b[1], sinC = Math.sin(c), cosC = Math.cos(c); //perform rotation and translate to correct position out[0] = p0 * cosC - p1 * sinC + b[0]; out[1] = p0 * sinC + p1 * cosC + b[1]; return out; }
javascript
function rotate(out, a, b, c) { //Translate point to the origin var p0 = a[0] - b[0], p1 = a[1] - b[1], sinC = Math.sin(c), cosC = Math.cos(c); //perform rotation and translate to correct position out[0] = p0 * cosC - p1 * sinC + b[0]; out[1] = p0 * sinC + p1 * cosC + b[1]; return out; }
[ "function", "rotate", "(", "out", ",", "a", ",", "b", ",", "c", ")", "{", "//Translate point to the origin", "var", "p0", "=", "a", "[", "0", "]", "-", "b", "[", "0", "]", ",", "p1", "=", "a", "[", "1", "]", "-", "b", "[", "1", "]", ",", "s...
Rotate a 2D vector @param {vec2} out The receiving vec2 @param {vec2} a The vec2 point to rotate @param {vec2} b The origin of the rotation @param {Number} c The angle of rotation @returns {vec2} out
[ "Rotate", "a", "2D", "vector" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L18794-L18806
14,152
antvis/data-set
demos/assets/g2.js
angle
function angle(a, b) { var x1 = a[0], y1 = a[1], x2 = b[0], y2 = b[1]; var len1 = x1 * x1 + y1 * y1; if (len1 > 0) { //TODO: evaluate use of glm_invsqrt here? len1 = 1 / Math.sqrt(len1); } var len2 = x2 * x2 + y2 * y2; if (len2 > 0) { //TODO: evaluate use of glm_invsqrt here?...
javascript
function angle(a, b) { var x1 = a[0], y1 = a[1], x2 = b[0], y2 = b[1]; var len1 = x1 * x1 + y1 * y1; if (len1 > 0) { //TODO: evaluate use of glm_invsqrt here? len1 = 1 / Math.sqrt(len1); } var len2 = x2 * x2 + y2 * y2; if (len2 > 0) { //TODO: evaluate use of glm_invsqrt here?...
[ "function", "angle", "(", "a", ",", "b", ")", "{", "var", "x1", "=", "a", "[", "0", "]", ",", "y1", "=", "a", "[", "1", "]", ",", "x2", "=", "b", "[", "0", "]", ",", "y2", "=", "b", "[", "1", "]", ";", "var", "len1", "=", "x1", "*", ...
Get the angle between two 2D vectors @param {vec2} a The first operand @param {vec2} b The second operand @returns {Number} The angle in radians
[ "Get", "the", "angle", "between", "two", "2D", "vectors" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L18814-L18841
14,153
antvis/data-set
demos/assets/g2.js
flatten
function flatten(arr) { if (!isArray(arr)) { return arr; } var result = []; each(arr, function (item) { if (isArray(item)) { each(item, function (subItem) { result.push(subItem); }); } else { result.push(item); } }); return result; }
javascript
function flatten(arr) { if (!isArray(arr)) { return arr; } var result = []; each(arr, function (item) { if (isArray(item)) { each(item, function (subItem) { result.push(subItem); }); } else { result.push(item); } }); return result; }
[ "function", "flatten", "(", "arr", ")", "{", "if", "(", "!", "isArray", "(", "arr", ")", ")", "{", "return", "arr", ";", "}", "var", "result", "=", "[", "]", ";", "each", "(", "arr", ",", "function", "(", "item", ")", "{", "if", "(", "isArray",...
Flattens `array` a single level deep. @param {Array} arr The array to flatten. @return {Array} Returns the new flattened array. @example _.flatten([1, [2, [3, [4]], 5]]); // => [1, 2, [3, [4]], 5]
[ "Flattens", "array", "a", "single", "level", "deep", "." ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L22323-L22338
14,154
antvis/data-set
demos/assets/g2.js
pick
function pick(object, keys) { if (object === null || !isPlaineObject(object)) { return {}; } var result = {}; each(keys, function (key) { if (hasOwnProperty.call(object, key)) { result[key] = object[key]; } }); return result; }
javascript
function pick(object, keys) { if (object === null || !isPlaineObject(object)) { return {}; } var result = {}; each(keys, function (key) { if (hasOwnProperty.call(object, key)) { result[key] = object[key]; } }); return result; }
[ "function", "pick", "(", "object", ",", "keys", ")", "{", "if", "(", "object", "===", "null", "||", "!", "isPlaineObject", "(", "object", ")", ")", "{", "return", "{", "}", ";", "}", "var", "result", "=", "{", "}", ";", "each", "(", "keys", ",", ...
Creates an object composed of the picked `object` properties. @param {Object} object The source object. @param {...(string|string[])} [paths] The property paths to pick. @returns {Object} Returns the new object. @example var object = { 'a': 1, 'b': '2', 'c': 3 }; pick(object, ['a', 'c']); // => { 'a': 1, 'c': 3 }
[ "Creates", "an", "object", "composed", "of", "the", "picked", "object", "properties", "." ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L23319-L23330
14,155
antvis/data-set
demos/assets/g2.js
getPath
function getPath(cfg, smooth) { var path = void 0; var points = cfg.points; var isInCircle = cfg.isInCircle; var first = points[0]; if (Util.isArray(first.y)) { path = getRangePath(points, smooth, isInCircle, cfg); } else { path = getSinglePath(points, smooth, isInCircle, cfg); } return path; }
javascript
function getPath(cfg, smooth) { var path = void 0; var points = cfg.points; var isInCircle = cfg.isInCircle; var first = points[0]; if (Util.isArray(first.y)) { path = getRangePath(points, smooth, isInCircle, cfg); } else { path = getSinglePath(points, smooth, isInCircle, cfg); } return path; }
[ "function", "getPath", "(", "cfg", ",", "smooth", ")", "{", "var", "path", "=", "void", "0", ";", "var", "points", "=", "cfg", ".", "points", ";", "var", "isInCircle", "=", "cfg", ".", "isInCircle", ";", "var", "first", "=", "points", "[", "0", "]"...
get line path
[ "get", "line", "path" ]
55526ac5663b87cdc988fc579404df186603b2d9
https://github.com/antvis/data-set/blob/55526ac5663b87cdc988fc579404df186603b2d9/demos/assets/g2.js#L39845-L39856
14,156
brightcove/hot-shots
lib/statsFunctions.js
hrtimer
function hrtimer() { const start = process.hrtime(); return () => { const durationComponents = process.hrtime(start); const seconds = durationComponents[0]; const nanoseconds = durationComponents[1]; const duration = (seconds * 1000) + (nanoseconds / 1E6); return duration; }; ...
javascript
function hrtimer() { const start = process.hrtime(); return () => { const durationComponents = process.hrtime(start); const seconds = durationComponents[0]; const nanoseconds = durationComponents[1]; const duration = (seconds * 1000) + (nanoseconds / 1E6); return duration; }; ...
[ "function", "hrtimer", "(", ")", "{", "const", "start", "=", "process", ".", "hrtime", "(", ")", ";", "return", "(", ")", "=>", "{", "const", "durationComponents", "=", "process", ".", "hrtime", "(", "start", ")", ";", "const", "seconds", "=", "duratio...
High-resolution timer
[ "High", "-", "resolution", "timer" ]
8042839d9f51f68d319fcb9b6e6eee5f75e77423
https://github.com/brightcove/hot-shots/blob/8042839d9f51f68d319fcb9b6e6eee5f75e77423/lib/statsFunctions.js#L80-L90
14,157
brightcove/hot-shots
lib/helpers.js
sanitizeTags
function sanitizeTags(value, telegraf) { const blacklist = telegraf ? /:|\|/g : /:|\||@|,/g; // Replace reserved chars with underscores. return String(value).replace(blacklist, '_'); }
javascript
function sanitizeTags(value, telegraf) { const blacklist = telegraf ? /:|\|/g : /:|\||@|,/g; // Replace reserved chars with underscores. return String(value).replace(blacklist, '_'); }
[ "function", "sanitizeTags", "(", "value", ",", "telegraf", ")", "{", "const", "blacklist", "=", "telegraf", "?", "/", ":|\\|", "/", "g", ":", "/", ":|\\||@|,", "/", "g", ";", "// Replace reserved chars with underscores.", "return", "String", "(", "value", ")",...
Replace any characters that can't be sent on with an underscore
[ "Replace", "any", "characters", "that", "can", "t", "be", "sent", "on", "with", "an", "underscore" ]
8042839d9f51f68d319fcb9b6e6eee5f75e77423
https://github.com/brightcove/hot-shots/blob/8042839d9f51f68d319fcb9b6e6eee5f75e77423/lib/helpers.js#L6-L10
14,158
brightcove/hot-shots
lib/helpers.js
formatTags
function formatTags(tags, telegraf) { if (Array.isArray(tags)) { return tags; } else { return Object.keys(tags).map(key => { return `${sanitizeTags(key, telegraf)}:${sanitizeTags(tags[key], telegraf)}`; }); } }
javascript
function formatTags(tags, telegraf) { if (Array.isArray(tags)) { return tags; } else { return Object.keys(tags).map(key => { return `${sanitizeTags(key, telegraf)}:${sanitizeTags(tags[key], telegraf)}`; }); } }
[ "function", "formatTags", "(", "tags", ",", "telegraf", ")", "{", "if", "(", "Array", ".", "isArray", "(", "tags", ")", ")", "{", "return", "tags", ";", "}", "else", "{", "return", "Object", ".", "keys", "(", "tags", ")", ".", "map", "(", "key", ...
Format tags properly before sending on
[ "Format", "tags", "properly", "before", "sending", "on" ]
8042839d9f51f68d319fcb9b6e6eee5f75e77423
https://github.com/brightcove/hot-shots/blob/8042839d9f51f68d319fcb9b6e6eee5f75e77423/lib/helpers.js#L15-L24
14,159
brightcove/hot-shots
lib/helpers.js
formatDate
function formatDate(date) { let timestamp; if (date instanceof Date) { // Datadog expects seconds. timestamp = Math.round(date.getTime() / 1000); } else if (date instanceof Number) { // Make sure it is an integer, not a float. timestamp = Math.round(date); } return timestamp; }
javascript
function formatDate(date) { let timestamp; if (date instanceof Date) { // Datadog expects seconds. timestamp = Math.round(date.getTime() / 1000); } else if (date instanceof Number) { // Make sure it is an integer, not a float. timestamp = Math.round(date); } return timestamp; }
[ "function", "formatDate", "(", "date", ")", "{", "let", "timestamp", ";", "if", "(", "date", "instanceof", "Date", ")", "{", "// Datadog expects seconds.", "timestamp", "=", "Math", ".", "round", "(", "date", ".", "getTime", "(", ")", "/", "1000", ")", "...
Formats a date for use with DataDog
[ "Formats", "a", "date", "for", "use", "with", "DataDog" ]
8042839d9f51f68d319fcb9b6e6eee5f75e77423
https://github.com/brightcove/hot-shots/blob/8042839d9f51f68d319fcb9b6e6eee5f75e77423/lib/helpers.js#L63-L73
14,160
brightcove/hot-shots
lib/helpers.js
intToIP
function intToIP(int) { const part1 = int & 255; const part2 = ((int >> 8) & 255); const part3 = ((int >> 16) & 255); const part4 = ((int >> 24) & 255); return `${part4}.${part3}.${part2}.${part1}`; }
javascript
function intToIP(int) { const part1 = int & 255; const part2 = ((int >> 8) & 255); const part3 = ((int >> 16) & 255); const part4 = ((int >> 24) & 255); return `${part4}.${part3}.${part2}.${part1}`; }
[ "function", "intToIP", "(", "int", ")", "{", "const", "part1", "=", "int", "&", "255", ";", "const", "part2", "=", "(", "(", "int", ">>", "8", ")", "&", "255", ")", ";", "const", "part3", "=", "(", "(", "int", ">>", "16", ")", "&", "255", ")"...
Converts int to a string IP
[ "Converts", "int", "to", "a", "string", "IP" ]
8042839d9f51f68d319fcb9b6e6eee5f75e77423
https://github.com/brightcove/hot-shots/blob/8042839d9f51f68d319fcb9b6e6eee5f75e77423/lib/helpers.js#L78-L85
14,161
brightcove/hot-shots
lib/helpers.js
getDefaultRoute
function getDefaultRoute() { try { const fileContents = fs.readFileSync('/proc/net/route', 'utf8'); // eslint-disable-line no-sync const routes = fileContents.split('\n'); for (const routeIdx in routes) { const fields = routes[routeIdx].trim().split('\t'); if (fields[1] === '00000000') { ...
javascript
function getDefaultRoute() { try { const fileContents = fs.readFileSync('/proc/net/route', 'utf8'); // eslint-disable-line no-sync const routes = fileContents.split('\n'); for (const routeIdx in routes) { const fields = routes[routeIdx].trim().split('\t'); if (fields[1] === '00000000') { ...
[ "function", "getDefaultRoute", "(", ")", "{", "try", "{", "const", "fileContents", "=", "fs", ".", "readFileSync", "(", "'/proc/net/route'", ",", "'utf8'", ")", ";", "// eslint-disable-line no-sync", "const", "routes", "=", "fileContents", ".", "split", "(", "'\...
Returns the system default interface on Linux
[ "Returns", "the", "system", "default", "interface", "on", "Linux" ]
8042839d9f51f68d319fcb9b6e6eee5f75e77423
https://github.com/brightcove/hot-shots/blob/8042839d9f51f68d319fcb9b6e6eee5f75e77423/lib/helpers.js#L90-L107
14,162
brightcove/hot-shots
lib/statsd.js
onSend
function onSend(error, bytes) { completed += 1; if (calledback) { return; } if (error) { if (typeof callback === 'function') { calledback = true; callback(error); } else if (self.errorHandler) { calledback = true; self.errorHandler(error); } ...
javascript
function onSend(error, bytes) { completed += 1; if (calledback) { return; } if (error) { if (typeof callback === 'function') { calledback = true; callback(error); } else if (self.errorHandler) { calledback = true; self.errorHandler(error); } ...
[ "function", "onSend", "(", "error", ",", "bytes", ")", "{", "completed", "+=", "1", ";", "if", "(", "calledback", ")", "{", "return", ";", "}", "if", "(", "error", ")", "{", "if", "(", "typeof", "callback", "===", "'function'", ")", "{", "calledback"...
Gets called once for each callback, when all callbacks return we will call back from the function @private
[ "Gets", "called", "once", "for", "each", "callback", "when", "all", "callbacks", "return", "we", "will", "call", "back", "from", "the", "function" ]
8042839d9f51f68d319fcb9b6e6eee5f75e77423
https://github.com/brightcove/hot-shots/blob/8042839d9f51f68d319fcb9b6e6eee5f75e77423/lib/statsd.js#L171-L195
14,163
sarriaroman/FabricPlugin
hooks/lib/utilities.js
getBuildGradlePath
function getBuildGradlePath() { var target = path.join("platforms", "android", "app", "build.gradle"); if (fs.existsSync(target)) { return target; } return path.join("platforms", "android", "build.gradle"); }
javascript
function getBuildGradlePath() { var target = path.join("platforms", "android", "app", "build.gradle"); if (fs.existsSync(target)) { return target; } return path.join("platforms", "android", "build.gradle"); }
[ "function", "getBuildGradlePath", "(", ")", "{", "var", "target", "=", "path", ".", "join", "(", "\"platforms\"", ",", "\"android\"", ",", "\"app\"", ",", "\"build.gradle\"", ")", ";", "if", "(", "fs", ".", "existsSync", "(", "target", ")", ")", "{", "re...
Used to get the path to the build.gradle file for the Android project. @returns {string} The path to the build.gradle file.
[ "Used", "to", "get", "the", "path", "to", "the", "build", ".", "gradle", "file", "for", "the", "Android", "project", "." ]
9363a290e071ccd262da9d718aaf5a10a284e144
https://github.com/sarriaroman/FabricPlugin/blob/9363a290e071ccd262da9d718aaf5a10a284e144/hooks/lib/utilities.js#L14-L21
14,164
sarriaroman/FabricPlugin
hooks/lib/utilities.js
function(platform) { var platformConfigPath = path.join("..", "..", "..", platform + ".json"); var platformConfig = require(platformConfigPath); var pluginId = this.getPluginId(); var apiKey = platformConfig.installed_plugins[pluginId].FABRIC_API_KEY; var apiSecret = platform...
javascript
function(platform) { var platformConfigPath = path.join("..", "..", "..", platform + ".json"); var platformConfig = require(platformConfigPath); var pluginId = this.getPluginId(); var apiKey = platformConfig.installed_plugins[pluginId].FABRIC_API_KEY; var apiSecret = platform...
[ "function", "(", "platform", ")", "{", "var", "platformConfigPath", "=", "path", ".", "join", "(", "\"..\"", ",", "\"..\"", ",", "\"..\"", ",", "platform", "+", "\".json\"", ")", ";", "var", "platformConfig", "=", "require", "(", "platformConfigPath", ")", ...
Used to get the plugin configuration for the given platform. The plugin configuration object will have the API and secret keys for the Fabric.io service that were specified when the plugin was installed. This configuration is obtained from, where "ios" is the platform name: platforms/ios/ios.json @param {string} pla...
[ "Used", "to", "get", "the", "plugin", "configuration", "for", "the", "given", "platform", "." ]
9363a290e071ccd262da9d718aaf5a10a284e144
https://github.com/sarriaroman/FabricPlugin/blob/9363a290e071ccd262da9d718aaf5a10a284e144/hooks/lib/utilities.js#L57-L74
14,165
abodelot/jquery.json-viewer
json-viewer/jquery.json-viewer.js
json2html
function json2html(json, options) { var html = ''; if (typeof json === 'string') { // Escape tags json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;'); if (options.withLinks && isUrl(json)) { html += '<a href="' + json + '" class="json-string" target="_blank">...
javascript
function json2html(json, options) { var html = ''; if (typeof json === 'string') { // Escape tags json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;'); if (options.withLinks && isUrl(json)) { html += '<a href="' + json + '" class="json-string" target="_blank">...
[ "function", "json2html", "(", "json", ",", "options", ")", "{", "var", "html", "=", "''", ";", "if", "(", "typeof", "json", "===", "'string'", ")", "{", "// Escape tags", "json", "=", "json", ".", "replace", "(", "/", "&", "/", "g", ",", "'&amp;'", ...
Transform a json object into html representation @return string
[ "Transform", "a", "json", "object", "into", "html", "representation" ]
72ded3f50ffbed28e304ad4fc761b2f3ac562506
https://github.com/abodelot/jquery.json-viewer/blob/72ded3f50ffbed28e304ad4fc761b2f3ac562506/json-viewer/jquery.json-viewer.js#L29-L94
14,166
FormidableLabs/builder
lib/config.js
function () { return _.map([].concat(this.pkgs, this.devPkgs), function (pkg) { return path.join(pkg.path, "node_modules/.bin"); }); }
javascript
function () { return _.map([].concat(this.pkgs, this.devPkgs), function (pkg) { return path.join(pkg.path, "node_modules/.bin"); }); }
[ "function", "(", ")", "{", "return", "_", ".", "map", "(", "[", "]", ".", "concat", "(", "this", ".", "pkgs", ",", "this", ".", "devPkgs", ")", ",", "function", "(", "pkg", ")", "{", "return", "path", ".", "join", "(", "pkg", ".", "path", ",", ...
Return `.bin` paths for archetypes in configured order. @returns {Array} Archetype bin paths
[ "Return", ".", "bin", "paths", "for", "archetypes", "in", "configured", "order", "." ]
7dc928ff3adf76f810f11358058cc32e27fd3d1c
https://github.com/FormidableLabs/builder/blob/7dc928ff3adf76f810f11358058cc32e27fd3d1c/lib/config.js#L307-L311
14,167
FormidableLabs/builder
lib/config.js
function () { var pkgs = this.pkgs; var configNames = _.chain(pkgs) .map(function (pkg) { return _.keys(pkg.config); }) .flatten() .uniq() .value(); // Take "first" config value in arrays as "winning" value. return _.chain(configNames) .map(function (name...
javascript
function () { var pkgs = this.pkgs; var configNames = _.chain(pkgs) .map(function (pkg) { return _.keys(pkg.config); }) .flatten() .uniq() .value(); // Take "first" config value in arrays as "winning" value. return _.chain(configNames) .map(function (name...
[ "function", "(", ")", "{", "var", "pkgs", "=", "this", ".", "pkgs", ";", "var", "configNames", "=", "_", ".", "chain", "(", "pkgs", ")", ".", "map", "(", "function", "(", "pkg", ")", "{", "return", "_", ".", "keys", "(", "pkg", ".", "config", "...
Return object of resolved package.json config fields. Resolves in order of "root wins", then in reverse archetype order. @returns {Object} environment object.
[ "Return", "object", "of", "resolved", "package", ".", "json", "config", "fields", "." ]
7dc928ff3adf76f810f11358058cc32e27fd3d1c
https://github.com/FormidableLabs/builder/blob/7dc928ff3adf76f810f11358058cc32e27fd3d1c/lib/config.js#L335-L356
14,168
FormidableLabs/builder
lib/args.js
function (flagKey) { var flags = _.isUndefined(flagKey) ? FLAGS.general : FLAGS[flagKey]; return !flags ? "" : _.map(flags, function (val, key) { return chalk.cyan("--" + key) + ": " + val.desc; }).join("\n\n "); }
javascript
function (flagKey) { var flags = _.isUndefined(flagKey) ? FLAGS.general : FLAGS[flagKey]; return !flags ? "" : _.map(flags, function (val, key) { return chalk.cyan("--" + key) + ": " + val.desc; }).join("\n\n "); }
[ "function", "(", "flagKey", ")", "{", "var", "flags", "=", "_", ".", "isUndefined", "(", "flagKey", ")", "?", "FLAGS", ".", "general", ":", "FLAGS", "[", "flagKey", "]", ";", "return", "!", "flags", "?", "\"\"", ":", "_", ".", "map", "(", "flags", ...
Retrieve help. @param {String} flagKey Key of flags to return or `undefined` for general @returns {String} Help string
[ "Retrieve", "help", "." ]
7dc928ff3adf76f810f11358058cc32e27fd3d1c
https://github.com/FormidableLabs/builder/blob/7dc928ff3adf76f810f11358058cc32e27fd3d1c/lib/args.js#L138-L144
14,169
eclipse/orion.client
bundles/org.eclipse.orion.client.cf/web/orion/cfui/cFClient.js
function(url, org, space) { var targetObject = { 'Url': url }; if (org) targetObject.Org = org; if (space) targetObject.Space = space; return this._xhrV1("POST", require.toUrl("cfapi/target"), targetObject); }
javascript
function(url, org, space) { var targetObject = { 'Url': url }; if (org) targetObject.Org = org; if (space) targetObject.Space = space; return this._xhrV1("POST", require.toUrl("cfapi/target"), targetObject); }
[ "function", "(", "url", ",", "org", ",", "space", ")", "{", "var", "targetObject", "=", "{", "'Url'", ":", "url", "}", ";", "if", "(", "org", ")", "targetObject", ".", "Org", "=", "org", ";", "if", "(", "space", ")", "targetObject", ".", "Space", ...
Target CF v2 operations
[ "Target", "CF", "v2", "operations" ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.cf/web/orion/cfui/cFClient.js#L100-L108
14,170
eclipse/orion.client
bundles/org.eclipse.orion.client.cf/web/orion/cfui/cFClient.js
function(target, name, contentLocation, manifest, packager, instrumentation) { var pushReq = {}; if (name) pushReq.Name = name; if (contentLocation) pushReq.ContentLocation = contentLocation; if (target) pushReq.Target = target; if(manifest) pushReq.Manifest = manifest; ...
javascript
function(target, name, contentLocation, manifest, packager, instrumentation) { var pushReq = {}; if (name) pushReq.Name = name; if (contentLocation) pushReq.ContentLocation = contentLocation; if (target) pushReq.Target = target; if(manifest) pushReq.Manifest = manifest; ...
[ "function", "(", "target", ",", "name", ",", "contentLocation", ",", "manifest", ",", "packager", ",", "instrumentation", ")", "{", "var", "pushReq", "=", "{", "}", ";", "if", "(", "name", ")", "pushReq", ".", "Name", "=", "name", ";", "if", "(", "co...
Apps CF v2 operations
[ "Apps", "CF", "v2", "operations" ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.cf/web/orion/cfui/cFClient.js#L154-L176
14,171
eclipse/orion.client
bundles/org.eclipse.orion.client.editor/web/orion/editor/textModel.js
TextModel
function TextModel(text, lineDelimiter) { this._lastLineIndex = -1; this._text = [""]; this._lineOffsets = [0]; this.setText(text); this.setLineDelimiter(lineDelimiter); }
javascript
function TextModel(text, lineDelimiter) { this._lastLineIndex = -1; this._text = [""]; this._lineOffsets = [0]; this.setText(text); this.setLineDelimiter(lineDelimiter); }
[ "function", "TextModel", "(", "text", ",", "lineDelimiter", ")", "{", "this", ".", "_lastLineIndex", "=", "-", "1", ";", "this", ".", "_text", "=", "[", "\"\"", "]", ";", "this", ".", "_lineOffsets", "=", "[", "0", "]", ";", "this", ".", "setText", ...
Constructs a new TextModel with the given text and default line delimiter. @param {String} [text=""] the text that the model will store @param {String} [lineDelimiter=platform delimiter] the line delimiter used when inserting new lines to the model. @name orion.editor.TextModel @class The TextModel is an interface th...
[ "Constructs", "a", "new", "TextModel", "with", "the", "given", "text", "and", "default", "line", "delimiter", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.editor/web/orion/editor/textModel.js#L37-L43
14,172
eclipse/orion.client
bundles/org.eclipse.orion.client.editor/web/orion/editor/textModel.js
function() { var count = 0; for (var i = 0; i<this._text.length; i++) { count += this._text[i].length; } return count; }
javascript
function() { var count = 0; for (var i = 0; i<this._text.length; i++) { count += this._text[i].length; } return count; }
[ "function", "(", ")", "{", "var", "count", "=", "0", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "this", ".", "_text", ".", "length", ";", "i", "++", ")", "{", "count", "+=", "this", ".", "_text", "[", "i", "]", ".", "length", ";"...
Returns the number of characters in the model. @returns {Number} the number of characters in the model.
[ "Returns", "the", "number", "of", "characters", "in", "the", "model", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.editor/web/orion/editor/textModel.js#L231-L237
14,173
eclipse/orion.client
releng/org.eclipse.orion.client.releng/builder/scripts/helpers.js
getBundles
function getBundles(buildObj) { var _self = self; var bundles = (buildObj.bundles || []); return bundles.map(function(bundle) { bundle = project.replaceProperties(bundle); var dir = project.resolveFile(bundle + Packages.java.io.File.separator + "web"); if (!dir.exists() || !dir.isDirectory()) { _self...
javascript
function getBundles(buildObj) { var _self = self; var bundles = (buildObj.bundles || []); return bundles.map(function(bundle) { bundle = project.replaceProperties(bundle); var dir = project.resolveFile(bundle + Packages.java.io.File.separator + "web"); if (!dir.exists() || !dir.isDirectory()) { _self...
[ "function", "getBundles", "(", "buildObj", ")", "{", "var", "_self", "=", "self", ";", "var", "bundles", "=", "(", "buildObj", ".", "bundles", "||", "[", "]", ")", ";", "return", "bundles", ".", "map", "(", "function", "(", "bundle", ")", "{", "bundl...
Returns bundle info from the build config. @param {Object} buildObj The build config object @returns { name: string, web: java.io.File }[] Array of bundle info objects.
[ "Returns", "bundle", "info", "from", "the", "build", "config", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/releng/org.eclipse.orion.client.releng/builder/scripts/helpers.js#L97-L112
14,174
eclipse/orion.client
bundles/org.eclipse.orion.client.editor/web/orion/editor/AsyncStyler.js
function() { if (this.textView) { this.textView.removeEventListener("ModelChanging", this.listener.onModelChanging); this.textView.removeEventListener("ModelChanged", this.listener.onModelChanged); this.textView.removeEventListener("Destroy", this.listener.onDestroy); this.textView.removeEventListene...
javascript
function() { if (this.textView) { this.textView.removeEventListener("ModelChanging", this.listener.onModelChanging); this.textView.removeEventListener("ModelChanged", this.listener.onModelChanged); this.textView.removeEventListener("Destroy", this.listener.onDestroy); this.textView.removeEventListene...
[ "function", "(", ")", "{", "if", "(", "this", ".", "textView", ")", "{", "this", ".", "textView", ".", "removeEventListener", "(", "\"ModelChanging\"", ",", "this", ".", "listener", ".", "onModelChanging", ")", ";", "this", ".", "textView", ".", "removeEve...
Deactivates this styler and removes any listeners it registered.
[ "Deactivates", "this", "styler", "and", "removes", "any", "listeners", "it", "registered", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.editor/web/orion/editor/AsyncStyler.js#L105-L126
14,175
eclipse/orion.client
modules/orionode/lib/api.js
sendStatus
function sendStatus(code, res){ try{ if (httpCodeMapping) { code = mapHttpStatusCode(code); } addStrictTransportHeaders(res); setResponseNoCache(res); return res.sendStatus(code); }catch(err){ logger.error(res.req.originalUrl , err.message); throw err; } }
javascript
function sendStatus(code, res){ try{ if (httpCodeMapping) { code = mapHttpStatusCode(code); } addStrictTransportHeaders(res); setResponseNoCache(res); return res.sendStatus(code); }catch(err){ logger.error(res.req.originalUrl , err.message); throw err; } }
[ "function", "sendStatus", "(", "code", ",", "res", ")", "{", "try", "{", "if", "(", "httpCodeMapping", ")", "{", "code", "=", "mapHttpStatusCode", "(", "code", ")", ";", "}", "addStrictTransportHeaders", "(", "res", ")", ";", "setResponseNoCache", "(", "re...
Helper for send a status response @param {Number} code @param {HttpResponse} res
[ "Helper", "for", "send", "a", "status", "response" ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/modules/orionode/lib/api.js#L72-L84
14,176
eclipse/orion.client
modules/orionode/lib/api.js
writeResponse
function writeResponse(code, res, headers, body, needEncodeLocation, noCachedStringRes) { try{ if (res.headerSent) { logger.error("header Sent:", res.req.method, res.req.originalUrl); } if (typeof code === 'number') { if (httpCodeMapping) { code = mapHttpStatusCode(code); } res.status(code); } ...
javascript
function writeResponse(code, res, headers, body, needEncodeLocation, noCachedStringRes) { try{ if (res.headerSent) { logger.error("header Sent:", res.req.method, res.req.originalUrl); } if (typeof code === 'number') { if (httpCodeMapping) { code = mapHttpStatusCode(code); } res.status(code); } ...
[ "function", "writeResponse", "(", "code", ",", "res", ",", "headers", ",", "body", ",", "needEncodeLocation", ",", "noCachedStringRes", ")", "{", "try", "{", "if", "(", "res", ".", "headerSent", ")", "{", "logger", ".", "error", "(", "\"header Sent:\"", ",...
Helper for writing a JSON response. @param {Number} code @param {HttpResponse} res @param {Object} [headers] @param {Object|String} [body] If Object, response will be JSON. If string, response will be text/plain. @param {Boolean} needEncodeLocation @param {Boolean} noCachedStringRes,set to true in case if the response ...
[ "Helper", "for", "writing", "a", "JSON", "response", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/modules/orionode/lib/api.js#L95-L134
14,177
eclipse/orion.client
modules/orionode/lib/api.js
writeError
function writeError(code, res, msg) { try{ if (res.headerSent) { logger.error("header Sent:", res.req.method, res.req.originalUrl); } if (httpCodeMapping) { code = mapHttpStatusCode(code); } msg = msg instanceof Error ? msg.message : msg; addStrictTransportHeaders(res); setResponseNoCache(res); i...
javascript
function writeError(code, res, msg) { try{ if (res.headerSent) { logger.error("header Sent:", res.req.method, res.req.originalUrl); } if (httpCodeMapping) { code = mapHttpStatusCode(code); } msg = msg instanceof Error ? msg.message : msg; addStrictTransportHeaders(res); setResponseNoCache(res); i...
[ "function", "writeError", "(", "code", ",", "res", ",", "msg", ")", "{", "try", "{", "if", "(", "res", ".", "headerSent", ")", "{", "logger", ".", "error", "(", "\"header Sent:\"", ",", "res", ".", "req", ".", "method", ",", "res", ".", "req", ".",...
Helper for writing an error JSON response. @param {Number} code @param {HttpResponse} res @param {String|Error} [msg]
[ "Helper", "for", "writing", "an", "error", "JSON", "response", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/modules/orionode/lib/api.js#L142-L167
14,178
eclipse/orion.client
bundles/org.eclipse.orion.client.editor/web/orion/editor/annotations.js
function(annotationModel, start, end) { var iter = annotationModel.getAnnotations(start, end); var annotation, annotations = []; while (iter.hasNext()) { annotation = iter.next(); if (!this.isAnnotationTypeVisible(annotation.type)) { continue; } annotations.push(annotation); } var self = this...
javascript
function(annotationModel, start, end) { var iter = annotationModel.getAnnotations(start, end); var annotation, annotations = []; while (iter.hasNext()) { annotation = iter.next(); if (!this.isAnnotationTypeVisible(annotation.type)) { continue; } annotations.push(annotation); } var self = this...
[ "function", "(", "annotationModel", ",", "start", ",", "end", ")", "{", "var", "iter", "=", "annotationModel", ".", "getAnnotations", "(", "start", ",", "end", ")", ";", "var", "annotation", ",", "annotations", "=", "[", "]", ";", "while", "(", "iter", ...
Returns an array of annotations in the specified annotation model for the given range of text sorted by type. @param {orion.editor.AnnotationModel} annotationModel the annotation model. @param {Number} start the start offset of the range. @param {Number} end the end offset of the range. @return {orion.editor.Annotatio...
[ "Returns", "an", "array", "of", "annotations", "in", "the", "specified", "annotation", "model", "for", "the", "given", "range", "of", "text", "sorted", "by", "type", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.editor/web/orion/editor/annotations.js#L431-L444
14,179
eclipse/orion.client
bundles/org.eclipse.orion.client.editor/web/orion/editor/annotations.js
function(type) { if (this.getAnnotationTypePriority(type) === 0) return false; return !this._visibleAnnotationTypes || this._visibleAnnotationTypes[type] === undefined || this._visibleAnnotationTypes[type] === true; }
javascript
function(type) { if (this.getAnnotationTypePriority(type) === 0) return false; return !this._visibleAnnotationTypes || this._visibleAnnotationTypes[type] === undefined || this._visibleAnnotationTypes[type] === true; }
[ "function", "(", "type", ")", "{", "if", "(", "this", ".", "getAnnotationTypePriority", "(", "type", ")", "===", "0", ")", "return", "false", ";", "return", "!", "this", ".", "_visibleAnnotationTypes", "||", "this", ".", "_visibleAnnotationTypes", "[", "type...
Returns whether the receiver shows annotations of the specified type. @param {Object} type the annotation type @returns {Boolean} whether the specified annotation type is shown @see orion.editor.AnnotationTypeList#addAnnotationType @see orion.editor.AnnotationTypeList#removeAnnotationType
[ "Returns", "whether", "the", "receiver", "shows", "annotations", "of", "the", "specified", "type", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.editor/web/orion/editor/annotations.js#L454-L457
14,180
eclipse/orion.client
bundles/org.eclipse.orion.client.editor/web/orion/editor/annotations.js
function(type, visible) { if (typeof type === "object") { this._visibleAnnotationTypes = type; } else { if (!this._visibleAnnotationTypes) this._visibleAnnotationTypes = {}; this._visibleAnnotationTypes[type] = visible; } }
javascript
function(type, visible) { if (typeof type === "object") { this._visibleAnnotationTypes = type; } else { if (!this._visibleAnnotationTypes) this._visibleAnnotationTypes = {}; this._visibleAnnotationTypes[type] = visible; } }
[ "function", "(", "type", ",", "visible", ")", "{", "if", "(", "typeof", "type", "===", "\"object\"", ")", "{", "this", ".", "_visibleAnnotationTypes", "=", "type", ";", "}", "else", "{", "if", "(", "!", "this", ".", "_visibleAnnotationTypes", ")", "this"...
Sets whether annotations of the given annotation type are visble. By default all annotations added to the receiver are visible. @param {Object} type @param {Boolean} visible @since 14.0
[ "Sets", "whether", "annotations", "of", "the", "given", "annotation", "type", "are", "visble", ".", "By", "default", "all", "annotations", "added", "to", "the", "receiver", "are", "visible", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.editor/web/orion/editor/annotations.js#L466-L473
14,181
eclipse/orion.client
bundles/org.eclipse.orion.client.editor/web/orion/editor/annotations.js
AnnotationModel
function AnnotationModel(textModel) { this._annotations = []; var self = this; this._listener = { onChanged: function(modelChangedEvent) { self._onChanged(modelChangedEvent); } }; this.setTextModel(textModel); }
javascript
function AnnotationModel(textModel) { this._annotations = []; var self = this; this._listener = { onChanged: function(modelChangedEvent) { self._onChanged(modelChangedEvent); } }; this.setTextModel(textModel); }
[ "function", "AnnotationModel", "(", "textModel", ")", "{", "this", ".", "_annotations", "=", "[", "]", ";", "var", "self", "=", "this", ";", "this", ".", "_listener", "=", "{", "onChanged", ":", "function", "(", "modelChangedEvent", ")", "{", "self", "."...
Constructs an annotation model. @param {orion.editor.TextModel} textModel The text model. @class This object manages annotations for a <code>TextModel</code>. <p> <b>See:</b><br/> {@link orion.editor.Annotation}<br/> {@link orion.editor.TextModel}<br/> </p> @name orion.editor.AnnotationModel @borrows orion.editor.Eve...
[ "Constructs", "an", "annotation", "model", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.editor/web/orion/editor/annotations.js#L528-L537
14,182
eclipse/orion.client
bundles/org.eclipse.orion.client.editor/web/orion/editor/annotations.js
function(textModel) { if (this._model) { this._model.removeEventListener("Changed", this._listener.onChanged); //$NON-NLS-0$ } this._model = textModel; if (this._model) { this._model.addEventListener("Changed", this._listener.onChanged); //$NON-NLS-0$ } }
javascript
function(textModel) { if (this._model) { this._model.removeEventListener("Changed", this._listener.onChanged); //$NON-NLS-0$ } this._model = textModel; if (this._model) { this._model.addEventListener("Changed", this._listener.onChanged); //$NON-NLS-0$ } }
[ "function", "(", "textModel", ")", "{", "if", "(", "this", ".", "_model", ")", "{", "this", ".", "_model", ".", "removeEventListener", "(", "\"Changed\"", ",", "this", ".", "_listener", ".", "onChanged", ")", ";", "//$NON-NLS-0$", "}", "this", ".", "_mod...
Sets the text model of the annotation model. The annotation model listens for changes in the text model to update and remove annotations that are affected by the change. @param {orion.editor.TextModel} textModel the text model. @see orion.editor.AnnotationModel#getTextModel
[ "Sets", "the", "text", "model", "of", "the", "annotation", "model", ".", "The", "annotation", "model", "listens", "for", "changes", "in", "the", "text", "model", "to", "update", "and", "remove", "annotations", "that", "are", "affected", "by", "the", "change"...
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.editor/web/orion/editor/annotations.js#L758-L766
14,183
eclipse/orion.client
bundles/org.eclipse.orion.client.editor/web/orion/editor/annotations.js
AnnotationStyler
function AnnotationStyler (view, annotationModel) { this._view = view; this._annotationModel = annotationModel; var self = this; this._listener = { onDestroy: function(e) { self._onDestroy(e); }, onLineStyle: function(e) { self._onLineStyle(e); }, onChanged: function(e) { self._onAnno...
javascript
function AnnotationStyler (view, annotationModel) { this._view = view; this._annotationModel = annotationModel; var self = this; this._listener = { onDestroy: function(e) { self._onDestroy(e); }, onLineStyle: function(e) { self._onLineStyle(e); }, onChanged: function(e) { self._onAnno...
[ "function", "AnnotationStyler", "(", "view", ",", "annotationModel", ")", "{", "this", ".", "_view", "=", "view", ";", "this", ".", "_annotationModel", "=", "annotationModel", ";", "var", "self", "=", "this", ";", "this", ".", "_listener", "=", "{", "onDes...
Constructs a new styler for annotations. @param {orion.editor.TextView} view The styler view. @param {orion.editor.AnnotationModel} view The styler annotation model. @class This object represents a styler for annotation attached to a text view. @name orion.editor.AnnotationStyler @borrows orion.editor.AnnotationTypeL...
[ "Constructs", "a", "new", "styler", "for", "annotations", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.editor/web/orion/editor/annotations.js#L842-L860
14,184
eclipse/orion.client
bundles/org.eclipse.orion.client.collab/web/orion/collab/collabFileAnnotation.js
function(name, color, location, displayedLocation, editing) { this.name = name; this.color = color; // Remove trailing "/" if(location.substr(-1) === '/') { location = location.substr(0, location.length - 1); } this.location = location; this.displayedLocation = displayedLocation || location; this.edi...
javascript
function(name, color, location, displayedLocation, editing) { this.name = name; this.color = color; // Remove trailing "/" if(location.substr(-1) === '/') { location = location.substr(0, location.length - 1); } this.location = location; this.displayedLocation = displayedLocation || location; this.edi...
[ "function", "(", "name", ",", "color", ",", "location", ",", "displayedLocation", ",", "editing", ")", "{", "this", ".", "name", "=", "name", ";", "this", ".", "color", "=", "color", ";", "// Remove trailing \"/\"", "if", "(", "location", ".", "substr", ...
A record of a collaborator annotation in the file tree @constructor @name {orion.collab.CollabFileAnnotation} @implements {orion.treetable.TableTree.IAnnotation} @param {string} name - displayed name @param {string} color - user color @param {string} location - file location @param {string} displayedLocation - read f...
[ "A", "record", "of", "a", "collaborator", "annotation", "in", "the", "file", "tree" ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.collab/web/orion/collab/collabFileAnnotation.js#L30-L40
14,185
eclipse/orion.client
bundles/org.eclipse.orion.client.collab/web/orion/collab/collabFileAnnotation.js
function(model, callback) { var self = this; model.getRoot(function(root) { // Find the existing ID reversely var location = self.location; while (location.length > 0) { // Create a fake item // NOTE: it's a hack because we don't have any efficient // way to get the actual file no...
javascript
function(model, callback) { var self = this; model.getRoot(function(root) { // Find the existing ID reversely var location = self.location; while (location.length > 0) { // Create a fake item // NOTE: it's a hack because we don't have any efficient // way to get the actual file no...
[ "function", "(", "model", ",", "callback", ")", "{", "var", "self", "=", "this", ";", "model", ".", "getRoot", "(", "function", "(", "root", ")", "{", "// Find the existing ID reversely", "var", "location", "=", "self", ".", "location", ";", "while", "(", ...
Find the deepest expanded folder item that contains the file having this annotation. @see IAnnotation for details. @param {orion.explorer.ExplorerModel} model - @param {Function} callback -
[ "Find", "the", "deepest", "expanded", "folder", "item", "that", "contains", "the", "file", "having", "this", "annotation", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.collab/web/orion/collab/collabFileAnnotation.js#L52-L82
14,186
eclipse/orion.client
bundles/org.eclipse.orion.client.collab/web/orion/collab/collabFileAnnotation.js
function() { var element = document.createElement('div'); element.innerHTML = mUIUtils.getNameInitial(this.name); element.style.backgroundColor = this.color; element.classList.add('collabAnnotation'); if (this.editing) { element.classList.add('collabEditing'); } return element; }
javascript
function() { var element = document.createElement('div'); element.innerHTML = mUIUtils.getNameInitial(this.name); element.style.backgroundColor = this.color; element.classList.add('collabAnnotation'); if (this.editing) { element.classList.add('collabEditing'); } return element; }
[ "function", "(", ")", "{", "var", "element", "=", "document", ".", "createElement", "(", "'div'", ")", ";", "element", ".", "innerHTML", "=", "mUIUtils", ".", "getNameInitial", "(", "this", ".", "name", ")", ";", "element", ".", "style", ".", "background...
Generate a new HTML element of this annotation. @return {Element} - the HTML element of this annotation
[ "Generate", "a", "new", "HTML", "element", "of", "this", "annotation", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.collab/web/orion/collab/collabFileAnnotation.js#L99-L108
14,187
eclipse/orion.client
bundles/org.eclipse.orion.client.core/web/orion/keyBinding.js
function(kb) { if (!kb) { return false; } if (this.keyCode !== kb.keyCode) { return false; } if (this.mod1 !== kb.mod1) { return false; } if (this.mod2 !== kb.mod2) { return false; } if (this.mod3 !== kb.mod3) { return false; } if (this.mod4 !== kb.mod4) { return false; } if (this.type !== kb.type)...
javascript
function(kb) { if (!kb) { return false; } if (this.keyCode !== kb.keyCode) { return false; } if (this.mod1 !== kb.mod1) { return false; } if (this.mod2 !== kb.mod2) { return false; } if (this.mod3 !== kb.mod3) { return false; } if (this.mod4 !== kb.mod4) { return false; } if (this.type !== kb.type)...
[ "function", "(", "kb", ")", "{", "if", "(", "!", "kb", ")", "{", "return", "false", ";", "}", "if", "(", "this", ".", "keyCode", "!==", "kb", ".", "keyCode", ")", "{", "return", "false", ";", "}", "if", "(", "this", ".", "mod1", "!==", "kb", ...
Returns whether this key stroke is the same as the given parameter. @param {orion.KeyBinding} kb the key binding to compare with. @returns {Boolean} whether or not the parameter and the receiver describe the same key binding.
[ "Returns", "whether", "this", "key", "stroke", "is", "the", "same", "as", "the", "given", "parameter", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.core/web/orion/keyBinding.js#L115-L124
14,188
eclipse/orion.client
bundles/org.eclipse.orion.client.core/web/orion/keyBinding.js
function(kb) { if (!kb.keys) { return false; } if (kb.keys.length !== this.keys.length) { return false; } for (var i=0; i<kb.keys.length; i++) { if (!kb.keys[i].equals(this.keys[i])) { return false; } } return true; }
javascript
function(kb) { if (!kb.keys) { return false; } if (kb.keys.length !== this.keys.length) { return false; } for (var i=0; i<kb.keys.length; i++) { if (!kb.keys[i].equals(this.keys[i])) { return false; } } return true; }
[ "function", "(", "kb", ")", "{", "if", "(", "!", "kb", ".", "keys", ")", "{", "return", "false", ";", "}", "if", "(", "kb", ".", "keys", ".", "length", "!==", "this", ".", "keys", ".", "length", ")", "{", "return", "false", ";", "}", "for", "...
Returns whether this key sequence is the same as the given parameter. @param {orion.KeyBinding|orion.KeySequence} kb the key binding to compare with. @returns {Boolean} whether or not the parameter and the receiver describe the same key binding.
[ "Returns", "whether", "this", "key", "sequence", "is", "the", "same", "as", "the", "given", "parameter", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.core/web/orion/keyBinding.js#L184-L191
14,189
eclipse/orion.client
bundles/org.eclipse.orion.client.ui/web/orion/settings/settingsRegistry.js
function(category) { var settingsMap = this.settingsMap; var pids = typeof category === 'string' ? this.categories[category] : Object.keys(settingsMap); //$NON-NLS-0$ if (!pids) { return []; } return pids.map(function(pid) { return settingsMap[pid]; }); }
javascript
function(category) { var settingsMap = this.settingsMap; var pids = typeof category === 'string' ? this.categories[category] : Object.keys(settingsMap); //$NON-NLS-0$ if (!pids) { return []; } return pids.map(function(pid) { return settingsMap[pid]; }); }
[ "function", "(", "category", ")", "{", "var", "settingsMap", "=", "this", ".", "settingsMap", ";", "var", "pids", "=", "typeof", "category", "===", "'string'", "?", "this", ".", "categories", "[", "category", "]", ":", "Object", ".", "keys", "(", "settin...
Returns settings. @param {String} [category] If passed, returns only the settings in the given category. Otherwise, returns all settings. @returns {orion.settings.Setting[]}
[ "Returns", "settings", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/settings/settingsRegistry.js#L245-L254
14,190
eclipse/orion.client
bundles/org.eclipse.orion.client.ui/web/orion/settings/settingsRegistry.js
function(category) { var settings = this.getSettings(category); for (var i = 0; i < settings.length; i++){ var label = settings[i].getCategoryLabel(); if (label) { return label; } } return null; }
javascript
function(category) { var settings = this.getSettings(category); for (var i = 0; i < settings.length; i++){ var label = settings[i].getCategoryLabel(); if (label) { return label; } } return null; }
[ "function", "(", "category", ")", "{", "var", "settings", "=", "this", ".", "getSettings", "(", "category", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "settings", ".", "length", ";", "i", "++", ")", "{", "var", "label", "=", "sett...
Returns the localized label for a category. @returns {String} The category label, or <code>null</code> if no localized label is available.
[ "Returns", "the", "localized", "label", "for", "a", "category", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/settings/settingsRegistry.js#L266-L275
14,191
eclipse/orion.client
bundles/org.eclipse.orion.client.collab/web/orion/collab/otAdapters.js
function(client, socket) { OrionSocketAdapter.call(this, client); var self = this; this.socket = socket; this.authenticated = false; // Register incoming message handler this.socket.addEventListener('message', function(e) { self._onMessage(JSON.parse(e.data)...
javascript
function(client, socket) { OrionSocketAdapter.call(this, client); var self = this; this.socket = socket; this.authenticated = false; // Register incoming message handler this.socket.addEventListener('message', function(e) { self._onMessage(JSON.parse(e.data)...
[ "function", "(", "client", ",", "socket", ")", "{", "OrionSocketAdapter", ".", "call", "(", "this", ",", "client", ")", ";", "var", "self", "=", "this", ";", "this", ".", "socket", "=", "socket", ";", "this", ".", "authenticated", "=", "false", ";", ...
The socket adapter for OT using CollabSocket as the communitation socket @class @extends orion.collab.OrionSocketAdapter @name orion.collab.OrionCollabSocketAdapter @param {orion.collabClient.CollabClient} client @param {orion.collabClient.CollabSocket} socket
[ "The", "socket", "adapter", "for", "OT", "using", "CollabSocket", "as", "the", "communitation", "socket" ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.collab/web/orion/collab/otAdapters.js#L228-L239
14,192
eclipse/orion.client
bundles/org.eclipse.orion.client.javascript/web/escope/escope.js
Reference
function Reference(ident, scope, flag,writeExpr, maybeImplicitGlobal, partial, init) { /** * Identifier syntax node. * @member {esprima#Identifier} Reference#identifier */ this.identifier = ident; /** * Reference to the enclosing Scope. * @member {Scope} Reference#fr...
javascript
function Reference(ident, scope, flag,writeExpr, maybeImplicitGlobal, partial, init) { /** * Identifier syntax node. * @member {esprima#Identifier} Reference#identifier */ this.identifier = ident; /** * Reference to the enclosing Scope. * @member {Scope} Reference#fr...
[ "function", "Reference", "(", "ident", ",", "scope", ",", "flag", ",", "writeExpr", ",", "maybeImplicitGlobal", ",", "partial", ",", "init", ")", "{", "/**\n * Identifier syntax node.\n * @member {esprima#Identifier} Reference#identifier\n */", "this", ".", ...
A Reference represents a single occurrence of an identifier in code. @class Reference
[ "A", "Reference", "represents", "a", "single", "occurrence", "of", "an", "identifier", "in", "code", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.javascript/web/escope/escope.js#L42-L89
14,193
eclipse/orion.client
bundles/org.eclipse.orion.client.javascript/web/escope/escope.js
analyze
function analyze(tree, providedOptions) { var scopeManager, referencer, options; options = updateDeeply(defaultOptions(), providedOptions); scopeManager = new ScopeManager(options); referencer = new Referencer(options, scopeManager); referencer.visit(tree); if(scopeManager.__currentScope !==...
javascript
function analyze(tree, providedOptions) { var scopeManager, referencer, options; options = updateDeeply(defaultOptions(), providedOptions); scopeManager = new ScopeManager(options); referencer = new Referencer(options, scopeManager); referencer.visit(tree); if(scopeManager.__currentScope !==...
[ "function", "analyze", "(", "tree", ",", "providedOptions", ")", "{", "var", "scopeManager", ",", "referencer", ",", "options", ";", "options", "=", "updateDeeply", "(", "defaultOptions", "(", ")", ",", "providedOptions", ")", ";", "scopeManager", "=", "new", ...
Main interface function. Takes an Esprima syntax tree and returns the analyzed scopes. @function analyze @param {esprima.Tree} tree @param {Object} providedOptions - Options that tailor the scope analysis @param {boolean} [providedOptions.optimistic=false] - the optimistic flag @param {boolean} [providedOptions.directi...
[ "Main", "interface", "function", ".", "Takes", "an", "Esprima", "syntax", "tree", "and", "returns", "the", "analyzed", "scopes", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.javascript/web/escope/escope.js#L2117-L2131
14,194
eclipse/orion.client
modules/orionode/lib/shared/db/sharedProjects.js
addProject
function addProject(project) { var hub = generateUniqueHubId(); //TODO Also add name of project owner? Replace by projectJSON all over the file. var query = sharedProject.findOne({location: project}); return query.exec() .then(function(doc) { return doc ? Promise.resolve(doc) : sharedProject.create({locati...
javascript
function addProject(project) { var hub = generateUniqueHubId(); //TODO Also add name of project owner? Replace by projectJSON all over the file. var query = sharedProject.findOne({location: project}); return query.exec() .then(function(doc) { return doc ? Promise.resolve(doc) : sharedProject.create({locati...
[ "function", "addProject", "(", "project", ")", "{", "var", "hub", "=", "generateUniqueHubId", "(", ")", ";", "//TODO Also add name of project owner? Replace by projectJSON all over the file.", "var", "query", "=", "sharedProject", ".", "findOne", "(", "{", "location", "...
Adds the project and a new hubID to the sharedProjects db document.
[ "Adds", "the", "project", "and", "a", "new", "hubID", "to", "the", "sharedProjects", "db", "document", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/modules/orionode/lib/shared/db/sharedProjects.js#L89-L97
14,195
eclipse/orion.client
modules/orionode/lib/shared/db/sharedProjects.js
removeProject
function removeProject(project) { return sharedProject.findOne({'location': project}).exec() .then(function(doc) { if (doc.users.length > 0) { return userProjectsCollection.removeProjectReferences(doc.users, project).exec(); } }) .then(function() { return sharedProject.remove({location: project}).e...
javascript
function removeProject(project) { return sharedProject.findOne({'location': project}).exec() .then(function(doc) { if (doc.users.length > 0) { return userProjectsCollection.removeProjectReferences(doc.users, project).exec(); } }) .then(function() { return sharedProject.remove({location: project}).e...
[ "function", "removeProject", "(", "project", ")", "{", "return", "sharedProject", ".", "findOne", "(", "{", "'location'", ":", "project", "}", ")", ".", "exec", "(", ")", ".", "then", "(", "function", "(", "doc", ")", "{", "if", "(", "doc", ".", "use...
Removes project from shared projects. Also removes all references from the other table.
[ "Removes", "project", "from", "shared", "projects", ".", "Also", "removes", "all", "references", "from", "the", "other", "table", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/modules/orionode/lib/shared/db/sharedProjects.js#L103-L113
14,196
eclipse/orion.client
modules/orionode/lib/shared/db/sharedProjects.js
generateUniqueHubId
function generateUniqueHubId() { //TODO ensure generated hub id is unique (not in db) // do { var length = 10; var letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV0123456789'; var s = ''; for (var i=0; i<length; i++) { s += letters.charAt(Math.floor(Math.random() * letters.length)); } // }...
javascript
function generateUniqueHubId() { //TODO ensure generated hub id is unique (not in db) // do { var length = 10; var letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV0123456789'; var s = ''; for (var i=0; i<length; i++) { s += letters.charAt(Math.floor(Math.random() * letters.length)); } // }...
[ "function", "generateUniqueHubId", "(", ")", "{", "//TODO ensure generated hub id is unique (not in db)", "// do {", "var", "length", "=", "10", ";", "var", "letters", "=", "'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV0123456789'", ";", "var", "s", "=", "''", ";", "f...
returns a unique hubID
[ "returns", "a", "unique", "hubID" ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/modules/orionode/lib/shared/db/sharedProjects.js#L126-L138
14,197
eclipse/orion.client
modules/orionode/lib/shared/db/sharedProjects.js
getUsersInProject
function getUsersInProject(project) { return sharedProject.findOne({'location': project}).exec() .then(function(doc) { return doc ? doc.users : undefined; }); }
javascript
function getUsersInProject(project) { return sharedProject.findOne({'location': project}).exec() .then(function(doc) { return doc ? doc.users : undefined; }); }
[ "function", "getUsersInProject", "(", "project", ")", "{", "return", "sharedProject", ".", "findOne", "(", "{", "'location'", ":", "project", "}", ")", ".", "exec", "(", ")", ".", "then", "(", "function", "(", "doc", ")", "{", "return", "doc", "?", "do...
Returns the list of users that the project is shared with.
[ "Returns", "the", "list", "of", "users", "that", "the", "project", "is", "shared", "with", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/modules/orionode/lib/shared/db/sharedProjects.js#L168-L173
14,198
eclipse/orion.client
modules/orionode/lib/shared/db/sharedProjects.js
addUserToProject
function addUserToProject(user, project) { return addProject(project) .then(function(doc) { if (doc.users.indexOf(user) === -1) { return sharedProject.findOneAndUpdate({'location': project}, {$addToSet: {'users': user} }, { safe: true, w: 'majority' }).exec(); } }); // return sharedProj...
javascript
function addUserToProject(user, project) { return addProject(project) .then(function(doc) { if (doc.users.indexOf(user) === -1) { return sharedProject.findOneAndUpdate({'location': project}, {$addToSet: {'users': user} }, { safe: true, w: 'majority' }).exec(); } }); // return sharedProj...
[ "function", "addUserToProject", "(", "user", ",", "project", ")", "{", "return", "addProject", "(", "project", ")", ".", "then", "(", "function", "(", "doc", ")", "{", "if", "(", "doc", ".", "users", ".", "indexOf", "(", "user", ")", "===", "-", "1",...
Adds user to project's user list.
[ "Adds", "user", "to", "project", "s", "user", "list", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/modules/orionode/lib/shared/db/sharedProjects.js#L178-L204
14,199
eclipse/orion.client
modules/orionode/lib/shared/db/sharedProjects.js
removeUserFromProject
function removeUserFromProject(user, project) { return sharedProject.findOne({'location': project}).exec() .then(function(doc) { return sharedProject.findOneAndUpdate({'location': project}, {$pull: {'users': { $in: [user]}} }, { safe: true, w: 'majority' }).exec(); }); }
javascript
function removeUserFromProject(user, project) { return sharedProject.findOne({'location': project}).exec() .then(function(doc) { return sharedProject.findOneAndUpdate({'location': project}, {$pull: {'users': { $in: [user]}} }, { safe: true, w: 'majority' }).exec(); }); }
[ "function", "removeUserFromProject", "(", "user", ",", "project", ")", "{", "return", "sharedProject", ".", "findOne", "(", "{", "'location'", ":", "project", "}", ")", ".", "exec", "(", ")", ".", "then", "(", "function", "(", "doc", ")", "{", "return", ...
Remove user from project's user list.
[ "Remove", "user", "from", "project", "s", "user", "list", "." ]
eb2583100c662b5cfc1b461a978b31d3b8555ce1
https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/modules/orionode/lib/shared/db/sharedProjects.js#L209-L217