repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
partition
stringclasses
1 value
jaredhanson/electrolyte
lib/patterns/constructor.js
ConstructorComponent
function ConstructorComponent(id, ctor, hs) { Component.call(this, id, ctor, hs); this._ctor = ctor; }
javascript
function ConstructorComponent(id, ctor, hs) { Component.call(this, id, ctor, hs); this._ctor = ctor; }
[ "function", "ConstructorComponent", "(", "id", ",", "ctor", ",", "hs", ")", "{", "Component", ".", "call", "(", "this", ",", "id", ",", "ctor", ",", "hs", ")", ";", "this", ".", "_ctor", "=", "ctor", ";", "}" ]
A component created using a constructor. Objects will be created by applying the `new` operator to the constructor with any required dependencies and returning the result. @constructor @param {string} id - The id of the component. @param {object} mod - The module containing the object constructor. @param {number} asm...
[ "A", "component", "created", "using", "a", "constructor", "." ]
3ab5c374095eaa68366386b5734b9397aa4f8c69
https://github.com/jaredhanson/electrolyte/blob/3ab5c374095eaa68366386b5734b9397aa4f8c69/lib/patterns/constructor.js#L19-L22
train
jaredhanson/electrolyte
lib/component.js
Component
function Component(id, mod, asm) { var keys, i, len; this.id = id; this.dependencies = mod['@require'] || []; this.singleton = mod['@singleton']; this.implements = mod['@implements'] || []; if (typeof this.implements == 'string') { this.implements = [ this.implements ] } this.a = {}; if (typ...
javascript
function Component(id, mod, asm) { var keys, i, len; this.id = id; this.dependencies = mod['@require'] || []; this.singleton = mod['@singleton']; this.implements = mod['@implements'] || []; if (typeof this.implements == 'string') { this.implements = [ this.implements ] } this.a = {}; if (typ...
[ "function", "Component", "(", "id", ",", "mod", ",", "asm", ")", "{", "var", "keys", ",", "i", ",", "len", ";", "this", ".", "id", "=", "id", ";", "this", ".", "dependencies", "=", "mod", "[", "'@require'", "]", "||", "[", "]", ";", "this", "."...
A specification of an object. A specification defines how an object is created. The specification includes a "factory" which is used to create objects. A factory is typically a function which returns the object or a constructor that is invoked with the `new` operator. A specification also declares any objects requi...
[ "A", "specification", "of", "an", "object", "." ]
3ab5c374095eaa68366386b5734b9397aa4f8c69
https://github.com/jaredhanson/electrolyte/blob/3ab5c374095eaa68366386b5734b9397aa4f8c69/lib/component.js#L36-L57
train
gulpjs/vinyl-fs
lib/dest/write-contents/index.js
onWritten
function onWritten(writeErr) { var flags = fo.getFlags({ overwrite: optResolver.resolve('overwrite', file), append: optResolver.resolve('append', file), }); if (fo.isFatalOverwriteError(writeErr, flags)) { return callback(writeErr); } callback(null, file); }
javascript
function onWritten(writeErr) { var flags = fo.getFlags({ overwrite: optResolver.resolve('overwrite', file), append: optResolver.resolve('append', file), }); if (fo.isFatalOverwriteError(writeErr, flags)) { return callback(writeErr); } callback(null, file); }
[ "function", "onWritten", "(", "writeErr", ")", "{", "var", "flags", "=", "fo", ".", "getFlags", "(", "{", "overwrite", ":", "optResolver", ".", "resolve", "(", "'overwrite'", ",", "file", ")", ",", "append", ":", "optResolver", ".", "resolve", "(", "'app...
This is invoked by the various writeXxx modules when they've finished writing the contents.
[ "This", "is", "invoked", "by", "the", "various", "writeXxx", "modules", "when", "they", "ve", "finished", "writing", "the", "contents", "." ]
5a5234694627276eae80d228e3b0d29e11376a89
https://github.com/gulpjs/vinyl-fs/blob/5a5234694627276eae80d228e3b0d29e11376a89/lib/dest/write-contents/index.js#L42-L52
train
sroze/ngInfiniteScroll
src/infinite-scroll.js
defaultHandler
function defaultHandler() { let containerBottom; let elementBottom; if (container === windowElement) { containerBottom = height(container) + pageYOffset(container[0].document.documentElement); elementBottom = offsetTop(elem) + height(elem); } else { containe...
javascript
function defaultHandler() { let containerBottom; let elementBottom; if (container === windowElement) { containerBottom = height(container) + pageYOffset(container[0].document.documentElement); elementBottom = offsetTop(elem) + height(elem); } else { containe...
[ "function", "defaultHandler", "(", ")", "{", "let", "containerBottom", ";", "let", "elementBottom", ";", "if", "(", "container", "===", "windowElement", ")", "{", "containerBottom", "=", "height", "(", "container", ")", "+", "pageYOffset", "(", "container", "[...
infinite-scroll specifies a function to call when the window, or some other container specified by infinite-scroll-container, is scrolled within a certain range from the bottom of the document. It is recommended to use infinite-scroll-disabled with a boolean that is set to true when the function is called in order to t...
[ "infinite", "-", "scroll", "specifies", "a", "function", "to", "call", "when", "the", "window", "or", "some", "other", "container", "specified", "by", "infinite", "-", "scroll", "-", "container", "is", "scrolled", "within", "a", "certain", "range", "from", "...
5035fd2d563eb09447bc500e5b754b21fbd3b92c
https://github.com/sroze/ngInfiniteScroll/blob/5035fd2d563eb09447bc500e5b754b21fbd3b92c/src/infinite-scroll.js#L63-L99
train
sroze/ngInfiniteScroll
src/infinite-scroll.js
throttle
function throttle(func, wait) { let timeout = null; let previous = 0; function later() { previous = new Date().getTime(); $interval.cancel(timeout); timeout = null; return func.call(); } function throttled() { const now = new Da...
javascript
function throttle(func, wait) { let timeout = null; let previous = 0; function later() { previous = new Date().getTime(); $interval.cancel(timeout); timeout = null; return func.call(); } function throttled() { const now = new Da...
[ "function", "throttle", "(", "func", ",", "wait", ")", "{", "let", "timeout", "=", "null", ";", "let", "previous", "=", "0", ";", "function", "later", "(", ")", "{", "previous", "=", "new", "Date", "(", ")", ".", "getTime", "(", ")", ";", "$interva...
The optional THROTTLE_MILLISECONDS configuration value specifies a minimum time that should elapse between each call to the handler. N.b. the first call the handler will be run immediately, and the final call will always result in the handler being called after the `wait` period elapses. A slimmed down version of under...
[ "The", "optional", "THROTTLE_MILLISECONDS", "configuration", "value", "specifies", "a", "minimum", "time", "that", "should", "elapse", "between", "each", "call", "to", "the", "handler", ".", "N", ".", "b", ".", "the", "first", "call", "the", "handler", "will",...
5035fd2d563eb09447bc500e5b754b21fbd3b92c
https://github.com/sroze/ngInfiniteScroll/blob/5035fd2d563eb09447bc500e5b754b21fbd3b92c/src/infinite-scroll.js#L107-L132
train
sroze/ngInfiniteScroll
src/infinite-scroll.js
changeContainer
function changeContainer(newContainer) { if (container != null) { container.unbind('scroll', handler); } container = newContainer; if (newContainer != null) { container.bind('scroll', handler); } }
javascript
function changeContainer(newContainer) { if (container != null) { container.unbind('scroll', handler); } container = newContainer; if (newContainer != null) { container.bind('scroll', handler); } }
[ "function", "changeContainer", "(", "newContainer", ")", "{", "if", "(", "container", "!=", "null", ")", "{", "container", ".", "unbind", "(", "'scroll'", ",", "handler", ")", ";", "}", "container", "=", "newContainer", ";", "if", "(", "newContainer", "!="...
infinite-scroll-container sets the container which we want to be infinte scrolled, instead of the whole window. Must be an Angular or jQuery element, or, if jQuery is loaded, a jQuery selector as a string.
[ "infinite", "-", "scroll", "-", "container", "sets", "the", "container", "which", "we", "want", "to", "be", "infinte", "scrolled", "instead", "of", "the", "whole", "window", ".", "Must", "be", "an", "Angular", "or", "jQuery", "element", "or", "if", "jQuery...
5035fd2d563eb09447bc500e5b754b21fbd3b92c
https://github.com/sroze/ngInfiniteScroll/blob/5035fd2d563eb09447bc500e5b754b21fbd3b92c/src/infinite-scroll.js#L196-L205
train
networked-aframe/networked-aframe
src/components/networked-scene.js
function () { NAF.log.setDebug(this.data.debug); NAF.log.write('Networked-Aframe Connecting...'); this.checkDeprecatedProperties(); this.setupNetworkAdapter(); if (this.hasOnConnectFunction()) { this.callOnConnect(); } return NAF.connection.connect(this.data.serverURL, this.data.app,...
javascript
function () { NAF.log.setDebug(this.data.debug); NAF.log.write('Networked-Aframe Connecting...'); this.checkDeprecatedProperties(); this.setupNetworkAdapter(); if (this.hasOnConnectFunction()) { this.callOnConnect(); } return NAF.connection.connect(this.data.serverURL, this.data.app,...
[ "function", "(", ")", "{", "NAF", ".", "log", ".", "setDebug", "(", "this", ".", "data", ".", "debug", ")", ";", "NAF", ".", "log", ".", "write", "(", "'Networked-Aframe Connecting...'", ")", ";", "this", ".", "checkDeprecatedProperties", "(", ")", ";", ...
Connect to signalling server and begin connecting to other clients
[ "Connect", "to", "signalling", "server", "and", "begin", "connecting", "to", "other", "clients" ]
b0ece8ba80479fa6912969fa03bc4cf3f30c4026
https://github.com/networked-aframe/networked-aframe/blob/b0ece8ba80479fa6912969fa03bc4cf3f30c4026/src/components/networked-scene.js#L27-L38
train
numbers/numbers.js
lib/numbers/calculus.js
SimpsonDef
function SimpsonDef(func, a, b) { var c = (a + b) / 2; var d = Math.abs(b - a) / 6; return d * (func(a) + 4 * func(c) + func(b)); }
javascript
function SimpsonDef(func, a, b) { var c = (a + b) / 2; var d = Math.abs(b - a) / 6; return d * (func(a) + 4 * func(c) + func(b)); }
[ "function", "SimpsonDef", "(", "func", ",", "a", ",", "b", ")", "{", "var", "c", "=", "(", "a", "+", "b", ")", "/", "2", ";", "var", "d", "=", "Math", ".", "abs", "(", "b", "-", "a", ")", "/", "6", ";", "return", "d", "*", "(", "func", ...
Helper function in calculating integral of a function from a to b using simpson quadrature. @param {Function} math function to be evaluated. @param {Number} point to initiate evaluation. @param {Number} point to complete evaluation. @return {Number} evaluation.
[ "Helper", "function", "in", "calculating", "integral", "of", "a", "function", "from", "a", "to", "b", "using", "simpson", "quadrature", "." ]
ca3076a7bfc670a5c45bb18ade9c3a868363bcc3
https://github.com/numbers/numbers.js/blob/ca3076a7bfc670a5c45bb18ade9c3a868363bcc3/lib/numbers/calculus.js#L79-L83
train
numbers/numbers.js
lib/numbers/calculus.js
SimpsonRecursive
function SimpsonRecursive(func, a, b, whole, eps) { var c = a + b; var left = SimpsonDef(func, a, c); var right = SimpsonDef(func, c, b); if (Math.abs(left + right - whole) <= 15 * eps) { return left + right + (left + right - whole) / 15; } else { return SimpsonRecursive(func, a, c, eps / 2, left) + ...
javascript
function SimpsonRecursive(func, a, b, whole, eps) { var c = a + b; var left = SimpsonDef(func, a, c); var right = SimpsonDef(func, c, b); if (Math.abs(left + right - whole) <= 15 * eps) { return left + right + (left + right - whole) / 15; } else { return SimpsonRecursive(func, a, c, eps / 2, left) + ...
[ "function", "SimpsonRecursive", "(", "func", ",", "a", ",", "b", ",", "whole", ",", "eps", ")", "{", "var", "c", "=", "a", "+", "b", ";", "var", "left", "=", "SimpsonDef", "(", "func", ",", "a", ",", "c", ")", ";", "var", "right", "=", "Simpson...
Helper function in calculating integral of a function from a to b using simpson quadrature. Manages recursive investigation, handling evaluations within an error bound. @param {Function} math function to be evaluated. @param {Number} point to initiate evaluation. @param {Number} point to complete evaluation. @param {...
[ "Helper", "function", "in", "calculating", "integral", "of", "a", "function", "from", "a", "to", "b", "using", "simpson", "quadrature", ".", "Manages", "recursive", "investigation", "handling", "evaluations", "within", "an", "error", "bound", "." ]
ca3076a7bfc670a5c45bb18ade9c3a868363bcc3
https://github.com/numbers/numbers.js/blob/ca3076a7bfc670a5c45bb18ade9c3a868363bcc3/lib/numbers/calculus.js#L97-L107
train
numbers/numbers.js
lib/numbers/matrix.js
function (M) { //starting at bottom right, moving horizontally var jump = false, tl = n * n, br = 1, inc = 1, row, col, val, i, j; M[0][0] = tl; M[n - 1][n - 1] = br; for (i = 1; i < n; i++) { //generate top/bottom row if (jump) { tl -= 4 * inc; br +=...
javascript
function (M) { //starting at bottom right, moving horizontally var jump = false, tl = n * n, br = 1, inc = 1, row, col, val, i, j; M[0][0] = tl; M[n - 1][n - 1] = br; for (i = 1; i < n; i++) { //generate top/bottom row if (jump) { tl -= 4 * inc; br +=...
[ "function", "(", "M", ")", "{", "//starting at bottom right, moving horizontally", "var", "jump", "=", "false", ",", "tl", "=", "n", "*", "n", ",", "br", "=", "1", ",", "inc", "=", "1", ",", "row", ",", "col", ",", "val", ",", "i", ",", "j", ";", ...
create one kind of permutation - all other permutations can be created from this particular permutation through transformations
[ "create", "one", "kind", "of", "permutation", "-", "all", "other", "permutations", "can", "be", "created", "from", "this", "particular", "permutation", "through", "transformations" ]
ca3076a7bfc670a5c45bb18ade9c3a868363bcc3
https://github.com/numbers/numbers.js/blob/ca3076a7bfc670a5c45bb18ade9c3a868363bcc3/lib/numbers/matrix.js#L821-L890
train
jkphl/gulp-svg-sprite
index.js
gulpSVGSprite
function gulpSVGSprite(config) { // Extend plugin error function extendError(pError, error) { if (error && (typeof error === 'object')) { ['name', 'errno'].forEach(function(property) { if (property in error) { this[property] = error[property]; } }, pError); } return pError; } // Instanci...
javascript
function gulpSVGSprite(config) { // Extend plugin error function extendError(pError, error) { if (error && (typeof error === 'object')) { ['name', 'errno'].forEach(function(property) { if (property in error) { this[property] = error[property]; } }, pError); } return pError; } // Instanci...
[ "function", "gulpSVGSprite", "(", "config", ")", "{", "// Extend plugin error", "function", "extendError", "(", "pError", ",", "error", ")", "{", "if", "(", "error", "&&", "(", "typeof", "error", "===", "'object'", ")", ")", "{", "[", "'name'", ",", "'errn...
Plugin level function @param {Object} config SVGSpriter main configuration
[ "Plugin", "level", "function" ]
babc7efe1c3c0538cc31b349b44b8b4b5041952c
https://github.com/jkphl/gulp-svg-sprite/blob/babc7efe1c3c0538cc31b349b44b8b4b5041952c/index.js#L24-L73
train
jkphl/gulp-svg-sprite
index.js
extendError
function extendError(pError, error) { if (error && (typeof error === 'object')) { ['name', 'errno'].forEach(function(property) { if (property in error) { this[property] = error[property]; } }, pError); } return pError; }
javascript
function extendError(pError, error) { if (error && (typeof error === 'object')) { ['name', 'errno'].forEach(function(property) { if (property in error) { this[property] = error[property]; } }, pError); } return pError; }
[ "function", "extendError", "(", "pError", ",", "error", ")", "{", "if", "(", "error", "&&", "(", "typeof", "error", "===", "'object'", ")", ")", "{", "[", "'name'", ",", "'errno'", "]", ".", "forEach", "(", "function", "(", "property", ")", "{", "if"...
Extend plugin error
[ "Extend", "plugin", "error" ]
babc7efe1c3c0538cc31b349b44b8b4b5041952c
https://github.com/jkphl/gulp-svg-sprite/blob/babc7efe1c3c0538cc31b349b44b8b4b5041952c/index.js#L27-L37
train
expressjs/errorhandler
index.js
stringify
function stringify (val) { var stack = val.stack if (stack) { return String(stack) } var str = String(val) return str === toString.call(val) ? inspect(val) : str }
javascript
function stringify (val) { var stack = val.stack if (stack) { return String(stack) } var str = String(val) return str === toString.call(val) ? inspect(val) : str }
[ "function", "stringify", "(", "val", ")", "{", "var", "stack", "=", "val", ".", "stack", "if", "(", "stack", ")", "{", "return", "String", "(", "stack", ")", "}", "var", "str", "=", "String", "(", "val", ")", "return", "str", "===", "toString", "."...
Stringify a value. @api private
[ "Stringify", "a", "value", "." ]
2dbd778764ab2fd9e9a85bbbf4267984ed803c44
https://github.com/expressjs/errorhandler/blob/2dbd778764ab2fd9e9a85bbbf4267984ed803c44/index.js#L177-L189
train
mfranzke/datalist-polyfill
datalist-polyfill.js
function(event) { var input = event.target, datalist = input.list, keyOpen = event.keyCode === keyUP || event.keyCode === keyDOWN; // Check for whether the events target was an input and still check for an existing instance of the datalist and polyfilling select if (input.tagName.toLowerCase() !== 'input' ...
javascript
function(event) { var input = event.target, datalist = input.list, keyOpen = event.keyCode === keyUP || event.keyCode === keyDOWN; // Check for whether the events target was an input and still check for an existing instance of the datalist and polyfilling select if (input.tagName.toLowerCase() !== 'input' ...
[ "function", "(", "event", ")", "{", "var", "input", "=", "event", ".", "target", ",", "datalist", "=", "input", ".", "list", ",", "keyOpen", "=", "event", ".", "keyCode", "===", "keyUP", "||", "event", ".", "keyCode", "===", "keyDOWN", ";", "// Check f...
Function regarding the inputs interactions on keyup event
[ "Function", "regarding", "the", "inputs", "interactions", "on", "keyup", "event" ]
491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8
https://github.com/mfranzke/datalist-polyfill/blob/491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8/datalist-polyfill.js#L103-L168
train
mfranzke/datalist-polyfill
datalist-polyfill.js
function(event) { var input = event.target, datalist = input.list; if ( !input.matches('input[list]') || !input.matches('.' + classNameInput) || !datalist ) { return; } // Query for related option - and escaping the value as doublequotes wouldn't work var option = datalist.querySelector( ...
javascript
function(event) { var input = event.target, datalist = input.list; if ( !input.matches('input[list]') || !input.matches('.' + classNameInput) || !datalist ) { return; } // Query for related option - and escaping the value as doublequotes wouldn't work var option = datalist.querySelector( ...
[ "function", "(", "event", ")", "{", "var", "input", "=", "event", ".", "target", ",", "datalist", "=", "input", ".", "list", ";", "if", "(", "!", "input", ".", "matches", "(", "'input[list]'", ")", "||", "!", "input", ".", "matches", "(", "'.'", "+...
Check for the input and probably replace by correct options elements value
[ "Check", "for", "the", "input", "and", "probably", "replace", "by", "correct", "options", "elements", "value" ]
491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8
https://github.com/mfranzke/datalist-polyfill/blob/491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8/datalist-polyfill.js#L205-L228
train
mfranzke/datalist-polyfill
datalist-polyfill.js
function(option, inputValue) { var optVal = option.value.toLowerCase(), inptVal = inputValue.toLowerCase(), label = option.getAttribute('label'), text = option.text.toLowerCase(); /* "Each option element that is a descendant of the datalist element, that is not disabled, and whose value is a string that...
javascript
function(option, inputValue) { var optVal = option.value.toLowerCase(), inptVal = inputValue.toLowerCase(), label = option.getAttribute('label'), text = option.text.toLowerCase(); /* "Each option element that is a descendant of the datalist element, that is not disabled, and whose value is a string that...
[ "function", "(", "option", ",", "inputValue", ")", "{", "var", "optVal", "=", "option", ".", "value", ".", "toLowerCase", "(", ")", ",", "inptVal", "=", "inputValue", ".", "toLowerCase", "(", ")", ",", "label", "=", "option", ".", "getAttribute", "(", ...
Check for whether this is a valid suggestion
[ "Check", "for", "whether", "this", "is", "a", "valid", "suggestion" ]
491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8
https://github.com/mfranzke/datalist-polyfill/blob/491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8/datalist-polyfill.js#L231-L247
train
mfranzke/datalist-polyfill
datalist-polyfill.js
function(event) { // Check for correct element on this event delegation if (!event.target.matches('input[list]')) { return; } var input = event.target, datalist = input.list; // Check for whether the events target was an input and still check for an existing instance of the datalist if (input.tagNam...
javascript
function(event) { // Check for correct element on this event delegation if (!event.target.matches('input[list]')) { return; } var input = event.target, datalist = input.list; // Check for whether the events target was an input and still check for an existing instance of the datalist if (input.tagNam...
[ "function", "(", "event", ")", "{", "// Check for correct element on this event delegation", "if", "(", "!", "event", ".", "target", ".", "matches", "(", "'input[list]'", ")", ")", "{", "return", ";", "}", "var", "input", "=", "event", ".", "target", ",", "d...
Focusin and -out events
[ "Focusin", "and", "-", "out", "events" ]
491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8
https://github.com/mfranzke/datalist-polyfill/blob/491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8/datalist-polyfill.js#L250-L295
train
mfranzke/datalist-polyfill
datalist-polyfill.js
function(input, eventType) { // We'd like to prevent autocomplete on the input datalist field input.setAttribute('autocomplete', 'off'); // WAI ARIA attributes input.setAttribute('role', 'textbox'); input.setAttribute('aria-haspopup', 'true'); input.setAttribute('aria-autocomplete', 'list'); input.setAtt...
javascript
function(input, eventType) { // We'd like to prevent autocomplete on the input datalist field input.setAttribute('autocomplete', 'off'); // WAI ARIA attributes input.setAttribute('role', 'textbox'); input.setAttribute('aria-haspopup', 'true'); input.setAttribute('aria-autocomplete', 'list'); input.setAtt...
[ "function", "(", "input", ",", "eventType", ")", "{", "// We'd like to prevent autocomplete on the input datalist field", "input", ".", "setAttribute", "(", "'autocomplete'", ",", "'off'", ")", ";", "// WAI ARIA attributes", "input", ".", "setAttribute", "(", "'role'", ...
Prepare the input
[ "Prepare", "the", "input" ]
491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8
https://github.com/mfranzke/datalist-polyfill/blob/491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8/datalist-polyfill.js#L298-L331
train
mfranzke/datalist-polyfill
datalist-polyfill.js
function(input) { // In case of type=email and multiple attribute, we would need to grab the last piece // Using .getAttribute here for IE9 purpose - elsewhere it wouldn't return the newer HTML5 values correctly return input.getAttribute('type') === 'email' && input.getAttribute('multiple') !== null ? input...
javascript
function(input) { // In case of type=email and multiple attribute, we would need to grab the last piece // Using .getAttribute here for IE9 purpose - elsewhere it wouldn't return the newer HTML5 values correctly return input.getAttribute('type') === 'email' && input.getAttribute('multiple') !== null ? input...
[ "function", "(", "input", ")", "{", "// In case of type=email and multiple attribute, we would need to grab the last piece", "// Using .getAttribute here for IE9 purpose - elsewhere it wouldn't return the newer HTML5 values correctly", "return", "input", ".", "getAttribute", "(", "'type'", ...
Get the input value for dividing regular and mail types
[ "Get", "the", "input", "value", "for", "dividing", "regular", "and", "mail", "types" ]
491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8
https://github.com/mfranzke/datalist-polyfill/blob/491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8/datalist-polyfill.js#L334-L341
train
mfranzke/datalist-polyfill
datalist-polyfill.js
function(input, datalistSelectValue) { var lastSeperator; // In case of type=email and multiple attribute, we need to set up the resulting inputs value differently input.value = // Using .getAttribute here for IE9 purpose - elsewhere it wouldn't return the newer HTML5 values correctly input.getAttribute('t...
javascript
function(input, datalistSelectValue) { var lastSeperator; // In case of type=email and multiple attribute, we need to set up the resulting inputs value differently input.value = // Using .getAttribute here for IE9 purpose - elsewhere it wouldn't return the newer HTML5 values correctly input.getAttribute('t...
[ "function", "(", "input", ",", "datalistSelectValue", ")", "{", "var", "lastSeperator", ";", "// In case of type=email and multiple attribute, we need to set up the resulting inputs value differently", "input", ".", "value", "=", "// Using .getAttribute here for IE9 purpose - elsewhere...
Set the input value for dividing regular and mail types
[ "Set", "the", "input", "value", "for", "dividing", "regular", "and", "mail", "types" ]
491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8
https://github.com/mfranzke/datalist-polyfill/blob/491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8/datalist-polyfill.js#L344-L355
train
mfranzke/datalist-polyfill
datalist-polyfill.js
function(input, datalist) { // Check for whether it's of one of the supported input types defined at the beginning // Using .getAttribute here for IE9 purpose - elsewhere it wouldn't return the newer HTML5 values correctly // and still check for an existing instance if ( (input.getAttribute('type') && su...
javascript
function(input, datalist) { // Check for whether it's of one of the supported input types defined at the beginning // Using .getAttribute here for IE9 purpose - elsewhere it wouldn't return the newer HTML5 values correctly // and still check for an existing instance if ( (input.getAttribute('type') && su...
[ "function", "(", "input", ",", "datalist", ")", "{", "// Check for whether it's of one of the supported input types defined at the beginning", "// Using .getAttribute here for IE9 purpose - elsewhere it wouldn't return the newer HTML5 values correctly", "// and still check for an existing instance...
Define function for setting up the polyfilling select
[ "Define", "function", "for", "setting", "up", "the", "polyfilling", "select" ]
491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8
https://github.com/mfranzke/datalist-polyfill/blob/491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8/datalist-polyfill.js#L453-L543
train
mfranzke/datalist-polyfill
datalist-polyfill.js
function(event) { var datalistSelect = event.target, datalist = datalistSelect.parentNode, input = dcmnt.querySelector('input[list="' + datalist.id + '"]'); // Check for whether the events target was a select or whether the input doesn't exist if (datalistSelect.tagName.toLowerCase() !== 'select' || input ...
javascript
function(event) { var datalistSelect = event.target, datalist = datalistSelect.parentNode, input = dcmnt.querySelector('input[list="' + datalist.id + '"]'); // Check for whether the events target was a select or whether the input doesn't exist if (datalistSelect.tagName.toLowerCase() !== 'select' || input ...
[ "function", "(", "event", ")", "{", "var", "datalistSelect", "=", "event", ".", "target", ",", "datalist", "=", "datalistSelect", ".", "parentNode", ",", "input", "=", "dcmnt", ".", "querySelector", "(", "'input[list=\"'", "+", "datalist", ".", "id", "+", ...
Functions regarding changes to the datalist polyfilling created selects keypress
[ "Functions", "regarding", "changes", "to", "the", "datalist", "polyfilling", "created", "selects", "keypress" ]
491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8
https://github.com/mfranzke/datalist-polyfill/blob/491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8/datalist-polyfill.js#L546-L571
train
mfranzke/datalist-polyfill
datalist-polyfill.js
function(event) { var datalistSelect = event.currentTarget, datalist = datalistSelect.parentNode, input = dcmnt.querySelector('input[list="' + datalist.id + '"]'); // Check for whether the events target was a select or whether the input doesn't exist if (datalistSelect.tagName.toLowerCase() !== 'select' ||...
javascript
function(event) { var datalistSelect = event.currentTarget, datalist = datalistSelect.parentNode, input = dcmnt.querySelector('input[list="' + datalist.id + '"]'); // Check for whether the events target was a select or whether the input doesn't exist if (datalistSelect.tagName.toLowerCase() !== 'select' ||...
[ "function", "(", "event", ")", "{", "var", "datalistSelect", "=", "event", ".", "currentTarget", ",", "datalist", "=", "datalistSelect", ".", "parentNode", ",", "input", "=", "dcmnt", ".", "querySelector", "(", "'input[list=\"'", "+", "datalist", ".", "id", ...
Change, Click, Blur, Keydown
[ "Change", "Click", "Blur", "Keydown" ]
491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8
https://github.com/mfranzke/datalist-polyfill/blob/491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8/datalist-polyfill.js#L574-L623
train
mfranzke/datalist-polyfill
datalist-polyfill.js
function(input) { var evt; if (typeof Event === 'function') { evt = new Event('input', { bubbles: true }); } else { evt = dcmnt.createEvent('Event'); evt.initEvent('input', true, false); } input.dispatchEvent(evt); }
javascript
function(input) { var evt; if (typeof Event === 'function') { evt = new Event('input', { bubbles: true }); } else { evt = dcmnt.createEvent('Event'); evt.initEvent('input', true, false); } input.dispatchEvent(evt); }
[ "function", "(", "input", ")", "{", "var", "evt", ";", "if", "(", "typeof", "Event", "===", "'function'", ")", "{", "evt", "=", "new", "Event", "(", "'input'", ",", "{", "bubbles", ":", "true", "}", ")", ";", "}", "else", "{", "evt", "=", "dcmnt"...
Create and dispatch the input event; divided for IE9 usage
[ "Create", "and", "dispatch", "the", "input", "event", ";", "divided", "for", "IE9", "usage" ]
491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8
https://github.com/mfranzke/datalist-polyfill/blob/491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8/datalist-polyfill.js#L626-L639
train
mfranzke/datalist-polyfill
datalist-polyfill.js
function(visible, datalistSelect) { if (visible) { datalistSelect.removeAttribute('hidden'); } else { datalistSelect.setAttributeNode(dcmnt.createAttribute('hidden')); } datalistSelect.setAttribute('aria-hidden', (!visible).toString()); }
javascript
function(visible, datalistSelect) { if (visible) { datalistSelect.removeAttribute('hidden'); } else { datalistSelect.setAttributeNode(dcmnt.createAttribute('hidden')); } datalistSelect.setAttribute('aria-hidden', (!visible).toString()); }
[ "function", "(", "visible", ",", "datalistSelect", ")", "{", "if", "(", "visible", ")", "{", "datalistSelect", ".", "removeAttribute", "(", "'hidden'", ")", ";", "}", "else", "{", "datalistSelect", ".", "setAttributeNode", "(", "dcmnt", ".", "createAttribute",...
Toggle the visibility of the datalist select
[ "Toggle", "the", "visibility", "of", "the", "datalist", "select" ]
491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8
https://github.com/mfranzke/datalist-polyfill/blob/491b1bc93c2a3f4b51e37f96cbf3440311cbcbb8/datalist-polyfill.js#L642-L650
train
mddub/minimed-connect-to-nightscout
filter.js
makeRecencyFilter
function makeRecencyFilter(timeFn) { var lastTime = 0; return function(items) { var out = []; items.forEach(function(item) { if (timeFn(item) > lastTime) { out.push(item); } }); out.forEach(function(item) { lastTime = Math.max(lastTime, timeFn(item)); }); return o...
javascript
function makeRecencyFilter(timeFn) { var lastTime = 0; return function(items) { var out = []; items.forEach(function(item) { if (timeFn(item) > lastTime) { out.push(item); } }); out.forEach(function(item) { lastTime = Math.max(lastTime, timeFn(item)); }); return o...
[ "function", "makeRecencyFilter", "(", "timeFn", ")", "{", "var", "lastTime", "=", "0", ";", "return", "function", "(", "items", ")", "{", "var", "out", "=", "[", "]", ";", "items", ".", "forEach", "(", "function", "(", "item", ")", "{", "if", "(", ...
Returns a stateful filter which remembers the time of the last-seen entry to prevent uploading duplicates.
[ "Returns", "a", "stateful", "filter", "which", "remembers", "the", "time", "of", "the", "last", "-", "seen", "entry", "to", "prevent", "uploading", "duplicates", "." ]
83f8d4684ac781c87d9f673af2165c70ef7082d5
https://github.com/mddub/minimed-connect-to-nightscout/blob/83f8d4684ac781c87d9f673af2165c70ef7082d5/filter.js#L6-L22
train
willowtreeapps/wist
src/js/config/config-file.js
getBaseDir
function getBaseDir(configFilePath) { // calculates the path of the project including Wist as dependency const projectPath = path.resolve(__dirname, '../../../'); if (configFilePath && pathIsInside(configFilePath, projectPath)) { // be careful of https://github.com/substack/node-resolve/issues/78...
javascript
function getBaseDir(configFilePath) { // calculates the path of the project including Wist as dependency const projectPath = path.resolve(__dirname, '../../../'); if (configFilePath && pathIsInside(configFilePath, projectPath)) { // be careful of https://github.com/substack/node-resolve/issues/78...
[ "function", "getBaseDir", "(", "configFilePath", ")", "{", "// calculates the path of the project including Wist as dependency", "const", "projectPath", "=", "path", ".", "resolve", "(", "__dirname", ",", "'../../../'", ")", ";", "if", "(", "configFilePath", "&&", "path...
Determines the base directory for node packages referenced in a config file. This does not include node_modules in the path so it can be used for all references relative to a config file. @param {string} configFilePath The config file referencing the file. @returns {string} The base directory for the file path. @privat...
[ "Determines", "the", "base", "directory", "for", "node", "packages", "referenced", "in", "a", "config", "file", ".", "This", "does", "not", "include", "node_modules", "in", "the", "path", "so", "it", "can", "be", "used", "for", "all", "references", "relative...
c456c98f2af3fc59c53b2f8495d4f13d41eb9e0e
https://github.com/willowtreeapps/wist/blob/c456c98f2af3fc59c53b2f8495d4f13d41eb9e0e/src/js/config/config-file.js#L131-L147
train
willowtreeapps/wist
src/js/cli.js
handleInitialize
function handleInitialize(currentOptions) { const recommendedFilePath = path.resolve(__dirname, '../../config/wist-recommended.json'); let result = 0; if (currentOptions.config) { result = handleConfiguration(currentOptions.config); } else { result = handleConfiguration(recommendedFilePa...
javascript
function handleInitialize(currentOptions) { const recommendedFilePath = path.resolve(__dirname, '../../config/wist-recommended.json'); let result = 0; if (currentOptions.config) { result = handleConfiguration(currentOptions.config); } else { result = handleConfiguration(recommendedFilePa...
[ "function", "handleInitialize", "(", "currentOptions", ")", "{", "const", "recommendedFilePath", "=", "path", ".", "resolve", "(", "__dirname", ",", "'../../config/wist-recommended.json'", ")", ";", "let", "result", "=", "0", ";", "if", "(", "currentOptions", ".",...
Creates the .wistrc.json file in the default location if a configuration path is not specified. @param currentOptions Command lines arguments input by user. @returns {boolean} True if the initialization succeeds, false if not. @private
[ "Creates", "the", ".", "wistrc", ".", "json", "file", "in", "the", "default", "location", "if", "a", "configuration", "path", "is", "not", "specified", "." ]
c456c98f2af3fc59c53b2f8495d4f13d41eb9e0e
https://github.com/willowtreeapps/wist/blob/c456c98f2af3fc59c53b2f8495d4f13d41eb9e0e/src/js/cli.js#L81-L90
train
willowtreeapps/wist
src/js/cli.js
handleConfiguration
function handleConfiguration(filePath) { if (fs.existsSync(filePath)) { filePath = path.resolve(filePath); } else { console.error('Invalid path to configuration file.'); return 1; } return setupConfigurationFile(filePath); }
javascript
function handleConfiguration(filePath) { if (fs.existsSync(filePath)) { filePath = path.resolve(filePath); } else { console.error('Invalid path to configuration file.'); return 1; } return setupConfigurationFile(filePath); }
[ "function", "handleConfiguration", "(", "filePath", ")", "{", "if", "(", "fs", ".", "existsSync", "(", "filePath", ")", ")", "{", "filePath", "=", "path", ".", "resolve", "(", "filePath", ")", ";", "}", "else", "{", "console", ".", "error", "(", "'Inva...
Creates the .wistrc.json file from the user-defined configuration file. @param filePath Path to the user-defined configuration file. @returns {boolean} True if the creation of the configuration file succeeds, false if not. @private
[ "Creates", "the", ".", "wistrc", ".", "json", "file", "from", "the", "user", "-", "defined", "configuration", "file", "." ]
c456c98f2af3fc59c53b2f8495d4f13d41eb9e0e
https://github.com/willowtreeapps/wist/blob/c456c98f2af3fc59c53b2f8495d4f13d41eb9e0e/src/js/cli.js#L98-L107
train
willowtreeapps/wist
src/js/cli.js
setupConfigurationFile
function setupConfigurationFile(configFilePath) { const fileName = '.wistrc.json'; try { let contents = require(configFilePath); fs.writeFileSync(fileName, JSON.stringify(contents, null, 2)); log.info(`Initialized directory with a ${fileName}`) } catch (e) { console.error(e....
javascript
function setupConfigurationFile(configFilePath) { const fileName = '.wistrc.json'; try { let contents = require(configFilePath); fs.writeFileSync(fileName, JSON.stringify(contents, null, 2)); log.info(`Initialized directory with a ${fileName}`) } catch (e) { console.error(e....
[ "function", "setupConfigurationFile", "(", "configFilePath", ")", "{", "const", "fileName", "=", "'.wistrc.json'", ";", "try", "{", "let", "contents", "=", "require", "(", "configFilePath", ")", ";", "fs", ".", "writeFileSync", "(", "fileName", ",", "JSON", "....
Creates the .wistrc.json file from the contents of the specified file. @param configFilePath Path to the configuration file. @returns {boolean} True if the creation of the configuration file succeeds, false if not. @private
[ "Creates", "the", ".", "wistrc", ".", "json", "file", "from", "the", "contents", "of", "the", "specified", "file", "." ]
c456c98f2af3fc59c53b2f8495d4f13d41eb9e0e
https://github.com/willowtreeapps/wist/blob/c456c98f2af3fc59c53b2f8495d4f13d41eb9e0e/src/js/cli.js#L115-L127
train
willowtreeapps/wist
src/js/config/config-ops.js
deepmerge
function deepmerge(target, src, combine, isRule) { /* The MIT License (MIT) Copyright (c) 2012 Nicholas Fisher Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal ...
javascript
function deepmerge(target, src, combine, isRule) { /* The MIT License (MIT) Copyright (c) 2012 Nicholas Fisher Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal ...
[ "function", "deepmerge", "(", "target", ",", "src", ",", "combine", ",", "isRule", ")", "{", "/*\n The MIT License (MIT)\n\n Copyright (c) 2012 Nicholas Fisher\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software ...
Merges two config objects. This will not only add missing keys, but will also modify values to match. @param {Object} target config object @param {Object} src config object. Overrides in this config object will take priority over base. @param {boolean} [combine] Whether to combine arrays or not @param {boolean} [isRule...
[ "Merges", "two", "config", "objects", ".", "This", "will", "not", "only", "add", "missing", "keys", "but", "will", "also", "modify", "values", "to", "match", "." ]
c456c98f2af3fc59c53b2f8495d4f13d41eb9e0e
https://github.com/willowtreeapps/wist/blob/c456c98f2af3fc59c53b2f8495d4f13d41eb9e0e/src/js/config/config-ops.js#L95-L194
train
WebReflection/viperHTML
index.js
createAsync
function createAsync() { var wired = new Async, wire = render.bind(wired), chunksReceiver ; wired.update = function () { this.callback = chunksReceiver; return chunks.apply(this, arguments); }; return function (callback) { chunksReceiver = callback || String; return wire; }; }
javascript
function createAsync() { var wired = new Async, wire = render.bind(wired), chunksReceiver ; wired.update = function () { this.callback = chunksReceiver; return chunks.apply(this, arguments); }; return function (callback) { chunksReceiver = callback || String; return wire; }; }
[ "function", "createAsync", "(", ")", "{", "var", "wired", "=", "new", "Async", ",", "wire", "=", "render", ".", "bind", "(", "wired", ")", ",", "chunksReceiver", ";", "wired", ".", "update", "=", "function", "(", ")", "{", "this", ".", "callback", "=...
instrument a wire to work asynchronously passing along an optional resolved chunks interceptor callback
[ "instrument", "a", "wire", "to", "work", "asynchronously", "passing", "along", "an", "optional", "resolved", "chunks", "interceptor", "callback" ]
7dbdd3951b88d3b315e0a4a01608f36d0fc83795
https://github.com/WebReflection/viperHTML/blob/7dbdd3951b88d3b315e0a4a01608f36d0fc83795/index.js#L92-L106
train
WebReflection/viperHTML
index.js
fixUpdates
function fixUpdates(updates) { for (var update, i = 0, length = updates.length, out = []; i < length; i++ ) { update = updates[i]; out.push(update === getUpdateForHTML ? update.call(this) : update); } return out; }
javascript
function fixUpdates(updates) { for (var update, i = 0, length = updates.length, out = []; i < length; i++ ) { update = updates[i]; out.push(update === getUpdateForHTML ? update.call(this) : update); } return out; }
[ "function", "fixUpdates", "(", "updates", ")", "{", "for", "(", "var", "update", ",", "i", "=", "0", ",", "length", "=", "updates", ".", "length", ",", "out", "=", "[", "]", ";", "i", "<", "length", ";", "i", "++", ")", "{", "update", "=", "upd...
given a list of updates create a copy with the right update for HTML
[ "given", "a", "list", "of", "updates", "create", "a", "copy", "with", "the", "right", "update", "for", "HTML" ]
7dbdd3951b88d3b315e0a4a01608f36d0fc83795
https://github.com/WebReflection/viperHTML/blob/7dbdd3951b88d3b315e0a4a01608f36d0fc83795/index.js#L120-L132
train
WebReflection/viperHTML
index.js
invokeAtDistance
function invokeAtDistance(value, asTPV) { var after = asTPV ? asTemplateValue : identity; if ('text' in value) { return Promise.resolve(value.text).then(String).then(after); } else if ('any' in value) { return Promise.resolve(value.any).then(after); } else if ('html' in value) { return Promise.resol...
javascript
function invokeAtDistance(value, asTPV) { var after = asTPV ? asTemplateValue : identity; if ('text' in value) { return Promise.resolve(value.text).then(String).then(after); } else if ('any' in value) { return Promise.resolve(value.any).then(after); } else if ('html' in value) { return Promise.resol...
[ "function", "invokeAtDistance", "(", "value", ",", "asTPV", ")", "{", "var", "after", "=", "asTPV", "?", "asTemplateValue", ":", "identity", ";", "if", "(", "'text'", "in", "value", ")", "{", "return", "Promise", ".", "resolve", "(", "value", ".", "text"...
use a placeholder and resolve with the right callback
[ "use", "a", "placeholder", "and", "resolve", "with", "the", "right", "callback" ]
7dbdd3951b88d3b315e0a4a01608f36d0fc83795
https://github.com/WebReflection/viperHTML/blob/7dbdd3951b88d3b315e0a4a01608f36d0fc83795/index.js#L146-L157
train
WebReflection/viperHTML
index.js
invokeTransformer
function invokeTransformer(object) { for (var key, i = 0, length = transformersKeys.length; i < length; i++) { key = transformersKeys[i]; if (object.hasOwnProperty(key)) { // noop is passed to respect hyperHTML API but it won't have // any effect at distance for the time being return transfo...
javascript
function invokeTransformer(object) { for (var key, i = 0, length = transformersKeys.length; i < length; i++) { key = transformersKeys[i]; if (object.hasOwnProperty(key)) { // noop is passed to respect hyperHTML API but it won't have // any effect at distance for the time being return transfo...
[ "function", "invokeTransformer", "(", "object", ")", "{", "for", "(", "var", "key", ",", "i", "=", "0", ",", "length", "=", "transformersKeys", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "key", "=", "transformersKeys", "[", "i"...
last attempt to transform content
[ "last", "attempt", "to", "transform", "content" ]
7dbdd3951b88d3b315e0a4a01608f36d0fc83795
https://github.com/WebReflection/viperHTML/blob/7dbdd3951b88d3b315e0a4a01608f36d0fc83795/index.js#L160-L169
train
WebReflection/viperHTML
index.js
asTemplateValue
function asTemplateValue(value, isAttribute) { var presuf = isAttribute ? '' : createHyperComment(); switch(typeof value) { case 'string': return presuf + escape(value) + presuf; case 'boolean': case 'number': return presuf + value + presuf; case 'function': return asTemplateValue(value({}), isAttri...
javascript
function asTemplateValue(value, isAttribute) { var presuf = isAttribute ? '' : createHyperComment(); switch(typeof value) { case 'string': return presuf + escape(value) + presuf; case 'boolean': case 'number': return presuf + value + presuf; case 'function': return asTemplateValue(value({}), isAttri...
[ "function", "asTemplateValue", "(", "value", ",", "isAttribute", ")", "{", "var", "presuf", "=", "isAttribute", "?", "''", ":", "createHyperComment", "(", ")", ";", "switch", "(", "typeof", "value", ")", "{", "case", "'string'", ":", "return", "presuf", "+...
multiple content joined as single string
[ "multiple", "content", "joined", "as", "single", "string" ]
7dbdd3951b88d3b315e0a4a01608f36d0fc83795
https://github.com/WebReflection/viperHTML/blob/7dbdd3951b88d3b315e0a4a01608f36d0fc83795/index.js#L175-L202
train
WebReflection/viperHTML
index.js
updateBoolean
function updateBoolean(name) { name = ' ' + name; function update(value) { switch (value) { case true: case 'true': return name; } return ''; } update[UID] = true; return update; }
javascript
function updateBoolean(name) { name = ' ' + name; function update(value) { switch (value) { case true: case 'true': return name; } return ''; } update[UID] = true; return update; }
[ "function", "updateBoolean", "(", "name", ")", "{", "name", "=", "' '", "+", "name", ";", "function", "update", "(", "value", ")", "{", "switch", "(", "value", ")", "{", "case", "true", ":", "case", "'true'", ":", "return", "name", ";", "}", "return"...
return the right callback to update a boolean attribute after modifying the template to ignore such attribute if falsy
[ "return", "the", "right", "callback", "to", "update", "a", "boolean", "attribute", "after", "modifying", "the", "template", "to", "ignore", "such", "attribute", "if", "falsy" ]
7dbdd3951b88d3b315e0a4a01608f36d0fc83795
https://github.com/WebReflection/viperHTML/blob/7dbdd3951b88d3b315e0a4a01608f36d0fc83795/index.js#L339-L351
train
WebReflection/viperHTML
index.js
updateEvent
function updateEvent(value) { switch (typeof value) { case 'function': return 'return (' + escape( JS_SHORTCUT.test(value) && !JS_FUNCTION.test(value) ? ('function ' + value) : value ) + ').call(this, event)'; case 'object': return ''; default: return escape(value || ''); } }
javascript
function updateEvent(value) { switch (typeof value) { case 'function': return 'return (' + escape( JS_SHORTCUT.test(value) && !JS_FUNCTION.test(value) ? ('function ' + value) : value ) + ').call(this, event)'; case 'object': return ''; default: return escape(value || ''); } }
[ "function", "updateEvent", "(", "value", ")", "{", "switch", "(", "typeof", "value", ")", "{", "case", "'function'", ":", "return", "'return ('", "+", "escape", "(", "JS_SHORTCUT", ".", "test", "(", "value", ")", "&&", "!", "JS_FUNCTION", ".", "test", "(...
return the right callback to invoke an event stringifying the callback and invoking it to simulate a proper DOM behavior
[ "return", "the", "right", "callback", "to", "invoke", "an", "event", "stringifying", "the", "callback", "and", "invoking", "it", "to", "simulate", "a", "proper", "DOM", "behavior" ]
7dbdd3951b88d3b315e0a4a01608f36d0fc83795
https://github.com/WebReflection/viperHTML/blob/7dbdd3951b88d3b315e0a4a01608f36d0fc83795/index.js#L387-L397
train
WebReflection/viperHTML
index.js
chunks
function chunks() { for (var update, out = [], updates = this.updates, template = this.chunks, callback = this.callback, all = Promise.resolve(template[0]), chain = function (after) { return all.then(function (through) { notify(through); return aft...
javascript
function chunks() { for (var update, out = [], updates = this.updates, template = this.chunks, callback = this.callback, all = Promise.resolve(template[0]), chain = function (after) { return all.then(function (through) { notify(through); return aft...
[ "function", "chunks", "(", ")", "{", "for", "(", "var", "update", ",", "out", "=", "[", "]", ",", "updates", "=", "this", ".", "updates", ",", "template", "=", "this", ".", "chunks", ",", "callback", "=", "this", ".", "callback", ",", "all", "=", ...
resolves through promises and invoke a notifier per each resolved chunk the context will be a viper
[ "resolves", "through", "promises", "and", "invoke", "a", "notifier", "per", "each", "resolved", "chunk", "the", "context", "will", "be", "a", "viper" ]
7dbdd3951b88d3b315e0a4a01608f36d0fc83795
https://github.com/WebReflection/viperHTML/blob/7dbdd3951b88d3b315e0a4a01608f36d0fc83795/index.js#L422-L472
train
WebReflection/viperHTML
index.js
resolveAsTemplateValue
function resolveAsTemplateValue(update) { return function (value) { return asTemplateValue( value, update === updateAttribute || update === updateEvent || UID in update ); }; }
javascript
function resolveAsTemplateValue(update) { return function (value) { return asTemplateValue( value, update === updateAttribute || update === updateEvent || UID in update ); }; }
[ "function", "resolveAsTemplateValue", "(", "update", ")", "{", "return", "function", "(", "value", ")", "{", "return", "asTemplateValue", "(", "value", ",", "update", "===", "updateAttribute", "||", "update", "===", "updateEvent", "||", "UID", "in", "update", ...
invokes at distance asTemplateValue passing the "isAttribute" flag
[ "invokes", "at", "distance", "asTemplateValue", "passing", "the", "isAttribute", "flag" ]
7dbdd3951b88d3b315e0a4a01608f36d0fc83795
https://github.com/WebReflection/viperHTML/blob/7dbdd3951b88d3b315e0a4a01608f36d0fc83795/index.js#L484-L493
train
WebReflection/viperHTML
index.js
update
function update() { for (var tmp, promise = false, updates = this.updates, template = this.chunks, out = [template[0]], i = 1, length = arguments.length; i < length; i++ ) { tmp = arguments[i]; if ( (typeof tmp === 'object' && tmp !== null) && (typeof tmp.th...
javascript
function update() { for (var tmp, promise = false, updates = this.updates, template = this.chunks, out = [template[0]], i = 1, length = arguments.length; i < length; i++ ) { tmp = arguments[i]; if ( (typeof tmp === 'object' && tmp !== null) && (typeof tmp.th...
[ "function", "update", "(", ")", "{", "for", "(", "var", "tmp", ",", "promise", "=", "false", ",", "updates", "=", "this", ".", "updates", ",", "template", "=", "this", ".", "chunks", ",", "out", "=", "[", "template", "[", "0", "]", "]", ",", "i",...
each known viperHTML update is kept as simple as possible. the context will be a viper
[ "each", "known", "viperHTML", "update", "is", "kept", "as", "simple", "as", "possible", ".", "the", "context", "will", "be", "a", "viper" ]
7dbdd3951b88d3b315e0a4a01608f36d0fc83795
https://github.com/WebReflection/viperHTML/blob/7dbdd3951b88d3b315e0a4a01608f36d0fc83795/index.js#L498-L526
train
Autarc/optimal-select
src/match.js
checkAttributes
function checkAttributes (priority, element, ignore, path, parent = element.parentNode) { const pattern = findAttributesPattern(priority, element, ignore) if (pattern) { const matches = parent.querySelectorAll(pattern) if (matches.length === 1) { path.unshift(pattern) return true } } ret...
javascript
function checkAttributes (priority, element, ignore, path, parent = element.parentNode) { const pattern = findAttributesPattern(priority, element, ignore) if (pattern) { const matches = parent.querySelectorAll(pattern) if (matches.length === 1) { path.unshift(pattern) return true } } ret...
[ "function", "checkAttributes", "(", "priority", ",", "element", ",", "ignore", ",", "path", ",", "parent", "=", "element", ".", "parentNode", ")", "{", "const", "pattern", "=", "findAttributesPattern", "(", "priority", ",", "element", ",", "ignore", ")", "if...
Extend path with attribute identifier @param {Array.<string>} priority - [description] @param {HTMLElement} element - [description] @param {Object} ignore - [description] @param {Array.<string>} path - [description] @param {HTMLElement} parent - [description] @return {boolean} ...
[ "Extend", "path", "with", "attribute", "identifier" ]
722d220d2dc54d78121d610a69f6544c2e116721
https://github.com/Autarc/optimal-select/blob/722d220d2dc54d78121d610a69f6544c2e116721/src/match.js#L117-L127
train
Autarc/optimal-select
src/match.js
findAttributesPattern
function findAttributesPattern (priority, element, ignore) { const attributes = element.attributes const sortedKeys = Object.keys(attributes).sort((curr, next) => { const currPos = priority.indexOf(attributes[curr].name) const nextPos = priority.indexOf(attributes[next].name) if (nextPos === -1) { ...
javascript
function findAttributesPattern (priority, element, ignore) { const attributes = element.attributes const sortedKeys = Object.keys(attributes).sort((curr, next) => { const currPos = priority.indexOf(attributes[curr].name) const nextPos = priority.indexOf(attributes[next].name) if (nextPos === -1) { ...
[ "function", "findAttributesPattern", "(", "priority", ",", "element", ",", "ignore", ")", "{", "const", "attributes", "=", "element", ".", "attributes", "const", "sortedKeys", "=", "Object", ".", "keys", "(", "attributes", ")", ".", "sort", "(", "(", "curr",...
Lookup attribute identifier @param {Array.<string>} priority - [description] @param {HTMLElement} element - [description] @param {Object} ignore - [description] @return {string?} - [description]
[ "Lookup", "attribute", "identifier" ]
722d220d2dc54d78121d610a69f6544c2e116721
https://github.com/Autarc/optimal-select/blob/722d220d2dc54d78121d610a69f6544c2e116721/src/match.js#L137-L179
train
Autarc/optimal-select
src/match.js
checkTag
function checkTag (element, ignore, path, parent = element.parentNode) { const pattern = findTagPattern(element, ignore) if (pattern) { const matches = parent.getElementsByTagName(pattern) if (matches.length === 1) { path.unshift(pattern) return true } } return false }
javascript
function checkTag (element, ignore, path, parent = element.parentNode) { const pattern = findTagPattern(element, ignore) if (pattern) { const matches = parent.getElementsByTagName(pattern) if (matches.length === 1) { path.unshift(pattern) return true } } return false }
[ "function", "checkTag", "(", "element", ",", "ignore", ",", "path", ",", "parent", "=", "element", ".", "parentNode", ")", "{", "const", "pattern", "=", "findTagPattern", "(", "element", ",", "ignore", ")", "if", "(", "pattern", ")", "{", "const", "match...
Extend path with tag identifier @param {HTMLElement} element - [description] @param {Object} ignore - [description] @param {Array.<string>} path - [description] @param {HTMLElement} parent - [description] @return {boolean} - [description]
[ "Extend", "path", "with", "tag", "identifier" ]
722d220d2dc54d78121d610a69f6544c2e116721
https://github.com/Autarc/optimal-select/blob/722d220d2dc54d78121d610a69f6544c2e116721/src/match.js#L190-L200
train
Autarc/optimal-select
src/match.js
findTagPattern
function findTagPattern (element, ignore) { const tagName = element.tagName.toLowerCase() if (checkIgnore(ignore.tag, null, tagName)) { return null } return tagName }
javascript
function findTagPattern (element, ignore) { const tagName = element.tagName.toLowerCase() if (checkIgnore(ignore.tag, null, tagName)) { return null } return tagName }
[ "function", "findTagPattern", "(", "element", ",", "ignore", ")", "{", "const", "tagName", "=", "element", ".", "tagName", ".", "toLowerCase", "(", ")", "if", "(", "checkIgnore", "(", "ignore", ".", "tag", ",", "null", ",", "tagName", ")", ")", "{", "r...
Lookup tag identifier @param {HTMLElement} element - [description] @param {Object} ignore - [description] @return {boolean} - [description]
[ "Lookup", "tag", "identifier" ]
722d220d2dc54d78121d610a69f6544c2e116721
https://github.com/Autarc/optimal-select/blob/722d220d2dc54d78121d610a69f6544c2e116721/src/match.js#L209-L215
train
Autarc/optimal-select
src/match.js
checkChilds
function checkChilds (priority, element, ignore, path) { const parent = element.parentNode const children = parent.childTags || parent.children for (var i = 0, l = children.length; i < l; i++) { const child = children[i] if (child === element) { const childPattern = findPattern(priority, child, igno...
javascript
function checkChilds (priority, element, ignore, path) { const parent = element.parentNode const children = parent.childTags || parent.children for (var i = 0, l = children.length; i < l; i++) { const child = children[i] if (child === element) { const childPattern = findPattern(priority, child, igno...
[ "function", "checkChilds", "(", "priority", ",", "element", ",", "ignore", ",", "path", ")", "{", "const", "parent", "=", "element", ".", "parentNode", "const", "children", "=", "parent", ".", "childTags", "||", "parent", ".", "children", "for", "(", "var"...
Extend path with specific child identifier NOTE: 'childTags' is a custom property to use as a view filter for tags using 'adapter.js' @param {Array.<string>} priority - [description] @param {HTMLElement} element - [description] @param {Object} ignore - [description] @param {Array.<string>} path ...
[ "Extend", "path", "with", "specific", "child", "identifier" ]
722d220d2dc54d78121d610a69f6544c2e116721
https://github.com/Autarc/optimal-select/blob/722d220d2dc54d78121d610a69f6544c2e116721/src/match.js#L228-L246
train
Autarc/optimal-select
src/match.js
checkIgnore
function checkIgnore (predicate, name, value, defaultPredicate) { if (!value) { return true } const check = predicate || defaultPredicate if (!check) { return false } return check(name, value, defaultPredicate) }
javascript
function checkIgnore (predicate, name, value, defaultPredicate) { if (!value) { return true } const check = predicate || defaultPredicate if (!check) { return false } return check(name, value, defaultPredicate) }
[ "function", "checkIgnore", "(", "predicate", ",", "name", ",", "value", ",", "defaultPredicate", ")", "{", "if", "(", "!", "value", ")", "{", "return", "true", "}", "const", "check", "=", "predicate", "||", "defaultPredicate", "if", "(", "!", "check", ")...
Validate with custom and default functions @param {Function} predicate - [description] @param {string?} name - [description] @param {string} value - [description] @param {Function} defaultPredicate - [description] @return {boolean} - [description]
[ "Validate", "with", "custom", "and", "default", "functions" ]
722d220d2dc54d78121d610a69f6544c2e116721
https://github.com/Autarc/optimal-select/blob/722d220d2dc54d78121d610a69f6544c2e116721/src/match.js#L273-L282
train
Autarc/optimal-select
src/select.js
getCommonSelectors
function getCommonSelectors (elements) { const { classes, attributes, tag } = getCommonProperties(elements) const selectorPath = [] if (tag) { selectorPath.push(tag) } if (classes) { const classSelector = classes.map((name) => `.${name}`).join('') selectorPath.push(classSelector) } if (at...
javascript
function getCommonSelectors (elements) { const { classes, attributes, tag } = getCommonProperties(elements) const selectorPath = [] if (tag) { selectorPath.push(tag) } if (classes) { const classSelector = classes.map((name) => `.${name}`).join('') selectorPath.push(classSelector) } if (at...
[ "function", "getCommonSelectors", "(", "elements", ")", "{", "const", "{", "classes", ",", "attributes", ",", "tag", "}", "=", "getCommonProperties", "(", "elements", ")", "const", "selectorPath", "=", "[", "]", "if", "(", "tag", ")", "{", "selectorPath", ...
Get selectors to describe a set of elements @param {Array.<HTMLElements>} elements - [description] @return {string} - [description]
[ "Get", "selectors", "to", "describe", "a", "set", "of", "elements" ]
722d220d2dc54d78121d610a69f6544c2e116721
https://github.com/Autarc/optimal-select/blob/722d220d2dc54d78121d610a69f6544c2e116721/src/select.js#L99-L129
train
Autarc/optimal-select
src/adapt.js
traverseDescendants
function traverseDescendants (nodes, handler) { nodes.forEach((node) => { var progress = true handler(node, () => progress = false) if (node.childTags && progress) { traverseDescendants(node.childTags, handler) } }) }
javascript
function traverseDescendants (nodes, handler) { nodes.forEach((node) => { var progress = true handler(node, () => progress = false) if (node.childTags && progress) { traverseDescendants(node.childTags, handler) } }) }
[ "function", "traverseDescendants", "(", "nodes", ",", "handler", ")", "{", "nodes", ".", "forEach", "(", "(", "node", ")", "=>", "{", "var", "progress", "=", "true", "handler", "(", "node", ",", "(", ")", "=>", "progress", "=", "false", ")", "if", "(...
Walking recursive to invoke callbacks @param {Array.<HTMLElement>} nodes - [description] @param {Function} handler - [description]
[ "Walking", "recursive", "to", "invoke", "callbacks" ]
722d220d2dc54d78121d610a69f6544c2e116721
https://github.com/Autarc/optimal-select/blob/722d220d2dc54d78121d610a69f6544c2e116721/src/adapt.js#L310-L318
train
Autarc/optimal-select
src/adapt.js
getAncestor
function getAncestor (node, root, validate) { while (node.parent) { node = node.parent if (validate(node)) { return node } if (node === root) { break } } return null }
javascript
function getAncestor (node, root, validate) { while (node.parent) { node = node.parent if (validate(node)) { return node } if (node === root) { break } } return null }
[ "function", "getAncestor", "(", "node", ",", "root", ",", "validate", ")", "{", "while", "(", "node", ".", "parent", ")", "{", "node", "=", "node", ".", "parent", "if", "(", "validate", "(", "node", ")", ")", "{", "return", "node", "}", "if", "(", ...
Bubble up from bottom to top @param {HTMLELement} node - [description] @param {HTMLELement} root - [description] @param {Function} validate - [description] @return {HTMLELement} - [description]
[ "Bubble", "up", "from", "bottom", "to", "top" ]
722d220d2dc54d78121d610a69f6544c2e116721
https://github.com/Autarc/optimal-select/blob/722d220d2dc54d78121d610a69f6544c2e116721/src/adapt.js#L328-L339
train
Autarc/optimal-select
src/optimize.js
compareResults
function compareResults (matches, elements) { const { length } = matches return length === elements.length && elements.every((element) => { for (var i = 0; i < length; i++) { if (matches[i] === element) { return true } } return false }) }
javascript
function compareResults (matches, elements) { const { length } = matches return length === elements.length && elements.every((element) => { for (var i = 0; i < length; i++) { if (matches[i] === element) { return true } } return false }) }
[ "function", "compareResults", "(", "matches", ",", "elements", ")", "{", "const", "{", "length", "}", "=", "matches", "return", "length", "===", "elements", ".", "length", "&&", "elements", ".", "every", "(", "(", "element", ")", "=>", "{", "for", "(", ...
Evaluate matches with expected elements @param {Array.<HTMLElement>} matches - [description] @param {Array.<HTMLElement>} elements - [description] @return {Boolean} - [description]
[ "Evaluate", "matches", "with", "expected", "elements" ]
722d220d2dc54d78121d610a69f6544c2e116721
https://github.com/Autarc/optimal-select/blob/722d220d2dc54d78121d610a69f6544c2e116721/src/optimize.js#L172-L182
train
barmalei/zebkit
src/js/ui/web/ui.web.core.js
$isInInvisibleState
function $isInInvisibleState(c) { if (c.isVisible === false || c.$container.parentNode === null || c.width <= 0 || c.height <= 0 || c.parent === null || ...
javascript
function $isInInvisibleState(c) { if (c.isVisible === false || c.$container.parentNode === null || c.width <= 0 || c.height <= 0 || c.parent === null || ...
[ "function", "$isInInvisibleState", "(", "c", ")", "{", "if", "(", "c", ".", "isVisible", "===", "false", "||", "c", ".", "$container", ".", "parentNode", "===", "null", "||", "c", ".", "width", "<=", "0", "||", "c", ".", "height", "<=", "0", "||", ...
Evaluates if the given zebkit HTML UI component is in invisible state. @param {zebkit.ui.HtmlElement} c an UI HTML element wrapper @private @method $isInInvisibleState @return {Boolean} true if the HTML element wrapped with zebkit UI is in invisible state
[ "Evaluates", "if", "the", "given", "zebkit", "HTML", "UI", "component", "is", "in", "invisible", "state", "." ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/ui/web/ui.web.core.js#L644-L661
train
barmalei/zebkit
src/js/ui/web/ui.web.core.js
$resolveDOMParent
function $resolveDOMParent(c) { // try to find an HTML element in zebkit (pay attention, in zebkit hierarchy !) // hierarchy that has to be a DOM parent for the given component var parentElement = null; for(var p = c.parent; p !== null; p = p.parent) { ...
javascript
function $resolveDOMParent(c) { // try to find an HTML element in zebkit (pay attention, in zebkit hierarchy !) // hierarchy that has to be a DOM parent for the given component var parentElement = null; for(var p = c.parent; p !== null; p = p.parent) { ...
[ "function", "$resolveDOMParent", "(", "c", ")", "{", "// try to find an HTML element in zebkit (pay attention, in zebkit hierarchy !)", "// hierarchy that has to be a DOM parent for the given component", "var", "parentElement", "=", "null", ";", "for", "(", "var", "p", "=", "c", ...
attach to appropriate DOM parent if necessary c parameter has to be DOM element
[ "attach", "to", "appropriate", "DOM", "parent", "if", "necessary", "c", "parameter", "has", "to", "be", "DOM", "element" ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/ui/web/ui.web.core.js#L708-L739
train
barmalei/zebkit
src/js/ui/ui.menu.js
setParent
function setParent(p) { this.$super(p); if (p !== null && p.noSubIfEmpty === true) { this.getSub().setVisible(false); } }
javascript
function setParent(p) { this.$super(p); if (p !== null && p.noSubIfEmpty === true) { this.getSub().setVisible(false); } }
[ "function", "setParent", "(", "p", ")", "{", "this", ".", "$super", "(", "p", ")", ";", "if", "(", "p", "!==", "null", "&&", "p", ".", "noSubIfEmpty", "===", "true", ")", "{", "this", ".", "getSub", "(", ")", ".", "setVisible", "(", "false", ")",...
Override setParent method to catch the moment when the item is inserted to a menu @param {zebkit.ui.Panel} p a parent @method setParent
[ "Override", "setParent", "method", "to", "catch", "the", "moment", "when", "the", "item", "is", "inserted", "to", "a", "menu" ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/ui/ui.menu.js#L342-L347
train
barmalei/zebkit
src/js/ui/ui.menu.js
keyPressed
function keyPressed(e){ if (e.code === "Escape") { if (this.parent !== null) { var p = this.$parentMenu; this.$canceled(this); this.$hideMenu(); if (p !== null) { p.requestFocus(); ...
javascript
function keyPressed(e){ if (e.code === "Escape") { if (this.parent !== null) { var p = this.$parentMenu; this.$canceled(this); this.$hideMenu(); if (p !== null) { p.requestFocus(); ...
[ "function", "keyPressed", "(", "e", ")", "{", "if", "(", "e", ".", "code", "===", "\"Escape\"", ")", "{", "if", "(", "this", ".", "parent", "!==", "null", ")", "{", "var", "p", "=", "this", ".", "$parentMenu", ";", "this", ".", "$canceled", "(", ...
Override key pressed events handler to handle key events according to context menu component requirements @param {zebkit.ui.event.KeyEvent} e a key event @method keyPressed
[ "Override", "key", "pressed", "events", "handler", "to", "handle", "key", "events", "according", "to", "context", "menu", "component", "requirements" ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/ui/ui.menu.js#L729-L742
train
barmalei/zebkit
src/js/ui/ui.menu.js
addDecorative
function addDecorative(c) { if (c.$isDecorative !== true) { c.$$isDecorative = true; } this.$getSuper("insert").call(this, this.kids.length, null, c); }
javascript
function addDecorative(c) { if (c.$isDecorative !== true) { c.$$isDecorative = true; } this.$getSuper("insert").call(this, this.kids.length, null, c); }
[ "function", "addDecorative", "(", "c", ")", "{", "if", "(", "c", ".", "$isDecorative", "!==", "true", ")", "{", "c", ".", "$$isDecorative", "=", "true", ";", "}", "this", ".", "$getSuper", "(", "\"insert\"", ")", ".", "call", "(", "this", ",", "this"...
Add the specified component as a decorative item of the menu @param {zebkit.ui.Panel} c an UI component @method addDecorative
[ "Add", "the", "specified", "component", "as", "a", "decorative", "item", "of", "the", "menu" ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/ui/ui.menu.js#L770-L775
train
barmalei/zebkit
src/js/ui/ui.field.js
setValue
function setValue(s) { var txt = this.getValue(); if (txt !== s){ if (this.position !== null) { this.position.setOffset(0); } this.scrollManager.scrollTo(0, 0); this.$super(s); } return th...
javascript
function setValue(s) { var txt = this.getValue(); if (txt !== s){ if (this.position !== null) { this.position.setOffset(0); } this.scrollManager.scrollTo(0, 0); this.$super(s); } return th...
[ "function", "setValue", "(", "s", ")", "{", "var", "txt", "=", "this", ".", "getValue", "(", ")", ";", "if", "(", "txt", "!==", "s", ")", "{", "if", "(", "this", ".", "position", "!==", "null", ")", "{", "this", ".", "position", ".", "setOffset",...
Set the text content of the text field component @param {String} s a text the text field component has to be filled @method setValue @chainable
[ "Set", "the", "text", "content", "of", "the", "text", "field", "component" ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/ui/ui.field.js#L1247-L1257
train
barmalei/zebkit
src/js/dthen.js
function(e, pr) { if (arguments.length === 0) { if (this.$error !== null) { this.dumpError(e); } } else { if (this.$error === null) { if (this.$ignoreError) { this.$ignored(e); } else { ...
javascript
function(e, pr) { if (arguments.length === 0) { if (this.$error !== null) { this.dumpError(e); } } else { if (this.$error === null) { if (this.$ignoreError) { this.$ignored(e); } else { ...
[ "function", "(", "e", ",", "pr", ")", "{", "if", "(", "arguments", ".", "length", "===", "0", ")", "{", "if", "(", "this", ".", "$error", "!==", "null", ")", "{", "this", ".", "dumpError", "(", "e", ")", ";", "}", "}", "else", "{", "if", "(",...
Force to fire error. @param {Error} [e] an error to be fired @method error @chainable
[ "Force", "to", "fire", "error", "." ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/dthen.js#L241-L263
train
barmalei/zebkit
src/js/dthen.js
function(body) { var level = this.$level; // store level then was executed for the given task // to be used to compute correct the level inside the // method below var task = function() { // clean results of execution of a...
javascript
function(body) { var level = this.$level; // store level then was executed for the given task // to be used to compute correct the level inside the // method below var task = function() { // clean results of execution of a...
[ "function", "(", "body", ")", "{", "var", "level", "=", "this", ".", "$level", ";", "// store level then was executed for the given task", "// to be used to compute correct the level inside the", "// method below", "var", "task", "=", "function", "(", ")", "{", "// clean ...
Method to catch error that has occurred during the doit sequence execution. @param {Function} [body] a callback to handle the error. The method gets an error that has happened as its argument. If there is no argument the error will be printed in output. If passed argument is null then no error output is expected. @cha...
[ "Method", "to", "catch", "error", "that", "has", "occurred", "during", "the", "doit", "sequence", "execution", "." ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/dthen.js#L409-L463
train
barmalei/zebkit
src/js/dthen.js
function() { // clean results of execution of a previous task this.$busy = 0; var pc = this.$taskCounter; if (this.$error !== null) { this.$taskCounter = 0; // we have to count the tasks on this level this.$level = level + 1; ...
javascript
function() { // clean results of execution of a previous task this.$busy = 0; var pc = this.$taskCounter; if (this.$error !== null) { this.$taskCounter = 0; // we have to count the tasks on this level this.$level = level + 1; ...
[ "function", "(", ")", "{", "// clean results of execution of a previous task", "this", ".", "$busy", "=", "0", ";", "var", "pc", "=", "this", ".", "$taskCounter", ";", "if", "(", "this", ".", "$error", "!==", "null", ")", "{", "this", ".", "$taskCounter", ...
store level then was executed for the given task to be used to compute correct the level inside the method below
[ "store", "level", "then", "was", "executed", "for", "the", "given", "task", "to", "be", "used", "to", "compute", "correct", "the", "level", "inside", "the", "method", "below" ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/dthen.js#L414-L450
train
barmalei/zebkit
src/js/ui/ui.Slider.js
getView
function getView(t, v) { if (v !== null && v !== undefined && this.numPrecision !== -1 && zebkit.isNumber(v)) { v = v.toFixed(this.numPrecision); } return this.$super(t, v); }
javascript
function getView(t, v) { if (v !== null && v !== undefined && this.numPrecision !== -1 && zebkit.isNumber(v)) { v = v.toFixed(this.numPrecision); } return this.$super(t, v); }
[ "function", "getView", "(", "t", ",", "v", ")", "{", "if", "(", "v", "!==", "null", "&&", "v", "!==", "undefined", "&&", "this", ".", "numPrecision", "!==", "-", "1", "&&", "zebkit", ".", "isNumber", "(", "v", ")", ")", "{", "v", "=", "v", ".",...
Get a view to render the given number. @param {zebkit.ui.RulerPan} t a target ruler panel. @param {Number} v a number to be rendered @return {zebkit.draw.View} a view to render the number @method getView
[ "Get", "a", "view", "to", "render", "the", "given", "number", "." ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/ui/ui.Slider.js#L169-L174
train
barmalei/zebkit
src/js/ui/tree/ui.tree.Tree.js
setViewProvider
function setViewProvider(p){ if (this.provider != p) { this.stopEditing(false); this.provider = p; delete this.nodes; this.nodes = {}; this.vrp(); } return this; }
javascript
function setViewProvider(p){ if (this.provider != p) { this.stopEditing(false); this.provider = p; delete this.nodes; this.nodes = {}; this.vrp(); } return this; }
[ "function", "setViewProvider", "(", "p", ")", "{", "if", "(", "this", ".", "provider", "!=", "p", ")", "{", "this", ".", "stopEditing", "(", "false", ")", ";", "this", ".", "provider", "=", "p", ";", "delete", "this", ".", "nodes", ";", "this", "."...
Set tree component items view provider. Provider says how tree model items have to be visualized. @param {zebkit.ui.tree.DefViews} p a view provider @method setViewProvider @chainable
[ "Set", "tree", "component", "items", "view", "provider", ".", "Provider", "says", "how", "tree", "model", "items", "have", "to", "be", "visualized", "." ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/ui/tree/ui.tree.Tree.js#L293-L302
train
barmalei/zebkit
src/js/misc.js
dumpError
function dumpError(e) { if (typeof console !== "undefined" && typeof console.log !== "undefined") { var msg = "zebkit.err ["; if (typeof Date !== 'undefined') { var date = new Date(); msg = msg + date.getDate() + "/" + (date.getMonth() + 1) + "/" + ...
javascript
function dumpError(e) { if (typeof console !== "undefined" && typeof console.log !== "undefined") { var msg = "zebkit.err ["; if (typeof Date !== 'undefined') { var date = new Date(); msg = msg + date.getDate() + "/" + (date.getMonth() + 1) + "/" + ...
[ "function", "dumpError", "(", "e", ")", "{", "if", "(", "typeof", "console", "!==", "\"undefined\"", "&&", "typeof", "console", ".", "log", "!==", "\"undefined\"", ")", "{", "var", "msg", "=", "\"zebkit.err [\"", ";", "if", "(", "typeof", "Date", "!==", ...
Dump the given error to output. @param {Exception | Object} e an error. @method dumpError @for zebkit
[ "Dump", "the", "given", "error", "to", "output", "." ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/misc.js#L195-L212
train
barmalei/zebkit
src/js/misc.js
image
function image(ph, fireErr) { if (arguments.length < 2) { fireErr = false; } var doit = new DoIt(), jn = doit.join(), marker = "data:image"; if (isString(ph) && ph.length > marker.length) { // use "for" instead of "indexOf === 0" var i = 0; for(; i ...
javascript
function image(ph, fireErr) { if (arguments.length < 2) { fireErr = false; } var doit = new DoIt(), jn = doit.join(), marker = "data:image"; if (isString(ph) && ph.length > marker.length) { // use "for" instead of "indexOf === 0" var i = 0; for(; i ...
[ "function", "image", "(", "ph", ",", "fireErr", ")", "{", "if", "(", "arguments", ".", "length", "<", "2", ")", "{", "fireErr", "=", "false", ";", "}", "var", "doit", "=", "new", "DoIt", "(", ")", ",", "jn", "=", "doit", ".", "join", "(", ")", ...
Load image or complete the given image loading. @param {String|Image} ph path or image to complete loading. @param {Boolean} [fireErr] flag to force or preserve error firing. @return {zebkit.DoIt} @method image @for zebkit
[ "Load", "image", "or", "complete", "the", "given", "image", "loading", "." ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/misc.js#L223-L257
train
barmalei/zebkit
src/js/misc.js
isNumber
function isNumber(o) { return o !== undefined && o !== null && (typeof o === "number" || o.constructor === Number); }
javascript
function isNumber(o) { return o !== undefined && o !== null && (typeof o === "number" || o.constructor === Number); }
[ "function", "isNumber", "(", "o", ")", "{", "return", "o", "!==", "undefined", "&&", "o", "!==", "null", "&&", "(", "typeof", "o", "===", "\"number\"", "||", "o", ".", "constructor", "===", "Number", ")", ";", "}" ]
Check if the given value is number @param {Object} v a value. @return {Boolean} true if the given value is number @method isNumber @for zebkit
[ "Check", "if", "the", "given", "value", "is", "number" ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/misc.js#L282-L285
train
barmalei/zebkit
src/js/misc.js
isBoolean
function isBoolean(o) { return o !== undefined && o !== null && (typeof o === "boolean" || o.constructor === Boolean); }
javascript
function isBoolean(o) { return o !== undefined && o !== null && (typeof o === "boolean" || o.constructor === Boolean); }
[ "function", "isBoolean", "(", "o", ")", "{", "return", "o", "!==", "undefined", "&&", "o", "!==", "null", "&&", "(", "typeof", "o", "===", "\"boolean\"", "||", "o", ".", "constructor", "===", "Boolean", ")", ";", "}" ]
Check if the given value is boolean @param {Object} v a value. @return {Boolean} true if the given value is boolean @method isBoolean @for zebkit
[ "Check", "if", "the", "given", "value", "is", "boolean" ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/misc.js#L294-L297
train
barmalei/zebkit
src/js/misc.js
getPropertyValue
function getPropertyValue(obj, path, useGetter) { // if (arguments.length < 3) { // useGetter = false; // } path = path.trim(); if (path === undefined || path.length === 0) { throw new Error("Invalid field path: '" + path + "'"); } // if (obj === undefined || obj === null) { ...
javascript
function getPropertyValue(obj, path, useGetter) { // if (arguments.length < 3) { // useGetter = false; // } path = path.trim(); if (path === undefined || path.length === 0) { throw new Error("Invalid field path: '" + path + "'"); } // if (obj === undefined || obj === null) { ...
[ "function", "getPropertyValue", "(", "obj", ",", "path", ",", "useGetter", ")", "{", "// if (arguments.length < 3) {", "// useGetter = false;", "// }", "path", "=", "path", ".", "trim", "(", ")", ";", "if", "(", "path", "===", "undefined", "||", "path", "....
Get property value for the given object and the specified property path @param {Object} obj a target object. as the target object @param {String} path property path. Use "`*" as path to collect all available public properties. @param {Boolean} [useGetter] says too try getter method when it exists. By default the pa...
[ "Get", "property", "value", "for", "the", "given", "object", "and", "the", "specified", "property", "path" ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/misc.js#L334-L399
train
barmalei/zebkit
src/js/misc.js
function() { return (this.scheme !== null ? this.scheme + "://" : '') + (this.host !== null ? this.host : '' ) + (this.port !== -1 ? ":" + this.port : '' ) + (this.path !== null ? this.path : '' ) + (this.qs !== null ? "?" + this.qs : '' ); }
javascript
function() { return (this.scheme !== null ? this.scheme + "://" : '') + (this.host !== null ? this.host : '' ) + (this.port !== -1 ? ":" + this.port : '' ) + (this.path !== null ? this.path : '' ) + (this.qs !== null ? "?" + this.qs : '' ); }
[ "function", "(", ")", "{", "return", "(", "this", ".", "scheme", "!==", "null", "?", "this", ".", "scheme", "+", "\"://\"", ":", "''", ")", "+", "(", "this", ".", "host", "!==", "null", "?", "this", ".", "host", ":", "''", ")", "+", "(", "this"...
Serialize URI to its string representation. @method toString @return {String} an URI as a string.
[ "Serialize", "URI", "to", "its", "string", "representation", "." ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/misc.js#L715-L721
train
barmalei/zebkit
src/js/misc.js
function() { if (this.path === null) { return null; } else { var i = this.path.lastIndexOf('/'); return (i < 0 || this.path === '/') ? null : new URI(this.scheme, ...
javascript
function() { if (this.path === null) { return null; } else { var i = this.path.lastIndexOf('/'); return (i < 0 || this.path === '/') ? null : new URI(this.scheme, ...
[ "function", "(", ")", "{", "if", "(", "this", ".", "path", "===", "null", ")", "{", "return", "null", ";", "}", "else", "{", "var", "i", "=", "this", ".", "path", ".", "lastIndexOf", "(", "'/'", ")", ";", "return", "(", "i", "<", "0", "||", "...
Get a parent URI. @method getParent @return {zebkit.URI} a parent URI.
[ "Get", "a", "parent", "URI", "." ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/misc.js#L728-L740
train
barmalei/zebkit
src/js/misc.js
function(obj) { if (obj !== null) { if (this.qs === null) { this.qs = ''; } if (this.qs.length > 0) { this.qs = this.qs + "&" + URI.toQS(obj); } else { this.qs = URI.toQS(obj); } } }
javascript
function(obj) { if (obj !== null) { if (this.qs === null) { this.qs = ''; } if (this.qs.length > 0) { this.qs = this.qs + "&" + URI.toQS(obj); } else { this.qs = URI.toQS(obj); } } }
[ "function", "(", "obj", ")", "{", "if", "(", "obj", "!==", "null", ")", "{", "if", "(", "this", ".", "qs", "===", "null", ")", "{", "this", ".", "qs", "=", "''", ";", "}", "if", "(", "this", ".", "qs", ".", "length", ">", "0", ")", "{", "...
Append the given parameters to a query string of the URI. @param {Object} obj a dictionary of parameters to be appended to the URL query string @method appendQS
[ "Append", "the", "given", "parameters", "to", "a", "query", "string", "of", "the", "URI", "." ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/misc.js#L748-L760
train
barmalei/zebkit
src/js/misc.js
function() { var args = Array.prototype.slice.call(arguments); args.splice(0, 0, this.toString()); return URI.join.apply(URI, args); }
javascript
function() { var args = Array.prototype.slice.call(arguments); args.splice(0, 0, this.toString()); return URI.join.apply(URI, args); }
[ "function", "(", ")", "{", "var", "args", "=", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "arguments", ")", ";", "args", ".", "splice", "(", "0", ",", "0", ",", "this", ".", "toString", "(", ")", ")", ";", "return", "URI", ".", ...
Join URI with the specified path @param {String} p* relative paths @return {String} an absolute URI @method join
[ "Join", "URI", "with", "the", "specified", "path" ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/misc.js#L777-L781
train
barmalei/zebkit
src/js/misc.js
function(to) { if ((to instanceof URI) === false) { to = new URI(to); } if (this.isAbsolute() && to.isAbsolute() && this.host === to.host ...
javascript
function(to) { if ((to instanceof URI) === false) { to = new URI(to); } if (this.isAbsolute() && to.isAbsolute() && this.host === to.host ...
[ "function", "(", "to", ")", "{", "if", "(", "(", "to", "instanceof", "URI", ")", "===", "false", ")", "{", "to", "=", "new", "URI", "(", "to", ")", ";", "}", "if", "(", "this", ".", "isAbsolute", "(", ")", "&&", "to", ".", "isAbsolute", "(", ...
Get an URI relative to the given URI. @param {String|zebkit.URI} to an URI to that the relative URI has to be detected. @return {String} a relative URI @method relative
[ "Get", "an", "URI", "relative", "to", "the", "given", "URI", "." ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/misc.js#L798-L817
train
barmalei/zebkit
src/js/web/web.event.key.js
$initializeCodesMap
function $initializeCodesMap() { var k = null, code = null; // validate codes mapping for(k in CODES) { code = CODES[k]; if (code.map !== undefined) { if (CODES[code.map] === undefined) { throw new Error("Invalid mappin...
javascript
function $initializeCodesMap() { var k = null, code = null; // validate codes mapping for(k in CODES) { code = CODES[k]; if (code.map !== undefined) { if (CODES[code.map] === undefined) { throw new Error("Invalid mappin...
[ "function", "$initializeCodesMap", "(", ")", "{", "var", "k", "=", "null", ",", "code", "=", "null", ";", "// validate codes mapping", "for", "(", "k", "in", "CODES", ")", "{", "code", "=", "CODES", "[", "k", "]", ";", "if", "(", "code", ".", "map", ...
codes to that are not the same for different browsers
[ "codes", "to", "that", "are", "not", "the", "same", "for", "different", "browsers" ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/web/web.event.key.js#L135-L163
train
barmalei/zebkit
src/js/ui/date/ui.date.js
setFormat
function setFormat(format) { if (format === null || format === undefined) { throw new Error("Format is not defined " + this.clazz.$name); } if (this.format !== format) { this.format = format; this.$getSuper("setValue").call(this, this....
javascript
function setFormat(format) { if (format === null || format === undefined) { throw new Error("Format is not defined " + this.clazz.$name); } if (this.format !== format) { this.format = format; this.$getSuper("setValue").call(this, this....
[ "function", "setFormat", "(", "format", ")", "{", "if", "(", "format", "===", "null", "||", "format", "===", "undefined", ")", "{", "throw", "new", "Error", "(", "\"Format is not defined \"", "+", "this", ".", "clazz", ".", "$name", ")", ";", "}", "if", ...
Set the pattern to be used to format date @param {String} format a format pattern @method setFormat @chainable
[ "Set", "the", "pattern", "to", "be", "used", "to", "format", "date" ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/ui/date/ui.date.js#L1338-L1349
train
barmalei/zebkit
src/js/ui/date/ui.date.js
getCalendar
function getCalendar() { if (this.clazz.$name === undefined) { throw new Error(); } if (this.calendar === undefined || this.calendar === null) { var $this = this; this.$freezeCalendar = false; this.calendar = new pkg....
javascript
function getCalendar() { if (this.clazz.$name === undefined) { throw new Error(); } if (this.calendar === undefined || this.calendar === null) { var $this = this; this.$freezeCalendar = false; this.calendar = new pkg....
[ "function", "getCalendar", "(", ")", "{", "if", "(", "this", ".", "clazz", ".", "$name", "===", "undefined", ")", "{", "throw", "new", "Error", "(", ")", ";", "}", "if", "(", "this", ".", "calendar", "===", "undefined", "||", "this", ".", "calendar",...
Get calendar component. @return {zebkit.ui.date.Calendar} a calendar @method getCalendar
[ "Get", "calendar", "component", "." ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/ui/date/ui.date.js#L1405-L1446
train
barmalei/zebkit
src/js/ui/date/ui.date.js
showCalendar
function showCalendar(anchor) { try { this.$freezeCalendar = true; this.hideCalendar(); var calendar = this.getCalendar(); this.$anchor = anchor; var c = this.getCanvas(), w = c.getLayer("win"), ...
javascript
function showCalendar(anchor) { try { this.$freezeCalendar = true; this.hideCalendar(); var calendar = this.getCalendar(); this.$anchor = anchor; var c = this.getCanvas(), w = c.getLayer("win"), ...
[ "function", "showCalendar", "(", "anchor", ")", "{", "try", "{", "this", ".", "$freezeCalendar", "=", "true", ";", "this", ".", "hideCalendar", "(", ")", ";", "var", "calendar", "=", "this", ".", "getCalendar", "(", ")", ";", "this", ".", "$anchor", "=...
Show calendar as popup window for the given anchor component @param {zebkit.ui.Panel} anchor an anchor component. @chainable @method showCalendar
[ "Show", "calendar", "as", "popup", "window", "for", "the", "given", "anchor", "component" ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/ui/date/ui.date.js#L1454-L1491
train
barmalei/zebkit
src/js/ui/date/ui.date.js
hideCalendar
function hideCalendar() { if (this.calendar !== undefined && this.calendar !== null) { var calendar = this.getCalendar(); if (calendar.parent !== null) { calendar.removeMe(); if (this.calendarHidden !== undefined) { ...
javascript
function hideCalendar() { if (this.calendar !== undefined && this.calendar !== null) { var calendar = this.getCalendar(); if (calendar.parent !== null) { calendar.removeMe(); if (this.calendarHidden !== undefined) { ...
[ "function", "hideCalendar", "(", ")", "{", "if", "(", "this", ".", "calendar", "!==", "undefined", "&&", "this", ".", "calendar", "!==", "null", ")", "{", "var", "calendar", "=", "this", ".", "getCalendar", "(", ")", ";", "if", "(", "calendar", ".", ...
Hide calendar that has been shown as popup window. @chainable @method hideCalendar
[ "Hide", "calendar", "that", "has", "been", "shown", "as", "popup", "window", "." ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/ui/date/ui.date.js#L1498-L1511
train
barmalei/zebkit
src/js/ui/date/ui.date.js
setValue
function setValue(d1, d2) { if (compareDates(d1, d2) === 1) { throw new RangeError(); } if (compareDates(d1, this.minDateField.date) !== 0 || compareDates(d2, this.maxDateField.date) !== 0 ) { var prev = this.getValue(); ...
javascript
function setValue(d1, d2) { if (compareDates(d1, d2) === 1) { throw new RangeError(); } if (compareDates(d1, this.minDateField.date) !== 0 || compareDates(d2, this.maxDateField.date) !== 0 ) { var prev = this.getValue(); ...
[ "function", "setValue", "(", "d1", ",", "d2", ")", "{", "if", "(", "compareDates", "(", "d1", ",", "d2", ")", "===", "1", ")", "{", "throw", "new", "RangeError", "(", ")", ";", "}", "if", "(", "compareDates", "(", "d1", ",", "this", ".", "minDate...
Set the given date range. @param {Date} d1 a minimal possible date @param {Date} d2 a maximal possible date @method setValue
[ "Set", "the", "given", "date", "range", "." ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/ui/date/ui.date.js#L1714-L1733
train
barmalei/zebkit
src/js/oop.js
$cpMethods
function $cpMethods(src, dest, clazz) { var overriddenAbstractMethods = 0; for(var name in src) { if (name !== CNAME && name !== "clazz" && src.hasOwnProperty(name) ) { var method = src[name]; if (typeof method === "function" &&...
javascript
function $cpMethods(src, dest, clazz) { var overriddenAbstractMethods = 0; for(var name in src) { if (name !== CNAME && name !== "clazz" && src.hasOwnProperty(name) ) { var method = src[name]; if (typeof method === "function" &&...
[ "function", "$cpMethods", "(", "src", ",", "dest", ",", "clazz", ")", "{", "var", "overriddenAbstractMethods", "=", "0", ";", "for", "(", "var", "name", "in", "src", ")", "{", "if", "(", "name", "!==", "CNAME", "&&", "name", "!==", "\"clazz\"", "&&", ...
copy methods from source to destination
[ "copy", "methods", "from", "source", "to", "destination" ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/oop.js#L100-L141
train
barmalei/zebkit
src/js/oop.js
newInstance
function newInstance(clazz, args) { if (arguments.length > 1 && args.length > 0) { var f = function () {}; f.prototype = clazz.prototype; var o = new f(); clazz.apply(o, args); return o; } return new clazz(); }
javascript
function newInstance(clazz, args) { if (arguments.length > 1 && args.length > 0) { var f = function () {}; f.prototype = clazz.prototype; var o = new f(); clazz.apply(o, args); return o; } return new clazz(); }
[ "function", "newInstance", "(", "clazz", ",", "args", ")", "{", "if", "(", "arguments", ".", "length", ">", "1", "&&", "args", ".", "length", ">", "0", ")", "{", "var", "f", "=", "function", "(", ")", "{", "}", ";", "f", ".", "prototype", "=", ...
Instantiate a new class instance of the given class with the specified constructor arguments. @param {Function} clazz a class @param {Array} [args] an arguments list @return {Object} a new instance of the given class initialized with the specified arguments @method newInstance @for zebkit
[ "Instantiate", "a", "new", "class", "instance", "of", "the", "given", "class", "with", "the", "specified", "constructor", "arguments", "." ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/oop.js#L304-L314
train
barmalei/zebkit
src/js/oop.js
function() { var methods = arguments[arguments.length - 1], hasMethod = Array.isArray(methods); // inject class if (hasMethod && this.$isExtended !== true) { // create intermediate class var A = this.$parent !== null ? Class(this.$parent, []) ...
javascript
function() { var methods = arguments[arguments.length - 1], hasMethod = Array.isArray(methods); // inject class if (hasMethod && this.$isExtended !== true) { // create intermediate class var A = this.$parent !== null ? Class(this.$parent, []) ...
[ "function", "(", ")", "{", "var", "methods", "=", "arguments", "[", "arguments", ".", "length", "-", "1", "]", ",", "hasMethod", "=", "Array", ".", "isArray", "(", "methods", ")", ";", "// inject class", "if", "(", "hasMethod", "&&", "this", ".", "$isE...
Extend the class with new method and implemented interfaces. @param {zebkit.Interface} [interfaces]* number of interfaces the class has to implement. @param {Array} methods set of methods the given class has to be extended. @method extend @chainable @for zebkit.Class add extend method later to avoid the method be inh...
[ "Extend", "the", "class", "with", "new", "method", "and", "implemented", "interfaces", "." ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/oop.js#L689-L744
train
barmalei/zebkit
src/js/oop.js
function(clazz) { if (this !== clazz) { // detect class if (clazz.clazz === this.clazz) { for (var p = this.$parent; p !== null; p = p.$parent) { if (p === clazz) { return true; } } ...
javascript
function(clazz) { if (this !== clazz) { // detect class if (clazz.clazz === this.clazz) { for (var p = this.$parent; p !== null; p = p.$parent) { if (p === clazz) { return true; } } ...
[ "function", "(", "clazz", ")", "{", "if", "(", "this", "!==", "clazz", ")", "{", "// detect class", "if", "(", "clazz", ".", "clazz", "===", "this", ".", "clazz", ")", "{", "for", "(", "var", "p", "=", "this", ".", "$parent", ";", "p", "!==", "nu...
Tests if the class inherits the given class or interface. @param {zebkit.Class | zebkit.Interface} clazz a class or interface. @return {Boolean} true if the class or interface is inherited with the class. @method isInherit @for zebkit.Class
[ "Tests", "if", "the", "class", "inherits", "the", "given", "class", "or", "interface", "." ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/oop.js#L754-L770
train
barmalei/zebkit
src/js/oop.js
function(name) { if ($caller !== null) { for(var $s = $caller.boundTo.$parent; $s !== null; $s = $s.$parent) { var m = $s.prototype[name]; if (typeof m === 'function') { return m; } } return null; } ...
javascript
function(name) { if ($caller !== null) { for(var $s = $caller.boundTo.$parent; $s !== null; $s = $s.$parent) { var m = $s.prototype[name]; if (typeof m === 'function') { return m; } } return null; } ...
[ "function", "(", "name", ")", "{", "if", "(", "$caller", "!==", "null", ")", "{", "for", "(", "var", "$s", "=", "$caller", ".", "boundTo", ".", "$parent", ";", "$s", "!==", "null", ";", "$s", "=", "$s", ".", "$parent", ")", "{", "var", "m", "="...
Get a first super implementation of the given method in a parent classes hierarchy. @param {String} name a name of the method @return {Function} a super method implementation @method $getSuper @for zebkit.Class.zObject
[ "Get", "a", "first", "super", "implementation", "of", "the", "given", "method", "in", "a", "parent", "classes", "hierarchy", "." ]
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/oop.js#L972-L983
train
barmalei/zebkit
src/js/oop.js
instanceOf
function instanceOf(obj, clazz) { if (clazz !== null && clazz !== undefined) { if (obj === null || obj === undefined) { return false; } else if (obj.clazz === undefined) { return (obj instanceof clazz); } else { return obj.clazz !== null && ...
javascript
function instanceOf(obj, clazz) { if (clazz !== null && clazz !== undefined) { if (obj === null || obj === undefined) { return false; } else if (obj.clazz === undefined) { return (obj instanceof clazz); } else { return obj.clazz !== null && ...
[ "function", "instanceOf", "(", "obj", ",", "clazz", ")", "{", "if", "(", "clazz", "!==", "null", "&&", "clazz", "!==", "undefined", ")", "{", "if", "(", "obj", "===", "null", "||", "obj", "===", "undefined", ")", "{", "return", "false", ";", "}", "...
Test if the given object is instance of the specified class or interface. It is preferable to use this method instead of JavaScript "instanceof" operator whenever you are dealing with zebkit classes and interfaces. @param {Object} obj an object to be evaluated @param {Function} clazz a class or interface @return {Boo...
[ "Test", "if", "the", "given", "object", "is", "instance", "of", "the", "specified", "class", "or", "interface", ".", "It", "is", "preferable", "to", "use", "this", "method", "instead", "of", "JavaScript", "instanceof", "operator", "whenever", "you", "are", "...
eea59bcdba9f07158098f3d8c6efd4f80770efad
https://github.com/barmalei/zebkit/blob/eea59bcdba9f07158098f3d8c6efd4f80770efad/src/js/oop.js#L1268-L1282
train
RadLikeWhoa/Countable
Countable.js
validateArguments
function validateArguments (targets, callback) { const nodes = Object.prototype.toString.call(targets) const targetsValid = typeof targets === 'string' || ((nodes === '[object NodeList]' || nodes === '[object HTMLCollection]') || targets.nodeType === 1) const callbackValid = typeof callback === 'function' ...
javascript
function validateArguments (targets, callback) { const nodes = Object.prototype.toString.call(targets) const targetsValid = typeof targets === 'string' || ((nodes === '[object NodeList]' || nodes === '[object HTMLCollection]') || targets.nodeType === 1) const callbackValid = typeof callback === 'function' ...
[ "function", "validateArguments", "(", "targets", ",", "callback", ")", "{", "const", "nodes", "=", "Object", ".", "prototype", ".", "toString", ".", "call", "(", "targets", ")", "const", "targetsValid", "=", "typeof", "targets", "===", "'string'", "||", "(",...
`validateArguments` validates the arguments given to each function call. Errors are logged to the console as warnings, but Countable fails silently. @private @param {Nodes|String} targets A (collection of) element(s) or a single string to validate. @param {Function} callback The callback function to val...
[ "validateArguments", "validates", "the", "arguments", "given", "to", "each", "function", "call", ".", "Errors", "are", "logged", "to", "the", "console", "as", "warnings", "but", "Countable", "fails", "silently", "." ]
4d2812d7b53736d2bca4268b783997545d261c43
https://github.com/RadLikeWhoa/Countable/blob/4d2812d7b53736d2bca4268b783997545d261c43/Countable.js#L92-L101
train
RadLikeWhoa/Countable
Countable.js
function (elements, callback, options) { if (!validateArguments(elements, callback)) return if (!Array.isArray(elements)) { elements = [ elements ] } each.call(elements, function (e) { const handler = function () { callback.call(e, count(e, options)) }...
javascript
function (elements, callback, options) { if (!validateArguments(elements, callback)) return if (!Array.isArray(elements)) { elements = [ elements ] } each.call(elements, function (e) { const handler = function () { callback.call(e, count(e, options)) }...
[ "function", "(", "elements", ",", "callback", ",", "options", ")", "{", "if", "(", "!", "validateArguments", "(", "elements", ",", "callback", ")", ")", "return", "if", "(", "!", "Array", ".", "isArray", "(", "elements", ")", ")", "{", "elements", "=",...
The `on` method binds the counting handler to all given elements. The event is either `oninput` or `onkeydown`, based on the capabilities of the browser. @param {Nodes} elements All elements that should receive the Countable functionality. @param {Function} callback The callback to fire whenever the elem...
[ "The", "on", "method", "binds", "the", "counting", "handler", "to", "all", "given", "elements", ".", "The", "event", "is", "either", "oninput", "or", "onkeydown", "based", "on", "the", "capabilities", "of", "the", "browser", "." ]
4d2812d7b53736d2bca4268b783997545d261c43
https://github.com/RadLikeWhoa/Countable/blob/4d2812d7b53736d2bca4268b783997545d261c43/Countable.js#L194-L214
train
RadLikeWhoa/Countable
Countable.js
function (elements) { if (!validateArguments(elements, function () {})) return if (!Array.isArray(elements)) { elements = [ elements ] } liveElements.filter(function (e) { return elements.indexOf(e.element) !== -1 }).forEach(function (e) { e.element.removeEv...
javascript
function (elements) { if (!validateArguments(elements, function () {})) return if (!Array.isArray(elements)) { elements = [ elements ] } liveElements.filter(function (e) { return elements.indexOf(e.element) !== -1 }).forEach(function (e) { e.element.removeEv...
[ "function", "(", "elements", ")", "{", "if", "(", "!", "validateArguments", "(", "elements", ",", "function", "(", ")", "{", "}", ")", ")", "return", "if", "(", "!", "Array", ".", "isArray", "(", "elements", ")", ")", "{", "elements", "=", "[", "el...
The `off` method removes the Countable functionality from all given elements. @param {Nodes} elements All elements whose Countable functionality should be unbound. @return {Object} Returns the Countable object to allow for chaining.
[ "The", "off", "method", "removes", "the", "Countable", "functionality", "from", "all", "given", "elements", "." ]
4d2812d7b53736d2bca4268b783997545d261c43
https://github.com/RadLikeWhoa/Countable/blob/4d2812d7b53736d2bca4268b783997545d261c43/Countable.js#L226-L244
train
RadLikeWhoa/Countable
Countable.js
function (targets, callback, options) { if (!validateArguments(targets, callback)) return if (!Array.isArray(targets)) { targets = [ targets ] } each.call(targets, function (e) { callback.call(e, count(e, options)) }) return this }
javascript
function (targets, callback, options) { if (!validateArguments(targets, callback)) return if (!Array.isArray(targets)) { targets = [ targets ] } each.call(targets, function (e) { callback.call(e, count(e, options)) }) return this }
[ "function", "(", "targets", ",", "callback", ",", "options", ")", "{", "if", "(", "!", "validateArguments", "(", "targets", ",", "callback", ")", ")", "return", "if", "(", "!", "Array", ".", "isArray", "(", "targets", ")", ")", "{", "targets", "=", "...
The `count` method works mostly like the `live` method, but no events are bound, the functionality is only executed once. @param {Nodes|String} targets All elements that should be counted. @param {Function} callback The callback to fire whenever the element's value changes. The callback is called with t...
[ "The", "count", "method", "works", "mostly", "like", "the", "live", "method", "but", "no", "events", "are", "bound", "the", "functionality", "is", "only", "executed", "once", "." ]
4d2812d7b53736d2bca4268b783997545d261c43
https://github.com/RadLikeWhoa/Countable/blob/4d2812d7b53736d2bca4268b783997545d261c43/Countable.js#L264-L276
train
RadLikeWhoa/Countable
Countable.js
function (elements) { if (elements.length === undefined) { elements = [ elements ] } return liveElements.filter(function (e) { return elements.indexOf(e.element) !== -1 }).length === elements.length }
javascript
function (elements) { if (elements.length === undefined) { elements = [ elements ] } return liveElements.filter(function (e) { return elements.indexOf(e.element) !== -1 }).length === elements.length }
[ "function", "(", "elements", ")", "{", "if", "(", "elements", ".", "length", "===", "undefined", ")", "{", "elements", "=", "[", "elements", "]", "}", "return", "liveElements", ".", "filter", "(", "function", "(", "e", ")", "{", "return", "elements", "...
The `enabled` method checks if the live-counting functionality is bound to an element. @param {Node} element All elements that should be checked for the Countable functionality. @return {Boolean} A boolean value representing whether Countable functionality is bound to all given elements.
[ "The", "enabled", "method", "checks", "if", "the", "live", "-", "counting", "functionality", "is", "bound", "to", "an", "element", "." ]
4d2812d7b53736d2bca4268b783997545d261c43
https://github.com/RadLikeWhoa/Countable/blob/4d2812d7b53736d2bca4268b783997545d261c43/Countable.js#L289-L297
train
IonicaBizau/node-cobol
lib/run/index.js
Run
function Run(path, options, callback) { var p = Spawn(path, options.args), err = "", data = ""; if (options.remove !== false) { Fs.unlink(path, () => {}); } if (options.stdin) { options.stdin.pipe(p.stdin); } if (options.stdout) { p.stdout.pipe(options....
javascript
function Run(path, options, callback) { var p = Spawn(path, options.args), err = "", data = ""; if (options.remove !== false) { Fs.unlink(path, () => {}); } if (options.stdin) { options.stdin.pipe(p.stdin); } if (options.stdout) { p.stdout.pipe(options....
[ "function", "Run", "(", "path", ",", "options", ",", "callback", ")", "{", "var", "p", "=", "Spawn", "(", "path", ",", "options", ".", "args", ")", ",", "err", "=", "\"\"", ",", "data", "=", "\"\"", ";", "if", "(", "options", ".", "remove", "!=="...
Run Runs the executable output. @name Run @function @param {String} path The executable path. @param {Object} options An object containing the following fields: @param {Function} callback The callback function.
[ "Run", "Runs", "the", "executable", "output", "." ]
b3084a8262166a324dcaf54d976f6f3f8712b2a1
https://github.com/IonicaBizau/node-cobol/blob/b3084a8262166a324dcaf54d976f6f3f8712b2a1/lib/run/index.js#L17-L49
train
IonicaBizau/node-cobol
lib/move/index.js
Move
function Move(old, cwd, callback) { var n = Path.join(cwd, Path.basename(old)); Fs.rename(old, n, function (err) { callback(null, [old, n][Number(!err)]); }); }
javascript
function Move(old, cwd, callback) { var n = Path.join(cwd, Path.basename(old)); Fs.rename(old, n, function (err) { callback(null, [old, n][Number(!err)]); }); }
[ "function", "Move", "(", "old", ",", "cwd", ",", "callback", ")", "{", "var", "n", "=", "Path", ".", "join", "(", "cwd", ",", "Path", ".", "basename", "(", "old", ")", ")", ";", "Fs", ".", "rename", "(", "old", ",", "n", ",", "function", "(", ...
Move Moves the executable file into another directory. @name Move @function @param {String} old The old executable path. @param {String} cwd The destination folder (most probably the current working directory). @param {Function} callback The callback function.
[ "Move", "Moves", "the", "executable", "file", "into", "another", "directory", "." ]
b3084a8262166a324dcaf54d976f6f3f8712b2a1
https://github.com/IonicaBizau/node-cobol/blob/b3084a8262166a324dcaf54d976f6f3f8712b2a1/lib/move/index.js#L17-L22
train
IonicaBizau/node-cobol
lib/compile/index.js
Compile
function Compile(input, options, callback) { var output = Path.join(options.cwd, Path.basename(input).slice(0, -4)); if (options.precompiled) { callback(null, output); } else { CheckCobc(function (exists) { if (!exists) { return callback(new Error("Couldn't find...
javascript
function Compile(input, options, callback) { var output = Path.join(options.cwd, Path.basename(input).slice(0, -4)); if (options.precompiled) { callback(null, output); } else { CheckCobc(function (exists) { if (!exists) { return callback(new Error("Couldn't find...
[ "function", "Compile", "(", "input", ",", "options", ",", "callback", ")", "{", "var", "output", "=", "Path", ".", "join", "(", "options", ".", "cwd", ",", "Path", ".", "basename", "(", "input", ")", ".", "slice", "(", "0", ",", "-", "4", ")", ")...
Compile Compiles the cobol file. @name Compile @function @param {String} input The path to the cobol file. @param {Object} options An object containing the following fields: @param {Function} callback The callback function.
[ "Compile", "Compiles", "the", "cobol", "file", "." ]
b3084a8262166a324dcaf54d976f6f3f8712b2a1
https://github.com/IonicaBizau/node-cobol/blob/b3084a8262166a324dcaf54d976f6f3f8712b2a1/lib/compile/index.js#L40-L68
train
IonicaBizau/node-cobol
lib/index.js
Cobol
function Cobol(input, options, callback) { var args = Sliced(arguments); if (typeof options === "function") { callback = options; options = {}; } callback = callback || function () {}; // Merge the defaults options = Ul.merge(options, { cwd: process.cwd(), com...
javascript
function Cobol(input, options, callback) { var args = Sliced(arguments); if (typeof options === "function") { callback = options; options = {}; } callback = callback || function () {}; // Merge the defaults options = Ul.merge(options, { cwd: process.cwd(), com...
[ "function", "Cobol", "(", "input", ",", "options", ",", "callback", ")", "{", "var", "args", "=", "Sliced", "(", "arguments", ")", ";", "if", "(", "typeof", "options", "===", "\"function\"", ")", "{", "callback", "=", "options", ";", "options", "=", "{...
Cobol Runs COBOL code from Node.JS side. @name Cobol @function @param {Function|String|Path} input A function containing a comment with inline COBOL code, the cobol code itself or a path to a COBOL file. @param {Object} options An object containing the following fields: - `cwd` (String): Where the COBOL code will run...
[ "Cobol", "Runs", "COBOL", "code", "from", "Node", ".", "JS", "side", "." ]
b3084a8262166a324dcaf54d976f6f3f8712b2a1
https://github.com/IonicaBizau/node-cobol/blob/b3084a8262166a324dcaf54d976f6f3f8712b2a1/lib/index.js#L36-L100
train
pelias/leaflet-plugin
spec/helpers.js
loadJSON
function loadJSON (path, callback) { var xobj = new XMLHttpRequest(); xobj.overrideMimeType('application/json'); xobj.open('GET', path, true); xobj.onreadystatechange = function () { if (xobj.readyState === 4 && xobj.status === 200) { callback(xobj.responseText); } }; xobj.send(null); }
javascript
function loadJSON (path, callback) { var xobj = new XMLHttpRequest(); xobj.overrideMimeType('application/json'); xobj.open('GET', path, true); xobj.onreadystatechange = function () { if (xobj.readyState === 4 && xobj.status === 200) { callback(xobj.responseText); } }; xobj.send(null); }
[ "function", "loadJSON", "(", "path", ",", "callback", ")", "{", "var", "xobj", "=", "new", "XMLHttpRequest", "(", ")", ";", "xobj", ".", "overrideMimeType", "(", "'application/json'", ")", ";", "xobj", ".", "open", "(", "'GET'", ",", "path", ",", "true",...
Read sample results data
[ "Read", "sample", "results", "data" ]
f915387e131c9f8b156ff4c3f135446137bf5265
https://github.com/pelias/leaflet-plugin/blob/f915387e131c9f8b156ff4c3f135446137bf5265/spec/helpers.js#L2-L12
train
pelias/leaflet-plugin
spec/suites/SearchOptionsSpec.js
destroyMap
function destroyMap (map) { var el = map.getContainer(); map.remove(); document.body.removeChild(el); }
javascript
function destroyMap (map) { var el = map.getContainer(); map.remove(); document.body.removeChild(el); }
[ "function", "destroyMap", "(", "map", ")", "{", "var", "el", "=", "map", ".", "getContainer", "(", ")", ";", "map", ".", "remove", "(", ")", ";", "document", ".", "body", ".", "removeChild", "(", "el", ")", ";", "}" ]
Don't forget to clean up the map and DOM after you're done
[ "Don", "t", "forget", "to", "clean", "up", "the", "map", "and", "DOM", "after", "you", "re", "done" ]
f915387e131c9f8b156ff4c3f135446137bf5265
https://github.com/pelias/leaflet-plugin/blob/f915387e131c9f8b156ff4c3f135446137bf5265/spec/suites/SearchOptionsSpec.js#L17-L21
train
erming/shout
client/js/libs/jquery/tse.js
startDrag
function startDrag(e) { // Preventing the event's default action stops text being // selectable during the drag. e.preventDefault(); var self = $(this); self.trigger('startDrag'); // Measure how far the user's mouse is from the top of the scrollbar drag handle. var eventOffse...
javascript
function startDrag(e) { // Preventing the event's default action stops text being // selectable during the drag. e.preventDefault(); var self = $(this); self.trigger('startDrag'); // Measure how far the user's mouse is from the top of the scrollbar drag handle. var eventOffse...
[ "function", "startDrag", "(", "e", ")", "{", "// Preventing the event's default action stops text being", "// selectable during the drag.", "e", ".", "preventDefault", "(", ")", ";", "var", "self", "=", "$", "(", "this", ")", ";", "self", ".", "trigger", "(", "'st...
Start scrollbar handle drag
[ "Start", "scrollbar", "handle", "drag" ]
90a62c56af4412c6b0e0ae51fe84f3825f49e226
https://github.com/erming/shout/blob/90a62c56af4412c6b0e0ae51fe84f3825f49e226/client/js/libs/jquery/tse.js#L93-L112
train
erming/shout
client/js/libs/jquery/tse.js
drag
function drag(e) { e.preventDefault(); // Calculate how far the user's mouse is from the top/left of the scrollbar (minus the dragOffset). var eventOffset = e.pageY; if (scrollDirection === 'horiz') { eventOffset = e.pageX; } var dragPos = eventOffset - $scrollbarEl.offset()...
javascript
function drag(e) { e.preventDefault(); // Calculate how far the user's mouse is from the top/left of the scrollbar (minus the dragOffset). var eventOffset = e.pageY; if (scrollDirection === 'horiz') { eventOffset = e.pageX; } var dragPos = eventOffset - $scrollbarEl.offset()...
[ "function", "drag", "(", "e", ")", "{", "e", ".", "preventDefault", "(", ")", ";", "// Calculate how far the user's mouse is from the top/left of the scrollbar (minus the dragOffset).", "var", "eventOffset", "=", "e", ".", "pageY", ";", "if", "(", "scrollDirection", "==...
Drag scrollbar handle
[ "Drag", "scrollbar", "handle" ]
90a62c56af4412c6b0e0ae51fe84f3825f49e226
https://github.com/erming/shout/blob/90a62c56af4412c6b0e0ae51fe84f3825f49e226/client/js/libs/jquery/tse.js#L117-L132
train
erming/shout
client/js/libs/jquery/tse.js
resizeScrollContent
function resizeScrollContent() { if (scrollDirection === 'vert'){ $scrollContentEl.width($el.width()+scrollbarWidth()); $scrollContentEl.height($el.height()); } else { $scrollContentEl.width($el.width()); $scrollContentEl.height($el.height()+scrollbarWidth()); $conten...
javascript
function resizeScrollContent() { if (scrollDirection === 'vert'){ $scrollContentEl.width($el.width()+scrollbarWidth()); $scrollContentEl.height($el.height()); } else { $scrollContentEl.width($el.width()); $scrollContentEl.height($el.height()+scrollbarWidth()); $conten...
[ "function", "resizeScrollContent", "(", ")", "{", "if", "(", "scrollDirection", "===", "'vert'", ")", "{", "$scrollContentEl", ".", "width", "(", "$el", ".", "width", "(", ")", "+", "scrollbarWidth", "(", ")", ")", ";", "$scrollContentEl", ".", "height", "...
Resize content element
[ "Resize", "content", "element" ]
90a62c56af4412c6b0e0ae51fe84f3825f49e226
https://github.com/erming/shout/blob/90a62c56af4412c6b0e0ae51fe84f3825f49e226/client/js/libs/jquery/tse.js#L238-L247
train
erming/shout
client/js/libs/jquery/tse.js
scrollbarWidth
function scrollbarWidth() { // Append a temporary scrolling element to the DOM, then measure // the difference between between its outer and inner elements. var tempEl = $('<div class="scrollbar-width-tester" style="width:50px;height:50px;overflow-y:scroll;position:absolute;top:-200px;left:-200px;"><d...
javascript
function scrollbarWidth() { // Append a temporary scrolling element to the DOM, then measure // the difference between between its outer and inner elements. var tempEl = $('<div class="scrollbar-width-tester" style="width:50px;height:50px;overflow-y:scroll;position:absolute;top:-200px;left:-200px;"><d...
[ "function", "scrollbarWidth", "(", ")", "{", "// Append a temporary scrolling element to the DOM, then measure", "// the difference between between its outer and inner elements.", "var", "tempEl", "=", "$", "(", "'<div class=\"scrollbar-width-tester\" style=\"width:50px;height:50px;overflow-...
Calculate scrollbar width Original function by Jonathan Sharp: http://jdsharp.us/jQuery/minute/calculate-scrollbar-width.php Updated to work in Chrome v25.
[ "Calculate", "scrollbar", "width" ]
90a62c56af4412c6b0e0ae51fe84f3825f49e226
https://github.com/erming/shout/blob/90a62c56af4412c6b0e0ae51fe84f3825f49e226/client/js/libs/jquery/tse.js#L256-L271
train
erming/shout
client/js/libs/favico.js
function(imageElement) { _readyCb = function() { try { var w = imageElement.width; var h = imageElement.height; var newImg = document.createElement('img'); var ratio = (w / _w < h / _h) ? (w / _w) : (h / _h); newImg.setAttribute('src', imageElement.getAttribute('src')); newImg.heigh...
javascript
function(imageElement) { _readyCb = function() { try { var w = imageElement.width; var h = imageElement.height; var newImg = document.createElement('img'); var ratio = (w / _w < h / _h) ? (w / _w) : (h / _h); newImg.setAttribute('src', imageElement.getAttribute('src')); newImg.heigh...
[ "function", "(", "imageElement", ")", "{", "_readyCb", "=", "function", "(", ")", "{", "try", "{", "var", "w", "=", "imageElement", ".", "width", ";", "var", "h", "=", "imageElement", ".", "height", ";", "var", "newImg", "=", "document", ".", "createEl...
Set image as icon
[ "Set", "image", "as", "icon" ]
90a62c56af4412c6b0e0ae51fe84f3825f49e226
https://github.com/erming/shout/blob/90a62c56af4412c6b0e0ae51fe84f3825f49e226/client/js/libs/favico.js#L340-L360
train