code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
function nicknameValid(nick) {
// Allow letters, numbers, and underscores
return /^[a-zA-Z0-9_]{1,24}$/.test(nick)
} | Sends data to all clients
channel: if not null, restricts broadcast to clients in the channel | nicknameValid | javascript | AndrewBelt/hack.chat | server.js | https://github.com/AndrewBelt/hack.chat/blob/master/server.js | MIT |
function getAddress(client) {
if (config.x_forwarded_for) {
// The remoteAddress is 127.0.0.1 since if all connections
// originate from a proxy (e.g. nginx).
// You must write the x-forwarded-for header to determine the
// client's real IP address.
return client.upgradeReq.headers['x-forwarded-for']
}
els... | Sends data to all clients
channel: if not null, restricts broadcast to clients in the channel | getAddress | javascript | AndrewBelt/hack.chat | server.js | https://github.com/AndrewBelt/hack.chat/blob/master/server.js | MIT |
function hash(password) {
var sha = crypto.createHash('sha256')
sha.update(password + config.salt)
return sha.digest('base64').substr(0, 6)
} | Sends data to all clients
channel: if not null, restricts broadcast to clients in the channel | hash | javascript | AndrewBelt/hack.chat | server.js | https://github.com/AndrewBelt/hack.chat/blob/master/server.js | MIT |
function isAdmin(client) {
return client.nick == config.admin
} | Sends data to all clients
channel: if not null, restricts broadcast to clients in the channel | isAdmin | javascript | AndrewBelt/hack.chat | server.js | https://github.com/AndrewBelt/hack.chat/blob/master/server.js | MIT |
function isMod(client) {
if (isAdmin(client)) return true
if (config.mods) {
if (client.trip && config.mods.indexOf(client.trip) > -1) {
return true
}
}
return false
} | Sends data to all clients
channel: if not null, restricts broadcast to clients in the channel | isMod | javascript | AndrewBelt/hack.chat | server.js | https://github.com/AndrewBelt/hack.chat/blob/master/server.js | MIT |
render = function(expression, baseNode, options) {
utils.clearNode(baseNode);
var settings = new Settings(options);
var tree = parseTree(expression, settings);
var node = buildTree(tree, expression, settings).toNode();
baseNode.appendChild(node);
} | Parse and build an expression, and place that expression in the DOM node
given. | render | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
renderToString = function(expression, options) {
var settings = new Settings(options);
var tree = parseTree(expression, settings);
return buildTree(tree, expression, settings).toMarkup();
} | Parse and build an expression, and return the markup for that. | renderToString | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
generateParseTree = function(expression, options) {
var settings = new Settings(options);
return parseTree(expression, settings);
} | Parse an expression and return the parse tree. | generateParseTree | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
function Lexer(input) {
this._input = input;
} | The Lexer class handles tokenizing the input in various ways. Since our
parser expects us to be able to backtrack, the lexer allows lexing from any
given starting point.
Its main exposed function is the `lex` function, which takes a position to
lex from and a type of token to lex. It defers to the appropriate `_innerL... | Lexer | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
function Token(text, data, position) {
this.text = text;
this.data = data;
this.position = position;
} | The Lexer class handles tokenizing the input in various ways. Since our
parser expects us to be able to backtrack, the lexer allows lexing from any
given starting point.
Its main exposed function is the `lex` function, which takes a position to
lex from and a type of token to lex. It defers to the appropriate `_innerL... | Token | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
function Options(data) {
this.style = data.style;
this.color = data.color;
this.size = data.size;
this.phantom = data.phantom;
this.font = data.font;
if (data.parentStyle === undefined) {
this.parentStyle = data.style;
} else {
this.parentStyle = data.parentStyle;
}
... | This is the main options class. It contains the style, size, color, and font
of the current parse level. It also contains the style and size of the parent
parse level, so size changes can be handled efficiently.
Each of the `.with*` and `.reset` functions passes its current style and size
as the parentStyle and parent... | Options | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
function ParseError(message, lexer, position) {
var error = "KaTeX parse error: " + message;
if (lexer !== undefined && position !== undefined) {
// If we have the input and a position, make the error a bit fancier
// Prepend some information
error += " at position " + position + ": ";... | This is the ParseError class, which is the main error thrown by KaTeX
functions when something has gone wrong. This is used to distinguish internal
errors from errors in the expression that the user provided. | ParseError | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
function ParseFuncOrArgument(result, isFunction) {
this.result = result;
// Is this a function (i.e. is it something defined in functions.js)?
this.isFunction = isFunction;
} | An initial function (without its arguments), or an argument to a function.
The `result` argument should be a ParseResult. | ParseFuncOrArgument | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
function get(option, defaultValue) {
return option === undefined ? defaultValue : option;
} | Helper function for getting a default value if the value is undefined | get | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
function Settings(options) {
// allow null options
options = options || {};
this.displayMode = get(options.displayMode, false);
} | The main Settings object
The current options stored are:
- displayMode: Whether the expression should be typeset by default in
textstyle or displaystyle (default false) | Settings | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
function Style(id, size, multiplier, cramped) {
this.id = id;
this.size = size;
this.cramped = cramped;
this.sizeMultiplier = multiplier;
} | The main style class. Contains a unique id for the style, a size (which is
the same for cramped and uncramped version of a style), a cramped flag, and a
size multiplier, which gives the size difference between a style and
textstyle. | Style | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
makeSymbol = function(value, style, mode, color, classes) {
// Replace the value with its replaced value from symbol.js
if (symbols[mode][value] && symbols[mode][value].replace) {
value = symbols[mode][value].replace;
}
var metrics = fontMetrics.getCharacterMetrics(value, style);
var symbo... | Makes a symbolNode after translation via the list of symbols in symbols.js.
Correctly pulls out metrics for the character, and optionally takes a list of
classes to be attached to the node. | makeSymbol | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
mathsym = function(value, mode, color, classes) {
// Decide what font to render the symbol in by its entry in the symbols
// table.
if (symbols[mode][value].font === "main") {
return makeSymbol(value, "Main-Regular", mode, color, classes);
} else {
return makeSymbol(
value, "... | Makes a symbol in Main-Regular or AMS-Regular.
Used for rel, bin, open, close, inner, and punct. | mathsym | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
mathDefault = function(value, mode, color, classes, type) {
if (type === "mathord") {
return mathit(value, mode, color, classes);
} else if (type === "textord") {
return makeSymbol(
value, "Main-Regular", mode, color, classes.concat(["mathrm"]));
} else {
throw new Error(... | Makes a symbol in the default font for mathords and textords. | mathDefault | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
mathit = function(value, mode, color, classes) {
if (/[0-9]/.test(value.charAt(0)) ||
utils.contains(["\u0131", "\u0237"], value) ||
utils.contains(greekCapitals, value)) {
return makeSymbol(
value, "Main-Italic", mode, color, classes.concat(["mainit"]));
} else {
ret... | Makes a symbol in the italic math font. | mathit | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
makeOrd = function(group, options, type) {
var mode = group.mode;
var value = group.value;
if (symbols[mode][value] && symbols[mode][value].replace) {
value = symbols[mode][value].replace;
}
var classes = ["mord"];
var color = options.getColor();
var font = options.font;
if (fo... | Makes either a mathord or textord in the correct font and color. | makeOrd | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
sizeElementFromChildren = function(elem) {
var height = 0;
var depth = 0;
var maxFontSize = 0;
if (elem.children) {
for (var i = 0; i < elem.children.length; i++) {
if (elem.children[i].height > height) {
height = elem.children[i].height;
}
if... | Calculate the height, depth, and maxFontSize of an element based on its
children. | sizeElementFromChildren | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
makeSpan = function(classes, children, color) {
var span = new domTree.span(classes, children);
sizeElementFromChildren(span);
if (color) {
span.style.color = color;
}
return span;
} | Makes a span with the given list of classes, list of children, and color. | makeSpan | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
makeFragment = function(children) {
var fragment = new domTree.documentFragment(children);
sizeElementFromChildren(fragment);
return fragment;
} | Makes a document fragment with the given list of children. | makeFragment | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
makeFontSizer = function(options, fontSize) {
var fontSizeInner = makeSpan([], [new domTree.symbolNode("\u200b")]);
fontSizeInner.style.fontSize = (fontSize / options.style.sizeMultiplier) + "em";
var fontSizer = makeSpan(
["fontsize-ensurer", "reset-" + options.size, "size5"],
[fontSizeInn... | Makes an element placed in each of the vlist elements to ensure that each
element has the same max font size. To do this, we create a zero-width space
with the correct font size. | makeFontSizer | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
makeVList = function(children, positionType, positionData, options) {
var depth;
var currPos;
var i;
if (positionType === "individualShift") {
var oldChildren = children;
children = [oldChildren[0]];
// Add in kerns to the list of children to get each element to be
// sh... | Makes a vertical list by stacking elements and kerns on top of each other.
Allows for many different ways of specifying the positioning method.
Arguments:
- children: A list of child or kern nodes to be stacked on top of each other
(i.e. the first element will be at the bottom, and the last at
... | makeVList | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
buildExpression = function(expression, options, prev) {
var groups = [];
for (var i = 0; i < expression.length; i++) {
var group = expression[i];
groups.push(buildGroup(group, options, prev));
prev = group;
}
return groups;
} | Take a list of nodes, build them in order, and return a list of the built
nodes. This function handles the `prev` node correctly, and passes the
previous element from the list as the prev of the next element. | buildExpression | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
getTypeOfGroup = function(group) {
if (group == null) {
// Like when typesetting $^3$
return groupToType.mathord;
} else if (group.type === "supsub") {
return getTypeOfGroup(group.value.base);
} else if (group.type === "llap" || group.type === "rlap") {
return getTypeOfGroup(... | Gets the final math type of an expression, given its group type. This type is
used to determine spacing between elements, and affects bin elements by
causing them to change depending on what types are around them. This type
must be attached to the outermost node of an element as a CSS class so that
spacing with its sur... | getTypeOfGroup | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
shouldHandleSupSub = function(group, options) {
if (!group) {
return false;
} else if (group.type === "op") {
// Operators handle supsubs differently when they have limits
// (e.g. `\displaystyle\sum_2^3`)
return group.value.limits && options.style.size === Style.DISPLAY.size;
... | Sometimes, groups perform special rules when they have superscripts or
subscripts attached to them. This function lets the `supsub` group know that
its inner element should handle the superscripts and subscripts instead of
handling them itself. | shouldHandleSupSub | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
getBaseElem = function(group) {
if (!group) {
return false;
} else if (group.type === "ordgroup") {
if (group.value.length === 1) {
return getBaseElem(group.value[0]);
} else {
return group;
}
} else if (group.type === "color") {
if (group.valu... | Sometimes we want to pull out the innermost element of a group. In most
cases, this will just be the group itself, but when ordgroups and colors have
a single element, we want to pull that out. | getBaseElem | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
isCharacterBox = function(group) {
var baseElem = getBaseElem(group);
// These are all they types of groups which hold single characters
return baseElem.type === "mathord" ||
baseElem.type === "textord" ||
baseElem.type === "bin" ||
baseElem.type === "rel" ||
baseElem.type =... | TeXbook algorithms often reference "character boxes", which are simply groups
with a single character in them. To decide if something is a character box,
we find its innermost group, and see if it is a single character. | isCharacterBox | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
makeNullDelimiter = function(options) {
return makeSpan([
"sizing", "reset-" + options.size, "size5",
options.style.reset(), Style.TEXT.cls(),
"nulldelimiter"
]);
} | TeXbook algorithms often reference "character boxes", which are simply groups
with a single character in them. To decide if something is a character box,
we find its innermost group, and see if it is a single character. | makeNullDelimiter | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
buildGroup = function(group, options, prev) {
if (!group) {
return makeSpan();
}
if (groupTypes[group.type]) {
// Call the groupTypes function
var groupNode = groupTypes[group.type](group, options, prev);
var multiplier;
// If the style changed between the parent an... | buildGroup is the function that takes a group and calls the correct groupType
function for it. It also handles the interaction of size and style changes
between parents and children. | buildGroup | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
buildHTML = function(tree, settings) {
// buildExpression is destructive, so we need to make a clone
// of the incoming tree so that it isn't accidentally changed
tree = JSON.parse(JSON.stringify(tree));
var startStyle = Style.TEXT;
if (settings.displayMode) {
startStyle = Style.DISPLAY;
... | Take an entire parse tree, and build it into an appropriate set of HTML
nodes. | buildHTML | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
makeText = function(text, mode) {
if (symbols[mode][text] && symbols[mode][text].replace) {
text = symbols[mode][text].replace;
}
return new mathMLTree.TextNode(text);
} | Takes a symbol and converts it into a MathML text node after performing
optional replacement from symbols.js. | makeText | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
getVariant = function(group, options) {
var font = options.font;
if (!font) {
return null;
}
var mode = group.mode;
if (font === "mathit") {
return "italic";
}
var value = group.value;
if (utils.contains(["\\imath", "\\jmath"], value)) {
return null;
}
... | Returns the math variant as a string or null if none is required. | getVariant | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
buildExpression = function(expression, options) {
var groups = [];
for (var i = 0; i < expression.length; i++) {
var group = expression[i];
groups.push(buildGroup(group, options));
}
return groups;
} | Takes a list of nodes, builds them, and returns a list of the generated
MathML nodes. A little simpler than the HTML version because we don't do any
previous-node handling. | buildExpression | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
buildGroup = function(group, options) {
if (!group) {
return new mathMLTree.MathNode("mrow");
}
if (groupTypes[group.type]) {
// Call the groupTypes function
return groupTypes[group.type](group, options);
} else {
throw new ParseError(
"Got group of unknown t... | Takes a group from the parser and calls the appropriate groupTypes function
on it to produce a MathML node. | buildGroup | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
buildMathML = function(tree, texExpression, settings) {
settings = settings || new Settings({});
var startStyle = Style.TEXT;
if (settings.displayMode) {
startStyle = Style.DISPLAY;
}
// Setup the default options
var options = new Options({
style: startStyle,
size: "siz... | Takes a full parse tree and settings and builds a MathML representation of
it. In particular, we put the elements from building the parse tree into a
<semantics> tag so we can also include that TeX source as an annotation.
Note that we actually return a domTree element with a `<math>` inside it so
we can do appropriat... | buildMathML | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
buildTree = function(tree, expression, settings) {
// `buildHTML` sometimes messes with the parse tree (like turning bins ->
// ords), so we build the MathML version first.
var mathMLNode = buildMathML(tree, expression, settings);
var htmlNode = buildHTML(tree, settings);
var katexNode = makeSpan([... | Takes a full parse tree and settings and builds a MathML representation of
it. In particular, we put the elements from building the parse tree into a
<semantics> tag so we can also include that TeX source as an annotation.
Note that we actually return a domTree element with a `<math>` inside it so
we can do appropriat... | buildTree | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
getMetrics = function(symbol, font) {
if (symbols.math[symbol] && symbols.math[symbol].replace) {
return fontMetrics.getCharacterMetrics(
symbols.math[symbol].replace, font);
} else {
return fontMetrics.getCharacterMetrics(
symbol, font);
}
} | Get the metrics for a given symbol and font, after transformation (i.e.
after following replacement from symbols.js) | getMetrics | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
mathrmSize = function(value, size, mode) {
return buildCommon.makeSymbol(value, "Size" + size + "-Regular", mode);
} | Builds a symbol in the given font size (note size is an integer) | mathrmSize | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
createClass = function(classes) {
classes = classes.slice();
for (var i = classes.length - 1; i >= 0; i--) {
if (!classes[i]) {
classes.splice(i, 1);
}
}
return classes.join(" ");
} | Create an HTML className based on a list of classes. In addition to joining
with spaces, we also remove null or empty classes. | createClass | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
function span(classes, children, height, depth, maxFontSize, style) {
this.classes = classes || [];
this.children = children || [];
this.height = height || 0;
this.depth = depth || 0;
this.maxFontSize = maxFontSize || 0;
this.style = style || {};
this.attributes = {};
} | This node represents a span node, with a className, a list of children, and
an inline style. It also contains information about its height, depth, and
maxFontSize. | span | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
function documentFragment(children, height, depth, maxFontSize) {
this.children = children || [];
this.height = height || 0;
this.depth = depth || 0;
this.maxFontSize = maxFontSize || 0;
} | This node represents a document fragment, which contains elements, but when
placed into the DOM doesn't have any representation itself. Thus, it only
contains children and doesn't have any HTML properties. It also keeps track
of a height, depth, and maxFontSize. | documentFragment | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
function symbolNode(value, height, depth, italic, skew, classes, style) {
this.value = value || "";
this.height = height || 0;
this.depth = depth || 0;
this.italic = italic || 0;
this.skew = skew || 0;
this.classes = classes || [];
this.style = style || {};
this.maxFontSize = 0;
} | A symbol node contains information about a single symbol. It either renders
to a single text node, or a span with a single text node in it, depending on
whether it has CSS classes, styles, or needs italic correction. | symbolNode | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
getCharacterMetrics = function(character, style) {
return metricMap[style][character.charCodeAt(0)];
} | This function is a convience function for looking up information in the
metricMap table. It takes a character as a string, and a style | getCharacterMetrics | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
addFuncsWithData = function(funcs, data) {
for (var i = 0; i < funcs.length; i++) {
functions[funcs[i]] = data;
}
} | This function is a convience function for looking up information in the
metricMap table. It takes a character as a string, and a style | addFuncsWithData | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
function MathNode(type, children) {
this.type = type;
this.attributes = {};
this.children = children || [];
} | This node represents a general purpose MathML node of any type. The
constructor requires the type of node to create (for example, `"mo"` or
`"mspace"`, corresponding to `<mo>` and `<mspace>` tags). | MathNode | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
function TextNode(text) {
this.text = text;
} | This node represents a piece of text. | TextNode | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
function ParseNode(type, value, mode) {
this.type = type;
this.value = value;
this.mode = mode;
} | The resulting parse tree nodes of the parse tree. | ParseNode | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
function ParseResult(result, newPosition, peek) {
this.result = result;
this.position = newPosition;
} | A result and final position returned by the `.parse...` functions. | ParseResult | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
parseTree = function(toParse, settings) {
var parser = new Parser(toParse, settings);
return parser.parse();
} | Parses an expression using a Parser, then returns the parsed result. | parseTree | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
indexOf = function(list, elem) {
if (list == null) {
return -1;
}
if (nativeIndexOf && list.indexOf === nativeIndexOf) {
return list.indexOf(elem);
}
var i = 0, l = list.length;
for (; i < l; i++) {
if (list[i] === elem) {
return i;
}
}
return ... | Provide an `indexOf` function which works in IE8, but defers to native if
possible. | indexOf | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
contains = function(list, elem) {
return indexOf(list, elem) !== -1;
} | Return whether an element is contained in a list | contains | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
deflt = function(setting, defaultIfUndefined) {
return setting === undefined ? defaultIfUndefined : setting;
} | Provide a default value if a setting is undefined | deflt | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
hyphenate = function(str) {
return str.replace(uppercase, "-$1").toLowerCase();
} | Provide a default value if a setting is undefined | hyphenate | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
function escaper(match) {
return ESCAPE_LOOKUP[match];
} | Provide a default value if a setting is undefined | escaper | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
function escape(text) {
return ("" + text).replace(ESCAPE_REGEX, escaper);
} | Escapes text to prevent scripting attacks.
@param {*} text Text value to escape.
@return {string} An escaped string. | escape | javascript | AndrewBelt/hack.chat | client/katex/katex.js | https://github.com/AndrewBelt/hack.chat/blob/master/client/katex/katex.js | MIT |
optionsToArray(obj, optionsPrefix, hasEquals) {
optionsPrefix = optionsPrefix || '--'
var ret = []
Object.keys(obj).forEach((key) => {
ret.push(optionsPrefix + key + (hasEquals ? '=' : ''))
if (obj[key]) {
ret.push(obj[key])
}
})
return ret
} | Convert an options object into a valid arguments array for the child_process.spawn method
from:
var options = {
foo: 'hello',
baz: 'world'
}
to:
['--foo=', 'hello', '--baz=','world']
@param { Object } obj - object we need to convert
@param { Array } optionsPrefix - use a prefix for the new array c... | optionsToArray | javascript | GianlucaGuarini/es6-project-starter-kit | tasks/_utils.js | https://github.com/GianlucaGuarini/es6-project-starter-kit/blob/master/tasks/_utils.js | MIT |
extend(obj1, obj2) {
for (var i in obj2) {
if (obj2.hasOwnProperty(i)) {
obj1[i] = obj2[i]
}
}
return obj1
} | Simple object extend function
@param { Object } obj1 - destination
@param { Object } obj2 - source
@returns { Object } - destination object | extend | javascript | GianlucaGuarini/es6-project-starter-kit | tasks/_utils.js | https://github.com/GianlucaGuarini/es6-project-starter-kit/blob/master/tasks/_utils.js | MIT |
exec(command, args, envVariables) {
var path = require('path'),
os = require('os')
return new Promise(function(resolve, reject) {
if (os.platform() == 'win32' || os.platform() == 'win64') command += '.cmd'
// extend the env variables with some other custom options
utils.e... | Run any system command
@param { String } command - command to execute
@param { Array } args - command arguments
@param { Object } envVariables - command environment variables
@returns { Promise } chainable promise object | exec | javascript | GianlucaGuarini/es6-project-starter-kit | tasks/_utils.js | https://github.com/GianlucaGuarini/es6-project-starter-kit/blob/master/tasks/_utils.js | MIT |
listFiles(path, mustDelete) {
utils.print(`Listing all the files in the folder: ${path}`, 'confirm')
var files = []
if (fs.existsSync(path)) {
var tmpFiles = fs.readdirSync(path)
tmpFiles.forEach((file) => {
var curPath = path + '/' + file
files.push(curPath)
... | Read all the files crawling starting from a certain folder path
@param { String } path directory path
@param { bool } mustDelete delete the files found
@returns { Array } files path list | listFiles | javascript | GianlucaGuarini/es6-project-starter-kit | tasks/_utils.js | https://github.com/GianlucaGuarini/es6-project-starter-kit/blob/master/tasks/_utils.js | MIT |
clean(path) {
var files = utils.listFiles(path, true)
utils.print(`Deleting the following files: \n ${files.join('\n')}`, 'cool')
} | Delete synchronously any folder or file
@param { String } path - path to clean | clean | javascript | GianlucaGuarini/es6-project-starter-kit | tasks/_utils.js | https://github.com/GianlucaGuarini/es6-project-starter-kit/blob/master/tasks/_utils.js | MIT |
print(msg, type) {
var color
switch (type) {
case 'error':
color = '\x1B[31m'
break
case 'warning':
color = '\x1B[33m'
break
case 'confirm':
color = '\x1B[32m'
break
case 'cool':
color = '\x1B[36m'
break
default:
... | Log messages in the terminal using custom colors
@param { String } msg - message to output
@param { String } type - message type to handle the right color | print | javascript | GianlucaGuarini/es6-project-starter-kit | tasks/_utils.js | https://github.com/GianlucaGuarini/es6-project-starter-kit/blob/master/tasks/_utils.js | MIT |
function markFunction( fn ) {
fn[ expando ] = true;
return fn;
} | Mark a function for special use by Sizzle
@param {Function} fn The function to mark | markFunction | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function assert( fn ) {
var div = document.createElement("div");
try {
return !!fn( div );
} catch (e) {
return false;
} finally {
// Remove from its parent by default
if ( div.parentNode ) {
div.parentNode.removeChild( div );
}
// release memory in IE
div = null;
}
} | Support testing using an element
@param {Function} fn Passed the created div and expects a boolean result | assert | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function addHandle( attrs, handler ) {
var arr = attrs.split("|"),
i = attrs.length;
while ( i-- ) {
Expr.attrHandle[ arr[i] ] = handler;
}
} | Adds the same handler for all of the specified attrs
@param {String} attrs Pipe-separated list of attributes
@param {Function} handler The method that will be applied | addHandle | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function siblingCheck( a, b ) {
var cur = b && a,
diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
( ~b.sourceIndex || MAX_NEGATIVE ) -
( ~a.sourceIndex || MAX_NEGATIVE );
// Use IE sourceIndex if available on both nodes
if ( diff ) {
return diff;
}
// Check if b follows a
if ( cur ) {
while ( ... | Checks document order of two siblings
@param {Element} a
@param {Element} b
@returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b | siblingCheck | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function createInputPseudo( type ) {
return function( elem ) {
var name = elem.nodeName.toLowerCase();
return name === "input" && elem.type === type;
};
} | Returns a function to use in pseudos for input types
@param {String} type | createInputPseudo | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function createButtonPseudo( type ) {
return function( elem ) {
var name = elem.nodeName.toLowerCase();
return (name === "input" || name === "button") && elem.type === type;
};
} | Returns a function to use in pseudos for buttons
@param {String} type | createButtonPseudo | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function createPositionalPseudo( fn ) {
return markFunction(function( argument ) {
argument = +argument;
return markFunction(function( seed, matches ) {
var j,
matchIndexes = fn( [], seed.length, argument ),
i = matchIndexes.length;
// Match elements found at the specified indexes
while ( i-- ) {... | Returns a function to use in pseudos for positionals
@param {Function} fn | createPositionalPseudo | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function testContext( context ) {
return context && typeof context.getElementsByTagName !== strundefined && context;
} | Checks a node for validity as a Sizzle context
@param {Element|Object=} context
@returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value | testContext | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function toSelector( tokens ) {
var i = 0,
len = tokens.length,
selector = "";
for ( ; i < len; i++ ) {
selector += tokens[i].value;
}
return selector;
} | Utility function for retrieving the text value of an array of DOM nodes
@param {Array|Element} elem | toSelector | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function addCombinator( matcher, combinator, base ) {
var dir = combinator.dir,
checkNonElements = base && dir === "parentNode",
doneName = done++;
return combinator.first ?
// Check against closest ancestor/preceding element
function( elem, context, xml ) {
while ( (elem = elem[ dir ]) ) {
if ( elem.... | Utility function for retrieving the text value of an array of DOM nodes
@param {Array|Element} elem | addCombinator | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function elementMatcher( matchers ) {
return matchers.length > 1 ?
function( elem, context, xml ) {
var i = matchers.length;
while ( i-- ) {
if ( !matchers[i]( elem, context, xml ) ) {
return false;
}
}
return true;
} :
matchers[0];
} | Utility function for retrieving the text value of an array of DOM nodes
@param {Array|Element} elem | elementMatcher | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function multipleContexts( selector, contexts, results ) {
var i = 0,
len = contexts.length;
for ( ; i < len; i++ ) {
Sizzle( selector, contexts[i], results );
}
return results;
} | Utility function for retrieving the text value of an array of DOM nodes
@param {Array|Element} elem | multipleContexts | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function condense( unmatched, map, filter, context, xml ) {
var elem,
newUnmatched = [],
i = 0,
len = unmatched.length,
mapped = map != null;
for ( ; i < len; i++ ) {
if ( (elem = unmatched[i]) ) {
if ( !filter || filter( elem, context, xml ) ) {
newUnmatched.push( elem );
if ( mapped ) {
m... | Utility function for retrieving the text value of an array of DOM nodes
@param {Array|Element} elem | condense | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
if ( postFilter && !postFilter[ expando ] ) {
postFilter = setMatcher( postFilter );
}
if ( postFinder && !postFinder[ expando ] ) {
postFinder = setMatcher( postFinder, postSelector );
}
return markFunction(function( s... | Utility function for retrieving the text value of an array of DOM nodes
@param {Array|Element} elem | setMatcher | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function matcherFromTokens( tokens ) {
var checkContext, matcher, j,
len = tokens.length,
leadingRelative = Expr.relative[ tokens[0].type ],
implicitRelative = leadingRelative || Expr.relative[" "],
i = leadingRelative ? 1 : 0,
// The foundational matcher ensures that elements are reachable from top-level c... | Utility function for retrieving the text value of an array of DOM nodes
@param {Array|Element} elem | matcherFromTokens | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
var bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function( seed, context, xml, results, outermost ) {
var elem, j, matcher,
matchedCount = 0,
i = "0",
unmatched = seed && [],
setMatched ... | Utility function for retrieving the text value of an array of DOM nodes
@param {Array|Element} elem | matcherFromGroupMatchers | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
superMatcher = function( seed, context, xml, results, outermost ) {
var elem, j, matcher,
matchedCount = 0,
i = "0",
unmatched = seed && [],
setMatched = [],
contextBackup = outermostContext,
// We must always have either seed elements or outermost context
elems = seed || byElement && Exp... | Utility function for retrieving the text value of an array of DOM nodes
@param {Array|Element} elem | superMatcher | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function winnow( elements, qualifier, not ) {
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep( elements, function( elem, i ) {
/* jshint -W018 */
return !!qualifier.call( elem, i, elem ) !== not;
});
}
if ( qualifier.nodeType ) {
return jQuery.grep( elements, function( elem ) {
return ( e... | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | winnow | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function sibling( cur, dir ) {
do {
cur = cur[ dir ];
} while ( cur && cur.nodeType !== 1 );
return cur;
} | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | sibling | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function createOptions( options ) {
var object = optionsCache[ options ] = {};
jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
object[ flag ] = true;
});
return object;
} | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | createOptions | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
fire = function( data ) {
memory = options.memory && data;
fired = true;
firingIndex = firingStart || 0;
firingStart = 0;
firingLength = list.length;
firing = true;
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && ... | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | fire | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
updateFunc = function( i, contexts, values ) {
return function( value ) {
contexts[ i ] = this;
values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
if ( values === progressValues ) {
deferred.notifyWith( contexts, values );
} else if ( !(--remaining) ) {
deferred.r... | A low-level selection function that works with Sizzle's compiled
selector functions
@param {String|Function} selector A selector or a pre-compiled
selector function built with Sizzle.compile
@param {Element} context
@param {Array} [results]
@param {Array} [seed] A set of elements to match against | updateFunc | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function detach() {
if ( document.addEventListener ) {
document.removeEventListener( "DOMContentLoaded", completed, false );
window.removeEventListener( "load", completed, false );
} else {
document.detachEvent( "onreadystatechange", completed );
window.detachEvent( "onload", completed );
}
} | Clean-up method for dom ready events | detach | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function completed() {
// readyState === "complete" is good enough for us to call the dom ready in oldIE
if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
detach();
jQuery.ready();
}
} | The ready event handler and self cleanup method | completed | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function dataAttr( elem, key, data ) {
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
if ( data === undefined && elem.nodeType === 1 ) {
var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
data = elem.getAttribute( name );
if ( typeof data === "... | Determines whether an object can have data | dataAttr | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function isEmptyDataObject( obj ) {
var name;
for ( name in obj ) {
// if the public data object is empty, the private is still empty
if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
continue;
}
if ( name !== "toJSON" ) {
return false;
}
}
return true;
} | Determines whether an object can have data | isEmptyDataObject | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
var ret, thisCache,
internalKey = jQuery.expando,
// We have to handle DOM nodes and JS objects differently because IE6-7
// can't GC object references properly across the DOM-JS boundary
... | Determines whether an object can have data | internalData | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function internalRemoveData( elem, name, pvt ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
var thisCache, i,
isNode = elem.nodeType,
// See jQuery.data for more information
cache = isNode ? jQuery.cache : elem,
id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
// If there is already no cache e... | Determines whether an object can have data | internalRemoveData | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
next = function() {
jQuery.dequeue( elem, type );
} | Determines whether an object can have data | next | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
resolve = function() {
if ( !( --count ) ) {
defer.resolveWith( elements, [ elements ] );
}
} | Determines whether an object can have data | resolve | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
isHidden = function( elem, el ) {
// isHidden might be called from jQuery#filter function;
// in that case, element will be second argument
elem = el || elem;
return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
} | Determines whether an object can have data | isHidden | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function returnTrue() {
return true;
} | Determines whether an object can have data | returnTrue | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function returnFalse() {
return false;
} | Determines whether an object can have data | returnFalse | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
function safeActiveElement() {
try {
return document.activeElement;
} catch ( err ) { }
} | Determines whether an object can have data | safeActiveElement | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
handler = function( event ) {
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
} | Determines whether an object can have data | handler | javascript | lodge/lodge | public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.