repo stringlengths 5 67 | path stringlengths 4 116 | func_name stringlengths 0 58 | original_string stringlengths 52 373k | language stringclasses 1
value | code stringlengths 52 373k | code_tokens list | docstring stringlengths 4 11.8k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 86 226 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train | |
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 | train |
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 | train | |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
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 | train | |
golden-layout/golden-layout | src/js/items/RowOrColumn.js | function( contentItem, index, _$suspendResize ) {
var newItemSize, itemSize, i, splitterElement;
contentItem = this.layoutManager._$normalizeContentItem( contentItem, this );
if( index === undefined ) {
index = this.contentItems.length;
}
if( this.contentItems.length > 0 ) {
splitterElement = this._... | javascript | function( contentItem, index, _$suspendResize ) {
var newItemSize, itemSize, i, splitterElement;
contentItem = this.layoutManager._$normalizeContentItem( contentItem, this );
if( index === undefined ) {
index = this.contentItems.length;
}
if( this.contentItems.length > 0 ) {
splitterElement = this._... | [
"function",
"(",
"contentItem",
",",
"index",
",",
"_$suspendResize",
")",
"{",
"var",
"newItemSize",
",",
"itemSize",
",",
"i",
",",
"splitterElement",
";",
"contentItem",
"=",
"this",
".",
"layoutManager",
".",
"_$normalizeContentItem",
"(",
"contentItem",
","... | Add a new contentItem to the Row or Column
@param {lm.item.AbstractContentItem} contentItem
@param {[int]} index The position of the new item within the Row or Column.
If no index is provided the item will be added to the end
@param {[bool]} _$suspendResize If true the items won't be resized. This will leave the item ... | [
"Add",
"a",
"new",
"contentItem",
"to",
"the",
"Row",
"or",
"Column"
] | 41ffb9f693b810132760d7b1218237820e5f9612 | https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/items/RowOrColumn.js#L35-L84 | train | |
golden-layout/golden-layout | src/js/items/RowOrColumn.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 );
}
for( i = 0; i < this.contentItems.length; i++ ) {... | 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 );
}
for( i = 0; i < this.contentItems.length; i++ ) {... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"isInitialised",
"===",
"true",
")",
"return",
";",
"var",
"i",
";",
"lm",
".",
"items",
".",
"AbstractContentItem",
".",
"prototype",
".",
"_$init",
".",
"call",
"(",
"this",
")",
";",
"for",
"(",
... | Invoked recursively 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",
"recursively",
"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/src/js/items/RowOrColumn.js#L252-L266 | train | |
golden-layout/golden-layout | src/js/items/RowOrColumn.js | function() {
var i,
totalSplitterSize = (this.contentItems.length - 1) * this._splitterSize,
headerSize = this.layoutManager.config.dimensions.headerHeight,
totalWidth = this.element.width(),
totalHeight = this.element.height(),
totalAssigned = 0,
additionalPixel,
itemSize,
itemSizes = [];
... | javascript | function() {
var i,
totalSplitterSize = (this.contentItems.length - 1) * this._splitterSize,
headerSize = this.layoutManager.config.dimensions.headerHeight,
totalWidth = this.element.width(),
totalHeight = this.element.height(),
totalAssigned = 0,
additionalPixel,
itemSize,
itemSizes = [];
... | [
"function",
"(",
")",
"{",
"var",
"i",
",",
"totalSplitterSize",
"=",
"(",
"this",
".",
"contentItems",
".",
"length",
"-",
"1",
")",
"*",
"this",
".",
"_splitterSize",
",",
"headerSize",
"=",
"this",
".",
"layoutManager",
".",
"config",
".",
"dimensions... | Calculates the absolute sizes of all of the children of this Item.
@returns {object} - Set with absolute sizes and additional pixels. | [
"Calculates",
"the",
"absolute",
"sizes",
"of",
"all",
"of",
"the",
"children",
"of",
"this",
"Item",
"."
] | 41ffb9f693b810132760d7b1218237820e5f9612 | https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/items/RowOrColumn.js#L300-L346 | train | |
golden-layout/golden-layout | src/js/items/RowOrColumn.js | function() {
var minItemWidth = this.layoutManager.config.dimensions ? (this.layoutManager.config.dimensions.minItemWidth || 0) : 0,
sizeData = null,
entriesOverMin = [],
totalOverMin = 0,
totalUnderMin = 0,
remainingWidth = 0,
itemSize = 0,
contentItem = null,
reducePercent,
reducedWidth,
... | javascript | function() {
var minItemWidth = this.layoutManager.config.dimensions ? (this.layoutManager.config.dimensions.minItemWidth || 0) : 0,
sizeData = null,
entriesOverMin = [],
totalOverMin = 0,
totalUnderMin = 0,
remainingWidth = 0,
itemSize = 0,
contentItem = null,
reducePercent,
reducedWidth,
... | [
"function",
"(",
")",
"{",
"var",
"minItemWidth",
"=",
"this",
".",
"layoutManager",
".",
"config",
".",
"dimensions",
"?",
"(",
"this",
".",
"layoutManager",
".",
"config",
".",
"dimensions",
".",
"minItemWidth",
"||",
"0",
")",
":",
"0",
",",
"sizeData... | Adjusts the column widths to respect the dimensions minItemWidth if set.
@returns {} | [
"Adjusts",
"the",
"column",
"widths",
"to",
"respect",
"the",
"dimensions",
"minItemWidth",
"if",
"set",
"."
] | 41ffb9f693b810132760d7b1218237820e5f9612 | https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/items/RowOrColumn.js#L430-L504 | train | |
golden-layout/golden-layout | src/js/items/RowOrColumn.js | function( index ) {
var splitter;
splitter = new lm.controls.Splitter( this._isColumn, this._splitterSize, this._splitterGrabSize );
splitter.on( 'drag', lm.utils.fnBind( this._onSplitterDrag, this, [ splitter ] ), this );
splitter.on( 'dragStop', lm.utils.fnBind( this._onSplitterDragStop, this, [ splitter ] ),... | javascript | function( index ) {
var splitter;
splitter = new lm.controls.Splitter( this._isColumn, this._splitterSize, this._splitterGrabSize );
splitter.on( 'drag', lm.utils.fnBind( this._onSplitterDrag, this, [ splitter ] ), this );
splitter.on( 'dragStop', lm.utils.fnBind( this._onSplitterDragStop, this, [ splitter ] ),... | [
"function",
"(",
"index",
")",
"{",
"var",
"splitter",
";",
"splitter",
"=",
"new",
"lm",
".",
"controls",
".",
"Splitter",
"(",
"this",
".",
"_isColumn",
",",
"this",
".",
"_splitterSize",
",",
"this",
".",
"_splitterGrabSize",
")",
";",
"splitter",
"."... | Instantiates a new lm.controls.Splitter, binds events to it and adds
it to the array of splitters at the position specified as the index argument
What it doesn't do though is append the splitter to the DOM
@param {Int} index The position of the splitter
@returns {lm.controls.Splitter} | [
"Instantiates",
"a",
"new",
"lm",
".",
"controls",
".",
"Splitter",
"binds",
"events",
"to",
"it",
"and",
"adds",
"it",
"to",
"the",
"array",
"of",
"splitters",
"at",
"the",
"position",
"specified",
"as",
"the",
"index",
"argument"
] | 41ffb9f693b810132760d7b1218237820e5f9612 | https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/items/RowOrColumn.js#L516-L524 | train | |
golden-layout/golden-layout | src/js/items/RowOrColumn.js | function ( index ) {
if ( typeof index == 'undefined' ) {
var count = 0;
for (var i = 0; i < this.contentItems.length; ++i)
if ( this._isDocked( i ) )
count++;
return count;
}
if ( index < this.contentItems.length )
return this.contentItems[ index ]._docker && this.contentItems[ index ]._dock... | javascript | function ( index ) {
if ( typeof index == 'undefined' ) {
var count = 0;
for (var i = 0; i < this.contentItems.length; ++i)
if ( this._isDocked( i ) )
count++;
return count;
}
if ( index < this.contentItems.length )
return this.contentItems[ index ]._docker && this.contentItems[ index ]._dock... | [
"function",
"(",
"index",
")",
"{",
"if",
"(",
"typeof",
"index",
"==",
"'undefined'",
")",
"{",
"var",
"count",
"=",
"0",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"contentItems",
".",
"length",
";",
"++",
"i",
")",
"i... | Gets docking information
@private | [
"Gets",
"docking",
"information"
] | 41ffb9f693b810132760d7b1218237820e5f9612 | https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/items/RowOrColumn.js#L549-L559 | train | |
golden-layout/golden-layout | src/js/items/RowOrColumn.js | function ( that ) {
that = that || this;
var can = that.contentItems.length - that._isDocked() > 1;
for (var i = 0; i < that.contentItems.length; ++i )
if ( that.contentItems[ i ] instanceof lm.items.Stack ) {
that.contentItems[ i ].header._setDockable( that._isDocked( i ) || can );
that.contentItems[ ... | javascript | function ( that ) {
that = that || this;
var can = that.contentItems.length - that._isDocked() > 1;
for (var i = 0; i < that.contentItems.length; ++i )
if ( that.contentItems[ i ] instanceof lm.items.Stack ) {
that.contentItems[ i ].header._setDockable( that._isDocked( i ) || can );
that.contentItems[ ... | [
"function",
"(",
"that",
")",
"{",
"that",
"=",
"that",
"||",
"this",
";",
"var",
"can",
"=",
"that",
".",
"contentItems",
".",
"length",
"-",
"that",
".",
"_isDocked",
"(",
")",
">",
"1",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
... | Validate if row or column has ability to dock
@private | [
"Validate",
"if",
"row",
"or",
"column",
"has",
"ability",
"to",
"dock"
] | 41ffb9f693b810132760d7b1218237820e5f9612 | https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/items/RowOrColumn.js#L565-L573 | train | |
golden-layout/golden-layout | src/js/items/RowOrColumn.js | function( arr ) {
var minWidth = 0, minHeight = 0;
for( var i = 0; i < arr.length; ++i ) {
minWidth = Math.max( arr[ i ].minWidth || 0, minWidth );
minHeight = Math.max( arr[ i ].minHeight || 0, minHeight );
}
return { horizontal: minWidth, vertical: minHeight };
} | javascript | function( arr ) {
var minWidth = 0, minHeight = 0;
for( var i = 0; i < arr.length; ++i ) {
minWidth = Math.max( arr[ i ].minWidth || 0, minWidth );
minHeight = Math.max( arr[ i ].minHeight || 0, minHeight );
}
return { horizontal: minWidth, vertical: minHeight };
} | [
"function",
"(",
"arr",
")",
"{",
"var",
"minWidth",
"=",
"0",
",",
"minHeight",
"=",
"0",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"arr",
".",
"length",
";",
"++",
"i",
")",
"{",
"minWidth",
"=",
"Math",
".",
"max",
"(",
"arr",
... | Gets the minimum dimensions for the given item configuration array
@param item
@private | [
"Gets",
"the",
"minimum",
"dimensions",
"for",
"the",
"given",
"item",
"configuration",
"array"
] | 41ffb9f693b810132760d7b1218237820e5f9612 | https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/items/RowOrColumn.js#L580-L589 | train | |
golden-layout/golden-layout | src/js/controls/Tab.js | function() {
this.element.off( 'mousedown touchstart', this._onTabClickFn );
this.closeElement.off( 'click touchstart', this._onCloseClickFn );
if( this._dragListener ) {
this.contentItem.off( 'destroy', this._dragListener.destroy, this._dragListener );
this._dragListener.off( 'dragStart', this._onDragStart... | javascript | function() {
this.element.off( 'mousedown touchstart', this._onTabClickFn );
this.closeElement.off( 'click touchstart', this._onCloseClickFn );
if( this._dragListener ) {
this.contentItem.off( 'destroy', this._dragListener.destroy, this._dragListener );
this._dragListener.off( 'dragStart', this._onDragStart... | [
"function",
"(",
")",
"{",
"this",
".",
"element",
".",
"off",
"(",
"'mousedown touchstart'",
",",
"this",
".",
"_onTabClickFn",
")",
";",
"this",
".",
"closeElement",
".",
"off",
"(",
"'click touchstart'",
",",
"this",
".",
"_onCloseClickFn",
")",
";",
"i... | Destroys the tab
@private
@returns {void} | [
"Destroys",
"the",
"tab"
] | 41ffb9f693b810132760d7b1218237820e5f9612 | https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/controls/Tab.js#L104-L113 | train | |
golden-layout/golden-layout | src/js/controls/Tab.js | function( x, y ) {
if( !this.header._canDestroy )
return null;
if( this.contentItem.parent.isMaximised === true ) {
this.contentItem.parent.toggleMaximise();
}
new lm.controls.DragProxy(
x,
y,
this._dragListener,
this._layoutManager,
this.contentItem,
this.header.parent
);
} | javascript | function( x, y ) {
if( !this.header._canDestroy )
return null;
if( this.contentItem.parent.isMaximised === true ) {
this.contentItem.parent.toggleMaximise();
}
new lm.controls.DragProxy(
x,
y,
this._dragListener,
this._layoutManager,
this.contentItem,
this.header.parent
);
} | [
"function",
"(",
"x",
",",
"y",
")",
"{",
"if",
"(",
"!",
"this",
".",
"header",
".",
"_canDestroy",
")",
"return",
"null",
";",
"if",
"(",
"this",
".",
"contentItem",
".",
"parent",
".",
"isMaximised",
"===",
"true",
")",
"{",
"this",
".",
"conten... | Callback for the DragListener
@param {Number} x The tabs absolute x position
@param {Number} y The tabs absolute y position
@private
@returns {void} | [
"Callback",
"for",
"the",
"DragListener"
] | 41ffb9f693b810132760d7b1218237820e5f9612 | https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/controls/Tab.js#L124-L138 | train | |
golden-layout/golden-layout | src/js/controls/Tab.js | function( event ) {
// left mouse button or tap
if( event.button === 0 || event.type === 'touchstart' ) {
this.header.parent.setActiveContentItem( this.contentItem );
// middle mouse button
} else if( event.button === 1 && this.contentItem.config.isClosable ) {
this._onCloseClick( event );
}
} | javascript | function( event ) {
// left mouse button or tap
if( event.button === 0 || event.type === 'touchstart' ) {
this.header.parent.setActiveContentItem( this.contentItem );
// middle mouse button
} else if( event.button === 1 && this.contentItem.config.isClosable ) {
this._onCloseClick( event );
}
} | [
"function",
"(",
"event",
")",
"{",
"// left mouse button or tap",
"if",
"(",
"event",
".",
"button",
"===",
"0",
"||",
"event",
".",
"type",
"===",
"'touchstart'",
")",
"{",
"this",
".",
"header",
".",
"parent",
".",
"setActiveContentItem",
"(",
"this",
"... | Callback when the tab is clicked
@param {jQuery DOM event} event
@private
@returns {void} | [
"Callback",
"when",
"the",
"tab",
"is",
"clicked"
] | 41ffb9f693b810132760d7b1218237820e5f9612 | https://github.com/golden-layout/golden-layout/blob/41ffb9f693b810132760d7b1218237820e5f9612/src/js/controls/Tab.js#L148-L157 | train | |
russellgoldenberg/scrollama | src/init.js | updateStepAboveIO | function updateStepAboveIO() {
io.stepAbove = stepEl.map((el, i) => {
const marginTop = -offsetMargin + stepOffsetHeight[i];
const marginBottom = offsetMargin - viewH;
const rootMargin = `${marginTop}px 0px ${marginBottom}px 0px`;
const options = { rootMargin };
// console.log(options)... | javascript | function updateStepAboveIO() {
io.stepAbove = stepEl.map((el, i) => {
const marginTop = -offsetMargin + stepOffsetHeight[i];
const marginBottom = offsetMargin - viewH;
const rootMargin = `${marginTop}px 0px ${marginBottom}px 0px`;
const options = { rootMargin };
// console.log(options)... | [
"function",
"updateStepAboveIO",
"(",
")",
"{",
"io",
".",
"stepAbove",
"=",
"stepEl",
".",
"map",
"(",
"(",
"el",
",",
"i",
")",
"=>",
"{",
"const",
"marginTop",
"=",
"-",
"offsetMargin",
"+",
"stepOffsetHeight",
"[",
"i",
"]",
";",
"const",
"marginBo... | look above for intersection | [
"look",
"above",
"for",
"intersection"
] | 486c14807c43d284eaaf2118e52b116798e618b9 | https://github.com/russellgoldenberg/scrollama/blob/486c14807c43d284eaaf2118e52b116798e618b9/src/init.js#L363-L374 | train |
russellgoldenberg/scrollama | src/init.js | updateStepProgressIO | function updateStepProgressIO() {
io.stepProgress = stepEl.map((el, i) => {
const marginTop = stepOffsetHeight[i] - offsetMargin;
const marginBottom = -viewH + offsetMargin;
const rootMargin = `${marginTop}px 0px ${marginBottom}px 0px`;
const threshold = createThreshold(stepOffsetHeight[i]);... | javascript | function updateStepProgressIO() {
io.stepProgress = stepEl.map((el, i) => {
const marginTop = stepOffsetHeight[i] - offsetMargin;
const marginBottom = -viewH + offsetMargin;
const rootMargin = `${marginTop}px 0px ${marginBottom}px 0px`;
const threshold = createThreshold(stepOffsetHeight[i]);... | [
"function",
"updateStepProgressIO",
"(",
")",
"{",
"io",
".",
"stepProgress",
"=",
"stepEl",
".",
"map",
"(",
"(",
"el",
",",
"i",
")",
"=>",
"{",
"const",
"marginTop",
"=",
"stepOffsetHeight",
"[",
"i",
"]",
"-",
"offsetMargin",
";",
"const",
"marginBot... | progress progress tracker | [
"progress",
"progress",
"tracker"
] | 486c14807c43d284eaaf2118e52b116798e618b9 | https://github.com/russellgoldenberg/scrollama/blob/486c14807c43d284eaaf2118e52b116798e618b9/src/init.js#L391-L403 | train |
jashkenas/backbone | examples/backbone.localStorage.js | function(model) {
this.localStorage().setItem(this.name+"-"+model.id, JSON.stringify(model));
if (!_.include(this.records, model.id.toString()))
this.records.push(model.id.toString()); this.save();
return this.find(model);
} | javascript | function(model) {
this.localStorage().setItem(this.name+"-"+model.id, JSON.stringify(model));
if (!_.include(this.records, model.id.toString()))
this.records.push(model.id.toString()); this.save();
return this.find(model);
} | [
"function",
"(",
"model",
")",
"{",
"this",
".",
"localStorage",
"(",
")",
".",
"setItem",
"(",
"this",
".",
"name",
"+",
"\"-\"",
"+",
"model",
".",
"id",
",",
"JSON",
".",
"stringify",
"(",
"model",
")",
")",
";",
"if",
"(",
"!",
"_",
".",
"i... | Update a model by replacing its copy in `this.data`. | [
"Update",
"a",
"model",
"by",
"replacing",
"its",
"copy",
"in",
"this",
".",
"data",
"."
] | 75e6d0ce6394bd2b809823c7f7dc014ddb6ae287 | https://github.com/jashkenas/backbone/blob/75e6d0ce6394bd2b809823c7f7dc014ddb6ae287/examples/backbone.localStorage.js#L66-L71 | train | |
jashkenas/backbone | examples/backbone.localStorage.js | function() {
return _(this.records).chain()
.map(function(id){
return this.jsonData(this.localStorage().getItem(this.name+"-"+id));
}, this)
.compact()
.value();
} | javascript | function() {
return _(this.records).chain()
.map(function(id){
return this.jsonData(this.localStorage().getItem(this.name+"-"+id));
}, this)
.compact()
.value();
} | [
"function",
"(",
")",
"{",
"return",
"_",
"(",
"this",
".",
"records",
")",
".",
"chain",
"(",
")",
".",
"map",
"(",
"function",
"(",
"id",
")",
"{",
"return",
"this",
".",
"jsonData",
"(",
"this",
".",
"localStorage",
"(",
")",
".",
"getItem",
"... | Return the array of all models currently in storage. | [
"Return",
"the",
"array",
"of",
"all",
"models",
"currently",
"in",
"storage",
"."
] | 75e6d0ce6394bd2b809823c7f7dc014ddb6ae287 | https://github.com/jashkenas/backbone/blob/75e6d0ce6394bd2b809823c7f7dc014ddb6ae287/examples/backbone.localStorage.js#L79-L86 | train | |
jashkenas/backbone | examples/backbone.localStorage.js | function(model) {
if (model.isNew())
return false
this.localStorage().removeItem(this.name+"-"+model.id);
this.records = _.reject(this.records, function(id){
return id === model.id.toString();
});
this.save();
return model;
} | javascript | function(model) {
if (model.isNew())
return false
this.localStorage().removeItem(this.name+"-"+model.id);
this.records = _.reject(this.records, function(id){
return id === model.id.toString();
});
this.save();
return model;
} | [
"function",
"(",
"model",
")",
"{",
"if",
"(",
"model",
".",
"isNew",
"(",
")",
")",
"return",
"false",
"this",
".",
"localStorage",
"(",
")",
".",
"removeItem",
"(",
"this",
".",
"name",
"+",
"\"-\"",
"+",
"model",
".",
"id",
")",
";",
"this",
"... | Delete a model from `this.data`, returning it. | [
"Delete",
"a",
"model",
"from",
"this",
".",
"data",
"returning",
"it",
"."
] | 75e6d0ce6394bd2b809823c7f7dc014ddb6ae287 | https://github.com/jashkenas/backbone/blob/75e6d0ce6394bd2b809823c7f7dc014ddb6ae287/examples/backbone.localStorage.js#L89-L98 | train | |
mozilla/nunjucks | docs/bower_components/bootstrap/assets/js/jszip.js | function (name, data, o) {
// be sure sub folders exist
var parent = parentFolder(name), dataType = JSZip.utils.getTypeOf(data);
if (parent) {
folderAdd.call(this, parent);
}
o = prepareFileAttrs(o);
if (o.dir || data === null || typeof data === "undefined") {
o.b... | javascript | function (name, data, o) {
// be sure sub folders exist
var parent = parentFolder(name), dataType = JSZip.utils.getTypeOf(data);
if (parent) {
folderAdd.call(this, parent);
}
o = prepareFileAttrs(o);
if (o.dir || data === null || typeof data === "undefined") {
o.b... | [
"function",
"(",
"name",
",",
"data",
",",
"o",
")",
"{",
"// be sure sub folders exist",
"var",
"parent",
"=",
"parentFolder",
"(",
"name",
")",
",",
"dataType",
"=",
"JSZip",
".",
"utils",
".",
"getTypeOf",
"(",
"data",
")",
";",
"if",
"(",
"parent",
... | Add a file in the current folder.
@private
@param {string} name the name of the file
@param {String|ArrayBuffer|Uint8Array|Buffer} data the data of the file
@param {Object} o the options of the file
@return {Object} the new file. | [
"Add",
"a",
"file",
"in",
"the",
"current",
"folder",
"."
] | 224645791298db835df0acff3dc596d3a9ed2c4d | https://github.com/mozilla/nunjucks/blob/224645791298db835df0acff3dc596d3a9ed2c4d/docs/bower_components/bootstrap/assets/js/jszip.js#L254-L291 | train | |
mozilla/nunjucks | docs/bower_components/bootstrap/assets/js/jszip.js | function (file, compression) {
var result = new JSZip.CompressedObject(), content;
// the data has not been decompressed, we might reuse things !
if (file._data instanceof JSZip.CompressedObject) {
result.uncompressedSize = file._data.uncompressedSize;
result.crc32 = file._data.crc3... | javascript | function (file, compression) {
var result = new JSZip.CompressedObject(), content;
// the data has not been decompressed, we might reuse things !
if (file._data instanceof JSZip.CompressedObject) {
result.uncompressedSize = file._data.uncompressedSize;
result.crc32 = file._data.crc3... | [
"function",
"(",
"file",
",",
"compression",
")",
"{",
"var",
"result",
"=",
"new",
"JSZip",
".",
"CompressedObject",
"(",
")",
",",
"content",
";",
"// the data has not been decompressed, we might reuse things !",
"if",
"(",
"file",
".",
"_data",
"instanceof",
"J... | Generate a JSZip.CompressedObject for a given zipOject.
@param {ZipObject} file the object to read.
@param {JSZip.compression} compression the compression to use.
@return {JSZip.CompressedObject} the compressed result. | [
"Generate",
"a",
"JSZip",
".",
"CompressedObject",
"for",
"a",
"given",
"zipOject",
"."
] | 224645791298db835df0acff3dc596d3a9ed2c4d | https://github.com/mozilla/nunjucks/blob/224645791298db835df0acff3dc596d3a9ed2c4d/docs/bower_components/bootstrap/assets/js/jszip.js#L333-L368 | train | |
mozilla/nunjucks | docs/bower_components/bootstrap/assets/js/jszip.js | function(name, file, compressedObject, offset) {
var data = compressedObject.compressedContent,
utfEncodedFileName = this.utf8encode(file.name),
useUTF8 = utfEncodedFileName !== file.name,
o = file.options,
dosTime,
dosDate;
// date
// @see http... | javascript | function(name, file, compressedObject, offset) {
var data = compressedObject.compressedContent,
utfEncodedFileName = this.utf8encode(file.name),
useUTF8 = utfEncodedFileName !== file.name,
o = file.options,
dosTime,
dosDate;
// date
// @see http... | [
"function",
"(",
"name",
",",
"file",
",",
"compressedObject",
",",
"offset",
")",
"{",
"var",
"data",
"=",
"compressedObject",
".",
"compressedContent",
",",
"utfEncodedFileName",
"=",
"this",
".",
"utf8encode",
"(",
"file",
".",
"name",
")",
",",
"useUTF8"... | Generate the various parts used in the construction of the final zip file.
@param {string} name the file name.
@param {ZipObject} file the file content.
@param {JSZip.CompressedObject} compressedObject the compressed object.
@param {number} offset the current offset from the start of the zip file.
@return {object} the ... | [
"Generate",
"the",
"various",
"parts",
"used",
"in",
"the",
"construction",
"of",
"the",
"final",
"zip",
"file",
"."
] | 224645791298db835df0acff3dc596d3a9ed2c4d | https://github.com/mozilla/nunjucks/blob/224645791298db835df0acff3dc596d3a9ed2c4d/docs/bower_components/bootstrap/assets/js/jszip.js#L378-L455 | train |
Subsets and Splits
SQL Console for semeru/code-text-javascript
Retrieves 20,000 non-null code samples labeled as JavaScript, providing a basic overview of the dataset.