id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
20,200
ghinda/css-toggle-switch
bower_components/qunit/qunit/qunit.js
on
function on(eventName, callback) { if (objectType(eventName) !== "string") { throw new TypeError("eventName must be a string when registering a listener"); } else if (!inArray(eventName, SUPPORTED_EVENTS)) { var events = SUPPORTED_EVENTS.join(", "); throw new Error("\"" + eventName + "\" is not a vali...
javascript
function on(eventName, callback) { if (objectType(eventName) !== "string") { throw new TypeError("eventName must be a string when registering a listener"); } else if (!inArray(eventName, SUPPORTED_EVENTS)) { var events = SUPPORTED_EVENTS.join(", "); throw new Error("\"" + eventName + "\" is not a vali...
[ "function", "on", "(", "eventName", ",", "callback", ")", "{", "if", "(", "objectType", "(", "eventName", ")", "!==", "\"string\"", ")", "{", "throw", "new", "TypeError", "(", "\"eventName must be a string when registering a listener\"", ")", ";", "}", "else", "...
Registers a callback as a listener to the specified event. @public @method on @param {String} eventName @param {Function} callback @return {Void}
[ "Registers", "a", "callback", "as", "a", "listener", "to", "the", "specified", "event", "." ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/qunit/qunit/qunit.js#L991-L1009
20,201
ghinda/css-toggle-switch
bower_components/qunit/qunit/qunit.js
registerLoggingCallbacks
function registerLoggingCallbacks(obj) { var i, l, key, callbackNames = ["begin", "done", "log", "testStart", "testDone", "moduleStart", "moduleDone"]; function registerLoggingCallback(key) { var loggingCallback = function loggingCallback(callback) { if (objectType(callback) !== "fu...
javascript
function registerLoggingCallbacks(obj) { var i, l, key, callbackNames = ["begin", "done", "log", "testStart", "testDone", "moduleStart", "moduleDone"]; function registerLoggingCallback(key) { var loggingCallback = function loggingCallback(callback) { if (objectType(callback) !== "fu...
[ "function", "registerLoggingCallbacks", "(", "obj", ")", "{", "var", "i", ",", "l", ",", "key", ",", "callbackNames", "=", "[", "\"begin\"", ",", "\"done\"", ",", "\"log\"", ",", "\"testStart\"", ",", "\"testDone\"", ",", "\"moduleStart\"", ",", "\"moduleDone\...
Register logging callbacks
[ "Register", "logging", "callbacks" ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/qunit/qunit/qunit.js#L1012-L1040
20,202
ghinda/css-toggle-switch
bower_components/qunit/qunit/qunit.js
done
function done() { var storage = config.storage; ProcessingQueue.finished = true; var runtime = now() - config.started; var passed = config.stats.all - config.stats.bad; emit("runEnd", globalSuite.end(true)); runLoggingCallbacks("done", { passed: passed, failed: config.stats.bad, total: ...
javascript
function done() { var storage = config.storage; ProcessingQueue.finished = true; var runtime = now() - config.started; var passed = config.stats.all - config.stats.bad; emit("runEnd", globalSuite.end(true)); runLoggingCallbacks("done", { passed: passed, failed: config.stats.bad, total: ...
[ "function", "done", "(", ")", "{", "var", "storage", "=", "config", ".", "storage", ";", "ProcessingQueue", ".", "finished", "=", "true", ";", "var", "runtime", "=", "now", "(", ")", "-", "config", ".", "started", ";", "var", "passed", "=", "config", ...
This function is called when the ProcessingQueue is done processing all items. It handles emitting the final run events.
[ "This", "function", "is", "called", "when", "the", "ProcessingQueue", "is", "done", "processing", "all", "items", ".", "It", "handles", "emitting", "the", "final", "run", "events", "." ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/qunit/qunit/qunit.js#L1191-L1217
20,203
ghinda/css-toggle-switch
bower_components/qunit/qunit/qunit.js
internalStop
function internalStop(test) { test.semaphore += 1; config.blocking = true; // Set a recovery timeout, if so configured. if (defined.setTimeout) { var timeoutDuration = void 0; if (typeof test.timeout === "number") { timeoutDuration = test.timeout; } else if (typeof config.testTimeout === ...
javascript
function internalStop(test) { test.semaphore += 1; config.blocking = true; // Set a recovery timeout, if so configured. if (defined.setTimeout) { var timeoutDuration = void 0; if (typeof test.timeout === "number") { timeoutDuration = test.timeout; } else if (typeof config.testTimeout === ...
[ "function", "internalStop", "(", "test", ")", "{", "test", ".", "semaphore", "+=", "1", ";", "config", ".", "blocking", "=", "true", ";", "// Set a recovery timeout, if so configured.", "if", "(", "defined", ".", "setTimeout", ")", "{", "var", "timeoutDuration",...
Put a hold on processing and return a function that will release it.
[ "Put", "a", "hold", "on", "processing", "and", "return", "a", "function", "that", "will", "release", "it", "." ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/qunit/qunit/qunit.js#L1963-L1996
20,204
ghinda/css-toggle-switch
bower_components/qunit/qunit/qunit.js
internalStart
function internalStart(test) { // If semaphore is non-numeric, throw error if (isNaN(test.semaphore)) { test.semaphore = 0; pushFailure("Invalid value on test.semaphore", sourceFromStacktrace(2)); return; } // Don't start until equal number of stop-calls if (test.semaphore > 0) { retur...
javascript
function internalStart(test) { // If semaphore is non-numeric, throw error if (isNaN(test.semaphore)) { test.semaphore = 0; pushFailure("Invalid value on test.semaphore", sourceFromStacktrace(2)); return; } // Don't start until equal number of stop-calls if (test.semaphore > 0) { retur...
[ "function", "internalStart", "(", "test", ")", "{", "// If semaphore is non-numeric, throw error", "if", "(", "isNaN", "(", "test", ".", "semaphore", ")", ")", "{", "test", ".", "semaphore", "=", "0", ";", "pushFailure", "(", "\"Invalid value on test.semaphore\"", ...
Release a processing hold, scheduling a resumption attempt if no holds remain.
[ "Release", "a", "processing", "hold", "scheduling", "a", "resumption", "attempt", "if", "no", "holds", "remain", "." ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/qunit/qunit/qunit.js#L2005-L2047
20,205
ghinda/css-toggle-switch
bower_components/qunit/qunit/qunit.js
onError
function onError(error) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } if (config.current) { if (config.current.ignoreGlobalErrors) { return true; } pushFailure.apply(undefined, [error.message...
javascript
function onError(error) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } if (config.current) { if (config.current.ignoreGlobalErrors) { return true; } pushFailure.apply(undefined, [error.message...
[ "function", "onError", "(", "error", ")", "{", "for", "(", "var", "_len", "=", "arguments", ".", "length", ",", "args", "=", "Array", "(", "_len", ">", "1", "?", "_len", "-", "1", ":", "0", ")", ",", "_key", "=", "1", ";", "_key", "<", "_len", ...
Handle an unhandled exception. By convention, returns true if further error handling should be suppressed and false otherwise. In this case, we will only suppress further error handling if the "ignoreGlobalErrors" configuration option is enabled.
[ "Handle", "an", "unhandled", "exception", ".", "By", "convention", "returns", "true", "if", "further", "error", "handling", "should", "be", "suppressed", "and", "false", "otherwise", ".", "In", "this", "case", "we", "will", "only", "suppress", "further", "erro...
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/qunit/qunit/qunit.js#L2617-L2634
20,206
ghinda/css-toggle-switch
bower_components/qunit/qunit/qunit.js
storeFixture
function storeFixture() { // Avoid overwriting user-defined values if (hasOwn.call(config, "fixture")) { return; } var fixture = document.getElementById("qunit-fixture"); if (fixture) { config.fixture = fixture.innerHTML; } }
javascript
function storeFixture() { // Avoid overwriting user-defined values if (hasOwn.call(config, "fixture")) { return; } var fixture = document.getElementById("qunit-fixture"); if (fixture) { config.fixture = fixture.innerHTML; } }
[ "function", "storeFixture", "(", ")", "{", "// Avoid overwriting user-defined values", "if", "(", "hasOwn", ".", "call", "(", "config", ",", "\"fixture\"", ")", ")", "{", "return", ";", "}", "var", "fixture", "=", "document", ".", "getElementById", "(", "\"qun...
Stores fixture HTML for resetting later
[ "Stores", "fixture", "HTML", "for", "resetting", "later" ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/qunit/qunit/qunit.js#L2949-L2960
20,207
ghinda/css-toggle-switch
bower_components/qunit/qunit/qunit.js
resetFixture
function resetFixture() { if (config.fixture == null) { return; } var fixture = document.getElementById("qunit-fixture"); if (fixture) { fixture.innerHTML = config.fixture; } }
javascript
function resetFixture() { if (config.fixture == null) { return; } var fixture = document.getElementById("qunit-fixture"); if (fixture) { fixture.innerHTML = config.fixture; } }
[ "function", "resetFixture", "(", ")", "{", "if", "(", "config", ".", "fixture", "==", "null", ")", "{", "return", ";", "}", "var", "fixture", "=", "document", ".", "getElementById", "(", "\"qunit-fixture\"", ")", ";", "if", "(", "fixture", ")", "{", "f...
Resets the fixture DOM element if available.
[ "Resets", "the", "fixture", "DOM", "element", "if", "available", "." ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/qunit/qunit/qunit.js#L2965-L2974
20,208
ghinda/css-toggle-switch
bower_components/prism/plugins/autoloader/prism-autoloader.js
function (lang, elt) { var data = lang_data[lang]; if (!data) { data = lang_data[lang] = {}; } // Look for additional dependencies defined on the <code> or <pre> tags var deps = elt.getAttribute('data-dependencies'); if (!deps && elt.parentNode && elt.parentNode.tagName.toLowerCase() === 'pre') { dep...
javascript
function (lang, elt) { var data = lang_data[lang]; if (!data) { data = lang_data[lang] = {}; } // Look for additional dependencies defined on the <code> or <pre> tags var deps = elt.getAttribute('data-dependencies'); if (!deps && elt.parentNode && elt.parentNode.tagName.toLowerCase() === 'pre') { dep...
[ "function", "(", "lang", ",", "elt", ")", "{", "var", "data", "=", "lang_data", "[", "lang", "]", ";", "if", "(", "!", "data", ")", "{", "data", "=", "lang_data", "[", "lang", "]", "=", "{", "}", ";", "}", "// Look for additional dependencies defined o...
Tries to load a grammar and highlight again the given element once loaded. @param {string} lang @param {HTMLElement} elt
[ "Tries", "to", "load", "a", "grammar", "and", "highlight", "again", "the", "given", "element", "once", "loaded", "." ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/prism/plugins/autoloader/prism-autoloader.js#L56-L79
20,209
ghinda/css-toggle-switch
bower_components/prism/plugins/autoloader/prism-autoloader.js
function (langs, success, error) { if (typeof langs === 'string') { langs = [langs]; } var i = 0; var l = langs.length; var f = function () { if (i < l) { loadLanguage(langs[i], function () { i++; f(); }, function () { error && error(langs[i]); }); } else if (i === l) { ...
javascript
function (langs, success, error) { if (typeof langs === 'string') { langs = [langs]; } var i = 0; var l = langs.length; var f = function () { if (i < l) { loadLanguage(langs[i], function () { i++; f(); }, function () { error && error(langs[i]); }); } else if (i === l) { ...
[ "function", "(", "langs", ",", "success", ",", "error", ")", "{", "if", "(", "typeof", "langs", "===", "'string'", ")", "{", "langs", "=", "[", "langs", "]", ";", "}", "var", "i", "=", "0", ";", "var", "l", "=", "langs", ".", "length", ";", "va...
Sequentially loads an array of grammars. @param {string[]|string} langs @param {function=} success @param {function=} error
[ "Sequentially", "loads", "an", "array", "of", "grammars", "." ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/prism/plugins/autoloader/prism-autoloader.js#L87-L106
20,210
ghinda/css-toggle-switch
bower_components/prism/plugins/autoloader/prism-autoloader.js
function (lang, success, error) { var load = function () { var force = false; // Do we want to force reload the grammar? if (lang.indexOf('!') >= 0) { force = true; lang = lang.replace('!', ''); } var data = lang_data[lang]; if (!data) { data = lang_data[lang] = {}; } if (success)...
javascript
function (lang, success, error) { var load = function () { var force = false; // Do we want to force reload the grammar? if (lang.indexOf('!') >= 0) { force = true; lang = lang.replace('!', ''); } var data = lang_data[lang]; if (!data) { data = lang_data[lang] = {}; } if (success)...
[ "function", "(", "lang", ",", "success", ",", "error", ")", "{", "var", "load", "=", "function", "(", ")", "{", "var", "force", "=", "false", ";", "// Do we want to force reload the grammar?", "if", "(", "lang", ".", "indexOf", "(", "'!'", ")", ">=", "0"...
Load a grammar with its dependencies @param {string} lang @param {function=} success @param {function=} error
[ "Load", "a", "grammar", "with", "its", "dependencies" ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/prism/plugins/autoloader/prism-autoloader.js#L114-L164
20,211
ghinda/css-toggle-switch
bower_components/prism/plugins/autoloader/prism-autoloader.js
function (lang) { if (lang_data[lang] && lang_data[lang].success_callbacks && lang_data[lang].success_callbacks.length) { lang_data[lang].success_callbacks.forEach(function (f) { f(lang); }); } }
javascript
function (lang) { if (lang_data[lang] && lang_data[lang].success_callbacks && lang_data[lang].success_callbacks.length) { lang_data[lang].success_callbacks.forEach(function (f) { f(lang); }); } }
[ "function", "(", "lang", ")", "{", "if", "(", "lang_data", "[", "lang", "]", "&&", "lang_data", "[", "lang", "]", ".", "success_callbacks", "&&", "lang_data", "[", "lang", "]", ".", "success_callbacks", ".", "length", ")", "{", "lang_data", "[", "lang", ...
Runs all success callbacks for this language. @param {string} lang
[ "Runs", "all", "success", "callbacks", "for", "this", "language", "." ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/prism/plugins/autoloader/prism-autoloader.js#L170-L176
20,212
ghinda/css-toggle-switch
bower_components/prism/plugins/autoloader/prism-autoloader.js
function (lang) { if (lang_data[lang] && lang_data[lang].error_callbacks && lang_data[lang].error_callbacks.length) { lang_data[lang].error_callbacks.forEach(function (f) { f(lang); }); } }
javascript
function (lang) { if (lang_data[lang] && lang_data[lang].error_callbacks && lang_data[lang].error_callbacks.length) { lang_data[lang].error_callbacks.forEach(function (f) { f(lang); }); } }
[ "function", "(", "lang", ")", "{", "if", "(", "lang_data", "[", "lang", "]", "&&", "lang_data", "[", "lang", "]", ".", "error_callbacks", "&&", "lang_data", "[", "lang", "]", ".", "error_callbacks", ".", "length", ")", "{", "lang_data", "[", "lang", "]...
Runs all error callbacks for this language. @param {string} lang
[ "Runs", "all", "error", "callbacks", "for", "this", "language", "." ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/prism/plugins/autoloader/prism-autoloader.js#L182-L188
20,213
ghinda/css-toggle-switch
bower_components/foundation-sites/js/foundation.core.js
function(plugin, name) { // Object key to use when adding to global Foundation object // Examples: Foundation.Reveal, Foundation.OffCanvas var className = (name || functionName(plugin)); // Object key to use when storing the plugin, also used to create the identifying data attribute for the plugin /...
javascript
function(plugin, name) { // Object key to use when adding to global Foundation object // Examples: Foundation.Reveal, Foundation.OffCanvas var className = (name || functionName(plugin)); // Object key to use when storing the plugin, also used to create the identifying data attribute for the plugin /...
[ "function", "(", "plugin", ",", "name", ")", "{", "// Object key to use when adding to global Foundation object", "// Examples: Foundation.Reveal, Foundation.OffCanvas", "var", "className", "=", "(", "name", "||", "functionName", "(", "plugin", ")", ")", ";", "// Object key...
Defines a Foundation plugin, adding it to the `Foundation` namespace and the list of plugins to initialize when reflowing. @param {Object} plugin - The constructor of the plugin.
[ "Defines", "a", "Foundation", "plugin", "adding", "it", "to", "the", "Foundation", "namespace", "and", "the", "list", "of", "plugins", "to", "initialize", "when", "reflowing", "." ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/foundation-sites/js/foundation.core.js#L28-L38
20,214
ghinda/css-toggle-switch
bower_components/foundation-sites/js/foundation.core.js
function (func, delay) { var timer = null; return function () { var context = this, args = arguments; if (timer === null) { timer = setTimeout(function () { func.apply(context, args); timer = null; }, delay); } }; }
javascript
function (func, delay) { var timer = null; return function () { var context = this, args = arguments; if (timer === null) { timer = setTimeout(function () { func.apply(context, args); timer = null; }, delay); } }; }
[ "function", "(", "func", ",", "delay", ")", "{", "var", "timer", "=", "null", ";", "return", "function", "(", ")", "{", "var", "context", "=", "this", ",", "args", "=", "arguments", ";", "if", "(", "timer", "===", "null", ")", "{", "timer", "=", ...
Function for applying a debounce effect to a function call. @function @param {Function} func - Function to be called at end of timeout. @param {Number} delay - Time in ms to delay the call of `func`. @returns function
[ "Function", "for", "applying", "a", "debounce", "effect", "to", "a", "function", "call", "." ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/foundation-sites/js/foundation.core.js#L233-L246
20,215
ghinda/css-toggle-switch
bower_components/foundation-sites/js/foundation.core.js
functionName
function functionName(fn) { if (Function.prototype.name === undefined) { var funcNameRegex = /function\s([^(]{1,})\(/; var results = (funcNameRegex).exec((fn).toString()); return (results && results.length > 1) ? results[1].trim() : ""; } else if (fn.prototype === undefined) { return fn.constructo...
javascript
function functionName(fn) { if (Function.prototype.name === undefined) { var funcNameRegex = /function\s([^(]{1,})\(/; var results = (funcNameRegex).exec((fn).toString()); return (results && results.length > 1) ? results[1].trim() : ""; } else if (fn.prototype === undefined) { return fn.constructo...
[ "function", "functionName", "(", "fn", ")", "{", "if", "(", "Function", ".", "prototype", ".", "name", "===", "undefined", ")", "{", "var", "funcNameRegex", "=", "/", "function\\s([^(]{1,})\\(", "/", ";", "var", "results", "=", "(", "funcNameRegex", ")", "...
Polyfill to get the name of a function in IE9
[ "Polyfill", "to", "get", "the", "name", "of", "a", "function", "in", "IE9" ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/foundation-sites/js/foundation.core.js#L312-L324
20,216
ghinda/css-toggle-switch
bower_components/foundation-sites/js/foundation.util.core.js
GetYoDigits
function GetYoDigits(length, namespace){ length = length || 6; return Math.round((Math.pow(36, length + 1) - Math.random() * Math.pow(36, length))).toString(36).slice(1) + (namespace ? `-${namespace}` : ''); }
javascript
function GetYoDigits(length, namespace){ length = length || 6; return Math.round((Math.pow(36, length + 1) - Math.random() * Math.pow(36, length))).toString(36).slice(1) + (namespace ? `-${namespace}` : ''); }
[ "function", "GetYoDigits", "(", "length", ",", "namespace", ")", "{", "length", "=", "length", "||", "6", ";", "return", "Math", ".", "round", "(", "(", "Math", ".", "pow", "(", "36", ",", "length", "+", "1", ")", "-", "Math", ".", "random", "(", ...
returns a random base-36 uid with namespacing @function @param {Number} length - number of random base-36 digits desired. Increase for more random strings. @param {String} namespace - name of plugin to be incorporated in uid, optional. @default {String} '' - if no plugin name is provided, nothing is appended to the uid...
[ "returns", "a", "random", "base", "-", "36", "uid", "with", "namespacing" ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/foundation-sites/js/foundation.util.core.js#L22-L25
20,217
ghinda/css-toggle-switch
bower_components/foundation-sites/dist/js/plugins/foundation.zf.responsiveAccordionTabs.js
ResponsiveAccordionTabs
function ResponsiveAccordionTabs(element, options) { _classCallCheck(this, ResponsiveAccordionTabs); this.$element = $(element); this.options = $.extend({}, this.$element.data(), options); this.rules = this.$element.data('responsive-accordion-tabs'); this.currentMq = null; this.curr...
javascript
function ResponsiveAccordionTabs(element, options) { _classCallCheck(this, ResponsiveAccordionTabs); this.$element = $(element); this.options = $.extend({}, this.$element.data(), options); this.rules = this.$element.data('responsive-accordion-tabs'); this.currentMq = null; this.curr...
[ "function", "ResponsiveAccordionTabs", "(", "element", ",", "options", ")", "{", "_classCallCheck", "(", "this", ",", "ResponsiveAccordionTabs", ")", ";", "this", ".", "$element", "=", "$", "(", "element", ")", ";", "this", ".", "options", "=", "$", ".", "...
Creates a new instance of a responsive accordion tabs. @class @fires ResponsiveAccordionTabs#init @param {jQuery} element - jQuery object to make into a dropdown menu. @param {Object} options - Overrides to the default plugin settings.
[ "Creates", "a", "new", "instance", "of", "a", "responsive", "accordion", "tabs", "." ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/foundation-sites/dist/js/plugins/foundation.zf.responsiveAccordionTabs.js#L27-L43
20,218
ghinda/css-toggle-switch
bower_components/qunit/src/core/processing-queue.js
advance
function advance() { const start = now(); config.depth = ( config.depth || 0 ) + 1; while ( config.queue.length && !config.blocking ) { const elapsedTime = now() - start; if ( !defined.setTimeout || config.updateRate <= 0 || elapsedTime < config.updateRate ) { if ( priorityCount > 0 ) { priorityCount--;...
javascript
function advance() { const start = now(); config.depth = ( config.depth || 0 ) + 1; while ( config.queue.length && !config.blocking ) { const elapsedTime = now() - start; if ( !defined.setTimeout || config.updateRate <= 0 || elapsedTime < config.updateRate ) { if ( priorityCount > 0 ) { priorityCount--;...
[ "function", "advance", "(", ")", "{", "const", "start", "=", "now", "(", ")", ";", "config", ".", "depth", "=", "(", "config", ".", "depth", "||", "0", ")", "+", "1", ";", "while", "(", "config", ".", "queue", ".", "length", "&&", "!", "config", ...
Advances the ProcessingQueue to the next item if it is ready. @param {Boolean} last
[ "Advances", "the", "ProcessingQueue", "to", "the", "next", "item", "if", "it", "is", "ready", "." ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/qunit/src/core/processing-queue.js#L29-L53
20,219
ghinda/css-toggle-switch
bower_components/qunit/src/core/processing-queue.js
addToQueue
function addToQueue( callback, prioritize, seed ) { if ( prioritize ) { config.queue.splice( priorityCount++, 0, callback ); } else if ( seed ) { if ( !unitSampler ) { unitSampler = unitSamplerGenerator( seed ); } // Insert into a random position after all prioritized items const index = Math.floor( uni...
javascript
function addToQueue( callback, prioritize, seed ) { if ( prioritize ) { config.queue.splice( priorityCount++, 0, callback ); } else if ( seed ) { if ( !unitSampler ) { unitSampler = unitSamplerGenerator( seed ); } // Insert into a random position after all prioritized items const index = Math.floor( uni...
[ "function", "addToQueue", "(", "callback", ",", "prioritize", ",", "seed", ")", "{", "if", "(", "prioritize", ")", "{", "config", ".", "queue", ".", "splice", "(", "priorityCount", "++", ",", "0", ",", "callback", ")", ";", "}", "else", "if", "(", "s...
Adds a function to the ProcessingQueue for execution. @param {Function|Array} callback @param {Boolean} priority @param {String} seed
[ "Adds", "a", "function", "to", "the", "ProcessingQueue", "for", "execution", "." ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/qunit/src/core/processing-queue.js#L74-L88
20,220
ghinda/css-toggle-switch
bower_components/qunit/src/core/processing-queue.js
unitSamplerGenerator
function unitSamplerGenerator( seed ) { // 32-bit xorshift, requires only a nonzero seed // http://excamera.com/sphinx/article-xorshift.html let sample = parseInt( generateHash( seed ), 16 ) || -1; return function() { sample ^= sample << 13; sample ^= sample >>> 17; sample ^= sample << 5; // ECMAScript ha...
javascript
function unitSamplerGenerator( seed ) { // 32-bit xorshift, requires only a nonzero seed // http://excamera.com/sphinx/article-xorshift.html let sample = parseInt( generateHash( seed ), 16 ) || -1; return function() { sample ^= sample << 13; sample ^= sample >>> 17; sample ^= sample << 5; // ECMAScript ha...
[ "function", "unitSamplerGenerator", "(", "seed", ")", "{", "// 32-bit xorshift, requires only a nonzero seed", "// http://excamera.com/sphinx/article-xorshift.html", "let", "sample", "=", "parseInt", "(", "generateHash", "(", "seed", ")", ",", "16", ")", "||", "-", "1", ...
Creates a seeded "sample" generator which is used for randomizing tests.
[ "Creates", "a", "seeded", "sample", "generator", "which", "is", "used", "for", "randomizing", "tests", "." ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/qunit/src/core/processing-queue.js#L93-L110
20,221
ghinda/css-toggle-switch
bower_components/prism/examples.js
loadLanguage
function loadLanguage (lang) { // at first we need to fetch all dependencies for the main language // Note: we need to do this, even if the main language already is loaded (just to be sure..) // // We load an array of all dependencies and call recursively this function on each entry // // dependencies is now an (...
javascript
function loadLanguage (lang) { // at first we need to fetch all dependencies for the main language // Note: we need to do this, even if the main language already is loaded (just to be sure..) // // We load an array of all dependencies and call recursively this function on each entry // // dependencies is now an (...
[ "function", "loadLanguage", "(", "lang", ")", "{", "// at first we need to fetch all dependencies for the main language", "// Note: we need to do this, even if the main language already is loaded (just to be sure..)", "//", "// We load an array of all dependencies and call recursively this functio...
Loads a language, including all dependencies @param {string} lang the language to load @type {Promise} the promise which resolves as soon as everything is loaded
[ "Loads", "a", "language", "including", "all", "dependencies" ]
9c7e7f167407d1ae07f660f62b4b4172ecd97ff8
https://github.com/ghinda/css-toggle-switch/blob/9c7e7f167407d1ae07f660f62b4b4172ecd97ff8/bower_components/prism/examples.js#L135-L160
20,222
maxgalbu/nightwatch-custom-commands-assertions
js/assertions/attributeMatches.js
getMultipleSelectors
function getMultipleSelectors(selector) { if (Array.isArray(selector)) { var section_selector = selector[0].selector; var real_selector = selector[1].selector; return [section_selector, real_selector]; } else { return selector; } }
javascript
function getMultipleSelectors(selector) { if (Array.isArray(selector)) { var section_selector = selector[0].selector; var real_selector = selector[1].selector; return [section_selector, real_selector]; } else { return selector; } }
[ "function", "getMultipleSelectors", "(", "selector", ")", "{", "if", "(", "Array", ".", "isArray", "(", "selector", ")", ")", "{", "var", "section_selector", "=", "selector", "[", "0", "]", ".", "selector", ";", "var", "real_selector", "=", "selector", "["...
The param "selector" that is passed to a custom command or assertion can be an array of selector, or a string. It's an array when a custom command is called from a section, and this array cannot be used straight away in a command, because nightwatch or selenium encode it in JSON, but the array itself has circular refer...
[ "The", "param", "selector", "that", "is", "passed", "to", "a", "custom", "command", "or", "assertion", "can", "be", "an", "array", "of", "selector", "or", "a", "string", ".", "It", "s", "an", "array", "when", "a", "custom", "command", "is", "called", "...
5ee52b9cfa26f89fb9f10c3a5878b38134892760
https://github.com/maxgalbu/nightwatch-custom-commands-assertions/blob/5ee52b9cfa26f89fb9f10c3a5878b38134892760/js/assertions/attributeMatches.js#L21-L29
20,223
maxgalbu/nightwatch-custom-commands-assertions
js/assertions/attributeMatches.js
assertion
function assertion(selector, attribute, regexp) { var _this = this; var msg = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; this.message = msg; if (!this.message) { this.message = _util2.default.format('Testing if element <%s> has attribute <%s> that matches %s', selector, attribute,...
javascript
function assertion(selector, attribute, regexp) { var _this = this; var msg = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; this.message = msg; if (!this.message) { this.message = _util2.default.format('Testing if element <%s> has attribute <%s> that matches %s', selector, attribute,...
[ "function", "assertion", "(", "selector", ",", "attribute", ",", "regexp", ")", "{", "var", "_this", "=", "this", ";", "var", "msg", "=", "arguments", ".", "length", ">", "3", "&&", "arguments", "[", "3", "]", "!==", "undefined", "?", "arguments", "[",...
Assert that the element identified by the selector has an attribute that matches the provided regexp. h3 Examples: browser .url("http://www.github.com") .assert.attributeMatches("body", "class", /body-class/g) browser .url("http://www.github.com") .assert.attributeMatches("body", "class", new RegExp("body-class", "g...
[ "Assert", "that", "the", "element", "identified", "by", "the", "selector", "has", "an", "attribute", "that", "matches", "the", "provided", "regexp", "." ]
5ee52b9cfa26f89fb9f10c3a5878b38134892760
https://github.com/maxgalbu/nightwatch-custom-commands-assertions/blob/5ee52b9cfa26f89fb9f10c3a5878b38134892760/js/assertions/attributeMatches.js#L50-L77
20,224
dtinth/promptpay-qr
webapp/src/Flipper.js
shouldAnimate
function shouldAnimate () { // Don’t animate while dragging if (pointerIsDown) return false const finished = current === target && Math.abs(currentSpeed) < 0.5 return !finished }
javascript
function shouldAnimate () { // Don’t animate while dragging if (pointerIsDown) return false const finished = current === target && Math.abs(currentSpeed) < 0.5 return !finished }
[ "function", "shouldAnimate", "(", ")", "{", "// Don’t animate while dragging", "if", "(", "pointerIsDown", ")", "return", "false", "const", "finished", "=", "current", "===", "target", "&&", "Math", ".", "abs", "(", "currentSpeed", ")", "<", "0.5", "return", "...
Returns whether an animation should run.
[ "Returns", "whether", "an", "animation", "should", "run", "." ]
1bdaecb5317413b98135b695a5f1031cfee4d73d
https://github.com/dtinth/promptpay-qr/blob/1bdaecb5317413b98135b695a5f1031cfee4d73d/webapp/src/Flipper.js#L105-L111
20,225
dtinth/promptpay-qr
webapp/src/Flipper.js
update
function update () { const bestSpeed = (target - current) * springK currentSpeed = linearlyApproach(currentSpeed, bestSpeed, acceleration) current += currentSpeed if (Math.abs(current - target) < 0.1) { current = target } }
javascript
function update () { const bestSpeed = (target - current) * springK currentSpeed = linearlyApproach(currentSpeed, bestSpeed, acceleration) current += currentSpeed if (Math.abs(current - target) < 0.1) { current = target } }
[ "function", "update", "(", ")", "{", "const", "bestSpeed", "=", "(", "target", "-", "current", ")", "*", "springK", "currentSpeed", "=", "linearlyApproach", "(", "currentSpeed", ",", "bestSpeed", ",", "acceleration", ")", "current", "+=", "currentSpeed", "if",...
Animation update logic.
[ "Animation", "update", "logic", "." ]
1bdaecb5317413b98135b695a5f1031cfee4d73d
https://github.com/dtinth/promptpay-qr/blob/1bdaecb5317413b98135b695a5f1031cfee4d73d/webapp/src/Flipper.js#L143-L150
20,226
dtinth/promptpay-qr
webapp/src/Flipper.js
linearlyApproach
function linearlyApproach (current, target, delta) { if (Math.abs(current - target) < delta) { return target } else if (current < target) { return current + delta } else { return current - delta } }
javascript
function linearlyApproach (current, target, delta) { if (Math.abs(current - target) < delta) { return target } else if (current < target) { return current + delta } else { return current - delta } }
[ "function", "linearlyApproach", "(", "current", ",", "target", ",", "delta", ")", "{", "if", "(", "Math", ".", "abs", "(", "current", "-", "target", ")", "<", "delta", ")", "{", "return", "target", "}", "else", "if", "(", "current", "<", "target", ")...
Linearly approach target by at most delta.
[ "Linearly", "approach", "target", "by", "at", "most", "delta", "." ]
1bdaecb5317413b98135b695a5f1031cfee4d73d
https://github.com/dtinth/promptpay-qr/blob/1bdaecb5317413b98135b695a5f1031cfee4d73d/webapp/src/Flipper.js#L153-L161
20,227
dtinth/promptpay-qr
webapp/src/Flipper.js
getProjection
function getProjection () { let projection = current let speed = currentSpeed for (let i = 0; i < 600; i++) { const targetSpeed = speed * (1 - springK) speed = linearlyApproach(speed, targetSpeed, acceleration) projection += speed } return projection }
javascript
function getProjection () { let projection = current let speed = currentSpeed for (let i = 0; i < 600; i++) { const targetSpeed = speed * (1 - springK) speed = linearlyApproach(speed, targetSpeed, acceleration) projection += speed } return projection }
[ "function", "getProjection", "(", ")", "{", "let", "projection", "=", "current", "let", "speed", "=", "currentSpeed", "for", "(", "let", "i", "=", "0", ";", "i", "<", "600", ";", "i", "++", ")", "{", "const", "targetSpeed", "=", "speed", "*", "(", ...
Based on current animation state, simulate the projected rotation angle if we allow the spinning to stop without intervention.
[ "Based", "on", "current", "animation", "state", "simulate", "the", "projected", "rotation", "angle", "if", "we", "allow", "the", "spinning", "to", "stop", "without", "intervention", "." ]
1bdaecb5317413b98135b695a5f1031cfee4d73d
https://github.com/dtinth/promptpay-qr/blob/1bdaecb5317413b98135b695a5f1031cfee4d73d/webapp/src/Flipper.js#L170-L179
20,228
dtinth/promptpay-qr
webapp/src/Flipper.js
getTargetAngle
function getTargetAngle (projection, flipped) { const offset = flipped ? 180 : 0 return Math.round((projection - offset - 1) / 360) * 360 + offset }
javascript
function getTargetAngle (projection, flipped) { const offset = flipped ? 180 : 0 return Math.round((projection - offset - 1) / 360) * 360 + offset }
[ "function", "getTargetAngle", "(", "projection", ",", "flipped", ")", "{", "const", "offset", "=", "flipped", "?", "180", ":", "0", "return", "Math", ".", "round", "(", "(", "projection", "-", "offset", "-", "1", ")", "/", "360", ")", "*", "360", "+"...
Based on the projected angle `projection` and desired `flipped` state, determine the optimal angle to rotate the flipper to.
[ "Based", "on", "the", "projected", "angle", "projection", "and", "desired", "flipped", "state", "determine", "the", "optimal", "angle", "to", "rotate", "the", "flipper", "to", "." ]
1bdaecb5317413b98135b695a5f1031cfee4d73d
https://github.com/dtinth/promptpay-qr/blob/1bdaecb5317413b98135b695a5f1031cfee4d73d/webapp/src/Flipper.js#L197-L200
20,229
auth0/unreleased
index.js
getAllTags
function getAllTags(version, cwd, repo, cb) { var str = 'git for-each-ref --format="%(tag)" --sort=\'*authordate\' refs/tags | sed \'1!G;h;$!d\''; exec(str, {cwd: cwd}, function (err, stdout, stderr) { var output = ''; if (err) { return cb(err); } var stdoutAsString = stdout.toString('utf8'); //...
javascript
function getAllTags(version, cwd, repo, cb) { var str = 'git for-each-ref --format="%(tag)" --sort=\'*authordate\' refs/tags | sed \'1!G;h;$!d\''; exec(str, {cwd: cwd}, function (err, stdout, stderr) { var output = ''; if (err) { return cb(err); } var stdoutAsString = stdout.toString('utf8'); //...
[ "function", "getAllTags", "(", "version", ",", "cwd", ",", "repo", ",", "cb", ")", "{", "var", "str", "=", "'git for-each-ref --format=\"%(tag)\" --sort=\\'*authordate\\' refs/tags | sed \\'1!G;h;$!d\\''", ";", "exec", "(", "str", ",", "{", "cwd", ":", "cwd", "}", ...
Get all existing tags ordered descending on date
[ "Get", "all", "existing", "tags", "ordered", "descending", "on", "date" ]
3ec04b447ccf47c4a4364d20c35b80bb65588473
https://github.com/auth0/unreleased/blob/3ec04b447ccf47c4a4364d20c35b80bb65588473/index.js#L18-L48
20,230
angular/protractor-accessibility-plugin
index.js
runChromeDevTools
function runChromeDevTools(context) { var data = fs.readFileSync(AUDIT_FILE, 'utf-8'); data = data + ' var configuration = new axs.AuditConfiguration(' + JSON.stringify(context.config.chromeA11YDevTools.auditConfiguration) + '); return axs.Audit.run(configuration);'; var elementPromises = [], elementStrin...
javascript
function runChromeDevTools(context) { var data = fs.readFileSync(AUDIT_FILE, 'utf-8'); data = data + ' var configuration = new axs.AuditConfiguration(' + JSON.stringify(context.config.chromeA11YDevTools.auditConfiguration) + '); return axs.Audit.run(configuration);'; var elementPromises = [], elementStrin...
[ "function", "runChromeDevTools", "(", "context", ")", "{", "var", "data", "=", "fs", ".", "readFileSync", "(", "AUDIT_FILE", ",", "'utf-8'", ")", ";", "data", "=", "data", "+", "' var configuration = new axs.AuditConfiguration('", "+", "JSON", ".", "stringify", ...
Audits page source against the Chrome Accessibility Developer Tools, if configured. @param {Object} context The plugin context object @return {q.Promise} A promise which resolves when the audit is finished @private
[ "Audits", "page", "source", "against", "the", "Chrome", "Accessibility", "Developer", "Tools", "if", "configured", "." ]
d0cca1876d6e829d882b6b885e9b7e80318f68d5
https://github.com/angular/protractor-accessibility-plugin/blob/d0cca1876d6e829d882b6b885e9b7e80318f68d5/index.js#L153-L235
20,231
RusticiSoftware/TinCanJS
vendor/cryptojs-v3.1.2/components/enc-utf16.js
function (utf16Str) { // Shortcut var utf16StrLength = utf16Str.length; // Convert var words = []; for (var i = 0; i < utf16StrLength; i++) { words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16)); } ...
javascript
function (utf16Str) { // Shortcut var utf16StrLength = utf16Str.length; // Convert var words = []; for (var i = 0; i < utf16StrLength; i++) { words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16)); } ...
[ "function", "(", "utf16Str", ")", "{", "// Shortcut", "var", "utf16StrLength", "=", "utf16Str", ".", "length", ";", "// Convert", "var", "words", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "utf16StrLength", ";", "i", "++", "...
Converts a UTF-16 LE string to a word array. @param {string} utf16Str The UTF-16 LE string. @return {WordArray} The word array. @static @example var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);
[ "Converts", "a", "UTF", "-", "16", "LE", "string", "to", "a", "word", "array", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/vendor/cryptojs-v3.1.2/components/enc-utf16.js#L118-L129
20,232
RusticiSoftware/TinCanJS
build/tincan.js
function (msg, src) { /* globals console */ if (TinCan.DEBUG && typeof console !== "undefined" && console.log) { src = src || this.LOG_SRC || "TinCan"; console.log("TinCan." + src + ": " + msg); } }
javascript
function (msg, src) { /* globals console */ if (TinCan.DEBUG && typeof console !== "undefined" && console.log) { src = src || this.LOG_SRC || "TinCan"; console.log("TinCan." + src + ": " + msg); } }
[ "function", "(", "msg", ",", "src", ")", "{", "/* globals console */", "if", "(", "TinCan", ".", "DEBUG", "&&", "typeof", "console", "!==", "\"undefined\"", "&&", "console", ".", "log", ")", "{", "src", "=", "src", "||", "this", ".", "LOG_SRC", "||", "...
Safe version of logging, only displays when .DEBUG is true, and console.log is available @method log @param {String} msg Message to output
[ "Safe", "version", "of", "logging", "only", "displays", "when", ".", "DEBUG", "is", "true", "and", "console", ".", "log", "is", "available" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L340-L347
20,233
RusticiSoftware/TinCanJS
build/tincan.js
function (stmt, callback) { this.log("sendStatement"); // would prefer to use .bind instead of 'self' var self = this, lrs, statement = this.prepareStatement(stmt), rsCount = this.recordStores.length, i, ...
javascript
function (stmt, callback) { this.log("sendStatement"); // would prefer to use .bind instead of 'self' var self = this, lrs, statement = this.prepareStatement(stmt), rsCount = this.recordStores.length, i, ...
[ "function", "(", "stmt", ",", "callback", ")", "{", "this", ".", "log", "(", "\"sendStatement\"", ")", ";", "// would prefer to use .bind instead of 'self'", "var", "self", "=", "this", ",", "lrs", ",", "statement", "=", "this", ".", "prepareStatement", "(", "...
Calls saveStatement on each configured LRS, provide callback to make it asynchronous @method sendStatement @param {TinCan.Statement|Object} statement Send statement to LRS @param {Function} [callback] Callback function to execute on completion
[ "Calls", "saveStatement", "on", "each", "configured", "LRS", "provide", "callback", "to", "make", "it", "asynchronous" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L577-L652
20,234
RusticiSoftware/TinCanJS
build/tincan.js
function (stmtId, callback, cfg) { this.log("getStatement"); var lrs; cfg = cfg || {}; cfg.params = cfg.params || {}; if (this.recordStores.length > 0) { // // for statements (for now) we only need to read from the first LRS ...
javascript
function (stmtId, callback, cfg) { this.log("getStatement"); var lrs; cfg = cfg || {}; cfg.params = cfg.params || {}; if (this.recordStores.length > 0) { // // for statements (for now) we only need to read from the first LRS ...
[ "function", "(", "stmtId", ",", "callback", ",", "cfg", ")", "{", "this", ".", "log", "(", "\"getStatement\"", ")", ";", "var", "lrs", ";", "cfg", "=", "cfg", "||", "{", "}", ";", "cfg", ".", "params", "=", "cfg", ".", "params", "||", "{", "}", ...
Calls retrieveStatement on the first LRS, provide callback to make it asynchronous @method getStatement @param {String} [stmtId] Statement ID to get @param {Function} [callback] Callback function to execute on completion @param {Object} [cfg] Configuration data @param {Object} [params] Query parameters @param {Boolean...
[ "Calls", "retrieveStatement", "on", "the", "first", "LRS", "provide", "callback", "to", "make", "it", "asynchronous" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L667-L691
20,235
RusticiSoftware/TinCanJS
build/tincan.js
function (stmtId, callback) { this.log("getVoidedStatement"); var lrs; if (this.recordStores.length > 0) { // // for statements (for now) we only need to read from the first LRS // in the future it may make sense to get all from all L...
javascript
function (stmtId, callback) { this.log("getVoidedStatement"); var lrs; if (this.recordStores.length > 0) { // // for statements (for now) we only need to read from the first LRS // in the future it may make sense to get all from all L...
[ "function", "(", "stmtId", ",", "callback", ")", "{", "this", ".", "log", "(", "\"getVoidedStatement\"", ")", ";", "var", "lrs", ";", "if", "(", "this", ".", "recordStores", ".", "length", ">", "0", ")", "{", "//", "// for statements (for now) we only need t...
Calls retrieveVoidedStatement on the first LRS, provide callback to make it asynchronous @method getVoidedStatement @param {String} statement Statement ID to get @param {Function} [callback] Callback function to execute on completion @return {Array|Result} Array of results, or single result TODO: make TinCan track vo...
[ "Calls", "retrieveVoidedStatement", "on", "the", "first", "LRS", "provide", "callback", "to", "make", "it", "asynchronous" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L815-L836
20,236
RusticiSoftware/TinCanJS
build/tincan.js
function (stmts, callback) { this.log("sendStatements"); var self = this, lrs, statements = [], rsCount = this.recordStores.length, i, results = [], callbackWrapper, callbackResults = ...
javascript
function (stmts, callback) { this.log("sendStatements"); var self = this, lrs, statements = [], rsCount = this.recordStores.length, i, results = [], callbackWrapper, callbackResults = ...
[ "function", "(", "stmts", ",", "callback", ")", "{", "this", ".", "log", "(", "\"sendStatements\"", ")", ";", "var", "self", "=", "this", ",", "lrs", ",", "statements", "=", "[", "]", ",", "rsCount", "=", "this", ".", "recordStores", ".", "length", "...
Calls saveStatements with list of prepared statements @method sendStatements @param {Array} Array of statements to send @param {Function} Callback function to execute on completion
[ "Calls", "saveStatements", "with", "list", "of", "prepared", "statements" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L845-L931
20,237
RusticiSoftware/TinCanJS
build/tincan.js
function (prop, lang) { var langDict = this[prop], key; if (typeof lang !== "undefined" && typeof langDict[lang] !== "undefined") { return langDict[lang]; } if (typeof langDict.und !== "undefined") { return langDict.und; ...
javascript
function (prop, lang) { var langDict = this[prop], key; if (typeof lang !== "undefined" && typeof langDict[lang] !== "undefined") { return langDict[lang]; } if (typeof langDict.und !== "undefined") { return langDict.und; ...
[ "function", "(", "prop", ",", "lang", ")", "{", "var", "langDict", "=", "this", "[", "prop", "]", ",", "key", ";", "if", "(", "typeof", "lang", "!==", "\"undefined\"", "&&", "typeof", "langDict", "[", "lang", "]", "!==", "\"undefined\"", ")", "{", "r...
Intended to be inherited by objects with properties that store display values in a language based "dictionary" @method getLangDictionaryValue @param {String} prop Property name storing the dictionary @param {String} [lang] Language to return @return {String}
[ "Intended", "to", "be", "inherited", "by", "objects", "with", "properties", "that", "store", "display", "values", "in", "a", "language", "based", "dictionary" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L1720-L1740
20,238
RusticiSoftware/TinCanJS
build/tincan.js
function (cfg) { this.log("sendRequest"); var fullUrl = this.endpoint + cfg.url, headers = {}, prop ; // respect absolute URLs passed in if (cfg.url.indexOf("http") === 0) { fullUrl = cfg.url; } ...
javascript
function (cfg) { this.log("sendRequest"); var fullUrl = this.endpoint + cfg.url, headers = {}, prop ; // respect absolute URLs passed in if (cfg.url.indexOf("http") === 0) { fullUrl = cfg.url; } ...
[ "function", "(", "cfg", ")", "{", "this", ".", "log", "(", "\"sendRequest\"", ")", ";", "var", "fullUrl", "=", "this", ".", "endpoint", "+", "cfg", ".", "url", ",", "headers", "=", "{", "}", ",", "prop", ";", "// respect absolute URLs passed in", "if", ...
Method used to send a request via browser objects to the LRS @method sendRequest @param {Object} cfg Configuration for request @param {String} cfg.url URL portion to add to endpoint @param {String} [cfg.method] GET, PUT, POST, etc. @param {Object} [cfg.params] Parameters to set on the querystring @param {String|ArrayB...
[ "Method", "used", "to", "send", "a", "request", "via", "browser", "objects", "to", "the", "LRS" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L2166-L2207
20,239
RusticiSoftware/TinCanJS
build/tincan.js
function (cfg) { this.log("about"); var requestCfg, requestResult, callbackWrapper; cfg = cfg || {}; requestCfg = { url: "about", method: "GET", params: {} }; if (typ...
javascript
function (cfg) { this.log("about"); var requestCfg, requestResult, callbackWrapper; cfg = cfg || {}; requestCfg = { url: "about", method: "GET", params: {} }; if (typ...
[ "function", "(", "cfg", ")", "{", "this", ".", "log", "(", "\"about\"", ")", ";", "var", "requestCfg", ",", "requestResult", ",", "callbackWrapper", ";", "cfg", "=", "cfg", "||", "{", "}", ";", "requestCfg", "=", "{", "url", ":", "\"about\"", ",", "m...
Method used to determine the LRS version @method about @param {Object} cfg Configuration object for the about request @param {Function} [cfg.callback] Callback to execute upon receiving a response @param {Object} [cfg.params] this is needed, but can be empty @return {Object} About which holds the version, or asyncrhon...
[ "Method", "used", "to", "determine", "the", "LRS", "version" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L2218-L2254
20,240
RusticiSoftware/TinCanJS
build/tincan.js
function (stmt, cfg) { this.log("saveStatement"); var requestCfg = { url: "statements", headers: {} }, versionedStatement, requestAttachments = [], boundary, i; cf...
javascript
function (stmt, cfg) { this.log("saveStatement"); var requestCfg = { url: "statements", headers: {} }, versionedStatement, requestAttachments = [], boundary, i; cf...
[ "function", "(", "stmt", ",", "cfg", ")", "{", "this", ".", "log", "(", "\"saveStatement\"", ")", ";", "var", "requestCfg", "=", "{", "url", ":", "\"statements\"", ",", "headers", ":", "{", "}", "}", ",", "versionedStatement", ",", "requestAttachments", ...
Save a statement, when used from a browser sends to the endpoint using the RESTful interface. Use a callback to make the call asynchronous. @method saveStatement @param {TinCan.Statement} statement to send @param {Object} [cfg] Configuration used when saving @param {Function} [cfg.callback] Callback to execute on comp...
[ "Save", "a", "statement", "when", "used", "from", "a", "browser", "sends", "to", "the", "endpoint", "using", "the", "RESTful", "interface", ".", "Use", "a", "callback", "to", "make", "the", "call", "asynchronous", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L2265-L2362
20,241
RusticiSoftware/TinCanJS
build/tincan.js
function (stmtId, cfg) { this.log("retrieveStatement"); var requestCfg, requestResult, callbackWrapper, lrs = this; cfg = cfg || {}; cfg.params = cfg.params || {}; requestCfg = { url: "statement...
javascript
function (stmtId, cfg) { this.log("retrieveStatement"); var requestCfg, requestResult, callbackWrapper, lrs = this; cfg = cfg || {}; cfg.params = cfg.params || {}; requestCfg = { url: "statement...
[ "function", "(", "stmtId", ",", "cfg", ")", "{", "this", ".", "log", "(", "\"retrieveStatement\"", ")", ";", "var", "requestCfg", ",", "requestResult", ",", "callbackWrapper", ",", "lrs", "=", "this", ";", "cfg", "=", "cfg", "||", "{", "}", ";", "cfg",...
Retrieve a statement, when used from a browser sends to the endpoint using the RESTful interface. @method retrieveStatement @param {String} ID of statement to retrieve @param {Object} [cfg] Configuration options @param {Object} [cfg.params] Query parameters @param {Boolean} [cfg.params.attachments] Include attachments...
[ "Retrieve", "a", "statement", "when", "used", "from", "a", "browser", "sends", "to", "the", "endpoint", "using", "the", "RESTful", "interface", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L2375-L2418
20,242
RusticiSoftware/TinCanJS
build/tincan.js
function (cfg) { this.log("queryStatements"); var requestCfg, requestResult, callbackWrapper, lrs = this; cfg = cfg || {}; cfg.params = cfg.params || {}; // // if they misconfigured (possibly due to...
javascript
function (cfg) { this.log("queryStatements"); var requestCfg, requestResult, callbackWrapper, lrs = this; cfg = cfg || {}; cfg.params = cfg.params || {}; // // if they misconfigured (possibly due to...
[ "function", "(", "cfg", ")", "{", "this", ".", "log", "(", "\"queryStatements\"", ")", ";", "var", "requestCfg", ",", "requestResult", ",", "callbackWrapper", ",", "lrs", "=", "this", ";", "cfg", "=", "cfg", "||", "{", "}", ";", "cfg", ".", "params", ...
Fetch a set of statements, when used from a browser sends to the endpoint using the RESTful interface. Use a callback to make the call asynchronous. @method queryStatements @param {Object} [cfg] Configuration used to query @param {Object} [cfg.params] Query parameters @param {TinCan.Agent|TinCan.Group} [cfg.params.ag...
[ "Fetch", "a", "set", "of", "statements", "when", "used", "from", "a", "browser", "sends", "to", "the", "endpoint", "using", "the", "RESTful", "interface", ".", "Use", "a", "callback", "to", "make", "the", "call", "asynchronous", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L2631-L2714
20,243
RusticiSoftware/TinCanJS
build/tincan.js
function (cfg) { this.log("moreStatements: " + cfg.url); var requestCfg, requestResult, callbackWrapper, parsedURL, serverRoot; cfg = cfg || {}; // to support our interface (to support IE) we need to break ...
javascript
function (cfg) { this.log("moreStatements: " + cfg.url); var requestCfg, requestResult, callbackWrapper, parsedURL, serverRoot; cfg = cfg || {}; // to support our interface (to support IE) we need to break ...
[ "function", "(", "cfg", ")", "{", "this", ".", "log", "(", "\"moreStatements: \"", "+", "cfg", ".", "url", ")", ";", "var", "requestCfg", ",", "requestResult", ",", "callbackWrapper", ",", "parsedURL", ",", "serverRoot", ";", "cfg", "=", "cfg", "||", "{"...
Fetch more statements from a previous query, when used from a browser sends to the endpoint using the RESTful interface. Use a callback to make the call asynchronous. @method moreStatements @param {Object} [cfg] Configuration used to query @param {String} [cfg.url] More URL @param {Function} [cfg.callback] Callback t...
[ "Fetch", "more", "statements", "from", "a", "previous", "query", "when", "used", "from", "a", "browser", "sends", "to", "the", "endpoint", "using", "the", "RESTful", "interface", ".", "Use", "a", "callback", "to", "make", "the", "call", "asynchronous", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L3018-L3075
20,244
RusticiSoftware/TinCanJS
build/tincan.js
function (key, cfg) { this.log("retrieveState"); var requestParams = {}, requestCfg = {}, requestResult, callbackWrapper, requestHeaders, self = this; requestHeaders = cfg.requestHeaders || {}; ...
javascript
function (key, cfg) { this.log("retrieveState"); var requestParams = {}, requestCfg = {}, requestResult, callbackWrapper, requestHeaders, self = this; requestHeaders = cfg.requestHeaders || {}; ...
[ "function", "(", "key", ",", "cfg", ")", "{", "this", ".", "log", "(", "\"retrieveState\"", ")", ";", "var", "requestParams", "=", "{", "}", ",", "requestCfg", "=", "{", "}", ",", "requestResult", ",", "callbackWrapper", ",", "requestHeaders", ",", "self...
Retrieve a state value, when used from a browser sends to the endpoint using the RESTful interface. @method retrieveState @param {String} key Key of state to retrieve @param {Object} cfg Configuration options @param {TinCan.Activity} cfg.activity Activity in document identifier @param {TinCan.Agent} cfg.agent Agent in...
[ "Retrieve", "a", "state", "value", "when", "used", "from", "a", "browser", "sends", "to", "the", "endpoint", "using", "the", "RESTful", "interface", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L3092-L3227
20,245
RusticiSoftware/TinCanJS
build/tincan.js
function (cfg) { this.log("retrieveStateIds"); var requestParams = {}, requestCfg, requestHeaders, requestResult, callbackWrapper; cfg = cfg || {}; requestHeaders = cfg.requestHeaders || {}; req...
javascript
function (cfg) { this.log("retrieveStateIds"); var requestParams = {}, requestCfg, requestHeaders, requestResult, callbackWrapper; cfg = cfg || {}; requestHeaders = cfg.requestHeaders || {}; req...
[ "function", "(", "cfg", ")", "{", "this", ".", "log", "(", "\"retrieveStateIds\"", ")", ";", "var", "requestParams", "=", "{", "}", ",", "requestCfg", ",", "requestHeaders", ",", "requestResult", ",", "callbackWrapper", ";", "cfg", "=", "cfg", "||", "{", ...
Retrieve the list of IDs for a state, when used from a browser sends to the endpoint using the RESTful interface. @method retrieveStateIds @param {Object} cfg Configuration options @param {TinCan.Activity} cfg.activity Activity in document identifier @param {TinCan.Agent} cfg.agent Agent in document identifier @param ...
[ "Retrieve", "the", "list", "of", "IDs", "for", "a", "state", "when", "used", "from", "a", "browser", "sends", "to", "the", "endpoint", "using", "the", "RESTful", "interface", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L3242-L3325
20,246
RusticiSoftware/TinCanJS
build/tincan.js
function (key, val, cfg) { this.log("saveState"); var requestParams, requestCfg, requestHeaders; requestHeaders = cfg.requestHeaders || {}; if (typeof cfg.contentType === "undefined") { cfg.contentType = "application/octet...
javascript
function (key, val, cfg) { this.log("saveState"); var requestParams, requestCfg, requestHeaders; requestHeaders = cfg.requestHeaders || {}; if (typeof cfg.contentType === "undefined") { cfg.contentType = "application/octet...
[ "function", "(", "key", ",", "val", ",", "cfg", ")", "{", "this", ".", "log", "(", "\"saveState\"", ")", ";", "var", "requestParams", ",", "requestCfg", ",", "requestHeaders", ";", "requestHeaders", "=", "cfg", ".", "requestHeaders", "||", "{", "}", ";",...
Save a state value, when used from a browser sends to the endpoint using the RESTful interface. @method saveState @param {String} key Key of state to save @param val Value to be stored @param {Object} cfg Configuration options @param {TinCan.Activity} cfg.activity Activity in document identifier @param {TinCan.Agent} ...
[ "Save", "a", "state", "value", "when", "used", "from", "a", "browser", "sends", "to", "the", "endpoint", "using", "the", "RESTful", "interface", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L3343-L3399
20,247
RusticiSoftware/TinCanJS
build/tincan.js
function (key, cfg) { this.log("dropState"); var requestParams, requestCfg, requestHeaders; requestHeaders = cfg.requestHeaders || {}; requestParams = { activityId: cfg.activity.id }; if (this.versi...
javascript
function (key, cfg) { this.log("dropState"); var requestParams, requestCfg, requestHeaders; requestHeaders = cfg.requestHeaders || {}; requestParams = { activityId: cfg.activity.id }; if (this.versi...
[ "function", "(", "key", ",", "cfg", ")", "{", "this", ".", "log", "(", "\"dropState\"", ")", ";", "var", "requestParams", ",", "requestCfg", ",", "requestHeaders", ";", "requestHeaders", "=", "cfg", ".", "requestHeaders", "||", "{", "}", ";", "requestParam...
Drop a state value or all of the state, when used from a browser sends to the endpoint using the RESTful interface. @method dropState @param {String|null} key Key of state to delete, or null for all @param {Object} cfg Configuration options @param {TinCan.Activity} cfg.activity Activity in document identifier @param {...
[ "Drop", "a", "state", "value", "or", "all", "of", "the", "state", "when", "used", "from", "a", "browser", "sends", "to", "the", "endpoint", "using", "the", "RESTful", "interface", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L3413-L3454
20,248
RusticiSoftware/TinCanJS
build/tincan.js
function (activityId, cfg) { this.log("retrieveActivity"); var requestCfg = {}, requestResult, callbackWrapper, requestHeaders; requestHeaders = cfg.requestHeaders || {}; requestCfg = { url: "activities", ...
javascript
function (activityId, cfg) { this.log("retrieveActivity"); var requestCfg = {}, requestResult, callbackWrapper, requestHeaders; requestHeaders = cfg.requestHeaders || {}; requestCfg = { url: "activities", ...
[ "function", "(", "activityId", ",", "cfg", ")", "{", "this", ".", "log", "(", "\"retrieveActivity\"", ")", ";", "var", "requestCfg", "=", "{", "}", ",", "requestResult", ",", "callbackWrapper", ",", "requestHeaders", ";", "requestHeaders", "=", "cfg", ".", ...
Retrieve an activity, when used from a browser sends to the endpoint using the RESTful interface. @method retrieveActivity @param {String} activityId id of the Activity to retrieve @param {Object} cfg Configuration options @param {Function} [cfg.callback] Callback to execute on completion @param {Object} [cfg.requestH...
[ "Retrieve", "an", "activity", "when", "used", "from", "a", "browser", "sends", "to", "the", "endpoint", "using", "the", "RESTful", "interface", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L3466-L3531
20,249
RusticiSoftware/TinCanJS
build/tincan.js
function (cfg) { this.log("retrieveActivityProfileIds"); var requestCfg, requestHeaders, requestResult, callbackWrapper; cfg = cfg || {}; requestHeaders = cfg.requestHeaders || {}; requestCfg = { ...
javascript
function (cfg) { this.log("retrieveActivityProfileIds"); var requestCfg, requestHeaders, requestResult, callbackWrapper; cfg = cfg || {}; requestHeaders = cfg.requestHeaders || {}; requestCfg = { ...
[ "function", "(", "cfg", ")", "{", "this", ".", "log", "(", "\"retrieveActivityProfileIds\"", ")", ";", "var", "requestCfg", ",", "requestHeaders", ",", "requestResult", ",", "callbackWrapper", ";", "cfg", "=", "cfg", "||", "{", "}", ";", "requestHeaders", "=...
Retrieve the list of IDs for an activity profile, when used from a browser sends to the endpoint using the RESTful interface. @method retrieveActivityProfileIds @param {Object} cfg Configuration options @param {TinCan.Activity} cfg.activity Activity in document identifier @param {Function} [cfg.callback] Callback to e...
[ "Retrieve", "the", "list", "of", "IDs", "for", "an", "activity", "profile", "when", "used", "from", "a", "browser", "sends", "to", "the", "endpoint", "using", "the", "RESTful", "interface", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L3675-L3743
20,250
RusticiSoftware/TinCanJS
build/tincan.js
function (key, val, cfg) { this.log("saveActivityProfile"); var requestCfg, requestHeaders; requestHeaders = cfg.requestHeaders || {}; if (typeof cfg.contentType === "undefined") { cfg.contentType = "application/octet-stream"; ...
javascript
function (key, val, cfg) { this.log("saveActivityProfile"); var requestCfg, requestHeaders; requestHeaders = cfg.requestHeaders || {}; if (typeof cfg.contentType === "undefined") { cfg.contentType = "application/octet-stream"; ...
[ "function", "(", "key", ",", "val", ",", "cfg", ")", "{", "this", ".", "log", "(", "\"saveActivityProfile\"", ")", ";", "var", "requestCfg", ",", "requestHeaders", ";", "requestHeaders", "=", "cfg", ".", "requestHeaders", "||", "{", "}", ";", "if", "(", ...
Save an activity profile value, when used from a browser sends to the endpoint using the RESTful interface. @method saveActivityProfile @param {String} key Key of activity profile to retrieve @param val Value to be stored @param {Object} cfg Configuration options @param {TinCan.Activity} cfg.activity Activity in docum...
[ "Save", "an", "activity", "profile", "value", "when", "used", "from", "a", "browser", "sends", "to", "the", "endpoint", "using", "the", "RESTful", "interface", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L3759-L3801
20,251
RusticiSoftware/TinCanJS
build/tincan.js
function (key, cfg) { this.log("dropActivityProfile"); var requestParams, requestCfg, requestHeaders; requestHeaders = cfg.requestHeaders || {}; requestParams = { profileId: key, activityId: cfg.activity.id...
javascript
function (key, cfg) { this.log("dropActivityProfile"); var requestParams, requestCfg, requestHeaders; requestHeaders = cfg.requestHeaders || {}; requestParams = { profileId: key, activityId: cfg.activity.id...
[ "function", "(", "key", ",", "cfg", ")", "{", "this", ".", "log", "(", "\"dropActivityProfile\"", ")", ";", "var", "requestParams", ",", "requestCfg", ",", "requestHeaders", ";", "requestHeaders", "=", "cfg", ".", "requestHeaders", "||", "{", "}", ";", "re...
Drop an activity profile value, when used from a browser sends to the endpoint using the RESTful interface. Full activity profile delete is not supported by the spec. @method dropActivityProfile @param {String|null} key Key of activity profile to delete @param {Object} cfg Configuration options @param {TinCan.Activity...
[ "Drop", "an", "activity", "profile", "value", "when", "used", "from", "a", "browser", "sends", "to", "the", "endpoint", "using", "the", "RESTful", "interface", ".", "Full", "activity", "profile", "delete", "is", "not", "supported", "by", "the", "spec", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L3814-L3839
20,252
RusticiSoftware/TinCanJS
build/tincan.js
function (key, cfg) { this.log("retrieveAgentProfile"); var requestCfg = {}, requestResult, callbackWrapper, requestHeaders, self = this; requestHeaders = cfg.requestHeaders || {}; requestCfg = { ...
javascript
function (key, cfg) { this.log("retrieveAgentProfile"); var requestCfg = {}, requestResult, callbackWrapper, requestHeaders, self = this; requestHeaders = cfg.requestHeaders || {}; requestCfg = { ...
[ "function", "(", "key", ",", "cfg", ")", "{", "this", ".", "log", "(", "\"retrieveAgentProfile\"", ")", ";", "var", "requestCfg", "=", "{", "}", ",", "requestResult", ",", "callbackWrapper", ",", "requestHeaders", ",", "self", "=", "this", ";", "requestHea...
Retrieve an agent profile value, when used from a browser sends to the endpoint using the RESTful interface. @method retrieveAgentProfile @param {String} key Key of agent profile to retrieve @param {Object} cfg Configuration options @param {TinCan.Agent} cfg.agent Agent in document identifier @param {Function} [cfg.ca...
[ "Retrieve", "an", "agent", "profile", "value", "when", "used", "from", "a", "browser", "sends", "to", "the", "endpoint", "using", "the", "RESTful", "interface", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L3852-L3976
20,253
RusticiSoftware/TinCanJS
build/tincan.js
function (key, val, cfg) { this.log("saveAgentProfile"); var requestCfg, requestHeaders; requestHeaders = cfg.requestHeaders || {}; if (typeof cfg.contentType === "undefined") { cfg.contentType = "application/octet-stream"; } ...
javascript
function (key, val, cfg) { this.log("saveAgentProfile"); var requestCfg, requestHeaders; requestHeaders = cfg.requestHeaders || {}; if (typeof cfg.contentType === "undefined") { cfg.contentType = "application/octet-stream"; } ...
[ "function", "(", "key", ",", "val", ",", "cfg", ")", "{", "this", ".", "log", "(", "\"saveAgentProfile\"", ")", ";", "var", "requestCfg", ",", "requestHeaders", ";", "requestHeaders", "=", "cfg", ".", "requestHeaders", "||", "{", "}", ";", "if", "(", "...
Save an agent profile value, when used from a browser sends to the endpoint using the RESTful interface. @method saveAgentProfile @param {String} key Key of agent profile to retrieve @param val Value to be stored @param {Object} cfg Configuration options @param {TinCan.Agent} cfg.agent Agent in document identifier @pa...
[ "Save", "an", "agent", "profile", "value", "when", "used", "from", "a", "browser", "sends", "to", "the", "endpoint", "using", "the", "RESTful", "interface", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L4081-L4129
20,254
RusticiSoftware/TinCanJS
build/tincan.js
function (key, cfg) { this.log("dropAgentProfile"); var requestParams, requestCfg, requestHeaders; requestHeaders = cfg.requestHeaders || {}; requestParams = { profileId: key }; requestCfg = { ...
javascript
function (key, cfg) { this.log("dropAgentProfile"); var requestParams, requestCfg, requestHeaders; requestHeaders = cfg.requestHeaders || {}; requestParams = { profileId: key }; requestCfg = { ...
[ "function", "(", "key", ",", "cfg", ")", "{", "this", ".", "log", "(", "\"dropAgentProfile\"", ")", ";", "var", "requestParams", ",", "requestCfg", ",", "requestHeaders", ";", "requestHeaders", "=", "cfg", ".", "requestHeaders", "||", "{", "}", ";", "reque...
Drop an agent profile value, when used from a browser sends to the endpoint using the RESTful interface. Full agent profile delete is not supported by the spec. @method dropAgentProfile @param {String|null} key Key of agent profile to delete @param {Object} cfg Configuration options @param {TinCan.Agent} cfg.agent Age...
[ "Drop", "an", "agent", "profile", "value", "when", "used", "from", "a", "browser", "sends", "to", "the", "endpoint", "using", "the", "RESTful", "interface", ".", "Full", "agent", "profile", "delete", "is", "not", "supported", "by", "the", "spec", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L4142-L4172
20,255
RusticiSoftware/TinCanJS
build/tincan.js
function () { this.log("hasAttachmentWithContent"); var i; if (this.attachments === null) { return false; } for (i = 0; i < this.attachments.length; i += 1) { if (this.attachments[i].content !== null) { ret...
javascript
function () { this.log("hasAttachmentWithContent"); var i; if (this.attachments === null) { return false; } for (i = 0; i < this.attachments.length; i += 1) { if (this.attachments[i].content !== null) { ret...
[ "function", "(", ")", "{", "this", ".", "log", "(", "\"hasAttachmentWithContent\"", ")", ";", "var", "i", ";", "if", "(", "this", ".", "attachments", "===", "null", ")", "{", "return", "false", ";", "}", "for", "(", "i", "=", "0", ";", "i", "<", ...
Checks if the Statement has at least one attachment with content @method hasAttachmentsWithContent
[ "Checks", "if", "the", "Statement", "has", "at", "least", "one", "attachment", "with", "content" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L7096-L7111
20,256
RusticiSoftware/TinCanJS
build/tincan.js
function(token) { if (Array.isArray(token)) { var tokens = /**@type {!Array.<number>}*/(token); while (tokens.length) this.tokens.push(tokens.pop()); } else { this.tokens.push(token); } }
javascript
function(token) { if (Array.isArray(token)) { var tokens = /**@type {!Array.<number>}*/(token); while (tokens.length) this.tokens.push(tokens.pop()); } else { this.tokens.push(token); } }
[ "function", "(", "token", ")", "{", "if", "(", "Array", ".", "isArray", "(", "token", ")", ")", "{", "var", "tokens", "=", "/**@type {!Array.<number>}*/", "(", "token", ")", ";", "while", "(", "tokens", ".", "length", ")", "this", ".", "tokens", ".", ...
When one or more tokens are prepended to a stream, those tokens must be inserted, in given order, before the first token in the stream. @param {(number|!Array.<number>)} token The token(s) to prepend to the stream.
[ "When", "one", "or", "more", "tokens", "are", "prepended", "to", "a", "stream", "those", "tokens", "must", "be", "inserted", "in", "given", "order", "before", "the", "first", "token", "in", "the", "stream", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L9933-L9941
20,257
RusticiSoftware/TinCanJS
build/tincan.js
function(token) { if (Array.isArray(token)) { var tokens = /**@type {!Array.<number>}*/(token); while (tokens.length) this.tokens.unshift(tokens.shift()); } else { this.tokens.unshift(token); } }
javascript
function(token) { if (Array.isArray(token)) { var tokens = /**@type {!Array.<number>}*/(token); while (tokens.length) this.tokens.unshift(tokens.shift()); } else { this.tokens.unshift(token); } }
[ "function", "(", "token", ")", "{", "if", "(", "Array", ".", "isArray", "(", "token", ")", ")", "{", "var", "tokens", "=", "/**@type {!Array.<number>}*/", "(", "token", ")", ";", "while", "(", "tokens", ".", "length", ")", "this", ".", "tokens", ".", ...
When one or more tokens are pushed to a stream, those tokens must be inserted, in given order, after the last token in the stream. @param {(number|!Array.<number>)} token The tokens(s) to push to the stream.
[ "When", "one", "or", "more", "tokens", "are", "pushed", "to", "a", "stream", "those", "tokens", "must", "be", "inserted", "in", "given", "order", "after", "the", "last", "token", "in", "the", "stream", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L9951-L9959
20,258
RusticiSoftware/TinCanJS
build/tincan.js
TextDecoder
function TextDecoder(label, options) { // Web IDL conventions if (!(this instanceof TextDecoder)) throw TypeError('Called as a function. Did you forget \'new\'?'); label = label !== undefined ? String(label) : DEFAULT_ENCODING; options = ToDictionary(options); // A TextDecoder object has an a...
javascript
function TextDecoder(label, options) { // Web IDL conventions if (!(this instanceof TextDecoder)) throw TypeError('Called as a function. Did you forget \'new\'?'); label = label !== undefined ? String(label) : DEFAULT_ENCODING; options = ToDictionary(options); // A TextDecoder object has an a...
[ "function", "TextDecoder", "(", "label", ",", "options", ")", "{", "// Web IDL conventions", "if", "(", "!", "(", "this", "instanceof", "TextDecoder", ")", ")", "throw", "TypeError", "(", "'Called as a function. Did you forget \\'new\\'?'", ")", ";", "label", "=", ...
8.1 Interface TextDecoder @constructor @param {string=} label The label of the encoding; defaults to 'utf-8'. @param {Object=} options
[ "8", ".", "1", "Interface", "TextDecoder" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L10679-L10742
20,259
RusticiSoftware/TinCanJS
build/tincan.js
serializeStream
function serializeStream(stream) { // 1. Let token be the result of reading from stream. // (Done in-place on array, rather than as a stream) // 2. If encoding is UTF-8, UTF-16BE, or UTF-16LE, and ignore // BOM flag and BOM seen flag are unset, run these subsubsteps: if (includes(['UTF-8'...
javascript
function serializeStream(stream) { // 1. Let token be the result of reading from stream. // (Done in-place on array, rather than as a stream) // 2. If encoding is UTF-8, UTF-16BE, or UTF-16LE, and ignore // BOM flag and BOM seen flag are unset, run these subsubsteps: if (includes(['UTF-8'...
[ "function", "serializeStream", "(", "stream", ")", "{", "// 1. Let token be the result of reading from stream.", "// (Done in-place on array, rather than as a stream)", "// 2. If encoding is UTF-8, UTF-16BE, or UTF-16LE, and ignore", "// BOM flag and BOM seen flag are unset, run these subsubsteps:...
A TextDecoder object also has an associated serialize stream algorithm... @param {!Array.<number>} stream @return {string} @this {TextDecoder}
[ "A", "TextDecoder", "object", "also", "has", "an", "associated", "serialize", "stream", "algorithm", "..." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L10865-L10889
20,260
RusticiSoftware/TinCanJS
build/tincan.js
TextEncoder
function TextEncoder(label, options) { // Web IDL conventions if (!(this instanceof TextEncoder)) throw TypeError('Called as a function. Did you forget \'new\'?'); options = ToDictionary(options); // A TextEncoder object has an associated encoding and encoder. /** @private */ this._encod...
javascript
function TextEncoder(label, options) { // Web IDL conventions if (!(this instanceof TextEncoder)) throw TypeError('Called as a function. Did you forget \'new\'?'); options = ToDictionary(options); // A TextEncoder object has an associated encoding and encoder. /** @private */ this._encod...
[ "function", "TextEncoder", "(", "label", ",", "options", ")", "{", "// Web IDL conventions", "if", "(", "!", "(", "this", "instanceof", "TextEncoder", ")", ")", "throw", "TypeError", "(", "'Called as a function. Did you forget \\'new\\'?'", ")", ";", "options", "=",...
8.2 Interface TextEncoder @constructor @param {string=} label The label of the encoding. NONSTANDARD. @param {Object=} options NONSTANDARD.
[ "8", ".", "2", "Interface", "TextEncoder" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L10901-L10951
20,261
RusticiSoftware/TinCanJS
build/tincan.js
UTF8Encoder
function UTF8Encoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.<number>)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If c...
javascript
function UTF8Encoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.<number>)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If c...
[ "function", "UTF8Encoder", "(", "options", ")", "{", "var", "fatal", "=", "options", ".", "fatal", ";", "/**\n * @param {Stream} stream Input stream.\n * @param {number} code_point Next code point read from the stream.\n * @return {(number|!Array.<number>)} Byte(s) to emit.\n ...
9.1.2 utf-8 encoder @constructor @implements {Encoder} @param {{fatal: boolean}} options
[ "9", ".", "1", ".", "2", "utf", "-", "8", "encoder" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L11177-L11235
20,262
RusticiSoftware/TinCanJS
build/tincan.js
SingleByteDecoder
function SingleByteDecoder(index, options) { var fatal = options.fatal; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.<number>)} The next code point(s) * decoded, or null if not enough...
javascript
function SingleByteDecoder(index, options) { var fatal = options.fatal; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.<number>)} The next code point(s) * decoded, or null if not enough...
[ "function", "SingleByteDecoder", "(", "index", ",", "options", ")", "{", "var", "fatal", "=", "options", ".", "fatal", ";", "/**\n * @param {Stream} stream The stream of bytes being decoded.\n * @param {number} bite The next byte read from the stream.\n * @return {?(number|...
10.1 single-byte decoder @constructor @implements {Decoder} @param {!Array.<number>} index The encoding index. @param {{fatal: boolean}} options
[ "10", ".", "1", "single", "-", "byte", "decoder" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L11257-L11287
20,263
RusticiSoftware/TinCanJS
build/tincan.js
GB18030Decoder
function GB18030Decoder(options) { var fatal = options.fatal; // gb18030's decoder has an associated gb18030 first, gb18030 // second, and gb18030 third (all initially 0x00). var /** @type {number} */ gb18030_first = 0x00, /** @type {number} */ gb18030_second = 0x00, /** @type {number} *...
javascript
function GB18030Decoder(options) { var fatal = options.fatal; // gb18030's decoder has an associated gb18030 first, gb18030 // second, and gb18030 third (all initially 0x00). var /** @type {number} */ gb18030_first = 0x00, /** @type {number} */ gb18030_second = 0x00, /** @type {number} *...
[ "function", "GB18030Decoder", "(", "options", ")", "{", "var", "fatal", "=", "options", ".", "fatal", ";", "// gb18030's decoder has an associated gb18030 first, gb18030", "// second, and gb18030 third (all initially 0x00).", "var", "/** @type {number} */", "gb18030_first", "=", ...
11.2.1 gb18030 decoder @constructor @implements {Decoder} @param {{fatal: boolean}} options
[ "11", ".", "2", ".", "1", "gb18030", "decoder" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L11375-L11523
20,264
RusticiSoftware/TinCanJS
build/tincan.js
GB18030Encoder
function GB18030Encoder(options, gbk_flag) { var fatal = options.fatal; // gb18030's decoder has an associated gbk flag (initially unset). /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.<number>)} Byte(s)...
javascript
function GB18030Encoder(options, gbk_flag) { var fatal = options.fatal; // gb18030's decoder has an associated gbk flag (initially unset). /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.<number>)} Byte(s)...
[ "function", "GB18030Encoder", "(", "options", ",", "gbk_flag", ")", "{", "var", "fatal", "=", "options", ".", "fatal", ";", "// gb18030's decoder has an associated gbk flag (initially unset).", "/**\n * @param {Stream} stream Input stream.\n * @param {number} code_point Next ...
11.2.2 gb18030 encoder @constructor @implements {Encoder} @param {{fatal: boolean}} options @param {boolean=} gbk_flag
[ "11", ".", "2", ".", "2", "gb18030", "encoder" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L11532-L11612
20,265
RusticiSoftware/TinCanJS
build/tincan.js
Big5Decoder
function Big5Decoder(options) { var fatal = options.fatal; // big5's decoder has an associated big5 lead (initially 0x00). var /** @type {number} */ big5_lead = 0x00; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. ...
javascript
function Big5Decoder(options) { var fatal = options.fatal; // big5's decoder has an associated big5 lead (initially 0x00). var /** @type {number} */ big5_lead = 0x00; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. ...
[ "function", "Big5Decoder", "(", "options", ")", "{", "var", "fatal", "=", "options", ".", "fatal", ";", "// big5's decoder has an associated big5 lead (initially 0x00).", "var", "/** @type {number} */", "big5_lead", "=", "0x00", ";", "/**\n * @param {Stream} stream The st...
12.1.1 big5 decoder @constructor @implements {Decoder} @param {{fatal: boolean}} options
[ "12", ".", "1", ".", "1", "big5", "decoder" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L11636-L11727
20,266
RusticiSoftware/TinCanJS
build/tincan.js
Big5Encoder
function Big5Encoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.<number>)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If c...
javascript
function Big5Encoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.<number>)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If c...
[ "function", "Big5Encoder", "(", "options", ")", "{", "var", "fatal", "=", "options", ".", "fatal", ";", "/**\n * @param {Stream} stream Input stream.\n * @param {number} code_point Next code point read from the stream.\n * @return {(number|!Array.<number>)} Byte(s) to emit.\n ...
12.1.2 big5 encoder @constructor @implements {Encoder} @param {{fatal: boolean}} options
[ "12", ".", "1", ".", "2", "big5", "encoder" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L11735-L11776
20,267
RusticiSoftware/TinCanJS
build/tincan.js
EUCJPDecoder
function EUCJPDecoder(options) { var fatal = options.fatal; // euc-jp's decoder has an associated euc-jp jis0212 flag // (initially unset) and euc-jp lead (initially 0x00). var /** @type {boolean} */ eucjp_jis0212_flag = false, /** @type {number} */ eucjp_lead = 0x00; /** * @param {St...
javascript
function EUCJPDecoder(options) { var fatal = options.fatal; // euc-jp's decoder has an associated euc-jp jis0212 flag // (initially unset) and euc-jp lead (initially 0x00). var /** @type {boolean} */ eucjp_jis0212_flag = false, /** @type {number} */ eucjp_lead = 0x00; /** * @param {St...
[ "function", "EUCJPDecoder", "(", "options", ")", "{", "var", "fatal", "=", "options", ".", "fatal", ";", "// euc-jp's decoder has an associated euc-jp jis0212 flag", "// (initially unset) and euc-jp lead (initially 0x00).", "var", "/** @type {boolean} */", "eucjp_jis0212_flag", "...
13.1.1 euc-jp decoder @constructor @implements {Decoder} @param {{fatal: boolean}} options
[ "13", ".", "1", ".", "1", "euc", "-", "jp", "decoder" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L11800-L11895
20,268
RusticiSoftware/TinCanJS
build/tincan.js
ISO2022JPEncoder
function ISO2022JPEncoder(options) { var fatal = options.fatal; // iso-2022-jp's encoder has an associated iso-2022-jp encoder // state which is one of ASCII, Roman, and jis0208 (initially // ASCII). /** @enum */ var states = { ASCII: 0, Roman: 1, jis0208: 2 }; var /** ...
javascript
function ISO2022JPEncoder(options) { var fatal = options.fatal; // iso-2022-jp's encoder has an associated iso-2022-jp encoder // state which is one of ASCII, Roman, and jis0208 (initially // ASCII). /** @enum */ var states = { ASCII: 0, Roman: 1, jis0208: 2 }; var /** ...
[ "function", "ISO2022JPEncoder", "(", "options", ")", "{", "var", "fatal", "=", "options", ".", "fatal", ";", "// iso-2022-jp's encoder has an associated iso-2022-jp encoder", "// state which is one of ASCII, Roman, and jis0208 (initially", "// ASCII).", "/** @enum */", "var", "st...
13.2.2 iso-2022-jp encoder @constructor @implements {Encoder} @param {{fatal: boolean}} options
[ "13", ".", "2", ".", "2", "iso", "-", "2022", "-", "jp", "encoder" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L12282-L12405
20,269
RusticiSoftware/TinCanJS
build/tincan.js
ShiftJISDecoder
function ShiftJISDecoder(options) { var fatal = options.fatal; // shift_jis's decoder has an associated shift_jis lead (initially // 0x00). var /** @type {number} */ shiftjis_lead = 0x00; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte r...
javascript
function ShiftJISDecoder(options) { var fatal = options.fatal; // shift_jis's decoder has an associated shift_jis lead (initially // 0x00). var /** @type {number} */ shiftjis_lead = 0x00; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte r...
[ "function", "ShiftJISDecoder", "(", "options", ")", "{", "var", "fatal", "=", "options", ".", "fatal", ";", "// shift_jis's decoder has an associated shift_jis lead (initially", "// 0x00).", "var", "/** @type {number} */", "shiftjis_lead", "=", "0x00", ";", "/**\n * @pa...
13.3.1 shift_jis decoder @constructor @implements {Decoder} @param {{fatal: boolean}} options
[ "13", ".", "3", ".", "1", "shift_jis", "decoder" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L12424-L12515
20,270
RusticiSoftware/TinCanJS
build/tincan.js
ShiftJISEncoder
function ShiftJISEncoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.<number>)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. ...
javascript
function ShiftJISEncoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.<number>)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. ...
[ "function", "ShiftJISEncoder", "(", "options", ")", "{", "var", "fatal", "=", "options", ".", "fatal", ";", "/**\n * @param {Stream} stream Input stream.\n * @param {number} code_point Next code point read from the stream.\n * @return {(number|!Array.<number>)} Byte(s) to emit....
13.3.2 shift_jis encoder @constructor @implements {Encoder} @param {{fatal: boolean}} options
[ "13", ".", "3", ".", "2", "shift_jis", "encoder" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L12523-L12582
20,271
RusticiSoftware/TinCanJS
build/tincan.js
EUCKRDecoder
function EUCKRDecoder(options) { var fatal = options.fatal; // euc-kr's decoder has an associated euc-kr lead (initially 0x00). var /** @type {number} */ euckr_lead = 0x00; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the strea...
javascript
function EUCKRDecoder(options) { var fatal = options.fatal; // euc-kr's decoder has an associated euc-kr lead (initially 0x00). var /** @type {number} */ euckr_lead = 0x00; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the strea...
[ "function", "EUCKRDecoder", "(", "options", ")", "{", "var", "fatal", "=", "options", ".", "fatal", ";", "// euc-kr's decoder has an associated euc-kr lead (initially 0x00).", "var", "/** @type {number} */", "euckr_lead", "=", "0x00", ";", "/**\n * @param {Stream} stream ...
14.1.1 euc-kr decoder @constructor @implements {Decoder} @param {{fatal: boolean}} options
[ "14", ".", "1", ".", "1", "euc", "-", "kr", "decoder" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L12605-L12676
20,272
RusticiSoftware/TinCanJS
build/tincan.js
EUCKREncoder
function EUCKREncoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.<number>)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If ...
javascript
function EUCKREncoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.<number>)} Byte(s) to emit. */ this.handler = function(stream, code_point) { // 1. If ...
[ "function", "EUCKREncoder", "(", "options", ")", "{", "var", "fatal", "=", "options", ".", "fatal", ";", "/**\n * @param {Stream} stream Input stream.\n * @param {number} code_point Next code point read from the stream.\n * @return {(number|!Array.<number>)} Byte(s) to emit.\n ...
14.1.2 euc-kr encoder @constructor @implements {Encoder} @param {{fatal: boolean}} options
[ "14", ".", "1", ".", "2", "euc", "-", "kr", "encoder" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L12684-L12718
20,273
RusticiSoftware/TinCanJS
build/tincan.js
convertCodeUnitToBytes
function convertCodeUnitToBytes(code_unit, utf16be) { // 1. Let byte1 be code unit >> 8. var byte1 = code_unit >> 8; // 2. Let byte2 be code unit & 0x00FF. var byte2 = code_unit & 0x00FF; // 3. Then return the bytes in order: // utf-16be flag is set: byte1, then byte2. if (utf16be) ...
javascript
function convertCodeUnitToBytes(code_unit, utf16be) { // 1. Let byte1 be code unit >> 8. var byte1 = code_unit >> 8; // 2. Let byte2 be code unit & 0x00FF. var byte2 = code_unit & 0x00FF; // 3. Then return the bytes in order: // utf-16be flag is set: byte1, then byte2. if (utf16be) ...
[ "function", "convertCodeUnitToBytes", "(", "code_unit", ",", "utf16be", ")", "{", "// 1. Let byte1 be code unit >> 8.", "var", "byte1", "=", "code_unit", ">>", "8", ";", "// 2. Let byte2 be code unit & 0x00FF.", "var", "byte2", "=", "code_unit", "&", "0x00FF", ";", "/...
15.2 Common infrastructure for utf-16be and utf-16le @param {number} code_unit @param {boolean} utf16be @return {!Array.<number>} bytes
[ "15", ".", "2", "Common", "infrastructure", "for", "utf", "-", "16be", "and", "utf", "-", "16le" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L12745-L12758
20,274
RusticiSoftware/TinCanJS
build/tincan.js
UTF16Decoder
function UTF16Decoder(utf16_be, options) { var fatal = options.fatal; var /** @type {?number} */ utf16_lead_byte = null, /** @type {?number} */ utf16_lead_surrogate = null; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the st...
javascript
function UTF16Decoder(utf16_be, options) { var fatal = options.fatal; var /** @type {?number} */ utf16_lead_byte = null, /** @type {?number} */ utf16_lead_surrogate = null; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the st...
[ "function", "UTF16Decoder", "(", "utf16_be", ",", "options", ")", "{", "var", "fatal", "=", "options", ".", "fatal", ";", "var", "/** @type {?number} */", "utf16_lead_byte", "=", "null", ",", "/** @type {?number} */", "utf16_lead_surrogate", "=", "null", ";", "/**...
15.2.1 shared utf-16 decoder @constructor @implements {Decoder} @param {boolean} utf16_be True if big-endian, false if little-endian. @param {{fatal: boolean}} options
[ "15", ".", "2", ".", "1", "shared", "utf", "-", "16", "decoder" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L12767-L12852
20,275
RusticiSoftware/TinCanJS
build/tincan.js
UTF16Encoder
function UTF16Encoder(utf16_be, options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.<number>)} Byte(s) to emit. */ this.handler = function(stream, code_point) { ...
javascript
function UTF16Encoder(utf16_be, options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.<number>)} Byte(s) to emit. */ this.handler = function(stream, code_point) { ...
[ "function", "UTF16Encoder", "(", "utf16_be", ",", "options", ")", "{", "var", "fatal", "=", "options", ".", "fatal", ";", "/**\n * @param {Stream} stream Input stream.\n * @param {number} code_point Next code point read from the stream.\n * @return {(number|!Array.<number>)...
15.2.2 shared utf-16 encoder @constructor @implements {Encoder} @param {boolean} utf16_be True if big-endian, false if little-endian. @param {{fatal: boolean}} options
[ "15", ".", "2", ".", "2", "shared", "utf", "-", "16", "encoder" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L12861-L12892
20,276
RusticiSoftware/TinCanJS
build/tincan.js
XUserDefinedDecoder
function XUserDefinedDecoder(options) { var fatal = options.fatal; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.<number>)} The next code point(s) * decoded, or null if not enough data...
javascript
function XUserDefinedDecoder(options) { var fatal = options.fatal; /** * @param {Stream} stream The stream of bytes being decoded. * @param {number} bite The next byte read from the stream. * @return {?(number|!Array.<number>)} The next code point(s) * decoded, or null if not enough data...
[ "function", "XUserDefinedDecoder", "(", "options", ")", "{", "var", "fatal", "=", "options", ".", "fatal", ";", "/**\n * @param {Stream} stream The stream of bytes being decoded.\n * @param {number} bite The next byte read from the stream.\n * @return {?(number|!Array.<number>)...
15.5.1 x-user-defined decoder @constructor @implements {Decoder} @param {{fatal: boolean}} options
[ "15", ".", "5", ".", "1", "x", "-", "user", "-", "defined", "decoder" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L12926-L12948
20,277
RusticiSoftware/TinCanJS
build/tincan.js
XUserDefinedEncoder
function XUserDefinedEncoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.<number>)} Byte(s) to emit. */ this.handler = function(stream, code_point) { //...
javascript
function XUserDefinedEncoder(options) { var fatal = options.fatal; /** * @param {Stream} stream Input stream. * @param {number} code_point Next code point read from the stream. * @return {(number|!Array.<number>)} Byte(s) to emit. */ this.handler = function(stream, code_point) { //...
[ "function", "XUserDefinedEncoder", "(", "options", ")", "{", "var", "fatal", "=", "options", ".", "fatal", ";", "/**\n * @param {Stream} stream Input stream.\n * @param {number} code_point Next code point read from the stream.\n * @return {(number|!Array.<number>)} Byte(s) to e...
15.5.2 x-user-defined encoder @constructor @implements {Encoder} @param {{fatal: boolean}} options
[ "15", ".", "5", ".", "2", "x", "-", "user", "-", "defined", "encoder" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/build/tincan.js#L12956-L12981
20,278
RusticiSoftware/TinCanJS
vendor/cryptojs-v3.0.2/components/tripledes.js
exchangeLR
function exchangeLR(offset, mask) { var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask; this._rBlock ^= t; this._lBlock ^= t << offset; }
javascript
function exchangeLR(offset, mask) { var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask; this._rBlock ^= t; this._lBlock ^= t << offset; }
[ "function", "exchangeLR", "(", "offset", ",", "mask", ")", "{", "var", "t", "=", "(", "(", "this", ".", "_lBlock", ">>>", "offset", ")", "^", "this", ".", "_rBlock", ")", "&", "mask", ";", "this", ".", "_rBlock", "^=", "t", ";", "this", ".", "_lB...
Swap bits across the left and right words
[ "Swap", "bits", "across", "the", "left", "and", "right", "words" ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/vendor/cryptojs-v3.0.2/components/tripledes.js#L307-L311
20,279
RusticiSoftware/TinCanJS
vendor/cryptojs-v3.0.2/components/cipher-core.js
function (xformMode, key, cfg) { // Apply config defaults this.cfg = this.cfg.extend(cfg); // Store transform mode and key this._xformMode = xformMode; this._key = key; // Set initial values this.reset(); }
javascript
function (xformMode, key, cfg) { // Apply config defaults this.cfg = this.cfg.extend(cfg); // Store transform mode and key this._xformMode = xformMode; this._key = key; // Set initial values this.reset(); }
[ "function", "(", "xformMode", ",", "key", ",", "cfg", ")", "{", "// Apply config defaults\r", "this", ".", "cfg", "=", "this", ".", "cfg", ".", "extend", "(", "cfg", ")", ";", "// Store transform mode and key\r", "this", ".", "_xformMode", "=", "xformMode", ...
Initializes a newly created cipher. @param {number} xformMode Either the encryption or decryption transormation mode constant. @param {WordArray} key The key. @param {Object} cfg (Optional) The configuration options to use for this operation. @example var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFOR...
[ "Initializes", "a", "newly", "created", "cipher", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/vendor/cryptojs-v3.0.2/components/cipher-core.js#L86-L96
20,280
RusticiSoftware/TinCanJS
vendor/cryptojs-v3.0.2/components/cipher-core.js
function (cipher, ciphertext, key, cfg) { // Apply config defaults cfg = this.cfg.extend(cfg); // Convert string to CipherParams ciphertext = this._parse(ciphertext, cfg.format); // Decrypt var plaintext = cipher.createDecryptor(key, cfg)...
javascript
function (cipher, ciphertext, key, cfg) { // Apply config defaults cfg = this.cfg.extend(cfg); // Convert string to CipherParams ciphertext = this._parse(ciphertext, cfg.format); // Decrypt var plaintext = cipher.createDecryptor(key, cfg)...
[ "function", "(", "cipher", ",", "ciphertext", ",", "key", ",", "cfg", ")", "{", "// Apply config defaults\r", "cfg", "=", "this", ".", "cfg", ".", "extend", "(", "cfg", ")", ";", "// Convert string to CipherParams\r", "ciphertext", "=", "this", ".", "_parse", ...
Decrypts serialized ciphertext. @param {Cipher} cipher The cipher algorithm to use. @param {CipherParams|string} ciphertext The ciphertext to decrypt. @param {WordArray} key The key. @param {Object} cfg (Optional) The configuration options to use for this operation. @return {WordArray} The plaintext. @static @examp...
[ "Decrypts", "serialized", "ciphertext", "." ]
8733f14ddcaeea77a0579505300bc8f38921a6b1
https://github.com/RusticiSoftware/TinCanJS/blob/8733f14ddcaeea77a0579505300bc8f38921a6b1/vendor/cryptojs-v3.0.2/components/cipher-core.js#L701-L712
20,281
bugsnag/bugsnag-sourcemaps
index.js
validateOptions
function validateOptions (options) { if (typeof options.apiKey !== 'string') { throw new Error('You must provide a valid API key to upload sourcemaps to Bugsnag.') } if (typeof options.sourceMap !== 'string') { throw new Error('You must provide a path to the source map you want to upload.') } if (opti...
javascript
function validateOptions (options) { if (typeof options.apiKey !== 'string') { throw new Error('You must provide a valid API key to upload sourcemaps to Bugsnag.') } if (typeof options.sourceMap !== 'string') { throw new Error('You must provide a path to the source map you want to upload.') } if (opti...
[ "function", "validateOptions", "(", "options", ")", "{", "if", "(", "typeof", "options", ".", "apiKey", "!==", "'string'", ")", "{", "throw", "new", "Error", "(", "'You must provide a valid API key to upload sourcemaps to Bugsnag.'", ")", "}", "if", "(", "typeof", ...
Checks that the any required options are present and are not malformed. Some options also depend on each other in order to function correctly. Throws an error when there's a voilation. @param {object} options The options @returns {object}
[ "Checks", "that", "the", "any", "required", "options", "are", "present", "and", "are", "not", "malformed", ".", "Some", "options", "also", "depend", "on", "each", "other", "in", "order", "to", "function", "correctly", ".", "Throws", "an", "error", "when", ...
f3693373f0970ed308281144dd39a9db95242915
https://github.com/bugsnag/bugsnag-sourcemaps/blob/f3693373f0970ed308281144dd39a9db95242915/index.js#L42-L64
20,282
bugsnag/bugsnag-sourcemaps
index.js
stripProjectRoot
function stripProjectRoot (projectRoot, filePath) { if (typeof filePath === 'string') { // Check whether the path is an posix absolute file, otherwise check whether it's a // win32 valid absolute file. The order is important here because win32 treats posix // absolute paths as absolute, but posix doesn't ...
javascript
function stripProjectRoot (projectRoot, filePath) { if (typeof filePath === 'string') { // Check whether the path is an posix absolute file, otherwise check whether it's a // win32 valid absolute file. The order is important here because win32 treats posix // absolute paths as absolute, but posix doesn't ...
[ "function", "stripProjectRoot", "(", "projectRoot", ",", "filePath", ")", "{", "if", "(", "typeof", "filePath", "===", "'string'", ")", "{", "// Check whether the path is an posix absolute file, otherwise check whether it's a", "// win32 valid absolute file. The order is important ...
Strips the project root from the file path. @param {string} projectRoot The project root path @param {string} filePath The file path @returns {string}
[ "Strips", "the", "project", "root", "from", "the", "file", "path", "." ]
f3693373f0970ed308281144dd39a9db95242915
https://github.com/bugsnag/bugsnag-sourcemaps/blob/f3693373f0970ed308281144dd39a9db95242915/index.js#L73-L89
20,283
bugsnag/bugsnag-sourcemaps
index.js
readFileJSON
function readFileJSON (path) { return new Promise((resolve, reject) => { fs.readFile(path, (err, data) => { if (err) { reject(err) return } try { const json = JSON.parse(String(data)) resolve(json) } catch (err) { reject(err) } }) }) }
javascript
function readFileJSON (path) { return new Promise((resolve, reject) => { fs.readFile(path, (err, data) => { if (err) { reject(err) return } try { const json = JSON.parse(String(data)) resolve(json) } catch (err) { reject(err) } }) }) }
[ "function", "readFileJSON", "(", "path", ")", "{", "return", "new", "Promise", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "fs", ".", "readFile", "(", "path", ",", "(", "err", ",", "data", ")", "=>", "{", "if", "(", "err", ")", "{", "reje...
Reads a file and parses the content a JSON. If the file could not be read (because it doesn't exist) or it is not valid JSON, the promise is rejected - both cases with the Error object. @param {string} path The path to the file @returns {Promise<object>} The JSON contents of the file
[ "Reads", "a", "file", "and", "parses", "the", "content", "a", "JSON", "." ]
f3693373f0970ed308281144dd39a9db95242915
https://github.com/bugsnag/bugsnag-sourcemaps/blob/f3693373f0970ed308281144dd39a9db95242915/index.js#L100-L115
20,284
bugsnag/bugsnag-sourcemaps
index.js
transformSourcesMap
function transformSourcesMap (options) { return ( readFileJSON(options.sourceMap) .then(sourceMap => ( mapSources(sourceMap, path => { const relativePath = stripProjectRoot(options.projectRoot, path) return doesFileExist(path).then(exists => { if (exists && options.up...
javascript
function transformSourcesMap (options) { return ( readFileJSON(options.sourceMap) .then(sourceMap => ( mapSources(sourceMap, path => { const relativePath = stripProjectRoot(options.projectRoot, path) return doesFileExist(path).then(exists => { if (exists && options.up...
[ "function", "transformSourcesMap", "(", "options", ")", "{", "return", "(", "readFileJSON", "(", "options", ".", "sourceMap", ")", ".", "then", "(", "sourceMap", "=>", "(", "mapSources", "(", "sourceMap", ",", "path", "=>", "{", "const", "relativePath", "=",...
Extracts the source file paths from the specified source map file, and adds them to the "sources" option, so they are uploaded too. Note: The "projectRoot" option is used to create relative paths to the sources. @param {object} options The options @returns {Promise<object>}
[ "Extracts", "the", "source", "file", "paths", "from", "the", "specified", "source", "map", "file", "and", "adds", "them", "to", "the", "sources", "option", "so", "they", "are", "uploaded", "too", "." ]
f3693373f0970ed308281144dd39a9db95242915
https://github.com/bugsnag/bugsnag-sourcemaps/blob/f3693373f0970ed308281144dd39a9db95242915/index.js#L169-L206
20,285
bugsnag/bugsnag-sourcemaps
index.js
transformOptions
function transformOptions (options) { if (options.codeBundleId && options.appVersion) { delete options.appVersion } if (options.addWildcardPrefix && options.minifiedUrl) { if (options.minifiedUrl.indexOf('://') === -1 && options.minifiedUrl[0] !== '*') { options.minifiedUrl = '*' + options.minifiedUrl } ...
javascript
function transformOptions (options) { if (options.codeBundleId && options.appVersion) { delete options.appVersion } if (options.addWildcardPrefix && options.minifiedUrl) { if (options.minifiedUrl.indexOf('://') === -1 && options.minifiedUrl[0] !== '*') { options.minifiedUrl = '*' + options.minifiedUrl } ...
[ "function", "transformOptions", "(", "options", ")", "{", "if", "(", "options", ".", "codeBundleId", "&&", "options", ".", "appVersion", ")", "{", "delete", "options", ".", "appVersion", "}", "if", "(", "options", ".", "addWildcardPrefix", "&&", "options", "...
Does any last-minute transformations to the options before preparing the request. 1) Removes the "appVersion" option if the "codeBundleId" is set. 2) Extracts the source paths from the source map and adds them to the "sources" option. @param {object} options The options @returns {Promise<object>|object}
[ "Does", "any", "last", "-", "minute", "transformations", "to", "the", "options", "before", "preparing", "the", "request", "." ]
f3693373f0970ed308281144dd39a9db95242915
https://github.com/bugsnag/bugsnag-sourcemaps/blob/f3693373f0970ed308281144dd39a9db95242915/index.js#L217-L229
20,286
bugsnag/bugsnag-sourcemaps
index.js
sendRequest
function sendRequest (args) { // { options, formData } const options = args.options const formData = args.formData return request(options.endpoint, formData).then(() => options) }
javascript
function sendRequest (args) { // { options, formData } const options = args.options const formData = args.formData return request(options.endpoint, formData).then(() => options) }
[ "function", "sendRequest", "(", "args", ")", "{", "// { options, formData }", "const", "options", "=", "args", ".", "options", "const", "formData", "=", "args", ".", "formData", "return", "request", "(", "options", ".", "endpoint", ",", "formData", ")", ".", ...
Posts the form data to the endpoint. If the endpoint returns a status code other than 200, the promise is rejected. @param {{options: object, formData: object}} @returns {Promise<string>}
[ "Posts", "the", "form", "data", "to", "the", "endpoint", "." ]
f3693373f0970ed308281144dd39a9db95242915
https://github.com/bugsnag/bugsnag-sourcemaps/blob/f3693373f0970ed308281144dd39a9db95242915/index.js#L326-L331
20,287
bugsnag/bugsnag-sourcemaps
index.js
cleanupTempFiles
function cleanupTempFiles (options) { return new Promise((resolve, reject) => { if (options.tempDir) { if (path.dirname(options.sourceMap) === options.tempDir) { fs.unlinkSync(options.sourceMap) } fs.rmdir(options.tempDir, (err) => { if (err) { reject(err) } els...
javascript
function cleanupTempFiles (options) { return new Promise((resolve, reject) => { if (options.tempDir) { if (path.dirname(options.sourceMap) === options.tempDir) { fs.unlinkSync(options.sourceMap) } fs.rmdir(options.tempDir, (err) => { if (err) { reject(err) } els...
[ "function", "cleanupTempFiles", "(", "options", ")", "{", "return", "new", "Promise", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "if", "(", "options", ".", "tempDir", ")", "{", "if", "(", "path", ".", "dirname", "(", "options", ".", "sourceMap...
Removes temporary files generated by the upload process. @param {object} options The options @returns {Promise<object>}
[ "Removes", "temporary", "files", "generated", "by", "the", "upload", "process", "." ]
f3693373f0970ed308281144dd39a9db95242915
https://github.com/bugsnag/bugsnag-sourcemaps/blob/f3693373f0970ed308281144dd39a9db95242915/index.js#L339-L356
20,288
bugsnag/bugsnag-sourcemaps
index.js
upload
function upload (options, callback) { const promise = ( Promise.resolve(options) .then(applyDefaults) .then(validateOptions) .then(opts => { options = opts return options }) .then(transformOptions) .then(prepareRequest) .then(sendRequest) .catch(err ...
javascript
function upload (options, callback) { const promise = ( Promise.resolve(options) .then(applyDefaults) .then(validateOptions) .then(opts => { options = opts return options }) .then(transformOptions) .then(prepareRequest) .then(sendRequest) .catch(err ...
[ "function", "upload", "(", "options", ",", "callback", ")", "{", "const", "promise", "=", "(", "Promise", ".", "resolve", "(", "options", ")", ".", "then", "(", "applyDefaults", ")", ".", "then", "(", "validateOptions", ")", ".", "then", "(", "opts", "...
Upload source map to Bugsnag. @param {object} options The options @param {function} [callback] The node-style callback (optional) @returns {Promise<string>}
[ "Upload", "source", "map", "to", "Bugsnag", "." ]
f3693373f0970ed308281144dd39a9db95242915
https://github.com/bugsnag/bugsnag-sourcemaps/blob/f3693373f0970ed308281144dd39a9db95242915/index.js#L365-L389
20,289
jshttp/on-headers
index.js
createWriteHead
function createWriteHead (prevWriteHead, listener) { var fired = false // return function with core name and argument list return function writeHead (statusCode) { // set headers from arguments var args = setWriteHeadHeaders.apply(this, arguments) // fire listener if (!fired) { fired = tru...
javascript
function createWriteHead (prevWriteHead, listener) { var fired = false // return function with core name and argument list return function writeHead (statusCode) { // set headers from arguments var args = setWriteHeadHeaders.apply(this, arguments) // fire listener if (!fired) { fired = tru...
[ "function", "createWriteHead", "(", "prevWriteHead", ",", "listener", ")", "{", "var", "fired", "=", "false", "// return function with core name and argument list", "return", "function", "writeHead", "(", "statusCode", ")", "{", "// set headers from arguments", "var", "ar...
Create a replacement writeHead method. @param {function} prevWriteHead @param {function} listener @private
[ "Create", "a", "replacement", "writeHead", "method", "." ]
c05140cde9bbce2127926752433271c6f3fe8787
https://github.com/jshttp/on-headers/blob/c05140cde9bbce2127926752433271c6f3fe8787/index.js#L24-L46
20,290
jshttp/on-headers
index.js
onHeaders
function onHeaders (res, listener) { if (!res) { throw new TypeError('argument res is required') } if (typeof listener !== 'function') { throw new TypeError('argument listener must be a function') } res.writeHead = createWriteHead(res.writeHead, listener) }
javascript
function onHeaders (res, listener) { if (!res) { throw new TypeError('argument res is required') } if (typeof listener !== 'function') { throw new TypeError('argument listener must be a function') } res.writeHead = createWriteHead(res.writeHead, listener) }
[ "function", "onHeaders", "(", "res", ",", "listener", ")", "{", "if", "(", "!", "res", ")", "{", "throw", "new", "TypeError", "(", "'argument res is required'", ")", "}", "if", "(", "typeof", "listener", "!==", "'function'", ")", "{", "throw", "new", "Ty...
Execute a listener when a response is about to write headers. @param {object} res @return {function} listener @public
[ "Execute", "a", "listener", "when", "a", "response", "is", "about", "to", "write", "headers", "." ]
c05140cde9bbce2127926752433271c6f3fe8787
https://github.com/jshttp/on-headers/blob/c05140cde9bbce2127926752433271c6f3fe8787/index.js#L56-L66
20,291
jshttp/on-headers
index.js
setHeadersFromArray
function setHeadersFromArray (res, headers) { for (var i = 0; i < headers.length; i++) { res.setHeader(headers[i][0], headers[i][1]) } }
javascript
function setHeadersFromArray (res, headers) { for (var i = 0; i < headers.length; i++) { res.setHeader(headers[i][0], headers[i][1]) } }
[ "function", "setHeadersFromArray", "(", "res", ",", "headers", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "headers", ".", "length", ";", "i", "++", ")", "{", "res", ".", "setHeader", "(", "headers", "[", "i", "]", "[", "0", "]", ...
Set headers contained in array on the response object. @param {object} res @param {array} headers @private
[ "Set", "headers", "contained", "in", "array", "on", "the", "response", "object", "." ]
c05140cde9bbce2127926752433271c6f3fe8787
https://github.com/jshttp/on-headers/blob/c05140cde9bbce2127926752433271c6f3fe8787/index.js#L76-L80
20,292
jshttp/on-headers
index.js
setHeadersFromObject
function setHeadersFromObject (res, headers) { var keys = Object.keys(headers) for (var i = 0; i < keys.length; i++) { var k = keys[i] if (k) res.setHeader(k, headers[k]) } }
javascript
function setHeadersFromObject (res, headers) { var keys = Object.keys(headers) for (var i = 0; i < keys.length; i++) { var k = keys[i] if (k) res.setHeader(k, headers[k]) } }
[ "function", "setHeadersFromObject", "(", "res", ",", "headers", ")", "{", "var", "keys", "=", "Object", ".", "keys", "(", "headers", ")", "for", "(", "var", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "i", "++", ")", "{", "var", "k"...
Set headers contained in object on the response object. @param {object} res @param {object} headers @private
[ "Set", "headers", "contained", "in", "object", "on", "the", "response", "object", "." ]
c05140cde9bbce2127926752433271c6f3fe8787
https://github.com/jshttp/on-headers/blob/c05140cde9bbce2127926752433271c6f3fe8787/index.js#L90-L96
20,293
jshttp/on-headers
index.js
setWriteHeadHeaders
function setWriteHeadHeaders (statusCode) { var length = arguments.length var headerIndex = length > 1 && typeof arguments[1] === 'string' ? 2 : 1 var headers = length >= headerIndex + 1 ? arguments[headerIndex] : undefined this.statusCode = statusCode if (Array.isArray(headers)) { // h...
javascript
function setWriteHeadHeaders (statusCode) { var length = arguments.length var headerIndex = length > 1 && typeof arguments[1] === 'string' ? 2 : 1 var headers = length >= headerIndex + 1 ? arguments[headerIndex] : undefined this.statusCode = statusCode if (Array.isArray(headers)) { // h...
[ "function", "setWriteHeadHeaders", "(", "statusCode", ")", "{", "var", "length", "=", "arguments", ".", "length", "var", "headerIndex", "=", "length", ">", "1", "&&", "typeof", "arguments", "[", "1", "]", "===", "'string'", "?", "2", ":", "1", "var", "he...
Set headers and other properties on the response object. @param {number} statusCode @private
[ "Set", "headers", "and", "other", "properties", "on", "the", "response", "object", "." ]
c05140cde9bbce2127926752433271c6f3fe8787
https://github.com/jshttp/on-headers/blob/c05140cde9bbce2127926752433271c6f3fe8787/index.js#L105-L132
20,294
bdougherty/BigScreen
src/bigscreen.js
_getVideo
function _getVideo(element) { var videoElement = null; if (element.tagName === 'VIDEO') { videoElement = element; } else { var videos = element.getElementsByTagName('video'); if (videos[0]) { videoElement = videos[0]; } } return videoElement; }
javascript
function _getVideo(element) { var videoElement = null; if (element.tagName === 'VIDEO') { videoElement = element; } else { var videos = element.getElementsByTagName('video'); if (videos[0]) { videoElement = videos[0]; } } return videoElement; }
[ "function", "_getVideo", "(", "element", ")", "{", "var", "videoElement", "=", "null", ";", "if", "(", "element", ".", "tagName", "===", "'VIDEO'", ")", "{", "videoElement", "=", "element", ";", "}", "else", "{", "var", "videos", "=", "element", ".", "...
Find a child video in the element passed.
[ "Find", "a", "child", "video", "in", "the", "element", "passed", "." ]
7e57ce672e5d5c27eefecb3ce47ed00446c00e79
https://github.com/bdougherty/BigScreen/blob/7e57ce672e5d5c27eefecb3ce47ed00446c00e79/src/bigscreen.js#L35-L49
20,295
bdougherty/BigScreen
src/bigscreen.js
videoEnterFullscreen
function videoEnterFullscreen(element) { var videoElement = _getVideo(element); if (videoElement && videoElement.webkitEnterFullscreen) { try { if (videoElement.readyState < videoElement.HAVE_METADATA) { videoElement.addEventListener('loadedmetadata', function onMetadataLoaded() { videoElement.re...
javascript
function videoEnterFullscreen(element) { var videoElement = _getVideo(element); if (videoElement && videoElement.webkitEnterFullscreen) { try { if (videoElement.readyState < videoElement.HAVE_METADATA) { videoElement.addEventListener('loadedmetadata', function onMetadataLoaded() { videoElement.re...
[ "function", "videoEnterFullscreen", "(", "element", ")", "{", "var", "videoElement", "=", "_getVideo", "(", "element", ")", ";", "if", "(", "videoElement", "&&", "videoElement", ".", "webkitEnterFullscreen", ")", "{", "try", "{", "if", "(", "videoElement", "."...
Attempt to put a child video into full screen using webkitEnterFullscreen. The metadata must be loaded in order for it to work, so load it automatically if it isn't already.
[ "Attempt", "to", "put", "a", "child", "video", "into", "full", "screen", "using", "webkitEnterFullscreen", ".", "The", "metadata", "must", "be", "loaded", "in", "order", "for", "it", "to", "work", "so", "load", "it", "automatically", "if", "it", "isn", "t"...
7e57ce672e5d5c27eefecb3ce47ed00446c00e79
https://github.com/bdougherty/BigScreen/blob/7e57ce672e5d5c27eefecb3ce47ed00446c00e79/src/bigscreen.js#L64-L92
20,296
bdougherty/BigScreen
src/bigscreen.js
function(reason, element) { if (elements.length > 0) { var obj = elements.pop(); element = element || obj.element; obj.error.call(element, reason); bigscreen.onerror(element, reason); } }
javascript
function(reason, element) { if (elements.length > 0) { var obj = elements.pop(); element = element || obj.element; obj.error.call(element, reason); bigscreen.onerror(element, reason); } }
[ "function", "(", "reason", ",", "element", ")", "{", "if", "(", "elements", ".", "length", ">", "0", ")", "{", "var", "obj", "=", "elements", ".", "pop", "(", ")", ";", "element", "=", "element", "||", "obj", ".", "element", ";", "obj", ".", "err...
Make a callback to the error handlers and clear the element from the stack when an error occurs.
[ "Make", "a", "callback", "to", "the", "error", "handlers", "and", "clear", "the", "element", "from", "the", "stack", "when", "an", "error", "occurs", "." ]
7e57ce672e5d5c27eefecb3ce47ed00446c00e79
https://github.com/bdougherty/BigScreen/blob/7e57ce672e5d5c27eefecb3ce47ed00446c00e79/src/bigscreen.js#L182-L190
20,297
infusion/Polynomial.js
polynomial.js
gcd
function gcd(a, b) { var t; while (b) { t = a; a = b; b = t % b; } return Math.abs(a); }
javascript
function gcd(a, b) { var t; while (b) { t = a; a = b; b = t % b; } return Math.abs(a); }
[ "function", "gcd", "(", "a", ",", "b", ")", "{", "var", "t", ";", "while", "(", "b", ")", "{", "t", "=", "a", ";", "a", "=", "b", ";", "b", "=", "t", "%", "b", ";", "}", "return", "Math", ".", "abs", "(", "a", ")", ";", "}" ]
Calculates the gcd @param {number} a @param {number} b @returns {number}
[ "Calculates", "the", "gcd" ]
c291420de240107695ad1799d8947e85be416bed
https://github.com/infusion/Polynomial.js/blob/c291420de240107695ad1799d8947e85be416bed/polynomial.js#L122-L130
20,298
infusion/Polynomial.js
polynomial.js
function(a, b) { // gcd = a * s + b * t var s = 0, t = 1, u = 1, v = 0; while (a !== 0) { var q = b / a | 0, r = b % a; var m = s - u * q, n = t - v * q; b = a; a = r; s = u; t = v; u = m; v = n; } return [b /* gcd*/, s, t]; }
javascript
function(a, b) { // gcd = a * s + b * t var s = 0, t = 1, u = 1, v = 0; while (a !== 0) { var q = b / a | 0, r = b % a; var m = s - u * q, n = t - v * q; b = a; a = r; s = u; t = v; u = m; v = n; } return [b /* gcd*/, s, t]; }
[ "function", "(", "a", ",", "b", ")", "{", "// gcd = a * s + b * t", "var", "s", "=", "0", ",", "t", "=", "1", ",", "u", "=", "1", ",", "v", "=", "0", ";", "while", "(", "a", "!==", "0", ")", "{", "var", "q", "=", "b", "/", "a", "|", "0"...
Calculates the extended gcd @param {number} a @param {number} b @returns {Array}
[ "Calculates", "the", "extended", "gcd" ]
c291420de240107695ad1799d8947e85be416bed
https://github.com/infusion/Polynomial.js/blob/c291420de240107695ad1799d8947e85be416bed/polynomial.js#L148-L166
20,299
infusion/Polynomial.js
polynomial.js
keyUnion
function keyUnion(a, b) { var k = {}; for (var i in a) { k[i] = 1; } for (var i in b) { k[i] = 1; } return k; }
javascript
function keyUnion(a, b) { var k = {}; for (var i in a) { k[i] = 1; } for (var i in b) { k[i] = 1; } return k; }
[ "function", "keyUnion", "(", "a", ",", "b", ")", "{", "var", "k", "=", "{", "}", ";", "for", "(", "var", "i", "in", "a", ")", "{", "k", "[", "i", "]", "=", "1", ";", "}", "for", "(", "var", "i", "in", "b", ")", "{", "k", "[", "i", "]"...
Combines the keys of two objects @param {Object} a @param {Object} b @returns {Object}
[ "Combines", "the", "keys", "of", "two", "objects" ]
c291420de240107695ad1799d8947e85be416bed
https://github.com/infusion/Polynomial.js/blob/c291420de240107695ad1799d8947e85be416bed/polynomial.js#L210-L220