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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
glidejs/glide | dist/glide.esm.js | make | function make(move) {
var _this = this;
if (!Glide.disabled) {
Glide.disable();
this.move = move;
Events.emit('run.before', this.move);
this.calculate();
Events.emit('run', this.move);
Components.Transition.after(function () {
if (_this.isStart... | javascript | function make(move) {
var _this = this;
if (!Glide.disabled) {
Glide.disable();
this.move = move;
Events.emit('run.before', this.move);
this.calculate();
Events.emit('run', this.move);
Components.Transition.after(function () {
if (_this.isStart... | [
"function",
"make",
"(",
"move",
")",
"{",
"var",
"_this",
"=",
"this",
";",
"if",
"(",
"!",
"Glide",
".",
"disabled",
")",
"{",
"Glide",
".",
"disable",
"(",
")",
";",
"this",
".",
"move",
"=",
"move",
";",
"Events",
".",
"emit",
"(",
"'run.befo... | Makes glides running based on the passed moving schema.
@param {String} move | [
"Makes",
"glides",
"running",
"based",
"on",
"the",
"passed",
"moving",
"schema",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L897-L931 | train |
glidejs/glide | dist/glide.esm.js | calculate | function calculate() {
var move = this.move,
length = this.length;
var steps = move.steps,
direction = move.direction;
var countableSteps = isNumber(toInt(steps)) && toInt(steps) !== 0;
switch (direction) {
case '>':
if (steps === '>') {
Glide... | javascript | function calculate() {
var move = this.move,
length = this.length;
var steps = move.steps,
direction = move.direction;
var countableSteps = isNumber(toInt(steps)) && toInt(steps) !== 0;
switch (direction) {
case '>':
if (steps === '>') {
Glide... | [
"function",
"calculate",
"(",
")",
"{",
"var",
"move",
"=",
"this",
".",
"move",
",",
"length",
"=",
"this",
".",
"length",
";",
"var",
"steps",
"=",
"move",
".",
"steps",
",",
"direction",
"=",
"move",
".",
"direction",
";",
"var",
"countableSteps",
... | Calculates current index based on defined move.
@return {Void} | [
"Calculates",
"current",
"index",
"based",
"on",
"defined",
"move",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L939-L989 | train |
glidejs/glide | dist/glide.esm.js | set | function set(value) {
var step = value.substr(1);
this._m = {
direction: value.substr(0, 1),
steps: step ? toInt(step) ? toInt(step) : step : 0
};
} | javascript | function set(value) {
var step = value.substr(1);
this._m = {
direction: value.substr(0, 1),
steps: step ? toInt(step) ? toInt(step) : step : 0
};
} | [
"function",
"set",
"(",
"value",
")",
"{",
"var",
"step",
"=",
"value",
".",
"substr",
"(",
"1",
")",
";",
"this",
".",
"_m",
"=",
"{",
"direction",
":",
"value",
".",
"substr",
"(",
"0",
",",
"1",
")",
",",
"steps",
":",
"step",
"?",
"toInt",
... | Sets value of the move schema.
@returns {Object} | [
"Sets",
"value",
"of",
"the",
"move",
"schema",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1039-L1046 | train |
glidejs/glide | dist/glide.esm.js | get | function get() {
var settings = Glide.settings;
var length = Components.Html.slides.length;
// If the `bound` option is acitve, a maximum running distance should be
// reduced by `perView` and `focusAt` settings. Running distance
// should end before creating an empty space after instance... | javascript | function get() {
var settings = Glide.settings;
var length = Components.Html.slides.length;
// If the `bound` option is acitve, a maximum running distance should be
// reduced by `perView` and `focusAt` settings. Running distance
// should end before creating an empty space after instance... | [
"function",
"get",
"(",
")",
"{",
"var",
"settings",
"=",
"Glide",
".",
"settings",
";",
"var",
"length",
"=",
"Components",
".",
"Html",
".",
"slides",
".",
"length",
";",
"// If the `bound` option is acitve, a maximum running distance should be",
"// reduced by `per... | Gets value of the running distance based
on zero-indexing number of slides.
@return {Number} | [
"Gets",
"value",
"of",
"the",
"running",
"distance",
"based",
"on",
"zero",
"-",
"indexing",
"number",
"of",
"slides",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1056-L1069 | train |
glidejs/glide | dist/glide.esm.js | apply | function apply(slides) {
for (var i = 0, len = slides.length; i < len; i++) {
var style = slides[i].style;
var direction = Components.Direction.value;
if (i !== 0) {
style[MARGIN_TYPE[direction][0]] = this.value / 2 + 'px';
} else {
style[MARGIN_TYPE[direction]... | javascript | function apply(slides) {
for (var i = 0, len = slides.length; i < len; i++) {
var style = slides[i].style;
var direction = Components.Direction.value;
if (i !== 0) {
style[MARGIN_TYPE[direction][0]] = this.value / 2 + 'px';
} else {
style[MARGIN_TYPE[direction]... | [
"function",
"apply",
"(",
"slides",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"slides",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"var",
"style",
"=",
"slides",
"[",
"i",
"]",
".",
"style",
";",
"var",
... | Applies gaps between slides. First and last
slides do not receive it's edge margins.
@param {HTMLCollection} slides
@return {Void} | [
"Applies",
"gaps",
"between",
"slides",
".",
"First",
"and",
"last",
"slides",
"do",
"not",
"receive",
"it",
"s",
"edge",
"margins",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1164-L1181 | train |
glidejs/glide | dist/glide.esm.js | remove | function remove(slides) {
for (var i = 0, len = slides.length; i < len; i++) {
var style = slides[i].style;
style.marginLeft = '';
style.marginRight = '';
}
} | javascript | function remove(slides) {
for (var i = 0, len = slides.length; i < len; i++) {
var style = slides[i].style;
style.marginLeft = '';
style.marginRight = '';
}
} | [
"function",
"remove",
"(",
"slides",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"slides",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"var",
"style",
"=",
"slides",
"[",
"i",
"]",
".",
"style",
";",
"style... | Removes gaps from the slides.
@param {HTMLCollection} slides
@returns {Void} | [
"Removes",
"gaps",
"from",
"the",
"slides",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1190-L1197 | train |
glidejs/glide | dist/glide.esm.js | siblings | function siblings(node) {
if (node && node.parentNode) {
var n = node.parentNode.firstChild;
var matched = [];
for (; n; n = n.nextSibling) {
if (n.nodeType === 1 && n !== node) {
matched.push(n);
}
}
return matched;
}
return [];
} | javascript | function siblings(node) {
if (node && node.parentNode) {
var n = node.parentNode.firstChild;
var matched = [];
for (; n; n = n.nextSibling) {
if (n.nodeType === 1 && n !== node) {
matched.push(n);
}
}
return matched;
}
return [];
} | [
"function",
"siblings",
"(",
"node",
")",
"{",
"if",
"(",
"node",
"&&",
"node",
".",
"parentNode",
")",
"{",
"var",
"n",
"=",
"node",
".",
"parentNode",
".",
"firstChild",
";",
"var",
"matched",
"=",
"[",
"]",
";",
"for",
"(",
";",
"n",
";",
"n",... | Finds siblings nodes of the passed node.
@param {Element} node
@return {Array} | [
"Finds",
"siblings",
"nodes",
"of",
"the",
"passed",
"node",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1263-L1278 | train |
glidejs/glide | dist/glide.esm.js | mount | function mount() {
this.root = Glide.selector;
this.track = this.root.querySelector(TRACK_SELECTOR);
this.slides = Array.prototype.slice.call(this.wrapper.children).filter(function (slide) {
return !slide.classList.contains(Glide.settings.classes.cloneSlide);
});
} | javascript | function mount() {
this.root = Glide.selector;
this.track = this.root.querySelector(TRACK_SELECTOR);
this.slides = Array.prototype.slice.call(this.wrapper.children).filter(function (slide) {
return !slide.classList.contains(Glide.settings.classes.cloneSlide);
});
} | [
"function",
"mount",
"(",
")",
"{",
"this",
".",
"root",
"=",
"Glide",
".",
"selector",
";",
"this",
".",
"track",
"=",
"this",
".",
"root",
".",
"querySelector",
"(",
"TRACK_SELECTOR",
")",
";",
"this",
".",
"slides",
"=",
"Array",
".",
"prototype",
... | Setup slider HTML nodes.
@param {Glide} glide | [
"Setup",
"slider",
"HTML",
"nodes",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1303-L1309 | train |
glidejs/glide | dist/glide.esm.js | set | function set(r) {
if (isString(r)) {
r = document.querySelector(r);
}
if (exist(r)) {
Html._r = r;
} else {
warn('Root element must be a existing Html node');
}
} | javascript | function set(r) {
if (isString(r)) {
r = document.querySelector(r);
}
if (exist(r)) {
Html._r = r;
} else {
warn('Root element must be a existing Html node');
}
} | [
"function",
"set",
"(",
"r",
")",
"{",
"if",
"(",
"isString",
"(",
"r",
")",
")",
"{",
"r",
"=",
"document",
".",
"querySelector",
"(",
"r",
")",
";",
"}",
"if",
"(",
"exist",
"(",
"r",
")",
")",
"{",
"Html",
".",
"_r",
"=",
"r",
";",
"}",
... | Sets node of the glide main element.
@return {Object} | [
"Sets",
"node",
"of",
"the",
"glide",
"main",
"element",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1328-L1338 | train |
glidejs/glide | dist/glide.esm.js | set | function set(value) {
if (isObject(value)) {
value.before = toInt(value.before);
value.after = toInt(value.after);
} else {
value = toInt(value);
}
Peek._v = value;
} | javascript | function set(value) {
if (isObject(value)) {
value.before = toInt(value.before);
value.after = toInt(value.after);
} else {
value = toInt(value);
}
Peek._v = value;
} | [
"function",
"set",
"(",
"value",
")",
"{",
"if",
"(",
"isObject",
"(",
"value",
")",
")",
"{",
"value",
".",
"before",
"=",
"toInt",
"(",
"value",
".",
"before",
")",
";",
"value",
".",
"after",
"=",
"toInt",
"(",
"value",
".",
"after",
")",
";",... | Sets value of the peek.
@param {Number|Object} value
@return {Void} | [
"Sets",
"value",
"of",
"the",
"peek",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1409-L1418 | train |
glidejs/glide | dist/glide.esm.js | get | function get() {
var value = Peek.value;
var perView = Glide.settings.perView;
if (isObject(value)) {
return value.before / perView + value.after / perView;
}
return value * 2 / perView;
} | javascript | function get() {
var value = Peek.value;
var perView = Glide.settings.perView;
if (isObject(value)) {
return value.before / perView + value.after / perView;
}
return value * 2 / perView;
} | [
"function",
"get",
"(",
")",
"{",
"var",
"value",
"=",
"Peek",
".",
"value",
";",
"var",
"perView",
"=",
"Glide",
".",
"settings",
".",
"perView",
";",
"if",
"(",
"isObject",
"(",
"value",
")",
")",
"{",
"return",
"value",
".",
"before",
"/",
"perV... | Gets reduction value caused by peek.
@returns {Number} | [
"Gets",
"reduction",
"value",
"caused",
"by",
"peek",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1427-L1436 | train |
glidejs/glide | dist/glide.esm.js | make | function make() {
var _this = this;
var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
this.offset = offset;
Events.emit('move', {
movement: this.value
});
Components.Transition.after(function () {
Events.emit('move.after', {
... | javascript | function make() {
var _this = this;
var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
this.offset = offset;
Events.emit('move', {
movement: this.value
});
Components.Transition.after(function () {
Events.emit('move.after', {
... | [
"function",
"make",
"(",
")",
"{",
"var",
"_this",
"=",
"this",
";",
"var",
"offset",
"=",
"arguments",
".",
"length",
">",
"0",
"&&",
"arguments",
"[",
"0",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"0",
"]",
":",
"0",
";",
"this",
".",
"o... | Calculates a movement value based on passed offset and currently active index.
@param {Number} offset
@return {Void} | [
"Calculates",
"a",
"movement",
"value",
"based",
"on",
"passed",
"offset",
"and",
"currently",
"active",
"index",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1468-L1484 | train |
glidejs/glide | dist/glide.esm.js | get | function get() {
var offset = this.offset;
var translate = this.translate;
if (Components.Direction.is('rtl')) {
return translate + offset;
}
return translate - offset;
} | javascript | function get() {
var offset = this.offset;
var translate = this.translate;
if (Components.Direction.is('rtl')) {
return translate + offset;
}
return translate - offset;
} | [
"function",
"get",
"(",
")",
"{",
"var",
"offset",
"=",
"this",
".",
"offset",
";",
"var",
"translate",
"=",
"this",
".",
"translate",
";",
"if",
"(",
"Components",
".",
"Direction",
".",
"is",
"(",
"'rtl'",
")",
")",
"{",
"return",
"translate",
"+",... | Gets an actual movement value corrected by offset.
@return {Number} | [
"Gets",
"an",
"actual",
"movement",
"value",
"corrected",
"by",
"offset",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1525-L1534 | train |
glidejs/glide | dist/glide.esm.js | setupSlides | function setupSlides() {
var width = this.slideWidth + 'px';
var slides = Components.Html.slides;
for (var i = 0; i < slides.length; i++) {
slides[i].style.width = width;
}
} | javascript | function setupSlides() {
var width = this.slideWidth + 'px';
var slides = Components.Html.slides;
for (var i = 0; i < slides.length; i++) {
slides[i].style.width = width;
}
} | [
"function",
"setupSlides",
"(",
")",
"{",
"var",
"width",
"=",
"this",
".",
"slideWidth",
"+",
"'px'",
";",
"var",
"slides",
"=",
"Components",
".",
"Html",
".",
"slides",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"slides",
".",
"length... | Setups dimentions of slides.
@return {Void} | [
"Setups",
"dimentions",
"of",
"slides",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1556-L1563 | train |
glidejs/glide | dist/glide.esm.js | remove | function remove() {
var slides = Components.Html.slides;
for (var i = 0; i < slides.length; i++) {
slides[i].style.width = '';
}
Components.Html.wrapper.style.width = '';
} | javascript | function remove() {
var slides = Components.Html.slides;
for (var i = 0; i < slides.length; i++) {
slides[i].style.width = '';
}
Components.Html.wrapper.style.width = '';
} | [
"function",
"remove",
"(",
")",
"{",
"var",
"slides",
"=",
"Components",
".",
"Html",
".",
"slides",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"slides",
".",
"length",
";",
"i",
"++",
")",
"{",
"slides",
"[",
"i",
"]",
".",
"style",... | Removes applied styles from HTML elements.
@returns {Void} | [
"Removes",
"applied",
"styles",
"from",
"HTML",
"elements",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1581-L1589 | train |
glidejs/glide | dist/glide.esm.js | get | function get() {
return Sizes.slideWidth * Sizes.length + Components.Gaps.grow + Components.Clones.grow;
} | javascript | function get() {
return Sizes.slideWidth * Sizes.length + Components.Gaps.grow + Components.Clones.grow;
} | [
"function",
"get",
"(",
")",
"{",
"return",
"Sizes",
".",
"slideWidth",
"*",
"Sizes",
".",
"length",
"+",
"Components",
".",
"Gaps",
".",
"grow",
"+",
"Components",
".",
"Clones",
".",
"grow",
";",
"}"
] | Gets size of the slides wrapper.
@return {Number} | [
"Gets",
"size",
"of",
"the",
"slides",
"wrapper",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1620-L1622 | train |
glidejs/glide | dist/glide.esm.js | get | function get() {
return Sizes.width / Glide.settings.perView - Components.Peek.reductor - Components.Gaps.reductor;
} | javascript | function get() {
return Sizes.width / Glide.settings.perView - Components.Peek.reductor - Components.Gaps.reductor;
} | [
"function",
"get",
"(",
")",
"{",
"return",
"Sizes",
".",
"width",
"/",
"Glide",
".",
"settings",
".",
"perView",
"-",
"Components",
".",
"Peek",
".",
"reductor",
"-",
"Components",
".",
"Gaps",
".",
"reductor",
";",
"}"
] | Gets width value of the single slide.
@return {Number} | [
"Gets",
"width",
"value",
"of",
"the",
"single",
"slide",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1631-L1633 | train |
glidejs/glide | dist/glide.esm.js | typeClass | function typeClass() {
Components.Html.root.classList.add(Glide.settings.classes[Glide.settings.type]);
} | javascript | function typeClass() {
Components.Html.root.classList.add(Glide.settings.classes[Glide.settings.type]);
} | [
"function",
"typeClass",
"(",
")",
"{",
"Components",
".",
"Html",
".",
"root",
".",
"classList",
".",
"add",
"(",
"Glide",
".",
"settings",
".",
"classes",
"[",
"Glide",
".",
"settings",
".",
"type",
"]",
")",
";",
"}"
] | Adds `type` class to the glide element.
@return {Void} | [
"Adds",
"type",
"class",
"to",
"the",
"glide",
"element",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1681-L1683 | train |
glidejs/glide | dist/glide.esm.js | removeClasses | function removeClasses() {
var classes = Glide.settings.classes;
Components.Html.root.classList.remove(classes[Glide.settings.type]);
Components.Html.slides.forEach(function (sibling) {
sibling.classList.remove(classes.activeSlide);
});
} | javascript | function removeClasses() {
var classes = Glide.settings.classes;
Components.Html.root.classList.remove(classes[Glide.settings.type]);
Components.Html.slides.forEach(function (sibling) {
sibling.classList.remove(classes.activeSlide);
});
} | [
"function",
"removeClasses",
"(",
")",
"{",
"var",
"classes",
"=",
"Glide",
".",
"settings",
".",
"classes",
";",
"Components",
".",
"Html",
".",
"root",
".",
"classList",
".",
"remove",
"(",
"classes",
"[",
"Glide",
".",
"settings",
".",
"type",
"]",
... | Removes HTML classes applied at building.
@return {Void} | [
"Removes",
"HTML",
"classes",
"applied",
"at",
"building",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1710-L1718 | train |
glidejs/glide | dist/glide.esm.js | collect | function collect() {
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var slides = Components.Html.slides;
var _Glide$settings = Glide.settings,
perView = _Glide$settings.perView,
classes = _Glide$settings.classes;
var peekIncrementer = +!... | javascript | function collect() {
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var slides = Components.Html.slides;
var _Glide$settings = Glide.settings,
perView = _Glide$settings.perView,
classes = _Glide$settings.classes;
var peekIncrementer = +!... | [
"function",
"collect",
"(",
")",
"{",
"var",
"items",
"=",
"arguments",
".",
"length",
">",
"0",
"&&",
"arguments",
"[",
"0",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"0",
"]",
":",
"[",
"]",
";",
"var",
"slides",
"=",
"Components",
".",
"Ht... | Collect clones with pattern.
@return {Void} | [
"Collect",
"clones",
"with",
"pattern",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1769-L1801 | train |
glidejs/glide | dist/glide.esm.js | append | function append() {
var items = this.items;
var _Components$Html = Components.Html,
wrapper = _Components$Html.wrapper,
slides = _Components$Html.slides;
var half = Math.floor(items.length / 2);
var prepend = items.slice(0, half).reverse();
var append = items.slice(ha... | javascript | function append() {
var items = this.items;
var _Components$Html = Components.Html,
wrapper = _Components$Html.wrapper,
slides = _Components$Html.slides;
var half = Math.floor(items.length / 2);
var prepend = items.slice(0, half).reverse();
var append = items.slice(ha... | [
"function",
"append",
"(",
")",
"{",
"var",
"items",
"=",
"this",
".",
"items",
";",
"var",
"_Components$Html",
"=",
"Components",
".",
"Html",
",",
"wrapper",
"=",
"_Components$Html",
".",
"wrapper",
",",
"slides",
"=",
"_Components$Html",
".",
"slides",
... | Append cloned slides with generated pattern.
@return {Void} | [
"Append",
"cloned",
"slides",
"with",
"generated",
"pattern",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1809-L1832 | train |
glidejs/glide | dist/glide.esm.js | remove | function remove() {
var items = this.items;
for (var i = 0; i < items.length; i++) {
Components.Html.wrapper.removeChild(items[i]);
}
} | javascript | function remove() {
var items = this.items;
for (var i = 0; i < items.length; i++) {
Components.Html.wrapper.removeChild(items[i]);
}
} | [
"function",
"remove",
"(",
")",
"{",
"var",
"items",
"=",
"this",
".",
"items",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"items",
".",
"length",
";",
"i",
"++",
")",
"{",
"Components",
".",
"Html",
".",
"wrapper",
".",
"removeChild",... | Remove all cloned slides.
@return {Void} | [
"Remove",
"all",
"cloned",
"slides",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1840-L1847 | train |
glidejs/glide | dist/glide.esm.js | get | function get() {
return (Components.Sizes.slideWidth + Components.Gaps.value) * Clones.items.length;
} | javascript | function get() {
return (Components.Sizes.slideWidth + Components.Gaps.value) * Clones.items.length;
} | [
"function",
"get",
"(",
")",
"{",
"return",
"(",
"Components",
".",
"Sizes",
".",
"slideWidth",
"+",
"Components",
".",
"Gaps",
".",
"value",
")",
"*",
"Clones",
".",
"items",
".",
"length",
";",
"}"
] | Gets additional dimentions value caused by clones.
@return {Number} | [
"Gets",
"additional",
"dimentions",
"value",
"caused",
"by",
"clones",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1856-L1858 | train |
glidejs/glide | dist/glide.esm.js | EventsBinder | function EventsBinder() {
var listeners = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
classCallCheck(this, EventsBinder);
this.listeners = listeners;
} | javascript | function EventsBinder() {
var listeners = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
classCallCheck(this, EventsBinder);
this.listeners = listeners;
} | [
"function",
"EventsBinder",
"(",
")",
"{",
"var",
"listeners",
"=",
"arguments",
".",
"length",
">",
"0",
"&&",
"arguments",
"[",
"0",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"0",
"]",
":",
"{",
"}",
";",
"classCallCheck",
"(",
"this",
",",
"... | Construct a EventsBinder instance. | [
"Construct",
"a",
"EventsBinder",
"instance",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1896-L1901 | train |
glidejs/glide | dist/glide.esm.js | bind | function bind() {
Binder.on('resize', window, throttle(function () {
Events.emit('resize');
}, Glide.settings.throttle));
} | javascript | function bind() {
Binder.on('resize', window, throttle(function () {
Events.emit('resize');
}, Glide.settings.throttle));
} | [
"function",
"bind",
"(",
")",
"{",
"Binder",
".",
"on",
"(",
"'resize'",
",",
"window",
",",
"throttle",
"(",
"function",
"(",
")",
"{",
"Events",
".",
"emit",
"(",
"'resize'",
")",
";",
"}",
",",
"Glide",
".",
"settings",
".",
"throttle",
")",
")"... | Binds `rezsize` listener to the window.
It's a costly event, so we are debouncing it.
@return {Void} | [
"Binds",
"rezsize",
"listener",
"to",
"the",
"window",
".",
"It",
"s",
"a",
"costly",
"event",
"so",
"we",
"are",
"debouncing",
"it",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L1991-L1995 | train |
glidejs/glide | dist/glide.esm.js | resolve | function resolve(pattern) {
var token = pattern.slice(0, 1);
if (this.is('rtl')) {
return pattern.split(token).join(FLIPED_MOVEMENTS[token]);
}
return pattern;
} | javascript | function resolve(pattern) {
var token = pattern.slice(0, 1);
if (this.is('rtl')) {
return pattern.split(token).join(FLIPED_MOVEMENTS[token]);
}
return pattern;
} | [
"function",
"resolve",
"(",
"pattern",
")",
"{",
"var",
"token",
"=",
"pattern",
".",
"slice",
"(",
"0",
",",
"1",
")",
";",
"if",
"(",
"this",
".",
"is",
"(",
"'rtl'",
")",
")",
"{",
"return",
"pattern",
".",
"split",
"(",
"token",
")",
".",
"... | Resolves pattern based on direction value
@param {String} pattern
@returns {String} | [
"Resolves",
"pattern",
"based",
"on",
"direction",
"value"
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2045-L2053 | train |
glidejs/glide | dist/glide.esm.js | addClass | function addClass() {
Components.Html.root.classList.add(Glide.settings.classes.direction[this.value]);
} | javascript | function addClass() {
Components.Html.root.classList.add(Glide.settings.classes.direction[this.value]);
} | [
"function",
"addClass",
"(",
")",
"{",
"Components",
".",
"Html",
".",
"root",
".",
"classList",
".",
"add",
"(",
"Glide",
".",
"settings",
".",
"classes",
".",
"direction",
"[",
"this",
".",
"value",
"]",
")",
";",
"}"
] | Applies direction class to the root HTML element.
@return {Void} | [
"Applies",
"direction",
"class",
"to",
"the",
"root",
"HTML",
"element",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2072-L2074 | train |
glidejs/glide | dist/glide.esm.js | removeClass | function removeClass() {
Components.Html.root.classList.remove(Glide.settings.classes.direction[this.value]);
} | javascript | function removeClass() {
Components.Html.root.classList.remove(Glide.settings.classes.direction[this.value]);
} | [
"function",
"removeClass",
"(",
")",
"{",
"Components",
".",
"Html",
".",
"root",
".",
"classList",
".",
"remove",
"(",
"Glide",
".",
"settings",
".",
"classes",
".",
"direction",
"[",
"this",
".",
"value",
"]",
")",
";",
"}"
] | Removes direction class from the root HTML element.
@return {Void} | [
"Removes",
"direction",
"class",
"from",
"the",
"root",
"HTML",
"element",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2082-L2084 | train |
glidejs/glide | dist/glide.esm.js | Rtl | function Rtl (Glide, Components) {
return {
/**
* Negates the passed translate if glide is in RTL option.
*
* @param {Number} translate
* @return {Number}
*/
modify: function modify(translate) {
if (Components.Direction.is('rtl')) {
return -translate;
}
ret... | javascript | function Rtl (Glide, Components) {
return {
/**
* Negates the passed translate if glide is in RTL option.
*
* @param {Number} translate
* @return {Number}
*/
modify: function modify(translate) {
if (Components.Direction.is('rtl')) {
return -translate;
}
ret... | [
"function",
"Rtl",
"(",
"Glide",
",",
"Components",
")",
"{",
"return",
"{",
"/**\n * Negates the passed translate if glide is in RTL option.\n *\n * @param {Number} translate\n * @return {Number}\n */",
"modify",
":",
"function",
"modify",
"(",
"translate",
")... | Reflects value of glide movement.
@param {Object} Glide
@param {Object} Components
@return {Object} | [
"Reflects",
"value",
"of",
"glide",
"movement",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2149-L2165 | train |
glidejs/glide | dist/glide.esm.js | Gap | function Gap (Glide, Components) {
return {
/**
* Modifies passed translate value with number in the `gap` settings.
*
* @param {Number} translate
* @return {Number}
*/
modify: function modify(translate) {
return translate + Components.Gaps.value * Glide.index;
}
};
} | javascript | function Gap (Glide, Components) {
return {
/**
* Modifies passed translate value with number in the `gap` settings.
*
* @param {Number} translate
* @return {Number}
*/
modify: function modify(translate) {
return translate + Components.Gaps.value * Glide.index;
}
};
} | [
"function",
"Gap",
"(",
"Glide",
",",
"Components",
")",
"{",
"return",
"{",
"/**\n * Modifies passed translate value with number in the `gap` settings.\n *\n * @param {Number} translate\n * @return {Number}\n */",
"modify",
":",
"function",
"modify",
"(",
"trans... | Updates glide movement with a `gap` settings.
@param {Object} Glide
@param {Object} Components
@return {Object} | [
"Updates",
"glide",
"movement",
"with",
"a",
"gap",
"settings",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2174-L2186 | train |
glidejs/glide | dist/glide.esm.js | Grow | function Grow (Glide, Components) {
return {
/**
* Adds to the passed translate width of the half of clones.
*
* @param {Number} translate
* @return {Number}
*/
modify: function modify(translate) {
return translate + Components.Clones.grow / 2;
}
};
} | javascript | function Grow (Glide, Components) {
return {
/**
* Adds to the passed translate width of the half of clones.
*
* @param {Number} translate
* @return {Number}
*/
modify: function modify(translate) {
return translate + Components.Clones.grow / 2;
}
};
} | [
"function",
"Grow",
"(",
"Glide",
",",
"Components",
")",
"{",
"return",
"{",
"/**\n * Adds to the passed translate width of the half of clones.\n *\n * @param {Number} translate\n * @return {Number}\n */",
"modify",
":",
"function",
"modify",
"(",
"translate",
... | Updates glide movement with width of additional clones width.
@param {Object} Glide
@param {Object} Components
@return {Object} | [
"Updates",
"glide",
"movement",
"with",
"width",
"of",
"additional",
"clones",
"width",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2195-L2207 | train |
glidejs/glide | dist/glide.esm.js | modify | function modify(translate) {
if (Glide.settings.focusAt >= 0) {
var peek = Components.Peek.value;
if (isObject(peek)) {
return translate - peek.before;
}
return translate - peek;
}
return translate;
} | javascript | function modify(translate) {
if (Glide.settings.focusAt >= 0) {
var peek = Components.Peek.value;
if (isObject(peek)) {
return translate - peek.before;
}
return translate - peek;
}
return translate;
} | [
"function",
"modify",
"(",
"translate",
")",
"{",
"if",
"(",
"Glide",
".",
"settings",
".",
"focusAt",
">=",
"0",
")",
"{",
"var",
"peek",
"=",
"Components",
".",
"Peek",
".",
"value",
";",
"if",
"(",
"isObject",
"(",
"peek",
")",
")",
"{",
"return... | Modifies passed translate value with a `peek` setting.
@param {Number} translate
@return {Number} | [
"Modifies",
"passed",
"translate",
"value",
"with",
"a",
"peek",
"setting",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2224-L2236 | train |
glidejs/glide | dist/glide.esm.js | Focusing | function Focusing (Glide, Components) {
return {
/**
* Modifies passed translate value with index in the `focusAt` setting.
*
* @param {Number} translate
* @return {Number}
*/
modify: function modify(translate) {
var gap = Components.Gaps.value;
var width = Components.Siz... | javascript | function Focusing (Glide, Components) {
return {
/**
* Modifies passed translate value with index in the `focusAt` setting.
*
* @param {Number} translate
* @return {Number}
*/
modify: function modify(translate) {
var gap = Components.Gaps.value;
var width = Components.Siz... | [
"function",
"Focusing",
"(",
"Glide",
",",
"Components",
")",
"{",
"return",
"{",
"/**\n * Modifies passed translate value with index in the `focusAt` setting.\n *\n * @param {Number} translate\n * @return {Number}\n */",
"modify",
":",
"function",
"modify",
"(",
... | Updates glide movement with a `focusAt` settings.
@param {Object} Glide
@param {Object} Components
@return {Object} | [
"Updates",
"glide",
"movement",
"with",
"a",
"focusAt",
"settings",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2247-L2268 | train |
glidejs/glide | dist/glide.esm.js | mutator | function mutator (Glide, Components, Events) {
/**
* Merge instance transformers with collection of default transformers.
* It's important that the Rtl component be last on the list,
* so it reflects all previous transformations.
*
* @type {Array}
*/
var TRANSFORMERS = [Gap, Grow, Peeking, Focusin... | javascript | function mutator (Glide, Components, Events) {
/**
* Merge instance transformers with collection of default transformers.
* It's important that the Rtl component be last on the list,
* so it reflects all previous transformations.
*
* @type {Array}
*/
var TRANSFORMERS = [Gap, Grow, Peeking, Focusin... | [
"function",
"mutator",
"(",
"Glide",
",",
"Components",
",",
"Events",
")",
"{",
"/**\n * Merge instance transformers with collection of default transformers.\n * It's important that the Rtl component be last on the list,\n * so it reflects all previous transformations.\n *\n * @type {... | Applies diffrent transformers on translate value.
@param {Object} Glide
@param {Object} Components
@return {Object} | [
"Applies",
"diffrent",
"transformers",
"on",
"translate",
"value",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2277-L2308 | train |
glidejs/glide | dist/glide.esm.js | mutate | function mutate(translate) {
for (var i = 0; i < TRANSFORMERS.length; i++) {
var transformer = TRANSFORMERS[i];
if (isFunction(transformer) && isFunction(transformer().modify)) {
translate = transformer(Glide, Components, Events).modify(translate);
} else {
warn('Trans... | javascript | function mutate(translate) {
for (var i = 0; i < TRANSFORMERS.length; i++) {
var transformer = TRANSFORMERS[i];
if (isFunction(transformer) && isFunction(transformer().modify)) {
translate = transformer(Glide, Components, Events).modify(translate);
} else {
warn('Trans... | [
"function",
"mutate",
"(",
"translate",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"TRANSFORMERS",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"transformer",
"=",
"TRANSFORMERS",
"[",
"i",
"]",
";",
"if",
"(",
"isFunction",
"(",... | Piplines translate value with registered transformers.
@param {Number} translate
@return {Number} | [
"Piplines",
"translate",
"value",
"with",
"registered",
"transformers",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2294-L2306 | train |
glidejs/glide | dist/glide.esm.js | set | function set(value) {
var transform = mutator(Glide, Components).mutate(value);
Components.Html.wrapper.style.transform = 'translate3d(' + -1 * transform + 'px, 0px, 0px)';
} | javascript | function set(value) {
var transform = mutator(Glide, Components).mutate(value);
Components.Html.wrapper.style.transform = 'translate3d(' + -1 * transform + 'px, 0px, 0px)';
} | [
"function",
"set",
"(",
"value",
")",
"{",
"var",
"transform",
"=",
"mutator",
"(",
"Glide",
",",
"Components",
")",
".",
"mutate",
"(",
"value",
")",
";",
"Components",
".",
"Html",
".",
"wrapper",
".",
"style",
".",
"transform",
"=",
"'translate3d('",
... | Sets value of translate on HTML element.
@param {Number} value
@return {Void} | [
"Sets",
"value",
"of",
"translate",
"on",
"HTML",
"element",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2318-L2322 | train |
glidejs/glide | dist/glide.esm.js | compose | function compose(property) {
var settings = Glide.settings;
if (!disabled) {
return property + ' ' + this.duration + 'ms ' + settings.animationTimingFunc;
}
return property + ' 0ms ' + settings.animationTimingFunc;
} | javascript | function compose(property) {
var settings = Glide.settings;
if (!disabled) {
return property + ' ' + this.duration + 'ms ' + settings.animationTimingFunc;
}
return property + ' 0ms ' + settings.animationTimingFunc;
} | [
"function",
"compose",
"(",
"property",
")",
"{",
"var",
"settings",
"=",
"Glide",
".",
"settings",
";",
"if",
"(",
"!",
"disabled",
")",
"{",
"return",
"property",
"+",
"' '",
"+",
"this",
".",
"duration",
"+",
"'ms '",
"+",
"settings",
".",
"animatio... | Composes string of the CSS transition.
@param {String} property
@return {String} | [
"Composes",
"string",
"of",
"the",
"CSS",
"transition",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2395-L2403 | train |
glidejs/glide | dist/glide.esm.js | set | function set() {
var property = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform';
Components.Html.wrapper.style.transition = this.compose(property);
} | javascript | function set() {
var property = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform';
Components.Html.wrapper.style.transition = this.compose(property);
} | [
"function",
"set",
"(",
")",
"{",
"var",
"property",
"=",
"arguments",
".",
"length",
">",
"0",
"&&",
"arguments",
"[",
"0",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"0",
"]",
":",
"'transform'",
";",
"Components",
".",
"Html",
".",
"wrapper",
... | Sets value of transition on HTML element.
@param {String=} property
@return {Void} | [
"Sets",
"value",
"of",
"transition",
"on",
"HTML",
"element",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2412-L2416 | train |
glidejs/glide | dist/glide.esm.js | get | function get() {
var settings = Glide.settings;
if (Glide.isType('slider') && Components.Run.offset) {
return settings.rewindDuration;
}
return settings.animationDuration;
} | javascript | function get() {
var settings = Glide.settings;
if (Glide.isType('slider') && Components.Run.offset) {
return settings.rewindDuration;
}
return settings.animationDuration;
} | [
"function",
"get",
"(",
")",
"{",
"var",
"settings",
"=",
"Glide",
".",
"settings",
";",
"if",
"(",
"Glide",
".",
"isType",
"(",
"'slider'",
")",
"&&",
"Components",
".",
"Run",
".",
"offset",
")",
"{",
"return",
"settings",
".",
"rewindDuration",
";",... | Gets duration of the transition based
on currently running animation type.
@return {Number} | [
"Gets",
"duration",
"of",
"the",
"transition",
"based",
"on",
"currently",
"running",
"animation",
"type",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2473-L2481 | train |
glidejs/glide | dist/glide.esm.js | start | function start(event) {
if (!disabled && !Glide.disabled) {
this.disable();
var swipe = this.touches(event);
swipeSin = null;
swipeStartX = toInt(swipe.pageX);
swipeStartY = toInt(swipe.pageY);
this.bindSwipeMove();
this.bindSwipeEnd();
Events.em... | javascript | function start(event) {
if (!disabled && !Glide.disabled) {
this.disable();
var swipe = this.touches(event);
swipeSin = null;
swipeStartX = toInt(swipe.pageX);
swipeStartY = toInt(swipe.pageY);
this.bindSwipeMove();
this.bindSwipeEnd();
Events.em... | [
"function",
"start",
"(",
"event",
")",
"{",
"if",
"(",
"!",
"disabled",
"&&",
"!",
"Glide",
".",
"disabled",
")",
"{",
"this",
".",
"disable",
"(",
")",
";",
"var",
"swipe",
"=",
"this",
".",
"touches",
"(",
"event",
")",
";",
"swipeSin",
"=",
"... | Handler for `swipestart` event. Calculates entry points of the user's tap.
@param {Object} event
@return {Void} | [
"Handler",
"for",
"swipestart",
"event",
".",
"Calculates",
"entry",
"points",
"of",
"the",
"user",
"s",
"tap",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2579-L2594 | train |
glidejs/glide | dist/glide.esm.js | move | function move(event) {
if (!Glide.disabled) {
var _Glide$settings = Glide.settings,
touchAngle = _Glide$settings.touchAngle,
touchRatio = _Glide$settings.touchRatio,
classes = _Glide$settings.classes;
var swipe = this.touches(event);
var subExSx = toI... | javascript | function move(event) {
if (!Glide.disabled) {
var _Glide$settings = Glide.settings,
touchAngle = _Glide$settings.touchAngle,
touchRatio = _Glide$settings.touchRatio,
classes = _Glide$settings.classes;
var swipe = this.touches(event);
var subExSx = toI... | [
"function",
"move",
"(",
"event",
")",
"{",
"if",
"(",
"!",
"Glide",
".",
"disabled",
")",
"{",
"var",
"_Glide$settings",
"=",
"Glide",
".",
"settings",
",",
"touchAngle",
"=",
"_Glide$settings",
".",
"touchAngle",
",",
"touchRatio",
"=",
"_Glide$settings",
... | Handler for `swipemove` event. Calculates user's tap angle and distance.
@param {Object} event | [
"Handler",
"for",
"swipemove",
"event",
".",
"Calculates",
"user",
"s",
"tap",
"angle",
"and",
"distance",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2602-L2633 | train |
glidejs/glide | dist/glide.esm.js | end | function end(event) {
if (!Glide.disabled) {
var settings = Glide.settings;
var swipe = this.touches(event);
var threshold = this.threshold(event);
var swipeDistance = swipe.pageX - swipeStartX;
var swipeDeg = swipeSin * 180 / Math.PI;
var steps = Math.round(swipe... | javascript | function end(event) {
if (!Glide.disabled) {
var settings = Glide.settings;
var swipe = this.touches(event);
var threshold = this.threshold(event);
var swipeDistance = swipe.pageX - swipeStartX;
var swipeDeg = swipeSin * 180 / Math.PI;
var steps = Math.round(swipe... | [
"function",
"end",
"(",
"event",
")",
"{",
"if",
"(",
"!",
"Glide",
".",
"disabled",
")",
"{",
"var",
"settings",
"=",
"Glide",
".",
"settings",
";",
"var",
"swipe",
"=",
"this",
".",
"touches",
"(",
"event",
")",
";",
"var",
"threshold",
"=",
"thi... | Handler for `swipeend` event. Finitializes user's tap and decides about glide move.
@param {Object} event
@return {Void} | [
"Handler",
"for",
"swipeend",
"event",
".",
"Finitializes",
"user",
"s",
"tap",
"and",
"decides",
"about",
"glide",
"move",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2642-L2689 | train |
glidejs/glide | dist/glide.esm.js | bindSwipeStart | function bindSwipeStart() {
var _this = this;
var settings = Glide.settings;
if (settings.swipeThreshold) {
Binder.on(START_EVENTS[0], Components.Html.wrapper, function (event) {
_this.start(event);
}, capture);
}
if (settings.dragThreshold) {
Binder.on... | javascript | function bindSwipeStart() {
var _this = this;
var settings = Glide.settings;
if (settings.swipeThreshold) {
Binder.on(START_EVENTS[0], Components.Html.wrapper, function (event) {
_this.start(event);
}, capture);
}
if (settings.dragThreshold) {
Binder.on... | [
"function",
"bindSwipeStart",
"(",
")",
"{",
"var",
"_this",
"=",
"this",
";",
"var",
"settings",
"=",
"Glide",
".",
"settings",
";",
"if",
"(",
"settings",
".",
"swipeThreshold",
")",
"{",
"Binder",
".",
"on",
"(",
"START_EVENTS",
"[",
"0",
"]",
",",
... | Binds swipe's starting event.
@return {Void} | [
"Binds",
"swipe",
"s",
"starting",
"event",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2697-L2713 | train |
glidejs/glide | dist/glide.esm.js | unbindSwipeStart | function unbindSwipeStart() {
Binder.off(START_EVENTS[0], Components.Html.wrapper, capture);
Binder.off(START_EVENTS[1], Components.Html.wrapper, capture);
} | javascript | function unbindSwipeStart() {
Binder.off(START_EVENTS[0], Components.Html.wrapper, capture);
Binder.off(START_EVENTS[1], Components.Html.wrapper, capture);
} | [
"function",
"unbindSwipeStart",
"(",
")",
"{",
"Binder",
".",
"off",
"(",
"START_EVENTS",
"[",
"0",
"]",
",",
"Components",
".",
"Html",
".",
"wrapper",
",",
"capture",
")",
";",
"Binder",
".",
"off",
"(",
"START_EVENTS",
"[",
"1",
"]",
",",
"Component... | Unbinds swipe's starting event.
@return {Void} | [
"Unbinds",
"swipe",
"s",
"starting",
"event",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2721-L2724 | train |
glidejs/glide | dist/glide.esm.js | bindSwipeMove | function bindSwipeMove() {
var _this2 = this;
Binder.on(MOVE_EVENTS, Components.Html.wrapper, throttle(function (event) {
_this2.move(event);
}, Glide.settings.throttle), capture);
} | javascript | function bindSwipeMove() {
var _this2 = this;
Binder.on(MOVE_EVENTS, Components.Html.wrapper, throttle(function (event) {
_this2.move(event);
}, Glide.settings.throttle), capture);
} | [
"function",
"bindSwipeMove",
"(",
")",
"{",
"var",
"_this2",
"=",
"this",
";",
"Binder",
".",
"on",
"(",
"MOVE_EVENTS",
",",
"Components",
".",
"Html",
".",
"wrapper",
",",
"throttle",
"(",
"function",
"(",
"event",
")",
"{",
"_this2",
".",
"move",
"("... | Binds swipe's moving event.
@return {Void} | [
"Binds",
"swipe",
"s",
"moving",
"event",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2732-L2738 | train |
glidejs/glide | dist/glide.esm.js | bindSwipeEnd | function bindSwipeEnd() {
var _this3 = this;
Binder.on(END_EVENTS, Components.Html.wrapper, function (event) {
_this3.end(event);
});
} | javascript | function bindSwipeEnd() {
var _this3 = this;
Binder.on(END_EVENTS, Components.Html.wrapper, function (event) {
_this3.end(event);
});
} | [
"function",
"bindSwipeEnd",
"(",
")",
"{",
"var",
"_this3",
"=",
"this",
";",
"Binder",
".",
"on",
"(",
"END_EVENTS",
",",
"Components",
".",
"Html",
".",
"wrapper",
",",
"function",
"(",
"event",
")",
"{",
"_this3",
".",
"end",
"(",
"event",
")",
";... | Binds swipe's ending event.
@return {Void} | [
"Binds",
"swipe",
"s",
"ending",
"event",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2756-L2762 | train |
glidejs/glide | dist/glide.esm.js | touches | function touches(event) {
if (MOUSE_EVENTS.indexOf(event.type) > -1) {
return event;
}
return event.touches[0] || event.changedTouches[0];
} | javascript | function touches(event) {
if (MOUSE_EVENTS.indexOf(event.type) > -1) {
return event;
}
return event.touches[0] || event.changedTouches[0];
} | [
"function",
"touches",
"(",
"event",
")",
"{",
"if",
"(",
"MOUSE_EVENTS",
".",
"indexOf",
"(",
"event",
".",
"type",
")",
">",
"-",
"1",
")",
"{",
"return",
"event",
";",
"}",
"return",
"event",
".",
"touches",
"[",
"0",
"]",
"||",
"event",
".",
... | Normalizes event touches points accorting to different types.
@param {Object} event | [
"Normalizes",
"event",
"touches",
"points",
"accorting",
"to",
"different",
"types",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2780-L2786 | train |
glidejs/glide | dist/glide.esm.js | threshold | function threshold(event) {
var settings = Glide.settings;
if (MOUSE_EVENTS.indexOf(event.type) > -1) {
return settings.dragThreshold;
}
return settings.swipeThreshold;
} | javascript | function threshold(event) {
var settings = Glide.settings;
if (MOUSE_EVENTS.indexOf(event.type) > -1) {
return settings.dragThreshold;
}
return settings.swipeThreshold;
} | [
"function",
"threshold",
"(",
"event",
")",
"{",
"var",
"settings",
"=",
"Glide",
".",
"settings",
";",
"if",
"(",
"MOUSE_EVENTS",
".",
"indexOf",
"(",
"event",
".",
"type",
")",
">",
"-",
"1",
")",
"{",
"return",
"settings",
".",
"dragThreshold",
";",... | Gets value of minimum swipe distance settings based on event type.
@return {Number} | [
"Gets",
"value",
"of",
"minimum",
"swipe",
"distance",
"settings",
"based",
"on",
"event",
"type",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L2794-L2802 | train |
glidejs/glide | dist/glide.esm.js | detach | function detach() {
prevented = true;
if (!detached) {
for (var i = 0; i < this.items.length; i++) {
this.items[i].draggable = false;
this.items[i].setAttribute('data-href', this.items[i].getAttribute('href'));
this.items[i].removeAttribute('href');
}
... | javascript | function detach() {
prevented = true;
if (!detached) {
for (var i = 0; i < this.items.length; i++) {
this.items[i].draggable = false;
this.items[i].setAttribute('data-href', this.items[i].getAttribute('href'));
this.items[i].removeAttribute('href');
}
... | [
"function",
"detach",
"(",
")",
"{",
"prevented",
"=",
"true",
";",
"if",
"(",
"!",
"detached",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"items",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"items",
"[... | Detaches anchors click event inside glide.
@return {self} | [
"Detaches",
"anchors",
"click",
"event",
"inside",
"glide",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L3000-L3016 | train |
glidejs/glide | dist/glide.esm.js | attach | function attach() {
prevented = false;
if (detached) {
for (var i = 0; i < this.items.length; i++) {
this.items[i].draggable = true;
this.items[i].setAttribute('href', this.items[i].getAttribute('data-href'));
}
detached = false;
}
return this;
... | javascript | function attach() {
prevented = false;
if (detached) {
for (var i = 0; i < this.items.length; i++) {
this.items[i].draggable = true;
this.items[i].setAttribute('href', this.items[i].getAttribute('data-href'));
}
detached = false;
}
return this;
... | [
"function",
"attach",
"(",
")",
"{",
"prevented",
"=",
"false",
";",
"if",
"(",
"detached",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"items",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"items",
"[",
"... | Attaches anchors click events inside glide.
@return {self} | [
"Attaches",
"anchors",
"click",
"events",
"inside",
"glide",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L3024-L3038 | train |
glidejs/glide | dist/glide.esm.js | mount | function mount() {
/**
* Collection of navigation HTML elements.
*
* @private
* @type {HTMLCollection}
*/
this._n = Components.Html.root.querySelectorAll(NAV_SELECTOR);
/**
* Collection of controls HTML elements.
*
* @private
* @type {HTM... | javascript | function mount() {
/**
* Collection of navigation HTML elements.
*
* @private
* @type {HTMLCollection}
*/
this._n = Components.Html.root.querySelectorAll(NAV_SELECTOR);
/**
* Collection of controls HTML elements.
*
* @private
* @type {HTM... | [
"function",
"mount",
"(",
")",
"{",
"/**\n * Collection of navigation HTML elements.\n *\n * @private\n * @type {HTMLCollection}\n */",
"this",
".",
"_n",
"=",
"Components",
".",
"Html",
".",
"root",
".",
"querySelectorAll",
"(",
"NAV_SELECTOR",
")... | Inits arrows. Binds events listeners
to the arrows HTML elements.
@return {Void} | [
"Inits",
"arrows",
".",
"Binds",
"events",
"listeners",
"to",
"the",
"arrows",
"HTML",
"elements",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L3103-L3121 | train |
glidejs/glide | dist/glide.esm.js | removeActive | function removeActive() {
for (var i = 0; i < this._n.length; i++) {
this.removeClass(this._n[i].children);
}
} | javascript | function removeActive() {
for (var i = 0; i < this._n.length; i++) {
this.removeClass(this._n[i].children);
}
} | [
"function",
"removeActive",
"(",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"_n",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"removeClass",
"(",
"this",
".",
"_n",
"[",
"i",
"]",
".",
"children",
")",
"... | Removes active class to current slide.
@return {Void} | [
"Removes",
"active",
"class",
"to",
"current",
"slide",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L3141-L3145 | train |
glidejs/glide | dist/glide.esm.js | addClass | function addClass(controls) {
var settings = Glide.settings;
var item = controls[Glide.index];
if (item) {
item.classList.add(settings.classes.activeNav);
siblings(item).forEach(function (sibling) {
sibling.classList.remove(settings.classes.activeNav);
});
}
... | javascript | function addClass(controls) {
var settings = Glide.settings;
var item = controls[Glide.index];
if (item) {
item.classList.add(settings.classes.activeNav);
siblings(item).forEach(function (sibling) {
sibling.classList.remove(settings.classes.activeNav);
});
}
... | [
"function",
"addClass",
"(",
"controls",
")",
"{",
"var",
"settings",
"=",
"Glide",
".",
"settings",
";",
"var",
"item",
"=",
"controls",
"[",
"Glide",
".",
"index",
"]",
";",
"if",
"(",
"item",
")",
"{",
"item",
".",
"classList",
".",
"add",
"(",
... | Toggles active class on items inside navigation.
@param {HTMLElement} controls
@return {Void} | [
"Toggles",
"active",
"class",
"on",
"items",
"inside",
"navigation",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L3154-L3165 | train |
glidejs/glide | dist/glide.esm.js | removeClass | function removeClass(controls) {
var item = controls[Glide.index];
if (item) {
item.classList.remove(Glide.settings.classes.activeNav);
}
} | javascript | function removeClass(controls) {
var item = controls[Glide.index];
if (item) {
item.classList.remove(Glide.settings.classes.activeNav);
}
} | [
"function",
"removeClass",
"(",
"controls",
")",
"{",
"var",
"item",
"=",
"controls",
"[",
"Glide",
".",
"index",
"]",
";",
"if",
"(",
"item",
")",
"{",
"item",
".",
"classList",
".",
"remove",
"(",
"Glide",
".",
"settings",
".",
"classes",
".",
"act... | Removes active class from active control.
@param {HTMLElement} controls
@return {Void} | [
"Removes",
"active",
"class",
"from",
"active",
"control",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L3174-L3180 | train |
glidejs/glide | dist/glide.esm.js | addBindings | function addBindings() {
for (var i = 0; i < this._c.length; i++) {
this.bind(this._c[i].children);
}
} | javascript | function addBindings() {
for (var i = 0; i < this._c.length; i++) {
this.bind(this._c[i].children);
}
} | [
"function",
"addBindings",
"(",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"_c",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"bind",
"(",
"this",
".",
"_c",
"[",
"i",
"]",
".",
"children",
")",
";",
"}... | Adds handles to the each group of controls.
@return {Void} | [
"Adds",
"handles",
"to",
"the",
"each",
"group",
"of",
"controls",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L3188-L3192 | train |
glidejs/glide | dist/glide.esm.js | removeBindings | function removeBindings() {
for (var i = 0; i < this._c.length; i++) {
this.unbind(this._c[i].children);
}
} | javascript | function removeBindings() {
for (var i = 0; i < this._c.length; i++) {
this.unbind(this._c[i].children);
}
} | [
"function",
"removeBindings",
"(",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"_c",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"unbind",
"(",
"this",
".",
"_c",
"[",
"i",
"]",
".",
"children",
")",
";",... | Removes handles from the each group of controls.
@return {Void} | [
"Removes",
"handles",
"from",
"the",
"each",
"group",
"of",
"controls",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L3200-L3204 | train |
glidejs/glide | dist/glide.esm.js | bind | function bind(elements) {
for (var i = 0; i < elements.length; i++) {
Binder.on('click', elements[i], this.click);
Binder.on('touchstart', elements[i], this.click, capture);
}
} | javascript | function bind(elements) {
for (var i = 0; i < elements.length; i++) {
Binder.on('click', elements[i], this.click);
Binder.on('touchstart', elements[i], this.click, capture);
}
} | [
"function",
"bind",
"(",
"elements",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"elements",
".",
"length",
";",
"i",
"++",
")",
"{",
"Binder",
".",
"on",
"(",
"'click'",
",",
"elements",
"[",
"i",
"]",
",",
"this",
".",
"click",... | Binds events to arrows HTML elements.
@param {HTMLCollection} elements
@return {Void} | [
"Binds",
"events",
"to",
"arrows",
"HTML",
"elements",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L3213-L3218 | train |
glidejs/glide | dist/glide.esm.js | unbind | function unbind(elements) {
for (var i = 0; i < elements.length; i++) {
Binder.off(['click', 'touchstart'], elements[i]);
}
} | javascript | function unbind(elements) {
for (var i = 0; i < elements.length; i++) {
Binder.off(['click', 'touchstart'], elements[i]);
}
} | [
"function",
"unbind",
"(",
"elements",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"elements",
".",
"length",
";",
"i",
"++",
")",
"{",
"Binder",
".",
"off",
"(",
"[",
"'click'",
",",
"'touchstart'",
"]",
",",
"elements",
"[",
"i",... | Unbinds events binded to the arrows HTML elements.
@param {HTMLCollection} elements
@return {Void} | [
"Unbinds",
"events",
"binded",
"to",
"the",
"arrows",
"HTML",
"elements",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L3227-L3231 | train |
glidejs/glide | dist/glide.esm.js | click | function click(event) {
event.preventDefault();
Components.Run.make(Components.Direction.resolve(event.currentTarget.getAttribute('data-glide-dir')));
} | javascript | function click(event) {
event.preventDefault();
Components.Run.make(Components.Direction.resolve(event.currentTarget.getAttribute('data-glide-dir')));
} | [
"function",
"click",
"(",
"event",
")",
"{",
"event",
".",
"preventDefault",
"(",
")",
";",
"Components",
".",
"Run",
".",
"make",
"(",
"Components",
".",
"Direction",
".",
"resolve",
"(",
"event",
".",
"currentTarget",
".",
"getAttribute",
"(",
"'data-gli... | Handles `click` event on the arrows HTML elements.
Moves slider in driection precised in
`data-glide-dir` attribute.
@param {Object} event
@return {Void} | [
"Handles",
"click",
"event",
"on",
"the",
"arrows",
"HTML",
"elements",
".",
"Moves",
"slider",
"in",
"driection",
"precised",
"in",
"data",
"-",
"glide",
"-",
"dir",
"attribute",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L3242-L3246 | train |
glidejs/glide | dist/glide.esm.js | press | function press(event) {
if (event.keyCode === 39) {
Components.Run.make(Components.Direction.resolve('>'));
}
if (event.keyCode === 37) {
Components.Run.make(Components.Direction.resolve('<'));
}
} | javascript | function press(event) {
if (event.keyCode === 39) {
Components.Run.make(Components.Direction.resolve('>'));
}
if (event.keyCode === 37) {
Components.Run.make(Components.Direction.resolve('<'));
}
} | [
"function",
"press",
"(",
"event",
")",
"{",
"if",
"(",
"event",
".",
"keyCode",
"===",
"39",
")",
"{",
"Components",
".",
"Run",
".",
"make",
"(",
"Components",
".",
"Direction",
".",
"resolve",
"(",
"'>'",
")",
")",
";",
"}",
"if",
"(",
"event",
... | Handles keyboard's arrows press and moving glide foward and backward.
@param {Object} event
@return {Void} | [
"Handles",
"keyboard",
"s",
"arrows",
"press",
"and",
"moving",
"glide",
"foward",
"and",
"backward",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L3329-L3337 | train |
glidejs/glide | dist/glide.esm.js | start | function start() {
var _this = this;
if (Glide.settings.autoplay) {
if (isUndefined(this._i)) {
this._i = setInterval(function () {
_this.stop();
Components.Run.make('>');
_this.start();
}, this.time);
}
}
} | javascript | function start() {
var _this = this;
if (Glide.settings.autoplay) {
if (isUndefined(this._i)) {
this._i = setInterval(function () {
_this.stop();
Components.Run.make('>');
_this.start();
}, this.time);
}
}
} | [
"function",
"start",
"(",
")",
"{",
"var",
"_this",
"=",
"this",
";",
"if",
"(",
"Glide",
".",
"settings",
".",
"autoplay",
")",
"{",
"if",
"(",
"isUndefined",
"(",
"this",
".",
"_i",
")",
")",
"{",
"this",
".",
"_i",
"=",
"setInterval",
"(",
"fu... | Starts autoplaying in configured interval.
@param {Boolean|Number} force Run autoplaying with passed interval regardless of `autoplay` settings
@return {Void} | [
"Starts",
"autoplaying",
"in",
"configured",
"interval",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L3397-L3411 | train |
glidejs/glide | dist/glide.esm.js | bind | function bind() {
var _this2 = this;
Binder.on('mouseover', Components.Html.root, function () {
_this2.stop();
});
Binder.on('mouseout', Components.Html.root, function () {
_this2.start();
});
} | javascript | function bind() {
var _this2 = this;
Binder.on('mouseover', Components.Html.root, function () {
_this2.stop();
});
Binder.on('mouseout', Components.Html.root, function () {
_this2.start();
});
} | [
"function",
"bind",
"(",
")",
"{",
"var",
"_this2",
"=",
"this",
";",
"Binder",
".",
"on",
"(",
"'mouseover'",
",",
"Components",
".",
"Html",
".",
"root",
",",
"function",
"(",
")",
"{",
"_this2",
".",
"stop",
"(",
")",
";",
"}",
")",
";",
"Bind... | Stops autoplaying while mouse is over glide's area.
@return {Void} | [
"Stops",
"autoplaying",
"while",
"mouse",
"is",
"over",
"glide",
"s",
"area",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L3429-L3439 | train |
glidejs/glide | dist/glide.esm.js | get | function get() {
var autoplay = Components.Html.slides[Glide.index].getAttribute('data-glide-autoplay');
if (autoplay) {
return toInt(autoplay);
}
return toInt(Glide.settings.autoplay);
} | javascript | function get() {
var autoplay = Components.Html.slides[Glide.index].getAttribute('data-glide-autoplay');
if (autoplay) {
return toInt(autoplay);
}
return toInt(Glide.settings.autoplay);
} | [
"function",
"get",
"(",
")",
"{",
"var",
"autoplay",
"=",
"Components",
".",
"Html",
".",
"slides",
"[",
"Glide",
".",
"index",
"]",
".",
"getAttribute",
"(",
"'data-glide-autoplay'",
")",
";",
"if",
"(",
"autoplay",
")",
"{",
"return",
"toInt",
"(",
"... | Gets time period value for the autoplay interval. Prioritizes
times in `data-glide-autoplay` attrubutes over options.
@return {Number} | [
"Gets",
"time",
"period",
"value",
"for",
"the",
"autoplay",
"interval",
".",
"Prioritizes",
"times",
"in",
"data",
"-",
"glide",
"-",
"autoplay",
"attrubutes",
"over",
"options",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L3459-L3467 | train |
glidejs/glide | dist/glide.esm.js | match | function match(points) {
if (typeof window.matchMedia !== 'undefined') {
for (var point in points) {
if (points.hasOwnProperty(point)) {
if (window.matchMedia('(max-width: ' + point + 'px)').matches) {
return points[point];
}
}
}
}
... | javascript | function match(points) {
if (typeof window.matchMedia !== 'undefined') {
for (var point in points) {
if (points.hasOwnProperty(point)) {
if (window.matchMedia('(max-width: ' + point + 'px)').matches) {
return points[point];
}
}
}
}
... | [
"function",
"match",
"(",
"points",
")",
"{",
"if",
"(",
"typeof",
"window",
".",
"matchMedia",
"!==",
"'undefined'",
")",
"{",
"for",
"(",
"var",
"point",
"in",
"points",
")",
"{",
"if",
"(",
"points",
".",
"hasOwnProperty",
"(",
"point",
")",
")",
... | Matches settings for currectly matching media breakpoint.
@param {Object} points
@returns {Object} | [
"Matches",
"settings",
"for",
"currectly",
"matching",
"media",
"breakpoint",
"."
] | 593ad78d0f85bd7bcb6ac6ef487c607718605a89 | https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L3574-L3586 | train |
ariutta/svg-pan-zoom | src/uniwheel.js | createCallback | function createCallback(element,callback) {
var fn = function(originalEvent) {
!originalEvent && ( originalEvent = window.event );
// create a normalized event object
var event = {
// keep a ref to the original event object
originalEvent: originalEvent,
target: originalE... | javascript | function createCallback(element,callback) {
var fn = function(originalEvent) {
!originalEvent && ( originalEvent = window.event );
// create a normalized event object
var event = {
// keep a ref to the original event object
originalEvent: originalEvent,
target: originalE... | [
"function",
"createCallback",
"(",
"element",
",",
"callback",
")",
"{",
"var",
"fn",
"=",
"function",
"(",
"originalEvent",
")",
"{",
"!",
"originalEvent",
"&&",
"(",
"originalEvent",
"=",
"window",
".",
"event",
")",
";",
"// create a normalized event object",... | let's assume that remaining browsers are older Firefox | [
"let",
"s",
"assume",
"that",
"remaining",
"browsers",
"are",
"older",
"Firefox"
] | 51cabbf6006729d40a214f79000166371e934e40 | https://github.com/ariutta/svg-pan-zoom/blob/51cabbf6006729d40a214f79000166371e934e40/src/uniwheel.js#L28-L70 | train |
imba/imba | lib/compiler/nodes.js | subclass$ | function subclass$(obj,sup) {
for (var k in sup) {
if (sup.hasOwnProperty(k)) obj[k] = sup[k];
};
// obj.__super__ = sup;
obj.prototype = Object.create(sup.prototype);
obj.__super__ = obj.prototype.__super__ = sup.prototype;
obj.prototype.initialize = obj.prototype.constructor = obj;
} | javascript | function subclass$(obj,sup) {
for (var k in sup) {
if (sup.hasOwnProperty(k)) obj[k] = sup[k];
};
// obj.__super__ = sup;
obj.prototype = Object.create(sup.prototype);
obj.__super__ = obj.prototype.__super__ = sup.prototype;
obj.prototype.initialize = obj.prototype.constructor = obj;
} | [
"function",
"subclass$",
"(",
"obj",
",",
"sup",
")",
"{",
"for",
"(",
"var",
"k",
"in",
"sup",
")",
"{",
"if",
"(",
"sup",
".",
"hasOwnProperty",
"(",
"k",
")",
")",
"obj",
"[",
"k",
"]",
"=",
"sup",
"[",
"k",
"]",
";",
"}",
";",
"// obj.__s... | helper for subclassing | [
"helper",
"for",
"subclassing"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/compiler/nodes.js#L5-L13 | train |
imba/imba | lib/compiler/nodes.js | Parens | function Parens(value,open,close){
this.setup();
this._open = open;
this._close = close;
this._value = this.load(value);
} | javascript | function Parens(value,open,close){
this.setup();
this._open = open;
this._close = close;
this._value = this.load(value);
} | [
"function",
"Parens",
"(",
"value",
",",
"open",
",",
"close",
")",
"{",
"this",
".",
"setup",
"(",
")",
";",
"this",
".",
"_open",
"=",
"open",
";",
"this",
".",
"_close",
"=",
"close",
";",
"this",
".",
"_value",
"=",
"this",
".",
"load",
"(",
... | Could inherit from valueNode | [
"Could",
"inherit",
"from",
"valueNode"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/compiler/nodes.js#L1689-L1694 | train |
imba/imba | lib/compiler/nodes.js | Param | function Param(name,defaults,typ){
// could have introduced bugs by moving back to identifier here
this._traversed = false;
this._name = name;
this._defaults = defaults;
this._typ = typ;
this._variable = null;
} | javascript | function Param(name,defaults,typ){
// could have introduced bugs by moving back to identifier here
this._traversed = false;
this._name = name;
this._defaults = defaults;
this._typ = typ;
this._variable = null;
} | [
"function",
"Param",
"(",
"name",
",",
"defaults",
",",
"typ",
")",
"{",
"// could have introduced bugs by moving back to identifier here",
"this",
".",
"_traversed",
"=",
"false",
";",
"this",
".",
"_name",
"=",
"name",
";",
"this",
".",
"_defaults",
"=",
"defa... | export class PARAMS | [
"export",
"class",
"PARAMS"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/compiler/nodes.js#L1921-L1928 | train |
imba/imba | lib/compiler/nodes.js | Root | function Root(body,opts){
this._traversed = false;
this._body = AST.blk(body);
this._scope = new RootScope(this,null);
this._options = {};
} | javascript | function Root(body,opts){
this._traversed = false;
this._body = AST.blk(body);
this._scope = new RootScope(this,null);
this._options = {};
} | [
"function",
"Root",
"(",
"body",
",",
"opts",
")",
"{",
"this",
".",
"_traversed",
"=",
"false",
";",
"this",
".",
"_body",
"=",
"AST",
".",
"blk",
"(",
"body",
")",
";",
"this",
".",
"_scope",
"=",
"new",
"RootScope",
"(",
"this",
",",
"null",
"... | Rename to Program? | [
"Rename",
"to",
"Program?"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/compiler/nodes.js#L2630-L2635 | train |
imba/imba | lib/compiler/nodes.js | Literal | function Literal(v){
this._traversed = false;
this._expression = true;
this._cache = null;
this._raw = null;
this._value = this.load(v);
} | javascript | function Literal(v){
this._traversed = false;
this._expression = true;
this._cache = null;
this._raw = null;
this._value = this.load(v);
} | [
"function",
"Literal",
"(",
"v",
")",
"{",
"this",
".",
"_traversed",
"=",
"false",
";",
"this",
".",
"_expression",
"=",
"true",
";",
"this",
".",
"_cache",
"=",
"null",
";",
"this",
".",
"_raw",
"=",
"null",
";",
"this",
".",
"_value",
"=",
"this... | Literals should probably not inherit from the same parent as arrays, tuples, objects would be better off inheriting from listnode. | [
"Literals",
"should",
"probably",
"not",
"inherit",
"from",
"the",
"same",
"parent",
"as",
"arrays",
"tuples",
"objects",
"would",
"be",
"better",
"off",
"inheriting",
"from",
"listnode",
"."
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/compiler/nodes.js#L3676-L3682 | train |
imba/imba | lib/compiler/nodes.js | Str | function Str(v){
this._traversed = false;
this._expression = true;
this._cache = null;
this._value = v;
// should grab the actual value immediately?
} | javascript | function Str(v){
this._traversed = false;
this._expression = true;
this._cache = null;
this._value = v;
// should grab the actual value immediately?
} | [
"function",
"Str",
"(",
"v",
")",
"{",
"this",
".",
"_traversed",
"=",
"false",
";",
"this",
".",
"_expression",
"=",
"true",
";",
"this",
".",
"_cache",
"=",
"null",
";",
"this",
".",
"_value",
"=",
"v",
";",
"// should grab the actual value immediately?"... | should be quoted no? what about strings in object-literals? we want to be able to see if the values are allowed | [
"should",
"be",
"quoted",
"no?",
"what",
"about",
"strings",
"in",
"object",
"-",
"literals?",
"we",
"want",
"to",
"be",
"able",
"to",
"see",
"if",
"the",
"values",
"are",
"allowed"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/compiler/nodes.js#L3863-L3869 | train |
imba/imba | lib/compiler/nodes.js | InterpolatedString | function InterpolatedString(nodes,o){
if(o === undefined) o = {};
this._nodes = nodes;
this._options = o;
this;
} | javascript | function InterpolatedString(nodes,o){
if(o === undefined) o = {};
this._nodes = nodes;
this._options = o;
this;
} | [
"function",
"InterpolatedString",
"(",
"nodes",
",",
"o",
")",
"{",
"if",
"(",
"o",
"===",
"undefined",
")",
"o",
"=",
"{",
"}",
";",
"this",
".",
"_nodes",
"=",
"nodes",
";",
"this",
".",
"_options",
"=",
"o",
";",
"this",
";",
"}"
] | Currently not used - it would be better to use this for real interpolated strings though, than to break them up into their parts before parsing | [
"Currently",
"not",
"used",
"-",
"it",
"would",
"be",
"better",
"to",
"use",
"this",
"for",
"real",
"interpolated",
"strings",
"though",
"than",
"to",
"break",
"them",
"up",
"into",
"their",
"parts",
"before",
"parsing"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/compiler/nodes.js#L3913-L3918 | train |
imba/imba | lib/compiler/nodes.js | Identifier | function Identifier(value){
this._value = this.load(value);
this._symbol = null;
this._setter = null;
if (("" + value).indexOf("?") >= 0) {
this._safechain = true;
};
// @safechain = ("" + value).indexOf("?") >= 0
this;
} | javascript | function Identifier(value){
this._value = this.load(value);
this._symbol = null;
this._setter = null;
if (("" + value).indexOf("?") >= 0) {
this._safechain = true;
};
// @safechain = ("" + value).indexOf("?") >= 0
this;
} | [
"function",
"Identifier",
"(",
"value",
")",
"{",
"this",
".",
"_value",
"=",
"this",
".",
"load",
"(",
"value",
")",
";",
"this",
".",
"_symbol",
"=",
"null",
";",
"this",
".",
"_setter",
"=",
"null",
";",
"if",
"(",
"(",
"\"\"",
"+",
"value",
"... | really need to clean this up Drop the token? | [
"really",
"need",
"to",
"clean",
"this",
"up",
"Drop",
"the",
"token?"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/compiler/nodes.js#L5859-L5869 | train |
imba/imba | lib/compiler/nodes.js | For | function For(o){
if(o === undefined) o = {};
this._traversed = false;
this._options = o;
this._scope = new ForScope(this);
this._catcher = null;
} | javascript | function For(o){
if(o === undefined) o = {};
this._traversed = false;
this._options = o;
this._scope = new ForScope(this);
this._catcher = null;
} | [
"function",
"For",
"(",
"o",
")",
"{",
"if",
"(",
"o",
"===",
"undefined",
")",
"o",
"=",
"{",
"}",
";",
"this",
".",
"_traversed",
"=",
"false",
";",
"this",
".",
"_options",
"=",
"o",
";",
"this",
".",
"_scope",
"=",
"new",
"ForScope",
"(",
"... | This should define an open scope should rather | [
"This",
"should",
"define",
"an",
"open",
"scope",
"should",
"rather"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/compiler/nodes.js#L6816-L6822 | train |
imba/imba | lib/compiler/nodes.js | TagTree | function TagTree(owner,list,options){
if(options === undefined) options = {};
this._owner = owner;
this._nodes = this.load(list);
this._options = options;
this._conditions = [];
this._blocks = [this];
this._counter = 0;
this;
} | javascript | function TagTree(owner,list,options){
if(options === undefined) options = {};
this._owner = owner;
this._nodes = this.load(list);
this._options = options;
this._conditions = [];
this._blocks = [this];
this._counter = 0;
this;
} | [
"function",
"TagTree",
"(",
"owner",
",",
"list",
",",
"options",
")",
"{",
"if",
"(",
"options",
"===",
"undefined",
")",
"options",
"=",
"{",
"}",
";",
"this",
".",
"_owner",
"=",
"owner",
";",
"this",
".",
"_nodes",
"=",
"this",
".",
"load",
"("... | This is a helper-node Should probably use the same type of listnode everywhere and simply flag the type as TagTree instead | [
"This",
"is",
"a",
"helper",
"-",
"node",
"Should",
"probably",
"use",
"the",
"same",
"type",
"of",
"listnode",
"everywhere",
"and",
"simply",
"flag",
"the",
"type",
"as",
"TagTree",
"instead"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/compiler/nodes.js#L8268-L8277 | train |
imba/imba | lib/compiler/nodes.js | RootScope | function RootScope(){
RootScope.prototype.__super__.constructor.apply(this,arguments);
this.register('global',this,{type: 'global'});
this.register('module',this,{type: 'global'});
this.register('window',this,{type: 'global'});
this.register('document',this,{type: 'global'});
this.register('exports',this,{type:... | javascript | function RootScope(){
RootScope.prototype.__super__.constructor.apply(this,arguments);
this.register('global',this,{type: 'global'});
this.register('module',this,{type: 'global'});
this.register('window',this,{type: 'global'});
this.register('document',this,{type: 'global'});
this.register('exports',this,{type:... | [
"function",
"RootScope",
"(",
")",
"{",
"RootScope",
".",
"prototype",
".",
"__super__",
".",
"constructor",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"this",
".",
"register",
"(",
"'global'",
",",
"this",
",",
"{",
"type",
":",
"'global'",
... | RootScope is wrong? Rather TopScope or ProgramScope | [
"RootScope",
"is",
"wrong?",
"Rather",
"TopScope",
"or",
"ProgramScope"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/compiler/nodes.js#L9501-L9534 | train |
imba/imba | lib/imba/dom/reconciler.js | function(root,node,before) {
if (node instanceof Array) {
var i = 0;
var c = node.taglen;
var k = (c != null) ? ((node.domlen = c)) : node.length;
while (i < k){
insertNestedBefore(root,node[i++],before);
};
} else if (node && node._dom) {
root.insertBefore(node,before);
} else if (node != null && nod... | javascript | function(root,node,before) {
if (node instanceof Array) {
var i = 0;
var c = node.taglen;
var k = (c != null) ? ((node.domlen = c)) : node.length;
while (i < k){
insertNestedBefore(root,node[i++],before);
};
} else if (node && node._dom) {
root.insertBefore(node,before);
} else if (node != null && nod... | [
"function",
"(",
"root",
",",
"node",
",",
"before",
")",
"{",
"if",
"(",
"node",
"instanceof",
"Array",
")",
"{",
"var",
"i",
"=",
"0",
";",
"var",
"c",
"=",
"node",
".",
"taglen",
";",
"var",
"k",
"=",
"(",
"c",
"!=",
"null",
")",
"?",
"(",... | insert nodes before a certain node does not need to return any tail, as before will still be correct there before must be an actual domnode | [
"insert",
"nodes",
"before",
"a",
"certain",
"node",
"does",
"not",
"need",
"to",
"return",
"any",
"tail",
"as",
"before",
"will",
"still",
"be",
"correct",
"there",
"before",
"must",
"be",
"an",
"actual",
"domnode"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/imba/dom/reconciler.js#L53-L68 | train | |
imba/imba | lib/imba/dom/reconciler.js | function(root,new$,old,caret) {
var nl = new$.length;
var ol = old.length;
var cl = new$.cache.i$; // cache-length
var i = 0,d = nl - ol;
// TODO support caret
// find the first index that is different
while (i < ol && i < nl && new$[i] === old[i]){
i++;
};
// conditionally prune cache
if (cl > 1000 &... | javascript | function(root,new$,old,caret) {
var nl = new$.length;
var ol = old.length;
var cl = new$.cache.i$; // cache-length
var i = 0,d = nl - ol;
// TODO support caret
// find the first index that is different
while (i < ol && i < nl && new$[i] === old[i]){
i++;
};
// conditionally prune cache
if (cl > 1000 &... | [
"function",
"(",
"root",
",",
"new$",
",",
"old",
",",
"caret",
")",
"{",
"var",
"nl",
"=",
"new$",
".",
"length",
";",
"var",
"ol",
"=",
"old",
".",
"length",
";",
"var",
"cl",
"=",
"new$",
".",
"cache",
".",
"i$",
";",
"// cache-length",
"var",... | TYPE 5 - we know that we are dealing with a single array of keyed tags - and root has no other children | [
"TYPE",
"5",
"-",
"we",
"know",
"that",
"we",
"are",
"dealing",
"with",
"a",
"single",
"array",
"of",
"keyed",
"tags",
"-",
"and",
"root",
"has",
"no",
"other",
"children"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/imba/dom/reconciler.js#L223-L283 | train | |
imba/imba | lib/imba/dom/reconciler.js | function(root,new$,old,caret) {
// var skipnew = new == null or new === false or new === true
var newIsNull = new$ == null || new$ === false;
var oldIsNull = old == null || old === false;
if (new$ === old) {
// remember that the caret must be an actual dom element
// we should instead move the actual care... | javascript | function(root,new$,old,caret) {
// var skipnew = new == null or new === false or new === true
var newIsNull = new$ == null || new$ === false;
var oldIsNull = old == null || old === false;
if (new$ === old) {
// remember that the caret must be an actual dom element
// we should instead move the actual care... | [
"function",
"(",
"root",
",",
"new$",
",",
"old",
",",
"caret",
")",
"{",
"// var skipnew = new == null or new === false or new === true",
"var",
"newIsNull",
"=",
"new$",
"==",
"null",
"||",
"new$",
"===",
"false",
";",
"var",
"oldIsNull",
"=",
"old",
"==",
"... | the general reconciler that respects conditions etc caret is the current node we want to insert things after | [
"the",
"general",
"reconciler",
"that",
"respects",
"conditions",
"etc",
"caret",
"is",
"the",
"current",
"node",
"we",
"want",
"to",
"insert",
"things",
"after"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/imba/dom/reconciler.js#L315-L393 | train | |
imba/imba | lib/compiler/rewriter.js | function(token,i,tokens) {
var type = token._type;
if (!seenSingle && token.fromThen) {
return true;
};
var ifelse = type == 'IF' || type == 'UNLESS' || type == 'ELSE';
if (ifelse || type === 'CATCH') {
seenSingle = true;
};
if (ifelse || type === 'SWITCH' || type == 'TRY') {
seenC... | javascript | function(token,i,tokens) {
var type = token._type;
if (!seenSingle && token.fromThen) {
return true;
};
var ifelse = type == 'IF' || type == 'UNLESS' || type == 'ELSE';
if (ifelse || type === 'CATCH') {
seenSingle = true;
};
if (ifelse || type === 'SWITCH' || type == 'TRY') {
seenC... | [
"function",
"(",
"token",
",",
"i",
",",
"tokens",
")",
"{",
"var",
"type",
"=",
"token",
".",
"_type",
";",
"if",
"(",
"!",
"seenSingle",
"&&",
"token",
".",
"fromThen",
")",
"{",
"return",
"true",
";",
"}",
";",
"var",
"ifelse",
"=",
"type",
"=... | function will not be optimized in single run could tro to move this out | [
"function",
"will",
"not",
"be",
"optimized",
"in",
"single",
"run",
"could",
"tro",
"to",
"move",
"this",
"out"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/compiler/rewriter.js#L768-L823 | train | |
imba/imba | lib/jison/jison.js | processOperators | function processOperators (ops) {
if (!ops) return {};
var operators = {};
for (var i=0,k,prec;prec=ops[i]; i++) {
for (k=1;k < prec.length;k++) {
operators[prec[k]] = {precedence: i+1, assoc: prec[0]};
}
}
return operators;
} | javascript | function processOperators (ops) {
if (!ops) return {};
var operators = {};
for (var i=0,k,prec;prec=ops[i]; i++) {
for (k=1;k < prec.length;k++) {
operators[prec[k]] = {precedence: i+1, assoc: prec[0]};
}
}
return operators;
} | [
"function",
"processOperators",
"(",
"ops",
")",
"{",
"if",
"(",
"!",
"ops",
")",
"return",
"{",
"}",
";",
"var",
"operators",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"k",
",",
"prec",
";",
"prec",
"=",
"ops",
"[",
"i",
"]"... | set precedence and associativity of operators | [
"set",
"precedence",
"and",
"associativity",
"of",
"operators"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/jison/jison.js#L161-L170 | train |
imba/imba | lib/jison/jison.js | addSymbol | function addSymbol (s) {
if (s && !symbols_[s]) {
symbols_[s] = ++symbolId;
symbols.push(s);
}
} | javascript | function addSymbol (s) {
if (s && !symbols_[s]) {
symbols_[s] = ++symbolId;
symbols.push(s);
}
} | [
"function",
"addSymbol",
"(",
"s",
")",
"{",
"if",
"(",
"s",
"&&",
"!",
"symbols_",
"[",
"s",
"]",
")",
"{",
"symbols_",
"[",
"s",
"]",
"=",
"++",
"symbolId",
";",
"symbols",
".",
"push",
"(",
"s",
")",
";",
"}",
"}"
] | has error recovery | [
"has",
"error",
"recovery"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/jison/jison.js#L191-L196 | train |
imba/imba | lib/jison/jison.js | tokenStackLex | function tokenStackLex() {
var token;
token = tstack.pop() || lexer.lex() || EOF;
// if token isn't its numeric value, convert
if (typeof token !== 'number') {
if (token instanceof Array) {
tstack = token;
token = tstack.pop();
}
token = self.symbols_[toke... | javascript | function tokenStackLex() {
var token;
token = tstack.pop() || lexer.lex() || EOF;
// if token isn't its numeric value, convert
if (typeof token !== 'number') {
if (token instanceof Array) {
tstack = token;
token = tstack.pop();
}
token = self.symbols_[toke... | [
"function",
"tokenStackLex",
"(",
")",
"{",
"var",
"token",
";",
"token",
"=",
"tstack",
".",
"pop",
"(",
")",
"||",
"lexer",
".",
"lex",
"(",
")",
"||",
"EOF",
";",
"// if token isn't its numeric value, convert",
"if",
"(",
"typeof",
"token",
"!==",
"'num... | lex function that supports token stacks | [
"lex",
"function",
"that",
"supports",
"token",
"stacks"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/jison/jison.js#L1002-L1014 | train |
imba/imba | lib/jison/jison.js | createVariable | function createVariable() {
var id = nextVariableId++;
var name = '$V';
do {
name += variableTokens[id % variableTokensLength];
id = ~~(id / variableTokensLength);
} while (id !== 0);
return name;
} | javascript | function createVariable() {
var id = nextVariableId++;
var name = '$V';
do {
name += variableTokens[id % variableTokensLength];
id = ~~(id / variableTokensLength);
} while (id !== 0);
return name;
} | [
"function",
"createVariable",
"(",
")",
"{",
"var",
"id",
"=",
"nextVariableId",
"++",
";",
"var",
"name",
"=",
"'$V'",
";",
"do",
"{",
"name",
"+=",
"variableTokens",
"[",
"id",
"%",
"variableTokensLength",
"]",
";",
"id",
"=",
"~",
"~",
"(",
"id",
... | Creates a variable with a unique name | [
"Creates",
"a",
"variable",
"with",
"a",
"unique",
"name"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/jison/jison.js#L1139-L1149 | train |
imba/imba | lib/jison/jison.js | locateNearestErrorRecoveryRule | function locateNearestErrorRecoveryRule(state) {
var stack_probe = stack.length - 1;
var depth = 0;
// try to recover from error
for(;;) {
// check for error recovery rule in this state
if ((TERROR.toString()) in table[state]) {
... | javascript | function locateNearestErrorRecoveryRule(state) {
var stack_probe = stack.length - 1;
var depth = 0;
// try to recover from error
for(;;) {
// check for error recovery rule in this state
if ((TERROR.toString()) in table[state]) {
... | [
"function",
"locateNearestErrorRecoveryRule",
"(",
"state",
")",
"{",
"var",
"stack_probe",
"=",
"stack",
".",
"length",
"-",
"1",
";",
"var",
"depth",
"=",
"0",
";",
"// try to recover from error",
"for",
"(",
";",
";",
")",
"{",
"// check for error recovery ru... | Return the rule stack depth where the nearest error rule can be found. Return FALSE when no error recovery rule was found. we have no rules now | [
"Return",
"the",
"rule",
"stack",
"depth",
"where",
"the",
"nearest",
"error",
"rule",
"can",
"be",
"found",
".",
"Return",
"FALSE",
"when",
"no",
"error",
"recovery",
"rule",
"was",
"found",
".",
"we",
"have",
"no",
"rules",
"now"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/jison/jison.js#L1291-L1308 | train |
imba/imba | lib/jison/jison.js | LALR_buildNewGrammar | function LALR_buildNewGrammar () {
var self = this,
newg = this.newg;
this.states.forEach(function (state, i) {
state.forEach(function (item) {
if (item.dotPosition === 0) {
// new symbols are a combination of state and transition symbol
... | javascript | function LALR_buildNewGrammar () {
var self = this,
newg = this.newg;
this.states.forEach(function (state, i) {
state.forEach(function (item) {
if (item.dotPosition === 0) {
// new symbols are a combination of state and transition symbol
... | [
"function",
"LALR_buildNewGrammar",
"(",
")",
"{",
"var",
"self",
"=",
"this",
",",
"newg",
"=",
"this",
".",
"newg",
";",
"this",
".",
"states",
".",
"forEach",
"(",
"function",
"(",
"state",
",",
"i",
")",
"{",
"state",
".",
"forEach",
"(",
"functi... | every disjoint reduction of a nonterminal becomes a produciton in G' | [
"every",
"disjoint",
"reduction",
"of",
"a",
"nonterminal",
"becomes",
"a",
"produciton",
"in",
"G"
] | cbf24f7ba961c33c105a8fd5a9fff18286d119bb | https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/jison/jison.js#L1516-L1547 | train |
imolorhe/altair | chrome-ext-files/js/background.js | focusTab | function focusTab(tabId) {
var updateProperties = { "active": true };
chrome.tabs.update(tabId, updateProperties, function (tab) { });
} | javascript | function focusTab(tabId) {
var updateProperties = { "active": true };
chrome.tabs.update(tabId, updateProperties, function (tab) { });
} | [
"function",
"focusTab",
"(",
"tabId",
")",
"{",
"var",
"updateProperties",
"=",
"{",
"\"active\"",
":",
"true",
"}",
";",
"chrome",
".",
"tabs",
".",
"update",
"(",
"tabId",
",",
"updateProperties",
",",
"function",
"(",
"tab",
")",
"{",
"}",
")",
";",... | Focus on the open extension tab | [
"Focus",
"on",
"the",
"open",
"extension",
"tab"
] | d228f435ad05de9fca673b6c67f3cc995f348284 | https://github.com/imolorhe/altair/blob/d228f435ad05de9fca673b6c67f3cc995f348284/chrome-ext-files/js/background.js#L12-L15 | train |
imolorhe/altair | chrome-ext-files/js/options.js | save_options | function save_options() {
var showChangeLog = document.getElementById('show_changelog').checked;
chrome.storage.sync.set({
showChangeLog: showChangeLog
}, function () {
// Update status to let user know options were saved.
var status = document.getElementById('status');
status.textContent = 'Optio... | javascript | function save_options() {
var showChangeLog = document.getElementById('show_changelog').checked;
chrome.storage.sync.set({
showChangeLog: showChangeLog
}, function () {
// Update status to let user know options were saved.
var status = document.getElementById('status');
status.textContent = 'Optio... | [
"function",
"save_options",
"(",
")",
"{",
"var",
"showChangeLog",
"=",
"document",
".",
"getElementById",
"(",
"'show_changelog'",
")",
".",
"checked",
";",
"chrome",
".",
"storage",
".",
"sync",
".",
"set",
"(",
"{",
"showChangeLog",
":",
"showChangeLog",
... | Saves options to chrome.storage | [
"Saves",
"options",
"to",
"chrome",
".",
"storage"
] | d228f435ad05de9fca673b6c67f3cc995f348284 | https://github.com/imolorhe/altair/blob/d228f435ad05de9fca673b6c67f3cc995f348284/chrome-ext-files/js/options.js#L2-L14 | train |
imolorhe/altair | chrome-ext-files/js/options.js | restore_options | function restore_options() {
// Use default value showChangeLog = true.
chrome.storage.sync.get({
showChangeLog: true
}, function (items) {
document.getElementById('show_changelog').checked = items.showChangeLog;
});
} | javascript | function restore_options() {
// Use default value showChangeLog = true.
chrome.storage.sync.get({
showChangeLog: true
}, function (items) {
document.getElementById('show_changelog').checked = items.showChangeLog;
});
} | [
"function",
"restore_options",
"(",
")",
"{",
"// Use default value showChangeLog = true.",
"chrome",
".",
"storage",
".",
"sync",
".",
"get",
"(",
"{",
"showChangeLog",
":",
"true",
"}",
",",
"function",
"(",
"items",
")",
"{",
"document",
".",
"getElementById"... | Restores select box and checkbox state using the preferences stored in chrome.storage. | [
"Restores",
"select",
"box",
"and",
"checkbox",
"state",
"using",
"the",
"preferences",
"stored",
"in",
"chrome",
".",
"storage",
"."
] | d228f435ad05de9fca673b6c67f3cc995f348284 | https://github.com/imolorhe/altair/blob/d228f435ad05de9fca673b6c67f3cc995f348284/chrome-ext-files/js/options.js#L18-L25 | train |
heroku/cli | packages/addons-v5/lib/util.js | style | function style (s, t) {
if (!t) return (text) => style(s, text)
return cli.color[styles[s] || s](t)
} | javascript | function style (s, t) {
if (!t) return (text) => style(s, text)
return cli.color[styles[s] || s](t)
} | [
"function",
"style",
"(",
"s",
",",
"t",
")",
"{",
"if",
"(",
"!",
"t",
")",
"return",
"(",
"text",
")",
"=>",
"style",
"(",
"s",
",",
"text",
")",
"return",
"cli",
".",
"color",
"[",
"styles",
"[",
"s",
"]",
"||",
"s",
"]",
"(",
"t",
")",
... | style given text or return a function that styles text according to provided style | [
"style",
"given",
"text",
"or",
"return",
"a",
"function",
"that",
"styles",
"text",
"according",
"to",
"provided",
"style"
] | 4d4f88817f9812f9a25d529863270155be3cda23 | https://github.com/heroku/cli/blob/4d4f88817f9812f9a25d529863270155be3cda23/packages/addons-v5/lib/util.js#L14-L17 | train |
pa11y/pa11y | lib/reporter.js | buildReporter | function buildReporter(methods) {
return {
supports: methods.supports,
begin: buildReporterMethod(methods.begin),
results: buildReporterMethod(methods.results),
log: {
debug: buildReporterMethod(methods.debug),
error: buildReporterMethod(methods.error, 'error'),
info: buildReporterMethod(methods.info)... | javascript | function buildReporter(methods) {
return {
supports: methods.supports,
begin: buildReporterMethod(methods.begin),
results: buildReporterMethod(methods.results),
log: {
debug: buildReporterMethod(methods.debug),
error: buildReporterMethod(methods.error, 'error'),
info: buildReporterMethod(methods.info)... | [
"function",
"buildReporter",
"(",
"methods",
")",
"{",
"return",
"{",
"supports",
":",
"methods",
".",
"supports",
",",
"begin",
":",
"buildReporterMethod",
"(",
"methods",
".",
"begin",
")",
",",
"results",
":",
"buildReporterMethod",
"(",
"methods",
".",
"... | Build a Pa11y reporter.
@private
@param {Object} methods - The reporter methods.
@returns {Promise} Returns a promise which resolves with the new reporter. | [
"Build",
"a",
"Pa11y",
"reporter",
"."
] | ddcbb3696a43f775e32399bbafeea7f12c9d6cbb | https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/reporter.js#L11-L22 | train |
pa11y/pa11y | lib/reporter.js | buildReporterMethod | function buildReporterMethod(method, consoleMethod = 'log') {
if (typeof method !== 'function') {
method = () => {};
}
return async input => {
const output = await method(input);
if (output) {
console[consoleMethod](output);
}
};
} | javascript | function buildReporterMethod(method, consoleMethod = 'log') {
if (typeof method !== 'function') {
method = () => {};
}
return async input => {
const output = await method(input);
if (output) {
console[consoleMethod](output);
}
};
} | [
"function",
"buildReporterMethod",
"(",
"method",
",",
"consoleMethod",
"=",
"'log'",
")",
"{",
"if",
"(",
"typeof",
"method",
"!==",
"'function'",
")",
"{",
"method",
"=",
"(",
")",
"=>",
"{",
"}",
";",
"}",
"return",
"async",
"input",
"=>",
"{",
"con... | Build a Pa11y reporter method, making it async and only outputting when
actual output is returned.
@private
@param {Function} method - The reporter method to build.
@param {String} [consoleMethod='log'] - The console method to use in reporting.
@returns {Function} Returns a built async reporter method. | [
"Build",
"a",
"Pa11y",
"reporter",
"method",
"making",
"it",
"async",
"and",
"only",
"outputting",
"when",
"actual",
"output",
"is",
"returned",
"."
] | ddcbb3696a43f775e32399bbafeea7f12c9d6cbb | https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/reporter.js#L32-L42 | train |
pa11y/pa11y | lib/action.js | isValidAction | function isValidAction(actionString) {
return module.exports.actions.some(foundAction => {
return foundAction.match.test(actionString);
});
} | javascript | function isValidAction(actionString) {
return module.exports.actions.some(foundAction => {
return foundAction.match.test(actionString);
});
} | [
"function",
"isValidAction",
"(",
"actionString",
")",
"{",
"return",
"module",
".",
"exports",
".",
"actions",
".",
"some",
"(",
"foundAction",
"=>",
"{",
"return",
"foundAction",
".",
"match",
".",
"test",
"(",
"actionString",
")",
";",
"}",
")",
";",
... | Check whether an action string is valid.
@public
@param {String} actionString - The action string to validate.
@returns {Boolean} Returns whether the action string is valid. | [
"Check",
"whether",
"an",
"action",
"string",
"is",
"valid",
"."
] | ddcbb3696a43f775e32399bbafeea7f12c9d6cbb | https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/action.js#L39-L43 | train |
pa11y/pa11y | lib/pa11y.js | pa11y | async function pa11y(url, options = {}, callback) {
const state = {};
/* eslint-disable prefer-rest-params */
// Check for presence of a callback function
if (typeof arguments[arguments.length - 1] === 'function') {
callback = arguments[arguments.length - 1];
} else {
callback = undefined;
}
/* eslint-enabl... | javascript | async function pa11y(url, options = {}, callback) {
const state = {};
/* eslint-disable prefer-rest-params */
// Check for presence of a callback function
if (typeof arguments[arguments.length - 1] === 'function') {
callback = arguments[arguments.length - 1];
} else {
callback = undefined;
}
/* eslint-enabl... | [
"async",
"function",
"pa11y",
"(",
"url",
",",
"options",
"=",
"{",
"}",
",",
"callback",
")",
"{",
"const",
"state",
"=",
"{",
"}",
";",
"/* eslint-disable prefer-rest-params */",
"// Check for presence of a callback function",
"if",
"(",
"typeof",
"arguments",
"... | Run accessibility tests on a web page.
@public
@param {String} [url] - The URL to run tests against.
@param {Object} [options={}] - Options to change the way tests run.
@param {Function} [callback] - An optional callback to use instead of promises.
@returns {Promise} Returns a promise which resolves with a results obje... | [
"Run",
"accessibility",
"tests",
"on",
"a",
"web",
"page",
"."
] | ddcbb3696a43f775e32399bbafeea7f12c9d6cbb | https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/pa11y.js#L24-L77 | train |
pa11y/pa11y | lib/pa11y.js | defaultOptions | function defaultOptions(options) {
options = extend({}, pa11y.defaults, options);
options.ignore = options.ignore.map(ignored => ignored.toLowerCase());
if (!options.includeNotices) {
options.ignore.push('notice');
}
if (!options.includeWarnings) {
options.ignore.push('warning');
}
return options;
} | javascript | function defaultOptions(options) {
options = extend({}, pa11y.defaults, options);
options.ignore = options.ignore.map(ignored => ignored.toLowerCase());
if (!options.includeNotices) {
options.ignore.push('notice');
}
if (!options.includeWarnings) {
options.ignore.push('warning');
}
return options;
} | [
"function",
"defaultOptions",
"(",
"options",
")",
"{",
"options",
"=",
"extend",
"(",
"{",
"}",
",",
"pa11y",
".",
"defaults",
",",
"options",
")",
";",
"options",
".",
"ignore",
"=",
"options",
".",
"ignore",
".",
"map",
"(",
"ignored",
"=>",
"ignore... | Default the passed in options using Pa11y's defaults.
@private
@param {Object} [options={}] - The options to apply defaults to.
@returns {Object} Returns the defaulted options. | [
"Default",
"the",
"passed",
"in",
"options",
"using",
"Pa11y",
"s",
"defaults",
"."
] | ddcbb3696a43f775e32399bbafeea7f12c9d6cbb | https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/pa11y.js#L258-L268 | train |
pa11y/pa11y | lib/pa11y.js | verifyOptions | function verifyOptions(options) {
if (!pa11y.allowedStandards.includes(options.standard)) {
throw new Error(`Standard must be one of ${pa11y.allowedStandards.join(', ')}`);
}
if (options.page && !options.browser) {
throw new Error('The page option must only be set alongside the browser option');
}
} | javascript | function verifyOptions(options) {
if (!pa11y.allowedStandards.includes(options.standard)) {
throw new Error(`Standard must be one of ${pa11y.allowedStandards.join(', ')}`);
}
if (options.page && !options.browser) {
throw new Error('The page option must only be set alongside the browser option');
}
} | [
"function",
"verifyOptions",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"pa11y",
".",
"allowedStandards",
".",
"includes",
"(",
"options",
".",
"standard",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"`",
"${",
"pa11y",
".",
"allowedStandards",
".",
"joi... | Verify that passed in options are valid.
@private
@param {Object} [options={}] - The options to verify.
@returns {Undefined} Returns nothing.
@throws {Error} Throws if options are not valid. | [
"Verify",
"that",
"passed",
"in",
"options",
"are",
"valid",
"."
] | ddcbb3696a43f775e32399bbafeea7f12c9d6cbb | https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/pa11y.js#L277-L284 | train |
pa11y/pa11y | lib/runner.js | configureHtmlCodeSniffer | function configureHtmlCodeSniffer() {
if (options.rules.length && options.standard !== 'Section508') {
for (const rule of options.rules) {
if (window.HTMLCS_WCAG2AAA.sniffs.includes(rule)) {
window[`HTMLCS_${options.standard}`].sniffs[0].include.push(rule);
} else {
throw new Error(`${rule}... | javascript | function configureHtmlCodeSniffer() {
if (options.rules.length && options.standard !== 'Section508') {
for (const rule of options.rules) {
if (window.HTMLCS_WCAG2AAA.sniffs.includes(rule)) {
window[`HTMLCS_${options.standard}`].sniffs[0].include.push(rule);
} else {
throw new Error(`${rule}... | [
"function",
"configureHtmlCodeSniffer",
"(",
")",
"{",
"if",
"(",
"options",
".",
"rules",
".",
"length",
"&&",
"options",
".",
"standard",
"!==",
"'Section508'",
")",
"{",
"for",
"(",
"const",
"rule",
"of",
"options",
".",
"rules",
")",
"{",
"if",
"(",
... | Configure HTML CodeSniffer.
@private
@returns {Undefined} Returns nothing. | [
"Configure",
"HTML",
"CodeSniffer",
"."
] | ddcbb3696a43f775e32399bbafeea7f12c9d6cbb | https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/runner.js#L54-L64 | train |
pa11y/pa11y | lib/runner.js | runHtmlCodeSniffer | function runHtmlCodeSniffer() {
return new Promise((resolve, reject) => {
window.HTMLCS.process(options.standard, window.document, error => {
if (error) {
return reject(error);
}
resolve(window.HTMLCS.getMessages());
});
});
} | javascript | function runHtmlCodeSniffer() {
return new Promise((resolve, reject) => {
window.HTMLCS.process(options.standard, window.document, error => {
if (error) {
return reject(error);
}
resolve(window.HTMLCS.getMessages());
});
});
} | [
"function",
"runHtmlCodeSniffer",
"(",
")",
"{",
"return",
"new",
"Promise",
"(",
"(",
"resolve",
",",
"reject",
")",
"=>",
"{",
"window",
".",
"HTMLCS",
".",
"process",
"(",
"options",
".",
"standard",
",",
"window",
".",
"document",
",",
"error",
"=>",... | Run HTML CodeSniffer on the current page.
@private
@returns {Promise} Returns a promise which resolves with HTML CodeSniffer issues. | [
"Run",
"HTML",
"CodeSniffer",
"on",
"the",
"current",
"page",
"."
] | ddcbb3696a43f775e32399bbafeea7f12c9d6cbb | https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/runner.js#L71-L80 | train |
pa11y/pa11y | lib/runner.js | processIssues | function processIssues(issues) {
if (options.rootElement) {
issues = issues.filter(isIssueInTestArea);
}
if (options.hideElements) {
issues = issues.filter(isElementOutsideHiddenArea);
}
return issues.map(processIssue).filter(isIssueNotIgnored);
} | javascript | function processIssues(issues) {
if (options.rootElement) {
issues = issues.filter(isIssueInTestArea);
}
if (options.hideElements) {
issues = issues.filter(isElementOutsideHiddenArea);
}
return issues.map(processIssue).filter(isIssueNotIgnored);
} | [
"function",
"processIssues",
"(",
"issues",
")",
"{",
"if",
"(",
"options",
".",
"rootElement",
")",
"{",
"issues",
"=",
"issues",
".",
"filter",
"(",
"isIssueInTestArea",
")",
";",
"}",
"if",
"(",
"options",
".",
"hideElements",
")",
"{",
"issues",
"=",... | Process HTML CodeSniffer issues.
@private
@param {Array} issues - An array of HTML CodeSniffer issues to process.
@returns {Array} Returns an array of processed issues. | [
"Process",
"HTML",
"CodeSniffer",
"issues",
"."
] | ddcbb3696a43f775e32399bbafeea7f12c9d6cbb | https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/runner.js#L88-L96 | train |
pa11y/pa11y | lib/runner.js | processIssue | function processIssue(issue) {
return {
code: issue.code,
context: processIssueHtml(issue.element),
message: issue.msg,
type: issueTypeMap[issue.type] || 'unknown',
typeCode: issue.type,
selector: getCssSelectorForElement(issue.element)
};
} | javascript | function processIssue(issue) {
return {
code: issue.code,
context: processIssueHtml(issue.element),
message: issue.msg,
type: issueTypeMap[issue.type] || 'unknown',
typeCode: issue.type,
selector: getCssSelectorForElement(issue.element)
};
} | [
"function",
"processIssue",
"(",
"issue",
")",
"{",
"return",
"{",
"code",
":",
"issue",
".",
"code",
",",
"context",
":",
"processIssueHtml",
"(",
"issue",
".",
"element",
")",
",",
"message",
":",
"issue",
".",
"msg",
",",
"type",
":",
"issueTypeMap",
... | Process a HTML CodeSniffer issue.
@private
@param {Object} issue - An HTML CodeSniffer issue to process.
@returns {Object} Returns the processed issue. | [
"Process",
"a",
"HTML",
"CodeSniffer",
"issue",
"."
] | ddcbb3696a43f775e32399bbafeea7f12c9d6cbb | https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/runner.js#L104-L113 | 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.