id
int32 0
58k
| repo
stringlengths 5
67
| path
stringlengths 4
116
| func_name
stringlengths 0
58
| original_string
stringlengths 52
373k
| language
stringclasses 1
value | code
stringlengths 52
373k
| code_tokens
list | docstring
stringlengths 4
11.8k
| docstring_tokens
list | sha
stringlengths 40
40
| url
stringlengths 86
226
|
---|---|---|---|---|---|---|---|---|---|---|---|
42,600 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function(fn) {
var values = [];
for (var i in this._nodes) {
if (this._nodes.hasOwnProperty(i)) {
var n = this._nodes[i];
if (fn(n)) {
values.push(n);
}
}
}
return (values.length) ? values : null;
} | javascript | function(fn) {
var values = [];
for (var i in this._nodes) {
if (this._nodes.hasOwnProperty(i)) {
var n = this._nodes[i];
if (fn(n)) {
values.push(n);
}
}
}
return (values.length) ? values : null;
} | [
"function",
"(",
"fn",
")",
"{",
"var",
"values",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"in",
"this",
".",
"_nodes",
")",
"{",
"if",
"(",
"this",
".",
"_nodes",
".",
"hasOwnProperty",
"(",
"i",
")",
")",
"{",
"var",
"n",
"=",
"this",
".",
"_nodes",
"[",
"i",
"]",
";",
"if",
"(",
"fn",
"(",
"n",
")",
")",
"{",
"values",
".",
"push",
"(",
"n",
")",
";",
"}",
"}",
"}",
"return",
"(",
"values",
".",
"length",
")",
"?",
"values",
":",
"null",
";",
"}"
]
| Returns a collection of nodes that have passed the test function
passed as its only argument.
The function will receive a reference to each node to be tested.
@method getNodesBy
@param {function} a boolean function that receives a Node instance and returns true to add the node to the results list
@return {Array} the matching collection of nodes, null if no match | [
"Returns",
"a",
"collection",
"of",
"nodes",
"that",
"have",
"passed",
"the",
"test",
"function",
"passed",
"as",
"its",
"only",
"argument",
".",
"The",
"function",
"will",
"receive",
"a",
"reference",
"to",
"each",
"node",
"to",
"be",
"tested",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L994-L1005 |
|
42,601 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function(el) {
var p=el, m, re=/ygtv([^\d]*)(.*)/;
do {
if (p && p.id) {
m = p.id.match(re);
if (m && m[2]) {
return this.getNodeByIndex(m[2]);
}
}
p = p.parentNode;
if (!p || !p.tagName) {
break;
}
}
while (p.id !== this.id && p.tagName.toLowerCase() !== "body");
return null;
} | javascript | function(el) {
var p=el, m, re=/ygtv([^\d]*)(.*)/;
do {
if (p && p.id) {
m = p.id.match(re);
if (m && m[2]) {
return this.getNodeByIndex(m[2]);
}
}
p = p.parentNode;
if (!p || !p.tagName) {
break;
}
}
while (p.id !== this.id && p.tagName.toLowerCase() !== "body");
return null;
} | [
"function",
"(",
"el",
")",
"{",
"var",
"p",
"=",
"el",
",",
"m",
",",
"re",
"=",
"/",
"ygtv([^\\d]*)(.*)",
"/",
";",
"do",
"{",
"if",
"(",
"p",
"&&",
"p",
".",
"id",
")",
"{",
"m",
"=",
"p",
".",
"id",
".",
"match",
"(",
"re",
")",
";",
"if",
"(",
"m",
"&&",
"m",
"[",
"2",
"]",
")",
"{",
"return",
"this",
".",
"getNodeByIndex",
"(",
"m",
"[",
"2",
"]",
")",
";",
"}",
"}",
"p",
"=",
"p",
".",
"parentNode",
";",
"if",
"(",
"!",
"p",
"||",
"!",
"p",
".",
"tagName",
")",
"{",
"break",
";",
"}",
"}",
"while",
"(",
"p",
".",
"id",
"!==",
"this",
".",
"id",
"&&",
"p",
".",
"tagName",
".",
"toLowerCase",
"(",
")",
"!==",
"\"body\"",
")",
";",
"return",
"null",
";",
"}"
]
| Returns the treeview node reference for an ancestor element
of the node, or null if it is not contained within any node
in this tree.
@method getNodeByElement
@param el {HTMLElement} the element to test
@return {YAHOO.widget.Node} a node reference or null | [
"Returns",
"the",
"treeview",
"node",
"reference",
"for",
"an",
"ancestor",
"element",
"of",
"the",
"node",
"or",
"null",
"if",
"it",
"is",
"not",
"contained",
"within",
"any",
"node",
"in",
"this",
"tree",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L1014-L1037 |
|
42,602 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function(node, autoRefresh) {
// Don't delete the root node
if (node.isRoot()) {
return false;
}
// Get the branch that we may need to refresh
var p = node.parent;
if (p.parent) {
p = p.parent;
}
// Delete the node and its children
this._deleteNode(node);
// Refresh the parent of the parent
if (autoRefresh && p && p.childrenRendered) {
p.refresh();
}
return true;
} | javascript | function(node, autoRefresh) {
// Don't delete the root node
if (node.isRoot()) {
return false;
}
// Get the branch that we may need to refresh
var p = node.parent;
if (p.parent) {
p = p.parent;
}
// Delete the node and its children
this._deleteNode(node);
// Refresh the parent of the parent
if (autoRefresh && p && p.childrenRendered) {
p.refresh();
}
return true;
} | [
"function",
"(",
"node",
",",
"autoRefresh",
")",
"{",
"// Don't delete the root node",
"if",
"(",
"node",
".",
"isRoot",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"// Get the branch that we may need to refresh",
"var",
"p",
"=",
"node",
".",
"parent",
";",
"if",
"(",
"p",
".",
"parent",
")",
"{",
"p",
"=",
"p",
".",
"parent",
";",
"}",
"// Delete the node and its children",
"this",
".",
"_deleteNode",
"(",
"node",
")",
";",
"// Refresh the parent of the parent",
"if",
"(",
"autoRefresh",
"&&",
"p",
"&&",
"p",
".",
"childrenRendered",
")",
"{",
"p",
".",
"refresh",
"(",
")",
";",
"}",
"return",
"true",
";",
"}"
]
| Removes the node and its children, and optionally refreshes the
branch of the tree that was affected.
@method removeNode
@param {Node} node to remove
@param {boolean} autoRefresh automatically refreshes branch if true
@return {boolean} False is there was a problem, true otherwise. | [
"Removes",
"the",
"node",
"and",
"its",
"children",
"and",
"optionally",
"refreshes",
"the",
"branch",
"of",
"the",
"tree",
"that",
"was",
"affected",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L1058-L1080 |
|
42,603 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function(node) {
var p = node.parent;
// Update the parent's collection of children
var a = [];
for (var i=0, len=p.children.length;i<len;++i) {
if (p.children[i] != node) {
a[a.length] = p.children[i];
}
}
p.children = a;
// reset the childrenRendered flag for the parent
p.childrenRendered = false;
// Update the sibling relationship
if (node.previousSibling) {
node.previousSibling.nextSibling = node.nextSibling;
}
if (node.nextSibling) {
node.nextSibling.previousSibling = node.previousSibling;
}
if (this.currentFocus == node) {
this.currentFocus = null;
}
if (this._currentlyHighlighted == node) {
this._currentlyHighlighted = null;
}
node.parent = null;
node.previousSibling = null;
node.nextSibling = null;
node.tree = null;
// Update the tree's node collection
delete this._nodes[node.index];
} | javascript | function(node) {
var p = node.parent;
// Update the parent's collection of children
var a = [];
for (var i=0, len=p.children.length;i<len;++i) {
if (p.children[i] != node) {
a[a.length] = p.children[i];
}
}
p.children = a;
// reset the childrenRendered flag for the parent
p.childrenRendered = false;
// Update the sibling relationship
if (node.previousSibling) {
node.previousSibling.nextSibling = node.nextSibling;
}
if (node.nextSibling) {
node.nextSibling.previousSibling = node.previousSibling;
}
if (this.currentFocus == node) {
this.currentFocus = null;
}
if (this._currentlyHighlighted == node) {
this._currentlyHighlighted = null;
}
node.parent = null;
node.previousSibling = null;
node.nextSibling = null;
node.tree = null;
// Update the tree's node collection
delete this._nodes[node.index];
} | [
"function",
"(",
"node",
")",
"{",
"var",
"p",
"=",
"node",
".",
"parent",
";",
"// Update the parent's collection of children",
"var",
"a",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"p",
".",
"children",
".",
"length",
";",
"i",
"<",
"len",
";",
"++",
"i",
")",
"{",
"if",
"(",
"p",
".",
"children",
"[",
"i",
"]",
"!=",
"node",
")",
"{",
"a",
"[",
"a",
".",
"length",
"]",
"=",
"p",
".",
"children",
"[",
"i",
"]",
";",
"}",
"}",
"p",
".",
"children",
"=",
"a",
";",
"// reset the childrenRendered flag for the parent",
"p",
".",
"childrenRendered",
"=",
"false",
";",
"// Update the sibling relationship",
"if",
"(",
"node",
".",
"previousSibling",
")",
"{",
"node",
".",
"previousSibling",
".",
"nextSibling",
"=",
"node",
".",
"nextSibling",
";",
"}",
"if",
"(",
"node",
".",
"nextSibling",
")",
"{",
"node",
".",
"nextSibling",
".",
"previousSibling",
"=",
"node",
".",
"previousSibling",
";",
"}",
"if",
"(",
"this",
".",
"currentFocus",
"==",
"node",
")",
"{",
"this",
".",
"currentFocus",
"=",
"null",
";",
"}",
"if",
"(",
"this",
".",
"_currentlyHighlighted",
"==",
"node",
")",
"{",
"this",
".",
"_currentlyHighlighted",
"=",
"null",
";",
"}",
"node",
".",
"parent",
"=",
"null",
";",
"node",
".",
"previousSibling",
"=",
"null",
";",
"node",
".",
"nextSibling",
"=",
"null",
";",
"node",
".",
"tree",
"=",
"null",
";",
"// Update the tree's node collection ",
"delete",
"this",
".",
"_nodes",
"[",
"node",
".",
"index",
"]",
";",
"}"
]
| Removes the node from the tree, preserving the child collection
to make it possible to insert the branch into another part of the
tree, or another tree.
@method popNode
@param {Node} node to remove | [
"Removes",
"the",
"node",
"from",
"the",
"tree",
"preserving",
"the",
"child",
"collection",
"to",
"make",
"it",
"possible",
"to",
"insert",
"the",
"branch",
"into",
"another",
"part",
"of",
"the",
"tree",
"or",
"another",
"tree",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L1151-L1191 |
|
42,604 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function() {
// Since the label editor can be separated from the main TreeView control
// the destroy method for it might not be there.
if (this._destroyEditor) { this._destroyEditor(); }
var el = this.getEl();
Event.removeListener(el,'click');
Event.removeListener(el,'dblclick');
Event.removeListener(el,'mouseover');
Event.removeListener(el,'mouseout');
Event.removeListener(el,'keydown');
for (var i = 0 ; i < this._nodes.length; i++) {
var node = this._nodes[i];
if (node && node.destroy) {node.destroy(); }
}
el.innerHTML = '';
this._hasEvents = false;
} | javascript | function() {
// Since the label editor can be separated from the main TreeView control
// the destroy method for it might not be there.
if (this._destroyEditor) { this._destroyEditor(); }
var el = this.getEl();
Event.removeListener(el,'click');
Event.removeListener(el,'dblclick');
Event.removeListener(el,'mouseover');
Event.removeListener(el,'mouseout');
Event.removeListener(el,'keydown');
for (var i = 0 ; i < this._nodes.length; i++) {
var node = this._nodes[i];
if (node && node.destroy) {node.destroy(); }
}
el.innerHTML = '';
this._hasEvents = false;
} | [
"function",
"(",
")",
"{",
"// Since the label editor can be separated from the main TreeView control",
"// the destroy method for it might not be there.",
"if",
"(",
"this",
".",
"_destroyEditor",
")",
"{",
"this",
".",
"_destroyEditor",
"(",
")",
";",
"}",
"var",
"el",
"=",
"this",
".",
"getEl",
"(",
")",
";",
"Event",
".",
"removeListener",
"(",
"el",
",",
"'click'",
")",
";",
"Event",
".",
"removeListener",
"(",
"el",
",",
"'dblclick'",
")",
";",
"Event",
".",
"removeListener",
"(",
"el",
",",
"'mouseover'",
")",
";",
"Event",
".",
"removeListener",
"(",
"el",
",",
"'mouseout'",
")",
";",
"Event",
".",
"removeListener",
"(",
"el",
",",
"'keydown'",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"_nodes",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"node",
"=",
"this",
".",
"_nodes",
"[",
"i",
"]",
";",
"if",
"(",
"node",
"&&",
"node",
".",
"destroy",
")",
"{",
"node",
".",
"destroy",
"(",
")",
";",
"}",
"}",
"el",
".",
"innerHTML",
"=",
"''",
";",
"this",
".",
"_hasEvents",
"=",
"false",
";",
"}"
]
| Nulls out the entire TreeView instance and related objects, removes attached
event listeners, and clears out DOM elements inside the container. After
calling this method, the instance reference should be expliclitly nulled by
implementer, as in myDataTable = null. Use with caution!
@method destroy | [
"Nulls",
"out",
"the",
"entire",
"TreeView",
"instance",
"and",
"related",
"objects",
"removes",
"attached",
"event",
"listeners",
"and",
"clears",
"out",
"DOM",
"elements",
"inside",
"the",
"container",
".",
"After",
"calling",
"this",
"method",
"the",
"instance",
"reference",
"should",
"be",
"expliclitly",
"nulled",
"by",
"implementer",
"as",
"in",
"myDataTable",
"=",
"null",
".",
"Use",
"with",
"caution!"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L1201-L1217 |
|
42,605 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function(name, value, refresh) {
this.root.setNodesProperty(name,value);
if (refresh) {
this.root.refresh();
}
} | javascript | function(name, value, refresh) {
this.root.setNodesProperty(name,value);
if (refresh) {
this.root.refresh();
}
} | [
"function",
"(",
"name",
",",
"value",
",",
"refresh",
")",
"{",
"this",
".",
"root",
".",
"setNodesProperty",
"(",
"name",
",",
"value",
")",
";",
"if",
"(",
"refresh",
")",
"{",
"this",
".",
"root",
".",
"refresh",
"(",
")",
";",
"}",
"}"
]
| Sets the value of a property for all loaded nodes in the tree.
@method setNodesProperty
@param name {string} Name of the property to be set
@param value {any} value to be set
@param refresh {boolean} if present and true, it does a refresh | [
"Sets",
"the",
"value",
"of",
"a",
"property",
"for",
"all",
"loaded",
"nodes",
"in",
"the",
"tree",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L1274-L1279 |
|
42,606 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function (oArgs) {
var node;
if ('node' in oArgs && oArgs.node instanceof Widget.Node) {
node = oArgs.node;
} else if (oArgs instanceof Widget.Node) {
node = oArgs;
} else {
return false;
}
node.toggleHighlight();
return false;
} | javascript | function (oArgs) {
var node;
if ('node' in oArgs && oArgs.node instanceof Widget.Node) {
node = oArgs.node;
} else if (oArgs instanceof Widget.Node) {
node = oArgs;
} else {
return false;
}
node.toggleHighlight();
return false;
} | [
"function",
"(",
"oArgs",
")",
"{",
"var",
"node",
";",
"if",
"(",
"'node'",
"in",
"oArgs",
"&&",
"oArgs",
".",
"node",
"instanceof",
"Widget",
".",
"Node",
")",
"{",
"node",
"=",
"oArgs",
".",
"node",
";",
"}",
"else",
"if",
"(",
"oArgs",
"instanceof",
"Widget",
".",
"Node",
")",
"{",
"node",
"=",
"oArgs",
";",
"}",
"else",
"{",
"return",
"false",
";",
"}",
"node",
".",
"toggleHighlight",
"(",
")",
";",
"return",
"false",
";",
"}"
]
| Event listener to toggle node highlight.
Can be assigned as listener to clickEvent, dblClickEvent and enterKeyPressed.
It returns false to prevent the default action.
@method onEventToggleHighlight
@param oArgs {any} it takes the arguments of any of the events mentioned above
@return {false} Always cancels the default action for the event | [
"Event",
"listener",
"to",
"toggle",
"node",
"highlight",
".",
"Can",
"be",
"assigned",
"as",
"listener",
"to",
"clickEvent",
"dblClickEvent",
"and",
"enterKeyPressed",
".",
"It",
"returns",
"false",
"to",
"prevent",
"the",
"default",
"action",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L1288-L1299 |
|
42,607 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function(parentNode) {
if (!parentNode) {
return false;
}
this.tree = parentNode.tree;
this.parent = parentNode;
this.depth = parentNode.depth + 1;
// @todo why was this put here. This causes new nodes added at the
// root level to lose the menu behavior.
// if (! this.multiExpand) {
// this.multiExpand = parentNode.multiExpand;
// }
this.tree.regNode(this);
parentNode.childrenRendered = false;
// cascade update existing children
for (var i=0, len=this.children.length;i<len;++i) {
this.children[i].applyParent(this);
}
this.fireEvent("parentChange");
return true;
} | javascript | function(parentNode) {
if (!parentNode) {
return false;
}
this.tree = parentNode.tree;
this.parent = parentNode;
this.depth = parentNode.depth + 1;
// @todo why was this put here. This causes new nodes added at the
// root level to lose the menu behavior.
// if (! this.multiExpand) {
// this.multiExpand = parentNode.multiExpand;
// }
this.tree.regNode(this);
parentNode.childrenRendered = false;
// cascade update existing children
for (var i=0, len=this.children.length;i<len;++i) {
this.children[i].applyParent(this);
}
this.fireEvent("parentChange");
return true;
} | [
"function",
"(",
"parentNode",
")",
"{",
"if",
"(",
"!",
"parentNode",
")",
"{",
"return",
"false",
";",
"}",
"this",
".",
"tree",
"=",
"parentNode",
".",
"tree",
";",
"this",
".",
"parent",
"=",
"parentNode",
";",
"this",
".",
"depth",
"=",
"parentNode",
".",
"depth",
"+",
"1",
";",
"// @todo why was this put here. This causes new nodes added at the",
"// root level to lose the menu behavior.",
"// if (! this.multiExpand) {",
"// this.multiExpand = parentNode.multiExpand;",
"// }",
"this",
".",
"tree",
".",
"regNode",
"(",
"this",
")",
";",
"parentNode",
".",
"childrenRendered",
"=",
"false",
";",
"// cascade update existing children",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"this",
".",
"children",
".",
"length",
";",
"i",
"<",
"len",
";",
"++",
"i",
")",
"{",
"this",
".",
"children",
"[",
"i",
"]",
".",
"applyParent",
"(",
"this",
")",
";",
"}",
"this",
".",
"fireEvent",
"(",
"\"parentChange\"",
")",
";",
"return",
"true",
";",
"}"
]
| Certain properties for the node cannot be set until the parent
is known. This is called after the node is inserted into a tree.
the parent is also applied to this node's children in order to
make it possible to move a branch from one tree to another.
@method applyParent
@param {Node} parentNode this node's parent node
@return {boolean} true if the application was successful | [
"Certain",
"properties",
"for",
"the",
"node",
"cannot",
"be",
"set",
"until",
"the",
"parent",
"is",
"known",
".",
"This",
"is",
"called",
"after",
"the",
"node",
"is",
"inserted",
"into",
"a",
"tree",
".",
"the",
"parent",
"is",
"also",
"applied",
"to",
"this",
"node",
"s",
"children",
"in",
"order",
"to",
"make",
"it",
"possible",
"to",
"move",
"a",
"branch",
"from",
"one",
"tree",
"to",
"another",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L1704-L1730 |
|
42,608 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function(childNode) {
if (this.hasChildren()) {
var sib = this.children[this.children.length - 1];
sib.nextSibling = childNode;
childNode.previousSibling = sib;
}
this.children[this.children.length] = childNode;
childNode.applyParent(this);
// part of the IE display issue workaround. If child nodes
// are added after the initial render, and the node was
// instantiated with expanded = true, we need to show the
// children div now that the node has a child.
if (this.childrenRendered && this.expanded) {
this.getChildrenEl().style.display = "";
}
return childNode;
} | javascript | function(childNode) {
if (this.hasChildren()) {
var sib = this.children[this.children.length - 1];
sib.nextSibling = childNode;
childNode.previousSibling = sib;
}
this.children[this.children.length] = childNode;
childNode.applyParent(this);
// part of the IE display issue workaround. If child nodes
// are added after the initial render, and the node was
// instantiated with expanded = true, we need to show the
// children div now that the node has a child.
if (this.childrenRendered && this.expanded) {
this.getChildrenEl().style.display = "";
}
return childNode;
} | [
"function",
"(",
"childNode",
")",
"{",
"if",
"(",
"this",
".",
"hasChildren",
"(",
")",
")",
"{",
"var",
"sib",
"=",
"this",
".",
"children",
"[",
"this",
".",
"children",
".",
"length",
"-",
"1",
"]",
";",
"sib",
".",
"nextSibling",
"=",
"childNode",
";",
"childNode",
".",
"previousSibling",
"=",
"sib",
";",
"}",
"this",
".",
"children",
"[",
"this",
".",
"children",
".",
"length",
"]",
"=",
"childNode",
";",
"childNode",
".",
"applyParent",
"(",
"this",
")",
";",
"// part of the IE display issue workaround. If child nodes",
"// are added after the initial render, and the node was",
"// instantiated with expanded = true, we need to show the",
"// children div now that the node has a child.",
"if",
"(",
"this",
".",
"childrenRendered",
"&&",
"this",
".",
"expanded",
")",
"{",
"this",
".",
"getChildrenEl",
"(",
")",
".",
"style",
".",
"display",
"=",
"\"\"",
";",
"}",
"return",
"childNode",
";",
"}"
]
| Appends a node to the child collection.
@method appendChild
@param childNode {Node} the new node
@return {Node} the child node
@private | [
"Appends",
"a",
"node",
"to",
"the",
"child",
"collection",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L1739-L1757 |
|
42,609 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function(parentNode) {
if (parentNode && parentNode.children) {
for (var i=0, len=parentNode.children.length; i<len ; ++i) {
if (parentNode.children[i] === this) {
return i;
}
}
}
return -1;
} | javascript | function(parentNode) {
if (parentNode && parentNode.children) {
for (var i=0, len=parentNode.children.length; i<len ; ++i) {
if (parentNode.children[i] === this) {
return i;
}
}
}
return -1;
} | [
"function",
"(",
"parentNode",
")",
"{",
"if",
"(",
"parentNode",
"&&",
"parentNode",
".",
"children",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"parentNode",
".",
"children",
".",
"length",
";",
"i",
"<",
"len",
";",
"++",
"i",
")",
"{",
"if",
"(",
"parentNode",
".",
"children",
"[",
"i",
"]",
"===",
"this",
")",
"{",
"return",
"i",
";",
"}",
"}",
"}",
"return",
"-",
"1",
";",
"}"
]
| Returns true if the Node is a child of supplied Node
@method isChildOf
@param parentNode {Node} the Node to check
@return {boolean} The node index if this Node is a child of
supplied Node, else -1.
@private | [
"Returns",
"true",
"if",
"the",
"Node",
"is",
"a",
"child",
"of",
"supplied",
"Node"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L1840-L1850 |
|
42,610 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function() {
var sib = this.parent.children.slice(0);
for (var i=0;i < sib.length && sib[i] != this;i++) {}
sib.splice(i,1);
if (sib.length) { return sib; }
return null;
} | javascript | function() {
var sib = this.parent.children.slice(0);
for (var i=0;i < sib.length && sib[i] != this;i++) {}
sib.splice(i,1);
if (sib.length) { return sib; }
return null;
} | [
"function",
"(",
")",
"{",
"var",
"sib",
"=",
"this",
".",
"parent",
".",
"children",
".",
"slice",
"(",
"0",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"sib",
".",
"length",
"&&",
"sib",
"[",
"i",
"]",
"!=",
"this",
";",
"i",
"++",
")",
"{",
"}",
"sib",
".",
"splice",
"(",
"i",
",",
"1",
")",
";",
"if",
"(",
"sib",
".",
"length",
")",
"{",
"return",
"sib",
";",
"}",
"return",
"null",
";",
"}"
]
| Returns a node array of this node's siblings, null if none.
@method getSiblings
@return Node[] | [
"Returns",
"a",
"node",
"array",
"of",
"this",
"node",
"s",
"siblings",
"null",
"if",
"none",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L1857-L1863 |
|
42,611 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function() {
var l = this.children.length;
for (var i=0;i<l;++i) {
var c = this.children[i];
if (c.isDynamic()) {
break;
} else if (! c.multiExpand) {
break;
} else {
c.expand();
c.expandAll();
}
}
} | javascript | function() {
var l = this.children.length;
for (var i=0;i<l;++i) {
var c = this.children[i];
if (c.isDynamic()) {
break;
} else if (! c.multiExpand) {
break;
} else {
c.expand();
c.expandAll();
}
}
} | [
"function",
"(",
")",
"{",
"var",
"l",
"=",
"this",
".",
"children",
".",
"length",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"l",
";",
"++",
"i",
")",
"{",
"var",
"c",
"=",
"this",
".",
"children",
"[",
"i",
"]",
";",
"if",
"(",
"c",
".",
"isDynamic",
"(",
")",
")",
"{",
"break",
";",
"}",
"else",
"if",
"(",
"!",
"c",
".",
"multiExpand",
")",
"{",
"break",
";",
"}",
"else",
"{",
"c",
".",
"expand",
"(",
")",
";",
"c",
".",
"expandAll",
"(",
")",
";",
"}",
"}",
"}"
]
| Recursively expands all of this node's children.
@method expandAll | [
"Recursively",
"expands",
"all",
"of",
"this",
"node",
"s",
"children",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L2148-L2161 |
|
42,612 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function() {
for (var i=0;i<this.children.length;++i) {
this.children[i].collapse();
this.children[i].collapseAll();
}
} | javascript | function() {
for (var i=0;i<this.children.length;++i) {
this.children[i].collapse();
this.children[i].collapseAll();
}
} | [
"function",
"(",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"children",
".",
"length",
";",
"++",
"i",
")",
"{",
"this",
".",
"children",
"[",
"i",
"]",
".",
"collapse",
"(",
")",
";",
"this",
".",
"children",
"[",
"i",
"]",
".",
"collapseAll",
"(",
")",
";",
"}",
"}"
]
| Recursively collapses all of this node's children.
@method collapseAll | [
"Recursively",
"collapses",
"all",
"of",
"this",
"node",
"s",
"children",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L2167-L2172 |
|
42,613 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function(fnDataLoader, iconMode) {
if (fnDataLoader) {
this.dataLoader = fnDataLoader;
this._dynLoad = true;
} else {
this.dataLoader = null;
this._dynLoad = false;
}
if (iconMode) {
this.iconMode = iconMode;
}
} | javascript | function(fnDataLoader, iconMode) {
if (fnDataLoader) {
this.dataLoader = fnDataLoader;
this._dynLoad = true;
} else {
this.dataLoader = null;
this._dynLoad = false;
}
if (iconMode) {
this.iconMode = iconMode;
}
} | [
"function",
"(",
"fnDataLoader",
",",
"iconMode",
")",
"{",
"if",
"(",
"fnDataLoader",
")",
"{",
"this",
".",
"dataLoader",
"=",
"fnDataLoader",
";",
"this",
".",
"_dynLoad",
"=",
"true",
";",
"}",
"else",
"{",
"this",
".",
"dataLoader",
"=",
"null",
";",
"this",
".",
"_dynLoad",
"=",
"false",
";",
"}",
"if",
"(",
"iconMode",
")",
"{",
"this",
".",
"iconMode",
"=",
"iconMode",
";",
"}",
"}"
]
| Configures this node for dynamically obtaining the child data
when the node is first expanded. Calling it without the callback
will turn off dynamic load for the node.
@method setDynamicLoad
@param fmDataLoader {function} the function that will be used to get the data.
@param iconMode {int} configures the icon that is displayed when a dynamic
load node is expanded the first time without children. By default, the
"collapse" icon will be used. If set to 1, the leaf node icon will be
displayed. | [
"Configures",
"this",
"node",
"for",
"dynamically",
"obtaining",
"the",
"child",
"data",
"when",
"the",
"node",
"is",
"first",
"expanded",
".",
"Calling",
"it",
"without",
"the",
"callback",
"will",
"turn",
"off",
"dynamic",
"load",
"for",
"the",
"node",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L2185-L2197 |
|
42,614 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function() {
var sb = [];
sb[sb.length] = '<div class="ygtvchildren" id="' + this.getChildrenElId() + '"';
// This is a workaround for an IE rendering issue, the child div has layout
// in IE, creating extra space if a leaf node is created with the expanded
// property set to true.
if (!this.expanded || !this.hasChildren()) {
sb[sb.length] = ' style="display:none;"';
}
sb[sb.length] = '>';
// Don't render the actual child node HTML unless this node is expanded.
if ( (this.hasChildren(true) && this.expanded) ||
(this.renderHidden && !this.isDynamic()) ) {
sb[sb.length] = this.renderChildren();
}
sb[sb.length] = '</div>';
return sb.join("");
} | javascript | function() {
var sb = [];
sb[sb.length] = '<div class="ygtvchildren" id="' + this.getChildrenElId() + '"';
// This is a workaround for an IE rendering issue, the child div has layout
// in IE, creating extra space if a leaf node is created with the expanded
// property set to true.
if (!this.expanded || !this.hasChildren()) {
sb[sb.length] = ' style="display:none;"';
}
sb[sb.length] = '>';
// Don't render the actual child node HTML unless this node is expanded.
if ( (this.hasChildren(true) && this.expanded) ||
(this.renderHidden && !this.isDynamic()) ) {
sb[sb.length] = this.renderChildren();
}
sb[sb.length] = '</div>';
return sb.join("");
} | [
"function",
"(",
")",
"{",
"var",
"sb",
"=",
"[",
"]",
";",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"'<div class=\"ygtvchildren\" id=\"'",
"+",
"this",
".",
"getChildrenElId",
"(",
")",
"+",
"'\"'",
";",
"// This is a workaround for an IE rendering issue, the child div has layout",
"// in IE, creating extra space if a leaf node is created with the expanded",
"// property set to true.",
"if",
"(",
"!",
"this",
".",
"expanded",
"||",
"!",
"this",
".",
"hasChildren",
"(",
")",
")",
"{",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"' style=\"display:none;\"'",
";",
"}",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"'>'",
";",
"// Don't render the actual child node HTML unless this node is expanded.",
"if",
"(",
"(",
"this",
".",
"hasChildren",
"(",
"true",
")",
"&&",
"this",
".",
"expanded",
")",
"||",
"(",
"this",
".",
"renderHidden",
"&&",
"!",
"this",
".",
"isDynamic",
"(",
")",
")",
")",
"{",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"this",
".",
"renderChildren",
"(",
")",
";",
"}",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"'</div>'",
";",
"return",
"sb",
".",
"join",
"(",
"\"\"",
")",
";",
"}"
]
| Called when first rendering the tree. We always build the div that will
contain this nodes children, but we don't render the children themselves
unless this node is expanded.
@method getChildrenHtml
@return {string} the children container div html and any expanded children
@private | [
"Called",
"when",
"first",
"rendering",
"the",
"tree",
".",
"We",
"always",
"build",
"the",
"div",
"that",
"will",
"contain",
"this",
"nodes",
"children",
"but",
"we",
"don",
"t",
"render",
"the",
"children",
"themselves",
"unless",
"this",
"node",
"is",
"expanded",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L2288-L2312 |
|
42,615 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function() {
// this.loadComplete();
this.getChildrenEl().innerHTML = this.completeRender();
if (this.hasIcon) {
var el = this.getToggleEl();
if (el) {
el.className = el.className.replace(/\bygtv[lt][nmp]h*\b/gi,this.getStyle());
}
}
} | javascript | function() {
// this.loadComplete();
this.getChildrenEl().innerHTML = this.completeRender();
if (this.hasIcon) {
var el = this.getToggleEl();
if (el) {
el.className = el.className.replace(/\bygtv[lt][nmp]h*\b/gi,this.getStyle());
}
}
} | [
"function",
"(",
")",
"{",
"// this.loadComplete();",
"this",
".",
"getChildrenEl",
"(",
")",
".",
"innerHTML",
"=",
"this",
".",
"completeRender",
"(",
")",
";",
"if",
"(",
"this",
".",
"hasIcon",
")",
"{",
"var",
"el",
"=",
"this",
".",
"getToggleEl",
"(",
")",
";",
"if",
"(",
"el",
")",
"{",
"el",
".",
"className",
"=",
"el",
".",
"className",
".",
"replace",
"(",
"/",
"\\bygtv[lt][nmp]h*\\b",
"/",
"gi",
",",
"this",
".",
"getStyle",
"(",
")",
")",
";",
"}",
"}",
"}"
]
| Regenerates the html for this node and its children. To be used when the
node is expanded and new children have been added.
@method refresh | [
"Regenerates",
"the",
"html",
"for",
"this",
"node",
"and",
"its",
"children",
".",
"To",
"be",
"used",
"when",
"the",
"node",
"is",
"expanded",
"and",
"new",
"children",
"have",
"been",
"added",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L2493-L2503 |
|
42,616 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function () {
if (this._focusedItem) {
Event.removeListener(this._focusedItem,'blur');
this._focusedItem = null;
}
var el;
while ((el = this._focusHighlightedItems.shift())) { // yes, it is meant as an assignment, really
Dom.removeClass(el,YAHOO.widget.TreeView.FOCUS_CLASS_NAME );
}
} | javascript | function () {
if (this._focusedItem) {
Event.removeListener(this._focusedItem,'blur');
this._focusedItem = null;
}
var el;
while ((el = this._focusHighlightedItems.shift())) { // yes, it is meant as an assignment, really
Dom.removeClass(el,YAHOO.widget.TreeView.FOCUS_CLASS_NAME );
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_focusedItem",
")",
"{",
"Event",
".",
"removeListener",
"(",
"this",
".",
"_focusedItem",
",",
"'blur'",
")",
";",
"this",
".",
"_focusedItem",
"=",
"null",
";",
"}",
"var",
"el",
";",
"while",
"(",
"(",
"el",
"=",
"this",
".",
"_focusHighlightedItems",
".",
"shift",
"(",
")",
")",
")",
"{",
"// yes, it is meant as an assignment, really",
"Dom",
".",
"removeClass",
"(",
"el",
",",
"YAHOO",
".",
"widget",
".",
"TreeView",
".",
"FOCUS_CLASS_NAME",
")",
";",
"}",
"}"
]
| Removes the focus of previously selected Node
@method _removeFocus
@private | [
"Removes",
"the",
"focus",
"of",
"previously",
"selected",
"Node"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L2544-L2553 |
|
42,617 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function () {
var focused = false, self = this;
if (this.tree.currentFocus) {
this.tree.currentFocus._removeFocus();
}
var expandParent = function (node) {
if (node.parent) {
expandParent(node.parent);
node.parent.expand();
}
};
expandParent(this);
Dom.getElementsBy (
function (el) {
return (/ygtv(([tl][pmn]h?)|(content))/).test(el.className);
} ,
'td' ,
self.getEl().firstChild ,
function (el) {
Dom.addClass(el, YAHOO.widget.TreeView.FOCUS_CLASS_NAME );
if (!focused) {
var aEl = el.getElementsByTagName('a');
if (aEl.length) {
aEl = aEl[0];
aEl.focus();
self._focusedItem = aEl;
Event.on(aEl,'blur',function () {
//console.log('f1');
self.tree.fireEvent('focusChanged',{oldNode:self.tree.currentFocus,newNode:null});
self.tree.currentFocus = null;
self._removeFocus();
});
focused = true;
}
}
self._focusHighlightedItems.push(el);
}
);
if (focused) {
//console.log('f2');
this.tree.fireEvent('focusChanged',{oldNode:this.tree.currentFocus,newNode:this});
this.tree.currentFocus = this;
} else {
//console.log('f3');
this.tree.fireEvent('focusChanged',{oldNode:self.tree.currentFocus,newNode:null});
this.tree.currentFocus = null;
this._removeFocus();
}
return focused;
} | javascript | function () {
var focused = false, self = this;
if (this.tree.currentFocus) {
this.tree.currentFocus._removeFocus();
}
var expandParent = function (node) {
if (node.parent) {
expandParent(node.parent);
node.parent.expand();
}
};
expandParent(this);
Dom.getElementsBy (
function (el) {
return (/ygtv(([tl][pmn]h?)|(content))/).test(el.className);
} ,
'td' ,
self.getEl().firstChild ,
function (el) {
Dom.addClass(el, YAHOO.widget.TreeView.FOCUS_CLASS_NAME );
if (!focused) {
var aEl = el.getElementsByTagName('a');
if (aEl.length) {
aEl = aEl[0];
aEl.focus();
self._focusedItem = aEl;
Event.on(aEl,'blur',function () {
//console.log('f1');
self.tree.fireEvent('focusChanged',{oldNode:self.tree.currentFocus,newNode:null});
self.tree.currentFocus = null;
self._removeFocus();
});
focused = true;
}
}
self._focusHighlightedItems.push(el);
}
);
if (focused) {
//console.log('f2');
this.tree.fireEvent('focusChanged',{oldNode:this.tree.currentFocus,newNode:this});
this.tree.currentFocus = this;
} else {
//console.log('f3');
this.tree.fireEvent('focusChanged',{oldNode:self.tree.currentFocus,newNode:null});
this.tree.currentFocus = null;
this._removeFocus();
}
return focused;
} | [
"function",
"(",
")",
"{",
"var",
"focused",
"=",
"false",
",",
"self",
"=",
"this",
";",
"if",
"(",
"this",
".",
"tree",
".",
"currentFocus",
")",
"{",
"this",
".",
"tree",
".",
"currentFocus",
".",
"_removeFocus",
"(",
")",
";",
"}",
"var",
"expandParent",
"=",
"function",
"(",
"node",
")",
"{",
"if",
"(",
"node",
".",
"parent",
")",
"{",
"expandParent",
"(",
"node",
".",
"parent",
")",
";",
"node",
".",
"parent",
".",
"expand",
"(",
")",
";",
"}",
"}",
";",
"expandParent",
"(",
"this",
")",
";",
"Dom",
".",
"getElementsBy",
"(",
"function",
"(",
"el",
")",
"{",
"return",
"(",
"/",
"ygtv(([tl][pmn]h?)|(content))",
"/",
")",
".",
"test",
"(",
"el",
".",
"className",
")",
";",
"}",
",",
"'td'",
",",
"self",
".",
"getEl",
"(",
")",
".",
"firstChild",
",",
"function",
"(",
"el",
")",
"{",
"Dom",
".",
"addClass",
"(",
"el",
",",
"YAHOO",
".",
"widget",
".",
"TreeView",
".",
"FOCUS_CLASS_NAME",
")",
";",
"if",
"(",
"!",
"focused",
")",
"{",
"var",
"aEl",
"=",
"el",
".",
"getElementsByTagName",
"(",
"'a'",
")",
";",
"if",
"(",
"aEl",
".",
"length",
")",
"{",
"aEl",
"=",
"aEl",
"[",
"0",
"]",
";",
"aEl",
".",
"focus",
"(",
")",
";",
"self",
".",
"_focusedItem",
"=",
"aEl",
";",
"Event",
".",
"on",
"(",
"aEl",
",",
"'blur'",
",",
"function",
"(",
")",
"{",
"//console.log('f1');",
"self",
".",
"tree",
".",
"fireEvent",
"(",
"'focusChanged'",
",",
"{",
"oldNode",
":",
"self",
".",
"tree",
".",
"currentFocus",
",",
"newNode",
":",
"null",
"}",
")",
";",
"self",
".",
"tree",
".",
"currentFocus",
"=",
"null",
";",
"self",
".",
"_removeFocus",
"(",
")",
";",
"}",
")",
";",
"focused",
"=",
"true",
";",
"}",
"}",
"self",
".",
"_focusHighlightedItems",
".",
"push",
"(",
"el",
")",
";",
"}",
")",
";",
"if",
"(",
"focused",
")",
"{",
"//console.log('f2');",
"this",
".",
"tree",
".",
"fireEvent",
"(",
"'focusChanged'",
",",
"{",
"oldNode",
":",
"this",
".",
"tree",
".",
"currentFocus",
",",
"newNode",
":",
"this",
"}",
")",
";",
"this",
".",
"tree",
".",
"currentFocus",
"=",
"this",
";",
"}",
"else",
"{",
"//console.log('f3');",
"this",
".",
"tree",
".",
"fireEvent",
"(",
"'focusChanged'",
",",
"{",
"oldNode",
":",
"self",
".",
"tree",
".",
"currentFocus",
",",
"newNode",
":",
"null",
"}",
")",
";",
"this",
".",
"tree",
".",
"currentFocus",
"=",
"null",
";",
"this",
".",
"_removeFocus",
"(",
")",
";",
"}",
"return",
"focused",
";",
"}"
]
| Sets the focus on the node element.
It will only be able to set the focus on nodes that have anchor elements in it.
Toggle or branch icons have anchors and can be focused on.
If will fail in nodes that have no anchor
@method focus
@return {boolean} success | [
"Sets",
"the",
"focus",
"on",
"the",
"node",
"element",
".",
"It",
"will",
"only",
"be",
"able",
"to",
"set",
"the",
"focus",
"on",
"nodes",
"that",
"have",
"anchor",
"elements",
"in",
"it",
".",
"Toggle",
"or",
"branch",
"icons",
"have",
"anchors",
"and",
"can",
"be",
"focused",
"on",
".",
"If",
"will",
"fail",
"in",
"nodes",
"that",
"have",
"no",
"anchor"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L2562-L2614 |
|
42,618 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function() {
for (var i = 0, count = 0;i< this.children.length;i++) {
count += this.children[i].getNodeCount();
}
return count + 1;
} | javascript | function() {
for (var i = 0, count = 0;i< this.children.length;i++) {
count += this.children[i].getNodeCount();
}
return count + 1;
} | [
"function",
"(",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"count",
"=",
"0",
";",
"i",
"<",
"this",
".",
"children",
".",
"length",
";",
"i",
"++",
")",
"{",
"count",
"+=",
"this",
".",
"children",
"[",
"i",
"]",
".",
"getNodeCount",
"(",
")",
";",
"}",
"return",
"count",
"+",
"1",
";",
"}"
]
| Count of nodes in a branch
@method getNodeCount
@return {int} number of nodes in the branch | [
"Count",
"of",
"nodes",
"in",
"a",
"branch"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L2621-L2626 |
|
42,619 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function() {
if (this.isDynamic()) { return false; }
var def, defs = Lang.merge(this.data), children = [];
if (this.expanded) {defs.expanded = this.expanded; }
if (!this.multiExpand) { defs.multiExpand = this.multiExpand; }
if (!this.renderHidden) { defs.renderHidden = this.renderHidden; }
if (!this.hasIcon) { defs.hasIcon = this.hasIcon; }
if (this.nowrap) { defs.nowrap = this.nowrap; }
if (this.className) { defs.className = this.className; }
if (this.editable) { defs.editable = this.editable; }
if (this.enableHighlight) { defs.enableHighlight = this.enableHighlight; }
if (this.highlightState) { defs.highlightState = this.highlightState; }
if (this.propagateHighlightUp) { defs.propagateHighlightUp = this.propagateHighlightUp; }
if (this.propagateHighlightDown) { defs.propagateHighlightDown = this.propagateHighlightDown; }
defs.type = this._type;
for (var i = 0; i < this.children.length;i++) {
def = this.children[i].getNodeDefinition();
if (def === false) { return false;}
children.push(def);
}
if (children.length) { defs.children = children; }
return defs;
} | javascript | function() {
if (this.isDynamic()) { return false; }
var def, defs = Lang.merge(this.data), children = [];
if (this.expanded) {defs.expanded = this.expanded; }
if (!this.multiExpand) { defs.multiExpand = this.multiExpand; }
if (!this.renderHidden) { defs.renderHidden = this.renderHidden; }
if (!this.hasIcon) { defs.hasIcon = this.hasIcon; }
if (this.nowrap) { defs.nowrap = this.nowrap; }
if (this.className) { defs.className = this.className; }
if (this.editable) { defs.editable = this.editable; }
if (this.enableHighlight) { defs.enableHighlight = this.enableHighlight; }
if (this.highlightState) { defs.highlightState = this.highlightState; }
if (this.propagateHighlightUp) { defs.propagateHighlightUp = this.propagateHighlightUp; }
if (this.propagateHighlightDown) { defs.propagateHighlightDown = this.propagateHighlightDown; }
defs.type = this._type;
for (var i = 0; i < this.children.length;i++) {
def = this.children[i].getNodeDefinition();
if (def === false) { return false;}
children.push(def);
}
if (children.length) { defs.children = children; }
return defs;
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"isDynamic",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"var",
"def",
",",
"defs",
"=",
"Lang",
".",
"merge",
"(",
"this",
".",
"data",
")",
",",
"children",
"=",
"[",
"]",
";",
"if",
"(",
"this",
".",
"expanded",
")",
"{",
"defs",
".",
"expanded",
"=",
"this",
".",
"expanded",
";",
"}",
"if",
"(",
"!",
"this",
".",
"multiExpand",
")",
"{",
"defs",
".",
"multiExpand",
"=",
"this",
".",
"multiExpand",
";",
"}",
"if",
"(",
"!",
"this",
".",
"renderHidden",
")",
"{",
"defs",
".",
"renderHidden",
"=",
"this",
".",
"renderHidden",
";",
"}",
"if",
"(",
"!",
"this",
".",
"hasIcon",
")",
"{",
"defs",
".",
"hasIcon",
"=",
"this",
".",
"hasIcon",
";",
"}",
"if",
"(",
"this",
".",
"nowrap",
")",
"{",
"defs",
".",
"nowrap",
"=",
"this",
".",
"nowrap",
";",
"}",
"if",
"(",
"this",
".",
"className",
")",
"{",
"defs",
".",
"className",
"=",
"this",
".",
"className",
";",
"}",
"if",
"(",
"this",
".",
"editable",
")",
"{",
"defs",
".",
"editable",
"=",
"this",
".",
"editable",
";",
"}",
"if",
"(",
"this",
".",
"enableHighlight",
")",
"{",
"defs",
".",
"enableHighlight",
"=",
"this",
".",
"enableHighlight",
";",
"}",
"if",
"(",
"this",
".",
"highlightState",
")",
"{",
"defs",
".",
"highlightState",
"=",
"this",
".",
"highlightState",
";",
"}",
"if",
"(",
"this",
".",
"propagateHighlightUp",
")",
"{",
"defs",
".",
"propagateHighlightUp",
"=",
"this",
".",
"propagateHighlightUp",
";",
"}",
"if",
"(",
"this",
".",
"propagateHighlightDown",
")",
"{",
"defs",
".",
"propagateHighlightDown",
"=",
"this",
".",
"propagateHighlightDown",
";",
"}",
"defs",
".",
"type",
"=",
"this",
".",
"_type",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"children",
".",
"length",
";",
"i",
"++",
")",
"{",
"def",
"=",
"this",
".",
"children",
"[",
"i",
"]",
".",
"getNodeDefinition",
"(",
")",
";",
"if",
"(",
"def",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"children",
".",
"push",
"(",
"def",
")",
";",
"}",
"if",
"(",
"children",
".",
"length",
")",
"{",
"defs",
".",
"children",
"=",
"children",
";",
"}",
"return",
"defs",
";",
"}"
]
| Returns an object which could be used to build a tree out of this node and its children.
It can be passed to the tree constructor to reproduce this node as a tree.
It will return false if the node or any children loads dynamically, regardless of whether it is loaded or not.
@method getNodeDefinition
@return {Object | false} definition of the tree or false if the node or any children is defined as dynamic | [
"Returns",
"an",
"object",
"which",
"could",
"be",
"used",
"to",
"build",
"a",
"tree",
"out",
"of",
"this",
"node",
"and",
"its",
"children",
".",
"It",
"can",
"be",
"passed",
"to",
"the",
"tree",
"constructor",
"to",
"reproduce",
"this",
"node",
"as",
"a",
"tree",
".",
"It",
"will",
"return",
"false",
"if",
"the",
"node",
"or",
"any",
"children",
"loads",
"dynamically",
"regardless",
"of",
"whether",
"it",
"is",
"loaded",
"or",
"not",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L2635-L2665 |
|
42,620 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function(name, value, refresh) {
if (name.charAt(0) != '_' && !Lang.isUndefined(this[name]) && !Lang.isFunction(this[name]) ) {
this[name] = value;
} else {
this.data[name] = value;
}
for (var i = 0; i < this.children.length;i++) {
this.children[i].setNodesProperty(name,value);
}
if (refresh) {
this.refresh();
}
} | javascript | function(name, value, refresh) {
if (name.charAt(0) != '_' && !Lang.isUndefined(this[name]) && !Lang.isFunction(this[name]) ) {
this[name] = value;
} else {
this.data[name] = value;
}
for (var i = 0; i < this.children.length;i++) {
this.children[i].setNodesProperty(name,value);
}
if (refresh) {
this.refresh();
}
} | [
"function",
"(",
"name",
",",
"value",
",",
"refresh",
")",
"{",
"if",
"(",
"name",
".",
"charAt",
"(",
"0",
")",
"!=",
"'_'",
"&&",
"!",
"Lang",
".",
"isUndefined",
"(",
"this",
"[",
"name",
"]",
")",
"&&",
"!",
"Lang",
".",
"isFunction",
"(",
"this",
"[",
"name",
"]",
")",
")",
"{",
"this",
"[",
"name",
"]",
"=",
"value",
";",
"}",
"else",
"{",
"this",
".",
"data",
"[",
"name",
"]",
"=",
"value",
";",
"}",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"children",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"children",
"[",
"i",
"]",
".",
"setNodesProperty",
"(",
"name",
",",
"value",
")",
";",
"}",
"if",
"(",
"refresh",
")",
"{",
"this",
".",
"refresh",
"(",
")",
";",
"}",
"}"
]
| Sets the value of property for this node and all loaded descendants.
Only public and defined properties can be set, not methods.
Values for unknown properties will be assigned to the refNode.data object
@method setNodesProperty
@param name {string} Name of the property to be set
@param value {any} value to be set
@param refresh {boolean} if present and true, it does a refresh | [
"Sets",
"the",
"value",
"of",
"property",
"for",
"this",
"node",
"and",
"all",
"loaded",
"descendants",
".",
"Only",
"public",
"and",
"defined",
"properties",
"can",
"be",
"set",
"not",
"methods",
".",
"Values",
"for",
"unknown",
"properties",
"will",
"be",
"assigned",
"to",
"the",
"refNode",
".",
"data",
"object"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L2686-L2698 |
|
42,621 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function(_silent) {
if (this.enableHighlight) {
if (this.tree.singleNodeHighlight) {
if (this.tree._currentlyHighlighted) {
this.tree._currentlyHighlighted.unhighlight(_silent);
}
this.tree._currentlyHighlighted = this;
}
this.highlightState = 1;
this._setHighlightClassName();
if (!this.tree.singleNodeHighlight) {
if (this.propagateHighlightDown) {
for (var i = 0;i < this.children.length;i++) {
this.children[i].highlight(true);
}
}
if (this.propagateHighlightUp) {
if (this.parent) {
this.parent._childrenHighlighted();
}
}
}
if (!_silent) {
this.tree.fireEvent('highlightEvent',this);
}
}
} | javascript | function(_silent) {
if (this.enableHighlight) {
if (this.tree.singleNodeHighlight) {
if (this.tree._currentlyHighlighted) {
this.tree._currentlyHighlighted.unhighlight(_silent);
}
this.tree._currentlyHighlighted = this;
}
this.highlightState = 1;
this._setHighlightClassName();
if (!this.tree.singleNodeHighlight) {
if (this.propagateHighlightDown) {
for (var i = 0;i < this.children.length;i++) {
this.children[i].highlight(true);
}
}
if (this.propagateHighlightUp) {
if (this.parent) {
this.parent._childrenHighlighted();
}
}
}
if (!_silent) {
this.tree.fireEvent('highlightEvent',this);
}
}
} | [
"function",
"(",
"_silent",
")",
"{",
"if",
"(",
"this",
".",
"enableHighlight",
")",
"{",
"if",
"(",
"this",
".",
"tree",
".",
"singleNodeHighlight",
")",
"{",
"if",
"(",
"this",
".",
"tree",
".",
"_currentlyHighlighted",
")",
"{",
"this",
".",
"tree",
".",
"_currentlyHighlighted",
".",
"unhighlight",
"(",
"_silent",
")",
";",
"}",
"this",
".",
"tree",
".",
"_currentlyHighlighted",
"=",
"this",
";",
"}",
"this",
".",
"highlightState",
"=",
"1",
";",
"this",
".",
"_setHighlightClassName",
"(",
")",
";",
"if",
"(",
"!",
"this",
".",
"tree",
".",
"singleNodeHighlight",
")",
"{",
"if",
"(",
"this",
".",
"propagateHighlightDown",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"children",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"children",
"[",
"i",
"]",
".",
"highlight",
"(",
"true",
")",
";",
"}",
"}",
"if",
"(",
"this",
".",
"propagateHighlightUp",
")",
"{",
"if",
"(",
"this",
".",
"parent",
")",
"{",
"this",
".",
"parent",
".",
"_childrenHighlighted",
"(",
")",
";",
"}",
"}",
"}",
"if",
"(",
"!",
"_silent",
")",
"{",
"this",
".",
"tree",
".",
"fireEvent",
"(",
"'highlightEvent'",
",",
"this",
")",
";",
"}",
"}",
"}"
]
| Turns highlighting on node.
@method highlight
@param _silent {boolean} optional, don't fire the highlightEvent | [
"Turns",
"highlighting",
"on",
"node",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L2719-L2745 |
|
42,622 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function() {
var yes = false, no = false;
if (this.enableHighlight) {
for (var i = 0;i < this.children.length;i++) {
switch(this.children[i].highlightState) {
case 0:
no = true;
break;
case 1:
yes = true;
break;
case 2:
yes = no = true;
break;
}
}
if (yes && no) {
this.highlightState = 2;
} else if (yes) {
this.highlightState = 1;
} else {
this.highlightState = 0;
}
this._setHighlightClassName();
if (this.propagateHighlightUp) {
if (this.parent) {
this.parent._childrenHighlighted();
}
}
}
} | javascript | function() {
var yes = false, no = false;
if (this.enableHighlight) {
for (var i = 0;i < this.children.length;i++) {
switch(this.children[i].highlightState) {
case 0:
no = true;
break;
case 1:
yes = true;
break;
case 2:
yes = no = true;
break;
}
}
if (yes && no) {
this.highlightState = 2;
} else if (yes) {
this.highlightState = 1;
} else {
this.highlightState = 0;
}
this._setHighlightClassName();
if (this.propagateHighlightUp) {
if (this.parent) {
this.parent._childrenHighlighted();
}
}
}
} | [
"function",
"(",
")",
"{",
"var",
"yes",
"=",
"false",
",",
"no",
"=",
"false",
";",
"if",
"(",
"this",
".",
"enableHighlight",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"children",
".",
"length",
";",
"i",
"++",
")",
"{",
"switch",
"(",
"this",
".",
"children",
"[",
"i",
"]",
".",
"highlightState",
")",
"{",
"case",
"0",
":",
"no",
"=",
"true",
";",
"break",
";",
"case",
"1",
":",
"yes",
"=",
"true",
";",
"break",
";",
"case",
"2",
":",
"yes",
"=",
"no",
"=",
"true",
";",
"break",
";",
"}",
"}",
"if",
"(",
"yes",
"&&",
"no",
")",
"{",
"this",
".",
"highlightState",
"=",
"2",
";",
"}",
"else",
"if",
"(",
"yes",
")",
"{",
"this",
".",
"highlightState",
"=",
"1",
";",
"}",
"else",
"{",
"this",
".",
"highlightState",
"=",
"0",
";",
"}",
"this",
".",
"_setHighlightClassName",
"(",
")",
";",
"if",
"(",
"this",
".",
"propagateHighlightUp",
")",
"{",
"if",
"(",
"this",
".",
"parent",
")",
"{",
"this",
".",
"parent",
".",
"_childrenHighlighted",
"(",
")",
";",
"}",
"}",
"}",
"}"
]
| Checks whether all or part of the children of a node are highlighted and
sets the node highlight to full, none or partial highlight.
If set to propagate it will further call the parent
@method _childrenHighlighted
@private | [
"Checks",
"whether",
"all",
"or",
"part",
"of",
"the",
"children",
"of",
"a",
"node",
"are",
"highlighted",
"and",
"sets",
"the",
"node",
"highlight",
"to",
"full",
"none",
"or",
"partial",
"highlight",
".",
"If",
"set",
"to",
"propagate",
"it",
"will",
"further",
"call",
"the",
"parent"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L2781-L2811 |
|
42,623 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function() {
var el = Dom.get('ygtvtableel' + this.index);
if (el) {
el.className = el.className.replace(/\bygtv-highlight\d\b/gi,'ygtv-highlight' + this.highlightState);
}
} | javascript | function() {
var el = Dom.get('ygtvtableel' + this.index);
if (el) {
el.className = el.className.replace(/\bygtv-highlight\d\b/gi,'ygtv-highlight' + this.highlightState);
}
} | [
"function",
"(",
")",
"{",
"var",
"el",
"=",
"Dom",
".",
"get",
"(",
"'ygtvtableel'",
"+",
"this",
".",
"index",
")",
";",
"if",
"(",
"el",
")",
"{",
"el",
".",
"className",
"=",
"el",
".",
"className",
".",
"replace",
"(",
"/",
"\\bygtv-highlight\\d\\b",
"/",
"gi",
",",
"'ygtv-highlight'",
"+",
"this",
".",
"highlightState",
")",
";",
"}",
"}"
]
| Changes the classNames on the toggle and content containers to reflect the current highlighting
@method _setHighlightClassName
@private | [
"Changes",
"the",
"classNames",
"on",
"the",
"toggle",
"and",
"content",
"containers",
"to",
"reflect",
"the",
"current",
"highlighting"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L2818-L2823 |
|
42,624 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function() {
for (var def, defs = [], i = 0; i < this.children.length;i++) {
def = this.children[i].getNodeDefinition();
if (def === false) { return false;}
defs.push(def);
}
return defs;
} | javascript | function() {
for (var def, defs = [], i = 0; i < this.children.length;i++) {
def = this.children[i].getNodeDefinition();
if (def === false) { return false;}
defs.push(def);
}
return defs;
} | [
"function",
"(",
")",
"{",
"for",
"(",
"var",
"def",
",",
"defs",
"=",
"[",
"]",
",",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"children",
".",
"length",
";",
"i",
"++",
")",
"{",
"def",
"=",
"this",
".",
"children",
"[",
"i",
"]",
".",
"getNodeDefinition",
"(",
")",
";",
"if",
"(",
"def",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"defs",
".",
"push",
"(",
"def",
")",
";",
"}",
"return",
"defs",
";",
"}"
]
| Returns an object which could be used to build a tree out of this node and its children.
It can be passed to the tree constructor to reproduce this node as a tree.
Since the RootNode is automatically created by treeView,
its own definition is excluded from the returned node definition
which only contains its children.
@method getNodeDefinition
@return {Object | false} definition of the tree or false if any child node is defined as dynamic | [
"Returns",
"an",
"object",
"which",
"could",
"be",
"used",
"to",
"build",
"a",
"tree",
"out",
"of",
"this",
"node",
"and",
"its",
"children",
".",
"It",
"can",
"be",
"passed",
"to",
"the",
"tree",
"constructor",
"to",
"reproduce",
"this",
"node",
"as",
"a",
"tree",
".",
"Since",
"the",
"RootNode",
"is",
"automatically",
"created",
"by",
"treeView",
"its",
"own",
"definition",
"is",
"excluded",
"from",
"the",
"returned",
"node",
"definition",
"which",
"only",
"contains",
"its",
"children",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L2898-L2906 |
|
42,625 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function() {
var sb = [];
sb[sb.length] = this.href?'<a':'<span';
sb[sb.length] = ' id="' + this.labelElId + '"';
sb[sb.length] = ' class="' + this.labelStyle + '"';
if (this.href) {
sb[sb.length] = ' href="' + this.href + '"';
sb[sb.length] = ' target="' + this.target + '"';
}
if (this.title) {
sb[sb.length] = ' title="' + this.title + '"';
}
sb[sb.length] = ' >';
sb[sb.length] = this.label;
sb[sb.length] = this.href?'</a>':'</span>';
return sb.join("");
} | javascript | function() {
var sb = [];
sb[sb.length] = this.href?'<a':'<span';
sb[sb.length] = ' id="' + this.labelElId + '"';
sb[sb.length] = ' class="' + this.labelStyle + '"';
if (this.href) {
sb[sb.length] = ' href="' + this.href + '"';
sb[sb.length] = ' target="' + this.target + '"';
}
if (this.title) {
sb[sb.length] = ' title="' + this.title + '"';
}
sb[sb.length] = ' >';
sb[sb.length] = this.label;
sb[sb.length] = this.href?'</a>':'</span>';
return sb.join("");
} | [
"function",
"(",
")",
"{",
"var",
"sb",
"=",
"[",
"]",
";",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"this",
".",
"href",
"?",
"'<a'",
":",
"'<span'",
";",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"' id=\"'",
"+",
"this",
".",
"labelElId",
"+",
"'\"'",
";",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"' class=\"'",
"+",
"this",
".",
"labelStyle",
"+",
"'\"'",
";",
"if",
"(",
"this",
".",
"href",
")",
"{",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"' href=\"'",
"+",
"this",
".",
"href",
"+",
"'\"'",
";",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"' target=\"'",
"+",
"this",
".",
"target",
"+",
"'\"'",
";",
"}",
"if",
"(",
"this",
".",
"title",
")",
"{",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"' title=\"'",
"+",
"this",
".",
"title",
"+",
"'\"'",
";",
"}",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"' >'",
";",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"this",
".",
"label",
";",
"sb",
"[",
"sb",
".",
"length",
"]",
"=",
"this",
".",
"href",
"?",
"'</a>'",
":",
"'</span>'",
";",
"return",
"sb",
".",
"join",
"(",
"\"\"",
")",
";",
"}"
]
| overrides YAHOO.widget.Node | [
"overrides",
"YAHOO",
".",
"widget",
".",
"Node"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L3045-L3061 |
|
42,626 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function(o) {
this.html = (typeof o === "string") ? o : o.html;
var el = this.getContentEl();
if (el) {
el.innerHTML = this.html;
}
} | javascript | function(o) {
this.html = (typeof o === "string") ? o : o.html;
var el = this.getContentEl();
if (el) {
el.innerHTML = this.html;
}
} | [
"function",
"(",
"o",
")",
"{",
"this",
".",
"html",
"=",
"(",
"typeof",
"o",
"===",
"\"string\"",
")",
"?",
"o",
":",
"o",
".",
"html",
";",
"var",
"el",
"=",
"this",
".",
"getContentEl",
"(",
")",
";",
"if",
"(",
"el",
")",
"{",
"el",
".",
"innerHTML",
"=",
"this",
".",
"html",
";",
"}",
"}"
]
| Synchronizes the node.html, and the node's content
@property setHtml
@param o {object} An html string or object containing an html property | [
"Synchronizes",
"the",
"node",
".",
"html",
"and",
"the",
"node",
"s",
"content"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L3236-L3245 |
|
42,627 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function() {
var def = YAHOO.widget.HTMLNode.superclass.getNodeDefinition.call(this);
if (def === false) { return false; }
def.html = this.html;
return def;
} | javascript | function() {
var def = YAHOO.widget.HTMLNode.superclass.getNodeDefinition.call(this);
if (def === false) { return false; }
def.html = this.html;
return def;
} | [
"function",
"(",
")",
"{",
"var",
"def",
"=",
"YAHOO",
".",
"widget",
".",
"HTMLNode",
".",
"superclass",
".",
"getNodeDefinition",
".",
"call",
"(",
"this",
")",
";",
"if",
"(",
"def",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"def",
".",
"html",
"=",
"this",
".",
"html",
";",
"return",
"def",
";",
"}"
]
| Returns an object which could be used to build a tree out of this node and its children.
It can be passed to the tree constructor to reproduce this node as a tree.
It will return false if any node loads dynamically, regardless of whether it is loaded or not.
@method getNodeDefinition
@return {Object | false} definition of the tree or false if any node is defined as dynamic | [
"Returns",
"an",
"object",
"which",
"could",
"be",
"used",
"to",
"build",
"a",
"tree",
"out",
"of",
"this",
"node",
"and",
"its",
"children",
".",
"It",
"can",
"be",
"passed",
"to",
"the",
"tree",
"constructor",
"to",
"reproduce",
"this",
"node",
"as",
"a",
"tree",
".",
"It",
"will",
"return",
"false",
"if",
"any",
"node",
"loads",
"dynamically",
"regardless",
"of",
"whether",
"it",
"is",
"loaded",
"or",
"not",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L3259-L3265 |
|
42,628 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function (editorData) {
var cal, container = editorData.inputContainer;
if (Lang.isUndefined(Calendar)) {
Dom.replaceClass(editorData.editorPanel,'ygtv-edit-DateNode','ygtv-edit-TextNode');
YAHOO.widget.DateNode.superclass.fillEditorContainer.call(this, editorData);
return;
}
if (editorData.nodeType != this._type) {
editorData.nodeType = this._type;
editorData.saveOnEnter = false;
editorData.node.destroyEditorContents(editorData);
editorData.inputObject = cal = new Calendar(container.appendChild(document.createElement('div')));
if (this.calendarConfig) {
cal.cfg.applyConfig(this.calendarConfig,true);
cal.cfg.fireQueue();
}
cal.selectEvent.subscribe(function () {
this.tree._closeEditor(true);
},this,true);
} else {
cal = editorData.inputObject;
}
editorData.oldValue = this.label;
cal.cfg.setProperty("selected",this.label, false);
var delim = cal.cfg.getProperty('DATE_FIELD_DELIMITER');
var pageDate = this.label.split(delim);
cal.cfg.setProperty('pagedate',pageDate[cal.cfg.getProperty('MDY_MONTH_POSITION') -1] + delim + pageDate[cal.cfg.getProperty('MDY_YEAR_POSITION') -1]);
cal.cfg.fireQueue();
cal.render();
cal.oDomContainer.focus();
} | javascript | function (editorData) {
var cal, container = editorData.inputContainer;
if (Lang.isUndefined(Calendar)) {
Dom.replaceClass(editorData.editorPanel,'ygtv-edit-DateNode','ygtv-edit-TextNode');
YAHOO.widget.DateNode.superclass.fillEditorContainer.call(this, editorData);
return;
}
if (editorData.nodeType != this._type) {
editorData.nodeType = this._type;
editorData.saveOnEnter = false;
editorData.node.destroyEditorContents(editorData);
editorData.inputObject = cal = new Calendar(container.appendChild(document.createElement('div')));
if (this.calendarConfig) {
cal.cfg.applyConfig(this.calendarConfig,true);
cal.cfg.fireQueue();
}
cal.selectEvent.subscribe(function () {
this.tree._closeEditor(true);
},this,true);
} else {
cal = editorData.inputObject;
}
editorData.oldValue = this.label;
cal.cfg.setProperty("selected",this.label, false);
var delim = cal.cfg.getProperty('DATE_FIELD_DELIMITER');
var pageDate = this.label.split(delim);
cal.cfg.setProperty('pagedate',pageDate[cal.cfg.getProperty('MDY_MONTH_POSITION') -1] + delim + pageDate[cal.cfg.getProperty('MDY_YEAR_POSITION') -1]);
cal.cfg.fireQueue();
cal.render();
cal.oDomContainer.focus();
} | [
"function",
"(",
"editorData",
")",
"{",
"var",
"cal",
",",
"container",
"=",
"editorData",
".",
"inputContainer",
";",
"if",
"(",
"Lang",
".",
"isUndefined",
"(",
"Calendar",
")",
")",
"{",
"Dom",
".",
"replaceClass",
"(",
"editorData",
".",
"editorPanel",
",",
"'ygtv-edit-DateNode'",
",",
"'ygtv-edit-TextNode'",
")",
";",
"YAHOO",
".",
"widget",
".",
"DateNode",
".",
"superclass",
".",
"fillEditorContainer",
".",
"call",
"(",
"this",
",",
"editorData",
")",
";",
"return",
";",
"}",
"if",
"(",
"editorData",
".",
"nodeType",
"!=",
"this",
".",
"_type",
")",
"{",
"editorData",
".",
"nodeType",
"=",
"this",
".",
"_type",
";",
"editorData",
".",
"saveOnEnter",
"=",
"false",
";",
"editorData",
".",
"node",
".",
"destroyEditorContents",
"(",
"editorData",
")",
";",
"editorData",
".",
"inputObject",
"=",
"cal",
"=",
"new",
"Calendar",
"(",
"container",
".",
"appendChild",
"(",
"document",
".",
"createElement",
"(",
"'div'",
")",
")",
")",
";",
"if",
"(",
"this",
".",
"calendarConfig",
")",
"{",
"cal",
".",
"cfg",
".",
"applyConfig",
"(",
"this",
".",
"calendarConfig",
",",
"true",
")",
";",
"cal",
".",
"cfg",
".",
"fireQueue",
"(",
")",
";",
"}",
"cal",
".",
"selectEvent",
".",
"subscribe",
"(",
"function",
"(",
")",
"{",
"this",
".",
"tree",
".",
"_closeEditor",
"(",
"true",
")",
";",
"}",
",",
"this",
",",
"true",
")",
";",
"}",
"else",
"{",
"cal",
"=",
"editorData",
".",
"inputObject",
";",
"}",
"editorData",
".",
"oldValue",
"=",
"this",
".",
"label",
";",
"cal",
".",
"cfg",
".",
"setProperty",
"(",
"\"selected\"",
",",
"this",
".",
"label",
",",
"false",
")",
";",
"var",
"delim",
"=",
"cal",
".",
"cfg",
".",
"getProperty",
"(",
"'DATE_FIELD_DELIMITER'",
")",
";",
"var",
"pageDate",
"=",
"this",
".",
"label",
".",
"split",
"(",
"delim",
")",
";",
"cal",
".",
"cfg",
".",
"setProperty",
"(",
"'pagedate'",
",",
"pageDate",
"[",
"cal",
".",
"cfg",
".",
"getProperty",
"(",
"'MDY_MONTH_POSITION'",
")",
"-",
"1",
"]",
"+",
"delim",
"+",
"pageDate",
"[",
"cal",
".",
"cfg",
".",
"getProperty",
"(",
"'MDY_YEAR_POSITION'",
")",
"-",
"1",
"]",
")",
";",
"cal",
".",
"cfg",
".",
"fireQueue",
"(",
")",
";",
"cal",
".",
"render",
"(",
")",
";",
"cal",
".",
"oDomContainer",
".",
"focus",
"(",
")",
";",
"}"
]
| If YAHOO.widget.Calendar is available, it will pop up a Calendar to enter a new date. Otherwise, it falls back to a plain <input> textbox
@method fillEditorContainer
@param editorData {YAHOO.widget.TreeView.editorData} a shortcut to the static object holding editing information
@return void | [
"If",
"YAHOO",
".",
"widget",
".",
"Calendar",
"is",
"available",
"it",
"will",
"pop",
"up",
"a",
"Calendar",
"to",
"enter",
"a",
"new",
"date",
".",
"Otherwise",
"it",
"falls",
"back",
"to",
"a",
"plain",
"<",
";",
"input>",
";",
"textbox"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L3324-L3362 |
|
42,629 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function (value,editorData) {
var node = editorData.node;
node.label = value;
node.getLabelEl().innerHTML = value;
} | javascript | function (value,editorData) {
var node = editorData.node;
node.label = value;
node.getLabelEl().innerHTML = value;
} | [
"function",
"(",
"value",
",",
"editorData",
")",
"{",
"var",
"node",
"=",
"editorData",
".",
"node",
";",
"node",
".",
"label",
"=",
"value",
";",
"node",
".",
"getLabelEl",
"(",
")",
".",
"innerHTML",
"=",
"value",
";",
"}"
]
| Finally displays the newly entered date in the tree.
Overrides Node.displayEditedValue.
@method displayEditedValue
@param value {string} date to be displayed and stored in the node
@param editorData {YAHOO.widget.TreeView.editorData} a shortcut to the static object holding editing information | [
"Finally",
"displays",
"the",
"newly",
"entered",
"date",
"in",
"the",
"tree",
".",
"Overrides",
"Node",
".",
"displayEditedValue",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L3393-L3397 |
|
42,630 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function(type, el, callback) {
if (YAHOO.widget[type]) {
return new YAHOO.widget[type](el, callback);
} else {
return null;
}
} | javascript | function(type, el, callback) {
if (YAHOO.widget[type]) {
return new YAHOO.widget[type](el, callback);
} else {
return null;
}
} | [
"function",
"(",
"type",
",",
"el",
",",
"callback",
")",
"{",
"if",
"(",
"YAHOO",
".",
"widget",
"[",
"type",
"]",
")",
"{",
"return",
"new",
"YAHOO",
".",
"widget",
"[",
"type",
"]",
"(",
"el",
",",
"callback",
")",
";",
"}",
"else",
"{",
"return",
"null",
";",
"}",
"}"
]
| Returns a ygAnim instance of the given type
@method getAnim
@param type {string} the type of animation
@param el {HTMLElement} the element to element (probably the children div)
@param callback {function} function to invoke when the animation is done.
@return {YAHOO.util.Animation} the animation instance
@static | [
"Returns",
"a",
"ygAnim",
"instance",
"of",
"the",
"given",
"type"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L3848-L3854 |
|
42,631 | neyric/webhookit | public/javascripts/yui/treeview/treeview.js | function() {
var s = this.el.style;
s.display = "none";
s.opacity = 1;
s.filter = "alpha(opacity=100)";
this.callback();
} | javascript | function() {
var s = this.el.style;
s.display = "none";
s.opacity = 1;
s.filter = "alpha(opacity=100)";
this.callback();
} | [
"function",
"(",
")",
"{",
"var",
"s",
"=",
"this",
".",
"el",
".",
"style",
";",
"s",
".",
"display",
"=",
"\"none\"",
";",
"s",
".",
"opacity",
"=",
"1",
";",
"s",
".",
"filter",
"=",
"\"alpha(opacity=100)\"",
";",
"this",
".",
"callback",
"(",
")",
";",
"}"
]
| Clean up and invoke callback
@method onComplete | [
"Clean",
"up",
"and",
"invoke",
"callback"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/treeview/treeview.js#L3971-L3977 |
|
42,632 | neyric/webhookit | public/javascripts/yui/tabview/tabview-debug.js | function(tab, index) {
var tabs = this.get('tabs'),
before = this.getTab(index),
tabParent = this._tabParent,
contentParent = this._contentParent,
tabElement = tab.get(ELEMENT),
contentEl = tab.get(CONTENT_EL);
if (!tabs) { // not ready yet
this._queue[this._queue.length] = ['addTab', arguments];
return false;
}
index = (index === undefined) ? tabs.length : index;
tabs.splice(index, 0, tab);
if ( before ) {
tabParent.insertBefore(tabElement, before.get(ELEMENT));
} else {
tabParent.appendChild(tabElement);
}
if ( contentEl && !Dom.isAncestor(contentParent, contentEl) ) {
contentParent.appendChild(contentEl);
}
if ( !tab.get(ACTIVE) ) {
tab.set('contentVisible', false, true); /* hide if not active */
} else {
this.set(ACTIVE_TAB, tab, true);
this.set('activeIndex', index, true);
}
this._initTabEvents(tab);
} | javascript | function(tab, index) {
var tabs = this.get('tabs'),
before = this.getTab(index),
tabParent = this._tabParent,
contentParent = this._contentParent,
tabElement = tab.get(ELEMENT),
contentEl = tab.get(CONTENT_EL);
if (!tabs) { // not ready yet
this._queue[this._queue.length] = ['addTab', arguments];
return false;
}
index = (index === undefined) ? tabs.length : index;
tabs.splice(index, 0, tab);
if ( before ) {
tabParent.insertBefore(tabElement, before.get(ELEMENT));
} else {
tabParent.appendChild(tabElement);
}
if ( contentEl && !Dom.isAncestor(contentParent, contentEl) ) {
contentParent.appendChild(contentEl);
}
if ( !tab.get(ACTIVE) ) {
tab.set('contentVisible', false, true); /* hide if not active */
} else {
this.set(ACTIVE_TAB, tab, true);
this.set('activeIndex', index, true);
}
this._initTabEvents(tab);
} | [
"function",
"(",
"tab",
",",
"index",
")",
"{",
"var",
"tabs",
"=",
"this",
".",
"get",
"(",
"'tabs'",
")",
",",
"before",
"=",
"this",
".",
"getTab",
"(",
"index",
")",
",",
"tabParent",
"=",
"this",
".",
"_tabParent",
",",
"contentParent",
"=",
"this",
".",
"_contentParent",
",",
"tabElement",
"=",
"tab",
".",
"get",
"(",
"ELEMENT",
")",
",",
"contentEl",
"=",
"tab",
".",
"get",
"(",
"CONTENT_EL",
")",
";",
"if",
"(",
"!",
"tabs",
")",
"{",
"// not ready yet",
"this",
".",
"_queue",
"[",
"this",
".",
"_queue",
".",
"length",
"]",
"=",
"[",
"'addTab'",
",",
"arguments",
"]",
";",
"return",
"false",
";",
"}",
"index",
"=",
"(",
"index",
"===",
"undefined",
")",
"?",
"tabs",
".",
"length",
":",
"index",
";",
"tabs",
".",
"splice",
"(",
"index",
",",
"0",
",",
"tab",
")",
";",
"if",
"(",
"before",
")",
"{",
"tabParent",
".",
"insertBefore",
"(",
"tabElement",
",",
"before",
".",
"get",
"(",
"ELEMENT",
")",
")",
";",
"}",
"else",
"{",
"tabParent",
".",
"appendChild",
"(",
"tabElement",
")",
";",
"}",
"if",
"(",
"contentEl",
"&&",
"!",
"Dom",
".",
"isAncestor",
"(",
"contentParent",
",",
"contentEl",
")",
")",
"{",
"contentParent",
".",
"appendChild",
"(",
"contentEl",
")",
";",
"}",
"if",
"(",
"!",
"tab",
".",
"get",
"(",
"ACTIVE",
")",
")",
"{",
"tab",
".",
"set",
"(",
"'contentVisible'",
",",
"false",
",",
"true",
")",
";",
"/* hide if not active */",
"}",
"else",
"{",
"this",
".",
"set",
"(",
"ACTIVE_TAB",
",",
"tab",
",",
"true",
")",
";",
"this",
".",
"set",
"(",
"'activeIndex'",
",",
"index",
",",
"true",
")",
";",
"}",
"this",
".",
"_initTabEvents",
"(",
"tab",
")",
";",
"}"
]
| Adds a Tab to the TabView instance.
If no index is specified, the tab is added to the end of the tab list.
@method addTab
@param {YAHOO.widget.Tab} tab A Tab instance to add.
@param {Integer} index The position to add the tab.
@return void | [
"Adds",
"a",
"Tab",
"to",
"the",
"TabView",
"instance",
".",
"If",
"no",
"index",
"is",
"specified",
"the",
"tab",
"is",
"added",
"to",
"the",
"end",
"of",
"the",
"tab",
"list",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/tabview/tabview-debug.js#L94-L129 |
|
42,633 | neyric/webhookit | public/javascripts/yui/tabview/tabview-debug.js | function(e) {
var target = Event.getTarget(e),
tabParent = this._tabParent,
tabs = this.get('tabs'),
tab,
tabEl,
contentEl;
if (Dom.isAncestor(tabParent, target) ) {
for (var i = 0, len = tabs.length; i < len; i++) {
tabEl = tabs[i].get(ELEMENT);
contentEl = tabs[i].get(CONTENT_EL);
if ( target == tabEl || Dom.isAncestor(tabEl, target) ) {
tab = tabs[i];
break; // note break
}
}
if (tab) {
tab.fireEvent(e.type, e);
}
}
} | javascript | function(e) {
var target = Event.getTarget(e),
tabParent = this._tabParent,
tabs = this.get('tabs'),
tab,
tabEl,
contentEl;
if (Dom.isAncestor(tabParent, target) ) {
for (var i = 0, len = tabs.length; i < len; i++) {
tabEl = tabs[i].get(ELEMENT);
contentEl = tabs[i].get(CONTENT_EL);
if ( target == tabEl || Dom.isAncestor(tabEl, target) ) {
tab = tabs[i];
break; // note break
}
}
if (tab) {
tab.fireEvent(e.type, e);
}
}
} | [
"function",
"(",
"e",
")",
"{",
"var",
"target",
"=",
"Event",
".",
"getTarget",
"(",
"e",
")",
",",
"tabParent",
"=",
"this",
".",
"_tabParent",
",",
"tabs",
"=",
"this",
".",
"get",
"(",
"'tabs'",
")",
",",
"tab",
",",
"tabEl",
",",
"contentEl",
";",
"if",
"(",
"Dom",
".",
"isAncestor",
"(",
"tabParent",
",",
"target",
")",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"tabs",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"tabEl",
"=",
"tabs",
"[",
"i",
"]",
".",
"get",
"(",
"ELEMENT",
")",
";",
"contentEl",
"=",
"tabs",
"[",
"i",
"]",
".",
"get",
"(",
"CONTENT_EL",
")",
";",
"if",
"(",
"target",
"==",
"tabEl",
"||",
"Dom",
".",
"isAncestor",
"(",
"tabEl",
",",
"target",
")",
")",
"{",
"tab",
"=",
"tabs",
"[",
"i",
"]",
";",
"break",
";",
"// note break",
"}",
"}",
"if",
"(",
"tab",
")",
"{",
"tab",
".",
"fireEvent",
"(",
"e",
".",
"type",
",",
"e",
")",
";",
"}",
"}",
"}"
]
| Routes childNode events.
@method DOMEventHandler
@param {event} e The Dom event that is being handled.
@return void | [
"Routes",
"childNode",
"events",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/tabview/tabview-debug.js#L147-L171 |
|
42,634 | neyric/webhookit | public/javascripts/yui/tabview/tabview-debug.js | function(tab) {
var index = null,
tabs = this.get('tabs');
for (var i = 0, len = tabs.length; i < len; ++i) {
if (tab == tabs[i]) {
index = i;
break;
}
}
return index;
} | javascript | function(tab) {
var index = null,
tabs = this.get('tabs');
for (var i = 0, len = tabs.length; i < len; ++i) {
if (tab == tabs[i]) {
index = i;
break;
}
}
return index;
} | [
"function",
"(",
"tab",
")",
"{",
"var",
"index",
"=",
"null",
",",
"tabs",
"=",
"this",
".",
"get",
"(",
"'tabs'",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"tabs",
".",
"length",
";",
"i",
"<",
"len",
";",
"++",
"i",
")",
"{",
"if",
"(",
"tab",
"==",
"tabs",
"[",
"i",
"]",
")",
"{",
"index",
"=",
"i",
";",
"break",
";",
"}",
"}",
"return",
"index",
";",
"}"
]
| Returns the index of given tab.
@method getTabIndex
@param {YAHOO.widget.Tab} tab The tab whose index will be returned.
@return int | [
"Returns",
"the",
"index",
"of",
"given",
"tab",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/tabview/tabview-debug.js#L189-L200 |
|
42,635 | neyric/webhookit | public/javascripts/yui/tabview/tabview-debug.js | function(tab) {
var tabCount = this.get('tabs').length,
index = this.getTabIndex(tab);
if ( tab === this.get(ACTIVE_TAB) ) {
if (tabCount > 1) { // select another tab
if (index + 1 === tabCount) { // if last, activate previous
this.set(ACTIVE_INDEX, index - 1);
} else { // activate next tab
this.set(ACTIVE_INDEX, index + 1);
}
} else { // no more tabs
this.set(ACTIVE_TAB, null);
}
}
this._removeTabEvents(tab);
this._tabParent.removeChild( tab.get(ELEMENT) );
this._contentParent.removeChild( tab.get(CONTENT_EL) );
this._configs.tabs.value.splice(index, 1);
tab.fireEvent('remove', { type: 'remove', tabview: this });
} | javascript | function(tab) {
var tabCount = this.get('tabs').length,
index = this.getTabIndex(tab);
if ( tab === this.get(ACTIVE_TAB) ) {
if (tabCount > 1) { // select another tab
if (index + 1 === tabCount) { // if last, activate previous
this.set(ACTIVE_INDEX, index - 1);
} else { // activate next tab
this.set(ACTIVE_INDEX, index + 1);
}
} else { // no more tabs
this.set(ACTIVE_TAB, null);
}
}
this._removeTabEvents(tab);
this._tabParent.removeChild( tab.get(ELEMENT) );
this._contentParent.removeChild( tab.get(CONTENT_EL) );
this._configs.tabs.value.splice(index, 1);
tab.fireEvent('remove', { type: 'remove', tabview: this });
} | [
"function",
"(",
"tab",
")",
"{",
"var",
"tabCount",
"=",
"this",
".",
"get",
"(",
"'tabs'",
")",
".",
"length",
",",
"index",
"=",
"this",
".",
"getTabIndex",
"(",
"tab",
")",
";",
"if",
"(",
"tab",
"===",
"this",
".",
"get",
"(",
"ACTIVE_TAB",
")",
")",
"{",
"if",
"(",
"tabCount",
">",
"1",
")",
"{",
"// select another tab",
"if",
"(",
"index",
"+",
"1",
"===",
"tabCount",
")",
"{",
"// if last, activate previous",
"this",
".",
"set",
"(",
"ACTIVE_INDEX",
",",
"index",
"-",
"1",
")",
";",
"}",
"else",
"{",
"// activate next tab",
"this",
".",
"set",
"(",
"ACTIVE_INDEX",
",",
"index",
"+",
"1",
")",
";",
"}",
"}",
"else",
"{",
"// no more tabs",
"this",
".",
"set",
"(",
"ACTIVE_TAB",
",",
"null",
")",
";",
"}",
"}",
"this",
".",
"_removeTabEvents",
"(",
"tab",
")",
";",
"this",
".",
"_tabParent",
".",
"removeChild",
"(",
"tab",
".",
"get",
"(",
"ELEMENT",
")",
")",
";",
"this",
".",
"_contentParent",
".",
"removeChild",
"(",
"tab",
".",
"get",
"(",
"CONTENT_EL",
")",
")",
";",
"this",
".",
"_configs",
".",
"tabs",
".",
"value",
".",
"splice",
"(",
"index",
",",
"1",
")",
";",
"tab",
".",
"fireEvent",
"(",
"'remove'",
",",
"{",
"type",
":",
"'remove'",
",",
"tabview",
":",
"this",
"}",
")",
";",
"}"
]
| Removes the specified Tab from the TabView.
@method removeTab
@param {YAHOO.widget.Tab} item The Tab instance to be removed.
@return void | [
"Removes",
"the",
"specified",
"Tab",
"from",
"the",
"TabView",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/tabview/tabview-debug.js#L208-L230 |
|
42,636 | neyric/webhookit | public/javascripts/yui/tabview/tabview-debug.js | function(newTab, oldTab) {
if (newTab) {
newTab.set('contentVisible', true);
}
if (oldTab) {
oldTab.set('contentVisible', false);
}
} | javascript | function(newTab, oldTab) {
if (newTab) {
newTab.set('contentVisible', true);
}
if (oldTab) {
oldTab.set('contentVisible', false);
}
} | [
"function",
"(",
"newTab",
",",
"oldTab",
")",
"{",
"if",
"(",
"newTab",
")",
"{",
"newTab",
".",
"set",
"(",
"'contentVisible'",
",",
"true",
")",
";",
"}",
"if",
"(",
"oldTab",
")",
"{",
"oldTab",
".",
"set",
"(",
"'contentVisible'",
",",
"false",
")",
";",
"}",
"}"
]
| The transiton to use when switching between tabs.
@method contentTransition | [
"The",
"transiton",
"to",
"use",
"when",
"switching",
"between",
"tabs",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/tabview/tabview-debug.js#L246-L253 |
|
42,637 | neyric/webhookit | public/javascripts/yui/tabview/tabview-debug.js | function() {
var tabs = Dom.getChildren(this._tabParent),
contentElements = Dom.getChildren(this._contentParent),
activeIndex = this.get(ACTIVE_INDEX),
tab,
attr,
active;
for (var i = 0, len = tabs.length; i < len; ++i) {
attr = {};
if (contentElements[i]) {
attr.contentEl = contentElements[i];
}
tab = new YAHOO.widget.Tab(tabs[i], attr);
this.addTab(tab);
if (tab.hasClass(tab.ACTIVE_CLASSNAME) ) {
active = tab;
}
}
if (activeIndex) {
this.set(ACTIVE_TAB, this.getTab(activeIndex));
} else {
this._configs.activeTab.value = active; // dont invoke method
this._configs.activeIndex.value = this.getTabIndex(active);
}
} | javascript | function() {
var tabs = Dom.getChildren(this._tabParent),
contentElements = Dom.getChildren(this._contentParent),
activeIndex = this.get(ACTIVE_INDEX),
tab,
attr,
active;
for (var i = 0, len = tabs.length; i < len; ++i) {
attr = {};
if (contentElements[i]) {
attr.contentEl = contentElements[i];
}
tab = new YAHOO.widget.Tab(tabs[i], attr);
this.addTab(tab);
if (tab.hasClass(tab.ACTIVE_CLASSNAME) ) {
active = tab;
}
}
if (activeIndex) {
this.set(ACTIVE_TAB, this.getTab(activeIndex));
} else {
this._configs.activeTab.value = active; // dont invoke method
this._configs.activeIndex.value = this.getTabIndex(active);
}
} | [
"function",
"(",
")",
"{",
"var",
"tabs",
"=",
"Dom",
".",
"getChildren",
"(",
"this",
".",
"_tabParent",
")",
",",
"contentElements",
"=",
"Dom",
".",
"getChildren",
"(",
"this",
".",
"_contentParent",
")",
",",
"activeIndex",
"=",
"this",
".",
"get",
"(",
"ACTIVE_INDEX",
")",
",",
"tab",
",",
"attr",
",",
"active",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"tabs",
".",
"length",
";",
"i",
"<",
"len",
";",
"++",
"i",
")",
"{",
"attr",
"=",
"{",
"}",
";",
"if",
"(",
"contentElements",
"[",
"i",
"]",
")",
"{",
"attr",
".",
"contentEl",
"=",
"contentElements",
"[",
"i",
"]",
";",
"}",
"tab",
"=",
"new",
"YAHOO",
".",
"widget",
".",
"Tab",
"(",
"tabs",
"[",
"i",
"]",
",",
"attr",
")",
";",
"this",
".",
"addTab",
"(",
"tab",
")",
";",
"if",
"(",
"tab",
".",
"hasClass",
"(",
"tab",
".",
"ACTIVE_CLASSNAME",
")",
")",
"{",
"active",
"=",
"tab",
";",
"}",
"}",
"if",
"(",
"activeIndex",
")",
"{",
"this",
".",
"set",
"(",
"ACTIVE_TAB",
",",
"this",
".",
"getTab",
"(",
"activeIndex",
")",
")",
";",
"}",
"else",
"{",
"this",
".",
"_configs",
".",
"activeTab",
".",
"value",
"=",
"active",
";",
"// dont invoke method",
"this",
".",
"_configs",
".",
"activeIndex",
".",
"value",
"=",
"this",
".",
"getTabIndex",
"(",
"active",
")",
";",
"}",
"}"
]
| Creates Tab instances from a collection of HTMLElements.
@method _initTabs
@private
@return void | [
"Creates",
"Tab",
"instances",
"from",
"a",
"collection",
"of",
"HTMLElements",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/tabview/tabview-debug.js#L443-L471 |
|
42,638 | neyric/webhookit | public/javascripts/yui/datatable/datatable-debug.js | function(aData, index) {
var Rec = widget.Record,
a = lang.isArray(aData) ? aData : [aData],
added = [],
i = 0, l = a.length, j = 0;
index = parseInt(index,10)|0;
for(; i < l; ++i) {
if (typeof a[i] === 'object' && a[i]) {
added[j++] = this._records[index + i] = new Rec(a[i]);
}
}
this.fireEvent("recordsSetEvent",{records:added,data:aData});
// Backward compatibility for bug 1918245
this.fireEvent("recordsSet",{records:added,data:aData});
YAHOO.log("Set "+j+" Record(s) at index "+index, "info",
this.toString());
if (a.length && !added.length) {
YAHOO.log("Could not set Records with data " +
lang.dump(aData), "info", this.toString());
}
return added.length > 1 ? added : added[0];
} | javascript | function(aData, index) {
var Rec = widget.Record,
a = lang.isArray(aData) ? aData : [aData],
added = [],
i = 0, l = a.length, j = 0;
index = parseInt(index,10)|0;
for(; i < l; ++i) {
if (typeof a[i] === 'object' && a[i]) {
added[j++] = this._records[index + i] = new Rec(a[i]);
}
}
this.fireEvent("recordsSetEvent",{records:added,data:aData});
// Backward compatibility for bug 1918245
this.fireEvent("recordsSet",{records:added,data:aData});
YAHOO.log("Set "+j+" Record(s) at index "+index, "info",
this.toString());
if (a.length && !added.length) {
YAHOO.log("Could not set Records with data " +
lang.dump(aData), "info", this.toString());
}
return added.length > 1 ? added : added[0];
} | [
"function",
"(",
"aData",
",",
"index",
")",
"{",
"var",
"Rec",
"=",
"widget",
".",
"Record",
",",
"a",
"=",
"lang",
".",
"isArray",
"(",
"aData",
")",
"?",
"aData",
":",
"[",
"aData",
"]",
",",
"added",
"=",
"[",
"]",
",",
"i",
"=",
"0",
",",
"l",
"=",
"a",
".",
"length",
",",
"j",
"=",
"0",
";",
"index",
"=",
"parseInt",
"(",
"index",
",",
"10",
")",
"|",
"0",
";",
"for",
"(",
";",
"i",
"<",
"l",
";",
"++",
"i",
")",
"{",
"if",
"(",
"typeof",
"a",
"[",
"i",
"]",
"===",
"'object'",
"&&",
"a",
"[",
"i",
"]",
")",
"{",
"added",
"[",
"j",
"++",
"]",
"=",
"this",
".",
"_records",
"[",
"index",
"+",
"i",
"]",
"=",
"new",
"Rec",
"(",
"a",
"[",
"i",
"]",
")",
";",
"}",
"}",
"this",
".",
"fireEvent",
"(",
"\"recordsSetEvent\"",
",",
"{",
"records",
":",
"added",
",",
"data",
":",
"aData",
"}",
")",
";",
"// Backward compatibility for bug 1918245",
"this",
".",
"fireEvent",
"(",
"\"recordsSet\"",
",",
"{",
"records",
":",
"added",
",",
"data",
":",
"aData",
"}",
")",
";",
"YAHOO",
".",
"log",
"(",
"\"Set \"",
"+",
"j",
"+",
"\" Record(s) at index \"",
"+",
"index",
",",
"\"info\"",
",",
"this",
".",
"toString",
"(",
")",
")",
";",
"if",
"(",
"a",
".",
"length",
"&&",
"!",
"added",
".",
"length",
")",
"{",
"YAHOO",
".",
"log",
"(",
"\"Could not set Records with data \"",
"+",
"lang",
".",
"dump",
"(",
"aData",
")",
",",
"\"info\"",
",",
"this",
".",
"toString",
"(",
")",
")",
";",
"}",
"return",
"added",
".",
"length",
">",
"1",
"?",
"added",
":",
"added",
"[",
"0",
"]",
";",
"}"
]
| Sets or replaces multiple Records at once to the RecordSet with the given
data, starting at the given index. If index is not specified, then the new
Records are added to the end of the RecordSet.
@method setRecords
@param aData {Object[]} An array of object literal data.
@param index {Number} (optional) Position index.
@return {YAHOO.widget.Record[]} An array of Record instances. | [
"Sets",
"or",
"replaces",
"multiple",
"Records",
"at",
"once",
"to",
"the",
"RecordSet",
"with",
"the",
"given",
"data",
"starting",
"at",
"the",
"given",
"index",
".",
"If",
"index",
"is",
"not",
"specified",
"then",
"the",
"new",
"Records",
"are",
"added",
"to",
"the",
"end",
"of",
"the",
"RecordSet",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable-debug.js#L2072-L2098 |
|
42,639 | neyric/webhookit | public/javascripts/yui/datatable/datatable-debug.js | function(oData) {
//Convert to number
var number = oData * 1;
// Validate
if(lang.isNumber(number)) {
return number;
}
else {
YAHOO.log("Could not validate data " + lang.dump(oData) + " to type Number", "warn", this.toString());
return undefined;
}
} | javascript | function(oData) {
//Convert to number
var number = oData * 1;
// Validate
if(lang.isNumber(number)) {
return number;
}
else {
YAHOO.log("Could not validate data " + lang.dump(oData) + " to type Number", "warn", this.toString());
return undefined;
}
} | [
"function",
"(",
"oData",
")",
"{",
"//Convert to number",
"var",
"number",
"=",
"oData",
"*",
"1",
";",
"// Validate",
"if",
"(",
"lang",
".",
"isNumber",
"(",
"number",
")",
")",
"{",
"return",
"number",
";",
"}",
"else",
"{",
"YAHOO",
".",
"log",
"(",
"\"Could not validate data \"",
"+",
"lang",
".",
"dump",
"(",
"oData",
")",
"+",
"\" to type Number\"",
",",
"\"warn\"",
",",
"this",
".",
"toString",
"(",
")",
")",
";",
"return",
"undefined",
";",
"}",
"}"
]
| Validates data value to type Number, doing type conversion as
necessary. A valid Number value is return, else null is returned
if input value does not validate.
@method DataTable.validateNumber
@param oData {Object} Data to validate.
@static | [
"Validates",
"data",
"value",
"to",
"type",
"Number",
"doing",
"type",
"conversion",
"as",
"necessary",
".",
"A",
"valid",
"Number",
"value",
"is",
"return",
"else",
"null",
"is",
"returned",
"if",
"input",
"value",
"does",
"not",
"validate",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable-debug.js#L3562-L3574 |
|
42,640 | neyric/webhookit | public/javascripts/yui/datatable/datatable-debug.js | function(oDataSource) {
this._oDataSource = null;
if(oDataSource && (lang.isFunction(oDataSource.sendRequest))) {
this._oDataSource = oDataSource;
}
// Backward compatibility
else {
var tmpTable = null;
var tmpContainer = this._elContainer;
var i=0;
//TODO: this will break if re-initing DS at runtime for SDT
// Peek in container child nodes to see if TABLE already exists
if(tmpContainer.hasChildNodes()) {
var tmpChildren = tmpContainer.childNodes;
for(i=0; i<tmpChildren.length; i++) {
if(tmpChildren[i].nodeName && tmpChildren[i].nodeName.toLowerCase() == "table") {
tmpTable = tmpChildren[i];
break;
}
}
if(tmpTable) {
var tmpFieldsArray = [];
for(; i<this._oColumnSet.keys.length; i++) {
tmpFieldsArray.push({key:this._oColumnSet.keys[i].key});
}
this._oDataSource = new DS(tmpTable);
this._oDataSource.responseType = DS.TYPE_HTMLTABLE;
this._oDataSource.responseSchema = {fields: tmpFieldsArray};
YAHOO.log("Null DataSource for progressive enhancement from" +
" markup has been deprecated", "warn", this.toString());
}
}
}
} | javascript | function(oDataSource) {
this._oDataSource = null;
if(oDataSource && (lang.isFunction(oDataSource.sendRequest))) {
this._oDataSource = oDataSource;
}
// Backward compatibility
else {
var tmpTable = null;
var tmpContainer = this._elContainer;
var i=0;
//TODO: this will break if re-initing DS at runtime for SDT
// Peek in container child nodes to see if TABLE already exists
if(tmpContainer.hasChildNodes()) {
var tmpChildren = tmpContainer.childNodes;
for(i=0; i<tmpChildren.length; i++) {
if(tmpChildren[i].nodeName && tmpChildren[i].nodeName.toLowerCase() == "table") {
tmpTable = tmpChildren[i];
break;
}
}
if(tmpTable) {
var tmpFieldsArray = [];
for(; i<this._oColumnSet.keys.length; i++) {
tmpFieldsArray.push({key:this._oColumnSet.keys[i].key});
}
this._oDataSource = new DS(tmpTable);
this._oDataSource.responseType = DS.TYPE_HTMLTABLE;
this._oDataSource.responseSchema = {fields: tmpFieldsArray};
YAHOO.log("Null DataSource for progressive enhancement from" +
" markup has been deprecated", "warn", this.toString());
}
}
}
} | [
"function",
"(",
"oDataSource",
")",
"{",
"this",
".",
"_oDataSource",
"=",
"null",
";",
"if",
"(",
"oDataSource",
"&&",
"(",
"lang",
".",
"isFunction",
"(",
"oDataSource",
".",
"sendRequest",
")",
")",
")",
"{",
"this",
".",
"_oDataSource",
"=",
"oDataSource",
";",
"}",
"// Backward compatibility",
"else",
"{",
"var",
"tmpTable",
"=",
"null",
";",
"var",
"tmpContainer",
"=",
"this",
".",
"_elContainer",
";",
"var",
"i",
"=",
"0",
";",
"//TODO: this will break if re-initing DS at runtime for SDT",
"// Peek in container child nodes to see if TABLE already exists",
"if",
"(",
"tmpContainer",
".",
"hasChildNodes",
"(",
")",
")",
"{",
"var",
"tmpChildren",
"=",
"tmpContainer",
".",
"childNodes",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"tmpChildren",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"tmpChildren",
"[",
"i",
"]",
".",
"nodeName",
"&&",
"tmpChildren",
"[",
"i",
"]",
".",
"nodeName",
".",
"toLowerCase",
"(",
")",
"==",
"\"table\"",
")",
"{",
"tmpTable",
"=",
"tmpChildren",
"[",
"i",
"]",
";",
"break",
";",
"}",
"}",
"if",
"(",
"tmpTable",
")",
"{",
"var",
"tmpFieldsArray",
"=",
"[",
"]",
";",
"for",
"(",
";",
"i",
"<",
"this",
".",
"_oColumnSet",
".",
"keys",
".",
"length",
";",
"i",
"++",
")",
"{",
"tmpFieldsArray",
".",
"push",
"(",
"{",
"key",
":",
"this",
".",
"_oColumnSet",
".",
"keys",
"[",
"i",
"]",
".",
"key",
"}",
")",
";",
"}",
"this",
".",
"_oDataSource",
"=",
"new",
"DS",
"(",
"tmpTable",
")",
";",
"this",
".",
"_oDataSource",
".",
"responseType",
"=",
"DS",
".",
"TYPE_HTMLTABLE",
";",
"this",
".",
"_oDataSource",
".",
"responseSchema",
"=",
"{",
"fields",
":",
"tmpFieldsArray",
"}",
";",
"YAHOO",
".",
"log",
"(",
"\"Null DataSource for progressive enhancement from\"",
"+",
"\" markup has been deprecated\"",
",",
"\"warn\"",
",",
"this",
".",
"toString",
"(",
")",
")",
";",
"}",
"}",
"}",
"}"
]
| Initializes DataSource.
@method _initDataSource
@param oDataSource {YAHOO.util.DataSource} DataSource instance.
@private | [
"Initializes",
"DataSource",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable-debug.js#L4512-L4546 |
|
42,641 | neyric/webhookit | public/javascripts/yui/datatable/datatable-debug.js | function() {
this._destroyDraggableColumns();
if(util.DD) {
var oColumn, elTh, elDragTarget;
for(var i=0, len=this._oColumnSet.tree[0].length; i<len; i++) {
oColumn = this._oColumnSet.tree[0][i];
elTh = oColumn.getThEl();
Dom.addClass(elTh, DT.CLASS_DRAGGABLE);
elDragTarget = DT._initColumnDragTargetEl();
oColumn._dd = new YAHOO.widget.ColumnDD(this, oColumn, elTh, elDragTarget);
}
}
else {
YAHOO.log("Could not find DragDrop for draggable Columns", "warn", this.toString());
}
} | javascript | function() {
this._destroyDraggableColumns();
if(util.DD) {
var oColumn, elTh, elDragTarget;
for(var i=0, len=this._oColumnSet.tree[0].length; i<len; i++) {
oColumn = this._oColumnSet.tree[0][i];
elTh = oColumn.getThEl();
Dom.addClass(elTh, DT.CLASS_DRAGGABLE);
elDragTarget = DT._initColumnDragTargetEl();
oColumn._dd = new YAHOO.widget.ColumnDD(this, oColumn, elTh, elDragTarget);
}
}
else {
YAHOO.log("Could not find DragDrop for draggable Columns", "warn", this.toString());
}
} | [
"function",
"(",
")",
"{",
"this",
".",
"_destroyDraggableColumns",
"(",
")",
";",
"if",
"(",
"util",
".",
"DD",
")",
"{",
"var",
"oColumn",
",",
"elTh",
",",
"elDragTarget",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"this",
".",
"_oColumnSet",
".",
"tree",
"[",
"0",
"]",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"oColumn",
"=",
"this",
".",
"_oColumnSet",
".",
"tree",
"[",
"0",
"]",
"[",
"i",
"]",
";",
"elTh",
"=",
"oColumn",
".",
"getThEl",
"(",
")",
";",
"Dom",
".",
"addClass",
"(",
"elTh",
",",
"DT",
".",
"CLASS_DRAGGABLE",
")",
";",
"elDragTarget",
"=",
"DT",
".",
"_initColumnDragTargetEl",
"(",
")",
";",
"oColumn",
".",
"_dd",
"=",
"new",
"YAHOO",
".",
"widget",
".",
"ColumnDD",
"(",
"this",
",",
"oColumn",
",",
"elTh",
",",
"elDragTarget",
")",
";",
"}",
"}",
"else",
"{",
"YAHOO",
".",
"log",
"(",
"\"Could not find DragDrop for draggable Columns\"",
",",
"\"warn\"",
",",
"this",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
]
| Initializes top-level Column TH elements into DD instances.
@method _initDraggableColumns
@private | [
"Initializes",
"top",
"-",
"level",
"Column",
"TH",
"elements",
"into",
"DD",
"instances",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable-debug.js#L5025-L5040 |
|
42,642 | neyric/webhookit | public/javascripts/yui/datatable/datatable-debug.js | function(cell) {
var elCell = this.getTdEl(cell);
if(elCell) {
var nThisTdIndex = elCell.cellIndex;
var elRow = this.getTrEl(elCell);
if(nThisTdIndex > 0) {
return elRow.cells[nThisTdIndex-1];
}
else {
var elPreviousRow = this.getPreviousTrEl(elRow);
if(elPreviousRow) {
return this.getLastTdEl(elPreviousRow);
}
}
}
YAHOO.log("Could not get next TD element for cell " + cell, "info", this.toString());
return null;
} | javascript | function(cell) {
var elCell = this.getTdEl(cell);
if(elCell) {
var nThisTdIndex = elCell.cellIndex;
var elRow = this.getTrEl(elCell);
if(nThisTdIndex > 0) {
return elRow.cells[nThisTdIndex-1];
}
else {
var elPreviousRow = this.getPreviousTrEl(elRow);
if(elPreviousRow) {
return this.getLastTdEl(elPreviousRow);
}
}
}
YAHOO.log("Could not get next TD element for cell " + cell, "info", this.toString());
return null;
} | [
"function",
"(",
"cell",
")",
"{",
"var",
"elCell",
"=",
"this",
".",
"getTdEl",
"(",
"cell",
")",
";",
"if",
"(",
"elCell",
")",
"{",
"var",
"nThisTdIndex",
"=",
"elCell",
".",
"cellIndex",
";",
"var",
"elRow",
"=",
"this",
".",
"getTrEl",
"(",
"elCell",
")",
";",
"if",
"(",
"nThisTdIndex",
">",
"0",
")",
"{",
"return",
"elRow",
".",
"cells",
"[",
"nThisTdIndex",
"-",
"1",
"]",
";",
"}",
"else",
"{",
"var",
"elPreviousRow",
"=",
"this",
".",
"getPreviousTrEl",
"(",
"elRow",
")",
";",
"if",
"(",
"elPreviousRow",
")",
"{",
"return",
"this",
".",
"getLastTdEl",
"(",
"elPreviousRow",
")",
";",
"}",
"}",
"}",
"YAHOO",
".",
"log",
"(",
"\"Could not get next TD element for cell \"",
"+",
"cell",
",",
"\"info\"",
",",
"this",
".",
"toString",
"(",
")",
")",
";",
"return",
"null",
";",
"}"
]
| Returns DOM reference to the previous TD element from the given cell, or null.
@method getPreviousTdEl
@param cell {HTMLElement | String | Object} DOM element reference or string ID, or
object literal of syntax {record:oRecord, column:oColumn} from which to get previous TD element.
@return {HTMLElement} Reference to previous TD element, or null. | [
"Returns",
"DOM",
"reference",
"to",
"the",
"previous",
"TD",
"element",
"from",
"the",
"given",
"cell",
"or",
"null",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable-debug.js#L7001-L7018 |
|
42,643 | neyric/webhookit | public/javascripts/yui/datatable/datatable-debug.js | function() {
// Store for later
var instanceName = this.toString();
this._oChainRender.stop();
// Destroy static resizer proxy and column proxy
DT._destroyColumnDragTargetEl();
DT._destroyColumnResizerProxyEl();
// Destroy ColumnDD and ColumnResizers
this._destroyColumnHelpers();
// Destroy all CellEditors
var oCellEditor;
for(var i=0, len=this._oColumnSet.flat.length; i<len; i++) {
oCellEditor = this._oColumnSet.flat[i].editor;
if(oCellEditor && oCellEditor.destroy) {
oCellEditor.destroy();
this._oColumnSet.flat[i].editor = null;
}
}
// Destroy Paginator
this._destroyPaginator();
// Unhook custom events
this._oRecordSet.unsubscribeAll();
this.unsubscribeAll();
// Unhook DOM events
Ev.removeListener(document, "click", this._onDocumentClick);
// Clear out the container
this._destroyContainerEl(this._elContainer);
// Null out objects
for(var param in this) {
if(lang.hasOwnProperty(this, param)) {
this[param] = null;
}
}
// Clean up static values
DT._nCurrentCount--;
if(DT._nCurrentCount < 1) {
if(DT._elDynStyleNode) {
document.getElementsByTagName('head')[0].removeChild(DT._elDynStyleNode);
DT._elDynStyleNode = null;
}
}
YAHOO.log("DataTable instance destroyed: " + instanceName);
} | javascript | function() {
// Store for later
var instanceName = this.toString();
this._oChainRender.stop();
// Destroy static resizer proxy and column proxy
DT._destroyColumnDragTargetEl();
DT._destroyColumnResizerProxyEl();
// Destroy ColumnDD and ColumnResizers
this._destroyColumnHelpers();
// Destroy all CellEditors
var oCellEditor;
for(var i=0, len=this._oColumnSet.flat.length; i<len; i++) {
oCellEditor = this._oColumnSet.flat[i].editor;
if(oCellEditor && oCellEditor.destroy) {
oCellEditor.destroy();
this._oColumnSet.flat[i].editor = null;
}
}
// Destroy Paginator
this._destroyPaginator();
// Unhook custom events
this._oRecordSet.unsubscribeAll();
this.unsubscribeAll();
// Unhook DOM events
Ev.removeListener(document, "click", this._onDocumentClick);
// Clear out the container
this._destroyContainerEl(this._elContainer);
// Null out objects
for(var param in this) {
if(lang.hasOwnProperty(this, param)) {
this[param] = null;
}
}
// Clean up static values
DT._nCurrentCount--;
if(DT._nCurrentCount < 1) {
if(DT._elDynStyleNode) {
document.getElementsByTagName('head')[0].removeChild(DT._elDynStyleNode);
DT._elDynStyleNode = null;
}
}
YAHOO.log("DataTable instance destroyed: " + instanceName);
} | [
"function",
"(",
")",
"{",
"// Store for later",
"var",
"instanceName",
"=",
"this",
".",
"toString",
"(",
")",
";",
"this",
".",
"_oChainRender",
".",
"stop",
"(",
")",
";",
"// Destroy static resizer proxy and column proxy",
"DT",
".",
"_destroyColumnDragTargetEl",
"(",
")",
";",
"DT",
".",
"_destroyColumnResizerProxyEl",
"(",
")",
";",
"// Destroy ColumnDD and ColumnResizers",
"this",
".",
"_destroyColumnHelpers",
"(",
")",
";",
"// Destroy all CellEditors",
"var",
"oCellEditor",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"this",
".",
"_oColumnSet",
".",
"flat",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"oCellEditor",
"=",
"this",
".",
"_oColumnSet",
".",
"flat",
"[",
"i",
"]",
".",
"editor",
";",
"if",
"(",
"oCellEditor",
"&&",
"oCellEditor",
".",
"destroy",
")",
"{",
"oCellEditor",
".",
"destroy",
"(",
")",
";",
"this",
".",
"_oColumnSet",
".",
"flat",
"[",
"i",
"]",
".",
"editor",
"=",
"null",
";",
"}",
"}",
"// Destroy Paginator",
"this",
".",
"_destroyPaginator",
"(",
")",
";",
"// Unhook custom events",
"this",
".",
"_oRecordSet",
".",
"unsubscribeAll",
"(",
")",
";",
"this",
".",
"unsubscribeAll",
"(",
")",
";",
"// Unhook DOM events",
"Ev",
".",
"removeListener",
"(",
"document",
",",
"\"click\"",
",",
"this",
".",
"_onDocumentClick",
")",
";",
"// Clear out the container",
"this",
".",
"_destroyContainerEl",
"(",
"this",
".",
"_elContainer",
")",
";",
"// Null out objects",
"for",
"(",
"var",
"param",
"in",
"this",
")",
"{",
"if",
"(",
"lang",
".",
"hasOwnProperty",
"(",
"this",
",",
"param",
")",
")",
"{",
"this",
"[",
"param",
"]",
"=",
"null",
";",
"}",
"}",
"// Clean up static values",
"DT",
".",
"_nCurrentCount",
"--",
";",
"if",
"(",
"DT",
".",
"_nCurrentCount",
"<",
"1",
")",
"{",
"if",
"(",
"DT",
".",
"_elDynStyleNode",
")",
"{",
"document",
".",
"getElementsByTagName",
"(",
"'head'",
")",
"[",
"0",
"]",
".",
"removeChild",
"(",
"DT",
".",
"_elDynStyleNode",
")",
";",
"DT",
".",
"_elDynStyleNode",
"=",
"null",
";",
"}",
"}",
"YAHOO",
".",
"log",
"(",
"\"DataTable instance destroyed: \"",
"+",
"instanceName",
")",
";",
"}"
]
| Nulls out the entire DataTable instance and related objects, removes attached
event listeners, and clears out DOM elements inside the container. After
calling this method, the instance reference should be expliclitly nulled by
implementer, as in myDataTable = null. Use with caution!
@method destroy | [
"Nulls",
"out",
"the",
"entire",
"DataTable",
"instance",
"and",
"related",
"objects",
"removes",
"attached",
"event",
"listeners",
"and",
"clears",
"out",
"DOM",
"elements",
"inside",
"the",
"container",
".",
"After",
"calling",
"this",
"method",
"the",
"instance",
"reference",
"should",
"be",
"expliclitly",
"nulled",
"by",
"implementer",
"as",
"in",
"myDataTable",
"=",
"null",
".",
"Use",
"with",
"caution!"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable-debug.js#L7430-L7484 |
|
42,644 | neyric/webhookit | public/javascripts/yui/datatable/datatable-debug.js | function(row, oData) {
var index = row;
if (!lang.isNumber(index)) {
index = this.getRecordIndex(row);
}
// Update the Record
if(lang.isNumber(index) && (index >= 0)) {
var oRecordSet = this._oRecordSet,
oldRecord = oRecordSet.getRecord(index);
if(oldRecord) {
var updatedRecord = this._oRecordSet.setRecord(oData, index),
elRow = this.getTrEl(oldRecord),
// Copy data from the Record for the event that gets fired later
oldData = oldRecord ? oldRecord.getData() : null;
if(updatedRecord) {
// Update selected rows as necessary
var tracker = this._aSelections || [],
i=0,
oldId = oldRecord.getId(),
newId = updatedRecord.getId();
for(; i<tracker.length; i++) {
if((tracker[i] === oldId)) {
tracker[i] = newId;
}
else if(tracker[i].recordId === oldId) {
tracker[i].recordId = newId;
}
}
// Update the TR only if row is on current page
this._oChainRender.add({
method: function() {
if((this instanceof DT) && this._sId) {
// Paginated
var oPaginator = this.get('paginator');
if (oPaginator) {
var pageStartIndex = (oPaginator.getPageRecords())[0],
pageLastIndex = (oPaginator.getPageRecords())[1];
// At least one of the new records affects the view
if ((index >= pageStartIndex) || (index <= pageLastIndex)) {
this.render();
}
}
else {
if(elRow) {
this._updateTrEl(elRow, updatedRecord);
}
else {
this.getTbodyEl().appendChild(this._addTrEl(updatedRecord));
}
}
this.fireEvent("rowUpdateEvent", {record:updatedRecord, oldData:oldData});
YAHOO.log("DataTable row updated: Record ID = " + updatedRecord.getId() +
", Record index = " + this.getRecordIndex(updatedRecord) +
", page row index = " + this.getTrIndex(updatedRecord), "info", this.toString());
}
},
scope: this,
timeout: (this.get("renderLoopSize") > 0) ? 0 : -1
});
this._runRenderChain();
return;
}
}
}
YAHOO.log("Could not update row " + row + " with the data : " + lang.dump(oData), "warn", this.toString());
return;
} | javascript | function(row, oData) {
var index = row;
if (!lang.isNumber(index)) {
index = this.getRecordIndex(row);
}
// Update the Record
if(lang.isNumber(index) && (index >= 0)) {
var oRecordSet = this._oRecordSet,
oldRecord = oRecordSet.getRecord(index);
if(oldRecord) {
var updatedRecord = this._oRecordSet.setRecord(oData, index),
elRow = this.getTrEl(oldRecord),
// Copy data from the Record for the event that gets fired later
oldData = oldRecord ? oldRecord.getData() : null;
if(updatedRecord) {
// Update selected rows as necessary
var tracker = this._aSelections || [],
i=0,
oldId = oldRecord.getId(),
newId = updatedRecord.getId();
for(; i<tracker.length; i++) {
if((tracker[i] === oldId)) {
tracker[i] = newId;
}
else if(tracker[i].recordId === oldId) {
tracker[i].recordId = newId;
}
}
// Update the TR only if row is on current page
this._oChainRender.add({
method: function() {
if((this instanceof DT) && this._sId) {
// Paginated
var oPaginator = this.get('paginator');
if (oPaginator) {
var pageStartIndex = (oPaginator.getPageRecords())[0],
pageLastIndex = (oPaginator.getPageRecords())[1];
// At least one of the new records affects the view
if ((index >= pageStartIndex) || (index <= pageLastIndex)) {
this.render();
}
}
else {
if(elRow) {
this._updateTrEl(elRow, updatedRecord);
}
else {
this.getTbodyEl().appendChild(this._addTrEl(updatedRecord));
}
}
this.fireEvent("rowUpdateEvent", {record:updatedRecord, oldData:oldData});
YAHOO.log("DataTable row updated: Record ID = " + updatedRecord.getId() +
", Record index = " + this.getRecordIndex(updatedRecord) +
", page row index = " + this.getTrIndex(updatedRecord), "info", this.toString());
}
},
scope: this,
timeout: (this.get("renderLoopSize") > 0) ? 0 : -1
});
this._runRenderChain();
return;
}
}
}
YAHOO.log("Could not update row " + row + " with the data : " + lang.dump(oData), "warn", this.toString());
return;
} | [
"function",
"(",
"row",
",",
"oData",
")",
"{",
"var",
"index",
"=",
"row",
";",
"if",
"(",
"!",
"lang",
".",
"isNumber",
"(",
"index",
")",
")",
"{",
"index",
"=",
"this",
".",
"getRecordIndex",
"(",
"row",
")",
";",
"}",
"// Update the Record",
"if",
"(",
"lang",
".",
"isNumber",
"(",
"index",
")",
"&&",
"(",
"index",
">=",
"0",
")",
")",
"{",
"var",
"oRecordSet",
"=",
"this",
".",
"_oRecordSet",
",",
"oldRecord",
"=",
"oRecordSet",
".",
"getRecord",
"(",
"index",
")",
";",
"if",
"(",
"oldRecord",
")",
"{",
"var",
"updatedRecord",
"=",
"this",
".",
"_oRecordSet",
".",
"setRecord",
"(",
"oData",
",",
"index",
")",
",",
"elRow",
"=",
"this",
".",
"getTrEl",
"(",
"oldRecord",
")",
",",
"// Copy data from the Record for the event that gets fired later",
"oldData",
"=",
"oldRecord",
"?",
"oldRecord",
".",
"getData",
"(",
")",
":",
"null",
";",
"if",
"(",
"updatedRecord",
")",
"{",
"// Update selected rows as necessary",
"var",
"tracker",
"=",
"this",
".",
"_aSelections",
"||",
"[",
"]",
",",
"i",
"=",
"0",
",",
"oldId",
"=",
"oldRecord",
".",
"getId",
"(",
")",
",",
"newId",
"=",
"updatedRecord",
".",
"getId",
"(",
")",
";",
"for",
"(",
";",
"i",
"<",
"tracker",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"(",
"tracker",
"[",
"i",
"]",
"===",
"oldId",
")",
")",
"{",
"tracker",
"[",
"i",
"]",
"=",
"newId",
";",
"}",
"else",
"if",
"(",
"tracker",
"[",
"i",
"]",
".",
"recordId",
"===",
"oldId",
")",
"{",
"tracker",
"[",
"i",
"]",
".",
"recordId",
"=",
"newId",
";",
"}",
"}",
"// Update the TR only if row is on current page",
"this",
".",
"_oChainRender",
".",
"add",
"(",
"{",
"method",
":",
"function",
"(",
")",
"{",
"if",
"(",
"(",
"this",
"instanceof",
"DT",
")",
"&&",
"this",
".",
"_sId",
")",
"{",
"// Paginated",
"var",
"oPaginator",
"=",
"this",
".",
"get",
"(",
"'paginator'",
")",
";",
"if",
"(",
"oPaginator",
")",
"{",
"var",
"pageStartIndex",
"=",
"(",
"oPaginator",
".",
"getPageRecords",
"(",
")",
")",
"[",
"0",
"]",
",",
"pageLastIndex",
"=",
"(",
"oPaginator",
".",
"getPageRecords",
"(",
")",
")",
"[",
"1",
"]",
";",
"// At least one of the new records affects the view",
"if",
"(",
"(",
"index",
">=",
"pageStartIndex",
")",
"||",
"(",
"index",
"<=",
"pageLastIndex",
")",
")",
"{",
"this",
".",
"render",
"(",
")",
";",
"}",
"}",
"else",
"{",
"if",
"(",
"elRow",
")",
"{",
"this",
".",
"_updateTrEl",
"(",
"elRow",
",",
"updatedRecord",
")",
";",
"}",
"else",
"{",
"this",
".",
"getTbodyEl",
"(",
")",
".",
"appendChild",
"(",
"this",
".",
"_addTrEl",
"(",
"updatedRecord",
")",
")",
";",
"}",
"}",
"this",
".",
"fireEvent",
"(",
"\"rowUpdateEvent\"",
",",
"{",
"record",
":",
"updatedRecord",
",",
"oldData",
":",
"oldData",
"}",
")",
";",
"YAHOO",
".",
"log",
"(",
"\"DataTable row updated: Record ID = \"",
"+",
"updatedRecord",
".",
"getId",
"(",
")",
"+",
"\", Record index = \"",
"+",
"this",
".",
"getRecordIndex",
"(",
"updatedRecord",
")",
"+",
"\", page row index = \"",
"+",
"this",
".",
"getTrIndex",
"(",
"updatedRecord",
")",
",",
"\"info\"",
",",
"this",
".",
"toString",
"(",
")",
")",
";",
"}",
"}",
",",
"scope",
":",
"this",
",",
"timeout",
":",
"(",
"this",
".",
"get",
"(",
"\"renderLoopSize\"",
")",
">",
"0",
")",
"?",
"0",
":",
"-",
"1",
"}",
")",
";",
"this",
".",
"_runRenderChain",
"(",
")",
";",
"return",
";",
"}",
"}",
"}",
"YAHOO",
".",
"log",
"(",
"\"Could not update row \"",
"+",
"row",
"+",
"\" with the data : \"",
"+",
"lang",
".",
"dump",
"(",
"oData",
")",
",",
"\"warn\"",
",",
"this",
".",
"toString",
"(",
")",
")",
";",
"return",
";",
"}"
]
| For the given row, updates the associated Record with the given data. If the
row is on current page, the corresponding DOM elements are also updated.
@method updateRow
@param row {YAHOO.widget.Record | Number | HTMLElement | String}
Which row to update: By Record instance, by Record's RecordSet
position index, by HTMLElement reference to the TR element, or by ID string
of the TR element.
@param oData {Object} Object literal of data for the row. | [
"For",
"the",
"given",
"row",
"updates",
"the",
"associated",
"Record",
"with",
"the",
"given",
"data",
".",
"If",
"the",
"row",
"is",
"on",
"current",
"page",
"the",
"corresponding",
"DOM",
"elements",
"are",
"also",
"updated",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable-debug.js#L9156-L9228 |
|
42,645 | neyric/webhookit | public/javascripts/yui/datatable/datatable-debug.js | function(elLiner, oRecord, oColumn) {
if(!oRecord) {
oRecord = this.getRecord(elLiner);
}
if(!oColumn) {
oColumn = this.getColumn(elLiner.parentNode.cellIndex);
}
if(oRecord && oColumn) {
var sField = oColumn.field;
var oData = oRecord.getData(sField);
var fnFormatter = typeof oColumn.formatter === 'function' ?
oColumn.formatter :
DT.Formatter[oColumn.formatter+''] ||
DT.Formatter.defaultFormatter;
// Apply special formatter
if(fnFormatter) {
fnFormatter.call(this, elLiner, oRecord, oColumn, oData);
}
else {
elLiner.innerHTML = oData;
}
this.fireEvent("cellFormatEvent", {record:oRecord, column:oColumn, key:oColumn.key, el:elLiner});
}
else {
YAHOO.log("Could not format cell " + elLiner, "error", this.toString());
}
} | javascript | function(elLiner, oRecord, oColumn) {
if(!oRecord) {
oRecord = this.getRecord(elLiner);
}
if(!oColumn) {
oColumn = this.getColumn(elLiner.parentNode.cellIndex);
}
if(oRecord && oColumn) {
var sField = oColumn.field;
var oData = oRecord.getData(sField);
var fnFormatter = typeof oColumn.formatter === 'function' ?
oColumn.formatter :
DT.Formatter[oColumn.formatter+''] ||
DT.Formatter.defaultFormatter;
// Apply special formatter
if(fnFormatter) {
fnFormatter.call(this, elLiner, oRecord, oColumn, oData);
}
else {
elLiner.innerHTML = oData;
}
this.fireEvent("cellFormatEvent", {record:oRecord, column:oColumn, key:oColumn.key, el:elLiner});
}
else {
YAHOO.log("Could not format cell " + elLiner, "error", this.toString());
}
} | [
"function",
"(",
"elLiner",
",",
"oRecord",
",",
"oColumn",
")",
"{",
"if",
"(",
"!",
"oRecord",
")",
"{",
"oRecord",
"=",
"this",
".",
"getRecord",
"(",
"elLiner",
")",
";",
"}",
"if",
"(",
"!",
"oColumn",
")",
"{",
"oColumn",
"=",
"this",
".",
"getColumn",
"(",
"elLiner",
".",
"parentNode",
".",
"cellIndex",
")",
";",
"}",
"if",
"(",
"oRecord",
"&&",
"oColumn",
")",
"{",
"var",
"sField",
"=",
"oColumn",
".",
"field",
";",
"var",
"oData",
"=",
"oRecord",
".",
"getData",
"(",
"sField",
")",
";",
"var",
"fnFormatter",
"=",
"typeof",
"oColumn",
".",
"formatter",
"===",
"'function'",
"?",
"oColumn",
".",
"formatter",
":",
"DT",
".",
"Formatter",
"[",
"oColumn",
".",
"formatter",
"+",
"''",
"]",
"||",
"DT",
".",
"Formatter",
".",
"defaultFormatter",
";",
"// Apply special formatter",
"if",
"(",
"fnFormatter",
")",
"{",
"fnFormatter",
".",
"call",
"(",
"this",
",",
"elLiner",
",",
"oRecord",
",",
"oColumn",
",",
"oData",
")",
";",
"}",
"else",
"{",
"elLiner",
".",
"innerHTML",
"=",
"oData",
";",
"}",
"this",
".",
"fireEvent",
"(",
"\"cellFormatEvent\"",
",",
"{",
"record",
":",
"oRecord",
",",
"column",
":",
"oColumn",
",",
"key",
":",
"oColumn",
".",
"key",
",",
"el",
":",
"elLiner",
"}",
")",
";",
"}",
"else",
"{",
"YAHOO",
".",
"log",
"(",
"\"Could not format cell \"",
"+",
"elLiner",
",",
"\"error\"",
",",
"this",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
]
| CELL FUNCTIONS
Outputs markup into the given TD based on given Record.
@method formatCell
@param elLiner {HTMLElement} The liner DIV element within the TD.
@param oRecord {YAHOO.widget.Record} (Optional) Record instance.
@param oColumn {YAHOO.widget.Column} (Optional) Column instance. | [
"CELL",
"FUNCTIONS",
"Outputs",
"markup",
"into",
"the",
"given",
"TD",
"based",
"on",
"given",
"Record",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable-debug.js#L9643-L9673 |
|
42,646 | neyric/webhookit | public/javascripts/yui/datatable/datatable-debug.js | function(oRecord, oColumn, oData) {
// Validate Column and Record
oColumn = (oColumn instanceof YAHOO.widget.Column) ? oColumn : this.getColumn(oColumn);
if(oColumn && oColumn.getField() && (oRecord instanceof YAHOO.widget.Record)) {
var sKey = oColumn.getField(),
// Copy data from the Record for the event that gets fired later
//var oldData = YAHOO.widget.DataTable._cloneObject(oRecord.getData());
oldData = oRecord.getData(sKey);
// Update Record with new data
this._oRecordSet.updateRecordValue(oRecord, sKey, oData);
// Update the TD only if row is on current page
var elTd = this.getTdEl({record: oRecord, column: oColumn});
if(elTd) {
this._oChainRender.add({
method: function() {
if((this instanceof DT) && this._sId) {
this.formatCell(elTd.firstChild);
this.fireEvent("cellUpdateEvent", {record:oRecord, column: oColumn, oldData:oldData});
YAHOO.log("DataTable cell updated: Record ID = " + oRecord.getId() +
", Record index = " + this.getRecordIndex(oRecord) +
", page row index = " + this.getTrIndex(oRecord) +
", Column key = " + oColumn.getKey(), "info", this.toString());
}
},
scope: this,
timeout: (this.get("renderLoopSize") > 0) ? 0 : -1
});
this._runRenderChain();
}
else {
this.fireEvent("cellUpdateEvent", {record:oRecord, column: oColumn, oldData:oldData});
YAHOO.log("DataTable cell updated: Record ID = " + oRecord.getId() +
", Record index = " + this.getRecordIndex(oRecord) +
", page row index = " + this.getTrIndex(oRecord) +
", Column key = " + oColumn.getKey(), "info", this.toString());
}
}
} | javascript | function(oRecord, oColumn, oData) {
// Validate Column and Record
oColumn = (oColumn instanceof YAHOO.widget.Column) ? oColumn : this.getColumn(oColumn);
if(oColumn && oColumn.getField() && (oRecord instanceof YAHOO.widget.Record)) {
var sKey = oColumn.getField(),
// Copy data from the Record for the event that gets fired later
//var oldData = YAHOO.widget.DataTable._cloneObject(oRecord.getData());
oldData = oRecord.getData(sKey);
// Update Record with new data
this._oRecordSet.updateRecordValue(oRecord, sKey, oData);
// Update the TD only if row is on current page
var elTd = this.getTdEl({record: oRecord, column: oColumn});
if(elTd) {
this._oChainRender.add({
method: function() {
if((this instanceof DT) && this._sId) {
this.formatCell(elTd.firstChild);
this.fireEvent("cellUpdateEvent", {record:oRecord, column: oColumn, oldData:oldData});
YAHOO.log("DataTable cell updated: Record ID = " + oRecord.getId() +
", Record index = " + this.getRecordIndex(oRecord) +
", page row index = " + this.getTrIndex(oRecord) +
", Column key = " + oColumn.getKey(), "info", this.toString());
}
},
scope: this,
timeout: (this.get("renderLoopSize") > 0) ? 0 : -1
});
this._runRenderChain();
}
else {
this.fireEvent("cellUpdateEvent", {record:oRecord, column: oColumn, oldData:oldData});
YAHOO.log("DataTable cell updated: Record ID = " + oRecord.getId() +
", Record index = " + this.getRecordIndex(oRecord) +
", page row index = " + this.getTrIndex(oRecord) +
", Column key = " + oColumn.getKey(), "info", this.toString());
}
}
} | [
"function",
"(",
"oRecord",
",",
"oColumn",
",",
"oData",
")",
"{",
"// Validate Column and Record",
"oColumn",
"=",
"(",
"oColumn",
"instanceof",
"YAHOO",
".",
"widget",
".",
"Column",
")",
"?",
"oColumn",
":",
"this",
".",
"getColumn",
"(",
"oColumn",
")",
";",
"if",
"(",
"oColumn",
"&&",
"oColumn",
".",
"getField",
"(",
")",
"&&",
"(",
"oRecord",
"instanceof",
"YAHOO",
".",
"widget",
".",
"Record",
")",
")",
"{",
"var",
"sKey",
"=",
"oColumn",
".",
"getField",
"(",
")",
",",
"// Copy data from the Record for the event that gets fired later",
"//var oldData = YAHOO.widget.DataTable._cloneObject(oRecord.getData());",
"oldData",
"=",
"oRecord",
".",
"getData",
"(",
"sKey",
")",
";",
"// Update Record with new data",
"this",
".",
"_oRecordSet",
".",
"updateRecordValue",
"(",
"oRecord",
",",
"sKey",
",",
"oData",
")",
";",
"// Update the TD only if row is on current page",
"var",
"elTd",
"=",
"this",
".",
"getTdEl",
"(",
"{",
"record",
":",
"oRecord",
",",
"column",
":",
"oColumn",
"}",
")",
";",
"if",
"(",
"elTd",
")",
"{",
"this",
".",
"_oChainRender",
".",
"add",
"(",
"{",
"method",
":",
"function",
"(",
")",
"{",
"if",
"(",
"(",
"this",
"instanceof",
"DT",
")",
"&&",
"this",
".",
"_sId",
")",
"{",
"this",
".",
"formatCell",
"(",
"elTd",
".",
"firstChild",
")",
";",
"this",
".",
"fireEvent",
"(",
"\"cellUpdateEvent\"",
",",
"{",
"record",
":",
"oRecord",
",",
"column",
":",
"oColumn",
",",
"oldData",
":",
"oldData",
"}",
")",
";",
"YAHOO",
".",
"log",
"(",
"\"DataTable cell updated: Record ID = \"",
"+",
"oRecord",
".",
"getId",
"(",
")",
"+",
"\", Record index = \"",
"+",
"this",
".",
"getRecordIndex",
"(",
"oRecord",
")",
"+",
"\", page row index = \"",
"+",
"this",
".",
"getTrIndex",
"(",
"oRecord",
")",
"+",
"\", Column key = \"",
"+",
"oColumn",
".",
"getKey",
"(",
")",
",",
"\"info\"",
",",
"this",
".",
"toString",
"(",
")",
")",
";",
"}",
"}",
",",
"scope",
":",
"this",
",",
"timeout",
":",
"(",
"this",
".",
"get",
"(",
"\"renderLoopSize\"",
")",
">",
"0",
")",
"?",
"0",
":",
"-",
"1",
"}",
")",
";",
"this",
".",
"_runRenderChain",
"(",
")",
";",
"}",
"else",
"{",
"this",
".",
"fireEvent",
"(",
"\"cellUpdateEvent\"",
",",
"{",
"record",
":",
"oRecord",
",",
"column",
":",
"oColumn",
",",
"oldData",
":",
"oldData",
"}",
")",
";",
"YAHOO",
".",
"log",
"(",
"\"DataTable cell updated: Record ID = \"",
"+",
"oRecord",
".",
"getId",
"(",
")",
"+",
"\", Record index = \"",
"+",
"this",
".",
"getRecordIndex",
"(",
"oRecord",
")",
"+",
"\", page row index = \"",
"+",
"this",
".",
"getTrIndex",
"(",
"oRecord",
")",
"+",
"\", Column key = \"",
"+",
"oColumn",
".",
"getKey",
"(",
")",
",",
"\"info\"",
",",
"this",
".",
"toString",
"(",
")",
")",
";",
"}",
"}",
"}"
]
| For the given row and column, updates the Record with the given data. If the
cell is on current page, the corresponding DOM elements are also updated.
@method updateCell
@param oRecord {YAHOO.widget.Record} Record instance.
@param oColumn {YAHOO.widget.Column | String | Number} A Column key, or a ColumnSet key index.
@param oData {Object} New data value for the cell. | [
"For",
"the",
"given",
"row",
"and",
"column",
"updates",
"the",
"Record",
"with",
"the",
"given",
"data",
".",
"If",
"the",
"cell",
"is",
"on",
"current",
"page",
"the",
"corresponding",
"DOM",
"elements",
"are",
"also",
"updated",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable-debug.js#L9684-L9724 |
|
42,647 | neyric/webhookit | public/javascripts/yui/datatable/datatable-debug.js | function(row) {
var elRow = this.getTrEl(row);
if(elRow) {
// Make sure previous row is unhighlighted
/* if(this._sLastHighlightedTrElId) {
Dom.removeClass(this._sLastHighlightedTrElId,DT.CLASS_HIGHLIGHTED);
}*/
var oRecord = this.getRecord(elRow);
Dom.addClass(elRow,DT.CLASS_HIGHLIGHTED);
//this._sLastHighlightedTrElId = elRow.id;
this.fireEvent("rowHighlightEvent", {record:oRecord, el:elRow});
YAHOO.log("Highlighted " + elRow, "info", this.toString());
return;
}
YAHOO.log("Could not highlight row " + row, "warn", this.toString());
} | javascript | function(row) {
var elRow = this.getTrEl(row);
if(elRow) {
// Make sure previous row is unhighlighted
/* if(this._sLastHighlightedTrElId) {
Dom.removeClass(this._sLastHighlightedTrElId,DT.CLASS_HIGHLIGHTED);
}*/
var oRecord = this.getRecord(elRow);
Dom.addClass(elRow,DT.CLASS_HIGHLIGHTED);
//this._sLastHighlightedTrElId = elRow.id;
this.fireEvent("rowHighlightEvent", {record:oRecord, el:elRow});
YAHOO.log("Highlighted " + elRow, "info", this.toString());
return;
}
YAHOO.log("Could not highlight row " + row, "warn", this.toString());
} | [
"function",
"(",
"row",
")",
"{",
"var",
"elRow",
"=",
"this",
".",
"getTrEl",
"(",
"row",
")",
";",
"if",
"(",
"elRow",
")",
"{",
"// Make sure previous row is unhighlighted",
"/* if(this._sLastHighlightedTrElId) {\n Dom.removeClass(this._sLastHighlightedTrElId,DT.CLASS_HIGHLIGHTED);\n }*/",
"var",
"oRecord",
"=",
"this",
".",
"getRecord",
"(",
"elRow",
")",
";",
"Dom",
".",
"addClass",
"(",
"elRow",
",",
"DT",
".",
"CLASS_HIGHLIGHTED",
")",
";",
"//this._sLastHighlightedTrElId = elRow.id;",
"this",
".",
"fireEvent",
"(",
"\"rowHighlightEvent\"",
",",
"{",
"record",
":",
"oRecord",
",",
"el",
":",
"elRow",
"}",
")",
";",
"YAHOO",
".",
"log",
"(",
"\"Highlighted \"",
"+",
"elRow",
",",
"\"info\"",
",",
"this",
".",
"toString",
"(",
")",
")",
";",
"return",
";",
"}",
"YAHOO",
".",
"log",
"(",
"\"Could not highlight row \"",
"+",
"row",
",",
"\"warn\"",
",",
"this",
".",
"toString",
"(",
")",
")",
";",
"}"
]
| Assigns the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED to the given row.
@method highlightRow
@param row {HTMLElement | String} DOM element reference or ID string. | [
"Assigns",
"the",
"class",
"YAHOO",
".",
"widget",
".",
"DataTable",
".",
"CLASS_HIGHLIGHTED",
"to",
"the",
"given",
"row",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable-debug.js#L11995-L12011 |
|
42,648 | neyric/webhookit | public/javascripts/yui/datatable/datatable-debug.js | function(oDataTable, elCell) {
// Validate
if(oDataTable instanceof YAHOO.widget.DataTable) {
this._oDataTable = oDataTable;
// Validate cell
elCell = oDataTable.getTdEl(elCell);
if(elCell) {
this._elTd = elCell;
// Validate Column
var oColumn = oDataTable.getColumn(elCell);
if(oColumn) {
this._oColumn = oColumn;
// Validate Record
var oRecord = oDataTable.getRecord(elCell);
if(oRecord) {
this._oRecord = oRecord;
var value = oRecord.getData(this.getColumn().getField());
this.value = (value !== undefined) ? value : this.defaultValue;
return true;
}
}
}
}
YAHOO.log("Could not attach CellEditor","error",this.toString());
return false;
} | javascript | function(oDataTable, elCell) {
// Validate
if(oDataTable instanceof YAHOO.widget.DataTable) {
this._oDataTable = oDataTable;
// Validate cell
elCell = oDataTable.getTdEl(elCell);
if(elCell) {
this._elTd = elCell;
// Validate Column
var oColumn = oDataTable.getColumn(elCell);
if(oColumn) {
this._oColumn = oColumn;
// Validate Record
var oRecord = oDataTable.getRecord(elCell);
if(oRecord) {
this._oRecord = oRecord;
var value = oRecord.getData(this.getColumn().getField());
this.value = (value !== undefined) ? value : this.defaultValue;
return true;
}
}
}
}
YAHOO.log("Could not attach CellEditor","error",this.toString());
return false;
} | [
"function",
"(",
"oDataTable",
",",
"elCell",
")",
"{",
"// Validate ",
"if",
"(",
"oDataTable",
"instanceof",
"YAHOO",
".",
"widget",
".",
"DataTable",
")",
"{",
"this",
".",
"_oDataTable",
"=",
"oDataTable",
";",
"// Validate cell",
"elCell",
"=",
"oDataTable",
".",
"getTdEl",
"(",
"elCell",
")",
";",
"if",
"(",
"elCell",
")",
"{",
"this",
".",
"_elTd",
"=",
"elCell",
";",
"// Validate Column",
"var",
"oColumn",
"=",
"oDataTable",
".",
"getColumn",
"(",
"elCell",
")",
";",
"if",
"(",
"oColumn",
")",
"{",
"this",
".",
"_oColumn",
"=",
"oColumn",
";",
"// Validate Record",
"var",
"oRecord",
"=",
"oDataTable",
".",
"getRecord",
"(",
"elCell",
")",
";",
"if",
"(",
"oRecord",
")",
"{",
"this",
".",
"_oRecord",
"=",
"oRecord",
";",
"var",
"value",
"=",
"oRecord",
".",
"getData",
"(",
"this",
".",
"getColumn",
"(",
")",
".",
"getField",
"(",
")",
")",
";",
"this",
".",
"value",
"=",
"(",
"value",
"!==",
"undefined",
")",
"?",
"value",
":",
"this",
".",
"defaultValue",
";",
"return",
"true",
";",
"}",
"}",
"}",
"}",
"YAHOO",
".",
"log",
"(",
"\"Could not attach CellEditor\"",
",",
"\"error\"",
",",
"this",
".",
"toString",
"(",
")",
")",
";",
"return",
"false",
";",
"}"
]
| Attach CellEditor for a new interaction.
@method attach
@param oDataTable {YAHOO.widget.DataTable} Associated DataTable instance.
@param elCell {HTMLElement} Cell to edit. | [
"Attach",
"CellEditor",
"for",
"a",
"new",
"interaction",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable-debug.js#L16063-L16091 |
|
42,649 | neyric/webhookit | public/javascripts/yui/datatable/datatable-debug.js | function() {
this.resetForm();
this.isActive = true;
this.getContainerEl().style.display = "";
this.focus();
this.fireEvent("showEvent", {editor:this});
YAHOO.log("CellEditor shown", "info", this.toString());
} | javascript | function() {
this.resetForm();
this.isActive = true;
this.getContainerEl().style.display = "";
this.focus();
this.fireEvent("showEvent", {editor:this});
YAHOO.log("CellEditor shown", "info", this.toString());
} | [
"function",
"(",
")",
"{",
"this",
".",
"resetForm",
"(",
")",
";",
"this",
".",
"isActive",
"=",
"true",
";",
"this",
".",
"getContainerEl",
"(",
")",
".",
"style",
".",
"display",
"=",
"\"\"",
";",
"this",
".",
"focus",
"(",
")",
";",
"this",
".",
"fireEvent",
"(",
"\"showEvent\"",
",",
"{",
"editor",
":",
"this",
"}",
")",
";",
"YAHOO",
".",
"log",
"(",
"\"CellEditor shown\"",
",",
"\"info\"",
",",
"this",
".",
"toString",
"(",
")",
")",
";",
"}"
]
| Displays CellEditor UI in the correct position.
@method show | [
"Displays",
"CellEditor",
"UI",
"in",
"the",
"correct",
"position",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datatable/datatable-debug.js#L16128-L16135 |
|
42,650 | neyric/webhookit | public/javascripts/inputex/js/fields/DSSelectField.js | function (options) {
inputEx.DSSelectField.superclass.setOptions.call(this, options);
this.options.valueKey = options.valueKey || "value";
this.options.labelKey = options.labelKey || "label";
this.options.datasource = options.datasource;
} | javascript | function (options) {
inputEx.DSSelectField.superclass.setOptions.call(this, options);
this.options.valueKey = options.valueKey || "value";
this.options.labelKey = options.labelKey || "label";
this.options.datasource = options.datasource;
} | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"DSSelectField",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"this",
".",
"options",
".",
"valueKey",
"=",
"options",
".",
"valueKey",
"||",
"\"value\"",
";",
"this",
".",
"options",
".",
"labelKey",
"=",
"options",
".",
"labelKey",
"||",
"\"label\"",
";",
"this",
".",
"options",
".",
"datasource",
"=",
"options",
".",
"datasource",
";",
"}"
]
| Setup the additional options for selectfield
@param {Object} options Options object as passed to the constructor | [
"Setup",
"the",
"additional",
"options",
"for",
"selectfield"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/fields/DSSelectField.js#L25-L34 |
|
42,651 | neyric/webhookit | public/javascripts/inputex/js/fields/DSSelectField.js | function (oRequest) {
if (!!this.options.datasource) {
this.options.datasource.sendRequest(oRequest, {success: this.onDatasourceSuccess, failure: this.onDatasourceFailure, scope: this});
}
} | javascript | function (oRequest) {
if (!!this.options.datasource) {
this.options.datasource.sendRequest(oRequest, {success: this.onDatasourceSuccess, failure: this.onDatasourceFailure, scope: this});
}
} | [
"function",
"(",
"oRequest",
")",
"{",
"if",
"(",
"!",
"!",
"this",
".",
"options",
".",
"datasource",
")",
"{",
"this",
".",
"options",
".",
"datasource",
".",
"sendRequest",
"(",
"oRequest",
",",
"{",
"success",
":",
"this",
".",
"onDatasourceSuccess",
",",
"failure",
":",
"this",
".",
"onDatasourceFailure",
",",
"scope",
":",
"this",
"}",
")",
";",
"}",
"}"
]
| Send the datasource request | [
"Send",
"the",
"datasource",
"request"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/fields/DSSelectField.js#L50-L54 |
|
42,652 | neyric/webhookit | public/javascripts/inputex/js/fields/DSSelectField.js | function (items) {
var i, length;
// remove previous <option>s nodes
while (this.el.childNodes.length > 0) {
this.el.removeChild(this.el.childNodes[0]);
}
// add new options
for (i = 0, length = items.length; i < length ; i += 1) {
this.addChoice({ value: items[i][this.options.valueKey], label: items[i][this.options.labelKey] });
}
} | javascript | function (items) {
var i, length;
// remove previous <option>s nodes
while (this.el.childNodes.length > 0) {
this.el.removeChild(this.el.childNodes[0]);
}
// add new options
for (i = 0, length = items.length; i < length ; i += 1) {
this.addChoice({ value: items[i][this.options.valueKey], label: items[i][this.options.labelKey] });
}
} | [
"function",
"(",
"items",
")",
"{",
"var",
"i",
",",
"length",
";",
"// remove previous <option>s nodes",
"while",
"(",
"this",
".",
"el",
".",
"childNodes",
".",
"length",
">",
"0",
")",
"{",
"this",
".",
"el",
".",
"removeChild",
"(",
"this",
".",
"el",
".",
"childNodes",
"[",
"0",
"]",
")",
";",
"}",
"// add new options",
"for",
"(",
"i",
"=",
"0",
",",
"length",
"=",
"items",
".",
"length",
";",
"i",
"<",
"length",
";",
"i",
"+=",
"1",
")",
"{",
"this",
".",
"addChoice",
"(",
"{",
"value",
":",
"items",
"[",
"i",
"]",
"[",
"this",
".",
"options",
".",
"valueKey",
"]",
",",
"label",
":",
"items",
"[",
"i",
"]",
"[",
"this",
".",
"options",
".",
"labelKey",
"]",
"}",
")",
";",
"}",
"}"
]
| Insert the options | [
"Insert",
"the",
"options"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/fields/DSSelectField.js#L59-L72 |
|
42,653 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(instanceObject) {
if(!instanceObject || !instanceObject["$schema"]) {
throw new Error("Invalid json schema instance object. Object must have a '$schema' property.");
}
var formDef = this.schemaToInputEx(instanceObject["$schema"]);
// Set the default value of each property to the instance value
for(var i = 0 ; i < formDef.fields.length ; i++) {
var fieldName = formDef.fields[i].name;
formDef.fields[i].value = instanceObject[fieldName];
}
return formDef;
} | javascript | function(instanceObject) {
if(!instanceObject || !instanceObject["$schema"]) {
throw new Error("Invalid json schema instance object. Object must have a '$schema' property.");
}
var formDef = this.schemaToInputEx(instanceObject["$schema"]);
// Set the default value of each property to the instance value
for(var i = 0 ; i < formDef.fields.length ; i++) {
var fieldName = formDef.fields[i].name;
formDef.fields[i].value = instanceObject[fieldName];
}
return formDef;
} | [
"function",
"(",
"instanceObject",
")",
"{",
"if",
"(",
"!",
"instanceObject",
"||",
"!",
"instanceObject",
"[",
"\"$schema\"",
"]",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Invalid json schema instance object. Object must have a '$schema' property.\"",
")",
";",
"}",
"var",
"formDef",
"=",
"this",
".",
"schemaToInputEx",
"(",
"instanceObject",
"[",
"\"$schema\"",
"]",
")",
";",
"// Set the default value of each property to the instance value",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"formDef",
".",
"fields",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"fieldName",
"=",
"formDef",
".",
"fields",
"[",
"i",
"]",
".",
"name",
";",
"formDef",
".",
"fields",
"[",
"i",
"]",
".",
"value",
"=",
"instanceObject",
"[",
"fieldName",
"]",
";",
"}",
"return",
"formDef",
";",
"}"
]
| Create an inputEx Json form definition from a json schema instance object
Respect the "Self-Defined Schema Convention" | [
"Create",
"an",
"inputEx",
"Json",
"form",
"definition",
"from",
"a",
"json",
"schema",
"instance",
"object",
"Respect",
"the",
"Self",
"-",
"Defined",
"Schema",
"Convention"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L890-L904 |
|
42,654 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function (config, sendUpdatedEvt) {
var position, choice;
position = this.getChoicePosition(config);
if (position !== -1) {
choice = this.choicesList[position];
// test if visible first in case we try to hide twice or more...
if (choice.visible) {
choice.visible = false;
// Clear if hiding selected choice
if (this.getValue() === choice.value) {
this.clear(sendUpdatedEvt);
}
// Remove from DOM
this.removeChoiceNode(choice.node);
}
}
} | javascript | function (config, sendUpdatedEvt) {
var position, choice;
position = this.getChoicePosition(config);
if (position !== -1) {
choice = this.choicesList[position];
// test if visible first in case we try to hide twice or more...
if (choice.visible) {
choice.visible = false;
// Clear if hiding selected choice
if (this.getValue() === choice.value) {
this.clear(sendUpdatedEvt);
}
// Remove from DOM
this.removeChoiceNode(choice.node);
}
}
} | [
"function",
"(",
"config",
",",
"sendUpdatedEvt",
")",
"{",
"var",
"position",
",",
"choice",
";",
"position",
"=",
"this",
".",
"getChoicePosition",
"(",
"config",
")",
";",
"if",
"(",
"position",
"!==",
"-",
"1",
")",
"{",
"choice",
"=",
"this",
".",
"choicesList",
"[",
"position",
"]",
";",
"// test if visible first in case we try to hide twice or more...",
"if",
"(",
"choice",
".",
"visible",
")",
"{",
"choice",
".",
"visible",
"=",
"false",
";",
"// Clear if hiding selected choice",
"if",
"(",
"this",
".",
"getValue",
"(",
")",
"===",
"choice",
".",
"value",
")",
"{",
"this",
".",
"clear",
"(",
"sendUpdatedEvt",
")",
";",
"}",
"// Remove from DOM",
"this",
".",
"removeChoiceNode",
"(",
"choice",
".",
"node",
")",
";",
"}",
"}",
"}"
]
| Hide a choice
@param {Object} config An object targeting the choice to hide (e.g. { position : 1 } || { value: 'second' } || { label: 'Second' }) | [
"Hide",
"a",
"choice"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L1013-L1040 |
|
42,655 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(options) {
inputEx.Form.superclass.setOptions.call(this, options);
this.buttons = [];
this.options.buttons = options.buttons || [];
this.options.action = options.action;
this.options.method = options.method;
this.options.className = options.className || 'inputEx-Group';
this.options.autocomplete = lang.isUndefined(options.autocomplete) ?
inputEx.browserAutocomplete :
(options.autocomplete === false || options.autocomplete === "off") ? false : true;
this.options.enctype = options.enctype;
if(options.ajax) {
this.options.ajax = {};
this.options.ajax.method = options.ajax.method || 'POST';
this.options.ajax.uri = options.ajax.uri || 'default.php';
this.options.ajax.callback = options.ajax.callback || {};
this.options.ajax.callback.scope = options.ajax.callback.scope || this;
this.options.ajax.showMask = lang.isUndefined(options.ajax.showMask) ? false : options.ajax.showMask;
this.options.ajax.contentType = options.ajax.contentType || "application/json";
this.options.ajax.wrapObject = options.ajax.wrapObject;
}
if (lang.isFunction(options.onSubmit)) {
this.options.onSubmit = options.onSubmit;
}
} | javascript | function(options) {
inputEx.Form.superclass.setOptions.call(this, options);
this.buttons = [];
this.options.buttons = options.buttons || [];
this.options.action = options.action;
this.options.method = options.method;
this.options.className = options.className || 'inputEx-Group';
this.options.autocomplete = lang.isUndefined(options.autocomplete) ?
inputEx.browserAutocomplete :
(options.autocomplete === false || options.autocomplete === "off") ? false : true;
this.options.enctype = options.enctype;
if(options.ajax) {
this.options.ajax = {};
this.options.ajax.method = options.ajax.method || 'POST';
this.options.ajax.uri = options.ajax.uri || 'default.php';
this.options.ajax.callback = options.ajax.callback || {};
this.options.ajax.callback.scope = options.ajax.callback.scope || this;
this.options.ajax.showMask = lang.isUndefined(options.ajax.showMask) ? false : options.ajax.showMask;
this.options.ajax.contentType = options.ajax.contentType || "application/json";
this.options.ajax.wrapObject = options.ajax.wrapObject;
}
if (lang.isFunction(options.onSubmit)) {
this.options.onSubmit = options.onSubmit;
}
} | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"Form",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"this",
".",
"buttons",
"=",
"[",
"]",
";",
"this",
".",
"options",
".",
"buttons",
"=",
"options",
".",
"buttons",
"||",
"[",
"]",
";",
"this",
".",
"options",
".",
"action",
"=",
"options",
".",
"action",
";",
"this",
".",
"options",
".",
"method",
"=",
"options",
".",
"method",
";",
"this",
".",
"options",
".",
"className",
"=",
"options",
".",
"className",
"||",
"'inputEx-Group'",
";",
"this",
".",
"options",
".",
"autocomplete",
"=",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"autocomplete",
")",
"?",
"inputEx",
".",
"browserAutocomplete",
":",
"(",
"options",
".",
"autocomplete",
"===",
"false",
"||",
"options",
".",
"autocomplete",
"===",
"\"off\"",
")",
"?",
"false",
":",
"true",
";",
"this",
".",
"options",
".",
"enctype",
"=",
"options",
".",
"enctype",
";",
"if",
"(",
"options",
".",
"ajax",
")",
"{",
"this",
".",
"options",
".",
"ajax",
"=",
"{",
"}",
";",
"this",
".",
"options",
".",
"ajax",
".",
"method",
"=",
"options",
".",
"ajax",
".",
"method",
"||",
"'POST'",
";",
"this",
".",
"options",
".",
"ajax",
".",
"uri",
"=",
"options",
".",
"ajax",
".",
"uri",
"||",
"'default.php'",
";",
"this",
".",
"options",
".",
"ajax",
".",
"callback",
"=",
"options",
".",
"ajax",
".",
"callback",
"||",
"{",
"}",
";",
"this",
".",
"options",
".",
"ajax",
".",
"callback",
".",
"scope",
"=",
"options",
".",
"ajax",
".",
"callback",
".",
"scope",
"||",
"this",
";",
"this",
".",
"options",
".",
"ajax",
".",
"showMask",
"=",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"ajax",
".",
"showMask",
")",
"?",
"false",
":",
"options",
".",
"ajax",
".",
"showMask",
";",
"this",
".",
"options",
".",
"ajax",
".",
"contentType",
"=",
"options",
".",
"ajax",
".",
"contentType",
"||",
"\"application/json\"",
";",
"this",
".",
"options",
".",
"ajax",
".",
"wrapObject",
"=",
"options",
".",
"ajax",
".",
"wrapObject",
";",
"}",
"if",
"(",
"lang",
".",
"isFunction",
"(",
"options",
".",
"onSubmit",
")",
")",
"{",
"this",
".",
"options",
".",
"onSubmit",
"=",
"options",
".",
"onSubmit",
";",
"}",
"}"
]
| Adds buttons and set ajax default parameters
@param {Object} options Options object as passed to the constructor | [
"Adds",
"buttons",
"and",
"set",
"ajax",
"default",
"parameters"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L2255-L2287 |
|
42,656 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
var buttonConf, button, i, buttonsNb = this.options.buttons.length;
this.buttonDiv = inputEx.cn('div', {className: 'inputEx-Form-buttonBar'});
for(i = 0 ; i < buttonsNb ; i++ ) {
buttonConf = this.options.buttons[i];
// Throw Error if button is undefined
if(!buttonConf) {
throw new Error("inputEx.Form: One of the provided button is undefined ! (check trailing comma)");
}
button = new inputEx.widget.Button(buttonConf);
button.render(this.buttonDiv);
this.buttons.push(button);
}
// useful for link buttons re-styling (float required on <a>'s ... )
this.buttonDiv.appendChild(inputEx.cn('div',null,{clear:'both'}));
this.form.appendChild(this.buttonDiv);
} | javascript | function() {
var buttonConf, button, i, buttonsNb = this.options.buttons.length;
this.buttonDiv = inputEx.cn('div', {className: 'inputEx-Form-buttonBar'});
for(i = 0 ; i < buttonsNb ; i++ ) {
buttonConf = this.options.buttons[i];
// Throw Error if button is undefined
if(!buttonConf) {
throw new Error("inputEx.Form: One of the provided button is undefined ! (check trailing comma)");
}
button = new inputEx.widget.Button(buttonConf);
button.render(this.buttonDiv);
this.buttons.push(button);
}
// useful for link buttons re-styling (float required on <a>'s ... )
this.buttonDiv.appendChild(inputEx.cn('div',null,{clear:'both'}));
this.form.appendChild(this.buttonDiv);
} | [
"function",
"(",
")",
"{",
"var",
"buttonConf",
",",
"button",
",",
"i",
",",
"buttonsNb",
"=",
"this",
".",
"options",
".",
"buttons",
".",
"length",
";",
"this",
".",
"buttonDiv",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"'inputEx-Form-buttonBar'",
"}",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"buttonsNb",
";",
"i",
"++",
")",
"{",
"buttonConf",
"=",
"this",
".",
"options",
".",
"buttons",
"[",
"i",
"]",
";",
"// Throw Error if button is undefined",
"if",
"(",
"!",
"buttonConf",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"inputEx.Form: One of the provided button is undefined ! (check trailing comma)\"",
")",
";",
"}",
"button",
"=",
"new",
"inputEx",
".",
"widget",
".",
"Button",
"(",
"buttonConf",
")",
";",
"button",
".",
"render",
"(",
"this",
".",
"buttonDiv",
")",
";",
"this",
".",
"buttons",
".",
"push",
"(",
"button",
")",
";",
"}",
"// useful for link buttons re-styling (float required on <a>'s ... )",
"this",
".",
"buttonDiv",
".",
"appendChild",
"(",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"null",
",",
"{",
"clear",
":",
"'both'",
"}",
")",
")",
";",
"this",
".",
"form",
".",
"appendChild",
"(",
"this",
".",
"buttonDiv",
")",
";",
"}"
]
| Render the buttons | [
"Render",
"the",
"buttons"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L2328-L2353 |
|
42,657 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
if(this.options.ajax.showMask) { this.showMask(); }
var formValue = this.getValue();
// options.ajax.uri and options.ajax.method can also be functions that return a the uri/method depending of the value of the form
var uri = lang.isFunction(this.options.ajax.uri) ? this.options.ajax.uri(formValue) : this.options.ajax.uri;
var method = lang.isFunction(this.options.ajax.method) ? this.options.ajax.method(formValue) : this.options.ajax.method;
var postData = null;
// Classic application/x-www-form-urlencoded (like html forms)
if(this.options.ajax.contentType == "application/x-www-form-urlencoded" && method != "PUT") {
var params = [];
for(var key in formValue) {
if(formValue.hasOwnProperty(key)) {
var pName = (this.options.ajax.wrapObject ? this.options.ajax.wrapObject+'[' : '')+key+(this.options.ajax.wrapObject ? ']' : '');
params.push( pName+"="+window.encodeURIComponent(formValue[key]));
}
}
postData = params.join('&');
}
// The only other contentType available is "application/json"
else {
YAHOO.util.Connect.initHeader("Content-Type" , "application/json" , false);
// method PUT don't send as x-www-form-urlencoded but in JSON
if(method == "PUT") {
var formVal = this.getValue();
var p;
if(this.options.ajax.wrapObject) {
p = {};
p[this.options.ajax.wrapObject] = formVal;
}
else {
p = formVal;
}
postData = lang.JSON.stringify(p);
}
else {
// We keep this case for backward compatibility, but should not be used
// Used when we send in JSON in POST or GET
postData = "value="+window.encodeURIComponent(lang.JSON.stringify(this.getValue()));
}
}
util.Connect.asyncRequest( method, uri, {
success: function(o) {
if(this.options.ajax.showMask) { this.hideMask(); }
if( lang.isFunction(this.options.ajax.callback.success) ) {
this.options.ajax.callback.success.call(this.options.ajax.callback.scope,o);
}
},
failure: function(o) {
if(this.options.ajax.showMask) { this.hideMask(); }
if( lang.isFunction(this.options.ajax.callback.failure) ) {
this.options.ajax.callback.failure.call(this.options.ajax.callback.scope,o);
}
},
scope:this
}, postData);
} | javascript | function() {
if(this.options.ajax.showMask) { this.showMask(); }
var formValue = this.getValue();
// options.ajax.uri and options.ajax.method can also be functions that return a the uri/method depending of the value of the form
var uri = lang.isFunction(this.options.ajax.uri) ? this.options.ajax.uri(formValue) : this.options.ajax.uri;
var method = lang.isFunction(this.options.ajax.method) ? this.options.ajax.method(formValue) : this.options.ajax.method;
var postData = null;
// Classic application/x-www-form-urlencoded (like html forms)
if(this.options.ajax.contentType == "application/x-www-form-urlencoded" && method != "PUT") {
var params = [];
for(var key in formValue) {
if(formValue.hasOwnProperty(key)) {
var pName = (this.options.ajax.wrapObject ? this.options.ajax.wrapObject+'[' : '')+key+(this.options.ajax.wrapObject ? ']' : '');
params.push( pName+"="+window.encodeURIComponent(formValue[key]));
}
}
postData = params.join('&');
}
// The only other contentType available is "application/json"
else {
YAHOO.util.Connect.initHeader("Content-Type" , "application/json" , false);
// method PUT don't send as x-www-form-urlencoded but in JSON
if(method == "PUT") {
var formVal = this.getValue();
var p;
if(this.options.ajax.wrapObject) {
p = {};
p[this.options.ajax.wrapObject] = formVal;
}
else {
p = formVal;
}
postData = lang.JSON.stringify(p);
}
else {
// We keep this case for backward compatibility, but should not be used
// Used when we send in JSON in POST or GET
postData = "value="+window.encodeURIComponent(lang.JSON.stringify(this.getValue()));
}
}
util.Connect.asyncRequest( method, uri, {
success: function(o) {
if(this.options.ajax.showMask) { this.hideMask(); }
if( lang.isFunction(this.options.ajax.callback.success) ) {
this.options.ajax.callback.success.call(this.options.ajax.callback.scope,o);
}
},
failure: function(o) {
if(this.options.ajax.showMask) { this.hideMask(); }
if( lang.isFunction(this.options.ajax.callback.failure) ) {
this.options.ajax.callback.failure.call(this.options.ajax.callback.scope,o);
}
},
scope:this
}, postData);
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"options",
".",
"ajax",
".",
"showMask",
")",
"{",
"this",
".",
"showMask",
"(",
")",
";",
"}",
"var",
"formValue",
"=",
"this",
".",
"getValue",
"(",
")",
";",
"// options.ajax.uri and options.ajax.method can also be functions that return a the uri/method depending of the value of the form",
"var",
"uri",
"=",
"lang",
".",
"isFunction",
"(",
"this",
".",
"options",
".",
"ajax",
".",
"uri",
")",
"?",
"this",
".",
"options",
".",
"ajax",
".",
"uri",
"(",
"formValue",
")",
":",
"this",
".",
"options",
".",
"ajax",
".",
"uri",
";",
"var",
"method",
"=",
"lang",
".",
"isFunction",
"(",
"this",
".",
"options",
".",
"ajax",
".",
"method",
")",
"?",
"this",
".",
"options",
".",
"ajax",
".",
"method",
"(",
"formValue",
")",
":",
"this",
".",
"options",
".",
"ajax",
".",
"method",
";",
"var",
"postData",
"=",
"null",
";",
"// Classic application/x-www-form-urlencoded (like html forms)",
"if",
"(",
"this",
".",
"options",
".",
"ajax",
".",
"contentType",
"==",
"\"application/x-www-form-urlencoded\"",
"&&",
"method",
"!=",
"\"PUT\"",
")",
"{",
"var",
"params",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"key",
"in",
"formValue",
")",
"{",
"if",
"(",
"formValue",
".",
"hasOwnProperty",
"(",
"key",
")",
")",
"{",
"var",
"pName",
"=",
"(",
"this",
".",
"options",
".",
"ajax",
".",
"wrapObject",
"?",
"this",
".",
"options",
".",
"ajax",
".",
"wrapObject",
"+",
"'['",
":",
"''",
")",
"+",
"key",
"+",
"(",
"this",
".",
"options",
".",
"ajax",
".",
"wrapObject",
"?",
"']'",
":",
"''",
")",
";",
"params",
".",
"push",
"(",
"pName",
"+",
"\"=\"",
"+",
"window",
".",
"encodeURIComponent",
"(",
"formValue",
"[",
"key",
"]",
")",
")",
";",
"}",
"}",
"postData",
"=",
"params",
".",
"join",
"(",
"'&'",
")",
";",
"}",
"// The only other contentType available is \"application/json\"",
"else",
"{",
"YAHOO",
".",
"util",
".",
"Connect",
".",
"initHeader",
"(",
"\"Content-Type\"",
",",
"\"application/json\"",
",",
"false",
")",
";",
"// method PUT don't send as x-www-form-urlencoded but in JSON",
"if",
"(",
"method",
"==",
"\"PUT\"",
")",
"{",
"var",
"formVal",
"=",
"this",
".",
"getValue",
"(",
")",
";",
"var",
"p",
";",
"if",
"(",
"this",
".",
"options",
".",
"ajax",
".",
"wrapObject",
")",
"{",
"p",
"=",
"{",
"}",
";",
"p",
"[",
"this",
".",
"options",
".",
"ajax",
".",
"wrapObject",
"]",
"=",
"formVal",
";",
"}",
"else",
"{",
"p",
"=",
"formVal",
";",
"}",
"postData",
"=",
"lang",
".",
"JSON",
".",
"stringify",
"(",
"p",
")",
";",
"}",
"else",
"{",
"// We keep this case for backward compatibility, but should not be used",
"// Used when we send in JSON in POST or GET",
"postData",
"=",
"\"value=\"",
"+",
"window",
".",
"encodeURIComponent",
"(",
"lang",
".",
"JSON",
".",
"stringify",
"(",
"this",
".",
"getValue",
"(",
")",
")",
")",
";",
"}",
"}",
"util",
".",
"Connect",
".",
"asyncRequest",
"(",
"method",
",",
"uri",
",",
"{",
"success",
":",
"function",
"(",
"o",
")",
"{",
"if",
"(",
"this",
".",
"options",
".",
"ajax",
".",
"showMask",
")",
"{",
"this",
".",
"hideMask",
"(",
")",
";",
"}",
"if",
"(",
"lang",
".",
"isFunction",
"(",
"this",
".",
"options",
".",
"ajax",
".",
"callback",
".",
"success",
")",
")",
"{",
"this",
".",
"options",
".",
"ajax",
".",
"callback",
".",
"success",
".",
"call",
"(",
"this",
".",
"options",
".",
"ajax",
".",
"callback",
".",
"scope",
",",
"o",
")",
";",
"}",
"}",
",",
"failure",
":",
"function",
"(",
"o",
")",
"{",
"if",
"(",
"this",
".",
"options",
".",
"ajax",
".",
"showMask",
")",
"{",
"this",
".",
"hideMask",
"(",
")",
";",
"}",
"if",
"(",
"lang",
".",
"isFunction",
"(",
"this",
".",
"options",
".",
"ajax",
".",
"callback",
".",
"failure",
")",
")",
"{",
"this",
".",
"options",
".",
"ajax",
".",
"callback",
".",
"failure",
".",
"call",
"(",
"this",
".",
"options",
".",
"ajax",
".",
"callback",
".",
"scope",
",",
"o",
")",
";",
"}",
"}",
",",
"scope",
":",
"this",
"}",
",",
"postData",
")",
";",
"}"
]
| Send the form value in JSON through an ajax request | [
"Send",
"the",
"form",
"value",
"in",
"JSON",
"through",
"an",
"ajax",
"request"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L2425-L2489 |
|
42,658 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
if(this.maskRendered) return;
// position as "relative" to position formMask inside as "absolute"
Dom.setStyle(this.divEl, "position", "relative");
// set zoom = 1 to fix hasLayout issue with IE6/7
if (YAHOO.env.ua.ie) { Dom.setStyle(this.divEl, "zoom", 1); }
// Render mask over the divEl
this.formMask = inputEx.cn('div', {className: 'inputEx-Form-Mask'},
{
display: 'none',
// Use offsetWidth instead of Dom.getStyle(this.divEl,"width") because
// would return "auto" with IE instead of size in px
width: this.divEl.offsetWidth+"px",
height: this.divEl.offsetHeight+"px"
},
"<div class='inputEx-Form-Mask-bg'/><center><br/><div class='inputEx-Form-Mask-spinner'></div><br /><span>"+inputEx.messages.ajaxWait+"</span></div>");
this.divEl.appendChild(this.formMask);
this.maskRendered = true;
} | javascript | function() {
if(this.maskRendered) return;
// position as "relative" to position formMask inside as "absolute"
Dom.setStyle(this.divEl, "position", "relative");
// set zoom = 1 to fix hasLayout issue with IE6/7
if (YAHOO.env.ua.ie) { Dom.setStyle(this.divEl, "zoom", 1); }
// Render mask over the divEl
this.formMask = inputEx.cn('div', {className: 'inputEx-Form-Mask'},
{
display: 'none',
// Use offsetWidth instead of Dom.getStyle(this.divEl,"width") because
// would return "auto" with IE instead of size in px
width: this.divEl.offsetWidth+"px",
height: this.divEl.offsetHeight+"px"
},
"<div class='inputEx-Form-Mask-bg'/><center><br/><div class='inputEx-Form-Mask-spinner'></div><br /><span>"+inputEx.messages.ajaxWait+"</span></div>");
this.divEl.appendChild(this.formMask);
this.maskRendered = true;
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"maskRendered",
")",
"return",
";",
"// position as \"relative\" to position formMask inside as \"absolute\"",
"Dom",
".",
"setStyle",
"(",
"this",
".",
"divEl",
",",
"\"position\"",
",",
"\"relative\"",
")",
";",
"// set zoom = 1 to fix hasLayout issue with IE6/7",
"if",
"(",
"YAHOO",
".",
"env",
".",
"ua",
".",
"ie",
")",
"{",
"Dom",
".",
"setStyle",
"(",
"this",
".",
"divEl",
",",
"\"zoom\"",
",",
"1",
")",
";",
"}",
"// Render mask over the divEl",
"this",
".",
"formMask",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"'inputEx-Form-Mask'",
"}",
",",
"{",
"display",
":",
"'none'",
",",
"// Use offsetWidth instead of Dom.getStyle(this.divEl,\"width\") because",
"// would return \"auto\" with IE instead of size in px",
"width",
":",
"this",
".",
"divEl",
".",
"offsetWidth",
"+",
"\"px\"",
",",
"height",
":",
"this",
".",
"divEl",
".",
"offsetHeight",
"+",
"\"px\"",
"}",
",",
"\"<div class='inputEx-Form-Mask-bg'/><center><br/><div class='inputEx-Form-Mask-spinner'></div><br /><span>\"",
"+",
"inputEx",
".",
"messages",
".",
"ajaxWait",
"+",
"\"</span></div>\"",
")",
";",
"this",
".",
"divEl",
".",
"appendChild",
"(",
"this",
".",
"formMask",
")",
";",
"this",
".",
"maskRendered",
"=",
"true",
";",
"}"
]
| Create a Mask over the form | [
"Create",
"a",
"Mask",
"over",
"the",
"form"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L2494-L2515 |
|
42,659 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
inputEx.Form.superclass.enable.call(this);
for (var i = 0 ; i < this.buttons.length ; i++) {
this.buttons[i].enable();
}
} | javascript | function() {
inputEx.Form.superclass.enable.call(this);
for (var i = 0 ; i < this.buttons.length ; i++) {
this.buttons[i].enable();
}
} | [
"function",
"(",
")",
"{",
"inputEx",
".",
"Form",
".",
"superclass",
".",
"enable",
".",
"call",
"(",
"this",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"buttons",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"buttons",
"[",
"i",
"]",
".",
"enable",
"(",
")",
";",
"}",
"}"
]
| Enable all fields and buttons in the form | [
"Enable",
"all",
"fields",
"and",
"buttons",
"in",
"the",
"form"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L2561-L2567 |
|
42,660 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
inputEx.Form.superclass.disable.call(this);
for (var i = 0 ; i < this.buttons.length ; i++) {
this.buttons[i].disable();
}
} | javascript | function() {
inputEx.Form.superclass.disable.call(this);
for (var i = 0 ; i < this.buttons.length ; i++) {
this.buttons[i].disable();
}
} | [
"function",
"(",
")",
"{",
"inputEx",
".",
"Form",
".",
"superclass",
".",
"disable",
".",
"call",
"(",
"this",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"buttons",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"buttons",
"[",
"i",
"]",
".",
"disable",
"(",
")",
";",
"}",
"}"
]
| Disable all fields and buttons in the form | [
"Disable",
"all",
"fields",
"and",
"buttons",
"in",
"the",
"form"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L2572-L2578 |
|
42,661 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(parentEl) {
this.appendSeparator(0);
if(!this.options.fields) {return;}
var i, n=this.options.fields.length, f, field, fieldEl,t;
for(i = 0 ; i < n ; i++) {
f = this.options.fields[i];
if (this.options.required) {f.required = true;}
field = this.renderField(f);
fieldEl = field.getEl();
t = f.type;
if(t != "group" && t != "form") {
// remove the line breaker (<div style='clear: both;'>)
field.divEl.removeChild(fieldEl.childNodes[fieldEl.childNodes.length-1]);
}
// make the field float left
Dom.setStyle(fieldEl, 'float', 'left');
this.divEl.appendChild(fieldEl);
this.appendSeparator(i+1);
}
this.setFieldName(this.options.name);
} | javascript | function(parentEl) {
this.appendSeparator(0);
if(!this.options.fields) {return;}
var i, n=this.options.fields.length, f, field, fieldEl,t;
for(i = 0 ; i < n ; i++) {
f = this.options.fields[i];
if (this.options.required) {f.required = true;}
field = this.renderField(f);
fieldEl = field.getEl();
t = f.type;
if(t != "group" && t != "form") {
// remove the line breaker (<div style='clear: both;'>)
field.divEl.removeChild(fieldEl.childNodes[fieldEl.childNodes.length-1]);
}
// make the field float left
Dom.setStyle(fieldEl, 'float', 'left');
this.divEl.appendChild(fieldEl);
this.appendSeparator(i+1);
}
this.setFieldName(this.options.name);
} | [
"function",
"(",
"parentEl",
")",
"{",
"this",
".",
"appendSeparator",
"(",
"0",
")",
";",
"if",
"(",
"!",
"this",
".",
"options",
".",
"fields",
")",
"{",
"return",
";",
"}",
"var",
"i",
",",
"n",
"=",
"this",
".",
"options",
".",
"fields",
".",
"length",
",",
"f",
",",
"field",
",",
"fieldEl",
",",
"t",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"n",
";",
"i",
"++",
")",
"{",
"f",
"=",
"this",
".",
"options",
".",
"fields",
"[",
"i",
"]",
";",
"if",
"(",
"this",
".",
"options",
".",
"required",
")",
"{",
"f",
".",
"required",
"=",
"true",
";",
"}",
"field",
"=",
"this",
".",
"renderField",
"(",
"f",
")",
";",
"fieldEl",
"=",
"field",
".",
"getEl",
"(",
")",
";",
"t",
"=",
"f",
".",
"type",
";",
"if",
"(",
"t",
"!=",
"\"group\"",
"&&",
"t",
"!=",
"\"form\"",
")",
"{",
"// remove the line breaker (<div style='clear: both;'>)",
"field",
".",
"divEl",
".",
"removeChild",
"(",
"fieldEl",
".",
"childNodes",
"[",
"fieldEl",
".",
"childNodes",
".",
"length",
"-",
"1",
"]",
")",
";",
"}",
"// make the field float left",
"Dom",
".",
"setStyle",
"(",
"fieldEl",
",",
"'float'",
",",
"'left'",
")",
";",
"this",
".",
"divEl",
".",
"appendChild",
"(",
"fieldEl",
")",
";",
"this",
".",
"appendSeparator",
"(",
"i",
"+",
"1",
")",
";",
"}",
"this",
".",
"setFieldName",
"(",
"this",
".",
"options",
".",
"name",
")",
";",
"}"
]
| Render the subfields | [
"Render",
"the",
"subfields"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L2689-L2718 |
|
42,662 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(fieldOptions) {
// Subfields should inherit required property
if (this.options.required) {
fieldOptions.required = true;
}
return inputEx.CombineField.superclass.renderField.call(this, fieldOptions);
} | javascript | function(fieldOptions) {
// Subfields should inherit required property
if (this.options.required) {
fieldOptions.required = true;
}
return inputEx.CombineField.superclass.renderField.call(this, fieldOptions);
} | [
"function",
"(",
"fieldOptions",
")",
"{",
"// Subfields should inherit required property",
"if",
"(",
"this",
".",
"options",
".",
"required",
")",
"{",
"fieldOptions",
".",
"required",
"=",
"true",
";",
"}",
"return",
"inputEx",
".",
"CombineField",
".",
"superclass",
".",
"renderField",
".",
"call",
"(",
"this",
",",
"fieldOptions",
")",
";",
"}"
]
| Override to force required option on each subfield
@param {Object} fieldOptions The field properties as required by inputEx() | [
"Override",
"to",
"force",
"required",
"option",
"on",
"each",
"subfield"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L2724-L2732 |
|
42,663 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(i) {
if(this.options.separators && this.options.separators[i]) {
var sep = inputEx.cn('div', {className: 'inputEx-CombineField-separator'}, null, this.options.separators[i]);
this.divEl.appendChild(sep);
}
} | javascript | function(i) {
if(this.options.separators && this.options.separators[i]) {
var sep = inputEx.cn('div', {className: 'inputEx-CombineField-separator'}, null, this.options.separators[i]);
this.divEl.appendChild(sep);
}
} | [
"function",
"(",
"i",
")",
"{",
"if",
"(",
"this",
".",
"options",
".",
"separators",
"&&",
"this",
".",
"options",
".",
"separators",
"[",
"i",
"]",
")",
"{",
"var",
"sep",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"'inputEx-CombineField-separator'",
"}",
",",
"null",
",",
"this",
".",
"options",
".",
"separators",
"[",
"i",
"]",
")",
";",
"this",
".",
"divEl",
".",
"appendChild",
"(",
"sep",
")",
";",
"}",
"}"
]
| Add a separator to the divEl | [
"Add",
"a",
"separator",
"to",
"the",
"divEl"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L2753-L2758 |
|
42,664 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(options) {
inputEx.AutoComplete.superclass.setOptions.call(this, options);
// Overwrite options
this.options.className = options.className ? options.className : 'inputEx-Field inputEx-AutoComplete';
// Added options
this.options.datasource = options.datasource;
this.options.autoComp = options.autoComp;
this.options.returnValue = options.returnValue;
this.options.generateRequest = options.generateRequest;
this.options.datasourceParameters = options.datasourceParameters;
} | javascript | function(options) {
inputEx.AutoComplete.superclass.setOptions.call(this, options);
// Overwrite options
this.options.className = options.className ? options.className : 'inputEx-Field inputEx-AutoComplete';
// Added options
this.options.datasource = options.datasource;
this.options.autoComp = options.autoComp;
this.options.returnValue = options.returnValue;
this.options.generateRequest = options.generateRequest;
this.options.datasourceParameters = options.datasourceParameters;
} | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"AutoComplete",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"// Overwrite options",
"this",
".",
"options",
".",
"className",
"=",
"options",
".",
"className",
"?",
"options",
".",
"className",
":",
"'inputEx-Field inputEx-AutoComplete'",
";",
"// Added options",
"this",
".",
"options",
".",
"datasource",
"=",
"options",
".",
"datasource",
";",
"this",
".",
"options",
".",
"autoComp",
"=",
"options",
".",
"autoComp",
";",
"this",
".",
"options",
".",
"returnValue",
"=",
"options",
".",
"returnValue",
";",
"this",
".",
"options",
".",
"generateRequest",
"=",
"options",
".",
"generateRequest",
";",
"this",
".",
"options",
".",
"datasourceParameters",
"=",
"options",
".",
"datasourceParameters",
";",
"}"
]
| Adds autocomplete options
@param {Object} options Options object as passed to the constructor | [
"Adds",
"autocomplete",
"options"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L3134-L3146 |
|
42,665 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
// This element wraps the input node in a float: none div
this.wrapEl = inputEx.cn('div', {className: 'inputEx-StringField-wrapper'});
// Attributes of the input field
var attributes = {
type: 'text',
id: YAHOO.util.Dom.generateId()
};
if(this.options.size) attributes.size = this.options.size;
if(this.options.readonly) attributes.readonly = 'readonly';
if(this.options.maxLength) attributes.maxLength = this.options.maxLength;
// Create the node
this.el = inputEx.cn('input', attributes);
// Create the hidden input
var hiddenAttrs = {
type: 'hidden',
value: ''
};
if(this.options.name) hiddenAttrs.name = this.options.name;
this.hiddenEl = inputEx.cn('input', hiddenAttrs);
// Append it to the main element
this.wrapEl.appendChild(this.el);
this.wrapEl.appendChild(this.hiddenEl);
this.fieldContainer.appendChild(this.wrapEl);
// Render the list :
this.listEl = inputEx.cn('div', {id: Dom.generateId() });
this.fieldContainer.appendChild(this.listEl);
Event.onAvailable([this.el, this.listEl], this.buildAutocomplete, this, true);
} | javascript | function() {
// This element wraps the input node in a float: none div
this.wrapEl = inputEx.cn('div', {className: 'inputEx-StringField-wrapper'});
// Attributes of the input field
var attributes = {
type: 'text',
id: YAHOO.util.Dom.generateId()
};
if(this.options.size) attributes.size = this.options.size;
if(this.options.readonly) attributes.readonly = 'readonly';
if(this.options.maxLength) attributes.maxLength = this.options.maxLength;
// Create the node
this.el = inputEx.cn('input', attributes);
// Create the hidden input
var hiddenAttrs = {
type: 'hidden',
value: ''
};
if(this.options.name) hiddenAttrs.name = this.options.name;
this.hiddenEl = inputEx.cn('input', hiddenAttrs);
// Append it to the main element
this.wrapEl.appendChild(this.el);
this.wrapEl.appendChild(this.hiddenEl);
this.fieldContainer.appendChild(this.wrapEl);
// Render the list :
this.listEl = inputEx.cn('div', {id: Dom.generateId() });
this.fieldContainer.appendChild(this.listEl);
Event.onAvailable([this.el, this.listEl], this.buildAutocomplete, this, true);
} | [
"function",
"(",
")",
"{",
"// This element wraps the input node in a float: none div",
"this",
".",
"wrapEl",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"'inputEx-StringField-wrapper'",
"}",
")",
";",
"// Attributes of the input field",
"var",
"attributes",
"=",
"{",
"type",
":",
"'text'",
",",
"id",
":",
"YAHOO",
".",
"util",
".",
"Dom",
".",
"generateId",
"(",
")",
"}",
";",
"if",
"(",
"this",
".",
"options",
".",
"size",
")",
"attributes",
".",
"size",
"=",
"this",
".",
"options",
".",
"size",
";",
"if",
"(",
"this",
".",
"options",
".",
"readonly",
")",
"attributes",
".",
"readonly",
"=",
"'readonly'",
";",
"if",
"(",
"this",
".",
"options",
".",
"maxLength",
")",
"attributes",
".",
"maxLength",
"=",
"this",
".",
"options",
".",
"maxLength",
";",
"// Create the node",
"this",
".",
"el",
"=",
"inputEx",
".",
"cn",
"(",
"'input'",
",",
"attributes",
")",
";",
"// Create the hidden input",
"var",
"hiddenAttrs",
"=",
"{",
"type",
":",
"'hidden'",
",",
"value",
":",
"''",
"}",
";",
"if",
"(",
"this",
".",
"options",
".",
"name",
")",
"hiddenAttrs",
".",
"name",
"=",
"this",
".",
"options",
".",
"name",
";",
"this",
".",
"hiddenEl",
"=",
"inputEx",
".",
"cn",
"(",
"'input'",
",",
"hiddenAttrs",
")",
";",
"// Append it to the main element",
"this",
".",
"wrapEl",
".",
"appendChild",
"(",
"this",
".",
"el",
")",
";",
"this",
".",
"wrapEl",
".",
"appendChild",
"(",
"this",
".",
"hiddenEl",
")",
";",
"this",
".",
"fieldContainer",
".",
"appendChild",
"(",
"this",
".",
"wrapEl",
")",
";",
"// Render the list :",
"this",
".",
"listEl",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"id",
":",
"Dom",
".",
"generateId",
"(",
")",
"}",
")",
";",
"this",
".",
"fieldContainer",
".",
"appendChild",
"(",
"this",
".",
"listEl",
")",
";",
"Event",
".",
"onAvailable",
"(",
"[",
"this",
".",
"el",
",",
"this",
".",
"listEl",
"]",
",",
"this",
".",
"buildAutocomplete",
",",
"this",
",",
"true",
")",
";",
"}"
]
| Render the hidden list element | [
"Render",
"the",
"hidden",
"list",
"element"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L3164-L3199 |
|
42,666 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
// Call this function only when this.el AND this.listEl are available
if(!this._nElementsReady) { this._nElementsReady = 0; }
this._nElementsReady++;
if(this._nElementsReady != 2) return;
if(!lang.isUndefined(this.options.datasourceParameters))
{
for (param in this.options.datasourceParameters)
{
this.options.datasource[param] = this.options.datasourceParameters[param];
}
}
// Instantiate AutoComplete
this.oAutoComp = new YAHOO.widget.AutoComplete(this.el.id, this.listEl.id, this.options.datasource, this.options.autoComp);
if(!lang.isUndefined(this.options.generateRequest))
{
this.oAutoComp.generateRequest = this.options.generateRequest;
}
// subscribe to the itemSelect event
this.oAutoComp.itemSelectEvent.subscribe(this.itemSelectHandler, this, true);
// subscribe to the textboxBlur event (instead of "blur" event on this.el)
// |-------------- autocompleter ----------|
// -> order : "blur" on this.el -> internal callback -> textboxBlur event -> this.onBlur callback
// -> so fired after autocomp internal "blur" callback (which would erase typeInvite...)
this.oAutoComp.textboxBlurEvent.subscribe(this.onBlur, this, true);
} | javascript | function() {
// Call this function only when this.el AND this.listEl are available
if(!this._nElementsReady) { this._nElementsReady = 0; }
this._nElementsReady++;
if(this._nElementsReady != 2) return;
if(!lang.isUndefined(this.options.datasourceParameters))
{
for (param in this.options.datasourceParameters)
{
this.options.datasource[param] = this.options.datasourceParameters[param];
}
}
// Instantiate AutoComplete
this.oAutoComp = new YAHOO.widget.AutoComplete(this.el.id, this.listEl.id, this.options.datasource, this.options.autoComp);
if(!lang.isUndefined(this.options.generateRequest))
{
this.oAutoComp.generateRequest = this.options.generateRequest;
}
// subscribe to the itemSelect event
this.oAutoComp.itemSelectEvent.subscribe(this.itemSelectHandler, this, true);
// subscribe to the textboxBlur event (instead of "blur" event on this.el)
// |-------------- autocompleter ----------|
// -> order : "blur" on this.el -> internal callback -> textboxBlur event -> this.onBlur callback
// -> so fired after autocomp internal "blur" callback (which would erase typeInvite...)
this.oAutoComp.textboxBlurEvent.subscribe(this.onBlur, this, true);
} | [
"function",
"(",
")",
"{",
"// Call this function only when this.el AND this.listEl are available",
"if",
"(",
"!",
"this",
".",
"_nElementsReady",
")",
"{",
"this",
".",
"_nElementsReady",
"=",
"0",
";",
"}",
"this",
".",
"_nElementsReady",
"++",
";",
"if",
"(",
"this",
".",
"_nElementsReady",
"!=",
"2",
")",
"return",
";",
"if",
"(",
"!",
"lang",
".",
"isUndefined",
"(",
"this",
".",
"options",
".",
"datasourceParameters",
")",
")",
"{",
"for",
"(",
"param",
"in",
"this",
".",
"options",
".",
"datasourceParameters",
")",
"{",
"this",
".",
"options",
".",
"datasource",
"[",
"param",
"]",
"=",
"this",
".",
"options",
".",
"datasourceParameters",
"[",
"param",
"]",
";",
"}",
"}",
"// Instantiate AutoComplete",
"this",
".",
"oAutoComp",
"=",
"new",
"YAHOO",
".",
"widget",
".",
"AutoComplete",
"(",
"this",
".",
"el",
".",
"id",
",",
"this",
".",
"listEl",
".",
"id",
",",
"this",
".",
"options",
".",
"datasource",
",",
"this",
".",
"options",
".",
"autoComp",
")",
";",
"if",
"(",
"!",
"lang",
".",
"isUndefined",
"(",
"this",
".",
"options",
".",
"generateRequest",
")",
")",
"{",
"this",
".",
"oAutoComp",
".",
"generateRequest",
"=",
"this",
".",
"options",
".",
"generateRequest",
";",
"}",
"// subscribe to the itemSelect event",
"this",
".",
"oAutoComp",
".",
"itemSelectEvent",
".",
"subscribe",
"(",
"this",
".",
"itemSelectHandler",
",",
"this",
",",
"true",
")",
";",
"// subscribe to the textboxBlur event (instead of \"blur\" event on this.el)",
"// |-------------- autocompleter ----------|",
"// -> order : \"blur\" on this.el -> internal callback -> textboxBlur event -> this.onBlur callback",
"// -> so fired after autocomp internal \"blur\" callback (which would erase typeInvite...)",
"this",
".",
"oAutoComp",
".",
"textboxBlurEvent",
".",
"subscribe",
"(",
"this",
".",
"onBlur",
",",
"this",
",",
"true",
")",
";",
"}"
]
| Build the YUI autocompleter | [
"Build",
"the",
"YUI",
"autocompleter"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L3204-L3233 |
|
42,667 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(e) {
this.setClassFromState();
// Clear the field when no value
if (this.hiddenEl.value != this.el.value) this.hiddenEl.value = this.el.value;
lang.later(50, this, function() {
if(this.el.value == "") {
this.setValue("");
}
});
} | javascript | function(e) {
this.setClassFromState();
// Clear the field when no value
if (this.hiddenEl.value != this.el.value) this.hiddenEl.value = this.el.value;
lang.later(50, this, function() {
if(this.el.value == "") {
this.setValue("");
}
});
} | [
"function",
"(",
"e",
")",
"{",
"this",
".",
"setClassFromState",
"(",
")",
";",
"// Clear the field when no value ",
"if",
"(",
"this",
".",
"hiddenEl",
".",
"value",
"!=",
"this",
".",
"el",
".",
"value",
")",
"this",
".",
"hiddenEl",
".",
"value",
"=",
"this",
".",
"el",
".",
"value",
";",
"lang",
".",
"later",
"(",
"50",
",",
"this",
",",
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"el",
".",
"value",
"==",
"\"\"",
")",
"{",
"this",
".",
"setValue",
"(",
"\"\"",
")",
";",
"}",
"}",
")",
";",
"}"
]
| onChange event handler
@param {Event} e The original 'change' event | [
"onChange",
"event",
"handler"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L3256-L3265 |
|
42,668 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(options) {
inputEx.ColorField.superclass.setOptions.call(this, options);
// Overwrite options
this.options.className = options.className ? options.className : 'inputEx-Field inputEx-ColorField inputEx-PickerField';
// Added options
this.options.palette = options.palette;
this.options.colors = options.colors;
if (options.ratio) { this.options.ratio = options.ratio;}
if (options.cellPerLine) { this.options.cellPerLine = options.cellPerLine;}
} | javascript | function(options) {
inputEx.ColorField.superclass.setOptions.call(this, options);
// Overwrite options
this.options.className = options.className ? options.className : 'inputEx-Field inputEx-ColorField inputEx-PickerField';
// Added options
this.options.palette = options.palette;
this.options.colors = options.colors;
if (options.ratio) { this.options.ratio = options.ratio;}
if (options.cellPerLine) { this.options.cellPerLine = options.cellPerLine;}
} | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"ColorField",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"// Overwrite options",
"this",
".",
"options",
".",
"className",
"=",
"options",
".",
"className",
"?",
"options",
".",
"className",
":",
"'inputEx-Field inputEx-ColorField inputEx-PickerField'",
";",
"// Added options",
"this",
".",
"options",
".",
"palette",
"=",
"options",
".",
"palette",
";",
"this",
".",
"options",
".",
"colors",
"=",
"options",
".",
"colors",
";",
"if",
"(",
"options",
".",
"ratio",
")",
"{",
"this",
".",
"options",
".",
"ratio",
"=",
"options",
".",
"ratio",
";",
"}",
"if",
"(",
"options",
".",
"cellPerLine",
")",
"{",
"this",
".",
"options",
".",
"cellPerLine",
"=",
"options",
".",
"cellPerLine",
";",
"}",
"}"
]
| Adds the 'inputEx-ColorField' default className
@param {Object} options Options object as passed to the constructor | [
"Adds",
"the",
"inputEx",
"-",
"ColorField",
"default",
"className"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L3486-L3498 |
|
42,669 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
var grid, eventDelegation, square, i;
// remember squares
this.squares = [];
// container
grid = inputEx.cn('div', {className: 'inputEx-ColorField-Grid'});
// Is event delegation available ?
// (YAHOO.util.Event.delegate method is in "event-delegate" YUI-module)
eventDelegation = !lang.isUndefined(Event.delegate);
for(i = 0 ; i < this.length ; i++) {
//var square = inputEx.cn('div', {className: 'inputEx-ColorField-square'},{backgroundColor: this.colors[i], width:this.cellWidth+"px", height:this.cellHeight+"px", margin:this.cellMargin+"px" });
square = inputEx.cn('div', {className: 'inputEx-ColorField-square'},{backgroundColor: this.colors[i] });
grid.appendChild(square);
this.squares.push(square);
// No event delegation available : add a listener on each square
if (!eventDelegation) {
Event.addListener(square, "mousedown", function(e) {
var el = Event.getTarget(e);
this.onColorClick(e,el,grid);
}, this, true );
}
// <br clear='both'/> insertion to end a line
// ( + always after the last colored square)
if (i%this.cellPerLine === this.cellPerLine-1 || i === this.length-1) {
grid.appendChild(inputEx.cn('br',{clear:'both'}));
}
}
// Mousedown event delegation
if (eventDelegation) {
if (!lang.isUndefined(YAHOO.util.Selector)) {
Event.delegate(grid,"mousedown",this.onColorClick,"div.inputEx-ColorField-square",this,true);
} else {
Event.delegate(grid,"mousedown",this.onColorClick,function(el) {
if (el.nodeName === "DIV" && YAHOO.util.Dom.hasClass(el,'inputEx-ColorField-square')) {
return el;
}
},this,true);
}
}
return grid;
} | javascript | function() {
var grid, eventDelegation, square, i;
// remember squares
this.squares = [];
// container
grid = inputEx.cn('div', {className: 'inputEx-ColorField-Grid'});
// Is event delegation available ?
// (YAHOO.util.Event.delegate method is in "event-delegate" YUI-module)
eventDelegation = !lang.isUndefined(Event.delegate);
for(i = 0 ; i < this.length ; i++) {
//var square = inputEx.cn('div', {className: 'inputEx-ColorField-square'},{backgroundColor: this.colors[i], width:this.cellWidth+"px", height:this.cellHeight+"px", margin:this.cellMargin+"px" });
square = inputEx.cn('div', {className: 'inputEx-ColorField-square'},{backgroundColor: this.colors[i] });
grid.appendChild(square);
this.squares.push(square);
// No event delegation available : add a listener on each square
if (!eventDelegation) {
Event.addListener(square, "mousedown", function(e) {
var el = Event.getTarget(e);
this.onColorClick(e,el,grid);
}, this, true );
}
// <br clear='both'/> insertion to end a line
// ( + always after the last colored square)
if (i%this.cellPerLine === this.cellPerLine-1 || i === this.length-1) {
grid.appendChild(inputEx.cn('br',{clear:'both'}));
}
}
// Mousedown event delegation
if (eventDelegation) {
if (!lang.isUndefined(YAHOO.util.Selector)) {
Event.delegate(grid,"mousedown",this.onColorClick,"div.inputEx-ColorField-square",this,true);
} else {
Event.delegate(grid,"mousedown",this.onColorClick,function(el) {
if (el.nodeName === "DIV" && YAHOO.util.Dom.hasClass(el,'inputEx-ColorField-square')) {
return el;
}
},this,true);
}
}
return grid;
} | [
"function",
"(",
")",
"{",
"var",
"grid",
",",
"eventDelegation",
",",
"square",
",",
"i",
";",
"// remember squares",
"this",
".",
"squares",
"=",
"[",
"]",
";",
"// container",
"grid",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"'inputEx-ColorField-Grid'",
"}",
")",
";",
"// Is event delegation available ?",
"// (YAHOO.util.Event.delegate method is in \"event-delegate\" YUI-module)",
"eventDelegation",
"=",
"!",
"lang",
".",
"isUndefined",
"(",
"Event",
".",
"delegate",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"length",
";",
"i",
"++",
")",
"{",
"//var square = inputEx.cn('div', {className: 'inputEx-ColorField-square'},{backgroundColor: this.colors[i], width:this.cellWidth+\"px\", height:this.cellHeight+\"px\", margin:this.cellMargin+\"px\" });",
"square",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"'inputEx-ColorField-square'",
"}",
",",
"{",
"backgroundColor",
":",
"this",
".",
"colors",
"[",
"i",
"]",
"}",
")",
";",
"grid",
".",
"appendChild",
"(",
"square",
")",
";",
"this",
".",
"squares",
".",
"push",
"(",
"square",
")",
";",
"// No event delegation available : add a listener on each square",
"if",
"(",
"!",
"eventDelegation",
")",
"{",
"Event",
".",
"addListener",
"(",
"square",
",",
"\"mousedown\"",
",",
"function",
"(",
"e",
")",
"{",
"var",
"el",
"=",
"Event",
".",
"getTarget",
"(",
"e",
")",
";",
"this",
".",
"onColorClick",
"(",
"e",
",",
"el",
",",
"grid",
")",
";",
"}",
",",
"this",
",",
"true",
")",
";",
"}",
"// <br clear='both'/> insertion to end a line",
"// ( + always after the last colored square)",
"if",
"(",
"i",
"%",
"this",
".",
"cellPerLine",
"===",
"this",
".",
"cellPerLine",
"-",
"1",
"||",
"i",
"===",
"this",
".",
"length",
"-",
"1",
")",
"{",
"grid",
".",
"appendChild",
"(",
"inputEx",
".",
"cn",
"(",
"'br'",
",",
"{",
"clear",
":",
"'both'",
"}",
")",
")",
";",
"}",
"}",
"// Mousedown event delegation",
"if",
"(",
"eventDelegation",
")",
"{",
"if",
"(",
"!",
"lang",
".",
"isUndefined",
"(",
"YAHOO",
".",
"util",
".",
"Selector",
")",
")",
"{",
"Event",
".",
"delegate",
"(",
"grid",
",",
"\"mousedown\"",
",",
"this",
".",
"onColorClick",
",",
"\"div.inputEx-ColorField-square\"",
",",
"this",
",",
"true",
")",
";",
"}",
"else",
"{",
"Event",
".",
"delegate",
"(",
"grid",
",",
"\"mousedown\"",
",",
"this",
".",
"onColorClick",
",",
"function",
"(",
"el",
")",
"{",
"if",
"(",
"el",
".",
"nodeName",
"===",
"\"DIV\"",
"&&",
"YAHOO",
".",
"util",
".",
"Dom",
".",
"hasClass",
"(",
"el",
",",
"'inputEx-ColorField-square'",
")",
")",
"{",
"return",
"el",
";",
"}",
"}",
",",
"this",
",",
"true",
")",
";",
"}",
"}",
"return",
"grid",
";",
"}"
]
| This creates a color grid | [
"This",
"creates",
"a",
"color",
"grid"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L3607-L3663 |
|
42,670 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(e,square,container) {
// Stop the event to prevent a selection
Event.stopEvent(e);
// Overlay closure
this.oOverlay.hide();
// SetValue
var color = Dom.getStyle(square,'background-color');
var hexaColor = inputEx.ColorField.ensureHexa(color);
this.setValue(hexaColor);
} | javascript | function(e,square,container) {
// Stop the event to prevent a selection
Event.stopEvent(e);
// Overlay closure
this.oOverlay.hide();
// SetValue
var color = Dom.getStyle(square,'background-color');
var hexaColor = inputEx.ColorField.ensureHexa(color);
this.setValue(hexaColor);
} | [
"function",
"(",
"e",
",",
"square",
",",
"container",
")",
"{",
"// Stop the event to prevent a selection",
"Event",
".",
"stopEvent",
"(",
"e",
")",
";",
"// Overlay closure",
"this",
".",
"oOverlay",
".",
"hide",
"(",
")",
";",
"// SetValue",
"var",
"color",
"=",
"Dom",
".",
"getStyle",
"(",
"square",
",",
"'background-color'",
")",
";",
"var",
"hexaColor",
"=",
"inputEx",
".",
"ColorField",
".",
"ensureHexa",
"(",
"color",
")",
";",
"this",
".",
"setValue",
"(",
"hexaColor",
")",
";",
"}"
]
| Handle a color selection
@param {Event} e The original click event | [
"Handle",
"a",
"color",
"selection"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L3669-L3682 |
|
42,671 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(options) {
inputEx.DateField.superclass.setOptions.call(this, options);
// Overwrite options
this.options.className = options.className ? options.className : 'inputEx-Field inputEx-DateField';
this.options.messages.invalid = inputEx.messages.invalidDate ? inputEx.messages.invalidDate : "Invalid date, ex: 03/27/2008";
// Added options
this.options.dateFormat = options.dateFormat || inputEx.messages.defaultDateFormat;
this.options.valueFormat = options.valueFormat;
} | javascript | function(options) {
inputEx.DateField.superclass.setOptions.call(this, options);
// Overwrite options
this.options.className = options.className ? options.className : 'inputEx-Field inputEx-DateField';
this.options.messages.invalid = inputEx.messages.invalidDate ? inputEx.messages.invalidDate : "Invalid date, ex: 03/27/2008";
// Added options
this.options.dateFormat = options.dateFormat || inputEx.messages.defaultDateFormat;
this.options.valueFormat = options.valueFormat;
} | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"DateField",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"// Overwrite options",
"this",
".",
"options",
".",
"className",
"=",
"options",
".",
"className",
"?",
"options",
".",
"className",
":",
"'inputEx-Field inputEx-DateField'",
";",
"this",
".",
"options",
".",
"messages",
".",
"invalid",
"=",
"inputEx",
".",
"messages",
".",
"invalidDate",
"?",
"inputEx",
".",
"messages",
".",
"invalidDate",
":",
"\"Invalid date, ex: 03/27/2008\"",
";",
"// Added options",
"this",
".",
"options",
".",
"dateFormat",
"=",
"options",
".",
"dateFormat",
"||",
"inputEx",
".",
"messages",
".",
"defaultDateFormat",
";",
"this",
".",
"options",
".",
"valueFormat",
"=",
"options",
".",
"valueFormat",
";",
"}"
]
| Adds the 'inputEx-DateField' default className
@param {Object} options Options object as passed to the constructor | [
"Adds",
"the",
"inputEx",
"-",
"DateField",
"default",
"className"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L3842-L3852 |
|
42,672 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
var value = this.el.value;
var separator = this.options.dateFormat.match(/[^Ymd ]/g)[0];
var ladate = value.split(separator);
if( ladate.length != 3) { return false; }
if ( isNaN(parseInt(ladate[0],10)) || isNaN(parseInt(ladate[1],10)) || isNaN(parseInt(ladate[2],10))) { return false; }
var formatSplit = this.options.dateFormat.split(separator);
var yearIndex = inputEx.indexOf('Y',formatSplit);
if (ladate[yearIndex].length!=4) { return false; } // Avoid 3-digits years...
var d = parseInt(ladate[ inputEx.indexOf('d',formatSplit) ],10);
var Y = parseInt(ladate[yearIndex],10);
var m = parseInt(ladate[ inputEx.indexOf('m',formatSplit) ],10)-1;
var unedate = new Date(Y,m,d);
var annee = unedate.getFullYear();
return ((unedate.getDate() == d) && (unedate.getMonth() == m) && (annee == Y));
} | javascript | function() {
var value = this.el.value;
var separator = this.options.dateFormat.match(/[^Ymd ]/g)[0];
var ladate = value.split(separator);
if( ladate.length != 3) { return false; }
if ( isNaN(parseInt(ladate[0],10)) || isNaN(parseInt(ladate[1],10)) || isNaN(parseInt(ladate[2],10))) { return false; }
var formatSplit = this.options.dateFormat.split(separator);
var yearIndex = inputEx.indexOf('Y',formatSplit);
if (ladate[yearIndex].length!=4) { return false; } // Avoid 3-digits years...
var d = parseInt(ladate[ inputEx.indexOf('d',formatSplit) ],10);
var Y = parseInt(ladate[yearIndex],10);
var m = parseInt(ladate[ inputEx.indexOf('m',formatSplit) ],10)-1;
var unedate = new Date(Y,m,d);
var annee = unedate.getFullYear();
return ((unedate.getDate() == d) && (unedate.getMonth() == m) && (annee == Y));
} | [
"function",
"(",
")",
"{",
"var",
"value",
"=",
"this",
".",
"el",
".",
"value",
";",
"var",
"separator",
"=",
"this",
".",
"options",
".",
"dateFormat",
".",
"match",
"(",
"/",
"[^Ymd ]",
"/",
"g",
")",
"[",
"0",
"]",
";",
"var",
"ladate",
"=",
"value",
".",
"split",
"(",
"separator",
")",
";",
"if",
"(",
"ladate",
".",
"length",
"!=",
"3",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"isNaN",
"(",
"parseInt",
"(",
"ladate",
"[",
"0",
"]",
",",
"10",
")",
")",
"||",
"isNaN",
"(",
"parseInt",
"(",
"ladate",
"[",
"1",
"]",
",",
"10",
")",
")",
"||",
"isNaN",
"(",
"parseInt",
"(",
"ladate",
"[",
"2",
"]",
",",
"10",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
"var",
"formatSplit",
"=",
"this",
".",
"options",
".",
"dateFormat",
".",
"split",
"(",
"separator",
")",
";",
"var",
"yearIndex",
"=",
"inputEx",
".",
"indexOf",
"(",
"'Y'",
",",
"formatSplit",
")",
";",
"if",
"(",
"ladate",
"[",
"yearIndex",
"]",
".",
"length",
"!=",
"4",
")",
"{",
"return",
"false",
";",
"}",
"// Avoid 3-digits years...",
"var",
"d",
"=",
"parseInt",
"(",
"ladate",
"[",
"inputEx",
".",
"indexOf",
"(",
"'d'",
",",
"formatSplit",
")",
"]",
",",
"10",
")",
";",
"var",
"Y",
"=",
"parseInt",
"(",
"ladate",
"[",
"yearIndex",
"]",
",",
"10",
")",
";",
"var",
"m",
"=",
"parseInt",
"(",
"ladate",
"[",
"inputEx",
".",
"indexOf",
"(",
"'m'",
",",
"formatSplit",
")",
"]",
",",
"10",
")",
"-",
"1",
";",
"var",
"unedate",
"=",
"new",
"Date",
"(",
"Y",
",",
"m",
",",
"d",
")",
";",
"var",
"annee",
"=",
"unedate",
".",
"getFullYear",
"(",
")",
";",
"return",
"(",
"(",
"unedate",
".",
"getDate",
"(",
")",
"==",
"d",
")",
"&&",
"(",
"unedate",
".",
"getMonth",
"(",
")",
"==",
"m",
")",
"&&",
"(",
"annee",
"==",
"Y",
")",
")",
";",
"}"
]
| Specific Date validation depending of the 'format' option | [
"Specific",
"Date",
"validation",
"depending",
"of",
"the",
"format",
"option"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L3857-L3873 |
|
42,673 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(val, sendUpdatedEvt) {
// Don't try to parse a date if there is no date
if( val === '' ) {
inputEx.DateField.superclass.setValue.call(this, '', sendUpdatedEvt);
return;
}
var str = "";
if (val instanceof Date) {
str = inputEx.DateField.formatDate(val, this.options.dateFormat);
}
else if(this.options.valueFormat){
var dateVal = inputEx.DateField.parseWithFormat(val, this.options.valueFormat);
str = inputEx.DateField.formatDate(dateVal, this.options.dateFormat);
}
// else date must match this.options.dateFormat
else {
str = val;
}
inputEx.DateField.superclass.setValue.call(this, str, sendUpdatedEvt);
} | javascript | function(val, sendUpdatedEvt) {
// Don't try to parse a date if there is no date
if( val === '' ) {
inputEx.DateField.superclass.setValue.call(this, '', sendUpdatedEvt);
return;
}
var str = "";
if (val instanceof Date) {
str = inputEx.DateField.formatDate(val, this.options.dateFormat);
}
else if(this.options.valueFormat){
var dateVal = inputEx.DateField.parseWithFormat(val, this.options.valueFormat);
str = inputEx.DateField.formatDate(dateVal, this.options.dateFormat);
}
// else date must match this.options.dateFormat
else {
str = val;
}
inputEx.DateField.superclass.setValue.call(this, str, sendUpdatedEvt);
} | [
"function",
"(",
"val",
",",
"sendUpdatedEvt",
")",
"{",
"// Don't try to parse a date if there is no date",
"if",
"(",
"val",
"===",
"''",
")",
"{",
"inputEx",
".",
"DateField",
".",
"superclass",
".",
"setValue",
".",
"call",
"(",
"this",
",",
"''",
",",
"sendUpdatedEvt",
")",
";",
"return",
";",
"}",
"var",
"str",
"=",
"\"\"",
";",
"if",
"(",
"val",
"instanceof",
"Date",
")",
"{",
"str",
"=",
"inputEx",
".",
"DateField",
".",
"formatDate",
"(",
"val",
",",
"this",
".",
"options",
".",
"dateFormat",
")",
";",
"}",
"else",
"if",
"(",
"this",
".",
"options",
".",
"valueFormat",
")",
"{",
"var",
"dateVal",
"=",
"inputEx",
".",
"DateField",
".",
"parseWithFormat",
"(",
"val",
",",
"this",
".",
"options",
".",
"valueFormat",
")",
";",
"str",
"=",
"inputEx",
".",
"DateField",
".",
"formatDate",
"(",
"dateVal",
",",
"this",
".",
"options",
".",
"dateFormat",
")",
";",
"}",
"// else date must match this.options.dateFormat",
"else",
"{",
"str",
"=",
"val",
";",
"}",
"inputEx",
".",
"DateField",
".",
"superclass",
".",
"setValue",
".",
"call",
"(",
"this",
",",
"str",
",",
"sendUpdatedEvt",
")",
";",
"}"
]
| Format the date according to options.dateFormat
@param {Date} val Date to set
@param {boolean} [sendUpdatedEvt] (optional) Wether this setValue should fire the updatedEvt or not (default is true, pass false to NOT send the event) | [
"Format",
"the",
"date",
"according",
"to",
"options",
".",
"dateFormat"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L3881-L3902 |
|
42,674 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(forceDate) {
// let parent class function check if typeInvite, etc...
var value = inputEx.DateField.superclass.getValue.call(this);
// Hack to validate if field not required and empty
if (value === '') { return '';}
var finalDate = inputEx.DateField.parseWithFormat(value,this.options.dateFormat);
// if valueFormat is specified, we format the string
if(!forceDate && this.options.valueFormat){
return inputEx.DateField.formatDate(finalDate, this.options.valueFormat);
}
return finalDate;
} | javascript | function(forceDate) {
// let parent class function check if typeInvite, etc...
var value = inputEx.DateField.superclass.getValue.call(this);
// Hack to validate if field not required and empty
if (value === '') { return '';}
var finalDate = inputEx.DateField.parseWithFormat(value,this.options.dateFormat);
// if valueFormat is specified, we format the string
if(!forceDate && this.options.valueFormat){
return inputEx.DateField.formatDate(finalDate, this.options.valueFormat);
}
return finalDate;
} | [
"function",
"(",
"forceDate",
")",
"{",
"// let parent class function check if typeInvite, etc...",
"var",
"value",
"=",
"inputEx",
".",
"DateField",
".",
"superclass",
".",
"getValue",
".",
"call",
"(",
"this",
")",
";",
"// Hack to validate if field not required and empty",
"if",
"(",
"value",
"===",
"''",
")",
"{",
"return",
"''",
";",
"}",
"var",
"finalDate",
"=",
"inputEx",
".",
"DateField",
".",
"parseWithFormat",
"(",
"value",
",",
"this",
".",
"options",
".",
"dateFormat",
")",
";",
"// if valueFormat is specified, we format the string",
"if",
"(",
"!",
"forceDate",
"&&",
"this",
".",
"options",
".",
"valueFormat",
")",
"{",
"return",
"inputEx",
".",
"DateField",
".",
"formatDate",
"(",
"finalDate",
",",
"this",
".",
"options",
".",
"valueFormat",
")",
";",
"}",
"return",
"finalDate",
";",
"}"
]
| Return the date
@param {Boolean} forceDate Skip the valueFormat option if set to truthy
@return {String || Date} Formatted date using the valueFormat or a javascript Date instance | [
"Return",
"the",
"date"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L3909-L3924 |
|
42,675 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(value, sendUpdatedEvt) {
var values = [];
// !value catches "" (empty field), and invalid dates
if(!value || !lang.isFunction(value.getTime) || !lang.isNumber(value.getTime()) ) {
values[this.monthIndex] = "";
values[this.yearIndex] = "";
values[this.dayIndex] = "";
} else {
for(var i = 0 ; i < 3 ; i++) {
values.push( i == this.dayIndex ? value.getDate() : (i==this.yearIndex ? value.getFullYear() : value.getMonth()+1 ) );
}
}
inputEx.DateSplitField.superclass.setValue.call(this, values, sendUpdatedEvt);
} | javascript | function(value, sendUpdatedEvt) {
var values = [];
// !value catches "" (empty field), and invalid dates
if(!value || !lang.isFunction(value.getTime) || !lang.isNumber(value.getTime()) ) {
values[this.monthIndex] = "";
values[this.yearIndex] = "";
values[this.dayIndex] = "";
} else {
for(var i = 0 ; i < 3 ; i++) {
values.push( i == this.dayIndex ? value.getDate() : (i==this.yearIndex ? value.getFullYear() : value.getMonth()+1 ) );
}
}
inputEx.DateSplitField.superclass.setValue.call(this, values, sendUpdatedEvt);
} | [
"function",
"(",
"value",
",",
"sendUpdatedEvt",
")",
"{",
"var",
"values",
"=",
"[",
"]",
";",
"// !value catches \"\" (empty field), and invalid dates",
"if",
"(",
"!",
"value",
"||",
"!",
"lang",
".",
"isFunction",
"(",
"value",
".",
"getTime",
")",
"||",
"!",
"lang",
".",
"isNumber",
"(",
"value",
".",
"getTime",
"(",
")",
")",
")",
"{",
"values",
"[",
"this",
".",
"monthIndex",
"]",
"=",
"\"\"",
";",
"values",
"[",
"this",
".",
"yearIndex",
"]",
"=",
"\"\"",
";",
"values",
"[",
"this",
".",
"dayIndex",
"]",
"=",
"\"\"",
";",
"}",
"else",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"3",
";",
"i",
"++",
")",
"{",
"values",
".",
"push",
"(",
"i",
"==",
"this",
".",
"dayIndex",
"?",
"value",
".",
"getDate",
"(",
")",
":",
"(",
"i",
"==",
"this",
".",
"yearIndex",
"?",
"value",
".",
"getFullYear",
"(",
")",
":",
"value",
".",
"getMonth",
"(",
")",
"+",
"1",
")",
")",
";",
"}",
"}",
"inputEx",
".",
"DateSplitField",
".",
"superclass",
".",
"setValue",
".",
"call",
"(",
"this",
",",
"values",
",",
"sendUpdatedEvt",
")",
";",
"}"
]
| Set the value. Format the date according to options.dateFormat
@param {Date} val Date to set
@param {boolean} [sendUpdatedEvt] (optional) Wether this setValue should fire the updatedEvt or not (default is true, pass false to NOT send the event) | [
"Set",
"the",
"value",
".",
"Format",
"the",
"date",
"according",
"to",
"options",
".",
"dateFormat"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L4006-L4020 |
|
42,676 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(options) {
inputEx.DatePickerField.superclass.setOptions.call(this, options);
// Overwrite default options
this.options.className = options.className ? options.className : 'inputEx-Field inputEx-DateField inputEx-PickerField inputEx-DatePickerField';
this.options.readonly = YAHOO.lang.isUndefined(options.readonly) ? true : options.readonly;
// Added options
this.options.calendar = options.calendar || inputEx.messages.defautCalendarOpts;
} | javascript | function(options) {
inputEx.DatePickerField.superclass.setOptions.call(this, options);
// Overwrite default options
this.options.className = options.className ? options.className : 'inputEx-Field inputEx-DateField inputEx-PickerField inputEx-DatePickerField';
this.options.readonly = YAHOO.lang.isUndefined(options.readonly) ? true : options.readonly;
// Added options
this.options.calendar = options.calendar || inputEx.messages.defautCalendarOpts;
} | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"DatePickerField",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"// Overwrite default options",
"this",
".",
"options",
".",
"className",
"=",
"options",
".",
"className",
"?",
"options",
".",
"className",
":",
"'inputEx-Field inputEx-DateField inputEx-PickerField inputEx-DatePickerField'",
";",
"this",
".",
"options",
".",
"readonly",
"=",
"YAHOO",
".",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"readonly",
")",
"?",
"true",
":",
"options",
".",
"readonly",
";",
"// Added options",
"this",
".",
"options",
".",
"calendar",
"=",
"options",
".",
"calendar",
"||",
"inputEx",
".",
"messages",
".",
"defautCalendarOpts",
";",
"}"
]
| Set the default date picker CSS classes
@param {Object} options Options object as passed to the constructor | [
"Set",
"the",
"default",
"date",
"picker",
"CSS",
"classes"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L4134-L4144 |
|
42,677 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
inputEx.DatePickerField.superclass.renderComponent.call(this);
// Create overlay
this.oOverlay = new YAHOO.widget.Overlay(Dom.generateId(), { visible: false });
this.oOverlay.setBody(" ");
this.oOverlay.body.id = Dom.generateId();
// Create button
this.button = new YAHOO.widget.Button({ type: "menu", menu: this.oOverlay, label: " " });
this.button.appendTo(this.wrapEl);
// Render the overlay
this.oOverlay.render(this.wrapEl);
// HACK: Set position absolute to the overlay
Dom.setStyle(this.oOverlay.body.parentNode, "position", "absolute");
// Subscribe the click handler on the field only if readonly
if(this.options.readonly) {
Event.addListener(this.el,'click',function(){
// calendar may not have been rendered yet
this.renderCalendar();
if (!this.oOverlay.justHidden) {
this.button._showMenu();
}
},this,true);
}
this.oOverlay.hideEvent.subscribe(function() {
this.oOverlay.justHidden = true;
YAHOO.lang.later(250,this,function(){this.oOverlay.justHidden=false;});
},this,true);
// Subscribe to the first click
this.button.on('click', this.renderCalendar, this, true);
} | javascript | function() {
inputEx.DatePickerField.superclass.renderComponent.call(this);
// Create overlay
this.oOverlay = new YAHOO.widget.Overlay(Dom.generateId(), { visible: false });
this.oOverlay.setBody(" ");
this.oOverlay.body.id = Dom.generateId();
// Create button
this.button = new YAHOO.widget.Button({ type: "menu", menu: this.oOverlay, label: " " });
this.button.appendTo(this.wrapEl);
// Render the overlay
this.oOverlay.render(this.wrapEl);
// HACK: Set position absolute to the overlay
Dom.setStyle(this.oOverlay.body.parentNode, "position", "absolute");
// Subscribe the click handler on the field only if readonly
if(this.options.readonly) {
Event.addListener(this.el,'click',function(){
// calendar may not have been rendered yet
this.renderCalendar();
if (!this.oOverlay.justHidden) {
this.button._showMenu();
}
},this,true);
}
this.oOverlay.hideEvent.subscribe(function() {
this.oOverlay.justHidden = true;
YAHOO.lang.later(250,this,function(){this.oOverlay.justHidden=false;});
},this,true);
// Subscribe to the first click
this.button.on('click', this.renderCalendar, this, true);
} | [
"function",
"(",
")",
"{",
"inputEx",
".",
"DatePickerField",
".",
"superclass",
".",
"renderComponent",
".",
"call",
"(",
"this",
")",
";",
"// Create overlay",
"this",
".",
"oOverlay",
"=",
"new",
"YAHOO",
".",
"widget",
".",
"Overlay",
"(",
"Dom",
".",
"generateId",
"(",
")",
",",
"{",
"visible",
":",
"false",
"}",
")",
";",
"this",
".",
"oOverlay",
".",
"setBody",
"(",
"\" \"",
")",
";",
"this",
".",
"oOverlay",
".",
"body",
".",
"id",
"=",
"Dom",
".",
"generateId",
"(",
")",
";",
"// Create button",
"this",
".",
"button",
"=",
"new",
"YAHOO",
".",
"widget",
".",
"Button",
"(",
"{",
"type",
":",
"\"menu\"",
",",
"menu",
":",
"this",
".",
"oOverlay",
",",
"label",
":",
"\" \"",
"}",
")",
";",
"this",
".",
"button",
".",
"appendTo",
"(",
"this",
".",
"wrapEl",
")",
";",
"// Render the overlay",
"this",
".",
"oOverlay",
".",
"render",
"(",
"this",
".",
"wrapEl",
")",
";",
"// HACK: Set position absolute to the overlay",
"Dom",
".",
"setStyle",
"(",
"this",
".",
"oOverlay",
".",
"body",
".",
"parentNode",
",",
"\"position\"",
",",
"\"absolute\"",
")",
";",
"// Subscribe the click handler on the field only if readonly",
"if",
"(",
"this",
".",
"options",
".",
"readonly",
")",
"{",
"Event",
".",
"addListener",
"(",
"this",
".",
"el",
",",
"'click'",
",",
"function",
"(",
")",
"{",
"// calendar may not have been rendered yet",
"this",
".",
"renderCalendar",
"(",
")",
";",
"if",
"(",
"!",
"this",
".",
"oOverlay",
".",
"justHidden",
")",
"{",
"this",
".",
"button",
".",
"_showMenu",
"(",
")",
";",
"}",
"}",
",",
"this",
",",
"true",
")",
";",
"}",
"this",
".",
"oOverlay",
".",
"hideEvent",
".",
"subscribe",
"(",
"function",
"(",
")",
"{",
"this",
".",
"oOverlay",
".",
"justHidden",
"=",
"true",
";",
"YAHOO",
".",
"lang",
".",
"later",
"(",
"250",
",",
"this",
",",
"function",
"(",
")",
"{",
"this",
".",
"oOverlay",
".",
"justHidden",
"=",
"false",
";",
"}",
")",
";",
"}",
",",
"this",
",",
"true",
")",
";",
"// Subscribe to the first click",
"this",
".",
"button",
".",
"on",
"(",
"'click'",
",",
"this",
".",
"renderCalendar",
",",
"this",
",",
"true",
")",
";",
"}"
]
| Render the input field and the minical container | [
"Render",
"the",
"input",
"field",
"and",
"the",
"minical",
"container"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L4149-L4188 |
|
42,678 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
// if already rendered, ignore call
if (!!this.calendarRendered) return;
// Render the calendar
var calendarId = Dom.generateId();
this.calendar = new YAHOO.widget.Calendar(calendarId,this.oOverlay.body.id, this.options.calendar );
/*
this.calendar.cfg.setProperty("DATE_FIELD_DELIMITER", "/");
this.calendar.cfg.setProperty("MDY_DAY_POSITION", 1);
this.calendar.cfg.setProperty("MDY_MONTH_POSITION", 2);
this.calendar.cfg.setProperty("MDY_YEAR_POSITION", 3);
this.calendar.cfg.setProperty("MD_DAY_POSITION", 1);
this.calendar.cfg.setProperty("MD_MONTH_POSITION", 2);*/
// localization
if(inputEx.messages.shortMonths) this.calendar.cfg.setProperty("MONTHS_SHORT", inputEx.messages.shortMonths);
if(inputEx.messages.months) this.calendar.cfg.setProperty("MONTHS_LONG", inputEx.messages.months);
if(inputEx.messages.weekdays1char) this.calendar.cfg.setProperty("WEEKDAYS_1CHAR", inputEx.messages.weekdays1char);
if(inputEx.messages.shortWeekdays) this.calendar.cfg.setProperty("WEEKDAYS_SHORT", inputEx.messages.shortWeekdays);
// HACK to keep focus on calendar/overlay
// so overlay is not hidden when changing page in calendar
// (inspired by YUI examples)
var focusDay = function () {
var oCalendarTBody = Dom.get(calendarId).tBodies[0],
aElements = oCalendarTBody.getElementsByTagName("a"),
oAnchor;
if (aElements.length > 0) {
Dom.batch(aElements, function (element) {
if (Dom.hasClass(element.parentNode, "today")) {
oAnchor = element;
}
});
if (!oAnchor) {
oAnchor = aElements[0];
}
// Focus the anchor element using a timer since Calendar will try
// to set focus to its next button by default
lang.later(0, oAnchor, function () {
try {
oAnchor.focus();
}
catch(e) {}
});
}
};
// Set focus to either the current day, or first day of the month in
// the Calendar when the month changes (renderEvent is fired)
this.calendar.renderEvent.subscribe(focusDay, this.calendar, true);
// Open minical on correct date / month if field contains a value
this.oOverlay.beforeShowEvent.subscribe(this.beforeShowOverlay, this, true);
// Render the calendar on the right page !
// -> this.calendar.render(); is not enough...
this.beforeShowOverlay();
this.calendar.selectEvent.subscribe(function (type,args,obj) {
// HACK: stop here if called from beforeShowOverlay
if (!!this.ignoreBeforeShowOverlayCall) { return; }
this.oOverlay.hide();
var date = args[0][0];
var year = date[0], month = date[1], day = date[2];
// set value (updatedEvt fired by setValue)
this.setValue(new Date(year,month-1, day) );
}, this, true);
// Unsubscribe the event so this function is called only once
this.button.unsubscribe("click", this.renderCalendar);
this.calendarRendered = true;
// Since we render the calendar AFTER the opening of the overlay,
// the overlay can be mis-positionned (outside of the viewport).
// We force the repositionning of the overlay by hiding it, and show it again.
this.oOverlay.hide();
this.button._showMenu();
} | javascript | function() {
// if already rendered, ignore call
if (!!this.calendarRendered) return;
// Render the calendar
var calendarId = Dom.generateId();
this.calendar = new YAHOO.widget.Calendar(calendarId,this.oOverlay.body.id, this.options.calendar );
/*
this.calendar.cfg.setProperty("DATE_FIELD_DELIMITER", "/");
this.calendar.cfg.setProperty("MDY_DAY_POSITION", 1);
this.calendar.cfg.setProperty("MDY_MONTH_POSITION", 2);
this.calendar.cfg.setProperty("MDY_YEAR_POSITION", 3);
this.calendar.cfg.setProperty("MD_DAY_POSITION", 1);
this.calendar.cfg.setProperty("MD_MONTH_POSITION", 2);*/
// localization
if(inputEx.messages.shortMonths) this.calendar.cfg.setProperty("MONTHS_SHORT", inputEx.messages.shortMonths);
if(inputEx.messages.months) this.calendar.cfg.setProperty("MONTHS_LONG", inputEx.messages.months);
if(inputEx.messages.weekdays1char) this.calendar.cfg.setProperty("WEEKDAYS_1CHAR", inputEx.messages.weekdays1char);
if(inputEx.messages.shortWeekdays) this.calendar.cfg.setProperty("WEEKDAYS_SHORT", inputEx.messages.shortWeekdays);
// HACK to keep focus on calendar/overlay
// so overlay is not hidden when changing page in calendar
// (inspired by YUI examples)
var focusDay = function () {
var oCalendarTBody = Dom.get(calendarId).tBodies[0],
aElements = oCalendarTBody.getElementsByTagName("a"),
oAnchor;
if (aElements.length > 0) {
Dom.batch(aElements, function (element) {
if (Dom.hasClass(element.parentNode, "today")) {
oAnchor = element;
}
});
if (!oAnchor) {
oAnchor = aElements[0];
}
// Focus the anchor element using a timer since Calendar will try
// to set focus to its next button by default
lang.later(0, oAnchor, function () {
try {
oAnchor.focus();
}
catch(e) {}
});
}
};
// Set focus to either the current day, or first day of the month in
// the Calendar when the month changes (renderEvent is fired)
this.calendar.renderEvent.subscribe(focusDay, this.calendar, true);
// Open minical on correct date / month if field contains a value
this.oOverlay.beforeShowEvent.subscribe(this.beforeShowOverlay, this, true);
// Render the calendar on the right page !
// -> this.calendar.render(); is not enough...
this.beforeShowOverlay();
this.calendar.selectEvent.subscribe(function (type,args,obj) {
// HACK: stop here if called from beforeShowOverlay
if (!!this.ignoreBeforeShowOverlayCall) { return; }
this.oOverlay.hide();
var date = args[0][0];
var year = date[0], month = date[1], day = date[2];
// set value (updatedEvt fired by setValue)
this.setValue(new Date(year,month-1, day) );
}, this, true);
// Unsubscribe the event so this function is called only once
this.button.unsubscribe("click", this.renderCalendar);
this.calendarRendered = true;
// Since we render the calendar AFTER the opening of the overlay,
// the overlay can be mis-positionned (outside of the viewport).
// We force the repositionning of the overlay by hiding it, and show it again.
this.oOverlay.hide();
this.button._showMenu();
} | [
"function",
"(",
")",
"{",
"// if already rendered, ignore call",
"if",
"(",
"!",
"!",
"this",
".",
"calendarRendered",
")",
"return",
";",
"// Render the calendar",
"var",
"calendarId",
"=",
"Dom",
".",
"generateId",
"(",
")",
";",
"this",
".",
"calendar",
"=",
"new",
"YAHOO",
".",
"widget",
".",
"Calendar",
"(",
"calendarId",
",",
"this",
".",
"oOverlay",
".",
"body",
".",
"id",
",",
"this",
".",
"options",
".",
"calendar",
")",
";",
"/*\n this.calendar.cfg.setProperty(\"DATE_FIELD_DELIMITER\", \"/\");\n this.calendar.cfg.setProperty(\"MDY_DAY_POSITION\", 1);\n this.calendar.cfg.setProperty(\"MDY_MONTH_POSITION\", 2);\n this.calendar.cfg.setProperty(\"MDY_YEAR_POSITION\", 3);\n this.calendar.cfg.setProperty(\"MD_DAY_POSITION\", 1);\n this.calendar.cfg.setProperty(\"MD_MONTH_POSITION\", 2);*/",
"// localization",
"if",
"(",
"inputEx",
".",
"messages",
".",
"shortMonths",
")",
"this",
".",
"calendar",
".",
"cfg",
".",
"setProperty",
"(",
"\"MONTHS_SHORT\"",
",",
"inputEx",
".",
"messages",
".",
"shortMonths",
")",
";",
"if",
"(",
"inputEx",
".",
"messages",
".",
"months",
")",
"this",
".",
"calendar",
".",
"cfg",
".",
"setProperty",
"(",
"\"MONTHS_LONG\"",
",",
"inputEx",
".",
"messages",
".",
"months",
")",
";",
"if",
"(",
"inputEx",
".",
"messages",
".",
"weekdays1char",
")",
"this",
".",
"calendar",
".",
"cfg",
".",
"setProperty",
"(",
"\"WEEKDAYS_1CHAR\"",
",",
"inputEx",
".",
"messages",
".",
"weekdays1char",
")",
";",
"if",
"(",
"inputEx",
".",
"messages",
".",
"shortWeekdays",
")",
"this",
".",
"calendar",
".",
"cfg",
".",
"setProperty",
"(",
"\"WEEKDAYS_SHORT\"",
",",
"inputEx",
".",
"messages",
".",
"shortWeekdays",
")",
";",
"// HACK to keep focus on calendar/overlay ",
"// so overlay is not hidden when changing page in calendar",
"// (inspired by YUI examples)",
"var",
"focusDay",
"=",
"function",
"(",
")",
"{",
"var",
"oCalendarTBody",
"=",
"Dom",
".",
"get",
"(",
"calendarId",
")",
".",
"tBodies",
"[",
"0",
"]",
",",
"aElements",
"=",
"oCalendarTBody",
".",
"getElementsByTagName",
"(",
"\"a\"",
")",
",",
"oAnchor",
";",
"if",
"(",
"aElements",
".",
"length",
">",
"0",
")",
"{",
"Dom",
".",
"batch",
"(",
"aElements",
",",
"function",
"(",
"element",
")",
"{",
"if",
"(",
"Dom",
".",
"hasClass",
"(",
"element",
".",
"parentNode",
",",
"\"today\"",
")",
")",
"{",
"oAnchor",
"=",
"element",
";",
"}",
"}",
")",
";",
"if",
"(",
"!",
"oAnchor",
")",
"{",
"oAnchor",
"=",
"aElements",
"[",
"0",
"]",
";",
"}",
"// Focus the anchor element using a timer since Calendar will try ",
"// to set focus to its next button by default",
"lang",
".",
"later",
"(",
"0",
",",
"oAnchor",
",",
"function",
"(",
")",
"{",
"try",
"{",
"oAnchor",
".",
"focus",
"(",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"}",
"}",
")",
";",
"}",
"}",
";",
"// Set focus to either the current day, or first day of the month in ",
"// the Calendar when the month changes (renderEvent is fired)",
"this",
".",
"calendar",
".",
"renderEvent",
".",
"subscribe",
"(",
"focusDay",
",",
"this",
".",
"calendar",
",",
"true",
")",
";",
"// Open minical on correct date / month if field contains a value",
"this",
".",
"oOverlay",
".",
"beforeShowEvent",
".",
"subscribe",
"(",
"this",
".",
"beforeShowOverlay",
",",
"this",
",",
"true",
")",
";",
"// Render the calendar on the right page !",
"// -> this.calendar.render(); is not enough...",
"this",
".",
"beforeShowOverlay",
"(",
")",
";",
"this",
".",
"calendar",
".",
"selectEvent",
".",
"subscribe",
"(",
"function",
"(",
"type",
",",
"args",
",",
"obj",
")",
"{",
"// HACK: stop here if called from beforeShowOverlay",
"if",
"(",
"!",
"!",
"this",
".",
"ignoreBeforeShowOverlayCall",
")",
"{",
"return",
";",
"}",
"this",
".",
"oOverlay",
".",
"hide",
"(",
")",
";",
"var",
"date",
"=",
"args",
"[",
"0",
"]",
"[",
"0",
"]",
";",
"var",
"year",
"=",
"date",
"[",
"0",
"]",
",",
"month",
"=",
"date",
"[",
"1",
"]",
",",
"day",
"=",
"date",
"[",
"2",
"]",
";",
"// set value (updatedEvt fired by setValue)",
"this",
".",
"setValue",
"(",
"new",
"Date",
"(",
"year",
",",
"month",
"-",
"1",
",",
"day",
")",
")",
";",
"}",
",",
"this",
",",
"true",
")",
";",
"// Unsubscribe the event so this function is called only once",
"this",
".",
"button",
".",
"unsubscribe",
"(",
"\"click\"",
",",
"this",
".",
"renderCalendar",
")",
";",
"this",
".",
"calendarRendered",
"=",
"true",
";",
"// Since we render the calendar AFTER the opening of the overlay,",
"// the overlay can be mis-positionned (outside of the viewport).",
"// We force the repositionning of the overlay by hiding it, and show it again.",
"this",
".",
"oOverlay",
".",
"hide",
"(",
")",
";",
"this",
".",
"button",
".",
"_showMenu",
"(",
")",
";",
"}"
]
| Called ONCE to render the calendar lazily | [
"Called",
"ONCE",
"to",
"render",
"the",
"calendar",
"lazily"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L4194-L4286 |
|
42,679 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(e) {
var date = this.getValue(true);
if (!!this.calendar) {
if(!!date) {
// HACK: don't fire Field updatedEvt when selecting date
this.ignoreBeforeShowOverlayCall = true;
// select the previous date in calendar
this.calendar.select(date);
this.ignoreBeforeShowOverlayCall = false;
this.calendar.cfg.setProperty("pagedate",(date.getMonth()+1)+"/"+date.getFullYear());
}
this.calendar.render(); // refresh calendar
}
} | javascript | function(e) {
var date = this.getValue(true);
if (!!this.calendar) {
if(!!date) {
// HACK: don't fire Field updatedEvt when selecting date
this.ignoreBeforeShowOverlayCall = true;
// select the previous date in calendar
this.calendar.select(date);
this.ignoreBeforeShowOverlayCall = false;
this.calendar.cfg.setProperty("pagedate",(date.getMonth()+1)+"/"+date.getFullYear());
}
this.calendar.render(); // refresh calendar
}
} | [
"function",
"(",
"e",
")",
"{",
"var",
"date",
"=",
"this",
".",
"getValue",
"(",
"true",
")",
";",
"if",
"(",
"!",
"!",
"this",
".",
"calendar",
")",
"{",
"if",
"(",
"!",
"!",
"date",
")",
"{",
"// HACK: don't fire Field updatedEvt when selecting date",
"this",
".",
"ignoreBeforeShowOverlayCall",
"=",
"true",
";",
"// select the previous date in calendar",
"this",
".",
"calendar",
".",
"select",
"(",
"date",
")",
";",
"this",
".",
"ignoreBeforeShowOverlayCall",
"=",
"false",
";",
"this",
".",
"calendar",
".",
"cfg",
".",
"setProperty",
"(",
"\"pagedate\"",
",",
"(",
"date",
".",
"getMonth",
"(",
")",
"+",
"1",
")",
"+",
"\"/\"",
"+",
"date",
".",
"getFullYear",
"(",
")",
")",
";",
"}",
"this",
".",
"calendar",
".",
"render",
"(",
")",
";",
"// refresh calendar",
"}",
"}"
]
| Select the right date and display the right page on calendar, when the field has a value | [
"Select",
"the",
"right",
"date",
"and",
"display",
"the",
"right",
"page",
"on",
"calendar",
"when",
"the",
"field",
"has",
"a",
"value"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L4291-L4307 |
|
42,680 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
this.type = inputEx.HiddenField;
this.divEl = inputEx.cn('div', null, {display: 'none'});
this.el = inputEx.cn('input', {type: 'hidden'});
this.rawValue = ''; // initialize the rawValue with '' (default value of a hidden field)
if(this.options.name) this.el.name = this.options.name;
this.divEl.appendChild(this.el);
} | javascript | function() {
this.type = inputEx.HiddenField;
this.divEl = inputEx.cn('div', null, {display: 'none'});
this.el = inputEx.cn('input', {type: 'hidden'});
this.rawValue = ''; // initialize the rawValue with '' (default value of a hidden field)
if(this.options.name) this.el.name = this.options.name;
this.divEl.appendChild(this.el);
} | [
"function",
"(",
")",
"{",
"this",
".",
"type",
"=",
"inputEx",
".",
"HiddenField",
";",
"this",
".",
"divEl",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"null",
",",
"{",
"display",
":",
"'none'",
"}",
")",
";",
"this",
".",
"el",
"=",
"inputEx",
".",
"cn",
"(",
"'input'",
",",
"{",
"type",
":",
"'hidden'",
"}",
")",
";",
"this",
".",
"rawValue",
"=",
"''",
";",
"// initialize the rawValue with '' (default value of a hidden field)",
"if",
"(",
"this",
".",
"options",
".",
"name",
")",
"this",
".",
"el",
".",
"name",
"=",
"this",
".",
"options",
".",
"name",
";",
"this",
".",
"divEl",
".",
"appendChild",
"(",
"this",
".",
"el",
")",
";",
"}"
]
| Doesn't render much... | [
"Doesn",
"t",
"render",
"much",
"..."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L4498-L4507 |
|
42,681 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(options) {
inputEx.IntegerField.superclass.setOptions.call(this, options);
this.options.negative = lang.isUndefined(options.negative) ? false : options.negative;
this.options.min = lang.isUndefined(options.min) ? (this.options.negative ? -Infinity : 0) : parseInt(options.min,10);
this.options.max = lang.isUndefined(options.max) ? Infinity : parseInt(options.max,10);
} | javascript | function(options) {
inputEx.IntegerField.superclass.setOptions.call(this, options);
this.options.negative = lang.isUndefined(options.negative) ? false : options.negative;
this.options.min = lang.isUndefined(options.min) ? (this.options.negative ? -Infinity : 0) : parseInt(options.min,10);
this.options.max = lang.isUndefined(options.max) ? Infinity : parseInt(options.max,10);
} | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"IntegerField",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"this",
".",
"options",
".",
"negative",
"=",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"negative",
")",
"?",
"false",
":",
"options",
".",
"negative",
";",
"this",
".",
"options",
".",
"min",
"=",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"min",
")",
"?",
"(",
"this",
".",
"options",
".",
"negative",
"?",
"-",
"Infinity",
":",
"0",
")",
":",
"parseInt",
"(",
"options",
".",
"min",
",",
"10",
")",
";",
"this",
".",
"options",
".",
"max",
"=",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"max",
")",
"?",
"Infinity",
":",
"parseInt",
"(",
"options",
".",
"max",
",",
"10",
")",
";",
"}"
]
| Adds the negative, min, and max options
@param {Object} options | [
"Adds",
"the",
"negative",
"min",
"and",
"max",
"options"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L4834-L4840 |
|
42,682 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
var v = this.getValue(), str_value = inputEx.IntegerField.superclass.getValue.call(this);
// empty field
if (v === '') {
// validate only if not required
return !this.options.required;
}
if (isNaN(v)) {
return false;
}
return !!str_value.match(/^[\+\-]?[0-9]+$/) && (this.options.negative ? true : v >= 0) && v >= this.options.min && v <= this.options.max;
} | javascript | function() {
var v = this.getValue(), str_value = inputEx.IntegerField.superclass.getValue.call(this);
// empty field
if (v === '') {
// validate only if not required
return !this.options.required;
}
if (isNaN(v)) {
return false;
}
return !!str_value.match(/^[\+\-]?[0-9]+$/) && (this.options.negative ? true : v >= 0) && v >= this.options.min && v <= this.options.max;
} | [
"function",
"(",
")",
"{",
"var",
"v",
"=",
"this",
".",
"getValue",
"(",
")",
",",
"str_value",
"=",
"inputEx",
".",
"IntegerField",
".",
"superclass",
".",
"getValue",
".",
"call",
"(",
"this",
")",
";",
"// empty field",
"if",
"(",
"v",
"===",
"''",
")",
"{",
"// validate only if not required",
"return",
"!",
"this",
".",
"options",
".",
"required",
";",
"}",
"if",
"(",
"isNaN",
"(",
"v",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"!",
"!",
"str_value",
".",
"match",
"(",
"/",
"^[\\+\\-]?[0-9]+$",
"/",
")",
"&&",
"(",
"this",
".",
"options",
".",
"negative",
"?",
"true",
":",
"v",
">=",
"0",
")",
"&&",
"v",
">=",
"this",
".",
"options",
".",
"min",
"&&",
"v",
"<=",
"this",
".",
"options",
".",
"max",
";",
"}"
]
| Validate if is a number | [
"Validate",
"if",
"is",
"a",
"number"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L4864-L4880 |
|
42,683 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(value) {
// Render the subField
var subFieldEl = this.renderSubField(value);
if(this.options.name) {
subFieldEl.setFieldName(this.options.name+"["+this.subFields.length+"]");
}
// Adds it to the local list
this.subFields.push(subFieldEl);
return subFieldEl;
} | javascript | function(value) {
// Render the subField
var subFieldEl = this.renderSubField(value);
if(this.options.name) {
subFieldEl.setFieldName(this.options.name+"["+this.subFields.length+"]");
}
// Adds it to the local list
this.subFields.push(subFieldEl);
return subFieldEl;
} | [
"function",
"(",
"value",
")",
"{",
"// Render the subField",
"var",
"subFieldEl",
"=",
"this",
".",
"renderSubField",
"(",
"value",
")",
";",
"if",
"(",
"this",
".",
"options",
".",
"name",
")",
"{",
"subFieldEl",
".",
"setFieldName",
"(",
"this",
".",
"options",
".",
"name",
"+",
"\"[\"",
"+",
"this",
".",
"subFields",
".",
"length",
"+",
"\"]\"",
")",
";",
"}",
"// Adds it to the local list",
"this",
".",
"subFields",
".",
"push",
"(",
"subFieldEl",
")",
";",
"return",
"subFieldEl",
";",
"}"
]
| Adds an element
@param {Any} The initial value of the subfield to create
@return {inputEx.Field} SubField added instance | [
"Adds",
"an",
"element"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L5071-L5084 |
|
42,684 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(e) {
var childElement = Event.getTarget(e).parentNode;
var previousChildNode = null;
var nodeIndex = -1;
for(var i = 1 ; i < childElement.parentNode.childNodes.length ; i++) {
var el=childElement.parentNode.childNodes[i];
if(el == childElement) {
previousChildNode = childElement.parentNode.childNodes[i-1];
nodeIndex = i;
break;
}
}
if(previousChildNode) {
// Remove the line
var removedEl = this.childContainer.removeChild(childElement);
// Adds it before the previousChildNode
var insertedEl = this.childContainer.insertBefore(removedEl, previousChildNode);
// Swap this.subFields elements (i,i-1)
var temp = this.subFields[nodeIndex];
this.subFields[nodeIndex] = this.subFields[nodeIndex-1];
this.subFields[nodeIndex-1] = temp;
// Note: not very efficient, we could just swap the names
this.resetAllNames();
// Color Animation
if(this.arrowAnim) {
this.arrowAnim.stop(true);
}
this.arrowAnim = new YAHOO.util.ColorAnim(insertedEl, {backgroundColor: this.arrowAnimColors}, 0.4);
this.arrowAnim.onComplete.subscribe(function() { Dom.setStyle(insertedEl, 'background-color', ''); });
this.arrowAnim.animate();
// Fire updated !
this.fireUpdatedEvt();
}
} | javascript | function(e) {
var childElement = Event.getTarget(e).parentNode;
var previousChildNode = null;
var nodeIndex = -1;
for(var i = 1 ; i < childElement.parentNode.childNodes.length ; i++) {
var el=childElement.parentNode.childNodes[i];
if(el == childElement) {
previousChildNode = childElement.parentNode.childNodes[i-1];
nodeIndex = i;
break;
}
}
if(previousChildNode) {
// Remove the line
var removedEl = this.childContainer.removeChild(childElement);
// Adds it before the previousChildNode
var insertedEl = this.childContainer.insertBefore(removedEl, previousChildNode);
// Swap this.subFields elements (i,i-1)
var temp = this.subFields[nodeIndex];
this.subFields[nodeIndex] = this.subFields[nodeIndex-1];
this.subFields[nodeIndex-1] = temp;
// Note: not very efficient, we could just swap the names
this.resetAllNames();
// Color Animation
if(this.arrowAnim) {
this.arrowAnim.stop(true);
}
this.arrowAnim = new YAHOO.util.ColorAnim(insertedEl, {backgroundColor: this.arrowAnimColors}, 0.4);
this.arrowAnim.onComplete.subscribe(function() { Dom.setStyle(insertedEl, 'background-color', ''); });
this.arrowAnim.animate();
// Fire updated !
this.fireUpdatedEvt();
}
} | [
"function",
"(",
"e",
")",
"{",
"var",
"childElement",
"=",
"Event",
".",
"getTarget",
"(",
"e",
")",
".",
"parentNode",
";",
"var",
"previousChildNode",
"=",
"null",
";",
"var",
"nodeIndex",
"=",
"-",
"1",
";",
"for",
"(",
"var",
"i",
"=",
"1",
";",
"i",
"<",
"childElement",
".",
"parentNode",
".",
"childNodes",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"el",
"=",
"childElement",
".",
"parentNode",
".",
"childNodes",
"[",
"i",
"]",
";",
"if",
"(",
"el",
"==",
"childElement",
")",
"{",
"previousChildNode",
"=",
"childElement",
".",
"parentNode",
".",
"childNodes",
"[",
"i",
"-",
"1",
"]",
";",
"nodeIndex",
"=",
"i",
";",
"break",
";",
"}",
"}",
"if",
"(",
"previousChildNode",
")",
"{",
"// Remove the line",
"var",
"removedEl",
"=",
"this",
".",
"childContainer",
".",
"removeChild",
"(",
"childElement",
")",
";",
"// Adds it before the previousChildNode",
"var",
"insertedEl",
"=",
"this",
".",
"childContainer",
".",
"insertBefore",
"(",
"removedEl",
",",
"previousChildNode",
")",
";",
"// Swap this.subFields elements (i,i-1)",
"var",
"temp",
"=",
"this",
".",
"subFields",
"[",
"nodeIndex",
"]",
";",
"this",
".",
"subFields",
"[",
"nodeIndex",
"]",
"=",
"this",
".",
"subFields",
"[",
"nodeIndex",
"-",
"1",
"]",
";",
"this",
".",
"subFields",
"[",
"nodeIndex",
"-",
"1",
"]",
"=",
"temp",
";",
"// Note: not very efficient, we could just swap the names",
"this",
".",
"resetAllNames",
"(",
")",
";",
"// Color Animation",
"if",
"(",
"this",
".",
"arrowAnim",
")",
"{",
"this",
".",
"arrowAnim",
".",
"stop",
"(",
"true",
")",
";",
"}",
"this",
".",
"arrowAnim",
"=",
"new",
"YAHOO",
".",
"util",
".",
"ColorAnim",
"(",
"insertedEl",
",",
"{",
"backgroundColor",
":",
"this",
".",
"arrowAnimColors",
"}",
",",
"0.4",
")",
";",
"this",
".",
"arrowAnim",
".",
"onComplete",
".",
"subscribe",
"(",
"function",
"(",
")",
"{",
"Dom",
".",
"setStyle",
"(",
"insertedEl",
",",
"'background-color'",
",",
"''",
")",
";",
"}",
")",
";",
"this",
".",
"arrowAnim",
".",
"animate",
"(",
")",
";",
"// Fire updated !",
"this",
".",
"fireUpdatedEvt",
"(",
")",
";",
"}",
"}"
]
| Switch a subField with its previous one
Called when the user clicked on the up arrow of a sortable list
@param {Event} e Original click event | [
"Switch",
"a",
"subField",
"with",
"its",
"previous",
"one",
"Called",
"when",
"the",
"user",
"clicked",
"on",
"the",
"up",
"arrow",
"of",
"a",
"sortable",
"list"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L5188-L5228 |
|
42,685 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(e) {
Event.stopEvent(e);
// Prevent removing a field if already at minItems
if( lang.isNumber(this.options.minItems) && this.subFields.length <= this.options.minItems ) {
return;
}
// Get the wrapping div element
var elementDiv = Event.getTarget(e).parentNode;
// Get the index of the subField
var index = -1;
var subFieldEl = elementDiv.childNodes[this.options.useButtons ? 1 : 0];
for(var i = 0 ; i < this.subFields.length ; i++) {
if(this.subFields[i].getEl() == subFieldEl) {
index = i;
break;
}
}
// Remove it
if(index != -1) {
this.removeElement(index);
}
// Note: not very efficient
this.resetAllNames();
// Fire the updated event
this.fireUpdatedEvt();
} | javascript | function(e) {
Event.stopEvent(e);
// Prevent removing a field if already at minItems
if( lang.isNumber(this.options.minItems) && this.subFields.length <= this.options.minItems ) {
return;
}
// Get the wrapping div element
var elementDiv = Event.getTarget(e).parentNode;
// Get the index of the subField
var index = -1;
var subFieldEl = elementDiv.childNodes[this.options.useButtons ? 1 : 0];
for(var i = 0 ; i < this.subFields.length ; i++) {
if(this.subFields[i].getEl() == subFieldEl) {
index = i;
break;
}
}
// Remove it
if(index != -1) {
this.removeElement(index);
}
// Note: not very efficient
this.resetAllNames();
// Fire the updated event
this.fireUpdatedEvt();
} | [
"function",
"(",
"e",
")",
"{",
"Event",
".",
"stopEvent",
"(",
"e",
")",
";",
"// Prevent removing a field if already at minItems",
"if",
"(",
"lang",
".",
"isNumber",
"(",
"this",
".",
"options",
".",
"minItems",
")",
"&&",
"this",
".",
"subFields",
".",
"length",
"<=",
"this",
".",
"options",
".",
"minItems",
")",
"{",
"return",
";",
"}",
"// Get the wrapping div element",
"var",
"elementDiv",
"=",
"Event",
".",
"getTarget",
"(",
"e",
")",
".",
"parentNode",
";",
"// Get the index of the subField",
"var",
"index",
"=",
"-",
"1",
";",
"var",
"subFieldEl",
"=",
"elementDiv",
".",
"childNodes",
"[",
"this",
".",
"options",
".",
"useButtons",
"?",
"1",
":",
"0",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"subFields",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"this",
".",
"subFields",
"[",
"i",
"]",
".",
"getEl",
"(",
")",
"==",
"subFieldEl",
")",
"{",
"index",
"=",
"i",
";",
"break",
";",
"}",
"}",
"// Remove it",
"if",
"(",
"index",
"!=",
"-",
"1",
")",
"{",
"this",
".",
"removeElement",
"(",
"index",
")",
";",
"}",
"// Note: not very efficient",
"this",
".",
"resetAllNames",
"(",
")",
";",
"// Fire the updated event",
"this",
".",
"fireUpdatedEvt",
"(",
")",
";",
"}"
]
| Called when the user clicked on a delete button.
@param {Event} e The original click event | [
"Called",
"when",
"the",
"user",
"clicked",
"on",
"a",
"delete",
"button",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L5280-L5313 |
|
42,686 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(options) {
inputEx.NumberField.superclass.setOptions.call(this, options);
this.options.min = lang.isUndefined(options.min) ? -Infinity : parseFloat(options.min);
this.options.max = lang.isUndefined(options.max) ? Infinity : parseFloat(options.max);
} | javascript | function(options) {
inputEx.NumberField.superclass.setOptions.call(this, options);
this.options.min = lang.isUndefined(options.min) ? -Infinity : parseFloat(options.min);
this.options.max = lang.isUndefined(options.max) ? Infinity : parseFloat(options.max);
} | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"NumberField",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"this",
".",
"options",
".",
"min",
"=",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"min",
")",
"?",
"-",
"Infinity",
":",
"parseFloat",
"(",
"options",
".",
"min",
")",
";",
"this",
".",
"options",
".",
"max",
"=",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"max",
")",
"?",
"Infinity",
":",
"parseFloat",
"(",
"options",
".",
"max",
")",
";",
"}"
]
| Adds the min, and max options
@param {Object} options | [
"Adds",
"the",
"min",
"and",
"max",
"options"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L5360-L5365 |
|
42,687 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
var v = this.getValue(), str_value = inputEx.NumberField.superclass.getValue.call(this);
// empty field
if (v === '') {
// validate only if not required
return !this.options.required;
}
if (isNaN(v)) {
return false;
}
// We have to check the number with a regexp, otherwise "0.03a" is parsed to a valid number 0.03
return !!str_value.match(/^([\+\-]?((([0-9]+(\.)?)|([0-9]*\.[0-9]+))([eE][+-]?[0-9]+)?))$/) && v >= this.options.min && v <= this.options.max;
} | javascript | function() {
var v = this.getValue(), str_value = inputEx.NumberField.superclass.getValue.call(this);
// empty field
if (v === '') {
// validate only if not required
return !this.options.required;
}
if (isNaN(v)) {
return false;
}
// We have to check the number with a regexp, otherwise "0.03a" is parsed to a valid number 0.03
return !!str_value.match(/^([\+\-]?((([0-9]+(\.)?)|([0-9]*\.[0-9]+))([eE][+-]?[0-9]+)?))$/) && v >= this.options.min && v <= this.options.max;
} | [
"function",
"(",
")",
"{",
"var",
"v",
"=",
"this",
".",
"getValue",
"(",
")",
",",
"str_value",
"=",
"inputEx",
".",
"NumberField",
".",
"superclass",
".",
"getValue",
".",
"call",
"(",
"this",
")",
";",
"// empty field",
"if",
"(",
"v",
"===",
"''",
")",
"{",
"// validate only if not required",
"return",
"!",
"this",
".",
"options",
".",
"required",
";",
"}",
"if",
"(",
"isNaN",
"(",
"v",
")",
")",
"{",
"return",
"false",
";",
"}",
"// We have to check the number with a regexp, otherwise \"0.03a\" is parsed to a valid number 0.03",
"return",
"!",
"!",
"str_value",
".",
"match",
"(",
"/",
"^([\\+\\-]?((([0-9]+(\\.)?)|([0-9]*\\.[0-9]+))([eE][+-]?[0-9]+)?))$",
"/",
")",
"&&",
"v",
">=",
"this",
".",
"options",
".",
"min",
"&&",
"v",
"<=",
"this",
".",
"options",
".",
"max",
";",
"}"
]
| Check if the entered number is a float | [
"Check",
"if",
"the",
"entered",
"number",
"is",
"a",
"float"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L5388-L5405 |
|
42,688 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(options) {
inputEx.PasswordField.superclass.setOptions.call(this, options);
this.options.className = options.className ? options.className : "inputEx-Field inputEx-PasswordField";
// Add the password regexp (overridable)
this.options.regexp = options.regexp || inputEx.regexps.password;
// display a strength indicator
this.options.strengthIndicator = YAHOO.lang.isUndefined(options.strengthIndicator) ? false : options.strengthIndicator;
// capsLockWarning
this.options.capsLockWarning = YAHOO.lang.isUndefined(options.capsLockWarning) ? false : options.capsLockWarning;
// confirm option, pass the id of the password field to confirm
inputEx.PasswordField.byId[options.id] = this;
var passwordField;
if(options.confirm && (passwordField = inputEx.PasswordField.byId[options.confirm]) ) {
this.setConfirmationField(passwordField);
}
} | javascript | function(options) {
inputEx.PasswordField.superclass.setOptions.call(this, options);
this.options.className = options.className ? options.className : "inputEx-Field inputEx-PasswordField";
// Add the password regexp (overridable)
this.options.regexp = options.regexp || inputEx.regexps.password;
// display a strength indicator
this.options.strengthIndicator = YAHOO.lang.isUndefined(options.strengthIndicator) ? false : options.strengthIndicator;
// capsLockWarning
this.options.capsLockWarning = YAHOO.lang.isUndefined(options.capsLockWarning) ? false : options.capsLockWarning;
// confirm option, pass the id of the password field to confirm
inputEx.PasswordField.byId[options.id] = this;
var passwordField;
if(options.confirm && (passwordField = inputEx.PasswordField.byId[options.confirm]) ) {
this.setConfirmationField(passwordField);
}
} | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"PasswordField",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"this",
".",
"options",
".",
"className",
"=",
"options",
".",
"className",
"?",
"options",
".",
"className",
":",
"\"inputEx-Field inputEx-PasswordField\"",
";",
"// Add the password regexp (overridable)",
"this",
".",
"options",
".",
"regexp",
"=",
"options",
".",
"regexp",
"||",
"inputEx",
".",
"regexps",
".",
"password",
";",
"// display a strength indicator",
"this",
".",
"options",
".",
"strengthIndicator",
"=",
"YAHOO",
".",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"strengthIndicator",
")",
"?",
"false",
":",
"options",
".",
"strengthIndicator",
";",
"// capsLockWarning",
"this",
".",
"options",
".",
"capsLockWarning",
"=",
"YAHOO",
".",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"capsLockWarning",
")",
"?",
"false",
":",
"options",
".",
"capsLockWarning",
";",
"// confirm option, pass the id of the password field to confirm",
"inputEx",
".",
"PasswordField",
".",
"byId",
"[",
"options",
".",
"id",
"]",
"=",
"this",
";",
"var",
"passwordField",
";",
"if",
"(",
"options",
".",
"confirm",
"&&",
"(",
"passwordField",
"=",
"inputEx",
".",
"PasswordField",
".",
"byId",
"[",
"options",
".",
"confirm",
"]",
")",
")",
"{",
"this",
".",
"setConfirmationField",
"(",
"passwordField",
")",
";",
"}",
"}"
]
| Add the password regexp, strengthIndicator, capsLockWarning
@param {Object} options Options object as passed to the constructor | [
"Add",
"the",
"password",
"regexp",
"strengthIndicator",
"capsLockWarning"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L5444-L5464 |
|
42,689 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
// IE doesn't want to set the "type" property to 'password' if the node has a parent
// even if the parent is not in the DOM yet !!
// This element wraps the input node in a float: none div
this.wrapEl = inputEx.cn('div', {className: 'inputEx-StringField-wrapper'});
// Attributes of the input field
var attributes = {};
attributes.type = 'password';
attributes.size = this.options.size;
if(this.options.name) attributes.name = this.options.name;
// Create the node
this.el = inputEx.cn('input', attributes);
//inputEx.PasswordField.byId
// Append it to the main element
this.wrapEl.appendChild(this.el);
this.fieldContainer.appendChild(this.wrapEl);
// Caps lock warning
if(this.options.capsLockWarning) {
this.capsLockWarning = inputEx.cn('div',{className: 'capsLockWarning'},{display: 'none'},inputEx.messages.capslockWarning);
this.wrapEl.appendChild(this.capsLockWarning);
}
// Password strength indicator
if(this.options.strengthIndicator) {
this.strengthEl = inputEx.cn('div', {className: 'inputEx-Password-StrengthIndicator'}, null, inputEx.messages.passwordStrength);
this.strengthBlocks = [];
for(var i = 0 ; i < 4 ; i++) {
this.strengthBlocks[i] = inputEx.cn('div', {className: 'inputEx-Password-StrengthIndicatorBlock'});
this.strengthEl.appendChild( this.strengthBlocks[i] );
}
this.wrapEl.appendChild(this.strengthEl);
}
} | javascript | function() {
// IE doesn't want to set the "type" property to 'password' if the node has a parent
// even if the parent is not in the DOM yet !!
// This element wraps the input node in a float: none div
this.wrapEl = inputEx.cn('div', {className: 'inputEx-StringField-wrapper'});
// Attributes of the input field
var attributes = {};
attributes.type = 'password';
attributes.size = this.options.size;
if(this.options.name) attributes.name = this.options.name;
// Create the node
this.el = inputEx.cn('input', attributes);
//inputEx.PasswordField.byId
// Append it to the main element
this.wrapEl.appendChild(this.el);
this.fieldContainer.appendChild(this.wrapEl);
// Caps lock warning
if(this.options.capsLockWarning) {
this.capsLockWarning = inputEx.cn('div',{className: 'capsLockWarning'},{display: 'none'},inputEx.messages.capslockWarning);
this.wrapEl.appendChild(this.capsLockWarning);
}
// Password strength indicator
if(this.options.strengthIndicator) {
this.strengthEl = inputEx.cn('div', {className: 'inputEx-Password-StrengthIndicator'}, null, inputEx.messages.passwordStrength);
this.strengthBlocks = [];
for(var i = 0 ; i < 4 ; i++) {
this.strengthBlocks[i] = inputEx.cn('div', {className: 'inputEx-Password-StrengthIndicatorBlock'});
this.strengthEl.appendChild( this.strengthBlocks[i] );
}
this.wrapEl.appendChild(this.strengthEl);
}
} | [
"function",
"(",
")",
"{",
"// IE doesn't want to set the \"type\" property to 'password' if the node has a parent",
"// even if the parent is not in the DOM yet !!",
"// This element wraps the input node in a float: none div",
"this",
".",
"wrapEl",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"'inputEx-StringField-wrapper'",
"}",
")",
";",
"// Attributes of the input field",
"var",
"attributes",
"=",
"{",
"}",
";",
"attributes",
".",
"type",
"=",
"'password'",
";",
"attributes",
".",
"size",
"=",
"this",
".",
"options",
".",
"size",
";",
"if",
"(",
"this",
".",
"options",
".",
"name",
")",
"attributes",
".",
"name",
"=",
"this",
".",
"options",
".",
"name",
";",
"// Create the node",
"this",
".",
"el",
"=",
"inputEx",
".",
"cn",
"(",
"'input'",
",",
"attributes",
")",
";",
"//inputEx.PasswordField.byId",
"// Append it to the main element",
"this",
".",
"wrapEl",
".",
"appendChild",
"(",
"this",
".",
"el",
")",
";",
"this",
".",
"fieldContainer",
".",
"appendChild",
"(",
"this",
".",
"wrapEl",
")",
";",
"// Caps lock warning",
"if",
"(",
"this",
".",
"options",
".",
"capsLockWarning",
")",
"{",
"this",
".",
"capsLockWarning",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"'capsLockWarning'",
"}",
",",
"{",
"display",
":",
"'none'",
"}",
",",
"inputEx",
".",
"messages",
".",
"capslockWarning",
")",
";",
"this",
".",
"wrapEl",
".",
"appendChild",
"(",
"this",
".",
"capsLockWarning",
")",
";",
"}",
"// Password strength indicator",
"if",
"(",
"this",
".",
"options",
".",
"strengthIndicator",
")",
"{",
"this",
".",
"strengthEl",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"'inputEx-Password-StrengthIndicator'",
"}",
",",
"null",
",",
"inputEx",
".",
"messages",
".",
"passwordStrength",
")",
";",
"this",
".",
"strengthBlocks",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"4",
";",
"i",
"++",
")",
"{",
"this",
".",
"strengthBlocks",
"[",
"i",
"]",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"'inputEx-Password-StrengthIndicatorBlock'",
"}",
")",
";",
"this",
".",
"strengthEl",
".",
"appendChild",
"(",
"this",
".",
"strengthBlocks",
"[",
"i",
"]",
")",
";",
"}",
"this",
".",
"wrapEl",
".",
"appendChild",
"(",
"this",
".",
"strengthEl",
")",
";",
"}",
"}"
]
| Set the el type to 'password' | [
"Set",
"the",
"el",
"type",
"to",
"password"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L5469-L5507 |
|
42,690 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function() {
if(this.options.confirmPasswordField) {
if(this.options.confirmPasswordField.getValue() != this.getValue() ) {
return false;
}
}
return inputEx.PasswordField.superclass.validate.call(this);
} | javascript | function() {
if(this.options.confirmPasswordField) {
if(this.options.confirmPasswordField.getValue() != this.getValue() ) {
return false;
}
}
return inputEx.PasswordField.superclass.validate.call(this);
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"options",
".",
"confirmPasswordField",
")",
"{",
"if",
"(",
"this",
".",
"options",
".",
"confirmPasswordField",
".",
"getValue",
"(",
")",
"!=",
"this",
".",
"getValue",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"}",
"return",
"inputEx",
".",
"PasswordField",
".",
"superclass",
".",
"validate",
".",
"call",
"(",
"this",
")",
";",
"}"
]
| The validation adds the confirmation password field support | [
"The",
"validation",
"adds",
"the",
"confirmation",
"password",
"field",
"support"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L5522-L5529 |
|
42,691 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(e) {
inputEx.PasswordField.superclass.onInput.call(this,e);
if(this.options.confirmationPasswordField) {
this.options.confirmationPasswordField.setClassFromState();
}
} | javascript | function(e) {
inputEx.PasswordField.superclass.onInput.call(this,e);
if(this.options.confirmationPasswordField) {
this.options.confirmationPasswordField.setClassFromState();
}
} | [
"function",
"(",
"e",
")",
"{",
"inputEx",
".",
"PasswordField",
".",
"superclass",
".",
"onInput",
".",
"call",
"(",
"this",
",",
"e",
")",
";",
"if",
"(",
"this",
".",
"options",
".",
"confirmationPasswordField",
")",
"{",
"this",
".",
"options",
".",
"confirmationPasswordField",
".",
"setClassFromState",
"(",
")",
";",
"}",
"}"
]
| Update the state of the confirmation field
@param {Event} e The original input event | [
"Update",
"the",
"state",
"of",
"the",
"confirmation",
"field"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L5545-L5550 |
|
42,692 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(e) {
inputEx.PasswordField.superclass.onKeyPress.call(this,e);
if(this.options.capsLockWarning) {
var ev = e ? e : window.event;
if (!ev) {
return;
}
var targ = ev.target ? ev.target : ev.srcElement;
// get key pressed
var which = -1;
if (ev.which) {
which = ev.which;
} else if (ev.keyCode) {
which = ev.keyCode;
}
// get shift status
var shift_status = false;
if (ev.shiftKey) {
shift_status = ev.shiftKey;
} else if (ev.modifiers) {
shift_status = !!(ev.modifiers & 4);
}
var displayWarning = ((which >= 65 && which <= 90) && !shift_status) ||
((which >= 97 && which <= 122) && shift_status);
this.setCapsLockWarning(displayWarning);
}
} | javascript | function(e) {
inputEx.PasswordField.superclass.onKeyPress.call(this,e);
if(this.options.capsLockWarning) {
var ev = e ? e : window.event;
if (!ev) {
return;
}
var targ = ev.target ? ev.target : ev.srcElement;
// get key pressed
var which = -1;
if (ev.which) {
which = ev.which;
} else if (ev.keyCode) {
which = ev.keyCode;
}
// get shift status
var shift_status = false;
if (ev.shiftKey) {
shift_status = ev.shiftKey;
} else if (ev.modifiers) {
shift_status = !!(ev.modifiers & 4);
}
var displayWarning = ((which >= 65 && which <= 90) && !shift_status) ||
((which >= 97 && which <= 122) && shift_status);
this.setCapsLockWarning(displayWarning);
}
} | [
"function",
"(",
"e",
")",
"{",
"inputEx",
".",
"PasswordField",
".",
"superclass",
".",
"onKeyPress",
".",
"call",
"(",
"this",
",",
"e",
")",
";",
"if",
"(",
"this",
".",
"options",
".",
"capsLockWarning",
")",
"{",
"var",
"ev",
"=",
"e",
"?",
"e",
":",
"window",
".",
"event",
";",
"if",
"(",
"!",
"ev",
")",
"{",
"return",
";",
"}",
"var",
"targ",
"=",
"ev",
".",
"target",
"?",
"ev",
".",
"target",
":",
"ev",
".",
"srcElement",
";",
"// get key pressed",
"var",
"which",
"=",
"-",
"1",
";",
"if",
"(",
"ev",
".",
"which",
")",
"{",
"which",
"=",
"ev",
".",
"which",
";",
"}",
"else",
"if",
"(",
"ev",
".",
"keyCode",
")",
"{",
"which",
"=",
"ev",
".",
"keyCode",
";",
"}",
"// get shift status",
"var",
"shift_status",
"=",
"false",
";",
"if",
"(",
"ev",
".",
"shiftKey",
")",
"{",
"shift_status",
"=",
"ev",
".",
"shiftKey",
";",
"}",
"else",
"if",
"(",
"ev",
".",
"modifiers",
")",
"{",
"shift_status",
"=",
"!",
"!",
"(",
"ev",
".",
"modifiers",
"&",
"4",
")",
";",
"}",
"var",
"displayWarning",
"=",
"(",
"(",
"which",
">=",
"65",
"&&",
"which",
"<=",
"90",
")",
"&&",
"!",
"shift_status",
")",
"||",
"(",
"(",
"which",
">=",
"97",
"&&",
"which",
"<=",
"122",
")",
"&&",
"shift_status",
")",
";",
"this",
".",
"setCapsLockWarning",
"(",
"displayWarning",
")",
";",
"}",
"}"
]
| callback to display the capsLockWarning | [
"callback",
"to",
"display",
"the",
"capsLockWarning"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L5555-L5584 |
|
42,693 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function(e) {
inputEx.PasswordField.superclass.onKeyUp.call(this,e);
if(this.options.strengthIndicator) {
lang.later( 0, this, this.updateStrengthIndicator);
}
} | javascript | function(e) {
inputEx.PasswordField.superclass.onKeyUp.call(this,e);
if(this.options.strengthIndicator) {
lang.later( 0, this, this.updateStrengthIndicator);
}
} | [
"function",
"(",
"e",
")",
"{",
"inputEx",
".",
"PasswordField",
".",
"superclass",
".",
"onKeyUp",
".",
"call",
"(",
"this",
",",
"e",
")",
";",
"if",
"(",
"this",
".",
"options",
".",
"strengthIndicator",
")",
"{",
"lang",
".",
"later",
"(",
"0",
",",
"this",
",",
"this",
".",
"updateStrengthIndicator",
")",
";",
"}",
"}"
]
| onkeyup callback to update the strength indicator | [
"onkeyup",
"callback",
"to",
"update",
"the",
"strength",
"indicator"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L5589-L5594 |
|
42,694 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function (options) {
var i, length;
inputEx.RadioField.superclass.setOptions.call(this, options);
// Display mode
this.options.display = options.display === "vertically" ? "vertically" : "inline"; // default "inline"
// Classname
this.options.className = options.className ? options.className : 'inputEx-Field inputEx-RadioField';
if (this.options.display === "vertically") {
this.options.className += ' inputEx-RadioField-Vertically';
}
// Choices creation
// Retro-compatibility with old pattern (DEPRECATED since 2010-06-30)
if (lang.isArray(options.values)) {
this.options.choices = [];
for (i = 0, length = options.values.length; i < length; i += 1) {
this.options.choices.push({ value: options.values[i], label: options.choices[i] });
}
// New pattern to define choices
} else {
this.options.choices = options.choices; // ['val1','val2'] or [{ value: 'val1', label: '1st Choice' }, etc.]
}
if (lang.isUndefined(options.allowAny) || options.allowAny === false ) {
this.options.allowAny = false;
} else {
this.options.allowAny = {};
if (lang.isArray(options.allowAny.separators)) { this.options.allowAny.separators = options.allowAny.separators;}
this.options.allowAny.validator = lang.isFunction(options.allowAny.validator) ? options.allowAny.validator : function (val) {return true;};
this.options.allowAny.value = !lang.isUndefined(options.allowAny.value) ? options.allowAny.value : "";
this.options.allowAny.field = lang.isUndefined(options.allowAny.field) ? { type: "string", value: this.options.allowAny.value } : options.allowAny.field;
}
} | javascript | function (options) {
var i, length;
inputEx.RadioField.superclass.setOptions.call(this, options);
// Display mode
this.options.display = options.display === "vertically" ? "vertically" : "inline"; // default "inline"
// Classname
this.options.className = options.className ? options.className : 'inputEx-Field inputEx-RadioField';
if (this.options.display === "vertically") {
this.options.className += ' inputEx-RadioField-Vertically';
}
// Choices creation
// Retro-compatibility with old pattern (DEPRECATED since 2010-06-30)
if (lang.isArray(options.values)) {
this.options.choices = [];
for (i = 0, length = options.values.length; i < length; i += 1) {
this.options.choices.push({ value: options.values[i], label: options.choices[i] });
}
// New pattern to define choices
} else {
this.options.choices = options.choices; // ['val1','val2'] or [{ value: 'val1', label: '1st Choice' }, etc.]
}
if (lang.isUndefined(options.allowAny) || options.allowAny === false ) {
this.options.allowAny = false;
} else {
this.options.allowAny = {};
if (lang.isArray(options.allowAny.separators)) { this.options.allowAny.separators = options.allowAny.separators;}
this.options.allowAny.validator = lang.isFunction(options.allowAny.validator) ? options.allowAny.validator : function (val) {return true;};
this.options.allowAny.value = !lang.isUndefined(options.allowAny.value) ? options.allowAny.value : "";
this.options.allowAny.field = lang.isUndefined(options.allowAny.field) ? { type: "string", value: this.options.allowAny.value } : options.allowAny.field;
}
} | [
"function",
"(",
"options",
")",
"{",
"var",
"i",
",",
"length",
";",
"inputEx",
".",
"RadioField",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"// Display mode",
"this",
".",
"options",
".",
"display",
"=",
"options",
".",
"display",
"===",
"\"vertically\"",
"?",
"\"vertically\"",
":",
"\"inline\"",
";",
"// default \"inline\"",
"// Classname",
"this",
".",
"options",
".",
"className",
"=",
"options",
".",
"className",
"?",
"options",
".",
"className",
":",
"'inputEx-Field inputEx-RadioField'",
";",
"if",
"(",
"this",
".",
"options",
".",
"display",
"===",
"\"vertically\"",
")",
"{",
"this",
".",
"options",
".",
"className",
"+=",
"' inputEx-RadioField-Vertically'",
";",
"}",
"// Choices creation",
"// Retro-compatibility with old pattern (DEPRECATED since 2010-06-30)",
"if",
"(",
"lang",
".",
"isArray",
"(",
"options",
".",
"values",
")",
")",
"{",
"this",
".",
"options",
".",
"choices",
"=",
"[",
"]",
";",
"for",
"(",
"i",
"=",
"0",
",",
"length",
"=",
"options",
".",
"values",
".",
"length",
";",
"i",
"<",
"length",
";",
"i",
"+=",
"1",
")",
"{",
"this",
".",
"options",
".",
"choices",
".",
"push",
"(",
"{",
"value",
":",
"options",
".",
"values",
"[",
"i",
"]",
",",
"label",
":",
"options",
".",
"choices",
"[",
"i",
"]",
"}",
")",
";",
"}",
"// New pattern to define choices",
"}",
"else",
"{",
"this",
".",
"options",
".",
"choices",
"=",
"options",
".",
"choices",
";",
"// ['val1','val2'] or [{ value: 'val1', label: '1st Choice' }, etc.]",
"}",
"if",
"(",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"allowAny",
")",
"||",
"options",
".",
"allowAny",
"===",
"false",
")",
"{",
"this",
".",
"options",
".",
"allowAny",
"=",
"false",
";",
"}",
"else",
"{",
"this",
".",
"options",
".",
"allowAny",
"=",
"{",
"}",
";",
"if",
"(",
"lang",
".",
"isArray",
"(",
"options",
".",
"allowAny",
".",
"separators",
")",
")",
"{",
"this",
".",
"options",
".",
"allowAny",
".",
"separators",
"=",
"options",
".",
"allowAny",
".",
"separators",
";",
"}",
"this",
".",
"options",
".",
"allowAny",
".",
"validator",
"=",
"lang",
".",
"isFunction",
"(",
"options",
".",
"allowAny",
".",
"validator",
")",
"?",
"options",
".",
"allowAny",
".",
"validator",
":",
"function",
"(",
"val",
")",
"{",
"return",
"true",
";",
"}",
";",
"this",
".",
"options",
".",
"allowAny",
".",
"value",
"=",
"!",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"allowAny",
".",
"value",
")",
"?",
"options",
".",
"allowAny",
".",
"value",
":",
"\"\"",
";",
"this",
".",
"options",
".",
"allowAny",
".",
"field",
"=",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"allowAny",
".",
"field",
")",
"?",
"{",
"type",
":",
"\"string\"",
",",
"value",
":",
"this",
".",
"options",
".",
"allowAny",
".",
"value",
"}",
":",
"options",
".",
"allowAny",
".",
"field",
";",
"}",
"}"
]
| Adds the Radio button specific options
@param {Object} options Options object as passed to the constructor | [
"Adds",
"the",
"Radio",
"button",
"specific",
"options"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L5713-L5756 |
|
42,695 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function () {
// Delegate event listening because list of choices is dynamic
// so we can't listen on each <input type="radio" class='inputEx-RadioField-radio' />
// Change event (IE does not fire "change" event, so listen to click instead)
Event.delegate(this.fieldContainer, YAHOO.env.ua.ie ? "click" : "change", function(e, matchedEl, container) {
this.onChange(e);
}, "input.inputEx-RadioField-radio", this, true);
// Focus / Blur events
Event.delegate(this.fieldContainer, "focusin", function(e, matchedEl, container) {
this.onFocus(e);
}, "input.inputEx-RadioField-radio", this, true);
Event.delegate(this.fieldContainer, "focusout", function(e, matchedEl, container) {
this.onBlur(e);
}, "input.inputEx-RadioField-radio", this, true);
// AnyField events
if (this.allowAnyChoice) {
this.anyField.updatedEvt.subscribe(function (e, params) {
var value = params[0];
this.radioAny.value = value;
this.setClassFromState();
inputEx.RadioField.superclass.onChange.call(this,e);
}, this, true);
// Update radio field style after editing anyField content !
Event.addBlurListener(this.anyField.el, this.onBlur, this, true);
}
} | javascript | function () {
// Delegate event listening because list of choices is dynamic
// so we can't listen on each <input type="radio" class='inputEx-RadioField-radio' />
// Change event (IE does not fire "change" event, so listen to click instead)
Event.delegate(this.fieldContainer, YAHOO.env.ua.ie ? "click" : "change", function(e, matchedEl, container) {
this.onChange(e);
}, "input.inputEx-RadioField-radio", this, true);
// Focus / Blur events
Event.delegate(this.fieldContainer, "focusin", function(e, matchedEl, container) {
this.onFocus(e);
}, "input.inputEx-RadioField-radio", this, true);
Event.delegate(this.fieldContainer, "focusout", function(e, matchedEl, container) {
this.onBlur(e);
}, "input.inputEx-RadioField-radio", this, true);
// AnyField events
if (this.allowAnyChoice) {
this.anyField.updatedEvt.subscribe(function (e, params) {
var value = params[0];
this.radioAny.value = value;
this.setClassFromState();
inputEx.RadioField.superclass.onChange.call(this,e);
}, this, true);
// Update radio field style after editing anyField content !
Event.addBlurListener(this.anyField.el, this.onBlur, this, true);
}
} | [
"function",
"(",
")",
"{",
"// Delegate event listening because list of choices is dynamic",
"// so we can't listen on each <input type=\"radio\" class='inputEx-RadioField-radio' />",
"// Change event (IE does not fire \"change\" event, so listen to click instead)",
"Event",
".",
"delegate",
"(",
"this",
".",
"fieldContainer",
",",
"YAHOO",
".",
"env",
".",
"ua",
".",
"ie",
"?",
"\"click\"",
":",
"\"change\"",
",",
"function",
"(",
"e",
",",
"matchedEl",
",",
"container",
")",
"{",
"this",
".",
"onChange",
"(",
"e",
")",
";",
"}",
",",
"\"input.inputEx-RadioField-radio\"",
",",
"this",
",",
"true",
")",
";",
"// Focus / Blur events",
"Event",
".",
"delegate",
"(",
"this",
".",
"fieldContainer",
",",
"\"focusin\"",
",",
"function",
"(",
"e",
",",
"matchedEl",
",",
"container",
")",
"{",
"this",
".",
"onFocus",
"(",
"e",
")",
";",
"}",
",",
"\"input.inputEx-RadioField-radio\"",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"delegate",
"(",
"this",
".",
"fieldContainer",
",",
"\"focusout\"",
",",
"function",
"(",
"e",
",",
"matchedEl",
",",
"container",
")",
"{",
"this",
".",
"onBlur",
"(",
"e",
")",
";",
"}",
",",
"\"input.inputEx-RadioField-radio\"",
",",
"this",
",",
"true",
")",
";",
"// AnyField events",
"if",
"(",
"this",
".",
"allowAnyChoice",
")",
"{",
"this",
".",
"anyField",
".",
"updatedEvt",
".",
"subscribe",
"(",
"function",
"(",
"e",
",",
"params",
")",
"{",
"var",
"value",
"=",
"params",
"[",
"0",
"]",
";",
"this",
".",
"radioAny",
".",
"value",
"=",
"value",
";",
"this",
".",
"setClassFromState",
"(",
")",
";",
"inputEx",
".",
"RadioField",
".",
"superclass",
".",
"onChange",
".",
"call",
"(",
"this",
",",
"e",
")",
";",
"}",
",",
"this",
",",
"true",
")",
";",
"// Update radio field style after editing anyField content !",
"Event",
".",
"addBlurListener",
"(",
"this",
".",
"anyField",
".",
"el",
",",
"this",
".",
"onBlur",
",",
"this",
",",
"true",
")",
";",
"}",
"}"
]
| Listen for change events on all radios | [
"Listen",
"for",
"change",
"events",
"on",
"all",
"radios"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L5813-L5849 |
|
42,696 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function () {
var i, length;
for (i = 0, length = this.choicesList.length ; i < length ; i += 1) {
if (this.choicesList[i].node.firstChild.checked) {
Dom.addClass(this.choicesList[i].node,"inputEx-selected");
} else {
Dom.removeClass(this.choicesList[i].node,"inputEx-selected");
}
}
} | javascript | function () {
var i, length;
for (i = 0, length = this.choicesList.length ; i < length ; i += 1) {
if (this.choicesList[i].node.firstChild.checked) {
Dom.addClass(this.choicesList[i].node,"inputEx-selected");
} else {
Dom.removeClass(this.choicesList[i].node,"inputEx-selected");
}
}
} | [
"function",
"(",
")",
"{",
"var",
"i",
",",
"length",
";",
"for",
"(",
"i",
"=",
"0",
",",
"length",
"=",
"this",
".",
"choicesList",
".",
"length",
";",
"i",
"<",
"length",
";",
"i",
"+=",
"1",
")",
"{",
"if",
"(",
"this",
".",
"choicesList",
"[",
"i",
"]",
".",
"node",
".",
"firstChild",
".",
"checked",
")",
"{",
"Dom",
".",
"addClass",
"(",
"this",
".",
"choicesList",
"[",
"i",
"]",
".",
"node",
",",
"\"inputEx-selected\"",
")",
";",
"}",
"else",
"{",
"Dom",
".",
"removeClass",
"(",
"this",
".",
"choicesList",
"[",
"i",
"]",
".",
"node",
",",
"\"inputEx-selected\"",
")",
";",
"}",
"}",
"}"
]
| Add an additional class to the currently selected inputEx-RadioField-choice | [
"Add",
"an",
"additional",
"class",
"to",
"the",
"currently",
"selected",
"inputEx",
"-",
"RadioField",
"-",
"choice"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L5854-L5867 |
|
42,697 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function () {
var i, length;
for (i = 0, length = this.choicesList.length ; i < length ; i += 1) {
if (this.choicesList[i].node.firstChild.checked) {
if (this.radioAny && this.radioAny == this.choicesList[i].node.firstChild) {
return this.anyField.getValue();
}
return this.choicesList[i].value;
}
}
return "";
} | javascript | function () {
var i, length;
for (i = 0, length = this.choicesList.length ; i < length ; i += 1) {
if (this.choicesList[i].node.firstChild.checked) {
if (this.radioAny && this.radioAny == this.choicesList[i].node.firstChild) {
return this.anyField.getValue();
}
return this.choicesList[i].value;
}
}
return "";
} | [
"function",
"(",
")",
"{",
"var",
"i",
",",
"length",
";",
"for",
"(",
"i",
"=",
"0",
",",
"length",
"=",
"this",
".",
"choicesList",
".",
"length",
";",
"i",
"<",
"length",
";",
"i",
"+=",
"1",
")",
"{",
"if",
"(",
"this",
".",
"choicesList",
"[",
"i",
"]",
".",
"node",
".",
"firstChild",
".",
"checked",
")",
"{",
"if",
"(",
"this",
".",
"radioAny",
"&&",
"this",
".",
"radioAny",
"==",
"this",
".",
"choicesList",
"[",
"i",
"]",
".",
"node",
".",
"firstChild",
")",
"{",
"return",
"this",
".",
"anyField",
".",
"getValue",
"(",
")",
";",
"}",
"return",
"this",
".",
"choicesList",
"[",
"i",
"]",
".",
"value",
";",
"}",
"}",
"return",
"\"\"",
";",
"}"
]
| Get the field value
@return {Any} | [
"Get",
"the",
"field",
"value"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L5909-L5926 |
|
42,698 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function (value, sendUpdatedEvt) {
var checkAny = true, valueFound = false, i, length;
for (i = 0, length = this.choicesList.length ; i < length ; i += 1) {
// valueFound is a useful when "real" choice has a value equal to allowAny choice default value
// so we check only the first value-matching radio button
if (value === this.choicesList[i].value && !valueFound) {
this.choicesList[i].node.firstChild.checked = true;
valueFound = true;
checkAny = false;
} else {
this.choicesList[i].node.firstChild.checked = false;
}
}
// Option allowAny
if (this.radioAny) {
if (checkAny) {
this.radioAny.checked = true;
this.radioAny.value = value;
this.anyField.enable();
this.anyField.setValue(value, false);
} else {
this.anyField.disable();
}
}
// call parent class method to set style and fire updatedEvt
inputEx.RadioField.superclass.setValue.call(this, value, sendUpdatedEvt);
} | javascript | function (value, sendUpdatedEvt) {
var checkAny = true, valueFound = false, i, length;
for (i = 0, length = this.choicesList.length ; i < length ; i += 1) {
// valueFound is a useful when "real" choice has a value equal to allowAny choice default value
// so we check only the first value-matching radio button
if (value === this.choicesList[i].value && !valueFound) {
this.choicesList[i].node.firstChild.checked = true;
valueFound = true;
checkAny = false;
} else {
this.choicesList[i].node.firstChild.checked = false;
}
}
// Option allowAny
if (this.radioAny) {
if (checkAny) {
this.radioAny.checked = true;
this.radioAny.value = value;
this.anyField.enable();
this.anyField.setValue(value, false);
} else {
this.anyField.disable();
}
}
// call parent class method to set style and fire updatedEvt
inputEx.RadioField.superclass.setValue.call(this, value, sendUpdatedEvt);
} | [
"function",
"(",
"value",
",",
"sendUpdatedEvt",
")",
"{",
"var",
"checkAny",
"=",
"true",
",",
"valueFound",
"=",
"false",
",",
"i",
",",
"length",
";",
"for",
"(",
"i",
"=",
"0",
",",
"length",
"=",
"this",
".",
"choicesList",
".",
"length",
";",
"i",
"<",
"length",
";",
"i",
"+=",
"1",
")",
"{",
"// valueFound is a useful when \"real\" choice has a value equal to allowAny choice default value",
"// so we check only the first value-matching radio button",
"if",
"(",
"value",
"===",
"this",
".",
"choicesList",
"[",
"i",
"]",
".",
"value",
"&&",
"!",
"valueFound",
")",
"{",
"this",
".",
"choicesList",
"[",
"i",
"]",
".",
"node",
".",
"firstChild",
".",
"checked",
"=",
"true",
";",
"valueFound",
"=",
"true",
";",
"checkAny",
"=",
"false",
";",
"}",
"else",
"{",
"this",
".",
"choicesList",
"[",
"i",
"]",
".",
"node",
".",
"firstChild",
".",
"checked",
"=",
"false",
";",
"}",
"}",
"// Option allowAny",
"if",
"(",
"this",
".",
"radioAny",
")",
"{",
"if",
"(",
"checkAny",
")",
"{",
"this",
".",
"radioAny",
".",
"checked",
"=",
"true",
";",
"this",
".",
"radioAny",
".",
"value",
"=",
"value",
";",
"this",
".",
"anyField",
".",
"enable",
"(",
")",
";",
"this",
".",
"anyField",
".",
"setValue",
"(",
"value",
",",
"false",
")",
";",
"}",
"else",
"{",
"this",
".",
"anyField",
".",
"disable",
"(",
")",
";",
"}",
"}",
"// call parent class method to set style and fire updatedEvt",
"inputEx",
".",
"RadioField",
".",
"superclass",
".",
"setValue",
".",
"call",
"(",
"this",
",",
"value",
",",
"sendUpdatedEvt",
")",
";",
"}"
]
| Set the value of the Radio
@param {Any} value The value schould be one of this.options.values (which defaults to this.options.choices if missing) if allowAny option not true.
@param {boolean} [sendUpdatedEvt] (optional) Wether this setValue should fire the updatedEvt or not (default is true, pass false to NOT send the event) | [
"Set",
"the",
"value",
"of",
"the",
"Radio"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L5933-L5968 |
|
42,699 | neyric/webhookit | public/javascripts/inputex/build/inputex.js | function (sendUpdatedEvt) {
if (this.radioAny){
this.anyField.setValue(this.options.allowAny.value, false);
}
inputEx.RadioField.superclass.clear.call(this, sendUpdatedEvt);
} | javascript | function (sendUpdatedEvt) {
if (this.radioAny){
this.anyField.setValue(this.options.allowAny.value, false);
}
inputEx.RadioField.superclass.clear.call(this, sendUpdatedEvt);
} | [
"function",
"(",
"sendUpdatedEvt",
")",
"{",
"if",
"(",
"this",
".",
"radioAny",
")",
"{",
"this",
".",
"anyField",
".",
"setValue",
"(",
"this",
".",
"options",
".",
"allowAny",
".",
"value",
",",
"false",
")",
";",
"}",
"inputEx",
".",
"RadioField",
".",
"superclass",
".",
"clear",
".",
"call",
"(",
"this",
",",
"sendUpdatedEvt",
")",
";",
"}"
]
| Clear the field by setting the field value to this.options.value
@param {boolean} [sendUpdatedEvt] (optional) Wether this clear should fire the updatedEvt or not (default is true, pass false to NOT send the event) | [
"Clear",
"the",
"field",
"by",
"setting",
"the",
"field",
"value",
"to",
"this",
".",
"options",
".",
"value"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/build/inputex.js#L5974-L5981 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.