_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q21500 | make | train | 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 | {
"resource": ""
} |
q21501 | calculate | train | 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 | {
"resource": ""
} |
q21502 | set | train | function set(value) {
var step = value.substr(1);
this._m = {
direction: value.substr(0, 1),
| javascript | {
"resource": ""
} |
q21503 | get | train | 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` | javascript | {
"resource": ""
} |
q21504 | apply | train | 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 | {
"resource": ""
} |
q21505 | remove | train | function remove(slides) {
for (var i = 0, len = slides.length; i < len; i++) {
var style = slides[i].style;
| javascript | {
"resource": ""
} |
q21506 | siblings | train | function siblings(node) {
if (node && node.parentNode) {
var n = node.parentNode.firstChild;
var matched = [];
for (; n; n = n.nextSibling) {
| javascript | {
"resource": ""
} |
q21507 | mount | train | 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) { | javascript | {
"resource": ""
} |
q21508 | set | train | function set(r) {
if (isString(r)) {
r = document.querySelector(r);
}
if (exist(r)) {
Html._r = r;
} else {
| javascript | {
"resource": ""
} |
q21509 | set | train | function set(value) {
if (isObject(value)) {
value.before = toInt(value.before);
value.after = toInt(value.after);
} | javascript | {
"resource": ""
} |
q21510 | get | train | function get() {
var value = Peek.value;
var perView = Glide.settings.perView;
if (isObject(value)) {
return value.before | javascript | {
"resource": ""
} |
q21511 | make | train | function make() {
var _this = this;
var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
this.offset = offset; | javascript | {
"resource": ""
} |
q21512 | get | train | function get() {
var offset = this.offset;
var translate = this.translate;
if (Components.Direction.is('rtl')) {
| javascript | {
"resource": ""
} |
q21513 | setupSlides | train | function setupSlides() {
var width = this.slideWidth + 'px';
var slides = Components.Html.slides; | javascript | {
"resource": ""
} |
q21514 | remove | train | function remove() {
var slides = Components.Html.slides;
for (var i = 0; i | javascript | {
"resource": ""
} |
q21515 | get | train | function get() {
return Sizes.slideWidth | javascript | {
"resource": ""
} |
q21516 | get | train | function get() {
return Sizes.width / Glide.settings.perView | javascript | {
"resource": ""
} |
q21517 | typeClass | train | function typeClass() {
Components.Html.roo | javascript | {
"resource": ""
} |
q21518 | removeClasses | train | function removeClasses() {
var classes = Glide.settings.classes;
Components.Html.root.classList.remove(classes[Glide.settings.type]); | javascript | {
"resource": ""
} |
q21519 | collect | train | 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 | {
"resource": ""
} |
q21520 | append | train | 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();
| javascript | {
"resource": ""
} |
q21521 | remove | train | function remove() {
var items = this.items;
for (var i | javascript | {
"resource": ""
} |
q21522 | get | train | function get() {
return (Components.Sizes.slideWidth | javascript | {
"resource": ""
} |
q21523 | EventsBinder | train | function EventsBinder() {
var listeners = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
| javascript | {
"resource": ""
} |
q21524 | bind | train | function bind() {
Binder.on('resize', window, throttle(function () {
| javascript | {
"resource": ""
} |
q21525 | resolve | train | function resolve(pattern) {
var token = pattern.slice(0, 1);
if (this.is('rtl')) {
| javascript | {
"resource": ""
} |
q21526 | addClass | train | function addClass() {
Components.Html.root | javascript | {
"resource": ""
} |
q21527 | removeClass | train | function removeClass() {
Components.Html.root.classList.remove(Glide.settings. | javascript | {
"resource": ""
} |
q21528 | Rtl | train | function Rtl (Glide, Components) {
return {
/**
* Negates the passed translate if glide is in RTL option.
*
* @param {Number} translate | javascript | {
"resource": ""
} |
q21529 | Gap | train | function Gap (Glide, Components) {
return {
/**
* Modifies passed translate value with number in the `gap` settings.
*
* @param {Number} translate
* @return {Number}
*/
modify: function | javascript | {
"resource": ""
} |
q21530 | Grow | train | function Grow (Glide, Components) {
return {
/**
* Adds to the passed translate width of the half of clones.
| javascript | {
"resource": ""
} |
q21531 | modify | train | function modify(translate) {
if (Glide.settings.focusAt >= 0) {
var peek = Components.Peek.value;
if (isObject(peek)) {
| javascript | {
"resource": ""
} |
q21532 | Focusing | train | 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 | {
"resource": ""
} |
q21533 | mutator | train | 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 | {
"resource": ""
} |
q21534 | mutate | train | 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 {
| javascript | {
"resource": ""
} |
q21535 | set | train | function set(value) {
var transform = mutator(Glide, Components).mutate(value); | javascript | {
"resource": ""
} |
q21536 | compose | train | function compose(property) {
var settings = Glide.settings;
if (!disabled) {
return property + ' ' + this.duration + 'ms ' | javascript | {
"resource": ""
} |
q21537 | set | train | function set() {
var property = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform';
| javascript | {
"resource": ""
} |
q21538 | get | train | function get() {
var settings = Glide.settings;
if (Glide.isType('slider') && Components.Run.offset) {
| javascript | {
"resource": ""
} |
q21539 | start | train | function start(event) {
if (!disabled && !Glide.disabled) {
this.disable();
var swipe = this.touches(event);
swipeSin = null;
swipeStartX = toInt(swipe.pageX);
| javascript | {
"resource": ""
} |
q21540 | move | train | 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 | {
"resource": ""
} |
q21541 | end | train | 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 | {
"resource": ""
} |
q21542 | bindSwipeStart | train | 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);
}
| javascript | {
"resource": ""
} |
q21543 | unbindSwipeStart | train | function unbindSwipeStart() {
Binder.off(START_EVENTS[0], Components.Html.wrapper, | javascript | {
"resource": ""
} |
q21544 | bindSwipeMove | train | function bindSwipeMove() {
var _this2 = this;
Binder.on(MOVE_EVENTS, Components.Html.wrapper, throttle(function (event) {
| javascript | {
"resource": ""
} |
q21545 | bindSwipeEnd | train | function bindSwipeEnd() {
var _this3 = this;
Binder.on(END_EVENTS, Components.Html.wrapper, function | javascript | {
"resource": ""
} |
q21546 | touches | train | function touches(event) {
if (MOUSE_EVENTS.indexOf(event.type) > -1) {
return event;
| javascript | {
"resource": ""
} |
q21547 | threshold | train | function threshold(event) {
var settings = Glide.settings;
if (MOUSE_EVENTS.indexOf(event.type) > -1) {
| javascript | {
"resource": ""
} |
q21548 | detach | train | 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'));
| javascript | {
"resource": ""
} |
q21549 | attach | train | 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', | javascript | {
"resource": ""
} |
q21550 | mount | train | function mount() {
/**
* Collection of navigation HTML elements.
*
* @private
* @type {HTMLCollection}
*/
this._n = Components.Html.root.querySelectorAll(NAV_SELECTOR);
/**
* Collection of controls HTML elements.
*
| javascript | {
"resource": ""
} |
q21551 | removeActive | train | function removeActive() {
for (var i = 0; i < this._n.length; i++) {
| javascript | {
"resource": ""
} |
q21552 | addClass | train | function addClass(controls) {
var settings = Glide.settings;
var item = controls[Glide.index];
if (item) {
| javascript | {
"resource": ""
} |
q21553 | removeClass | train | function removeClass(controls) {
var item = controls[Glide.index];
if (item) {
| javascript | {
"resource": ""
} |
q21554 | addBindings | train | function addBindings() {
for (var i = 0; i < this._c.length; i++) {
| javascript | {
"resource": ""
} |
q21555 | removeBindings | train | function removeBindings() {
for (var i = 0; i < this._c.length; i++) {
| javascript | {
"resource": ""
} |
q21556 | bind | train | function bind(elements) {
for (var i = 0; i < elements.length; i++) {
Binder.on('click', elements[i], this.click);
| javascript | {
"resource": ""
} |
q21557 | unbind | train | function unbind(elements) {
for (var i = 0; i < elements.length; i++) {
| javascript | {
"resource": ""
} |
q21558 | click | train | function click(event) {
event.preventDefault();
Components.Run.make(Components.Direction.r | javascript | {
"resource": ""
} |
q21559 | press | train | function press(event) {
if (event.keyCode === 39) {
Components.Run.make(Components.Direction.resolve('>'));
}
if (event.keyCode === 37) | javascript | {
"resource": ""
} |
q21560 | start | train | function start() {
var _this = this;
if (Glide.settings.autoplay) {
if (isUndefined(this._i)) {
this._i = setInterval(function () {
_this.stop();
| javascript | {
"resource": ""
} |
q21561 | bind | train | function bind() {
var _this2 = this;
Binder.on('mouseover', Components.Html.root, function () {
_this2.stop();
}); | javascript | {
"resource": ""
} |
q21562 | get | train | function get() {
var autoplay = Components.Html.slides[Glide.index].getAttribute('data-glide-autoplay');
if (autoplay) {
| javascript | {
"resource": ""
} |
q21563 | match | train | function match(points) {
if (typeof window.matchMedia !== 'undefined') {
for (var point in points) {
if (points.hasOwnProperty(point)) {
if (window.matchMedia('(max-width: ' + point | javascript | {
"resource": ""
} |
q21564 | createCallback | train | 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 | {
"resource": ""
} |
q21565 | subclass$ | train | 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__ = | javascript | {
"resource": ""
} |
q21566 | Parens | train | function Parens(value,open,close){
this.setup();
this._open = open;
| javascript | {
"resource": ""
} |
q21567 | Param | train | function Param(name,defaults,typ){
// could have introduced bugs by moving back to identifier here
this._traversed = false;
this._name = name; | javascript | {
"resource": ""
} |
q21568 | Root | train | function Root(body,opts){
this._traversed = false;
this._body = AST.blk(body);
this._scope | javascript | {
"resource": ""
} |
q21569 | Literal | train | function Literal(v){
this._traversed = false;
this._expression | javascript | {
"resource": ""
} |
q21570 | Str | train | function Str(v){
this._traversed = false;
this._expression = true;
this._cache = null;
this._value = v; | javascript | {
"resource": ""
} |
q21571 | InterpolatedString | train | function InterpolatedString(nodes,o){
if(o === | javascript | {
"resource": ""
} |
q21572 | Identifier | train | function Identifier(value){
this._value = this.load(value);
this._symbol = null;
this._setter = null;
if (("" + value).indexOf("?") | javascript | {
"resource": ""
} |
q21573 | For | train | function For(o){
if(o === undefined) o = {};
this._traversed | javascript | {
"resource": ""
} |
q21574 | TagTree | train | function TagTree(owner,list,options){
if(options === undefined) options = {};
this._owner = owner;
this._nodes = this.load(list);
this._options = options;
| javascript | {
"resource": ""
} |
q21575 | RootScope | train | 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 | {
"resource": ""
} |
q21576 | train | 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) {
| javascript | {
"resource": ""
} | |
q21577 | train | 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 | {
"resource": ""
} | |
q21578 | train | 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 | {
"resource": ""
} | |
q21579 | train | 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 | {
"resource": ""
} | |
q21580 | processOperators | train | 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++) {
| javascript | {
"resource": ""
} |
q21581 | addSymbol | train | function addSymbol (s) {
if (s && !symbols_[s]) {
symbols_[s] = ++symbolId;
| javascript | {
"resource": ""
} |
q21582 | tokenStackLex | train | 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;
| javascript | {
"resource": ""
} |
q21583 | createVariable | train | function createVariable() {
var id = nextVariableId++;
var name = '$V';
do {
name += variableTokens[id % variableTokensLength];
id = | javascript | {
"resource": ""
} |
q21584 | locateNearestErrorRecoveryRule | train | 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 | {
"resource": ""
} |
q21585 | LALR_buildNewGrammar | train | 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 | {
"resource": ""
} |
q21586 | focusTab | train | function focusTab(tabId) {
var updateProperties = { "active": true };
| javascript | {
"resource": ""
} |
q21587 | save_options | train | 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.
| javascript | {
"resource": ""
} |
q21588 | restore_options | train | function restore_options() {
// Use default value showChangeLog = true.
chrome.storage.sync.get({
| javascript | {
"resource": ""
} |
q21589 | style | train | function style (s, t) {
if (!t) return (text) | javascript | {
"resource": ""
} |
q21590 | buildReporter | train | function buildReporter(methods) {
return {
supports: methods.supports,
begin: buildReporterMethod(methods.begin),
results: buildReporterMethod(methods.results),
log: {
debug: buildReporterMethod(methods.debug), | javascript | {
"resource": ""
} |
q21591 | buildReporterMethod | train | function buildReporterMethod(method, consoleMethod = 'log') {
if (typeof method !== 'function') {
method = () => {};
}
return async input => {
const | javascript | {
"resource": ""
} |
q21592 | isValidAction | train | function isValidAction(actionString) {
return module.exports.actions.some(foundAction => {
| javascript | {
"resource": ""
} |
q21593 | pa11y | train | 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 | {
"resource": ""
} |
q21594 | defaultOptions | train | function defaultOptions(options) {
options = extend({}, pa11y.defaults, options);
options.ignore = options.ignore.map(ignored | javascript | {
"resource": ""
} |
q21595 | verifyOptions | train | function verifyOptions(options) {
if (!pa11y.allowedStandards.includes(options.standard)) {
throw new Error(`Standard must be one of ${pa11y.allowedStandards.join(', ')}`);
}
if | javascript | {
"resource": ""
} |
q21596 | configureHtmlCodeSniffer | train | function configureHtmlCodeSniffer() {
if (options.rules.length && options.standard !== 'Section508') {
for (const rule of options.rules) {
if (window.HTMLCS_WCAG2AAA.sniffs.includes(rule)) {
| javascript | {
"resource": ""
} |
q21597 | runHtmlCodeSniffer | train | function runHtmlCodeSniffer() {
return new Promise((resolve, reject) => {
window.HTMLCS.process(options.standard, window.document, error => {
if (error) {
| javascript | {
"resource": ""
} |
q21598 | processIssues | train | function processIssues(issues) {
if (options.rootElement) {
issues = issues.filter(isIssueInTestArea);
| javascript | {
"resource": ""
} |
q21599 | processIssue | train | function processIssue(issue) {
return {
code: issue.code,
context: processIssueHtml(issue.element),
message: issue.msg,
type: issueTypeMap[issue.type] || 'unknown',
| javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.