id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
6,500
mongodb/node-mongodb-native
lib/operations/admin_ops.js
validateCollection
function validateCollection(admin, collectionName, options, callback) { const command = { validate: collectionName }; const keys = Object.keys(options); // Decorate command with extra options for (let i = 0; i < keys.length; i++) { if (options.hasOwnProperty(keys[i]) && keys[i] !== 'session') { comma...
javascript
function validateCollection(admin, collectionName, options, callback) { const command = { validate: collectionName }; const keys = Object.keys(options); // Decorate command with extra options for (let i = 0; i < keys.length; i++) { if (options.hasOwnProperty(keys[i]) && keys[i] !== 'session') { comma...
[ "function", "validateCollection", "(", "admin", ",", "collectionName", ",", "options", ",", "callback", ")", "{", "const", "command", "=", "{", "validate", ":", "collectionName", "}", ";", "const", "keys", "=", "Object", ".", "keys", "(", "options", ")", "...
Validate an existing collection @param {Admin} a collection instance. @param {string} collectionName The name of the collection to validate. @param {Object} [options] Optional settings. See Admin.prototype.validateCollection for a list of options. @param {Admin~resultCallback} [callback] The command result callback.
[ "Validate", "an", "existing", "collection" ]
0afbbccf1bd7d437610c33cbd5523f01bc6bc6e5
https://github.com/mongodb/node-mongodb-native/blob/0afbbccf1bd7d437610c33cbd5523f01bc6bc6e5/lib/operations/admin_ops.js#L36-L60
6,501
mongodb/node-mongodb-native
lib/operations/mongo_client_ops.js
collectEvents
function collectEvents(mongoClient, topology) { let MongoClient = loadClient(); const collectedEvents = []; if (mongoClient instanceof MongoClient) { monitoringEvents.forEach(event => { topology.on(event, (object1, object2) => { if (event === 'open') { collectedEvents.push({ event: ev...
javascript
function collectEvents(mongoClient, topology) { let MongoClient = loadClient(); const collectedEvents = []; if (mongoClient instanceof MongoClient) { monitoringEvents.forEach(event => { topology.on(event, (object1, object2) => { if (event === 'open') { collectedEvents.push({ event: ev...
[ "function", "collectEvents", "(", "mongoClient", ",", "topology", ")", "{", "let", "MongoClient", "=", "loadClient", "(", ")", ";", "const", "collectedEvents", "=", "[", "]", ";", "if", "(", "mongoClient", "instanceof", "MongoClient", ")", "{", "monitoringEven...
Collect all events in order from SDAM
[ "Collect", "all", "events", "in", "order", "from", "SDAM" ]
0afbbccf1bd7d437610c33cbd5523f01bc6bc6e5
https://github.com/mongodb/node-mongodb-native/blob/0afbbccf1bd7d437610c33cbd5523f01bc6bc6e5/lib/operations/mongo_client_ops.js#L144-L161
6,502
mongodb/node-mongodb-native
lib/operations/mongo_client_ops.js
replayEvents
function replayEvents(mongoClient, events) { for (let i = 0; i < events.length; i++) { mongoClient.emit(events[i].event, events[i].object1, events[i].object2); } }
javascript
function replayEvents(mongoClient, events) { for (let i = 0; i < events.length; i++) { mongoClient.emit(events[i].event, events[i].object1, events[i].object2); } }
[ "function", "replayEvents", "(", "mongoClient", ",", "events", ")", "{", "for", "(", "let", "i", "=", "0", ";", "i", "<", "events", ".", "length", ";", "i", "++", ")", "{", "mongoClient", ".", "emit", "(", "events", "[", "i", "]", ".", "event", "...
Replay any events due to single server connection switching to Mongos
[ "Replay", "any", "events", "due", "to", "single", "server", "connection", "switching", "to", "Mongos" ]
0afbbccf1bd7d437610c33cbd5523f01bc6bc6e5
https://github.com/mongodb/node-mongodb-native/blob/0afbbccf1bd7d437610c33cbd5523f01bc6bc6e5/lib/operations/mongo_client_ops.js#L502-L506
6,503
mongodb/node-mongodb-native
lib/mongo_client.js
MongoClient
function MongoClient(url, options) { if (!(this instanceof MongoClient)) return new MongoClient(url, options); // Set up event emitter EventEmitter.call(this); // The internal state this.s = { url: url, options: options || {}, promiseLibrary: null, dbCache: {}, sessions: [] }; // Get...
javascript
function MongoClient(url, options) { if (!(this instanceof MongoClient)) return new MongoClient(url, options); // Set up event emitter EventEmitter.call(this); // The internal state this.s = { url: url, options: options || {}, promiseLibrary: null, dbCache: {}, sessions: [] }; // Get...
[ "function", "MongoClient", "(", "url", ",", "options", ")", "{", "if", "(", "!", "(", "this", "instanceof", "MongoClient", ")", ")", "return", "new", "MongoClient", "(", "url", ",", "options", ")", ";", "// Set up event emitter", "EventEmitter", ".", "call",...
A string specifying the level of a ReadConcern @typedef {'local'|'available'|'majority'|'linearizable'|'snapshot'} ReadConcernLevel @see https://docs.mongodb.com/manual/reference/read-concern/index.html#read-concern-levels Creates a new MongoClient instance @class @param {string} url The connection URI string @param ...
[ "A", "string", "specifying", "the", "level", "of", "a", "ReadConcern" ]
0afbbccf1bd7d437610c33cbd5523f01bc6bc6e5
https://github.com/mongodb/node-mongodb-native/blob/0afbbccf1bd7d437610c33cbd5523f01bc6bc6e5/lib/mongo_client.js#L123-L142
6,504
mongodb/node-mongodb-native
lib/db.js
Db
function Db(databaseName, topology, options) { options = options || {}; if (!(this instanceof Db)) return new Db(databaseName, topology, options); EventEmitter.call(this); // Get the promiseLibrary const promiseLibrary = options.promiseLibrary || Promise; // Filter the options options = filterOptions(op...
javascript
function Db(databaseName, topology, options) { options = options || {}; if (!(this instanceof Db)) return new Db(databaseName, topology, options); EventEmitter.call(this); // Get the promiseLibrary const promiseLibrary = options.promiseLibrary || Promise; // Filter the options options = filterOptions(op...
[ "function", "Db", "(", "databaseName", ",", "topology", ",", "options", ")", "{", "options", "=", "options", "||", "{", "}", ";", "if", "(", "!", "(", "this", "instanceof", "Db", ")", ")", "return", "new", "Db", "(", "databaseName", ",", "topology", ...
Creates a new Db instance @class @param {string} databaseName The name of the database this instance represents. @param {(Server|ReplSet|Mongos)} topology The server topology for the database. @param {object} [options] Optional settings. @param {string} [options.authSource] If the database authentication is dependent o...
[ "Creates", "a", "new", "Db", "instance" ]
0afbbccf1bd7d437610c33cbd5523f01bc6bc6e5
https://github.com/mongodb/node-mongodb-native/blob/0afbbccf1bd7d437610c33cbd5523f01bc6bc6e5/lib/db.js#L133-L202
6,505
reduxjs/redux-devtools
packages/react-json-tree/src/JSONIterableNode.js
createItemString
function createItemString(data, limit) { let count = 0; let hasMore = false; if (Number.isSafeInteger(data.size)) { count = data.size; } else { // eslint-disable-next-line no-unused-vars for (const entry of data) { if (limit && count + 1 > limit) { hasMore = true; break; ...
javascript
function createItemString(data, limit) { let count = 0; let hasMore = false; if (Number.isSafeInteger(data.size)) { count = data.size; } else { // eslint-disable-next-line no-unused-vars for (const entry of data) { if (limit && count + 1 > limit) { hasMore = true; break; ...
[ "function", "createItemString", "(", "data", ",", "limit", ")", "{", "let", "count", "=", "0", ";", "let", "hasMore", "=", "false", ";", "if", "(", "Number", ".", "isSafeInteger", "(", "data", ".", "size", ")", ")", "{", "count", "=", "data", ".", ...
Returns the "n Items" string for this node, generating and caching it if it hasn't been created yet.
[ "Returns", "the", "n", "Items", "string", "for", "this", "node", "generating", "and", "caching", "it", "if", "it", "hasn", "t", "been", "created", "yet", "." ]
03d1448dc3c47ffd75a8cf07f21399b86d557988
https://github.com/reduxjs/redux-devtools/blob/03d1448dc3c47ffd75a8cf07f21399b86d557988/packages/react-json-tree/src/JSONIterableNode.js#L6-L22
6,506
reduxjs/redux-devtools
packages/redux-devtools-instrument/src/instrument.js
computeWithTryCatch
function computeWithTryCatch(reducer, action, state) { let nextState = state; let nextError; try { nextState = reducer(state, action); } catch (err) { nextError = err.toString(); if (isChrome) { // In Chrome, rethrowing provides better source map support setTimeout(() => { throw ...
javascript
function computeWithTryCatch(reducer, action, state) { let nextState = state; let nextError; try { nextState = reducer(state, action); } catch (err) { nextError = err.toString(); if (isChrome) { // In Chrome, rethrowing provides better source map support setTimeout(() => { throw ...
[ "function", "computeWithTryCatch", "(", "reducer", ",", "action", ",", "state", ")", "{", "let", "nextState", "=", "state", ";", "let", "nextError", ";", "try", "{", "nextState", "=", "reducer", "(", "state", ",", "action", ")", ";", "}", "catch", "(", ...
Computes the next entry with exceptions catching.
[ "Computes", "the", "next", "entry", "with", "exceptions", "catching", "." ]
03d1448dc3c47ffd75a8cf07f21399b86d557988
https://github.com/reduxjs/redux-devtools/blob/03d1448dc3c47ffd75a8cf07f21399b86d557988/packages/redux-devtools-instrument/src/instrument.js#L153-L174
6,507
reduxjs/redux-devtools
packages/redux-devtools-instrument/src/instrument.js
computeNextEntry
function computeNextEntry(reducer, action, state, shouldCatchErrors) { if (!shouldCatchErrors) { return { state: reducer(state, action) }; } return computeWithTryCatch(reducer, action, state); }
javascript
function computeNextEntry(reducer, action, state, shouldCatchErrors) { if (!shouldCatchErrors) { return { state: reducer(state, action) }; } return computeWithTryCatch(reducer, action, state); }
[ "function", "computeNextEntry", "(", "reducer", ",", "action", ",", "state", ",", "shouldCatchErrors", ")", "{", "if", "(", "!", "shouldCatchErrors", ")", "{", "return", "{", "state", ":", "reducer", "(", "state", ",", "action", ")", "}", ";", "}", "retu...
Computes the next entry in the log by applying an action.
[ "Computes", "the", "next", "entry", "in", "the", "log", "by", "applying", "an", "action", "." ]
03d1448dc3c47ffd75a8cf07f21399b86d557988
https://github.com/reduxjs/redux-devtools/blob/03d1448dc3c47ffd75a8cf07f21399b86d557988/packages/redux-devtools-instrument/src/instrument.js#L179-L184
6,508
reduxjs/redux-devtools
packages/redux-devtools-instrument/src/instrument.js
recomputeStates
function recomputeStates( computedStates, minInvalidatedStateIndex, reducer, committedState, actionsById, stagedActionIds, skippedActionIds, shouldCatchErrors ) { // Optimization: exit early and return the same reference // if we know nothing could have changed. if ( !computedStates || min...
javascript
function recomputeStates( computedStates, minInvalidatedStateIndex, reducer, committedState, actionsById, stagedActionIds, skippedActionIds, shouldCatchErrors ) { // Optimization: exit early and return the same reference // if we know nothing could have changed. if ( !computedStates || min...
[ "function", "recomputeStates", "(", "computedStates", ",", "minInvalidatedStateIndex", ",", "reducer", ",", "committedState", ",", "actionsById", ",", "stagedActionIds", ",", "skippedActionIds", ",", "shouldCatchErrors", ")", "{", "// Optimization: exit early and return the s...
Runs the reducer on invalidated actions to get a fresh computation log.
[ "Runs", "the", "reducer", "on", "invalidated", "actions", "to", "get", "a", "fresh", "computation", "log", "." ]
03d1448dc3c47ffd75a8cf07f21399b86d557988
https://github.com/reduxjs/redux-devtools/blob/03d1448dc3c47ffd75a8cf07f21399b86d557988/packages/redux-devtools-instrument/src/instrument.js#L189-L241
6,509
CreateJS/PreloadJS
lib/preloadjs.js
AbstractMediaLoader
function AbstractMediaLoader(loadItem, preferXHR, type) { this.AbstractLoader_constructor(loadItem, preferXHR, type); // public properties this.resultFormatter = this._formatResult; // protected properties this._tagSrcAttribute = "src"; this.on("initialize", this._updateXHR, this); }
javascript
function AbstractMediaLoader(loadItem, preferXHR, type) { this.AbstractLoader_constructor(loadItem, preferXHR, type); // public properties this.resultFormatter = this._formatResult; // protected properties this._tagSrcAttribute = "src"; this.on("initialize", this._updateXHR, this); }
[ "function", "AbstractMediaLoader", "(", "loadItem", ",", "preferXHR", ",", "type", ")", "{", "this", ".", "AbstractLoader_constructor", "(", "loadItem", ",", "preferXHR", ",", "type", ")", ";", "// public properties", "this", ".", "resultFormatter", "=", "this", ...
constructor The AbstractMediaLoader is a base class that handles some of the shared methods and properties of loaders that handle HTML media elements, such as Video and Audio. @class AbstractMediaLoader @param {LoadItem|Object} loadItem @param {Boolean} preferXHR @param {String} type The type of media to load. Usually...
[ "constructor", "The", "AbstractMediaLoader", "is", "a", "base", "class", "that", "handles", "some", "of", "the", "shared", "methods", "and", "properties", "of", "loaders", "that", "handle", "HTML", "media", "elements", "such", "as", "Video", "and", "Audio", "....
eab00cf50fe2f6993c75e04ad7f7e5e9c9e9f083
https://github.com/CreateJS/PreloadJS/blob/eab00cf50fe2f6993c75e04ad7f7e5e9c9e9f083/lib/preloadjs.js#L3429-L3439
6,510
CreateJS/PreloadJS
lib/preloadjs.js
XHRRequest
function XHRRequest (item) { this.AbstractRequest_constructor(item); // protected properties /** * A reference to the XHR request used to load the content. * @property _request * @type {XMLHttpRequest | XDomainRequest | ActiveX.XMLHTTP} * @private */ this._request = null; /** * A manual lo...
javascript
function XHRRequest (item) { this.AbstractRequest_constructor(item); // protected properties /** * A reference to the XHR request used to load the content. * @property _request * @type {XMLHttpRequest | XDomainRequest | ActiveX.XMLHTTP} * @private */ this._request = null; /** * A manual lo...
[ "function", "XHRRequest", "(", "item", ")", "{", "this", ".", "AbstractRequest_constructor", "(", "item", ")", ";", "// protected properties", "/**\n\t\t * A reference to the XHR request used to load the content.\n\t\t * @property _request\n\t\t * @type {XMLHttpRequest | XDomainRequest |...
constructor A preloader that loads items using XHR requests, usually XMLHttpRequest. However XDomainRequests will be used for cross-domain requests if possible, and older versions of IE fall back on to ActiveX objects when necessary. XHR requests load the content as text or binary data, provide progress and consistent...
[ "constructor", "A", "preloader", "that", "loads", "items", "using", "XHR", "requests", "usually", "XMLHttpRequest", ".", "However", "XDomainRequests", "will", "be", "used", "for", "cross", "-", "domain", "requests", "if", "possible", "and", "older", "versions", ...
eab00cf50fe2f6993c75e04ad7f7e5e9c9e9f083
https://github.com/CreateJS/PreloadJS/blob/eab00cf50fe2f6993c75e04ad7f7e5e9c9e9f083/lib/preloadjs.js#L3839-L3903
6,511
CreateJS/PreloadJS
lib/preloadjs.js
LoadQueue
function LoadQueue (preferXHR, basePath, crossOrigin) { this.AbstractLoader_constructor(); /** * An array of the plugins registered using {{#crossLink "LoadQueue/installPlugin"}}{{/crossLink}}. * @property _plugins * @type {Array} * @private * @since 0.6.1 */ this._plugins = []; /** * An ...
javascript
function LoadQueue (preferXHR, basePath, crossOrigin) { this.AbstractLoader_constructor(); /** * An array of the plugins registered using {{#crossLink "LoadQueue/installPlugin"}}{{/crossLink}}. * @property _plugins * @type {Array} * @private * @since 0.6.1 */ this._plugins = []; /** * An ...
[ "function", "LoadQueue", "(", "preferXHR", ",", "basePath", ",", "crossOrigin", ")", "{", "this", ".", "AbstractLoader_constructor", "(", ")", ";", "/**\n\t\t * An array of the plugins registered using {{#crossLink \"LoadQueue/installPlugin\"}}{{/crossLink}}.\n\t\t * @property _plugi...
constructor The LoadQueue class is the main API for preloading content. LoadQueue is a load manager, which can preload either a single file, or queue of files. <b>Creating a Queue</b><br /> To use LoadQueue, create a LoadQueue instance. If you want to force tag loading where possible, set the preferXHR argument to fa...
[ "constructor", "The", "LoadQueue", "class", "is", "the", "main", "API", "for", "preloading", "content", ".", "LoadQueue", "is", "a", "load", "manager", "which", "can", "preload", "either", "a", "single", "file", "or", "queue", "of", "files", "." ]
eab00cf50fe2f6993c75e04ad7f7e5e9c9e9f083
https://github.com/CreateJS/PreloadJS/blob/eab00cf50fe2f6993c75e04ad7f7e5e9c9e9f083/lib/preloadjs.js#L4542-L4677
6,512
CreateJS/PreloadJS
lib/preloadjs.js
BinaryLoader
function BinaryLoader(loadItem) { this.AbstractLoader_constructor(loadItem, true, createjs.Types.BINARY); this.on("initialize", this._updateXHR, this); }
javascript
function BinaryLoader(loadItem) { this.AbstractLoader_constructor(loadItem, true, createjs.Types.BINARY); this.on("initialize", this._updateXHR, this); }
[ "function", "BinaryLoader", "(", "loadItem", ")", "{", "this", ".", "AbstractLoader_constructor", "(", "loadItem", ",", "true", ",", "createjs", ".", "Types", ".", "BINARY", ")", ";", "this", ".", "on", "(", "\"initialize\"", ",", "this", ".", "_updateXHR", ...
constructor A loader for binary files. This is useful for loading web audio, or content that requires an ArrayBuffer. @class BinaryLoader @param {LoadItem|Object} loadItem @extends AbstractLoader @constructor
[ "constructor", "A", "loader", "for", "binary", "files", ".", "This", "is", "useful", "for", "loading", "web", "audio", "or", "content", "that", "requires", "an", "ArrayBuffer", "." ]
eab00cf50fe2f6993c75e04ad7f7e5e9c9e9f083
https://github.com/CreateJS/PreloadJS/blob/eab00cf50fe2f6993c75e04ad7f7e5e9c9e9f083/lib/preloadjs.js#L6129-L6132
6,513
sockjs/sockjs-client
lib/utils/escape.js
function(escapable) { var i; var unrolled = {}; var c = []; for (i = 0; i < 65536; i++) { c.push( String.fromCharCode(i) ); } escapable.lastIndex = 0; c.join('').replace(escapable, function(a) { unrolled[ a ] = '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); return ''; }); escap...
javascript
function(escapable) { var i; var unrolled = {}; var c = []; for (i = 0; i < 65536; i++) { c.push( String.fromCharCode(i) ); } escapable.lastIndex = 0; c.join('').replace(escapable, function(a) { unrolled[ a ] = '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); return ''; }); escap...
[ "function", "(", "escapable", ")", "{", "var", "i", ";", "var", "unrolled", "=", "{", "}", ";", "var", "c", "=", "[", "]", ";", "for", "(", "i", "=", "0", ";", "i", "<", "65536", ";", "i", "++", ")", "{", "c", ".", "push", "(", "String", ...
This may be quite slow, so let's delay until user actually uses bad characters.
[ "This", "may", "be", "quite", "slow", "so", "let", "s", "delay", "until", "user", "actually", "uses", "bad", "characters", "." ]
477e30d4d1ba61d9d995c991aef89627c1c14aed
https://github.com/sockjs/sockjs-client/blob/477e30d4d1ba61d9d995c991aef89627c1c14aed/lib/utils/escape.js#L13-L27
6,514
glidejs/glide
dist/glide.esm.js
mount
function mount(glide, extensions, events) { var components = {}; for (var name in extensions) { if (isFunction(extensions[name])) { components[name] = extensions[name](glide, components, events); } else { warn('Extension must be a function'); } } for (var _name in components) { if ...
javascript
function mount(glide, extensions, events) { var components = {}; for (var name in extensions) { if (isFunction(extensions[name])) { components[name] = extensions[name](glide, components, events); } else { warn('Extension must be a function'); } } for (var _name in components) { if ...
[ "function", "mount", "(", "glide", ",", "extensions", ",", "events", ")", "{", "var", "components", "=", "{", "}", ";", "for", "(", "var", "name", "in", "extensions", ")", "{", "if", "(", "isFunction", "(", "extensions", "[", "name", "]", ")", ")", ...
Creates and initializes specified collection of extensions. Each extension receives access to instance of glide and rest of components. @param {Object} glide @param {Object} extensions @returns {Object}
[ "Creates", "and", "initializes", "specified", "collection", "of", "extensions", ".", "Each", "extension", "receives", "access", "to", "instance", "of", "glide", "and", "rest", "of", "components", "." ]
593ad78d0f85bd7bcb6ac6ef487c607718605a89
https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L408-L426
6,515
glidejs/glide
dist/glide.esm.js
sortKeys
function sortKeys(obj) { return Object.keys(obj).sort().reduce(function (r, k) { r[k] = obj[k]; return r[k], r; }, {}); }
javascript
function sortKeys(obj) { return Object.keys(obj).sort().reduce(function (r, k) { r[k] = obj[k]; return r[k], r; }, {}); }
[ "function", "sortKeys", "(", "obj", ")", "{", "return", "Object", ".", "keys", "(", "obj", ")", ".", "sort", "(", ")", ".", "reduce", "(", "function", "(", "r", ",", "k", ")", "{", "r", "[", "k", "]", "=", "obj", "[", "k", "]", ";", "return",...
Sorts aphabetically object keys. @param {Object} obj @return {Object}
[ "Sorts", "aphabetically", "object", "keys", "." ]
593ad78d0f85bd7bcb6ac6ef487c607718605a89
https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L446-L452
6,516
glidejs/glide
dist/glide.esm.js
mergeOptions
function mergeOptions(defaults, settings) { var options = _extends({}, defaults, settings); // `Object.assign` do not deeply merge objects, so we // have to do it manually for every nested object // in options. Although it does not look smart, // it's smaller and faster than some fancy // merging deep-merg...
javascript
function mergeOptions(defaults, settings) { var options = _extends({}, defaults, settings); // `Object.assign` do not deeply merge objects, so we // have to do it manually for every nested object // in options. Although it does not look smart, // it's smaller and faster than some fancy // merging deep-merg...
[ "function", "mergeOptions", "(", "defaults", ",", "settings", ")", "{", "var", "options", "=", "_extends", "(", "{", "}", ",", "defaults", ",", "settings", ")", ";", "// `Object.assign` do not deeply merge objects, so we", "// have to do it manually for every nested objec...
Merges passed settings object with default options. @param {Object} defaults @param {Object} settings @return {Object}
[ "Merges", "passed", "settings", "object", "with", "default", "options", "." ]
593ad78d0f85bd7bcb6ac6ef487c607718605a89
https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L461-L482
6,517
glidejs/glide
dist/glide.esm.js
EventsBus
function EventsBus() { var events = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; classCallCheck(this, EventsBus); this.events = events; this.hop = events.hasOwnProperty; }
javascript
function EventsBus() { var events = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; classCallCheck(this, EventsBus); this.events = events; this.hop = events.hasOwnProperty; }
[ "function", "EventsBus", "(", ")", "{", "var", "events", "=", "arguments", ".", "length", ">", "0", "&&", "arguments", "[", "0", "]", "!==", "undefined", "?", "arguments", "[", "0", "]", ":", "{", "}", ";", "classCallCheck", "(", "this", ",", "Events...
Construct a EventBus instance. @param {Object} events
[ "Construct", "a", "EventBus", "instance", "." ]
593ad78d0f85bd7bcb6ac6ef487c607718605a89
https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L490-L496
6,518
glidejs/glide
dist/glide.esm.js
Glide
function Glide(selector) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; classCallCheck(this, Glide); this._c = {}; this._t = []; this._e = new EventsBus(); this.disabled = false; this.selector = selector; this.settings = mergeOptions(defaults, o...
javascript
function Glide(selector) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; classCallCheck(this, Glide); this._c = {}; this._t = []; this._e = new EventsBus(); this.disabled = false; this.selector = selector; this.settings = mergeOptions(defaults, o...
[ "function", "Glide", "(", "selector", ")", "{", "var", "options", "=", "arguments", ".", "length", ">", "1", "&&", "arguments", "[", "1", "]", "!==", "undefined", "?", "arguments", "[", "1", "]", ":", "{", "}", ";", "classCallCheck", "(", "this", ","...
Construct glide. @param {String} selector @param {Object} options
[ "Construct", "glide", "." ]
593ad78d0f85bd7bcb6ac6ef487c607718605a89
https://github.com/glidejs/glide/blob/593ad78d0f85bd7bcb6ac6ef487c607718605a89/dist/glide.esm.js#L568-L580
6,519
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
6,520
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
6,521
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
6,522
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
6,523
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
6,524
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
6,525
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
6,526
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
6,527
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
6,528
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
6,529
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
6,530
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
6,531
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
6,532
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
6,533
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
6,534
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
6,535
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
6,536
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
6,537
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
6,538
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
6,539
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
6,540
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
6,541
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
6,542
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
6,543
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
6,544
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
6,545
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
6,546
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
6,547
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
6,548
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
6,549
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
6,550
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
6,551
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
6,552
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
6,553
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
6,554
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
6,555
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
6,556
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
6,557
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
6,558
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
6,559
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
6,560
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
6,561
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
6,562
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
6,563
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
6,564
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
6,565
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
6,566
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
6,567
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
6,568
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
6,569
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
6,570
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
6,571
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
6,572
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
6,573
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
6,574
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
6,575
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
6,576
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
6,577
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
6,578
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
6,579
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
6,580
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
6,581
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
6,582
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
6,583
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
6,584
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
6,585
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
6,586
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
6,587
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
6,588
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
6,589
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
6,590
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
6,591
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
6,592
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
6,593
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
6,594
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
6,595
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
6,596
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
6,597
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
6,598
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
6,599
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