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
16,300
graphology/graphology
src/iteration/edges.js
createIteratorForKey
function createIteratorForKey(object, k) { const v = object[k]; if (v instanceof Set) { const iterator = v.values(); return new Iterator(function() { const step = iterator.next(); if (step.done) return step; const edgeData = step.value; return { done: false, ...
javascript
function createIteratorForKey(object, k) { const v = object[k]; if (v instanceof Set) { const iterator = v.values(); return new Iterator(function() { const step = iterator.next(); if (step.done) return step; const edgeData = step.value; return { done: false, ...
[ "function", "createIteratorForKey", "(", "object", ",", "k", ")", "{", "const", "v", "=", "object", "[", "k", "]", ";", "if", "(", "v", "instanceof", "Set", ")", "{", "const", "iterator", "=", "v", ".", "values", "(", ")", ";", "return", "new", "It...
Function returning an iterator over the egdes from the object at given key. @param {object} object - Target object. @param {mixed} k - Neighbor key. @return {Iterator}
[ "Function", "returning", "an", "iterator", "over", "the", "egdes", "from", "the", "object", "at", "given", "key", "." ]
f99681435ecd2d5b9d0a8e0d0d10f794817f417e
https://github.com/graphology/graphology/blob/f99681435ecd2d5b9d0a8e0d0d10f794817f417e/src/iteration/edges.js#L228-L264
16,301
graphology/graphology
src/iteration/edges.js
createEdgeArray
function createEdgeArray(graph, type) { if (graph.size === 0) return []; if (type === 'mixed' || type === graph.type) return take(graph._edges.keys(), graph._edges.size); const size = type === 'undirected' ? graph.undirectedSize : graph.directedSize; const list = new Array(size), mask...
javascript
function createEdgeArray(graph, type) { if (graph.size === 0) return []; if (type === 'mixed' || type === graph.type) return take(graph._edges.keys(), graph._edges.size); const size = type === 'undirected' ? graph.undirectedSize : graph.directedSize; const list = new Array(size), mask...
[ "function", "createEdgeArray", "(", "graph", ",", "type", ")", "{", "if", "(", "graph", ".", "size", "===", "0", ")", "return", "[", "]", ";", "if", "(", "type", "===", "'mixed'", "||", "type", "===", "graph", ".", "type", ")", "return", "take", "(...
Function creating an array of edges for the given type. @param {Graph} graph - Target Graph instance. @param {string} type - Type of edges to retrieve. @return {array} - Array of edges.
[ "Function", "creating", "an", "array", "of", "edges", "for", "the", "given", "type", "." ]
f99681435ecd2d5b9d0a8e0d0d10f794817f417e
https://github.com/graphology/graphology/blob/f99681435ecd2d5b9d0a8e0d0d10f794817f417e/src/iteration/edges.js#L273-L296
16,302
graphology/graphology
src/iteration/edges.js
forEachEdge
function forEachEdge(graph, type, callback) { if (graph.size === 0) return; if (type === 'mixed' || type === graph.type) { graph._edges.forEach((data, key) => { const {attributes, source, target} = data; callback( key, attributes, source.key, target.key, ...
javascript
function forEachEdge(graph, type, callback) { if (graph.size === 0) return; if (type === 'mixed' || type === graph.type) { graph._edges.forEach((data, key) => { const {attributes, source, target} = data; callback( key, attributes, source.key, target.key, ...
[ "function", "forEachEdge", "(", "graph", ",", "type", ",", "callback", ")", "{", "if", "(", "graph", ".", "size", "===", "0", ")", "return", ";", "if", "(", "type", "===", "'mixed'", "||", "type", "===", "graph", ".", "type", ")", "{", "graph", "."...
Function iterating over a graph's edges using a callback. @param {Graph} graph - Target Graph instance. @param {string} type - Type of edges to retrieve. @param {function} callback - Function to call.
[ "Function", "iterating", "over", "a", "graph", "s", "edges", "using", "a", "callback", "." ]
f99681435ecd2d5b9d0a8e0d0d10f794817f417e
https://github.com/graphology/graphology/blob/f99681435ecd2d5b9d0a8e0d0d10f794817f417e/src/iteration/edges.js#L305-L343
16,303
graphology/graphology
src/iteration/edges.js
createEdgeIterator
function createEdgeIterator(graph, type) { if (graph.size === 0) return Iterator.empty(); let iterator; if (type === 'mixed') { iterator = graph._edges.values(); return new Iterator(function next() { const step = iterator.next(); if (step.done) return step; const data = ...
javascript
function createEdgeIterator(graph, type) { if (graph.size === 0) return Iterator.empty(); let iterator; if (type === 'mixed') { iterator = graph._edges.values(); return new Iterator(function next() { const step = iterator.next(); if (step.done) return step; const data = ...
[ "function", "createEdgeIterator", "(", "graph", ",", "type", ")", "{", "if", "(", "graph", ".", "size", "===", "0", ")", "return", "Iterator", ".", "empty", "(", ")", ";", "let", "iterator", ";", "if", "(", "type", "===", "'mixed'", ")", "{", "iterat...
Function creating an iterator of edges for the given type. @param {Graph} graph - Target Graph instance. @param {string} type - Type of edges to retrieve. @return {Iterator}
[ "Function", "creating", "an", "iterator", "of", "edges", "for", "the", "given", "type", "." ]
f99681435ecd2d5b9d0a8e0d0d10f794817f417e
https://github.com/graphology/graphology/blob/f99681435ecd2d5b9d0a8e0d0d10f794817f417e/src/iteration/edges.js#L352-L407
16,304
graphology/graphology
src/iteration/edges.js
createEdgeArrayForNode
function createEdgeArrayForNode(type, direction, nodeData) { const edges = []; if (type !== 'undirected') { if (direction !== 'out') collect(edges, nodeData.in); if (direction !== 'in') collect(edges, nodeData.out); } if (type !== 'directed') { collect(edges, nodeData.undirected); } ...
javascript
function createEdgeArrayForNode(type, direction, nodeData) { const edges = []; if (type !== 'undirected') { if (direction !== 'out') collect(edges, nodeData.in); if (direction !== 'in') collect(edges, nodeData.out); } if (type !== 'directed') { collect(edges, nodeData.undirected); } ...
[ "function", "createEdgeArrayForNode", "(", "type", ",", "direction", ",", "nodeData", ")", "{", "const", "edges", "=", "[", "]", ";", "if", "(", "type", "!==", "'undirected'", ")", "{", "if", "(", "direction", "!==", "'out'", ")", "collect", "(", "edges"...
Function creating an array of edges for the given type & the given node. @param {string} type - Type of edges to retrieve. @param {string} direction - In or out? @param {any} nodeData - Target node's data. @return {array} - Array of edges.
[ "Function", "creating", "an", "array", "of", "edges", "for", "the", "given", "type", "&", "the", "given", "node", "." ]
f99681435ecd2d5b9d0a8e0d0d10f794817f417e
https://github.com/graphology/graphology/blob/f99681435ecd2d5b9d0a8e0d0d10f794817f417e/src/iteration/edges.js#L417-L432
16,305
graphology/graphology
src/iteration/edges.js
createEdgeArrayForPath
function createEdgeArrayForPath(type, direction, sourceData, target) { const edges = []; if (type !== 'undirected') { if (typeof sourceData.in !== 'undefined' && direction !== 'out') collectForKey(edges, sourceData.in, target); if (typeof sourceData.out !== 'undefined' && direction !== 'in') ...
javascript
function createEdgeArrayForPath(type, direction, sourceData, target) { const edges = []; if (type !== 'undirected') { if (typeof sourceData.in !== 'undefined' && direction !== 'out') collectForKey(edges, sourceData.in, target); if (typeof sourceData.out !== 'undefined' && direction !== 'in') ...
[ "function", "createEdgeArrayForPath", "(", "type", ",", "direction", ",", "sourceData", ",", "target", ")", "{", "const", "edges", "=", "[", "]", ";", "if", "(", "type", "!==", "'undirected'", ")", "{", "if", "(", "typeof", "sourceData", ".", "in", "!=="...
Function creating an array of edges for the given path. @param {string} type - Type of edges to retrieve. @param {string} direction - In or out? @param {NodeData} sourceData - Source node's data. @param {any} target - Target node. @return {array} - Array of edges.
[ "Function", "creating", "an", "array", "of", "edges", "for", "the", "given", "path", "." ]
f99681435ecd2d5b9d0a8e0d0d10f794817f417e
https://github.com/graphology/graphology/blob/f99681435ecd2d5b9d0a8e0d0d10f794817f417e/src/iteration/edges.js#L490-L508
16,306
graphology/graphology
src/iteration/edges.js
forEachEdgeForPath
function forEachEdgeForPath(type, direction, sourceData, target, callback) { if (type !== 'undirected') { if (typeof sourceData.in !== 'undefined' && direction !== 'out') forEachForKey(sourceData.in, target, callback); if (typeof sourceData.out !== 'undefined' && direction !== 'in') forEachForKe...
javascript
function forEachEdgeForPath(type, direction, sourceData, target, callback) { if (type !== 'undirected') { if (typeof sourceData.in !== 'undefined' && direction !== 'out') forEachForKey(sourceData.in, target, callback); if (typeof sourceData.out !== 'undefined' && direction !== 'in') forEachForKe...
[ "function", "forEachEdgeForPath", "(", "type", ",", "direction", ",", "sourceData", ",", "target", ",", "callback", ")", "{", "if", "(", "type", "!==", "'undirected'", ")", "{", "if", "(", "typeof", "sourceData", ".", "in", "!==", "'undefined'", "&&", "dir...
Function iterating over edges for the given path using a callback. @param {string} type - Type of edges to retrieve. @param {string} direction - In or out? @param {NodeData} sourceData - Source node's data. @param {string} target - Target node. @param {function} callback - Function to call.
[ "Function", "iterating", "over", "edges", "for", "the", "given", "path", "using", "a", "callback", "." ]
f99681435ecd2d5b9d0a8e0d0d10f794817f417e
https://github.com/graphology/graphology/blob/f99681435ecd2d5b9d0a8e0d0d10f794817f417e/src/iteration/edges.js#L519-L533
16,307
graphology/graphology
src/iteration/edges.js
createEdgeIteratorForPath
function createEdgeIteratorForPath(type, direction, sourceData, target) { let iterator = Iterator.empty(); if (type !== 'undirected') { if ( typeof sourceData.in !== 'undefined' && direction !== 'out' && target in sourceData.in ) iterator = chain(iterator, createIteratorForKey(sour...
javascript
function createEdgeIteratorForPath(type, direction, sourceData, target) { let iterator = Iterator.empty(); if (type !== 'undirected') { if ( typeof sourceData.in !== 'undefined' && direction !== 'out' && target in sourceData.in ) iterator = chain(iterator, createIteratorForKey(sour...
[ "function", "createEdgeIteratorForPath", "(", "type", ",", "direction", ",", "sourceData", ",", "target", ")", "{", "let", "iterator", "=", "Iterator", ".", "empty", "(", ")", ";", "if", "(", "type", "!==", "'undirected'", ")", "{", "if", "(", "typeof", ...
Function returning an iterator over edges for the given path. @param {string} type - Type of edges to retrieve. @param {string} direction - In or out? @param {NodeData} sourceData - Source node's data. @param {string} target - Target node. @param {function} callback - Function to call.
[ "Function", "returning", "an", "iterator", "over", "edges", "for", "the", "given", "path", "." ]
f99681435ecd2d5b9d0a8e0d0d10f794817f417e
https://github.com/graphology/graphology/blob/f99681435ecd2d5b9d0a8e0d0d10f794817f417e/src/iteration/edges.js#L544-L573
16,308
graphology/graphology
src/iteration/edges.js
attachEdgeArrayCreator
function attachEdgeArrayCreator(Class, description) { const { name, type, direction } = description; /** * Function returning an array of certain edges. * * Arity 0: Return all the relevant edges. * * Arity 1: Return all of a node's relevant edges. * @param {any} node - Target ...
javascript
function attachEdgeArrayCreator(Class, description) { const { name, type, direction } = description; /** * Function returning an array of certain edges. * * Arity 0: Return all the relevant edges. * * Arity 1: Return all of a node's relevant edges. * @param {any} node - Target ...
[ "function", "attachEdgeArrayCreator", "(", "Class", ",", "description", ")", "{", "const", "{", "name", ",", "type", ",", "direction", "}", "=", "description", ";", "/**\n * Function returning an array of certain edges.\n *\n * Arity 0: Return all the relevant edges.\n ...
Function attaching an edge array creator method to the Graph prototype. @param {function} Class - Target class. @param {object} description - Method description.
[ "Function", "attaching", "an", "edge", "array", "creator", "method", "to", "the", "Graph", "prototype", "." ]
f99681435ecd2d5b9d0a8e0d0d10f794817f417e
https://github.com/graphology/graphology/blob/f99681435ecd2d5b9d0a8e0d0d10f794817f417e/src/iteration/edges.js#L581-L647
16,309
graphology/graphology
src/iteration/edges.js
attachForEachEdge
function attachForEachEdge(Class, description) { const { name, type, direction } = description; const forEachName = 'forEach' + name[0].toUpperCase() + name.slice(1, -1); /** * Function iterating over the graph's relevant edges by applying the given * callback. * * Arity 1: Iterate ove...
javascript
function attachForEachEdge(Class, description) { const { name, type, direction } = description; const forEachName = 'forEach' + name[0].toUpperCase() + name.slice(1, -1); /** * Function iterating over the graph's relevant edges by applying the given * callback. * * Arity 1: Iterate ove...
[ "function", "attachForEachEdge", "(", "Class", ",", "description", ")", "{", "const", "{", "name", ",", "type", ",", "direction", "}", "=", "description", ";", "const", "forEachName", "=", "'forEach'", "+", "name", "[", "0", "]", ".", "toUpperCase", "(", ...
Function attaching a edge callback iterator method to the Graph prototype. @param {function} Class - Target class. @param {object} description - Method description.
[ "Function", "attaching", "a", "edge", "callback", "iterator", "method", "to", "the", "Graph", "prototype", "." ]
f99681435ecd2d5b9d0a8e0d0d10f794817f417e
https://github.com/graphology/graphology/blob/f99681435ecd2d5b9d0a8e0d0d10f794817f417e/src/iteration/edges.js#L655-L731
16,310
graphology/graphology
src/graph.js
addEdge
function addEdge( graph, name, mustGenerateKey, undirected, edge, source, target, attributes ) { // Checking validity of operation if (!undirected && graph.type === 'undirected') throw new UsageGraphError(`Graph.${name}: you cannot add a directed edge to an undirected graph. Use the #.addEdge o...
javascript
function addEdge( graph, name, mustGenerateKey, undirected, edge, source, target, attributes ) { // Checking validity of operation if (!undirected && graph.type === 'undirected') throw new UsageGraphError(`Graph.${name}: you cannot add a directed edge to an undirected graph. Use the #.addEdge o...
[ "function", "addEdge", "(", "graph", ",", "name", ",", "mustGenerateKey", ",", "undirected", ",", "edge", ",", "source", ",", "target", ",", "attributes", ")", "{", "// Checking validity of operation", "if", "(", "!", "undirected", "&&", "graph", ".", "type", ...
Abstract functions used by the Graph class for various methods. Internal method used to add an arbitrary edge to the given graph. @param {Graph} graph - Target graph. @param {string} name - Name of the child method for errors. @param {boolean} mustGenerateKey - Should the graph generate an...
[ "Abstract", "functions", "used", "by", "the", "Graph", "class", "for", "various", "methods", ".", "Internal", "method", "used", "to", "add", "an", "arbitrary", "edge", "to", "the", "given", "graph", "." ]
f99681435ecd2d5b9d0a8e0d0d10f794817f417e
https://github.com/graphology/graphology/blob/f99681435ecd2d5b9d0a8e0d0d10f794817f417e/src/graph.js#L131-L254
16,311
graphology/graphology
src/attributes.js
attachAttributeGetter
function attachAttributeGetter(Class, method, type, EdgeDataClass) { /** * Get the desired attribute for the given element (node or edge). * * Arity 2: * @param {any} element - Target element. * @param {string} name - Attribute's name. * * Arity 3 (only for edges): * @param {any} ...
javascript
function attachAttributeGetter(Class, method, type, EdgeDataClass) { /** * Get the desired attribute for the given element (node or edge). * * Arity 2: * @param {any} element - Target element. * @param {string} name - Attribute's name. * * Arity 3 (only for edges): * @param {any} ...
[ "function", "attachAttributeGetter", "(", "Class", ",", "method", ",", "type", ",", "EdgeDataClass", ")", "{", "/**\n * Get the desired attribute for the given element (node or edge).\n *\n * Arity 2:\n * @param {any} element - Target element.\n * @param {string} name - Att...
Attach an attribute getter method onto the provided class. @param {function} Class - Target class. @param {string} method - Method name. @param {string} type - Type of the edge to find. @param {Class} EdgeDataClass - Class of the edges to filter.
[ "Attach", "an", "attribute", "getter", "method", "onto", "the", "provided", "class", "." ]
f99681435ecd2d5b9d0a8e0d0d10f794817f417e
https://github.com/graphology/graphology/blob/f99681435ecd2d5b9d0a8e0d0d10f794817f417e/src/attributes.js#L33-L86
16,312
emadalam/atvjs
src/navigation.js
getLoaderDoc
function getLoaderDoc(message) { let tpl = defaults.templates.loader; let str = (tpl && tpl({message: message})) || '<document></document>'; return Parser.dom(str); }
javascript
function getLoaderDoc(message) { let tpl = defaults.templates.loader; let str = (tpl && tpl({message: message})) || '<document></document>'; return Parser.dom(str); }
[ "function", "getLoaderDoc", "(", "message", ")", "{", "let", "tpl", "=", "defaults", ".", "templates", ".", "loader", ";", "let", "str", "=", "(", "tpl", "&&", "tpl", "(", "{", "message", ":", "message", "}", ")", ")", "||", "'<document></document>'", ...
Get a loader document. @inner @alias module:navigation.getLoaderDoc @param {String} message Loading message @return {Document} A newly created loader document
[ "Get", "a", "loader", "document", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/navigation.js#L41-L46
16,313
emadalam/atvjs
src/navigation.js
getErrorDoc
function getErrorDoc(message) { let cfg = {}; if (_.isPlainObject(message)) { cfg = message; if (cfg.status && !cfg.template && defaults.templates.status[cfg.status]) { cfg.template = defaults.templates.status[cfg.status]; } } else { cfg.template = defaults.templa...
javascript
function getErrorDoc(message) { let cfg = {}; if (_.isPlainObject(message)) { cfg = message; if (cfg.status && !cfg.template && defaults.templates.status[cfg.status]) { cfg.template = defaults.templates.status[cfg.status]; } } else { cfg.template = defaults.templa...
[ "function", "getErrorDoc", "(", "message", ")", "{", "let", "cfg", "=", "{", "}", ";", "if", "(", "_", ".", "isPlainObject", "(", "message", ")", ")", "{", "cfg", "=", "message", ";", "if", "(", "cfg", ".", "status", "&&", "!", "cfg", ".", "templ...
Get an error document. @inner @alias module:navigation.getErrorDoc @param {Object|String} message Error page configuration or error message @return {Document} A newly created error document
[ "Get", "an", "error", "document", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/navigation.js#L57-L70
16,314
emadalam/atvjs
src/navigation.js
initMenu
function initMenu() { let menuCfg = defaults.menu; // no configuration given and neither the menu created earlier // no need to proceed if (!menuCfg && !Menu.created) { return; } // set options to create menu if (menuCfg) { Menu.setOptions(menuCfg); } menuDoc = Men...
javascript
function initMenu() { let menuCfg = defaults.menu; // no configuration given and neither the menu created earlier // no need to proceed if (!menuCfg && !Menu.created) { return; } // set options to create menu if (menuCfg) { Menu.setOptions(menuCfg); } menuDoc = Men...
[ "function", "initMenu", "(", ")", "{", "let", "menuCfg", "=", "defaults", ".", "menu", ";", "// no configuration given and neither the menu created earlier", "// no need to proceed", "if", "(", "!", "menuCfg", "&&", "!", "Menu", ".", "created", ")", "{", "return", ...
Initializes the menu document if present @private
[ "Initializes", "the", "menu", "document", "if", "present" ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/navigation.js#L89-L105
16,315
emadalam/atvjs
src/navigation.js
show
function show(cfg = {}) { if (_.isFunction(cfg)) { cfg = { template: cfg }; } // no template exists, cannot proceed if (!cfg.template) { console.warn('No template found!') return; } let doc = null; if (getLastDocumentFromStack() && cfg.type === 'm...
javascript
function show(cfg = {}) { if (_.isFunction(cfg)) { cfg = { template: cfg }; } // no template exists, cannot proceed if (!cfg.template) { console.warn('No template found!') return; } let doc = null; if (getLastDocumentFromStack() && cfg.type === 'm...
[ "function", "show", "(", "cfg", "=", "{", "}", ")", "{", "if", "(", "_", ".", "isFunction", "(", "cfg", ")", ")", "{", "cfg", "=", "{", "template", ":", "cfg", "}", ";", "}", "// no template exists, cannot proceed", "if", "(", "!", "cfg", ".", "tem...
Helper function to perform navigation after applying the page level default handlers @private @param {Object} cfg The configurations @return {Document} The created document
[ "Helper", "function", "to", "perform", "navigation", "after", "applying", "the", "page", "level", "default", "handlers" ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/navigation.js#L115-L135
16,316
emadalam/atvjs
src/navigation.js
showLoading
function showLoading(cfg = {}) { if (_.isString(cfg)) { cfg = { data: { message: cfg } }; } // use default loading template if not passed as a configuration _.defaultsDeep(cfg, { template: defaults.templates.loader, type: 'modal' ...
javascript
function showLoading(cfg = {}) { if (_.isString(cfg)) { cfg = { data: { message: cfg } }; } // use default loading template if not passed as a configuration _.defaultsDeep(cfg, { template: defaults.templates.loader, type: 'modal' ...
[ "function", "showLoading", "(", "cfg", "=", "{", "}", ")", "{", "if", "(", "_", ".", "isString", "(", "cfg", ")", ")", "{", "cfg", "=", "{", "data", ":", "{", "message", ":", "cfg", "}", "}", ";", "}", "// use default loading template if not passed as ...
Shows a loading page if a loader template exists. Also applies any default handlers and caches the document for later use. @inner @alias module:navigation.showLoading @param {Object|Function} cfg The configuration options or the template function @return {Document} The created loader document.
[ "Shows", "a", "loading", "page", "if", "a", "loader", "template", "exists", ".", "Also", "applies", "any", "default", "handlers", "and", "caches", "the", "document", "for", "later", "use", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/navigation.js#L147-L167
16,317
emadalam/atvjs
src/navigation.js
showError
function showError(cfg = {}) { if (_.isBoolean(cfg) && !cfg && errorDoc) { // hide error navigationDocument.removeDocument(errorDoc); return; } if (_.isString(cfg)) { cfg = { data: { message: cfg } }; } // use default error temp...
javascript
function showError(cfg = {}) { if (_.isBoolean(cfg) && !cfg && errorDoc) { // hide error navigationDocument.removeDocument(errorDoc); return; } if (_.isString(cfg)) { cfg = { data: { message: cfg } }; } // use default error temp...
[ "function", "showError", "(", "cfg", "=", "{", "}", ")", "{", "if", "(", "_", ".", "isBoolean", "(", "cfg", ")", "&&", "!", "cfg", "&&", "errorDoc", ")", "{", "// hide error", "navigationDocument", ".", "removeDocument", "(", "errorDoc", ")", ";", "ret...
Shows the error page using the existing error template. Also applies any default handlers and caches the document for later use. @inner @alias module:navigation.showError @param {Object|Function|Boolean} cfg The configuration options or the template function or boolean to hide the error @return {Document} ...
[ "Shows", "the", "error", "page", "using", "the", "existing", "error", "template", ".", "Also", "applies", "any", "default", "handlers", "and", "caches", "the", "document", "for", "later", "use", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/navigation.js#L179-L202
16,318
emadalam/atvjs
src/navigation.js
pushDocument
function pushDocument(doc) { if (!(doc instanceof Document)) { console.warn('Cannot navigate to the document.', doc); return; } navigationDocument.pushDocument(doc); }
javascript
function pushDocument(doc) { if (!(doc instanceof Document)) { console.warn('Cannot navigate to the document.', doc); return; } navigationDocument.pushDocument(doc); }
[ "function", "pushDocument", "(", "doc", ")", "{", "if", "(", "!", "(", "doc", "instanceof", "Document", ")", ")", "{", "console", ".", "warn", "(", "'Cannot navigate to the document.'", ",", "doc", ")", ";", "return", ";", "}", "navigationDocument", ".", "...
Pushes a given document to the navigation stack after applying all the default page level handlers. @private @param {Document} doc The document to push to the navigation stack
[ "Pushes", "a", "given", "document", "to", "the", "navigation", "stack", "after", "applying", "all", "the", "default", "page", "level", "handlers", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/navigation.js#L211-L217
16,319
emadalam/atvjs
src/navigation.js
replaceDocument
function replaceDocument(doc, docToReplace) { if (!(doc instanceof Document) || !(docToReplace instanceof Document)) { console.warn('Cannot replace document.'); return; } navigationDocument.replaceDocument(doc, docToReplace); }
javascript
function replaceDocument(doc, docToReplace) { if (!(doc instanceof Document) || !(docToReplace instanceof Document)) { console.warn('Cannot replace document.'); return; } navigationDocument.replaceDocument(doc, docToReplace); }
[ "function", "replaceDocument", "(", "doc", ",", "docToReplace", ")", "{", "if", "(", "!", "(", "doc", "instanceof", "Document", ")", "||", "!", "(", "docToReplace", "instanceof", "Document", ")", ")", "{", "console", ".", "warn", "(", "'Cannot replace docume...
Replaces a document on the navigation stack with the provided new document. Also adds the page level default handlers to the new document and removes the existing handlers from the document that is to be replaced. @inner @alias module:navigation.replaceDocument @param {Document} doc The document to pus...
[ "Replaces", "a", "document", "on", "the", "navigation", "stack", "with", "the", "provided", "new", "document", ".", "Also", "adds", "the", "page", "level", "default", "handlers", "to", "the", "new", "document", "and", "removes", "the", "existing", "handlers", ...
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/navigation.js#L229-L235
16,320
emadalam/atvjs
src/navigation.js
cleanNavigate
function cleanNavigate(doc, replace = false) { let navigated = false; let docs = navigationDocument.documents; let last = getLastDocumentFromStack(); if (!replace && (!last || last !== loaderDoc && last !== errorDoc)) { pushDocument(doc); } else if (last && last === loaderDoc || last === er...
javascript
function cleanNavigate(doc, replace = false) { let navigated = false; let docs = navigationDocument.documents; let last = getLastDocumentFromStack(); if (!replace && (!last || last !== loaderDoc && last !== errorDoc)) { pushDocument(doc); } else if (last && last === loaderDoc || last === er...
[ "function", "cleanNavigate", "(", "doc", ",", "replace", "=", "false", ")", "{", "let", "navigated", "=", "false", ";", "let", "docs", "=", "navigationDocument", ".", "documents", ";", "let", "last", "=", "getLastDocumentFromStack", "(", ")", ";", "if", "(...
Performs a navigation by checking the existing document stack to see if any error or loader page needs to be replaced from the current stack @private @param {Document} doc The document that needs to be pushed on to the navigation stack @param {Boolean} [replace=false] Whether to replace the last do...
[ "Performs", "a", "navigation", "by", "checking", "the", "existing", "document", "stack", "to", "see", "if", "any", "error", "or", "loader", "page", "needs", "to", "be", "replaced", "from", "the", "current", "stack" ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/navigation.js#L246-L271
16,321
emadalam/atvjs
src/navigation.js
navigateToMenuPage
function navigateToMenuPage() { console.log('navigating to menu...'); return new Promise((resolve, reject) => { if (!menuDoc) { initMenu(); } if (!menuDoc) { console.warn('No menu configuration exists, cannot navigate to the menu page.'); reject(); ...
javascript
function navigateToMenuPage() { console.log('navigating to menu...'); return new Promise((resolve, reject) => { if (!menuDoc) { initMenu(); } if (!menuDoc) { console.warn('No menu configuration exists, cannot navigate to the menu page.'); reject(); ...
[ "function", "navigateToMenuPage", "(", ")", "{", "console", ".", "log", "(", "'navigating to menu...'", ")", ";", "return", "new", "Promise", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "if", "(", "!", "menuDoc", ")", "{", "initMenu", "(", ")", ...
Navigates to the menu page if it exists @inner @alias module:navigation.navigateToMenuPage @return {Promise} Returns a Promise that resolves upon successful navigation.
[ "Navigates", "to", "the", "menu", "page", "if", "it", "exists" ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/navigation.js#L281-L297
16,322
emadalam/atvjs
src/navigation.js
navigate
function navigate(page, options, replace) { let p = Page.get(page); if (_.isBoolean(options)) { replace = options; } else { options = options || {}; } if (_.isBoolean(options.replace)) { replace = options.replace; } console.log('navigating... page:', page, ':: opti...
javascript
function navigate(page, options, replace) { let p = Page.get(page); if (_.isBoolean(options)) { replace = options; } else { options = options || {}; } if (_.isBoolean(options.replace)) { replace = options.replace; } console.log('navigating... page:', page, ':: opti...
[ "function", "navigate", "(", "page", ",", "options", ",", "replace", ")", "{", "let", "p", "=", "Page", ".", "get", "(", "page", ")", ";", "if", "(", "_", ".", "isBoolean", "(", "options", ")", ")", "{", "replace", "=", "options", ";", "}", "else...
Navigates to the provided page if it exists in the list of available pages. @inner @alias module:navigation.navigate @param {String} page Name of the previously created page. @param {Object} options The options that will be passed on to the page during runtime. @param {Boolean} replace Replace the pr...
[ "Navigates", "to", "the", "provided", "page", "if", "it", "exists", "in", "the", "list", "of", "available", "pages", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/navigation.js#L310-L378
16,323
emadalam/atvjs
src/navigation.js
presentModal
function presentModal(modal) { let doc = modal; // assume a document object is passed if (_.isString(modal)) { // if a modal document string is passed doc = Parser.dom(modal); } else if (_.isPlainObject(modal)) { // if a modal page configuration is passed doc = Page.makeDom(modal); } ...
javascript
function presentModal(modal) { let doc = modal; // assume a document object is passed if (_.isString(modal)) { // if a modal document string is passed doc = Parser.dom(modal); } else if (_.isPlainObject(modal)) { // if a modal page configuration is passed doc = Page.makeDom(modal); } ...
[ "function", "presentModal", "(", "modal", ")", "{", "let", "doc", "=", "modal", ";", "// assume a document object is passed", "if", "(", "_", ".", "isString", "(", "modal", ")", ")", "{", "// if a modal document string is passed", "doc", "=", "Parser", ".", "dom...
Shows a modal. Closes the previous modal before showing a new modal. @inner @alias module:navigation.presentModal @param {Document|String|Object} modal The TVML string/document representation of the modal window or a configuration object to create modal from @return {Document} The cre...
[ "Shows", "a", "modal", ".", "Closes", "the", "previous", "modal", "before", "showing", "a", "new", "modal", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/navigation.js#L389-L399
16,324
emadalam/atvjs
src/navigation.js
pop
function pop(doc) { if (doc instanceof Document) { _.defer(() => navigationDocument.popToDocument(doc)); } else { _.defer(() => navigationDocument.popDocument()); } }
javascript
function pop(doc) { if (doc instanceof Document) { _.defer(() => navigationDocument.popToDocument(doc)); } else { _.defer(() => navigationDocument.popDocument()); } }
[ "function", "pop", "(", "doc", ")", "{", "if", "(", "doc", "instanceof", "Document", ")", "{", "_", ".", "defer", "(", "(", ")", "=>", "navigationDocument", ".", "popToDocument", "(", "doc", ")", ")", ";", "}", "else", "{", "_", ".", "defer", "(", ...
Pops the recent document or pops all document before the provided document. @inner @alias module:navigation.pop @param {Document} [doc] The document until which we need to pop.
[ "Pops", "the", "recent", "document", "or", "pops", "all", "document", "before", "the", "provided", "document", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/navigation.js#L432-L438
16,325
emadalam/atvjs
src/page.js
appendStyle
function appendStyle(style, doc) { if (!_.isString(style) || !doc) { console.log('invalid document or style string...', style, doc); return; } let docEl = (doc.getElementsByTagName('document')).item(0); let styleString = ['<style>', style, '</style>'].join(''); let headTag = doc.getE...
javascript
function appendStyle(style, doc) { if (!_.isString(style) || !doc) { console.log('invalid document or style string...', style, doc); return; } let docEl = (doc.getElementsByTagName('document')).item(0); let styleString = ['<style>', style, '</style>'].join(''); let headTag = doc.getE...
[ "function", "appendStyle", "(", "style", ",", "doc", ")", "{", "if", "(", "!", "_", ".", "isString", "(", "style", ")", "||", "!", "doc", ")", "{", "console", ".", "log", "(", "'invalid document or style string...'", ",", "style", ",", "doc", ")", ";",...
Adds style to a document. @todo Check for existing style tag within the head of the provided document and append if exists @private @param {String} style Style string @param {Document} doc The document to add styles on
[ "Adds", "style", "to", "a", "document", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/page.js#L79-L94
16,326
emadalam/atvjs
src/page.js
prepareDom
function prepareDom(doc, cfg = {}) { if (!(doc instanceof Document)) { console.warn('Cannnot prepare, the provided element is not a document.'); return; } // apply defaults _.defaults(cfg, defaults); // append any default styles appendStyle(cfg.style, doc); // attach event ha...
javascript
function prepareDom(doc, cfg = {}) { if (!(doc instanceof Document)) { console.warn('Cannnot prepare, the provided element is not a document.'); return; } // apply defaults _.defaults(cfg, defaults); // append any default styles appendStyle(cfg.style, doc); // attach event ha...
[ "function", "prepareDom", "(", "doc", ",", "cfg", "=", "{", "}", ")", "{", "if", "(", "!", "(", "doc", "instanceof", "Document", ")", ")", "{", "console", ".", "warn", "(", "'Cannnot prepare, the provided element is not a document.'", ")", ";", "return", ";"...
Prepares a document by adding styles and event handlers. @inner @alias module:page.prepareDom @param {Document} doc The document to prepare @return {Document} The document passed
[ "Prepares", "a", "document", "by", "adding", "styles", "and", "event", "handlers", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/page.js#L105-L118
16,327
emadalam/atvjs
src/page.js
makeDom
function makeDom(cfg, response) { // apply defaults _.defaults(cfg, defaults); // create Document let doc = Parser.dom(cfg.template, (_.isPlainObject(cfg.data) ? cfg.data: cfg.data(response))); // prepare the Document prepareDom(doc, cfg); // call the after ready method if defined in the con...
javascript
function makeDom(cfg, response) { // apply defaults _.defaults(cfg, defaults); // create Document let doc = Parser.dom(cfg.template, (_.isPlainObject(cfg.data) ? cfg.data: cfg.data(response))); // prepare the Document prepareDom(doc, cfg); // call the after ready method if defined in the con...
[ "function", "makeDom", "(", "cfg", ",", "response", ")", "{", "// apply defaults", "_", ".", "defaults", "(", "cfg", ",", "defaults", ")", ";", "// create Document", "let", "doc", "=", "Parser", ".", "dom", "(", "cfg", ".", "template", ",", "(", "_", "...
A helper method that calls the data method to transform the data. It then creates a dom from the provided template and the final data. @inner @alias module:page.makeDom @param {Object} cfg Page configuration options @param {Object} response The data object @return {Document} The new...
[ "A", "helper", "method", "that", "calls", "the", "data", "method", "to", "transform", "the", "data", ".", "It", "then", "creates", "a", "dom", "from", "the", "provided", "template", "and", "the", "final", "data", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/page.js#L131-L147
16,328
emadalam/atvjs
src/page.js
makePage
function makePage(cfg) { return (options) => { _.defaultsDeep(cfg, defaults); console.log('making page... options:', cfg); // return a promise that resolves after completion of the ajax request // if no ready method or url configuration exist, the promise is resolved immediately an...
javascript
function makePage(cfg) { return (options) => { _.defaultsDeep(cfg, defaults); console.log('making page... options:', cfg); // return a promise that resolves after completion of the ajax request // if no ready method or url configuration exist, the promise is resolved immediately an...
[ "function", "makePage", "(", "cfg", ")", "{", "return", "(", "options", ")", "=>", "{", "_", ".", "defaultsDeep", "(", "cfg", ",", "defaults", ")", ";", "console", ".", "log", "(", "'making page... options:'", ",", "cfg", ")", ";", "// return a promise tha...
Generated a page function which returns a promise after invocation. @private @param {Object} cfg The page configuration object @return {Function} A function that returns promise upon execution
[ "Generated", "a", "page", "function", "which", "returns", "a", "promise", "after", "invocation", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/page.js#L157-L189
16,329
emadalam/atvjs
src/parser.js
parse
function parse(s, data) { // if a template function is provided, call the function with data s = _.isFunction(s) ? s(data) : s; console.log('parsing string...'); console.log(s); // prepend the xml string if not already present if (!_.startsWith(s, '<?xml')) { s = xmlPrefix + s; } ...
javascript
function parse(s, data) { // if a template function is provided, call the function with data s = _.isFunction(s) ? s(data) : s; console.log('parsing string...'); console.log(s); // prepend the xml string if not already present if (!_.startsWith(s, '<?xml')) { s = xmlPrefix + s; } ...
[ "function", "parse", "(", "s", ",", "data", ")", "{", "// if a template function is provided, call the function with data", "s", "=", "_", ".", "isFunction", "(", "s", ")", "?", "s", "(", "data", ")", ":", "s", ";", "console", ".", "log", "(", "'parsing stri...
xml prefix Parses the given XML string or a function and returns a DOM @private @param {String|Function} s The template function or the string @param {Object} [data] The data that will be applied to the function @return {Document} A new Document
[ "xml", "prefix", "Parses", "the", "given", "XML", "string", "or", "a", "function", "and", "returns", "a", "DOM" ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/parser.js#L14-L27
16,330
emadalam/atvjs
src/menu.js
setAttributes
function setAttributes(el, attributes) { console.log('setting attributes on element...', el, attributes); _.each(attributes, (value, name) => el.setAttribute(name, value)); }
javascript
function setAttributes(el, attributes) { console.log('setting attributes on element...', el, attributes); _.each(attributes, (value, name) => el.setAttribute(name, value)); }
[ "function", "setAttributes", "(", "el", ",", "attributes", ")", "{", "console", ".", "log", "(", "'setting attributes on element...'", ",", "el", ",", "attributes", ")", ";", "_", ".", "each", "(", "attributes", ",", "(", "value", ",", "name", ")", "=>", ...
Iterates and sets attributes to an element. @private @param {Element} el The element to set attributes on @param {Object} attributes Attributes key value pairs.
[ "Iterates", "and", "sets", "attributes", "to", "an", "element", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/menu.js#L46-L49
16,331
emadalam/atvjs
src/menu.js
addItem
function addItem(item = {}) { if (!item.id) { console.warn('Cannot add menuitem. A unique identifier is required for the menuitem to work correctly.'); return; } let el = doc.createElement('menuItem'); // assign unique id item.attributes = _.assign({}, item.attributes, { id: ...
javascript
function addItem(item = {}) { if (!item.id) { console.warn('Cannot add menuitem. A unique identifier is required for the menuitem to work correctly.'); return; } let el = doc.createElement('menuItem'); // assign unique id item.attributes = _.assign({}, item.attributes, { id: ...
[ "function", "addItem", "(", "item", "=", "{", "}", ")", "{", "if", "(", "!", "item", ".", "id", ")", "{", "console", ".", "warn", "(", "'Cannot add menuitem. A unique identifier is required for the menuitem to work correctly.'", ")", ";", "return", ";", "}", "le...
Adds menu item to the menu document. @private @param {Object} item The configuration realted to the menu item.
[ "Adds", "menu", "item", "to", "the", "menu", "document", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/menu.js#L73-L95
16,332
emadalam/atvjs
src/menu.js
create
function create(cfg = {}) { if (created) { console.warn('An instance of menu already exists, skipping creation...'); return; } // defaults _.assign(defaults, cfg); console.log('creating menu...', defaults); // set attributes to the menubar element setAttributes(menu...
javascript
function create(cfg = {}) { if (created) { console.warn('An instance of menu already exists, skipping creation...'); return; } // defaults _.assign(defaults, cfg); console.log('creating menu...', defaults); // set attributes to the menubar element setAttributes(menu...
[ "function", "create", "(", "cfg", "=", "{", "}", ")", "{", "if", "(", "created", ")", "{", "console", ".", "warn", "(", "'An instance of menu already exists, skipping creation...'", ")", ";", "return", ";", "}", "// defaults", "_", ".", "assign", "(", "defau...
Generates a menu from the configuration object. @example ATV.Menu.create({ attributes: {}, // menuBar attributes rootTemplateAttributes: {}, // menuBarTemplate attributes items: [{ id: 'search', name: 'Search', page: SearchPage }, { id: 'homepage', name: 'Home', page: HomePage, attributes: { autoHighlight: true // au...
[ "Generates", "a", "menu", "from", "the", "configuration", "object", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/menu.js#L132-L152
16,333
emadalam/atvjs
src/ajax.js
ajax
function ajax(url, options, method = 'GET') { if (typeof url == 'undefined') { console.error('No url specified for the ajax.'); throw new TypeError('A URL is required for making the ajax request.'); } if (typeof options === 'undefined' && typeof url === 'object' && url.url) { option...
javascript
function ajax(url, options, method = 'GET') { if (typeof url == 'undefined') { console.error('No url specified for the ajax.'); throw new TypeError('A URL is required for making the ajax request.'); } if (typeof options === 'undefined' && typeof url === 'object' && url.url) { option...
[ "function", "ajax", "(", "url", ",", "options", ",", "method", "=", "'GET'", ")", "{", "if", "(", "typeof", "url", "==", "'undefined'", ")", "{", "console", ".", "error", "(", "'No url specified for the ajax.'", ")", ";", "throw", "new", "TypeError", "(", ...
A function to perform ajax requests. It returns promise instead of relying on callbacks. @example ATV.Ajax('http://api.mymovieapp.com/movies') .then((response) => // do something with the response) .catch((error) => // catch errors ) @memberof module:ajax @param {String} url Resource...
[ "A", "function", "to", "perform", "ajax", "requests", ".", "It", "returns", "promise", "instead", "of", "relying", "on", "callbacks", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/ajax.js#L26-L82
16,334
emadalam/atvjs
src/index.js
initLibraries
function initLibraries(cfg = {}) { _.each(configMap, (keys, libName) => { let lib = libs[libName]; let options = {}; _.each(keys, (key) => options[key] = cfg[key]); lib.setOptions && lib.setOptions(options); }); }
javascript
function initLibraries(cfg = {}) { _.each(configMap, (keys, libName) => { let lib = libs[libName]; let options = {}; _.each(keys, (key) => options[key] = cfg[key]); lib.setOptions && lib.setOptions(options); }); }
[ "function", "initLibraries", "(", "cfg", "=", "{", "}", ")", "{", "_", ".", "each", "(", "configMap", ",", "(", "keys", ",", "libName", ")", "=>", "{", "let", "lib", "=", "libs", "[", "libName", "]", ";", "let", "options", "=", "{", "}", ";", "...
Iterates over each libraries and call setOptions with the relevant options. @private @param {Object} cfg All configuration options relevant to the libraries
[ "Iterates", "over", "each", "libraries", "and", "call", "setOptions", "with", "the", "relevant", "options", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/index.js#L133-L140
16,335
emadalam/atvjs
src/index.js
initAppHandlers
function initAppHandlers (cfg = {}) { _.each(handlers, (handler, name) => App[name] = _.partial(handler, _, (_.isFunction(cfg[name])) ? cfg[name] : _.noop)); }
javascript
function initAppHandlers (cfg = {}) { _.each(handlers, (handler, name) => App[name] = _.partial(handler, _, (_.isFunction(cfg[name])) ? cfg[name] : _.noop)); }
[ "function", "initAppHandlers", "(", "cfg", "=", "{", "}", ")", "{", "_", ".", "each", "(", "handlers", ",", "(", "handler", ",", "name", ")", "=>", "App", "[", "name", "]", "=", "_", ".", "partial", "(", "handler", ",", "_", ",", "(", "_", ".",...
Iterates over each supported handler types and attach it on the Apple TV App object. @private @param {Object} cfg All configuration options relevant to the App.
[ "Iterates", "over", "each", "supported", "handler", "types", "and", "attach", "it", "on", "the", "Apple", "TV", "App", "object", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/index.js#L214-L216
16,336
emadalam/atvjs
src/index.js
start
function start(cfg = {}) { if (started) { console.warn('Application already started, cannot call start again.'); return; } initLibraries(cfg); initAppHandlers(cfg); // if already bootloaded somewhere // immediately call the onLaunch method if (cfg.bootloaded) { App.onLaunch(App.launchOpt...
javascript
function start(cfg = {}) { if (started) { console.warn('Application already started, cannot call start again.'); return; } initLibraries(cfg); initAppHandlers(cfg); // if already bootloaded somewhere // immediately call the onLaunch method if (cfg.bootloaded) { App.onLaunch(App.launchOpt...
[ "function", "start", "(", "cfg", "=", "{", "}", ")", "{", "if", "(", "started", ")", "{", "console", ".", "warn", "(", "'Application already started, cannot call start again.'", ")", ";", "return", ";", "}", "initLibraries", "(", "cfg", ")", ";", "initAppHan...
Starts the Apple TV application after applying the relevant configuration options @example // create your pages let SearchPage = ATV.Page.create({ page configurations }); let HomePage = ATV.Page.create({ page configurations }); let MoviesPage = ATV.Page.create({ page configurations }); let TVShowsPage = ATV.Page.creat...
[ "Starts", "the", "Apple", "TV", "application", "after", "applying", "the", "relevant", "configuration", "options" ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/index.js#L332-L346
16,337
emadalam/atvjs
src/index.js
reload
function reload(options, reloadData) { App.onReload(options); App.reload(options, reloadData); }
javascript
function reload(options, reloadData) { App.onReload(options); App.reload(options, reloadData); }
[ "function", "reload", "(", "options", ",", "reloadData", ")", "{", "App", ".", "onReload", "(", "options", ")", ";", "App", ".", "reload", "(", "options", ",", "reloadData", ")", ";", "}" ]
Reloads the application with the provided options and data. @example ATV.reload({when: 'now'}, {customData}); @inner @alias module:ATV.reload @fires onReload @param {Object} [options] Options value. {when: 'now'} // or 'onResume' @param {Object} [reloadData] Custom data that needs to be passed whi...
[ "Reloads", "the", "application", "with", "the", "provided", "options", "and", "data", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/index.js#L361-L364
16,338
emadalam/atvjs
src/handler.js
setOptions
function setOptions(cfg = {}) { console.log('setting handler options...', cfg); // override the default options _.defaultsDeep(handlers, cfg.handlers); }
javascript
function setOptions(cfg = {}) { console.log('setting handler options...', cfg); // override the default options _.defaultsDeep(handlers, cfg.handlers); }
[ "function", "setOptions", "(", "cfg", "=", "{", "}", ")", "{", "console", ".", "log", "(", "'setting handler options...'", ",", "cfg", ")", ";", "// override the default options", "_", ".", "defaultsDeep", "(", "handlers", ",", "cfg", ".", "handlers", ")", "...
Sets the default handlers options @inner @alias module:handler.setOptions @param {Object} cfg The configuration object {defaults}
[ "Sets", "the", "default", "handlers", "options" ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/handler.js#L137-L141
16,339
emadalam/atvjs
src/handler.js
setListeners
function setListeners(doc, cfg = {}, add = true) { if (!doc || !(doc instanceof Document)) { return; } let listenerFn = doc.addEventListener; if (!add) { listenerFn = doc.removeEventListener; } if (_.isObject(cfg.events)) { let events = cfg.events; _.eac...
javascript
function setListeners(doc, cfg = {}, add = true) { if (!doc || !(doc instanceof Document)) { return; } let listenerFn = doc.addEventListener; if (!add) { listenerFn = doc.removeEventListener; } if (_.isObject(cfg.events)) { let events = cfg.events; _.eac...
[ "function", "setListeners", "(", "doc", ",", "cfg", "=", "{", "}", ",", "add", "=", "true", ")", "{", "if", "(", "!", "doc", "||", "!", "(", "doc", "instanceof", "Document", ")", ")", "{", "return", ";", "}", "let", "listenerFn", "=", "doc", ".",...
Iterates over the events configuration and add event listeners to the document. @example { events: { 'scroll': function(e) { // do the magic here }, 'select listItemLockup title': 'onTitleSelect', 'someOtherEvent': ['onTitleSelect', function(e) { // some other magic }, ...] }, onTitleSelect: function(e) { // do the ma...
[ "Iterates", "over", "the", "events", "configuration", "and", "add", "event", "listeners", "to", "the", "document", "." ]
e42a538805e610fce99b48d32f4e5b81f09ae4c4
https://github.com/emadalam/atvjs/blob/e42a538805e610fce99b48d32f4e5b81f09ae4c4/src/handler.js#L166-L200
16,340
archfirst/joinjs
src/index.js
map
function map(resultSet, maps, mapId, columnPrefix) { let mappedCollection = []; resultSet.forEach(result => { injectResultInCollection(result, mappedCollection, maps, mapId, columnPrefix); }); return mappedCollection; }
javascript
function map(resultSet, maps, mapId, columnPrefix) { let mappedCollection = []; resultSet.forEach(result => { injectResultInCollection(result, mappedCollection, maps, mapId, columnPrefix); }); return mappedCollection; }
[ "function", "map", "(", "resultSet", ",", "maps", ",", "mapId", ",", "columnPrefix", ")", "{", "let", "mappedCollection", "=", "[", "]", ";", "resultSet", ".", "forEach", "(", "result", "=>", "{", "injectResultInCollection", "(", "result", ",", "mappedCollec...
Maps a resultSet to an array of objects. @param {Array} resultSet - an array of database results @param {Array} maps - an array of result maps @param {String} mapId - mapId of the top-level objects in the resultSet @param {String} [columnPrefix] - prefix that should be applied to the column names of the top-level obje...
[ "Maps", "a", "resultSet", "to", "an", "array", "of", "objects", "." ]
3f55faa1178121436c8a51889b291cfef604a87f
https://github.com/archfirst/joinjs/blob/3f55faa1178121436c8a51889b291cfef604a87f/src/index.js#L20-L29
16,341
archfirst/joinjs
src/index.js
mapOne
function mapOne(resultSet, maps, mapId, columnPrefix, isRequired = true) { var mappedCollection = map(resultSet, maps, mapId, columnPrefix); if (mappedCollection.length > 0) { return mappedCollection[0]; } else if (isRequired) { throw new NotFoundError('EmptyResponse'); } else ...
javascript
function mapOne(resultSet, maps, mapId, columnPrefix, isRequired = true) { var mappedCollection = map(resultSet, maps, mapId, columnPrefix); if (mappedCollection.length > 0) { return mappedCollection[0]; } else if (isRequired) { throw new NotFoundError('EmptyResponse'); } else ...
[ "function", "mapOne", "(", "resultSet", ",", "maps", ",", "mapId", ",", "columnPrefix", ",", "isRequired", "=", "true", ")", "{", "var", "mappedCollection", "=", "map", "(", "resultSet", ",", "maps", ",", "mapId", ",", "columnPrefix", ")", ";", "if", "("...
Maps a resultSet to a single object. Although the result is a single object, resultSet may have multiple results (e.g. when the top-level object has many children in a one-to-many relationship). So mapOne() must still call map(), only difference is that it will return only the first result. @param {Array} resultSet -...
[ "Maps", "a", "resultSet", "to", "a", "single", "object", "." ]
3f55faa1178121436c8a51889b291cfef604a87f
https://github.com/archfirst/joinjs/blob/3f55faa1178121436c8a51889b291cfef604a87f/src/index.js#L46-L59
16,342
archfirst/joinjs
src/index.js
injectResultInCollection
function injectResultInCollection(result, mappedCollection, maps, mapId, columnPrefix = '') { // Check if the object is already in mappedCollection let resultMap = maps.find(map => map.mapId === mapId); let idProperty = getIdProperty(resultMap); let predicate = idProperty.reduce((accumulator, field) =>...
javascript
function injectResultInCollection(result, mappedCollection, maps, mapId, columnPrefix = '') { // Check if the object is already in mappedCollection let resultMap = maps.find(map => map.mapId === mapId); let idProperty = getIdProperty(resultMap); let predicate = idProperty.reduce((accumulator, field) =>...
[ "function", "injectResultInCollection", "(", "result", ",", "mappedCollection", ",", "maps", ",", "mapId", ",", "columnPrefix", "=", "''", ")", "{", "// Check if the object is already in mappedCollection", "let", "resultMap", "=", "maps", ".", "find", "(", "map", "=...
Maps a single database result to a single object using mapId and injects it into mappedCollection. @param {Object} result - a single database result (one row) @param {Array} mappedCollection - the collection in which the mapped object should be injected. @param {Array} maps - an array of result maps @param {String} ma...
[ "Maps", "a", "single", "database", "result", "to", "a", "single", "object", "using", "mapId", "and", "injects", "it", "into", "mappedCollection", "." ]
3f55faa1178121436c8a51889b291cfef604a87f
https://github.com/archfirst/joinjs/blob/3f55faa1178121436c8a51889b291cfef604a87f/src/index.js#L70-L102
16,343
archfirst/joinjs
src/index.js
injectResultInObject
function injectResultInObject(result, mappedObject, maps, mapId, columnPrefix = '') { // Get the resultMap for this object let resultMap = maps.find(map => map.mapId === mapId); // Copy id property let idProperty = getIdProperty(resultMap); idProperty.forEach(field => { if (!mappedObject[...
javascript
function injectResultInObject(result, mappedObject, maps, mapId, columnPrefix = '') { // Get the resultMap for this object let resultMap = maps.find(map => map.mapId === mapId); // Copy id property let idProperty = getIdProperty(resultMap); idProperty.forEach(field => { if (!mappedObject[...
[ "function", "injectResultInObject", "(", "result", ",", "mappedObject", ",", "maps", ",", "mapId", ",", "columnPrefix", "=", "''", ")", "{", "// Get the resultMap for this object", "let", "resultMap", "=", "maps", ".", "find", "(", "map", "=>", "map", ".", "ma...
Injects id, properties, associations and collections to the supplied mapped object. @param {Object} result - a single database result (one row) @param {Object} mappedObject - the object in which result needs to be injected @param {Array} maps - an array of result maps @param {String} mapId - mapId of the top-level obj...
[ "Injects", "id", "properties", "associations", "and", "collections", "to", "the", "supplied", "mapped", "object", "." ]
3f55faa1178121436c8a51889b291cfef604a87f
https://github.com/archfirst/joinjs/blob/3f55faa1178121436c8a51889b291cfef604a87f/src/index.js#L113-L186
16,344
mikedeboer/jsDAV
lib/CalDAV/calendarQueryValidator.js
function (vObject, filter) { /** * Definition: * <!ELEMENT filter (comp-filter)> */ if (filter) { if (vObject.name == filter.name) { return this._validateFilterSet(vObject, filter["comp-filters"], this._validateCompFilter) && ...
javascript
function (vObject, filter) { /** * Definition: * <!ELEMENT filter (comp-filter)> */ if (filter) { if (vObject.name == filter.name) { return this._validateFilterSet(vObject, filter["comp-filters"], this._validateCompFilter) && ...
[ "function", "(", "vObject", ",", "filter", ")", "{", "/**\n * Definition:\n * <!ELEMENT filter (comp-filter)>\n */", "if", "(", "filter", ")", "{", "if", "(", "vObject", ".", "name", "==", "filter", ".", "name", ")", "{", "return", "this", ...
Verify if a list of filters applies to the calendar data object The list of filters must be formatted as parsed by \Sabre\CalDAV\CalendarQueryParser @param {jsVObject_Component} vObject @param {Array} filter @return bool
[ "Verify", "if", "a", "list", "of", "filters", "applies", "to", "the", "calendar", "data", "object" ]
1fe585dff008184d3ea03332c50b4fcceadf8b76
https://github.com/mikedeboer/jsDAV/blob/1fe585dff008184d3ea03332c50b4fcceadf8b76/lib/CalDAV/calendarQueryValidator.js#L55-L72
16,345
mikedeboer/jsDAV
lib/CalDAV/calendarQueryValidator.js
function (component, textMatch) { if (component.hasFeature && component.hasFeature(jsVObject_Node)) component = component.getValue(); var isMatching = Util.textMatch(component, textMatch.value, textMatch["match-type"]); return (textMatch["negate-condition"] ^ isMatching); }
javascript
function (component, textMatch) { if (component.hasFeature && component.hasFeature(jsVObject_Node)) component = component.getValue(); var isMatching = Util.textMatch(component, textMatch.value, textMatch["match-type"]); return (textMatch["negate-condition"] ^ isMatching); }
[ "function", "(", "component", ",", "textMatch", ")", "{", "if", "(", "component", ".", "hasFeature", "&&", "component", ".", "hasFeature", "(", "jsVObject_Node", ")", ")", "component", "=", "component", ".", "getValue", "(", ")", ";", "var", "isMatching", ...
This method checks the validity of a text-match. A single text-match should be specified as well as the specific property or parameter we need to validate. @param {jsVObject_Node|String} component Value to check against. @param {Object} textMatch @return bool
[ "This", "method", "checks", "the", "validity", "of", "a", "text", "-", "match", "." ]
1fe585dff008184d3ea03332c50b4fcceadf8b76
https://github.com/mikedeboer/jsDAV/blob/1fe585dff008184d3ea03332c50b4fcceadf8b76/lib/CalDAV/calendarQueryValidator.js#L169-L175
16,346
mikedeboer/jsDAV
lib/CalDAV/calendarQueryValidator.js
function (component, filter) { if (!filter) return true; var start = filter.start, end = filter.end; if (!start) start = new Date(1900, 1, 1); if (!end) end = new Date(3000, 1, 1); switch (component.name) { case "VEVENT" : ...
javascript
function (component, filter) { if (!filter) return true; var start = filter.start, end = filter.end; if (!start) start = new Date(1900, 1, 1); if (!end) end = new Date(3000, 1, 1); switch (component.name) { case "VEVENT" : ...
[ "function", "(", "component", ",", "filter", ")", "{", "if", "(", "!", "filter", ")", "return", "true", ";", "var", "start", "=", "filter", ".", "start", ",", "end", "=", "filter", ".", "end", ";", "if", "(", "!", "start", ")", "start", "=", "new...
Validates if a component matches the given time range. This is all based on the rules specified in rfc4791, which are quite complex. @param {jsVObject_Node} component @param {Object} [filter] @param {Date} [filter.start] @param {Date} [filter.end] @return bool
[ "Validates", "if", "a", "component", "matches", "the", "given", "time", "range", "." ]
1fe585dff008184d3ea03332c50b4fcceadf8b76
https://github.com/mikedeboer/jsDAV/blob/1fe585dff008184d3ea03332c50b4fcceadf8b76/lib/CalDAV/calendarQueryValidator.js#L189-L291
16,347
mikedeboer/jsDAV
lib/DAV/backends/fsext/directory.js
function(name, data, enc, cbfscreatefile) { jsDAV_FS_Directory.createFile.call(this, name, data, enc, afterCreateFile.bind(this, name, cbfscreatefile)); }
javascript
function(name, data, enc, cbfscreatefile) { jsDAV_FS_Directory.createFile.call(this, name, data, enc, afterCreateFile.bind(this, name, cbfscreatefile)); }
[ "function", "(", "name", ",", "data", ",", "enc", ",", "cbfscreatefile", ")", "{", "jsDAV_FS_Directory", ".", "createFile", ".", "call", "(", "this", ",", "name", ",", "data", ",", "enc", ",", "afterCreateFile", ".", "bind", "(", "this", ",", "name", "...
Creates a new file in the directory data is a Buffer resource @param {String} name Name of the file @param {Buffer} data Initial payload @param {String} [enc] @param {Function} cbfscreatefile @return void
[ "Creates", "a", "new", "file", "in", "the", "directory" ]
1fe585dff008184d3ea03332c50b4fcceadf8b76
https://github.com/mikedeboer/jsDAV/blob/1fe585dff008184d3ea03332c50b4fcceadf8b76/lib/DAV/backends/fsext/directory.js#L44-L47
16,348
mikedeboer/jsDAV
lib/DAV/backends/fsext/directory.js
function(handler, name, enc, cbfscreatefile) { jsDAV_FS_Directory.createFileStream.call(this, handler, name, enc, afterCreateFile.bind(this, name, cbfscreatefile)); }
javascript
function(handler, name, enc, cbfscreatefile) { jsDAV_FS_Directory.createFileStream.call(this, handler, name, enc, afterCreateFile.bind(this, name, cbfscreatefile)); }
[ "function", "(", "handler", ",", "name", ",", "enc", ",", "cbfscreatefile", ")", "{", "jsDAV_FS_Directory", ".", "createFileStream", ".", "call", "(", "this", ",", "handler", ",", "name", ",", "enc", ",", "afterCreateFile", ".", "bind", "(", "this", ",", ...
Creates a new file in the directory whilst writing to a stream instead of from Buffer objects that reside in memory. @param {jsDAV_Handler} handler @param {String} name Name of the file @param {String} [enc] @param {Function} cbfscreatefile @return void
[ "Creates", "a", "new", "file", "in", "the", "directory", "whilst", "writing", "to", "a", "stream", "instead", "of", "from", "Buffer", "objects", "that", "reside", "in", "memory", "." ]
1fe585dff008184d3ea03332c50b4fcceadf8b76
https://github.com/mikedeboer/jsDAV/blob/1fe585dff008184d3ea03332c50b4fcceadf8b76/lib/DAV/backends/fsext/directory.js#L60-L63
16,349
mikedeboer/jsDAV
lib/DAV/backends/fsext/directory.js
function(name, cbfsgetchild) { var path = Path.join(this.path, name); Fs.stat(path, function(err, stat) { if (err || typeof stat == "undefined") { return cbfsgetchild(new Exc.FileNotFound("File with name " + path + " could not be located")); }...
javascript
function(name, cbfsgetchild) { var path = Path.join(this.path, name); Fs.stat(path, function(err, stat) { if (err || typeof stat == "undefined") { return cbfsgetchild(new Exc.FileNotFound("File with name " + path + " could not be located")); }...
[ "function", "(", "name", ",", "cbfsgetchild", ")", "{", "var", "path", "=", "Path", ".", "join", "(", "this", ".", "path", ",", "name", ")", ";", "Fs", ".", "stat", "(", "path", ",", "function", "(", "err", ",", "stat", ")", "{", "if", "(", "er...
Returns a specific child node, referenced by its name @param {String} name @throws Sabre_DAV_Exception_FileNotFound @return Sabre_DAV_INode
[ "Returns", "a", "specific", "child", "node", "referenced", "by", "its", "name" ]
1fe585dff008184d3ea03332c50b4fcceadf8b76
https://github.com/mikedeboer/jsDAV/blob/1fe585dff008184d3ea03332c50b4fcceadf8b76/lib/DAV/backends/fsext/directory.js#L88-L100
16,350
mikedeboer/jsDAV
lib/DAV/backends/fsext/directory.js
function(cbfsgetchildren) { var nodes = []; Async.readdir(this.path) .stat() .filter(function(file) { return file.indexOf(jsDAV_FSExt_File.PROPS_DIR) !== 0; }) .each(function(file, cbnextdirch) { nodes.push(file.stat.is...
javascript
function(cbfsgetchildren) { var nodes = []; Async.readdir(this.path) .stat() .filter(function(file) { return file.indexOf(jsDAV_FSExt_File.PROPS_DIR) !== 0; }) .each(function(file, cbnextdirch) { nodes.push(file.stat.is...
[ "function", "(", "cbfsgetchildren", ")", "{", "var", "nodes", "=", "[", "]", ";", "Async", ".", "readdir", "(", "this", ".", "path", ")", ".", "stat", "(", ")", ".", "filter", "(", "function", "(", "file", ")", "{", "return", "file", ".", "indexOf"...
Returns an array with all the child nodes @return jsDAV_iNode[]
[ "Returns", "an", "array", "with", "all", "the", "child", "nodes" ]
1fe585dff008184d3ea03332c50b4fcceadf8b76
https://github.com/mikedeboer/jsDAV/blob/1fe585dff008184d3ea03332c50b4fcceadf8b76/lib/DAV/backends/fsext/directory.js#L107-L124
16,351
mikedeboer/jsDAV
lib/DAV/backends/fsext/directory.js
function(cbfsdel) { var self = this; Async.rmtree(this.path, function(err) { if (err) return cbfsdel(err); self.deleteResourceData(cbfsdel); }); }
javascript
function(cbfsdel) { var self = this; Async.rmtree(this.path, function(err) { if (err) return cbfsdel(err); self.deleteResourceData(cbfsdel); }); }
[ "function", "(", "cbfsdel", ")", "{", "var", "self", "=", "this", ";", "Async", ".", "rmtree", "(", "this", ".", "path", ",", "function", "(", "err", ")", "{", "if", "(", "err", ")", "return", "cbfsdel", "(", "err", ")", ";", "self", ".", "delete...
Deletes all files in this directory, and then itself @return void
[ "Deletes", "all", "files", "in", "this", "directory", "and", "then", "itself" ]
1fe585dff008184d3ea03332c50b4fcceadf8b76
https://github.com/mikedeboer/jsDAV/blob/1fe585dff008184d3ea03332c50b4fcceadf8b76/lib/DAV/backends/fsext/directory.js#L131-L138
16,352
mikedeboer/jsDAV
lib/DAV/plugins/auth/abstractDigest.js
getDigest
function getDigest(req) { // most other servers var digest = req.headers["authorization"]; if (digest && digest.toLowerCase().indexOf("digest") === 0) return digest.substr(7); else return null; }
javascript
function getDigest(req) { // most other servers var digest = req.headers["authorization"]; if (digest && digest.toLowerCase().indexOf("digest") === 0) return digest.substr(7); else return null; }
[ "function", "getDigest", "(", "req", ")", "{", "// most other servers", "var", "digest", "=", "req", ".", "headers", "[", "\"authorization\"", "]", ";", "if", "(", "digest", "&&", "digest", ".", "toLowerCase", "(", ")", ".", "indexOf", "(", "\"digest\"", "...
This method returns the full digest string. If the header could not be found, null will be returned @return mixed
[ "This", "method", "returns", "the", "full", "digest", "string", "." ]
1fe585dff008184d3ea03332c50b4fcceadf8b76
https://github.com/mikedeboer/jsDAV/blob/1fe585dff008184d3ea03332c50b4fcceadf8b76/lib/DAV/plugins/auth/abstractDigest.js#L28-L35
16,353
mikedeboer/jsDAV
lib/DAV/plugins/auth/abstractDigest.js
parseDigest
function parseDigest(digest) { if (!digest) return false; // protect against missing data var needed_parts = {"nonce": 1, "nc": 1, "cnonce": 1, "qop": 1, "username": 1, "uri": 1, "response": 1}; var data = {}; digest.replace(/(\w+)=(?:(?:")([^"]+)"|([^\s,]+))/g, function(m, m1, m2, ...
javascript
function parseDigest(digest) { if (!digest) return false; // protect against missing data var needed_parts = {"nonce": 1, "nc": 1, "cnonce": 1, "qop": 1, "username": 1, "uri": 1, "response": 1}; var data = {}; digest.replace(/(\w+)=(?:(?:")([^"]+)"|([^\s,]+))/g, function(m, m1, m2, ...
[ "function", "parseDigest", "(", "digest", ")", "{", "if", "(", "!", "digest", ")", "return", "false", ";", "// protect against missing data", "var", "needed_parts", "=", "{", "\"nonce\"", ":", "1", ",", "\"nc\"", ":", "1", ",", "\"cnonce\"", ":", "1", ",",...
Parses the different pieces of the digest string into an array. This method returns false if an incomplete digest was supplied @param {String} digest @return mixed
[ "Parses", "the", "different", "pieces", "of", "the", "digest", "string", "into", "an", "array", "." ]
1fe585dff008184d3ea03332c50b4fcceadf8b76
https://github.com/mikedeboer/jsDAV/blob/1fe585dff008184d3ea03332c50b4fcceadf8b76/lib/DAV/plugins/auth/abstractDigest.js#L45-L60
16,354
mikedeboer/jsDAV
lib/DAV/plugins/auth/abstractDigest.js
function(realm, req) { this.realm = realm; this.opaque = Util.createHash(this.realm); this.digest = getDigest(req); this.digestParts = parseDigest(this.digest); }
javascript
function(realm, req) { this.realm = realm; this.opaque = Util.createHash(this.realm); this.digest = getDigest(req); this.digestParts = parseDigest(this.digest); }
[ "function", "(", "realm", ",", "req", ")", "{", "this", ".", "realm", "=", "realm", ";", "this", ".", "opaque", "=", "Util", ".", "createHash", "(", "this", ".", "realm", ")", ";", "this", ".", "digest", "=", "getDigest", "(", "req", ")", ";", "t...
Gathers all information from the headers This method needs to be called prior to anything else. @return void
[ "Gathers", "all", "information", "from", "the", "headers" ]
1fe585dff008184d3ea03332c50b4fcceadf8b76
https://github.com/mikedeboer/jsDAV/blob/1fe585dff008184d3ea03332c50b4fcceadf8b76/lib/DAV/plugins/auth/abstractDigest.js#L92-L97
16,355
mikedeboer/jsDAV
lib/DAV/plugins/auth/abstractDigest.js
function(handler, password, cbvalidpass) { this.A1 = Util.createHash(this.digestParts["username"] + ":" + this.realm + ":" + password); this.validate(handler, cbvalidpass); }
javascript
function(handler, password, cbvalidpass) { this.A1 = Util.createHash(this.digestParts["username"] + ":" + this.realm + ":" + password); this.validate(handler, cbvalidpass); }
[ "function", "(", "handler", ",", "password", ",", "cbvalidpass", ")", "{", "this", ".", "A1", "=", "Util", ".", "createHash", "(", "this", ".", "digestParts", "[", "\"username\"", "]", "+", "\":\"", "+", "this", ".", "realm", "+", "\":\"", "+", "passwo...
Validates authentication through a password. The actual password must be provided here. It is strongly recommended not store the password in plain-text and use validateA1 instead. @param {String} password @return bool
[ "Validates", "authentication", "through", "a", "password", ".", "The", "actual", "password", "must", "be", "provided", "here", ".", "It", "is", "strongly", "recommended", "not", "store", "the", "password", "in", "plain", "-", "text", "and", "use", "validateA1"...
1fe585dff008184d3ea03332c50b4fcceadf8b76
https://github.com/mikedeboer/jsDAV/blob/1fe585dff008184d3ea03332c50b4fcceadf8b76/lib/DAV/plugins/auth/abstractDigest.js#L139-L142
16,356
mikedeboer/jsDAV
lib/DAV/plugins/auth/abstractDigest.js
function(handler, cbvalidate) { var req = handler.httpRequest; var A2 = req.method + ":" + this.digestParts["uri"]; var self = this; if (this.digestParts["qop"] == "auth-int") { // Making sure we support this qop value if (!(this.qop & QOP_AUTHINT)) ...
javascript
function(handler, cbvalidate) { var req = handler.httpRequest; var A2 = req.method + ":" + this.digestParts["uri"]; var self = this; if (this.digestParts["qop"] == "auth-int") { // Making sure we support this qop value if (!(this.qop & QOP_AUTHINT)) ...
[ "function", "(", "handler", ",", "cbvalidate", ")", "{", "var", "req", "=", "handler", ".", "httpRequest", ";", "var", "A2", "=", "req", ".", "method", "+", "\":\"", "+", "this", ".", "digestParts", "[", "\"uri\"", "]", ";", "var", "self", "=", "this...
Validates the digest challenge @return bool
[ "Validates", "the", "digest", "challenge" ]
1fe585dff008184d3ea03332c50b4fcceadf8b76
https://github.com/mikedeboer/jsDAV/blob/1fe585dff008184d3ea03332c50b4fcceadf8b76/lib/DAV/plugins/auth/abstractDigest.js#L158-L189
16,357
mikedeboer/jsDAV
lib/DAV/plugins/auth/abstractDigest.js
function(realm, err, cbreqauth) { if (!(err instanceof Exc.jsDAV_Exception)) err = new Exc.NotAuthenticated(err); var currQop = ""; switch (this.qop) { case QOP_AUTH: currQop = "auth"; break; case QOP_AUTHINT: c...
javascript
function(realm, err, cbreqauth) { if (!(err instanceof Exc.jsDAV_Exception)) err = new Exc.NotAuthenticated(err); var currQop = ""; switch (this.qop) { case QOP_AUTH: currQop = "auth"; break; case QOP_AUTHINT: c...
[ "function", "(", "realm", ",", "err", ",", "cbreqauth", ")", "{", "if", "(", "!", "(", "err", "instanceof", "Exc", ".", "jsDAV_Exception", ")", ")", "err", "=", "new", "Exc", ".", "NotAuthenticated", "(", "err", ")", ";", "var", "currQop", "=", "\"\"...
Returns an HTTP 401 header, forcing login This should be called when username and password are incorrect, or not supplied at all @return void
[ "Returns", "an", "HTTP", "401", "header", "forcing", "login" ]
1fe585dff008184d3ea03332c50b4fcceadf8b76
https://github.com/mikedeboer/jsDAV/blob/1fe585dff008184d3ea03332c50b4fcceadf8b76/lib/DAV/plugins/auth/abstractDigest.js#L209-L230
16,358
mikedeboer/jsDAV
lib/DAV/plugins/auth/abstractDigest.js
function(handler, realm, cbauth) { var req = handler.httpRequest; this.init(realm, req); var username = this.digestParts["username"]; // No username was given if (!username) return this.requireAuth(realm, "No digest authentication headers were found", cbauth); ...
javascript
function(handler, realm, cbauth) { var req = handler.httpRequest; this.init(realm, req); var username = this.digestParts["username"]; // No username was given if (!username) return this.requireAuth(realm, "No digest authentication headers were found", cbauth); ...
[ "function", "(", "handler", ",", "realm", ",", "cbauth", ")", "{", "var", "req", "=", "handler", ".", "httpRequest", ";", "this", ".", "init", "(", "realm", ",", "req", ")", ";", "var", "username", "=", "this", ".", "digestParts", "[", "\"username\"", ...
Authenticates the user based on the current request. If authentication is succesful, true must be returned. If authentication fails, an exception must be thrown. @throws Sabre_DAV_Exception_NotAuthenticated @return bool
[ "Authenticates", "the", "user", "based", "on", "the", "current", "request", "." ]
1fe585dff008184d3ea03332c50b4fcceadf8b76
https://github.com/mikedeboer/jsDAV/blob/1fe585dff008184d3ea03332c50b4fcceadf8b76/lib/DAV/plugins/auth/abstractDigest.js#L241-L271
16,359
rain1017/memdb
lib/autoconnection.js
function(opts){ opts = opts || {}; this.db = opts.db; this.config = { maxConnection : opts.maxConnection || DEFAULT_MAX_CONNECTION, connectionIdleTimeout : opts.connectionIdleTimeout || DEFAULT_CONNECTION_IDLE_TIMEOUT, maxPendingTask : opts.maxPendingTask || DEFAULT_MAX_PENDING_TAS...
javascript
function(opts){ opts = opts || {}; this.db = opts.db; this.config = { maxConnection : opts.maxConnection || DEFAULT_MAX_CONNECTION, connectionIdleTimeout : opts.connectionIdleTimeout || DEFAULT_CONNECTION_IDLE_TIMEOUT, maxPendingTask : opts.maxPendingTask || DEFAULT_MAX_PENDING_TAS...
[ "function", "(", "opts", ")", "{", "opts", "=", "opts", "||", "{", "}", ";", "this", ".", "db", "=", "opts", ".", "db", ";", "this", ".", "config", "=", "{", "maxConnection", ":", "opts", ".", "maxConnection", "||", "DEFAULT_MAX_CONNECTION", ",", "co...
Use one connection per transaction Route request to shards
[ "Use", "one", "connection", "per", "transaction", "Route", "request", "to", "shards" ]
bded437d0e6aa286ec15238c71a91f96ded8e14e
https://github.com/rain1017/memdb/blob/bded437d0e6aa286ec15238c71a91f96ded8e14e/lib/autoconnection.js#L38-L79
16,360
aragon/aragon-cli
packages/aragon-cli/src/commands/apm_cmds/publish.js
prepareFilesForPublishing
async function prepareFilesForPublishing( tmpDir, files = [], ignorePatterns = null ) { // Ignored files filter const filter = ignore().add(ignorePatterns) const projectRoot = findProjectRoot() function createFilter(files, ignorePath) { let f = fs.readFileSync(ignorePath).toString() files.forEach...
javascript
async function prepareFilesForPublishing( tmpDir, files = [], ignorePatterns = null ) { // Ignored files filter const filter = ignore().add(ignorePatterns) const projectRoot = findProjectRoot() function createFilter(files, ignorePath) { let f = fs.readFileSync(ignorePath).toString() files.forEach...
[ "async", "function", "prepareFilesForPublishing", "(", "tmpDir", ",", "files", "=", "[", "]", ",", "ignorePatterns", "=", "null", ")", "{", "// Ignored files filter", "const", "filter", "=", "ignore", "(", ")", ".", "add", "(", "ignorePatterns", ")", "const", ...
Moves the specified files to a temporary directory and returns the path to the temporary directory. @param {string} tmpDir Temporary directory @param {Array<string>} files An array of file paths to include @param {string} ignorePatterns An array of glob-like pattern of files to ignore @return {string} The path to the t...
[ "Moves", "the", "specified", "files", "to", "a", "temporary", "directory", "and", "returns", "the", "path", "to", "the", "temporary", "directory", "." ]
88b5a33255df94cd2b95f43e40fda8ac5b9be99a
https://github.com/aragon/aragon-cli/blob/88b5a33255df94cd2b95f43e40fda8ac5b9be99a/packages/aragon-cli/src/commands/apm_cmds/publish.js#L215-L279
16,361
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/base.js
moduleDefine
function moduleDefine(exports, name, members) { var target = [exports]; var publicNS = null; if (name) { publicNS = createNamespace(_Global, name); target.push(publicNS); } initializeProperties(target, members, name || "<ANONYMO...
javascript
function moduleDefine(exports, name, members) { var target = [exports]; var publicNS = null; if (name) { publicNS = createNamespace(_Global, name); target.push(publicNS); } initializeProperties(target, members, name || "<ANONYMO...
[ "function", "moduleDefine", "(", "exports", ",", "name", ",", "members", ")", "{", "var", "target", "=", "[", "exports", "]", ";", "var", "publicNS", "=", "null", ";", "if", "(", "name", ")", "{", "publicNS", "=", "createNamespace", "(", "_Global", ","...
helper for defining AMD module members
[ "helper", "for", "defining", "AMD", "module", "members" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/base.js#L369-L378
16,362
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/base.js
completed
function completed(promise, value) { var targetState; if (value && typeof value === "object" && typeof value.then === "function") { targetState = state_waiting; } else { targetState = state_success_notify; } promise._value = value; promise._setStat...
javascript
function completed(promise, value) { var targetState; if (value && typeof value === "object" && typeof value.then === "function") { targetState = state_waiting; } else { targetState = state_success_notify; } promise._value = value; promise._setStat...
[ "function", "completed", "(", "promise", ",", "value", ")", "{", "var", "targetState", ";", "if", "(", "value", "&&", "typeof", "value", "===", "\"object\"", "&&", "typeof", "value", ".", "then", "===", "\"function\"", ")", "{", "targetState", "=", "state_...
Implementations of shared state machine code.
[ "Implementations", "of", "shared", "state", "machine", "code", "." ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/base.js#L2023-L2032
16,363
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/base.js
timeout
function timeout(timeoutMS) { var id; return new Promise( function (c) { if (timeoutMS) { id = _Global.setTimeout(c, timeoutMS); } else { _BaseCoreUtils._setImmediate(c); } }, func...
javascript
function timeout(timeoutMS) { var id; return new Promise( function (c) { if (timeoutMS) { id = _Global.setTimeout(c, timeoutMS); } else { _BaseCoreUtils._setImmediate(c); } }, func...
[ "function", "timeout", "(", "timeoutMS", ")", "{", "var", "id", ";", "return", "new", "Promise", "(", "function", "(", "c", ")", "{", "if", "(", "timeoutMS", ")", "{", "id", "=", "_Global", ".", "setTimeout", "(", "c", ",", "timeoutMS", ")", ";", "...
Promise is the user-creatable WinJS.Promise object.
[ "Promise", "is", "the", "user", "-", "creatable", "WinJS", ".", "Promise", "object", "." ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/base.js#L2525-L2541
16,364
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/base.js
setState
function setState(state) { return function (job, arg0, arg1) { job._setState(state, arg0, arg1); }; }
javascript
function setState(state) { return function (job, arg0, arg1) { job._setState(state, arg0, arg1); }; }
[ "function", "setState", "(", "state", ")", "{", "return", "function", "(", "job", ",", "arg0", ",", "arg1", ")", "{", "job", ".", "_setState", "(", "state", ",", "arg0", ",", "arg1", ")", ";", "}", ";", "}" ]
Helper which yields a function that transitions to the specified state
[ "Helper", "which", "yields", "a", "function", "that", "transitions", "to", "the", "specified", "state" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/base.js#L3520-L3524
16,365
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/base.js
notifyCurrentDrainListener
function notifyCurrentDrainListener() { var listener = drainQueue.shift(); if (listener) { drainStopping(listener); drainQueue[0] && drainStarting(drainQueue[0]); listener.complete(); } }
javascript
function notifyCurrentDrainListener() { var listener = drainQueue.shift(); if (listener) { drainStopping(listener); drainQueue[0] && drainStarting(drainQueue[0]); listener.complete(); } }
[ "function", "notifyCurrentDrainListener", "(", ")", "{", "var", "listener", "=", "drainQueue", ".", "shift", "(", ")", ";", "if", "(", "listener", ")", "{", "drainStopping", "(", "listener", ")", ";", "drainQueue", "[", "0", "]", "&&", "drainStarting", "("...
Notifies and removes the current drain listener
[ "Notifies", "and", "removes", "the", "current", "drain", "listener" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/base.js#L4135-L4143
16,366
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/base.js
notifyDrainListeners
function notifyDrainListeners() { var notifiedSomebody = false; if (!!drainQueue.length) { // As we exhaust priority levels, notify the appropriate drain listeners. // var drainPriority = currentDrainPriority(); while (+drainPriority === drainPriority && d...
javascript
function notifyDrainListeners() { var notifiedSomebody = false; if (!!drainQueue.length) { // As we exhaust priority levels, notify the appropriate drain listeners. // var drainPriority = currentDrainPriority(); while (+drainPriority === drainPriority && d...
[ "function", "notifyDrainListeners", "(", ")", "{", "var", "notifiedSomebody", "=", "false", ";", "if", "(", "!", "!", "drainQueue", ".", "length", ")", "{", "// As we exhaust priority levels, notify the appropriate drain listeners.", "//", "var", "drainPriority", "=", ...
Notifies all drain listeners which are at a priority > highWaterMark. Returns whether or not any drain listeners were notified. This function sets pumpingPriority and reads highWaterMark. Note that it may call into user code which may call back into the scheduler.
[ "Notifies", "all", "drain", "listeners", "which", "are", "at", "a", "priority", ">", "highWaterMark", ".", "Returns", "whether", "or", "not", "any", "drain", "listeners", "were", "notified", ".", "This", "function", "sets", "pumpingPriority", "and", "reads", "...
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/base.js#L4150-L4164
16,367
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/base.js
addJobAtHeadOfPriority
function addJobAtHeadOfPriority(node, priority) { var marker = markerFromPriority(priority); if (marker.priority > highWaterMark) { highWaterMark = marker.priority; immediateYield = true; } marker._insertJobAfter(node); }
javascript
function addJobAtHeadOfPriority(node, priority) { var marker = markerFromPriority(priority); if (marker.priority > highWaterMark) { highWaterMark = marker.priority; immediateYield = true; } marker._insertJobAfter(node); }
[ "function", "addJobAtHeadOfPriority", "(", "node", ",", "priority", ")", "{", "var", "marker", "=", "markerFromPriority", "(", "priority", ")", ";", "if", "(", "marker", ".", "priority", ">", "highWaterMark", ")", "{", "highWaterMark", "=", "marker", ".", "p...
Mechanism for the scheduler
[ "Mechanism", "for", "the", "scheduler" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/base.js#L4246-L4253
16,368
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/base.js
setAttribute
function setAttribute(element, attribute, value) { if (element.getAttribute(attribute) !== "" + value) { element.setAttribute(attribute, value); } }
javascript
function setAttribute(element, attribute, value) { if (element.getAttribute(attribute) !== "" + value) { element.setAttribute(attribute, value); } }
[ "function", "setAttribute", "(", "element", ",", "attribute", ",", "value", ")", "{", "if", "(", "element", ".", "getAttribute", "(", "attribute", ")", "!==", "\"\"", "+", "value", ")", "{", "element", ".", "setAttribute", "(", "attribute", ",", "value", ...
Only set the attribute if its value has changed
[ "Only", "set", "the", "attribute", "if", "its", "value", "has", "changed" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/base.js#L5687-L5691
16,369
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/base.js
addListenerToEventMap
function addListenerToEventMap(element, type, listener, useCapture, data) { var eventNameLowercase = type.toLowerCase(); if (!element._eventsMap) { element._eventsMap = {}; } if (!element._eventsMap[eventNameLowercase]) { element._eventsMap[eventNameLowercase] = [...
javascript
function addListenerToEventMap(element, type, listener, useCapture, data) { var eventNameLowercase = type.toLowerCase(); if (!element._eventsMap) { element._eventsMap = {}; } if (!element._eventsMap[eventNameLowercase]) { element._eventsMap[eventNameLowercase] = [...
[ "function", "addListenerToEventMap", "(", "element", ",", "type", ",", "listener", ",", "useCapture", ",", "data", ")", "{", "var", "eventNameLowercase", "=", "type", ".", "toLowerCase", "(", ")", ";", "if", "(", "!", "element", ".", "_eventsMap", ")", "{"...
Helpers for managing element._eventsMap for custom events
[ "Helpers", "for", "managing", "element", ".", "_eventsMap", "for", "custom", "events" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/base.js#L5776-L5789
16,370
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/base.js
function (element) { var hiddenElement = _Global.document.createElement("div"); hiddenElement.style[_BaseUtils._browserStyleEquivalents["animation-name"].scriptName] = "WinJS-node-inserted"; hiddenElement.style[_BaseUtils._browserStyleEquivalents["animation-duration"].scriptName] = "...
javascript
function (element) { var hiddenElement = _Global.document.createElement("div"); hiddenElement.style[_BaseUtils._browserStyleEquivalents["animation-name"].scriptName] = "WinJS-node-inserted"; hiddenElement.style[_BaseUtils._browserStyleEquivalents["animation-duration"].scriptName] = "...
[ "function", "(", "element", ")", "{", "var", "hiddenElement", "=", "_Global", ".", "document", ".", "createElement", "(", "\"div\"", ")", ";", "hiddenElement", ".", "style", "[", "_BaseUtils", ".", "_browserStyleEquivalents", "[", "\"animation-name\"", "]", ".",...
Appends a hidden child to the given element that will listen for being added to the DOM. When the hidden element is added to the DOM, it will dispatch a "WinJSNodeInserted" event on the provided element.
[ "Appends", "a", "hidden", "child", "to", "the", "given", "element", "that", "will", "listen", "for", "being", "added", "to", "the", "DOM", ".", "When", "the", "hidden", "element", "is", "added", "to", "the", "DOM", "it", "will", "dispatch", "a", "WinJSNo...
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/base.js#L6723-L6739
16,371
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/base.js
readWhitespace
function readWhitespace(text, offset, limit) { while (offset < limit) { var code = text.charCodeAt(offset); switch (code) { case 0x0009: // tab case 0x000B: // vertical tab ...
javascript
function readWhitespace(text, offset, limit) { while (offset < limit) { var code = text.charCodeAt(offset); switch (code) { case 0x0009: // tab case 0x000B: // vertical tab ...
[ "function", "readWhitespace", "(", "text", ",", "offset", ",", "limit", ")", "{", "while", "(", "offset", "<", "limit", ")", "{", "var", "code", "=", "text", ".", "charCodeAt", "(", "offset", ")", ";", "switch", "(", "code", ")", "{", "case", "0x0009...
Hand-inlined isWhitespace.
[ "Hand", "-", "inlined", "isWhitespace", "." ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/base.js#L8698-L8731
16,372
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/base.js
function () { if (this._notificationsSent && !this._externalBegin && !this._endNotificationsPosted) { this._endNotificationsPosted = true; var that = this; Scheduler.schedule(function ItemsManager_async_endNotifications() { ...
javascript
function () { if (this._notificationsSent && !this._externalBegin && !this._endNotificationsPosted) { this._endNotificationsPosted = true; var that = this; Scheduler.schedule(function ItemsManager_async_endNotifications() { ...
[ "function", "(", ")", "{", "if", "(", "this", ".", "_notificationsSent", "&&", "!", "this", ".", "_externalBegin", "&&", "!", "this", ".", "_endNotificationsPosted", ")", "{", "this", ".", "_endNotificationsPosted", "=", "true", ";", "var", "that", "=", "t...
Some functions may be called synchronously or asynchronously, so it's best to post _endNotifications to avoid calling it prematurely.
[ "Some", "functions", "may", "be", "called", "synchronously", "or", "asynchronously", "so", "it", "s", "best", "to", "post", "_endNotifications", "to", "avoid", "calling", "it", "prematurely", "." ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/base.js#L11291-L11300
16,373
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/base.js
tabbableElementsNodeFilter
function tabbableElementsNodeFilter(node) { var nodeStyle = _ElementUtilities._getComputedStyle(node); if (nodeStyle.display === "none" || nodeStyle.visibility === "hidden") { return _Global.NodeFilter.FILTER_REJECT; } if (node._tabContainer) { return _Global.Node...
javascript
function tabbableElementsNodeFilter(node) { var nodeStyle = _ElementUtilities._getComputedStyle(node); if (nodeStyle.display === "none" || nodeStyle.visibility === "hidden") { return _Global.NodeFilter.FILTER_REJECT; } if (node._tabContainer) { return _Global.Node...
[ "function", "tabbableElementsNodeFilter", "(", "node", ")", "{", "var", "nodeStyle", "=", "_ElementUtilities", ".", "_getComputedStyle", "(", "node", ")", ";", "if", "(", "nodeStyle", ".", "display", "===", "\"none\"", "||", "nodeStyle", ".", "visibility", "==="...
tabbableElementsNodeFilter works with the TreeWalker to create a view of the DOM tree that is built up of what we want the focusable tree to look like. When it runs into a tab contained area, it rejects anything except the childFocus element so that any potentially tabbable things that the TabContainer doesn't want tab...
[ "tabbableElementsNodeFilter", "works", "with", "the", "TreeWalker", "to", "create", "a", "view", "of", "the", "DOM", "tree", "that", "is", "built", "up", "of", "what", "we", "want", "the", "focusable", "tree", "to", "look", "like", ".", "When", "it", "runs...
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/base.js#L11381-L11402
16,374
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/base.js
drainQueue
function drainQueue(jobInfo) { function drainNext() { return drainQueue; } var queue = jobInfo.job._queue; if (queue.length === 0 && eventQueue.length > 0) { queue = jobInfo.job._queue = copyAndClearQueue(); } jobInfo.setPromise(drainOneEvent(qu...
javascript
function drainQueue(jobInfo) { function drainNext() { return drainQueue; } var queue = jobInfo.job._queue; if (queue.length === 0 && eventQueue.length > 0) { queue = jobInfo.job._queue = copyAndClearQueue(); } jobInfo.setPromise(drainOneEvent(qu...
[ "function", "drainQueue", "(", "jobInfo", ")", "{", "function", "drainNext", "(", ")", "{", "return", "drainQueue", ";", "}", "var", "queue", "=", "jobInfo", ".", "job", ".", "_queue", ";", "if", "(", "queue", ".", "length", "===", "0", "&&", "eventQue...
Drains the event queue via the scheduler
[ "Drains", "the", "event", "queue", "via", "the", "scheduler" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/base.js#L14908-L14920
16,375
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/base.js
activatedHandler
function activatedHandler(e) { var def = captureDeferral(e.activatedOperation); _State._loadState(e).then(function () { queueEvent({ type: activatedET, detail: e, _deferral: def.deferral, _deferralID: def.id }); }); }
javascript
function activatedHandler(e) { var def = captureDeferral(e.activatedOperation); _State._loadState(e).then(function () { queueEvent({ type: activatedET, detail: e, _deferral: def.deferral, _deferralID: def.id }); }); }
[ "function", "activatedHandler", "(", "e", ")", "{", "var", "def", "=", "captureDeferral", "(", "e", ".", "activatedOperation", ")", ";", "_State", ".", "_loadState", "(", "e", ")", ".", "then", "(", "function", "(", ")", "{", "queueEvent", "(", "{", "t...
loaded == DOMContentLoaded activated == after WinRT Activated ready == after all of the above
[ "loaded", "==", "DOMContentLoaded", "activated", "==", "after", "WinRT", "Activated", "ready", "==", "after", "all", "of", "the", "above" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/base.js#L15022-L15027
16,376
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/base.js
transformWithTransition
function transformWithTransition(element, transition) { // transition's properties: // - duration: Number representing the duration of the animation in milliseconds. // - timing: String representing the CSS timing function that controls the progress of the animation. // - to: The value o...
javascript
function transformWithTransition(element, transition) { // transition's properties: // - duration: Number representing the duration of the animation in milliseconds. // - timing: String representing the CSS timing function that controls the progress of the animation. // - to: The value o...
[ "function", "transformWithTransition", "(", "element", ",", "transition", ")", "{", "// transition's properties:", "// - duration: Number representing the duration of the animation in milliseconds.", "// - timing: String representing the CSS timing function that controls the progress of the anim...
Resize animation The resize animation requires 2 animations to run simultaneously in sync with each other. It's implemented without PVL because PVL doesn't provide a way to guarantee that 2 animations will start at the same time.
[ "Resize", "animation", "The", "resize", "animation", "requires", "2", "animations", "to", "run", "simultaneously", "in", "sync", "with", "each", "other", ".", "It", "s", "implemented", "without", "PVL", "because", "PVL", "doesn", "t", "provide", "a", "way", ...
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/base.js#L16645-L16683
16,377
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/base.js
disposeInstance
function disposeInstance(container, workPromise, renderCompletePromise) { var bindings = _ElementUtilities.data(container).bindTokens; if (bindings) { bindings.forEach(function (binding) { if (binding && binding.cancel) { ...
javascript
function disposeInstance(container, workPromise, renderCompletePromise) { var bindings = _ElementUtilities.data(container).bindTokens; if (bindings) { bindings.forEach(function (binding) { if (binding && binding.cancel) { ...
[ "function", "disposeInstance", "(", "container", ",", "workPromise", ",", "renderCompletePromise", ")", "{", "var", "bindings", "=", "_ElementUtilities", ".", "data", "(", "container", ")", ".", "bindTokens", ";", "if", "(", "bindings", ")", "{", "bindings", "...
Runtime helper functions
[ "Runtime", "helper", "functions" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/base.js#L20559-L20574
16,378
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/base.js
PageControl_ctor
function PageControl_ctor(element, options, complete, parentedPromise) { var that = this; this._disposed = false; this.element = element = element || _Global.document.createElement("div"); _ElementUtilities.addClass(element, "win-disposable...
javascript
function PageControl_ctor(element, options, complete, parentedPromise) { var that = this; this._disposed = false; this.element = element = element || _Global.document.createElement("div"); _ElementUtilities.addClass(element, "win-disposable...
[ "function", "PageControl_ctor", "(", "element", ",", "options", ",", "complete", ",", "parentedPromise", ")", "{", "var", "that", "=", "this", ";", "this", ".", "_disposed", "=", "false", ";", "this", ".", "element", "=", "element", "=", "element", "||", ...
This needs to follow the WinJS.UI.processAll "async constructor" pattern to interop nicely in the "Views.Control" use case.
[ "This", "needs", "to", "follow", "the", "WinJS", ".", "UI", ".", "processAll", "async", "constructor", "pattern", "to", "interop", "nicely", "in", "the", "Views", ".", "Control", "use", "case", "." ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/base.js#L26466-L26524
16,379
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
moveSequenceBefore
function moveSequenceBefore(slotNext, slotFirst, slotLast) { slotFirst.prev.next = slotLast.next; slotLast.next.prev = slotFirst.prev; slotFirst.prev = slotNext.prev; slotLast.next = slotNext; slotFirst.prev.next = slo...
javascript
function moveSequenceBefore(slotNext, slotFirst, slotLast) { slotFirst.prev.next = slotLast.next; slotLast.next.prev = slotFirst.prev; slotFirst.prev = slotNext.prev; slotLast.next = slotNext; slotFirst.prev.next = slo...
[ "function", "moveSequenceBefore", "(", "slotNext", ",", "slotFirst", ",", "slotLast", ")", "{", "slotFirst", ".", "prev", ".", "next", "=", "slotLast", ".", "next", ";", "slotLast", ".", "next", ".", "prev", "=", "slotFirst", ".", "prev", ";", "slotFirst",...
Does a little careful surgery to the slot sequence from slotFirst to slotLast before slotNext
[ "Does", "a", "little", "careful", "surgery", "to", "the", "slot", "sequence", "from", "slotFirst", "to", "slotLast", "before", "slotNext" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L322-L333
16,380
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
moveSequenceAfter
function moveSequenceAfter(slotPrev, slotFirst, slotLast) { slotFirst.prev.next = slotLast.next; slotLast.next.prev = slotFirst.prev; slotFirst.prev = slotPrev; slotLast.next = slotPrev.next; slotPrev.next = slotFirst;...
javascript
function moveSequenceAfter(slotPrev, slotFirst, slotLast) { slotFirst.prev.next = slotLast.next; slotLast.next.prev = slotFirst.prev; slotFirst.prev = slotPrev; slotLast.next = slotPrev.next; slotPrev.next = slotFirst;...
[ "function", "moveSequenceAfter", "(", "slotPrev", ",", "slotFirst", ",", "slotLast", ")", "{", "slotFirst", ".", "prev", ".", "next", "=", "slotLast", ".", "next", ";", "slotLast", ".", "next", ".", "prev", "=", "slotFirst", ".", "prev", ";", "slotFirst", ...
Does a little careful surgery to the slot sequence from slotFirst to slotLast after slotPrev
[ "Does", "a", "little", "careful", "surgery", "to", "the", "slot", "sequence", "from", "slotFirst", "to", "slotLast", "after", "slotPrev" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L336-L347
16,381
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
insertAndMergeSlot
function insertAndMergeSlot(slot, slotNext, mergeWithPrev, mergeWithNext) { insertSlot(slot, slotNext); var slotPrev = slot.prev; if (slotPrev.lastInSequence) { if (mergeWithPrev) { delete slotPrev.lastInSe...
javascript
function insertAndMergeSlot(slot, slotNext, mergeWithPrev, mergeWithNext) { insertSlot(slot, slotNext); var slotPrev = slot.prev; if (slotPrev.lastInSequence) { if (mergeWithPrev) { delete slotPrev.lastInSe...
[ "function", "insertAndMergeSlot", "(", "slot", ",", "slotNext", ",", "mergeWithPrev", ",", "mergeWithNext", ")", "{", "insertSlot", "(", "slot", ",", "slotNext", ")", ";", "var", "slotPrev", "=", "slot", ".", "prev", ";", "if", "(", "slotPrev", ".", "lastI...
Inserts a slot in the middle of a sequence or between sequences. If the latter, mergeWithPrev and mergeWithNext parameters specify whether to merge the slot with the previous sequence, or next, or neither.
[ "Inserts", "a", "slot", "in", "the", "middle", "of", "a", "sequence", "or", "between", "sequences", ".", "If", "the", "latter", "mergeWithPrev", "and", "mergeWithNext", "parameters", "specify", "whether", "to", "merge", "the", "slot", "with", "the", "previous"...
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L368-L386
16,382
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
setSlotKey
function setSlotKey(slot, key) { slot.key = key; // Add the slot to the keyMap, so it is possible to quickly find the slot given its key keyMap[slot.key] = slot; }
javascript
function setSlotKey(slot, key) { slot.key = key; // Add the slot to the keyMap, so it is possible to quickly find the slot given its key keyMap[slot.key] = slot; }
[ "function", "setSlotKey", "(", "slot", ",", "key", ")", "{", "slot", ".", "key", "=", "key", ";", "// Add the slot to the keyMap, so it is possible to quickly find the slot given its key", "keyMap", "[", "slot", ".", "key", "]", "=", "slot", ";", "}" ]
Keys and Indices
[ "Keys", "and", "Indices" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L390-L395
16,383
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
createAndAddSlot
function createAndAddSlot(slotNext, indexMapForSlot) { var slotNew = (indexMapForSlot === indexMap ? createPrimarySlot() : createSlot()); insertSlot(slotNew, slotNext); return slotNew; }
javascript
function createAndAddSlot(slotNext, indexMapForSlot) { var slotNew = (indexMapForSlot === indexMap ? createPrimarySlot() : createSlot()); insertSlot(slotNew, slotNext); return slotNew; }
[ "function", "createAndAddSlot", "(", "slotNext", ",", "indexMapForSlot", ")", "{", "var", "slotNew", "=", "(", "indexMapForSlot", "===", "indexMap", "?", "createPrimarySlot", "(", ")", ":", "createSlot", "(", ")", ")", ";", "insertSlot", "(", "slotNew", ",", ...
Creates a new slot and adds it to the slot list before slotNext
[ "Creates", "a", "new", "slot", "and", "adds", "it", "to", "the", "slot", "list", "before", "slotNext" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L418-L424
16,384
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
adjustedIndex
function adjustedIndex(slot) { var undefinedIndex; if (!slot) { return undefinedIndex; } var delta = 0; while (!slot.firstInSequence) { delta++; s...
javascript
function adjustedIndex(slot) { var undefinedIndex; if (!slot) { return undefinedIndex; } var delta = 0; while (!slot.firstInSequence) { delta++; s...
[ "function", "adjustedIndex", "(", "slot", ")", "{", "var", "undefinedIndex", ";", "if", "(", "!", "slot", ")", "{", "return", "undefinedIndex", ";", "}", "var", "delta", "=", "0", ";", "while", "(", "!", "slot", ".", "firstInSequence", ")", "{", "delta...
Deferred Index Updates Returns the index of the slot taking into account any outstanding index updates
[ "Deferred", "Index", "Updates", "Returns", "the", "index", "of", "the", "slot", "taking", "into", "account", "any", "outstanding", "index", "updates" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L952-L972
16,385
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
updateNewIndicesAfterSlot
function updateNewIndicesAfterSlot(slot, indexDelta) { // Adjust all the indexNews after this slot for (slot = slot.next; slot; slot = slot.next) { if (slot.firstInSequence) { var indexNew = (slot.indexNew !== undefined ? slot.i...
javascript
function updateNewIndicesAfterSlot(slot, indexDelta) { // Adjust all the indexNews after this slot for (slot = slot.next; slot; slot = slot.next) { if (slot.firstInSequence) { var indexNew = (slot.indexNew !== undefined ? slot.i...
[ "function", "updateNewIndicesAfterSlot", "(", "slot", ",", "indexDelta", ")", "{", "// Adjust all the indexNews after this slot", "for", "(", "slot", "=", "slot", ".", "next", ";", "slot", ";", "slot", "=", "slot", ".", "next", ")", "{", "if", "(", "slot", "...
Updates the new index of the first slot in each sequence after the given slot
[ "Updates", "the", "new", "index", "of", "the", "first", "slot", "in", "each", "sequence", "after", "the", "given", "slot" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L975-L998
16,386
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
updateNewIndices
function updateNewIndices(slot, indexDelta) { // If this slot is at the start of a sequence, transfer the indexNew if (slot.firstInSequence) { var indexNew; if (indexDelta < 0) { // The given slot is abo...
javascript
function updateNewIndices(slot, indexDelta) { // If this slot is at the start of a sequence, transfer the indexNew if (slot.firstInSequence) { var indexNew; if (indexDelta < 0) { // The given slot is abo...
[ "function", "updateNewIndices", "(", "slot", ",", "indexDelta", ")", "{", "// If this slot is at the start of a sequence, transfer the indexNew", "if", "(", "slot", ".", "firstInSequence", ")", "{", "var", "indexNew", ";", "if", "(", "indexDelta", "<", "0", ")", "{"...
Updates the new index of the given slot if necessary, and all subsequent new indices
[ "Updates", "the", "new", "index", "of", "the", "given", "slot", "if", "necessary", "and", "all", "subsequent", "new", "indices" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L1001-L1042
16,387
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
updateNewIndicesFromIndex
function updateNewIndicesFromIndex(index, indexDelta) { for (var slot = slotsStart; slot !== slotListEnd; slot = slot.next) { var indexNew = slot.indexNew; if (indexNew !== undefined && index <= indexNew) { updateNewIndices...
javascript
function updateNewIndicesFromIndex(index, indexDelta) { for (var slot = slotsStart; slot !== slotListEnd; slot = slot.next) { var indexNew = slot.indexNew; if (indexNew !== undefined && index <= indexNew) { updateNewIndices...
[ "function", "updateNewIndicesFromIndex", "(", "index", ",", "indexDelta", ")", "{", "for", "(", "var", "slot", "=", "slotsStart", ";", "slot", "!==", "slotListEnd", ";", "slot", "=", "slot", ".", "next", ")", "{", "var", "indexNew", "=", "slot", ".", "in...
Updates the new index of the first slot in each sequence after the given new index
[ "Updates", "the", "new", "index", "of", "the", "first", "slot", "in", "each", "sequence", "after", "the", "given", "new", "index" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L1045-L1054
16,388
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
updateIndices
function updateIndices() { var slot, slotFirstInSequence, indexNew; for (slot = slotsStart; ; slot = slot.next) { if (slot.firstInSequence) { slotFirstInSequence = slot; ...
javascript
function updateIndices() { var slot, slotFirstInSequence, indexNew; for (slot = slotsStart; ; slot = slot.next) { if (slot.firstInSequence) { slotFirstInSequence = slot; ...
[ "function", "updateIndices", "(", ")", "{", "var", "slot", ",", "slotFirstInSequence", ",", "indexNew", ";", "for", "(", "slot", "=", "slotsStart", ";", ";", "slot", "=", "slot", ".", "next", ")", "{", "if", "(", "slot", ".", "firstInSequence", ")", "{...
Adjust the indices of all slots to be consistent with any indexNew properties, and strip off the indexNews
[ "Adjust", "the", "indices", "of", "all", "slots", "to", "be", "consistent", "with", "any", "indexNew", "properties", "and", "strip", "off", "the", "indexNews" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L1057-L1116
16,389
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
addMarkers
function addMarkers(fetchResult) { var items = fetchResult.items, offset = fetchResult.offset, totalCount = fetchResult.totalCount, absoluteIndex = fetchResult.absoluteIndex, atStart = fetchResult.atStart...
javascript
function addMarkers(fetchResult) { var items = fetchResult.items, offset = fetchResult.offset, totalCount = fetchResult.totalCount, absoluteIndex = fetchResult.absoluteIndex, atStart = fetchResult.atStart...
[ "function", "addMarkers", "(", "fetchResult", ")", "{", "var", "items", "=", "fetchResult", ".", "items", ",", "offset", "=", "fetchResult", ".", "offset", ",", "totalCount", "=", "fetchResult", ".", "totalCount", ",", "absoluteIndex", "=", "fetchResult", ".",...
Adds markers on behalf of the data adapter if their presence can be deduced
[ "Adds", "markers", "on", "behalf", "of", "the", "data", "adapter", "if", "their", "presence", "can", "be", "deduced" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L1433-L1462
16,390
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
itemChanged
function itemChanged(slot) { var itemNew = slot.itemNew; if (!itemNew) { return false; } var item = slot.item; for (var property in item) { switch (property) { ...
javascript
function itemChanged(slot) { var itemNew = slot.itemNew; if (!itemNew) { return false; } var item = slot.item; for (var property in item) { switch (property) { ...
[ "function", "itemChanged", "(", "slot", ")", "{", "var", "itemNew", "=", "slot", ".", "itemNew", ";", "if", "(", "!", "itemNew", ")", "{", "return", "false", ";", "}", "var", "item", "=", "slot", ".", "item", ";", "for", "(", "var", "property", "in...
Fetch Result Processing
[ "Fetch", "Result", "Processing" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L1726-L1754
16,391
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
removeMirageIndices
function removeMirageIndices(countMax, indexFirstKnown) { var placeholdersAtEnd = 0; function removePlaceholdersAfterSlot(slotRemoveAfter) { for (var slot2 = slotListEnd.prev; !(slot2.index < countMax) && slot2 !== slotRemoveAfter;) { ...
javascript
function removeMirageIndices(countMax, indexFirstKnown) { var placeholdersAtEnd = 0; function removePlaceholdersAfterSlot(slotRemoveAfter) { for (var slot2 = slotListEnd.prev; !(slot2.index < countMax) && slot2 !== slotRemoveAfter;) { ...
[ "function", "removeMirageIndices", "(", "countMax", ",", "indexFirstKnown", ")", "{", "var", "placeholdersAtEnd", "=", "0", ";", "function", "removePlaceholdersAfterSlot", "(", "slotRemoveAfter", ")", "{", "for", "(", "var", "slot2", "=", "slotListEnd", ".", "prev...
Removes any placeholders with indices that exceed the given upper bound on the count
[ "Removes", "any", "placeholders", "with", "indices", "that", "exceed", "the", "given", "upper", "bound", "on", "the", "count" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L2100-L2147
16,392
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
lastRefreshInsertionPoint
function lastRefreshInsertionPoint() { var slotNext = refreshEnd; while (!slotNext.firstInSequence) { slotNext = slotNext.prev; if (slotNext === refreshStart) { return null; } ...
javascript
function lastRefreshInsertionPoint() { var slotNext = refreshEnd; while (!slotNext.firstInSequence) { slotNext = slotNext.prev; if (slotNext === refreshStart) { return null; } ...
[ "function", "lastRefreshInsertionPoint", "(", ")", "{", "var", "slotNext", "=", "refreshEnd", ";", "while", "(", "!", "slotNext", ".", "firstInSequence", ")", "{", "slotNext", "=", "slotNext", ".", "prev", ";", "if", "(", "slotNext", "===", "refreshStart", "...
Returns the slot after the last insertion point between sequences
[ "Returns", "the", "slot", "after", "the", "last", "insertion", "point", "between", "sequences" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L2934-L2945
16,393
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
queueEdit
function queueEdit(applyEdit, editType, complete, error, keyUpdate, updateSlots, undo) { var editQueueTail = editQueue.prev, edit = { prev: editQueueTail, next: editQueue, applyEdit: applyEdit...
javascript
function queueEdit(applyEdit, editType, complete, error, keyUpdate, updateSlots, undo) { var editQueueTail = editQueue.prev, edit = { prev: editQueueTail, next: editQueue, applyEdit: applyEdit...
[ "function", "queueEdit", "(", "applyEdit", ",", "editType", ",", "complete", ",", "error", ",", "keyUpdate", ",", "updateSlots", ",", "undo", ")", "{", "var", "editQueueTail", "=", "editQueue", ".", "prev", ",", "edit", "=", "{", "prev", ":", "editQueueTai...
Edit Queue Queues an edit and immediately "optimistically" apply it to the slots list, sending re-entrant notifications
[ "Edit", "Queue", "Queues", "an", "edit", "and", "immediately", "optimistically", "apply", "it", "to", "the", "slots", "list", "sending", "re", "-", "entrant", "notifications" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L4145-L4183
16,394
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
discardEditQueue
function discardEditQueue() { while (editQueue.prev !== editQueue) { var editLast = editQueue.prev; if (editLast.error) { editLast.error(new _ErrorFromName(EditError.canceled)); } ...
javascript
function discardEditQueue() { while (editQueue.prev !== editQueue) { var editLast = editQueue.prev; if (editLast.error) { editLast.error(new _ErrorFromName(EditError.canceled)); } ...
[ "function", "discardEditQueue", "(", ")", "{", "while", "(", "editQueue", ".", "prev", "!==", "editQueue", ")", "{", "var", "editLast", "=", "editQueue", ".", "prev", ";", "if", "(", "editLast", ".", "error", ")", "{", "editLast", ".", "error", "(", "n...
Undo all queued edits, starting with the most recent
[ "Undo", "all", "queued", "edits", "starting", "with", "the", "most", "recent" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L4195-L4215
16,395
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
concludeEdits
function concludeEdits() { editsQueued = false; if (listDataAdapter.endEdits && beginEditsCalled && !editsInProgress) { beginEditsCalled = false; listDataAdapter.endEdits(); } // See if ther...
javascript
function concludeEdits() { editsQueued = false; if (listDataAdapter.endEdits && beginEditsCalled && !editsInProgress) { beginEditsCalled = false; listDataAdapter.endEdits(); } // See if ther...
[ "function", "concludeEdits", "(", ")", "{", "editsQueued", "=", "false", ";", "if", "(", "listDataAdapter", ".", "endEdits", "&&", "beginEditsCalled", "&&", "!", "editsInProgress", ")", "{", "beginEditsCalled", "=", "false", ";", "listDataAdapter", ".", "endEdit...
Once the edit queue has emptied, update state appropriately and resume normal operation
[ "Once", "the", "edit", "queue", "has", "emptied", "update", "state", "appropriately", "and", "resume", "normal", "operation" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L4363-L4379
16,396
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
function (incomingPromise, dataSource) { var signal = new _Signal(); incomingPromise.then( function (v) { signal.complete(v); }, function (e) { signal.error(e); } ); var resultPromise = signal...
javascript
function (incomingPromise, dataSource) { var signal = new _Signal(); incomingPromise.then( function (v) { signal.complete(v); }, function (e) { signal.error(e); } ); var resultPromise = signal...
[ "function", "(", "incomingPromise", ",", "dataSource", ")", "{", "var", "signal", "=", "new", "_Signal", "(", ")", ";", "incomingPromise", ".", "then", "(", "function", "(", "v", ")", "{", "signal", ".", "complete", "(", "v", ")", ";", "}", ",", "fun...
Create a helper which issues new promises for the result of the input promise but have their cancelations ref-counted so that any given consumer canceling their promise doesn't result in the incoming promise being canceled unless all consumers are no longer interested in the result.
[ "Create", "a", "helper", "which", "issues", "new", "promises", "for", "the", "result", "of", "the", "input", "promise", "but", "have", "their", "cancelations", "ref", "-", "counted", "so", "that", "any", "given", "consumer", "canceling", "their", "promise", ...
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L5441-L5485
16,397
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
ItemEventsHandler_toggleItemSelection
function ItemEventsHandler_toggleItemSelection(itemIndex) { var site = this._site, selection = site.selection, selected = selection._isIncluded(itemIndex); if (site.selectionMode === _UI.SelectionMode.single) { ...
javascript
function ItemEventsHandler_toggleItemSelection(itemIndex) { var site = this._site, selection = site.selection, selected = selection._isIncluded(itemIndex); if (site.selectionMode === _UI.SelectionMode.single) { ...
[ "function", "ItemEventsHandler_toggleItemSelection", "(", "itemIndex", ")", "{", "var", "site", "=", "this", ".", "_site", ",", "selection", "=", "site", ".", "selection", ",", "selected", "=", "selection", ".", "_isIncluded", "(", "itemIndex", ")", ";", "if",...
In single selection mode, in addition to itemIndex's selection state being toggled, all other items will become deselected
[ "In", "single", "selection", "mode", "in", "addition", "to", "itemIndex", "s", "selection", "state", "being", "toggled", "all", "other", "items", "will", "become", "deselected" ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L8499-L8517
16,398
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
function (groupKey, itemKey, itemIndex) { this._lastFocusedItemKey = itemKey; this._lastFocusedItemIndex = itemIndex; itemIndex = "" + itemIndex; this._itemToIndex[itemKey] = itemIndex; this._groupToItem[groupKey] = item...
javascript
function (groupKey, itemKey, itemIndex) { this._lastFocusedItemKey = itemKey; this._lastFocusedItemIndex = itemIndex; itemIndex = "" + itemIndex; this._itemToIndex[itemKey] = itemIndex; this._groupToItem[groupKey] = item...
[ "function", "(", "groupKey", ",", "itemKey", ",", "itemIndex", ")", "{", "this", ".", "_lastFocusedItemKey", "=", "itemKey", ";", "this", ".", "_lastFocusedItemIndex", "=", "itemIndex", ";", "itemIndex", "=", "\"\"", "+", "itemIndex", ";", "this", ".", "_ite...
We store indices as strings in the cache so index=0 does not evaluate to false as when we check for the existance of an index in the cache. The index is converted back into a number when calling getIndexForGroup
[ "We", "store", "indices", "as", "strings", "in", "the", "cache", "so", "index", "=", "0", "does", "not", "evaluate", "to", "false", "as", "when", "we", "check", "for", "the", "existance", "of", "an", "index", "in", "the", "cache", ".", "The", "index", ...
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L11052-L11058
16,399
sitewaerts/cordova-plugin-document-viewer
src/common/js/winjs/js/ui.js
flushDynamicCssRules
function flushDynamicCssRules() { var rules = layoutStyleElem.sheet.cssRules, classCount = staleClassNames.length, i, j, ruleSuffix; for (i = 0; i < classCount; i++) { ruleSuffix = "." + staleClassNames[i] + " "; for (j = rules.len...
javascript
function flushDynamicCssRules() { var rules = layoutStyleElem.sheet.cssRules, classCount = staleClassNames.length, i, j, ruleSuffix; for (i = 0; i < classCount; i++) { ruleSuffix = "." + staleClassNames[i] + " "; for (j = rules.len...
[ "function", "flushDynamicCssRules", "(", ")", "{", "var", "rules", "=", "layoutStyleElem", ".", "sheet", ".", "cssRules", ",", "classCount", "=", "staleClassNames", ".", "length", ",", "i", ",", "j", ",", "ruleSuffix", ";", "for", "(", "i", "=", "0", ";"...
Removes the dynamic CSS rules corresponding to the classes in staleClassNames from the DOM.
[ "Removes", "the", "dynamic", "CSS", "rules", "corresponding", "to", "the", "classes", "in", "staleClassNames", "from", "the", "DOM", "." ]
25b82d959c20d7880d513100c2b979e1e15349dc
https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L11968-L11984