id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
6,600
imba/imba
lib/jison/jison.js
addSymbol
function addSymbol (s) { if (s && !symbols_[s]) { symbols_[s] = ++symbolId; symbols.push(s); } }
javascript
function addSymbol (s) { if (s && !symbols_[s]) { symbols_[s] = ++symbolId; symbols.push(s); } }
[ "function", "addSymbol", "(", "s", ")", "{", "if", "(", "s", "&&", "!", "symbols_", "[", "s", "]", ")", "{", "symbols_", "[", "s", "]", "=", "++", "symbolId", ";", "symbols", ".", "push", "(", "s", ")", ";", "}", "}" ]
has error recovery
[ "has", "error", "recovery" ]
cbf24f7ba961c33c105a8fd5a9fff18286d119bb
https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/jison/jison.js#L191-L196
6,601
imba/imba
lib/jison/jison.js
tokenStackLex
function tokenStackLex() { var token; token = tstack.pop() || lexer.lex() || EOF; // if token isn't its numeric value, convert if (typeof token !== 'number') { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self.symbols_[toke...
javascript
function tokenStackLex() { var token; token = tstack.pop() || lexer.lex() || EOF; // if token isn't its numeric value, convert if (typeof token !== 'number') { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self.symbols_[toke...
[ "function", "tokenStackLex", "(", ")", "{", "var", "token", ";", "token", "=", "tstack", ".", "pop", "(", ")", "||", "lexer", ".", "lex", "(", ")", "||", "EOF", ";", "// if token isn't its numeric value, convert", "if", "(", "typeof", "token", "!==", "'num...
lex function that supports token stacks
[ "lex", "function", "that", "supports", "token", "stacks" ]
cbf24f7ba961c33c105a8fd5a9fff18286d119bb
https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/jison/jison.js#L1002-L1014
6,602
imba/imba
lib/jison/jison.js
createVariable
function createVariable() { var id = nextVariableId++; var name = '$V'; do { name += variableTokens[id % variableTokensLength]; id = ~~(id / variableTokensLength); } while (id !== 0); return name; }
javascript
function createVariable() { var id = nextVariableId++; var name = '$V'; do { name += variableTokens[id % variableTokensLength]; id = ~~(id / variableTokensLength); } while (id !== 0); return name; }
[ "function", "createVariable", "(", ")", "{", "var", "id", "=", "nextVariableId", "++", ";", "var", "name", "=", "'$V'", ";", "do", "{", "name", "+=", "variableTokens", "[", "id", "%", "variableTokensLength", "]", ";", "id", "=", "~", "~", "(", "id", ...
Creates a variable with a unique name
[ "Creates", "a", "variable", "with", "a", "unique", "name" ]
cbf24f7ba961c33c105a8fd5a9fff18286d119bb
https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/jison/jison.js#L1139-L1149
6,603
imba/imba
lib/jison/jison.js
locateNearestErrorRecoveryRule
function locateNearestErrorRecoveryRule(state) { var stack_probe = stack.length - 1; var depth = 0; // try to recover from error for(;;) { // check for error recovery rule in this state if ((TERROR.toString()) in table[state]) { ...
javascript
function locateNearestErrorRecoveryRule(state) { var stack_probe = stack.length - 1; var depth = 0; // try to recover from error for(;;) { // check for error recovery rule in this state if ((TERROR.toString()) in table[state]) { ...
[ "function", "locateNearestErrorRecoveryRule", "(", "state", ")", "{", "var", "stack_probe", "=", "stack", ".", "length", "-", "1", ";", "var", "depth", "=", "0", ";", "// try to recover from error", "for", "(", ";", ";", ")", "{", "// check for error recovery ru...
Return the rule stack depth where the nearest error rule can be found. Return FALSE when no error recovery rule was found. we have no rules now
[ "Return", "the", "rule", "stack", "depth", "where", "the", "nearest", "error", "rule", "can", "be", "found", ".", "Return", "FALSE", "when", "no", "error", "recovery", "rule", "was", "found", ".", "we", "have", "no", "rules", "now" ]
cbf24f7ba961c33c105a8fd5a9fff18286d119bb
https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/jison/jison.js#L1291-L1308
6,604
imba/imba
lib/jison/jison.js
LALR_buildNewGrammar
function LALR_buildNewGrammar () { var self = this, newg = this.newg; this.states.forEach(function (state, i) { state.forEach(function (item) { if (item.dotPosition === 0) { // new symbols are a combination of state and transition symbol ...
javascript
function LALR_buildNewGrammar () { var self = this, newg = this.newg; this.states.forEach(function (state, i) { state.forEach(function (item) { if (item.dotPosition === 0) { // new symbols are a combination of state and transition symbol ...
[ "function", "LALR_buildNewGrammar", "(", ")", "{", "var", "self", "=", "this", ",", "newg", "=", "this", ".", "newg", ";", "this", ".", "states", ".", "forEach", "(", "function", "(", "state", ",", "i", ")", "{", "state", ".", "forEach", "(", "functi...
every disjoint reduction of a nonterminal becomes a produciton in G'
[ "every", "disjoint", "reduction", "of", "a", "nonterminal", "becomes", "a", "produciton", "in", "G" ]
cbf24f7ba961c33c105a8fd5a9fff18286d119bb
https://github.com/imba/imba/blob/cbf24f7ba961c33c105a8fd5a9fff18286d119bb/lib/jison/jison.js#L1516-L1547
6,605
imolorhe/altair
chrome-ext-files/js/background.js
focusTab
function focusTab(tabId) { var updateProperties = { "active": true }; chrome.tabs.update(tabId, updateProperties, function (tab) { }); }
javascript
function focusTab(tabId) { var updateProperties = { "active": true }; chrome.tabs.update(tabId, updateProperties, function (tab) { }); }
[ "function", "focusTab", "(", "tabId", ")", "{", "var", "updateProperties", "=", "{", "\"active\"", ":", "true", "}", ";", "chrome", ".", "tabs", ".", "update", "(", "tabId", ",", "updateProperties", ",", "function", "(", "tab", ")", "{", "}", ")", ";",...
Focus on the open extension tab
[ "Focus", "on", "the", "open", "extension", "tab" ]
d228f435ad05de9fca673b6c67f3cc995f348284
https://github.com/imolorhe/altair/blob/d228f435ad05de9fca673b6c67f3cc995f348284/chrome-ext-files/js/background.js#L12-L15
6,606
imolorhe/altair
chrome-ext-files/js/options.js
save_options
function save_options() { var showChangeLog = document.getElementById('show_changelog').checked; chrome.storage.sync.set({ showChangeLog: showChangeLog }, function () { // Update status to let user know options were saved. var status = document.getElementById('status'); status.textContent = 'Optio...
javascript
function save_options() { var showChangeLog = document.getElementById('show_changelog').checked; chrome.storage.sync.set({ showChangeLog: showChangeLog }, function () { // Update status to let user know options were saved. var status = document.getElementById('status'); status.textContent = 'Optio...
[ "function", "save_options", "(", ")", "{", "var", "showChangeLog", "=", "document", ".", "getElementById", "(", "'show_changelog'", ")", ".", "checked", ";", "chrome", ".", "storage", ".", "sync", ".", "set", "(", "{", "showChangeLog", ":", "showChangeLog", ...
Saves options to chrome.storage
[ "Saves", "options", "to", "chrome", ".", "storage" ]
d228f435ad05de9fca673b6c67f3cc995f348284
https://github.com/imolorhe/altair/blob/d228f435ad05de9fca673b6c67f3cc995f348284/chrome-ext-files/js/options.js#L2-L14
6,607
imolorhe/altair
chrome-ext-files/js/options.js
restore_options
function restore_options() { // Use default value showChangeLog = true. chrome.storage.sync.get({ showChangeLog: true }, function (items) { document.getElementById('show_changelog').checked = items.showChangeLog; }); }
javascript
function restore_options() { // Use default value showChangeLog = true. chrome.storage.sync.get({ showChangeLog: true }, function (items) { document.getElementById('show_changelog').checked = items.showChangeLog; }); }
[ "function", "restore_options", "(", ")", "{", "// Use default value showChangeLog = true.", "chrome", ".", "storage", ".", "sync", ".", "get", "(", "{", "showChangeLog", ":", "true", "}", ",", "function", "(", "items", ")", "{", "document", ".", "getElementById"...
Restores select box and checkbox state using the preferences stored in chrome.storage.
[ "Restores", "select", "box", "and", "checkbox", "state", "using", "the", "preferences", "stored", "in", "chrome", ".", "storage", "." ]
d228f435ad05de9fca673b6c67f3cc995f348284
https://github.com/imolorhe/altair/blob/d228f435ad05de9fca673b6c67f3cc995f348284/chrome-ext-files/js/options.js#L18-L25
6,608
heroku/cli
packages/addons-v5/lib/util.js
style
function style (s, t) { if (!t) return (text) => style(s, text) return cli.color[styles[s] || s](t) }
javascript
function style (s, t) { if (!t) return (text) => style(s, text) return cli.color[styles[s] || s](t) }
[ "function", "style", "(", "s", ",", "t", ")", "{", "if", "(", "!", "t", ")", "return", "(", "text", ")", "=>", "style", "(", "s", ",", "text", ")", "return", "cli", ".", "color", "[", "styles", "[", "s", "]", "||", "s", "]", "(", "t", ")", ...
style given text or return a function that styles text according to provided style
[ "style", "given", "text", "or", "return", "a", "function", "that", "styles", "text", "according", "to", "provided", "style" ]
4d4f88817f9812f9a25d529863270155be3cda23
https://github.com/heroku/cli/blob/4d4f88817f9812f9a25d529863270155be3cda23/packages/addons-v5/lib/util.js#L14-L17
6,609
pa11y/pa11y
lib/reporter.js
buildReporter
function buildReporter(methods) { return { supports: methods.supports, begin: buildReporterMethod(methods.begin), results: buildReporterMethod(methods.results), log: { debug: buildReporterMethod(methods.debug), error: buildReporterMethod(methods.error, 'error'), info: buildReporterMethod(methods.info)...
javascript
function buildReporter(methods) { return { supports: methods.supports, begin: buildReporterMethod(methods.begin), results: buildReporterMethod(methods.results), log: { debug: buildReporterMethod(methods.debug), error: buildReporterMethod(methods.error, 'error'), info: buildReporterMethod(methods.info)...
[ "function", "buildReporter", "(", "methods", ")", "{", "return", "{", "supports", ":", "methods", ".", "supports", ",", "begin", ":", "buildReporterMethod", "(", "methods", ".", "begin", ")", ",", "results", ":", "buildReporterMethod", "(", "methods", ".", "...
Build a Pa11y reporter. @private @param {Object} methods - The reporter methods. @returns {Promise} Returns a promise which resolves with the new reporter.
[ "Build", "a", "Pa11y", "reporter", "." ]
ddcbb3696a43f775e32399bbafeea7f12c9d6cbb
https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/reporter.js#L11-L22
6,610
pa11y/pa11y
lib/reporter.js
buildReporterMethod
function buildReporterMethod(method, consoleMethod = 'log') { if (typeof method !== 'function') { method = () => {}; } return async input => { const output = await method(input); if (output) { console[consoleMethod](output); } }; }
javascript
function buildReporterMethod(method, consoleMethod = 'log') { if (typeof method !== 'function') { method = () => {}; } return async input => { const output = await method(input); if (output) { console[consoleMethod](output); } }; }
[ "function", "buildReporterMethod", "(", "method", ",", "consoleMethod", "=", "'log'", ")", "{", "if", "(", "typeof", "method", "!==", "'function'", ")", "{", "method", "=", "(", ")", "=>", "{", "}", ";", "}", "return", "async", "input", "=>", "{", "con...
Build a Pa11y reporter method, making it async and only outputting when actual output is returned. @private @param {Function} method - The reporter method to build. @param {String} [consoleMethod='log'] - The console method to use in reporting. @returns {Function} Returns a built async reporter method.
[ "Build", "a", "Pa11y", "reporter", "method", "making", "it", "async", "and", "only", "outputting", "when", "actual", "output", "is", "returned", "." ]
ddcbb3696a43f775e32399bbafeea7f12c9d6cbb
https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/reporter.js#L32-L42
6,611
pa11y/pa11y
lib/action.js
isValidAction
function isValidAction(actionString) { return module.exports.actions.some(foundAction => { return foundAction.match.test(actionString); }); }
javascript
function isValidAction(actionString) { return module.exports.actions.some(foundAction => { return foundAction.match.test(actionString); }); }
[ "function", "isValidAction", "(", "actionString", ")", "{", "return", "module", ".", "exports", ".", "actions", ".", "some", "(", "foundAction", "=>", "{", "return", "foundAction", ".", "match", ".", "test", "(", "actionString", ")", ";", "}", ")", ";", ...
Check whether an action string is valid. @public @param {String} actionString - The action string to validate. @returns {Boolean} Returns whether the action string is valid.
[ "Check", "whether", "an", "action", "string", "is", "valid", "." ]
ddcbb3696a43f775e32399bbafeea7f12c9d6cbb
https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/action.js#L39-L43
6,612
pa11y/pa11y
lib/pa11y.js
pa11y
async function pa11y(url, options = {}, callback) { const state = {}; /* eslint-disable prefer-rest-params */ // Check for presence of a callback function if (typeof arguments[arguments.length - 1] === 'function') { callback = arguments[arguments.length - 1]; } else { callback = undefined; } /* eslint-enabl...
javascript
async function pa11y(url, options = {}, callback) { const state = {}; /* eslint-disable prefer-rest-params */ // Check for presence of a callback function if (typeof arguments[arguments.length - 1] === 'function') { callback = arguments[arguments.length - 1]; } else { callback = undefined; } /* eslint-enabl...
[ "async", "function", "pa11y", "(", "url", ",", "options", "=", "{", "}", ",", "callback", ")", "{", "const", "state", "=", "{", "}", ";", "/* eslint-disable prefer-rest-params */", "// Check for presence of a callback function", "if", "(", "typeof", "arguments", "...
Run accessibility tests on a web page. @public @param {String} [url] - The URL to run tests against. @param {Object} [options={}] - Options to change the way tests run. @param {Function} [callback] - An optional callback to use instead of promises. @returns {Promise} Returns a promise which resolves with a results obje...
[ "Run", "accessibility", "tests", "on", "a", "web", "page", "." ]
ddcbb3696a43f775e32399bbafeea7f12c9d6cbb
https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/pa11y.js#L24-L77
6,613
pa11y/pa11y
lib/pa11y.js
defaultOptions
function defaultOptions(options) { options = extend({}, pa11y.defaults, options); options.ignore = options.ignore.map(ignored => ignored.toLowerCase()); if (!options.includeNotices) { options.ignore.push('notice'); } if (!options.includeWarnings) { options.ignore.push('warning'); } return options; }
javascript
function defaultOptions(options) { options = extend({}, pa11y.defaults, options); options.ignore = options.ignore.map(ignored => ignored.toLowerCase()); if (!options.includeNotices) { options.ignore.push('notice'); } if (!options.includeWarnings) { options.ignore.push('warning'); } return options; }
[ "function", "defaultOptions", "(", "options", ")", "{", "options", "=", "extend", "(", "{", "}", ",", "pa11y", ".", "defaults", ",", "options", ")", ";", "options", ".", "ignore", "=", "options", ".", "ignore", ".", "map", "(", "ignored", "=>", "ignore...
Default the passed in options using Pa11y's defaults. @private @param {Object} [options={}] - The options to apply defaults to. @returns {Object} Returns the defaulted options.
[ "Default", "the", "passed", "in", "options", "using", "Pa11y", "s", "defaults", "." ]
ddcbb3696a43f775e32399bbafeea7f12c9d6cbb
https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/pa11y.js#L258-L268
6,614
pa11y/pa11y
lib/pa11y.js
verifyOptions
function verifyOptions(options) { if (!pa11y.allowedStandards.includes(options.standard)) { throw new Error(`Standard must be one of ${pa11y.allowedStandards.join(', ')}`); } if (options.page && !options.browser) { throw new Error('The page option must only be set alongside the browser option'); } }
javascript
function verifyOptions(options) { if (!pa11y.allowedStandards.includes(options.standard)) { throw new Error(`Standard must be one of ${pa11y.allowedStandards.join(', ')}`); } if (options.page && !options.browser) { throw new Error('The page option must only be set alongside the browser option'); } }
[ "function", "verifyOptions", "(", "options", ")", "{", "if", "(", "!", "pa11y", ".", "allowedStandards", ".", "includes", "(", "options", ".", "standard", ")", ")", "{", "throw", "new", "Error", "(", "`", "${", "pa11y", ".", "allowedStandards", ".", "joi...
Verify that passed in options are valid. @private @param {Object} [options={}] - The options to verify. @returns {Undefined} Returns nothing. @throws {Error} Throws if options are not valid.
[ "Verify", "that", "passed", "in", "options", "are", "valid", "." ]
ddcbb3696a43f775e32399bbafeea7f12c9d6cbb
https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/pa11y.js#L277-L284
6,615
pa11y/pa11y
lib/runner.js
configureHtmlCodeSniffer
function configureHtmlCodeSniffer() { if (options.rules.length && options.standard !== 'Section508') { for (const rule of options.rules) { if (window.HTMLCS_WCAG2AAA.sniffs.includes(rule)) { window[`HTMLCS_${options.standard}`].sniffs[0].include.push(rule); } else { throw new Error(`${rule}...
javascript
function configureHtmlCodeSniffer() { if (options.rules.length && options.standard !== 'Section508') { for (const rule of options.rules) { if (window.HTMLCS_WCAG2AAA.sniffs.includes(rule)) { window[`HTMLCS_${options.standard}`].sniffs[0].include.push(rule); } else { throw new Error(`${rule}...
[ "function", "configureHtmlCodeSniffer", "(", ")", "{", "if", "(", "options", ".", "rules", ".", "length", "&&", "options", ".", "standard", "!==", "'Section508'", ")", "{", "for", "(", "const", "rule", "of", "options", ".", "rules", ")", "{", "if", "(", ...
Configure HTML CodeSniffer. @private @returns {Undefined} Returns nothing.
[ "Configure", "HTML", "CodeSniffer", "." ]
ddcbb3696a43f775e32399bbafeea7f12c9d6cbb
https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/runner.js#L54-L64
6,616
pa11y/pa11y
lib/runner.js
runHtmlCodeSniffer
function runHtmlCodeSniffer() { return new Promise((resolve, reject) => { window.HTMLCS.process(options.standard, window.document, error => { if (error) { return reject(error); } resolve(window.HTMLCS.getMessages()); }); }); }
javascript
function runHtmlCodeSniffer() { return new Promise((resolve, reject) => { window.HTMLCS.process(options.standard, window.document, error => { if (error) { return reject(error); } resolve(window.HTMLCS.getMessages()); }); }); }
[ "function", "runHtmlCodeSniffer", "(", ")", "{", "return", "new", "Promise", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "window", ".", "HTMLCS", ".", "process", "(", "options", ".", "standard", ",", "window", ".", "document", ",", "error", "=>",...
Run HTML CodeSniffer on the current page. @private @returns {Promise} Returns a promise which resolves with HTML CodeSniffer issues.
[ "Run", "HTML", "CodeSniffer", "on", "the", "current", "page", "." ]
ddcbb3696a43f775e32399bbafeea7f12c9d6cbb
https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/runner.js#L71-L80
6,617
pa11y/pa11y
lib/runner.js
processIssues
function processIssues(issues) { if (options.rootElement) { issues = issues.filter(isIssueInTestArea); } if (options.hideElements) { issues = issues.filter(isElementOutsideHiddenArea); } return issues.map(processIssue).filter(isIssueNotIgnored); }
javascript
function processIssues(issues) { if (options.rootElement) { issues = issues.filter(isIssueInTestArea); } if (options.hideElements) { issues = issues.filter(isElementOutsideHiddenArea); } return issues.map(processIssue).filter(isIssueNotIgnored); }
[ "function", "processIssues", "(", "issues", ")", "{", "if", "(", "options", ".", "rootElement", ")", "{", "issues", "=", "issues", ".", "filter", "(", "isIssueInTestArea", ")", ";", "}", "if", "(", "options", ".", "hideElements", ")", "{", "issues", "=",...
Process HTML CodeSniffer issues. @private @param {Array} issues - An array of HTML CodeSniffer issues to process. @returns {Array} Returns an array of processed issues.
[ "Process", "HTML", "CodeSniffer", "issues", "." ]
ddcbb3696a43f775e32399bbafeea7f12c9d6cbb
https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/runner.js#L88-L96
6,618
pa11y/pa11y
lib/runner.js
processIssue
function processIssue(issue) { return { code: issue.code, context: processIssueHtml(issue.element), message: issue.msg, type: issueTypeMap[issue.type] || 'unknown', typeCode: issue.type, selector: getCssSelectorForElement(issue.element) }; }
javascript
function processIssue(issue) { return { code: issue.code, context: processIssueHtml(issue.element), message: issue.msg, type: issueTypeMap[issue.type] || 'unknown', typeCode: issue.type, selector: getCssSelectorForElement(issue.element) }; }
[ "function", "processIssue", "(", "issue", ")", "{", "return", "{", "code", ":", "issue", ".", "code", ",", "context", ":", "processIssueHtml", "(", "issue", ".", "element", ")", ",", "message", ":", "issue", ".", "msg", ",", "type", ":", "issueTypeMap", ...
Process a HTML CodeSniffer issue. @private @param {Object} issue - An HTML CodeSniffer issue to process. @returns {Object} Returns the processed issue.
[ "Process", "a", "HTML", "CodeSniffer", "issue", "." ]
ddcbb3696a43f775e32399bbafeea7f12c9d6cbb
https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/runner.js#L104-L113
6,619
pa11y/pa11y
lib/runner.js
processIssueHtml
function processIssueHtml(element) { let outerHTML = null; let innerHTML = null; if (!element.outerHTML) { return outerHTML; } outerHTML = element.outerHTML; if (element.innerHTML.length > 31) { innerHTML = `${element.innerHTML.substr(0, 31)}...`; outerHTML = outerHTML.replace(element.inne...
javascript
function processIssueHtml(element) { let outerHTML = null; let innerHTML = null; if (!element.outerHTML) { return outerHTML; } outerHTML = element.outerHTML; if (element.innerHTML.length > 31) { innerHTML = `${element.innerHTML.substr(0, 31)}...`; outerHTML = outerHTML.replace(element.inne...
[ "function", "processIssueHtml", "(", "element", ")", "{", "let", "outerHTML", "=", "null", ";", "let", "innerHTML", "=", "null", ";", "if", "(", "!", "element", ".", "outerHTML", ")", "{", "return", "outerHTML", ";", "}", "outerHTML", "=", "element", "."...
Get a short version of an element's outer HTML. @private @param {HTMLElement} element - An element to get short HTML for. @returns {String} Returns the short HTML as a string.
[ "Get", "a", "short", "version", "of", "an", "element", "s", "outer", "HTML", "." ]
ddcbb3696a43f775e32399bbafeea7f12c9d6cbb
https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/runner.js#L121-L136
6,620
pa11y/pa11y
lib/runner.js
getCssSelectorForElement
function getCssSelectorForElement(element, selectorParts = []) { if (isElementNode(element)) { const identifier = buildElementIdentifier(element); selectorParts.unshift(identifier); if (!element.id && element.parentNode) { return getCssSelectorForElement(element.parentNode, selectorParts); } ...
javascript
function getCssSelectorForElement(element, selectorParts = []) { if (isElementNode(element)) { const identifier = buildElementIdentifier(element); selectorParts.unshift(identifier); if (!element.id && element.parentNode) { return getCssSelectorForElement(element.parentNode, selectorParts); } ...
[ "function", "getCssSelectorForElement", "(", "element", ",", "selectorParts", "=", "[", "]", ")", "{", "if", "(", "isElementNode", "(", "element", ")", ")", "{", "const", "identifier", "=", "buildElementIdentifier", "(", "element", ")", ";", "selectorParts", "...
Get a CSS selector for an element. @private @param {HTMLElement} element - An element to get a selector for. @param {Array} [selectorParts=[]] - Internal parameter used for recursion. @returns {String} Returns the CSS selector as a string.
[ "Get", "a", "CSS", "selector", "for", "an", "element", "." ]
ddcbb3696a43f775e32399bbafeea7f12c9d6cbb
https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/runner.js#L145-L154
6,621
pa11y/pa11y
lib/runner.js
buildElementIdentifier
function buildElementIdentifier(element) { if (element.id) { return `#${element.id}`; } let identifier = element.tagName.toLowerCase(); if (!element.parentNode) { return identifier; } const siblings = getSiblings(element); const childIndex = siblings.indexOf(element); if (!isOnlySiblingO...
javascript
function buildElementIdentifier(element) { if (element.id) { return `#${element.id}`; } let identifier = element.tagName.toLowerCase(); if (!element.parentNode) { return identifier; } const siblings = getSiblings(element); const childIndex = siblings.indexOf(element); if (!isOnlySiblingO...
[ "function", "buildElementIdentifier", "(", "element", ")", "{", "if", "(", "element", ".", "id", ")", "{", "return", "`", "${", "element", ".", "id", "}", "`", ";", "}", "let", "identifier", "=", "element", ".", "tagName", ".", "toLowerCase", "(", ")",...
Build a unique CSS element identifier. @private @param {HTMLElement} element - An element to get a CSS element identifier for. @returns {String} Returns the CSS element identifier as a string.
[ "Build", "a", "unique", "CSS", "element", "identifier", "." ]
ddcbb3696a43f775e32399bbafeea7f12c9d6cbb
https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/runner.js#L162-L176
6,622
pa11y/pa11y
lib/runner.js
isOnlySiblingOfType
function isOnlySiblingOfType(element, siblings) { const siblingsOfType = siblings.filter(sibling => { return (sibling.tagName === element.tagName); }); return (siblingsOfType.length <= 1); }
javascript
function isOnlySiblingOfType(element, siblings) { const siblingsOfType = siblings.filter(sibling => { return (sibling.tagName === element.tagName); }); return (siblingsOfType.length <= 1); }
[ "function", "isOnlySiblingOfType", "(", "element", ",", "siblings", ")", "{", "const", "siblingsOfType", "=", "siblings", ".", "filter", "(", "sibling", "=>", "{", "return", "(", "sibling", ".", "tagName", "===", "element", ".", "tagName", ")", ";", "}", "...
Check whether an element is the only sibling of its type. @private @param {HTMLElement} element - An element to check siblings of. @param {Array} siblings - The siblings of the element. @returns {Boolean} Returns whether the element is the only sibling of its type.
[ "Check", "whether", "an", "element", "is", "the", "only", "sibling", "of", "its", "type", "." ]
ddcbb3696a43f775e32399bbafeea7f12c9d6cbb
https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/runner.js#L195-L200
6,623
pa11y/pa11y
lib/runner.js
isIssueNotIgnored
function isIssueNotIgnored(issue) { if (options.ignore.indexOf(issue.code.toLowerCase()) !== -1) { return false; } if (options.ignore.indexOf(issue.type) !== -1) { return false; } return true; }
javascript
function isIssueNotIgnored(issue) { if (options.ignore.indexOf(issue.code.toLowerCase()) !== -1) { return false; } if (options.ignore.indexOf(issue.type) !== -1) { return false; } return true; }
[ "function", "isIssueNotIgnored", "(", "issue", ")", "{", "if", "(", "options", ".", "ignore", ".", "indexOf", "(", "issue", ".", "code", ".", "toLowerCase", "(", ")", ")", "!==", "-", "1", ")", "{", "return", "false", ";", "}", "if", "(", "options", ...
Check whether an issue should be returned, and is not ignored. @private @param {Object} issue - The issue to check. @returns {Boolean} Returns whether the issue should be returned.
[ "Check", "whether", "an", "issue", "should", "be", "returned", "and", "is", "not", "ignored", "." ]
ddcbb3696a43f775e32399bbafeea7f12c9d6cbb
https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/runner.js#L218-L226
6,624
pa11y/pa11y
lib/runner.js
isElementOutsideHiddenArea
function isElementOutsideHiddenArea(issue) { const hiddenElements = [...window.document.querySelectorAll(options.hideElements)]; return !hiddenElements.some(hiddenElement => { return hiddenElement.contains(issue.element); }); }
javascript
function isElementOutsideHiddenArea(issue) { const hiddenElements = [...window.document.querySelectorAll(options.hideElements)]; return !hiddenElements.some(hiddenElement => { return hiddenElement.contains(issue.element); }); }
[ "function", "isElementOutsideHiddenArea", "(", "issue", ")", "{", "const", "hiddenElements", "=", "[", "...", "window", ".", "document", ".", "querySelectorAll", "(", "options", ".", "hideElements", ")", "]", ";", "return", "!", "hiddenElements", ".", "some", ...
Check whether an element is outside of all hidden selectors. @private @param {Object} issue - The issue to check. @returns {Boolean} Returns whether the issue is outside of a hidden area.
[ "Check", "whether", "an", "element", "is", "outside", "of", "all", "hidden", "selectors", "." ]
ddcbb3696a43f775e32399bbafeea7f12c9d6cbb
https://github.com/pa11y/pa11y/blob/ddcbb3696a43f775e32399bbafeea7f12c9d6cbb/lib/runner.js#L245-L250
6,625
expressjs/session
index.js
generate
function generate() { store.generate(req); originalId = req.sessionID; originalHash = hash(req.session); wrapmethods(req.session); }
javascript
function generate() { store.generate(req); originalId = req.sessionID; originalHash = hash(req.session); wrapmethods(req.session); }
[ "function", "generate", "(", ")", "{", "store", ".", "generate", "(", "req", ")", ";", "originalId", "=", "req", ".", "sessionID", ";", "originalHash", "=", "hash", "(", "req", ".", "session", ")", ";", "wrapmethods", "(", "req", ".", "session", ")", ...
generate the session
[ "generate", "the", "session" ]
327695e3d1dd4d7a5d3857f2afbb5852b7710213
https://github.com/expressjs/session/blob/327695e3d1dd4d7a5d3857f2afbb5852b7710213/index.js#L359-L364
6,626
expressjs/session
index.js
inflate
function inflate (req, sess) { store.createSession(req, sess) originalId = req.sessionID originalHash = hash(sess) if (!resaveSession) { savedHash = originalHash } wrapmethods(req.session) }
javascript
function inflate (req, sess) { store.createSession(req, sess) originalId = req.sessionID originalHash = hash(sess) if (!resaveSession) { savedHash = originalHash } wrapmethods(req.session) }
[ "function", "inflate", "(", "req", ",", "sess", ")", "{", "store", ".", "createSession", "(", "req", ",", "sess", ")", "originalId", "=", "req", ".", "sessionID", "originalHash", "=", "hash", "(", "sess", ")", "if", "(", "!", "resaveSession", ")", "{",...
inflate the session
[ "inflate", "the", "session" ]
327695e3d1dd4d7a5d3857f2afbb5852b7710213
https://github.com/expressjs/session/blob/327695e3d1dd4d7a5d3857f2afbb5852b7710213/index.js#L367-L377
6,627
expressjs/session
index.js
shouldSave
function shouldSave(req) { // cannot set cookie without a session ID if (typeof req.sessionID !== 'string') { debug('session ignored because of bogus req.sessionID %o', req.sessionID); return false; } return !saveUninitializedSession && cookieId !== req.sessionID ? isMod...
javascript
function shouldSave(req) { // cannot set cookie without a session ID if (typeof req.sessionID !== 'string') { debug('session ignored because of bogus req.sessionID %o', req.sessionID); return false; } return !saveUninitializedSession && cookieId !== req.sessionID ? isMod...
[ "function", "shouldSave", "(", "req", ")", "{", "// cannot set cookie without a session ID", "if", "(", "typeof", "req", ".", "sessionID", "!==", "'string'", ")", "{", "debug", "(", "'session ignored because of bogus req.sessionID %o'", ",", "req", ".", "sessionID", "...
determine if session should be saved to store
[ "determine", "if", "session", "should", "be", "saved", "to", "store" ]
327695e3d1dd4d7a5d3857f2afbb5852b7710213
https://github.com/expressjs/session/blob/327695e3d1dd4d7a5d3857f2afbb5852b7710213/index.js#L429-L439
6,628
expressjs/session
index.js
shouldTouch
function shouldTouch(req) { // cannot set cookie without a session ID if (typeof req.sessionID !== 'string') { debug('session ignored because of bogus req.sessionID %o', req.sessionID); return false; } return cookieId === req.sessionID && !shouldSave(req); }
javascript
function shouldTouch(req) { // cannot set cookie without a session ID if (typeof req.sessionID !== 'string') { debug('session ignored because of bogus req.sessionID %o', req.sessionID); return false; } return cookieId === req.sessionID && !shouldSave(req); }
[ "function", "shouldTouch", "(", "req", ")", "{", "// cannot set cookie without a session ID", "if", "(", "typeof", "req", ".", "sessionID", "!==", "'string'", ")", "{", "debug", "(", "'session ignored because of bogus req.sessionID %o'", ",", "req", ".", "sessionID", ...
determine if session should be touched
[ "determine", "if", "session", "should", "be", "touched" ]
327695e3d1dd4d7a5d3857f2afbb5852b7710213
https://github.com/expressjs/session/blob/327695e3d1dd4d7a5d3857f2afbb5852b7710213/index.js#L442-L450
6,629
expressjs/session
index.js
shouldSetCookie
function shouldSetCookie(req) { // cannot set cookie without a session ID if (typeof req.sessionID !== 'string') { return false; } return cookieId !== req.sessionID ? saveUninitializedSession || isModified(req.session) : rollingSessions || req.session.cookie.expires != n...
javascript
function shouldSetCookie(req) { // cannot set cookie without a session ID if (typeof req.sessionID !== 'string') { return false; } return cookieId !== req.sessionID ? saveUninitializedSession || isModified(req.session) : rollingSessions || req.session.cookie.expires != n...
[ "function", "shouldSetCookie", "(", "req", ")", "{", "// cannot set cookie without a session ID", "if", "(", "typeof", "req", ".", "sessionID", "!==", "'string'", ")", "{", "return", "false", ";", "}", "return", "cookieId", "!==", "req", ".", "sessionID", "?", ...
determine if cookie should be set on response
[ "determine", "if", "cookie", "should", "be", "set", "on", "response" ]
327695e3d1dd4d7a5d3857f2afbb5852b7710213
https://github.com/expressjs/session/blob/327695e3d1dd4d7a5d3857f2afbb5852b7710213/index.js#L453-L462
6,630
expressjs/session
index.js
hash
function hash(sess) { // serialize var str = JSON.stringify(sess, function (key, val) { // ignore sess.cookie property if (this === sess && key === 'cookie') { return } return val }) // hash return crypto .createHash('sha1') .update(str, 'utf8') .digest('hex') }
javascript
function hash(sess) { // serialize var str = JSON.stringify(sess, function (key, val) { // ignore sess.cookie property if (this === sess && key === 'cookie') { return } return val }) // hash return crypto .createHash('sha1') .update(str, 'utf8') .digest('hex') }
[ "function", "hash", "(", "sess", ")", "{", "// serialize", "var", "str", "=", "JSON", ".", "stringify", "(", "sess", ",", "function", "(", "key", ",", "val", ")", "{", "// ignore sess.cookie property", "if", "(", "this", "===", "sess", "&&", "key", "==="...
Hash the given `sess` object omitting changes to `.cookie`. @param {Object} sess @return {String} @private
[ "Hash", "the", "given", "sess", "object", "omitting", "changes", "to", ".", "cookie", "." ]
327695e3d1dd4d7a5d3857f2afbb5852b7710213
https://github.com/expressjs/session/blob/327695e3d1dd4d7a5d3857f2afbb5852b7710213/index.js#L585-L601
6,631
expressjs/session
index.js
issecure
function issecure(req, trustProxy) { // socket is https server if (req.connection && req.connection.encrypted) { return true; } // do not trust proxy if (trustProxy === false) { return false; } // no explicit trust; try req.secure from express if (trustProxy !== true) { return req.secure =...
javascript
function issecure(req, trustProxy) { // socket is https server if (req.connection && req.connection.encrypted) { return true; } // do not trust proxy if (trustProxy === false) { return false; } // no explicit trust; try req.secure from express if (trustProxy !== true) { return req.secure =...
[ "function", "issecure", "(", "req", ",", "trustProxy", ")", "{", "// socket is https server", "if", "(", "req", ".", "connection", "&&", "req", ".", "connection", ".", "encrypted", ")", "{", "return", "true", ";", "}", "// do not trust proxy", "if", "(", "tr...
Determine if request is secure. @param {Object} req @param {Boolean} [trustProxy] @return {Boolean} @private
[ "Determine", "if", "request", "is", "secure", "." ]
327695e3d1dd4d7a5d3857f2afbb5852b7710213
https://github.com/expressjs/session/blob/327695e3d1dd4d7a5d3857f2afbb5852b7710213/index.js#L612-L636
6,632
expressjs/session
index.js
unsigncookie
function unsigncookie(val, secrets) { for (var i = 0; i < secrets.length; i++) { var result = signature.unsign(val, secrets[i]); if (result !== false) { return result; } } return false; }
javascript
function unsigncookie(val, secrets) { for (var i = 0; i < secrets.length; i++) { var result = signature.unsign(val, secrets[i]); if (result !== false) { return result; } } return false; }
[ "function", "unsigncookie", "(", "val", ",", "secrets", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "secrets", ".", "length", ";", "i", "++", ")", "{", "var", "result", "=", "signature", ".", "unsign", "(", "val", ",", "secrets", "...
Verify and decode the given `val` with `secrets`. @param {String} val @param {Array} secrets @returns {String|Boolean} @private
[ "Verify", "and", "decode", "the", "given", "val", "with", "secrets", "." ]
327695e3d1dd4d7a5d3857f2afbb5852b7710213
https://github.com/expressjs/session/blob/327695e3d1dd4d7a5d3857f2afbb5852b7710213/index.js#L664-L674
6,633
expressjs/session
session/session.js
Session
function Session(req, data) { Object.defineProperty(this, 'req', { value: req }); Object.defineProperty(this, 'id', { value: req.sessionID }); if (typeof data === 'object' && data !== null) { // merge data into this, ignoring prototype properties for (var prop in data) { if (!(prop in this)) { ...
javascript
function Session(req, data) { Object.defineProperty(this, 'req', { value: req }); Object.defineProperty(this, 'id', { value: req.sessionID }); if (typeof data === 'object' && data !== null) { // merge data into this, ignoring prototype properties for (var prop in data) { if (!(prop in this)) { ...
[ "function", "Session", "(", "req", ",", "data", ")", "{", "Object", ".", "defineProperty", "(", "this", ",", "'req'", ",", "{", "value", ":", "req", "}", ")", ";", "Object", ".", "defineProperty", "(", "this", ",", "'id'", ",", "{", "value", ":", "...
Create a new `Session` with the given request and `data`. @param {IncomingRequest} req @param {Object} data @api private
[ "Create", "a", "new", "Session", "with", "the", "given", "request", "and", "data", "." ]
327695e3d1dd4d7a5d3857f2afbb5852b7710213
https://github.com/expressjs/session/blob/327695e3d1dd4d7a5d3857f2afbb5852b7710213/session/session.js#L24-L36
6,634
MikeMcl/bignumber.js
perf/lib/bigdecimal_GWT/bigdecimal.js
fix_and_export
function fix_and_export(class_name) { var Src = window.bigdecimal[class_name]; var Fixed = Src; if(Src.__init__) { Fixed = function wrap_constructor() { var args = Array.prototype.slice.call(arguments); return Src.__init__(args); }; Fixed.prototype = Src.prototype; for (var a in Src)...
javascript
function fix_and_export(class_name) { var Src = window.bigdecimal[class_name]; var Fixed = Src; if(Src.__init__) { Fixed = function wrap_constructor() { var args = Array.prototype.slice.call(arguments); return Src.__init__(args); }; Fixed.prototype = Src.prototype; for (var a in Src)...
[ "function", "fix_and_export", "(", "class_name", ")", "{", "var", "Src", "=", "window", ".", "bigdecimal", "[", "class_name", "]", ";", "var", "Fixed", "=", "Src", ";", "if", "(", "Src", ".", "__init__", ")", "{", "Fixed", "=", "function", "wrap_construc...
This is an unfortunate kludge because Java methods and constructors cannot accept vararg parameters.
[ "This", "is", "an", "unfortunate", "kludge", "because", "Java", "methods", "and", "constructors", "cannot", "accept", "vararg", "parameters", "." ]
2601c3eda90da68c22bec168df3b709b2d42a638
https://github.com/MikeMcl/bignumber.js/blob/2601c3eda90da68c22bec168df3b709b2d42a638/perf/lib/bigdecimal_GWT/bigdecimal.js#L549-L590
6,635
MikeMcl/bignumber.js
bignumber.js
multiply
function multiply(x, k, base) { var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0; for (x = x.slice(); i--;) { xlo = x[i] % SQRT_BASE; xhi = x[i] / SQRT_BASE | 0; m = khi * xlo + xhi * klo; ...
javascript
function multiply(x, k, base) { var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0; for (x = x.slice(); i--;) { xlo = x[i] % SQRT_BASE; xhi = x[i] / SQRT_BASE | 0; m = khi * xlo + xhi * klo; ...
[ "function", "multiply", "(", "x", ",", "k", ",", "base", ")", "{", "var", "m", ",", "temp", ",", "xlo", ",", "xhi", ",", "carry", "=", "0", ",", "i", "=", "x", ".", "length", ",", "klo", "=", "k", "%", "SQRT_BASE", ",", "khi", "=", "k", "/"...
Assume non-zero x and k.
[ "Assume", "non", "-", "zero", "x", "and", "k", "." ]
2601c3eda90da68c22bec168df3b709b2d42a638
https://github.com/MikeMcl/bignumber.js/blob/2601c3eda90da68c22bec168df3b709b2d42a638/bignumber.js#L970-L989
6,636
MikeMcl/bignumber.js
bignumber.js
isOdd
function isOdd(n) { var k = n.c.length - 1; return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0; }
javascript
function isOdd(n) { var k = n.c.length - 1; return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0; }
[ "function", "isOdd", "(", "n", ")", "{", "var", "k", "=", "n", ".", "c", ".", "length", "-", "1", ";", "return", "bitFloor", "(", "n", ".", "e", "/", "LOG_BASE", ")", "==", "k", "&&", "n", ".", "c", "[", "k", "]", "%", "2", "!=", "0", ";"...
Assumes finite n.
[ "Assumes", "finite", "n", "." ]
2601c3eda90da68c22bec168df3b709b2d42a638
https://github.com/MikeMcl/bignumber.js/blob/2601c3eda90da68c22bec168df3b709b2d42a638/bignumber.js#L2850-L2853
6,637
nodeca/pako
lib/deflate.js
Deflate
function Deflate(options) { if (!(this instanceof Deflate)) return new Deflate(options); this.options = utils.assign({ level: Z_DEFAULT_COMPRESSION, method: Z_DEFLATED, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: Z_DEFAULT_STRATEGY, to: '' }, options || {}); var opt = ...
javascript
function Deflate(options) { if (!(this instanceof Deflate)) return new Deflate(options); this.options = utils.assign({ level: Z_DEFAULT_COMPRESSION, method: Z_DEFLATED, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: Z_DEFAULT_STRATEGY, to: '' }, options || {}); var opt = ...
[ "function", "Deflate", "(", "options", ")", "{", "if", "(", "!", "(", "this", "instanceof", "Deflate", ")", ")", "return", "new", "Deflate", "(", "options", ")", ";", "this", ".", "options", "=", "utils", ".", "assign", "(", "{", "level", ":", "Z_DEF...
Deflate.msg -> String Error message, if [[Deflate.err]] != 0 new Deflate(options) - options (Object): zlib deflate options. Creates new deflator instance with specified params. Throws exception on bad params. Supported options: - `level` - `windowBits` - `memLevel` - `strategy` - `dictionary` [http://zlib.net/man...
[ "Deflate", ".", "msg", "-", ">", "String" ]
69798959ca01d40bc692d4fe9c54b9d23a4994bf
https://github.com/nodeca/pako/blob/69798959ca01d40bc692d4fe9c54b9d23a4994bf/lib/deflate.js#L120-L188
6,638
nodeca/pako
lib/inflate.js
Inflate
function Inflate(options) { if (!(this instanceof Inflate)) return new Inflate(options); this.options = utils.assign({ chunkSize: 16384, windowBits: 0, to: '' }, options || {}); var opt = this.options; // Force window size for `raw` data, if not set directly, // because we have no header for ...
javascript
function Inflate(options) { if (!(this instanceof Inflate)) return new Inflate(options); this.options = utils.assign({ chunkSize: 16384, windowBits: 0, to: '' }, options || {}); var opt = this.options; // Force window size for `raw` data, if not set directly, // because we have no header for ...
[ "function", "Inflate", "(", "options", ")", "{", "if", "(", "!", "(", "this", "instanceof", "Inflate", ")", ")", "return", "new", "Inflate", "(", "options", ")", ";", "this", ".", "options", "=", "utils", ".", "assign", "(", "{", "chunkSize", ":", "1...
Inflate.msg -> String Error message, if [[Inflate.err]] != 0 new Inflate(options) - options (Object): zlib inflate options. Creates new inflator instance with specified params. Throws exception on bad params. Supported options: - `windowBits` - `dictionary` [http://zlib.net/manual.html#Advanced](http://zlib.net/m...
[ "Inflate", ".", "msg", "-", ">", "String" ]
69798959ca01d40bc692d4fe9c54b9d23a4994bf
https://github.com/nodeca/pako/blob/69798959ca01d40bc692d4fe9c54b9d23a4994bf/lib/inflate.js#L93-L163
6,639
uw-labs/bloomrpc
webpack.config.base.js
filterDepWithoutEntryPoints
function filterDepWithoutEntryPoints(dep) { // Return true if we want to add a dependency to externals try { // If the root of the dependency has an index.js, return true if (fs.existsSync(path.join(__dirname, `node_modules/${dep}/index.js`))) { return false; } const pgkString = fs .read...
javascript
function filterDepWithoutEntryPoints(dep) { // Return true if we want to add a dependency to externals try { // If the root of the dependency has an index.js, return true if (fs.existsSync(path.join(__dirname, `node_modules/${dep}/index.js`))) { return false; } const pgkString = fs .read...
[ "function", "filterDepWithoutEntryPoints", "(", "dep", ")", "{", "// Return true if we want to add a dependency to externals", "try", "{", "// If the root of the dependency has an index.js, return true", "if", "(", "fs", ".", "existsSync", "(", "path", ".", "join", "(", "__di...
Find all the dependencies without a `main` property and add them as webpack externals
[ "Find", "all", "the", "dependencies", "without", "a", "main", "property", "and", "add", "them", "as", "webpack", "externals" ]
18acf5d04277547bdd42c372a40155f5ce994c64
https://github.com/uw-labs/bloomrpc/blob/18acf5d04277547bdd42c372a40155f5ce994c64/webpack.config.base.js#L12-L29
6,640
visionmedia/debug
src/common.js
createDebug
function createDebug(namespace) { let prevTime; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.cu...
javascript
function createDebug(namespace) { let prevTime; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.cu...
[ "function", "createDebug", "(", "namespace", ")", "{", "let", "prevTime", ";", "function", "debug", "(", "...", "args", ")", "{", "// Disabled?", "if", "(", "!", "debug", ".", "enabled", ")", "{", "return", ";", "}", "const", "self", "=", "debug", ";",...
Create a debugger with the given `namespace`. @param {String} namespace @return {Function} @api public
[ "Create", "a", "debugger", "with", "the", "given", "namespace", "." ]
5c7c61dc0df0db4eb5de25707d8cd1b9be1add4f
https://github.com/visionmedia/debug/blob/5c7c61dc0df0db4eb5de25707d8cd1b9be1add4f/src/common.js#L64-L134
6,641
visionmedia/debug
src/common.js
disable
function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; }
javascript
function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; }
[ "function", "disable", "(", ")", "{", "const", "namespaces", "=", "[", "...", "createDebug", ".", "names", ".", "map", "(", "toNamespace", ")", ",", "...", "createDebug", ".", "skips", ".", "map", "(", "toNamespace", ")", ".", "map", "(", "namespace", ...
Disable debug output. @return {String} namespaces @api public
[ "Disable", "debug", "output", "." ]
5c7c61dc0df0db4eb5de25707d8cd1b9be1add4f
https://github.com/visionmedia/debug/blob/5c7c61dc0df0db4eb5de25707d8cd1b9be1add4f/src/common.js#L195-L202
6,642
visionmedia/debug
src/common.js
enabled
function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.n...
javascript
function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.n...
[ "function", "enabled", "(", "name", ")", "{", "if", "(", "name", "[", "name", ".", "length", "-", "1", "]", "===", "'*'", ")", "{", "return", "true", ";", "}", "let", "i", ";", "let", "len", ";", "for", "(", "i", "=", "0", ",", "len", "=", ...
Returns true if the given mode name is enabled, false otherwise. @param {String} name @return {Boolean} @api public
[ "Returns", "true", "if", "the", "given", "mode", "name", "is", "enabled", "false", "otherwise", "." ]
5c7c61dc0df0db4eb5de25707d8cd1b9be1add4f
https://github.com/visionmedia/debug/blob/5c7c61dc0df0db4eb5de25707d8cd1b9be1add4f/src/common.js#L211-L232
6,643
visionmedia/debug
src/browser.js
load
function load() { let r; try { r = exports.storage.getItem('debug'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } ...
javascript
function load() { let r; try { r = exports.storage.getItem('debug'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } ...
[ "function", "load", "(", ")", "{", "let", "r", ";", "try", "{", "r", "=", "exports", ".", "storage", ".", "getItem", "(", "'debug'", ")", ";", "}", "catch", "(", "error", ")", "{", "// Swallow", "// XXX (@Qix-) should we be logging these?", "}", "// If deb...
Load `namespaces`. @return {String} returns the previously persisted debug modes @api private
[ "Load", "namespaces", "." ]
5c7c61dc0df0db4eb5de25707d8cd1b9be1add4f
https://github.com/visionmedia/debug/blob/5c7c61dc0df0db4eb5de25707d8cd1b9be1add4f/src/browser.js#L206-L221
6,644
visionmedia/debug
src/node.js
useColors
function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); }
javascript
function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); }
[ "function", "useColors", "(", ")", "{", "return", "'colors'", "in", "exports", ".", "inspectOpts", "?", "Boolean", "(", "exports", ".", "inspectOpts", ".", "colors", ")", ":", "tty", ".", "isatty", "(", "process", ".", "stderr", ".", "fd", ")", ";", "}...
Is stdout a TTY? Colored output is enabled when `true`.
[ "Is", "stdout", "a", "TTY?", "Colored", "output", "is", "enabled", "when", "true", "." ]
5c7c61dc0df0db4eb5de25707d8cd1b9be1add4f
https://github.com/visionmedia/debug/blob/5c7c61dc0df0db4eb5de25707d8cd1b9be1add4f/src/node.js#L151-L155
6,645
visionmedia/debug
src/node.js
formatArgs
function formatArgs(args) { const {namespace: name, useColors} = this; if (useColors) { const c = this.color; const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); const prefix = ` ${colorCode};1m${name} \u001B[0m`; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+'...
javascript
function formatArgs(args) { const {namespace: name, useColors} = this; if (useColors) { const c = this.color; const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); const prefix = ` ${colorCode};1m${name} \u001B[0m`; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+'...
[ "function", "formatArgs", "(", "args", ")", "{", "const", "{", "namespace", ":", "name", ",", "useColors", "}", "=", "this", ";", "if", "(", "useColors", ")", "{", "const", "c", "=", "this", ".", "color", ";", "const", "colorCode", "=", "'\\u001B[3'", ...
Adds ANSI color escape codes if enabled. @api public
[ "Adds", "ANSI", "color", "escape", "codes", "if", "enabled", "." ]
5c7c61dc0df0db4eb5de25707d8cd1b9be1add4f
https://github.com/visionmedia/debug/blob/5c7c61dc0df0db4eb5de25707d8cd1b9be1add4f/src/node.js#L163-L176
6,646
visionmedia/debug
src/node.js
init
function init(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports.inspectOpts); for (let i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } }
javascript
function init(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports.inspectOpts); for (let i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } }
[ "function", "init", "(", "debug", ")", "{", "debug", ".", "inspectOpts", "=", "{", "}", ";", "const", "keys", "=", "Object", ".", "keys", "(", "exports", ".", "inspectOpts", ")", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "keys", ".", ...
Init logic for `debug` instances. Create a new `inspectOpts` object in case `useColors` is set differently for a particular `debug` instance.
[ "Init", "logic", "for", "debug", "instances", "." ]
5c7c61dc0df0db4eb5de25707d8cd1b9be1add4f
https://github.com/visionmedia/debug/blob/5c7c61dc0df0db4eb5de25707d8cd1b9be1add4f/src/node.js#L227-L234
6,647
jupyter-widgets/ipywidgets
widgetsnbextension/src/extension.js
function(Jupyter, kernel) { if (kernel.comm_manager && kernel.widget_manager === undefined) { // Clear any old widget manager if (Jupyter.WidgetManager) { Jupyter.WidgetManager._managers[0].clear_state(); } // Create a new widget manager instance. Use the global ...
javascript
function(Jupyter, kernel) { if (kernel.comm_manager && kernel.widget_manager === undefined) { // Clear any old widget manager if (Jupyter.WidgetManager) { Jupyter.WidgetManager._managers[0].clear_state(); } // Create a new widget manager instance. Use the global ...
[ "function", "(", "Jupyter", ",", "kernel", ")", "{", "if", "(", "kernel", ".", "comm_manager", "&&", "kernel", ".", "widget_manager", "===", "undefined", ")", "{", "// Clear any old widget manager", "if", "(", "Jupyter", ".", "WidgetManager", ")", "{", "Jupyte...
Create a widget manager for a kernel instance.
[ "Create", "a", "widget", "manager", "for", "a", "kernel", "instance", "." ]
36fe37594cd5a268def228709ca27e37b99ac606
https://github.com/jupyter-widgets/ipywidgets/blob/36fe37594cd5a268def228709ca27e37b99ac606/widgetsnbextension/src/extension.js#L26-L46
6,648
jupyter-widgets/ipywidgets
widgetsnbextension/src/extension.js
render
function render(output, data, node) { // data is a model id var manager = Jupyter.notebook && Jupyter.notebook.kernel && Jupyter.notebook.kernel.widget_manager; if (!manager) { node.textContent = "Error rendering Jupyter widget: missing widget manager"; return; } ...
javascript
function render(output, data, node) { // data is a model id var manager = Jupyter.notebook && Jupyter.notebook.kernel && Jupyter.notebook.kernel.widget_manager; if (!manager) { node.textContent = "Error rendering Jupyter widget: missing widget manager"; return; } ...
[ "function", "render", "(", "output", ",", "data", ",", "node", ")", "{", "// data is a model id", "var", "manager", "=", "Jupyter", ".", "notebook", "&&", "Jupyter", ".", "notebook", ".", "kernel", "&&", "Jupyter", ".", "notebook", ".", "kernel", ".", "wid...
Render data to the output area.
[ "Render", "data", "to", "the", "output", "area", "." ]
36fe37594cd5a268def228709ca27e37b99ac606
https://github.com/jupyter-widgets/ipywidgets/blob/36fe37594cd5a268def228709ca27e37b99ac606/widgetsnbextension/src/extension.js#L103-L139
6,649
jupyter-widgets/ipywidgets
widgetsnbextension/src/extension.js
function(json, md, element) { var toinsert = this.create_output_subarea(md, CLASS_NAME, MIME_TYPE); this.keyboard_manager.register_events(toinsert); render(this, json, toinsert[0]); element.append(toinsert); return toinsert; }
javascript
function(json, md, element) { var toinsert = this.create_output_subarea(md, CLASS_NAME, MIME_TYPE); this.keyboard_manager.register_events(toinsert); render(this, json, toinsert[0]); element.append(toinsert); return toinsert; }
[ "function", "(", "json", ",", "md", ",", "element", ")", "{", "var", "toinsert", "=", "this", ".", "create_output_subarea", "(", "md", ",", "CLASS_NAME", ",", "MIME_TYPE", ")", ";", "this", ".", "keyboard_manager", ".", "register_events", "(", "toinsert", ...
`this` is the output area we are appending to
[ "this", "is", "the", "output", "area", "we", "are", "appending", "to" ]
36fe37594cd5a268def228709ca27e37b99ac606
https://github.com/jupyter-widgets/ipywidgets/blob/36fe37594cd5a268def228709ca27e37b99ac606/widgetsnbextension/src/extension.js#L142-L148
6,650
jupyter-widgets/ipywidgets
examples/web1/index.js
createWidget
function createWidget(widgetType, value, description) { // Create the widget model. return manager.new_model({ model_module: '@jupyter-widgets/controls', model_name: widgetType + 'Model', model_id: 'widget-1' // Create a view for the model. }).then(fu...
javascript
function createWidget(widgetType, value, description) { // Create the widget model. return manager.new_model({ model_module: '@jupyter-widgets/controls', model_name: widgetType + 'Model', model_id: 'widget-1' // Create a view for the model. }).then(fu...
[ "function", "createWidget", "(", "widgetType", ",", "value", ",", "description", ")", "{", "// Create the widget model.", "return", "manager", ".", "new_model", "(", "{", "model_module", ":", "'@jupyter-widgets/controls'", ",", "model_name", ":", "widgetType", "+", ...
Helper function for creating and displaying widgets. @return {Promise<WidgetView>}
[ "Helper", "function", "for", "creating", "and", "displaying", "widgets", "." ]
36fe37594cd5a268def228709ca27e37b99ac606
https://github.com/jupyter-widgets/ipywidgets/blob/36fe37594cd5a268def228709ca27e37b99ac606/examples/web1/index.js#L13-L36
6,651
jupyter-widgets/ipywidgets
scripts/package-integrity.js
getImports
function getImports(sourceFile) { var imports = []; handleNode(sourceFile); function handleNode(node) { switch (node.kind) { case ts.SyntaxKind.ImportDeclaration: imports.push(node.moduleSpecifier.text); break; case ts.SyntaxKind.ImportEqualsD...
javascript
function getImports(sourceFile) { var imports = []; handleNode(sourceFile); function handleNode(node) { switch (node.kind) { case ts.SyntaxKind.ImportDeclaration: imports.push(node.moduleSpecifier.text); break; case ts.SyntaxKind.ImportEqualsD...
[ "function", "getImports", "(", "sourceFile", ")", "{", "var", "imports", "=", "[", "]", ";", "handleNode", "(", "sourceFile", ")", ";", "function", "handleNode", "(", "node", ")", "{", "switch", "(", "node", ".", "kind", ")", "{", "case", "ts", ".", ...
Extract the module imports from a TypeScript source file.
[ "Extract", "the", "module", "imports", "from", "a", "TypeScript", "source", "file", "." ]
36fe37594cd5a268def228709ca27e37b99ac606
https://github.com/jupyter-widgets/ipywidgets/blob/36fe37594cd5a268def228709ca27e37b99ac606/scripts/package-integrity.js#L29-L45
6,652
jupyter-widgets/ipywidgets
scripts/package-integrity.js
validate
function validate(dname) { var filenames = glob.sync(dname + '/src/*.ts*'); filenames = filenames.concat(glob.sync(dname + '/src/**/*.ts*')); if (filenames.length == 0) { return []; } var imports = []; try { var pkg = require(path.resolve(dname) + '/package.json'); } catch...
javascript
function validate(dname) { var filenames = glob.sync(dname + '/src/*.ts*'); filenames = filenames.concat(glob.sync(dname + '/src/**/*.ts*')); if (filenames.length == 0) { return []; } var imports = []; try { var pkg = require(path.resolve(dname) + '/package.json'); } catch...
[ "function", "validate", "(", "dname", ")", "{", "var", "filenames", "=", "glob", ".", "sync", "(", "dname", "+", "'/src/*.ts*'", ")", ";", "filenames", "=", "filenames", ".", "concat", "(", "glob", ".", "sync", "(", "dname", "+", "'/src/**/*.ts*'", ")", ...
Validate the integrity of a package in a directory.
[ "Validate", "the", "integrity", "of", "a", "package", "in", "a", "directory", "." ]
36fe37594cd5a268def228709ca27e37b99ac606
https://github.com/jupyter-widgets/ipywidgets/blob/36fe37594cd5a268def228709ca27e37b99ac606/scripts/package-integrity.js#L50-L107
6,653
jupyter-widgets/ipywidgets
scripts/update-dependency.js
handlePackage
function handlePackage(packagePath) { // Read in the package.json. var packagePath = path.join(packagePath, 'package.json'); try { var package = require(packagePath); } catch (e) { console.log('Skipping package ' + packagePath); return; } // Update dependencies as appropriate. if (package.dep...
javascript
function handlePackage(packagePath) { // Read in the package.json. var packagePath = path.join(packagePath, 'package.json'); try { var package = require(packagePath); } catch (e) { console.log('Skipping package ' + packagePath); return; } // Update dependencies as appropriate. if (package.dep...
[ "function", "handlePackage", "(", "packagePath", ")", "{", "// Read in the package.json.", "var", "packagePath", "=", "path", ".", "join", "(", "packagePath", ",", "'package.json'", ")", ";", "try", "{", "var", "package", "=", "require", "(", "packagePath", ")",...
Handle an individual package on the path - update the dependency.
[ "Handle", "an", "individual", "package", "on", "the", "path", "-", "update", "the", "dependency", "." ]
36fe37594cd5a268def228709ca27e37b99ac606
https://github.com/jupyter-widgets/ipywidgets/blob/36fe37594cd5a268def228709ca27e37b99ac606/scripts/update-dependency.js#L45-L64
6,654
golden-layout/golden-layout
website/files/v0.9.2/js/goldenlayout.js
function( name, constructor ) { if( typeof constructor !== 'function' ) { throw new Error( 'Please register a constructor function' ); } if( this._components[ name ] !== undefined ) { throw new Error( 'Component ' + name + ' is already registered' ); } this._components[ name ] = constructor; }
javascript
function( name, constructor ) { if( typeof constructor !== 'function' ) { throw new Error( 'Please register a constructor function' ); } if( this._components[ name ] !== undefined ) { throw new Error( 'Component ' + name + ' is already registered' ); } this._components[ name ] = constructor; }
[ "function", "(", "name", ",", "constructor", ")", "{", "if", "(", "typeof", "constructor", "!==", "'function'", ")", "{", "throw", "new", "Error", "(", "'Please register a constructor function'", ")", ";", "}", "if", "(", "this", ".", "_components", "[", "na...
Register a component with the layout manager. If a configuration node of type component is reached it will look up componentName and create the associated component { type: "component", componentName: "EquityNewsFeed", componentState: { "feedTopic": "us-bluechips" } } @param {String} name @param {Function} constr...
[ "Register", "a", "component", "with", "the", "layout", "manager", ".", "If", "a", "configuration", "node", "of", "type", "component", "is", "reached", "it", "will", "look", "up", "componentName", "and", "create", "the", "associated", "component" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/website/files/v0.9.2/js/goldenlayout.js#L347-L357
6,655
golden-layout/golden-layout
website/files/v0.9.2/js/goldenlayout.js
function() { var config = $.extend( true, {}, this.config ); config.content = []; var next = function( configNode, item ) { var key, i; for( key in item.config ) { if( key !== 'content' ) { configNode[ key ] = item.config[ key ]; } } if( item.contentItems.length ) { configNode.co...
javascript
function() { var config = $.extend( true, {}, this.config ); config.content = []; var next = function( configNode, item ) { var key, i; for( key in item.config ) { if( key !== 'content' ) { configNode[ key ] = item.config[ key ]; } } if( item.contentItems.length ) { configNode.co...
[ "function", "(", ")", "{", "var", "config", "=", "$", ".", "extend", "(", "true", ",", "{", "}", ",", "this", ".", "config", ")", ";", "config", ".", "content", "=", "[", "]", ";", "var", "next", "=", "function", "(", "configNode", ",", "item", ...
Creates a layout configuration out of the current state @returns {Object} GoldenLayout configuration
[ "Creates", "a", "layout", "configuration", "out", "of", "the", "current", "state" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/website/files/v0.9.2/js/goldenlayout.js#L364-L389
6,656
golden-layout/golden-layout
website/files/v0.9.2/js/goldenlayout.js
function( name ) { if( this._components[ name ] === undefined ) { throw new lm.errors.ConfigurationError( 'Unknown component ' + name ); } return this._components[ name ]; }
javascript
function( name ) { if( this._components[ name ] === undefined ) { throw new lm.errors.ConfigurationError( 'Unknown component ' + name ); } return this._components[ name ]; }
[ "function", "(", "name", ")", "{", "if", "(", "this", ".", "_components", "[", "name", "]", "===", "undefined", ")", "{", "throw", "new", "lm", ".", "errors", ".", "ConfigurationError", "(", "'Unknown component '", "+", "name", ")", ";", "}", "return", ...
Returns a previously registered component @param {String} name The name used @returns {Function}
[ "Returns", "a", "previously", "registered", "component" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/website/files/v0.9.2/js/goldenlayout.js#L398-L404
6,657
golden-layout/golden-layout
website/files/v0.9.2/js/goldenlayout.js
function() { if( document.readyState === 'loading' || document.body === null ) { $(document).ready( lm.utils.fnBind( this.init, this )); return; } this._setContainer(); this.dropTargetIndicator = new lm.controls.DropTargetIndicator( this.container ); this.transitionIndicator = new lm.controls.Transiti...
javascript
function() { if( document.readyState === 'loading' || document.body === null ) { $(document).ready( lm.utils.fnBind( this.init, this )); return; } this._setContainer(); this.dropTargetIndicator = new lm.controls.DropTargetIndicator( this.container ); this.transitionIndicator = new lm.controls.Transiti...
[ "function", "(", ")", "{", "if", "(", "document", ".", "readyState", "===", "'loading'", "||", "document", ".", "body", "===", "null", ")", "{", "$", "(", "document", ")", ".", "ready", "(", "lm", ".", "utils", ".", "fnBind", "(", "this", ".", "ini...
Creates the actual layout. Must be called after all initial components are registered. Recourses through the configuration and sets up the item tree. If called before the document is ready it adds itself as a listener to the document.ready event @returns {void}
[ "Creates", "the", "actual", "layout", ".", "Must", "be", "called", "after", "all", "initial", "components", "are", "registered", ".", "Recourses", "through", "the", "configuration", "and", "sets", "up", "the", "item", "tree", "." ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/website/files/v0.9.2/js/goldenlayout.js#L416-L431
6,658
golden-layout/golden-layout
website/files/v0.9.2/js/goldenlayout.js
function( config, parent ) { var typeErrorMsg, contentItem; if( typeof config.type !== 'string' ) { throw new lm.errors.ConfigurationError( 'Missing parameter \'type\'', config ); } if( !this._typeToItem[ config.type ] ) { typeErrorMsg = 'Unknown type \'' + config.type + '\'. ' + 'Valid types are ' ...
javascript
function( config, parent ) { var typeErrorMsg, contentItem; if( typeof config.type !== 'string' ) { throw new lm.errors.ConfigurationError( 'Missing parameter \'type\'', config ); } if( !this._typeToItem[ config.type ] ) { typeErrorMsg = 'Unknown type \'' + config.type + '\'. ' + 'Valid types are ' ...
[ "function", "(", "config", ",", "parent", ")", "{", "var", "typeErrorMsg", ",", "contentItem", ";", "if", "(", "typeof", "config", ".", "type", "!==", "'string'", ")", "{", "throw", "new", "lm", ".", "errors", ".", "ConfigurationError", "(", "'Missing para...
Recoursively creates new item tree structures based on a provided ItemConfiguration object @param {Object} config ItemConfig @param {[ContentItem]} parent The item the newly created item should be a child of @returns {lm.items.ContentItem}
[ "Recoursively", "creates", "new", "item", "tree", "structures", "based", "on", "a", "provided", "ItemConfiguration", "object" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/website/files/v0.9.2/js/goldenlayout.js#L482-L513
6,659
golden-layout/golden-layout
website/files/v0.9.2/js/goldenlayout.js
function( contentItem, index ) { var tab = new lm.controls.Tab( this, contentItem ); if( this.tabs.length === 0 ) { this.tabs.push( tab ); this.tabsContainer.append( tab.element ); return; } if( index === undefined ) { index = this.tabs.length; } if( index > 0 ) { this.tabs[ index - 1 ...
javascript
function( contentItem, index ) { var tab = new lm.controls.Tab( this, contentItem ); if( this.tabs.length === 0 ) { this.tabs.push( tab ); this.tabsContainer.append( tab.element ); return; } if( index === undefined ) { index = this.tabs.length; } if( index > 0 ) { this.tabs[ index - 1 ...
[ "function", "(", "contentItem", ",", "index", ")", "{", "var", "tab", "=", "new", "lm", ".", "controls", ".", "Tab", "(", "this", ",", "contentItem", ")", ";", "if", "(", "this", ".", "tabs", ".", "length", "===", "0", ")", "{", "this", ".", "tab...
Creates a new tab and associates it with a contentItem @param {lm.item.AbstractContentItem} contentItem @param {Integer} index The position of the tab @returns {void}
[ "Creates", "a", "new", "tab", "and", "associates", "it", "with", "a", "contentItem" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/website/files/v0.9.2/js/goldenlayout.js#L1265-L1285
6,660
golden-layout/golden-layout
website/files/v0.9.2/js/goldenlayout.js
function( contentItem ) { for( var i = 0; i < this.tabs.length; i++ ) { if( this.tabs[ i ].contentItem === contentItem ) { this.tabs[ i ]._$destroy(); this.tabs.splice( i, 1 ); return; } } throw new Error( 'contentItem is not controlled by this header' ); }
javascript
function( contentItem ) { for( var i = 0; i < this.tabs.length; i++ ) { if( this.tabs[ i ].contentItem === contentItem ) { this.tabs[ i ]._$destroy(); this.tabs.splice( i, 1 ); return; } } throw new Error( 'contentItem is not controlled by this header' ); }
[ "function", "(", "contentItem", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "this", ".", "tabs", ".", "length", ";", "i", "++", ")", "{", "if", "(", "this", ".", "tabs", "[", "i", "]", ".", "contentItem", "===", "contentItem", ")...
Finds a tab based on the contentItem its associated with and removes it. @param {lm.item.AbstractContentItem} contentItem @returns {void}
[ "Finds", "a", "tab", "based", "on", "the", "contentItem", "its", "associated", "with", "and", "removes", "it", "." ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/website/files/v0.9.2/js/goldenlayout.js#L1294-L1304
6,661
golden-layout/golden-layout
website/files/v0.9.2/js/goldenlayout.js
function() { var availableWidth = this.element.outerWidth() - this.controlsContainer.outerWidth(), totalTabWidth = 0, tabElement, i, marginLeft, gap; for( i = 0; i < this.tabs.length; i++ ) { tabElement = this.tabs[ i ].element; /* * In order to show every tab's close icon, decrement the ...
javascript
function() { var availableWidth = this.element.outerWidth() - this.controlsContainer.outerWidth(), totalTabWidth = 0, tabElement, i, marginLeft, gap; for( i = 0; i < this.tabs.length; i++ ) { tabElement = this.tabs[ i ].element; /* * In order to show every tab's close icon, decrement the ...
[ "function", "(", ")", "{", "var", "availableWidth", "=", "this", ".", "element", ".", "outerWidth", "(", ")", "-", "this", ".", "controlsContainer", ".", "outerWidth", "(", ")", ",", "totalTabWidth", "=", "0", ",", "tabElement", ",", "i", ",", "marginLef...
Shrinks the tabs if the available space is not sufficient @returns {void}
[ "Shrinks", "the", "tabs", "if", "the", "available", "space", "is", "not", "sufficient" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/website/files/v0.9.2/js/goldenlayout.js#L1386-L1425
6,662
golden-layout/golden-layout
website/files/v0.9.2/js/goldenlayout.js
function( functionName, functionArguments, bottomUp, skipSelf ) { var i; if( bottomUp !== true && skipSelf !== true ) { this[ functionName ].apply( this, functionArguments || [] ); } for( i = 0; i < this.contentItems.length; i++ ) { this.contentItems[ i ].callDownwards( functionName, functionArguments, b...
javascript
function( functionName, functionArguments, bottomUp, skipSelf ) { var i; if( bottomUp !== true && skipSelf !== true ) { this[ functionName ].apply( this, functionArguments || [] ); } for( i = 0; i < this.contentItems.length; i++ ) { this.contentItems[ i ].callDownwards( functionName, functionArguments, b...
[ "function", "(", "functionName", ",", "functionArguments", ",", "bottomUp", ",", "skipSelf", ")", "{", "var", "i", ";", "if", "(", "bottomUp", "!==", "true", "&&", "skipSelf", "!==", "true", ")", "{", "this", "[", "functionName", "]", ".", "apply", "(", ...
Calls a method recoursively downwards on the tree @param {String} functionName the name of the function to be called @param {[Array]}functionArguments optional arguments that are passed to every function @param {[bool]} bottomUp Call methods from bottom to top, defaults to false @param {[bool]} s...
[ "Calls", "a", "method", "recoursively", "downwards", "on", "the", "tree" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/website/files/v0.9.2/js/goldenlayout.js#L1699-L1711
6,663
golden-layout/golden-layout
website/files/v0.9.2/js/goldenlayout.js
function( element ) { element = element || this.element; var offset = element.offset(), width = element.width(), height = element.height(); return { x1: offset.left, y1: offset.top, x2: offset.left + width, y2: offset.top + height, surface: width * height, contentItem: this }; }
javascript
function( element ) { element = element || this.element; var offset = element.offset(), width = element.width(), height = element.height(); return { x1: offset.left, y1: offset.top, x2: offset.left + width, y2: offset.top + height, surface: width * height, contentItem: this }; }
[ "function", "(", "element", ")", "{", "element", "=", "element", "||", "this", ".", "element", ";", "var", "offset", "=", "element", ".", "offset", "(", ")", ",", "width", "=", "element", ".", "width", "(", ")", ",", "height", "=", "element", ".", ...
Returns the area the component currently occupies in the format { x1: int xy: int y1: int y2: int contentItem: contentItem }
[ "Returns", "the", "area", "the", "component", "currently", "occupies", "in", "the", "format" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/website/files/v0.9.2/js/goldenlayout.js#L1961-L1976
6,664
golden-layout/golden-layout
website/files/v0.9.2/js/goldenlayout.js
function( name, event ) { if( event instanceof lm.utils.BubblingEvent && event.isPropagationStopped === false && this.isInitialised === true ) { /** * In some cases (e.g. if an element is created from a DragSource) it * doesn't have a parent and is not below root. If that's the case * propaga...
javascript
function( name, event ) { if( event instanceof lm.utils.BubblingEvent && event.isPropagationStopped === false && this.isInitialised === true ) { /** * In some cases (e.g. if an element is created from a DragSource) it * doesn't have a parent and is not below root. If that's the case * propaga...
[ "function", "(", "name", ",", "event", ")", "{", "if", "(", "event", "instanceof", "lm", ".", "utils", ".", "BubblingEvent", "&&", "event", ".", "isPropagationStopped", "===", "false", "&&", "this", ".", "isInitialised", "===", "true", ")", "{", "/**\n\t\t...
Called for every event on the item tree. Decides whether the event is a bubbling event and propagates it to its parent @param {String} name the name of the event @param {lm.utils.BubblingEvent} event @returns {void}
[ "Called", "for", "every", "event", "on", "the", "item", "tree", ".", "Decides", "whether", "the", "event", "is", "a", "bubbling", "event", "and", "propagates", "it", "to", "its", "parent" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/website/files/v0.9.2/js/goldenlayout.js#L2062-L2079
6,665
golden-layout/golden-layout
website/files/v0.9.2/js/goldenlayout.js
function( name, event ) { if( lm.utils.indexOf( name, this._throttledEvents ) === -1 ) { this.layoutManager.emit( name, event.origin ); } else { if( this._pendingEventPropagations[ name ] !== true ) { this._pendingEventPropagations[ name ] = true; lm.utils.animFrame( lm.utils.fnBind( this._propagateEv...
javascript
function( name, event ) { if( lm.utils.indexOf( name, this._throttledEvents ) === -1 ) { this.layoutManager.emit( name, event.origin ); } else { if( this._pendingEventPropagations[ name ] !== true ) { this._pendingEventPropagations[ name ] = true; lm.utils.animFrame( lm.utils.fnBind( this._propagateEv...
[ "function", "(", "name", ",", "event", ")", "{", "if", "(", "lm", ".", "utils", ".", "indexOf", "(", "name", ",", "this", ".", "_throttledEvents", ")", "===", "-", "1", ")", "{", "this", ".", "layoutManager", ".", "emit", "(", "name", ",", "event",...
All raw events bubble up to the root element. Some events that are propagated to - and emitted by - the layoutManager however are only string-based, batched and sanitized to make them more usable @param {String} name the name of the event @private @returns {void}
[ "All", "raw", "events", "bubble", "up", "to", "the", "root", "element", ".", "Some", "events", "that", "are", "propagated", "to", "-", "and", "emitted", "by", "-", "the", "layoutManager", "however", "are", "only", "string", "-", "based", "batched", "and", ...
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/website/files/v0.9.2/js/goldenlayout.js#L2091-L2101
6,666
golden-layout/golden-layout
website/files/v0.9.2/js/goldenlayout.js
function( oldChild, newChild ) { var size = oldChild.config[ this._dimension ]; lm.items.AbstractContentItem.prototype.replaceChild.call( this, oldChild, newChild ); newChild.config[ this._dimension ] = size; this.callDownwards( 'setSize' ); this.emitBubblingEvent( 'stateChanged' ); }
javascript
function( oldChild, newChild ) { var size = oldChild.config[ this._dimension ]; lm.items.AbstractContentItem.prototype.replaceChild.call( this, oldChild, newChild ); newChild.config[ this._dimension ] = size; this.callDownwards( 'setSize' ); this.emitBubblingEvent( 'stateChanged' ); }
[ "function", "(", "oldChild", ",", "newChild", ")", "{", "var", "size", "=", "oldChild", ".", "config", "[", "this", ".", "_dimension", "]", ";", "lm", ".", "items", ".", "AbstractContentItem", ".", "prototype", ".", "replaceChild", ".", "call", "(", "thi...
Replaces a child of this Row or Column with another contentItem @param {lm.items.AbstractContentItem} oldChild @param {lm.items.AbstractContentItem} newChild @returns {void}
[ "Replaces", "a", "child", "of", "this", "Row", "or", "Column", "with", "another", "contentItem" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/website/files/v0.9.2/js/goldenlayout.js#L2354-L2360
6,667
golden-layout/golden-layout
website/files/v0.9.2/js/goldenlayout.js
function() { if( this.isInitialised === true ) return; var i; lm.items.AbstractContentItem.prototype._$init.call( this ); for( i = 0; i < this.contentItems.length - 1; i++ ) { this.contentItems[ i ].element.after( this._createSplitter( i ).element ); } }
javascript
function() { if( this.isInitialised === true ) return; var i; lm.items.AbstractContentItem.prototype._$init.call( this ); for( i = 0; i < this.contentItems.length - 1; i++ ) { this.contentItems[ i ].element.after( this._createSplitter( i ).element ); } }
[ "function", "(", ")", "{", "if", "(", "this", ".", "isInitialised", "===", "true", ")", "return", ";", "var", "i", ";", "lm", ".", "items", ".", "AbstractContentItem", ".", "prototype", ".", "_$init", ".", "call", "(", "this", ")", ";", "for", "(", ...
Invoked recoursively by the layout manager. AbstractContentItem.init appends the contentItem's DOM elements to the container, RowOrColumn init adds splitters in between them @package private @override AbstractContentItem._$init @returns {void}
[ "Invoked", "recoursively", "by", "the", "layout", "manager", ".", "AbstractContentItem", ".", "init", "appends", "the", "contentItem", "s", "DOM", "elements", "to", "the", "container", "RowOrColumn", "init", "adds", "splitters", "in", "between", "them" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/website/files/v0.9.2/js/goldenlayout.js#L2385-L2395
6,668
golden-layout/golden-layout
website/files/v0.9.2/js/goldenlayout.js
function( splitter ) { var index = lm.utils.indexOf( splitter, this._splitter ); return { before: this.contentItems[ index ], after: this.contentItems[ index + 1 ] }; }
javascript
function( splitter ) { var index = lm.utils.indexOf( splitter, this._splitter ); return { before: this.contentItems[ index ], after: this.contentItems[ index + 1 ] }; }
[ "function", "(", "splitter", ")", "{", "var", "index", "=", "lm", ".", "utils", ".", "indexOf", "(", "splitter", ",", "this", ".", "_splitter", ")", ";", "return", "{", "before", ":", "this", ".", "contentItems", "[", "index", "]", ",", "after", ":",...
Locates the instance of lm.controls.Splitter in the array of registered splitters and returns a map containing the contentItem before and after the splitters, both of which are affected if the splitter is moved @param {lm.controls.Splitter} splitter @returns {Object} A map of contentItems that the splitter affects
[ "Locates", "the", "instance", "of", "lm", ".", "controls", ".", "Splitter", "in", "the", "array", "of", "registered", "splitters", "and", "returns", "a", "map", "containing", "the", "contentItem", "before", "and", "after", "the", "splitters", "both", "of", "...
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/website/files/v0.9.2/js/goldenlayout.js#L2554-L2561
6,669
golden-layout/golden-layout
website/files/v0.9.2/js/goldenlayout.js
function( splitter, offsetX, offsetY ) { var offset = this._isColumn ? offsetY : offsetX; if( offset > this._splitterMinPosition && offset < this._splitterMaxPosition ) { this._splitterPosition = offset; splitter.element.css( this._isColumn ? 'top' : 'left', offset ); } }
javascript
function( splitter, offsetX, offsetY ) { var offset = this._isColumn ? offsetY : offsetX; if( offset > this._splitterMinPosition && offset < this._splitterMaxPosition ) { this._splitterPosition = offset; splitter.element.css( this._isColumn ? 'top' : 'left', offset ); } }
[ "function", "(", "splitter", ",", "offsetX", ",", "offsetY", ")", "{", "var", "offset", "=", "this", ".", "_isColumn", "?", "offsetY", ":", "offsetX", ";", "if", "(", "offset", ">", "this", ".", "_splitterMinPosition", "&&", "offset", "<", "this", ".", ...
Invoked when a splitter's DragListener fires drag. Updates the splitters DOM position, but not the sizes of the elements the splitter controls in order to minimize resize events @param {lm.controls.Splitter} splitter @param {Int} offsetX Relative pixel values to the splitters original position. Can be negative @p...
[ "Invoked", "when", "a", "splitter", "s", "DragListener", "fires", "drag", ".", "Updates", "the", "splitters", "DOM", "position", "but", "not", "the", "sizes", "of", "the", "elements", "the", "splitter", "controls", "in", "order", "to", "minimize", "resize", ...
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/website/files/v0.9.2/js/goldenlayout.js#L2590-L2597
6,670
golden-layout/golden-layout
website/files/v0.9.2/js/goldenlayout.js
function( splitter ) { var items = this._getItemsForSplitter( splitter ), sizeBefore = items.before.element[ this._dimension ](), sizeAfter = items.after.element[ this._dimension ](), splitterPositionInRange = ( this._splitterPosition + sizeBefore ) / ( sizeBefore + sizeAfter ), totalRelativeSize = items...
javascript
function( splitter ) { var items = this._getItemsForSplitter( splitter ), sizeBefore = items.before.element[ this._dimension ](), sizeAfter = items.after.element[ this._dimension ](), splitterPositionInRange = ( this._splitterPosition + sizeBefore ) / ( sizeBefore + sizeAfter ), totalRelativeSize = items...
[ "function", "(", "splitter", ")", "{", "var", "items", "=", "this", ".", "_getItemsForSplitter", "(", "splitter", ")", ",", "sizeBefore", "=", "items", ".", "before", ".", "element", "[", "this", ".", "_dimension", "]", "(", ")", ",", "sizeAfter", "=", ...
Invoked when a splitter's DragListener fires dragStop. Resets the splitters DOM position, and applies the new sizes to the elements before and after the splitter and their children on the next animation frame @param {lm.controls.Splitter} splitter @returns {void}
[ "Invoked", "when", "a", "splitter", "s", "DragListener", "fires", "dragStop", ".", "Resets", "the", "splitters", "DOM", "position", "and", "applies", "the", "new", "sizes", "to", "the", "elements", "before", "and", "after", "the", "splitter", "and", "their", ...
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/website/files/v0.9.2/js/goldenlayout.js#L2608-L2625
6,671
golden-layout/golden-layout
src/js/LayoutManager.js
function( root ) { var config, next, i; if( this.isInitialised === false ) { throw new Error( 'Can\'t create config, layout not yet initialised' ); } if( root && !( root instanceof lm.items.AbstractContentItem ) ) { throw new Error( 'Root must be a ContentItem' ); } /* * settings & labels */ ...
javascript
function( root ) { var config, next, i; if( this.isInitialised === false ) { throw new Error( 'Can\'t create config, layout not yet initialised' ); } if( root && !( root instanceof lm.items.AbstractContentItem ) ) { throw new Error( 'Root must be a ContentItem' ); } /* * settings & labels */ ...
[ "function", "(", "root", ")", "{", "var", "config", ",", "next", ",", "i", ";", "if", "(", "this", ".", "isInitialised", "===", "false", ")", "{", "throw", "new", "Error", "(", "'Can\\'t create config, layout not yet initialised'", ")", ";", "}", "if", "("...
Creates a layout configuration object based on the the current state @public @returns {Object} GoldenLayout configuration
[ "Creates", "a", "layout", "configuration", "object", "based", "on", "the", "the", "current", "state" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/LayoutManager.js#L132-L195
6,672
golden-layout/golden-layout
src/js/LayoutManager.js
function() { /** * Create the popout windows straight away. If popouts are blocked * an error is thrown on the same 'thread' rather than a timeout and can * be caught. This also prevents any further initilisation from taking place. */ if( this._subWindowsCreated === false ) { this._createSubWindows(...
javascript
function() { /** * Create the popout windows straight away. If popouts are blocked * an error is thrown on the same 'thread' rather than a timeout and can * be caught. This also prevents any further initilisation from taking place. */ if( this._subWindowsCreated === false ) { this._createSubWindows(...
[ "function", "(", ")", "{", "/**\n\t\t * Create the popout windows straight away. If popouts are blocked\n\t\t * an error is thrown on the same 'thread' rather than a timeout and can\n\t\t * be caught. This also prevents any further initilisation from taking place.\n\t\t */", "if", "(", "this", ".", ...
Creates the actual layout. Must be called after all initial components are registered. Recurses through the configuration and sets up the item tree. If called before the document is ready it adds itself as a listener to the document.ready event @public @returns {void}
[ "Creates", "the", "actual", "layout", ".", "Must", "be", "called", "after", "all", "initial", "components", "are", "registered", ".", "Recurses", "through", "the", "configuration", "and", "sets", "up", "the", "item", "tree", "." ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/LayoutManager.js#L225-L270
6,673
golden-layout/golden-layout
src/js/LayoutManager.js
function( config, parent ) { var typeErrorMsg, contentItem; if( typeof config.type !== 'string' ) { throw new lm.errors.ConfigurationError( 'Missing parameter \'type\'', config ); } if( config.type === 'react-component' ) { config.type = 'component'; config.componentName = 'lm-react-component'; } ...
javascript
function( config, parent ) { var typeErrorMsg, contentItem; if( typeof config.type !== 'string' ) { throw new lm.errors.ConfigurationError( 'Missing parameter \'type\'', config ); } if( config.type === 'react-component' ) { config.type = 'component'; config.componentName = 'lm-react-component'; } ...
[ "function", "(", "config", ",", "parent", ")", "{", "var", "typeErrorMsg", ",", "contentItem", ";", "if", "(", "typeof", "config", ".", "type", "!==", "'string'", ")", "{", "throw", "new", "lm", ".", "errors", ".", "ConfigurationError", "(", "'Missing para...
Recursively creates new item tree structures based on a provided ItemConfiguration object @public @param {Object} config ItemConfig @param {[ContentItem]} parent The item the newly created item should be a child of @returns {lm.items.ContentItem}
[ "Recursively", "creates", "new", "item", "tree", "structures", "based", "on", "a", "provided", "ItemConfiguration", "object" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/LayoutManager.js#L343-L389
6,674
golden-layout/golden-layout
src/js/LayoutManager.js
function( configOrContentItem, dimensions, parentId, indexInParent ) { var config = configOrContentItem, isItem = configOrContentItem instanceof lm.items.AbstractContentItem, self = this, windowLeft, windowTop, offset, parent, child, browserPopout; parentId = parentId || null; if( isItem...
javascript
function( configOrContentItem, dimensions, parentId, indexInParent ) { var config = configOrContentItem, isItem = configOrContentItem instanceof lm.items.AbstractContentItem, self = this, windowLeft, windowTop, offset, parent, child, browserPopout; parentId = parentId || null; if( isItem...
[ "function", "(", "configOrContentItem", ",", "dimensions", ",", "parentId", ",", "indexInParent", ")", "{", "var", "config", "=", "configOrContentItem", ",", "isItem", "=", "configOrContentItem", "instanceof", "lm", ".", "items", ".", "AbstractContentItem", ",", "...
Creates a popout window with the specified content and dimensions @param {Object|lm.itemsAbstractContentItem} configOrContentItem @param {[Object]} dimensions A map with width, height, left and top @param {[String]} parentId the id of the element this item will be appended to when popIn is called @param {[Nu...
[ "Creates", "a", "popout", "window", "with", "the", "specified", "content", "and", "dimensions" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/LayoutManager.js#L402-L484
6,675
golden-layout/golden-layout
src/js/LayoutManager.js
function( contentItemOrConfig, parent ) { if( !contentItemOrConfig ) { throw new Error( 'No content item defined' ); } if( lm.utils.isFunction( contentItemOrConfig ) ) { contentItemOrConfig = contentItemOrConfig(); } if( contentItemOrConfig instanceof lm.items.AbstractContentItem ) { return content...
javascript
function( contentItemOrConfig, parent ) { if( !contentItemOrConfig ) { throw new Error( 'No content item defined' ); } if( lm.utils.isFunction( contentItemOrConfig ) ) { contentItemOrConfig = contentItemOrConfig(); } if( contentItemOrConfig instanceof lm.items.AbstractContentItem ) { return content...
[ "function", "(", "contentItemOrConfig", ",", "parent", ")", "{", "if", "(", "!", "contentItemOrConfig", ")", "{", "throw", "new", "Error", "(", "'No content item defined'", ")", ";", "}", "if", "(", "lm", ".", "utils", ".", "isFunction", "(", "contentItemOrC...
Takes a contentItem or a configuration and optionally a parent item and returns an initialised instance of the contentItem. If the contentItem is a function, it is first called @packagePrivate @param {lm.items.AbtractContentItem|Object|Function} contentItemOrConfig @param {lm.items.AbtractContentItem} parent Only...
[ "Takes", "a", "contentItem", "or", "a", "configuration", "and", "optionally", "a", "parent", "item", "and", "returns", "an", "initialised", "instance", "of", "the", "contentItem", ".", "If", "the", "contentItem", "is", "a", "function", "it", "is", "first", "...
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/LayoutManager.js#L686-L706
6,676
golden-layout/golden-layout
src/js/LayoutManager.js
function() { var popInButton = $( '<div class="lm_popin" title="' + this.config.labels.popin + '">' + '<div class="lm_icon"></div>' + '<div class="lm_bg"></div>' + '</div>' ); popInButton.on( 'click', lm.utils.fnBind( function() { this.emit( 'popIn' ); }, this ) ); document.title = lm.utils.stripT...
javascript
function() { var popInButton = $( '<div class="lm_popin" title="' + this.config.labels.popin + '">' + '<div class="lm_icon"></div>' + '<div class="lm_bg"></div>' + '</div>' ); popInButton.on( 'click', lm.utils.fnBind( function() { this.emit( 'popIn' ); }, this ) ); document.title = lm.utils.stripT...
[ "function", "(", ")", "{", "var", "popInButton", "=", "$", "(", "'<div class=\"lm_popin\" title=\"'", "+", "this", ".", "config", ".", "labels", ".", "popin", "+", "'\">'", "+", "'<div class=\"lm_icon\"></div>'", "+", "'<div class=\"lm_bg\"></div>'", "+", "'</div>'"...
This is executed when GoldenLayout detects that it is run within a previously opened popout window. @private @returns {void}
[ "This", "is", "executed", "when", "GoldenLayout", "detects", "that", "it", "is", "run", "within", "a", "previously", "opened", "popout", "window", "." ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/LayoutManager.js#L841-L872
6,677
golden-layout/golden-layout
src/js/LayoutManager.js
function() { if( this.config.settings.closePopoutsOnUnload === true ) { for( var i = 0; i < this.openPopouts.length; i++ ) { this.openPopouts[ i ].close(); } } }
javascript
function() { if( this.config.settings.closePopoutsOnUnload === true ) { for( var i = 0; i < this.openPopouts.length; i++ ) { this.openPopouts[ i ].close(); } } }
[ "function", "(", ")", "{", "if", "(", "this", ".", "config", ".", "settings", ".", "closePopoutsOnUnload", "===", "true", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "this", ".", "openPopouts", ".", "length", ";", "i", "++", ")", "...
Called when the window is closed or the user navigates away from the page @returns {void}
[ "Called", "when", "the", "window", "is", "closed", "or", "the", "user", "navigates", "away", "from", "the", "page" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/LayoutManager.js#L966-L972
6,678
golden-layout/golden-layout
src/js/LayoutManager.js
function() { // If there is no min width set, or not content items, do nothing. if( !this._useResponsiveLayout() || this._updatingColumnsResponsive || !this.config.dimensions || !this.config.dimensions.minItemWidth || this.root.contentItems.length === 0 || !this.root.contentItems[ 0 ].isRow ) { this._firstLoad ...
javascript
function() { // If there is no min width set, or not content items, do nothing. if( !this._useResponsiveLayout() || this._updatingColumnsResponsive || !this.config.dimensions || !this.config.dimensions.minItemWidth || this.root.contentItems.length === 0 || !this.root.contentItems[ 0 ].isRow ) { this._firstLoad ...
[ "function", "(", ")", "{", "// If there is no min width set, or not content items, do nothing.", "if", "(", "!", "this", ".", "_useResponsiveLayout", "(", ")", "||", "this", ".", "_updatingColumnsResponsive", "||", "!", "this", ".", "config", ".", "dimensions", "||", ...
Adjusts the number of columns to be lower to fit the screen and still maintain minItemWidth. @returns {void}
[ "Adjusts", "the", "number", "of", "columns", "to", "be", "lower", "to", "fit", "the", "screen", "and", "still", "maintain", "minItemWidth", "." ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/LayoutManager.js#L979-L1018
6,679
golden-layout/golden-layout
src/js/LayoutManager.js
function( container, node ) { if( node.type === 'stack' ) { node.contentItems.forEach( function( item ) { container.addChild( item ); node.removeChild( item, true ); } ); } else { node.contentItems.forEach( lm.utils.fnBind( function( item ) { this._addChildContentItemsToContainer( container, ...
javascript
function( container, node ) { if( node.type === 'stack' ) { node.contentItems.forEach( function( item ) { container.addChild( item ); node.removeChild( item, true ); } ); } else { node.contentItems.forEach( lm.utils.fnBind( function( item ) { this._addChildContentItemsToContainer( container, ...
[ "function", "(", "container", ",", "node", ")", "{", "if", "(", "node", ".", "type", "===", "'stack'", ")", "{", "node", ".", "contentItems", ".", "forEach", "(", "function", "(", "item", ")", "{", "container", ".", "addChild", "(", "item", ")", ";",...
Adds all children of a node to another container recursively. @param {object} container - Container to add child content items to. @param {object} node - Node to search for content items. @returns {void}
[ "Adds", "all", "children", "of", "a", "node", "to", "another", "container", "recursively", "." ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/LayoutManager.js#L1035-L1047
6,680
golden-layout/golden-layout
src/js/LayoutManager.js
function( stackContainers, node ) { node.contentItems.forEach( lm.utils.fnBind( function( item ) { if( item.type == 'stack' ) { stackContainers.push( item ); } else if( !item.isComponent ) { this._findAllStackContainersRecursive( stackContainers, item ); } }, this ) ); }
javascript
function( stackContainers, node ) { node.contentItems.forEach( lm.utils.fnBind( function( item ) { if( item.type == 'stack' ) { stackContainers.push( item ); } else if( !item.isComponent ) { this._findAllStackContainersRecursive( stackContainers, item ); } }, this ) ); }
[ "function", "(", "stackContainers", ",", "node", ")", "{", "node", ".", "contentItems", ".", "forEach", "(", "lm", ".", "utils", ".", "fnBind", "(", "function", "(", "item", ")", "{", "if", "(", "item", ".", "type", "==", "'stack'", ")", "{", "stackC...
Finds all the stack containers. @param {array} - Set of containers to populate. @param {object} - Current node to process. @returns {void}
[ "Finds", "all", "the", "stack", "containers", "." ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/LayoutManager.js#L1068-L1077
6,681
golden-layout/golden-layout
src/js/items/Stack.js
function() { var contentItem, isClosable, len, i; isClosable = this.header._isClosable(); for( i = 0, len = this.contentItems.length; i < len; i++ ) { if( !isClosable ) { break; } isClosable = this.contentItems[ i ].config.isClosable; } this.header._$setClosable( isClosable ); }
javascript
function() { var contentItem, isClosable, len, i; isClosable = this.header._isClosable(); for( i = 0, len = this.contentItems.length; i < len; i++ ) { if( !isClosable ) { break; } isClosable = this.contentItems[ i ].config.isClosable; } this.header._$setClosable( isClosable ); }
[ "function", "(", ")", "{", "var", "contentItem", ",", "isClosable", ",", "len", ",", "i", ";", "isClosable", "=", "this", ".", "header", ".", "_isClosable", "(", ")", ";", "for", "(", "i", "=", "0", ",", "len", "=", "this", ".", "contentItems", "."...
Validates that the stack is still closable or not. If a stack is able to close, but has a non closable component added to it, the stack is no longer closable until all components are closable. @returns {void}
[ "Validates", "that", "the", "stack", "is", "still", "closable", "or", "not", ".", "If", "a", "stack", "is", "able", "to", "close", "but", "has", "a", "non", "closable", "component", "added", "to", "it", "the", "stack", "is", "no", "longer", "closable", ...
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/items/Stack.js#L159-L176
6,682
golden-layout/golden-layout
src/js/items/Stack.js
function( x, y ) { var segment, area; for( segment in this._contentAreaDimensions ) { area = this._contentAreaDimensions[ segment ].hoverArea; if( area.x1 < x && area.x2 > x && area.y1 < y && area.y2 > y ) { if( segment === 'header' ) { this._dropSegment = 'header'; this._highlightHeaderDropZ...
javascript
function( x, y ) { var segment, area; for( segment in this._contentAreaDimensions ) { area = this._contentAreaDimensions[ segment ].hoverArea; if( area.x1 < x && area.x2 > x && area.y1 < y && area.y2 > y ) { if( segment === 'header' ) { this._dropSegment = 'header'; this._highlightHeaderDropZ...
[ "function", "(", "x", ",", "y", ")", "{", "var", "segment", ",", "area", ";", "for", "(", "segment", "in", "this", ".", "_contentAreaDimensions", ")", "{", "area", "=", "this", ".", "_contentAreaDimensions", "[", "segment", "]", ".", "hoverArea", ";", ...
If the user hovers above the header part of the stack, indicate drop positions for tabs. otherwise indicate which segment of the body the dragged item would be dropped on @param {Int} x Absolute Screen X @param {Int} y Absolute Screen Y @returns {void}
[ "If", "the", "user", "hovers", "above", "the", "header", "part", "of", "the", "stack", "indicate", "drop", "positions", "for", "tabs", ".", "otherwise", "indicate", "which", "segment", "of", "the", "body", "the", "dragged", "item", "would", "be", "dropped", ...
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/items/Stack.js#L291-L310
6,683
golden-layout/golden-layout
src/js/items/AbstractContentItem.js
function( e ) { e && e.preventDefault(); if( this.isMaximised === true ) { this.layoutManager._$minimiseItem( this ); } else { this.layoutManager._$maximiseItem( this ); } this.isMaximised = !this.isMaximised; this.emitBubblingEvent( 'stateChanged' ); }
javascript
function( e ) { e && e.preventDefault(); if( this.isMaximised === true ) { this.layoutManager._$minimiseItem( this ); } else { this.layoutManager._$maximiseItem( this ); } this.isMaximised = !this.isMaximised; this.emitBubblingEvent( 'stateChanged' ); }
[ "function", "(", "e", ")", "{", "e", "&&", "e", ".", "preventDefault", "(", ")", ";", "if", "(", "this", ".", "isMaximised", "===", "true", ")", "{", "this", ".", "layoutManager", ".", "_$minimiseItem", "(", "this", ")", ";", "}", "else", "{", "thi...
Maximises the Item or minimises it if it is already maximised @returns {void}
[ "Maximises", "the", "Item", "or", "minimises", "it", "if", "it", "is", "already", "maximised" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/items/AbstractContentItem.js#L244-L254
6,684
golden-layout/golden-layout
src/js/items/AbstractContentItem.js
function( id ) { if( !this.config.id ) { return false; } else if( typeof this.config.id === 'string' ) { return this.config.id === id; } else if( this.config.id instanceof Array ) { return lm.utils.indexOf( id, this.config.id ) !== -1; } }
javascript
function( id ) { if( !this.config.id ) { return false; } else if( typeof this.config.id === 'string' ) { return this.config.id === id; } else if( this.config.id instanceof Array ) { return lm.utils.indexOf( id, this.config.id ) !== -1; } }
[ "function", "(", "id", ")", "{", "if", "(", "!", "this", ".", "config", ".", "id", ")", "{", "return", "false", ";", "}", "else", "if", "(", "typeof", "this", ".", "config", ".", "id", "===", "'string'", ")", "{", "return", "this", ".", "config",...
Checks whether a provided id is present @public @param {String} id @returns {Boolean} isPresent
[ "Checks", "whether", "a", "provided", "id", "is", "present" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/items/AbstractContentItem.js#L302-L310
6,685
golden-layout/golden-layout
src/js/items/AbstractContentItem.js
function( id ) { if( !this.hasId( id ) ) { throw new Error( 'Id not found' ); } if( typeof this.config.id === 'string' ) { delete this.config.id; } else if( this.config.id instanceof Array ) { var index = lm.utils.indexOf( id, this.config.id ); this.config.id.splice( index, 1 ); } }
javascript
function( id ) { if( !this.hasId( id ) ) { throw new Error( 'Id not found' ); } if( typeof this.config.id === 'string' ) { delete this.config.id; } else if( this.config.id instanceof Array ) { var index = lm.utils.indexOf( id, this.config.id ); this.config.id.splice( index, 1 ); } }
[ "function", "(", "id", ")", "{", "if", "(", "!", "this", ".", "hasId", "(", "id", ")", ")", "{", "throw", "new", "Error", "(", "'Id not found'", ")", ";", "}", "if", "(", "typeof", "this", ".", "config", ".", "id", "===", "'string'", ")", "{", ...
Removes an existing id. Throws an error if the id is not present @public @param {String} id @returns {void}
[ "Removes", "an", "existing", "id", ".", "Throws", "an", "error", "if", "the", "id", "is", "not", "present" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/items/AbstractContentItem.js#L344-L355
6,686
golden-layout/golden-layout
src/js/controls/BrowserPopout.js
function() { var childConfig, parentItem, index = this._indexInParent; if( this._parentId ) { /* * The $.extend call seems a bit pointless, but it's crucial to * copy the config returned by this.getGlInstance().toConfig() * onto a new object. Internet Explorer keeps the references * to ob...
javascript
function() { var childConfig, parentItem, index = this._indexInParent; if( this._parentId ) { /* * The $.extend call seems a bit pointless, but it's crucial to * copy the config returned by this.getGlInstance().toConfig() * onto a new object. Internet Explorer keeps the references * to ob...
[ "function", "(", ")", "{", "var", "childConfig", ",", "parentItem", ",", "index", "=", "this", ".", "_indexInParent", ";", "if", "(", "this", ".", "_parentId", ")", "{", "/*\n\t\t\t * The $.extend call seems a bit pointless, but it's crucial to\n\t\t\t * copy the config r...
Returns the popped out item to its original position. If the original parent isn't available anymore it falls back to the layout's topmost element
[ "Returns", "the", "popped", "out", "item", "to", "its", "original", "position", ".", "If", "the", "original", "parent", "isn", "t", "available", "anymore", "it", "falls", "back", "to", "the", "layout", "s", "topmost", "element" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/controls/BrowserPopout.js#L74-L109
6,687
golden-layout/golden-layout
src/js/controls/BrowserPopout.js
function() { var checkReadyInterval, url = this._createUrl(), /** * Bogus title to prevent re-usage of existing window with the * same title. The actual title will be set by the new window's * GoldenLayout instance if it detects that it is in subWindowMode */ title = Math.floor( Math.random(...
javascript
function() { var checkReadyInterval, url = this._createUrl(), /** * Bogus title to prevent re-usage of existing window with the * same title. The actual title will be set by the new window's * GoldenLayout instance if it detects that it is in subWindowMode */ title = Math.floor( Math.random(...
[ "function", "(", ")", "{", "var", "checkReadyInterval", ",", "url", "=", "this", ".", "_createUrl", "(", ")", ",", "/**\n\t\t\t * Bogus title to prevent re-usage of existing window with the\n\t\t\t * same title. The actual title will be set by the new window's\n\t\t\t * GoldenLayout in...
Creates the URL and window parameter and opens a new window @private @returns {void}
[ "Creates", "the", "URL", "and", "window", "parameter", "and", "opens", "a", "new", "window" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/controls/BrowserPopout.js#L119-L175
6,688
golden-layout/golden-layout
src/js/controls/BrowserPopout.js
function() { var config = { content: this._config }, storageKey = 'gl-window-config-' + lm.utils.getUniqueId(), urlParts; config = ( new lm.utils.ConfigMinifier() ).minifyConfig( config ); try { localStorage.setItem( storageKey, JSON.stringify( config ) ); } catch( e ) { throw new Error( 'Error wh...
javascript
function() { var config = { content: this._config }, storageKey = 'gl-window-config-' + lm.utils.getUniqueId(), urlParts; config = ( new lm.utils.ConfigMinifier() ).minifyConfig( config ); try { localStorage.setItem( storageKey, JSON.stringify( config ) ); } catch( e ) { throw new Error( 'Error wh...
[ "function", "(", ")", "{", "var", "config", "=", "{", "content", ":", "this", ".", "_config", "}", ",", "storageKey", "=", "'gl-window-config-'", "+", "lm", ".", "utils", ".", "getUniqueId", "(", ")", ",", "urlParts", ";", "config", "=", "(", "new", ...
Creates the URL for the new window, including the config GET parameter @returns {String} URL
[ "Creates", "the", "URL", "for", "the", "new", "window", "including", "the", "config", "GET", "parameter" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/controls/BrowserPopout.js#L200-L223
6,689
golden-layout/golden-layout
website/assets/js/payment.js
function( form ) { var inputGroups = form.find( '.inputGroup' ), isValid = true, inputGroup, i; for( i = 0; i < inputGroups.length; i++ ) { inputGroup = $( inputGroups[ i ] ); if( $.trim( inputGroup.find( 'input' ).val() ).length === 0 ) { inputGroup.addClass( 'error' ); isValid = fals...
javascript
function( form ) { var inputGroups = form.find( '.inputGroup' ), isValid = true, inputGroup, i; for( i = 0; i < inputGroups.length; i++ ) { inputGroup = $( inputGroups[ i ] ); if( $.trim( inputGroup.find( 'input' ).val() ).length === 0 ) { inputGroup.addClass( 'error' ); isValid = fals...
[ "function", "(", "form", ")", "{", "var", "inputGroups", "=", "form", ".", "find", "(", "'.inputGroup'", ")", ",", "isValid", "=", "true", ",", "inputGroup", ",", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "inputGroups", ".", "length", ";"...
Validate the forms input fields @param {jQuery Element} form @returns {Boolean}
[ "Validate", "the", "forms", "input", "fields" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/website/assets/js/payment.js#L12-L30
6,690
golden-layout/golden-layout
src/js/controls/DragProxy.js
function( offsetX, offsetY, event ) { event = event.originalEvent && event.originalEvent.touches ? event.originalEvent.touches[ 0 ] : event; var x = event.pageX, y = event.pageY, isWithinContainer = x > this._minX && x < this._maxX && y > this._minY && y < this._maxY; if( !isWithinContainer && this._layo...
javascript
function( offsetX, offsetY, event ) { event = event.originalEvent && event.originalEvent.touches ? event.originalEvent.touches[ 0 ] : event; var x = event.pageX, y = event.pageY, isWithinContainer = x > this._minX && x < this._maxX && y > this._minY && y < this._maxY; if( !isWithinContainer && this._layo...
[ "function", "(", "offsetX", ",", "offsetY", ",", "event", ")", "{", "event", "=", "event", ".", "originalEvent", "&&", "event", ".", "originalEvent", ".", "touches", "?", "event", ".", "originalEvent", ".", "touches", "[", "0", "]", ":", "event", ";", ...
Callback on every mouseMove event during a drag. Determines if the drag is still within the valid drag area and calls the layoutManager to highlight the current drop area @param {Number} offsetX The difference from the original x position in px @param {Number} offsetY The difference from the original y position in...
[ "Callback", "on", "every", "mouseMove", "event", "during", "a", "drag", ".", "Determines", "if", "the", "drag", "is", "still", "within", "the", "valid", "drag", "area", "and", "calls", "the", "layoutManager", "to", "highlight", "the", "current", "drop", "are...
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/controls/DragProxy.js#L88-L101
6,691
golden-layout/golden-layout
src/js/controls/DragProxy.js
function( x, y ) { this.element.css( { left: x, top: y } ); this._area = this._layoutManager._$getArea( x, y ); if( this._area !== null ) { this._lastValidArea = this._area; this._area.contentItem._$highlightDropZone( x, y, this._area ); } }
javascript
function( x, y ) { this.element.css( { left: x, top: y } ); this._area = this._layoutManager._$getArea( x, y ); if( this._area !== null ) { this._lastValidArea = this._area; this._area.contentItem._$highlightDropZone( x, y, this._area ); } }
[ "function", "(", "x", ",", "y", ")", "{", "this", ".", "element", ".", "css", "(", "{", "left", ":", "x", ",", "top", ":", "y", "}", ")", ";", "this", ".", "_area", "=", "this", ".", "_layoutManager", ".", "_$getArea", "(", "x", ",", "y", ")"...
Sets the target position, highlighting the appropriate area @param {Number} x The x position in px @param {Number} y The y position in px @private @returns {void}
[ "Sets", "the", "target", "position", "highlighting", "the", "appropriate", "area" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/controls/DragProxy.js#L113-L121
6,692
golden-layout/golden-layout
src/js/controls/DragProxy.js
function() { var dimensions = this._layoutManager.config.dimensions, width = dimensions.dragProxyWidth, height = dimensions.dragProxyHeight; this.element.width( width ); this.element.height( height ); width -= ( this._sided ? dimensions.headerHeight : 0 ); height -= ( !this._sided ? dimensions.headerHe...
javascript
function() { var dimensions = this._layoutManager.config.dimensions, width = dimensions.dragProxyWidth, height = dimensions.dragProxyHeight; this.element.width( width ); this.element.height( height ); width -= ( this._sided ? dimensions.headerHeight : 0 ); height -= ( !this._sided ? dimensions.headerHe...
[ "function", "(", ")", "{", "var", "dimensions", "=", "this", ".", "_layoutManager", ".", "config", ".", "dimensions", ",", "width", "=", "dimensions", ".", "dragProxyWidth", ",", "height", "=", "dimensions", ".", "dragProxyHeight", ";", "this", ".", "element...
Updates the Drag Proxie's dimensions @private @returns {void}
[ "Updates", "the", "Drag", "Proxie", "s", "dimensions" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/controls/DragProxy.js#L195-L210
6,693
golden-layout/golden-layout
src/js/controls/Header.js
function( position ) { var previous = this.parent._header.show; if( this.parent._docker && this.parent._docker.docked ) throw new Error( 'Can\'t change header position in docked stack' ); if( previous && !this.parent._side ) previous = 'top'; if( position !== undefined && this.parent._header.show != posit...
javascript
function( position ) { var previous = this.parent._header.show; if( this.parent._docker && this.parent._docker.docked ) throw new Error( 'Can\'t change header position in docked stack' ); if( previous && !this.parent._side ) previous = 'top'; if( position !== undefined && this.parent._header.show != posit...
[ "function", "(", "position", ")", "{", "var", "previous", "=", "this", ".", "parent", ".", "_header", ".", "show", ";", "if", "(", "this", ".", "parent", ".", "_docker", "&&", "this", ".", "parent", ".", "_docker", ".", "docked", ")", "throw", "new",...
Programmatically operate with header position. @param {string} position one of ('top','left','right','bottom') to set or empty to get it. @returns {string} previous header position
[ "Programmatically", "operate", "with", "header", "position", "." ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/controls/Header.js#L152-L164
6,694
golden-layout/golden-layout
src/js/controls/Header.js
function( isClosable ) { this._canDestroy = isClosable || this.tabs.length > 1; if( this.closeButton && this._isClosable() ) { this.closeButton.element[ isClosable ? "show" : "hide" ](); return true; } return false; }
javascript
function( isClosable ) { this._canDestroy = isClosable || this.tabs.length > 1; if( this.closeButton && this._isClosable() ) { this.closeButton.element[ isClosable ? "show" : "hide" ](); return true; } return false; }
[ "function", "(", "isClosable", ")", "{", "this", ".", "_canDestroy", "=", "isClosable", "||", "this", ".", "tabs", ".", "length", ">", "1", ";", "if", "(", "this", ".", "closeButton", "&&", "this", ".", "_isClosable", "(", ")", ")", "{", "this", ".",...
Programmatically set closability. @package private @param {Boolean} isClosable Whether to enable/disable closability. @returns {Boolean} Whether the action was successful
[ "Programmatically", "set", "closability", "." ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/controls/Header.js#L174-L182
6,695
golden-layout/golden-layout
src/js/controls/Header.js
function( isDockable ) { if ( this.dockButton && this.parent._header && this.parent._header.dock ) { this.dockButton.element.toggle( !!isDockable ); return true; } return false; }
javascript
function( isDockable ) { if ( this.dockButton && this.parent._header && this.parent._header.dock ) { this.dockButton.element.toggle( !!isDockable ); return true; } return false; }
[ "function", "(", "isDockable", ")", "{", "if", "(", "this", ".", "dockButton", "&&", "this", ".", "parent", ".", "_header", "&&", "this", ".", "parent", ".", "_header", ".", "dock", ")", "{", "this", ".", "dockButton", ".", "element", ".", "toggle", ...
Programmatically set ability to dock. @package private @param {Boolean} isDockable Whether to enable/disable ability to dock. @returns {Boolean} Whether the action was successful
[ "Programmatically", "set", "ability", "to", "dock", "." ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/controls/Header.js#L192-L198
6,696
golden-layout/golden-layout
src/js/utils/ReactComponentHandler.js
function() { ReactDOM.unmountComponentAtNode( this._container.getElement()[ 0 ] ); this._container.off( 'open', this._render, this ); this._container.off( 'destroy', this._destroy, this ); }
javascript
function() { ReactDOM.unmountComponentAtNode( this._container.getElement()[ 0 ] ); this._container.off( 'open', this._render, this ); this._container.off( 'destroy', this._destroy, this ); }
[ "function", "(", ")", "{", "ReactDOM", ".", "unmountComponentAtNode", "(", "this", ".", "_container", ".", "getElement", "(", ")", "[", "0", "]", ")", ";", "this", ".", "_container", ".", "off", "(", "'open'", ",", "this", ".", "_render", ",", "this", ...
Removes the component from the DOM and thus invokes React's unmount lifecycle @private @returns {void}
[ "Removes", "the", "component", "from", "the", "DOM", "and", "thus", "invokes", "React", "s", "unmount", "lifecycle" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/utils/ReactComponentHandler.js#L61-L65
6,697
golden-layout/golden-layout
src/js/utils/ReactComponentHandler.js
function( nextProps, nextState ) { this._container.setState( nextState ); this._originalComponentWillUpdate.call( this._reactComponent, nextProps, nextState ); }
javascript
function( nextProps, nextState ) { this._container.setState( nextState ); this._originalComponentWillUpdate.call( this._reactComponent, nextProps, nextState ); }
[ "function", "(", "nextProps", ",", "nextState", ")", "{", "this", ".", "_container", ".", "setState", "(", "nextState", ")", ";", "this", ".", "_originalComponentWillUpdate", ".", "call", "(", "this", ".", "_reactComponent", ",", "nextProps", ",", "nextState",...
Hooks into React's state management and applies the componentstate to GoldenLayout @private @returns {void}
[ "Hooks", "into", "React", "s", "state", "management", "and", "applies", "the", "componentstate", "to", "GoldenLayout" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/utils/ReactComponentHandler.js#L74-L77
6,698
golden-layout/golden-layout
src/js/utils/ReactComponentHandler.js
function() { var componentName = this._container._config.component; var reactClass; if( !componentName ) { throw new Error( 'No react component name. type: react-component needs a field `component`' ); } reactClass = this._container.layoutManager.getComponent( componentName ); if( !reactClass ) { t...
javascript
function() { var componentName = this._container._config.component; var reactClass; if( !componentName ) { throw new Error( 'No react component name. type: react-component needs a field `component`' ); } reactClass = this._container.layoutManager.getComponent( componentName ); if( !reactClass ) { t...
[ "function", "(", ")", "{", "var", "componentName", "=", "this", ".", "_container", ".", "_config", ".", "component", ";", "var", "reactClass", ";", "if", "(", "!", "componentName", ")", "{", "throw", "new", "Error", "(", "'No react component name. type: react-...
Retrieves the react class from GoldenLayout's registry @private @returns {React.Class}
[ "Retrieves", "the", "react", "class", "from", "GoldenLayout", "s", "registry" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/utils/ReactComponentHandler.js#L85-L101
6,699
golden-layout/golden-layout
src/js/utils/ReactComponentHandler.js
function() { var defaultProps = { glEventHub: this._container.layoutManager.eventHub, glContainer: this._container, ref: this._gotReactComponent.bind( this ) }; var props = $.extend( defaultProps, this._container._config.props ); return React.createElement( this._reactClass, props ); }
javascript
function() { var defaultProps = { glEventHub: this._container.layoutManager.eventHub, glContainer: this._container, ref: this._gotReactComponent.bind( this ) }; var props = $.extend( defaultProps, this._container._config.props ); return React.createElement( this._reactClass, props ); }
[ "function", "(", ")", "{", "var", "defaultProps", "=", "{", "glEventHub", ":", "this", ".", "_container", ".", "layoutManager", ".", "eventHub", ",", "glContainer", ":", "this", ".", "_container", ",", "ref", ":", "this", ".", "_gotReactComponent", ".", "b...
Copies and extends the properties array and returns the React element @private @returns {React.Element}
[ "Copies", "and", "extends", "the", "properties", "array", "and", "returns", "the", "React", "element" ]
41ffb9f693b810132760d7b1218237820e5f9612
https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/utils/ReactComponentHandler.js#L109-L117