repo stringlengths 5 67 | path stringlengths 4 116 | func_name stringlengths 0 58 | original_string stringlengths 52 373k | language stringclasses 1
value | code stringlengths 52 373k | code_tokens list | docstring stringlengths 4 11.8k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 86 226 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(value) {
if ([
['%5B', '%5D'],
['%7B', '%7D']
].some(function isencoded(tokens) {
return value.startsWith(tokens[0]) && value.endsWith(tokens[1]);
})) {
try {
value = JSON.parse(decodeURIComponent(value));
} catch (exception) {
value = null;
console.error(this + ': Bad JSON: ' ... | javascript | function(value) {
if ([
['%5B', '%5D'],
['%7B', '%7D']
].some(function isencoded(tokens) {
return value.startsWith(tokens[0]) && value.endsWith(tokens[1]);
})) {
try {
value = JSON.parse(decodeURIComponent(value));
} catch (exception) {
value = null;
console.error(this + ': Bad JSON: ' ... | [
"function",
"(",
"value",
")",
"{",
"if",
"(",
"[",
"[",
"'%5B'",
",",
"'%5D'",
"]",
",",
"[",
"'%7B'",
",",
"'%7D'",
"]",
"]",
".",
"some",
"(",
"function",
"isencoded",
"(",
"tokens",
")",
"{",
"return",
"value",
".",
"startsWith",
"(",
"tokens",... | JSONArray or JSONObject scrambled with encodeURIComponent?
If so, let's decode and parse this into an array or object.
@param {string} value
@returns {Array|Object>} | [
"JSONArray",
"or",
"JSONObject",
"scrambled",
"with",
"encodeURIComponent?",
"If",
"so",
"let",
"s",
"decode",
"and",
"parse",
"this",
"into",
"an",
"array",
"or",
"object",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L7448-L7463 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(name, value) {
var list, att, handler, trigger;
var triggers = !gui.attributes.every(function(prefix) {
if ((trigger = name.startsWith(prefix))) {
this.spirit.config.configureone(name, value);
}
return !trigger;
}, this);
if (!triggers && (list = this._trackedtypes[name])) {
at... | javascript | function(name, value) {
var list, att, handler, trigger;
var triggers = !gui.attributes.every(function(prefix) {
if ((trigger = name.startsWith(prefix))) {
this.spirit.config.configureone(name, value);
}
return !trigger;
}, this);
if (!triggers && (list = this._trackedtypes[name])) {
at... | [
"function",
"(",
"name",
",",
"value",
")",
"{",
"var",
"list",
",",
"att",
",",
"handler",
",",
"trigger",
";",
"var",
"triggers",
"=",
"!",
"gui",
".",
"attributes",
".",
"every",
"(",
"function",
"(",
"prefix",
")",
"{",
"if",
"(",
"(",
"trigger... | Trigger potential handlers for attribute update.
@param {String} name
@param {String} value | [
"Trigger",
"potential",
"handlers",
"for",
"attribute",
"update",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L7676-L7691 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(elm) {
var map = Object.create(null);
this.all(elm).forEach(function(att) {
map[att.name] = gui.Type.cast(att.value);
});
return map;
} | javascript | function(elm) {
var map = Object.create(null);
this.all(elm).forEach(function(att) {
map[att.name] = gui.Type.cast(att.value);
});
return map;
} | [
"function",
"(",
"elm",
")",
"{",
"var",
"map",
"=",
"Object",
".",
"create",
"(",
"null",
")",
";",
"this",
".",
"all",
"(",
"elm",
")",
".",
"forEach",
"(",
"function",
"(",
"att",
")",
"{",
"map",
"[",
"att",
".",
"name",
"]",
"=",
"gui",
... | Get all attributes as hashmap type object.
Values are converted to an inferred type.
@param {Element} elm
@returns {Map<String,String>} | [
"Get",
"all",
"attributes",
"as",
"hashmap",
"type",
"object",
".",
"Values",
"are",
"converted",
"to",
"an",
"inferred",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L7826-L7832 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(element, name) {
if (this._supports) {
return element.classList.contains(name);
} else {
var classnames = element.className.split(" ");
return classnames.indexOf(name) > -1;
}
} | javascript | function(element, name) {
if (this._supports) {
return element.classList.contains(name);
} else {
var classnames = element.className.split(" ");
return classnames.indexOf(name) > -1;
}
} | [
"function",
"(",
"element",
",",
"name",
")",
"{",
"if",
"(",
"this",
".",
"_supports",
")",
"{",
"return",
"element",
".",
"classList",
".",
"contains",
"(",
"name",
")",
";",
"}",
"else",
"{",
"var",
"classnames",
"=",
"element",
".",
"className",
... | classList.contains
@param {Element} element
@param {String} name
@returns {boolean} | [
"classList",
".",
"contains"
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8227-L8234 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(thing, prop) {
var element = thing instanceof gui.Spirit ? thing.element : thing;
var doc = element.ownerDocument,
win = doc.defaultView;
prop = this._standardcase(this.jsproperty(prop));
return win.getComputedStyle(element, null).getPropertyValue(prop);
} | javascript | function(thing, prop) {
var element = thing instanceof gui.Spirit ? thing.element : thing;
var doc = element.ownerDocument,
win = doc.defaultView;
prop = this._standardcase(this.jsproperty(prop));
return win.getComputedStyle(element, null).getPropertyValue(prop);
} | [
"function",
"(",
"thing",
",",
"prop",
")",
"{",
"var",
"element",
"=",
"thing",
"instanceof",
"gui",
".",
"Spirit",
"?",
"thing",
".",
"element",
":",
"thing",
";",
"var",
"doc",
"=",
"element",
".",
"ownerDocument",
",",
"win",
"=",
"doc",
".",
"de... | Compute runtime style.
@param {object} thing Spirit or element.
@param {String} prop
@returns {String} | [
"Compute",
"runtime",
"style",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8290-L8296 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(prop) {
var vendors = this._vendors,
fixt = prop;
var element = document.documentElement;
prop = String(prop);
if (prop.startsWith("-beta-")) {
vendors.every(function(vendor) {
var test = this._camelcase(prop.replace("-beta-", vendor));
if (element.style[test] !== undefined) {
... | javascript | function(prop) {
var vendors = this._vendors,
fixt = prop;
var element = document.documentElement;
prop = String(prop);
if (prop.startsWith("-beta-")) {
vendors.every(function(vendor) {
var test = this._camelcase(prop.replace("-beta-", vendor));
if (element.style[test] !== undefined) {
... | [
"function",
"(",
"prop",
")",
"{",
"var",
"vendors",
"=",
"this",
".",
"_vendors",
",",
"fixt",
"=",
"prop",
";",
"var",
"element",
"=",
"document",
".",
"documentElement",
";",
"prop",
"=",
"String",
"(",
"prop",
")",
";",
"if",
"(",
"prop",
".",
... | Normalize declaration property for use in element.style scenario.
@param {String} prop
@returns {String} | [
"Normalize",
"declaration",
"property",
"for",
"use",
"in",
"element",
".",
"style",
"scenario",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8313-L8331 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(value) {
var vendors = this._vendors;
var element = document.documentElement;
value = String(value);
if (value && value.contains("-beta-")) {
var parts = [];
value.split(", ").forEach(function(part) {
if ((part = part.trim()).startsWith("-beta-")) {
vendors.every(function(vendor)... | javascript | function(value) {
var vendors = this._vendors;
var element = document.documentElement;
value = String(value);
if (value && value.contains("-beta-")) {
var parts = [];
value.split(", ").forEach(function(part) {
if ((part = part.trim()).startsWith("-beta-")) {
vendors.every(function(vendor)... | [
"function",
"(",
"value",
")",
"{",
"var",
"vendors",
"=",
"this",
".",
"_vendors",
";",
"var",
"element",
"=",
"document",
".",
"documentElement",
";",
"value",
"=",
"String",
"(",
"value",
")",
";",
"if",
"(",
"value",
"&&",
"value",
".",
"contains",... | Normalize declaration value for use in element.style scenario.
@param {String} value
@returns {String} | [
"Normalize",
"declaration",
"value",
"for",
"use",
"in",
"element",
".",
"style",
"scenario",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8338-L8361 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(string) {
return string.replace(/[A-Z]/g, function(all, letter) {
return "-" + string.charAt(letter).toLowerCase();
});
} | javascript | function(string) {
return string.replace(/[A-Z]/g, function(all, letter) {
return "-" + string.charAt(letter).toLowerCase();
});
} | [
"function",
"(",
"string",
")",
"{",
"return",
"string",
".",
"replace",
"(",
"/",
"[A-Z]",
"/",
"g",
",",
"function",
"(",
"all",
",",
"letter",
")",
"{",
"return",
"\"-\"",
"+",
"string",
".",
"charAt",
"(",
"letter",
")",
".",
"toLowerCase",
"(",
... | standard-css-notate CamelCased string.
@param {String} string
@returns {String} | [
"standard",
"-",
"css",
"-",
"notate",
"CamelCased",
"string",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8413-L8417 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(element) {
var result = 0;
var parent = element.parentNode;
if (parent) {
var node = parent.firstElementChild;
while (node) {
if (node === element) {
break;
} else {
node = node.nextElementSibling;
result++;
}
}
}
return result;
} | javascript | function(element) {
var result = 0;
var parent = element.parentNode;
if (parent) {
var node = parent.firstElementChild;
while (node) {
if (node === element) {
break;
} else {
node = node.nextElementSibling;
result++;
}
}
}
return result;
} | [
"function",
"(",
"element",
")",
"{",
"var",
"result",
"=",
"0",
";",
"var",
"parent",
"=",
"element",
".",
"parentNode",
";",
"if",
"(",
"parent",
")",
"{",
"var",
"node",
"=",
"parent",
".",
"firstElementChild",
";",
"while",
"(",
"node",
")",
"{",... | Get ordinal position of element within container.
@param {Element} element
@returns {number} | [
"Get",
"ordinal",
"position",
"of",
"element",
"within",
"container",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8770-L8785 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(node1, node2) {
node1 = node1 instanceof gui.Spirit ? node1.element : node1;
node2 = node2 instanceof gui.Spirit ? node2.element : node2;
return node1.compareDocumentPosition(node2);
} | javascript | function(node1, node2) {
node1 = node1 instanceof gui.Spirit ? node1.element : node1;
node2 = node2 instanceof gui.Spirit ? node2.element : node2;
return node1.compareDocumentPosition(node2);
} | [
"function",
"(",
"node1",
",",
"node2",
")",
"{",
"node1",
"=",
"node1",
"instanceof",
"gui",
".",
"Spirit",
"?",
"node1",
".",
"element",
":",
"node1",
";",
"node2",
"=",
"node2",
"instanceof",
"gui",
".",
"Spirit",
"?",
"node2",
".",
"element",
":",
... | Compare document position of two nodes.
@see http://mdn.io/compareDocumentPosition
@param {Node|gui.Spirit} node1
@param {Node|gui.Spirit} node2
@returns {number} | [
"Compare",
"document",
"position",
"of",
"two",
"nodes",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8794-L8798 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(node, othernode) {
var check = Node.DOCUMENT_POSITION_CONTAINS + Node.DOCUMENT_POSITION_PRECEDING;
return this.compare(othernode, node) === check;
} | javascript | function(node, othernode) {
var check = Node.DOCUMENT_POSITION_CONTAINS + Node.DOCUMENT_POSITION_PRECEDING;
return this.compare(othernode, node) === check;
} | [
"function",
"(",
"node",
",",
"othernode",
")",
"{",
"var",
"check",
"=",
"Node",
".",
"DOCUMENT_POSITION_CONTAINS",
"+",
"Node",
".",
"DOCUMENT_POSITION_PRECEDING",
";",
"return",
"this",
".",
"compare",
"(",
"othernode",
",",
"node",
")",
"===",
"check",
"... | Node contains other node?
@param {Node|gui.Spirit} node
@param {Node|gui.Spirit} othernode
@returns {boolean} | [
"Node",
"contains",
"other",
"node?"
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8806-L8809 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(node) {
node = node instanceof gui.Spirit ? node.element : node;
return this.contains(node.ownerDocument, node);
} | javascript | function(node) {
node = node instanceof gui.Spirit ? node.element : node;
return this.contains(node.ownerDocument, node);
} | [
"function",
"(",
"node",
")",
"{",
"node",
"=",
"node",
"instanceof",
"gui",
".",
"Spirit",
"?",
"node",
".",
"element",
":",
"node",
";",
"return",
"this",
".",
"contains",
"(",
"node",
".",
"ownerDocument",
",",
"node",
")",
";",
"}"
] | Is node positioned in page DOM?
@param {Element|gui.Spirit} node
@returns {boolean} | [
"Is",
"node",
"positioned",
"in",
"page",
"DOM?"
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8836-L8839 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(nodes) {
var node, groups = [];
function containedby(target, others) {
return others.some(function(other) {
return gui.DOMPlugin.contains(other, target);
});
}
while ((node = nodes.pop())) {
if (!containedby(node, nodes)) {
groups.push(node);
}
}
return groups;
} | javascript | function(nodes) {
var node, groups = [];
function containedby(target, others) {
return others.some(function(other) {
return gui.DOMPlugin.contains(other, target);
});
}
while ((node = nodes.pop())) {
if (!containedby(node, nodes)) {
groups.push(node);
}
}
return groups;
} | [
"function",
"(",
"nodes",
")",
"{",
"var",
"node",
",",
"groups",
"=",
"[",
"]",
";",
"function",
"containedby",
"(",
"target",
",",
"others",
")",
"{",
"return",
"others",
".",
"some",
"(",
"function",
"(",
"other",
")",
"{",
"return",
"gui",
".",
... | Remove from list all nodes that are contained by others.
@param {Array<Element|gui.Spirit>} nodes
@returns {Array<Element|gui.Spirit>} | [
"Remove",
"from",
"list",
"all",
"nodes",
"that",
"are",
"contained",
"by",
"others",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8846-L8860 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(node, selector, type) {
var result = null;
return this._qualify(node, selector)(function(node, selector) {
if (type) {
result = this.qall(node, selector, type)[0] || null;
} else {
try {
result = node.querySelector(selector);
} catch (exception) {
console.error("Dysfunc... | javascript | function(node, selector, type) {
var result = null;
return this._qualify(node, selector)(function(node, selector) {
if (type) {
result = this.qall(node, selector, type)[0] || null;
} else {
try {
result = node.querySelector(selector);
} catch (exception) {
console.error("Dysfunc... | [
"function",
"(",
"node",
",",
"selector",
",",
"type",
")",
"{",
"var",
"result",
"=",
"null",
";",
"return",
"this",
".",
"_qualify",
"(",
"node",
",",
"selector",
")",
"(",
"function",
"(",
"node",
",",
"selector",
")",
"{",
"if",
"(",
"type",
")... | Get first element that matches a selector.
Optional type argument filters to spirit of type.
@param {Node} node
@param {String} selector
@param @optional {function} type
@returns {Element|gui.Spirit} | [
"Get",
"first",
"element",
"that",
"matches",
"a",
"selector",
".",
"Optional",
"type",
"argument",
"filters",
"to",
"spirit",
"of",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8870-L8885 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type) {
var result = null,
spirit = null,
el = this.spirit.element;
if (type) {
while ((el = el.nextElementSibling) !== null) {
spirit = el.spirit;
if (spirit !== null && spirit instanceof type) {
result = spirit;
break;
}
}
} else {
result = el.nextEleme... | javascript | function(type) {
var result = null,
spirit = null,
el = this.spirit.element;
if (type) {
while ((el = el.nextElementSibling) !== null) {
spirit = el.spirit;
if (spirit !== null && spirit instanceof type) {
result = spirit;
break;
}
}
} else {
result = el.nextEleme... | [
"function",
"(",
"type",
")",
"{",
"var",
"result",
"=",
"null",
",",
"spirit",
"=",
"null",
",",
"el",
"=",
"this",
".",
"spirit",
".",
"element",
";",
"if",
"(",
"type",
")",
"{",
"while",
"(",
"(",
"el",
"=",
"el",
".",
"nextElementSibling",
"... | Next element or next spirit of given type.
@param @optional {function} type Spirit constructor
@returns {Element|gui.Spirit} | [
"Next",
"element",
"or",
"next",
"spirit",
"of",
"given",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9067-L9083 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type) {
var result = null,
spirit = null,
el = this.spirit.element;
if (type) {
while ((el = el.previousElementSibling) !== null) {
spirit = el.spirit;
if (spirit !== null && spirit instanceof type) {
result = spirit;
break;
}
}
} else {
result = el.previ... | javascript | function(type) {
var result = null,
spirit = null,
el = this.spirit.element;
if (type) {
while ((el = el.previousElementSibling) !== null) {
spirit = el.spirit;
if (spirit !== null && spirit instanceof type) {
result = spirit;
break;
}
}
} else {
result = el.previ... | [
"function",
"(",
"type",
")",
"{",
"var",
"result",
"=",
"null",
",",
"spirit",
"=",
"null",
",",
"el",
"=",
"this",
".",
"spirit",
".",
"element",
";",
"if",
"(",
"type",
")",
"{",
"while",
"(",
"(",
"el",
"=",
"el",
".",
"previousElementSibling",... | Previous element or previous spirit of given type.
@param @optional {function} type Spirit constructor
@returns {Element|gui.Spirit} | [
"Previous",
"element",
"or",
"previous",
"spirit",
"of",
"given",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9090-L9106 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type) {
var result = null,
spirit = null,
el = this.spirit.element.lastElementChild;
if (type) {
while (result === null && el !== null) {
spirit = el.spirit;
if (spirit !== null && spirit instanceof type) {
result = spirit;
}
el = el.previoustElementSibling;
}
... | javascript | function(type) {
var result = null,
spirit = null,
el = this.spirit.element.lastElementChild;
if (type) {
while (result === null && el !== null) {
spirit = el.spirit;
if (spirit !== null && spirit instanceof type) {
result = spirit;
}
el = el.previoustElementSibling;
}
... | [
"function",
"(",
"type",
")",
"{",
"var",
"result",
"=",
"null",
",",
"spirit",
"=",
"null",
",",
"el",
"=",
"this",
".",
"spirit",
".",
"element",
".",
"lastElementChild",
";",
"if",
"(",
"type",
")",
"{",
"while",
"(",
"result",
"===",
"null",
"&... | Last element or last spirit of type.
@param @optional {function} type Spirit constructor
@returns {Element|gui.Spirit} | [
"Last",
"element",
"or",
"last",
"spirit",
"of",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9136-L9152 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type) {
var result = this.spirit.element.parentNode;
if (type) {
var spirit = result.spirit;
if (spirit && spirit instanceof type) {
result = spirit;
} else {
result = null;
}
}
return result;
} | javascript | function(type) {
var result = this.spirit.element.parentNode;
if (type) {
var spirit = result.spirit;
if (spirit && spirit instanceof type) {
result = spirit;
} else {
result = null;
}
}
return result;
} | [
"function",
"(",
"type",
")",
"{",
"var",
"result",
"=",
"this",
".",
"spirit",
".",
"element",
".",
"parentNode",
";",
"if",
"(",
"type",
")",
"{",
"var",
"spirit",
"=",
"result",
".",
"spirit",
";",
"if",
"(",
"spirit",
"&&",
"spirit",
"instanceof"... | Parent parent or parent spirit of type.
@param @optional {function} type Spirit constructor
@returns {Element|gui.Spirit} | [
"Parent",
"parent",
"or",
"parent",
"spirit",
"of",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9159-L9170 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type) {
var result = this.spirit.element.firstElementChild;
if (type) {
result = this.children(type)[0] || null;
}
return result;
} | javascript | function(type) {
var result = this.spirit.element.firstElementChild;
if (type) {
result = this.children(type)[0] || null;
}
return result;
} | [
"function",
"(",
"type",
")",
"{",
"var",
"result",
"=",
"this",
".",
"spirit",
".",
"element",
".",
"firstElementChild",
";",
"if",
"(",
"type",
")",
"{",
"result",
"=",
"this",
".",
"children",
"(",
"type",
")",
"[",
"0",
"]",
"||",
"null",
";",
... | Child element or child spirit of type.
@param @optional {function} type Spirit constructor
@returns {Element|gui.Spirit} | [
"Child",
"element",
"or",
"child",
"spirit",
"of",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9177-L9183 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type) {
var result = [];
var crawler = new gui.Crawler();
if (type) {
crawler.ascend(this.element, {
handleSpirit: function(spirit) {
if (spirit instanceof type) {
result.push(spirit);
}
}
});
} else {
crawler.ascend(this.element, {
handleElement: funct... | javascript | function(type) {
var result = [];
var crawler = new gui.Crawler();
if (type) {
crawler.ascend(this.element, {
handleSpirit: function(spirit) {
if (spirit instanceof type) {
result.push(spirit);
}
}
});
} else {
crawler.ascend(this.element, {
handleElement: funct... | [
"function",
"(",
"type",
")",
"{",
"var",
"result",
"=",
"[",
"]",
";",
"var",
"crawler",
"=",
"new",
"gui",
".",
"Crawler",
"(",
")",
";",
"if",
"(",
"type",
")",
"{",
"crawler",
".",
"ascend",
"(",
"this",
".",
"element",
",",
"{",
"handleSpiri... | First ancestor elements or ancestor spirits of type.
@param @optional {function} type Spirit constructor
@returns {Array<Element|gui.Spirit>} | [
"First",
"ancestor",
"elements",
"or",
"ancestor",
"spirits",
"of",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9229-L9248 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type) {
var result = [];
var me = this.spirit.element;
new gui.Crawler().descend(me, {
handleElement: function(element) {
if (!type && element !== me) {
result.push(element);
}
},
handleSpirit: function(spirit) {
if (type && spirit instanceof type) {
if (spirit.e... | javascript | function(type) {
var result = [];
var me = this.spirit.element;
new gui.Crawler().descend(me, {
handleElement: function(element) {
if (!type && element !== me) {
result.push(element);
}
},
handleSpirit: function(spirit) {
if (type && spirit instanceof type) {
if (spirit.e... | [
"function",
"(",
"type",
")",
"{",
"var",
"result",
"=",
"[",
"]",
";",
"var",
"me",
"=",
"this",
".",
"spirit",
".",
"element",
";",
"new",
"gui",
".",
"Crawler",
"(",
")",
".",
"descend",
"(",
"me",
",",
"{",
"handleElement",
":",
"function",
"... | All descendant elements or all descendant spirits of type.
@param @optional {function} type Spirit constructor
@returns {Array<Element|gui.Spirit>} | [
"All",
"descendant",
"elements",
"or",
"all",
"descendant",
"spirits",
"of",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9278-L9296 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type) {
var result = [],
spirit, el = this.spirit.element;
while ((el = el.nextElementSibling)) {
if (type && (spirit = el.spirit)) {
if (spirit instanceof type) {
result.push(spirit);
}
} else {
result.push(el);
}
}
return result;
} | javascript | function(type) {
var result = [],
spirit, el = this.spirit.element;
while ((el = el.nextElementSibling)) {
if (type && (spirit = el.spirit)) {
if (spirit instanceof type) {
result.push(spirit);
}
} else {
result.push(el);
}
}
return result;
} | [
"function",
"(",
"type",
")",
"{",
"var",
"result",
"=",
"[",
"]",
",",
"spirit",
",",
"el",
"=",
"this",
".",
"spirit",
".",
"element",
";",
"while",
"(",
"(",
"el",
"=",
"el",
".",
"nextElementSibling",
")",
")",
"{",
"if",
"(",
"type",
"&&",
... | Get following sibling elements or spirits of type.
@param @optional {function} type
@returns {Array<element|gui.Spirit>} | [
"Get",
"following",
"sibling",
"elements",
"or",
"spirits",
"of",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9303-L9316 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type) {
var result = [],
spirit, el = this.spirit.element;
while ((el = el.previousElementSibling)) {
if (type && (spirit = el.spirit)) {
if (spirit instanceof type) {
result.push(spirit);
}
} else {
result.push(el);
}
}
return result;
} | javascript | function(type) {
var result = [],
spirit, el = this.spirit.element;
while ((el = el.previousElementSibling)) {
if (type && (spirit = el.spirit)) {
if (spirit instanceof type) {
result.push(spirit);
}
} else {
result.push(el);
}
}
return result;
} | [
"function",
"(",
"type",
")",
"{",
"var",
"result",
"=",
"[",
"]",
",",
"spirit",
",",
"el",
"=",
"this",
".",
"spirit",
".",
"element",
";",
"while",
"(",
"(",
"el",
"=",
"el",
".",
"previousElementSibling",
")",
")",
"{",
"if",
"(",
"type",
"&&... | Get preceding sibling elements or spirits of type.
@param @optional {function} type
@returns {Array<element|gui.Spirit>} | [
"Get",
"preceding",
"sibling",
"elements",
"or",
"spirits",
"of",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9323-L9336 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(things) {
var els = things,
element = this.spirit.element;
els.forEach(function(el) {
element.appendChild(el);
maybespiritualize(el);
});
} | javascript | function(things) {
var els = things,
element = this.spirit.element;
els.forEach(function(el) {
element.appendChild(el);
maybespiritualize(el);
});
} | [
"function",
"(",
"things",
")",
"{",
"var",
"els",
"=",
"things",
",",
"element",
"=",
"this",
".",
"spirit",
".",
"element",
";",
"els",
".",
"forEach",
"(",
"function",
"(",
"el",
")",
"{",
"element",
".",
"appendChild",
"(",
"el",
")",
";",
"may... | Append spirit OR element OR array of either.
@param {object} things Complicated argument
@returns {object} Returns the argument | [
"Append",
"spirit",
"OR",
"element",
"OR",
"array",
"of",
"either",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9438-L9445 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(things) {
var els = things,
element = this.spirit.element,
first = element.firstChild;
els.reverse().forEach(function(el) {
element.insertBefore(el, first);
maybespiritualize(el);
});
} | javascript | function(things) {
var els = things,
element = this.spirit.element,
first = element.firstChild;
els.reverse().forEach(function(el) {
element.insertBefore(el, first);
maybespiritualize(el);
});
} | [
"function",
"(",
"things",
")",
"{",
"var",
"els",
"=",
"things",
",",
"element",
"=",
"this",
".",
"spirit",
".",
"element",
",",
"first",
"=",
"element",
".",
"firstChild",
";",
"els",
".",
"reverse",
"(",
")",
".",
"forEach",
"(",
"function",
"(",... | Prepend spirit OR element OR array of either.
@param {object} things Complicated argument
@returns {object} Returns the argument | [
"Prepend",
"spirit",
"OR",
"element",
"OR",
"array",
"of",
"either",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9452-L9460 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(things) {
var els = things,
target = this.spirit.element,
parent = target.parentNode;
els.reverse().forEach(function(el) {
parent.insertBefore(el, target);
maybespiritualize(el);
});
} | javascript | function(things) {
var els = things,
target = this.spirit.element,
parent = target.parentNode;
els.reverse().forEach(function(el) {
parent.insertBefore(el, target);
maybespiritualize(el);
});
} | [
"function",
"(",
"things",
")",
"{",
"var",
"els",
"=",
"things",
",",
"target",
"=",
"this",
".",
"spirit",
".",
"element",
",",
"parent",
"=",
"target",
".",
"parentNode",
";",
"els",
".",
"reverse",
"(",
")",
".",
"forEach",
"(",
"function",
"(",
... | Insert spirit OR element OR array of either before this spirit.
@param {object} things Complicated argument
@returns {object} Returns the argument | [
"Insert",
"spirit",
"OR",
"element",
"OR",
"array",
"of",
"either",
"before",
"this",
"spirit",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9467-L9475 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type, checks) {
var target = checks[0];
var handler = checks[1];
var capture = checks[2];
this.remove(type, target, handler, capture);
} | javascript | function(type, checks) {
var target = checks[0];
var handler = checks[1];
var capture = checks[2];
this.remove(type, target, handler, capture);
} | [
"function",
"(",
"type",
",",
"checks",
")",
"{",
"var",
"target",
"=",
"checks",
"[",
"0",
"]",
";",
"var",
"handler",
"=",
"checks",
"[",
"1",
"]",
";",
"var",
"capture",
"=",
"checks",
"[",
"2",
"]",
";",
"this",
".",
"remove",
"(",
"type",
... | Remove event listeners.
@overwrites {gui.Tracker#_cleanup}
@param {String} type
@param {Array<object>} checks | [
"Remove",
"event",
"listeners",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9683-L9688 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(arg) {
return gui.TrackerPlugin.prototype._breakdown.call(this, arg).map(function(type) {
return type === 'transitionend' ? this._transitionend() : type;
}, this);
} | javascript | function(arg) {
return gui.TrackerPlugin.prototype._breakdown.call(this, arg).map(function(type) {
return type === 'transitionend' ? this._transitionend() : type;
}, this);
} | [
"function",
"(",
"arg",
")",
"{",
"return",
"gui",
".",
"TrackerPlugin",
".",
"prototype",
".",
"_breakdown",
".",
"call",
"(",
"this",
",",
"arg",
")",
".",
"map",
"(",
"function",
"(",
"type",
")",
"{",
"return",
"type",
"===",
"'transitionend'",
"?"... | Manhandle 'transitionend' event. Seems only Safari is left now...
@param {Array<String>|String} arg
@returns {Array<String>} | [
"Manhandle",
"transitionend",
"event",
".",
"Seems",
"only",
"Safari",
"is",
"left",
"now",
"..."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9695-L9699 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
if (true || gui.Client.has3D) {
this.spirit.css.set("-beta-transform", "");
} else {
this.spirit.css.left = "";
this.spirit.css.top = "";
}
} | javascript | function() {
if (true || gui.Client.has3D) {
this.spirit.css.set("-beta-transform", "");
} else {
this.spirit.css.left = "";
this.spirit.css.top = "";
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"true",
"||",
"gui",
".",
"Client",
".",
"has3D",
")",
"{",
"this",
".",
"spirit",
".",
"css",
".",
"set",
"(",
"\"-beta-transform\"",
",",
"\"\"",
")",
";",
"}",
"else",
"{",
"this",
".",
"spirit",
".",
"css... | Reset transformations. | [
"Reset",
"transformations",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9815-L9822 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
var pos = this._pos;
var set = [pos.x, pos.y, pos.z].map(Math.round);
if (true || gui.Client.has3D) {
this.spirit.css.set("-beta-transform",
"translate3d(" + set.join("px,") + "px)"
);
} else {
this.spirit.css.left = set [0];
this.spirit.css.top = set [1];
}
} | javascript | function() {
var pos = this._pos;
var set = [pos.x, pos.y, pos.z].map(Math.round);
if (true || gui.Client.has3D) {
this.spirit.css.set("-beta-transform",
"translate3d(" + set.join("px,") + "px)"
);
} else {
this.spirit.css.left = set [0];
this.spirit.css.top = set [1];
}
} | [
"function",
"(",
")",
"{",
"var",
"pos",
"=",
"this",
".",
"_pos",
";",
"var",
"set",
"=",
"[",
"pos",
".",
"x",
",",
"pos",
".",
"y",
",",
"pos",
".",
"z",
"]",
".",
"map",
"(",
"Math",
".",
"round",
")",
";",
"if",
"(",
"true",
"||",
"g... | Go ahead. | [
"Go",
"ahead",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9836-L9847 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(elm, doc, win, sig) { // TODO: get rid of all these!
this.element = elm;
this.document = doc;
this.window = win;
this.$contextid = sig;
gui.Spirit.$construct(this);
} | javascript | function(elm, doc, win, sig) { // TODO: get rid of all these!
this.element = elm;
this.document = doc;
this.window = win;
this.$contextid = sig;
gui.Spirit.$construct(this);
} | [
"function",
"(",
"elm",
",",
"doc",
",",
"win",
",",
"sig",
")",
"{",
"// TODO: get rid of all these!",
"this",
".",
"element",
"=",
"elm",
";",
"this",
".",
"document",
"=",
"doc",
";",
"this",
".",
"window",
"=",
"win",
";",
"this",
".",
"$contextid"... | Secret constructor invoked before `onconstruct`.
@param {Element} elm
@param {Document} doc
@param {Window} win
@param {String} sig | [
"Secret",
"constructor",
"invoked",
"before",
"onconstruct",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10022-L10028 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
var Plugin, plugins = this.constructor.$plugins;
this.life = new gui.LifePlugin(this);
this.config = new gui.ConfigPlugin(this);
Object.keys(plugins).filter(function(prefix) {
return prefix !== "life" && prefix !== "config";
}).sort().forEach(function(prefix) {
Plugin = plugins[prefix];
... | javascript | function() {
var Plugin, plugins = this.constructor.$plugins;
this.life = new gui.LifePlugin(this);
this.config = new gui.ConfigPlugin(this);
Object.keys(plugins).filter(function(prefix) {
return prefix !== "life" && prefix !== "config";
}).sort().forEach(function(prefix) {
Plugin = plugins[prefix];
... | [
"function",
"(",
")",
"{",
"var",
"Plugin",
",",
"plugins",
"=",
"this",
".",
"constructor",
".",
"$plugins",
";",
"this",
".",
"life",
"=",
"new",
"gui",
".",
"LifePlugin",
"(",
"this",
")",
";",
"this",
".",
"config",
"=",
"new",
"gui",
".",
"Con... | Plug in the plugins. Lazy plugins will be newed up when needed.
- {gui.LifePlugin} first
- {gui.ConfigPlugin} second
- bonus plugins galore
@TODO: To preserve order, refactor plugins stack from object to array | [
"Plug",
"in",
"the",
"plugins",
".",
"Lazy",
"plugins",
"will",
"be",
"newed",
"up",
"when",
"needed",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10044-L10058 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(constructing) {
if (gui.debug) {
var val, elm = this.element;
var fix = gui.attributes[0]; // by default using `gui`
if (constructing) {
if (gui.attributes.every(function(f) {
return !elm.hasAttribute(f);
})) {
val = "[" + this.constructor.$classname + "]";
elm.setAttribute(fi... | javascript | function(constructing) {
if (gui.debug) {
var val, elm = this.element;
var fix = gui.attributes[0]; // by default using `gui`
if (constructing) {
if (gui.attributes.every(function(f) {
return !elm.hasAttribute(f);
})) {
val = "[" + this.constructor.$classname + "]";
elm.setAttribute(fi... | [
"function",
"(",
"constructing",
")",
"{",
"if",
"(",
"gui",
".",
"debug",
")",
"{",
"var",
"val",
",",
"elm",
"=",
"this",
".",
"element",
";",
"var",
"fix",
"=",
"gui",
".",
"attributes",
"[",
"0",
"]",
";",
"// by default using `gui`",
"if",
"(",
... | In debug mode, stamp the spirit constructor name onto the spirit element.
Square brackets indicate that the `gui` attribute was added by this method.
@param {boolean} constructing | [
"In",
"debug",
"mode",
"stamp",
"the",
"spirit",
"constructor",
"name",
"onto",
"the",
"spirit",
"element",
".",
"Square",
"brackets",
"indicate",
"that",
"the",
"gui",
"attribute",
"was",
"added",
"by",
"this",
"method",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10065-L10083 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
var C = gui.Class.extend.apply(this, arguments);
C.$plugins = gui.Object.copy(this.$plugins);
return C;
/*
* Mutating plugins deprecated!
*
var args = [],
def, br = gui.Class.breakdown(arguments);
["name", "protos", "recurring", "statics"].forEach(function(key) {
if ((def = br[key])... | javascript | function() {
var C = gui.Class.extend.apply(this, arguments);
C.$plugins = gui.Object.copy(this.$plugins);
return C;
/*
* Mutating plugins deprecated!
*
var args = [],
def, br = gui.Class.breakdown(arguments);
["name", "protos", "recurring", "statics"].forEach(function(key) {
if ((def = br[key])... | [
"function",
"(",
")",
"{",
"var",
"C",
"=",
"gui",
".",
"Class",
".",
"extend",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"C",
".",
"$plugins",
"=",
"gui",
".",
"Object",
".",
"copy",
"(",
"this",
".",
"$plugins",
")",
";",
"return",... | Extend with plugins.
@TODO: move all this to {gui.Class}
@TODO: validate that user isn't declaring non-primitives on the prototype
@param {object} extension
@param {object} recurring
@param {object} statics
@returns {gui.Spirit} | [
"Extend",
"with",
"plugins",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10122-L10156 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(spirit) {
spirit.config.configureall();
spirit.life.configured = true;
spirit.onconfigure();
spirit.life.dispatch(gui.LIFE_CONFIGURE);
} | javascript | function(spirit) {
spirit.config.configureall();
spirit.life.configured = true;
spirit.onconfigure();
spirit.life.dispatch(gui.LIFE_CONFIGURE);
} | [
"function",
"(",
"spirit",
")",
"{",
"spirit",
".",
"config",
".",
"configureall",
"(",
")",
";",
"spirit",
".",
"life",
".",
"configured",
"=",
"true",
";",
"spirit",
".",
"onconfigure",
"(",
")",
";",
"spirit",
".",
"life",
".",
"dispatch",
"(",
"g... | Spirit configure.
@param {gui.Spirit} spirit | [
"Spirit",
"configure",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10212-L10217 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(spirit) {
spirit.window.gui.inside(spirit);
spirit.life.entered = true;
spirit.onenter();
spirit.life.dispatch(gui.LIFE_ENTER);
} | javascript | function(spirit) {
spirit.window.gui.inside(spirit);
spirit.life.entered = true;
spirit.onenter();
spirit.life.dispatch(gui.LIFE_ENTER);
} | [
"function",
"(",
"spirit",
")",
"{",
"spirit",
".",
"window",
".",
"gui",
".",
"inside",
"(",
"spirit",
")",
";",
"spirit",
".",
"life",
".",
"entered",
"=",
"true",
";",
"spirit",
".",
"onenter",
"(",
")",
";",
"spirit",
".",
"life",
".",
"dispatc... | Spirit enter.
@param {gui.Spirit} spirit | [
"Spirit",
"enter",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10223-L10228 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(spirit) {
spirit.window.gui.inside(spirit);
spirit.life.attached = true;
spirit.onattach();
spirit.life.dispatch(gui.LIFE_ATTACH);
} | javascript | function(spirit) {
spirit.window.gui.inside(spirit);
spirit.life.attached = true;
spirit.onattach();
spirit.life.dispatch(gui.LIFE_ATTACH);
} | [
"function",
"(",
"spirit",
")",
"{",
"spirit",
".",
"window",
".",
"gui",
".",
"inside",
"(",
"spirit",
")",
";",
"spirit",
".",
"life",
".",
"attached",
"=",
"true",
";",
"spirit",
".",
"onattach",
"(",
")",
";",
"spirit",
".",
"life",
".",
"dispa... | Spirit attach.
@param {gui.Spirit} spirit | [
"Spirit",
"attach",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10234-L10239 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(spirit) {
spirit.life.ready = true;
spirit.onready();
spirit.life.dispatch(gui.LIFE_READY);
} | javascript | function(spirit) {
spirit.life.ready = true;
spirit.onready();
spirit.life.dispatch(gui.LIFE_READY);
} | [
"function",
"(",
"spirit",
")",
"{",
"spirit",
".",
"life",
".",
"ready",
"=",
"true",
";",
"spirit",
".",
"onready",
"(",
")",
";",
"spirit",
".",
"life",
".",
"dispatch",
"(",
"gui",
".",
"LIFE_READY",
")",
";",
"}"
] | Spirit ready.
@param {gui.Spirit} spirit | [
"Spirit",
"ready",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10245-L10249 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(spirit) {
spirit.window.gui.outside(spirit);
spirit.life.detached = true;
spirit.life.visible = false;
spirit.life.dispatch(gui.LIFE_DETACH);
spirit.life.dispatch(gui.LIFE_INVISIBLE);
spirit.ondetach();
} | javascript | function(spirit) {
spirit.window.gui.outside(spirit);
spirit.life.detached = true;
spirit.life.visible = false;
spirit.life.dispatch(gui.LIFE_DETACH);
spirit.life.dispatch(gui.LIFE_INVISIBLE);
spirit.ondetach();
} | [
"function",
"(",
"spirit",
")",
"{",
"spirit",
".",
"window",
".",
"gui",
".",
"outside",
"(",
"spirit",
")",
";",
"spirit",
".",
"life",
".",
"detached",
"=",
"true",
";",
"spirit",
".",
"life",
".",
"visible",
"=",
"false",
";",
"spirit",
".",
"l... | Spirit detach.
@param {gui.Spirit} spirit | [
"Spirit",
"detach",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10255-L10262 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(spirit) {
spirit.life.exited = true;
spirit.life.dispatch(gui.LIFE_EXIT);
spirit.onexit();
} | javascript | function(spirit) {
spirit.life.exited = true;
spirit.life.dispatch(gui.LIFE_EXIT);
spirit.onexit();
} | [
"function",
"(",
"spirit",
")",
"{",
"spirit",
".",
"life",
".",
"exited",
"=",
"true",
";",
"spirit",
".",
"life",
".",
"dispatch",
"(",
"gui",
".",
"LIFE_EXIT",
")",
";",
"spirit",
".",
"onexit",
"(",
")",
";",
"}"
] | Spirit exit.
@param {gui.Spirit} spirit | [
"Spirit",
"exit",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10268-L10272 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(spirit) {
spirit.life.async = true;
spirit.onasync(); // TODO: life cycle stuff goes here
spirit.life.dispatch(gui.LIFE_ASYNC);
} | javascript | function(spirit) {
spirit.life.async = true;
spirit.onasync(); // TODO: life cycle stuff goes here
spirit.life.dispatch(gui.LIFE_ASYNC);
} | [
"function",
"(",
"spirit",
")",
"{",
"spirit",
".",
"life",
".",
"async",
"=",
"true",
";",
"spirit",
".",
"onasync",
"(",
")",
";",
"// TODO: life cycle stuff goes here",
"spirit",
".",
"life",
".",
"dispatch",
"(",
"gui",
".",
"LIFE_ASYNC",
")",
";",
"... | Spirit async.
@TODO: This should be evaluated after `appendChild` to another position.
@param {gui.Spirit} spirit | [
"Spirit",
"async",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10279-L10283 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(spirit) {
spirit.$debug(false);
spirit.life.destructed = true;
spirit.life.dispatch(gui.LIFE_DESTRUCT);
spirit.ondestruct();
} | javascript | function(spirit) {
spirit.$debug(false);
spirit.life.destructed = true;
spirit.life.dispatch(gui.LIFE_DESTRUCT);
spirit.ondestruct();
} | [
"function",
"(",
"spirit",
")",
"{",
"spirit",
".",
"$debug",
"(",
"false",
")",
";",
"spirit",
".",
"life",
".",
"destructed",
"=",
"true",
";",
"spirit",
".",
"life",
".",
"dispatch",
"(",
"gui",
".",
"LIFE_DESTRUCT",
")",
";",
"spirit",
".",
"onde... | Spirit destruct.
@param {gui.Spirit} spirit | [
"Spirit",
"destruct",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10289-L10294 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(a) {
gui.Spirit.prototype.onaction.call(this, a);
this.action.$handleownaction = false;
switch (a.type) {
case gui.$ACTION_XFRAME_VISIBILITY:
this._waiting = false;
if (gui.hasModule("gui-layout@wunderbyte.com")) { // TODO: - fix
if (a.data === true) {
this.visibility.on();
} e... | javascript | function(a) {
gui.Spirit.prototype.onaction.call(this, a);
this.action.$handleownaction = false;
switch (a.type) {
case gui.$ACTION_XFRAME_VISIBILITY:
this._waiting = false;
if (gui.hasModule("gui-layout@wunderbyte.com")) { // TODO: - fix
if (a.data === true) {
this.visibility.on();
} e... | [
"function",
"(",
"a",
")",
"{",
"gui",
".",
"Spirit",
".",
"prototype",
".",
"onaction",
".",
"call",
"(",
"this",
",",
"a",
")",
";",
"this",
".",
"action",
".",
"$handleownaction",
"=",
"false",
";",
"switch",
"(",
"a",
".",
"type",
")",
"{",
"... | Handle action.s
@param {gui.Action} a | [
"Handle",
"action",
".",
"s"
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10346-L10362 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
gui.Spirit.prototype.onenter.call(this);
this.event.add('load');
this.action.addGlobal([ // in order of appearance
gui.ACTION_DOC_ONDOMCONTENT,
gui.ACTION_DOC_ONLOAD,
gui.ACTION_DOC_ONHASH,
gui.ACTION_DOC_ONSPIRITUALIZED,
gui.ACTION_DOC_UNLOAD
]);
if (this.fit) {
this.css.height... | javascript | function() {
gui.Spirit.prototype.onenter.call(this);
this.event.add('load');
this.action.addGlobal([ // in order of appearance
gui.ACTION_DOC_ONDOMCONTENT,
gui.ACTION_DOC_ONLOAD,
gui.ACTION_DOC_ONHASH,
gui.ACTION_DOC_ONSPIRITUALIZED,
gui.ACTION_DOC_UNLOAD
]);
if (this.fit) {
this.css.height... | [
"function",
"(",
")",
"{",
"gui",
".",
"Spirit",
".",
"prototype",
".",
"onenter",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"event",
".",
"add",
"(",
"'load'",
")",
";",
"this",
".",
"action",
".",
"addGlobal",
"(",
"[",
"// in order of appea... | Stamp SRC on startup.
Configure content document events in order of
appearance and resolve current contentLocation. | [
"Stamp",
"SRC",
"on",
"startup",
".",
"Configure",
"content",
"document",
"events",
"in",
"order",
"of",
"appearance",
"and",
"resolve",
"current",
"contentLocation",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10490-L10509 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(a) {
gui.Spirit.prototype.onaction.call(this, a);
this.action.$handleownaction = false;
var base;
switch (a.type) {
case gui.ACTION_DOC_ONDOMCONTENT:
this.contentLocation = new gui.URL(document, a.data);
this.life.dispatch(gui.LIFE_IFRAME_DOMCONTENT);
this.action.remove(a.type);
a.co... | javascript | function(a) {
gui.Spirit.prototype.onaction.call(this, a);
this.action.$handleownaction = false;
var base;
switch (a.type) {
case gui.ACTION_DOC_ONDOMCONTENT:
this.contentLocation = new gui.URL(document, a.data);
this.life.dispatch(gui.LIFE_IFRAME_DOMCONTENT);
this.action.remove(a.type);
a.co... | [
"function",
"(",
"a",
")",
"{",
"gui",
".",
"Spirit",
".",
"prototype",
".",
"onaction",
".",
"call",
"(",
"this",
",",
"a",
")",
";",
"this",
".",
"action",
".",
"$handleownaction",
"=",
"false",
";",
"var",
"base",
";",
"switch",
"(",
"a",
".",
... | Handle action.
@param {gui.Action} a | [
"Handle",
"action",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10516-L10557 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(url, src) {
if (src) {
this._setupsrc(src);
}
if (url) {
this.element.src = url;
}
return this.contentLocation.href;
} | javascript | function(url, src) {
if (src) {
this._setupsrc(src);
}
if (url) {
this.element.src = url;
}
return this.contentLocation.href;
} | [
"function",
"(",
"url",
",",
"src",
")",
"{",
"if",
"(",
"src",
")",
"{",
"this",
".",
"_setupsrc",
"(",
"src",
")",
";",
"}",
"if",
"(",
"url",
")",
"{",
"this",
".",
"element",
".",
"src",
"=",
"url",
";",
"}",
"return",
"this",
".",
"conte... | Experimentally load some kind of blob.
@param @optional {URL} url
@param @optional {String} src | [
"Experimentally",
"load",
"some",
"kind",
"of",
"blob",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10614-L10622 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
var proto = Element.prototype;
if (gui.Type.isDefined(proto.spirit)) {
throw new Error("Spiritual loaded twice?");
} else {
proto.spirit = null; // defineProperty fails in iOS5
}
} | javascript | function() {
var proto = Element.prototype;
if (gui.Type.isDefined(proto.spirit)) {
throw new Error("Spiritual loaded twice?");
} else {
proto.spirit = null; // defineProperty fails in iOS5
}
} | [
"function",
"(",
")",
"{",
"var",
"proto",
"=",
"Element",
".",
"prototype",
";",
"if",
"(",
"gui",
".",
"Type",
".",
"isDefined",
"(",
"proto",
".",
"spirit",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Spiritual loaded twice?\"",
")",
";",
"}",
... | Declare `spirit` as a fundamental property of things.
@param {Window} win | [
"Declare",
"spirit",
"as",
"a",
"fundamental",
"property",
"of",
"things",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10998-L11005 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
var Elm = gui.Client.isExplorer ? HTMLElement : Element;
this._change(Elm.prototype, gui.DOMCombos);
} | javascript | function() {
var Elm = gui.Client.isExplorer ? HTMLElement : Element;
this._change(Elm.prototype, gui.DOMCombos);
} | [
"function",
"(",
")",
"{",
"var",
"Elm",
"=",
"gui",
".",
"Client",
".",
"isExplorer",
"?",
"HTMLElement",
":",
"Element",
";",
"this",
".",
"_change",
"(",
"Elm",
".",
"prototype",
",",
"gui",
".",
"DOMCombos",
")",
";",
"}"
] | Extend native DOM methods in given window scope.
Wonder what happens now with SVG in Explorer? | [
"Extend",
"native",
"DOM",
"methods",
"in",
"given",
"window",
"scope",
".",
"Wonder",
"what",
"happens",
"now",
"with",
"SVG",
"in",
"Explorer?"
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L11011-L11014 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(proto, name, combo, root) {
var getter = root.__lookupGetter__(name);
var setter = root.__lookupSetter__(name);
if (getter) { // firefox 20 needs a getter for this to work
proto.__defineGetter__(name, function() {
return getter.apply(this, arguments);
});
proto.__defineSetter__(name, combo(f... | javascript | function(proto, name, combo, root) {
var getter = root.__lookupGetter__(name);
var setter = root.__lookupSetter__(name);
if (getter) { // firefox 20 needs a getter for this to work
proto.__defineGetter__(name, function() {
return getter.apply(this, arguments);
});
proto.__defineSetter__(name, combo(f... | [
"function",
"(",
"proto",
",",
"name",
",",
"combo",
",",
"root",
")",
"{",
"var",
"getter",
"=",
"root",
".",
"__lookupGetter__",
"(",
"name",
")",
";",
"var",
"setter",
"=",
"root",
".",
"__lookupSetter__",
"(",
"name",
")",
";",
"if",
"(",
"getter... | Overload property setter for Firefox.
@param {object} proto
@param {String} name
@param {function} combo
@param {Element} root | [
"Overload",
"property",
"setter",
"for",
"Firefox",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L11118-L11129 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
if (gui.Client.hasMutations) {
if (!this._observer) {
var Observer = this._mutationobserver();
this._observer = new Observer(function(mutations) {
mutations.forEach(function(mutation) {
gui.DOMObserver._handleMutation(mutation);
});
});
}
this._connect(true);
this.... | javascript | function() {
if (gui.Client.hasMutations) {
if (!this._observer) {
var Observer = this._mutationobserver();
this._observer = new Observer(function(mutations) {
mutations.forEach(function(mutation) {
gui.DOMObserver._handleMutation(mutation);
});
});
}
this._connect(true);
this.... | [
"function",
"(",
")",
"{",
"if",
"(",
"gui",
".",
"Client",
".",
"hasMutations",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_observer",
")",
"{",
"var",
"Observer",
"=",
"this",
".",
"_mutationobserver",
"(",
")",
";",
"this",
".",
"_observer",
"=",
"... | Start observing. | [
"Start",
"observing",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L11441-L11456 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(action, thisp) {
var res;
if (this.observes) {
if (++this._suspend === 1) {
this._connect(false);
}
}
if (gui.Type.isFunction(action)) {
res = action.call(thisp);
}
if (this.observes) {
this.resume();
}
return res;
} | javascript | function(action, thisp) {
var res;
if (this.observes) {
if (++this._suspend === 1) {
this._connect(false);
}
}
if (gui.Type.isFunction(action)) {
res = action.call(thisp);
}
if (this.observes) {
this.resume();
}
return res;
} | [
"function",
"(",
"action",
",",
"thisp",
")",
"{",
"var",
"res",
";",
"if",
"(",
"this",
".",
"observes",
")",
"{",
"if",
"(",
"++",
"this",
".",
"_suspend",
"===",
"1",
")",
"{",
"this",
".",
"_connect",
"(",
"false",
")",
";",
"}",
"}",
"if",... | Suspend mutation monitoring of document; enable
monitoring again after executing provided function.
@param {Node} node
@param @optional {function} action
@param @optional {object} thisp
@returns {object} if action was defined, we might return something | [
"Suspend",
"mutation",
"monitoring",
"of",
"document",
";",
"enable",
"monitoring",
"again",
"after",
"executing",
"provided",
"function",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L11466-L11480 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(connect) {
var obs = this._observer;
if (obs) {
if (connect) {
obs.observe(document, {
childList: true,
subtree: true
});
} else {
obs.disconnect();
}
}
} | javascript | function(connect) {
var obs = this._observer;
if (obs) {
if (connect) {
obs.observe(document, {
childList: true,
subtree: true
});
} else {
obs.disconnect();
}
}
} | [
"function",
"(",
"connect",
")",
"{",
"var",
"obs",
"=",
"this",
".",
"_observer",
";",
"if",
"(",
"obs",
")",
"{",
"if",
"(",
"connect",
")",
"{",
"obs",
".",
"observe",
"(",
"document",
",",
"{",
"childList",
":",
"true",
",",
"subtree",
":",
"... | Connect and disconnect observer.
@param {boolean} connect | [
"Connect",
"and",
"disconnect",
"observer",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L11527-L11539 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(mutation) {
Array.forEach(mutation.removedNodes, function(node) {
if (node.nodeType === Node.ELEMENT_NODE) {
gui.materialize(node);
}
}, this);
Array.forEach(mutation.addedNodes, function(node) {
if (node.nodeType === Node.ELEMENT_NODE) {
gui.spiritualize(node);
}
}, this);
} | javascript | function(mutation) {
Array.forEach(mutation.removedNodes, function(node) {
if (node.nodeType === Node.ELEMENT_NODE) {
gui.materialize(node);
}
}, this);
Array.forEach(mutation.addedNodes, function(node) {
if (node.nodeType === Node.ELEMENT_NODE) {
gui.spiritualize(node);
}
}, this);
} | [
"function",
"(",
"mutation",
")",
"{",
"Array",
".",
"forEach",
"(",
"mutation",
".",
"removedNodes",
",",
"function",
"(",
"node",
")",
"{",
"if",
"(",
"node",
".",
"nodeType",
"===",
"Node",
".",
"ELEMENT_NODE",
")",
"{",
"gui",
".",
"materialize",
"... | Handle mutations.
1. Matarialize deleted nodes
2. Spiritualize added nodes
@param {MutationRecord} mutation | [
"Handle",
"mutations",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L11548-L11559 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(elm, Spirit) {
var doc = elm.ownerDocument;
var win = doc.defaultView;
var sig = win.gui.$contextid;
if (elm.spirit) {
throw new Error(
"Cannot repossess element with spirit " +
elm.spirit + " (exorcise first)"
);
} else if (!gui.debug || gui.Type.isSpiritConstructor(Spirit)) {
elm.s... | javascript | function(elm, Spirit) {
var doc = elm.ownerDocument;
var win = doc.defaultView;
var sig = win.gui.$contextid;
if (elm.spirit) {
throw new Error(
"Cannot repossess element with spirit " +
elm.spirit + " (exorcise first)"
);
} else if (!gui.debug || gui.Type.isSpiritConstructor(Spirit)) {
elm.s... | [
"function",
"(",
"elm",
",",
"Spirit",
")",
"{",
"var",
"doc",
"=",
"elm",
".",
"ownerDocument",
";",
"var",
"win",
"=",
"doc",
".",
"defaultView",
";",
"var",
"sig",
"=",
"win",
".",
"gui",
".",
"$contextid",
";",
"if",
"(",
"elm",
".",
"spirit",
... | Associate DOM element to Spirit instance.
@param {Element} elm
@param {function} Spirit constructor
@returns {Spirit} | [
"Associate",
"DOM",
"element",
"to",
"Spirit",
"instance",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L11594-L11611 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(operation, thisp) {
this._suspended = true;
var res = operation.call(thisp);
this._suspended = false;
return res;
} | javascript | function(operation, thisp) {
this._suspended = true;
var res = operation.call(thisp);
this._suspended = false;
return res;
} | [
"function",
"(",
"operation",
",",
"thisp",
")",
"{",
"this",
".",
"_suspended",
"=",
"true",
";",
"var",
"res",
"=",
"operation",
".",
"call",
"(",
"thisp",
")",
";",
"this",
".",
"_suspended",
"=",
"false",
";",
"return",
"res",
";",
"}"
] | Suspend spiritualization and materialization during operation.
@param {function} operation
@param @optional {object} thisp
@returns {object} | [
"Suspend",
"spiritualization",
"and",
"materialization",
"during",
"operation",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L11619-L11624 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(node, skip, id) {
var list = [];
new gui.Crawler(id).descend(node, {
handleSpirit: function(spirit) {
if (skip && spirit.element === node) {
// nothing
} else if (!spirit.life.destructed) {
list.push(spirit);
}
}
});
return list;
} | javascript | function(node, skip, id) {
var list = [];
new gui.Crawler(id).descend(node, {
handleSpirit: function(spirit) {
if (skip && spirit.element === node) {
// nothing
} else if (!spirit.life.destructed) {
list.push(spirit);
}
}
});
return list;
} | [
"function",
"(",
"node",
",",
"skip",
",",
"id",
")",
"{",
"var",
"list",
"=",
"[",
"]",
";",
"new",
"gui",
".",
"Crawler",
"(",
"id",
")",
".",
"descend",
"(",
"node",
",",
"{",
"handleSpirit",
":",
"function",
"(",
"spirit",
")",
"{",
"if",
"... | Collect non-destructed spirits from element and descendants.
@param {Node} node
@param @optional {boolean} skip Skip start element
@returns {Array<gui.Spirit>} | [
"Collect",
"non",
"-",
"destructed",
"spirits",
"from",
"element",
"and",
"descendants",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L11740-L11752 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(node, skip, one) {
node = node instanceof gui.Spirit ? node.element : node;
node = node.nodeType === Node.DOCUMENT_NODE ? node.documentElement : node;
if (this._handles(node)) {
this._spiritualize(node, skip, one);
}
} | javascript | function(node, skip, one) {
node = node instanceof gui.Spirit ? node.element : node;
node = node.nodeType === Node.DOCUMENT_NODE ? node.documentElement : node;
if (this._handles(node)) {
this._spiritualize(node, skip, one);
}
} | [
"function",
"(",
"node",
",",
"skip",
",",
"one",
")",
"{",
"node",
"=",
"node",
"instanceof",
"gui",
".",
"Spirit",
"?",
"node",
".",
"element",
":",
"node",
";",
"node",
"=",
"node",
".",
"nodeType",
"===",
"Node",
".",
"DOCUMENT_NODE",
"?",
"node"... | Spiritualize node perhaps.
@param {Node|gui.Spirit} node
@param {boolean} skip Skip the element?
@param {boolean} one Skip the subtree? | [
"Spiritualize",
"node",
"perhaps",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L11760-L11766 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(element, skip, one) {
skip = false; // until DOM setters can finally replace Mutation Observers...
var att = 'gui-spiritualizing';
if (!element.hasAttribute(att)) {
var spirit, spirits = []; // classname = gui.CLASS_NOSPIRITS
element.setAttribute(att, 'true');
new gui.Crawler(gui.CRAWLER_SPIRITU... | javascript | function(element, skip, one) {
skip = false; // until DOM setters can finally replace Mutation Observers...
var att = 'gui-spiritualizing';
if (!element.hasAttribute(att)) {
var spirit, spirits = []; // classname = gui.CLASS_NOSPIRITS
element.setAttribute(att, 'true');
new gui.Crawler(gui.CRAWLER_SPIRITU... | [
"function",
"(",
"element",
",",
"skip",
",",
"one",
")",
"{",
"skip",
"=",
"false",
";",
"// until DOM setters can finally replace Mutation Observers...",
"var",
"att",
"=",
"'gui-spiritualizing'",
";",
"if",
"(",
"!",
"element",
".",
"hasAttribute",
"(",
"att",
... | Evaluate spirits for element and subtree.
- Construct spirits in document order
- Fire life cycle events except `ready` in document order
- Fire `ready` in reverse document order (innermost first)
TODO: Create a dedicated crawler subclass for this purpose.
@param {Element} element
@param {boolean} skip Skip the eleme... | [
"Evaluate",
"spirits",
"for",
"element",
"and",
"subtree",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L11780-L11821 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(node, skip, one, force) {
node = node instanceof gui.Spirit ? node.element : node;
node = node.nodeType === Node.DOCUMENT_NODE ? node.documentElement : node;
if (force || this._handles(node)) {
node.setAttribute('gui-matarializing', 'true');
this._materialize(node, skip, one);
node.removeAttribu... | javascript | function(node, skip, one, force) {
node = node instanceof gui.Spirit ? node.element : node;
node = node.nodeType === Node.DOCUMENT_NODE ? node.documentElement : node;
if (force || this._handles(node)) {
node.setAttribute('gui-matarializing', 'true');
this._materialize(node, skip, one);
node.removeAttribu... | [
"function",
"(",
"node",
",",
"skip",
",",
"one",
",",
"force",
")",
"{",
"node",
"=",
"node",
"instanceof",
"gui",
".",
"Spirit",
"?",
"node",
".",
"element",
":",
"node",
";",
"node",
"=",
"node",
".",
"nodeType",
"===",
"Node",
".",
"DOCUMENT_NODE... | Destruct spirits from element and subtree. Using a two-phased destruction sequence
to minimize the risk of plugins invoking already destructed plugins during destruct.
@param {Node|gui.Spirit} node
@param {boolean} skip Skip the element?
@param {boolean} one Skip the subtree?
@param {boolean} force | [
"Destruct",
"spirits",
"from",
"element",
"and",
"subtree",
".",
"Using",
"a",
"two",
"-",
"phased",
"destruction",
"sequence",
"to",
"minimize",
"the",
"risk",
"of",
"plugins",
"invoking",
"already",
"destructed",
"plugins",
"during",
"destruct",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L11863-L11871 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(spirits) {
if (gui.hasModule("gui-layout@wunderbyte.com")) {
gui.DOMPlugin.group(spirits).forEach(function(spirit) {
gui.VisibilityPlugin.$init(spirit);
}, this);
}
} | javascript | function(spirits) {
if (gui.hasModule("gui-layout@wunderbyte.com")) {
gui.DOMPlugin.group(spirits).forEach(function(spirit) {
gui.VisibilityPlugin.$init(spirit);
}, this);
}
} | [
"function",
"(",
"spirits",
")",
"{",
"if",
"(",
"gui",
".",
"hasModule",
"(",
"\"gui-layout@wunderbyte.com\"",
")",
")",
"{",
"gui",
".",
"DOMPlugin",
".",
"group",
"(",
"spirits",
")",
".",
"forEach",
"(",
"function",
"(",
"spirit",
")",
"{",
"gui",
... | Evaluate spirits visibility.
@todo: Off to plugin somehow.
@todo: Test for this stuff.
@param {Array<gui.Spirit>} | [
"Evaluate",
"spirits",
"visibility",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L11930-L11936 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(e) {
/*
* TODO: Move this code into {gui.EventPlugin}
*/
if (e.type === 'webkitTransitionEnd') {
e = {
type: 'transitionend',
target: e.target,
propertyName: e.propertyName,
elapsedTime: e.elapsedTime,
pseudoElement: e.pseudoElement
};
}
this.onevent(e);
} | javascript | function(e) {
/*
* TODO: Move this code into {gui.EventPlugin}
*/
if (e.type === 'webkitTransitionEnd') {
e = {
type: 'transitionend',
target: e.target,
propertyName: e.propertyName,
elapsedTime: e.elapsedTime,
pseudoElement: e.pseudoElement
};
}
this.onevent(e);
} | [
"function",
"(",
"e",
")",
"{",
"/*\n\t\t\t * TODO: Move this code into {gui.EventPlugin}\n\t\t\t */",
"if",
"(",
"e",
".",
"type",
"===",
"'webkitTransitionEnd'",
")",
"{",
"e",
"=",
"{",
"type",
":",
"'transitionend'",
",",
"target",
":",
"e",
".",
"target",
"... | Native DOM interface. We'll forward the event to the method `onevent`.
@see http://www.w3.org/TR/DOM-Level-3-Events/#interface-EventListener
TODO: move to $protected area
@param {Event} e | [
"Native",
"DOM",
"interface",
".",
"We",
"ll",
"forward",
"the",
"event",
"to",
"the",
"method",
"onevent",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L12159-L12173 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(key) {
gui.Spirit.prototype.onkey.call(this, key);
console.log(key.type);
var map = this._map;
map[key.type] = key.down;
if (Object.keys(map).every(function(type) {
//console.log ( type + ": " + map [ type ]);
return map[type] === true;
})) {
console.log("fis!");
}
} | javascript | function(key) {
gui.Spirit.prototype.onkey.call(this, key);
console.log(key.type);
var map = this._map;
map[key.type] = key.down;
if (Object.keys(map).every(function(type) {
//console.log ( type + ": " + map [ type ]);
return map[type] === true;
})) {
console.log("fis!");
}
} | [
"function",
"(",
"key",
")",
"{",
"gui",
".",
"Spirit",
".",
"prototype",
".",
"onkey",
".",
"call",
"(",
"this",
",",
"key",
")",
";",
"console",
".",
"log",
"(",
"key",
".",
"type",
")",
";",
"var",
"map",
"=",
"this",
".",
"_map",
";",
"map"... | Handle key.
@param {gui.Key} key | [
"Handle",
"key",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L12527-L12539 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
var key = this.att.get("key");
if (key) {
key.split(" ").forEach(function(token) {
token = token.trim();
this.key.addGlobal(token);
this._map[token] = false;
}, this);
}
} | javascript | function() {
var key = this.att.get("key");
if (key) {
key.split(" ").forEach(function(token) {
token = token.trim();
this.key.addGlobal(token);
this._map[token] = false;
}, this);
}
} | [
"function",
"(",
")",
"{",
"var",
"key",
"=",
"this",
".",
"att",
".",
"get",
"(",
"\"key\"",
")",
";",
"if",
"(",
"key",
")",
"{",
"key",
".",
"split",
"(",
"\" \"",
")",
".",
"forEach",
"(",
"function",
"(",
"token",
")",
"{",
"token",
"=",
... | Parsing the 'key' attribute, setup key listeners. | [
"Parsing",
"the",
"key",
"attribute",
"setup",
"key",
"listeners",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L12554-L12563 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(context) {
this._keymap = Object.create(null);
["keydown", "keypress", "keyup"].forEach(function(type) {
context.document.addEventListener(type, this, false);
}, this);
} | javascript | function(context) {
this._keymap = Object.create(null);
["keydown", "keypress", "keyup"].forEach(function(type) {
context.document.addEventListener(type, this, false);
}, this);
} | [
"function",
"(",
"context",
")",
"{",
"this",
".",
"_keymap",
"=",
"Object",
".",
"create",
"(",
"null",
")",
";",
"[",
"\"keydown\"",
",",
"\"keypress\"",
",",
"\"keyup\"",
"]",
".",
"forEach",
"(",
"function",
"(",
"type",
")",
"{",
"context",
".",
... | Context init.
@param {Window} context | [
"Context",
"init",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L12607-L12612 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(e) {
var n = e.keyCode,
c = this._keymap[n],
b = gui.BROADCAST_KEYEVENT;
var id = e.currentTarget.defaultView.gui.$contextid;
/*
// TODO: THIS!
if ( e.ctrlKey && gui.Key.$key [ e.keyCode ] !== "Control" ) {
e.preventDefault ();
}
*/
switch (e.type) {
case "keydown":
if (c === ... | javascript | function(e) {
var n = e.keyCode,
c = this._keymap[n],
b = gui.BROADCAST_KEYEVENT;
var id = e.currentTarget.defaultView.gui.$contextid;
/*
// TODO: THIS!
if ( e.ctrlKey && gui.Key.$key [ e.keyCode ] !== "Control" ) {
e.preventDefault ();
}
*/
switch (e.type) {
case "keydown":
if (c === ... | [
"function",
"(",
"e",
")",
"{",
"var",
"n",
"=",
"e",
".",
"keyCode",
",",
"c",
"=",
"this",
".",
"_keymap",
"[",
"n",
"]",
",",
"b",
"=",
"gui",
".",
"BROADCAST_KEYEVENT",
";",
"var",
"id",
"=",
"e",
".",
"currentTarget",
".",
"defaultView",
"."... | Conan the Barbarian style events.
At least they suck in a known way.
@param {Event} e | [
"Conan",
"the",
"Barbarian",
"style",
"events",
".",
"At",
"least",
"they",
"suck",
"in",
"a",
"known",
"way",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L12660-L12699 | train | |
wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(e) {
gui.Key.ctrlDown = e.ctrlKey;
gui.Key.shiftDown = e.shiftKey;
gui.Key.altDown = e.altKey;
gui.Key.metaDown = e.metaKey;
} | javascript | function(e) {
gui.Key.ctrlDown = e.ctrlKey;
gui.Key.shiftDown = e.shiftKey;
gui.Key.altDown = e.altKey;
gui.Key.metaDown = e.metaKey;
} | [
"function",
"(",
"e",
")",
"{",
"gui",
".",
"Key",
".",
"ctrlDown",
"=",
"e",
".",
"ctrlKey",
";",
"gui",
".",
"Key",
".",
"shiftDown",
"=",
"e",
".",
"shiftKey",
";",
"gui",
".",
"Key",
".",
"altDown",
"=",
"e",
".",
"altKey",
";",
"gui",
".",... | Update key modifiers state.
@TODO Cross platform abstractions "accelDown" and "accessDown"
@param {KeyEvent} e | [
"Update",
"key",
"modifiers",
"state",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L12738-L12743 | train | |
bobtail-dev/bobtail-rx | dist/main.js | record | function record(f) {
// TODO document why @refreshing exists
// guards against recursively evaluating this recorded
// function (@body or an async body) when calling `.get()`
if (!_this10.refreshing) {
var res = void 0;
_this10.disc... | javascript | function record(f) {
// TODO document why @refreshing exists
// guards against recursively evaluating this recorded
// function (@body or an async body) when calling `.get()`
if (!_this10.refreshing) {
var res = void 0;
_this10.disc... | [
"function",
"record",
"(",
"f",
")",
"{",
"// TODO document why @refreshing exists",
"// guards against recursively evaluating this recorded",
"// function (@body or an async body) when calling `.get()`",
"if",
"(",
"!",
"_this10",
".",
"refreshing",
")",
"{",
"var",
"res",
"="... | next two are for tolerating env.done calls from within env.record | [
"next",
"two",
"are",
"for",
"tolerating",
"env",
".",
"done",
"calls",
"from",
"within",
"env",
".",
"record"
] | b4b1491dac3bcae6cfeebcb07b42fa718833c126 | https://github.com/bobtail-dev/bobtail-rx/blob/b4b1491dac3bcae6cfeebcb07b42fa718833c126/dist/main.js#L871-L895 | train |
dickhardt/node-a2p3 | lib/a2p3.js | createAgentRequest | function createAgentRequest ( config, vault, params ) {
if (!vault || !config || !params)
throw new Error('"config", "vault", "params" are required) ')
if (!params.returnURL && !params.callbackURL)
throw new Error('params must have either "returnURL" or "callbackURL"')
config = _init( config, vault )
va... | javascript | function createAgentRequest ( config, vault, params ) {
if (!vault || !config || !params)
throw new Error('"config", "vault", "params" are required) ')
if (!params.returnURL && !params.callbackURL)
throw new Error('params must have either "returnURL" or "callbackURL"')
config = _init( config, vault )
va... | [
"function",
"createAgentRequest",
"(",
"config",
",",
"vault",
",",
"params",
")",
"{",
"if",
"(",
"!",
"vault",
"||",
"!",
"config",
"||",
"!",
"params",
")",
"throw",
"new",
"Error",
"(",
"'\"config\", \"vault\", \"params\" are required) '",
")",
"if",
"(",
... | create an Agent Request | [
"create",
"an",
"Agent",
"Request"
] | ca9dd8802d7ed2e90f6754bfced0ac9014c230a3 | https://github.com/dickhardt/node-a2p3/blob/ca9dd8802d7ed2e90f6754bfced0ac9014c230a3/lib/a2p3.js#L63-L93 | train |
mcullenlewis/promise-maker | index.js | function(func, resolves = false){
if(typeof resolves !== 'boolean' && typeof resolves !== 'number' && resolves != 'all'){
throw new Error('Invalid value submitted for \'resolves\' argument.')
}
return function(){
return new Promise((resolve, reject)=>{
var params = [...arguments, functio... | javascript | function(func, resolves = false){
if(typeof resolves !== 'boolean' && typeof resolves !== 'number' && resolves != 'all'){
throw new Error('Invalid value submitted for \'resolves\' argument.')
}
return function(){
return new Promise((resolve, reject)=>{
var params = [...arguments, functio... | [
"function",
"(",
"func",
",",
"resolves",
"=",
"false",
")",
"{",
"if",
"(",
"typeof",
"resolves",
"!==",
"'boolean'",
"&&",
"typeof",
"resolves",
"!==",
"'number'",
"&&",
"resolves",
"!=",
"'all'",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Invalid value s... | Return a promise-based version of a callback-based async method. | [
"Return",
"a",
"promise",
"-",
"based",
"version",
"of",
"a",
"callback",
"-",
"based",
"async",
"method",
"."
] | ede012d28334cf79024d2b2d712b0b0d84ac7c81 | https://github.com/mcullenlewis/promise-maker/blob/ede012d28334cf79024d2b2d712b0b0d84ac7c81/index.js#L4-L42 | train | |
linyngfly/omelo-rpc | lib/rpc-client/client.js | function(opts) {
opts = opts || {};
this._context = opts.context;
this._routeContext = opts.routeContext;
this.router = opts.router || router.df;
this.routerType = opts.routerType;
this.rpcDebugLog = opts.rpcDebugLog;
if (this._context) {
opts.clientId = this._context.serverId;
}
this.opts = opts;... | javascript | function(opts) {
opts = opts || {};
this._context = opts.context;
this._routeContext = opts.routeContext;
this.router = opts.router || router.df;
this.routerType = opts.routerType;
this.rpcDebugLog = opts.rpcDebugLog;
if (this._context) {
opts.clientId = this._context.serverId;
}
this.opts = opts;... | [
"function",
"(",
"opts",
")",
"{",
"opts",
"=",
"opts",
"||",
"{",
"}",
";",
"this",
".",
"_context",
"=",
"opts",
".",
"context",
";",
"this",
".",
"_routeContext",
"=",
"opts",
".",
"routeContext",
";",
"this",
".",
"router",
"=",
"opts",
".",
"r... | client has closed
RPC Client Class | [
"client",
"has",
"closed",
"RPC",
"Client",
"Class"
] | a8d64a4f098f1d174550f0f648d5ccc7716624b8 | https://github.com/linyngfly/omelo-rpc/blob/a8d64a4f098f1d174550f0f648d5ccc7716624b8/lib/rpc-client/client.js#L22-L36 | train | |
linyngfly/omelo-rpc | lib/rpc-client/client.js | function(client, serverType, msg, routeParam, cb) {
if (!!client.routerType) {
let method;
switch (client.routerType) {
case constants.SCHEDULE.ROUNDROBIN:
method = router.rr;
break;
case constants.SCHEDULE.WEIGHT_ROUNDROBIN:
method = router.wrr;
break;
case c... | javascript | function(client, serverType, msg, routeParam, cb) {
if (!!client.routerType) {
let method;
switch (client.routerType) {
case constants.SCHEDULE.ROUNDROBIN:
method = router.rr;
break;
case constants.SCHEDULE.WEIGHT_ROUNDROBIN:
method = router.wrr;
break;
case c... | [
"function",
"(",
"client",
",",
"serverType",
",",
"msg",
",",
"routeParam",
",",
"cb",
")",
"{",
"if",
"(",
"!",
"!",
"client",
".",
"routerType",
")",
"{",
"let",
"method",
";",
"switch",
"(",
"client",
".",
"routerType",
")",
"{",
"case",
"constan... | Calculate remote target server id for rpc client.
@param client {Object} current client instance.
@param serverType {String} remote server type.
@param routeParam {Object} mailbox init context parameter.
@param cb {Function} return rpc remote target server id.
@api private | [
"Calculate",
"remote",
"target",
"server",
"id",
"for",
"rpc",
"client",
"."
] | a8d64a4f098f1d174550f0f648d5ccc7716624b8 | https://github.com/linyngfly/omelo-rpc/blob/a8d64a4f098f1d174550f0f648d5ccc7716624b8/lib/rpc-client/client.js#L322-L361 | train | |
linyngfly/omelo-rpc | lib/rpc-client/client.js | function(client, msg, serverType, serverId, cb) {
if (typeof serverId !== 'string') {
logger.error('[omelo-rpc] serverId is not a string : %s', serverId);
return;
}
if (serverId === '*') {
let servers = client._routeContext.getServersByType(serverType);
if (!servers) {
logger.error('[omelo-r... | javascript | function(client, msg, serverType, serverId, cb) {
if (typeof serverId !== 'string') {
logger.error('[omelo-rpc] serverId is not a string : %s', serverId);
return;
}
if (serverId === '*') {
let servers = client._routeContext.getServersByType(serverType);
if (!servers) {
logger.error('[omelo-r... | [
"function",
"(",
"client",
",",
"msg",
",",
"serverType",
",",
"serverId",
",",
"cb",
")",
"{",
"if",
"(",
"typeof",
"serverId",
"!==",
"'string'",
")",
"{",
"logger",
".",
"error",
"(",
"'[omelo-rpc] serverId is not a string : %s'",
",",
"serverId",
")",
";... | Rpc to specified server id or servers.
@param client {Object} current client instance.
@param msg {Object} rpc message.
@param serverType {String} remote server type.
@param serverId {Object} mailbox init context parameter.
@api private | [
"Rpc",
"to",
"specified",
"server",
"id",
"or",
"servers",
"."
] | a8d64a4f098f1d174550f0f648d5ccc7716624b8 | https://github.com/linyngfly/omelo-rpc/blob/a8d64a4f098f1d174550f0f648d5ccc7716624b8/lib/rpc-client/client.js#L373-L394 | train | |
ALDLife/outcome-graph | src/sessionsConverter.js | getValuesMapsFromOutcomes | function getValuesMapsFromOutcomes(outcomes) {
var dataMap = {};
var noteMap = {};
// add each outcome to a set
outcomes.forEach(function outcomeIterator(outcome) {
var lowerCaseLabel = updateLabels(outcome.outcome);
dataMap[lowerCaseLabel] = outcome.value;
noteMap[lowerCaseLabel] = ou... | javascript | function getValuesMapsFromOutcomes(outcomes) {
var dataMap = {};
var noteMap = {};
// add each outcome to a set
outcomes.forEach(function outcomeIterator(outcome) {
var lowerCaseLabel = updateLabels(outcome.outcome);
dataMap[lowerCaseLabel] = outcome.value;
noteMap[lowerCaseLabel] = ou... | [
"function",
"getValuesMapsFromOutcomes",
"(",
"outcomes",
")",
"{",
"var",
"dataMap",
"=",
"{",
"}",
";",
"var",
"noteMap",
"=",
"{",
"}",
";",
"// add each outcome to a set",
"outcomes",
".",
"forEach",
"(",
"function",
"outcomeIterator",
"(",
"outcome",
")",
... | this creates a mapping of the data value as well as notes for each label to be later used to create the ChartJS data array | [
"this",
"creates",
"a",
"mapping",
"of",
"the",
"data",
"value",
"as",
"well",
"as",
"notes",
"for",
"each",
"label",
"to",
"be",
"later",
"used",
"to",
"create",
"the",
"ChartJS",
"data",
"array"
] | 5f96227208777b2a9d31a79f13dc4fc585583746 | https://github.com/ALDLife/outcome-graph/blob/5f96227208777b2a9d31a79f13dc4fc585583746/src/sessionsConverter.js#L61-L74 | train |
ALDLife/outcome-graph | src/sessionsConverter.js | updateLabels | function updateLabels(potentialLabel) {
var lowerCaseLabel = potentialLabel.toLowerCase();
if (!labelSet.hasOwnProperty(lowerCaseLabel)) {
labels.push(potentialLabel);
// now value is in our set
labelSet[lowerCaseLabel] = true;
}
return lowerCaseLabel;
} | javascript | function updateLabels(potentialLabel) {
var lowerCaseLabel = potentialLabel.toLowerCase();
if (!labelSet.hasOwnProperty(lowerCaseLabel)) {
labels.push(potentialLabel);
// now value is in our set
labelSet[lowerCaseLabel] = true;
}
return lowerCaseLabel;
} | [
"function",
"updateLabels",
"(",
"potentialLabel",
")",
"{",
"var",
"lowerCaseLabel",
"=",
"potentialLabel",
".",
"toLowerCase",
"(",
")",
";",
"if",
"(",
"!",
"labelSet",
".",
"hasOwnProperty",
"(",
"lowerCaseLabel",
")",
")",
"{",
"labels",
".",
"push",
"(... | check if our set has the value or not | [
"check",
"if",
"our",
"set",
"has",
"the",
"value",
"or",
"not"
] | 5f96227208777b2a9d31a79f13dc4fc585583746 | https://github.com/ALDLife/outcome-graph/blob/5f96227208777b2a9d31a79f13dc4fc585583746/src/sessionsConverter.js#L77-L85 | train |
ALDLife/outcome-graph | src/sessionsConverter.js | getExtractedDataAndTooltipNotes | function getExtractedDataAndTooltipNotes(valuesMap) {
// go over currently added labels
var data = [];
var notes = [];
labels.forEach(function labelIterator(label) {
data.push(getExtractedDataValue(valuesMap.data[label.toLowerCase()]));
notes.push(getExtractedNoteValue(valuesMap.notes[label.... | javascript | function getExtractedDataAndTooltipNotes(valuesMap) {
// go over currently added labels
var data = [];
var notes = [];
labels.forEach(function labelIterator(label) {
data.push(getExtractedDataValue(valuesMap.data[label.toLowerCase()]));
notes.push(getExtractedNoteValue(valuesMap.notes[label.... | [
"function",
"getExtractedDataAndTooltipNotes",
"(",
"valuesMap",
")",
"{",
"// go over currently added labels",
"var",
"data",
"=",
"[",
"]",
";",
"var",
"notes",
"=",
"[",
"]",
";",
"labels",
".",
"forEach",
"(",
"function",
"labelIterator",
"(",
"label",
")",
... | Use values map to create the data and notes arrays confroming to ChartJS requirements. | [
"Use",
"values",
"map",
"to",
"create",
"the",
"data",
"and",
"notes",
"arrays",
"confroming",
"to",
"ChartJS",
"requirements",
"."
] | 5f96227208777b2a9d31a79f13dc4fc585583746 | https://github.com/ALDLife/outcome-graph/blob/5f96227208777b2a9d31a79f13dc4fc585583746/src/sessionsConverter.js#L89-L101 | train |
redisjs/jsr-server | lib/scanner.js | Scanner | function Scanner(target, cursor, pattern, count, map, stringify) {
this.target = target;
this.cursor = cursor;
this.pattern = pattern;
this.count = count || 10;
this.map = map;
this.stringify = stringify;
// clamp the count
this.count = Math.max(this.count, 10);
this.count = Math.min(this.count, 1000... | javascript | function Scanner(target, cursor, pattern, count, map, stringify) {
this.target = target;
this.cursor = cursor;
this.pattern = pattern;
this.count = count || 10;
this.map = map;
this.stringify = stringify;
// clamp the count
this.count = Math.max(this.count, 10);
this.count = Math.min(this.count, 1000... | [
"function",
"Scanner",
"(",
"target",
",",
"cursor",
",",
"pattern",
",",
"count",
",",
"map",
",",
"stringify",
")",
"{",
"this",
".",
"target",
"=",
"target",
";",
"this",
".",
"cursor",
"=",
"cursor",
";",
"this",
".",
"pattern",
"=",
"pattern",
"... | Encapsulates the scan logic.
@param target The target array of keys.
@param cursor The user-supplied cursor position.
@param pattern A regular expression pattern if match was specified.
@param count A user-specified count option.
@param map An object used to lookup values (hscan and zscan).
@param stringify Convert ma... | [
"Encapsulates",
"the",
"scan",
"logic",
"."
] | 49413052d3039524fbdd2ade0ef9bae26cb4d647 | https://github.com/redisjs/jsr-server/blob/49413052d3039524fbdd2ade0ef9bae26cb4d647/lib/scanner.js#L11-L22 | train |
redisjs/jsr-server | lib/scanner.js | scan | function scan(req, res) {
var records = []
, position
, i
, key
, inc
, map = this.map
, len = this.cursor + this.count;
for(i = this.cursor; i < len;i++) {
if(i === this.target.length) {
position = 0;
break;
}
key = '' + this.target[i];
inc = !this.pattern || (t... | javascript | function scan(req, res) {
var records = []
, position
, i
, key
, inc
, map = this.map
, len = this.cursor + this.count;
for(i = this.cursor; i < len;i++) {
if(i === this.target.length) {
position = 0;
break;
}
key = '' + this.target[i];
inc = !this.pattern || (t... | [
"function",
"scan",
"(",
"req",
",",
"res",
")",
"{",
"var",
"records",
"=",
"[",
"]",
",",
"position",
",",
"i",
",",
"key",
",",
"inc",
",",
"map",
"=",
"this",
".",
"map",
",",
"len",
"=",
"this",
".",
"cursor",
"+",
"this",
".",
"count",
... | Perform the scan and send the response to the client. | [
"Perform",
"the",
"scan",
"and",
"send",
"the",
"response",
"to",
"the",
"client",
"."
] | 49413052d3039524fbdd2ade0ef9bae26cb4d647 | https://github.com/redisjs/jsr-server/blob/49413052d3039524fbdd2ade0ef9bae26cb4d647/lib/scanner.js#L27-L51 | train |
admoexperience/generator-admo | templates/scripts/libs/framework.js | function(message) {
if (this.sendData % 200 == 0){
console.log("Kinect data being sent from kinect");
console.log(message);
}
this.sendData = this.sendData +1;
if (true) {
//Set the kinect data to the raw values from the kinect
for(var key in message){
KinectState[key] = ... | javascript | function(message) {
if (this.sendData % 200 == 0){
console.log("Kinect data being sent from kinect");
console.log(message);
}
this.sendData = this.sendData +1;
if (true) {
//Set the kinect data to the raw values from the kinect
for(var key in message){
KinectState[key] = ... | [
"function",
"(",
"message",
")",
"{",
"if",
"(",
"this",
".",
"sendData",
"%",
"200",
"==",
"0",
")",
"{",
"console",
".",
"log",
"(",
"\"Kinect data being sent from kinect\"",
")",
";",
"console",
".",
"log",
"(",
"message",
")",
";",
"}",
"this",
"."... | handles WS message | [
"handles",
"WS",
"message"
] | f27e261990948860e14f735f3cd7c59bf1130feb | https://github.com/admoexperience/generator-admo/blob/f27e261990948860e14f735f3cd7c59bf1130feb/templates/scripts/libs/framework.js#L86-L122 | train | |
hbouvier/node-tagger | lib/util/api.js | lex | function lex(phrase) {
var words = phrase && typeof(phrase) === 'string' ? lexer.lex(phrase) : {status:"Invalid phrase parameter"};
logger.log('verbose', '%s|lex|phrase=%s|words=%j', meta.module, phrase, words, meta);
return words;
} | javascript | function lex(phrase) {
var words = phrase && typeof(phrase) === 'string' ? lexer.lex(phrase) : {status:"Invalid phrase parameter"};
logger.log('verbose', '%s|lex|phrase=%s|words=%j', meta.module, phrase, words, meta);
return words;
} | [
"function",
"lex",
"(",
"phrase",
")",
"{",
"var",
"words",
"=",
"phrase",
"&&",
"typeof",
"(",
"phrase",
")",
"===",
"'string'",
"?",
"lexer",
".",
"lex",
"(",
"phrase",
")",
":",
"{",
"status",
":",
"\"Invalid phrase parameter\"",
"}",
";",
"logger",
... | Split a phrase into words
@param phrase: A string
@return an array of words | [
"Split",
"a",
"phrase",
"into",
"words"
] | 51a6a9b6158e83cbbc4d3d4f10fde19ac796510b | https://github.com/hbouvier/node-tagger/blob/51a6a9b6158e83cbbc4d3d4f10fde19ac796510b/lib/util/api.js#L27-L31 | train |
hbouvier/node-tagger | lib/util/api.js | tag | function tag(words) {
var taggedWords = (words && typeof(words) === 'string') ? tagger.tag(lexer.lex(words)) : (words && typeof(words) === 'object') ? tagger.tag(words) : {status:"Invalid words parameter"};
logger.log('verbose', '%s|tag|words=%j|tags=%j', meta.module, words, taggedWords, meta);
... | javascript | function tag(words) {
var taggedWords = (words && typeof(words) === 'string') ? tagger.tag(lexer.lex(words)) : (words && typeof(words) === 'object') ? tagger.tag(words) : {status:"Invalid words parameter"};
logger.log('verbose', '%s|tag|words=%j|tags=%j', meta.module, words, taggedWords, meta);
... | [
"function",
"tag",
"(",
"words",
")",
"{",
"var",
"taggedWords",
"=",
"(",
"words",
"&&",
"typeof",
"(",
"words",
")",
"===",
"'string'",
")",
"?",
"tagger",
".",
"tag",
"(",
"lexer",
".",
"lex",
"(",
"words",
")",
")",
":",
"(",
"words",
"&&",
"... | Tag each words in an array of words
@param words: (string): run the lexer first, then the tagger. (array): run the tagger directly
@return an array of array of words with their tags | [
"Tag",
"each",
"words",
"in",
"an",
"array",
"of",
"words"
] | 51a6a9b6158e83cbbc4d3d4f10fde19ac796510b | https://github.com/hbouvier/node-tagger/blob/51a6a9b6158e83cbbc4d3d4f10fde19ac796510b/lib/util/api.js#L40-L44 | train |
uupaa/Watch.js | lib/Watch.js | Sort_nat | function Sort_nat(source, // @arg StringArray - source. ["abc100", "abc1", "abc10"]
ignoreCase) { // @arg Boolean = false - true is case-insensitive
// @ret StringArray - sorted array. ["abc1", "abc10", "abc100"]
// @desc na... | javascript | function Sort_nat(source, // @arg StringArray - source. ["abc100", "abc1", "abc10"]
ignoreCase) { // @arg Boolean = false - true is case-insensitive
// @ret StringArray - sorted array. ["abc1", "abc10", "abc100"]
// @desc na... | [
"function",
"Sort_nat",
"(",
"source",
",",
"// @arg StringArray - source. [\"abc100\", \"abc1\", \"abc10\"]",
"ignoreCase",
")",
"{",
"// @arg Boolean = false - true is case-insensitive",
"// @ret StringArray - sorted array. [\"abc1\", \"abc10\", \"abc100\"]",
"// @desc nat sort",
"... | copy from Sort.js | [
"copy",
"from",
"Sort",
".",
"js"
] | 5c8c4d30de6ae4feb20f091c8ccfaedb39bd9c12 | https://github.com/uupaa/Watch.js/blob/5c8c4d30de6ae4feb20f091c8ccfaedb39bd9c12/lib/Watch.js#L232-L283 | train |
tolokoban/ToloFrameWork | lib/compiler-html2.js | lookForExternalDependenciesRES | function lookForExternalDependenciesRES( _def, resources, depFile ) {
if ( !_def ) return;
try {
const def = convertExternalDependencyDefinition( _def );
for ( const dep of Object.keys( def ) ) {
if ( def[ dep ] === "" ) {
// `res: { "bob/foo.png": "" }` is equivalent to
// `res: { "bo... | javascript | function lookForExternalDependenciesRES( _def, resources, depFile ) {
if ( !_def ) return;
try {
const def = convertExternalDependencyDefinition( _def );
for ( const dep of Object.keys( def ) ) {
if ( def[ dep ] === "" ) {
// `res: { "bob/foo.png": "" }` is equivalent to
// `res: { "bo... | [
"function",
"lookForExternalDependenciesRES",
"(",
"_def",
",",
"resources",
",",
"depFile",
")",
"{",
"if",
"(",
"!",
"_def",
")",
"return",
";",
"try",
"{",
"const",
"def",
"=",
"convertExternalDependencyDefinition",
"(",
"_def",
")",
";",
"for",
"(",
"con... | Section "res" in a dependency file.
@param {objects} _def - `{ "bob/foo.png": "", "yo/man.kml": "maps/man.kml" }`
@param {object} resources -
@param {Source} depFile - Source of the dependency file.
@returns {undefined} | [
"Section",
"res",
"in",
"a",
"dependency",
"file",
"."
] | 730845a833a9660ebfdb60ad027ebaab5ac871b6 | https://github.com/tolokoban/ToloFrameWork/blob/730845a833a9660ebfdb60ad027ebaab5ac871b6/lib/compiler-html2.js#L440-L467 | train |
tolokoban/ToloFrameWork | lib/compiler-html2.js | lookForExternalDependenciesJS | function lookForExternalDependenciesJS( _def, javascriptSources ) {
if ( !_def ) return;
try {
const def = convertExternalDependencyDefinition( _def );
Object.keys( def ).forEach( function ( js ) {
const
filename = `mod/${js}`,
src = new Source( Project, filename ),
code = src.read()... | javascript | function lookForExternalDependenciesJS( _def, javascriptSources ) {
if ( !_def ) return;
try {
const def = convertExternalDependencyDefinition( _def );
Object.keys( def ).forEach( function ( js ) {
const
filename = `mod/${js}`,
src = new Source( Project, filename ),
code = src.read()... | [
"function",
"lookForExternalDependenciesJS",
"(",
"_def",
",",
"javascriptSources",
")",
"{",
"if",
"(",
"!",
"_def",
")",
"return",
";",
"try",
"{",
"const",
"def",
"=",
"convertExternalDependencyDefinition",
"(",
"_def",
")",
";",
"Object",
".",
"keys",
"(",... | Section "js" in a dependency file.
@param {objects} _def - `{ "helper.js": "" }` or `"helper.js"`.
@param {array} javascriptSources - Array of the Javascript code to include in current HTML page.
@returns {undefined} | [
"Section",
"js",
"in",
"a",
"dependency",
"file",
"."
] | 730845a833a9660ebfdb60ad027ebaab5ac871b6 | https://github.com/tolokoban/ToloFrameWork/blob/730845a833a9660ebfdb60ad027ebaab5ac871b6/lib/compiler-html2.js#L476-L493 | train |
tolokoban/ToloFrameWork | lib/compiler-html2.js | pushUnique | function pushUnique( arr, item ) {
if ( arr.indexOf( item ) > -1 ) return false;
arr.push( item );
return true;
} | javascript | function pushUnique( arr, item ) {
if ( arr.indexOf( item ) > -1 ) return false;
arr.push( item );
return true;
} | [
"function",
"pushUnique",
"(",
"arr",
",",
"item",
")",
"{",
"if",
"(",
"arr",
".",
"indexOf",
"(",
"item",
")",
">",
"-",
"1",
")",
"return",
"false",
";",
"arr",
".",
"push",
"(",
"item",
")",
";",
"return",
"true",
";",
"}"
] | Push `item` into `arr` if it is not already in. | [
"Push",
"item",
"into",
"arr",
"if",
"it",
"is",
"not",
"already",
"in",
"."
] | 730845a833a9660ebfdb60ad027ebaab5ac871b6 | https://github.com/tolokoban/ToloFrameWork/blob/730845a833a9660ebfdb60ad027ebaab5ac871b6/lib/compiler-html2.js#L524-L528 | train |
tolokoban/ToloFrameWork | lib/compiler-html2.js | addFilePrefix | function addFilePrefix( path, prefix ) {
if ( typeof prefix === 'undefined' ) prefix = '@';
var separatorPosition = path.lastIndexOf( '/' );
if ( separatorPosition < 0 ) {
// Let's try with Windows separators.
separatorPosition = path.lastIndexOf( '\\' );
}
var filenameStart = separatorPosition > -1 ... | javascript | function addFilePrefix( path, prefix ) {
if ( typeof prefix === 'undefined' ) prefix = '@';
var separatorPosition = path.lastIndexOf( '/' );
if ( separatorPosition < 0 ) {
// Let's try with Windows separators.
separatorPosition = path.lastIndexOf( '\\' );
}
var filenameStart = separatorPosition > -1 ... | [
"function",
"addFilePrefix",
"(",
"path",
",",
"prefix",
")",
"{",
"if",
"(",
"typeof",
"prefix",
"===",
"'undefined'",
")",
"prefix",
"=",
"'@'",
";",
"var",
"separatorPosition",
"=",
"path",
".",
"lastIndexOf",
"(",
"'/'",
")",
";",
"if",
"(",
"separat... | Add a prefix to a filename. This is not as simple as prepending the
`prefix` to the string `path`, because `path` can contain folders'
separators. The prefix must be prepended to the real file name and
not to the whole path.
Examples with `prefix` == "@":
* `foobar.html`: `@foobar.html`
* `myfolder/myfile.js`: ... | [
"Add",
"a",
"prefix",
"to",
"a",
"filename",
".",
"This",
"is",
"not",
"as",
"simple",
"as",
"prepending",
"the",
"prefix",
"to",
"the",
"string",
"path",
"because",
"path",
"can",
"contain",
"folders",
"separators",
".",
"The",
"prefix",
"must",
"be",
"... | 730845a833a9660ebfdb60ad027ebaab5ac871b6 | https://github.com/tolokoban/ToloFrameWork/blob/730845a833a9660ebfdb60ad027ebaab5ac871b6/lib/compiler-html2.js#L866-L877 | train |
tolokoban/ToloFrameWork | lib/compiler-html2.js | addDescriptionToHead | function addDescriptionToHead( head, options ) {
if ( !options || !options.config || typeof options.config.description !== 'string' ) {
return false;
}
if ( !Array.isArray( head.children ) ) {
head.children = [];
}
for ( let i = 0; i < head.children.length; i++ ) {
const child = head.children[ i ... | javascript | function addDescriptionToHead( head, options ) {
if ( !options || !options.config || typeof options.config.description !== 'string' ) {
return false;
}
if ( !Array.isArray( head.children ) ) {
head.children = [];
}
for ( let i = 0; i < head.children.length; i++ ) {
const child = head.children[ i ... | [
"function",
"addDescriptionToHead",
"(",
"head",
",",
"options",
")",
"{",
"if",
"(",
"!",
"options",
"||",
"!",
"options",
".",
"config",
"||",
"typeof",
"options",
".",
"config",
".",
"description",
"!==",
"'string'",
")",
"{",
"return",
"false",
";",
... | Add a description in the header if no one was found.
@param {string} options.config.description - The description to use. | [
"Add",
"a",
"description",
"in",
"the",
"header",
"if",
"no",
"one",
"was",
"found",
"."
] | 730845a833a9660ebfdb60ad027ebaab5ac871b6 | https://github.com/tolokoban/ToloFrameWork/blob/730845a833a9660ebfdb60ad027ebaab5ac871b6/lib/compiler-html2.js#L919-L947 | train |
pzlr/build-core | lib/entries.js | getEntryImports | function getEntryImports(dir, content, arr = []) {
$C(content.split(eol)).forEach((line) => {
if (!hasImport.test(line)) {
return;
}
const
url = RegExp.$2,
nodeModule = isNodeModule(url);
if (nodeModule && entriesDir.test(url) || insideEntry.test(url)) {
const
d = nodeModule ? lib : dir;
... | javascript | function getEntryImports(dir, content, arr = []) {
$C(content.split(eol)).forEach((line) => {
if (!hasImport.test(line)) {
return;
}
const
url = RegExp.$2,
nodeModule = isNodeModule(url);
if (nodeModule && entriesDir.test(url) || insideEntry.test(url)) {
const
d = nodeModule ? lib : dir;
... | [
"function",
"getEntryImports",
"(",
"dir",
",",
"content",
",",
"arr",
"=",
"[",
"]",
")",
"{",
"$C",
"(",
"content",
".",
"split",
"(",
"eol",
")",
")",
".",
"forEach",
"(",
"(",
"line",
")",
"=>",
"{",
"if",
"(",
"!",
"hasImport",
".",
"test",
... | Returns a list of imports from the specified entry file
@param {string} dir - entry directory
@param {string} content - file content
@param {!Array} [arr]
@returns {!Array<string>} | [
"Returns",
"a",
"list",
"of",
"imports",
"from",
"the",
"specified",
"entry",
"file"
] | 11e20eda500682b9fa62c7804c66be1714df0df4 | https://github.com/pzlr/build-core/blob/11e20eda500682b9fa62c7804c66be1714df0df4/lib/entries.js#L153-L182 | train |
pzlr/build-core | lib/entries.js | getEntryParents | function getEntryParents(content) {
const
parents = new Set(),
clrfx = /\.\//;
$C(content.split(eol)).forEach((line) => {
if (!hasImport.test(line)) {
return;
}
const
url = RegExp.$2;
if (isNodeModule(url) && entriesDir.test(url) || insideEntry.test(url)) {
parents.add(url.replace(clrfx, ''));... | javascript | function getEntryParents(content) {
const
parents = new Set(),
clrfx = /\.\//;
$C(content.split(eol)).forEach((line) => {
if (!hasImport.test(line)) {
return;
}
const
url = RegExp.$2;
if (isNodeModule(url) && entriesDir.test(url) || insideEntry.test(url)) {
parents.add(url.replace(clrfx, ''));... | [
"function",
"getEntryParents",
"(",
"content",
")",
"{",
"const",
"parents",
"=",
"new",
"Set",
"(",
")",
",",
"clrfx",
"=",
"/",
"\\.\\/",
"/",
";",
"$C",
"(",
"content",
".",
"split",
"(",
"eol",
")",
")",
".",
"forEach",
"(",
"(",
"line",
")",
... | Returns a set of parent entries for the specified entry
@param {string} content - file content
@returns {!Set<string>} | [
"Returns",
"a",
"set",
"of",
"parent",
"entries",
"for",
"the",
"specified",
"entry"
] | 11e20eda500682b9fa62c7804c66be1714df0df4 | https://github.com/pzlr/build-core/blob/11e20eda500682b9fa62c7804c66be1714df0df4/lib/entries.js#L190-L209 | train |
pzlr/build-core | lib/entries.js | getEntryRuntimeDependencies | async function getEntryRuntimeDependencies(dir, content, {cache} = {}) {
const deps = {
runtime: new Map(),
parents: new Map(),
libs: new Set()
};
const
runtime = new Set();
await $C(getEntryImports(dir, content)).async.forEach(async (el) => {
const
name = path.basename(el, path.extname(el)),
bloc... | javascript | async function getEntryRuntimeDependencies(dir, content, {cache} = {}) {
const deps = {
runtime: new Map(),
parents: new Map(),
libs: new Set()
};
const
runtime = new Set();
await $C(getEntryImports(dir, content)).async.forEach(async (el) => {
const
name = path.basename(el, path.extname(el)),
bloc... | [
"async",
"function",
"getEntryRuntimeDependencies",
"(",
"dir",
",",
"content",
",",
"{",
"cache",
"}",
"=",
"{",
"}",
")",
"{",
"const",
"deps",
"=",
"{",
"runtime",
":",
"new",
"Map",
"(",
")",
",",
"parents",
":",
"new",
"Map",
"(",
")",
",",
"l... | Returns a graph with dependencies for an entry file
@param {string} dir - entry directory
@param {string} content - file content
@param {Map<string, !Block>=} [cache] - optional cache object with predefined blocks
@returns {!Promise<{runtime: !Map<string, !Block>, parents: !Map<string, !Block>, libs: !Set<string>}>} | [
"Returns",
"a",
"graph",
"with",
"dependencies",
"for",
"an",
"entry",
"file"
] | 11e20eda500682b9fa62c7804c66be1714df0df4 | https://github.com/pzlr/build-core/blob/11e20eda500682b9fa62c7804c66be1714df0df4/lib/entries.js#L219-L259 | train |
pzlr/build-core | lib/entries.js | getBuildConfig | async function getBuildConfig() {
const entries = await $C(vinyl.src(path.join(entry(), '*.js'), {read: false}))
.async
.to({})
.reduce((res, el) => {
const
src = el.path,
name = path.basename(src, '.js');
let source;
function getSource() {
source = source || fs.readFileSync(src, 'utf-8');
... | javascript | async function getBuildConfig() {
const entries = await $C(vinyl.src(path.join(entry(), '*.js'), {read: false}))
.async
.to({})
.reduce((res, el) => {
const
src = el.path,
name = path.basename(src, '.js');
let source;
function getSource() {
source = source || fs.readFileSync(src, 'utf-8');
... | [
"async",
"function",
"getBuildConfig",
"(",
")",
"{",
"const",
"entries",
"=",
"await",
"$C",
"(",
"vinyl",
".",
"src",
"(",
"path",
".",
"join",
"(",
"entry",
"(",
")",
",",
"'*.js'",
")",
",",
"{",
"read",
":",
"false",
"}",
")",
")",
".",
"asy... | Returns build config for entries
@returns {!Promise<!{entries, dependencies, commons}>} | [
"Returns",
"build",
"config",
"for",
"entries"
] | 11e20eda500682b9fa62c7804c66be1714df0df4 | https://github.com/pzlr/build-core/blob/11e20eda500682b9fa62c7804c66be1714df0df4/lib/entries.js#L265-L318 | train |
dalekjs/dalek-driver-sauce | lib/commands/window.js | function (name, hash) {
this.actionQueue.push(this.webdriverClient.windowHandles.bind(this.webdriverClient));
this.actionQueue.push(function (result) {
var deferred = Q.defer();
if (name === null) {
deferred.resolve(JSON.parse(result).value[0]);
}
deferred.resolve(name);
re... | javascript | function (name, hash) {
this.actionQueue.push(this.webdriverClient.windowHandles.bind(this.webdriverClient));
this.actionQueue.push(function (result) {
var deferred = Q.defer();
if (name === null) {
deferred.resolve(JSON.parse(result).value[0]);
}
deferred.resolve(name);
re... | [
"function",
"(",
"name",
",",
"hash",
")",
"{",
"this",
".",
"actionQueue",
".",
"push",
"(",
"this",
".",
"webdriverClient",
".",
"windowHandles",
".",
"bind",
"(",
"this",
".",
"webdriverClient",
")",
")",
";",
"this",
".",
"actionQueue",
".",
"push",
... | Switches to another window context
@method toFrame
@param {string} name Name of the window to switch to
@param {string} hash Unique hash of that fn call
@chainable | [
"Switches",
"to",
"another",
"window",
"context"
] | 4b3ef87a0c35a91db8456d074b0d47a3e0df58f7 | https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/window.js#L49-L62 | train | |
dalekjs/dalek-driver-sauce | lib/commands/window.js | function (dimensions, hash) {
this.actionQueue.push(this.webdriverClient.setWindowSize.bind(this.webdriverClient, dimensions.width, dimensions.height));
this.actionQueue.push(this._resizeCb.bind(this, dimensions, hash));
return this;
} | javascript | function (dimensions, hash) {
this.actionQueue.push(this.webdriverClient.setWindowSize.bind(this.webdriverClient, dimensions.width, dimensions.height));
this.actionQueue.push(this._resizeCb.bind(this, dimensions, hash));
return this;
} | [
"function",
"(",
"dimensions",
",",
"hash",
")",
"{",
"this",
".",
"actionQueue",
".",
"push",
"(",
"this",
".",
"webdriverClient",
".",
"setWindowSize",
".",
"bind",
"(",
"this",
".",
"webdriverClient",
",",
"dimensions",
".",
"width",
",",
"dimensions",
... | Resizes the current window
@method resize
@param {object} dimensions New window width & height
@param {string} hash Unique hash of that fn call
@chainable | [
"Resizes",
"the",
"current",
"window"
] | 4b3ef87a0c35a91db8456d074b0d47a3e0df58f7 | https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/window.js#L91-L95 | train | |
dalekjs/dalek-driver-sauce | lib/commands/window.js | function (hash) {
this.actionQueue.push(this.webdriverClient.maximize.bind(this.webdriverClient));
this.actionQueue.push(this._maximizeCb.bind(this, hash));
return this;
} | javascript | function (hash) {
this.actionQueue.push(this.webdriverClient.maximize.bind(this.webdriverClient));
this.actionQueue.push(this._maximizeCb.bind(this, hash));
return this;
} | [
"function",
"(",
"hash",
")",
"{",
"this",
".",
"actionQueue",
".",
"push",
"(",
"this",
".",
"webdriverClient",
".",
"maximize",
".",
"bind",
"(",
"this",
".",
"webdriverClient",
")",
")",
";",
"this",
".",
"actionQueue",
".",
"push",
"(",
"this",
"."... | Maximizes the current window
@method maximize
@param {string} hash Unique hash of that fn call
@chainable | [
"Maximizes",
"the",
"current",
"window"
] | 4b3ef87a0c35a91db8456d074b0d47a3e0df58f7 | https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/window.js#L123-L127 | train | |
berkeleybop/bbopx-js | npm/bbopx/bbopx.js | _set_url_from_token | function _set_url_from_token(in_token){
var url = null;
if( in_token ){
url = barista_location + '/api/' + namespace + '/m3BatchPrivileged';
}else{
url = barista_location + '/api/' + namespace + '/m3Batch';
}
anchor._url = url;
return url;
} | javascript | function _set_url_from_token(in_token){
var url = null;
if( in_token ){
url = barista_location + '/api/' + namespace + '/m3BatchPrivileged';
}else{
url = barista_location + '/api/' + namespace + '/m3Batch';
}
anchor._url = url;
return url;
} | [
"function",
"_set_url_from_token",
"(",
"in_token",
")",
"{",
"var",
"url",
"=",
"null",
";",
"if",
"(",
"in_token",
")",
"{",
"url",
"=",
"barista_location",
"+",
"'/api/'",
"+",
"namespace",
"+",
"'/m3BatchPrivileged'",
";",
"}",
"else",
"{",
"url",
"=",... | Will use this one other spot, where the user can change the token. | [
"Will",
"use",
"this",
"one",
"other",
"spot",
"where",
"the",
"user",
"can",
"change",
"the",
"token",
"."
] | 847d87f5980f144c19c4caef3786044930fe51db | https://github.com/berkeleybop/bbopx-js/blob/847d87f5980f144c19c4caef3786044930fe51db/npm/bbopx/bbopx.js#L643-L652 | train |
berkeleybop/bbopx-js | npm/bbopx/bbopx.js | _on_fail | function _on_fail(resp, man){
// See if we got any traction.
if( ! resp || ! resp.message_type() || ! resp.message() ){
// Something dark has happened, try to put something
// together.
// console.log('bad resp!?: ', resp);
var resp_seed = {
'message_type': 'error',
'message': 'deep manager er... | javascript | function _on_fail(resp, man){
// See if we got any traction.
if( ! resp || ! resp.message_type() || ! resp.message() ){
// Something dark has happened, try to put something
// together.
// console.log('bad resp!?: ', resp);
var resp_seed = {
'message_type': 'error',
'message': 'deep manager er... | [
"function",
"_on_fail",
"(",
"resp",
",",
"man",
")",
"{",
"// See if we got any traction.",
"if",
"(",
"!",
"resp",
"||",
"!",
"resp",
".",
"message_type",
"(",
")",
"||",
"!",
"resp",
".",
"message",
"(",
")",
")",
"{",
"// Something dark has happened, try... | How to deal with failure. | [
"How",
"to",
"deal",
"with",
"failure",
"."
] | 847d87f5980f144c19c4caef3786044930fe51db | https://github.com/berkeleybop/bbopx-js/blob/847d87f5980f144c19c4caef3786044930fe51db/npm/bbopx/bbopx.js#L689-L702 | train |
berkeleybop/bbopx-js | npm/bbopx/bbopx.js | _on_nominal_success | function _on_nominal_success(resp, man){
// Switch on message type when there isn't a complete failure.
var m = resp.message_type();
if( m == 'error' ){
// Errors trump everything.
anchor.apply_callbacks('error', [resp, anchor]);
}else if( m == 'warning' ){
// Don't really have anything for warning... | javascript | function _on_nominal_success(resp, man){
// Switch on message type when there isn't a complete failure.
var m = resp.message_type();
if( m == 'error' ){
// Errors trump everything.
anchor.apply_callbacks('error', [resp, anchor]);
}else if( m == 'warning' ){
// Don't really have anything for warning... | [
"function",
"_on_nominal_success",
"(",
"resp",
",",
"man",
")",
"{",
"// Switch on message type when there isn't a complete failure.",
"var",
"m",
"=",
"resp",
".",
"message_type",
"(",
")",
";",
"if",
"(",
"m",
"==",
"'error'",
")",
"{",
"// Errors trump everythin... | When we have nominal success, we still need to do some kind of dispatch to the proper functionality. | [
"When",
"we",
"have",
"nominal",
"success",
"we",
"still",
"need",
"to",
"do",
"some",
"kind",
"of",
"dispatch",
"to",
"the",
"proper",
"functionality",
"."
] | 847d87f5980f144c19c4caef3786044930fe51db | https://github.com/berkeleybop/bbopx-js/blob/847d87f5980f144c19c4caef3786044930fe51db/npm/bbopx/bbopx.js#L707-L731 | train |
berkeleybop/bbopx-js | npm/bbopx/bbopx.js | _applys_to_us_p | function _applys_to_us_p(data){
var ret = false;
var mid = data['model_id'] || null;
if( ! mid || mid != anchor.model_id ){
ll('skip packet--not for us');
}else{
ret = true;
}
return ret;
} | javascript | function _applys_to_us_p(data){
var ret = false;
var mid = data['model_id'] || null;
if( ! mid || mid != anchor.model_id ){
ll('skip packet--not for us');
}else{
ret = true;
}
return ret;
} | [
"function",
"_applys_to_us_p",
"(",
"data",
")",
"{",
"var",
"ret",
"=",
"false",
";",
"var",
"mid",
"=",
"data",
"[",
"'model_id'",
"]",
"||",
"null",
";",
"if",
"(",
"!",
"mid",
"||",
"mid",
"!=",
"anchor",
".",
"model_id",
")",
"{",
"ll",
"(",
... | Check whether ot not we should ignore the incoming data. | [
"Check",
"whether",
"ot",
"not",
"we",
"should",
"ignore",
"the",
"incoming",
"data",
"."
] | 847d87f5980f144c19c4caef3786044930fe51db | https://github.com/berkeleybop/bbopx-js/blob/847d87f5980f144c19c4caef3786044930fe51db/npm/bbopx/bbopx.js#L3936-L3947 | train |
berkeleybop/bbopx-js | npm/bbopx/bbopx.js | function(e){
// Check if we are talking about self or parent.
if( this === e.target ||
container_id === jQuery(e.target).parent().attr('id') ||
container_id === jQuery(e.target).attr('id') ){
_update_start_pos(e);
// Bind to moving.
jQuery(container_div).bind('mousemove', _scroller);
... | javascript | function(e){
// Check if we are talking about self or parent.
if( this === e.target ||
container_id === jQuery(e.target).parent().attr('id') ||
container_id === jQuery(e.target).attr('id') ){
_update_start_pos(e);
// Bind to moving.
jQuery(container_div).bind('mousemove', _scroller);
... | [
"function",
"(",
"e",
")",
"{",
"// Check if we are talking about self or parent.",
"if",
"(",
"this",
"===",
"e",
".",
"target",
"||",
"container_id",
"===",
"jQuery",
"(",
"e",
".",
"target",
")",
".",
"parent",
"(",
")",
".",
"attr",
"(",
"'id'",
")",
... | Only start if actual, not child. | [
"Only",
"start",
"if",
"actual",
"not",
"child",
"."
] | 847d87f5980f144c19c4caef3786044930fe51db | https://github.com/berkeleybop/bbopx-js/blob/847d87f5980f144c19c4caef3786044930fe51db/npm/bbopx/bbopx.js#L4262-L4271 | train | |
berkeleybop/bbopx-js | npm/bbopx/bbopx.js | _sorter | function _sorter(a, b){
// Use aid property priority.
var bpri = aid.priority(b.property_id());
var apri = aid.priority(a.property_id());
return apri - bpri;
} | javascript | function _sorter(a, b){
// Use aid property priority.
var bpri = aid.priority(b.property_id());
var apri = aid.priority(a.property_id());
return apri - bpri;
} | [
"function",
"_sorter",
"(",
"a",
",",
"b",
")",
"{",
"// Use aid property priority.",
"var",
"bpri",
"=",
"aid",
".",
"priority",
"(",
"b",
".",
"property_id",
"(",
")",
")",
";",
"var",
"apri",
"=",
"aid",
".",
"priority",
"(",
"a",
".",
"property_id"... | Sort the types within the stack according to the known type priorities. | [
"Sort",
"the",
"types",
"within",
"the",
"stack",
"according",
"to",
"the",
"known",
"type",
"priorities",
"."
] | 847d87f5980f144c19c4caef3786044930fe51db | https://github.com/berkeleybop/bbopx-js/blob/847d87f5980f144c19c4caef3786044930fe51db/npm/bbopx/bbopx.js#L5340-L5345 | train |
berkeleybop/bbopx-js | npm/bbopx/bbopx.js | _add_table_row | function _add_table_row(item, color, prefix, suffix){
//var rep_color = aid.color(item.category());
var out_rep = bbopx.noctua.type_to_span(item, color);
if( prefix ){ out_rep = prefix + out_rep; }
if( suffix ){ out_rep = out_rep + suffix; }
var trstr = null;
if( color ){
trstr = '<tr class="bbop-mme-stack-t... | javascript | function _add_table_row(item, color, prefix, suffix){
//var rep_color = aid.color(item.category());
var out_rep = bbopx.noctua.type_to_span(item, color);
if( prefix ){ out_rep = prefix + out_rep; }
if( suffix ){ out_rep = out_rep + suffix; }
var trstr = null;
if( color ){
trstr = '<tr class="bbop-mme-stack-t... | [
"function",
"_add_table_row",
"(",
"item",
",",
"color",
",",
"prefix",
",",
"suffix",
")",
"{",
"//var rep_color = aid.color(item.category());",
"var",
"out_rep",
"=",
"bbopx",
".",
"noctua",
".",
"type_to_span",
"(",
"item",
",",
"color",
")",
";",
"if",
"("... | General function for adding type information to stack. | [
"General",
"function",
"for",
"adding",
"type",
"information",
"to",
"stack",
"."
] | 847d87f5980f144c19c4caef3786044930fe51db | https://github.com/berkeleybop/bbopx-js/blob/847d87f5980f144c19c4caef3786044930fe51db/npm/bbopx/bbopx.js#L5366-L5381 | train |
Subsets and Splits
SQL Console for semeru/code-text-javascript
Retrieves 20,000 non-null code samples labeled as JavaScript, providing a basic overview of the dataset.