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
13,600
bolt-design-system/bolt
packages/build-tools/plugins/postcss-themify/src/index.js
getSelectorName
function getSelectorName(rule, variationName, isFallbackSelector = false) { const selectorPrefix = `.${options.classPrefix || ''}${variationName}`; // console.log(variationName); if (isFallbackSelector) { return rule.selectors .map(selector => { let selectors = []; let initialSelector ...
javascript
function getSelectorName(rule, variationName, isFallbackSelector = false) { const selectorPrefix = `.${options.classPrefix || ''}${variationName}`; // console.log(variationName); if (isFallbackSelector) { return rule.selectors .map(selector => { let selectors = []; let initialSelector ...
[ "function", "getSelectorName", "(", "rule", ",", "variationName", ",", "isFallbackSelector", "=", "false", ")", "{", "const", "selectorPrefix", "=", "`", "${", "options", ".", "classPrefix", "||", "''", "}", "${", "variationName", "}", "`", ";", "// console.lo...
Get a selector name for the given rule and variation, deliberately increasing the CSS class's specificity when generating CSS selectors for IE 11 so we can account for specificity conflicts when nesting themed components inside other themes. @param rule @param variationName @param isFallbackSelector
[ "Get", "a", "selector", "name", "for", "the", "given", "rule", "and", "variation", "deliberately", "increasing", "the", "CSS", "class", "s", "specificity", "when", "generating", "CSS", "selectors", "for", "IE", "11", "so", "we", "can", "account", "for", "spe...
c63ab37dbee8f35aa5472be2d9688f989b20fd21
https://github.com/bolt-design-system/bolt/blob/c63ab37dbee8f35aa5472be2d9688f989b20fd21/packages/build-tools/plugins/postcss-themify/src/index.js#L505-L533
13,601
bolt-design-system/bolt
packages/build-tools/utils/log.js
errorAndExit
function errorAndExit(msg, logMe) { // @todo Only trigger if `verbosity > 1` if (logMe) { // Adding some empty lines before error message for readability console.log(); console.log(); console.log(logMe); } error(`Error: ${msg}`); // There's a few ways to handle exiting // This is suggested...
javascript
function errorAndExit(msg, logMe) { // @todo Only trigger if `verbosity > 1` if (logMe) { // Adding some empty lines before error message for readability console.log(); console.log(); console.log(logMe); } error(`Error: ${msg}`); // There's a few ways to handle exiting // This is suggested...
[ "function", "errorAndExit", "(", "msg", ",", "logMe", ")", "{", "// @todo Only trigger if `verbosity > 1`", "if", "(", "logMe", ")", "{", "// Adding some empty lines before error message for readability", "console", ".", "log", "(", ")", ";", "console", ".", "log", "(...
Displays info, an error message, and then exits the cli @param {string} msg - Message @param {*} logMe - Passed to `console.log`
[ "Displays", "info", "an", "error", "message", "and", "then", "exits", "the", "cli" ]
c63ab37dbee8f35aa5472be2d9688f989b20fd21
https://github.com/bolt-design-system/bolt/blob/c63ab37dbee8f35aa5472be2d9688f989b20fd21/packages/build-tools/utils/log.js#L50-L73
13,602
bolt-design-system/bolt
packages/components/bolt-nav-indicator/nav-indicator.js
activateGumshoeLink
function activateGumshoeLink() { const originalTarget = nav.nav; let originalTargetHref; let normalizedTarget; if (originalTarget) { originalTargetHref = originalTarget.getAttribute('href'); } else { originalTargetHref = nav.nav.ge...
javascript
function activateGumshoeLink() { const originalTarget = nav.nav; let originalTargetHref; let normalizedTarget; if (originalTarget) { originalTargetHref = originalTarget.getAttribute('href'); } else { originalTargetHref = nav.nav.ge...
[ "function", "activateGumshoeLink", "(", ")", "{", "const", "originalTarget", "=", "nav", ".", "nav", ";", "let", "originalTargetHref", ";", "let", "normalizedTarget", ";", "if", "(", "originalTarget", ")", "{", "originalTargetHref", "=", "originalTarget", ".", "...
logic once we know we should try to animate in a gumshoe-activated link
[ "logic", "once", "we", "know", "we", "should", "try", "to", "animate", "in", "a", "gumshoe", "-", "activated", "link" ]
c63ab37dbee8f35aa5472be2d9688f989b20fd21
https://github.com/bolt-design-system/bolt/blob/c63ab37dbee8f35aa5472be2d9688f989b20fd21/packages/components/bolt-nav-indicator/nav-indicator.js#L82-L123
13,603
bolt-design-system/bolt
packages/build-tools/utils/manifest.js
flattenDeep
function flattenDeep(arr1) { return arr1.reduce( (acc, val) => Array.isArray(val) ? acc.concat(flattenDeep(val)) : acc.concat(val), [], ); }
javascript
function flattenDeep(arr1) { return arr1.reduce( (acc, val) => Array.isArray(val) ? acc.concat(flattenDeep(val)) : acc.concat(val), [], ); }
[ "function", "flattenDeep", "(", "arr1", ")", "{", "return", "arr1", ".", "reduce", "(", "(", "acc", ",", "val", ")", "=>", "Array", ".", "isArray", "(", "val", ")", "?", "acc", ".", "concat", "(", "flattenDeep", "(", "val", ")", ")", ":", "acc", ...
recursively flatten heavily nested arrays
[ "recursively", "flatten", "heavily", "nested", "arrays" ]
c63ab37dbee8f35aa5472be2d9688f989b20fd21
https://github.com/bolt-design-system/bolt/blob/c63ab37dbee8f35aa5472be2d9688f989b20fd21/packages/build-tools/utils/manifest.js#L13-L19
13,604
bolt-design-system/bolt
packages/build-tools/utils/manifest.js
aggregateBoltDependencies
async function aggregateBoltDependencies(data) { let componentDependencies = []; let componentsWithoutDeps = data; componentsWithoutDeps.forEach(item => { if (item.deps) { componentDependencies.push([...item.deps]); } }); componentDependencies = flattenDeep(componentDependencies); component...
javascript
async function aggregateBoltDependencies(data) { let componentDependencies = []; let componentsWithoutDeps = data; componentsWithoutDeps.forEach(item => { if (item.deps) { componentDependencies.push([...item.deps]); } }); componentDependencies = flattenDeep(componentDependencies); component...
[ "async", "function", "aggregateBoltDependencies", "(", "data", ")", "{", "let", "componentDependencies", "=", "[", "]", ";", "let", "componentsWithoutDeps", "=", "data", ";", "componentsWithoutDeps", ".", "forEach", "(", "item", "=>", "{", "if", "(", "item", "...
loop through package-specific dependencies to merge and dedupe
[ "loop", "through", "package", "-", "specific", "dependencies", "to", "merge", "and", "dedupe" ]
c63ab37dbee8f35aa5472be2d9688f989b20fd21
https://github.com/bolt-design-system/bolt/blob/c63ab37dbee8f35aa5472be2d9688f989b20fd21/packages/build-tools/utils/manifest.js#L177-L205
13,605
bolt-design-system/bolt
packages/build-tools/utils/manifest.js
getAllDirs
async function getAllDirs(relativeFrom) { const dirs = []; const manifest = await getBoltManifest(); [manifest.components.global, manifest.components.individual].forEach( componentList => { componentList.forEach(component => { dirs.push( relativeFrom ? path.relative(relativ...
javascript
async function getAllDirs(relativeFrom) { const dirs = []; const manifest = await getBoltManifest(); [manifest.components.global, manifest.components.individual].forEach( componentList => { componentList.forEach(component => { dirs.push( relativeFrom ? path.relative(relativ...
[ "async", "function", "getAllDirs", "(", "relativeFrom", ")", "{", "const", "dirs", "=", "[", "]", ";", "const", "manifest", "=", "await", "getBoltManifest", "(", ")", ";", "[", "manifest", ".", "components", ".", "global", ",", "manifest", ".", "components...
Get all directories for components in Bolt Manifest @param relativeFrom {string} - If present, the path will be relative from this, else it will be absolute. @returns {Array<String>} {dirs} - List of all component/package paths in Bolt Manifest
[ "Get", "all", "directories", "for", "components", "in", "Bolt", "Manifest" ]
c63ab37dbee8f35aa5472be2d9688f989b20fd21
https://github.com/bolt-design-system/bolt/blob/c63ab37dbee8f35aa5472be2d9688f989b20fd21/packages/build-tools/utils/manifest.js#L242-L258
13,606
bolt-design-system/bolt
packages/build-tools/utils/manifest.js
getTwigNamespaceConfig
async function getTwigNamespaceConfig(relativeFrom, extraNamespaces = {}) { const config = await getConfig(); const namespaces = {}; const allDirs = []; const manifest = await getBoltManifest(); const global = manifest.components.global; const individual = manifest.components.individual; [global, individ...
javascript
async function getTwigNamespaceConfig(relativeFrom, extraNamespaces = {}) { const config = await getConfig(); const namespaces = {}; const allDirs = []; const manifest = await getBoltManifest(); const global = manifest.components.global; const individual = manifest.components.individual; [global, individ...
[ "async", "function", "getTwigNamespaceConfig", "(", "relativeFrom", ",", "extraNamespaces", "=", "{", "}", ")", "{", "const", "config", "=", "await", "getConfig", "(", ")", ";", "const", "namespaces", "=", "{", "}", ";", "const", "allDirs", "=", "[", "]", ...
Builds config for Twig Namespaces @param relativeFrom {string} - If present, the path will be relative from this, else it will be absolute. @param extraNamespaces {object} - Extra namespaces to add to file in [this format](https://packagist.org/packages/evanlovely/plugin-twig-namespaces) @async @see writeTwigNamespaceF...
[ "Builds", "config", "for", "Twig", "Namespaces" ]
c63ab37dbee8f35aa5472be2d9688f989b20fd21
https://github.com/bolt-design-system/bolt/blob/c63ab37dbee8f35aa5472be2d9688f989b20fd21/packages/build-tools/utils/manifest.js#L322-L396
13,607
chjj/pty.js
lib/pty.js
Socket
function Socket(options) { if (!(this instanceof Socket)) { return new Socket(options); } var tty = process.binding('tty_wrap'); var guessHandleType = tty.guessHandleType; tty.guessHandleType = function() { return 'PIPE'; }; net.Socket.call(this, options); tty.guessHandleType = guessHandleType; ...
javascript
function Socket(options) { if (!(this instanceof Socket)) { return new Socket(options); } var tty = process.binding('tty_wrap'); var guessHandleType = tty.guessHandleType; tty.guessHandleType = function() { return 'PIPE'; }; net.Socket.call(this, options); tty.guessHandleType = guessHandleType; ...
[ "function", "Socket", "(", "options", ")", "{", "if", "(", "!", "(", "this", "instanceof", "Socket", ")", ")", "{", "return", "new", "Socket", "(", "options", ")", ";", "}", "var", "tty", "=", "process", ".", "binding", "(", "'tty_wrap'", ")", ";", ...
Wrap net.Socket for a workaround
[ "Wrap", "net", ".", "Socket", "for", "a", "workaround" ]
fe63a412574f45ee6bb6d8fab4a5c102107b5201
https://github.com/chjj/pty.js/blob/fe63a412574f45ee6bb6d8fab4a5c102107b5201/lib/pty.js#L430-L441
13,608
chjj/pty.js
lib/pty_win.js
Agent
function Agent(file, args, env, cwd, cols, rows, debug) { var self = this; // Increment the number of pipes created. pipeIncr++; // Unique identifier per pipe created. var timestamp = Date.now(); // The data pipe is the direct connection to the forked terminal. this.dataPipe = '\\\\.\\pipe\\winpty-data...
javascript
function Agent(file, args, env, cwd, cols, rows, debug) { var self = this; // Increment the number of pipes created. pipeIncr++; // Unique identifier per pipe created. var timestamp = Date.now(); // The data pipe is the direct connection to the forked terminal. this.dataPipe = '\\\\.\\pipe\\winpty-data...
[ "function", "Agent", "(", "file", ",", "args", ",", "env", ",", "cwd", ",", "cols", ",", "rows", ",", "debug", ")", "{", "var", "self", "=", "this", ";", "// Increment the number of pipes created.", "pipeIncr", "++", ";", "// Unique identifier per pipe created."...
Agent. Internal class. Everytime a new pseudo terminal is created it is contained within agent.exe. When this process is started there are two available named pipes (control and data socket).
[ "Agent", ".", "Internal", "class", "." ]
fe63a412574f45ee6bb6d8fab4a5c102107b5201
https://github.com/chjj/pty.js/blob/fe63a412574f45ee6bb6d8fab4a5c102107b5201/lib/pty_win.js#L24-L74
13,609
harrisiirak/cron-parser
lib/expression.js
isWildcardRange
function isWildcardRange(range, constraints) { if (range instanceof Array && !range.length) { return false; } if (constraints.length !== 2) { return false; } return range.length === (constraints[1] - (constraints[0] < 1 ? - 1 : 0)); }
javascript
function isWildcardRange(range, constraints) { if (range instanceof Array && !range.length) { return false; } if (constraints.length !== 2) { return false; } return range.length === (constraints[1] - (constraints[0] < 1 ? - 1 : 0)); }
[ "function", "isWildcardRange", "(", "range", ",", "constraints", ")", "{", "if", "(", "range", "instanceof", "Array", "&&", "!", "range", ".", "length", ")", "{", "return", "false", ";", "}", "if", "(", "constraints", ".", "length", "!==", "2", ")", "{...
Detect if input range fully matches constraint bounds @param {Array} range Input range @param {Array} constraints Input constraints @returns {Boolean} @private
[ "Detect", "if", "input", "range", "fully", "matches", "constraint", "bounds" ]
b6cfece825f0894194f5d002c0051b9a7f09ce12
https://github.com/harrisiirak/cron-parser/blob/b6cfece825f0894194f5d002c0051b9a7f09ce12/lib/expression.js#L21-L31
13,610
harrisiirak/cron-parser
lib/expression.js
CronExpression
function CronExpression (fields, options) { this._options = options; this._utc = options.utc || false; this._tz = this._utc ? 'UTC' : options.tz; this._currentDate = new CronDate(options.currentDate, this._tz); this._startDate = options.startDate ? new CronDate(options.startDate, this._tz) : null; this._end...
javascript
function CronExpression (fields, options) { this._options = options; this._utc = options.utc || false; this._tz = this._utc ? 'UTC' : options.tz; this._currentDate = new CronDate(options.currentDate, this._tz); this._startDate = options.startDate ? new CronDate(options.startDate, this._tz) : null; this._end...
[ "function", "CronExpression", "(", "fields", ",", "options", ")", "{", "this", ".", "_options", "=", "options", ";", "this", ".", "_utc", "=", "options", ".", "utc", "||", "false", ";", "this", ".", "_tz", "=", "this", ".", "_utc", "?", "'UTC'", ":",...
Construct a new expression parser Options: currentDate: iterator start date endDate: iterator end date @constructor @private @param {Object} fields Expression fields parsed values @param {Object} options Parser options
[ "Construct", "a", "new", "expression", "parser" ]
b6cfece825f0894194f5d002c0051b9a7f09ce12
https://github.com/harrisiirak/cron-parser/blob/b6cfece825f0894194f5d002c0051b9a7f09ce12/lib/expression.js#L45-L56
13,611
harrisiirak/cron-parser
lib/expression.js
parseRepeat
function parseRepeat (val) { var repeatInterval = 1; var atoms = val.split('/'); if (atoms.length > 1) { return parseRange(atoms[0], atoms[atoms.length - 1]); } return parseRange(val, repeatInterval); }
javascript
function parseRepeat (val) { var repeatInterval = 1; var atoms = val.split('/'); if (atoms.length > 1) { return parseRange(atoms[0], atoms[atoms.length - 1]); } return parseRange(val, repeatInterval); }
[ "function", "parseRepeat", "(", "val", ")", "{", "var", "repeatInterval", "=", "1", ";", "var", "atoms", "=", "val", ".", "split", "(", "'/'", ")", ";", "if", "(", "atoms", ".", "length", ">", "1", ")", "{", "return", "parseRange", "(", "atoms", "[...
Parse repetition interval @param {String} val @return {Array}
[ "Parse", "repetition", "interval" ]
b6cfece825f0894194f5d002c0051b9a7f09ce12
https://github.com/harrisiirak/cron-parser/blob/b6cfece825f0894194f5d002c0051b9a7f09ce12/lib/expression.js#L276-L285
13,612
harrisiirak/cron-parser
lib/expression.js
matchSchedule
function matchSchedule (value, sequence) { for (var i = 0, c = sequence.length; i < c; i++) { if (sequence[i] >= value) { return sequence[i] === value; } } return sequence[0] === value; }
javascript
function matchSchedule (value, sequence) { for (var i = 0, c = sequence.length; i < c; i++) { if (sequence[i] >= value) { return sequence[i] === value; } } return sequence[0] === value; }
[ "function", "matchSchedule", "(", "value", ",", "sequence", ")", "{", "for", "(", "var", "i", "=", "0", ",", "c", "=", "sequence", ".", "length", ";", "i", "<", "c", ";", "i", "++", ")", "{", "if", "(", "sequence", "[", "i", "]", ">=", "value",...
Match field value @param {String} value @param {Array} sequence @return {Boolean} @private
[ "Match", "field", "value" ]
b6cfece825f0894194f5d002c0051b9a7f09ce12
https://github.com/harrisiirak/cron-parser/blob/b6cfece825f0894194f5d002c0051b9a7f09ce12/lib/expression.js#L409-L417
13,613
harrisiirak/cron-parser
lib/expression.js
isNthDayMatch
function isNthDayMatch(date, nthDayOfWeek) { if (nthDayOfWeek < 6) { if ( date.getDate() < 8 && nthDayOfWeek === 1 // First occurence has to happen in first 7 days of the month ) { return true; } var offset = date.getDate() % 7 ? 1 : 0; // Math is off by 1 when dayOf...
javascript
function isNthDayMatch(date, nthDayOfWeek) { if (nthDayOfWeek < 6) { if ( date.getDate() < 8 && nthDayOfWeek === 1 // First occurence has to happen in first 7 days of the month ) { return true; } var offset = date.getDate() % 7 ? 1 : 0; // Math is off by 1 when dayOf...
[ "function", "isNthDayMatch", "(", "date", ",", "nthDayOfWeek", ")", "{", "if", "(", "nthDayOfWeek", "<", "6", ")", "{", "if", "(", "date", ".", "getDate", "(", ")", "<", "8", "&&", "nthDayOfWeek", "===", "1", "// First occurence has to happen in first 7 days o...
Helps determine if the provided date is the correct nth occurence of the desired day of week. @param {CronDate} date @param {Number} nthDayOfWeek @return {Boolean} @private
[ "Helps", "determine", "if", "the", "provided", "date", "is", "the", "correct", "nth", "occurence", "of", "the", "desired", "day", "of", "week", "." ]
b6cfece825f0894194f5d002c0051b9a7f09ce12
https://github.com/harrisiirak/cron-parser/blob/b6cfece825f0894194f5d002c0051b9a7f09ce12/lib/expression.js#L428-L445
13,614
pixijs/pixi-particles
docs/examples/js/ParticleExample.js
function(){ // Update the next frame updateId = requestAnimationFrame(update); var now = Date.now(); if (emitter) emitter.update((now - elapsed) * 0.001); framerate.innerHTML = (1000 / (now - elapsed)).toFixed(2); elapsed = now; if(emitter && particleCount) particleCount.innerHTML = em...
javascript
function(){ // Update the next frame updateId = requestAnimationFrame(update); var now = Date.now(); if (emitter) emitter.update((now - elapsed) * 0.001); framerate.innerHTML = (1000 / (now - elapsed)).toFixed(2); elapsed = now; if(emitter && particleCount) particleCount.innerHTML = em...
[ "function", "(", ")", "{", "// Update the next frame", "updateId", "=", "requestAnimationFrame", "(", "update", ")", ";", "var", "now", "=", "Date", ".", "now", "(", ")", ";", "if", "(", "emitter", ")", "emitter", ".", "update", "(", "(", "now", "-", "...
Update function every frame
[ "Update", "function", "every", "frame" ]
163262fe65ac8ebe4e8c5c4d485610571a54291b
https://github.com/pixijs/pixi-particles/blob/163262fe65ac8ebe4e8c5c4d485610571a54291b/docs/examples/js/ParticleExample.js#L38-L56
13,615
tristen/tablesort
src/tablesort.js
function(a, b) { a = a.trim().toLowerCase(); b = b.trim().toLowerCase(); if (a === b) return 0; if (a < b) return 1; return -1; }
javascript
function(a, b) { a = a.trim().toLowerCase(); b = b.trim().toLowerCase(); if (a === b) return 0; if (a < b) return 1; return -1; }
[ "function", "(", "a", ",", "b", ")", "{", "a", "=", "a", ".", "trim", "(", ")", ".", "toLowerCase", "(", ")", ";", "b", "=", "b", ".", "trim", "(", ")", ".", "toLowerCase", "(", ")", ";", "if", "(", "a", "===", "b", ")", "return", "0", ";...
Default sort method if no better sort method is found
[ "Default", "sort", "method", "if", "no", "better", "sort", "method", "is", "found" ]
3f9153b3e5f6d87ec8f9d83bb0c986d705661402
https://github.com/tristen/tablesort/blob/3f9153b3e5f6d87ec8f9d83bb0c986d705661402/src/tablesort.js#L31-L39
13,616
tristen/tablesort
src/tablesort.js
function(sort, antiStabilize) { return function(a, b) { var unstableResult = sort(a.td, b.td); if (unstableResult === 0) { if (antiStabilize) return b.index - a.index; return a.index - b.index; } return unstableResult; }; }
javascript
function(sort, antiStabilize) { return function(a, b) { var unstableResult = sort(a.td, b.td); if (unstableResult === 0) { if (antiStabilize) return b.index - a.index; return a.index - b.index; } return unstableResult; }; }
[ "function", "(", "sort", ",", "antiStabilize", ")", "{", "return", "function", "(", "a", ",", "b", ")", "{", "var", "unstableResult", "=", "sort", "(", "a", ".", "td", ",", "b", ".", "td", ")", ";", "if", "(", "unstableResult", "===", "0", ")", "...
Stable sort function If two elements are equal under the original sort function, then there relative order is reversed
[ "Stable", "sort", "function", "If", "two", "elements", "are", "equal", "under", "the", "original", "sort", "function", "then", "there", "relative", "order", "is", "reversed" ]
3f9153b3e5f6d87ec8f9d83bb0c986d705661402
https://github.com/tristen/tablesort/blob/3f9153b3e5f6d87ec8f9d83bb0c986d705661402/src/tablesort.js#L44-L55
13,617
xiongwilee/Gracejs
middleware/session/index.js
extendContext
function extendContext(context, opts) { Object.defineProperties(context, { [CONTEXT_SESSION]: { get() { if (this[_CONTEXT_SESSION]) return this[_CONTEXT_SESSION]; this[_CONTEXT_SESSION] = new ContextSession(this, opts); return this[_CONTEXT_SESSION]; }, enumerable: true ...
javascript
function extendContext(context, opts) { Object.defineProperties(context, { [CONTEXT_SESSION]: { get() { if (this[_CONTEXT_SESSION]) return this[_CONTEXT_SESSION]; this[_CONTEXT_SESSION] = new ContextSession(this, opts); return this[_CONTEXT_SESSION]; }, enumerable: true ...
[ "function", "extendContext", "(", "context", ",", "opts", ")", "{", "Object", ".", "defineProperties", "(", "context", ",", "{", "[", "CONTEXT_SESSION", "]", ":", "{", "get", "(", ")", "{", "if", "(", "this", "[", "_CONTEXT_SESSION", "]", ")", "return", ...
extend context prototype, add session properties @param {Object} context koa's context prototype @param {Object} opts session options @api private
[ "extend", "context", "prototype", "add", "session", "properties" ]
a4ca954d28ddcd1c39a0b3eefe16e79a390fb507
https://github.com/xiongwilee/Gracejs/blob/a4ca954d28ddcd1c39a0b3eefe16e79a390fb507/middleware/session/index.js#L103-L130
13,618
xiongwilee/Gracejs
middleware/router/lib/router.js
Router
function Router(opts) { if (!(this instanceof Router)) { return new Router(opts); } this.opts = opts || {}; this.methods = this.opts.methods || [ 'HEAD', 'OPTIONS', 'GET', 'PUT', 'PATCH', 'POST', 'DELETE' ]; this.params = {}; this.stack = []; this.MATCHS = {}; }
javascript
function Router(opts) { if (!(this instanceof Router)) { return new Router(opts); } this.opts = opts || {}; this.methods = this.opts.methods || [ 'HEAD', 'OPTIONS', 'GET', 'PUT', 'PATCH', 'POST', 'DELETE' ]; this.params = {}; this.stack = []; this.MATCHS = {}; }
[ "function", "Router", "(", "opts", ")", "{", "if", "(", "!", "(", "this", "instanceof", "Router", ")", ")", "{", "return", "new", "Router", "(", "opts", ")", ";", "}", "this", ".", "opts", "=", "opts", "||", "{", "}", ";", "this", ".", "methods",...
Create a new router. @example Basic usage: ```javascript var app = require('koa')(); var router = require('koa-router')(); router.get('/', function *(next) {...}); app .use(router.routes()) .use(router.allowedMethods()); ``` @alias module:koa-router @param {Object=} opts @param {String=} opts.prefix prefix router...
[ "Create", "a", "new", "router", "." ]
a4ca954d28ddcd1c39a0b3eefe16e79a390fb507
https://github.com/xiongwilee/Gracejs/blob/a4ca954d28ddcd1c39a0b3eefe16e79a390fb507/middleware/router/lib/router.js#L47-L66
13,619
xiongwilee/Gracejs
app/blog/static/js/common/reveal/markdown.js
getForwardedAttributes
function getForwardedAttributes( section ) { var attributes = section.attributes; var result = []; for( var i = 0, len = attributes.length; i < len; i++ ) { var name = attributes[i].name, value = attributes[i].value; // disregard attributes that are used for markdown loading/parsing if( /data\-(ma...
javascript
function getForwardedAttributes( section ) { var attributes = section.attributes; var result = []; for( var i = 0, len = attributes.length; i < len; i++ ) { var name = attributes[i].name, value = attributes[i].value; // disregard attributes that are used for markdown loading/parsing if( /data\-(ma...
[ "function", "getForwardedAttributes", "(", "section", ")", "{", "var", "attributes", "=", "section", ".", "attributes", ";", "var", "result", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ",", "len", "=", "attributes", ".", "length", ";", "i", ...
Given a markdown slide section element, this will return all arguments that aren't related to markdown parsing. Used to forward any other user-defined arguments to the output markdown slide.
[ "Given", "a", "markdown", "slide", "section", "element", "this", "will", "return", "all", "arguments", "that", "aren", "t", "related", "to", "markdown", "parsing", ".", "Used", "to", "forward", "any", "other", "user", "-", "defined", "arguments", "to", "the"...
a4ca954d28ddcd1c39a0b3eefe16e79a390fb507
https://github.com/xiongwilee/Gracejs/blob/a4ca954d28ddcd1c39a0b3eefe16e79a390fb507/app/blog/static/js/common/reveal/markdown.js#L74-L96
13,620
xiongwilee/Gracejs
app/blog/static/js/common/reveal/markdown.js
getSlidifyOptions
function getSlidifyOptions( options ) { options = options || {}; options.separator = options.separator || DEFAULT_SLIDE_SEPARATOR; options.notesSeparator = options.notesSeparator || DEFAULT_NOTES_SEPARATOR; options.attributes = options.attributes || ''; return options; }
javascript
function getSlidifyOptions( options ) { options = options || {}; options.separator = options.separator || DEFAULT_SLIDE_SEPARATOR; options.notesSeparator = options.notesSeparator || DEFAULT_NOTES_SEPARATOR; options.attributes = options.attributes || ''; return options; }
[ "function", "getSlidifyOptions", "(", "options", ")", "{", "options", "=", "options", "||", "{", "}", ";", "options", ".", "separator", "=", "options", ".", "separator", "||", "DEFAULT_SLIDE_SEPARATOR", ";", "options", ".", "notesSeparator", "=", "options", "....
Inspects the given options and fills out default values for what's not defined.
[ "Inspects", "the", "given", "options", "and", "fills", "out", "default", "values", "for", "what", "s", "not", "defined", "." ]
a4ca954d28ddcd1c39a0b3eefe16e79a390fb507
https://github.com/xiongwilee/Gracejs/blob/a4ca954d28ddcd1c39a0b3eefe16e79a390fb507/app/blog/static/js/common/reveal/markdown.js#L102-L111
13,621
xiongwilee/Gracejs
app/blog/static/js/common/reveal/markdown.js
slidify
function slidify( markdown, options ) { options = getSlidifyOptions( options ); var separatorRegex = new RegExp( options.separator + ( options.verticalSeparator ? '|' + options.verticalSeparator : '' ), 'mg' ), horizontalSeparatorRegex = new RegExp( options.separator ); var matches, lastIndex = 0, isH...
javascript
function slidify( markdown, options ) { options = getSlidifyOptions( options ); var separatorRegex = new RegExp( options.separator + ( options.verticalSeparator ? '|' + options.verticalSeparator : '' ), 'mg' ), horizontalSeparatorRegex = new RegExp( options.separator ); var matches, lastIndex = 0, isH...
[ "function", "slidify", "(", "markdown", ",", "options", ")", "{", "options", "=", "getSlidifyOptions", "(", "options", ")", ";", "var", "separatorRegex", "=", "new", "RegExp", "(", "options", ".", "separator", "+", "(", "options", ".", "verticalSeparator", "...
Parses a data string into multiple slides based on the passed in separator arguments.
[ "Parses", "a", "data", "string", "into", "multiple", "slides", "based", "on", "the", "passed", "in", "separator", "arguments", "." ]
a4ca954d28ddcd1c39a0b3eefe16e79a390fb507
https://github.com/xiongwilee/Gracejs/blob/a4ca954d28ddcd1c39a0b3eefe16e79a390fb507/app/blog/static/js/common/reveal/markdown.js#L138-L204
13,622
xiongwilee/Gracejs
app/blog/static/js/common/reveal/markdown.js
addAttributeInElement
function addAttributeInElement( node, elementTarget, separator ) { var mardownClassesInElementsRegex = new RegExp( separator, 'mg' ); var mardownClassRegex = new RegExp( "([^\"= ]+?)=\"([^\"=]+?)\"", 'mg' ); var nodeValue = node.nodeValue; if( matches = mardownClassesInElementsRegex.exec( nodeValue ) ) { v...
javascript
function addAttributeInElement( node, elementTarget, separator ) { var mardownClassesInElementsRegex = new RegExp( separator, 'mg' ); var mardownClassRegex = new RegExp( "([^\"= ]+?)=\"([^\"=]+?)\"", 'mg' ); var nodeValue = node.nodeValue; if( matches = mardownClassesInElementsRegex.exec( nodeValue ) ) { v...
[ "function", "addAttributeInElement", "(", "node", ",", "elementTarget", ",", "separator", ")", "{", "var", "mardownClassesInElementsRegex", "=", "new", "RegExp", "(", "separator", ",", "'mg'", ")", ";", "var", "mardownClassRegex", "=", "new", "RegExp", "(", "\"(...
Check if a node value has the attributes pattern. If yes, extract it and add that value as one or several attributes the the terget element. You need Cache Killer on Chrome to see the effect on any FOM transformation directly on refresh (F5) http://stackoverflow.com/questions/5690269/disabling-chrome-cache-for-website...
[ "Check", "if", "a", "node", "value", "has", "the", "attributes", "pattern", ".", "If", "yes", "extract", "it", "and", "add", "that", "value", "as", "one", "or", "several", "attributes", "the", "the", "terget", "element", "." ]
a4ca954d28ddcd1c39a0b3eefe16e79a390fb507
https://github.com/xiongwilee/Gracejs/blob/a4ca954d28ddcd1c39a0b3eefe16e79a390fb507/app/blog/static/js/common/reveal/markdown.js#L293-L309
13,623
xiongwilee/Gracejs
app/blog/static/js/common/reveal/markdown.js
addAttributes
function addAttributes( section, element, previousElement, separatorElementAttributes, separatorSectionAttributes ) { if ( element != null && element.childNodes != undefined && element.childNodes.length > 0 ) { previousParentElement = element; for( var i = 0; i < element.childNodes.length; i++ ) { childEle...
javascript
function addAttributes( section, element, previousElement, separatorElementAttributes, separatorSectionAttributes ) { if ( element != null && element.childNodes != undefined && element.childNodes.length > 0 ) { previousParentElement = element; for( var i = 0; i < element.childNodes.length; i++ ) { childEle...
[ "function", "addAttributes", "(", "section", ",", "element", ",", "previousElement", ",", "separatorElementAttributes", ",", "separatorSectionAttributes", ")", "{", "if", "(", "element", "!=", "null", "&&", "element", ".", "childNodes", "!=", "undefined", "&&", "e...
Add attributes to the parent element of a text node, or the element of an attribute node.
[ "Add", "attributes", "to", "the", "parent", "element", "of", "a", "text", "node", "or", "the", "element", "of", "an", "attribute", "node", "." ]
a4ca954d28ddcd1c39a0b3eefe16e79a390fb507
https://github.com/xiongwilee/Gracejs/blob/a4ca954d28ddcd1c39a0b3eefe16e79a390fb507/app/blog/static/js/common/reveal/markdown.js#L315-L348
13,624
xiongwilee/Gracejs
app/blog/static/js/common/reveal/markdown.js
convertSlides
function convertSlides() { var sections = document.querySelectorAll( '[data-markdown]'); for( var i = 0, len = sections.length; i < len; i++ ) { var section = sections[i]; // Only parse the same slide once if( !section.getAttribute( 'data-markdown-parsed' ) ) { section.setAttribute( 'data-markdown...
javascript
function convertSlides() { var sections = document.querySelectorAll( '[data-markdown]'); for( var i = 0, len = sections.length; i < len; i++ ) { var section = sections[i]; // Only parse the same slide once if( !section.getAttribute( 'data-markdown-parsed' ) ) { section.setAttribute( 'data-markdown...
[ "function", "convertSlides", "(", ")", "{", "var", "sections", "=", "document", ".", "querySelectorAll", "(", "'[data-markdown]'", ")", ";", "for", "(", "var", "i", "=", "0", ",", "len", "=", "sections", ".", "length", ";", "i", "<", "len", ";", "i", ...
Converts any current data-markdown slides in the DOM to HTML.
[ "Converts", "any", "current", "data", "-", "markdown", "slides", "in", "the", "DOM", "to", "HTML", "." ]
a4ca954d28ddcd1c39a0b3eefe16e79a390fb507
https://github.com/xiongwilee/Gracejs/blob/a4ca954d28ddcd1c39a0b3eefe16e79a390fb507/app/blog/static/js/common/reveal/markdown.js#L354-L388
13,625
Shopify/node-themekit
lib/run-executable.js
runExecutable
function runExecutable(args, cwd, logLevel) { const logger = require('./logger')(logLevel); return new Promise((resolve, reject) => { logger.silly('Theme Kit command starting'); let errors = ''; const pathToExecutable = path.join(config.destination, config.binName); fs.statSync(pathToExecutable); ...
javascript
function runExecutable(args, cwd, logLevel) { const logger = require('./logger')(logLevel); return new Promise((resolve, reject) => { logger.silly('Theme Kit command starting'); let errors = ''; const pathToExecutable = path.join(config.destination, config.binName); fs.statSync(pathToExecutable); ...
[ "function", "runExecutable", "(", "args", ",", "cwd", ",", "logLevel", ")", "{", "const", "logger", "=", "require", "(", "'./logger'", ")", "(", "logLevel", ")", ";", "return", "new", "Promise", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "logg...
Spawns a child process to run the Theme Kit executable with given parameters @param {string[]} args array to pass to the executable @param {string} cwd directory to run command on @param {string} logLevel level of logging required
[ "Spawns", "a", "child", "process", "to", "run", "the", "Theme", "Kit", "executable", "with", "given", "parameters" ]
8f71a778b301dffda673181c651f58b368b25293
https://github.com/Shopify/node-themekit/blob/8f71a778b301dffda673181c651f58b368b25293/lib/run-executable.js#L13-L43
13,626
Shopify/node-themekit
lib/utils.js
cleanFile
function cleanFile(pathToFile) { try { fs.unlinkSync(pathToFile); } catch (err) { switch (err.code) { case 'ENOENT': return; default: throw new Error(err); } } }
javascript
function cleanFile(pathToFile) { try { fs.unlinkSync(pathToFile); } catch (err) { switch (err.code) { case 'ENOENT': return; default: throw new Error(err); } } }
[ "function", "cleanFile", "(", "pathToFile", ")", "{", "try", "{", "fs", ".", "unlinkSync", "(", "pathToFile", ")", ";", "}", "catch", "(", "err", ")", "{", "switch", "(", "err", ".", "code", ")", "{", "case", "'ENOENT'", ":", "return", ";", "default"...
Deletes a file from the filesystem if it exists. Does nothing if it doesn't do anything. @param {string} pathToFile path to file to delete
[ "Deletes", "a", "file", "from", "the", "filesystem", "if", "it", "exists", ".", "Does", "nothing", "if", "it", "doesn", "t", "do", "anything", "." ]
8f71a778b301dffda673181c651f58b368b25293
https://github.com/Shopify/node-themekit/blob/8f71a778b301dffda673181c651f58b368b25293/lib/utils.js#L8-L19
13,627
splunk/splunk-sdk-javascript
contrib/dox/doc_builder.js
function () { var module = "Global"; for(var i = 0; i < doc.tags.length; i++) { var tag = doc.tags[i]; if (tag.type === "method") { module = tag.content; } else if (tag.type === "function") { module = tag.content; ...
javascript
function () { var module = "Global"; for(var i = 0; i < doc.tags.length; i++) { var tag = doc.tags[i]; if (tag.type === "method") { module = tag.content; } else if (tag.type === "function") { module = tag.content; ...
[ "function", "(", ")", "{", "var", "module", "=", "\"Global\"", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "doc", ".", "tags", ".", "length", ";", "i", "++", ")", "{", "var", "tag", "=", "doc", ".", "tags", "[", "i", "]", ";", "if...
Find the parent module and note the name
[ "Find", "the", "parent", "module", "and", "note", "the", "name" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/contrib/dox/doc_builder.js#L67-L80
13,628
splunk/splunk-sdk-javascript
lib/http.js
function() { // We perform the bindings so that every function works // properly when it is passed as a callback. this.get = utils.bind(this, this.get); this.del = utils.bind(this, this.del); this.post = utils.bind(...
javascript
function() { // We perform the bindings so that every function works // properly when it is passed as a callback. this.get = utils.bind(this, this.get); this.del = utils.bind(this, this.del); this.post = utils.bind(...
[ "function", "(", ")", "{", "// We perform the bindings so that every function works", "// properly when it is passed as a callback.", "this", ".", "get", "=", "utils", ".", "bind", "(", "this", ",", "this", ".", "get", ")", ";", "this", ".", "del", "=", "utils", "...
Constructor for `splunkjs.Http`. @constructor @return {splunkjs.Http} A new `splunkjs.Http` instance. @method splunkjs.Http
[ "Constructor", "for", "splunkjs", ".", "Http", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/http.js#L72-L87
13,629
splunk/splunk-sdk-javascript
lib/http.js
function() { var cookieString = ""; utils.forEach(this._cookieStore, function (cookieValue, cookieKey) { cookieString += cookieKey; cookieString += '='; cookieString += cookieValue; cookieString += '; '; }); ...
javascript
function() { var cookieString = ""; utils.forEach(this._cookieStore, function (cookieValue, cookieKey) { cookieString += cookieKey; cookieString += '='; cookieString += cookieValue; cookieString += '; '; }); ...
[ "function", "(", ")", "{", "var", "cookieString", "=", "\"\"", ";", "utils", ".", "forEach", "(", "this", ".", "_cookieStore", ",", "function", "(", "cookieValue", ",", "cookieKey", ")", "{", "cookieString", "+=", "cookieKey", ";", "cookieString", "+=", "'...
Returns all cookies formatted as a string to be put into the Cookie Header.
[ "Returns", "all", "cookies", "formatted", "as", "a", "string", "to", "be", "put", "into", "the", "Cookie", "Header", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/http.js#L97-L109
13,630
splunk/splunk-sdk-javascript
lib/http.js
function(url, headers, params, timeout, callback) { var message = { method: "GET", headers: headers, timeout: timeout, query: params }; return this.request(url, message, callback); }
javascript
function(url, headers, params, timeout, callback) { var message = { method: "GET", headers: headers, timeout: timeout, query: params }; return this.request(url, message, callback); }
[ "function", "(", "url", ",", "headers", ",", "params", ",", "timeout", ",", "callback", ")", "{", "var", "message", "=", "{", "method", ":", "\"GET\"", ",", "headers", ":", "headers", ",", "timeout", ":", "timeout", ",", "query", ":", "params", "}", ...
Performs a GET request. @param {String} url The URL of the GET request. @param {Object} headers An object of headers for this request. @param {Object} params Parameters for this request. @param {Number} timeout A timeout period. @param {Function} callback The function to call when the request is complete: `(err, respo...
[ "Performs", "a", "GET", "request", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/http.js#L142-L151
13,631
splunk/splunk-sdk-javascript
lib/http.js
function(url, message, callback) { var that = this; var wrappedCallback = function(response) { callback = callback || function() {}; // Handle cookies if 'set-cookie' header is in the response var cookieHeaders = response.response.headers['set-co...
javascript
function(url, message, callback) { var that = this; var wrappedCallback = function(response) { callback = callback || function() {}; // Handle cookies if 'set-cookie' header is in the response var cookieHeaders = response.response.headers['set-co...
[ "function", "(", "url", ",", "message", ",", "callback", ")", "{", "var", "that", "=", "this", ";", "var", "wrappedCallback", "=", "function", "(", "response", ")", "{", "callback", "=", "callback", "||", "function", "(", ")", "{", "}", ";", "// Handle...
Performs a request. This function sets up how to handle a response from a request, but delegates calling the request to the `makeRequest` subclass. @param {String} url The encoded URL of the request. @param {Object} message An object with values for method, headers, timeout, and encoded body. @param {Function} callba...
[ "Performs", "a", "request", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/http.js#L211-L262
13,632
splunk/splunk-sdk-javascript
lib/http.js
function(error, response, data) { var complete_response, json = {}; var contentType = null; if (response && response.headers) { contentType = utils.trim(response.headers["content-type"] || response.headers["Content-Type"] || response.headers["Content-type"] || respon...
javascript
function(error, response, data) { var complete_response, json = {}; var contentType = null; if (response && response.headers) { contentType = utils.trim(response.headers["content-type"] || response.headers["Content-Type"] || response.headers["Content-type"] || respon...
[ "function", "(", "error", ",", "response", ",", "data", ")", "{", "var", "complete_response", ",", "json", "=", "{", "}", ";", "var", "contentType", "=", "null", ";", "if", "(", "response", "&&", "response", ".", "headers", ")", "{", "contentType", "="...
Generates a unified response with the given parameters. @param {Object} error An error object, if one exists for the request. @param {Object} response The response object. @param {Object} data The response data. @return {Object} A unified response object. @method splunkjs.Http
[ "Generates", "a", "unified", "response", "with", "the", "given", "parameters", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/http.js#L300-L333
13,633
splunk/splunk-sdk-javascript
examples/node/helloworld/search_oneshot.js
function(results, done) { // Find the index of the fields we want var rawIndex = results.fields.indexOf("_raw"); var sourcetypeIndex = results.fields.indexOf("sourcetype"); var userIndex = results.fields.indexOf("user"); //...
javascript
function(results, done) { // Find the index of the fields we want var rawIndex = results.fields.indexOf("_raw"); var sourcetypeIndex = results.fields.indexOf("sourcetype"); var userIndex = results.fields.indexOf("user"); //...
[ "function", "(", "results", ",", "done", ")", "{", "// Find the index of the fields we want", "var", "rawIndex", "=", "results", ".", "fields", ".", "indexOf", "(", "\"_raw\"", ")", ";", "var", "sourcetypeIndex", "=", "results", ".", "fields", ".", "indexOf", ...
The job is done, and the results are returned inline
[ "The", "job", "is", "done", "and", "the", "results", "are", "returned", "inline" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/examples/node/helloworld/search_oneshot.js#L58-L74
13,634
splunk/splunk-sdk-javascript
examples/node/helloworld/search_realtime.js
function(job, done) { var MAX_COUNT = 5; var count = 0; Async.whilst( // Loop for N times function() { return MAX_COUNT > count; }, // Every second, ask for preview results fu...
javascript
function(job, done) { var MAX_COUNT = 5; var count = 0; Async.whilst( // Loop for N times function() { return MAX_COUNT > count; }, // Every second, ask for preview results fu...
[ "function", "(", "job", ",", "done", ")", "{", "var", "MAX_COUNT", "=", "5", ";", "var", "count", "=", "0", ";", "Async", ".", "whilst", "(", "// Loop for N times", "function", "(", ")", "{", "return", "MAX_COUNT", ">", "count", ";", "}", ",", "// Ev...
The search is never going to be done, so we simply poll it every second to get more results
[ "The", "search", "is", "never", "going", "to", "be", "done", "so", "we", "simply", "poll", "it", "every", "second", "to", "get", "more", "results" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/examples/node/helloworld/search_realtime.js#L61-L109
13,635
splunk/splunk-sdk-javascript
client/splunk.ui.timeline.js
function(script) { // create local undefined vars so that script cannot access private vars var _namespaces = undefined; var _imported = undefined; var _loading = undefined; var _classPaths = undefined; var _classInfo = undefined; var _classDependencyList = undefined; var _mixinCount = undefined; var...
javascript
function(script) { // create local undefined vars so that script cannot access private vars var _namespaces = undefined; var _imported = undefined; var _loading = undefined; var _classPaths = undefined; var _classInfo = undefined; var _classDependencyList = undefined; var _mixinCount = undefined; var...
[ "function", "(", "script", ")", "{", "// create local undefined vars so that script cannot access private vars", "var", "_namespaces", "=", "undefined", ";", "var", "_imported", "=", "undefined", ";", "var", "_loading", "=", "undefined", ";", "var", "_classPaths", "=", ...
Private Functions Function for evaluating dynamically loaded scripts.
[ "Private", "Functions", "Function", "for", "evaluating", "dynamically", "loaded", "scripts", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.timeline.js#L509-L528
13,636
splunk/splunk-sdk-javascript
lib/ui/charting/i18n.js
ungettext
function ungettext(msgid1, msgid2, n) { if (_i18n_locale.locale_name == 'en_DEBUG') return __debug_trans_str(msgid1); var id = ''+_i18n_plural(n)+'-'+msgid1; var entry = _i18n_catalog[id]; return entry == undefined ? (n==1 ? msgid1 : msgid2) : entry; }
javascript
function ungettext(msgid1, msgid2, n) { if (_i18n_locale.locale_name == 'en_DEBUG') return __debug_trans_str(msgid1); var id = ''+_i18n_plural(n)+'-'+msgid1; var entry = _i18n_catalog[id]; return entry == undefined ? (n==1 ? msgid1 : msgid2) : entry; }
[ "function", "ungettext", "(", "msgid1", ",", "msgid2", ",", "n", ")", "{", "if", "(", "_i18n_locale", ".", "locale_name", "==", "'en_DEBUG'", ")", "return", "__debug_trans_str", "(", "msgid1", ")", ";", "var", "id", "=", "''", "+", "_i18n_plural", "(", "...
Translate a string containing a number Eg. ungettext('Delete %(files)d file?', 'Delete %(files)d files?', files) Use in conjuction with sprintf(): sprintf( ungettext('Delete %(files)d file?', 'Delete %(files)d files?', files), { files: 14 } )
[ "Translate", "a", "string", "containing", "a", "number" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/i18n.js#L46-L51
13,637
splunk/splunk-sdk-javascript
lib/ui/charting/i18n.js
Time
function Time(hour, minute, second, microsecond) { if (_i18n_locale.locale_name == 'en_DEBUG') { this.hour = 11; this.minute = 22; this.second = 33; this.microsecond = 123000; } else { this.hour = hour; this.minute = minute; ...
javascript
function Time(hour, minute, second, microsecond) { if (_i18n_locale.locale_name == 'en_DEBUG') { this.hour = 11; this.minute = 22; this.second = 33; this.microsecond = 123000; } else { this.hour = hour; this.minute = minute; ...
[ "function", "Time", "(", "hour", ",", "minute", ",", "second", ",", "microsecond", ")", "{", "if", "(", "_i18n_locale", ".", "locale_name", "==", "'en_DEBUG'", ")", "{", "this", ".", "hour", "=", "11", ";", "this", ".", "minute", "=", "22", ";", "thi...
Class to hold time information in lieu of datetime.time
[ "Class", "to", "hold", "time", "information", "in", "lieu", "of", "datetime", ".", "time" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/i18n.js#L294-L306
13,638
splunk/splunk-sdk-javascript
lib/ui/charting/i18n.js
DateTime
function DateTime(date) { if (date instanceof DateTime) return date; if (_i18n_locale.locale_name == 'en_DEBUG') date = new Date(3333, 10, 22, 11, 22, 33, 123); if (date instanceof Date) { this.date = date; this.hour = date.getHours(); ...
javascript
function DateTime(date) { if (date instanceof DateTime) return date; if (_i18n_locale.locale_name == 'en_DEBUG') date = new Date(3333, 10, 22, 11, 22, 33, 123); if (date instanceof Date) { this.date = date; this.hour = date.getHours(); ...
[ "function", "DateTime", "(", "date", ")", "{", "if", "(", "date", "instanceof", "DateTime", ")", "return", "date", ";", "if", "(", "_i18n_locale", ".", "locale_name", "==", "'en_DEBUG'", ")", "date", "=", "new", "Date", "(", "3333", ",", "10", ",", "22...
Wrapper object for JS Date objects
[ "Wrapper", "object", "for", "JS", "Date", "objects" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/i18n.js#L311-L330
13,639
splunk/splunk-sdk-javascript
examples/node/helloworld/firedalerts_async.js
function(firedAlertGroups, done) { // Get the list of all fired alert groups, including the all group (represented by "-"). var groups = firedAlertGroups.list(); console.log("Fired alert groups:"); Async.seriesEach( groups, ...
javascript
function(firedAlertGroups, done) { // Get the list of all fired alert groups, including the all group (represented by "-"). var groups = firedAlertGroups.list(); console.log("Fired alert groups:"); Async.seriesEach( groups, ...
[ "function", "(", "firedAlertGroups", ",", "done", ")", "{", "// Get the list of all fired alert groups, including the all group (represented by \"-\").", "var", "groups", "=", "firedAlertGroups", ".", "list", "(", ")", ";", "console", ".", "log", "(", "\"Fired alert groups:...
Print them out.
[ "Print", "them", "out", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/examples/node/helloworld/firedalerts_async.js#L57-L89
13,640
splunk/splunk-sdk-javascript
contrib/commander.js
camelcase
function camelcase(flag) { return flag.split('-').reduce(function(str, word){ return str + word[0].toUpperCase() + word.slice(1); }); }
javascript
function camelcase(flag) { return flag.split('-').reduce(function(str, word){ return str + word[0].toUpperCase() + word.slice(1); }); }
[ "function", "camelcase", "(", "flag", ")", "{", "return", "flag", ".", "split", "(", "'-'", ")", ".", "reduce", "(", "function", "(", "str", ",", "word", ")", "{", "return", "str", "+", "word", "[", "0", "]", ".", "toUpperCase", "(", ")", "+", "w...
Camel-case the given `flag` @param {String} flag @return {String} @api private
[ "Camel", "-", "case", "the", "given", "flag" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/contrib/commander.js#L1054-L1058
13,641
splunk/splunk-sdk-javascript
contrib/commander.js
pad
function pad(str, width) { var len = Math.max(0, width - str.length); return str + Array(len + 1).join(' '); }
javascript
function pad(str, width) { var len = Math.max(0, width - str.length); return str + Array(len + 1).join(' '); }
[ "function", "pad", "(", "str", ",", "width", ")", "{", "var", "len", "=", "Math", ".", "max", "(", "0", ",", "width", "-", "str", ".", "length", ")", ";", "return", "str", "+", "Array", "(", "len", "+", "1", ")", ".", "join", "(", "' '", ")",...
Pad `str` to `width`. @param {String} str @param {Number} width @return {String} @api private
[ "Pad", "str", "to", "width", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/contrib/commander.js#L1081-L1084
13,642
splunk/splunk-sdk-javascript
examples/node/jobs.js
function(sids, options, callback) { _check_sids('cancel', sids); // For each of the supplied sids, cancel the job. this._foreach(sids, function(job, idx, done) { job.cancel(function (err) { if (err) { done(err); ...
javascript
function(sids, options, callback) { _check_sids('cancel', sids); // For each of the supplied sids, cancel the job. this._foreach(sids, function(job, idx, done) { job.cancel(function (err) { if (err) { done(err); ...
[ "function", "(", "sids", ",", "options", ",", "callback", ")", "{", "_check_sids", "(", "'cancel'", ",", "sids", ")", ";", "// For each of the supplied sids, cancel the job.", "this", ".", "_foreach", "(", "sids", ",", "function", "(", "job", ",", "idx", ",", ...
Cancel the specified search jobs
[ "Cancel", "the", "specified", "search", "jobs" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/examples/node/jobs.js#L145-L160
13,643
splunk/splunk-sdk-javascript
examples/node/jobs.js
function(args, options, callback) { // Get the query and parameters, and remove the extraneous // search parameter var query = options.search; var params = options; delete params.search; // Create the job this.service.jobs().create(que...
javascript
function(args, options, callback) { // Get the query and parameters, and remove the extraneous // search parameter var query = options.search; var params = options; delete params.search; // Create the job this.service.jobs().create(que...
[ "function", "(", "args", ",", "options", ",", "callback", ")", "{", "// Get the query and parameters, and remove the extraneous", "// search parameter", "var", "query", "=", "options", ".", "search", ";", "var", "params", "=", "options", ";", "delete", "params", "."...
Create a search job
[ "Create", "a", "search", "job" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/examples/node/jobs.js#L191-L208
13,644
splunk/splunk-sdk-javascript
examples/node/jobs.js
function(sids, options, callback) { sids = sids || []; if (sids.length === 0) { // If no job SIDs are provided, we list all jobs. var jobs = this.service.jobs(); jobs.fetch(function(err, jobs) { if (err) { ...
javascript
function(sids, options, callback) { sids = sids || []; if (sids.length === 0) { // If no job SIDs are provided, we list all jobs. var jobs = this.service.jobs(); jobs.fetch(function(err, jobs) { if (err) { ...
[ "function", "(", "sids", ",", "options", ",", "callback", ")", "{", "sids", "=", "sids", "||", "[", "]", ";", "if", "(", "sids", ".", "length", "===", "0", ")", "{", "// If no job SIDs are provided, we list all jobs.", "var", "jobs", "=", "this", ".", "s...
List all current search jobs if no jobs specified, otherwise list the properties of the specified jobs.
[ "List", "all", "current", "search", "jobs", "if", "no", "jobs", "specified", "otherwise", "list", "the", "properties", "of", "the", "specified", "jobs", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/examples/node/jobs.js#L212-L257
13,645
splunk/splunk-sdk-javascript
examples/modularinputs/github_commits/bin/app/github_commits.js
getDisplayDate
function getDisplayDate(date) { var monthStrings = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; date = new Date(date); var hours = date.getHours(); if (hours < 10) { hours = "0" + hours.toString(); } var mins = date.g...
javascript
function getDisplayDate(date) { var monthStrings = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; date = new Date(date); var hours = date.getHours(); if (hours < 10) { hours = "0" + hours.toString(); } var mins = date.g...
[ "function", "getDisplayDate", "(", "date", ")", "{", "var", "monthStrings", "=", "[", "\"Jan\"", ",", "\"Feb\"", ",", "\"Mar\"", ",", "\"Apr\"", ",", "\"May\"", ",", "\"Jun\"", ",", "\"Jul\"", ",", "\"Aug\"", ",", "\"Sep\"", ",", "\"Oct\"", ",", "\"Nov\"",...
Create easy to read date format.
[ "Create", "easy", "to", "read", "date", "format", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/examples/modularinputs/github_commits/bin/app/github_commits.js#L32-L48
13,646
splunk/splunk-sdk-javascript
lib/log.js
function(allMessages) { allMessages = allMessages || []; for(var i = 0; i < allMessages.length; i++) { var message = allMessages[i]; var type = message["type"]; var text = message["text"]; var msg = '[SPLUNKD] ' + text;...
javascript
function(allMessages) { allMessages = allMessages || []; for(var i = 0; i < allMessages.length; i++) { var message = allMessages[i]; var type = message["type"]; var text = message["text"]; var msg = '[SPLUNKD] ' + text;...
[ "function", "(", "allMessages", ")", "{", "allMessages", "=", "allMessages", "||", "[", "]", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "allMessages", ".", "length", ";", "i", "++", ")", "{", "var", "message", "=", "allMessages", "[", "i...
Prints all messages that are retrieved from the splunkd server to the console. @function splunkjs.Logger
[ "Prints", "all", "messages", "that", "are", "retrieved", "from", "the", "splunkd", "server", "to", "the", "console", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/log.js#L139-L167
13,647
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(name, properties) { // first respect the field hide list that came from the parent module if(properties.fieldHideList && $.inArray(name, properties.fieldHideList) > -1) { return false; } // next process the field visibility lists from the xml ...
javascript
function(name, properties) { // first respect the field hide list that came from the parent module if(properties.fieldHideList && $.inArray(name, properties.fieldHideList) > -1) { return false; } // next process the field visibility lists from the xml ...
[ "function", "(", "name", ",", "properties", ")", "{", "// first respect the field hide list that came from the parent module", "if", "(", "properties", ".", "fieldHideList", "&&", "$", ".", "inArray", "(", "name", ",", "properties", ".", "fieldHideList", ")", ">", "...
returns false if series should not be added to the chart
[ "returns", "false", "if", "series", "should", "not", "be", "added", "to", "the", "chart" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L1434-L1452
13,648
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function($super, key, value, properties) { var keysToIgnore = { 'chart.nullValueMode': true }; if(key in keysToIgnore) { return; } $super(key, value, properties); }
javascript
function($super, key, value, properties) { var keysToIgnore = { 'chart.nullValueMode': true }; if(key in keysToIgnore) { return; } $super(key, value, properties); }
[ "function", "(", "$super", ",", "key", ",", "value", ",", "properties", ")", "{", "var", "keysToIgnore", "=", "{", "'chart.nullValueMode'", ":", "true", "}", ";", "if", "(", "key", "in", "keysToIgnore", ")", "{", "return", ";", "}", "$super", "(", "key...
override point-based charts need to defensively ignore null-value mode, since 'connect' will lead to unexpected results
[ "override", "point", "-", "based", "charts", "need", "to", "defensively", "ignore", "null", "-", "value", "mode", "since", "connect", "will", "lead", "to", "unexpected", "results" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L1769-L1778
13,649
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(point, series) { if(!point || !point.graphic) { return; } point.graphic.attr({'fill': this.fadedElementColor, 'stroke-width': 1, 'stroke': this.fadedElementBorderColor}); }
javascript
function(point, series) { if(!point || !point.graphic) { return; } point.graphic.attr({'fill': this.fadedElementColor, 'stroke-width': 1, 'stroke': this.fadedElementBorderColor}); }
[ "function", "(", "point", ",", "series", ")", "{", "if", "(", "!", "point", "||", "!", "point", ".", "graphic", ")", "{", "return", ";", "}", "point", ".", "graphic", ".", "attr", "(", "{", "'fill'", ":", "this", ".", "fadedElementColor", ",", "'st...
doing full overrides here to avoid a double-repaint, even though there is some duplicate code override
[ "doing", "full", "overrides", "here", "to", "avoid", "a", "double", "-", "repaint", "even", "though", "there", "is", "some", "duplicate", "code", "override" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L1915-L1920
13,650
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(properties, data) { var axisProperties = this.parseUtils.getXAxisProperties(properties), orientation = (this.axesAreInverted) ? 'vertical' : 'horizontal', colorScheme = this.getAxisColorScheme(); // add some extra info to the axisProperties as needed ...
javascript
function(properties, data) { var axisProperties = this.parseUtils.getXAxisProperties(properties), orientation = (this.axesAreInverted) ? 'vertical' : 'horizontal', colorScheme = this.getAxisColorScheme(); // add some extra info to the axisProperties as needed ...
[ "function", "(", "properties", ",", "data", ")", "{", "var", "axisProperties", "=", "this", ".", "parseUtils", ".", "getXAxisProperties", "(", "properties", ")", ",", "orientation", "=", "(", "this", ".", "axesAreInverted", ")", "?", "'vertical'", ":", "'hor...
override force the x axis to be numeric
[ "override", "force", "the", "x", "axis", "to", "be", "numeric" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L2345-L2364
13,651
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function($super) { if(!this.hasSVG) { $super(); return; } var i, loopSplit, loopKeyName, loopKeyElem, loopValElem, $tooltip = $('.highcharts-tooltip', $(this.renderTo)), tooltipElements = (this.hasSVG) ? $('tspan', $tool...
javascript
function($super) { if(!this.hasSVG) { $super(); return; } var i, loopSplit, loopKeyName, loopKeyElem, loopValElem, $tooltip = $('.highcharts-tooltip', $(this.renderTo)), tooltipElements = (this.hasSVG) ? $('tspan', $tool...
[ "function", "(", "$super", ")", "{", "if", "(", "!", "this", ".", "hasSVG", ")", "{", "$super", "(", ")", ";", "return", ";", "}", "var", "i", ",", "loopSplit", ",", "loopKeyName", ",", "loopKeyElem", ",", "loopValElem", ",", "$tooltip", "=", "$", ...
we have to override here because the tooltip structure is different
[ "we", "have", "to", "override", "here", "because", "the", "tooltip", "structure", "is", "different" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L2581-L2605
13,652
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(properties, data) { var useTimeNames = (this.processedData.xAxisType === 'time'), resolveLabel = this.getLabel.bind(this); this.formatTooltip(properties, data); $.extend(true, this.hcConfig, { plotOptions: { pie: { ...
javascript
function(properties, data) { var useTimeNames = (this.processedData.xAxisType === 'time'), resolveLabel = this.getLabel.bind(this); this.formatTooltip(properties, data); $.extend(true, this.hcConfig, { plotOptions: { pie: { ...
[ "function", "(", "properties", ",", "data", ")", "{", "var", "useTimeNames", "=", "(", "this", ".", "processedData", ".", "xAxisType", "===", "'time'", ")", ",", "resolveLabel", "=", "this", ".", "getLabel", ".", "bind", "(", "this", ")", ";", "this", ...
override not calling super class method, pie charts don't have axes or legend
[ "override", "not", "calling", "super", "class", "method", "pie", "charts", "don", "t", "have", "axes", "or", "legend" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L2798-L2813
13,653
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(list, map, legendSize) { var hexColor; this.colorList = []; this.hcConfig.colors = []; for(i = 0; i < list.length; i++) { hexColor = this.colorPalette.getColor(list[i], map[list[i]], legendSize); this.colorList.push(hexColor); ...
javascript
function(list, map, legendSize) { var hexColor; this.colorList = []; this.hcConfig.colors = []; for(i = 0; i < list.length; i++) { hexColor = this.colorPalette.getColor(list[i], map[list[i]], legendSize); this.colorList.push(hexColor); ...
[ "function", "(", "list", ",", "map", ",", "legendSize", ")", "{", "var", "hexColor", ";", "this", ".", "colorList", "=", "[", "]", ";", "this", ".", "hcConfig", ".", "colors", "=", "[", "]", ";", "for", "(", "i", "=", "0", ";", "i", "<", "list"...
override the inner charts will handle adding opacity to their color schemes
[ "override", "the", "inner", "charts", "will", "handle", "adding", "opacity", "to", "their", "color", "schemes" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L3364-L3373
13,654
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(ticks) { var key, tickArray = []; for(key in ticks) { if(ticks.hasOwnProperty(key)) { tickArray.push(ticks[key]); } } tickArray.sort(function(t1, t2) { return (t1.pos - t2.pos); ...
javascript
function(ticks) { var key, tickArray = []; for(key in ticks) { if(ticks.hasOwnProperty(key)) { tickArray.push(ticks[key]); } } tickArray.sort(function(t1, t2) { return (t1.pos - t2.pos); ...
[ "function", "(", "ticks", ")", "{", "var", "key", ",", "tickArray", "=", "[", "]", ";", "for", "(", "key", "in", "ticks", ")", "{", "if", "(", "ticks", ".", "hasOwnProperty", "(", "key", ")", ")", "{", "tickArray", ".", "push", "(", "ticks", "[",...
returns the ticks in an array in ascending order by 'pos'
[ "returns", "the", "ticks", "in", "an", "array", "in", "ascending", "order", "by", "pos" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L3982-L3995
13,655
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(options, extremes) { // if there are no extremes (i.e. no meaningful data was extracted), go with 0 to 100 if(!extremes.min && !extremes.max) { options.min = 0; options.max = 100; return; } // if the min or max is s...
javascript
function(options, extremes) { // if there are no extremes (i.e. no meaningful data was extracted), go with 0 to 100 if(!extremes.min && !extremes.max) { options.min = 0; options.max = 100; return; } // if the min or max is s...
[ "function", "(", "options", ",", "extremes", ")", "{", "// if there are no extremes (i.e. no meaningful data was extracted), go with 0 to 100", "if", "(", "!", "extremes", ".", "min", "&&", "!", "extremes", ".", "max", ")", "{", "options", ".", "min", "=", "0", ";...
clean up various issues that can arise from the axis extremes
[ "clean", "up", "various", "issues", "that", "can", "arise", "from", "the", "axis", "extremes" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L4292-L4317
13,656
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(startVal, endVal, drawFn, finishCallback) { var animationRange = endVal - startVal, duration = 500, animationProperties = { duration: duration, step: function(now, fx) { drawFn(startVal + now); ...
javascript
function(startVal, endVal, drawFn, finishCallback) { var animationRange = endVal - startVal, duration = 500, animationProperties = { duration: duration, step: function(now, fx) { drawFn(startVal + now); ...
[ "function", "(", "startVal", ",", "endVal", ",", "drawFn", ",", "finishCallback", ")", "{", "var", "animationRange", "=", "endVal", "-", "startVal", ",", "duration", "=", "500", ",", "animationProperties", "=", "{", "duration", ":", "duration", ",", "step", ...
we can't use the jQuery animation library explicitly to perform complex SVG animations, but we can take advantage of their implementation using a meaningless css property and a custom step function
[ "we", "can", "t", "use", "the", "jQuery", "animation", "library", "explicitly", "to", "perform", "complex", "SVG", "animations", "but", "we", "can", "take", "advantage", "of", "their", "implementation", "using", "a", "meaningless", "css", "property", "and", "a...
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L5436-L5458
13,657
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function($super, oldValue, newValue) { var oldPrecision = this.mathUtils.getDecimalPrecision(oldValue, 3), newPrecision = this.mathUtils.getDecimalPrecision(newValue, 3); this.valueAnimationPrecision = Math.max(oldPrecision, newPrecision); $super(oldValue, newValue);...
javascript
function($super, oldValue, newValue) { var oldPrecision = this.mathUtils.getDecimalPrecision(oldValue, 3), newPrecision = this.mathUtils.getDecimalPrecision(newValue, 3); this.valueAnimationPrecision = Math.max(oldPrecision, newPrecision); $super(oldValue, newValue);...
[ "function", "(", "$super", ",", "oldValue", ",", "newValue", ")", "{", "var", "oldPrecision", "=", "this", ".", "mathUtils", ".", "getDecimalPrecision", "(", "oldValue", ",", "3", ")", ",", "newPrecision", "=", "this", ".", "mathUtils", ".", "getDecimalPreci...
override use the decimal precision of the old and new values to set things up for a smooth animation
[ "override", "use", "the", "decimal", "precision", "of", "the", "old", "and", "new", "values", "to", "set", "things", "up", "for", "a", "smooth", "animation" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L6023-L6029
13,658
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(fillColor) { var fillColorHex = this.colorUtils.hexFromColor(fillColor), luminanceThreshold = 128, darkColor = 'black', lightColor = 'white', fillLuminance = this.colorUtils.getLuminance(fillColorHex); return (fillLuminanc...
javascript
function(fillColor) { var fillColorHex = this.colorUtils.hexFromColor(fillColor), luminanceThreshold = 128, darkColor = 'black', lightColor = 'white', fillLuminance = this.colorUtils.getLuminance(fillColorHex); return (fillLuminanc...
[ "function", "(", "fillColor", ")", "{", "var", "fillColorHex", "=", "this", ".", "colorUtils", ".", "hexFromColor", "(", "fillColor", ")", ",", "luminanceThreshold", "=", "128", ",", "darkColor", "=", "'black'", ",", "lightColor", "=", "'white'", ",", "fillL...
use the value to determine the fill color, then use that color's luminance determine if a light or dark font color should be used
[ "use", "the", "value", "to", "determine", "the", "fill", "color", "then", "use", "that", "color", "s", "luminance", "determine", "if", "a", "light", "or", "dark", "font", "color", "should", "be", "used" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L6060-L6068
13,659
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(num) { var result = Math.log(num) / Math.LN10; return (Math.round(result * 10000) / 10000); }
javascript
function(num) { var result = Math.log(num) / Math.LN10; return (Math.round(result * 10000) / 10000); }
[ "function", "(", "num", ")", "{", "var", "result", "=", "Math", ".", "log", "(", "num", ")", "/", "Math", ".", "LN10", ";", "return", "(", "Math", ".", "round", "(", "result", "*", "10000", ")", "/", "10000", ")", ";", "}" ]
shortcut for base-ten log, also rounds to four decimal points of precision to make pretty numbers
[ "shortcut", "for", "base", "-", "ten", "log", "also", "rounds", "to", "four", "decimal", "points", "of", "precision", "to", "make", "pretty", "numbers" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L7272-L7275
13,660
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(num) { if(typeof num !== "number") { return NaN; } var isNegative = (num < 0), result; if(isNegative) { num = -num; } if(num < 10) { num += (10 - num) / 10; } ...
javascript
function(num) { if(typeof num !== "number") { return NaN; } var isNegative = (num < 0), result; if(isNegative) { num = -num; } if(num < 10) { num += (10 - num) / 10; } ...
[ "function", "(", "num", ")", "{", "if", "(", "typeof", "num", "!==", "\"number\"", ")", "{", "return", "NaN", ";", "}", "var", "isNegative", "=", "(", "num", "<", "0", ")", ",", "result", ";", "if", "(", "isNegative", ")", "{", "num", "=", "-", ...
transforms numbers to a normalized log scale that can handle negative numbers rounds to four decimal points of precision
[ "transforms", "numbers", "to", "a", "normalized", "log", "scale", "that", "can", "handle", "negative", "numbers", "rounds", "to", "four", "decimal", "points", "of", "precision" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L7279-L7294
13,661
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(num) { if(typeof num !== "number") { return NaN; } var isNegative = (num < 0), result; if(isNegative) { num = -num; } result = Math.pow(10, num); if(result < 10) { ...
javascript
function(num) { if(typeof num !== "number") { return NaN; } var isNegative = (num < 0), result; if(isNegative) { num = -num; } result = Math.pow(10, num); if(result < 10) { ...
[ "function", "(", "num", ")", "{", "if", "(", "typeof", "num", "!==", "\"number\"", ")", "{", "return", "NaN", ";", "}", "var", "isNegative", "=", "(", "num", "<", "0", ")", ",", "result", ";", "if", "(", "isNegative", ")", "{", "num", "=", "-", ...
reverses the transformation made by absLogBaseTen above rounds to three decimal points of precision
[ "reverses", "the", "transformation", "made", "by", "absLogBaseTen", "above", "rounds", "to", "three", "decimal", "points", "of", "precision" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L7298-L7314
13,662
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(num) { if(typeof num !== "number") { return NaN; } var isNegative = num < 0; num = (isNegative) ? -num : num; var log = this.logBaseTen(num), result = Math.pow(10, Math.floor(log)); return (isNegative) ? -r...
javascript
function(num) { if(typeof num !== "number") { return NaN; } var isNegative = num < 0; num = (isNegative) ? -num : num; var log = this.logBaseTen(num), result = Math.pow(10, Math.floor(log)); return (isNegative) ? -r...
[ "function", "(", "num", ")", "{", "if", "(", "typeof", "num", "!==", "\"number\"", ")", "{", "return", "NaN", ";", "}", "var", "isNegative", "=", "num", "<", "0", ";", "num", "=", "(", "isNegative", ")", "?", "-", "num", ":", "num", ";", "var", ...
calculates the power of ten that is closest to but not greater than the number negative numbers are treated as their absolute value and the sign of the result is flipped before returning
[ "calculates", "the", "power", "of", "ten", "that", "is", "closest", "to", "but", "not", "greater", "than", "the", "number", "negative", "numbers", "are", "treated", "as", "their", "absolute", "value", "and", "the", "sign", "of", "the", "result", "is", "fli...
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L7318-L7328
13,663
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(num, max) { max = max || Infinity; var precision = 0; while(precision < max && num.toFixed(precision) !== num.toString()) { precision += 1; } return precision; }
javascript
function(num, max) { max = max || Infinity; var precision = 0; while(precision < max && num.toFixed(precision) !== num.toString()) { precision += 1; } return precision; }
[ "function", "(", "num", ",", "max", ")", "{", "max", "=", "max", "||", "Infinity", ";", "var", "precision", "=", "0", ";", "while", "(", "precision", "<", "max", "&&", "num", ".", "toFixed", "(", "precision", ")", "!==", "num", ".", "toString", "("...
returns the number of digits of precision after the decimal point optionally accepts a maximum number, after which point it will stop looking and return the max
[ "returns", "the", "number", "of", "digits", "of", "precision", "after", "the", "decimal", "point", "optionally", "accepts", "a", "maximum", "number", "after", "which", "point", "it", "will", "stop", "looking", "and", "return", "the", "max" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L7346-L7355
13,664
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(isoString, pointSpan) { var i18n = Splunk.JSCharting.i18nUtils, bdTime = this.extractBdTime(isoString), dateObject; if(bdTime.isInvalid) { return null; } dateObject = this.bdTimeToDateObject(bdTime); i...
javascript
function(isoString, pointSpan) { var i18n = Splunk.JSCharting.i18nUtils, bdTime = this.extractBdTime(isoString), dateObject; if(bdTime.isInvalid) { return null; } dateObject = this.bdTimeToDateObject(bdTime); i...
[ "function", "(", "isoString", ",", "pointSpan", ")", "{", "var", "i18n", "=", "Splunk", ".", "JSCharting", ".", "i18nUtils", ",", "bdTime", "=", "this", ".", "extractBdTime", "(", "isoString", ")", ",", "dateObject", ";", "if", "(", "bdTime", ".", "isInv...
returns null if string cannot be parsed
[ "returns", "null", "if", "string", "cannot", "be", "parsed" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L7886-L7903
13,665
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(hexNum, alpha) { if(typeof hexNum !== "number") { hexNum = parseInt(hexNum, 16); } if(isNaN(hexNum) || hexNum < 0x000000 || hexNum > 0xffffff) { return undefined; } var r = (hexNum & 0xff0000) >> 16, g =...
javascript
function(hexNum, alpha) { if(typeof hexNum !== "number") { hexNum = parseInt(hexNum, 16); } if(isNaN(hexNum) || hexNum < 0x000000 || hexNum > 0xffffff) { return undefined; } var r = (hexNum & 0xff0000) >> 16, g =...
[ "function", "(", "hexNum", ",", "alpha", ")", "{", "if", "(", "typeof", "hexNum", "!==", "\"number\"", ")", "{", "hexNum", "=", "parseInt", "(", "hexNum", ",", "16", ")", ";", "}", "if", "(", "isNaN", "(", "hexNum", ")", "||", "hexNum", "<", "0x000...
converts a hex number to its css-friendly counterpart, with optional alpha transparency field returns undefined if the input is cannot be parsed to a valid number or if the number is out of range
[ "converts", "a", "hex", "number", "to", "its", "css", "-", "friendly", "counterpart", "with", "optional", "alpha", "transparency", "field", "returns", "undefined", "if", "the", "input", "is", "cannot", "be", "parsed", "to", "a", "valid", "number", "or", "if"...
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L8009-L8021
13,666
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(color) { var normalizedColor = Splunk.util.normalizeColor(color); return (normalizedColor) ? parseInt(normalizedColor.replace("#", "0x"), 16) : 0; }
javascript
function(color) { var normalizedColor = Splunk.util.normalizeColor(color); return (normalizedColor) ? parseInt(normalizedColor.replace("#", "0x"), 16) : 0; }
[ "function", "(", "color", ")", "{", "var", "normalizedColor", "=", "Splunk", ".", "util", ".", "normalizeColor", "(", "color", ")", ";", "return", "(", "normalizedColor", ")", "?", "parseInt", "(", "normalizedColor", ".", "replace", "(", "\"#\"", ",", "\"0...
coverts a color string in either hex or rgb format into its corresponding hex number returns zero if the color string can't be parsed as either format
[ "coverts", "a", "color", "string", "in", "either", "hex", "or", "rgb", "format", "into", "its", "corresponding", "hex", "number", "returns", "zero", "if", "the", "color", "string", "can", "t", "be", "parsed", "as", "either", "format" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L8025-L8029
13,667
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(rgbaStr) { // lazy create the regex if(!this.rgbaRegex) { this.rgbaRegex = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,[\s\d.]+\)\s*$/; } var colorComponents = this.rgbaRegex.exec(rgbaStr); if(!colorComponents) { ...
javascript
function(rgbaStr) { // lazy create the regex if(!this.rgbaRegex) { this.rgbaRegex = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,[\s\d.]+\)\s*$/; } var colorComponents = this.rgbaRegex.exec(rgbaStr); if(!colorComponents) { ...
[ "function", "(", "rgbaStr", ")", "{", "// lazy create the regex", "if", "(", "!", "this", ".", "rgbaRegex", ")", "{", "this", ".", "rgbaRegex", "=", "/", "^rgba\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,[\\s\\d.]+\\)\\s*$", "/", ";", "}", "var", "colo...
given a color string in rgba format, returns the equivalent color in rgb format if the color string is not in valid rgba format, returns the color string un-modified
[ "given", "a", "color", "string", "in", "rgba", "format", "returns", "the", "equivalent", "color", "in", "rgb", "format", "if", "the", "color", "string", "is", "not", "in", "valid", "rgba", "format", "returns", "the", "color", "string", "un", "-", "modified...
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L8039-L8049
13,668
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(properties) { var key, newKey, remapped = {}, axisProps = this.filterPropsByRegex(properties, /(axisX|primaryAxis|axisLabelsX|axisTitleX|gridLinesX)/); for(key in axisProps) { if(axisProps.hasOwnProperty(key)) { if(!thi...
javascript
function(properties) { var key, newKey, remapped = {}, axisProps = this.filterPropsByRegex(properties, /(axisX|primaryAxis|axisLabelsX|axisTitleX|gridLinesX)/); for(key in axisProps) { if(axisProps.hasOwnProperty(key)) { if(!thi...
[ "function", "(", "properties", ")", "{", "var", "key", ",", "newKey", ",", "remapped", "=", "{", "}", ",", "axisProps", "=", "this", ".", "filterPropsByRegex", "(", "properties", ",", "/", "(axisX|primaryAxis|axisLabelsX|axisTitleX|gridLinesX)", "/", ")", ";", ...
returns a map of properties that apply either to the x-axis or to x-axis labels all axis-related keys are renamed to 'axis' and all axis-label-related keys are renamed to 'axisLabels'
[ "returns", "a", "map", "of", "properties", "that", "apply", "either", "to", "the", "x", "-", "axis", "or", "to", "x", "-", "axis", "labels", "all", "axis", "-", "related", "keys", "are", "renamed", "to", "axis", "and", "all", "axis", "-", "label", "-...
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L8077-L8093
13,669
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(key, properties) { if(!(/primaryAxis/.test(key))) { return false; } if(/primaryAxisTitle/.test(key)) { return properties[key.replace(/primaryAxisTitle/, "axisTitleX")]; } return properties[key.replace(/primaryAxis/, "ax...
javascript
function(key, properties) { if(!(/primaryAxis/.test(key))) { return false; } if(/primaryAxisTitle/.test(key)) { return properties[key.replace(/primaryAxisTitle/, "axisTitleX")]; } return properties[key.replace(/primaryAxis/, "ax...
[ "function", "(", "key", ",", "properties", ")", "{", "if", "(", "!", "(", "/", "primaryAxis", "/", ".", "test", "(", "key", ")", ")", ")", "{", "return", "false", ";", "}", "if", "(", "/", "primaryAxisTitle", "/", ".", "test", "(", "key", ")", ...
checks if the given x-axis key is deprecated, and if so returns true if that key's non-deprecated counterpart is set in the properties map, otherwise returns false
[ "checks", "if", "the", "given", "x", "-", "axis", "key", "is", "deprecated", "and", "if", "so", "returns", "true", "if", "that", "key", "s", "non", "-", "deprecated", "counterpart", "is", "set", "in", "the", "properties", "map", "otherwise", "returns", "...
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L8097-L8105
13,670
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(properties) { var key, newKey, remapped = {}, axisProps = this.filterPropsByRegex(properties, /(axisY|secondaryAxis|axisLabelsY|axisTitleY|gridLinesY)/); for(key in axisProps) { if(axisProps.hasOwnProperty(key)) { if(!t...
javascript
function(properties) { var key, newKey, remapped = {}, axisProps = this.filterPropsByRegex(properties, /(axisY|secondaryAxis|axisLabelsY|axisTitleY|gridLinesY)/); for(key in axisProps) { if(axisProps.hasOwnProperty(key)) { if(!t...
[ "function", "(", "properties", ")", "{", "var", "key", ",", "newKey", ",", "remapped", "=", "{", "}", ",", "axisProps", "=", "this", ".", "filterPropsByRegex", "(", "properties", ",", "/", "(axisY|secondaryAxis|axisLabelsY|axisTitleY|gridLinesY)", "/", ")", ";",...
returns a map of properties that apply either to the y-axis or to y-axis labels all axis-related keys are renamed to 'axis' and all axis-label-related keys are renamed to 'axisLabels'
[ "returns", "a", "map", "of", "properties", "that", "apply", "either", "to", "the", "y", "-", "axis", "or", "to", "y", "-", "axis", "labels", "all", "axis", "-", "related", "keys", "are", "renamed", "to", "axis", "and", "all", "axis", "-", "label", "-...
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L8109-L8125
13,671
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(key, properties) { if(!(/secondaryAxis/.test(key))) { return false; } if(/secondaryAxisTitle/.test(key)) { return properties[key.replace(/secondaryAxisTitle/, "axisTitleY")]; } return properties[key.replace(/secondaryAx...
javascript
function(key, properties) { if(!(/secondaryAxis/.test(key))) { return false; } if(/secondaryAxisTitle/.test(key)) { return properties[key.replace(/secondaryAxisTitle/, "axisTitleY")]; } return properties[key.replace(/secondaryAx...
[ "function", "(", "key", ",", "properties", ")", "{", "if", "(", "!", "(", "/", "secondaryAxis", "/", ".", "test", "(", "key", ")", ")", ")", "{", "return", "false", ";", "}", "if", "(", "/", "secondaryAxisTitle", "/", ".", "test", "(", "key", ")"...
checks if the given y-axis key is deprecated, and if so returns true if that key's non-deprecated counterpart is set in the properties map, otherwise returns false
[ "checks", "if", "the", "given", "y", "-", "axis", "key", "is", "deprecated", "and", "if", "so", "returns", "true", "if", "that", "key", "s", "non", "-", "deprecated", "counterpart", "is", "set", "in", "the", "properties", "map", "otherwise", "returns", "...
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L8129-L8137
13,672
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(props, regex) { if(!(regex instanceof RegExp)) { return props; } var key, filtered = {}; for(key in props) { if(props.hasOwnProperty(key) && regex.test(key)) { filtered[key] = props[key]; ...
javascript
function(props, regex) { if(!(regex instanceof RegExp)) { return props; } var key, filtered = {}; for(key in props) { if(props.hasOwnProperty(key) && regex.test(key)) { filtered[key] = props[key]; ...
[ "function", "(", "props", ",", "regex", ")", "{", "if", "(", "!", "(", "regex", "instanceof", "RegExp", ")", ")", "{", "return", "props", ";", "}", "var", "key", ",", "filtered", "=", "{", "}", ";", "for", "(", "key", "in", "props", ")", "{", "...
uses the given regex to filter out any properties whose key doesn't match will return an empty object if the props input is not a map
[ "uses", "the", "given", "regex", "to", "filter", "out", "any", "properties", "whose", "key", "doesn", "t", "match", "will", "return", "an", "empty", "object", "if", "the", "props", "input", "is", "not", "a", "map" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L8141-L8154
13,673
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(array1, array2) { // make sure these are actually arrays if(!(array1 instanceof Array) || !(array2 instanceof Array)) { return false; } if(array1 === array2) { // true if they are the same object return true; ...
javascript
function(array1, array2) { // make sure these are actually arrays if(!(array1 instanceof Array) || !(array2 instanceof Array)) { return false; } if(array1 === array2) { // true if they are the same object return true; ...
[ "function", "(", "array1", ",", "array2", ")", "{", "// make sure these are actually arrays", "if", "(", "!", "(", "array1", "instanceof", "Array", ")", "||", "!", "(", "array2", "instanceof", "Array", ")", ")", "{", "return", "false", ";", "}", "if", "(",...
a simple utility method for comparing arrays, assumes one-dimensional arrays of primitives, performs strict comparisons
[ "a", "simple", "utility", "method", "for", "comparing", "arrays", "assumes", "one", "-", "dimensional", "arrays", "of", "primitives", "performs", "strict", "comparisons" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L8201-L8221
13,674
splunk/splunk-sdk-javascript
lib/ui/charting/js_charting.js
function(date, format) { var i, replacements, locale = locale_name(); if(format && locale_uses_day_before_month()) { replacements = this.DAY_FIRST_FORMATS; for(i = 0; i < replacements.length; i++) { format = format.replace(repla...
javascript
function(date, format) { var i, replacements, locale = locale_name(); if(format && locale_uses_day_before_month()) { replacements = this.DAY_FIRST_FORMATS; for(i = 0; i < replacements.length; i++) { format = format.replace(repla...
[ "function", "(", "date", ",", "format", ")", "{", "var", "i", ",", "replacements", ",", "locale", "=", "locale_name", "(", ")", ";", "if", "(", "format", "&&", "locale_uses_day_before_month", "(", ")", ")", "{", "replacements", "=", "this", ".", "DAY_FIR...
a special-case hack to handle some i18n bugs, see SPL-42469
[ "a", "special", "-", "case", "hack", "to", "handle", "some", "i18n", "bugs", "see", "SPL", "-", "42469" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/ui/charting/js_charting.js#L8261-L8278
13,675
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(args) { args = this.trim(args, '&\?#'); var parts = args.split('&'); var output = {}; var key; var value; var equalsSegments; var lim = parts.length; for (var i=0,l=lim; i<l; i++) { equalsSegments ...
javascript
function(args) { args = this.trim(args, '&\?#'); var parts = args.split('&'); var output = {}; var key; var value; var equalsSegments; var lim = parts.length; for (var i=0,l=lim; i<l; i++) { equalsSegments ...
[ "function", "(", "args", ")", "{", "args", "=", "this", ".", "trim", "(", "args", ",", "'&\\?#'", ")", ";", "var", "parts", "=", "args", ".", "split", "(", "'&'", ")", ";", "var", "output", "=", "{", "}", ";", "var", "key", ";", "var", "value",...
Converts a flat querystring into an object literal
[ "Converts", "a", "flat", "querystring", "into", "an", "object", "literal" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L10790-L10807
13,676
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(){ var hashPos = window.location.href.indexOf('#'); if (hashPos == -1) { return ""; } var qPos = window.location.href.indexOf('?', hashPos); if (qPos != -1) return window.location.href.substr(qPos); return window.location.href.substr(h...
javascript
function(){ var hashPos = window.location.href.indexOf('#'); if (hashPos == -1) { return ""; } var qPos = window.location.href.indexOf('?', hashPos); if (qPos != -1) return window.location.href.substr(qPos); return window.location.href.substr(h...
[ "function", "(", ")", "{", "var", "hashPos", "=", "window", ".", "location", ".", "href", ".", "indexOf", "(", "'#'", ")", ";", "if", "(", "hashPos", "==", "-", "1", ")", "{", "return", "\"\"", ";", "}", "var", "qPos", "=", "window", ".", "locati...
Extracts the fragment identifier value.
[ "Extracts", "the", "fragment", "identifier", "value", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L10812-L10825
13,677
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(serverOffsetThen, d) { if (!Splunk.util.isInt(serverOffsetThen)) { return 0; } // what JS thinks the timezone offset is at the time given by d. This WILL INCLUDE DST var clientOffsetThen = d.getTimezoneOffset() * 60; // what splunkd to...
javascript
function(serverOffsetThen, d) { if (!Splunk.util.isInt(serverOffsetThen)) { return 0; } // what JS thinks the timezone offset is at the time given by d. This WILL INCLUDE DST var clientOffsetThen = d.getTimezoneOffset() * 60; // what splunkd to...
[ "function", "(", "serverOffsetThen", ",", "d", ")", "{", "if", "(", "!", "Splunk", ".", "util", ".", "isInt", "(", "serverOffsetThen", ")", ")", "{", "return", "0", ";", "}", "// what JS thinks the timezone offset is at the time given by d. This WILL INCLUDE DST", "...
Given a timezone offset in minutes, and a JS Date object, returns the delta in milliseconds, of the two timezones. Note that this will include the offset contributions from DST for both.
[ "Given", "a", "timezone", "offset", "in", "minutes", "and", "a", "JS", "Date", "object", "returns", "the", "delta", "in", "milliseconds", "of", "the", "two", "timezones", ".", "Note", "that", "this", "will", "include", "the", "offset", "contributions", "from...
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L10894-L10904
13,678
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function() { var output = '', seg, len; for (var i=0,l=arguments.length; i<l; i++) { seg = arguments[i].toString(); len = seg.length; if (len > 1 && seg.charAt(len-1) == '/') { seg = seg.substring(0, len-1); } ...
javascript
function() { var output = '', seg, len; for (var i=0,l=arguments.length; i<l; i++) { seg = arguments[i].toString(); len = seg.length; if (len > 1 && seg.charAt(len-1) == '/') { seg = seg.substring(0, len-1); } ...
[ "function", "(", ")", "{", "var", "output", "=", "''", ",", "seg", ",", "len", ";", "for", "(", "var", "i", "=", "0", ",", "l", "=", "arguments", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "seg", "=", "arguments", "[", "i"...
Returns a proper path that is relative to the current appserver location. This is critical to ensure that we are proxy compatible. This method takes 1 or more arguments, which will all be stiched together in sequence. Ex: make_url('search/job'); // "/splunk/search/job" Ex: make_url('/search/job'); // "/splunk/search/j...
[ "Returns", "a", "proper", "path", "that", "is", "relative", "to", "the", "current", "appserver", "location", ".", "This", "is", "critical", "to", "ensure", "that", "we", "are", "proxy", "compatible", ".", "This", "method", "takes", "1", "or", "more", "argu...
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L10975-L11011
13,679
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(url, options) { url = this.make_url(url); if (options) url = url + '?' + this.propToQueryString(options); return url; }
javascript
function(url, options) { url = this.make_url(url); if (options) url = url + '?' + this.propToQueryString(options); return url; }
[ "function", "(", "url", ",", "options", ")", "{", "url", "=", "this", ".", "make_url", "(", "url", ")", ";", "if", "(", "options", ")", "url", "=", "url", "+", "'?'", "+", "this", ".", "propToQueryString", "(", "options", ")", ";", "return", "url",...
Given a path and a dictionary of options, builds a qualified query string. @param uri {String} required; path to endpoint. eg. "search/jobs" @param options {Object} key / value par of query params eg. {'foo': 'bar'}
[ "Given", "a", "path", "and", "a", "dictionary", "of", "options", "builds", "a", "qualified", "query", "string", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L11019-L11023
13,680
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(uri, options, windowObj, focus) { uri = this.make_full_url(uri, options); if (!windowObj) windowObj = window; windowObj.document.location = uri; if (focus && windowObj.focus) windowObj.focus(); return; }
javascript
function(uri, options, windowObj, focus) { uri = this.make_full_url(uri, options); if (!windowObj) windowObj = window; windowObj.document.location = uri; if (focus && windowObj.focus) windowObj.focus(); return; }
[ "function", "(", "uri", ",", "options", ",", "windowObj", ",", "focus", ")", "{", "uri", "=", "this", ".", "make_full_url", "(", "uri", ",", "options", ")", ";", "if", "(", "!", "windowObj", ")", "windowObj", "=", "window", ";", "windowObj", ".", "do...
Redirects user to a new page. @param uri {String} required @param options {Object} containing parameters like: sid => attaches optional sid in valid format s => attaches optional saved search name q => attaches optional search string in valid format Example: util.redirect_to('app/core/search', { 'sid' : 1234, 'foo' :...
[ "Redirects", "user", "to", "a", "new", "page", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L11044-L11050
13,681
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(path) { if (path === undefined) { path = document.location.pathname; } var locale = this.getConfigValue('LOCALE').toString(); // if there is no way to figure out the locale, just return pathname if (!this.getConfigValue('LOCALE') || p...
javascript
function(path) { if (path === undefined) { path = document.location.pathname; } var locale = this.getConfigValue('LOCALE').toString(); // if there is no way to figure out the locale, just return pathname if (!this.getConfigValue('LOCALE') || p...
[ "function", "(", "path", ")", "{", "if", "(", "path", "===", "undefined", ")", "{", "path", "=", "document", ".", "location", ".", "pathname", ";", "}", "var", "locale", "=", "this", ".", "getConfigValue", "(", "'LOCALE'", ")", ".", "toString", "(", ...
Return the path without the localization segment.
[ "Return", "the", "path", "without", "the", "localization", "segment", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L11109-L11121
13,682
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(){ var pageYOffset = 0; if(window.pageYOffset){ pageYOffset = window.pageYOffset; }else if(document.documentElement && document.documentElement.scrollTop){ pageYOffset = document.documentElement.scrollTop; } return page...
javascript
function(){ var pageYOffset = 0; if(window.pageYOffset){ pageYOffset = window.pageYOffset; }else if(document.documentElement && document.documentElement.scrollTop){ pageYOffset = document.documentElement.scrollTop; } return page...
[ "function", "(", ")", "{", "var", "pageYOffset", "=", "0", ";", "if", "(", "window", ".", "pageYOffset", ")", "{", "pageYOffset", "=", "window", ".", "pageYOffset", ";", "}", "else", "if", "(", "document", ".", "documentElement", "&&", "document", ".", ...
Retrieve the amount of content that has been hidden by scrolling down. @type Number @return 0-n value.
[ "Retrieve", "the", "amount", "of", "content", "that", "has", "been", "hidden", "by", "scrolling", "down", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L11149-L11157
13,683
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(){ return { width:(!isNaN(window.innerWidth))?window.innerWidth:document.documentElement.clientWidth||0, height:(!isNaN(window.innerHeight))?window.innerHeight:document.documentElement.clientHeight||0 }; }
javascript
function(){ return { width:(!isNaN(window.innerWidth))?window.innerWidth:document.documentElement.clientWidth||0, height:(!isNaN(window.innerHeight))?window.innerHeight:document.documentElement.clientHeight||0 }; }
[ "function", "(", ")", "{", "return", "{", "width", ":", "(", "!", "isNaN", "(", "window", ".", "innerWidth", ")", ")", "?", "window", ".", "innerWidth", ":", "document", ".", "documentElement", ".", "clientWidth", "||", "0", ",", "height", ":", "(", ...
Retrieve the inner dimensions of the window. This does not work in jQuery. @type Object @return An object literal having width and height attributes.
[ "Retrieve", "the", "inner", "dimensions", "of", "the", "window", ".", "This", "does", "not", "work", "in", "jQuery", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L11165-L11170
13,684
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(el, styleProperty){ if(el.currentStyle){ return el.currentStyle[styleProperty]; }else if(window.getComputedStyle){ var cssProperty = styleProperty.replace(/([A-Z])/g, "-$1").toLowerCase(); var computedStyle = window.getComputedStyle(el, ""...
javascript
function(el, styleProperty){ if(el.currentStyle){ return el.currentStyle[styleProperty]; }else if(window.getComputedStyle){ var cssProperty = styleProperty.replace(/([A-Z])/g, "-$1").toLowerCase(); var computedStyle = window.getComputedStyle(el, ""...
[ "function", "(", "el", ",", "styleProperty", ")", "{", "if", "(", "el", ".", "currentStyle", ")", "{", "return", "el", ".", "currentStyle", "[", "styleProperty", "]", ";", "}", "else", "if", "(", "window", ".", "getComputedStyle", ")", "{", "var", "css...
Retrieve the computed style from a specified element. @param el @param styleProperty @return The computed style value. @type String
[ "Retrieve", "the", "computed", "style", "from", "a", "specified", "element", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L11180-L11190
13,685
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(p, s){ s = s || window.location.search; if(!s){ return null; } if(!(s.indexOf(p+'=')+1)){ return null; } return s.split(p+'=')[1].split('&')[0]; }
javascript
function(p, s){ s = s || window.location.search; if(!s){ return null; } if(!(s.indexOf(p+'=')+1)){ return null; } return s.split(p+'=')[1].split('&')[0]; }
[ "function", "(", "p", ",", "s", ")", "{", "s", "=", "s", "||", "window", ".", "location", ".", "search", ";", "if", "(", "!", "s", ")", "{", "return", "null", ";", "}", "if", "(", "!", "(", "s", ".", "indexOf", "(", "p", "+", "'='", ")", ...
Retrieve a GET parameter from the window.location. Type casting is not performed. @param {String} p The param value to retrieve. @param {String} s Optional string to search through instead of window.location.search @return {String || null} The string value or null if it does not exist.
[ "Retrieve", "a", "GET", "parameter", "from", "the", "window", ".", "location", ".", "Type", "casting", "is", "not", "performed", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L11198-L11207
13,686
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(rgb){ var parts = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); var hex = (parts[1]<<16|parts[2]<<8|parts[3]).toString(16); return "#"+Array(6-hex.length).concat([hex]).toString().replace(/,/g, 0); }
javascript
function(rgb){ var parts = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); var hex = (parts[1]<<16|parts[2]<<8|parts[3]).toString(16); return "#"+Array(6-hex.length).concat([hex]).toString().replace(/,/g, 0); }
[ "function", "(", "rgb", ")", "{", "var", "parts", "=", "rgb", ".", "match", "(", "/", "^rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)$", "/", ")", ";", "var", "hex", "=", "(", "parts", "[", "1", "]", "<<", "16", "|", "parts", "[", "2", "]", "<<", "8", "|",...
Take an RGB value and convert to HEX equivalent. @param {String} rgb A RGB value following rgb(XXX, XXX, XXX) convention. @type String @return A HEX equivalent for a given RGB value with a leading '#' character.
[ "Take", "an", "RGB", "value", "and", "convert", "to", "HEX", "equivalent", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L11216-L11220
13,687
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(target, innerHTML) { /*@cc_on //innerHTML is faster for IE target.innerHTML = innerHTML; return target; @*/ var targetClone = target.cloneNode(false); targetClone.innerHTML = innerHTML; target.parentNode.replaceChild(ta...
javascript
function(target, innerHTML) { /*@cc_on //innerHTML is faster for IE target.innerHTML = innerHTML; return target; @*/ var targetClone = target.cloneNode(false); targetClone.innerHTML = innerHTML; target.parentNode.replaceChild(ta...
[ "function", "(", "target", ",", "innerHTML", ")", "{", "/*@cc_on //innerHTML is faster for IE\n target.innerHTML = innerHTML;\n return target;\n @*/", "var", "targetClone", "=", "target", ".", "cloneNode", "(", "false", ")", ";", "targetCl...
innerHTML substitute when it is not fast enough. @param {HTMLObject} target The target DOM element to replace innerHTML content with. @param {String} innerHTML The innerHTML string to add. @return {HTMLObject} The reference to the target DOM element as it may have been cloned and removed.
[ "innerHTML", "substitute", "when", "it", "is", "not", "fast", "enough", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L11251-L11260
13,688
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(q, isUserEntered) { var workingQ = '' + q; workingQ = workingQ.replace(this.reLTrim, '').replace(this.reRNormalize, ' '); if (workingQ.substring(0, 1) == '|') { return q; } // this is specific to the case where searchstring = 'search ...
javascript
function(q, isUserEntered) { var workingQ = '' + q; workingQ = workingQ.replace(this.reLTrim, '').replace(this.reRNormalize, ' '); if (workingQ.substring(0, 1) == '|') { return q; } // this is specific to the case where searchstring = 'search ...
[ "function", "(", "q", ",", "isUserEntered", ")", "{", "var", "workingQ", "=", "''", "+", "q", ";", "workingQ", "=", "workingQ", ".", "replace", "(", "this", ".", "reLTrim", ",", "''", ")", ".", "replace", "(", "this", ".", "reRNormalize", ",", "' '",...
Returns a fully qualified search string by prepending the 'search' command of unqualified searches. This method deems strings as unqualified if it does not start with a | or 'search ' @param {boolean} isUserEntered Indicates if 'q' is expected to be unqualified
[ "Returns", "a", "fully", "qualified", "search", "string", "by", "prepending", "the", "search", "command", "of", "unqualified", "searches", ".", "This", "method", "deems", "strings", "as", "unqualified", "if", "it", "does", "not", "start", "with", "a", "|", "...
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L11313-L11328
13,689
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(q) { var workingQ = '' + q; workingQ = workingQ.replace(this.reLTrimCommand, ''); if (workingQ.substring(0, 7) == 'search ') { return workingQ.substring(7).replace(this.reLTrimCommand, ''); } return q; }
javascript
function(q) { var workingQ = '' + q; workingQ = workingQ.replace(this.reLTrimCommand, ''); if (workingQ.substring(0, 7) == 'search ') { return workingQ.substring(7).replace(this.reLTrimCommand, ''); } return q; }
[ "function", "(", "q", ")", "{", "var", "workingQ", "=", "''", "+", "q", ";", "workingQ", "=", "workingQ", ".", "replace", "(", "this", ".", "reLTrimCommand", ",", "''", ")", ";", "if", "(", "workingQ", ".", "substring", "(", "0", ",", "7", ")", "...
Returns an unqualified search string by removing any leading 'search ' command. This method does a simple search at the beginning of the search.
[ "Returns", "an", "unqualified", "search", "string", "by", "removing", "any", "leading", "search", "command", ".", "This", "method", "does", "a", "simple", "search", "at", "the", "beginning", "of", "the", "search", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L11335-L11342
13,690
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(strList) { if (typeof(strList) != 'string' || !strList) return []; var items = []; var field_name_buffer = []; var inquote = false; var str = $.trim(strList); for (var i=0,j=str.length; i<j; i++) { if (str.charAt(i) == '\\'...
javascript
function(strList) { if (typeof(strList) != 'string' || !strList) return []; var items = []; var field_name_buffer = []; var inquote = false; var str = $.trim(strList); for (var i=0,j=str.length; i<j; i++) { if (str.charAt(i) == '\\'...
[ "function", "(", "strList", ")", "{", "if", "(", "typeof", "(", "strList", ")", "!=", "'string'", "||", "!", "strList", ")", "return", "[", "]", ";", "var", "items", "=", "[", "]", ";", "var", "field_name_buffer", "=", "[", "]", ";", "var", "inquot...
Deserializes a string into a field list.
[ "Deserializes", "a", "string", "into", "a", "field", "list", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L11347-L11389
13,691
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(obj1, obj2){ if(obj1 instanceof Array && obj2 instanceof Array){ if(obj1.length!==obj2.length){ return false; }else{ for(var i=0; i<obj1.length; i++){ if(!this....
javascript
function(obj1, obj2){ if(obj1 instanceof Array && obj2 instanceof Array){ if(obj1.length!==obj2.length){ return false; }else{ for(var i=0; i<obj1.length; i++){ if(!this....
[ "function", "(", "obj1", ",", "obj2", ")", "{", "if", "(", "obj1", "instanceof", "Array", "&&", "obj2", "instanceof", "Array", ")", "{", "if", "(", "obj1", ".", "length", "!==", "obj2", ".", "length", ")", "{", "return", "false", ";", "}", "else", ...
Compare the likeness of two objects. Please use with discretion.
[ "Compare", "the", "likeness", "of", "two", "objects", ".", "Please", "use", "with", "discretion", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L11429-L11467
13,692
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(){ var self = this, startTime = null, stopTime = null, times = []; var isSet = function(prop){ return (prop==null)?false:true; }; var isStarted = function(){ return isSet(startTime); ...
javascript
function(){ var self = this, startTime = null, stopTime = null, times = []; var isSet = function(prop){ return (prop==null)?false:true; }; var isStarted = function(){ return isSet(startTime); ...
[ "function", "(", ")", "{", "var", "self", "=", "this", ",", "startTime", "=", "null", ",", "stopTime", "=", "null", ",", "times", "=", "[", "]", ";", "var", "isSet", "=", "function", "(", "prop", ")", "{", "return", "(", "prop", "==", "null", ")"...
Stop watch class.
[ "Stop", "watch", "class", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L11471-L11530
13,693
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(string, maxLength) { if (!string) return string; if (maxLength < 1) return string; if (string.length <= maxLength) return string; if (maxLength == 1) return string.substring(0,1) + '...'; var midpoint = Math.ceil(string.length / 2); var t...
javascript
function(string, maxLength) { if (!string) return string; if (maxLength < 1) return string; if (string.length <= maxLength) return string; if (maxLength == 1) return string.substring(0,1) + '...'; var midpoint = Math.ceil(string.length / 2); var t...
[ "function", "(", "string", ",", "maxLength", ")", "{", "if", "(", "!", "string", ")", "return", "string", ";", "if", "(", "maxLength", "<", "1", ")", "return", "string", ";", "if", "(", "string", ".", "length", "<=", "maxLength", ")", "return", "stri...
Returns a string trimmed to maxLength by removing characters from the middle of the string and replacing with ellipses. Ex: Splunk.util.smartTrim('1234567890', 5) ==> '12...890'
[ "Returns", "a", "string", "trimmed", "to", "maxLength", "by", "removing", "characters", "from", "the", "middle", "of", "the", "string", "and", "replacing", "with", "ellipses", "." ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L11543-L11554
13,694
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
function(fragment, reg, value) { if (typeof fragment == 'string') { if (fragment.match(reg)) { fragment = fragment.replace(reg, value); } return fragment; } else if (typeof fragment == "function") { r...
javascript
function(fragment, reg, value) { if (typeof fragment == 'string') { if (fragment.match(reg)) { fragment = fragment.replace(reg, value); } return fragment; } else if (typeof fragment == "function") { r...
[ "function", "(", "fragment", ",", "reg", ",", "value", ")", "{", "if", "(", "typeof", "fragment", "==", "'string'", ")", "{", "if", "(", "fragment", ".", "match", "(", "reg", ")", ")", "{", "fragment", "=", "fragment", ".", "replace", "(", "reg", "...
walked through the entirety of fragment to all levels of nesting and will replace all matches of the given single regex with the given single value. replacement will occur in both keys and values.
[ "walked", "through", "the", "entirety", "of", "fragment", "to", "all", "levels", "of", "nesting", "and", "will", "replace", "all", "matches", "of", "the", "given", "single", "regex", "with", "the", "given", "single", "value", ".", "replacement", "will", "occ...
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L11611-L11645
13,695
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
extend
function extend(a, b) { var n; if (!a) { a = {}; } for (n in b) { a[n] = b[n]; } return a; }
javascript
function extend(a, b) { var n; if (!a) { a = {}; } for (n in b) { a[n] = b[n]; } return a; }
[ "function", "extend", "(", "a", ",", "b", ")", "{", "var", "n", ";", "if", "(", "!", "a", ")", "{", "a", "=", "{", "}", ";", "}", "for", "(", "n", "in", "b", ")", "{", "a", "[", "n", "]", "=", "b", "[", "n", "]", ";", "}", "return", ...
Extend an object with the members of another @param {Object} a The object to be extended @param {Object} b The object to add to the first one
[ "Extend", "an", "object", "with", "the", "members", "of", "another" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L12123-L12132
13,696
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
erase
function erase(arr, item) { var i = arr.length; while (i--) { if (arr[i] === item) { arr.splice(i, 1); break; } } //return arr; }
javascript
function erase(arr, item) { var i = arr.length; while (i--) { if (arr[i] === item) { arr.splice(i, 1); break; } } //return arr; }
[ "function", "erase", "(", "arr", ",", "item", ")", "{", "var", "i", "=", "arr", ".", "length", ";", "while", "(", "i", "--", ")", "{", "if", "(", "arr", "[", "i", "]", "===", "item", ")", "{", "arr", ".", "splice", "(", "i", ",", "1", ")", ...
Remove last occurence of an item from an array @param {Array} arr @param {Mixed} item
[ "Remove", "last", "occurence", "of", "an", "item", "from", "an", "array" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L12186-L12195
13,697
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
attr
function attr(elem, prop, value) { var key, setAttribute = 'setAttribute', ret; // if the prop is a string if (isString(prop)) { // set the value if (defined(value)) { elem[setAttribute](prop, value); // get the value } else if (elem && elem.getAttribute) { // elem not defined when pri...
javascript
function attr(elem, prop, value) { var key, setAttribute = 'setAttribute', ret; // if the prop is a string if (isString(prop)) { // set the value if (defined(value)) { elem[setAttribute](prop, value); // get the value } else if (elem && elem.getAttribute) { // elem not defined when pri...
[ "function", "attr", "(", "elem", ",", "prop", ",", "value", ")", "{", "var", "key", ",", "setAttribute", "=", "'setAttribute'", ",", "ret", ";", "// if the prop is a string\r", "if", "(", "isString", "(", "prop", ")", ")", "{", "// set the value\r", "if", ...
Set or get an attribute or an object of attributes. Can't use jQuery attr because it attempts to set expando properties on the SVG element, which is not allowed. @param {Object} elem The DOM element to receive the attribute(s) @param {String|Object} prop The property or an abject of key-value pairs @param {String} val...
[ "Set", "or", "get", "an", "attribute", "or", "an", "object", "of", "attributes", ".", "Can", "t", "use", "jQuery", "attr", "because", "it", "attempts", "to", "set", "expando", "properties", "on", "the", "SVG", "element", "which", "is", "not", "allowed", ...
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L12213-L12237
13,698
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
css
function css(el, styles) { if (isIE) { if (styles && styles.opacity !== UNDEFINED) { styles.filter = 'alpha(opacity=' + (styles.opacity * 100) + ')'; } } extend(el.style, styles); }
javascript
function css(el, styles) { if (isIE) { if (styles && styles.opacity !== UNDEFINED) { styles.filter = 'alpha(opacity=' + (styles.opacity * 100) + ')'; } } extend(el.style, styles); }
[ "function", "css", "(", "el", ",", "styles", ")", "{", "if", "(", "isIE", ")", "{", "if", "(", "styles", "&&", "styles", ".", "opacity", "!==", "UNDEFINED", ")", "{", "styles", ".", "filter", "=", "'alpha(opacity='", "+", "(", "styles", ".", "opacity...
Set CSS on a given element @param {Object} el @param {Object} styles Style object with camel case property names
[ "Set", "CSS", "on", "a", "given", "element" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L12268-L12275
13,699
splunk/splunk-sdk-javascript
client/splunk.ui.charting.js
createElement
function createElement(tag, attribs, styles, parent, nopad) { var el = doc.createElement(tag); if (attribs) { extend(el, attribs); } if (nopad) { css(el, {padding: 0, border: NONE, margin: 0}); } if (styles) { css(el, styles); } if (parent) { parent.appendChild(el); } return el; }
javascript
function createElement(tag, attribs, styles, parent, nopad) { var el = doc.createElement(tag); if (attribs) { extend(el, attribs); } if (nopad) { css(el, {padding: 0, border: NONE, margin: 0}); } if (styles) { css(el, styles); } if (parent) { parent.appendChild(el); } return el; }
[ "function", "createElement", "(", "tag", ",", "attribs", ",", "styles", ",", "parent", ",", "nopad", ")", "{", "var", "el", "=", "doc", ".", "createElement", "(", "tag", ")", ";", "if", "(", "attribs", ")", "{", "extend", "(", "el", ",", "attribs", ...
Utility function to create element with attributes and styles @param {Object} tag @param {Object} attribs @param {Object} styles @param {Object} parent @param {Object} nopad
[ "Utility", "function", "to", "create", "element", "with", "attributes", "and", "styles" ]
9aec5443860926654c2ab8ee3bf198a407c53b07
https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L12285-L12300