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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
24,100 | ember-cli/loader.js | benchmarks/scenarios/ember.js | Morph | function Morph(domHelper, contextualElement) {
this.domHelper = domHelper;
// context if content if current content is detached
this.contextualElement = contextualElement;
// inclusive range of morph
// these should be nodeType 1, 3, or 8
this.firstNode = null;
this.lastNode = null;
// ... | javascript | function Morph(domHelper, contextualElement) {
this.domHelper = domHelper;
// context if content if current content is detached
this.contextualElement = contextualElement;
// inclusive range of morph
// these should be nodeType 1, 3, or 8
this.firstNode = null;
this.lastNode = null;
// ... | [
"function",
"Morph",
"(",
"domHelper",
",",
"contextualElement",
")",
"{",
"this",
".",
"domHelper",
"=",
"domHelper",
";",
"// context if content if current content is detached",
"this",
".",
"contextualElement",
"=",
"contextualElement",
";",
"// inclusive range of morph"... | constructor just initializes the fields use one of the static initializers to create a valid morph. | [
"constructor",
"just",
"initializes",
"the",
"fields",
"use",
"one",
"of",
"the",
"static",
"initializers",
"to",
"create",
"a",
"valid",
"morph",
"."
] | 4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101 | https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L51201-L51217 |
24,101 | ember-cli/loader.js | benchmarks/scenarios/ember.js | ReferenceIterator | function ReferenceIterator(iterable) {
_classCallCheck(this, ReferenceIterator);
this.iterator = null;
var artifacts = new IterationArtifacts(iterable);
this.artifacts = artifacts;
} | javascript | function ReferenceIterator(iterable) {
_classCallCheck(this, ReferenceIterator);
this.iterator = null;
var artifacts = new IterationArtifacts(iterable);
this.artifacts = artifacts;
} | [
"function",
"ReferenceIterator",
"(",
"iterable",
")",
"{",
"_classCallCheck",
"(",
"this",
",",
"ReferenceIterator",
")",
";",
"this",
".",
"iterator",
"=",
"null",
";",
"var",
"artifacts",
"=",
"new",
"IterationArtifacts",
"(",
"iterable",
")",
";",
"this",
... | if anyone needs to construct this object with something other than an iterable, let @wycats know. | [
"if",
"anyone",
"needs",
"to",
"construct",
"this",
"object",
"with",
"something",
"other",
"than",
"an",
"iterable",
"let"
] | 4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101 | https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L51675-L51681 |
24,102 | ember-cli/loader.js | benchmarks/scenarios/ember.js | function (ch) {
// DEBUG "Processing `" + ch + "`:"
var nextStates = this.nextStates,
child,
charSpec,
chars;
// DEBUG " " + debugState(this)
var returned = [];
for (var i = 0, l = nextStates.length; i < l; i++) {
child = nextStates[i];
cha... | javascript | function (ch) {
// DEBUG "Processing `" + ch + "`:"
var nextStates = this.nextStates,
child,
charSpec,
chars;
// DEBUG " " + debugState(this)
var returned = [];
for (var i = 0, l = nextStates.length; i < l; i++) {
child = nextStates[i];
cha... | [
"function",
"(",
"ch",
")",
"{",
"// DEBUG \"Processing `\" + ch + \"`:\"",
"var",
"nextStates",
"=",
"this",
".",
"nextStates",
",",
"child",
",",
"charSpec",
",",
"chars",
";",
"// DEBUG \" \" + debugState(this)",
"var",
"returned",
"=",
"[",
"]",
";",
"for",
... | Find a list of child states matching the next character | [
"Find",
"a",
"list",
"of",
"child",
"states",
"matching",
"the",
"next",
"character"
] | 4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101 | https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L61012-L61039 | |
24,103 | ember-cli/loader.js | benchmarks/scenarios/ember.js | function (handlerName) {
var partitionedArgs = _routerUtils.extractQueryParams(_routerUtils.slice.call(arguments, 1)),
suppliedParams = partitionedArgs[0],
queryParams = partitionedArgs[1];
// Construct a TransitionIntent with the provided params
// and apply it to the present st... | javascript | function (handlerName) {
var partitionedArgs = _routerUtils.extractQueryParams(_routerUtils.slice.call(arguments, 1)),
suppliedParams = partitionedArgs[0],
queryParams = partitionedArgs[1];
// Construct a TransitionIntent with the provided params
// and apply it to the present st... | [
"function",
"(",
"handlerName",
")",
"{",
"var",
"partitionedArgs",
"=",
"_routerUtils",
".",
"extractQueryParams",
"(",
"_routerUtils",
".",
"slice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
")",
",",
"suppliedParams",
"=",
"partitionedArgs",
"[",
"0",
... | Take a named route and context objects and generate a
URL.
@param {String} name the name of the route to generate
a URL for
@param {...Object} objects a list of objects to serialize
@return {String} a URL | [
"Take",
"a",
"named",
"route",
"and",
"context",
"objects",
"and",
"generate",
"a",
"URL",
"."
] | 4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101 | https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L61957-L61977 | |
24,104 | ember-cli/loader.js | benchmarks/scenarios/ember.js | function () {
if (this.isAborted) {
return this;
}
_routerUtils.log(this.router, this.sequence, this.targetName + ": transition was aborted");
this.intent.preTransitionState = this.router.state;
this.isAborted = true;
this.isActive = false;
this.router.activeTransition ... | javascript | function () {
if (this.isAborted) {
return this;
}
_routerUtils.log(this.router, this.sequence, this.targetName + ": transition was aborted");
this.intent.preTransitionState = this.router.state;
this.isAborted = true;
this.isActive = false;
this.router.activeTransition ... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"isAborted",
")",
"{",
"return",
"this",
";",
"}",
"_routerUtils",
".",
"log",
"(",
"this",
".",
"router",
",",
"this",
".",
"sequence",
",",
"this",
".",
"targetName",
"+",
"\": transition was aborted\"... | Aborts the Transition. Note you can also implicitly abort a transition
by initiating another transition while a previous one is underway.
@method abort
@return {Transition} this transition
@public | [
"Aborts",
"the",
"Transition",
".",
"Note",
"you",
"can",
"also",
"implicitly",
"abort",
"a",
"transition",
"by",
"initiating",
"another",
"transition",
"while",
"a",
"previous",
"one",
"is",
"underway",
"."
] | 4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101 | https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L63069-L63079 | |
24,105 | ember-cli/loader.js | benchmarks/scenarios/ember.js | race | function race(entries, label) {
/*jshint validthis:true */
var Constructor = this;
var promise = new Constructor(_rsvpInternal.noop, label);
if (!_rsvpUtils.isArray(entries)) {
_rsvpInternal.reject(promise, new TypeError('You must pass an array to race.'));
return promise;
}
var l... | javascript | function race(entries, label) {
/*jshint validthis:true */
var Constructor = this;
var promise = new Constructor(_rsvpInternal.noop, label);
if (!_rsvpUtils.isArray(entries)) {
_rsvpInternal.reject(promise, new TypeError('You must pass an array to race.'));
return promise;
}
var l... | [
"function",
"race",
"(",
"entries",
",",
"label",
")",
"{",
"/*jshint validthis:true */",
"var",
"Constructor",
"=",
"this",
";",
"var",
"promise",
"=",
"new",
"Constructor",
"(",
"_rsvpInternal",
".",
"noop",
",",
"label",
")",
";",
"if",
"(",
"!",
"_rsvp... | `RSVP.Promise.race` returns a new promise which is settled in the same way as the
first passed promise to settle.
Example:
```javascript
var promise1 = new RSVP.Promise(function(resolve, reject){
setTimeout(function(){
resolve('promise 1');
}, 200);
});
var promise2 = new RSVP.Promise(function(resolve, reject){
setT... | [
"RSVP",
".",
"Promise",
".",
"race",
"returns",
"a",
"new",
"promise",
"which",
"is",
"settled",
"in",
"the",
"same",
"way",
"as",
"the",
"first",
"passed",
"promise",
"to",
"settle",
"."
] | 4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101 | https://github.com/ember-cli/loader.js/blob/4fe5b3dfd5e1a30d706d289bb4e5fdbd5a799101/benchmarks/scenarios/ember.js#L65258-L65284 |
24,106 | sindresorhus/gulp-changed | index.js | fsOperationFailed | function fsOperationFailed(stream, sourceFile, err) {
if (err.code !== 'ENOENT') {
stream.emit('error', new PluginError('gulp-changed', err, {
fileName: sourceFile.path
}));
}
stream.push(sourceFile);
} | javascript | function fsOperationFailed(stream, sourceFile, err) {
if (err.code !== 'ENOENT') {
stream.emit('error', new PluginError('gulp-changed', err, {
fileName: sourceFile.path
}));
}
stream.push(sourceFile);
} | [
"function",
"fsOperationFailed",
"(",
"stream",
",",
"sourceFile",
",",
"err",
")",
"{",
"if",
"(",
"err",
".",
"code",
"!==",
"'ENOENT'",
")",
"{",
"stream",
".",
"emit",
"(",
"'error'",
",",
"new",
"PluginError",
"(",
"'gulp-changed'",
",",
"err",
",",... | Ignore missing file error | [
"Ignore",
"missing",
"file",
"error"
] | df7582f848aba597b9e821dbb8507ddd208178d7 | https://github.com/sindresorhus/gulp-changed/blob/df7582f848aba597b9e821dbb8507ddd208178d7/index.js#L13-L21 |
24,107 | sindresorhus/gulp-changed | index.js | compareLastModifiedTime | function compareLastModifiedTime(stream, sourceFile, targetPath) {
return stat(targetPath)
.then(targetStat => {
if (sourceFile.stat && sourceFile.stat.mtime > targetStat.mtime) {
stream.push(sourceFile);
}
});
} | javascript | function compareLastModifiedTime(stream, sourceFile, targetPath) {
return stat(targetPath)
.then(targetStat => {
if (sourceFile.stat && sourceFile.stat.mtime > targetStat.mtime) {
stream.push(sourceFile);
}
});
} | [
"function",
"compareLastModifiedTime",
"(",
"stream",
",",
"sourceFile",
",",
"targetPath",
")",
"{",
"return",
"stat",
"(",
"targetPath",
")",
".",
"then",
"(",
"targetStat",
"=>",
"{",
"if",
"(",
"sourceFile",
".",
"stat",
"&&",
"sourceFile",
".",
"stat",
... | Only push through files changed more recently than the destination files | [
"Only",
"push",
"through",
"files",
"changed",
"more",
"recently",
"than",
"the",
"destination",
"files"
] | df7582f848aba597b9e821dbb8507ddd208178d7 | https://github.com/sindresorhus/gulp-changed/blob/df7582f848aba597b9e821dbb8507ddd208178d7/index.js#L24-L31 |
24,108 | sindresorhus/gulp-changed | index.js | compareContents | function compareContents(stream, sourceFile, targetPath) {
return readFile(targetPath)
.then(targetData => {
if (sourceFile.isNull() || !sourceFile.contents.equals(targetData)) {
stream.push(sourceFile);
}
});
} | javascript | function compareContents(stream, sourceFile, targetPath) {
return readFile(targetPath)
.then(targetData => {
if (sourceFile.isNull() || !sourceFile.contents.equals(targetData)) {
stream.push(sourceFile);
}
});
} | [
"function",
"compareContents",
"(",
"stream",
",",
"sourceFile",
",",
"targetPath",
")",
"{",
"return",
"readFile",
"(",
"targetPath",
")",
".",
"then",
"(",
"targetData",
"=>",
"{",
"if",
"(",
"sourceFile",
".",
"isNull",
"(",
")",
"||",
"!",
"sourceFile"... | Only push through files with different contents than the destination files | [
"Only",
"push",
"through",
"files",
"with",
"different",
"contents",
"than",
"the",
"destination",
"files"
] | df7582f848aba597b9e821dbb8507ddd208178d7 | https://github.com/sindresorhus/gulp-changed/blob/df7582f848aba597b9e821dbb8507ddd208178d7/index.js#L34-L41 |
24,109 | ghybs/Leaflet.MarkerCluster.LayerSupport | src/layersupport.js | function (layers) {
var layersArray = this._toArray(layers),
separated = this._checkInGetSeparated(layersArray),
groups = separated.groups,
i, group, id;
// Batch add all single layers.
this._originalAddLayers(separated.singles);
// Add Layer Groups to the map so that they are registered the... | javascript | function (layers) {
var layersArray = this._toArray(layers),
separated = this._checkInGetSeparated(layersArray),
groups = separated.groups,
i, group, id;
// Batch add all single layers.
this._originalAddLayers(separated.singles);
// Add Layer Groups to the map so that they are registered the... | [
"function",
"(",
"layers",
")",
"{",
"var",
"layersArray",
"=",
"this",
".",
"_toArray",
"(",
"layers",
")",
",",
"separated",
"=",
"this",
".",
"_checkInGetSeparated",
"(",
"layersArray",
")",
",",
"groups",
"=",
"separated",
".",
"groups",
",",
"i",
",... | Checks in and adds an array of layers to this group.
Layer Groups are also added to the map to fire their event.
@param layers (L.Layer|L.Layer[]) single and/or group layers to be added.
@returns {L.MarkerClusterGroup.LayerSupport} this. | [
"Checks",
"in",
"and",
"adds",
"an",
"array",
"of",
"layers",
"to",
"this",
"group",
".",
"Layer",
"Groups",
"are",
"also",
"added",
"to",
"the",
"map",
"to",
"fire",
"their",
"event",
"."
] | 649b3a94fad3e7fe6bc5870e2cca74b07604a934 | https://github.com/ghybs/Leaflet.MarkerCluster.LayerSupport/blob/649b3a94fad3e7fe6bc5870e2cca74b07604a934/src/layersupport.js#L92-L112 | |
24,110 | ghybs/Leaflet.MarkerCluster.LayerSupport | src/layersupport.js | function (layers) {
var layersArray = this._toArray(layers),
separated = this._separateSingleFromGroupLayers(layersArray, {
groups: [],
singles: []
}),
groups = separated.groups,
singles = separated.singles,
i = 0,
group, id;
// Batch remove single layers fro... | javascript | function (layers) {
var layersArray = this._toArray(layers),
separated = this._separateSingleFromGroupLayers(layersArray, {
groups: [],
singles: []
}),
groups = separated.groups,
singles = separated.singles,
i = 0,
group, id;
// Batch remove single layers fro... | [
"function",
"(",
"layers",
")",
"{",
"var",
"layersArray",
"=",
"this",
".",
"_toArray",
"(",
"layers",
")",
",",
"separated",
"=",
"this",
".",
"_separateSingleFromGroupLayers",
"(",
"layersArray",
",",
"{",
"groups",
":",
"[",
"]",
",",
"singles",
":",
... | Removes layers from this group but without check out.
Layer Groups are also removed from the map to fire their event.
@param layers (L.Layer|L.Layer[]) single and/or group layers to be removed.
@returns {L.MarkerClusterGroup.LayerSupport} this. | [
"Removes",
"layers",
"from",
"this",
"group",
"but",
"without",
"check",
"out",
".",
"Layer",
"Groups",
"are",
"also",
"removed",
"from",
"the",
"map",
"to",
"fire",
"their",
"event",
"."
] | 649b3a94fad3e7fe6bc5870e2cca74b07604a934 | https://github.com/ghybs/Leaflet.MarkerCluster.LayerSupport/blob/649b3a94fad3e7fe6bc5870e2cca74b07604a934/src/layersupport.js#L126-L154 | |
24,111 | ghybs/Leaflet.MarkerCluster.LayerSupport | src/layersupport.js | function (layer, operationType) {
var duration = this.options.singleAddRemoveBufferDuration,
fn;
if (duration > 0) {
this._singleAddRemoveBuffer.push({
type: operationType,
layer: layer
});
if (!this._singleAddRemoveBufferTimeout) {
fn = L.bind(this._processSingleAddRemoveBuffer, this);... | javascript | function (layer, operationType) {
var duration = this.options.singleAddRemoveBufferDuration,
fn;
if (duration > 0) {
this._singleAddRemoveBuffer.push({
type: operationType,
layer: layer
});
if (!this._singleAddRemoveBufferTimeout) {
fn = L.bind(this._processSingleAddRemoveBuffer, this);... | [
"function",
"(",
"layer",
",",
"operationType",
")",
"{",
"var",
"duration",
"=",
"this",
".",
"options",
".",
"singleAddRemoveBufferDuration",
",",
"fn",
";",
"if",
"(",
"duration",
">",
"0",
")",
"{",
"this",
".",
"_singleAddRemoveBuffer",
".",
"push",
"... | Do not restore the original map methods when removing the group from it. Leaving them as-is does not harm, whereas restoring the original ones may kill the functionality of potential other LayerSupport groups on the same map. Therefore we do not need to override onRemove. | [
"Do",
"not",
"restore",
"the",
"original",
"map",
"methods",
"when",
"removing",
"the",
"group",
"from",
"it",
".",
"Leaving",
"them",
"as",
"-",
"is",
"does",
"not",
"harm",
"whereas",
"restoring",
"the",
"original",
"ones",
"may",
"kill",
"the",
"functio... | 649b3a94fad3e7fe6bc5870e2cca74b07604a934 | https://github.com/ghybs/Leaflet.MarkerCluster.LayerSupport/blob/649b3a94fad3e7fe6bc5870e2cca74b07604a934/src/layersupport.js#L210-L228 | |
24,112 | ghybs/Leaflet.MarkerCluster.LayerSupport | src/layersupport.js | function (layerGroup) {
if (layerGroup._proxyMcgLayerSupportGroup === undefined ||
layerGroup._proxyMcgLayerSupportGroup !== this) {
return;
}
delete layerGroup._proxyMcgLayerSupportGroup;
layerGroup.addLayer = layerGroup._originalAddLayer;
layerGroup.removeLayer = layerGroup._originalRemoveLayer;
l... | javascript | function (layerGroup) {
if (layerGroup._proxyMcgLayerSupportGroup === undefined ||
layerGroup._proxyMcgLayerSupportGroup !== this) {
return;
}
delete layerGroup._proxyMcgLayerSupportGroup;
layerGroup.addLayer = layerGroup._originalAddLayer;
layerGroup.removeLayer = layerGroup._originalRemoveLayer;
l... | [
"function",
"(",
"layerGroup",
")",
"{",
"if",
"(",
"layerGroup",
".",
"_proxyMcgLayerSupportGroup",
"===",
"undefined",
"||",
"layerGroup",
".",
"_proxyMcgLayerSupportGroup",
"!==",
"this",
")",
"{",
"return",
";",
"}",
"delete",
"layerGroup",
".",
"_proxyMcgLaye... | Restore the normal LayerGroup behaviour. Removal and check out of contained markers must be taken care of externally. | [
"Restore",
"the",
"normal",
"LayerGroup",
"behaviour",
".",
"Removal",
"and",
"check",
"out",
"of",
"contained",
"markers",
"must",
"be",
"taken",
"care",
"of",
"externally",
"."
] | 649b3a94fad3e7fe6bc5870e2cca74b07604a934 | https://github.com/ghybs/Leaflet.MarkerCluster.LayerSupport/blob/649b3a94fad3e7fe6bc5870e2cca74b07604a934/src/layersupport.js#L347-L365 | |
24,113 | ghybs/Leaflet.MarkerCluster.LayerSupport | src/layersupport.js | function (map) {
var layers = this._layers,
toBeReAdded = [],
layer;
for (var id in layers) {
layer = layers[id];
if (layer._map) {
toBeReAdded.push(layer);
map._originalRemoveLayer(layer);
}
}
return toBeReAdded;
} | javascript | function (map) {
var layers = this._layers,
toBeReAdded = [],
layer;
for (var id in layers) {
layer = layers[id];
if (layer._map) {
toBeReAdded.push(layer);
map._originalRemoveLayer(layer);
}
}
return toBeReAdded;
} | [
"function",
"(",
"map",
")",
"{",
"var",
"layers",
"=",
"this",
".",
"_layers",
",",
"toBeReAdded",
"=",
"[",
"]",
",",
"layer",
";",
"for",
"(",
"var",
"id",
"in",
"layers",
")",
"{",
"layer",
"=",
"layers",
"[",
"id",
"]",
";",
"if",
"(",
"la... | In case checked in layers have been added to map whereas map is not redirected. | [
"In",
"case",
"checked",
"in",
"layers",
"have",
"been",
"added",
"to",
"map",
"whereas",
"map",
"is",
"not",
"redirected",
"."
] | 649b3a94fad3e7fe6bc5870e2cca74b07604a934 | https://github.com/ghybs/Leaflet.MarkerCluster.LayerSupport/blob/649b3a94fad3e7fe6bc5870e2cca74b07604a934/src/layersupport.js#L393-L407 | |
24,114 | ghybs/Leaflet.MarkerCluster.LayerSupport | src/layersupport.js | function (layer) {
var id = this.getLayerId(layer);
this._layers[id] = layer;
if (this._map) {
this._proxyMcgLayerSupportGroup.addLayer(layer);
} else {
this._proxyMcgLayerSupportGroup.checkIn(layer);
}
return this;
} | javascript | function (layer) {
var id = this.getLayerId(layer);
this._layers[id] = layer;
if (this._map) {
this._proxyMcgLayerSupportGroup.addLayer(layer);
} else {
this._proxyMcgLayerSupportGroup.checkIn(layer);
}
return this;
} | [
"function",
"(",
"layer",
")",
"{",
"var",
"id",
"=",
"this",
".",
"getLayerId",
"(",
"layer",
")",
";",
"this",
".",
"_layers",
"[",
"id",
"]",
"=",
"layer",
";",
"if",
"(",
"this",
".",
"_map",
")",
"{",
"this",
".",
"_proxyMcgLayerSupportGroup",
... | Re-implement to redirect addLayer to Layer Support group instead of map. | [
"Re",
"-",
"implement",
"to",
"redirect",
"addLayer",
"to",
"Layer",
"Support",
"group",
"instead",
"of",
"map",
"."
] | 649b3a94fad3e7fe6bc5870e2cca74b07604a934 | https://github.com/ghybs/Leaflet.MarkerCluster.LayerSupport/blob/649b3a94fad3e7fe6bc5870e2cca74b07604a934/src/layersupport.js#L489-L501 | |
24,115 | ghybs/Leaflet.MarkerCluster.LayerSupport | src/layersupport.js | function (layer) {
var id = layer in this._layers ? layer : this.getLayerId(layer);
this._proxyMcgLayerSupportGroup.removeLayer(layer);
delete this._layers[id];
return this;
} | javascript | function (layer) {
var id = layer in this._layers ? layer : this.getLayerId(layer);
this._proxyMcgLayerSupportGroup.removeLayer(layer);
delete this._layers[id];
return this;
} | [
"function",
"(",
"layer",
")",
"{",
"var",
"id",
"=",
"layer",
"in",
"this",
".",
"_layers",
"?",
"layer",
":",
"this",
".",
"getLayerId",
"(",
"layer",
")",
";",
"this",
".",
"_proxyMcgLayerSupportGroup",
".",
"removeLayer",
"(",
"layer",
")",
";",
"d... | Re-implement to redirect removeLayer to Layer Support group instead of map. | [
"Re",
"-",
"implement",
"to",
"redirect",
"removeLayer",
"to",
"Layer",
"Support",
"group",
"instead",
"of",
"map",
"."
] | 649b3a94fad3e7fe6bc5870e2cca74b07604a934 | https://github.com/ghybs/Leaflet.MarkerCluster.LayerSupport/blob/649b3a94fad3e7fe6bc5870e2cca74b07604a934/src/layersupport.js#L504-L513 | |
24,116 | jeromeetienne/better.js | www/long-stack-traces/lib/long-stack-traces.js | wrapRegistrationFunction | function wrapRegistrationFunction(object, property, callbackArg) {
if (typeof object[property] !== "function") {
console.error("(long-stack-traces) Object", object, "does not contain function", property);
return;
}
if (!has.call(object, property)) {
console.wa... | javascript | function wrapRegistrationFunction(object, property, callbackArg) {
if (typeof object[property] !== "function") {
console.error("(long-stack-traces) Object", object, "does not contain function", property);
return;
}
if (!has.call(object, property)) {
console.wa... | [
"function",
"wrapRegistrationFunction",
"(",
"object",
",",
"property",
",",
"callbackArg",
")",
"{",
"if",
"(",
"typeof",
"object",
"[",
"property",
"]",
"!==",
"\"function\"",
")",
"{",
"console",
".",
"error",
"(",
"\"(long-stack-traces) Object\"",
",",
"obje... | Takes an object, a property name for the callback function to wrap, and an argument position and overwrites the function with a wrapper that captures the stack at the time of callback registration | [
"Takes",
"an",
"object",
"a",
"property",
"name",
"for",
"the",
"callback",
"function",
"to",
"wrap",
"and",
"an",
"argument",
"position",
"and",
"overwrites",
"the",
"function",
"with",
"a",
"wrapper",
"that",
"captures",
"the",
"stack",
"at",
"the",
"time"... | 248114fc31978b3c197fe227734d7da7381d4c4a | https://github.com/jeromeetienne/better.js/blob/248114fc31978b3c197fe227734d7da7381d4c4a/www/long-stack-traces/lib/long-stack-traces.js#L38-L63 |
24,117 | jeromeetienne/better.js | www/long-stack-traces/lib/long-stack-traces.js | makeWrappedCallback | function makeWrappedCallback(callback, frameLocation) {
// add a fake stack frame. we can't get a real one since we aren't inside the original function
var traceError = new Error();
traceError.__location = frameLocation;
traceError.__previous = currentTraceError;
return function(... | javascript | function makeWrappedCallback(callback, frameLocation) {
// add a fake stack frame. we can't get a real one since we aren't inside the original function
var traceError = new Error();
traceError.__location = frameLocation;
traceError.__previous = currentTraceError;
return function(... | [
"function",
"makeWrappedCallback",
"(",
"callback",
",",
"frameLocation",
")",
"{",
"// add a fake stack frame. we can't get a real one since we aren't inside the original function",
"var",
"traceError",
"=",
"new",
"Error",
"(",
")",
";",
"traceError",
".",
"__location",
"="... | Takes a callback function and name, and captures a stack trace, returning a new callback that restores the stack frame This function adds a single function call overhead during callback registration vs. inlining it in wrapRegistationFunction | [
"Takes",
"a",
"callback",
"function",
"and",
"name",
"and",
"captures",
"a",
"stack",
"trace",
"returning",
"a",
"new",
"callback",
"that",
"restores",
"the",
"stack",
"frame",
"This",
"function",
"adds",
"a",
"single",
"function",
"call",
"overhead",
"during"... | 248114fc31978b3c197fe227734d7da7381d4c4a | https://github.com/jeromeetienne/better.js/blob/248114fc31978b3c197fe227734d7da7381d4c4a/www/long-stack-traces/lib/long-stack-traces.js#L67-L91 |
24,118 | jeromeetienne/better.js | src/stacktrace.js | _parserFirefox | function _parserFirefox(error){
// start parse the error stack string
var lines = error.stack.split("\n").slice(0, -1);
var stacktrace = [];
lines.forEach(function(line){
var matches = line.match(/^(.*)@(.+):(\d+)$/);
stacktrace.push(new Stacktrace.Frame({
fct : matches[1] === '' ? '<anonymous>' : mat... | javascript | function _parserFirefox(error){
// start parse the error stack string
var lines = error.stack.split("\n").slice(0, -1);
var stacktrace = [];
lines.forEach(function(line){
var matches = line.match(/^(.*)@(.+):(\d+)$/);
stacktrace.push(new Stacktrace.Frame({
fct : matches[1] === '' ? '<anonymous>' : mat... | [
"function",
"_parserFirefox",
"(",
"error",
")",
"{",
"// start parse the error stack string",
"var",
"lines",
"=",
"error",
".",
"stack",
".",
"split",
"(",
"\"\\n\"",
")",
".",
"slice",
"(",
"0",
",",
"-",
"1",
")",
";",
"var",
"stacktrace",
"=",
"[",
... | parse the stacktrace from firefox | [
"parse",
"the",
"stacktrace",
"from",
"firefox"
] | 248114fc31978b3c197fe227734d7da7381d4c4a | https://github.com/jeromeetienne/better.js/blob/248114fc31978b3c197fe227734d7da7381d4c4a/src/stacktrace.js#L108-L122 |
24,119 | jeromeetienne/better.js | src/stacktrace.js | _parserPhantomJS | function _parserPhantomJS(error){
// start parse the error stack string
var lines = error.stack.split("\n").slice(1);
var stacktrace = [];
lines.forEach(function(line){
if( line.match(/\(native\)$/) ){
var matches = line.match(/^\s*at (.+) \(native\)/);
stacktrace.push(new Stacktrace.Frame({
fct... | javascript | function _parserPhantomJS(error){
// start parse the error stack string
var lines = error.stack.split("\n").slice(1);
var stacktrace = [];
lines.forEach(function(line){
if( line.match(/\(native\)$/) ){
var matches = line.match(/^\s*at (.+) \(native\)/);
stacktrace.push(new Stacktrace.Frame({
fct... | [
"function",
"_parserPhantomJS",
"(",
"error",
")",
"{",
"// start parse the error stack string",
"var",
"lines",
"=",
"error",
".",
"stack",
".",
"split",
"(",
"\"\\n\"",
")",
".",
"slice",
"(",
"1",
")",
";",
"var",
"stacktrace",
"=",
"[",
"]",
";",
"line... | parse the stacktrace from phantomJS | [
"parse",
"the",
"stacktrace",
"from",
"phantomJS"
] | 248114fc31978b3c197fe227734d7da7381d4c4a | https://github.com/jeromeetienne/better.js/blob/248114fc31978b3c197fe227734d7da7381d4c4a/src/stacktrace.js#L127-L159 |
24,120 | jeromeetienne/better.js | src/strongtyping.js | typeToString | function typeToString(allowedType){
if( allowedType === Number ) return 'Number'
if( allowedType === String ) return 'String'
if( allowedType === Object ) return 'Object'
if( allowedType === undefined ) return 'undefined'
return allowedType.toString()
} | javascript | function typeToString(allowedType){
if( allowedType === Number ) return 'Number'
if( allowedType === String ) return 'String'
if( allowedType === Object ) return 'Object'
if( allowedType === undefined ) return 'undefined'
return allowedType.toString()
} | [
"function",
"typeToString",
"(",
"allowedType",
")",
"{",
"if",
"(",
"allowedType",
"===",
"Number",
")",
"return",
"'Number'",
"if",
"(",
"allowedType",
"===",
"String",
")",
"return",
"'String'",
"if",
"(",
"allowedType",
"===",
"Object",
")",
"return",
"'... | convert one allowed type to a string
@param {any} allowedType - the allowed type
@return {String} - the string for this type | [
"convert",
"one",
"allowed",
"type",
"to",
"a",
"string"
] | 248114fc31978b3c197fe227734d7da7381d4c4a | https://github.com/jeromeetienne/better.js/blob/248114fc31978b3c197fe227734d7da7381d4c4a/src/strongtyping.js#L217-L223 |
24,121 | videojs/font | lib/grunt.js | merge | function merge(target, source) {
// Check if font name is changed
if (source['font-name']) {
target['font-name'] = source['font-name'];
}
// Check if root dir is changed
if (source['root-dir']) {
target['root-dir'] = source['root-dir'];
}
// Check for icon changes
if (source.icons) {
for (... | javascript | function merge(target, source) {
// Check if font name is changed
if (source['font-name']) {
target['font-name'] = source['font-name'];
}
// Check if root dir is changed
if (source['root-dir']) {
target['root-dir'] = source['root-dir'];
}
// Check for icon changes
if (source.icons) {
for (... | [
"function",
"merge",
"(",
"target",
",",
"source",
")",
"{",
"// Check if font name is changed",
"if",
"(",
"source",
"[",
"'font-name'",
"]",
")",
"{",
"target",
"[",
"'font-name'",
"]",
"=",
"source",
"[",
"'font-name'",
"]",
";",
"}",
"// Check if root dir ... | Merge a `source` object to a `target` recursively | [
"Merge",
"a",
"source",
"object",
"to",
"a",
"target",
"recursively"
] | ec42c81be03f8a41f22f457eff10833e824c33b9 | https://github.com/videojs/font/blob/ec42c81be03f8a41f22f457eff10833e824c33b9/lib/grunt.js#L8-L37 |
24,122 | krampstudio/grunt-jsdoc | tasks/lib/exec.js | function(grunt, script, sources, params) {
var flag;
var cmd = script;
var args =[];
// Compute JSDoc options
for (flag in params) {
if (params.hasOwnProperty(flag)) {
if (params[flag] !== false) {
args.push('--' + flag);
... | javascript | function(grunt, script, sources, params) {
var flag;
var cmd = script;
var args =[];
// Compute JSDoc options
for (flag in params) {
if (params.hasOwnProperty(flag)) {
if (params[flag] !== false) {
args.push('--' + flag);
... | [
"function",
"(",
"grunt",
",",
"script",
",",
"sources",
",",
"params",
")",
"{",
"var",
"flag",
";",
"var",
"cmd",
"=",
"script",
";",
"var",
"args",
"=",
"[",
"]",
";",
"// Compute JSDoc options",
"for",
"(",
"flag",
"in",
"params",
")",
"{",
"if",... | Build and execute a child process using the spawn function
@param {Object} grunt - the grunt context
@param {String} script - the script to run
@param {Array} sources - the list of sources files
@param {Object} params - the list of cli flags
@return {ChildProcess} from the spawn | [
"Build",
"and",
"execute",
"a",
"child",
"process",
"using",
"the",
"spawn",
"function"
] | 7b4c6eb9db6ae207b18f1fdf37bc71d8c98c76da | https://github.com/krampstudio/grunt-jsdoc/blob/7b4c6eb9db6ae207b18f1fdf37bc71d8c98c76da/tasks/lib/exec.js#L17-L44 | |
24,123 | krampstudio/grunt-jsdoc | tasks/lib/exec.js | function(grunt) {
var i, binPath, paths;
var nodePath = process.env.NODE_PATH || '';
//check first the base path into the cwd
paths = [
__dirname + '/../../node_modules/.bin/jsdoc',
__dirname + '/../../node_modules/jsdoc/jsdoc.js',
__dirname + '/../..... | javascript | function(grunt) {
var i, binPath, paths;
var nodePath = process.env.NODE_PATH || '';
//check first the base path into the cwd
paths = [
__dirname + '/../../node_modules/.bin/jsdoc',
__dirname + '/../../node_modules/jsdoc/jsdoc.js',
__dirname + '/../..... | [
"function",
"(",
"grunt",
")",
"{",
"var",
"i",
",",
"binPath",
",",
"paths",
";",
"var",
"nodePath",
"=",
"process",
".",
"env",
".",
"NODE_PATH",
"||",
"''",
";",
"//check first the base path into the cwd",
"paths",
"=",
"[",
"__dirname",
"+",
"'/../../nod... | Lookup file or path into node modules
@param {Object} grunt - the grunt context
@returns {String} the first matching resolved path or nothing if not found | [
"Lookup",
"file",
"or",
"path",
"into",
"node",
"modules"
] | 7b4c6eb9db6ae207b18f1fdf37bc71d8c98c76da | https://github.com/krampstudio/grunt-jsdoc/blob/7b4c6eb9db6ae207b18f1fdf37bc71d8c98c76da/tasks/lib/exec.js#L51-L78 | |
24,124 | qlik-oss/leonardo-ui | docs/build.js | compileTemplates | function compileTemplates() {
const mainHtml = fs.readFileSync(path.resolve(docsDir, 'src/template.html'), {
encoding: 'utf8',
});
const mainTemplate = Handlebars.compile(mainHtml);
function createPage(fileName, tab, content) {
const html = mainTemplate({
tabs: [{
title: 'Get started',
... | javascript | function compileTemplates() {
const mainHtml = fs.readFileSync(path.resolve(docsDir, 'src/template.html'), {
encoding: 'utf8',
});
const mainTemplate = Handlebars.compile(mainHtml);
function createPage(fileName, tab, content) {
const html = mainTemplate({
tabs: [{
title: 'Get started',
... | [
"function",
"compileTemplates",
"(",
")",
"{",
"const",
"mainHtml",
"=",
"fs",
".",
"readFileSync",
"(",
"path",
".",
"resolve",
"(",
"docsDir",
",",
"'src/template.html'",
")",
",",
"{",
"encoding",
":",
"'utf8'",
",",
"}",
")",
";",
"const",
"mainTemplat... | Compile Handlebars templates | [
"Compile",
"Handlebars",
"templates"
] | b02bd30a9b951fb4fe949ff374327c2698afdb74 | https://github.com/qlik-oss/leonardo-ui/blob/b02bd30a9b951fb4fe949ff374327c2698afdb74/docs/build.js#L156-L243 |
24,125 | qlik-oss/leonardo-ui | docs/build.js | copyResources | function copyResources() {
// Source code deps
fileUtil.copyFile(path.resolve(docsDir, '../dist/leonardo-ui.js'), path.resolve(docsDir, 'dist/leonardo-ui/leonardo-ui.js'));
fileUtil.copyFile(path.resolve(docsDir, '../dist/leonardo-ui.js.map'), path.resolve(docsDir, 'dist/leonardo-ui/leonardo-ui.js.map'));
fileU... | javascript | function copyResources() {
// Source code deps
fileUtil.copyFile(path.resolve(docsDir, '../dist/leonardo-ui.js'), path.resolve(docsDir, 'dist/leonardo-ui/leonardo-ui.js'));
fileUtil.copyFile(path.resolve(docsDir, '../dist/leonardo-ui.js.map'), path.resolve(docsDir, 'dist/leonardo-ui/leonardo-ui.js.map'));
fileU... | [
"function",
"copyResources",
"(",
")",
"{",
"// Source code deps",
"fileUtil",
".",
"copyFile",
"(",
"path",
".",
"resolve",
"(",
"docsDir",
",",
"'../dist/leonardo-ui.js'",
")",
",",
"path",
".",
"resolve",
"(",
"docsDir",
",",
"'dist/leonardo-ui/leonardo-ui.js'",
... | Copy external libraries and images | [
"Copy",
"external",
"libraries",
"and",
"images"
] | b02bd30a9b951fb4fe949ff374327c2698afdb74 | https://github.com/qlik-oss/leonardo-ui/blob/b02bd30a9b951fb4fe949ff374327c2698afdb74/docs/build.js#L246-L261 |
24,126 | systemjs/builder | lib/utils.js | getCanonicalNamePlain | function getCanonicalNamePlain(loader, normalized, isPlugin) {
// now just reverse apply paths rules to get canonical name
var pathMatch;
// first check exact path matches
for (var p in loader.paths) {
if (loader.paths[p].indexOf('*') != -1)
continue;
var curPath = normalizePath(loader, loader.p... | javascript | function getCanonicalNamePlain(loader, normalized, isPlugin) {
// now just reverse apply paths rules to get canonical name
var pathMatch;
// first check exact path matches
for (var p in loader.paths) {
if (loader.paths[p].indexOf('*') != -1)
continue;
var curPath = normalizePath(loader, loader.p... | [
"function",
"getCanonicalNamePlain",
"(",
"loader",
",",
"normalized",
",",
"isPlugin",
")",
"{",
"// now just reverse apply paths rules to get canonical name",
"var",
"pathMatch",
";",
"// first check exact path matches",
"for",
"(",
"var",
"p",
"in",
"loader",
".",
"pat... | syntax-free getCanonicalName just reverse-applies paths and defulatJSExtension to determine the canonical | [
"syntax",
"-",
"free",
"getCanonicalName",
"just",
"reverse",
"-",
"applies",
"paths",
"and",
"defulatJSExtension",
"to",
"determine",
"the",
"canonical"
] | e874ec6a0bdea904016bc2831f5185f38fe6c539 | https://github.com/systemjs/builder/blob/e874ec6a0bdea904016bc2831f5185f38fe6c539/lib/utils.js#L175-L233 |
24,127 | systemjs/builder | lib/utils.js | createPkgConfigPathObj | function createPkgConfigPathObj(path) {
var lastWildcard = path.lastIndexOf('*');
var length = Math.max(lastWildcard + 1, path.lastIndexOf('/'));
return {
length: length,
regEx: new RegExp('^(' + path.substr(0, length).replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '[^\\/]+') + ')(\\/|$)'),
wild... | javascript | function createPkgConfigPathObj(path) {
var lastWildcard = path.lastIndexOf('*');
var length = Math.max(lastWildcard + 1, path.lastIndexOf('/'));
return {
length: length,
regEx: new RegExp('^(' + path.substr(0, length).replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '[^\\/]+') + ')(\\/|$)'),
wild... | [
"function",
"createPkgConfigPathObj",
"(",
"path",
")",
"{",
"var",
"lastWildcard",
"=",
"path",
".",
"lastIndexOf",
"(",
"'*'",
")",
";",
"var",
"length",
"=",
"Math",
".",
"max",
"(",
"lastWildcard",
"+",
"1",
",",
"path",
".",
"lastIndexOf",
"(",
"'/'... | data object for quick checks against package paths | [
"data",
"object",
"for",
"quick",
"checks",
"against",
"package",
"paths"
] | e874ec6a0bdea904016bc2831f5185f38fe6c539 | https://github.com/systemjs/builder/blob/e874ec6a0bdea904016bc2831f5185f38fe6c539/lib/utils.js#L242-L250 |
24,128 | systemjs/builder | lib/trace.js | booleanEnvTrace | function booleanEnvTrace(condition) {
var conditionObj = parseCondition(condition);
if (conditionObj.negate)
return traceCondition(conditionalComplement(condition), false);
else
return traceCondition(condition, true);
} | javascript | function booleanEnvTrace(condition) {
var conditionObj = parseCondition(condition);
if (conditionObj.negate)
return traceCondition(conditionalComplement(condition), false);
else
return traceCondition(condition, true);
} | [
"function",
"booleanEnvTrace",
"(",
"condition",
")",
"{",
"var",
"conditionObj",
"=",
"parseCondition",
"(",
"condition",
")",
";",
"if",
"(",
"conditionObj",
".",
"negate",
")",
"return",
"traceCondition",
"(",
"conditionalComplement",
"(",
"condition",
")",
"... | whether or not to include condition branch given our conditionalEnv | [
"whether",
"or",
"not",
"to",
"include",
"condition",
"branch",
"given",
"our",
"conditionalEnv"
] | e874ec6a0bdea904016bc2831f5185f38fe6c539 | https://github.com/systemjs/builder/blob/e874ec6a0bdea904016bc2831f5185f38fe6c539/lib/trace.js#L870-L877 |
24,129 | systemjs/builder | compilers/json.js | optimizePackageConfig | function optimizePackageConfig(json) {
if (json.systemjs)
json = json.systemjs;
// remove non SystemJS package config properties
var loaderConfigProperties = ['baseDir', 'defaultExtension', 'format', 'meta', 'map', 'main'];
for (var p in json)
if (loaderConfigProperties.indexOf(p) == -1)
delete j... | javascript | function optimizePackageConfig(json) {
if (json.systemjs)
json = json.systemjs;
// remove non SystemJS package config properties
var loaderConfigProperties = ['baseDir', 'defaultExtension', 'format', 'meta', 'map', 'main'];
for (var p in json)
if (loaderConfigProperties.indexOf(p) == -1)
delete j... | [
"function",
"optimizePackageConfig",
"(",
"json",
")",
"{",
"if",
"(",
"json",
".",
"systemjs",
")",
"json",
"=",
"json",
".",
"systemjs",
";",
"// remove non SystemJS package config properties",
"var",
"loaderConfigProperties",
"=",
"[",
"'baseDir'",
",",
"'default... | because bundles are for the browser only if this is a package config file json we are compiling then we can optimize out the node-only configurations to make it smaller | [
"because",
"bundles",
"are",
"for",
"the",
"browser",
"only",
"if",
"this",
"is",
"a",
"package",
"config",
"file",
"json",
"we",
"are",
"compiling",
"then",
"we",
"can",
"optimize",
"out",
"the",
"node",
"-",
"only",
"configurations",
"to",
"make",
"it",
... | e874ec6a0bdea904016bc2831f5185f38fe6c539 | https://github.com/systemjs/builder/blob/e874ec6a0bdea904016bc2831f5185f38fe6c539/compilers/json.js#L28-L60 |
24,130 | systemjs/builder | lib/compile.js | getCompileHash | function getCompileHash(load, compileOpts) {
return createHash('md5')
.update(JSON.stringify({
source: load.source,
metadata: load.metadata,
path: compileOpts.sourceMaps && load.path,
normalize: compileOpts.normalize,
anonymous: compileOpts.anonymous,
systemGlobal: compileOpts.systemGlobal,... | javascript | function getCompileHash(load, compileOpts) {
return createHash('md5')
.update(JSON.stringify({
source: load.source,
metadata: load.metadata,
path: compileOpts.sourceMaps && load.path,
normalize: compileOpts.normalize,
anonymous: compileOpts.anonymous,
systemGlobal: compileOpts.systemGlobal,... | [
"function",
"getCompileHash",
"(",
"load",
",",
"compileOpts",
")",
"{",
"return",
"createHash",
"(",
"'md5'",
")",
".",
"update",
"(",
"JSON",
".",
"stringify",
"(",
"{",
"source",
":",
"load",
".",
"source",
",",
"metadata",
":",
"load",
".",
"metadata... | create a compile hash based on path + source + metadata + compileOpts one implication here is that plugins shouldn't rely on System.x checks as these will not be cache-invalidated but within the bundle hook is fine | [
"create",
"a",
"compile",
"hash",
"based",
"on",
"path",
"+",
"source",
"+",
"metadata",
"+",
"compileOpts",
"one",
"implication",
"here",
"is",
"that",
"plugins",
"shouldn",
"t",
"rely",
"on",
"System",
".",
"x",
"checks",
"as",
"these",
"will",
"not",
... | e874ec6a0bdea904016bc2831f5185f38fe6c539 | https://github.com/systemjs/builder/blob/e874ec6a0bdea904016bc2831f5185f38fe6c539/lib/compile.js#L26-L42 |
24,131 | systemjs/builder | lib/compile.js | remapLoadRecord | function remapLoadRecord(load, mapFunction) {
load = extend({}, load);
load.name = mapFunction(load.name, load.name);
var depMap = {};
Object.keys(load.depMap).forEach(function(dep) {
depMap[dep] = mapFunction(load.depMap[dep], dep);
});
load.depMap = depMap;
return load;
} | javascript | function remapLoadRecord(load, mapFunction) {
load = extend({}, load);
load.name = mapFunction(load.name, load.name);
var depMap = {};
Object.keys(load.depMap).forEach(function(dep) {
depMap[dep] = mapFunction(load.depMap[dep], dep);
});
load.depMap = depMap;
return load;
} | [
"function",
"remapLoadRecord",
"(",
"load",
",",
"mapFunction",
")",
"{",
"load",
"=",
"extend",
"(",
"{",
"}",
",",
"load",
")",
";",
"load",
".",
"name",
"=",
"mapFunction",
"(",
"load",
".",
"name",
",",
"load",
".",
"name",
")",
";",
"var",
"de... | create a new load record with any necessary final mappings | [
"create",
"a",
"new",
"load",
"record",
"with",
"any",
"necessary",
"final",
"mappings"
] | e874ec6a0bdea904016bc2831f5185f38fe6c539 | https://github.com/systemjs/builder/blob/e874ec6a0bdea904016bc2831f5185f38fe6c539/lib/compile.js#L86-L95 |
24,132 | handsontable/ngHandsontable | dist/ngHandsontable.js | function(element, htSettings) {
var container = document.createElement('div'),
hot;
container.className = this.containerClassName;
if (htSettings.hotId) {
container.id = htSettings.hotId;
}
element[0].appendChild(container);
hot = new Handsontable(co... | javascript | function(element, htSettings) {
var container = document.createElement('div'),
hot;
container.className = this.containerClassName;
if (htSettings.hotId) {
container.id = htSettings.hotId;
}
element[0].appendChild(container);
hot = new Handsontable(co... | [
"function",
"(",
"element",
",",
"htSettings",
")",
"{",
"var",
"container",
"=",
"document",
".",
"createElement",
"(",
"'div'",
")",
",",
"hot",
";",
"container",
".",
"className",
"=",
"this",
".",
"containerClassName",
";",
"if",
"(",
"htSettings",
"."... | Append handsontable container div and initialize handsontable instance inside element.
@param {qLite} element
@param {Object} htSettings | [
"Append",
"handsontable",
"container",
"div",
"and",
"initialize",
"handsontable",
"instance",
"inside",
"element",
"."
] | c23f42ac1b937794ac93ded0a6392b55bbe4c16b | https://github.com/handsontable/ngHandsontable/blob/c23f42ac1b937794ac93ded0a6392b55bbe4c16b/dist/ngHandsontable.js#L130-L147 | |
24,133 | handsontable/ngHandsontable | dist/ngHandsontable.js | function(settings, scope) {
var
scopeOptions = angular.extend({}, scope),
htOptions, i, length;
settings = settings || {};
angular.extend(scopeOptions, scope.settings || {});
htOptions = this.getAvailableSettings();
for (i = 0, length = htOptions.length; i <... | javascript | function(settings, scope) {
var
scopeOptions = angular.extend({}, scope),
htOptions, i, length;
settings = settings || {};
angular.extend(scopeOptions, scope.settings || {});
htOptions = this.getAvailableSettings();
for (i = 0, length = htOptions.length; i <... | [
"function",
"(",
"settings",
",",
"scope",
")",
"{",
"var",
"scopeOptions",
"=",
"angular",
".",
"extend",
"(",
"{",
"}",
",",
"scope",
")",
",",
"htOptions",
",",
"i",
",",
"length",
";",
"settings",
"=",
"settings",
"||",
"{",
"}",
";",
"angular",
... | Merge original handsontable settings with setting defined in scope.
@param {Object} settings
@param {Object} scope
@returns {Object} | [
"Merge",
"original",
"handsontable",
"settings",
"with",
"setting",
"defined",
"in",
"scope",
"."
] | c23f42ac1b937794ac93ded0a6392b55bbe4c16b | https://github.com/handsontable/ngHandsontable/blob/c23f42ac1b937794ac93ded0a6392b55bbe4c16b/dist/ngHandsontable.js#L179-L195 | |
24,134 | handsontable/ngHandsontable | dist/ngHandsontable.js | function(settings, scope) {
var
scopeOptions = angular.extend({}, scope),
htHooks, i, length, attribute;
settings = settings || {};
angular.extend(scopeOptions, scope.settings || {});
htHooks = this.getAvailableHooks();
for (i = 0, length = htHooks.length; i... | javascript | function(settings, scope) {
var
scopeOptions = angular.extend({}, scope),
htHooks, i, length, attribute;
settings = settings || {};
angular.extend(scopeOptions, scope.settings || {});
htHooks = this.getAvailableHooks();
for (i = 0, length = htHooks.length; i... | [
"function",
"(",
"settings",
",",
"scope",
")",
"{",
"var",
"scopeOptions",
"=",
"angular",
".",
"extend",
"(",
"{",
"}",
",",
"scope",
")",
",",
"htHooks",
",",
"i",
",",
"length",
",",
"attribute",
";",
"settings",
"=",
"settings",
"||",
"{",
"}",
... | Merge original handsontable hooks with hooks defined in scope.
@param {Object} settings
@param {Object} scope
@returns {Object} | [
"Merge",
"original",
"handsontable",
"hooks",
"with",
"hooks",
"defined",
"in",
"scope",
"."
] | c23f42ac1b937794ac93ded0a6392b55bbe4c16b | https://github.com/handsontable/ngHandsontable/blob/c23f42ac1b937794ac93ded0a6392b55bbe4c16b/dist/ngHandsontable.js#L204-L222 | |
24,135 | handsontable/ngHandsontable | dist/ngHandsontable.js | function(scopeDefinition, attrs) {
for (var i in scopeDefinition) {
if (scopeDefinition.hasOwnProperty(i) && attrs[i] === void 0 &&
attrs[scopeDefinition[i].substr(1, scopeDefinition[i].length)] === void 0) {
delete scopeDefinition[i];
}
}
return sc... | javascript | function(scopeDefinition, attrs) {
for (var i in scopeDefinition) {
if (scopeDefinition.hasOwnProperty(i) && attrs[i] === void 0 &&
attrs[scopeDefinition[i].substr(1, scopeDefinition[i].length)] === void 0) {
delete scopeDefinition[i];
}
}
return sc... | [
"function",
"(",
"scopeDefinition",
",",
"attrs",
")",
"{",
"for",
"(",
"var",
"i",
"in",
"scopeDefinition",
")",
"{",
"if",
"(",
"scopeDefinition",
".",
"hasOwnProperty",
"(",
"i",
")",
"&&",
"attrs",
"[",
"i",
"]",
"===",
"void",
"0",
"&&",
"attrs",
... | Trim scope definition according to attrs object from directive.
@param {Object} scopeDefinition
@param {Object} attrs
@returns {Object} | [
"Trim",
"scope",
"definition",
"according",
"to",
"attrs",
"object",
"from",
"directive",
"."
] | c23f42ac1b937794ac93ded0a6392b55bbe4c16b | https://github.com/handsontable/ngHandsontable/blob/c23f42ac1b937794ac93ded0a6392b55bbe4c16b/dist/ngHandsontable.js#L231-L240 | |
24,136 | handsontable/ngHandsontable | dist/ngHandsontable.js | function() {
var scopeDefinition = {};
this.applyAvailableSettingsScopeDef(scopeDefinition);
this.applyAvailableHooksScopeDef(scopeDefinition);
scopeDefinition.datarows = '=';
scopeDefinition.dataschema = '=';
scopeDefinition.observeDomVisibility = '=';
//scopeD... | javascript | function() {
var scopeDefinition = {};
this.applyAvailableSettingsScopeDef(scopeDefinition);
this.applyAvailableHooksScopeDef(scopeDefinition);
scopeDefinition.datarows = '=';
scopeDefinition.dataschema = '=';
scopeDefinition.observeDomVisibility = '=';
//scopeD... | [
"function",
"(",
")",
"{",
"var",
"scopeDefinition",
"=",
"{",
"}",
";",
"this",
".",
"applyAvailableSettingsScopeDef",
"(",
"scopeDefinition",
")",
";",
"this",
".",
"applyAvailableHooksScopeDef",
"(",
"scopeDefinition",
")",
";",
"scopeDefinition",
".",
"datarow... | Get isolate scope definition for main handsontable directive.
@return {Object} | [
"Get",
"isolate",
"scope",
"definition",
"for",
"main",
"handsontable",
"directive",
"."
] | c23f42ac1b937794ac93ded0a6392b55bbe4c16b | https://github.com/handsontable/ngHandsontable/blob/c23f42ac1b937794ac93ded0a6392b55bbe4c16b/dist/ngHandsontable.js#L247-L259 | |
24,137 | handsontable/ngHandsontable | dist/ngHandsontable.js | function(scopeDefinition) {
var options, i, length;
options = this.getAvailableSettings();
for (i = 0, length = options.length; i < length; i++) {
scopeDefinition[options[i]] = '=';
}
return scopeDefinition;
} | javascript | function(scopeDefinition) {
var options, i, length;
options = this.getAvailableSettings();
for (i = 0, length = options.length; i < length; i++) {
scopeDefinition[options[i]] = '=';
}
return scopeDefinition;
} | [
"function",
"(",
"scopeDefinition",
")",
"{",
"var",
"options",
",",
"i",
",",
"length",
";",
"options",
"=",
"this",
".",
"getAvailableSettings",
"(",
")",
";",
"for",
"(",
"i",
"=",
"0",
",",
"length",
"=",
"options",
".",
"length",
";",
"i",
"<",
... | Apply all available handsontable settings into object which represents scope definition.
@param {Object} [scopeDefinition]
@returns {Object} | [
"Apply",
"all",
"available",
"handsontable",
"settings",
"into",
"object",
"which",
"represents",
"scope",
"definition",
"."
] | c23f42ac1b937794ac93ded0a6392b55bbe4c16b | https://github.com/handsontable/ngHandsontable/blob/c23f42ac1b937794ac93ded0a6392b55bbe4c16b/dist/ngHandsontable.js#L281-L291 | |
24,138 | handsontable/ngHandsontable | dist/ngHandsontable.js | function(scopeDefinition) {
var options, i, length;
options = this.getAvailableHooks();
for (i = 0, length = options.length; i < length; i++) {
scopeDefinition[options[i]] = '=on' + ucFirst(options[i]);
}
return scopeDefinition;
} | javascript | function(scopeDefinition) {
var options, i, length;
options = this.getAvailableHooks();
for (i = 0, length = options.length; i < length; i++) {
scopeDefinition[options[i]] = '=on' + ucFirst(options[i]);
}
return scopeDefinition;
} | [
"function",
"(",
"scopeDefinition",
")",
"{",
"var",
"options",
",",
"i",
",",
"length",
";",
"options",
"=",
"this",
".",
"getAvailableHooks",
"(",
")",
";",
"for",
"(",
"i",
"=",
"0",
",",
"length",
"=",
"options",
".",
"length",
";",
"i",
"<",
"... | Apply all available handsontable hooks into object which represents scope definition.
@param {Object} [scopeDefinition]
@returns {Object} | [
"Apply",
"all",
"available",
"handsontable",
"hooks",
"into",
"object",
"which",
"represents",
"scope",
"definition",
"."
] | c23f42ac1b937794ac93ded0a6392b55bbe4c16b | https://github.com/handsontable/ngHandsontable/blob/c23f42ac1b937794ac93ded0a6392b55bbe4c16b/dist/ngHandsontable.js#L299-L309 | |
24,139 | handsontable/ngHandsontable | dist/ngHandsontable.js | function(hyphenateStyle) {
var settings = Object.keys(Handsontable.DefaultSettings.prototype);
if (settings.indexOf('contextMenuCopyPaste') === -1) {
settings.push('contextMenuCopyPaste');
}
if (settings.indexOf('handsontable') === -1) {
settings.push('handsontable')... | javascript | function(hyphenateStyle) {
var settings = Object.keys(Handsontable.DefaultSettings.prototype);
if (settings.indexOf('contextMenuCopyPaste') === -1) {
settings.push('contextMenuCopyPaste');
}
if (settings.indexOf('handsontable') === -1) {
settings.push('handsontable')... | [
"function",
"(",
"hyphenateStyle",
")",
"{",
"var",
"settings",
"=",
"Object",
".",
"keys",
"(",
"Handsontable",
".",
"DefaultSettings",
".",
"prototype",
")",
";",
"if",
"(",
"settings",
".",
"indexOf",
"(",
"'contextMenuCopyPaste'",
")",
"===",
"-",
"1",
... | Get all available settings from handsontable, returns settings by default in camelCase mode.
@param {Boolean} [hyphenateStyle=undefined] If `true` then returns options in hyphenate mode (eq. row-header)
@returns {Array} | [
"Get",
"all",
"available",
"settings",
"from",
"handsontable",
"returns",
"settings",
"by",
"default",
"in",
"camelCase",
"mode",
"."
] | c23f42ac1b937794ac93ded0a6392b55bbe4c16b | https://github.com/handsontable/ngHandsontable/blob/c23f42ac1b937794ac93ded0a6392b55bbe4c16b/dist/ngHandsontable.js#L317-L334 | |
24,140 | handsontable/ngHandsontable | dist/ngHandsontable.js | function(hyphenateStyle) {
var settings = Handsontable.hooks.getRegistered();
if (hyphenateStyle) {
settings = settings.map(function(hook) {
return 'on-' + hyphenate(hook);
});
}
return settings;
} | javascript | function(hyphenateStyle) {
var settings = Handsontable.hooks.getRegistered();
if (hyphenateStyle) {
settings = settings.map(function(hook) {
return 'on-' + hyphenate(hook);
});
}
return settings;
} | [
"function",
"(",
"hyphenateStyle",
")",
"{",
"var",
"settings",
"=",
"Handsontable",
".",
"hooks",
".",
"getRegistered",
"(",
")",
";",
"if",
"(",
"hyphenateStyle",
")",
"{",
"settings",
"=",
"settings",
".",
"map",
"(",
"function",
"(",
"hook",
")",
"{"... | Get all available hooks from handsontable, returns hooks by default in camelCase mode.
@param {Boolean} [hyphenateStyle=undefined] If `true` then returns hooks in hyphenate mode (eq. on-after-init)
@returns {Array} | [
"Get",
"all",
"available",
"hooks",
"from",
"handsontable",
"returns",
"hooks",
"by",
"default",
"in",
"camelCase",
"mode",
"."
] | c23f42ac1b937794ac93ded0a6392b55bbe4c16b | https://github.com/handsontable/ngHandsontable/blob/c23f42ac1b937794ac93ded0a6392b55bbe4c16b/dist/ngHandsontable.js#L342-L352 | |
24,141 | QuickBlox/quickblox-javascript-sdk | samples/video_conferencing/js/video/ui_helpers.js | autoClosePopups | function autoClosePopups(clear) {
if (clear) {
clearTimeout(modalTimerID);
modalTimerID = undefined;
} else {
modalTimerID = setTimeout(function() {
bootbox.hideAll();
}, 30000);
}
} | javascript | function autoClosePopups(clear) {
if (clear) {
clearTimeout(modalTimerID);
modalTimerID = undefined;
} else {
modalTimerID = setTimeout(function() {
bootbox.hideAll();
}, 30000);
}
} | [
"function",
"autoClosePopups",
"(",
"clear",
")",
"{",
"if",
"(",
"clear",
")",
"{",
"clearTimeout",
"(",
"modalTimerID",
")",
";",
"modalTimerID",
"=",
"undefined",
";",
"}",
"else",
"{",
"modalTimerID",
"=",
"setTimeout",
"(",
"function",
"(",
")",
"{",
... | modal's timer | [
"modal",
"s",
"timer"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/video_conferencing/js/video/ui_helpers.js#L368-L377 |
24,142 | QuickBlox/quickblox-javascript-sdk | samples/cordova/text_chat/www/js/ui_helpers.js | buildUserHtml | function buildUserHtml(userLogin, userId, isNew) {
var userHtml = "<a href='#' id='" + userId;
if(isNew){
userHtml += "_new'";
}else{
userHtml += "'";
}
userHtml += " class='col-md-12 col-sm-12 col-xs-12 users_form' onclick='";
userHtml += "clickToAdd";
userHtml += "(\"";
userHtml += userId;
i... | javascript | function buildUserHtml(userLogin, userId, isNew) {
var userHtml = "<a href='#' id='" + userId;
if(isNew){
userHtml += "_new'";
}else{
userHtml += "'";
}
userHtml += " class='col-md-12 col-sm-12 col-xs-12 users_form' onclick='";
userHtml += "clickToAdd";
userHtml += "(\"";
userHtml += userId;
i... | [
"function",
"buildUserHtml",
"(",
"userLogin",
",",
"userId",
",",
"isNew",
")",
"{",
"var",
"userHtml",
"=",
"\"<a href='#' id='\"",
"+",
"userId",
";",
"if",
"(",
"isNew",
")",
"{",
"userHtml",
"+=",
"\"_new'\"",
";",
"}",
"else",
"{",
"userHtml",
"+=",
... | build html for users list | [
"build",
"html",
"for",
"users",
"list"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/cordova/text_chat/www/js/ui_helpers.js#L76-L95 |
24,143 | QuickBlox/quickblox-javascript-sdk | samples/cordova/video_chat/platforms/ios/cordova/lib/prepare.js | cleanLaunchStoryboardImages | function cleanLaunchStoryboardImages(projectRoot, projectConfig, locations) {
var splashScreens = projectConfig.getSplashScreens('ios');
var platformProjDir = locations.xcodeCordovaProj;
var launchStoryboardImagesDir = getLaunchStoryboardImagesDir(projectRoot, platformProjDir);
if (launchStoryboardImage... | javascript | function cleanLaunchStoryboardImages(projectRoot, projectConfig, locations) {
var splashScreens = projectConfig.getSplashScreens('ios');
var platformProjDir = locations.xcodeCordovaProj;
var launchStoryboardImagesDir = getLaunchStoryboardImagesDir(projectRoot, platformProjDir);
if (launchStoryboardImage... | [
"function",
"cleanLaunchStoryboardImages",
"(",
"projectRoot",
",",
"projectConfig",
",",
"locations",
")",
"{",
"var",
"splashScreens",
"=",
"projectConfig",
".",
"getSplashScreens",
"(",
"'ios'",
")",
";",
"var",
"platformProjDir",
"=",
"locations",
".",
"xcodeCor... | Removes the images from the launch storyboard's image set and updates the image set's contents.json
file appropriately.
@param {string} projectRoot Path to the project root
@param {Object} projectConfig The project's config.xml
@param {Object} locations A dictionary containing useful location p... | [
"Removes",
"the",
"images",
"from",
"the",
"launch",
"storyboard",
"s",
"image",
"set",
"and",
"updates",
"the",
"image",
"set",
"s",
"contents",
".",
"json",
"file",
"appropriately",
"."
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/cordova/video_chat/platforms/ios/cordova/lib/prepare.js#L713-L739 |
24,144 | QuickBlox/quickblox-javascript-sdk | src/modules/chat/qbChat.js | function(callback, isInitialConnect) {
Utils.QBLog('[QBChat]', 'Status.CONNECTED at ' + chatUtils.getLocalTime());
var self = this,
xmppClient = Utils.getEnv().browser ? self.connection : self.Client,
presence = Utils.getEnv().browser ? $pres() : chatUtils.createStanza(XMPP.Stan... | javascript | function(callback, isInitialConnect) {
Utils.QBLog('[QBChat]', 'Status.CONNECTED at ' + chatUtils.getLocalTime());
var self = this,
xmppClient = Utils.getEnv().browser ? self.connection : self.Client,
presence = Utils.getEnv().browser ? $pres() : chatUtils.createStanza(XMPP.Stan... | [
"function",
"(",
"callback",
",",
"isInitialConnect",
")",
"{",
"Utils",
".",
"QBLog",
"(",
"'[QBChat]'",
",",
"'Status.CONNECTED at '",
"+",
"chatUtils",
".",
"getLocalTime",
"(",
")",
")",
";",
"var",
"self",
"=",
"this",
",",
"xmppClient",
"=",
"Utils",
... | Actions after the connection is established
- enable stream management (the configuration setting);
- save user's JID;
- enable carbons;
- get and storage the user's roster (if the initial connect);
- recover the joined rooms and fire 'onReconnectListener' (if the reconnect);
- send initial presence to the chat server... | [
"Actions",
"after",
"the",
"connection",
"is",
"established"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/src/modules/chat/qbChat.js#L872-L913 | |
24,145 | QuickBlox/quickblox-javascript-sdk | src/modules/chat/qbChat.js | function(listWithUpdates, callback) {
/**
* Callback for QB.chat.privacylist.update().
* @param {Object} error - The error object
* @param {Object} response - The privacy list object
* @callback updatePrivacylistCallback
* */
var self = this;
self.g... | javascript | function(listWithUpdates, callback) {
/**
* Callback for QB.chat.privacylist.update().
* @param {Object} error - The error object
* @param {Object} response - The privacy list object
* @callback updatePrivacylistCallback
* */
var self = this;
self.g... | [
"function",
"(",
"listWithUpdates",
",",
"callback",
")",
"{",
"/**\n * Callback for QB.chat.privacylist.update().\n * @param {Object} error - The error object\n * @param {Object} response - The privacy list object\n * @callback updatePrivacylistCallback\n * */"... | Update the privacy list.
@memberof QB.chat.privacylist
@param {String} name - The name of the list.
@param {updatePrivacylistCallback} callback - The callback function. | [
"Update",
"the",
"privacy",
"list",
"."
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/src/modules/chat/qbChat.js#L2008-L2035 | |
24,146 | QuickBlox/quickblox-javascript-sdk | src/modules/chat/qbChat.js | function(jid_or_user_id) {
var jid;
if (typeof jid_or_user_id === 'string') {
jid = jid_or_user_id;
} else if (typeof jid_or_user_id === 'number') {
jid = jid_or_user_id + '-' + config.creds.appId + '@' + config.endpoints.chat;
} else {
throw new Error... | javascript | function(jid_or_user_id) {
var jid;
if (typeof jid_or_user_id === 'string') {
jid = jid_or_user_id;
} else if (typeof jid_or_user_id === 'number') {
jid = jid_or_user_id + '-' + config.creds.appId + '@' + config.endpoints.chat;
} else {
throw new Error... | [
"function",
"(",
"jid_or_user_id",
")",
"{",
"var",
"jid",
";",
"if",
"(",
"typeof",
"jid_or_user_id",
"===",
"'string'",
")",
"{",
"jid",
"=",
"jid_or_user_id",
";",
"}",
"else",
"if",
"(",
"typeof",
"jid_or_user_id",
"===",
"'number'",
")",
"{",
"jid",
... | Get unique id.
@memberof QB.chat.helpers
@param {String | Number} jid_or_user_id - Jid or user id.
@returns {String} - jid. | [
"Get",
"unique",
"id",
"."
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/src/modules/chat/qbChat.js#L2270-L2280 | |
24,147 | QuickBlox/quickblox-javascript-sdk | src/modules/chat/qbChat.js | function(jid_or_user_id) {
var chatType;
if (typeof jid_or_user_id === 'string') {
chatType = jid_or_user_id.indexOf("muc") > -1 ? 'groupchat' : 'chat';
} else if (typeof jid_or_user_id === 'number') {
chatType = 'chat';
} else {
throw new Error(unsupp... | javascript | function(jid_or_user_id) {
var chatType;
if (typeof jid_or_user_id === 'string') {
chatType = jid_or_user_id.indexOf("muc") > -1 ? 'groupchat' : 'chat';
} else if (typeof jid_or_user_id === 'number') {
chatType = 'chat';
} else {
throw new Error(unsupp... | [
"function",
"(",
"jid_or_user_id",
")",
"{",
"var",
"chatType",
";",
"if",
"(",
"typeof",
"jid_or_user_id",
"===",
"'string'",
")",
"{",
"chatType",
"=",
"jid_or_user_id",
".",
"indexOf",
"(",
"\"muc\"",
")",
">",
"-",
"1",
"?",
"'groupchat'",
":",
"'chat'... | Get the chat type.
@memberof QB.chat.helpers
@param {String | Number} jid_or_user_id - Jid or user id.
@returns {String} - jid. | [
"Get",
"the",
"chat",
"type",
"."
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/src/modules/chat/qbChat.js#L2288-L2298 | |
24,148 | QuickBlox/quickblox-javascript-sdk | src/modules/chat/qbChat.js | function(occupantsIds, UserId) {
var recipient = null;
occupantsIds.forEach(function(item) {
if(item != UserId){
recipient = item;
}
});
return recipient;
} | javascript | function(occupantsIds, UserId) {
var recipient = null;
occupantsIds.forEach(function(item) {
if(item != UserId){
recipient = item;
}
});
return recipient;
} | [
"function",
"(",
"occupantsIds",
",",
"UserId",
")",
"{",
"var",
"recipient",
"=",
"null",
";",
"occupantsIds",
".",
"forEach",
"(",
"function",
"(",
"item",
")",
"{",
"if",
"(",
"item",
"!=",
"UserId",
")",
"{",
"recipient",
"=",
"item",
";",
"}",
"... | Get the recipint id.
@memberof QB.chat.helpers
@param {Array} occupantsIds - Array of user ids.
@param {Number} UserId - Jid or user id.
@returns {Number} recipient - recipient id. | [
"Get",
"the",
"recipint",
"id",
"."
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/src/modules/chat/qbChat.js#L2307-L2315 | |
24,149 | QuickBlox/quickblox-javascript-sdk | src/modules/chat/qbChat.js | function(userId, appId) {
if(!appId){
return userId + '-' + config.creds.appId + '@' + config.endpoints.chat;
}
return userId + '-' + appId + '@' + config.endpoints.chat;
} | javascript | function(userId, appId) {
if(!appId){
return userId + '-' + config.creds.appId + '@' + config.endpoints.chat;
}
return userId + '-' + appId + '@' + config.endpoints.chat;
} | [
"function",
"(",
"userId",
",",
"appId",
")",
"{",
"if",
"(",
"!",
"appId",
")",
"{",
"return",
"userId",
"+",
"'-'",
"+",
"config",
".",
"creds",
".",
"appId",
"+",
"'@'",
"+",
"config",
".",
"endpoints",
".",
"chat",
";",
"}",
"return",
"userId",... | Get the User jid id.
@memberof QB.chat.helpers
@param {Number} UserId - The user id.
@param {Number} appId - The application id.
@returns {String} jid - The user jid. | [
"Get",
"the",
"User",
"jid",
"id",
"."
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/src/modules/chat/qbChat.js#L2324-L2329 | |
24,150 | QuickBlox/quickblox-javascript-sdk | src/modules/chat/qbChat.js | function(jid) {
var s = jid.split('/');
if (s.length < 2) return null;
s.splice(0, 1);
return parseInt(s.join('/'));
} | javascript | function(jid) {
var s = jid.split('/');
if (s.length < 2) return null;
s.splice(0, 1);
return parseInt(s.join('/'));
} | [
"function",
"(",
"jid",
")",
"{",
"var",
"s",
"=",
"jid",
".",
"split",
"(",
"'/'",
")",
";",
"if",
"(",
"s",
".",
"length",
"<",
"2",
")",
"return",
"null",
";",
"s",
".",
"splice",
"(",
"0",
",",
"1",
")",
";",
"return",
"parseInt",
"(",
... | Get user id from dialog's full jid.
@memberof QB.chat.helpers
@param {String} jid - dialog's full jid.
@returns {String} user_id - User Id. | [
"Get",
"user",
"id",
"from",
"dialog",
"s",
"full",
"jid",
"."
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/src/modules/chat/qbChat.js#L2389-L2394 | |
24,151 | QuickBlox/quickblox-javascript-sdk | src/modules/chat/qbChat.js | function(jid) {
var arrayElements = jid.toString().split('/');
if(arrayElements.length === 0){
return null;
}
return arrayElements[arrayElements.length-1];
} | javascript | function(jid) {
var arrayElements = jid.toString().split('/');
if(arrayElements.length === 0){
return null;
}
return arrayElements[arrayElements.length-1];
} | [
"function",
"(",
"jid",
")",
"{",
"var",
"arrayElements",
"=",
"jid",
".",
"toString",
"(",
")",
".",
"split",
"(",
"'/'",
")",
";",
"if",
"(",
"arrayElements",
".",
"length",
"===",
"0",
")",
"{",
"return",
"null",
";",
"}",
"return",
"arrayElements... | Get the user id from the room jid.
@memberof QB.chat.helpers
@param {String} jid - resourse jid.
@returns {String} userId - The user id. | [
"Get",
"the",
"user",
"id",
"from",
"the",
"room",
"jid",
"."
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/src/modules/chat/qbChat.js#L2423-L2429 | |
24,152 | QuickBlox/quickblox-javascript-sdk | samples/cordova/video_chat/platforms/ios/cordova/lib/run.js | filterSupportedArgs | function filterSupportedArgs(args) {
var filtered = [];
var sargs = ['--device', '--emulator', '--nobuild', '--list', '--target', '--debug', '--release'];
var re = new RegExp(sargs.join('|'));
args.forEach(function(element) {
// supported args not found, we add
/... | javascript | function filterSupportedArgs(args) {
var filtered = [];
var sargs = ['--device', '--emulator', '--nobuild', '--list', '--target', '--debug', '--release'];
var re = new RegExp(sargs.join('|'));
args.forEach(function(element) {
// supported args not found, we add
/... | [
"function",
"filterSupportedArgs",
"(",
"args",
")",
"{",
"var",
"filtered",
"=",
"[",
"]",
";",
"var",
"sargs",
"=",
"[",
"'--device'",
",",
"'--emulator'",
",",
"'--nobuild'",
",",
"'--list'",
",",
"'--target'",
",",
"'--debug'",
",",
"'--release'",
"]",
... | Filters the args array and removes supported args for the 'run' command.
@return {Array} array with unsupported args for the 'run' command | [
"Filters",
"the",
"args",
"array",
"and",
"removes",
"supported",
"args",
"for",
"the",
"run",
"command",
"."
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/cordova/video_chat/platforms/ios/cordova/lib/run.js#L98-L112 |
24,153 | QuickBlox/quickblox-javascript-sdk | samples/video_conferencing/js/messages.js | clickSendMessage | function clickSendMessage() {
var currentText = $('#message_text').val().trim();
if (!currentText.length) {
return;
}
$('#message_text').val('').focus();
sendMessage(currentText, null);
} | javascript | function clickSendMessage() {
var currentText = $('#message_text').val().trim();
if (!currentText.length) {
return;
}
$('#message_text').val('').focus();
sendMessage(currentText, null);
} | [
"function",
"clickSendMessage",
"(",
")",
"{",
"var",
"currentText",
"=",
"$",
"(",
"'#message_text'",
")",
".",
"val",
"(",
")",
".",
"trim",
"(",
")",
";",
"if",
"(",
"!",
"currentText",
".",
"length",
")",
"{",
"return",
";",
"}",
"$",
"(",
"'#m... | sending messages after confirmation | [
"sending",
"messages",
"after",
"confirmation"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/video_conferencing/js/messages.js#L179-L189 |
24,154 | QuickBlox/quickblox-javascript-sdk | samples/video_conferencing/js/messages.js | showMessage | function showMessage(userId, msg, attachmentFileId) {
var userLogin = getUserLoginById(userId);
var messageHtml = buildMessageHTML(msg.body, userLogin, new Date(), attachmentFileId, msg.id);
$('#messages-list').append(messageHtml);
// scroll to bottom
var mydiv = $('#messages-list');
mydiv.scr... | javascript | function showMessage(userId, msg, attachmentFileId) {
var userLogin = getUserLoginById(userId);
var messageHtml = buildMessageHTML(msg.body, userLogin, new Date(), attachmentFileId, msg.id);
$('#messages-list').append(messageHtml);
// scroll to bottom
var mydiv = $('#messages-list');
mydiv.scr... | [
"function",
"showMessage",
"(",
"userId",
",",
"msg",
",",
"attachmentFileId",
")",
"{",
"var",
"userLogin",
"=",
"getUserLoginById",
"(",
"userId",
")",
";",
"var",
"messageHtml",
"=",
"buildMessageHTML",
"(",
"msg",
".",
"body",
",",
"userLogin",
",",
"new... | show messages in UI | [
"show",
"messages",
"in",
"UI"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/video_conferencing/js/messages.js#L255-L264 |
24,155 | QuickBlox/quickblox-javascript-sdk | samples/video_conferencing/js/messages.js | sendTypingStatus | function sendTypingStatus() {
if (currentDialog.type == 3) {
QB.chat.sendIsTypingStatus(opponentId);
} else if (currentDialog && currentDialog.xmpp_room_jid) {
QB.chat.sendIsTypingStatus(currentDialog.xmpp_room_jid);
}
} | javascript | function sendTypingStatus() {
if (currentDialog.type == 3) {
QB.chat.sendIsTypingStatus(opponentId);
} else if (currentDialog && currentDialog.xmpp_room_jid) {
QB.chat.sendIsTypingStatus(currentDialog.xmpp_room_jid);
}
} | [
"function",
"sendTypingStatus",
"(",
")",
"{",
"if",
"(",
"currentDialog",
".",
"type",
"==",
"3",
")",
"{",
"QB",
".",
"chat",
".",
"sendIsTypingStatus",
"(",
"opponentId",
")",
";",
"}",
"else",
"if",
"(",
"currentDialog",
"&&",
"currentDialog",
".",
"... | send 'is typing' status | [
"send",
"is",
"typing",
"status"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/video_conferencing/js/messages.js#L311-L317 |
24,156 | QuickBlox/quickblox-javascript-sdk | samples/video_conferencing/js/messages.js | sendStopTypinStatus | function sendStopTypinStatus() {
if (currentDialog.type == 3) {
QB.chat.sendIsStopTypingStatus(opponentId);
} else {
QB.chat.sendIsStopTypingStatus(currentDialog.xmpp_room_jid);
}
} | javascript | function sendStopTypinStatus() {
if (currentDialog.type == 3) {
QB.chat.sendIsStopTypingStatus(opponentId);
} else {
QB.chat.sendIsStopTypingStatus(currentDialog.xmpp_room_jid);
}
} | [
"function",
"sendStopTypinStatus",
"(",
")",
"{",
"if",
"(",
"currentDialog",
".",
"type",
"==",
"3",
")",
"{",
"QB",
".",
"chat",
".",
"sendIsStopTypingStatus",
"(",
"opponentId",
")",
";",
"}",
"else",
"{",
"QB",
".",
"chat",
".",
"sendIsStopTypingStatus... | send 'stop typing' status | [
"send",
"stop",
"typing",
"status"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/video_conferencing/js/messages.js#L320-L326 |
24,157 | QuickBlox/quickblox-javascript-sdk | samples/video_conferencing/js/messages.js | showUserIsTypingView | function showUserIsTypingView(isTyping, userId, dialogId) {
if (isMessageForCurrentDialog(userId, dialogId)) {
if (!isTyping) {
$('#' + userId + '_typing').remove();
} else if (userId != currentUser.id) {
var userLogin = getUserLoginById(userId);
var typingUserHt... | javascript | function showUserIsTypingView(isTyping, userId, dialogId) {
if (isMessageForCurrentDialog(userId, dialogId)) {
if (!isTyping) {
$('#' + userId + '_typing').remove();
} else if (userId != currentUser.id) {
var userLogin = getUserLoginById(userId);
var typingUserHt... | [
"function",
"showUserIsTypingView",
"(",
"isTyping",
",",
"userId",
",",
"dialogId",
")",
"{",
"if",
"(",
"isMessageForCurrentDialog",
"(",
"userId",
",",
"dialogId",
")",
")",
"{",
"if",
"(",
"!",
"isTyping",
")",
"{",
"$",
"(",
"'#'",
"+",
"userId",
"+... | show or hide typing status to other users | [
"show",
"or",
"hide",
"typing",
"status",
"to",
"other",
"users"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/video_conferencing/js/messages.js#L329-L344 |
24,158 | QuickBlox/quickblox-javascript-sdk | samples/video_conferencing/js/messages.js | isMessageForCurrentDialog | function isMessageForCurrentDialog(userId, dialogId) {
var result = false;
if (dialogId == currentDialog._id || (dialogId === null && currentDialog.type == 3 && opponentId == userId)) {
result = true;
}
return result;
} | javascript | function isMessageForCurrentDialog(userId, dialogId) {
var result = false;
if (dialogId == currentDialog._id || (dialogId === null && currentDialog.type == 3 && opponentId == userId)) {
result = true;
}
return result;
} | [
"function",
"isMessageForCurrentDialog",
"(",
"userId",
",",
"dialogId",
")",
"{",
"var",
"result",
"=",
"false",
";",
"if",
"(",
"dialogId",
"==",
"currentDialog",
".",
"_id",
"||",
"(",
"dialogId",
"===",
"null",
"&&",
"currentDialog",
".",
"type",
"==",
... | filter for current dialog | [
"filter",
"for",
"current",
"dialog"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/video_conferencing/js/messages.js#L347-L353 |
24,159 | QuickBlox/quickblox-javascript-sdk | samples/cordova/video_chat/platforms/ios/cordova/lib/check_reqs.js | checkTool | function checkTool (tool, minVersion, message, toolFriendlyName) {
toolFriendlyName = toolFriendlyName || tool;
// Check whether tool command is available at all
var tool_command = shell.which(tool);
if (!tool_command) {
return Q.reject(toolFriendlyName + ' was not found. ' + (message || ''));
... | javascript | function checkTool (tool, minVersion, message, toolFriendlyName) {
toolFriendlyName = toolFriendlyName || tool;
// Check whether tool command is available at all
var tool_command = shell.which(tool);
if (!tool_command) {
return Q.reject(toolFriendlyName + ' was not found. ' + (message || ''));
... | [
"function",
"checkTool",
"(",
"tool",
",",
"minVersion",
",",
"message",
",",
"toolFriendlyName",
")",
"{",
"toolFriendlyName",
"=",
"toolFriendlyName",
"||",
"tool",
";",
"// Check whether tool command is available at all",
"var",
"tool_command",
"=",
"shell",
".",
"... | Checks if specific tool is available.
@param {String} tool Tool name to check. Known tools are 'xcodebuild' and 'ios-deploy'
@param {Number} minVersion Min allowed tool version.
@param {String} message Message that will be used to reject promise.
@param {String} toolFriendlyName Friendly name of the tool,... | [
"Checks",
"if",
"specific",
"tool",
"is",
"available",
"."
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/cordova/video_chat/platforms/ios/cordova/lib/check_reqs.js#L128-L144 |
24,160 | QuickBlox/quickblox-javascript-sdk | samples/video_conferencing/js/video/soundmeter.js | SoundMeter | function SoundMeter(context) {
this.context = context;
this.instant = 0.0;
this.slow = 0.0;
this.clip = 0.0;
this.script = context.createScriptProcessor(2048, 1, 1);
var that = this;
this.script.onaudioprocess = function(event) {
var input = event.inputBuffer.getChannelData(0);
var i;
var sum ... | javascript | function SoundMeter(context) {
this.context = context;
this.instant = 0.0;
this.slow = 0.0;
this.clip = 0.0;
this.script = context.createScriptProcessor(2048, 1, 1);
var that = this;
this.script.onaudioprocess = function(event) {
var input = event.inputBuffer.getChannelData(0);
var i;
var sum ... | [
"function",
"SoundMeter",
"(",
"context",
")",
"{",
"this",
".",
"context",
"=",
"context",
";",
"this",
".",
"instant",
"=",
"0.0",
";",
"this",
".",
"slow",
"=",
"0.0",
";",
"this",
".",
"clip",
"=",
"0.0",
";",
"this",
".",
"script",
"=",
"conte... | Meter class that generates a number correlated to audio volume. The meter class itself displays nothing, but it makes the instantaneous and time-decaying volumes available for inspection. It also reports on the fraction of samples that were at or near the top of the measurement range. | [
"Meter",
"class",
"that",
"generates",
"a",
"number",
"correlated",
"to",
"audio",
"volume",
".",
"The",
"meter",
"class",
"itself",
"displays",
"nothing",
"but",
"it",
"makes",
"the",
"instantaneous",
"and",
"time",
"-",
"decaying",
"volumes",
"available",
"f... | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/video_conferencing/js/video/soundmeter.js#L16-L38 |
24,161 | QuickBlox/quickblox-javascript-sdk | samples/cordova/video_chat/plugins/cordova-plugin-device/www/device.js | Device | function Device() {
this.available = false;
this.platform = null;
this.version = null;
this.uuid = null;
this.cordova = null;
this.model = null;
this.manufacturer = null;
this.isVirtual = null;
this.serial = null;
var me = this;
channel.onCordovaReady.subscribe(function() {... | javascript | function Device() {
this.available = false;
this.platform = null;
this.version = null;
this.uuid = null;
this.cordova = null;
this.model = null;
this.manufacturer = null;
this.isVirtual = null;
this.serial = null;
var me = this;
channel.onCordovaReady.subscribe(function() {... | [
"function",
"Device",
"(",
")",
"{",
"this",
".",
"available",
"=",
"false",
";",
"this",
".",
"platform",
"=",
"null",
";",
"this",
".",
"version",
"=",
"null",
";",
"this",
".",
"uuid",
"=",
"null",
";",
"this",
".",
"cordova",
"=",
"null",
";",
... | This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
phone, etc.
@constructor | [
"This",
"represents",
"the",
"mobile",
"device",
"and",
"provides",
"properties",
"for",
"inspecting",
"the",
"model",
"version",
"UUID",
"of",
"the",
"phone",
"etc",
"."
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/cordova/video_chat/plugins/cordova-plugin-device/www/device.js#L37-L70 |
24,162 | QuickBlox/quickblox-javascript-sdk | src/modules/qbAddressBook.js | function(isCompactOrCallback, callback) {
var self = this;
var isCompact, cb;
if(isFunction(isCompactOrCallback)) {
cb = isCompactOrCallback;
} else {
isCompact = isCompactOrCallback;
cb = callback;
}
if(!isFunction(cb)) {
throw new Error('The QB.addressbook.get accept ... | javascript | function(isCompactOrCallback, callback) {
var self = this;
var isCompact, cb;
if(isFunction(isCompactOrCallback)) {
cb = isCompactOrCallback;
} else {
isCompact = isCompactOrCallback;
cb = callback;
}
if(!isFunction(cb)) {
throw new Error('The QB.addressbook.get accept ... | [
"function",
"(",
"isCompactOrCallback",
",",
"callback",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"isCompact",
",",
"cb",
";",
"if",
"(",
"isFunction",
"(",
"isCompactOrCallback",
")",
")",
"{",
"cb",
"=",
"isCompactOrCallback",
";",
"}",
"else",
... | Retrieve QuickBlox users that have phone numbers from your address book.
The methods accepts 1 or 2 parameters.
@memberof QB.addressbook
@param {boolean|function} udidOrCallback - You can pass isCompact parameter or callback object. If isCompact is passed then only user's id and phone fields will be returned from serve... | [
"Retrieve",
"QuickBlox",
"users",
"that",
"have",
"phone",
"numbers",
"from",
"your",
"address",
"book",
".",
"The",
"methods",
"accepts",
"1",
"or",
"2",
"parameters",
"."
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/src/modules/qbAddressBook.js#L176-L216 | |
24,163 | QuickBlox/quickblox-javascript-sdk | src/modules/webrtc/qbWebRTCSession.js | WebRTCSession | function WebRTCSession(params) {
this.ID = params.sessionID ? params.sessionID : generateUUID();
this.state = WebRTCSession.State.NEW;
this.initiatorID = parseInt(params.initiatorID);
this.opponentsIDs = params.opIDs;
this.callType = parseInt(params.callType);
this.peerConnections = {};
t... | javascript | function WebRTCSession(params) {
this.ID = params.sessionID ? params.sessionID : generateUUID();
this.state = WebRTCSession.State.NEW;
this.initiatorID = parseInt(params.initiatorID);
this.opponentsIDs = params.opIDs;
this.callType = parseInt(params.callType);
this.peerConnections = {};
t... | [
"function",
"WebRTCSession",
"(",
"params",
")",
"{",
"this",
".",
"ID",
"=",
"params",
".",
"sessionID",
"?",
"params",
".",
"sessionID",
":",
"generateUUID",
"(",
")",
";",
"this",
".",
"state",
"=",
"WebRTCSession",
".",
"State",
".",
"NEW",
";",
"t... | Creates a session
@param {number} An ID if the call's initiator
@param {array} An array with opponents
@param {enum} Type of a call | [
"Creates",
"a",
"session"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/src/modules/webrtc/qbWebRTCSession.js#L41-L70 |
24,164 | QuickBlox/quickblox-javascript-sdk | src/modules/webrtc/qbWebRTCSession.js | _prepareExtension | function _prepareExtension(extension) {
var ext = {};
try {
if ( ({}).toString.call(extension) === '[object Object]' ) {
ext.userInfo = extension;
ext = JSON.parse( JSON.stringify(ext).replace(/null/g, "\"\"") );
} else {
throw new Error('Invalid type of "ext... | javascript | function _prepareExtension(extension) {
var ext = {};
try {
if ( ({}).toString.call(extension) === '[object Object]' ) {
ext.userInfo = extension;
ext = JSON.parse( JSON.stringify(ext).replace(/null/g, "\"\"") );
} else {
throw new Error('Invalid type of "ext... | [
"function",
"_prepareExtension",
"(",
"extension",
")",
"{",
"var",
"ext",
"=",
"{",
"}",
";",
"try",
"{",
"if",
"(",
"(",
"{",
"}",
")",
".",
"toString",
".",
"call",
"(",
"extension",
")",
"===",
"'[object Object]'",
")",
"{",
"ext",
".",
"userInfo... | private _prepareExtension - replace property null to empty string
return object with property or empty if extension didn't set | [
"private",
"_prepareExtension",
"-",
"replace",
"property",
"null",
"to",
"empty",
"string",
"return",
"object",
"with",
"property",
"or",
"empty",
"if",
"extension",
"didn",
"t",
"set"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/src/modules/webrtc/qbWebRTCSession.js#L998-L1013 |
24,165 | QuickBlox/quickblox-javascript-sdk | samples/cordova/text_chat/www/libs/stickerpipe/js/stickerpipe.js | defaultImageSrcGenerator | function defaultImageSrcGenerator(icon, options) {
return ''.concat(options.base, options.size, '/', icon, options.ext);
} | javascript | function defaultImageSrcGenerator(icon, options) {
return ''.concat(options.base, options.size, '/', icon, options.ext);
} | [
"function",
"defaultImageSrcGenerator",
"(",
"icon",
",",
"options",
")",
"{",
"return",
"''",
".",
"concat",
"(",
"options",
".",
"base",
",",
"options",
".",
"size",
",",
"'/'",
",",
"icon",
",",
"options",
".",
"ext",
")",
";",
"}"
] | Default callback used to generate emoji src
based on Twitter CDN
@param string the emoji codepoint string
@param string the default size to use, i.e. "36x36"
@param string optional "\uFE0F" variant char, ignored by default
@return string the image source to use | [
"Default",
"callback",
"used",
"to",
"generate",
"emoji",
"src",
"based",
"on",
"Twitter",
"CDN"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/cordova/text_chat/www/libs/stickerpipe/js/stickerpipe.js#L2650-L2652 |
24,166 | QuickBlox/quickblox-javascript-sdk | samples/cordova/text_chat/www/libs/stickerpipe/js/stickerpipe.js | grabTheRightIcon | function grabTheRightIcon(icon, variant) {
// if variant is present as \uFE0F
return toCodePoint(
variant === '\uFE0F' ?
// the icon should not contain it
icon.slice(0, -1) :
// fix non standard OSX behavior
(icon.length === 3 && icon.charAt(1) === '\uFE0F' ?
icon.charAt(0) + icon.cha... | javascript | function grabTheRightIcon(icon, variant) {
// if variant is present as \uFE0F
return toCodePoint(
variant === '\uFE0F' ?
// the icon should not contain it
icon.slice(0, -1) :
// fix non standard OSX behavior
(icon.length === 3 && icon.charAt(1) === '\uFE0F' ?
icon.charAt(0) + icon.cha... | [
"function",
"grabTheRightIcon",
"(",
"icon",
",",
"variant",
")",
"{",
"// if variant is present as \\uFE0F",
"return",
"toCodePoint",
"(",
"variant",
"===",
"'\\uFE0F'",
"?",
"// the icon should not contain it",
"icon",
".",
"slice",
"(",
"0",
",",
"-",
"1",
")",
... | Used to both remove the possible variant
and to convert utf16 into code points
@param string the emoji surrogate pair
@param string the optional variant char, if any | [
"Used",
"to",
"both",
"remove",
"the",
"possible",
"variant",
"and",
"to",
"convert",
"utf16",
"into",
"code",
"points"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/cordova/text_chat/www/libs/stickerpipe/js/stickerpipe.js#L2690-L2700 |
24,167 | QuickBlox/quickblox-javascript-sdk | samples/cordova/text_chat/www/js/messages.js | sendMessage | function sendMessage(text, attachmentFileId) {
stickerpipe.onUserMessageSent(stickerpipe.isSticker(text));
var msg = {
type: currentDialog.type === 3 ? 'chat' : 'groupchat',
body: text,
extension: {
save_to_history: 1,
},
markable: 1
};
if(attachment... | javascript | function sendMessage(text, attachmentFileId) {
stickerpipe.onUserMessageSent(stickerpipe.isSticker(text));
var msg = {
type: currentDialog.type === 3 ? 'chat' : 'groupchat',
body: text,
extension: {
save_to_history: 1,
},
markable: 1
};
if(attachment... | [
"function",
"sendMessage",
"(",
"text",
",",
"attachmentFileId",
")",
"{",
"stickerpipe",
".",
"onUserMessageSent",
"(",
"stickerpipe",
".",
"isSticker",
"(",
"text",
")",
")",
";",
"var",
"msg",
"=",
"{",
"type",
":",
"currentDialog",
".",
"type",
"===",
... | send text or attachment | [
"send",
"text",
"or",
"attachment"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/cordova/text_chat/www/js/messages.js#L193-L231 |
24,168 | QuickBlox/quickblox-javascript-sdk | samples/cordova/text_chat/www/js/dialogs.js | createNewDialog | function createNewDialog() {
var usersIds = [];
var usersNames = [];
$('#users_list .users_form.active').each(function(index) {
usersIds[index] = $(this).attr('id');
usersNames[index] = $(this).text();
});
$("#add_new_dialog").modal("hide");
$('#add_new_dialog .progress').show();
var dialogName... | javascript | function createNewDialog() {
var usersIds = [];
var usersNames = [];
$('#users_list .users_form.active').each(function(index) {
usersIds[index] = $(this).attr('id');
usersNames[index] = $(this).text();
});
$("#add_new_dialog").modal("hide");
$('#add_new_dialog .progress').show();
var dialogName... | [
"function",
"createNewDialog",
"(",
")",
"{",
"var",
"usersIds",
"=",
"[",
"]",
";",
"var",
"usersNames",
"=",
"[",
"]",
";",
"$",
"(",
"'#users_list .users_form.active'",
")",
".",
"each",
"(",
"function",
"(",
"index",
")",
"{",
"usersIds",
"[",
"index... | create new dialog | [
"create",
"new",
"dialog"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/cordova/text_chat/www/js/dialogs.js#L214-L274 |
24,169 | QuickBlox/quickblox-javascript-sdk | samples/cordova/text_chat/www/js/dialogs.js | showDialogInfoPopup | function showDialogInfoPopup() {
if(Object.keys(currentDialog).length !== 0) {
$('#update_dialog').modal('show');
$('#update_dialog .progress').hide();
setupDialogInfoPopup(currentDialog.occupants_ids, currentDialog.name);
}
} | javascript | function showDialogInfoPopup() {
if(Object.keys(currentDialog).length !== 0) {
$('#update_dialog').modal('show');
$('#update_dialog .progress').hide();
setupDialogInfoPopup(currentDialog.occupants_ids, currentDialog.name);
}
} | [
"function",
"showDialogInfoPopup",
"(",
")",
"{",
"if",
"(",
"Object",
".",
"keys",
"(",
"currentDialog",
")",
".",
"length",
"!==",
"0",
")",
"{",
"$",
"(",
"'#update_dialog'",
")",
".",
"modal",
"(",
"'show'",
")",
";",
"$",
"(",
"'#update_dialog .prog... | show modal window with dialog's info | [
"show",
"modal",
"window",
"with",
"dialog",
"s",
"info"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/cordova/text_chat/www/js/dialogs.js#L384-L391 |
24,170 | QuickBlox/quickblox-javascript-sdk | samples/cordova/video_chat/plugins/cordova-custom-config/hooks/applyCustomConfig.js | parseAndroidPreferences | function parseAndroidPreferences(preferences, configData){
var type = 'preference';
_.each(preferences, function (preference) {
// Extract pre-defined preferences (deprecated)
var target,
prefData;
if(preference.attrib.name.match(/^android-manifest\/... | javascript | function parseAndroidPreferences(preferences, configData){
var type = 'preference';
_.each(preferences, function (preference) {
// Extract pre-defined preferences (deprecated)
var target,
prefData;
if(preference.attrib.name.match(/^android-manifest\/... | [
"function",
"parseAndroidPreferences",
"(",
"preferences",
",",
"configData",
")",
"{",
"var",
"type",
"=",
"'preference'",
";",
"_",
".",
"each",
"(",
"preferences",
",",
"function",
"(",
"preference",
")",
"{",
"// Extract pre-defined preferences (deprecated)",
"v... | Parses supported Android preferences using the preference mapping into the appropriate XML elements in AndroidManifest.xml | [
"Parses",
"supported",
"Android",
"preferences",
"using",
"the",
"preference",
"mapping",
"into",
"the",
"appropriate",
"XML",
"elements",
"in",
"AndroidManifest",
".",
"xml"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/cordova/video_chat/plugins/cordova-custom-config/hooks/applyCustomConfig.js#L257-L287 |
24,171 | QuickBlox/quickblox-javascript-sdk | samples/cordova/video_chat/plugins/cordova-custom-config/hooks/applyCustomConfig.js | updateWp8Manifest | function updateWp8Manifest(targetFilePath, configItems) {
var tempManifest = fileUtils.parseElementtreeSync(targetFilePath),
root = tempManifest.getroot();
_.each(configItems, function (item) {
// if parent is not found on the root, child/grandchild nodes are searched
... | javascript | function updateWp8Manifest(targetFilePath, configItems) {
var tempManifest = fileUtils.parseElementtreeSync(targetFilePath),
root = tempManifest.getroot();
_.each(configItems, function (item) {
// if parent is not found on the root, child/grandchild nodes are searched
... | [
"function",
"updateWp8Manifest",
"(",
"targetFilePath",
",",
"configItems",
")",
"{",
"var",
"tempManifest",
"=",
"fileUtils",
".",
"parseElementtreeSync",
"(",
"targetFilePath",
")",
",",
"root",
"=",
"tempManifest",
".",
"getroot",
"(",
")",
";",
"_",
".",
"... | Updates target file with data from config.xml | [
"Updates",
"target",
"file",
"with",
"data",
"from",
"config",
".",
"xml"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/cordova/video_chat/plugins/cordova-custom-config/hooks/applyCustomConfig.js#L430-L464 |
24,172 | QuickBlox/quickblox-javascript-sdk | samples/cordova/video_chat/plugins/cordova-custom-config/hooks/applyCustomConfig.js | updateIosPbxProj | function updateIosPbxProj(xcodeProjectPath, configItems) {
var xcodeProject = xcode.project(xcodeProjectPath);
xcodeProject.parse(function(err){
if(err){
// shell is undefined if android platform has been removed and added with a new package id but ios stayed the same.
... | javascript | function updateIosPbxProj(xcodeProjectPath, configItems) {
var xcodeProject = xcode.project(xcodeProjectPath);
xcodeProject.parse(function(err){
if(err){
// shell is undefined if android platform has been removed and added with a new package id but ios stayed the same.
... | [
"function",
"updateIosPbxProj",
"(",
"xcodeProjectPath",
",",
"configItems",
")",
"{",
"var",
"xcodeProject",
"=",
"xcode",
".",
"project",
"(",
"xcodeProjectPath",
")",
";",
"xcodeProject",
".",
"parse",
"(",
"function",
"(",
"err",
")",
"{",
"if",
"(",
"er... | Updates the project.pbxproj file with data from config.xml
@param {String} xcodeProjectPath - path to XCode project file
@param {Array} configItems - config items to update project file with | [
"Updates",
"the",
"project",
".",
"pbxproj",
"file",
"with",
"data",
"from",
"config",
".",
"xml"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/cordova/video_chat/plugins/cordova-custom-config/hooks/applyCustomConfig.js#L493-L519 |
24,173 | QuickBlox/quickblox-javascript-sdk | samples/cordova/video_chat/plugins/cordova-custom-config/hooks/applyCustomConfig.js | updateXCBuildConfiguration | function updateXCBuildConfiguration(item, buildConfig, mode){
var modified = false;
for(var blockName in buildConfig){
var block = buildConfig[blockName];
if(typeof(block) !== "object" || !(block["buildSettings"])) continue;
var literalMatch = !!block["buildSettings"... | javascript | function updateXCBuildConfiguration(item, buildConfig, mode){
var modified = false;
for(var blockName in buildConfig){
var block = buildConfig[blockName];
if(typeof(block) !== "object" || !(block["buildSettings"])) continue;
var literalMatch = !!block["buildSettings"... | [
"function",
"updateXCBuildConfiguration",
"(",
"item",
",",
"buildConfig",
",",
"mode",
")",
"{",
"var",
"modified",
"=",
"false",
";",
"for",
"(",
"var",
"blockName",
"in",
"buildConfig",
")",
"{",
"var",
"block",
"=",
"buildConfig",
"[",
"blockName",
"]",
... | Updates an XCode build configuration setting with the given item.
@param {Object} item - configuration item containing setting data
@param {Object} buildConfig - XCode build config object
@param {String} mode - update mode: "replace" to replace only existing keys or "add" to add a new key to every block
@returns {boole... | [
"Updates",
"an",
"XCode",
"build",
"configuration",
"setting",
"with",
"the",
"given",
"item",
"."
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/samples/cordova/video_chat/plugins/cordova-custom-config/hooks/applyCustomConfig.js#L528-L556 |
24,174 | QuickBlox/quickblox-javascript-sdk | src/modules/qbData.js | function(className, params) {
var result = Utils.getUrl(config.urls.data, className + '/' + params.id + '/file');
result += '?field_name=' + params.field_name + '&token=' + this.service.getSession().token;
return result;
} | javascript | function(className, params) {
var result = Utils.getUrl(config.urls.data, className + '/' + params.id + '/file');
result += '?field_name=' + params.field_name + '&token=' + this.service.getSession().token;
return result;
} | [
"function",
"(",
"className",
",",
"params",
")",
"{",
"var",
"result",
"=",
"Utils",
".",
"getUrl",
"(",
"config",
".",
"urls",
".",
"data",
",",
"className",
"+",
"'/'",
"+",
"params",
".",
"id",
"+",
"'/file'",
")",
";",
"result",
"+=",
"'?field_n... | Return file's URL from file field by ID
@memberof QB.data
@param {string} className - A class name of record
@param {object} params - Object of parameters
@param {string} params.field_name - The file's field name
@param {string} params.id - The record's ID | [
"Return",
"file",
"s",
"URL",
"from",
"file",
"field",
"by",
"ID"
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/src/modules/qbData.js#L347-L351 | |
24,175 | QuickBlox/quickblox-javascript-sdk | src/modules/qbContent.js | function(params, callback) {
/**
* Callback for QB.content.createAndUpload(params, callback).
* @callback createAndUploadFileCallback
* @param {object} error - The error object
* @param {object} response - The file object (blob-object-access)
*/
var _this = t... | javascript | function(params, callback) {
/**
* Callback for QB.content.createAndUpload(params, callback).
* @callback createAndUploadFileCallback
* @param {object} error - The error object
* @param {object} response - The file object (blob-object-access)
*/
var _this = t... | [
"function",
"(",
"params",
",",
"callback",
")",
"{",
"/**\n * Callback for QB.content.createAndUpload(params, callback).\n * @callback createAndUploadFileCallback\n * @param {object} error - The error object\n * @param {object} response - The file object (blob-object-a... | Create file > upload file > mark file as uploaded > return result.
@memberof QB.content
@param {object} params - Object of parameters
@param {object} params.file - File object
@param {string} params.name - The file's name
@param {string} params.type - The file's mime ({@link https://developer.mozilla.org/en-US/docs/Web... | [
"Create",
"file",
">",
"upload",
"file",
">",
"mark",
"file",
"as",
"uploaded",
">",
"return",
"result",
"."
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/src/modules/qbContent.js#L122-L197 | |
24,176 | QuickBlox/quickblox-javascript-sdk | src/modules/qbContent.js | function (id, callback) {
/**
* Callback for QB.content.getInfo(id, callback)
* @callback getFileInfoByIdCallback
* @param {object} error - The error object
* @param {object} response - The file object (blob-object-access)
*/
this.service.ajax({url: Utils.get... | javascript | function (id, callback) {
/**
* Callback for QB.content.getInfo(id, callback)
* @callback getFileInfoByIdCallback
* @param {object} error - The error object
* @param {object} response - The file object (blob-object-access)
*/
this.service.ajax({url: Utils.get... | [
"function",
"(",
"id",
",",
"callback",
")",
"{",
"/**\n * Callback for QB.content.getInfo(id, callback)\n * @callback getFileInfoByIdCallback\n * @param {object} error - The error object\n * @param {object} response - The file object (blob-object-access)\n */",... | Retrieve file object by id (@link https://docsdev.quickblox.com/rest_api/Content_API.html#Retrieve_file read more})
@memberof QB.content
@param {number} id - The id of file to declare as uploaded
@param {getFileInfoByIdCallback} callback - The getFileInfoByIdCallback function return file's object. | [
"Retrieve",
"file",
"object",
"by",
"id",
"("
] | 23edee3c5904cff3d723907a928ddf20dab8ffa5 | https://github.com/QuickBlox/quickblox-javascript-sdk/blob/23edee3c5904cff3d723907a928ddf20dab8ffa5/src/modules/qbContent.js#L270-L284 | |
24,177 | McNull/angular-block-ui | dist/angular-block-ui.js | blockNavigation | function blockNavigation($scope, mainBlockUI, blockUIConfig) {
if (blockUIConfig.blockBrowserNavigation) {
function registerLocationChange() {
$scope.$on('$locationChangeStart', function (event) {
// console.log('$locationChangeStart', mainBlockUI.$_blockLocationChange + ' ' + mainBlockUI... | javascript | function blockNavigation($scope, mainBlockUI, blockUIConfig) {
if (blockUIConfig.blockBrowserNavigation) {
function registerLocationChange() {
$scope.$on('$locationChangeStart', function (event) {
// console.log('$locationChangeStart', mainBlockUI.$_blockLocationChange + ' ' + mainBlockUI... | [
"function",
"blockNavigation",
"(",
"$scope",
",",
"mainBlockUI",
",",
"blockUIConfig",
")",
"{",
"if",
"(",
"blockUIConfig",
".",
"blockBrowserNavigation",
")",
"{",
"function",
"registerLocationChange",
"(",
")",
"{",
"$scope",
".",
"$on",
"(",
"'$locationChange... | Called from block-ui-directive for the 'main' instance. | [
"Called",
"from",
"block",
"-",
"ui",
"-",
"directive",
"for",
"the",
"main",
"instance",
"."
] | 0d01eee67a6f8b0fd6beeaf16f950d1870842702 | https://github.com/McNull/angular-block-ui/blob/0d01eee67a6f8b0fd6beeaf16f950d1870842702/dist/angular-block-ui.js#L104-L146 |
24,178 | exceptionless/Exceptionless.JavaScript | dist/exceptionless.universal.js | unsubscribe | function unsubscribe(handler) {
for (var i = handlers.length - 1; i >= 0; --i) {
if (handlers[i] === handler) {
handlers.splice(i, 1);
}
}
if (handlers.length === 0) {
window.onerror = _oldOnerrorHandler;
_onErrorHandlerInstalled =... | javascript | function unsubscribe(handler) {
for (var i = handlers.length - 1; i >= 0; --i) {
if (handlers[i] === handler) {
handlers.splice(i, 1);
}
}
if (handlers.length === 0) {
window.onerror = _oldOnerrorHandler;
_onErrorHandlerInstalled =... | [
"function",
"unsubscribe",
"(",
"handler",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"handlers",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"--",
"i",
")",
"{",
"if",
"(",
"handlers",
"[",
"i",
"]",
"===",
"handler",
")",
"{",
"handlers",
... | Remove a crash handler.
@param {Function} handler
@memberof TraceKit.report | [
"Remove",
"a",
"crash",
"handler",
"."
] | 02711d099660a6d51a107b69a6e1c2aa68c9c559 | https://github.com/exceptionless/Exceptionless.JavaScript/blob/02711d099660a6d51a107b69a6e1c2aa68c9c559/dist/exceptionless.universal.js#L139-L150 |
24,179 | exceptionless/Exceptionless.JavaScript | dist/exceptionless.universal.js | installGlobalHandler | function installGlobalHandler() {
if (_onErrorHandlerInstalled === true) {
return;
}
_oldOnerrorHandler = window.onerror;
window.onerror = traceKitWindowOnError;
_onErrorHandlerInstalled = true;
} | javascript | function installGlobalHandler() {
if (_onErrorHandlerInstalled === true) {
return;
}
_oldOnerrorHandler = window.onerror;
window.onerror = traceKitWindowOnError;
_onErrorHandlerInstalled = true;
} | [
"function",
"installGlobalHandler",
"(",
")",
"{",
"if",
"(",
"_onErrorHandlerInstalled",
"===",
"true",
")",
"{",
"return",
";",
"}",
"_oldOnerrorHandler",
"=",
"window",
".",
"onerror",
";",
"window",
".",
"onerror",
"=",
"traceKitWindowOnError",
";",
"_onErro... | Install a global onerror handler
@memberof TraceKit.report | [
"Install",
"a",
"global",
"onerror",
"handler"
] | 02711d099660a6d51a107b69a6e1c2aa68c9c559 | https://github.com/exceptionless/Exceptionless.JavaScript/blob/02711d099660a6d51a107b69a6e1c2aa68c9c559/dist/exceptionless.universal.js#L241-L249 |
24,180 | exceptionless/Exceptionless.JavaScript | dist/exceptionless.universal.js | processLastException | function processLastException() {
var _lastExceptionStack = lastExceptionStack,
_lastException = lastException;
lastExceptionStack = null;
lastException = null;
notifyHandlers(_lastExceptionStack, false, _lastException);
} | javascript | function processLastException() {
var _lastExceptionStack = lastExceptionStack,
_lastException = lastException;
lastExceptionStack = null;
lastException = null;
notifyHandlers(_lastExceptionStack, false, _lastException);
} | [
"function",
"processLastException",
"(",
")",
"{",
"var",
"_lastExceptionStack",
"=",
"lastExceptionStack",
",",
"_lastException",
"=",
"lastException",
";",
"lastExceptionStack",
"=",
"null",
";",
"lastException",
"=",
"null",
";",
"notifyHandlers",
"(",
"_lastExcept... | Process the most recent exception
@memberof TraceKit.report | [
"Process",
"the",
"most",
"recent",
"exception"
] | 02711d099660a6d51a107b69a6e1c2aa68c9c559 | https://github.com/exceptionless/Exceptionless.JavaScript/blob/02711d099660a6d51a107b69a6e1c2aa68c9c559/dist/exceptionless.universal.js#L255-L261 |
24,181 | exceptionless/Exceptionless.JavaScript | dist/exceptionless.universal.js | loadSource | function loadSource(url) {
if (!TraceKit.remoteFetching) { //Only attempt request if remoteFetching is on.
return '';
}
try {
var getXHR = function() {
try {
return new window.XMLHttpRequest();
} catch (e) {
... | javascript | function loadSource(url) {
if (!TraceKit.remoteFetching) { //Only attempt request if remoteFetching is on.
return '';
}
try {
var getXHR = function() {
try {
return new window.XMLHttpRequest();
} catch (e) {
... | [
"function",
"loadSource",
"(",
"url",
")",
"{",
"if",
"(",
"!",
"TraceKit",
".",
"remoteFetching",
")",
"{",
"//Only attempt request if remoteFetching is on.",
"return",
"''",
";",
"}",
"try",
"{",
"var",
"getXHR",
"=",
"function",
"(",
")",
"{",
"try",
"{",... | Attempts to retrieve source code via XMLHttpRequest, which is used
to look up anonymous function names.
@param {string} url URL of source code.
@return {string} Source contents.
@memberof TraceKit.computeStackTrace | [
"Attempts",
"to",
"retrieve",
"source",
"code",
"via",
"XMLHttpRequest",
"which",
"is",
"used",
"to",
"look",
"up",
"anonymous",
"function",
"names",
"."
] | 02711d099660a6d51a107b69a6e1c2aa68c9c559 | https://github.com/exceptionless/Exceptionless.JavaScript/blob/02711d099660a6d51a107b69a6e1c2aa68c9c559/dist/exceptionless.universal.js#L396-L417 |
24,182 | exceptionless/Exceptionless.JavaScript | dist/exceptionless.universal.js | findSourceInUrls | function findSourceInUrls(re, urls) {
var source, m;
for (var i = 0, j = urls.length; i < j; ++i) {
if ((source = getSource(urls[i])).length) {
source = source.join('\n');
if ((m = re.exec(source))) {
return {
'url'... | javascript | function findSourceInUrls(re, urls) {
var source, m;
for (var i = 0, j = urls.length; i < j; ++i) {
if ((source = getSource(urls[i])).length) {
source = source.join('\n');
if ((m = re.exec(source))) {
return {
'url'... | [
"function",
"findSourceInUrls",
"(",
"re",
",",
"urls",
")",
"{",
"var",
"source",
",",
"m",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"j",
"=",
"urls",
".",
"length",
";",
"i",
"<",
"j",
";",
"++",
"i",
")",
"{",
"if",
"(",
"(",
"source",
... | Determines where a code fragment occurs in the source code.
@param {RegExp} re The function definition.
@param {Array.<string>} urls A list of URLs to search.
@return {?Object.<string, (string|number)>} An object containing
the url, line, and column number of the defined function.
@memberof TraceKit.computeStackTrace | [
"Determines",
"where",
"a",
"code",
"fragment",
"occurs",
"in",
"the",
"source",
"code",
"."
] | 02711d099660a6d51a107b69a6e1c2aa68c9c559 | https://github.com/exceptionless/Exceptionless.JavaScript/blob/02711d099660a6d51a107b69a6e1c2aa68c9c559/dist/exceptionless.universal.js#L558-L575 |
24,183 | exceptionless/Exceptionless.JavaScript | dist/exceptionless.universal.js | findSourceByFunctionBody | function findSourceByFunctionBody(func) {
if (_isUndefined(window && window.document)) {
return;
}
var urls = [window.location.href],
scripts = window.document.getElementsByTagName('script'),
body,
code = '' + func,
codeRE = /^function... | javascript | function findSourceByFunctionBody(func) {
if (_isUndefined(window && window.document)) {
return;
}
var urls = [window.location.href],
scripts = window.document.getElementsByTagName('script'),
body,
code = '' + func,
codeRE = /^function... | [
"function",
"findSourceByFunctionBody",
"(",
"func",
")",
"{",
"if",
"(",
"_isUndefined",
"(",
"window",
"&&",
"window",
".",
"document",
")",
")",
"{",
"return",
";",
"}",
"var",
"urls",
"=",
"[",
"window",
".",
"location",
".",
"href",
"]",
",",
"scr... | Determines where a function was defined within the source code.
@param {(Function|string)} func A function reference or serialized
function definition.
@return {?Object.<string, (string|number)>} An object containing
the url, line, and column number of the defined function.
@memberof TraceKit.computeStackTrace | [
"Determines",
"where",
"a",
"function",
"was",
"defined",
"within",
"the",
"source",
"code",
"."
] | 02711d099660a6d51a107b69a6e1c2aa68c9c559 | https://github.com/exceptionless/Exceptionless.JavaScript/blob/02711d099660a6d51a107b69a6e1c2aa68c9c559/dist/exceptionless.universal.js#L608-L670 |
24,184 | exceptionless/Exceptionless.JavaScript | dist/exceptionless.universal.js | computeStackTraceFromStacktraceProp | function computeStackTraceFromStacktraceProp(ex) {
// Access and store the stacktrace property before doing ANYTHING
// else to it because Opera is not very good at providing it
// reliably in other circumstances.
var stacktrace = ex.stacktrace;
if (!stacktrace) {
ret... | javascript | function computeStackTraceFromStacktraceProp(ex) {
// Access and store the stacktrace property before doing ANYTHING
// else to it because Opera is not very good at providing it
// reliably in other circumstances.
var stacktrace = ex.stacktrace;
if (!stacktrace) {
ret... | [
"function",
"computeStackTraceFromStacktraceProp",
"(",
"ex",
")",
"{",
"// Access and store the stacktrace property before doing ANYTHING",
"// else to it because Opera is not very good at providing it",
"// reliably in other circumstances.",
"var",
"stacktrace",
"=",
"ex",
".",
"stackt... | Computes stack trace information from the stacktrace property.
Opera 10+ uses this property.
@param {Error} ex
@return {?TraceKit.StackTrace} Stack trace information.
@memberof TraceKit.computeStackTrace | [
"Computes",
"stack",
"trace",
"information",
"from",
"the",
"stacktrace",
"property",
".",
"Opera",
"10",
"+",
"uses",
"this",
"property",
"."
] | 02711d099660a6d51a107b69a6e1c2aa68c9c559 | https://github.com/exceptionless/Exceptionless.JavaScript/blob/02711d099660a6d51a107b69a6e1c2aa68c9c559/dist/exceptionless.universal.js#L818-L881 |
24,185 | marionettejs/backbone.radio | src/backbone.radio.js | callHandler | function callHandler(callback, context, args) {
switch (args.length) {
case 0: return callback.call(context);
case 1: return callback.call(context, args[0]);
case 2: return callback.call(context, args[0], args[1]);
case 3: return callback.call(context, args[0], args[1], args[2]);
default: return c... | javascript | function callHandler(callback, context, args) {
switch (args.length) {
case 0: return callback.call(context);
case 1: return callback.call(context, args[0]);
case 2: return callback.call(context, args[0], args[1]);
case 3: return callback.call(context, args[0], args[1], args[2]);
default: return c... | [
"function",
"callHandler",
"(",
"callback",
",",
"context",
",",
"args",
")",
"{",
"switch",
"(",
"args",
".",
"length",
")",
"{",
"case",
"0",
":",
"return",
"callback",
".",
"call",
"(",
"context",
")",
";",
"case",
"1",
":",
"return",
"callback",
... | An optimized way to execute callbacks. | [
"An",
"optimized",
"way",
"to",
"execute",
"callbacks",
"."
] | 7a58ade84bedb5551c2e12bdd3434d0fd6b1bdbd | https://github.com/marionettejs/backbone.radio/blob/7a58ade84bedb5551c2e12bdd3434d0fd6b1bdbd/src/backbone.radio.js#L74-L82 |
24,186 | marionettejs/backbone.radio | src/backbone.radio.js | removeHandler | function removeHandler(store, name, callback, context) {
var event = store[name];
if (
(!callback || (callback === event.callback || callback === event.callback._callback)) &&
(!context || (context === event.context))
) {
delete store[name];
return true;
}
} | javascript | function removeHandler(store, name, callback, context) {
var event = store[name];
if (
(!callback || (callback === event.callback || callback === event.callback._callback)) &&
(!context || (context === event.context))
) {
delete store[name];
return true;
}
} | [
"function",
"removeHandler",
"(",
"store",
",",
"name",
",",
"callback",
",",
"context",
")",
"{",
"var",
"event",
"=",
"store",
"[",
"name",
"]",
";",
"if",
"(",
"(",
"!",
"callback",
"||",
"(",
"callback",
"===",
"event",
".",
"callback",
"||",
"ca... | A helper used by `off` methods to the handler from the store | [
"A",
"helper",
"used",
"by",
"off",
"methods",
"to",
"the",
"handler",
"from",
"the",
"store"
] | 7a58ade84bedb5551c2e12bdd3434d0fd6b1bdbd | https://github.com/marionettejs/backbone.radio/blob/7a58ade84bedb5551c2e12bdd3434d0fd6b1bdbd/src/backbone.radio.js#L85-L94 |
24,187 | marionettejs/backbone.radio | src/backbone.radio.js | _partial | function _partial(channelName) {
return _logs[channelName] || (_logs[channelName] = Radio.log.bind(Radio, channelName));
} | javascript | function _partial(channelName) {
return _logs[channelName] || (_logs[channelName] = Radio.log.bind(Radio, channelName));
} | [
"function",
"_partial",
"(",
"channelName",
")",
"{",
"return",
"_logs",
"[",
"channelName",
"]",
"||",
"(",
"_logs",
"[",
"channelName",
"]",
"=",
"Radio",
".",
"log",
".",
"bind",
"(",
"Radio",
",",
"channelName",
")",
")",
";",
"}"
] | This is to produce an identical function in both tuneIn and tuneOut, so that Backbone.Events unregisters it. | [
"This",
"is",
"to",
"produce",
"an",
"identical",
"function",
"in",
"both",
"tuneIn",
"and",
"tuneOut",
"so",
"that",
"Backbone",
".",
"Events",
"unregisters",
"it",
"."
] | 7a58ade84bedb5551c2e12bdd3434d0fd6b1bdbd | https://github.com/marionettejs/backbone.radio/blob/7a58ade84bedb5551c2e12bdd3434d0fd6b1bdbd/src/backbone.radio.js#L129-L131 |
24,188 | marionettejs/backbone.radio | src/backbone.radio.js | function(channelName, eventName) {
if (typeof console === 'undefined') { return; }
var args = _.toArray(arguments).slice(2);
console.log('[' + channelName + '] "' + eventName + '"', args);
} | javascript | function(channelName, eventName) {
if (typeof console === 'undefined') { return; }
var args = _.toArray(arguments).slice(2);
console.log('[' + channelName + '] "' + eventName + '"', args);
} | [
"function",
"(",
"channelName",
",",
"eventName",
")",
"{",
"if",
"(",
"typeof",
"console",
"===",
"'undefined'",
")",
"{",
"return",
";",
"}",
"var",
"args",
"=",
"_",
".",
"toArray",
"(",
"arguments",
")",
".",
"slice",
"(",
"2",
")",
";",
"console... | Log information about the channel and event | [
"Log",
"information",
"about",
"the",
"channel",
"and",
"event"
] | 7a58ade84bedb5551c2e12bdd3434d0fd6b1bdbd | https://github.com/marionettejs/backbone.radio/blob/7a58ade84bedb5551c2e12bdd3434d0fd6b1bdbd/src/backbone.radio.js#L136-L140 | |
24,189 | marionettejs/backbone.radio | src/backbone.radio.js | function(channelName) {
var channel = Radio.channel(channelName);
channel._tunedIn = true;
channel.on('all', _partial(channelName));
return this;
} | javascript | function(channelName) {
var channel = Radio.channel(channelName);
channel._tunedIn = true;
channel.on('all', _partial(channelName));
return this;
} | [
"function",
"(",
"channelName",
")",
"{",
"var",
"channel",
"=",
"Radio",
".",
"channel",
"(",
"channelName",
")",
";",
"channel",
".",
"_tunedIn",
"=",
"true",
";",
"channel",
".",
"on",
"(",
"'all'",
",",
"_partial",
"(",
"channelName",
")",
")",
";"... | Logs all events on this channel to the console. It sets an internal value on the channel telling it we're listening, then sets a listener on the Backbone.Events | [
"Logs",
"all",
"events",
"on",
"this",
"channel",
"to",
"the",
"console",
".",
"It",
"sets",
"an",
"internal",
"value",
"on",
"the",
"channel",
"telling",
"it",
"we",
"re",
"listening",
"then",
"sets",
"a",
"listener",
"on",
"the",
"Backbone",
".",
"Even... | 7a58ade84bedb5551c2e12bdd3434d0fd6b1bdbd | https://github.com/marionettejs/backbone.radio/blob/7a58ade84bedb5551c2e12bdd3434d0fd6b1bdbd/src/backbone.radio.js#L145-L150 | |
24,190 | marionettejs/backbone.radio | src/backbone.radio.js | function(channelName) {
var channel = Radio.channel(channelName);
channel._tunedIn = false;
channel.off('all', _partial(channelName));
delete _logs[channelName];
return this;
} | javascript | function(channelName) {
var channel = Radio.channel(channelName);
channel._tunedIn = false;
channel.off('all', _partial(channelName));
delete _logs[channelName];
return this;
} | [
"function",
"(",
"channelName",
")",
"{",
"var",
"channel",
"=",
"Radio",
".",
"channel",
"(",
"channelName",
")",
";",
"channel",
".",
"_tunedIn",
"=",
"false",
";",
"channel",
".",
"off",
"(",
"'all'",
",",
"_partial",
"(",
"channelName",
")",
")",
"... | Stop logging all of the activities on this channel to the console | [
"Stop",
"logging",
"all",
"of",
"the",
"activities",
"on",
"this",
"channel",
"to",
"the",
"console"
] | 7a58ade84bedb5551c2e12bdd3434d0fd6b1bdbd | https://github.com/marionettejs/backbone.radio/blob/7a58ade84bedb5551c2e12bdd3434d0fd6b1bdbd/src/backbone.radio.js#L153-L159 | |
24,191 | marionettejs/backbone.radio | src/backbone.radio.js | function(name) {
var args = _.toArray(arguments).slice(1);
var results = eventsApi(this, 'request', name, args);
if (results) {
return results;
}
var channelName = this.channelName;
var requests = this._requests;
// Check if we should log the request, and if so, do it
if (channelN... | javascript | function(name) {
var args = _.toArray(arguments).slice(1);
var results = eventsApi(this, 'request', name, args);
if (results) {
return results;
}
var channelName = this.channelName;
var requests = this._requests;
// Check if we should log the request, and if so, do it
if (channelN... | [
"function",
"(",
"name",
")",
"{",
"var",
"args",
"=",
"_",
".",
"toArray",
"(",
"arguments",
")",
".",
"slice",
"(",
"1",
")",
";",
"var",
"results",
"=",
"eventsApi",
"(",
"this",
",",
"'request'",
",",
"name",
",",
"args",
")",
";",
"if",
"(",... | Make a request | [
"Make",
"a",
"request"
] | 7a58ade84bedb5551c2e12bdd3434d0fd6b1bdbd | https://github.com/marionettejs/backbone.radio/blob/7a58ade84bedb5551c2e12bdd3434d0fd6b1bdbd/src/backbone.radio.js#L181-L203 | |
24,192 | marionettejs/backbone.radio | src/backbone.radio.js | function(name, callback, context) {
if (eventsApi(this, 'replyOnce', name, [callback, context])) {
return this;
}
var self = this;
var once = _.once(function() {
self.stopReplying(name);
return makeCallback(callback).apply(this, arguments);
});
return this.reply(name, once, ... | javascript | function(name, callback, context) {
if (eventsApi(this, 'replyOnce', name, [callback, context])) {
return this;
}
var self = this;
var once = _.once(function() {
self.stopReplying(name);
return makeCallback(callback).apply(this, arguments);
});
return this.reply(name, once, ... | [
"function",
"(",
"name",
",",
"callback",
",",
"context",
")",
"{",
"if",
"(",
"eventsApi",
"(",
"this",
",",
"'replyOnce'",
",",
"name",
",",
"[",
"callback",
",",
"context",
"]",
")",
")",
"{",
"return",
"this",
";",
"}",
"var",
"self",
"=",
"thi... | Set up a handler that can only be requested once | [
"Set",
"up",
"a",
"handler",
"that",
"can",
"only",
"be",
"requested",
"once"
] | 7a58ade84bedb5551c2e12bdd3434d0fd6b1bdbd | https://github.com/marionettejs/backbone.radio/blob/7a58ade84bedb5551c2e12bdd3434d0fd6b1bdbd/src/backbone.radio.js#L226-L239 | |
24,193 | lpinca/forwarded-parse | lib/ascii.js | isDelimiter | function isDelimiter(code) {
return code === 0x22 // '"'
|| code === 0x28 // '('
|| code === 0x29 // ')'
|| code === 0x2C // ','
|| code === 0x2F // '/'
|| code >= 0x3A && code <= 0x40 // ':', ';', '<', '=', '>', ... | javascript | function isDelimiter(code) {
return code === 0x22 // '"'
|| code === 0x28 // '('
|| code === 0x29 // ')'
|| code === 0x2C // ','
|| code === 0x2F // '/'
|| code >= 0x3A && code <= 0x40 // ':', ';', '<', '=', '>', ... | [
"function",
"isDelimiter",
"(",
"code",
")",
"{",
"return",
"code",
"===",
"0x22",
"// '\"'",
"||",
"code",
"===",
"0x28",
"// '('",
"||",
"code",
"===",
"0x29",
"// ')'",
"||",
"code",
"===",
"0x2C",
"// ','",
"||",
"code",
"===",
"0x2F",
"// '/'",
"||"... | Check if a character is a delimiter as defined in section 3.2.6 of RFC 7230.
@param {number} code The code of the character to check.
@returns {boolean} `true` if the character is a delimiter, else `false`.
@public | [
"Check",
"if",
"a",
"character",
"is",
"a",
"delimiter",
"as",
"defined",
"in",
"section",
"3",
".",
"2",
".",
"6",
"of",
"RFC",
"7230",
"."
] | a80ef2cb3892ff7c0a2ec80800cd8aa4580dfe89 | https://github.com/lpinca/forwarded-parse/blob/a80ef2cb3892ff7c0a2ec80800cd8aa4580dfe89/lib/ascii.js#L11-L21 |
24,194 | lpinca/forwarded-parse | lib/ascii.js | isTokenChar | function isTokenChar(code) {
return code === 0x21 // '!'
|| code >= 0x23 && code <= 0x27 // '#', '$', '%', '&', '''
|| code === 0x2A // '*'
|| code === 0x2B // '+'
|| code === 0x2D // '-'
|| code === 0x2E // '.'
... | javascript | function isTokenChar(code) {
return code === 0x21 // '!'
|| code >= 0x23 && code <= 0x27 // '#', '$', '%', '&', '''
|| code === 0x2A // '*'
|| code === 0x2B // '+'
|| code === 0x2D // '-'
|| code === 0x2E // '.'
... | [
"function",
"isTokenChar",
"(",
"code",
")",
"{",
"return",
"code",
"===",
"0x21",
"// '!'",
"||",
"code",
">=",
"0x23",
"&&",
"code",
"<=",
"0x27",
"// '#', '$', '%', '&', '''",
"||",
"code",
"===",
"0x2A",
"// '*'",
"||",
"code",
"===",
"0x2B",
"// '+'",
... | Check if a character is allowed in a token as defined in section 3.2.6
of RFC 7230.
@param {number} code The code of the character to check.
@returns {boolean} `true` if the character is allowed, else `false`.
@public | [
"Check",
"if",
"a",
"character",
"is",
"allowed",
"in",
"a",
"token",
"as",
"defined",
"in",
"section",
"3",
".",
"2",
".",
"6",
"of",
"RFC",
"7230",
"."
] | a80ef2cb3892ff7c0a2ec80800cd8aa4580dfe89 | https://github.com/lpinca/forwarded-parse/blob/a80ef2cb3892ff7c0a2ec80800cd8aa4580dfe89/lib/ascii.js#L31-L43 |
24,195 | lpinca/forwarded-parse | lib/error.js | ParseError | function ParseError(message, input) {
Error.captureStackTrace(this, ParseError);
this.name = this.constructor.name;
this.message = message;
this.input = input;
} | javascript | function ParseError(message, input) {
Error.captureStackTrace(this, ParseError);
this.name = this.constructor.name;
this.message = message;
this.input = input;
} | [
"function",
"ParseError",
"(",
"message",
",",
"input",
")",
"{",
"Error",
".",
"captureStackTrace",
"(",
"this",
",",
"ParseError",
")",
";",
"this",
".",
"name",
"=",
"this",
".",
"constructor",
".",
"name",
";",
"this",
".",
"message",
"=",
"message",... | An error thrown by the parser on unexpected input.
@constructor
@param {string} message The error message.
@param {string} input The unexpected input.
@public | [
"An",
"error",
"thrown",
"by",
"the",
"parser",
"on",
"unexpected",
"input",
"."
] | a80ef2cb3892ff7c0a2ec80800cd8aa4580dfe89 | https://github.com/lpinca/forwarded-parse/blob/a80ef2cb3892ff7c0a2ec80800cd8aa4580dfe89/lib/error.js#L13-L19 |
24,196 | RisingStack/graffiti-mongoose | src/model/model.js | extractPath | function extractPath(schemaPath) {
const subNames = schemaPath.path.split('.');
return reduceRight(subNames, (fields, name, key) => {
const obj = {};
if (schemaPath instanceof mongoose.Schema.Types.DocumentArray) {
const subSchemaPaths = schemaPath.schema.paths;
const fields = extractPaths(sub... | javascript | function extractPath(schemaPath) {
const subNames = schemaPath.path.split('.');
return reduceRight(subNames, (fields, name, key) => {
const obj = {};
if (schemaPath instanceof mongoose.Schema.Types.DocumentArray) {
const subSchemaPaths = schemaPath.schema.paths;
const fields = extractPaths(sub... | [
"function",
"extractPath",
"(",
"schemaPath",
")",
"{",
"const",
"subNames",
"=",
"schemaPath",
".",
"path",
".",
"split",
"(",
"'.'",
")",
";",
"return",
"reduceRight",
"(",
"subNames",
",",
"(",
"fields",
",",
"name",
",",
"key",
")",
"=>",
"{",
"con... | Extracts tree chunk from path if it's a sub-document
@method extractPath
@param {Object} schemaPath
@param {Object} model
@return {Object} field | [
"Extracts",
"tree",
"chunk",
"from",
"path",
"if",
"it",
"s",
"a",
"sub",
"-",
"document"
] | 414c91e4b2081bf0d14ecd2de545f621713f5da7 | https://github.com/RisingStack/graffiti-mongoose/blob/414c91e4b2081bf0d14ecd2de545f621713f5da7/src/model/model.js#L65-L106 |
24,197 | RisingStack/graffiti-mongoose | src/model/model.js | extractPaths | function extractPaths(schemaPaths, model) {
return reduce(schemaPaths, (fields, schemaPath) => (
merge(fields, extractPath(schemaPath, model))
), {});
} | javascript | function extractPaths(schemaPaths, model) {
return reduce(schemaPaths, (fields, schemaPath) => (
merge(fields, extractPath(schemaPath, model))
), {});
} | [
"function",
"extractPaths",
"(",
"schemaPaths",
",",
"model",
")",
"{",
"return",
"reduce",
"(",
"schemaPaths",
",",
"(",
"fields",
",",
"schemaPath",
")",
"=>",
"(",
"merge",
"(",
"fields",
",",
"extractPath",
"(",
"schemaPath",
",",
"model",
")",
")",
... | Merge sub-document tree chunks
@method extractPaths
@param {Object} schemaPaths
@param {Object} model
@return {Object) extractedSchemaPaths | [
"Merge",
"sub",
"-",
"document",
"tree",
"chunks"
] | 414c91e4b2081bf0d14ecd2de545f621713f5da7 | https://github.com/RisingStack/graffiti-mongoose/blob/414c91e4b2081bf0d14ecd2de545f621713f5da7/src/model/model.js#L115-L119 |
24,198 | RisingStack/graffiti-mongoose | src/model/model.js | getModel | function getModel(model) {
const schemaPaths = model.schema.paths;
const name = model.modelName;
const fields = extractPaths(schemaPaths, { name });
return {
name,
fields,
model
};
} | javascript | function getModel(model) {
const schemaPaths = model.schema.paths;
const name = model.modelName;
const fields = extractPaths(schemaPaths, { name });
return {
name,
fields,
model
};
} | [
"function",
"getModel",
"(",
"model",
")",
"{",
"const",
"schemaPaths",
"=",
"model",
".",
"schema",
".",
"paths",
";",
"const",
"name",
"=",
"model",
".",
"modelName",
";",
"const",
"fields",
"=",
"extractPaths",
"(",
"schemaPaths",
",",
"{",
"name",
"}... | Turn mongoose model to graffiti model
@method getModel
@param {Object} model Mongoose model
@return {Object} graffiti model | [
"Turn",
"mongoose",
"model",
"to",
"graffiti",
"model"
] | 414c91e4b2081bf0d14ecd2de545f621713f5da7 | https://github.com/RisingStack/graffiti-mongoose/blob/414c91e4b2081bf0d14ecd2de545f621713f5da7/src/model/model.js#L127-L138 |
24,199 | RisingStack/graffiti-mongoose | src/query/query.js | getIdFetcher | function getIdFetcher(graffitiModels) {
return function idFetcher(obj, { id: globalId }, context, info) {
const { type, id } = fromGlobalId(globalId);
if (type === 'Viewer') {
return viewer;
} else if (graffitiModels[type]) {
const Collection = graffitiModels[type].model;
return getOne(... | javascript | function getIdFetcher(graffitiModels) {
return function idFetcher(obj, { id: globalId }, context, info) {
const { type, id } = fromGlobalId(globalId);
if (type === 'Viewer') {
return viewer;
} else if (graffitiModels[type]) {
const Collection = graffitiModels[type].model;
return getOne(... | [
"function",
"getIdFetcher",
"(",
"graffitiModels",
")",
"{",
"return",
"function",
"idFetcher",
"(",
"obj",
",",
"{",
"id",
":",
"globalId",
"}",
",",
"context",
",",
"info",
")",
"{",
"const",
"{",
"type",
",",
"id",
"}",
"=",
"fromGlobalId",
"(",
"gl... | Returns an idFetcher function, that can resolve
an object based on a global id | [
"Returns",
"an",
"idFetcher",
"function",
"that",
"can",
"resolve",
"an",
"object",
"based",
"on",
"a",
"global",
"id"
] | 414c91e4b2081bf0d14ecd2de545f621713f5da7 | https://github.com/RisingStack/graffiti-mongoose/blob/414c91e4b2081bf0d14ecd2de545f621713f5da7/src/query/query.js#L198-L211 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.