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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
neyric/webhookit | public/javascripts/yui/stylesheet/stylesheet.js | function (name,sheet) {
return !!(name && sheet instanceof StyleSheet &&
!sheets[name] && (sheets[name] = sheet));
} | javascript | function (name,sheet) {
return !!(name && sheet instanceof StyleSheet &&
!sheets[name] && (sheets[name] = sheet));
} | [
"function",
"(",
"name",
",",
"sheet",
")",
"{",
"return",
"!",
"!",
"(",
"name",
"&&",
"sheet",
"instanceof",
"StyleSheet",
"&&",
"!",
"sheets",
"[",
"name",
"]",
"&&",
"(",
"sheets",
"[",
"name",
"]",
"=",
"sheet",
")",
")",
";",
"}"
] | Registers a StyleSheet instance in the static registry by the given name
@method StyleSheet.register
@param name {String} the name to assign the StyleSheet in the registry
@param sheet {StyleSheet} The StyleSheet instance
@return {Boolean} false if no name or sheet is not a StyleSheet
instance. true otherwise.
@static | [
"Registers",
"a",
"StyleSheet",
"instance",
"in",
"the",
"static",
"registry",
"by",
"the",
"given",
"name"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/stylesheet/stylesheet.js#L502-L505 | train | |
neyric/webhookit | public/javascripts/yui/treeview/treeview-debug.js | function(el, node) {
this.logger.log("animating expand");
if (this._expandAnim && this._animCount < this.maxAnim) {
// this.locked = true;
var tree = this;
var a = Widget.TVAnim.getAnim(this._expandAnim, el,
function() { tree.expandComple... | javascript | function(el, node) {
this.logger.log("animating expand");
if (this._expandAnim && this._animCount < this.maxAnim) {
// this.locked = true;
var tree = this;
var a = Widget.TVAnim.getAnim(this._expandAnim, el,
function() { tree.expandComple... | [
"function",
"(",
"el",
",",
"node",
")",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"\"animating expand\"",
")",
";",
"if",
"(",
"this",
".",
"_expandAnim",
"&&",
"this",
".",
"_animCount",
"<",
"this",
".",
"maxAnim",
")",
"{",
"// this.locked = true;... | Perform the expand animation if configured, or just show the
element if not configured or too many animations are in progress
@method animateExpand
@param el {HTMLElement} the element to animate
@param node {YAHOO.util.Node} the node that was expanded
@return {boolean} true if animation could be invoked, false otherwis... | [
"Perform",
"the",
"expand",
"animation",
"if",
"configured",
"or",
"just",
"show",
"the",
"element",
"if",
"not",
"configured",
"or",
"too",
"many",
"animations",
"are",
"in",
"progress"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview-debug.js#L182-L203 | train | |
neyric/webhookit | public/javascripts/yui/treeview/treeview-debug.js | function(el, node) {
this.logger.log("animating collapse");
if (this._collapseAnim && this._animCount < this.maxAnim) {
// this.locked = true;
var tree = this;
var a = Widget.TVAnim.getAnim(this._collapseAnim, el,
function() { tree.collap... | javascript | function(el, node) {
this.logger.log("animating collapse");
if (this._collapseAnim && this._animCount < this.maxAnim) {
// this.locked = true;
var tree = this;
var a = Widget.TVAnim.getAnim(this._collapseAnim, el,
function() { tree.collap... | [
"function",
"(",
"el",
",",
"node",
")",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"\"animating collapse\"",
")",
";",
"if",
"(",
"this",
".",
"_collapseAnim",
"&&",
"this",
".",
"_animCount",
"<",
"this",
".",
"maxAnim",
")",
"{",
"// this.locked = t... | Perform the collapse animation if configured, or just show the
element if not configured or too many animations are in progress
@method animateCollapse
@param el {HTMLElement} the element to animate
@param node {YAHOO.util.Node} the node that was expanded
@return {boolean} true if animation could be invoked, false othe... | [
"Perform",
"the",
"collapse",
"animation",
"if",
"configured",
"or",
"just",
"show",
"the",
"element",
"if",
"not",
"configured",
"or",
"too",
"many",
"animations",
"are",
"in",
"progress"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview-debug.js#L213-L234 | train | |
neyric/webhookit | public/javascripts/yui/treeview/treeview-debug.js | function(node) {
if (node.expanded) {
// wait until the animation is complete before deleting to
// avoid javascript errors
if (this._collapseAnim) {
this.subscribe("animComplete",
this._removeChildren_animComplete, this, true);
... | javascript | function(node) {
if (node.expanded) {
// wait until the animation is complete before deleting to
// avoid javascript errors
if (this._collapseAnim) {
this.subscribe("animComplete",
this._removeChildren_animComplete, this, true);
... | [
"function",
"(",
"node",
")",
"{",
"if",
"(",
"node",
".",
"expanded",
")",
"{",
"// wait until the animation is complete before deleting to",
"// avoid javascript errors",
"if",
"(",
"this",
".",
"_collapseAnim",
")",
"{",
"this",
".",
"subscribe",
"(",
"\"animComp... | Deletes this nodes child collection, recursively. Also collapses
the node, and resets the dynamic load flag. The primary use for
this method is to purge a node and allow it to fetch its data
dynamically again.
@method removeChildren
@param {Node} node the node to purge | [
"Deletes",
"this",
"nodes",
"child",
"collection",
"recursively",
".",
"Also",
"collapses",
"the",
"node",
"and",
"resets",
"the",
"dynamic",
"load",
"flag",
".",
"The",
"primary",
"use",
"for",
"this",
"method",
"is",
"to",
"purge",
"a",
"node",
"and",
"a... | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview-debug.js#L1130-L1158 | train | |
neyric/webhookit | public/javascripts/yui/treeview/treeview-debug.js | function(node) {
this.logger.log("insertAfter: " + node);
var p = node.parent;
if (p) {
if (this.tree) {
this.tree.popNode(this);
}
var refIndex = node.isChildOf(p);
this.logger.log(refIndex);
if (!node.nextSibling) {... | javascript | function(node) {
this.logger.log("insertAfter: " + node);
var p = node.parent;
if (p) {
if (this.tree) {
this.tree.popNode(this);
}
var refIndex = node.isChildOf(p);
this.logger.log(refIndex);
if (!node.nextSibling) {... | [
"function",
"(",
"node",
")",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"\"insertAfter: \"",
"+",
"node",
")",
";",
"var",
"p",
"=",
"node",
".",
"parent",
";",
"if",
"(",
"p",
")",
"{",
"if",
"(",
"this",
".",
"tree",
")",
"{",
"this",
".",... | Inserts this node after the supplied node
@method insertAfter
@param node {Node} the node to insert after
@return {Node} the inserted node | [
"Inserts",
"this",
"node",
"after",
"the",
"supplied",
"node"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview-debug.js#L1836-L1864 | train | |
neyric/webhookit | public/javascripts/yui/treeview/treeview-debug.js | function() {
// this.logger.log("No children, " + " isDyanmic: " + this.isDynamic() + " expanded: " + this.expanded);
if (this.isLoading) {
this.logger.log("returning the loading icon");
return "ygtvloading";
} else {
// location top or bottom, middle nodes al... | javascript | function() {
// this.logger.log("No children, " + " isDyanmic: " + this.isDynamic() + " expanded: " + this.expanded);
if (this.isLoading) {
this.logger.log("returning the loading icon");
return "ygtvloading";
} else {
// location top or bottom, middle nodes al... | [
"function",
"(",
")",
"{",
"// this.logger.log(\"No children, \" + \" isDyanmic: \" + this.isDynamic() + \" expanded: \" + this.expanded);",
"if",
"(",
"this",
".",
"isLoading",
")",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"\"returning the loading icon\"",
")",
";",
"r... | Returns the css style name for the toggle
@method getStyle
@return {string} the css class for this node's toggle | [
"Returns",
"the",
"css",
"style",
"name",
"for",
"the",
"toggle"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview-debug.js#L2154-L2173 | train | |
neyric/webhookit | public/javascripts/yui/treeview/treeview-debug.js | function() {
this.logger.log("rendering children for " + this.index);
var node = this;
if (this.isDynamic() && !this.dynamicLoadComplete) {
this.isLoading = true;
this.tree.locked = true;
if (this.dataLoader) {
this.logger.log("Using dynami... | javascript | function() {
this.logger.log("rendering children for " + this.index);
var node = this;
if (this.isDynamic() && !this.dynamicLoadComplete) {
this.isLoading = true;
this.tree.locked = true;
if (this.dataLoader) {
this.logger.log("Using dynami... | [
"function",
"(",
")",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"\"rendering children for \"",
"+",
"this",
".",
"index",
")",
";",
"var",
"node",
"=",
"this",
";",
"if",
"(",
"this",
".",
"isDynamic",
"(",
")",
"&&",
"!",
"this",
".",
"dynamicLoa... | Generates the markup for the child nodes. This is not done until the node
is expanded.
@method renderChildren
@return {string} the html for this node's children
@private | [
"Generates",
"the",
"markup",
"for",
"the",
"child",
"nodes",
".",
"This",
"is",
"not",
"done",
"until",
"the",
"node",
"is",
"expanded",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview-debug.js#L2373-L2415 | train | |
neyric/webhookit | public/javascripts/yui/treeview/treeview-debug.js | function() {
this.logger.log(this.index + " loadComplete, children: " + this.children.length);
this.getChildrenEl().innerHTML = this.completeRender();
if (this.propagateHighlightDown) {
if (this.highlightState === 1 && !this.tree.singleNodeHighlight) {
for (var i = 0; i < this.children.length; ... | javascript | function() {
this.logger.log(this.index + " loadComplete, children: " + this.children.length);
this.getChildrenEl().innerHTML = this.completeRender();
if (this.propagateHighlightDown) {
if (this.highlightState === 1 && !this.tree.singleNodeHighlight) {
for (var i = 0; i < this.children.length; ... | [
"function",
"(",
")",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"this",
".",
"index",
"+",
"\" loadComplete, children: \"",
"+",
"this",
".",
"children",
".",
"length",
")",
";",
"this",
".",
"getChildrenEl",
"(",
")",
".",
"innerHTML",
"=",
"this",
... | Load complete is the callback function we pass to the data provider
in dynamic load situations.
@method loadComplete | [
"Load",
"complete",
"is",
"the",
"callback",
"function",
"we",
"pass",
"to",
"the",
"data",
"provider",
"in",
"dynamic",
"load",
"situations",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview-debug.js#L2441-L2460 | train | |
neyric/webhookit | public/javascripts/yui/treeview/treeview-debug.js | function() {
this.logger.log("Generating html");
var sb = [];
sb[sb.length] = '<table id="ygtvtableel' + this.index + '" border="0" cellpadding="0" cellspacing="0" class="ygtvtable ygtvdepth' + this.depth;
if (this.enableHighlight) {
sb[sb.length] = ' ygtv-highlight' + this... | javascript | function() {
this.logger.log("Generating html");
var sb = [];
sb[sb.length] = '<table id="ygtvtableel' + this.index + '" border="0" cellpadding="0" cellspacing="0" class="ygtvtable ygtvdepth' + this.depth;
if (this.enableHighlight) {
sb[sb.length] = ' ygtv-highlight' + this... | [
"function",
"(",
")",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"\"Generating html\"",
")",
";",
"var",
"sb",
"=",
"[",
"]",
";",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"'<table id=\"ygtvtableel'",
"+",
"this",
".",
"index",
"+",
"'\" border=\"0\... | Get the markup for the node. This may be overrided so that we can
support different types of nodes.
@method getNodeHtml
@return {string} The HTML that will render this node. | [
"Get",
"the",
"markup",
"for",
"the",
"node",
".",
"This",
"may",
"be",
"overrided",
"so",
"that",
"we",
"can",
"support",
"different",
"types",
"of",
"nodes",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview-debug.js#L2503-L2537 | train | |
neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(r, g, b) {
if (isArray(r)) {
return this.rgb2hex.apply(this, r);
}
var f=this.dec2hex;
return f(r) + f(g) + f(b);
} | javascript | function(r, g, b) {
if (isArray(r)) {
return this.rgb2hex.apply(this, r);
}
var f=this.dec2hex;
return f(r) + f(g) + f(b);
} | [
"function",
"(",
"r",
",",
"g",
",",
"b",
")",
"{",
"if",
"(",
"isArray",
"(",
"r",
")",
")",
"{",
"return",
"this",
".",
"rgb2hex",
".",
"apply",
"(",
"this",
",",
"r",
")",
";",
"}",
"var",
"f",
"=",
"this",
".",
"dec2hex",
";",
"return",
... | Converts decimal rgb values into a hex string
255,255,255 -> FFFFFF
@method rgb2hex
@param r {int|[int, int, int]} the red value, or an
array containing all three parameters
@param g {int} the green value
@param b {int} the blue value
@return {string} the hex string | [
"Converts",
"decimal",
"rgb",
"values",
"into",
"a",
"hex",
"string",
"255",
"255",
"255",
"-",
">",
"FFFFFF"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L121-L128 | train | |
neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(n) {
n = parseInt(n,10)|0;
n = (n > 255 || n < 0) ? 0 : n;
return (ZERO+n.toString(16)).slice(-2).toUpperCase();
} | javascript | function(n) {
n = parseInt(n,10)|0;
n = (n > 255 || n < 0) ? 0 : n;
return (ZERO+n.toString(16)).slice(-2).toUpperCase();
} | [
"function",
"(",
"n",
")",
"{",
"n",
"=",
"parseInt",
"(",
"n",
",",
"10",
")",
"|",
"0",
";",
"n",
"=",
"(",
"n",
">",
"255",
"||",
"n",
"<",
"0",
")",
"?",
"0",
":",
"n",
";",
"return",
"(",
"ZERO",
"+",
"n",
".",
"toString",
"(",
"16... | Converts an int 0...255 to hex pair 00...FF
@method dec2hex
@param n {int} the number to convert
@return {string} the hex equivalent | [
"Converts",
"an",
"int",
"0",
"...",
"255",
"to",
"hex",
"pair",
"00",
"...",
"FF"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L136-L141 | train | |
neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(s) {
var f = this.hex2dec;
return [f(s.slice(0, 2)), f(s.slice(2, 4)), f(s.slice(4, 6))];
} | javascript | function(s) {
var f = this.hex2dec;
return [f(s.slice(0, 2)), f(s.slice(2, 4)), f(s.slice(4, 6))];
} | [
"function",
"(",
"s",
")",
"{",
"var",
"f",
"=",
"this",
".",
"hex2dec",
";",
"return",
"[",
"f",
"(",
"s",
".",
"slice",
"(",
"0",
",",
"2",
")",
")",
",",
"f",
"(",
"s",
".",
"slice",
"(",
"2",
",",
"4",
")",
")",
",",
"f",
"(",
"s",
... | Converts a hex string to rgb
@method hex2rgb
@param str {string} the hex string
@return {[int, int, int]} an array containing the rgb values | [
"Converts",
"a",
"hex",
"string",
"to",
"rgb"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L159-L162 | train | |
neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(r, g, b) {
if (isArray(r)) {
return this.websafe.apply(this, r);
}
// returns the closest match [0, 51, 102, 153, 204, 255]
var f = function(v) {
if (isNumber(v)) {
v = Math.min(Math.max(0, v), 255);
... | javascript | function(r, g, b) {
if (isArray(r)) {
return this.websafe.apply(this, r);
}
// returns the closest match [0, 51, 102, 153, 204, 255]
var f = function(v) {
if (isNumber(v)) {
v = Math.min(Math.max(0, v), 255);
... | [
"function",
"(",
"r",
",",
"g",
",",
"b",
")",
"{",
"if",
"(",
"isArray",
"(",
"r",
")",
")",
"{",
"return",
"this",
".",
"websafe",
".",
"apply",
"(",
"this",
",",
"r",
")",
";",
"}",
"// returns the closest match [0, 51, 102, 153, 204, 255]",
"var",
... | Returns the closest websafe color to the supplied rgb value.
@method websafe
@param r {int|[int, int, int]} the red value, or an
array containing all three parameters
@param g {int} the green value
@param b {int} the blue value
@return {[int, int, int]} an array containing the closes
websafe rgb colors. | [
"Returns",
"the",
"closest",
"websafe",
"color",
"to",
"the",
"supplied",
"rgb",
"value",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L174-L197 | train | |
neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | ColorPicker | function ColorPicker(el, attr) {
_pickercount = _pickercount + 1;
attr = attr || {};
if (arguments.length === 1 && !YAHOO.lang.isString(el) && !el.nodeName) {
attr = el; // treat first arg as attr object
el = attr.element || null;
}
if (!el && !at... | javascript | function ColorPicker(el, attr) {
_pickercount = _pickercount + 1;
attr = attr || {};
if (arguments.length === 1 && !YAHOO.lang.isString(el) && !el.nodeName) {
attr = el; // treat first arg as attr object
el = attr.element || null;
}
if (!el && !at... | [
"function",
"ColorPicker",
"(",
"el",
",",
"attr",
")",
"{",
"_pickercount",
"=",
"_pickercount",
"+",
"1",
";",
"attr",
"=",
"attr",
"||",
"{",
"}",
";",
"if",
"(",
"arguments",
".",
"length",
"===",
"1",
"&&",
"!",
"YAHOO",
".",
"lang",
".",
"isS... | A widget to select colors
@namespace YAHOO.widget
@class YAHOO.widget.ColorPicker
@extends YAHOO.util.Element
@constructor
@param {HTMLElement | String | Object} el(optional) The html
element that represents the colorpicker, or the attribute object to use.
An element will be created if none provided.
@param {Object} at... | [
"A",
"widget",
"to",
"select",
"colors"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L233-L248 | train |
neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function () {
var el = document.createElement('div');
if (this.CSS.BASE) {
el.className = this.CSS.BASE;
}
return el;
} | javascript | function () {
var el = document.createElement('div');
if (this.CSS.BASE) {
el.className = this.CSS.BASE;
}
return el;
} | [
"function",
"(",
")",
"{",
"var",
"el",
"=",
"document",
".",
"createElement",
"(",
"'div'",
")",
";",
"if",
"(",
"this",
".",
"CSS",
".",
"BASE",
")",
"{",
"el",
".",
"className",
"=",
"this",
".",
"CSS",
".",
"BASE",
";",
"}",
"return",
"el",
... | Creates the host element if it doesn't exist
@method _createHostElement
@protected | [
"Creates",
"the",
"host",
"element",
"if",
"it",
"doesn",
"t",
"exist"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L545-L553 | train | |
neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(rgb, silent) {
silent = (silent) || false;
this.set(this.OPT.RGB, rgb, silent);
this._updateSliders();
} | javascript | function(rgb, silent) {
silent = (silent) || false;
this.set(this.OPT.RGB, rgb, silent);
this._updateSliders();
} | [
"function",
"(",
"rgb",
",",
"silent",
")",
"{",
"silent",
"=",
"(",
"silent",
")",
"||",
"false",
";",
"this",
".",
"set",
"(",
"this",
".",
"OPT",
".",
"RGB",
",",
"rgb",
",",
"silent",
")",
";",
"this",
".",
"_updateSliders",
"(",
")",
";",
... | Sets the control to the specified rgb value and
moves the sliders to the proper positions
@method setValue
@param rgb {[int, int, int]} the rgb value
@param silent {boolean} whether or not to fire the change event | [
"Sets",
"the",
"control",
"to",
"the",
"specified",
"rgb",
"value",
"and",
"moves",
"the",
"sliders",
"to",
"the",
"proper",
"positions"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L614-L618 | train | |
neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function() {
var rgb = this.get(this.OPT.RGB),
websafe = this.get(this.OPT.WEBSAFE),
el = this.getElement(this.ID.SWATCH),
color = rgb.join(","),
txt = this.get(this.OPT.TXT);
Dom.setStyle(el, "background-color", "rgb(" + color + ... | javascript | function() {
var rgb = this.get(this.OPT.RGB),
websafe = this.get(this.OPT.WEBSAFE),
el = this.getElement(this.ID.SWATCH),
color = rgb.join(","),
txt = this.get(this.OPT.TXT);
Dom.setStyle(el, "background-color", "rgb(" + color + ... | [
"function",
"(",
")",
"{",
"var",
"rgb",
"=",
"this",
".",
"get",
"(",
"this",
".",
"OPT",
".",
"RGB",
")",
",",
"websafe",
"=",
"this",
".",
"get",
"(",
"this",
".",
"OPT",
".",
"WEBSAFE",
")",
",",
"el",
"=",
"this",
".",
"getElement",
"(",
... | Updates the background of the swatch with the current rbg value.
Also updates the websafe swatch to the closest websafe color
@method _updateSwatch
@protected | [
"Updates",
"the",
"background",
"of",
"the",
"swatch",
"with",
"the",
"current",
"rbg",
"value",
".",
"Also",
"updates",
"the",
"websafe",
"swatch",
"to",
"the",
"closest",
"websafe",
"color"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L675-L696 | train | |
neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(e) {
var c = Event.getCharCode(e);
//alert(Event.getCharCode(e) + ", " + e.keyCode + ", " + e.charCode);
// special keys
if (c === 38) { // up arrow
return 3;
} else if (c === 13) { // return
return 6;
} e... | javascript | function(e) {
var c = Event.getCharCode(e);
//alert(Event.getCharCode(e) + ", " + e.keyCode + ", " + e.charCode);
// special keys
if (c === 38) { // up arrow
return 3;
} else if (c === 13) { // return
return 6;
} e... | [
"function",
"(",
"e",
")",
"{",
"var",
"c",
"=",
"Event",
".",
"getCharCode",
"(",
"e",
")",
";",
"//alert(Event.getCharCode(e) + \", \" + e.keyCode + \", \" + e.charCode);",
"// special keys",
"if",
"(",
"c",
"===",
"38",
")",
"{",
"// up arrow",
"return",
"3",
... | Key map to well-known commands for txt field input
@method _getCommand
@param e {Event} the keypress or keydown event
@return {int} a command code
<ul>
<li>0 = not a number, letter in range, or special key</li>
<li>1 = number</li>
<li>2 = a-fA-F</li>
<li>3 = increment (up arrow)</li>
<li>4 = decrement (down arrow)</li>... | [
"Key",
"map",
"to",
"well",
"-",
"known",
"commands",
"for",
"txt",
"field",
"input"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L790-L817 | train | |
neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(e, el, prop) {
var val = el.value;
if (prop !== this.OPT.HEX) {
val = parseInt(val, 10);
}
if (val !== this.get(prop)) {
this.set(prop, val);
}
} | javascript | function(e, el, prop) {
var val = el.value;
if (prop !== this.OPT.HEX) {
val = parseInt(val, 10);
}
if (val !== this.get(prop)) {
this.set(prop, val);
}
} | [
"function",
"(",
"e",
",",
"el",
",",
"prop",
")",
"{",
"var",
"val",
"=",
"el",
".",
"value",
";",
"if",
"(",
"prop",
"!==",
"this",
".",
"OPT",
".",
"HEX",
")",
"{",
"val",
"=",
"parseInt",
"(",
"val",
",",
"10",
")",
";",
"}",
"if",
"(",... | Use the value of the text field to update the control
@method _useFieldValue
@param e {Event} an event
@param el {HTMLElement} the field
@param prop {string} the key to the linked property
@protected | [
"Use",
"the",
"value",
"of",
"the",
"text",
"field",
"to",
"update",
"the",
"control"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L827-L837 | train | |
neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(e, el, prop) {
var command = this._getCommand(e),
inc = (e.shiftKey) ? 10 : 1;
switch (command) {
case 6: // return, update the value
this._useFieldValue.apply(this, arguments);
break;
... | javascript | function(e, el, prop) {
var command = this._getCommand(e),
inc = (e.shiftKey) ? 10 : 1;
switch (command) {
case 6: // return, update the value
this._useFieldValue.apply(this, arguments);
break;
... | [
"function",
"(",
"e",
",",
"el",
",",
"prop",
")",
"{",
"var",
"command",
"=",
"this",
".",
"_getCommand",
"(",
"e",
")",
",",
"inc",
"=",
"(",
"e",
".",
"shiftKey",
")",
"?",
"10",
":",
"1",
";",
"switch",
"(",
"command",
")",
"{",
"case",
"... | Handle keypress on one of the rgb or hsv fields.
@method _rgbFieldKeypress
@param e {Event} the keypress event
@param el {HTMLElement} the field
@param prop {string} the key to the linked property
@protected | [
"Handle",
"keypress",
"on",
"one",
"of",
"the",
"rgb",
"or",
"hsv",
"fields",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L847-L869 | train | |
neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(e, el, prop) {
var command = this._getCommand(e);
if (command === 6) { // return, update the value
this._useFieldValue.apply(this, arguments);
}
} | javascript | function(e, el, prop) {
var command = this._getCommand(e);
if (command === 6) { // return, update the value
this._useFieldValue.apply(this, arguments);
}
} | [
"function",
"(",
"e",
",",
"el",
",",
"prop",
")",
"{",
"var",
"command",
"=",
"this",
".",
"_getCommand",
"(",
"e",
")",
";",
"if",
"(",
"command",
"===",
"6",
")",
"{",
"// return, update the value",
"this",
".",
"_useFieldValue",
".",
"apply",
"(",
... | Handle keydown on the hex field
@method _hexFieldKeypress
@param e {Event} the keypress event
@param el {HTMLElement} the field
@param prop {string} the key to the linked property
@protected | [
"Handle",
"keydown",
"on",
"the",
"hex",
"field"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L879-L884 | train | |
neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(e, numbersOnly) {
var command = this._getCommand(e);
switch (command) {
case 6: // return
case 5: // special char
case 1: // number
break;
case 2: // hex char (a-f)
if (numbersOnly !=... | javascript | function(e, numbersOnly) {
var command = this._getCommand(e);
switch (command) {
case 6: // return
case 5: // special char
case 1: // number
break;
case 2: // hex char (a-f)
if (numbersOnly !=... | [
"function",
"(",
"e",
",",
"numbersOnly",
")",
"{",
"var",
"command",
"=",
"this",
".",
"_getCommand",
"(",
"e",
")",
";",
"switch",
"(",
"command",
")",
"{",
"case",
"6",
":",
"// return",
"case",
"5",
":",
"// special char",
"case",
"1",
":",
"// n... | Allows numbers and special chars, and by default allows a-f.
Used for the hex field keypress handler.
@method _hexOnly
@param e {Event} the event
@param numbersOnly omits a-f if set to true
@protected
@return {boolean} false if we are canceling the event | [
"Allows",
"numbers",
"and",
"special",
"chars",
"and",
"by",
"default",
"allows",
"a",
"-",
"f",
".",
"Used",
"for",
"the",
"hex",
"field",
"keypress",
"handler",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L895-L913 | train | |
neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function () {
var ID = this.ID,
O = this.OPT;
this.hueSlider.subscribe("change",
this._onHueSliderChange, this, true);
this.pickerSlider.subscribe("change",
this._onPickerSliderChange, this, true);
Event.on(this.getElemen... | javascript | function () {
var ID = this.ID,
O = this.OPT;
this.hueSlider.subscribe("change",
this._onHueSliderChange, this, true);
this.pickerSlider.subscribe("change",
this._onPickerSliderChange, this, true);
Event.on(this.getElemen... | [
"function",
"(",
")",
"{",
"var",
"ID",
"=",
"this",
".",
"ID",
",",
"O",
"=",
"this",
".",
"OPT",
";",
"this",
".",
"hueSlider",
".",
"subscribe",
"(",
"\"change\"",
",",
"this",
".",
"_onHueSliderChange",
",",
"this",
",",
"true",
")",
";",
"this... | Adds event listeners to Sliders and UI elements. Wires everything
up.
@method _bindUI
@protected | [
"Adds",
"event",
"listeners",
"to",
"Sliders",
"and",
"UI",
"elements",
".",
"Wires",
"everything",
"up",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L1305-L1339 | train | |
neyric/webhookit | public/javascripts/yui/colorpicker/colorpicker.js | function(id, on) {
var el = (lang.isString(id) ? this.getElement(id) : id);
Dom.setStyle(el, "display", (on) ? "" : "none");
} | javascript | function(id, on) {
var el = (lang.isString(id) ? this.getElement(id) : id);
Dom.setStyle(el, "display", (on) ? "" : "none");
} | [
"function",
"(",
"id",
",",
"on",
")",
"{",
"var",
"el",
"=",
"(",
"lang",
".",
"isString",
"(",
"id",
")",
"?",
"this",
".",
"getElement",
"(",
"id",
")",
":",
"id",
")",
";",
"Dom",
".",
"setStyle",
"(",
"el",
",",
"\"display\"",
",",
"(",
... | Returns the cached element reference. If the id is not a string, it
is assumed that it is an element and this is returned.
@param id {string|HTMLElement} the element key, id, or ref
@param on {boolean} hide or show. If true, show
@protected | [
"Returns",
"the",
"cached",
"element",
"reference",
".",
"If",
"the",
"id",
"is",
"not",
"a",
"string",
"it",
"is",
"assumed",
"that",
"it",
"is",
"an",
"element",
"and",
"this",
"is",
"returned",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/colorpicker/colorpicker.js#L1413-L1416 | train | |
jacoborus/node-filesaver | src/Filesaver.js | function (options) {
var x;
options = options || {};
// Store folders
this.folders = options.folders || {};
this.safenames = options.safenames || false;
// check for existing folders
for (x in this.folders) {
if (!fs.existsSync( this.folders[x] )){
// create folder if not exists
mkdirp( this.folders[x] ... | javascript | function (options) {
var x;
options = options || {};
// Store folders
this.folders = options.folders || {};
this.safenames = options.safenames || false;
// check for existing folders
for (x in this.folders) {
if (!fs.existsSync( this.folders[x] )){
// create folder if not exists
mkdirp( this.folders[x] ... | [
"function",
"(",
"options",
")",
"{",
"var",
"x",
";",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"// Store folders",
"this",
".",
"folders",
"=",
"options",
".",
"folders",
"||",
"{",
"}",
";",
"this",
".",
"safenames",
"=",
"options",
".",
"sa... | Filesaver constructor.
Options:
- folders: *Object* with folder routes
- safename: *Boolean* use safe name for files
Example:
```js
var folders = {
images: './images',
books: './books'
}
var filesaver = new Filesaver({
folders: folders,
safenames: true
});
```
@param {Object} options folders and safenames | [
"Filesaver",
"constructor",
"."
] | 14a6868b1e6e094c3c4a26b471fde4eb63198423 | https://github.com/jacoborus/node-filesaver/blob/14a6868b1e6e094c3c4a26b471fde4eb63198423/src/Filesaver.js#L102-L116 | train | |
neyric/webhookit | public/javascripts/inputex/js/widgets/Dialog.js | function (callback) {
var fn, scope;
fn = callback.fn;
scope = callback.scope;
if (this.formAvailable) {
fn.call(scope);
} else {
this.formAvailableEvt.subscribe(fn, scope, true);
}
} | javascript | function (callback) {
var fn, scope;
fn = callback.fn;
scope = callback.scope;
if (this.formAvailable) {
fn.call(scope);
} else {
this.formAvailableEvt.subscribe(fn, scope, true);
}
} | [
"function",
"(",
"callback",
")",
"{",
"var",
"fn",
",",
"scope",
";",
"fn",
"=",
"callback",
".",
"fn",
";",
"scope",
"=",
"callback",
".",
"scope",
";",
"if",
"(",
"this",
".",
"formAvailable",
")",
"{",
"fn",
".",
"call",
"(",
"scope",
")",
";... | Execute a callback as soon as the form is available
@param {Object} callback An object like {fn: my_function, scope: my_scope} | [
"Execute",
"a",
"callback",
"as",
"soon",
"as",
"the",
"form",
"is",
"available"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/widgets/Dialog.js#L115-L128 | train | |
neyric/webhookit | public/javascripts/yui/container/container-debug.js | function (key, value, silent) {
var property;
key = key.toLowerCase();
YAHOO.log("setProperty: " + key + "=" + value, "info", "Config");
if (this.queueInProgress && ! silent) {
// Currently running through a queue...
... | javascript | function (key, value, silent) {
var property;
key = key.toLowerCase();
YAHOO.log("setProperty: " + key + "=" + value, "info", "Config");
if (this.queueInProgress && ! silent) {
// Currently running through a queue...
... | [
"function",
"(",
"key",
",",
"value",
",",
"silent",
")",
"{",
"var",
"property",
";",
"key",
"=",
"key",
".",
"toLowerCase",
"(",
")",
";",
"YAHOO",
".",
"log",
"(",
"\"setProperty: \"",
"+",
"key",
"+",
"\"=\"",
"+",
"value",
",",
"\"info\"",
",",
... | Sets the value of a property. If the silent property is passed as
true, the property's event will not be fired.
@method setProperty
@param {String} key The name of the property
@param {String} value The value to set the property to
@param {Boolean} silent Whether the value should be set silently,
without firing the pro... | [
"Sets",
"the",
"value",
"of",
"a",
"property",
".",
"If",
"the",
"silent",
"property",
"is",
"passed",
"as",
"true",
"the",
"property",
"s",
"event",
"will",
"not",
"be",
"fired",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container-debug.js#L274-L303 | train | |
neyric/webhookit | public/javascripts/yui/container/container-debug.js | function (key, value) {
key = key.toLowerCase();
YAHOO.log("queueProperty: " + key + "=" + value, "info", "Config");
var property = this.config[key],
foundDuplicate = false,
iLen,
queueItem,
queueItemKe... | javascript | function (key, value) {
key = key.toLowerCase();
YAHOO.log("queueProperty: " + key + "=" + value, "info", "Config");
var property = this.config[key],
foundDuplicate = false,
iLen,
queueItem,
queueItemKe... | [
"function",
"(",
"key",
",",
"value",
")",
"{",
"key",
"=",
"key",
".",
"toLowerCase",
"(",
")",
";",
"YAHOO",
".",
"log",
"(",
"\"queueProperty: \"",
"+",
"key",
"+",
"\"=\"",
"+",
"value",
",",
"\"info\"",
",",
"\"Config\"",
")",
";",
"var",
"prope... | Sets the value of a property and queues its event to execute. If the
event is already scheduled to execute, it is
moved from its current position to the end of the queue.
@method queueProperty
@param {String} key The name of the property
@param {String} value The value to set the property to
@return {Boolean} true, if... | [
"Sets",
"the",
"value",
"of",
"a",
"property",
"and",
"queues",
"its",
"event",
"to",
"execute",
".",
"If",
"the",
"event",
"is",
"already",
"scheduled",
"to",
"execute",
"it",
"is",
"moved",
"from",
"its",
"current",
"position",
"to",
"the",
"end",
"of"... | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container-debug.js#L315-L422 | train | |
neyric/webhookit | public/javascripts/yui/container/container-debug.js | function (type, args, obj) {
var pos = args[0],
x = pos[0],
y = pos[1];
this.cfg.setProperty("x", x);
this.cfg.setProperty("y", y);
this.beforeMoveEvent.fire([x, y]);
x = this.cfg.getProperty("x");
y = this.cfg.g... | javascript | function (type, args, obj) {
var pos = args[0],
x = pos[0],
y = pos[1];
this.cfg.setProperty("x", x);
this.cfg.setProperty("y", y);
this.beforeMoveEvent.fire([x, y]);
x = this.cfg.getProperty("x");
y = this.cfg.g... | [
"function",
"(",
"type",
",",
"args",
",",
"obj",
")",
"{",
"var",
"pos",
"=",
"args",
"[",
"0",
"]",
",",
"x",
"=",
"pos",
"[",
"0",
"]",
",",
"y",
"=",
"pos",
"[",
"1",
"]",
";",
"this",
".",
"cfg",
".",
"setProperty",
"(",
"\"x\"",
",",
... | The default event handler fired when the "xy" property is changed.
@method configXY
@param {String} type The CustomEvent type (usually the property name)
@param {Object[]} args The CustomEvent arguments. For configuration
handlers, args[0] will equal the newly applied value for the property.
@param {Object} obj The sco... | [
"The",
"default",
"event",
"handler",
"fired",
"when",
"the",
"xy",
"property",
"is",
"changed",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container-debug.js#L3058-L3076 | train | |
neyric/webhookit | public/javascripts/yui/container/container-debug.js | function () {
var me = this;
me.logger.log("Setting hide tooltip timeout", "time");
return setTimeout(function () {
me.logger.log("Hide tooltip", "time");
me.hide();
}, this.cfg.getProperty("autodismissdelay"));
} | javascript | function () {
var me = this;
me.logger.log("Setting hide tooltip timeout", "time");
return setTimeout(function () {
me.logger.log("Hide tooltip", "time");
me.hide();
}, this.cfg.getProperty("autodismissdelay"));
} | [
"function",
"(",
")",
"{",
"var",
"me",
"=",
"this",
";",
"me",
".",
"logger",
".",
"log",
"(",
"\"Setting hide tooltip timeout\"",
",",
"\"time\"",
")",
";",
"return",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"me",
".",
"logger",
".",
"log",
"(",... | Sets the timeout for the auto-dismiss delay, which by default is 5
seconds, meaning that a tooltip will automatically dismiss itself
after 5 seconds of being displayed.
@method doHide | [
"Sets",
"the",
"timeout",
"for",
"the",
"auto",
"-",
"dismiss",
"delay",
"which",
"by",
"default",
"is",
"5",
"seconds",
"meaning",
"that",
"a",
"tooltip",
"will",
"automatically",
"dismiss",
"itself",
"after",
"5",
"seconds",
"of",
"being",
"displayed",
"."... | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container-debug.js#L5436-L5449 | train | |
neyric/webhookit | public/javascripts/yui/container/container-debug.js | function (pageX, pageY) {
var height = this.element.offsetHeight,
mousePoint = new YAHOO.util.Point(pageX, pageY),
elementRegion = Dom.getRegion(this.element);
elementRegion.top -= 5;
elementRegion.left -= 5;
elementRegion... | javascript | function (pageX, pageY) {
var height = this.element.offsetHeight,
mousePoint = new YAHOO.util.Point(pageX, pageY),
elementRegion = Dom.getRegion(this.element);
elementRegion.top -= 5;
elementRegion.left -= 5;
elementRegion... | [
"function",
"(",
"pageX",
",",
"pageY",
")",
"{",
"var",
"height",
"=",
"this",
".",
"element",
".",
"offsetHeight",
",",
"mousePoint",
"=",
"new",
"YAHOO",
".",
"util",
".",
"Point",
"(",
"pageX",
",",
"pageY",
")",
",",
"elementRegion",
"=",
"Dom",
... | Fired when the Tooltip is moved, this event handler is used to
prevent the Tooltip from overlapping with its context element.
@method preventOverlay
@param {Number} pageX The x coordinate position of the mouse pointer
@param {Number} pageY The y coordinate position of the mouse pointer | [
"Fired",
"when",
"the",
"Tooltip",
"is",
"moved",
"this",
"event",
"handler",
"is",
"used",
"to",
"prevent",
"the",
"Tooltip",
"from",
"overlapping",
"with",
"its",
"context",
"element",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container-debug.js#L5458-L5476 | train | |
neyric/webhookit | public/javascripts/yui/profiler/profiler.js | function(name, method){
//create instrumented version of function
var newMethod = function () {
var start = new Date(),
retval = method.apply(this, arguments),
stop = new Date();
saveDataPoint(... | javascript | function(name, method){
//create instrumented version of function
var newMethod = function () {
var start = new Date(),
retval = method.apply(this, arguments),
stop = new Date();
saveDataPoint(... | [
"function",
"(",
"name",
",",
"method",
")",
"{",
"//create instrumented version of function",
"var",
"newMethod",
"=",
"function",
"(",
")",
"{",
"var",
"start",
"=",
"new",
"Date",
"(",
")",
",",
"retval",
"=",
"method",
".",
"apply",
"(",
"this",
",",
... | Instruments a method to have profiling calls.
@param {String} name The name of the report for the function.
@param {Function} method The function to instrument.
@return {Function} An instrumented version of the function.
@method instrument
@static | [
"Instruments",
"a",
"method",
"to",
"have",
"profiling",
"calls",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/profiler/profiler.js#L142-L173 | train | |
neyric/webhookit | public/javascripts/yui/profiler/profiler.js | function () {
var start = new Date(),
retval = method.apply(this, arguments),
stop = new Date();
saveDataPoint(name, stop-start);
return retval;
} | javascript | function () {
var start = new Date(),
retval = method.apply(this, arguments),
stop = new Date();
saveDataPoint(name, stop-start);
return retval;
} | [
"function",
"(",
")",
"{",
"var",
"start",
"=",
"new",
"Date",
"(",
")",
",",
"retval",
"=",
"method",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
",",
"stop",
"=",
"new",
"Date",
"(",
")",
";",
"saveDataPoint",
"(",
"name",
",",
"stop",
"-... | create instrumented version of function | [
"create",
"instrumented",
"version",
"of",
"function"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/profiler/profiler.js#L145-L155 | train | |
neyric/webhookit | public/javascripts/yui/profiler/profiler.js | function(name){
if(container[name]){
throw new Error("Cannot use '" + name + "' for profiling through start(), name is already in use.");
} else {
//create report if necessary
if (!report[name]){
createReport(name);... | javascript | function(name){
if(container[name]){
throw new Error("Cannot use '" + name + "' for profiling through start(), name is already in use.");
} else {
//create report if necessary
if (!report[name]){
createReport(name);... | [
"function",
"(",
"name",
")",
"{",
"if",
"(",
"container",
"[",
"name",
"]",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Cannot use '\"",
"+",
"name",
"+",
"\"' for profiling through start(), name is already in use.\"",
")",
";",
"}",
"else",
"{",
"//create repor... | Start profiling information for a given name. The name cannot be the name
of a registered function or object. This is used to start timing for a
particular block of code rather than instrumenting the entire function.
@param {String} name The name of the data point.
@return {Void}
@method start
@static | [
"Start",
"profiling",
"information",
"for",
"a",
"given",
"name",
".",
"The",
"name",
"cannot",
"be",
"the",
"name",
"of",
"a",
"registered",
"function",
"or",
"object",
".",
"This",
"is",
"used",
"to",
"start",
"timing",
"for",
"a",
"particular",
"block",... | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/profiler/profiler.js#L207-L232 | train | |
neyric/webhookit | public/javascripts/yui/profiler/profiler.js | function(name){
var now = new Date(),
stopwatch = stopwatches[name];
if (stopwatch){
if (stopwatch.state == WATCH_STARTED){
saveDataPoint(name, stopwatch.total + (now - stopwatch.start));
} e... | javascript | function(name){
var now = new Date(),
stopwatch = stopwatches[name];
if (stopwatch){
if (stopwatch.state == WATCH_STARTED){
saveDataPoint(name, stopwatch.total + (now - stopwatch.start));
} e... | [
"function",
"(",
"name",
")",
"{",
"var",
"now",
"=",
"new",
"Date",
"(",
")",
",",
"stopwatch",
"=",
"stopwatches",
"[",
"name",
"]",
";",
"if",
"(",
"stopwatch",
")",
"{",
"if",
"(",
"stopwatch",
".",
"state",
"==",
"WATCH_STARTED",
")",
"{",
"sa... | Stops profiling information for a given name.
@param {String} name The name of the data point.
@return {Void}
@method stop
@static | [
"Stops",
"profiling",
"information",
"for",
"a",
"given",
"name",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/profiler/profiler.js#L241-L257 | train | |
neyric/webhookit | public/javascripts/yui/profiler/profiler.js | function(name /*:String*/, owner /*:Object*/, registerPrototype /*:Boolean*/) /*:Void*/{
//figure out the function name without namespacing
var funcName = (name.indexOf(".") > -1 ?
name.substring(name.lastIndexOf(".")+1) : name),
method,
... | javascript | function(name /*:String*/, owner /*:Object*/, registerPrototype /*:Boolean*/) /*:Void*/{
//figure out the function name without namespacing
var funcName = (name.indexOf(".") > -1 ?
name.substring(name.lastIndexOf(".")+1) : name),
method,
... | [
"function",
"(",
"name",
"/*:String*/",
",",
"owner",
"/*:Object*/",
",",
"registerPrototype",
"/*:Boolean*/",
")",
"/*:Void*/",
"{",
"//figure out the function name without namespacing",
"var",
"funcName",
"=",
"(",
"name",
".",
"indexOf",
"(",
"\".\"",
")",
">",
"... | Sets up a function for profiling. It essentially overwrites the function with one
that has instrumentation data. This method also creates an entry for the function
in the profile report. The original function is stored on the container object.
@param {String} name The full name of the function including namespacing. Th... | [
"Sets",
"up",
"a",
"function",
"for",
"profiling",
".",
"It",
"essentially",
"overwrites",
"the",
"function",
"with",
"one",
"that",
"has",
"instrumentation",
"data",
".",
"This",
"method",
"also",
"creates",
"an",
"entry",
"for",
"the",
"function",
"in",
"t... | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/profiler/profiler.js#L396-L434 | train | |
neyric/webhookit | lib/controllers/users.js | get_user_collection | function get_user_collection(req, res, next) {
app.db.collection('users', function(error, user_collection) {
if(error) { throw error; }
else {
req.user_collection = user_collection;
next();
}
});
} | javascript | function get_user_collection(req, res, next) {
app.db.collection('users', function(error, user_collection) {
if(error) { throw error; }
else {
req.user_collection = user_collection;
next();
}
});
} | [
"function",
"get_user_collection",
"(",
"req",
",",
"res",
",",
"next",
")",
"{",
"app",
".",
"db",
".",
"collection",
"(",
"'users'",
",",
"function",
"(",
"error",
",",
"user_collection",
")",
"{",
"if",
"(",
"error",
")",
"{",
"throw",
"error",
";",... | store the user collection into req.user_collection | [
"store",
"the",
"user",
"collection",
"into",
"req",
".",
"user_collection"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/lib/controllers/users.js#L4-L12 | train |
neyric/webhookit | public/javascripts/inputex/js/fields/SerializeField-beta.js | function() {
this.subfieldWrapper = inputEx.cn('div', {className: "inputEx-SerializedField-SubFieldWrapper"});
this.fieldContainer.appendChild( this.subfieldWrapper );
var config = {parentEl: this.subfieldWrapper};
lang.augmentObject(config, this.options.subfield);
this.subField = inputEx... | javascript | function() {
this.subfieldWrapper = inputEx.cn('div', {className: "inputEx-SerializedField-SubFieldWrapper"});
this.fieldContainer.appendChild( this.subfieldWrapper );
var config = {parentEl: this.subfieldWrapper};
lang.augmentObject(config, this.options.subfield);
this.subField = inputEx... | [
"function",
"(",
")",
"{",
"this",
".",
"subfieldWrapper",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"\"inputEx-SerializedField-SubFieldWrapper\"",
"}",
")",
";",
"this",
".",
"fieldContainer",
".",
"appendChild",
"(",
"this",
".",
... | Render the subfield | [
"Render",
"the",
"subfield"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/fields/SerializeField-beta.js#L34-L42 | train | |
neyric/webhookit | public/javascripts/inputex/js/fields/SerializeField-beta.js | function() {
inputEx.SerializeField.superclass.initEvents.call(this);
this.subField.updatedEvt.subscribe(this.fireUpdatedEvt, this, true);
} | javascript | function() {
inputEx.SerializeField.superclass.initEvents.call(this);
this.subField.updatedEvt.subscribe(this.fireUpdatedEvt, this, true);
} | [
"function",
"(",
")",
"{",
"inputEx",
".",
"SerializeField",
".",
"superclass",
".",
"initEvents",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"subField",
".",
"updatedEvt",
".",
"subscribe",
"(",
"this",
".",
"fireUpdatedEvt",
",",
"this",
",",
"tr... | Subscribe the subField | [
"Subscribe",
"the",
"subField"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/fields/SerializeField-beta.js#L47-L50 | train | |
neyric/webhookit | public/javascripts/inputex/js/fields/SerializeField-beta.js | function(o) {
if(!XML || !YAHOO.lang.isFunction(XML.ObjTree) ) {
alert("ObjTree.js not loaded.");
return null;
}
var xotree = new XML.ObjTree();
return xotree.writeXML(o);
} | javascript | function(o) {
if(!XML || !YAHOO.lang.isFunction(XML.ObjTree) ) {
alert("ObjTree.js not loaded.");
return null;
}
var xotree = new XML.ObjTree();
return xotree.writeXML(o);
} | [
"function",
"(",
"o",
")",
"{",
"if",
"(",
"!",
"XML",
"||",
"!",
"YAHOO",
".",
"lang",
".",
"isFunction",
"(",
"XML",
".",
"ObjTree",
")",
")",
"{",
"alert",
"(",
"\"ObjTree.js not loaded.\"",
")",
";",
"return",
"null",
";",
"}",
"var",
"xotree",
... | serialize to XML
@static | [
"serialize",
"to",
"XML"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/fields/SerializeField-beta.js#L131-L138 | train | |
neyric/webhookit | public/javascripts/inputex/js/fields/SerializeField-beta.js | function(sValue) {
if(!XML || !YAHOO.lang.isFunction(XML.ObjTree) ) {
alert("ObjTree.js not loaded.");
return null;
}
var xotree = new XML.ObjTree();
var tree = xotree.parseXML( sValue );
return tree;
} | javascript | function(sValue) {
if(!XML || !YAHOO.lang.isFunction(XML.ObjTree) ) {
alert("ObjTree.js not loaded.");
return null;
}
var xotree = new XML.ObjTree();
var tree = xotree.parseXML( sValue );
return tree;
} | [
"function",
"(",
"sValue",
")",
"{",
"if",
"(",
"!",
"XML",
"||",
"!",
"YAHOO",
".",
"lang",
".",
"isFunction",
"(",
"XML",
".",
"ObjTree",
")",
")",
"{",
"alert",
"(",
"\"ObjTree.js not loaded.\"",
")",
";",
"return",
"null",
";",
"}",
"var",
"xotre... | deserialize from XML
@static | [
"deserialize",
"from",
"XML"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/fields/SerializeField-beta.js#L144-L152 | train | |
neyric/webhookit | server.js | function(req, res){
return function(){
var buf = [],
messages = req.flash(),
types = Object.keys(messages),
len = types.length;
if (!len) {
return '';
}
buf.push('<div id="messages">');
for (var i = 0 ; i < ... | javascript | function(req, res){
return function(){
var buf = [],
messages = req.flash(),
types = Object.keys(messages),
len = types.length;
if (!len) {
return '';
}
buf.push('<div id="messages">');
for (var i = 0 ; i < ... | [
"function",
"(",
"req",
",",
"res",
")",
"{",
"return",
"function",
"(",
")",
"{",
"var",
"buf",
"=",
"[",
"]",
",",
"messages",
"=",
"req",
".",
"flash",
"(",
")",
",",
"types",
"=",
"Object",
".",
"keys",
"(",
"messages",
")",
",",
"len",
"="... | req.flash to html helper | [
"req",
".",
"flash",
"to",
"html",
"helper"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/server.js#L70-L93 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | Slider | function Slider(sElementId, sGroup, oThumb, sType) {
Slider.ANIM_AVAIL = (!YAHOO.lang.isUndefined(YAHOO.util.Anim));
if (sElementId) {
this.init(sElementId, sGroup, true);
this.initSlider(sType);
this.initThumb(oThumb);
}
} | javascript | function Slider(sElementId, sGroup, oThumb, sType) {
Slider.ANIM_AVAIL = (!YAHOO.lang.isUndefined(YAHOO.util.Anim));
if (sElementId) {
this.init(sElementId, sGroup, true);
this.initSlider(sType);
this.initThumb(oThumb);
}
} | [
"function",
"Slider",
"(",
"sElementId",
",",
"sGroup",
",",
"oThumb",
",",
"sType",
")",
"{",
"Slider",
".",
"ANIM_AVAIL",
"=",
"(",
"!",
"YAHOO",
".",
"lang",
".",
"isUndefined",
"(",
"YAHOO",
".",
"util",
".",
"Anim",
")",
")",
";",
"if",
"(",
"... | A DragDrop implementation that can be used as a background for a
slider. It takes a reference to the thumb instance
so it can delegate some of the events to it. The goal is to make the
thumb jump to the location on the background when the background is
clicked.
@class Slider
@extends YAHOO.util.DragDrop
@uses YAHOO.... | [
"A",
"DragDrop",
"implementation",
"that",
"can",
"be",
"used",
"as",
"a",
"background",
"for",
"a",
"slider",
".",
"It",
"takes",
"a",
"reference",
"to",
"the",
"thumb",
"instance",
"so",
"it",
"can",
"delegate",
"some",
"of",
"the",
"events",
"to",
"it... | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L43-L52 | train |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function (sBGElId, sHandleElId, iUp, iDown, iTickSize) {
return new Slider(sBGElId, sBGElId,
new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, 0, 0,
iUp, iDown, iTickSize), "vert");
} | javascript | function (sBGElId, sHandleElId, iUp, iDown, iTickSize) {
return new Slider(sBGElId, sBGElId,
new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, 0, 0,
iUp, iDown, iTickSize), "vert");
} | [
"function",
"(",
"sBGElId",
",",
"sHandleElId",
",",
"iUp",
",",
"iDown",
",",
"iTickSize",
")",
"{",
"return",
"new",
"Slider",
"(",
"sBGElId",
",",
"sBGElId",
",",
"new",
"YAHOO",
".",
"widget",
".",
"SliderThumb",
"(",
"sHandleElId",
",",
"sBGElId",
"... | Factory method for creating a vertical slider
@method YAHOO.widget.Slider.getVertSlider
@static
@param {String} sBGElId the id of the slider's background element
@param {String} sHandleElId the id of the thumb element
@param {int} iUp the number of pixels the element can move up
@param {int} iDown the number of pixels ... | [
"Factory",
"method",
"for",
"creating",
"a",
"vertical",
"slider"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L87-L91 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function(t) {
var self = this;
/**
* A YAHOO.widget.SliderThumb instance that we will use to
* reposition the thumb when the background is clicked
* @property thumb
* @type YAHOO.widget.SliderThumb
*/
this.thumb = t;
t.cacheBetweenDrags = ... | javascript | function(t) {
var self = this;
/**
* A YAHOO.widget.SliderThumb instance that we will use to
* reposition the thumb when the background is clicked
* @property thumb
* @type YAHOO.widget.SliderThumb
*/
this.thumb = t;
t.cacheBetweenDrags = ... | [
"function",
"(",
"t",
")",
"{",
"var",
"self",
"=",
"this",
";",
"/**\n * A YAHOO.widget.SliderThumb instance that we will use to \n * reposition the thumb when the background is clicked\n * @property thumb\n * @type YAHOO.widget.SliderThumb\n */",
"this... | Initializes the slider's thumb. Executed in the constructor.
@method initThumb
@param {YAHOO.widget.SliderThumb} t the slider thumb | [
"Initializes",
"the",
"slider",
"s",
"thumb",
".",
"Executed",
"in",
"the",
"constructor",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L340-L379 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function () {
Event.on(this.id, "keydown", this.handleKeyDown, this, true);
Event.on(this.id, "keypress", this.handleKeyPress, this, true);
} | javascript | function () {
Event.on(this.id, "keydown", this.handleKeyDown, this, true);
Event.on(this.id, "keypress", this.handleKeyPress, this, true);
} | [
"function",
"(",
")",
"{",
"Event",
".",
"on",
"(",
"this",
".",
"id",
",",
"\"keydown\"",
",",
"this",
".",
"handleKeyDown",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"on",
"(",
"this",
".",
"id",
",",
"\"keypress\"",
",",
"this",
".",
"... | Sets up the listeners for keydown and key press events.
@method _bindKeyEvents
@protected | [
"Sets",
"up",
"the",
"listeners",
"for",
"keydown",
"and",
"key",
"press",
"events",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L395-L398 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function(e) {
if (this.enableKeys) {
var kc = Event.getCharCode(e);
switch (kc) {
case 0x25: // left
case 0x26: // up
case 0x27: // right
case 0x28: // down
case 0x24: // home
case 0x23: // e... | javascript | function(e) {
if (this.enableKeys) {
var kc = Event.getCharCode(e);
switch (kc) {
case 0x25: // left
case 0x26: // up
case 0x27: // right
case 0x28: // down
case 0x24: // home
case 0x23: // e... | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"this",
".",
"enableKeys",
")",
"{",
"var",
"kc",
"=",
"Event",
".",
"getCharCode",
"(",
"e",
")",
";",
"switch",
"(",
"kc",
")",
"{",
"case",
"0x25",
":",
"// left",
"case",
"0x26",
":",
"// up",
"case"... | Executed when a keypress event happens with the control focused.
Prevents the default behavior for navigation keys. The actual
logic for moving the slider thumb in response to a key event
happens in handleKeyDown.
@param {Event} e the keypress event | [
"Executed",
"when",
"a",
"keypress",
"event",
"happens",
"with",
"the",
"control",
"focused",
".",
"Prevents",
"the",
"default",
"behavior",
"for",
"navigation",
"keys",
".",
"The",
"actual",
"logic",
"for",
"moving",
"the",
"slider",
"thumb",
"in",
"response"... | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L407-L423 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function(e) {
if (this.enableKeys) {
var kc = Event.getCharCode(e),
t = this.thumb,
h = this.getXValue(),
v = this.getYValue(),
changeValue = true;
switch (kc) {
// left
case 0x25: h -= t... | javascript | function(e) {
if (this.enableKeys) {
var kc = Event.getCharCode(e),
t = this.thumb,
h = this.getXValue(),
v = this.getYValue(),
changeValue = true;
switch (kc) {
// left
case 0x25: h -= t... | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"this",
".",
"enableKeys",
")",
"{",
"var",
"kc",
"=",
"Event",
".",
"getCharCode",
"(",
"e",
")",
",",
"t",
"=",
"this",
".",
"thumb",
",",
"h",
"=",
"this",
".",
"getXValue",
"(",
")",
",",
"v",
"=... | Executed when a keydown event happens with the control focused.
Updates the slider value and display when the keypress is an
arrow key, home, or end as long as enableKeys is set to true.
@param {Event} e the keydown event | [
"Executed",
"when",
"a",
"keydown",
"event",
"happens",
"with",
"the",
"control",
"focused",
".",
"Updates",
"the",
"slider",
"value",
"and",
"display",
"when",
"the",
"keypress",
"is",
"an",
"arrow",
"key",
"home",
"or",
"end",
"as",
"long",
"as",
"enable... | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L431-L477 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function() {
var el = this.thumb.getEl();
if (el) {
/**
* The center of the slider element is stored so we can
* place it in the correct position when the background is clicked.
* @property thumbCenterPoint
* @type {"x": int, "y": int}
... | javascript | function() {
var el = this.thumb.getEl();
if (el) {
/**
* The center of the slider element is stored so we can
* place it in the correct position when the background is clicked.
* @property thumbCenterPoint
* @type {"x": int, "y": int}
... | [
"function",
"(",
")",
"{",
"var",
"el",
"=",
"this",
".",
"thumb",
".",
"getEl",
"(",
")",
";",
"if",
"(",
"el",
")",
"{",
"/**\n * The center of the slider element is stored so we can \n * place it in the correct position when the background is clicke... | When the thumb is available, we cache the centerpoint of the element so
we can position the element correctly when the background is clicked
@method setThumbCenterPoint | [
"When",
"the",
"thumb",
"is",
"available",
"we",
"cache",
"the",
"centerpoint",
"of",
"the",
"element",
"so",
"we",
"can",
"position",
"the",
"element",
"correctly",
"when",
"the",
"background",
"is",
"clicked"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L521-L538 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function() {
var args = _AS.call(arguments);
args.unshift(Slider.SOURCE_SET_VALUE);
return this._setValue.apply(this,args);
} | javascript | function() {
var args = _AS.call(arguments);
args.unshift(Slider.SOURCE_SET_VALUE);
return this._setValue.apply(this,args);
} | [
"function",
"(",
")",
"{",
"var",
"args",
"=",
"_AS",
".",
"call",
"(",
"arguments",
")",
";",
"args",
".",
"unshift",
"(",
"Slider",
".",
"SOURCE_SET_VALUE",
")",
";",
"return",
"this",
".",
"_setValue",
".",
"apply",
"(",
"this",
",",
"args",
")",
... | Provides a way to set the value of the slider in code.
@method setValue
@param {int} newOffset the number of pixels the thumb should be
positioned away from the initial start point
@param {boolean} skipAnim set to true to disable the animation
for this move action (but not others).
@param {boolean} force ignore the lo... | [
"Provides",
"a",
"way",
"to",
"set",
"the",
"value",
"of",
"the",
"slider",
"in",
"code",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L686-L690 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function(finalCoord) {
var t = this.thumb,
self = this,
nextCoord = null,
tmpX, tmpY;
if (t._isRegion) {
nextCoord = this._getNextX(this.curCoord, finalCoord);
tmpX = (nextCoord !== null) ? nextCoord[0] : this.curCoord[0];
nextCoo... | javascript | function(finalCoord) {
var t = this.thumb,
self = this,
nextCoord = null,
tmpX, tmpY;
if (t._isRegion) {
nextCoord = this._getNextX(this.curCoord, finalCoord);
tmpX = (nextCoord !== null) ? nextCoord[0] : this.curCoord[0];
nextCoo... | [
"function",
"(",
"finalCoord",
")",
"{",
"var",
"t",
"=",
"this",
".",
"thumb",
",",
"self",
"=",
"this",
",",
"nextCoord",
"=",
"null",
",",
"tmpX",
",",
"tmpY",
";",
"if",
"(",
"t",
".",
"_isRegion",
")",
"{",
"nextCoord",
"=",
"this",
".",
"_g... | Move the slider one tick mark towards its final coordinate. Used
for the animation when tick marks are defined
@method moveOneTick
@param {int[]} the destination coordinate
@private | [
"Move",
"the",
"slider",
"one",
"tick",
"mark",
"towards",
"its",
"final",
"coordinate",
".",
"Used",
"for",
"the",
"animation",
"when",
"tick",
"marks",
"are",
"defined"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L950-L996 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function(e) {
if (!this.backgroundEnabled || this.isLocked()) {
return false;
}
this._mouseDown = true;
var x = Event.getPageX(e),
y = Event.getPageY(e);
this.focus();
this._slideStart();
this.moveThumb(x, y);
} | javascript | function(e) {
if (!this.backgroundEnabled || this.isLocked()) {
return false;
}
this._mouseDown = true;
var x = Event.getPageX(e),
y = Event.getPageY(e);
this.focus();
this._slideStart();
this.moveThumb(x, y);
} | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"!",
"this",
".",
"backgroundEnabled",
"||",
"this",
".",
"isLocked",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"this",
".",
"_mouseDown",
"=",
"true",
";",
"var",
"x",
"=",
"Event",
".",
"getPageX"... | Handles the mousedown event for the slider background
@method onMouseDown
@private | [
"Handles",
"the",
"mousedown",
"event",
"for",
"the",
"slider",
"background"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L1069-L1083 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function () {
var t = this.thumb;
t.setXConstraint(t.leftConstraint, t.rightConstraint, t.xTickSize);
t.setYConstraint(t.topConstraint, t.bottomConstraint, t.xTickSize);
} | javascript | function () {
var t = this.thumb;
t.setXConstraint(t.leftConstraint, t.rightConstraint, t.xTickSize);
t.setYConstraint(t.topConstraint, t.bottomConstraint, t.xTickSize);
} | [
"function",
"(",
")",
"{",
"var",
"t",
"=",
"this",
".",
"thumb",
";",
"t",
".",
"setXConstraint",
"(",
"t",
".",
"leftConstraint",
",",
"t",
".",
"rightConstraint",
",",
"t",
".",
"xTickSize",
")",
";",
"t",
".",
"setYConstraint",
"(",
"t",
".",
"... | Resets the X and Y contraints for the thumb. Used in lieu of the thumb
instance's inherited resetConstraints because some logic was not
applicable.
@method resetThumbConstraints
@protected | [
"Resets",
"the",
"X",
"and",
"Y",
"contraints",
"for",
"the",
"thumb",
".",
"Used",
"in",
"lieu",
"of",
"the",
"thumb",
"instance",
"s",
"inherited",
"resetConstraints",
"because",
"some",
"logic",
"was",
"not",
"applicable",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L1117-L1122 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function(parentPos) {
var myPos = YAHOO.util.Dom.getXY(this.getEl()),
ppos = parentPos || YAHOO.util.Dom.getXY(this.parentElId);
return [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ];
} | javascript | function(parentPos) {
var myPos = YAHOO.util.Dom.getXY(this.getEl()),
ppos = parentPos || YAHOO.util.Dom.getXY(this.parentElId);
return [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ];
} | [
"function",
"(",
"parentPos",
")",
"{",
"var",
"myPos",
"=",
"YAHOO",
".",
"util",
".",
"Dom",
".",
"getXY",
"(",
"this",
".",
"getEl",
"(",
")",
")",
",",
"ppos",
"=",
"parentPos",
"||",
"YAHOO",
".",
"util",
".",
"Dom",
".",
"getXY",
"(",
"this... | Returns the difference between the location of the thumb and its parent.
@method getOffsetFromParent
@param {[int, int]} parentPos Optionally accepts the position of the parent
@type [int, int] | [
"Returns",
"the",
"difference",
"between",
"the",
"location",
"of",
"the",
"thumb",
"and",
"its",
"parent",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L1303-L1308 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function (iLeft, iRight, iUp, iDown, iTickSize) {
this.initLeft = iLeft;
this.initRight = iRight;
this.initUp = iUp;
this.initDown = iDown;
this.setXConstraint(iLeft, iRight, iTickSize);
this.setYConstraint(iUp, iDown, iTickSize);
if (iTickSize && iTickSize > 1)... | javascript | function (iLeft, iRight, iUp, iDown, iTickSize) {
this.initLeft = iLeft;
this.initRight = iRight;
this.initUp = iUp;
this.initDown = iDown;
this.setXConstraint(iLeft, iRight, iTickSize);
this.setYConstraint(iUp, iDown, iTickSize);
if (iTickSize && iTickSize > 1)... | [
"function",
"(",
"iLeft",
",",
"iRight",
",",
"iUp",
",",
"iDown",
",",
"iTickSize",
")",
"{",
"this",
".",
"initLeft",
"=",
"iLeft",
";",
"this",
".",
"initRight",
"=",
"iRight",
";",
"this",
".",
"initUp",
"=",
"iUp",
";",
"this",
".",
"initDown",
... | Set up the slider, must be called in the constructor of all subclasses
@method initSlider
@param {int} iLeft the number of pixels the element can move left
@param {int} iRight the number of pixels the element can move right
@param {int} iUp the number of pixels the element can move up
@param {int} iDown the number of p... | [
"Set",
"up",
"the",
"slider",
"must",
"be",
"called",
"in",
"the",
"constructor",
"of",
"all",
"subclasses"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L1352-L1369 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function () {
if (!this.available) {
return 0;
}
var newOffset = this.getOffsetFromParent();
if (YAHOO.lang.isNumber(newOffset[0])) {
this.lastOffset = newOffset;
return (newOffset[0] - this.startOffset[0]);
} else {
return (this.... | javascript | function () {
if (!this.available) {
return 0;
}
var newOffset = this.getOffsetFromParent();
if (YAHOO.lang.isNumber(newOffset[0])) {
this.lastOffset = newOffset;
return (newOffset[0] - this.startOffset[0]);
} else {
return (this.... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"available",
")",
"{",
"return",
"0",
";",
"}",
"var",
"newOffset",
"=",
"this",
".",
"getOffsetFromParent",
"(",
")",
";",
"if",
"(",
"YAHOO",
".",
"lang",
".",
"isNumber",
"(",
"newOffset",
... | Gets the current X offset from the element's start position in
pixels.
@method getXValue
@return {int} the number of pixels (positive or negative) the
slider has moved horizontally from the start position. | [
"Gets",
"the",
"current",
"X",
"offset",
"from",
"the",
"element",
"s",
"start",
"position",
"in",
"pixels",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L1400-L1411 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function (slider) {
Event.on(slider.id,'keydown', this._handleKeyDown, this,true);
Event.on(slider.id,'keypress',this._handleKeyPress,this,true);
} | javascript | function (slider) {
Event.on(slider.id,'keydown', this._handleKeyDown, this,true);
Event.on(slider.id,'keypress',this._handleKeyPress,this,true);
} | [
"function",
"(",
"slider",
")",
"{",
"Event",
".",
"on",
"(",
"slider",
".",
"id",
",",
"'keydown'",
",",
"this",
".",
"_handleKeyDown",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"on",
"(",
"slider",
".",
"id",
",",
"'keypress'",
",",
"this... | Set up the listeners for the keydown and keypress events.
@method _bindKeyEvents
@protected | [
"Set",
"up",
"the",
"listeners",
"for",
"the",
"keydown",
"and",
"keypress",
"events",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L1700-L1703 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function (min, max, skipAnim, force, silent) {
var mins = this.minSlider,
maxs = this.maxSlider,
mint = mins.thumb,
maxt = maxs.thumb,
self = this,
done = { min : false, max : false };
// Clear constraints to prevent animated thumbs from prema... | javascript | function (min, max, skipAnim, force, silent) {
var mins = this.minSlider,
maxs = this.maxSlider,
mint = mins.thumb,
maxt = maxs.thumb,
self = this,
done = { min : false, max : false };
// Clear constraints to prevent animated thumbs from prema... | [
"function",
"(",
"min",
",",
"max",
",",
"skipAnim",
",",
"force",
",",
"silent",
")",
"{",
"var",
"mins",
"=",
"this",
".",
"minSlider",
",",
"maxs",
"=",
"this",
".",
"maxSlider",
",",
"mint",
"=",
"mins",
".",
"thumb",
",",
"maxt",
"=",
"maxs",
... | Sets the min and max thumbs to new values.
@method setValues
@param min {int} Pixel offset to assign to the min thumb
@param max {int} Pixel offset to assign to the max thumb
@param skipAnim {boolean} (optional) Set to true to skip thumb animation.
Default false
@param force {boolean} (optional) ignore the locked setti... | [
"Sets",
"the",
"min",
"and",
"max",
"thumbs",
"to",
"new",
"values",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L1739-L1789 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function (min, skipAnim, force, silent) {
var mins = this.minSlider,
self = this;
this.activeSlider = mins;
// Use a one-time event callback to delay the updateValue call
// until after the slide operation is done
self = this;
this._oneTimeCallback(mins,'sli... | javascript | function (min, skipAnim, force, silent) {
var mins = this.minSlider,
self = this;
this.activeSlider = mins;
// Use a one-time event callback to delay the updateValue call
// until after the slide operation is done
self = this;
this._oneTimeCallback(mins,'sli... | [
"function",
"(",
"min",
",",
"skipAnim",
",",
"force",
",",
"silent",
")",
"{",
"var",
"mins",
"=",
"this",
".",
"minSlider",
",",
"self",
"=",
"this",
";",
"this",
".",
"activeSlider",
"=",
"mins",
";",
"// Use a one-time event callback to delay the updateVal... | Set the min thumb position to a new value.
@method setMinValue
@param min {int} Pixel offset for min thumb
@param skipAnim {boolean} (optional) Set to true to skip thumb animation.
Default false
@param force {boolean} (optional) ignore the locked setting and set
value anyway. Default false
@param silent {boolean} (opti... | [
"Set",
"the",
"min",
"thumb",
"position",
"to",
"a",
"new",
"value",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L1802-L1819 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function (max, skipAnim, force, silent) {
var maxs = this.maxSlider,
self = this;
this.activeSlider = maxs;
// Use a one-time event callback to delay the updateValue call
// until after the slide operation is done
this._oneTimeCallback(maxs,'slideEnd',function () {
... | javascript | function (max, skipAnim, force, silent) {
var maxs = this.maxSlider,
self = this;
this.activeSlider = maxs;
// Use a one-time event callback to delay the updateValue call
// until after the slide operation is done
this._oneTimeCallback(maxs,'slideEnd',function () {
... | [
"function",
"(",
"max",
",",
"skipAnim",
",",
"force",
",",
"silent",
")",
"{",
"var",
"maxs",
"=",
"this",
".",
"maxSlider",
",",
"self",
"=",
"this",
";",
"this",
".",
"activeSlider",
"=",
"maxs",
";",
"// Use a one-time event callback to delay the updateVal... | Set the max thumb position to a new value.
@method setMaxValue
@param max {int} Pixel offset for max thumb
@param skipAnim {boolean} (optional) Set to true to skip thumb animation.
Default false
@param force {boolean} (optional) ignore the locked setting and set
value anyway. Default false
@param silent {boolean} (opti... | [
"Set",
"the",
"max",
"thumb",
"position",
"to",
"a",
"new",
"value",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L1832-L1848 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function(silent) {
var min = this.minSlider.getValue(),
max = this.maxSlider.getValue(),
changed = false,
mint,maxt,dim,minConstraint,maxConstraint,thumbInnerWidth;
if (min != this.minVal || max != this.maxVal) {
changed = true;
mint ... | javascript | function(silent) {
var min = this.minSlider.getValue(),
max = this.maxSlider.getValue(),
changed = false,
mint,maxt,dim,minConstraint,maxConstraint,thumbInnerWidth;
if (min != this.minVal || max != this.maxVal) {
changed = true;
mint ... | [
"function",
"(",
"silent",
")",
"{",
"var",
"min",
"=",
"this",
".",
"minSlider",
".",
"getValue",
"(",
")",
",",
"max",
"=",
"this",
".",
"maxSlider",
".",
"getValue",
"(",
")",
",",
"changed",
"=",
"false",
",",
"mint",
",",
"maxt",
",",
"dim",
... | Executed when one of the sliders is moved
@method updateValue
@param silent {boolean} (optional) Set to true to skip firing change
events. Default false
@private | [
"Executed",
"when",
"one",
"of",
"the",
"sliders",
"is",
"moved"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L1857-L1899 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function(e) {
var min = this.minSlider,
max = this.maxSlider,
minLocked = min.isLocked() || !min.backgroundEnabled,
maxLocked = max.isLocked() || !min.backgroundEnabled,
Ev = YAHOO.util.Event,
d;
if (minLocked || maxLocked) {
this... | javascript | function(e) {
var min = this.minSlider,
max = this.maxSlider,
minLocked = min.isLocked() || !min.backgroundEnabled,
maxLocked = max.isLocked() || !min.backgroundEnabled,
Ev = YAHOO.util.Event,
d;
if (minLocked || maxLocked) {
this... | [
"function",
"(",
"e",
")",
"{",
"var",
"min",
"=",
"this",
".",
"minSlider",
",",
"max",
"=",
"this",
".",
"maxSlider",
",",
"minLocked",
"=",
"min",
".",
"isLocked",
"(",
")",
"||",
"!",
"min",
".",
"backgroundEnabled",
",",
"maxLocked",
"=",
"max",... | A background click will move the slider thumb nearest to the click.
Override if you need different behavior.
@method selectActiveSlider
@param e {Event} the mousedown event
@private | [
"A",
"background",
"click",
"will",
"move",
"the",
"slider",
"thumb",
"nearest",
"to",
"the",
"click",
".",
"Override",
"if",
"you",
"need",
"different",
"behavior",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L1908-L1927 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function(e) {
if (!e._handled && !this.minSlider._sliding && !this.maxSlider._sliding) {
e._handled = true;
this.selectActiveSlider(e);
return YW.Slider.prototype.onMouseDown.call(this.activeSlider, e);
} else {
return false;
}
} | javascript | function(e) {
if (!e._handled && !this.minSlider._sliding && !this.maxSlider._sliding) {
e._handled = true;
this.selectActiveSlider(e);
return YW.Slider.prototype.onMouseDown.call(this.activeSlider, e);
} else {
return false;
}
} | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"!",
"e",
".",
"_handled",
"&&",
"!",
"this",
".",
"minSlider",
".",
"_sliding",
"&&",
"!",
"this",
".",
"maxSlider",
".",
"_sliding",
")",
"{",
"e",
".",
"_handled",
"=",
"true",
";",
"this",
".",
"sele... | Delegates the onMouseDown to the appropriate Slider
@method _handleMouseDown
@param e {Event} mouseup event
@protected | [
"Delegates",
"the",
"onMouseDown",
"to",
"the",
"appropriate",
"Slider"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L1936-L1944 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function (o,evt,fn) {
var sub = function () {
// Unsubscribe myself
o.unsubscribe(evt, sub);
// Pass the event handler arguments to the one time callback
fn.apply({},arguments);
};
o.subscribe(evt,sub);
} | javascript | function (o,evt,fn) {
var sub = function () {
// Unsubscribe myself
o.unsubscribe(evt, sub);
// Pass the event handler arguments to the one time callback
fn.apply({},arguments);
};
o.subscribe(evt,sub);
} | [
"function",
"(",
"o",
",",
"evt",
",",
"fn",
")",
"{",
"var",
"sub",
"=",
"function",
"(",
")",
"{",
"// Unsubscribe myself",
"o",
".",
"unsubscribe",
"(",
"evt",
",",
"sub",
")",
";",
"// Pass the event handler arguments to the one time callback",
"fn",
".",
... | Schedule an event callback that will execute once, then unsubscribe
itself.
@method _oneTimeCallback
@param o {EventProvider} Object to attach the event to
@param evt {string} Name of the event
@param fn {Function} function to execute once
@private | [
"Schedule",
"an",
"event",
"callback",
"that",
"will",
"execute",
"once",
"then",
"unsubscribe",
"itself",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L1967-L1975 | train | |
neyric/webhookit | public/javascripts/yui/slider/slider.js | function (o,evt) {
var ce,i,len,j,subs,newSubs;
if (o.__yui_events && o.events[evt]) {
for (i = o.__yui_events.length; i >= 0; --i) {
if (o.__yui_events[i].type === evt) {
ce = o.__yui_events[i];
break;
}
}
... | javascript | function (o,evt) {
var ce,i,len,j,subs,newSubs;
if (o.__yui_events && o.events[evt]) {
for (i = o.__yui_events.length; i >= 0; --i) {
if (o.__yui_events[i].type === evt) {
ce = o.__yui_events[i];
break;
}
}
... | [
"function",
"(",
"o",
",",
"evt",
")",
"{",
"var",
"ce",
",",
"i",
",",
"len",
",",
"j",
",",
"subs",
",",
"newSubs",
";",
"if",
"(",
"o",
".",
"__yui_events",
"&&",
"o",
".",
"events",
"[",
"evt",
"]",
")",
"{",
"for",
"(",
"i",
"=",
"o",
... | Clean up the slideEnd event subscribers array, since each one-time
callback will be replaced in the event's subscribers property with
null. This will cause memory bloat and loss of performance.
@method _cleanEvent
@param o {EventProvider} object housing the CustomEvent
@param evt {string} name of the CustomEvent
@priv... | [
"Clean",
"up",
"the",
"slideEnd",
"event",
"subscribers",
"array",
"since",
"each",
"one",
"-",
"time",
"callback",
"will",
"be",
"replaced",
"in",
"the",
"event",
"s",
"subscribers",
"property",
"with",
"null",
".",
"This",
"will",
"cause",
"memory",
"bloat... | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/slider/slider.js#L1986-L2008 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | createElement | function createElement(el, attrs) {
var newEl = document.createElement(el);
attrs = attrs || {};
if (attrs.className) {
Dom.addClass(newEl, attrs.className);
}
if (attrs.styles) {
setStyles(newEl, attrs.styles);
}
if (attrs.parent) {
... | javascript | function createElement(el, attrs) {
var newEl = document.createElement(el);
attrs = attrs || {};
if (attrs.className) {
Dom.addClass(newEl, attrs.className);
}
if (attrs.styles) {
setStyles(newEl, attrs.styles);
}
if (attrs.parent) {
... | [
"function",
"createElement",
"(",
"el",
",",
"attrs",
")",
"{",
"var",
"newEl",
"=",
"document",
".",
"createElement",
"(",
"el",
")",
";",
"attrs",
"=",
"attrs",
"||",
"{",
"}",
";",
"if",
"(",
"attrs",
".",
"className",
")",
"{",
"Dom",
".",
"add... | Create an element, set its class name and optionally install the element
to its parent.
@method createElement
@param el {String} The element to be created
@param attrs {Object} Configuration of parent, class and id attributes.
If the content is specified, it is inserted after creation of the
element. The content can al... | [
"Create",
"an",
"element",
"set",
"its",
"class",
"name",
"and",
"optionally",
"install",
"the",
"element",
"to",
"its",
"parent",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L314-L343 | train |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | getStyle | function getStyle(el, style, type) {
var value;
if (!el) {
return 0;
}
function getStyleIntVal(el, style) {
var val;
/*
* XXX: Safari calculates incorrect marginRight for an element
* which has its parent element style set ... | javascript | function getStyle(el, style, type) {
var value;
if (!el) {
return 0;
}
function getStyleIntVal(el, style) {
var val;
/*
* XXX: Safari calculates incorrect marginRight for an element
* which has its parent element style set ... | [
"function",
"getStyle",
"(",
"el",
",",
"style",
",",
"type",
")",
"{",
"var",
"value",
";",
"if",
"(",
"!",
"el",
")",
"{",
"return",
"0",
";",
"}",
"function",
"getStyleIntVal",
"(",
"el",
",",
"style",
")",
"{",
"var",
"val",
";",
"/*\n ... | Get the computed style of an element.
@method getStyle
@param el {HTMLElement} The element for which the style needs to be
returned.
@param style {String} The style attribute
@param type {String} "int", "float", etc. (defaults to int)
@private | [
"Get",
"the",
"computed",
"style",
"of",
"an",
"element",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L355-L445 | train |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | getCarouselItemSize | function getCarouselItemSize(which) {
var carousel = this,
child,
item,
size = 0,
first = carousel.get("firstVisible"),
vertical = false;
if (carousel._itemsTable.numItems === 0) {
return 0;
}
item = carousel._... | javascript | function getCarouselItemSize(which) {
var carousel = this,
child,
item,
size = 0,
first = carousel.get("firstVisible"),
vertical = false;
if (carousel._itemsTable.numItems === 0) {
return 0;
}
item = carousel._... | [
"function",
"getCarouselItemSize",
"(",
"which",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"child",
",",
"item",
",",
"size",
"=",
"0",
",",
"first",
"=",
"carousel",
".",
"get",
"(",
"\"firstVisible\"",
")",
",",
"vertical",
"=",
"false",
";",
"i... | Compute and return the height or width of a single Carousel item
depending upon the orientation.
@method getCarouselItemSize
@param which {String} "height" or "width" to be returned. If this is
passed explicitly, the calculated size is not cached.
@private | [
"Compute",
"and",
"return",
"the",
"height",
"or",
"width",
"of",
"a",
"single",
"Carousel",
"item",
"depending",
"upon",
"the",
"orientation",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L456-L496 | train |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | getCarouselItemPosition | function getCarouselItemPosition(pos) {
var carousel = this,
itemsPerRow = carousel._cols,
itemsPerCol = carousel._rows,
page,
sz,
isVertical,
itemsCol,
itemsRow,
sentinel,
delta = 0,
top,
... | javascript | function getCarouselItemPosition(pos) {
var carousel = this,
itemsPerRow = carousel._cols,
itemsPerCol = carousel._rows,
page,
sz,
isVertical,
itemsCol,
itemsRow,
sentinel,
delta = 0,
top,
... | [
"function",
"getCarouselItemPosition",
"(",
"pos",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"itemsPerRow",
"=",
"carousel",
".",
"_cols",
",",
"itemsPerCol",
"=",
"carousel",
".",
"_rows",
",",
"page",
",",
"sz",
",",
"isVertical",
",",
"itemsCol",
"... | Compute and return the position of a Carousel item based on its
position.
@method getCarouselItemPosition
@param position {Number} The position of the Carousel item.
@private | [
"Compute",
"and",
"return",
"the",
"position",
"of",
"a",
"Carousel",
"item",
"based",
"on",
"its",
"position",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L521-L596 | train |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | getScrollOffset | function getScrollOffset(delta) {
var itemSize = 0,
size = 0;
itemSize = getCarouselItemSize.call(this);
size = itemSize * delta;
return size;
} | javascript | function getScrollOffset(delta) {
var itemSize = 0,
size = 0;
itemSize = getCarouselItemSize.call(this);
size = itemSize * delta;
return size;
} | [
"function",
"getScrollOffset",
"(",
"delta",
")",
"{",
"var",
"itemSize",
"=",
"0",
",",
"size",
"=",
"0",
";",
"itemSize",
"=",
"getCarouselItemSize",
".",
"call",
"(",
"this",
")",
";",
"size",
"=",
"itemSize",
"*",
"delta",
";",
"return",
"size",
";... | Return the scrolling offset size given the number of elements to
scroll.
@method getScrollOffset
@param delta {Number} The delta number of elements to scroll by.
@private | [
"Return",
"the",
"scrolling",
"offset",
"size",
"given",
"the",
"number",
"of",
"elements",
"to",
"scroll",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L619-L627 | train |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | setItemSelection | function setItemSelection(newpos, oldpos) {
var carousel = this,
cssClass = carousel.CLASSES,
el,
firstItem = carousel._firstItem,
isCircular = carousel.get("isCircular"),
numItems = carousel.get("numItems"),
numVisible = carousel.get(... | javascript | function setItemSelection(newpos, oldpos) {
var carousel = this,
cssClass = carousel.CLASSES,
el,
firstItem = carousel._firstItem,
isCircular = carousel.get("isCircular"),
numItems = carousel.get("numItems"),
numVisible = carousel.get(... | [
"function",
"setItemSelection",
"(",
"newpos",
",",
"oldpos",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"cssClass",
"=",
"carousel",
".",
"CLASSES",
",",
"el",
",",
"firstItem",
"=",
"carousel",
".",
"_firstItem",
",",
"isCircular",
"=",
"carousel",
"... | Set the selected item.
@method setItemSelection
@param {Number} newpos The index of the new position
@param {Number} oldpos The index of the previous position
@private | [
"Set",
"the",
"selected",
"item",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L663-L706 | train |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | syncPagerUi | function syncPagerUi(page) {
var carousel = this, numPages, numVisible;
// Don't do anything if the Carousel is not rendered
if (!carousel._hasRendered) {
return;
}
numVisible = carousel.get("numVisible");
if (!JS.isNumber(page)) {
page = Math.f... | javascript | function syncPagerUi(page) {
var carousel = this, numPages, numVisible;
// Don't do anything if the Carousel is not rendered
if (!carousel._hasRendered) {
return;
}
numVisible = carousel.get("numVisible");
if (!JS.isNumber(page)) {
page = Math.f... | [
"function",
"syncPagerUi",
"(",
"page",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"numPages",
",",
"numVisible",
";",
"// Don't do anything if the Carousel is not rendered",
"if",
"(",
"!",
"carousel",
".",
"_hasRendered",
")",
"{",
"return",
";",
"}",
"num... | Synchronize and redraw the Pager UI if necessary.
@method syncPagerUi
@private | [
"Synchronize",
"and",
"redraw",
"the",
"Pager",
"UI",
"if",
"necessary",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L800-L824 | train |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | getDimensions | function getDimensions(el, which) {
switch (which) {
case 'height':
return getStyle(el, "marginTop") +
getStyle(el, "marginBottom") +
getStyle(el, "paddingTop") +
getStyle(el, "paddingBottom") +
... | javascript | function getDimensions(el, which) {
switch (which) {
case 'height':
return getStyle(el, "marginTop") +
getStyle(el, "marginBottom") +
getStyle(el, "paddingTop") +
getStyle(el, "paddingBottom") +
... | [
"function",
"getDimensions",
"(",
"el",
",",
"which",
")",
"{",
"switch",
"(",
"which",
")",
"{",
"case",
"'height'",
":",
"return",
"getStyle",
"(",
"el",
",",
"\"marginTop\"",
")",
"+",
"getStyle",
"(",
"el",
",",
"\"marginBottom\"",
")",
"+",
"getStyl... | Get full dimensions of an element.
@method getDimensions
@param {Object} el The element to get the dimensions of
@param {String} which Get the height or width of an element
@private | [
"Get",
"full",
"dimensions",
"of",
"an",
"element",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L834-L855 | train |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | syncUi | function syncUi(o) {
var carousel = this;
if (!JS.isObject(o)) {
return;
}
switch (o.ev) {
case itemAddedEvent:
carousel._syncUiForItemAdd(o);
break;
case itemRemovedEvent:
carousel._syncUiForItemRemove(o);
bre... | javascript | function syncUi(o) {
var carousel = this;
if (!JS.isObject(o)) {
return;
}
switch (o.ev) {
case itemAddedEvent:
carousel._syncUiForItemAdd(o);
break;
case itemRemovedEvent:
carousel._syncUiForItemRemove(o);
bre... | [
"function",
"syncUi",
"(",
"o",
")",
"{",
"var",
"carousel",
"=",
"this",
";",
"if",
"(",
"!",
"JS",
".",
"isObject",
"(",
"o",
")",
")",
"{",
"return",
";",
"}",
"switch",
"(",
"o",
".",
"ev",
")",
"{",
"case",
"itemAddedEvent",
":",
"carousel",... | Handle UI update.
Call the appropriate methods on events fired when an item is added, or
removed for synchronizing the DOM.
@method syncUi
@param {Object} o The item that needs to be added or removed
@private | [
"Handle",
"UI",
"update",
".",
"Call",
"the",
"appropriate",
"methods",
"on",
"events",
"fired",
"when",
"an",
"item",
"is",
"added",
"or",
"removed",
"for",
"synchronizing",
"the",
"DOM",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L866-L889 | train |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | updateStateAfterScroll | function updateStateAfterScroll(item, sentinel) {
var carousel = this,
page = carousel.get("currentPage"),
newPage,
numPerPage = carousel.get("numVisible");
newPage = parseInt(carousel._firstItem / numPerPage, 10);
if (newPage != page) {
c... | javascript | function updateStateAfterScroll(item, sentinel) {
var carousel = this,
page = carousel.get("currentPage"),
newPage,
numPerPage = carousel.get("numVisible");
newPage = parseInt(carousel._firstItem / numPerPage, 10);
if (newPage != page) {
c... | [
"function",
"updateStateAfterScroll",
"(",
"item",
",",
"sentinel",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"page",
"=",
"carousel",
".",
"get",
"(",
"\"currentPage\"",
")",
",",
"newPage",
",",
"numPerPage",
"=",
"carousel",
".",
"get",
"(",
"\"num... | Update the state variables after scrolling the Carousel view port.
@method updateStateAfterScroll
@param {Integer} item The index to which the Carousel has scrolled to.
@param {Integer} sentinel The last element in the view port.
@private | [
"Update",
"the",
"state",
"variables",
"after",
"scrolling",
"the",
"Carousel",
"view",
"port",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L899-L927 | train |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function () {
var carousel = this, n = carousel.get("numItems");
while (n > 0) {
if (!carousel.removeItem(0)) {
YAHOO.log("Item could not be removed - missing?",
"warn", WidgetName);
}
/*
... | javascript | function () {
var carousel = this, n = carousel.get("numItems");
while (n > 0) {
if (!carousel.removeItem(0)) {
YAHOO.log("Item could not be removed - missing?",
"warn", WidgetName);
}
/*
... | [
"function",
"(",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"n",
"=",
"carousel",
".",
"get",
"(",
"\"numItems\"",
")",
";",
"while",
"(",
"n",
">",
"0",
")",
"{",
"if",
"(",
"!",
"carousel",
".",
"removeItem",
"(",
"0",
")",
")",
"{",
"YAH... | Clears the items from Carousel.
@method clearItems
@public | [
"Clears",
"the",
"items",
"from",
"Carousel",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L1564-L1586 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function () {
var carousel = this,
first,
focusEl,
isSelectionInvisible,
itemsTable,
last,
numVisible,
selectOnScroll,
selected,
selItem;
// Don't do a... | javascript | function () {
var carousel = this,
first,
focusEl,
isSelectionInvisible,
itemsTable,
last,
numVisible,
selectOnScroll,
selected,
selItem;
// Don't do a... | [
"function",
"(",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"first",
",",
"focusEl",
",",
"isSelectionInvisible",
",",
"itemsTable",
",",
"last",
",",
"numVisible",
",",
"selectOnScroll",
",",
"selected",
",",
"selItem",
";",
"// Don't do anything if the Car... | Set focus on the Carousel.
@method focus
@public | [
"Set",
"focus",
"on",
"the",
"Carousel",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L1594-L1643 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function () {
var carousel = this;
if (carousel.fireEvent(beforeHideEvent) !== false) {
carousel.removeClass(carousel.CLASSES.VISIBLE);
carousel.fireEvent(hideEvent);
}
} | javascript | function () {
var carousel = this;
if (carousel.fireEvent(beforeHideEvent) !== false) {
carousel.removeClass(carousel.CLASSES.VISIBLE);
carousel.fireEvent(hideEvent);
}
} | [
"function",
"(",
")",
"{",
"var",
"carousel",
"=",
"this",
";",
"if",
"(",
"carousel",
".",
"fireEvent",
"(",
"beforeHideEvent",
")",
"!==",
"false",
")",
"{",
"carousel",
".",
"removeClass",
"(",
"carousel",
".",
"CLASSES",
".",
"VISIBLE",
")",
";",
"... | Hide the Carousel.
@method hide
@public | [
"Hide",
"the",
"Carousel",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L1651-L1658 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function (el, attrs) {
var carousel = this,
elId = el, // save for a rainy day
parse = false,
selected;
if (!el) {
YAHOO.log(el + " is neither an HTML element, nor a string",
"error", WidgetName);
... | javascript | function (el, attrs) {
var carousel = this,
elId = el, // save for a rainy day
parse = false,
selected;
if (!el) {
YAHOO.log(el + " is neither an HTML element, nor a string",
"error", WidgetName);
... | [
"function",
"(",
"el",
",",
"attrs",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"elId",
"=",
"el",
",",
"// save for a rainy day",
"parse",
"=",
"false",
",",
"selected",
";",
"if",
"(",
"!",
"el",
")",
"{",
"YAHOO",
".",
"log",
"(",
"el",
"+",... | Initialize the Carousel.
@method init
@public
@param el {HTMLElement | String} The html element that represents
the Carousel container.
@param attrs {Object} The set of configuration attributes for
creating the Carousel. | [
"Initialize",
"the",
"Carousel",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L1670-L1742 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function (attrs) {
var carousel = this;
attrs = attrs || {};
Carousel.superclass.initAttributes.call(carousel, attrs);
/**
* @attribute carouselEl
* @description The type of the Carousel element.
* @default OL
* @type ... | javascript | function (attrs) {
var carousel = this;
attrs = attrs || {};
Carousel.superclass.initAttributes.call(carousel, attrs);
/**
* @attribute carouselEl
* @description The type of the Carousel element.
* @default OL
* @type ... | [
"function",
"(",
"attrs",
")",
"{",
"var",
"carousel",
"=",
"this",
";",
"attrs",
"=",
"attrs",
"||",
"{",
"}",
";",
"Carousel",
".",
"superclass",
".",
"initAttributes",
".",
"call",
"(",
"carousel",
",",
"attrs",
")",
";",
"/**\n * @attribute... | Initialize the configuration attributes used to create the Carousel.
@method initAttributes
@public
@param attrs {Object} The set of configuration attributes for
creating the Carousel. | [
"Initialize",
"the",
"configuration",
"attributes",
"used",
"to",
"create",
"the",
"Carousel",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L1752-L1975 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function (index) {
var carousel = this;
if (index < 0 || index >= carousel.get("numItems")) {
YAHOO.log("Index out of bounds", "error", WidgetName);
return null;
}
if (carousel._itemsTable.items[index]) {
return Dom.get(ca... | javascript | function (index) {
var carousel = this;
if (index < 0 || index >= carousel.get("numItems")) {
YAHOO.log("Index out of bounds", "error", WidgetName);
return null;
}
if (carousel._itemsTable.items[index]) {
return Dom.get(ca... | [
"function",
"(",
"index",
")",
"{",
"var",
"carousel",
"=",
"this",
";",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"carousel",
".",
"get",
"(",
"\"numItems\"",
")",
")",
"{",
"YAHOO",
".",
"log",
"(",
"\"Index out of bounds\"",
",",
"\"error\"... | Return the carouselItemEl at index or null if the index is not
found.
@method getElementForItem
@param index {Number} The index of the item to be returned
@return {Element} Return the item at index or null if not found
@public | [
"Return",
"the",
"carouselItemEl",
"at",
"index",
"or",
"null",
"if",
"the",
"index",
"is",
"not",
"found",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2119-L2132 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function () {
var carousel = this, els = [], i;
for (i = 0; i < carousel._itemsTable.numItems; i++) {
els.push(carousel.getElementForItem(i));
}
return els;
} | javascript | function () {
var carousel = this, els = [], i;
for (i = 0; i < carousel._itemsTable.numItems; i++) {
els.push(carousel.getElementForItem(i));
}
return els;
} | [
"function",
"(",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"els",
"=",
"[",
"]",
",",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"carousel",
".",
"_itemsTable",
".",
"numItems",
";",
"i",
"++",
")",
"{",
"els",
".",
"push",
"(",... | Return the carouselItemEl for all items in the Carousel.
@method getElementForItems
@return {Array} Return all the items
@public | [
"Return",
"the",
"carouselItemEl",
"for",
"all",
"items",
"in",
"the",
"Carousel",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2141-L2149 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function (index) {
var carousel = this;
if (index < 0 || index >= carousel.get("numItems")) {
YAHOO.log("Index out of bounds", "error", WidgetName);
return null;
}
if (carousel._itemsTable.numItems > index) {
if (!JS.isUnd... | javascript | function (index) {
var carousel = this;
if (index < 0 || index >= carousel.get("numItems")) {
YAHOO.log("Index out of bounds", "error", WidgetName);
return null;
}
if (carousel._itemsTable.numItems > index) {
if (!JS.isUnd... | [
"function",
"(",
"index",
")",
"{",
"var",
"carousel",
"=",
"this",
";",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"carousel",
".",
"get",
"(",
"\"numItems\"",
")",
")",
"{",
"YAHOO",
".",
"log",
"(",
"\"Index out of bounds\"",
",",
"\"error\"... | Return the item at index or null if the index is not found.
@method getItem
@param index {Number} The index of the item to be returned
@return {Object} Return the item at index or null if not found
@public | [
"Return",
"the",
"item",
"at",
"index",
"or",
"null",
"if",
"the",
"index",
"is",
"not",
"found",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2159-L2174 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function (id) {
var carousel = this,
n = carousel.get("numItems"),
i = 0,
items = carousel._itemsTable.items,
item;
while (i < n) {
item = items[i] || {};
if(item.id == id) {
retu... | javascript | function (id) {
var carousel = this,
n = carousel.get("numItems"),
i = 0,
items = carousel._itemsTable.items,
item;
while (i < n) {
item = items[i] || {};
if(item.id == id) {
retu... | [
"function",
"(",
"id",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"n",
"=",
"carousel",
".",
"get",
"(",
"\"numItems\"",
")",
",",
"i",
"=",
"0",
",",
"items",
"=",
"carousel",
".",
"_itemsTable",
".",
"items",
",",
"item",
";",
"while",
"(",
... | Return the position of the Carousel item that has the id "id", or -1
if the id is not found.
@method getItemPositionById
@param index {Number} The index of the item to be returned
@public | [
"Return",
"the",
"position",
"of",
"the",
"Carousel",
"item",
"that",
"has",
"the",
"id",
"id",
"or",
"-",
"1",
"if",
"the",
"id",
"is",
"not",
"found",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2228-L2244 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function () {
var carousel = this,
i = carousel.get("firstVisible"),
n = i + carousel.get("numVisible"),
r = [];
while (i < n) {
r.push(carousel.getElementForItem(i));
i++;
}
... | javascript | function () {
var carousel = this,
i = carousel.get("firstVisible"),
n = i + carousel.get("numVisible"),
r = [];
while (i < n) {
r.push(carousel.getElementForItem(i));
i++;
}
... | [
"function",
"(",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"i",
"=",
"carousel",
".",
"get",
"(",
"\"firstVisible\"",
")",
",",
"n",
"=",
"i",
"+",
"carousel",
".",
"get",
"(",
"\"numVisible\"",
")",
",",
"r",
"=",
"[",
"]",
";",
"while",
"(... | Return all visible items as an array.
@method getVisibleItems
@return {Array} The array of visible items
@public | [
"Return",
"all",
"visible",
"items",
"as",
"an",
"array",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2253-L2265 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function (index) {
var carousel = this,
item,
num = carousel.get("numItems");
if (index < 0 || index >= num) {
YAHOO.log("Index out of bounds", "error", WidgetName);
return false;
}
item = carousel._it... | javascript | function (index) {
var carousel = this,
item,
num = carousel.get("numItems");
if (index < 0 || index >= num) {
YAHOO.log("Index out of bounds", "error", WidgetName);
return false;
}
item = carousel._it... | [
"function",
"(",
"index",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"item",
",",
"num",
"=",
"carousel",
".",
"get",
"(",
"\"numItems\"",
")",
";",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"num",
")",
"{",
"YAHOO",
".",
"log",
"(",... | Remove an item at index from the Carousel.
@method removeItem
@public
@param index {Number} The position to where in the list (starts from
zero).
@return {Boolean} Return true on success, false otherwise | [
"Remove",
"an",
"item",
"at",
"index",
"from",
"the",
"Carousel",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2276-L2297 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function (item, index) {
var carousel = this,
className,
content,
elId,
numItems = carousel.get("numItems"),
oel,
el = item;
if (!item) {
return false;
}
if (... | javascript | function (item, index) {
var carousel = this,
className,
content,
elId,
numItems = carousel.get("numItems"),
oel,
el = item;
if (!item) {
return false;
}
if (... | [
"function",
"(",
"item",
",",
"index",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"className",
",",
"content",
",",
"elId",
",",
"numItems",
"=",
"carousel",
".",
"get",
"(",
"\"numItems\"",
")",
",",
"oel",
",",
"el",
"=",
"item",
";",
"if",
"... | Replace an item at index witin Carousel.
@method replaceItem
@public
@param item {String | Object | HTMLElement} The item to be appended
to the Carousel. If the parameter is a string, it is assumed to be
the content of the newly created item. If the parameter is an
object, it is assumed to supply the content and an op... | [
"Replace",
"an",
"item",
"at",
"index",
"witin",
"Carousel",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2313-L2362 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function (appendTo) {
var carousel = this,
cssClass = carousel.CLASSES,
rows = carousel._rows;
carousel.addClass(cssClass.CAROUSEL);
if (!carousel._clipEl) {
carousel._clipEl = carousel._createCarouselClip();
carouse... | javascript | function (appendTo) {
var carousel = this,
cssClass = carousel.CLASSES,
rows = carousel._rows;
carousel.addClass(cssClass.CAROUSEL);
if (!carousel._clipEl) {
carousel._clipEl = carousel._createCarouselClip();
carouse... | [
"function",
"(",
"appendTo",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"cssClass",
"=",
"carousel",
".",
"CLASSES",
",",
"rows",
"=",
"carousel",
".",
"_rows",
";",
"carousel",
".",
"addClass",
"(",
"cssClass",
".",
"CAROUSEL",
")",
";",
"if",
"("... | Render the Carousel.
@method render
@public
@param appendTo {HTMLElement | String} The element to which the
Carousel should be appended prior to rendering.
@return {Boolean} Status of the operation | [
"Render",
"the",
"Carousel",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2400-L2444 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function () {
var carousel = this,
isVertical = carousel.get("isVertical"),
cols = carousel._cols,
item = carousel._firstItem - carousel.get("numVisible");
if (item < 0) { // only account for multi-row when scrolling backwards from item ... | javascript | function () {
var carousel = this,
isVertical = carousel.get("isVertical"),
cols = carousel._cols,
item = carousel._firstItem - carousel.get("numVisible");
if (item < 0) { // only account for multi-row when scrolling backwards from item ... | [
"function",
"(",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"isVertical",
"=",
"carousel",
".",
"get",
"(",
"\"isVertical\"",
")",
",",
"cols",
"=",
"carousel",
".",
"_cols",
",",
"item",
"=",
"carousel",
".",
"_firstItem",
"-",
"carousel",
".",
"g... | Scroll the Carousel by a page backward.
@method scrollPageBackward
@public | [
"Scroll",
"the",
"Carousel",
"by",
"a",
"page",
"backward",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2476-L2493 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function () {
var carousel = this,
item = carousel._firstItem + carousel.get("numVisible");
if (item > carousel.get("numItems")) {
item = 0;
}
if (carousel.get("selectOnScroll")) {
carousel._selectedItem = carousel._ge... | javascript | function () {
var carousel = this,
item = carousel._firstItem + carousel.get("numVisible");
if (item > carousel.get("numItems")) {
item = 0;
}
if (carousel.get("selectOnScroll")) {
carousel._selectedItem = carousel._ge... | [
"function",
"(",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"item",
"=",
"carousel",
".",
"_firstItem",
"+",
"carousel",
".",
"get",
"(",
"\"numVisible\"",
")",
";",
"if",
"(",
"item",
">",
"carousel",
".",
"get",
"(",
"\"numItems\"",
")",
")",
"... | Scroll the Carousel by a page forward.
@method scrollPageForward
@public | [
"Scroll",
"the",
"Carousel",
"by",
"a",
"page",
"forward",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2501-L2514 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function () {
var carousel = this,
newpos = 0,
selected = carousel.get("selectedItem");
if (selected == this._firstItem) {
newpos = selected - carousel.get("numVisible");
carousel._selectedItem = carousel._getSelectedItem(selecte... | javascript | function () {
var carousel = this,
newpos = 0,
selected = carousel.get("selectedItem");
if (selected == this._firstItem) {
newpos = selected - carousel.get("numVisible");
carousel._selectedItem = carousel._getSelectedItem(selecte... | [
"function",
"(",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"newpos",
"=",
"0",
",",
"selected",
"=",
"carousel",
".",
"get",
"(",
"\"selectedItem\"",
")",
";",
"if",
"(",
"selected",
"==",
"this",
".",
"_firstItem",
")",
"{",
"newpos",
"=",
"sel... | Select the previous item in the Carousel.
@method selectPreviousItem
@public | [
"Select",
"the",
"previous",
"item",
"in",
"the",
"Carousel",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2667-L2681 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function () {
var carousel = this, newpos = 0;
newpos = carousel.get("selectedItem") +
carousel.get("scrollIncrement");
carousel.set("selectedItem", carousel._getSelectedItem(newpos));
} | javascript | function () {
var carousel = this, newpos = 0;
newpos = carousel.get("selectedItem") +
carousel.get("scrollIncrement");
carousel.set("selectedItem", carousel._getSelectedItem(newpos));
} | [
"function",
"(",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"newpos",
"=",
"0",
";",
"newpos",
"=",
"carousel",
".",
"get",
"(",
"\"selectedItem\"",
")",
"+",
"carousel",
".",
"get",
"(",
"\"scrollIncrement\"",
")",
";",
"carousel",
".",
"set",
"("... | Select the next item in the Carousel.
@method selectNextItem
@public | [
"Select",
"the",
"next",
"item",
"in",
"the",
"Carousel",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2689-L2695 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function () {
var carousel = this,
cssClass = carousel.CLASSES;
if (carousel.fireEvent(beforeShowEvent) !== false) {
carousel.addClass(cssClass.VISIBLE);
carousel.fireEvent(showEvent);
}
} | javascript | function () {
var carousel = this,
cssClass = carousel.CLASSES;
if (carousel.fireEvent(beforeShowEvent) !== false) {
carousel.addClass(cssClass.VISIBLE);
carousel.fireEvent(showEvent);
}
} | [
"function",
"(",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"cssClass",
"=",
"carousel",
".",
"CLASSES",
";",
"if",
"(",
"carousel",
".",
"fireEvent",
"(",
"beforeShowEvent",
")",
"!==",
"false",
")",
"{",
"carousel",
".",
"addClass",
"(",
"cssClass"... | Display the Carousel.
@method show
@public | [
"Display",
"the",
"Carousel",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2703-L2711 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function () {
var carousel = this, timer;
if (JS.isUndefined(carousel._autoPlayTimer)) {
timer = carousel.get("autoPlayInterval");
if (timer <= 0) {
return;
}
carousel._isAutoPlayInProgress = true;
... | javascript | function () {
var carousel = this, timer;
if (JS.isUndefined(carousel._autoPlayTimer)) {
timer = carousel.get("autoPlayInterval");
if (timer <= 0) {
return;
}
carousel._isAutoPlayInProgress = true;
... | [
"function",
"(",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"timer",
";",
"if",
"(",
"JS",
".",
"isUndefined",
"(",
"carousel",
".",
"_autoPlayTimer",
")",
")",
"{",
"timer",
"=",
"carousel",
".",
"get",
"(",
"\"autoPlayInterval\"",
")",
";",
"if",... | Start auto-playing the Carousel.
@method startAutoPlay
@public | [
"Start",
"auto",
"-",
"playing",
"the",
"Carousel",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2719-L2733 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function () {
var carousel = this;
if (!JS.isUndefined(carousel._autoPlayTimer)) {
clearTimeout(carousel._autoPlayTimer);
delete carousel._autoPlayTimer;
carousel._isAutoPlayInProgress = false;
carousel.fireEvent(stopAutoPlayEvent)... | javascript | function () {
var carousel = this;
if (!JS.isUndefined(carousel._autoPlayTimer)) {
clearTimeout(carousel._autoPlayTimer);
delete carousel._autoPlayTimer;
carousel._isAutoPlayInProgress = false;
carousel.fireEvent(stopAutoPlayEvent)... | [
"function",
"(",
")",
"{",
"var",
"carousel",
"=",
"this",
";",
"if",
"(",
"!",
"JS",
".",
"isUndefined",
"(",
"carousel",
".",
"_autoPlayTimer",
")",
")",
"{",
"clearTimeout",
"(",
"carousel",
".",
"_autoPlayTimer",
")",
";",
"delete",
"carousel",
".",
... | Stop auto-playing the Carousel.
@method stopAutoPlay
@public | [
"Stop",
"auto",
"-",
"playing",
"the",
"Carousel",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2741-L2750 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function () {
var carousel = this,
pagination = carousel._pagination;
if(!pagination.el){ return false; }
var numItems = carousel.get('numItems'),
numVisible = carousel.get('numVisible'),
firstVisible = carousel.get('firstVisible')+1,
... | javascript | function () {
var carousel = this,
pagination = carousel._pagination;
if(!pagination.el){ return false; }
var numItems = carousel.get('numItems'),
numVisible = carousel.get('numVisible'),
firstVisible = carousel.get('firstVisible')+1,
... | [
"function",
"(",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"pagination",
"=",
"carousel",
".",
"_pagination",
";",
"if",
"(",
"!",
"pagination",
".",
"el",
")",
"{",
"return",
"false",
";",
"}",
"var",
"numItems",
"=",
"carousel",
".",
"get",
"(... | Update interface's pagination data within a registered template.
@method updatePagination
@public | [
"Update",
"interface",
"s",
"pagination",
"data",
"within",
"a",
"registered",
"template",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2758-L2781 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function (tpl, pos, cb) {
var carousel = this;
carousel._pagination.template = tpl;
carousel._pagination.callback = cb || {};
if(!carousel._pagination.el){
carousel._pagination.el = createElement('DIV', {className:carousel.CLASSES.PAGINATION});
... | javascript | function (tpl, pos, cb) {
var carousel = this;
carousel._pagination.template = tpl;
carousel._pagination.callback = cb || {};
if(!carousel._pagination.el){
carousel._pagination.el = createElement('DIV', {className:carousel.CLASSES.PAGINATION});
... | [
"function",
"(",
"tpl",
",",
"pos",
",",
"cb",
")",
"{",
"var",
"carousel",
"=",
"this",
";",
"carousel",
".",
"_pagination",
".",
"template",
"=",
"tpl",
";",
"carousel",
".",
"_pagination",
".",
"callback",
"=",
"cb",
"||",
"{",
"}",
";",
"if",
"... | Register carousels pagination template, append to interface, and populate.
@method registerPagination
@param template {String} Pagination template as passed to lang.substitute
@public | [
"Register",
"carousels",
"pagination",
"template",
"append",
"to",
"interface",
"and",
"populate",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2790-L2810 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function (ev, p, o) {
o.scope._isAnimationInProgress = false;
updateStateAfterScroll.call(o.scope, o.item, o.last);
} | javascript | function (ev, p, o) {
o.scope._isAnimationInProgress = false;
updateStateAfterScroll.call(o.scope, o.item, o.last);
} | [
"function",
"(",
"ev",
",",
"p",
",",
"o",
")",
"{",
"o",
".",
"scope",
".",
"_isAnimationInProgress",
"=",
"false",
";",
"updateStateAfterScroll",
".",
"call",
"(",
"o",
".",
"scope",
",",
"o",
".",
"item",
",",
"o",
".",
"last",
")",
";",
"}"
] | Handle the animation complete event.
@method _animationCompleteHandler
@param {Event} ev The event.
@param {Array} p The event parameters.
@param {Object} o The object that has the state of the Carousel
@protected | [
"Handle",
"the",
"animation",
"complete",
"event",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2868-L2871 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function() {
var carousel = this,
currIndex = carousel._firstItem,
index;
if (currIndex >= carousel.get("numItems") - 1) {
if (carousel.get("isCircular")) {
index = 0;
} else {
carousel.stop... | javascript | function() {
var carousel = this,
currIndex = carousel._firstItem,
index;
if (currIndex >= carousel.get("numItems") - 1) {
if (carousel.get("isCircular")) {
index = 0;
} else {
carousel.stop... | [
"function",
"(",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"currIndex",
"=",
"carousel",
".",
"_firstItem",
",",
"index",
";",
"if",
"(",
"currIndex",
">=",
"carousel",
".",
"get",
"(",
"\"numItems\"",
")",
"-",
"1",
")",
"{",
"if",
"(",
"carous... | Automatically scroll the contents of the Carousel.
@method _autoScroll
@protected | [
"Automatically",
"scroll",
"the",
"contents",
"of",
"the",
"Carousel",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2878-L2895 | train | |
neyric/webhookit | public/javascripts/yui/carousel/carousel-debug.js | function (elId) {
var carousel = this,
cssClass = carousel.CLASSES,
el = Dom.get(elId);
if (!el) {
el = createElement("DIV", {
className : cssClass.CAROUSEL,
id : elId
})... | javascript | function (elId) {
var carousel = this,
cssClass = carousel.CLASSES,
el = Dom.get(elId);
if (!el) {
el = createElement("DIV", {
className : cssClass.CAROUSEL,
id : elId
})... | [
"function",
"(",
"elId",
")",
"{",
"var",
"carousel",
"=",
"this",
",",
"cssClass",
"=",
"carousel",
".",
"CLASSES",
",",
"el",
"=",
"Dom",
".",
"get",
"(",
"elId",
")",
";",
"if",
"(",
"!",
"el",
")",
"{",
"el",
"=",
"createElement",
"(",
"\"DIV... | Create the Carousel.
@method createCarousel
@param elId {String} The id of the element to be created
@protected | [
"Create",
"the",
"Carousel",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/carousel/carousel-debug.js#L2904-L2922 | 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.