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,300 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
// Create the DIV element
this.el = WireIt.cn('div', {className: this.className} );
if(this.name) { this.el.title = this.name; }
// Set the offset position
this.setPosition(this.offsetPosition);
// Append the element to the parent
this.parentEl.appendChild(this.el);
} | javascript | function() {
// Create the DIV element
this.el = WireIt.cn('div', {className: this.className} );
if(this.name) { this.el.title = this.name; }
// Set the offset position
this.setPosition(this.offsetPosition);
// Append the element to the parent
this.parentEl.appendChild(this.el);
} | [
"function",
"(",
")",
"{",
"// Create the DIV element",
"this",
".",
"el",
"=",
"WireIt",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"this",
".",
"className",
"}",
")",
";",
"if",
"(",
"this",
".",
"name",
")",
"{",
"this",
".",
"el",
".",
"title",
"=",
"this",
".",
"name",
";",
"}",
"// Set the offset position",
"this",
".",
"setPosition",
"(",
"this",
".",
"offsetPosition",
")",
";",
"// Append the element to the parent",
"this",
".",
"parentEl",
".",
"appendChild",
"(",
"this",
".",
"el",
")",
";",
"}"
]
| Render the DOM of the terminal
@method render | [
"Render",
"the",
"DOM",
"of",
"the",
"terminal"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L1951-L1962 |
|
42,301 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(wire) {
// Adds this wire to the list of connected wires :
this.wires.push(wire);
// Set class indicating that the wire is connected
Dom.addClass(this.el, this.connectedClassName);
// Fire the event
this.eventAddWire.fire(wire);
} | javascript | function(wire) {
// Adds this wire to the list of connected wires :
this.wires.push(wire);
// Set class indicating that the wire is connected
Dom.addClass(this.el, this.connectedClassName);
// Fire the event
this.eventAddWire.fire(wire);
} | [
"function",
"(",
"wire",
")",
"{",
"// Adds this wire to the list of connected wires :",
"this",
".",
"wires",
".",
"push",
"(",
"wire",
")",
";",
"// Set class indicating that the wire is connected",
"Dom",
".",
"addClass",
"(",
"this",
".",
"el",
",",
"this",
".",
"connectedClassName",
")",
";",
"// Fire the event",
"this",
".",
"eventAddWire",
".",
"fire",
"(",
"wire",
")",
";",
"}"
]
| Add a wire to this terminal.
@method addWire
@param {WireIt.Wire} wire Wire instance to add | [
"Add",
"a",
"wire",
"to",
"this",
"terminal",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L1996-L2006 |
|
42,302 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(wire) {
var index = WireIt.indexOf(wire, this.wires);
if( index != -1 ) {
this.wires[index].destroy();
this.wires[index] = null;
this.wires = WireIt.compact(this.wires);
// Remove the connected class if it has no more wires:
if(this.wires.length === 0) {
Dom.removeClass(this.el, this.connectedClassName);
}
// Fire the event
this.eventRemoveWire.fire(wire);
}
} | javascript | function(wire) {
var index = WireIt.indexOf(wire, this.wires);
if( index != -1 ) {
this.wires[index].destroy();
this.wires[index] = null;
this.wires = WireIt.compact(this.wires);
// Remove the connected class if it has no more wires:
if(this.wires.length === 0) {
Dom.removeClass(this.el, this.connectedClassName);
}
// Fire the event
this.eventRemoveWire.fire(wire);
}
} | [
"function",
"(",
"wire",
")",
"{",
"var",
"index",
"=",
"WireIt",
".",
"indexOf",
"(",
"wire",
",",
"this",
".",
"wires",
")",
";",
"if",
"(",
"index",
"!=",
"-",
"1",
")",
"{",
"this",
".",
"wires",
"[",
"index",
"]",
".",
"destroy",
"(",
")",
";",
"this",
".",
"wires",
"[",
"index",
"]",
"=",
"null",
";",
"this",
".",
"wires",
"=",
"WireIt",
".",
"compact",
"(",
"this",
".",
"wires",
")",
";",
"// Remove the connected class if it has no more wires:",
"if",
"(",
"this",
".",
"wires",
".",
"length",
"===",
"0",
")",
"{",
"Dom",
".",
"removeClass",
"(",
"this",
".",
"el",
",",
"this",
".",
"connectedClassName",
")",
";",
"}",
"// Fire the event",
"this",
".",
"eventRemoveWire",
".",
"fire",
"(",
"wire",
")",
";",
"}",
"}"
]
| Remove a wire
@method removeWire
@param {WireIt.Wire} wire Wire instance to remove | [
"Remove",
"a",
"wire"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L2013-L2030 |
|
42,303 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
var layerEl = this.container && this.container.layer ? this.container.layer.el : document.body;
var obj = this.el;
var curleft = 0, curtop = 0;
if (obj.offsetParent) {
do {
curleft += obj.offsetLeft;
curtop += obj.offsetTop;
obj = obj.offsetParent;
} while ( !!obj && obj != layerEl);
}
return [curleft+15,curtop+15];
} | javascript | function() {
var layerEl = this.container && this.container.layer ? this.container.layer.el : document.body;
var obj = this.el;
var curleft = 0, curtop = 0;
if (obj.offsetParent) {
do {
curleft += obj.offsetLeft;
curtop += obj.offsetTop;
obj = obj.offsetParent;
} while ( !!obj && obj != layerEl);
}
return [curleft+15,curtop+15];
} | [
"function",
"(",
")",
"{",
"var",
"layerEl",
"=",
"this",
".",
"container",
"&&",
"this",
".",
"container",
".",
"layer",
"?",
"this",
".",
"container",
".",
"layer",
".",
"el",
":",
"document",
".",
"body",
";",
"var",
"obj",
"=",
"this",
".",
"el",
";",
"var",
"curleft",
"=",
"0",
",",
"curtop",
"=",
"0",
";",
"if",
"(",
"obj",
".",
"offsetParent",
")",
"{",
"do",
"{",
"curleft",
"+=",
"obj",
".",
"offsetLeft",
";",
"curtop",
"+=",
"obj",
".",
"offsetTop",
";",
"obj",
"=",
"obj",
".",
"offsetParent",
";",
"}",
"while",
"(",
"!",
"!",
"obj",
"&&",
"obj",
"!=",
"layerEl",
")",
";",
"}",
"return",
"[",
"curleft",
"+",
"15",
",",
"curtop",
"+",
"15",
"]",
";",
"}"
]
| This function is a temporary test. I added the border width while traversing the DOM and
I calculated the offset to center the wire in the terminal just after its creation
@method getXY | [
"This",
"function",
"is",
"a",
"temporary",
"test",
".",
"I",
"added",
"the",
"border",
"width",
"while",
"traversing",
"the",
"DOM",
"and",
"I",
"calculated",
"the",
"offset",
"to",
"center",
"the",
"wire",
"in",
"the",
"terminal",
"just",
"after",
"its",
"creation"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L2037-L2052 |
|
42,304 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
var terminalList = [];
if(this.wires) {
for(var i = 0 ; i < this.wires.length ; i++) {
terminalList.push(this.wires[i].getOtherTerminal(this));
}
}
return terminalList;
} | javascript | function() {
var terminalList = [];
if(this.wires) {
for(var i = 0 ; i < this.wires.length ; i++) {
terminalList.push(this.wires[i].getOtherTerminal(this));
}
}
return terminalList;
} | [
"function",
"(",
")",
"{",
"var",
"terminalList",
"=",
"[",
"]",
";",
"if",
"(",
"this",
".",
"wires",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"wires",
".",
"length",
";",
"i",
"++",
")",
"{",
"terminalList",
".",
"push",
"(",
"this",
".",
"wires",
"[",
"i",
"]",
".",
"getOtherTerminal",
"(",
"this",
")",
")",
";",
"}",
"}",
"return",
"terminalList",
";",
"}"
]
| Returns a list of all the terminals connecter to this terminal through its wires.
@method getConnectedTerminals
@return {Array} List of all connected terminals | [
"Returns",
"a",
"list",
"of",
"all",
"the",
"terminals",
"connecter",
"to",
"this",
"terminal",
"through",
"its",
"wires",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L2081-L2089 |
|
42,305 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(e) {
// Make sure terminalList is an array
var terminalList = YAHOO.lang.isArray(this._WireItTerminals) ? this._WireItTerminals : (this._WireItTerminals.isWireItTerminal ? [this._WireItTerminals] : []);
// Redraw all the wires
for(var i = 0 ; i < terminalList.length ; i++) {
if(terminalList[i].wires) {
for(var k = 0 ; k < terminalList[i].wires.length ; k++) {
terminalList[i].wires[k].redraw();
}
}
}
} | javascript | function(e) {
// Make sure terminalList is an array
var terminalList = YAHOO.lang.isArray(this._WireItTerminals) ? this._WireItTerminals : (this._WireItTerminals.isWireItTerminal ? [this._WireItTerminals] : []);
// Redraw all the wires
for(var i = 0 ; i < terminalList.length ; i++) {
if(terminalList[i].wires) {
for(var k = 0 ; k < terminalList[i].wires.length ; k++) {
terminalList[i].wires[k].redraw();
}
}
}
} | [
"function",
"(",
"e",
")",
"{",
"// Make sure terminalList is an array",
"var",
"terminalList",
"=",
"YAHOO",
".",
"lang",
".",
"isArray",
"(",
"this",
".",
"_WireItTerminals",
")",
"?",
"this",
".",
"_WireItTerminals",
":",
"(",
"this",
".",
"_WireItTerminals",
".",
"isWireItTerminal",
"?",
"[",
"this",
".",
"_WireItTerminals",
"]",
":",
"[",
"]",
")",
";",
"// Redraw all the wires",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"terminalList",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"terminalList",
"[",
"i",
"]",
".",
"wires",
")",
"{",
"for",
"(",
"var",
"k",
"=",
"0",
";",
"k",
"<",
"terminalList",
"[",
"i",
"]",
".",
"wires",
".",
"length",
";",
"k",
"++",
")",
"{",
"terminalList",
"[",
"i",
"]",
".",
"wires",
"[",
"k",
"]",
".",
"redraw",
"(",
")",
";",
"}",
"}",
"}",
"}"
]
| Override YAHOO.util.DD.prototype.onDrag to redraw the wires
@method onDrag | [
"Override",
"YAHOO",
".",
"util",
".",
"DD",
".",
"prototype",
".",
"onDrag",
"to",
"redraw",
"the",
"wires"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L2257-L2268 |
|
42,306 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(event, args) {
var size = args[0];
// TODO: do not hardcode those sizes !!
WireIt.sn(this.bodyEl, null, {width: (size[0]-14)+"px", height: (size[1]-( this.ddHandle ? 44 : 14) )+"px"});
} | javascript | function(event, args) {
var size = args[0];
// TODO: do not hardcode those sizes !!
WireIt.sn(this.bodyEl, null, {width: (size[0]-14)+"px", height: (size[1]-( this.ddHandle ? 44 : 14) )+"px"});
} | [
"function",
"(",
"event",
",",
"args",
")",
"{",
"var",
"size",
"=",
"args",
"[",
"0",
"]",
";",
"// TODO: do not hardcode those sizes !!",
"WireIt",
".",
"sn",
"(",
"this",
".",
"bodyEl",
",",
"null",
",",
"{",
"width",
":",
"(",
"size",
"[",
"0",
"]",
"-",
"14",
")",
"+",
"\"px\"",
",",
"height",
":",
"(",
"size",
"[",
"1",
"]",
"-",
"(",
"this",
".",
"ddHandle",
"?",
"44",
":",
"14",
")",
")",
"+",
"\"px\"",
"}",
")",
";",
"}"
]
| Function called when the container is being resized.
It sets the size of the body element of the container
@method onResize | [
"Function",
"called",
"when",
"the",
"container",
"is",
"being",
"resized",
".",
"It",
"sets",
"the",
"size",
"of",
"the",
"body",
"element",
"of",
"the",
"container"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L2613-L2617 |
|
42,307 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(content) {
if(typeof content == "string") {
this.bodyEl.innerHTML = content;
}
else {
this.bodyEl.innerHTML = "";
this.bodyEl.appendChild(content);
}
} | javascript | function(content) {
if(typeof content == "string") {
this.bodyEl.innerHTML = content;
}
else {
this.bodyEl.innerHTML = "";
this.bodyEl.appendChild(content);
}
} | [
"function",
"(",
"content",
")",
"{",
"if",
"(",
"typeof",
"content",
"==",
"\"string\"",
")",
"{",
"this",
".",
"bodyEl",
".",
"innerHTML",
"=",
"content",
";",
"}",
"else",
"{",
"this",
".",
"bodyEl",
".",
"innerHTML",
"=",
"\"\"",
";",
"this",
".",
"bodyEl",
".",
"appendChild",
"(",
"content",
")",
";",
"}",
"}"
]
| Sets the content of the body element
@method setBody
@param {String or HTMLElement} content | [
"Sets",
"the",
"content",
"of",
"the",
"body",
"element"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L2696-L2704 |
|
42,308 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(event, args) {
var wire = args[0];
// add the wire to the list if it isn't in
if( WireIt.indexOf(wire, this.wires) == -1 ) {
this.wires.push(wire);
this.eventAddWire.fire(wire);
}
} | javascript | function(event, args) {
var wire = args[0];
// add the wire to the list if it isn't in
if( WireIt.indexOf(wire, this.wires) == -1 ) {
this.wires.push(wire);
this.eventAddWire.fire(wire);
}
} | [
"function",
"(",
"event",
",",
"args",
")",
"{",
"var",
"wire",
"=",
"args",
"[",
"0",
"]",
";",
"// add the wire to the list if it isn't in",
"if",
"(",
"WireIt",
".",
"indexOf",
"(",
"wire",
",",
"this",
".",
"wires",
")",
"==",
"-",
"1",
")",
"{",
"this",
".",
"wires",
".",
"push",
"(",
"wire",
")",
";",
"this",
".",
"eventAddWire",
".",
"fire",
"(",
"wire",
")",
";",
"}",
"}"
]
| This method is called when a wire is added to one of the terminals
@method onAddWire
@param {Event} event The eventAddWire event fired by the terminal
@param {Array} args This array contains a single element args[0] which is the added Wire instance | [
"This",
"method",
"is",
"called",
"when",
"a",
"wire",
"is",
"added",
"to",
"one",
"of",
"the",
"terminals"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L2825-L2832 |
|
42,309 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(container) {
var index = WireIt.indexOf(container, this.containers);
if( index != -1 ) {
container.remove();
this.containers[index] = null;
this.containers = WireIt.compact(this.containers);
this.eventRemoveContainer.fire(container);
this.eventChanged.fire(this);
}
} | javascript | function(container) {
var index = WireIt.indexOf(container, this.containers);
if( index != -1 ) {
container.remove();
this.containers[index] = null;
this.containers = WireIt.compact(this.containers);
this.eventRemoveContainer.fire(container);
this.eventChanged.fire(this);
}
} | [
"function",
"(",
"container",
")",
"{",
"var",
"index",
"=",
"WireIt",
".",
"indexOf",
"(",
"container",
",",
"this",
".",
"containers",
")",
";",
"if",
"(",
"index",
"!=",
"-",
"1",
")",
"{",
"container",
".",
"remove",
"(",
")",
";",
"this",
".",
"containers",
"[",
"index",
"]",
"=",
"null",
";",
"this",
".",
"containers",
"=",
"WireIt",
".",
"compact",
"(",
"this",
".",
"containers",
")",
";",
"this",
".",
"eventRemoveContainer",
".",
"fire",
"(",
"container",
")",
";",
"this",
".",
"eventChanged",
".",
"fire",
"(",
"this",
")",
";",
"}",
"}"
]
| Remove a container
@method removeContainer
@param {WireIt.Container} container Container instance to remove | [
"Remove",
"a",
"container"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L3240-L3253 |
|
42,310 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(event, args) {
var wire = args[0];
// add the wire to the list if it isn't in
if( WireIt.indexOf(wire, this.wires) == -1 ) {
this.wires.push(wire);
if(this.enableMouseEvents) {
YAHOO.util.Event.addListener(wire.element, "mousemove", this.onWireMouseMove, this, true);
YAHOO.util.Event.addListener(wire.element, "click", this.onWireClick, this, true);
}
// Re-Fire an event at the layer level
this.eventAddWire.fire(wire);
// Fire the layer changed event
this.eventChanged.fire(this);
}
} | javascript | function(event, args) {
var wire = args[0];
// add the wire to the list if it isn't in
if( WireIt.indexOf(wire, this.wires) == -1 ) {
this.wires.push(wire);
if(this.enableMouseEvents) {
YAHOO.util.Event.addListener(wire.element, "mousemove", this.onWireMouseMove, this, true);
YAHOO.util.Event.addListener(wire.element, "click", this.onWireClick, this, true);
}
// Re-Fire an event at the layer level
this.eventAddWire.fire(wire);
// Fire the layer changed event
this.eventChanged.fire(this);
}
} | [
"function",
"(",
"event",
",",
"args",
")",
"{",
"var",
"wire",
"=",
"args",
"[",
"0",
"]",
";",
"// add the wire to the list if it isn't in",
"if",
"(",
"WireIt",
".",
"indexOf",
"(",
"wire",
",",
"this",
".",
"wires",
")",
"==",
"-",
"1",
")",
"{",
"this",
".",
"wires",
".",
"push",
"(",
"wire",
")",
";",
"if",
"(",
"this",
".",
"enableMouseEvents",
")",
"{",
"YAHOO",
".",
"util",
".",
"Event",
".",
"addListener",
"(",
"wire",
".",
"element",
",",
"\"mousemove\"",
",",
"this",
".",
"onWireMouseMove",
",",
"this",
",",
"true",
")",
";",
"YAHOO",
".",
"util",
".",
"Event",
".",
"addListener",
"(",
"wire",
".",
"element",
",",
"\"click\"",
",",
"this",
".",
"onWireClick",
",",
"this",
",",
"true",
")",
";",
"}",
"// Re-Fire an event at the layer level",
"this",
".",
"eventAddWire",
".",
"fire",
"(",
"wire",
")",
";",
"// Fire the layer changed event",
"this",
".",
"eventChanged",
".",
"fire",
"(",
"this",
")",
";",
"}",
"}"
]
| Update the wire list when any of the containers fired the eventAddWire
@method onAddWire
@param {Event} event The eventAddWire event fired by the container
@param {Array} args This array contains a single element args[0] which is the added Wire instance | [
"Update",
"the",
"wire",
"list",
"when",
"any",
"of",
"the",
"containers",
"fired",
"the",
"eventAddWire"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L3293-L3310 |
|
42,311 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(event, args) {
var wire = args[0];
var index = WireIt.indexOf(wire, this.wires);
if( index != -1 ) {
this.wires[index] = null;
this.wires = WireIt.compact(this.wires);
this.eventRemoveWire.fire(wire);
this.eventChanged.fire(this);
}
} | javascript | function(event, args) {
var wire = args[0];
var index = WireIt.indexOf(wire, this.wires);
if( index != -1 ) {
this.wires[index] = null;
this.wires = WireIt.compact(this.wires);
this.eventRemoveWire.fire(wire);
this.eventChanged.fire(this);
}
} | [
"function",
"(",
"event",
",",
"args",
")",
"{",
"var",
"wire",
"=",
"args",
"[",
"0",
"]",
";",
"var",
"index",
"=",
"WireIt",
".",
"indexOf",
"(",
"wire",
",",
"this",
".",
"wires",
")",
";",
"if",
"(",
"index",
"!=",
"-",
"1",
")",
"{",
"this",
".",
"wires",
"[",
"index",
"]",
"=",
"null",
";",
"this",
".",
"wires",
"=",
"WireIt",
".",
"compact",
"(",
"this",
".",
"wires",
")",
";",
"this",
".",
"eventRemoveWire",
".",
"fire",
"(",
"wire",
")",
";",
"this",
".",
"eventChanged",
".",
"fire",
"(",
"this",
")",
";",
"}",
"}"
]
| Update the wire list when a wire is removed
@method onRemoveWire
@param {Event} event The eventRemoveWire event fired by the container
@param {Array} args This array contains a single element args[0] which is the removed Wire instance | [
"Update",
"the",
"wire",
"list",
"when",
"a",
"wire",
"is",
"removed"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L3318-L3327 |
|
42,312 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
var i;
var obj = {containers: [], wires: []};
for( i = 0 ; i < this.containers.length ; i++) {
obj.containers.push( this.containers[i].getConfig() );
}
for( i = 0 ; i < this.wires.length ; i++) {
var wire = this.wires[i];
var wireObj = wire.getConfig();
wireObj.src = {moduleId: WireIt.indexOf(wire.terminal1.container, this.containers), terminal: wire.terminal1.name };
wireObj.tgt = {moduleId: WireIt.indexOf(wire.terminal2.container, this.containers), terminal: wire.terminal2.name };
obj.wires.push(wireObj);
}
return obj;
} | javascript | function() {
var i;
var obj = {containers: [], wires: []};
for( i = 0 ; i < this.containers.length ; i++) {
obj.containers.push( this.containers[i].getConfig() );
}
for( i = 0 ; i < this.wires.length ; i++) {
var wire = this.wires[i];
var wireObj = wire.getConfig();
wireObj.src = {moduleId: WireIt.indexOf(wire.terminal1.container, this.containers), terminal: wire.terminal1.name };
wireObj.tgt = {moduleId: WireIt.indexOf(wire.terminal2.container, this.containers), terminal: wire.terminal2.name };
obj.wires.push(wireObj);
}
return obj;
} | [
"function",
"(",
")",
"{",
"var",
"i",
";",
"var",
"obj",
"=",
"{",
"containers",
":",
"[",
"]",
",",
"wires",
":",
"[",
"]",
"}",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"containers",
".",
"length",
";",
"i",
"++",
")",
"{",
"obj",
".",
"containers",
".",
"push",
"(",
"this",
".",
"containers",
"[",
"i",
"]",
".",
"getConfig",
"(",
")",
")",
";",
"}",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"wires",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"wire",
"=",
"this",
".",
"wires",
"[",
"i",
"]",
";",
"var",
"wireObj",
"=",
"wire",
".",
"getConfig",
"(",
")",
";",
"wireObj",
".",
"src",
"=",
"{",
"moduleId",
":",
"WireIt",
".",
"indexOf",
"(",
"wire",
".",
"terminal1",
".",
"container",
",",
"this",
".",
"containers",
")",
",",
"terminal",
":",
"wire",
".",
"terminal1",
".",
"name",
"}",
";",
"wireObj",
".",
"tgt",
"=",
"{",
"moduleId",
":",
"WireIt",
".",
"indexOf",
"(",
"wire",
".",
"terminal2",
".",
"container",
",",
"this",
".",
"containers",
")",
",",
"terminal",
":",
"wire",
".",
"terminal2",
".",
"name",
"}",
";",
"obj",
".",
"wires",
".",
"push",
"(",
"wireObj",
")",
";",
"}",
"return",
"obj",
";",
"}"
]
| Return an object that represent the state of the layer including the containers and the wires
@method getWiring
@return {Obj} layer configuration | [
"Return",
"an",
"object",
"that",
"represent",
"the",
"state",
"of",
"the",
"layer",
"including",
"the",
"containers",
"and",
"the",
"wires"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L3354-L3372 |
|
42,313 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(wiring) {
this.clear();
var i;
if(YAHOO.lang.isArray(wiring.containers)) {
for(i = 0 ; i < wiring.containers.length ; i++) {
this.addContainer(wiring.containers[i]);
}
}
if(YAHOO.lang.isArray(wiring.wires)) {
for(i = 0 ; i < wiring.wires.length ; i++) {
this.addWire(wiring.wires[i]);
}
}
} | javascript | function(wiring) {
this.clear();
var i;
if(YAHOO.lang.isArray(wiring.containers)) {
for(i = 0 ; i < wiring.containers.length ; i++) {
this.addContainer(wiring.containers[i]);
}
}
if(YAHOO.lang.isArray(wiring.wires)) {
for(i = 0 ; i < wiring.wires.length ; i++) {
this.addWire(wiring.wires[i]);
}
}
} | [
"function",
"(",
"wiring",
")",
"{",
"this",
".",
"clear",
"(",
")",
";",
"var",
"i",
";",
"if",
"(",
"YAHOO",
".",
"lang",
".",
"isArray",
"(",
"wiring",
".",
"containers",
")",
")",
"{",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"wiring",
".",
"containers",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"addContainer",
"(",
"wiring",
".",
"containers",
"[",
"i",
"]",
")",
";",
"}",
"}",
"if",
"(",
"YAHOO",
".",
"lang",
".",
"isArray",
"(",
"wiring",
".",
"wires",
")",
")",
"{",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"wiring",
".",
"wires",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"addWire",
"(",
"wiring",
".",
"wires",
"[",
"i",
"]",
")",
";",
"}",
"}",
"}"
]
| Load a layer configuration object
@method setWiring
@param {Object} wiring layer configuration | [
"Load",
"a",
"layer",
"configuration",
"object"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L3379-L3392 |
|
42,314 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(e) {
var tgt = YAHOO.util.Event.getTarget(e);
var tgtPos = [tgt.offsetLeft, tgt.offsetTop];
return [tgtPos[0]+e.layerX, tgtPos[1]+e.layerY];
} | javascript | function(e) {
var tgt = YAHOO.util.Event.getTarget(e);
var tgtPos = [tgt.offsetLeft, tgt.offsetTop];
return [tgtPos[0]+e.layerX, tgtPos[1]+e.layerY];
} | [
"function",
"(",
"e",
")",
"{",
"var",
"tgt",
"=",
"YAHOO",
".",
"util",
".",
"Event",
".",
"getTarget",
"(",
"e",
")",
";",
"var",
"tgtPos",
"=",
"[",
"tgt",
".",
"offsetLeft",
",",
"tgt",
".",
"offsetTop",
"]",
";",
"return",
"[",
"tgtPos",
"[",
"0",
"]",
"+",
"e",
".",
"layerX",
",",
"tgtPos",
"[",
"1",
"]",
"+",
"e",
".",
"layerY",
"]",
";",
"}"
]
| Returns a position relative to the layer from a mouse event
@method _getMouseEvtPos
@param {Event} e Mouse event
@return {Array} position | [
"Returns",
"a",
"position",
"relative",
"to",
"the",
"layer",
"from",
"a",
"mouse",
"event"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L3400-L3404 |
|
42,315 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
var layer = this.layer;
Event.addListener(this.element, 'mousedown', this.onMouseDown, this, true);
Event.addListener(this.element, 'mouseup', this.onMouseUp, this, true);
Event.addListener(this.element, 'mousemove', this.onMouseMove, this, true);
Event.addListener(this.element, 'mouseout', this.onMouseUp, this, true);
layer.eventAddWire.subscribe(this.draw, this, true);
layer.eventRemoveWire.subscribe(this.draw, this, true);
layer.eventAddContainer.subscribe(this.draw, this, true);
layer.eventRemoveContainer.subscribe(this.draw, this, true);
layer.eventContainerDragged.subscribe(this.draw, this, true);
layer.eventContainerResized.subscribe(this.draw, this, true);
Event.addListener(this.layer.el, "scroll", this.onLayerScroll, this, true);
} | javascript | function() {
var layer = this.layer;
Event.addListener(this.element, 'mousedown', this.onMouseDown, this, true);
Event.addListener(this.element, 'mouseup', this.onMouseUp, this, true);
Event.addListener(this.element, 'mousemove', this.onMouseMove, this, true);
Event.addListener(this.element, 'mouseout', this.onMouseUp, this, true);
layer.eventAddWire.subscribe(this.draw, this, true);
layer.eventRemoveWire.subscribe(this.draw, this, true);
layer.eventAddContainer.subscribe(this.draw, this, true);
layer.eventRemoveContainer.subscribe(this.draw, this, true);
layer.eventContainerDragged.subscribe(this.draw, this, true);
layer.eventContainerResized.subscribe(this.draw, this, true);
Event.addListener(this.layer.el, "scroll", this.onLayerScroll, this, true);
} | [
"function",
"(",
")",
"{",
"var",
"layer",
"=",
"this",
".",
"layer",
";",
"Event",
".",
"addListener",
"(",
"this",
".",
"element",
",",
"'mousedown'",
",",
"this",
".",
"onMouseDown",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"addListener",
"(",
"this",
".",
"element",
",",
"'mouseup'",
",",
"this",
".",
"onMouseUp",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"addListener",
"(",
"this",
".",
"element",
",",
"'mousemove'",
",",
"this",
".",
"onMouseMove",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"addListener",
"(",
"this",
".",
"element",
",",
"'mouseout'",
",",
"this",
".",
"onMouseUp",
",",
"this",
",",
"true",
")",
";",
"layer",
".",
"eventAddWire",
".",
"subscribe",
"(",
"this",
".",
"draw",
",",
"this",
",",
"true",
")",
";",
"layer",
".",
"eventRemoveWire",
".",
"subscribe",
"(",
"this",
".",
"draw",
",",
"this",
",",
"true",
")",
";",
"layer",
".",
"eventAddContainer",
".",
"subscribe",
"(",
"this",
".",
"draw",
",",
"this",
",",
"true",
")",
";",
"layer",
".",
"eventRemoveContainer",
".",
"subscribe",
"(",
"this",
".",
"draw",
",",
"this",
",",
"true",
")",
";",
"layer",
".",
"eventContainerDragged",
".",
"subscribe",
"(",
"this",
".",
"draw",
",",
"this",
",",
"true",
")",
";",
"layer",
".",
"eventContainerResized",
".",
"subscribe",
"(",
"this",
".",
"draw",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"addListener",
"(",
"this",
".",
"layer",
".",
"el",
",",
"\"scroll\"",
",",
"this",
".",
"onLayerScroll",
",",
"this",
",",
"true",
")",
";",
"}"
]
| Listen for various events that should redraw the layer map
@method initEvents | [
"Listen",
"for",
"various",
"events",
"that",
"should",
"redraw",
"the",
"layer",
"map"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L3539-L3556 |
|
42,316 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(e, args) {
Event.stopEvent(e);
if(this.isMouseDown) {
this.scrollLayer(e.clientX,e.clientY);
}
} | javascript | function(e, args) {
Event.stopEvent(e);
if(this.isMouseDown) {
this.scrollLayer(e.clientX,e.clientY);
}
} | [
"function",
"(",
"e",
",",
"args",
")",
"{",
"Event",
".",
"stopEvent",
"(",
"e",
")",
";",
"if",
"(",
"this",
".",
"isMouseDown",
")",
"{",
"this",
".",
"scrollLayer",
"(",
"e",
".",
"clientX",
",",
"e",
".",
"clientY",
")",
";",
"}",
"}"
]
| When a mouse move is received
@method onMouseMove
@param {Event} e Original event
@param {Array} args event parameters | [
"When",
"a",
"mouse",
"move",
"is",
"received"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L3564-L3569 |
|
42,317 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
if(this.scrollTimer) { window.clearTimeout(this.scrollTimer); }
var that = this;
this.scrollTimer = window.setTimeout(function() {
that.draw();
},50);
} | javascript | function() {
if(this.scrollTimer) { window.clearTimeout(this.scrollTimer); }
var that = this;
this.scrollTimer = window.setTimeout(function() {
that.draw();
},50);
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"scrollTimer",
")",
"{",
"window",
".",
"clearTimeout",
"(",
"this",
".",
"scrollTimer",
")",
";",
"}",
"var",
"that",
"=",
"this",
";",
"this",
".",
"scrollTimer",
"=",
"window",
".",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"that",
".",
"draw",
"(",
")",
";",
"}",
",",
"50",
")",
";",
"}"
]
| Redraw after a timeout
@method onLayerScroll | [
"Redraw",
"after",
"a",
"timeout"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L3642-L3650 |
|
42,318 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
var ctxt=this.getContext();
// Canvas Region
var canvasRegion = Dom.getRegion(this.element);
var canvasWidth = canvasRegion.right-canvasRegion.left-4;
var canvasHeight = canvasRegion.bottom-canvasRegion.top-4;
// Clear Rect
ctxt.clearRect(0,0, canvasWidth, canvasHeight);
// Calculate ratio
var layerWidth = this.layer.el.scrollWidth;
var layerHeight = this.layer.el.scrollHeight;
var hRatio = Math.floor(100*canvasWidth/layerWidth)/100;
var vRatio = Math.floor(100*canvasHeight/layerHeight)/100;
// Draw the viewport
var region = Dom.getRegion(this.layer.el);
var viewportWidth = region.right-region.left;
var viewportHeight = region.bottom-region.top;
var viewportX = this.layer.el.scrollLeft;
var viewportY = this.layer.el.scrollTop;
ctxt.strokeStyle= "rgb(200, 50, 50)";
ctxt.lineWidth=1;
ctxt.strokeRect(viewportX*hRatio, viewportY*vRatio, viewportWidth*hRatio, viewportHeight*vRatio);
// Draw containers and wires
ctxt.fillStyle = this.style;
ctxt.strokeStyle= this.style;
ctxt.lineWidth=this.lineWidth;
this.drawContainers(ctxt, hRatio, vRatio);
this.drawWires(ctxt, hRatio, vRatio);
} | javascript | function() {
var ctxt=this.getContext();
// Canvas Region
var canvasRegion = Dom.getRegion(this.element);
var canvasWidth = canvasRegion.right-canvasRegion.left-4;
var canvasHeight = canvasRegion.bottom-canvasRegion.top-4;
// Clear Rect
ctxt.clearRect(0,0, canvasWidth, canvasHeight);
// Calculate ratio
var layerWidth = this.layer.el.scrollWidth;
var layerHeight = this.layer.el.scrollHeight;
var hRatio = Math.floor(100*canvasWidth/layerWidth)/100;
var vRatio = Math.floor(100*canvasHeight/layerHeight)/100;
// Draw the viewport
var region = Dom.getRegion(this.layer.el);
var viewportWidth = region.right-region.left;
var viewportHeight = region.bottom-region.top;
var viewportX = this.layer.el.scrollLeft;
var viewportY = this.layer.el.scrollTop;
ctxt.strokeStyle= "rgb(200, 50, 50)";
ctxt.lineWidth=1;
ctxt.strokeRect(viewportX*hRatio, viewportY*vRatio, viewportWidth*hRatio, viewportHeight*vRatio);
// Draw containers and wires
ctxt.fillStyle = this.style;
ctxt.strokeStyle= this.style;
ctxt.lineWidth=this.lineWidth;
this.drawContainers(ctxt, hRatio, vRatio);
this.drawWires(ctxt, hRatio, vRatio);
} | [
"function",
"(",
")",
"{",
"var",
"ctxt",
"=",
"this",
".",
"getContext",
"(",
")",
";",
"// Canvas Region",
"var",
"canvasRegion",
"=",
"Dom",
".",
"getRegion",
"(",
"this",
".",
"element",
")",
";",
"var",
"canvasWidth",
"=",
"canvasRegion",
".",
"right",
"-",
"canvasRegion",
".",
"left",
"-",
"4",
";",
"var",
"canvasHeight",
"=",
"canvasRegion",
".",
"bottom",
"-",
"canvasRegion",
".",
"top",
"-",
"4",
";",
"// Clear Rect",
"ctxt",
".",
"clearRect",
"(",
"0",
",",
"0",
",",
"canvasWidth",
",",
"canvasHeight",
")",
";",
"// Calculate ratio",
"var",
"layerWidth",
"=",
"this",
".",
"layer",
".",
"el",
".",
"scrollWidth",
";",
"var",
"layerHeight",
"=",
"this",
".",
"layer",
".",
"el",
".",
"scrollHeight",
";",
"var",
"hRatio",
"=",
"Math",
".",
"floor",
"(",
"100",
"*",
"canvasWidth",
"/",
"layerWidth",
")",
"/",
"100",
";",
"var",
"vRatio",
"=",
"Math",
".",
"floor",
"(",
"100",
"*",
"canvasHeight",
"/",
"layerHeight",
")",
"/",
"100",
";",
"// Draw the viewport",
"var",
"region",
"=",
"Dom",
".",
"getRegion",
"(",
"this",
".",
"layer",
".",
"el",
")",
";",
"var",
"viewportWidth",
"=",
"region",
".",
"right",
"-",
"region",
".",
"left",
";",
"var",
"viewportHeight",
"=",
"region",
".",
"bottom",
"-",
"region",
".",
"top",
";",
"var",
"viewportX",
"=",
"this",
".",
"layer",
".",
"el",
".",
"scrollLeft",
";",
"var",
"viewportY",
"=",
"this",
".",
"layer",
".",
"el",
".",
"scrollTop",
";",
"ctxt",
".",
"strokeStyle",
"=",
"\"rgb(200, 50, 50)\"",
";",
"ctxt",
".",
"lineWidth",
"=",
"1",
";",
"ctxt",
".",
"strokeRect",
"(",
"viewportX",
"*",
"hRatio",
",",
"viewportY",
"*",
"vRatio",
",",
"viewportWidth",
"*",
"hRatio",
",",
"viewportHeight",
"*",
"vRatio",
")",
";",
"// Draw containers and wires",
"ctxt",
".",
"fillStyle",
"=",
"this",
".",
"style",
";",
"ctxt",
".",
"strokeStyle",
"=",
"this",
".",
"style",
";",
"ctxt",
".",
"lineWidth",
"=",
"this",
".",
"lineWidth",
";",
"this",
".",
"drawContainers",
"(",
"ctxt",
",",
"hRatio",
",",
"vRatio",
")",
";",
"this",
".",
"drawWires",
"(",
"ctxt",
",",
"hRatio",
",",
"vRatio",
")",
";",
"}"
]
| Redraw the layer map
@method draw | [
"Redraw",
"the",
"layer",
"map"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L3656-L3689 |
|
42,319 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(ctxt, hRatio, vRatio) {
var containers = this.layer.containers;
var n = containers.length,i,gIS = WireIt.getIntStyle,containerEl;
for(i = 0 ; i < n ; i++) {
containerEl = containers[i].el;
ctxt.fillRect(gIS(containerEl, "left")*hRatio, gIS(containerEl, "top")*vRatio,
gIS(containerEl, "width")*hRatio, gIS(containerEl, "height")*vRatio);
}
} | javascript | function(ctxt, hRatio, vRatio) {
var containers = this.layer.containers;
var n = containers.length,i,gIS = WireIt.getIntStyle,containerEl;
for(i = 0 ; i < n ; i++) {
containerEl = containers[i].el;
ctxt.fillRect(gIS(containerEl, "left")*hRatio, gIS(containerEl, "top")*vRatio,
gIS(containerEl, "width")*hRatio, gIS(containerEl, "height")*vRatio);
}
} | [
"function",
"(",
"ctxt",
",",
"hRatio",
",",
"vRatio",
")",
"{",
"var",
"containers",
"=",
"this",
".",
"layer",
".",
"containers",
";",
"var",
"n",
"=",
"containers",
".",
"length",
",",
"i",
",",
"gIS",
"=",
"WireIt",
".",
"getIntStyle",
",",
"containerEl",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"n",
";",
"i",
"++",
")",
"{",
"containerEl",
"=",
"containers",
"[",
"i",
"]",
".",
"el",
";",
"ctxt",
".",
"fillRect",
"(",
"gIS",
"(",
"containerEl",
",",
"\"left\"",
")",
"*",
"hRatio",
",",
"gIS",
"(",
"containerEl",
",",
"\"top\"",
")",
"*",
"vRatio",
",",
"gIS",
"(",
"containerEl",
",",
"\"width\"",
")",
"*",
"hRatio",
",",
"gIS",
"(",
"containerEl",
",",
"\"height\"",
")",
"*",
"vRatio",
")",
";",
"}",
"}"
]
| Subroutine to draw the containers
@method drawContainers | [
"Subroutine",
"to",
"draw",
"the",
"containers"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L3695-L3703 |
|
42,320 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(ctxt, hRatio, vRatio) {
var wires = this.layer.wires;
var n = wires.length,i,wire;
for(i = 0 ; i < n ; i++) {
wire = wires[i];
var pos1 = wire.terminal1.getXY(),
pos2 = wire.terminal2.getXY();
// Stroked line
// TODO:
ctxt.beginPath();
ctxt.moveTo(pos1[0]*hRatio,pos1[1]*vRatio);
ctxt.lineTo(pos2[0]*hRatio,pos2[1]*vRatio);
ctxt.closePath();
ctxt.stroke();
}
} | javascript | function(ctxt, hRatio, vRatio) {
var wires = this.layer.wires;
var n = wires.length,i,wire;
for(i = 0 ; i < n ; i++) {
wire = wires[i];
var pos1 = wire.terminal1.getXY(),
pos2 = wire.terminal2.getXY();
// Stroked line
// TODO:
ctxt.beginPath();
ctxt.moveTo(pos1[0]*hRatio,pos1[1]*vRatio);
ctxt.lineTo(pos2[0]*hRatio,pos2[1]*vRatio);
ctxt.closePath();
ctxt.stroke();
}
} | [
"function",
"(",
"ctxt",
",",
"hRatio",
",",
"vRatio",
")",
"{",
"var",
"wires",
"=",
"this",
".",
"layer",
".",
"wires",
";",
"var",
"n",
"=",
"wires",
".",
"length",
",",
"i",
",",
"wire",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"n",
";",
"i",
"++",
")",
"{",
"wire",
"=",
"wires",
"[",
"i",
"]",
";",
"var",
"pos1",
"=",
"wire",
".",
"terminal1",
".",
"getXY",
"(",
")",
",",
"pos2",
"=",
"wire",
".",
"terminal2",
".",
"getXY",
"(",
")",
";",
"// Stroked line",
"// TODO:",
"ctxt",
".",
"beginPath",
"(",
")",
";",
"ctxt",
".",
"moveTo",
"(",
"pos1",
"[",
"0",
"]",
"*",
"hRatio",
",",
"pos1",
"[",
"1",
"]",
"*",
"vRatio",
")",
";",
"ctxt",
".",
"lineTo",
"(",
"pos2",
"[",
"0",
"]",
"*",
"hRatio",
",",
"pos2",
"[",
"1",
"]",
"*",
"vRatio",
")",
";",
"ctxt",
".",
"closePath",
"(",
")",
";",
"ctxt",
".",
"stroke",
"(",
")",
";",
"}",
"}"
]
| Subroutine to draw the wires
@method drawWires | [
"Subroutine",
"to",
"draw",
"the",
"wires"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L3709-L3726 |
|
42,321 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(arr) {
var n = [], l=arr.length,i;
for(i = 0 ; i < l ; i++) {
if( !lang.isNull(arr[i]) && !lang.isUndefined(arr[i]) ) {
n.push(arr[i]);
}
}
return n;
} | javascript | function(arr) {
var n = [], l=arr.length,i;
for(i = 0 ; i < l ; i++) {
if( !lang.isNull(arr[i]) && !lang.isUndefined(arr[i]) ) {
n.push(arr[i]);
}
}
return n;
} | [
"function",
"(",
"arr",
")",
"{",
"var",
"n",
"=",
"[",
"]",
",",
"l",
"=",
"arr",
".",
"length",
",",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"l",
";",
"i",
"++",
")",
"{",
"if",
"(",
"!",
"lang",
".",
"isNull",
"(",
"arr",
"[",
"i",
"]",
")",
"&&",
"!",
"lang",
".",
"isUndefined",
"(",
"arr",
"[",
"i",
"]",
")",
")",
"{",
"n",
".",
"push",
"(",
"arr",
"[",
"i",
"]",
")",
";",
"}",
"}",
"return",
"n",
";",
"}"
]
| Create a new array without the null or undefined values
@static
@param {Array} arr The array to compact
@return {Array} The new array | [
"Create",
"a",
"new",
"array",
"without",
"the",
"null",
"or",
"undefined",
"values"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L4197-L4205 |
|
42,322 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(state) {
if(state == inputEx.stateRequired) {
return this.options.messages.required;
}
else if(state == inputEx.stateInvalid) {
return this.options.messages.invalid;
}
else {
return '';
}
} | javascript | function(state) {
if(state == inputEx.stateRequired) {
return this.options.messages.required;
}
else if(state == inputEx.stateInvalid) {
return this.options.messages.invalid;
}
else {
return '';
}
} | [
"function",
"(",
"state",
")",
"{",
"if",
"(",
"state",
"==",
"inputEx",
".",
"stateRequired",
")",
"{",
"return",
"this",
".",
"options",
".",
"messages",
".",
"required",
";",
"}",
"else",
"if",
"(",
"state",
"==",
"inputEx",
".",
"stateInvalid",
")",
"{",
"return",
"this",
".",
"options",
".",
"messages",
".",
"invalid",
";",
"}",
"else",
"{",
"return",
"''",
";",
"}",
"}"
]
| Get the string for the given state | [
"Get",
"the",
"string",
"for",
"the",
"given",
"state"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L4447-L4457 |
|
42,323 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(msg) {
if(!this.fieldContainer) { return; }
if(!this.msgEl) {
this.msgEl = inputEx.cn('div', {className: 'inputEx-message'});
try{
var divElements = this.divEl.getElementsByTagName('div');
this.divEl.insertBefore(this.msgEl, divElements[(divElements.length-1>=0)?divElements.length-1:0]); //insertBefore the clear:both div
}catch(e){alert(e);}
}
this.msgEl.innerHTML = msg;
} | javascript | function(msg) {
if(!this.fieldContainer) { return; }
if(!this.msgEl) {
this.msgEl = inputEx.cn('div', {className: 'inputEx-message'});
try{
var divElements = this.divEl.getElementsByTagName('div');
this.divEl.insertBefore(this.msgEl, divElements[(divElements.length-1>=0)?divElements.length-1:0]); //insertBefore the clear:both div
}catch(e){alert(e);}
}
this.msgEl.innerHTML = msg;
} | [
"function",
"(",
"msg",
")",
"{",
"if",
"(",
"!",
"this",
".",
"fieldContainer",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"this",
".",
"msgEl",
")",
"{",
"this",
".",
"msgEl",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"'inputEx-message'",
"}",
")",
";",
"try",
"{",
"var",
"divElements",
"=",
"this",
".",
"divEl",
".",
"getElementsByTagName",
"(",
"'div'",
")",
";",
"this",
".",
"divEl",
".",
"insertBefore",
"(",
"this",
".",
"msgEl",
",",
"divElements",
"[",
"(",
"divElements",
".",
"length",
"-",
"1",
">=",
"0",
")",
"?",
"divElements",
".",
"length",
"-",
"1",
":",
"0",
"]",
")",
";",
"//insertBefore the clear:both div",
"}",
"catch",
"(",
"e",
")",
"{",
"alert",
"(",
"e",
")",
";",
"}",
"}",
"this",
".",
"msgEl",
".",
"innerHTML",
"=",
"msg",
";",
"}"
]
| Update the message
@param {String} msg Message to display | [
"Update",
"the",
"message"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L4555-L4565 |
|
42,324 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(options) {
inputEx.Field.superclass.setOptions.call(this, options);
this.options.wirable = lang.isUndefined(options.wirable) ? false : options.wirable;
this.options.container = options.container;
options.container = null;
} | javascript | function(options) {
inputEx.Field.superclass.setOptions.call(this, options);
this.options.wirable = lang.isUndefined(options.wirable) ? false : options.wirable;
this.options.container = options.container;
options.container = null;
} | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"Field",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"this",
".",
"options",
".",
"wirable",
"=",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"wirable",
")",
"?",
"false",
":",
"options",
".",
"wirable",
";",
"this",
".",
"options",
".",
"container",
"=",
"options",
".",
"container",
";",
"options",
".",
"container",
"=",
"null",
";",
"}"
]
| Adds a wirable option to every field
@method setOptions | [
"Adds",
"a",
"wirable",
"option",
"to",
"every",
"field"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L4650-L4656 |
|
42,325 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
var wrapper = inputEx.cn('div', {className: 'WireIt-InputExTerminal'});
this.divEl.insertBefore(wrapper, this.fieldContainer);
this.terminal = new WireIt.Terminal(wrapper, {
name: this.options.name,
direction: [-1,0],
fakeDirection: [0, 1],
ddConfig: {
type: "input",
allowedTypes: ["output"]
},
nMaxWires: 1 }, this.options.container);
// Reference to the container
if(this.options.container) {
this.options.container.terminals.push(this.terminal);
}
// Register the events
this.terminal.eventAddWire.subscribe(this.onAddWire, this, true);
this.terminal.eventRemoveWire.subscribe(this.onRemoveWire, this, true);
} | javascript | function() {
var wrapper = inputEx.cn('div', {className: 'WireIt-InputExTerminal'});
this.divEl.insertBefore(wrapper, this.fieldContainer);
this.terminal = new WireIt.Terminal(wrapper, {
name: this.options.name,
direction: [-1,0],
fakeDirection: [0, 1],
ddConfig: {
type: "input",
allowedTypes: ["output"]
},
nMaxWires: 1 }, this.options.container);
// Reference to the container
if(this.options.container) {
this.options.container.terminals.push(this.terminal);
}
// Register the events
this.terminal.eventAddWire.subscribe(this.onAddWire, this, true);
this.terminal.eventRemoveWire.subscribe(this.onRemoveWire, this, true);
} | [
"function",
"(",
")",
"{",
"var",
"wrapper",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"'WireIt-InputExTerminal'",
"}",
")",
";",
"this",
".",
"divEl",
".",
"insertBefore",
"(",
"wrapper",
",",
"this",
".",
"fieldContainer",
")",
";",
"this",
".",
"terminal",
"=",
"new",
"WireIt",
".",
"Terminal",
"(",
"wrapper",
",",
"{",
"name",
":",
"this",
".",
"options",
".",
"name",
",",
"direction",
":",
"[",
"-",
"1",
",",
"0",
"]",
",",
"fakeDirection",
":",
"[",
"0",
",",
"1",
"]",
",",
"ddConfig",
":",
"{",
"type",
":",
"\"input\"",
",",
"allowedTypes",
":",
"[",
"\"output\"",
"]",
"}",
",",
"nMaxWires",
":",
"1",
"}",
",",
"this",
".",
"options",
".",
"container",
")",
";",
"// Reference to the container",
"if",
"(",
"this",
".",
"options",
".",
"container",
")",
"{",
"this",
".",
"options",
".",
"container",
".",
"terminals",
".",
"push",
"(",
"this",
".",
"terminal",
")",
";",
"}",
"// Register the events",
"this",
".",
"terminal",
".",
"eventAddWire",
".",
"subscribe",
"(",
"this",
".",
"onAddWire",
",",
"this",
",",
"true",
")",
";",
"this",
".",
"terminal",
".",
"eventRemoveWire",
".",
"subscribe",
"(",
"this",
".",
"onRemoveWire",
",",
"this",
",",
"true",
")",
";",
"}"
]
| Render the associated input terminal
@method renderTerminal | [
"Render",
"the",
"associated",
"input",
"terminal"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L4674-L4697 |
|
42,326 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(fieldOptions) {
// Instanciate the field
var fieldInstance = inputEx(fieldOptions,this);
this.inputs.push(fieldInstance);
// Create an index to access fields by their name
if(fieldInstance.options.name) {
this.inputsNames[fieldInstance.options.name] = fieldInstance;
}
// Create the this.hasInteractions to run interactions at startup
if(!this.hasInteractions && fieldOptions.interactions) {
this.hasInteractions = true;
}
// Subscribe to the field "updated" event to send the group "updated" event
fieldInstance.updatedEvt.subscribe(this.onChange, this, true);
return fieldInstance;
} | javascript | function(fieldOptions) {
// Instanciate the field
var fieldInstance = inputEx(fieldOptions,this);
this.inputs.push(fieldInstance);
// Create an index to access fields by their name
if(fieldInstance.options.name) {
this.inputsNames[fieldInstance.options.name] = fieldInstance;
}
// Create the this.hasInteractions to run interactions at startup
if(!this.hasInteractions && fieldOptions.interactions) {
this.hasInteractions = true;
}
// Subscribe to the field "updated" event to send the group "updated" event
fieldInstance.updatedEvt.subscribe(this.onChange, this, true);
return fieldInstance;
} | [
"function",
"(",
"fieldOptions",
")",
"{",
"// Instanciate the field",
"var",
"fieldInstance",
"=",
"inputEx",
"(",
"fieldOptions",
",",
"this",
")",
";",
"this",
".",
"inputs",
".",
"push",
"(",
"fieldInstance",
")",
";",
"// Create an index to access fields by their name",
"if",
"(",
"fieldInstance",
".",
"options",
".",
"name",
")",
"{",
"this",
".",
"inputsNames",
"[",
"fieldInstance",
".",
"options",
".",
"name",
"]",
"=",
"fieldInstance",
";",
"}",
"// Create the this.hasInteractions to run interactions at startup",
"if",
"(",
"!",
"this",
".",
"hasInteractions",
"&&",
"fieldOptions",
".",
"interactions",
")",
"{",
"this",
".",
"hasInteractions",
"=",
"true",
";",
"}",
"// Subscribe to the field \"updated\" event to send the group \"updated\" event",
"fieldInstance",
".",
"updatedEvt",
".",
"subscribe",
"(",
"this",
".",
"onChange",
",",
"this",
",",
"true",
")",
";",
"return",
"fieldInstance",
";",
"}"
]
| Instanciate one field given its parameters, type or fieldClass
@param {Object} fieldOptions The field properties as required by the inputEx() method | [
"Instanciate",
"one",
"field",
"given",
"its",
"parameters",
"type",
"or",
"fieldClass"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L4998-L5019 |
|
42,327 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
var input, inputName, state, message,
returnedObj = { fields:{}, validate:true };
// Loop on all the sub fields
for (var i = 0 ; i < this.inputs.length ; i++) {
input = this.inputs[i];
inputName = input.options.name;
state = input.getState();
message = input.getStateString(state);
returnedObj.fields[inputName] = {};
returnedObj.fields[inputName].valid = true;
returnedObj.fields[inputName].message = message;
// check if subfield validates
if( state == inputEx.stateRequired || state == inputEx.stateInvalid ) {
returnedObj.fields[inputName].valid = false;
returnedObj.validate = false;
}
}
return returnedObj;
} | javascript | function() {
var input, inputName, state, message,
returnedObj = { fields:{}, validate:true };
// Loop on all the sub fields
for (var i = 0 ; i < this.inputs.length ; i++) {
input = this.inputs[i];
inputName = input.options.name;
state = input.getState();
message = input.getStateString(state);
returnedObj.fields[inputName] = {};
returnedObj.fields[inputName].valid = true;
returnedObj.fields[inputName].message = message;
// check if subfield validates
if( state == inputEx.stateRequired || state == inputEx.stateInvalid ) {
returnedObj.fields[inputName].valid = false;
returnedObj.validate = false;
}
}
return returnedObj;
} | [
"function",
"(",
")",
"{",
"var",
"input",
",",
"inputName",
",",
"state",
",",
"message",
",",
"returnedObj",
"=",
"{",
"fields",
":",
"{",
"}",
",",
"validate",
":",
"true",
"}",
";",
"// Loop on all the sub fields",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"inputs",
".",
"length",
";",
"i",
"++",
")",
"{",
"input",
"=",
"this",
".",
"inputs",
"[",
"i",
"]",
";",
"inputName",
"=",
"input",
".",
"options",
".",
"name",
";",
"state",
"=",
"input",
".",
"getState",
"(",
")",
";",
"message",
"=",
"input",
".",
"getStateString",
"(",
"state",
")",
";",
"returnedObj",
".",
"fields",
"[",
"inputName",
"]",
"=",
"{",
"}",
";",
"returnedObj",
".",
"fields",
"[",
"inputName",
"]",
".",
"valid",
"=",
"true",
";",
"returnedObj",
".",
"fields",
"[",
"inputName",
"]",
".",
"message",
"=",
"message",
";",
"// check if subfield validates",
"if",
"(",
"state",
"==",
"inputEx",
".",
"stateRequired",
"||",
"state",
"==",
"inputEx",
".",
"stateInvalid",
")",
"{",
"returnedObj",
".",
"fields",
"[",
"inputName",
"]",
".",
"valid",
"=",
"false",
";",
"returnedObj",
".",
"validate",
"=",
"false",
";",
"}",
"}",
"return",
"returnedObj",
";",
"}"
]
| Alternative method to validate for advanced error handling
@returns {Object} with all Forms's fields state, error message
and validate containing a boolean for the global Form validation | [
"Alternative",
"method",
"to",
"validate",
"for",
"advanced",
"error",
"handling"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L5066-L5091 |
|
42,328 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
var o = {};
for (var i = 0 ; i < this.inputs.length ; i++) {
var v = this.inputs[i].getValue();
if(this.inputs[i].options.name) {
if(this.inputs[i].options.flatten && lang.isObject(v) ) {
lang.augmentObject( o, v);
}
else {
o[this.inputs[i].options.name] = v;
}
}
}
return o;
} | javascript | function() {
var o = {};
for (var i = 0 ; i < this.inputs.length ; i++) {
var v = this.inputs[i].getValue();
if(this.inputs[i].options.name) {
if(this.inputs[i].options.flatten && lang.isObject(v) ) {
lang.augmentObject( o, v);
}
else {
o[this.inputs[i].options.name] = v;
}
}
}
return o;
} | [
"function",
"(",
")",
"{",
"var",
"o",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"inputs",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"v",
"=",
"this",
".",
"inputs",
"[",
"i",
"]",
".",
"getValue",
"(",
")",
";",
"if",
"(",
"this",
".",
"inputs",
"[",
"i",
"]",
".",
"options",
".",
"name",
")",
"{",
"if",
"(",
"this",
".",
"inputs",
"[",
"i",
"]",
".",
"options",
".",
"flatten",
"&&",
"lang",
".",
"isObject",
"(",
"v",
")",
")",
"{",
"lang",
".",
"augmentObject",
"(",
"o",
",",
"v",
")",
";",
"}",
"else",
"{",
"o",
"[",
"this",
".",
"inputs",
"[",
"i",
"]",
".",
"options",
".",
"name",
"]",
"=",
"v",
";",
"}",
"}",
"}",
"return",
"o",
";",
"}"
]
| Return an object with all the values of the fields | [
"Return",
"an",
"object",
"with",
"all",
"the",
"values",
"of",
"the",
"fields"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L5142-L5156 |
|
42,329 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(eventName, args) {
// Run interactions
var fieldValue = args[0];
var fieldInstance = args[1];
this.runInteractions(fieldInstance,fieldValue);
//this.setClassFromState();
this.fireUpdatedEvt();
} | javascript | function(eventName, args) {
// Run interactions
var fieldValue = args[0];
var fieldInstance = args[1];
this.runInteractions(fieldInstance,fieldValue);
//this.setClassFromState();
this.fireUpdatedEvt();
} | [
"function",
"(",
"eventName",
",",
"args",
")",
"{",
"// Run interactions",
"var",
"fieldValue",
"=",
"args",
"[",
"0",
"]",
";",
"var",
"fieldInstance",
"=",
"args",
"[",
"1",
"]",
";",
"this",
".",
"runInteractions",
"(",
"fieldInstance",
",",
"fieldValue",
")",
";",
"//this.setClassFromState();",
"this",
".",
"fireUpdatedEvt",
"(",
")",
";",
"}"
]
| Called when one of the group subfields is updated.
@param {String} eventName Event name
@param {Array} args Array of [fieldValue, fieldInstance] | [
"Called",
"when",
"one",
"of",
"the",
"group",
"subfields",
"is",
"updated",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L5194-L5204 |
|
42,330 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(fieldInstance,fieldValue) {
var index = inputEx.indexOf(fieldInstance, this.inputs);
var fieldConfig = this.options.fields[index];
if( YAHOO.lang.isUndefined(fieldConfig.interactions) ) return;
// Let's run the interactions !
var interactions = fieldConfig.interactions;
for(var i = 0 ; i < interactions.length ; i++) {
var interaction = interactions[i];
if(interaction.valueTrigger === fieldValue) {
for(var j = 0 ; j < interaction.actions.length ; j++) {
this.runAction(interaction.actions[j], fieldValue);
}
}
}
} | javascript | function(fieldInstance,fieldValue) {
var index = inputEx.indexOf(fieldInstance, this.inputs);
var fieldConfig = this.options.fields[index];
if( YAHOO.lang.isUndefined(fieldConfig.interactions) ) return;
// Let's run the interactions !
var interactions = fieldConfig.interactions;
for(var i = 0 ; i < interactions.length ; i++) {
var interaction = interactions[i];
if(interaction.valueTrigger === fieldValue) {
for(var j = 0 ; j < interaction.actions.length ; j++) {
this.runAction(interaction.actions[j], fieldValue);
}
}
}
} | [
"function",
"(",
"fieldInstance",
",",
"fieldValue",
")",
"{",
"var",
"index",
"=",
"inputEx",
".",
"indexOf",
"(",
"fieldInstance",
",",
"this",
".",
"inputs",
")",
";",
"var",
"fieldConfig",
"=",
"this",
".",
"options",
".",
"fields",
"[",
"index",
"]",
";",
"if",
"(",
"YAHOO",
".",
"lang",
".",
"isUndefined",
"(",
"fieldConfig",
".",
"interactions",
")",
")",
"return",
";",
"// Let's run the interactions !",
"var",
"interactions",
"=",
"fieldConfig",
".",
"interactions",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"interactions",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"interaction",
"=",
"interactions",
"[",
"i",
"]",
";",
"if",
"(",
"interaction",
".",
"valueTrigger",
"===",
"fieldValue",
")",
"{",
"for",
"(",
"var",
"j",
"=",
"0",
";",
"j",
"<",
"interaction",
".",
"actions",
".",
"length",
";",
"j",
"++",
")",
"{",
"this",
".",
"runAction",
"(",
"interaction",
".",
"actions",
"[",
"j",
"]",
",",
"fieldValue",
")",
";",
"}",
"}",
"}",
"}"
]
| Run the interactions for the given field instance
@param {inputEx.Field} fieldInstance Field that just changed
@param {Any} fieldValue Field value | [
"Run",
"the",
"interactions",
"for",
"the",
"given",
"field",
"instance"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L5229-L5246 |
|
42,331 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
if(this.hasInteractions) {
for(var i = 0 ; i < this.inputs.length ; i++) {
this.runInteractions(this.inputs[i],this.inputs[i].getValue());
}
}
} | javascript | function() {
if(this.hasInteractions) {
for(var i = 0 ; i < this.inputs.length ; i++) {
this.runInteractions(this.inputs[i],this.inputs[i].getValue());
}
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"hasInteractions",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"inputs",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"runInteractions",
"(",
"this",
".",
"inputs",
"[",
"i",
"]",
",",
"this",
".",
"inputs",
"[",
"i",
"]",
".",
"getValue",
"(",
")",
")",
";",
"}",
"}",
"}"
]
| Run the interactions for all fields | [
"Run",
"the",
"interactions",
"for",
"all",
"fields"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L5251-L5257 |
|
42,332 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(sendUpdatedEvt) {
for(var i = 0 ; i < this.inputs.length ; i++) {
this.inputs[i].clear(false);
}
if(sendUpdatedEvt !== false) {
// fire update event
this.fireUpdatedEvt();
}
} | javascript | function(sendUpdatedEvt) {
for(var i = 0 ; i < this.inputs.length ; i++) {
this.inputs[i].clear(false);
}
if(sendUpdatedEvt !== false) {
// fire update event
this.fireUpdatedEvt();
}
} | [
"function",
"(",
"sendUpdatedEvt",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"inputs",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"inputs",
"[",
"i",
"]",
".",
"clear",
"(",
"false",
")",
";",
"}",
"if",
"(",
"sendUpdatedEvt",
"!==",
"false",
")",
"{",
"// fire update event",
"this",
".",
"fireUpdatedEvt",
"(",
")",
";",
"}",
"}"
]
| Clear all subfields
@param {boolean} [sendUpdatedEvt] (optional) Wether this clear should fire the updatedEvt or not (default is true, pass false to NOT send the event) | [
"Clear",
"all",
"subfields"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L5263-L5271 |
|
42,333 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(errors) {
var i,k;
if(YAHOO.lang.isArray(errors)) {
for(i = 0 ; i < errors.length ; i++) {
k = errors[i][0];
value = errors[i][1];
if(this.inputsNames[k]) {
if(this.inputsNames[k].options.showMsg) {
this.inputsNames[k].displayMessage(value);
Dom.replaceClass(this.inputsNames[k].divEl, "inputEx-valid", "inputEx-invalid" );
}
}
}
}
else if(YAHOO.lang.isObject(errors)) {
for(k in errors) {
if(errors.hasOwnProperty(k)) {
if(this.inputsNames[k]) {
if(this.inputsNames[k].options.showMsg) {
this.inputsNames[k].displayMessage(errors[k]);
Dom.replaceClass(this.inputsNames[k].divEl, "inputEx-valid", "inputEx-invalid" );
}
}
}
}
}
} | javascript | function(errors) {
var i,k;
if(YAHOO.lang.isArray(errors)) {
for(i = 0 ; i < errors.length ; i++) {
k = errors[i][0];
value = errors[i][1];
if(this.inputsNames[k]) {
if(this.inputsNames[k].options.showMsg) {
this.inputsNames[k].displayMessage(value);
Dom.replaceClass(this.inputsNames[k].divEl, "inputEx-valid", "inputEx-invalid" );
}
}
}
}
else if(YAHOO.lang.isObject(errors)) {
for(k in errors) {
if(errors.hasOwnProperty(k)) {
if(this.inputsNames[k]) {
if(this.inputsNames[k].options.showMsg) {
this.inputsNames[k].displayMessage(errors[k]);
Dom.replaceClass(this.inputsNames[k].divEl, "inputEx-valid", "inputEx-invalid" );
}
}
}
}
}
} | [
"function",
"(",
"errors",
")",
"{",
"var",
"i",
",",
"k",
";",
"if",
"(",
"YAHOO",
".",
"lang",
".",
"isArray",
"(",
"errors",
")",
")",
"{",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"errors",
".",
"length",
";",
"i",
"++",
")",
"{",
"k",
"=",
"errors",
"[",
"i",
"]",
"[",
"0",
"]",
";",
"value",
"=",
"errors",
"[",
"i",
"]",
"[",
"1",
"]",
";",
"if",
"(",
"this",
".",
"inputsNames",
"[",
"k",
"]",
")",
"{",
"if",
"(",
"this",
".",
"inputsNames",
"[",
"k",
"]",
".",
"options",
".",
"showMsg",
")",
"{",
"this",
".",
"inputsNames",
"[",
"k",
"]",
".",
"displayMessage",
"(",
"value",
")",
";",
"Dom",
".",
"replaceClass",
"(",
"this",
".",
"inputsNames",
"[",
"k",
"]",
".",
"divEl",
",",
"\"inputEx-valid\"",
",",
"\"inputEx-invalid\"",
")",
";",
"}",
"}",
"}",
"}",
"else",
"if",
"(",
"YAHOO",
".",
"lang",
".",
"isObject",
"(",
"errors",
")",
")",
"{",
"for",
"(",
"k",
"in",
"errors",
")",
"{",
"if",
"(",
"errors",
".",
"hasOwnProperty",
"(",
"k",
")",
")",
"{",
"if",
"(",
"this",
".",
"inputsNames",
"[",
"k",
"]",
")",
"{",
"if",
"(",
"this",
".",
"inputsNames",
"[",
"k",
"]",
".",
"options",
".",
"showMsg",
")",
"{",
"this",
".",
"inputsNames",
"[",
"k",
"]",
".",
"displayMessage",
"(",
"errors",
"[",
"k",
"]",
")",
";",
"Dom",
".",
"replaceClass",
"(",
"this",
".",
"inputsNames",
"[",
"k",
"]",
".",
"divEl",
",",
"\"inputEx-valid\"",
",",
"\"inputEx-invalid\"",
")",
";",
"}",
"}",
"}",
"}",
"}",
"}"
]
| Write error messages for fields as specified in the hash
@param {Object || Array} errors Hash object containing error messages as Strings referenced by the field name, or array [ ["fieldName", "Message"], ...] | [
"Write",
"error",
"messages",
"for",
"fields",
"as",
"specified",
"in",
"the",
"hash"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L5277-L5303 |
|
42,334 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(options) {
this.options = {};
this.options.id = lang.isString(options.id) ? options.id : Dom.generateId();
this.options.className = options.className || "inputEx-Button";
this.options.parentEl = lang.isString(options.parentEl) ? Dom.get(options.parentEl) : options.parentEl;
// default type === "submit"
this.options.type = (options.type === "link" || options.type === "submit-link") ? options.type : "submit";
// value is the text displayed inside the button (<input type="submit" value="Submit" /> convention...)
this.options.value = options.value;
this.options.disabled = !!options.disabled;
if (lang.isFunction(options.onClick)) {
this.options.onClick = {fn: options.onClick, scope:this};
} else if (lang.isObject(options.onClick)) {
this.options.onClick = {fn: options.onClick.fn, scope: options.onClick.scope || this};
}
} | javascript | function(options) {
this.options = {};
this.options.id = lang.isString(options.id) ? options.id : Dom.generateId();
this.options.className = options.className || "inputEx-Button";
this.options.parentEl = lang.isString(options.parentEl) ? Dom.get(options.parentEl) : options.parentEl;
// default type === "submit"
this.options.type = (options.type === "link" || options.type === "submit-link") ? options.type : "submit";
// value is the text displayed inside the button (<input type="submit" value="Submit" /> convention...)
this.options.value = options.value;
this.options.disabled = !!options.disabled;
if (lang.isFunction(options.onClick)) {
this.options.onClick = {fn: options.onClick, scope:this};
} else if (lang.isObject(options.onClick)) {
this.options.onClick = {fn: options.onClick.fn, scope: options.onClick.scope || this};
}
} | [
"function",
"(",
"options",
")",
"{",
"this",
".",
"options",
"=",
"{",
"}",
";",
"this",
".",
"options",
".",
"id",
"=",
"lang",
".",
"isString",
"(",
"options",
".",
"id",
")",
"?",
"options",
".",
"id",
":",
"Dom",
".",
"generateId",
"(",
")",
";",
"this",
".",
"options",
".",
"className",
"=",
"options",
".",
"className",
"||",
"\"inputEx-Button\"",
";",
"this",
".",
"options",
".",
"parentEl",
"=",
"lang",
".",
"isString",
"(",
"options",
".",
"parentEl",
")",
"?",
"Dom",
".",
"get",
"(",
"options",
".",
"parentEl",
")",
":",
"options",
".",
"parentEl",
";",
"// default type === \"submit\"",
"this",
".",
"options",
".",
"type",
"=",
"(",
"options",
".",
"type",
"===",
"\"link\"",
"||",
"options",
".",
"type",
"===",
"\"submit-link\"",
")",
"?",
"options",
".",
"type",
":",
"\"submit\"",
";",
"// value is the text displayed inside the button (<input type=\"submit\" value=\"Submit\" /> convention...)",
"this",
".",
"options",
".",
"value",
"=",
"options",
".",
"value",
";",
"this",
".",
"options",
".",
"disabled",
"=",
"!",
"!",
"options",
".",
"disabled",
";",
"if",
"(",
"lang",
".",
"isFunction",
"(",
"options",
".",
"onClick",
")",
")",
"{",
"this",
".",
"options",
".",
"onClick",
"=",
"{",
"fn",
":",
"options",
".",
"onClick",
",",
"scope",
":",
"this",
"}",
";",
"}",
"else",
"if",
"(",
"lang",
".",
"isObject",
"(",
"options",
".",
"onClick",
")",
")",
"{",
"this",
".",
"options",
".",
"onClick",
"=",
"{",
"fn",
":",
"options",
".",
"onClick",
".",
"fn",
",",
"scope",
":",
"options",
".",
"onClick",
".",
"scope",
"||",
"this",
"}",
";",
"}",
"}"
]
| set the default options | [
"set",
"the",
"default",
"options"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L5468-L5490 |
|
42,335 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(parentEl) {
var innerSpan;
if (this.options.type === "link" || this.options.type === "submit-link") {
this.el = inputEx.cn('a', {className: this.options.className, id:this.options.id, href:"#"});
Dom.addClass(this.el,this.options.type === "link" ? "inputEx-Button-Link" : "inputEx-Button-Submit-Link");
innerSpan = inputEx.cn('span', null, null, this.options.value);
this.el.appendChild(innerSpan);
// default type is "submit" input
} else {
this.el = inputEx.cn('input', {type: "submit", value: this.options.value, className: this.options.className, id:this.options.id});
Dom.addClass(this.el,"inputEx-Button-Submit");
}
parentEl.appendChild(this.el);
if (this.options.disabled) {
this.disable();
}
this.initEvents();
return this.el;
} | javascript | function(parentEl) {
var innerSpan;
if (this.options.type === "link" || this.options.type === "submit-link") {
this.el = inputEx.cn('a', {className: this.options.className, id:this.options.id, href:"#"});
Dom.addClass(this.el,this.options.type === "link" ? "inputEx-Button-Link" : "inputEx-Button-Submit-Link");
innerSpan = inputEx.cn('span', null, null, this.options.value);
this.el.appendChild(innerSpan);
// default type is "submit" input
} else {
this.el = inputEx.cn('input', {type: "submit", value: this.options.value, className: this.options.className, id:this.options.id});
Dom.addClass(this.el,"inputEx-Button-Submit");
}
parentEl.appendChild(this.el);
if (this.options.disabled) {
this.disable();
}
this.initEvents();
return this.el;
} | [
"function",
"(",
"parentEl",
")",
"{",
"var",
"innerSpan",
";",
"if",
"(",
"this",
".",
"options",
".",
"type",
"===",
"\"link\"",
"||",
"this",
".",
"options",
".",
"type",
"===",
"\"submit-link\"",
")",
"{",
"this",
".",
"el",
"=",
"inputEx",
".",
"cn",
"(",
"'a'",
",",
"{",
"className",
":",
"this",
".",
"options",
".",
"className",
",",
"id",
":",
"this",
".",
"options",
".",
"id",
",",
"href",
":",
"\"#\"",
"}",
")",
";",
"Dom",
".",
"addClass",
"(",
"this",
".",
"el",
",",
"this",
".",
"options",
".",
"type",
"===",
"\"link\"",
"?",
"\"inputEx-Button-Link\"",
":",
"\"inputEx-Button-Submit-Link\"",
")",
";",
"innerSpan",
"=",
"inputEx",
".",
"cn",
"(",
"'span'",
",",
"null",
",",
"null",
",",
"this",
".",
"options",
".",
"value",
")",
";",
"this",
".",
"el",
".",
"appendChild",
"(",
"innerSpan",
")",
";",
"// default type is \"submit\" input",
"}",
"else",
"{",
"this",
".",
"el",
"=",
"inputEx",
".",
"cn",
"(",
"'input'",
",",
"{",
"type",
":",
"\"submit\"",
",",
"value",
":",
"this",
".",
"options",
".",
"value",
",",
"className",
":",
"this",
".",
"options",
".",
"className",
",",
"id",
":",
"this",
".",
"options",
".",
"id",
"}",
")",
";",
"Dom",
".",
"addClass",
"(",
"this",
".",
"el",
",",
"\"inputEx-Button-Submit\"",
")",
";",
"}",
"parentEl",
".",
"appendChild",
"(",
"this",
".",
"el",
")",
";",
"if",
"(",
"this",
".",
"options",
".",
"disabled",
")",
"{",
"this",
".",
"disable",
"(",
")",
";",
"}",
"this",
".",
"initEvents",
"(",
")",
";",
"return",
"this",
".",
"el",
";",
"}"
]
| render the button into the parent Element
@param {DOMElement} parentEl The DOM element where the button should be rendered
@return {DOMElement} The created button | [
"render",
"the",
"button",
"into",
"the",
"parent",
"Element"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L5497-L5526 |
|
42,336 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
/**
* Click Event facade (YUI custom event)
* @event clickEvent
*/
this.clickEvent = new util.CustomEvent("click");
/**
* Submit Event facade (YUI custom event)
* @event submitEvent
*/
this.submitEvent = new util.CustomEvent("submit");
Event.addListener(this.el,"click",function(e) {
var fireSubmitEvent;
// stop click event, so :
//
// 1. buttons of 'link' or 'submit-link' type don't link to any url
// 2. buttons of 'submit' type (<input type="submit" />) don't fire a 'submit' event
Event.stopEvent(e);
// button disabled : don't fire clickEvent, and stop here
if (this.disabled) {
fireSubmitEvent = false;
// button enabled : fire clickEvent
} else {
// submit event will be fired if not prevented by clickEvent
fireSubmitEvent = this.clickEvent.fire();
}
// link buttons should NOT fire a submit event
if (this.options.type === "link") {
fireSubmitEvent = false;
}
if (fireSubmitEvent) {
this.submitEvent.fire();
}
},this,true);
// Subscribe onClick handler
if (this.options.onClick) {
this.clickEvent.subscribe(this.options.onClick.fn,this.options.onClick.scope,true);
}
} | javascript | function() {
/**
* Click Event facade (YUI custom event)
* @event clickEvent
*/
this.clickEvent = new util.CustomEvent("click");
/**
* Submit Event facade (YUI custom event)
* @event submitEvent
*/
this.submitEvent = new util.CustomEvent("submit");
Event.addListener(this.el,"click",function(e) {
var fireSubmitEvent;
// stop click event, so :
//
// 1. buttons of 'link' or 'submit-link' type don't link to any url
// 2. buttons of 'submit' type (<input type="submit" />) don't fire a 'submit' event
Event.stopEvent(e);
// button disabled : don't fire clickEvent, and stop here
if (this.disabled) {
fireSubmitEvent = false;
// button enabled : fire clickEvent
} else {
// submit event will be fired if not prevented by clickEvent
fireSubmitEvent = this.clickEvent.fire();
}
// link buttons should NOT fire a submit event
if (this.options.type === "link") {
fireSubmitEvent = false;
}
if (fireSubmitEvent) {
this.submitEvent.fire();
}
},this,true);
// Subscribe onClick handler
if (this.options.onClick) {
this.clickEvent.subscribe(this.options.onClick.fn,this.options.onClick.scope,true);
}
} | [
"function",
"(",
")",
"{",
"/**\n\t\t * Click Event facade (YUI custom event)\n \t\t * @event clickEvent\n\t\t */",
"this",
".",
"clickEvent",
"=",
"new",
"util",
".",
"CustomEvent",
"(",
"\"click\"",
")",
";",
"/**\n\t\t * Submit Event facade (YUI custom event)\n \t\t * @event submitEvent\n\t\t */",
"this",
".",
"submitEvent",
"=",
"new",
"util",
".",
"CustomEvent",
"(",
"\"submit\"",
")",
";",
"Event",
".",
"addListener",
"(",
"this",
".",
"el",
",",
"\"click\"",
",",
"function",
"(",
"e",
")",
"{",
"var",
"fireSubmitEvent",
";",
"// stop click event, so :",
"//",
"// 1. buttons of 'link' or 'submit-link' type don't link to any url",
"// 2. buttons of 'submit' type (<input type=\"submit\" />) don't fire a 'submit' event",
"Event",
".",
"stopEvent",
"(",
"e",
")",
";",
"// button disabled : don't fire clickEvent, and stop here",
"if",
"(",
"this",
".",
"disabled",
")",
"{",
"fireSubmitEvent",
"=",
"false",
";",
"// button enabled : fire clickEvent",
"}",
"else",
"{",
"// submit event will be fired if not prevented by clickEvent",
"fireSubmitEvent",
"=",
"this",
".",
"clickEvent",
".",
"fire",
"(",
")",
";",
"}",
"// link buttons should NOT fire a submit event",
"if",
"(",
"this",
".",
"options",
".",
"type",
"===",
"\"link\"",
")",
"{",
"fireSubmitEvent",
"=",
"false",
";",
"}",
"if",
"(",
"fireSubmitEvent",
")",
"{",
"this",
".",
"submitEvent",
".",
"fire",
"(",
")",
";",
"}",
"}",
",",
"this",
",",
"true",
")",
";",
"// Subscribe onClick handler",
"if",
"(",
"this",
".",
"options",
".",
"onClick",
")",
"{",
"this",
".",
"clickEvent",
".",
"subscribe",
"(",
"this",
".",
"options",
".",
"onClick",
".",
"fn",
",",
"this",
".",
"options",
".",
"onClick",
".",
"scope",
",",
"true",
")",
";",
"}",
"}"
]
| attach the listeners on "click" event and create the custom events | [
"attach",
"the",
"listeners",
"on",
"click",
"event",
"and",
"create",
"the",
"custom",
"events"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L5531-L5582 |
|
42,337 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
this.disabled = true;
Dom.addClass(this.el,"inputEx-Button-disabled");
if (this.options.type === "submit") {
this.el.disabled = true;
}
} | javascript | function() {
this.disabled = true;
Dom.addClass(this.el,"inputEx-Button-disabled");
if (this.options.type === "submit") {
this.el.disabled = true;
}
} | [
"function",
"(",
")",
"{",
"this",
".",
"disabled",
"=",
"true",
";",
"Dom",
".",
"addClass",
"(",
"this",
".",
"el",
",",
"\"inputEx-Button-disabled\"",
")",
";",
"if",
"(",
"this",
".",
"options",
".",
"type",
"===",
"\"submit\"",
")",
"{",
"this",
".",
"el",
".",
"disabled",
"=",
"true",
";",
"}",
"}"
]
| Disable the button | [
"Disable",
"the",
"button"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L5587-L5596 |
|
42,338 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
this.disabled = false;
Dom.removeClass(this.el,"inputEx-Button-disabled");
if (this.options.type === "submit") {
this.el.disabled = false;
}
} | javascript | function() {
this.disabled = false;
Dom.removeClass(this.el,"inputEx-Button-disabled");
if (this.options.type === "submit") {
this.el.disabled = false;
}
} | [
"function",
"(",
")",
"{",
"this",
".",
"disabled",
"=",
"false",
";",
"Dom",
".",
"removeClass",
"(",
"this",
".",
"el",
",",
"\"inputEx-Button-disabled\"",
")",
";",
"if",
"(",
"this",
".",
"options",
".",
"type",
"===",
"\"submit\"",
")",
"{",
"this",
".",
"el",
".",
"disabled",
"=",
"false",
";",
"}",
"}"
]
| Enable the button | [
"Enable",
"the",
"button"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L5601-L5610 |
|
42,339 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
Event.addListener(this.el, "change", this.onChange, this, true);
if (YAHOO.env.ua.ie){ // refer to inputEx-95
var field = this.el;
new YAHOO.util.KeyListener(this.el, {keys:[13]}, {fn:function(){
field.blur();
field.focus();
}}).enable();
}
Event.addFocusListener(this.el, this.onFocus, this, true);
Event.addBlurListener(this.el, this.onBlur, this, true);
Event.addListener(this.el, "keypress", this.onKeyPress, this, true);
Event.addListener(this.el, "keyup", this.onKeyUp, this, true);
} | javascript | function() {
Event.addListener(this.el, "change", this.onChange, this, true);
if (YAHOO.env.ua.ie){ // refer to inputEx-95
var field = this.el;
new YAHOO.util.KeyListener(this.el, {keys:[13]}, {fn:function(){
field.blur();
field.focus();
}}).enable();
}
Event.addFocusListener(this.el, this.onFocus, this, true);
Event.addBlurListener(this.el, this.onBlur, this, true);
Event.addListener(this.el, "keypress", this.onKeyPress, this, true);
Event.addListener(this.el, "keyup", this.onKeyUp, this, true);
} | [
"function",
"(",
")",
"{",
"Event",
".",
"addListener",
"(",
"this",
".",
"el",
",",
"\"change\"",
",",
"this",
".",
"onChange",
",",
"this",
",",
"true",
")",
";",
"if",
"(",
"YAHOO",
".",
"env",
".",
"ua",
".",
"ie",
")",
"{",
"// refer to inputEx-95",
"var",
"field",
"=",
"this",
".",
"el",
";",
"new",
"YAHOO",
".",
"util",
".",
"KeyListener",
"(",
"this",
".",
"el",
",",
"{",
"keys",
":",
"[",
"13",
"]",
"}",
",",
"{",
"fn",
":",
"function",
"(",
")",
"{",
"field",
".",
"blur",
"(",
")",
";",
"field",
".",
"focus",
"(",
")",
";",
"}",
"}",
")",
".",
"enable",
"(",
")",
";",
"}",
"Event",
".",
"addFocusListener",
"(",
"this",
".",
"el",
",",
"this",
".",
"onFocus",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"addBlurListener",
"(",
"this",
".",
"el",
",",
"this",
".",
"onBlur",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"addListener",
"(",
"this",
".",
"el",
",",
"\"keypress\"",
",",
"this",
".",
"onKeyPress",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"addListener",
"(",
"this",
".",
"el",
",",
"\"keyup\"",
",",
"this",
".",
"onKeyUp",
",",
"this",
",",
"true",
")",
";",
"}"
]
| Register the change, focus and blur events | [
"Register",
"the",
"change",
"focus",
"and",
"blur",
"events"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L5713-L5728 |
|
42,340 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
var value;
value = (this.options.typeInvite && this.el.value == this.options.typeInvite) ? '' : this.el.value;
if (this.options.trim) {
value = YAHOO.lang.trim(value);
}
return value;
} | javascript | function() {
var value;
value = (this.options.typeInvite && this.el.value == this.options.typeInvite) ? '' : this.el.value;
if (this.options.trim) {
value = YAHOO.lang.trim(value);
}
return value;
} | [
"function",
"(",
")",
"{",
"var",
"value",
";",
"value",
"=",
"(",
"this",
".",
"options",
".",
"typeInvite",
"&&",
"this",
".",
"el",
".",
"value",
"==",
"this",
".",
"options",
".",
"typeInvite",
")",
"?",
"''",
":",
"this",
".",
"el",
".",
"value",
";",
"if",
"(",
"this",
".",
"options",
".",
"trim",
")",
"{",
"value",
"=",
"YAHOO",
".",
"lang",
".",
"trim",
"(",
"value",
")",
";",
"}",
"return",
"value",
";",
"}"
]
| Return the string value
@param {String} The string value | [
"Return",
"the",
"string",
"value"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L5734-L5745 |
|
42,341 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(e) {
inputEx.StringField.superclass.onFocus.call(this,e);
if(this.options.typeInvite) {
this.updateTypeInvite();
}
} | javascript | function(e) {
inputEx.StringField.superclass.onFocus.call(this,e);
if(this.options.typeInvite) {
this.updateTypeInvite();
}
} | [
"function",
"(",
"e",
")",
"{",
"inputEx",
".",
"StringField",
".",
"superclass",
".",
"onFocus",
".",
"call",
"(",
"this",
",",
"e",
")",
";",
"if",
"(",
"this",
".",
"options",
".",
"typeInvite",
")",
"{",
"this",
".",
"updateTypeInvite",
"(",
")",
";",
"}",
"}"
]
| Clear the typeInvite when the field gains focus | [
"Clear",
"the",
"typeInvite",
"when",
"the",
"field",
"gains",
"focus"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L5862-L5868 |
|
42,342 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function (config) {
var choice, position, that;
// allow config not to be an object, just a value -> convert it in a standard config object
if (!lang.isObject(config)) {
config = { value: config };
}
choice = {
value: config.value,
label: lang.isString(config.label) ? config.label : "" + config.value,
visible: true
};
// Create DOM <option> node
choice.node = this.createChoiceNode(choice);
// Get choice's position
// -> don't pass config.value to getChoicePosition !!!
// (we search position of existing choice, whereas config.value is a property of new choice to be created...)
position = this.getChoicePosition({ position: config.position, label: config.before || config.after });
if (position === -1) { // (default is at the end)
position = this.choicesList.length;
} else if (lang.isString(config.after)) {
// +1 to insert "after" position (not "at" position)
position += 1;
}
// Insert choice in list at position
this.choicesList.splice(position, 0, choice);
// Append <option> node in DOM
this.appendChoiceNode(choice.node, position);
// Select new choice
if (!!config.selected) {
// setTimeout for IE6 (let time to create dom option)
that = this;
setTimeout(function () {
that.setValue(choice.value);
}, 0);
}
// Return generated choice
return choice;
} | javascript | function (config) {
var choice, position, that;
// allow config not to be an object, just a value -> convert it in a standard config object
if (!lang.isObject(config)) {
config = { value: config };
}
choice = {
value: config.value,
label: lang.isString(config.label) ? config.label : "" + config.value,
visible: true
};
// Create DOM <option> node
choice.node = this.createChoiceNode(choice);
// Get choice's position
// -> don't pass config.value to getChoicePosition !!!
// (we search position of existing choice, whereas config.value is a property of new choice to be created...)
position = this.getChoicePosition({ position: config.position, label: config.before || config.after });
if (position === -1) { // (default is at the end)
position = this.choicesList.length;
} else if (lang.isString(config.after)) {
// +1 to insert "after" position (not "at" position)
position += 1;
}
// Insert choice in list at position
this.choicesList.splice(position, 0, choice);
// Append <option> node in DOM
this.appendChoiceNode(choice.node, position);
// Select new choice
if (!!config.selected) {
// setTimeout for IE6 (let time to create dom option)
that = this;
setTimeout(function () {
that.setValue(choice.value);
}, 0);
}
// Return generated choice
return choice;
} | [
"function",
"(",
"config",
")",
"{",
"var",
"choice",
",",
"position",
",",
"that",
";",
"// allow config not to be an object, just a value -> convert it in a standard config object",
"if",
"(",
"!",
"lang",
".",
"isObject",
"(",
"config",
")",
")",
"{",
"config",
"=",
"{",
"value",
":",
"config",
"}",
";",
"}",
"choice",
"=",
"{",
"value",
":",
"config",
".",
"value",
",",
"label",
":",
"lang",
".",
"isString",
"(",
"config",
".",
"label",
")",
"?",
"config",
".",
"label",
":",
"\"\"",
"+",
"config",
".",
"value",
",",
"visible",
":",
"true",
"}",
";",
"// Create DOM <option> node",
"choice",
".",
"node",
"=",
"this",
".",
"createChoiceNode",
"(",
"choice",
")",
";",
"// Get choice's position",
"// -> don't pass config.value to getChoicePosition !!!",
"// (we search position of existing choice, whereas config.value is a property of new choice to be created...)",
"position",
"=",
"this",
".",
"getChoicePosition",
"(",
"{",
"position",
":",
"config",
".",
"position",
",",
"label",
":",
"config",
".",
"before",
"||",
"config",
".",
"after",
"}",
")",
";",
"if",
"(",
"position",
"===",
"-",
"1",
")",
"{",
"// (default is at the end)",
"position",
"=",
"this",
".",
"choicesList",
".",
"length",
";",
"}",
"else",
"if",
"(",
"lang",
".",
"isString",
"(",
"config",
".",
"after",
")",
")",
"{",
"// +1 to insert \"after\" position (not \"at\" position)",
"position",
"+=",
"1",
";",
"}",
"// Insert choice in list at position",
"this",
".",
"choicesList",
".",
"splice",
"(",
"position",
",",
"0",
",",
"choice",
")",
";",
"// Append <option> node in DOM",
"this",
".",
"appendChoiceNode",
"(",
"choice",
".",
"node",
",",
"position",
")",
";",
"// Select new choice",
"if",
"(",
"!",
"!",
"config",
".",
"selected",
")",
"{",
"// setTimeout for IE6 (let time to create dom option)",
"that",
"=",
"this",
";",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"that",
".",
"setValue",
"(",
"choice",
".",
"value",
")",
";",
"}",
",",
"0",
")",
";",
"}",
"// Return generated choice",
"return",
"choice",
";",
"}"
]
| Add a choice
@param {Object} config An object describing the choice to add (e.g. { value: 'second' [, label: 'Second' [, position: 1 || after: 'First' || before: 'Third']] }) | [
"Add",
"a",
"choice"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L5910-L5962 |
|
42,343 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function (config) {
var position, choice;
// Get choice's position
position = this.getChoicePosition(config);
if (position === -1) {
throw new Error("SelectField : invalid or missing position, label or value in removeChoice");
}
// Choice to remove
choice = this.choicesList[position];
// Clear if removing selected choice
if (this.getValue() === choice.value) {
this.clear();
}
// Remove choice in list at position
this.choicesList.splice(position, 1); // remove 1 element at position
// Remove node from DOM
this.removeChoiceNode(choice.node);
} | javascript | function (config) {
var position, choice;
// Get choice's position
position = this.getChoicePosition(config);
if (position === -1) {
throw new Error("SelectField : invalid or missing position, label or value in removeChoice");
}
// Choice to remove
choice = this.choicesList[position];
// Clear if removing selected choice
if (this.getValue() === choice.value) {
this.clear();
}
// Remove choice in list at position
this.choicesList.splice(position, 1); // remove 1 element at position
// Remove node from DOM
this.removeChoiceNode(choice.node);
} | [
"function",
"(",
"config",
")",
"{",
"var",
"position",
",",
"choice",
";",
"// Get choice's position",
"position",
"=",
"this",
".",
"getChoicePosition",
"(",
"config",
")",
";",
"if",
"(",
"position",
"===",
"-",
"1",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"SelectField : invalid or missing position, label or value in removeChoice\"",
")",
";",
"}",
"// Choice to remove",
"choice",
"=",
"this",
".",
"choicesList",
"[",
"position",
"]",
";",
"// Clear if removing selected choice",
"if",
"(",
"this",
".",
"getValue",
"(",
")",
"===",
"choice",
".",
"value",
")",
"{",
"this",
".",
"clear",
"(",
")",
";",
"}",
"// Remove choice in list at position",
"this",
".",
"choicesList",
".",
"splice",
"(",
"position",
",",
"1",
")",
";",
"// remove 1 element at position",
"// Remove node from DOM",
"this",
".",
"removeChoiceNode",
"(",
"choice",
".",
"node",
")",
";",
"}"
]
| Remove a choice
@param {Object} config An object targeting the choice to remove (e.g. { position : 1 } || { value: 'second' } || { label: 'Second' }) | [
"Remove",
"a",
"choice"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L5968-L5993 |
|
42,344 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function (config) {
var position, choice;
position = this.getChoicePosition(config);
if (position !== -1) {
choice = this.choicesList[position];
if (!choice.visible) {
choice.visible = true;
this.appendChoiceNode(choice.node, position);
}
}
} | javascript | function (config) {
var position, choice;
position = this.getChoicePosition(config);
if (position !== -1) {
choice = this.choicesList[position];
if (!choice.visible) {
choice.visible = true;
this.appendChoiceNode(choice.node, position);
}
}
} | [
"function",
"(",
"config",
")",
"{",
"var",
"position",
",",
"choice",
";",
"position",
"=",
"this",
".",
"getChoicePosition",
"(",
"config",
")",
";",
"if",
"(",
"position",
"!==",
"-",
"1",
")",
"{",
"choice",
"=",
"this",
".",
"choicesList",
"[",
"position",
"]",
";",
"if",
"(",
"!",
"choice",
".",
"visible",
")",
"{",
"choice",
".",
"visible",
"=",
"true",
";",
"this",
".",
"appendChoiceNode",
"(",
"choice",
".",
"node",
",",
"position",
")",
";",
"}",
"}",
"}"
]
| Show a choice
@param {Object} config An object targeting the choice to show (e.g. { position : 1 } || { value: 'second' } || { label: 'Second' }) | [
"Show",
"a",
"choice"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L6032-L6051 |
|
42,345 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function (config, unselect) {
var position, choice;
// Should we unselect choice if disabling selected choice
if (lang.isUndefined(unselect) || !lang.isBoolean(unselect)) { unselect = true; }
position = this.getChoicePosition(config);
if (position !== -1) {
choice = this.choicesList[position];
this.disableChoiceNode(choice.node);
// Clear if disabling selected choice
if (unselect && this.getValue() === choice.value) {
this.clear();
}
}
} | javascript | function (config, unselect) {
var position, choice;
// Should we unselect choice if disabling selected choice
if (lang.isUndefined(unselect) || !lang.isBoolean(unselect)) { unselect = true; }
position = this.getChoicePosition(config);
if (position !== -1) {
choice = this.choicesList[position];
this.disableChoiceNode(choice.node);
// Clear if disabling selected choice
if (unselect && this.getValue() === choice.value) {
this.clear();
}
}
} | [
"function",
"(",
"config",
",",
"unselect",
")",
"{",
"var",
"position",
",",
"choice",
";",
"// Should we unselect choice if disabling selected choice",
"if",
"(",
"lang",
".",
"isUndefined",
"(",
"unselect",
")",
"||",
"!",
"lang",
".",
"isBoolean",
"(",
"unselect",
")",
")",
"{",
"unselect",
"=",
"true",
";",
"}",
"position",
"=",
"this",
".",
"getChoicePosition",
"(",
"config",
")",
";",
"if",
"(",
"position",
"!==",
"-",
"1",
")",
"{",
"choice",
"=",
"this",
".",
"choicesList",
"[",
"position",
"]",
";",
"this",
".",
"disableChoiceNode",
"(",
"choice",
".",
"node",
")",
";",
"// Clear if disabling selected choice",
"if",
"(",
"unselect",
"&&",
"this",
".",
"getValue",
"(",
")",
"===",
"choice",
".",
"value",
")",
"{",
"this",
".",
"clear",
"(",
")",
";",
"}",
"}",
"}"
]
| Disable a choice
@param {Object} config An object targeting the choice to disable (e.g. { position : 1 } || { value: 'second' } || { label: 'Second' }) | [
"Disable",
"a",
"choice"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L6057-L6079 |
|
42,346 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function (config) {
var position, choice;
position = this.getChoicePosition(config);
if (position !== -1) {
choice = this.choicesList[position];
this.enableChoiceNode(choice.node);
}
} | javascript | function (config) {
var position, choice;
position = this.getChoicePosition(config);
if (position !== -1) {
choice = this.choicesList[position];
this.enableChoiceNode(choice.node);
}
} | [
"function",
"(",
"config",
")",
"{",
"var",
"position",
",",
"choice",
";",
"position",
"=",
"this",
".",
"getChoicePosition",
"(",
"config",
")",
";",
"if",
"(",
"position",
"!==",
"-",
"1",
")",
"{",
"choice",
"=",
"this",
".",
"choicesList",
"[",
"position",
"]",
";",
"this",
".",
"enableChoiceNode",
"(",
"choice",
".",
"node",
")",
";",
"}",
"}"
]
| Enable a choice
@param {Object} config An object targeting the choice to enable (e.g. { position : 1 } || { value: 'second' } || { label: 'Second' }) | [
"Enable",
"a",
"choice"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L6085-L6099 |
|
42,347 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function () {
var i, length;
// create DOM <select> node
this.el = inputEx.cn('select', {
id: this.divEl.id ? this.divEl.id + '-field' : YAHOO.util.Dom.generateId(),
name: this.options.name || ''
});
// list of choices (e.g. [{ label: "France", value:"fr", node:<DOM-node>, visible:true }, {...}, ...])
this.choicesList = [];
// add choices
for (i = 0, length = this.options.choices.length; i < length; i += 1) {
this.addChoice(this.options.choices[i]);
}
// append <select> to DOM tree
this.fieldContainer.appendChild(this.el);
} | javascript | function () {
var i, length;
// create DOM <select> node
this.el = inputEx.cn('select', {
id: this.divEl.id ? this.divEl.id + '-field' : YAHOO.util.Dom.generateId(),
name: this.options.name || ''
});
// list of choices (e.g. [{ label: "France", value:"fr", node:<DOM-node>, visible:true }, {...}, ...])
this.choicesList = [];
// add choices
for (i = 0, length = this.options.choices.length; i < length; i += 1) {
this.addChoice(this.options.choices[i]);
}
// append <select> to DOM tree
this.fieldContainer.appendChild(this.el);
} | [
"function",
"(",
")",
"{",
"var",
"i",
",",
"length",
";",
"// create DOM <select> node",
"this",
".",
"el",
"=",
"inputEx",
".",
"cn",
"(",
"'select'",
",",
"{",
"id",
":",
"this",
".",
"divEl",
".",
"id",
"?",
"this",
".",
"divEl",
".",
"id",
"+",
"'-field'",
":",
"YAHOO",
".",
"util",
".",
"Dom",
".",
"generateId",
"(",
")",
",",
"name",
":",
"this",
".",
"options",
".",
"name",
"||",
"''",
"}",
")",
";",
"// list of choices (e.g. [{ label: \"France\", value:\"fr\", node:<DOM-node>, visible:true }, {...}, ...])",
"this",
".",
"choicesList",
"=",
"[",
"]",
";",
"// add choices",
"for",
"(",
"i",
"=",
"0",
",",
"length",
"=",
"this",
".",
"options",
".",
"choices",
".",
"length",
";",
"i",
"<",
"length",
";",
"i",
"+=",
"1",
")",
"{",
"this",
".",
"addChoice",
"(",
"this",
".",
"options",
".",
"choices",
"[",
"i",
"]",
")",
";",
"}",
"// append <select> to DOM tree",
"this",
".",
"fieldContainer",
".",
"appendChild",
"(",
"this",
".",
"el",
")",
";",
"}"
]
| Build a select tag with options | [
"Build",
"a",
"select",
"tag",
"with",
"options"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L6187-L6209 |
|
42,348 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function () {
var choiceIndex;
if (this.el.selectedIndex >= 0) {
choiceIndex = inputEx.indexOf(this.el.childNodes[this.el.selectedIndex], this.choicesList, function (node, choice) {
return node === choice.node;
});
return this.choicesList[choiceIndex].value;
} else {
return "";
}
} | javascript | function () {
var choiceIndex;
if (this.el.selectedIndex >= 0) {
choiceIndex = inputEx.indexOf(this.el.childNodes[this.el.selectedIndex], this.choicesList, function (node, choice) {
return node === choice.node;
});
return this.choicesList[choiceIndex].value;
} else {
return "";
}
} | [
"function",
"(",
")",
"{",
"var",
"choiceIndex",
";",
"if",
"(",
"this",
".",
"el",
".",
"selectedIndex",
">=",
"0",
")",
"{",
"choiceIndex",
"=",
"inputEx",
".",
"indexOf",
"(",
"this",
".",
"el",
".",
"childNodes",
"[",
"this",
".",
"el",
".",
"selectedIndex",
"]",
",",
"this",
".",
"choicesList",
",",
"function",
"(",
"node",
",",
"choice",
")",
"{",
"return",
"node",
"===",
"choice",
".",
"node",
";",
"}",
")",
";",
"return",
"this",
".",
"choicesList",
"[",
"choiceIndex",
"]",
".",
"value",
";",
"}",
"else",
"{",
"return",
"\"\"",
";",
"}",
"}"
]
| Return the value
@return {Any} the selected value | [
"Return",
"the",
"value"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L6270-L6287 |
|
42,349 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(options) {
inputEx.EmailField.superclass.setOptions.call(this, options);
// Overwrite options
this.options.messages.invalid = inputEx.messages.invalidEmail;
this.options.regexp = inputEx.regexps.email;
// Validate the domain name ( false by default )
this.options.fixdomain = (YAHOO.lang.isUndefined(options.fixdomain) ? false : !!options.fixdomain);
} | javascript | function(options) {
inputEx.EmailField.superclass.setOptions.call(this, options);
// Overwrite options
this.options.messages.invalid = inputEx.messages.invalidEmail;
this.options.regexp = inputEx.regexps.email;
// Validate the domain name ( false by default )
this.options.fixdomain = (YAHOO.lang.isUndefined(options.fixdomain) ? false : !!options.fixdomain);
} | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"EmailField",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"// Overwrite options",
"this",
".",
"options",
".",
"messages",
".",
"invalid",
"=",
"inputEx",
".",
"messages",
".",
"invalidEmail",
";",
"this",
".",
"options",
".",
"regexp",
"=",
"inputEx",
".",
"regexps",
".",
"email",
";",
"// Validate the domain name ( false by default )",
"this",
".",
"options",
".",
"fixdomain",
"=",
"(",
"YAHOO",
".",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"fixdomain",
")",
"?",
"false",
":",
"!",
"!",
"options",
".",
"fixdomain",
")",
";",
"}"
]
| Set the email regexp and invalid message
@param {Object} options Options object as passed to the constructor | [
"Set",
"the",
"email",
"regexp",
"and",
"invalid",
"message"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L6408-L6417 |
|
42,350 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
var value;
value = inputEx.EmailField.superclass.getValue.call(this);
return inputEx.removeAccents(value.toLowerCase());
} | javascript | function() {
var value;
value = inputEx.EmailField.superclass.getValue.call(this);
return inputEx.removeAccents(value.toLowerCase());
} | [
"function",
"(",
")",
"{",
"var",
"value",
";",
"value",
"=",
"inputEx",
".",
"EmailField",
".",
"superclass",
".",
"getValue",
".",
"call",
"(",
"this",
")",
";",
"return",
"inputEx",
".",
"removeAccents",
"(",
"value",
".",
"toLowerCase",
"(",
")",
")",
";",
"}"
]
| Set the value to lower case since email have no case
@return {String} The email string | [
"Set",
"the",
"value",
"to",
"lower",
"case",
"since",
"email",
"have",
"no",
"case"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L6519-L6526 |
|
42,351 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(options) {
inputEx.UrlField.superclass.setOptions.call(this, options);
this.options.className = options.className ? options.className : "inputEx-Field inputEx-UrlField";
this.options.messages.invalid = inputEx.messages.invalidUrl;
this.options.favicon = lang.isUndefined(options.favicon) ? (("https:" == document.location.protocol) ? false : true) : options.favicon;
this.options.size = options.size || 50;
// validate with url regexp
this.options.regexp = inputEx.regexps.url;
} | javascript | function(options) {
inputEx.UrlField.superclass.setOptions.call(this, options);
this.options.className = options.className ? options.className : "inputEx-Field inputEx-UrlField";
this.options.messages.invalid = inputEx.messages.invalidUrl;
this.options.favicon = lang.isUndefined(options.favicon) ? (("https:" == document.location.protocol) ? false : true) : options.favicon;
this.options.size = options.size || 50;
// validate with url regexp
this.options.regexp = inputEx.regexps.url;
} | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"UrlField",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"this",
".",
"options",
".",
"className",
"=",
"options",
".",
"className",
"?",
"options",
".",
"className",
":",
"\"inputEx-Field inputEx-UrlField\"",
";",
"this",
".",
"options",
".",
"messages",
".",
"invalid",
"=",
"inputEx",
".",
"messages",
".",
"invalidUrl",
";",
"this",
".",
"options",
".",
"favicon",
"=",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"favicon",
")",
"?",
"(",
"(",
"\"https:\"",
"==",
"document",
".",
"location",
".",
"protocol",
")",
"?",
"false",
":",
"true",
")",
":",
"options",
".",
"favicon",
";",
"this",
".",
"options",
".",
"size",
"=",
"options",
".",
"size",
"||",
"50",
";",
"// validate with url regexp",
"this",
".",
"options",
".",
"regexp",
"=",
"inputEx",
".",
"regexps",
".",
"url",
";",
"}"
]
| Adds the invalid Url message
@param {Object} options Options object as passed to the constructor | [
"Adds",
"the",
"invalid",
"Url",
"message"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L6562-L6572 |
|
42,352 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
inputEx.UrlField.superclass.render.call(this);
this.el.size = this.options.size;
if(!this.options.favicon) {
YAHOO.util.Dom.addClass(this.el, 'nofavicon');
}
// Create the favicon image tag
if(this.options.favicon) {
this.favicon = inputEx.cn('img', {src: inputEx.spacerUrl});
this.fieldContainer.insertBefore(this.favicon,this.fieldContainer.childNodes[0]);
// focus field when clicking on favicon
YAHOO.util.Event.addListener(this.favicon,"click",function(){this.focus();},this,true);
}
} | javascript | function() {
inputEx.UrlField.superclass.render.call(this);
this.el.size = this.options.size;
if(!this.options.favicon) {
YAHOO.util.Dom.addClass(this.el, 'nofavicon');
}
// Create the favicon image tag
if(this.options.favicon) {
this.favicon = inputEx.cn('img', {src: inputEx.spacerUrl});
this.fieldContainer.insertBefore(this.favicon,this.fieldContainer.childNodes[0]);
// focus field when clicking on favicon
YAHOO.util.Event.addListener(this.favicon,"click",function(){this.focus();},this,true);
}
} | [
"function",
"(",
")",
"{",
"inputEx",
".",
"UrlField",
".",
"superclass",
".",
"render",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"el",
".",
"size",
"=",
"this",
".",
"options",
".",
"size",
";",
"if",
"(",
"!",
"this",
".",
"options",
".",
"favicon",
")",
"{",
"YAHOO",
".",
"util",
".",
"Dom",
".",
"addClass",
"(",
"this",
".",
"el",
",",
"'nofavicon'",
")",
";",
"}",
"// Create the favicon image tag",
"if",
"(",
"this",
".",
"options",
".",
"favicon",
")",
"{",
"this",
".",
"favicon",
"=",
"inputEx",
".",
"cn",
"(",
"'img'",
",",
"{",
"src",
":",
"inputEx",
".",
"spacerUrl",
"}",
")",
";",
"this",
".",
"fieldContainer",
".",
"insertBefore",
"(",
"this",
".",
"favicon",
",",
"this",
".",
"fieldContainer",
".",
"childNodes",
"[",
"0",
"]",
")",
";",
"// focus field when clicking on favicon",
"YAHOO",
".",
"util",
".",
"Event",
".",
"addListener",
"(",
"this",
".",
"favicon",
",",
"\"click\"",
",",
"function",
"(",
")",
"{",
"this",
".",
"focus",
"(",
")",
";",
"}",
",",
"this",
",",
"true",
")",
";",
"}",
"}"
]
| Adds a img tag before the field to display the favicon | [
"Adds",
"a",
"img",
"tag",
"before",
"the",
"field",
"to",
"display",
"the",
"favicon"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L6577-L6593 |
|
42,353 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(options) {
inputEx.ListField.superclass.setOptions.call(this, options);
this.options.className = options.className ? options.className : 'inputEx-Field inputEx-ListField';
this.options.sortable = lang.isUndefined(options.sortable) ? false : options.sortable;
this.options.elementType = options.elementType || {type: 'string'};
this.options.useButtons = lang.isUndefined(options.useButtons) ? false : options.useButtons;
this.options.unique = lang.isUndefined(options.unique) ? false : options.unique;
this.options.listAddLabel = options.listAddLabel || inputEx.messages.listAddLink;
this.options.listRemoveLabel = options.listRemoveLabel || inputEx.messages.listRemoveLink;
this.options.maxItems = options.maxItems;
this.options.minItems = options.minItems;
} | javascript | function(options) {
inputEx.ListField.superclass.setOptions.call(this, options);
this.options.className = options.className ? options.className : 'inputEx-Field inputEx-ListField';
this.options.sortable = lang.isUndefined(options.sortable) ? false : options.sortable;
this.options.elementType = options.elementType || {type: 'string'};
this.options.useButtons = lang.isUndefined(options.useButtons) ? false : options.useButtons;
this.options.unique = lang.isUndefined(options.unique) ? false : options.unique;
this.options.listAddLabel = options.listAddLabel || inputEx.messages.listAddLink;
this.options.listRemoveLabel = options.listRemoveLabel || inputEx.messages.listRemoveLink;
this.options.maxItems = options.maxItems;
this.options.minItems = options.minItems;
} | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"ListField",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"this",
".",
"options",
".",
"className",
"=",
"options",
".",
"className",
"?",
"options",
".",
"className",
":",
"'inputEx-Field inputEx-ListField'",
";",
"this",
".",
"options",
".",
"sortable",
"=",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"sortable",
")",
"?",
"false",
":",
"options",
".",
"sortable",
";",
"this",
".",
"options",
".",
"elementType",
"=",
"options",
".",
"elementType",
"||",
"{",
"type",
":",
"'string'",
"}",
";",
"this",
".",
"options",
".",
"useButtons",
"=",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"useButtons",
")",
"?",
"false",
":",
"options",
".",
"useButtons",
";",
"this",
".",
"options",
".",
"unique",
"=",
"lang",
".",
"isUndefined",
"(",
"options",
".",
"unique",
")",
"?",
"false",
":",
"options",
".",
"unique",
";",
"this",
".",
"options",
".",
"listAddLabel",
"=",
"options",
".",
"listAddLabel",
"||",
"inputEx",
".",
"messages",
".",
"listAddLink",
";",
"this",
".",
"options",
".",
"listRemoveLabel",
"=",
"options",
".",
"listRemoveLabel",
"||",
"inputEx",
".",
"messages",
".",
"listRemoveLink",
";",
"this",
".",
"options",
".",
"maxItems",
"=",
"options",
".",
"maxItems",
";",
"this",
".",
"options",
".",
"minItems",
"=",
"options",
".",
"minItems",
";",
"}"
]
| Set the ListField classname
@param {Object} options Options object as passed to the constructor | [
"Set",
"the",
"ListField",
"classname"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L6676-L6691 |
|
42,354 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
// Add element button
if(this.options.useButtons) {
this.addButton = inputEx.cn('img', {src: inputEx.spacerUrl, className: 'inputEx-ListField-addButton'});
this.fieldContainer.appendChild(this.addButton);
}
// List label
this.fieldContainer.appendChild( inputEx.cn('span', null, {marginLeft: "4px"}, this.options.listLabel) );
// Div element to contain the children
this.childContainer = inputEx.cn('div', {className: 'inputEx-ListField-childContainer'});
this.fieldContainer.appendChild(this.childContainer);
// Add link
if(!this.options.useButtons) {
this.addButton = inputEx.cn('a', {className: 'inputEx-List-link'}, null, this.options.listAddLabel);
this.fieldContainer.appendChild(this.addButton);
}
} | javascript | function() {
// Add element button
if(this.options.useButtons) {
this.addButton = inputEx.cn('img', {src: inputEx.spacerUrl, className: 'inputEx-ListField-addButton'});
this.fieldContainer.appendChild(this.addButton);
}
// List label
this.fieldContainer.appendChild( inputEx.cn('span', null, {marginLeft: "4px"}, this.options.listLabel) );
// Div element to contain the children
this.childContainer = inputEx.cn('div', {className: 'inputEx-ListField-childContainer'});
this.fieldContainer.appendChild(this.childContainer);
// Add link
if(!this.options.useButtons) {
this.addButton = inputEx.cn('a', {className: 'inputEx-List-link'}, null, this.options.listAddLabel);
this.fieldContainer.appendChild(this.addButton);
}
} | [
"function",
"(",
")",
"{",
"// Add element button",
"if",
"(",
"this",
".",
"options",
".",
"useButtons",
")",
"{",
"this",
".",
"addButton",
"=",
"inputEx",
".",
"cn",
"(",
"'img'",
",",
"{",
"src",
":",
"inputEx",
".",
"spacerUrl",
",",
"className",
":",
"'inputEx-ListField-addButton'",
"}",
")",
";",
"this",
".",
"fieldContainer",
".",
"appendChild",
"(",
"this",
".",
"addButton",
")",
";",
"}",
"// List label",
"this",
".",
"fieldContainer",
".",
"appendChild",
"(",
"inputEx",
".",
"cn",
"(",
"'span'",
",",
"null",
",",
"{",
"marginLeft",
":",
"\"4px\"",
"}",
",",
"this",
".",
"options",
".",
"listLabel",
")",
")",
";",
"// Div element to contain the children",
"this",
".",
"childContainer",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"'inputEx-ListField-childContainer'",
"}",
")",
";",
"this",
".",
"fieldContainer",
".",
"appendChild",
"(",
"this",
".",
"childContainer",
")",
";",
"// Add link",
"if",
"(",
"!",
"this",
".",
"options",
".",
"useButtons",
")",
"{",
"this",
".",
"addButton",
"=",
"inputEx",
".",
"cn",
"(",
"'a'",
",",
"{",
"className",
":",
"'inputEx-List-link'",
"}",
",",
"null",
",",
"this",
".",
"options",
".",
"listAddLabel",
")",
";",
"this",
".",
"fieldContainer",
".",
"appendChild",
"(",
"this",
".",
"addButton",
")",
";",
"}",
"}"
]
| Render the addButton | [
"Render",
"the",
"addButton"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L6696-L6716 |
|
42,355 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(value, sendUpdatedEvt) {
if(!lang.isArray(value) ) {
throw new Error("inputEx.ListField.setValue expected an array, got "+(typeof value));
}
// Set the values (and add the lines if necessary)
for(var i = 0 ; i < value.length ; i++) {
if(i == this.subFields.length) {
this.addElement(value[i]);
}
else {
this.subFields[i].setValue(value[i], false);
}
}
// Remove additional subFields
var additionalElements = this.subFields.length-value.length;
if(additionalElements > 0) {
for(i = 0 ; i < additionalElements ; i++) {
this.removeElement(value.length);
}
}
inputEx.ListField.superclass.setValue.call(this, value, sendUpdatedEvt);
} | javascript | function(value, sendUpdatedEvt) {
if(!lang.isArray(value) ) {
throw new Error("inputEx.ListField.setValue expected an array, got "+(typeof value));
}
// Set the values (and add the lines if necessary)
for(var i = 0 ; i < value.length ; i++) {
if(i == this.subFields.length) {
this.addElement(value[i]);
}
else {
this.subFields[i].setValue(value[i], false);
}
}
// Remove additional subFields
var additionalElements = this.subFields.length-value.length;
if(additionalElements > 0) {
for(i = 0 ; i < additionalElements ; i++) {
this.removeElement(value.length);
}
}
inputEx.ListField.superclass.setValue.call(this, value, sendUpdatedEvt);
} | [
"function",
"(",
"value",
",",
"sendUpdatedEvt",
")",
"{",
"if",
"(",
"!",
"lang",
".",
"isArray",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"inputEx.ListField.setValue expected an array, got \"",
"+",
"(",
"typeof",
"value",
")",
")",
";",
"}",
"// Set the values (and add the lines if necessary)",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"value",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"i",
"==",
"this",
".",
"subFields",
".",
"length",
")",
"{",
"this",
".",
"addElement",
"(",
"value",
"[",
"i",
"]",
")",
";",
"}",
"else",
"{",
"this",
".",
"subFields",
"[",
"i",
"]",
".",
"setValue",
"(",
"value",
"[",
"i",
"]",
",",
"false",
")",
";",
"}",
"}",
"// Remove additional subFields",
"var",
"additionalElements",
"=",
"this",
".",
"subFields",
".",
"length",
"-",
"value",
".",
"length",
";",
"if",
"(",
"additionalElements",
">",
"0",
")",
"{",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"additionalElements",
";",
"i",
"++",
")",
"{",
"this",
".",
"removeElement",
"(",
"value",
".",
"length",
")",
";",
"}",
"}",
"inputEx",
".",
"ListField",
".",
"superclass",
".",
"setValue",
".",
"call",
"(",
"this",
",",
"value",
",",
"sendUpdatedEvt",
")",
";",
"}"
]
| Set the value of all the subfields
@param {Array} value The list of values 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",
"of",
"all",
"the",
"subfields"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L6769-L6794 |
|
42,356 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
var values = [];
for(var i = 0 ; i < this.subFields.length ; i++) {
values[i] = this.subFields[i].getValue();
}
return values;
} | javascript | function() {
var values = [];
for(var i = 0 ; i < this.subFields.length ; i++) {
values[i] = this.subFields[i].getValue();
}
return values;
} | [
"function",
"(",
")",
"{",
"var",
"values",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"subFields",
".",
"length",
";",
"i",
"++",
")",
"{",
"values",
"[",
"i",
"]",
"=",
"this",
".",
"subFields",
"[",
"i",
"]",
".",
"getValue",
"(",
")",
";",
"}",
"return",
"values",
";",
"}"
]
| Return the array of values
@return {Array} The array | [
"Return",
"the",
"array",
"of",
"values"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L6800-L6806 |
|
42,357 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(e) {
Event.stopEvent(e);
// Prevent adding a new field if already at maxItems
if( lang.isNumber(this.options.maxItems) && this.subFields.length >= this.options.maxItems ) {
return;
}
// Add a field with no value:
var subFieldEl = this.addElement();
// Focus on this field
subFieldEl.focus();
// Fire updated !
this.fireUpdatedEvt();
} | javascript | function(e) {
Event.stopEvent(e);
// Prevent adding a new field if already at maxItems
if( lang.isNumber(this.options.maxItems) && this.subFields.length >= this.options.maxItems ) {
return;
}
// Add a field with no value:
var subFieldEl = this.addElement();
// Focus on this field
subFieldEl.focus();
// Fire updated !
this.fireUpdatedEvt();
} | [
"function",
"(",
"e",
")",
"{",
"Event",
".",
"stopEvent",
"(",
"e",
")",
";",
"// Prevent adding a new field if already at maxItems",
"if",
"(",
"lang",
".",
"isNumber",
"(",
"this",
".",
"options",
".",
"maxItems",
")",
"&&",
"this",
".",
"subFields",
".",
"length",
">=",
"this",
".",
"options",
".",
"maxItems",
")",
"{",
"return",
";",
"}",
"// Add a field with no value: ",
"var",
"subFieldEl",
"=",
"this",
".",
"addElement",
"(",
")",
";",
"// Focus on this field",
"subFieldEl",
".",
"focus",
"(",
")",
";",
"// Fire updated !",
"this",
".",
"fireUpdatedEvt",
"(",
")",
";",
"}"
]
| Add a new element to the list and fire updated event
@param {Event} e The original click event | [
"Add",
"a",
"new",
"element",
"to",
"the",
"list",
"and",
"fire",
"updated",
"event"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L6828-L6844 |
|
42,358 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(index) {
var elementDiv = this.subFields[index].getEl().parentNode;
this.subFields[index] = undefined;
this.subFields = inputEx.compactArray(this.subFields);
// Remove the element
elementDiv.parentNode.removeChild(elementDiv);
} | javascript | function(index) {
var elementDiv = this.subFields[index].getEl().parentNode;
this.subFields[index] = undefined;
this.subFields = inputEx.compactArray(this.subFields);
// Remove the element
elementDiv.parentNode.removeChild(elementDiv);
} | [
"function",
"(",
"index",
")",
"{",
"var",
"elementDiv",
"=",
"this",
".",
"subFields",
"[",
"index",
"]",
".",
"getEl",
"(",
")",
".",
"parentNode",
";",
"this",
".",
"subFields",
"[",
"index",
"]",
"=",
"undefined",
";",
"this",
".",
"subFields",
"=",
"inputEx",
".",
"compactArray",
"(",
"this",
".",
"subFields",
")",
";",
"// Remove the element",
"elementDiv",
".",
"parentNode",
".",
"removeChild",
"(",
"elementDiv",
")",
";",
"}"
]
| Remove the line from the dom and the subField from the list.
@param {integer} index The index of the element to remove | [
"Remove",
"the",
"line",
"from",
"the",
"dom",
"and",
"the",
"subField",
"from",
"the",
"list",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L7037-L7045 |
|
42,359 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(options) {
inputEx.CheckBox.superclass.setOptions.call(this, options);
// Overwrite options:
this.options.className = options.className ? options.className : 'inputEx-Field inputEx-CheckBox';
this.options.rightLabel = options.rightLabel || '';
// Added options
this.sentValues = options.sentValues || [true, false];
this.options.sentValues = this.sentValues; // for compatibility
this.checkedValue = this.sentValues[0];
this.uncheckedValue = this.sentValues[1];
} | javascript | function(options) {
inputEx.CheckBox.superclass.setOptions.call(this, options);
// Overwrite options:
this.options.className = options.className ? options.className : 'inputEx-Field inputEx-CheckBox';
this.options.rightLabel = options.rightLabel || '';
// Added options
this.sentValues = options.sentValues || [true, false];
this.options.sentValues = this.sentValues; // for compatibility
this.checkedValue = this.sentValues[0];
this.uncheckedValue = this.sentValues[1];
} | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"CheckBox",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"// Overwrite options:",
"this",
".",
"options",
".",
"className",
"=",
"options",
".",
"className",
"?",
"options",
".",
"className",
":",
"'inputEx-Field inputEx-CheckBox'",
";",
"this",
".",
"options",
".",
"rightLabel",
"=",
"options",
".",
"rightLabel",
"||",
"''",
";",
"// Added options",
"this",
".",
"sentValues",
"=",
"options",
".",
"sentValues",
"||",
"[",
"true",
",",
"false",
"]",
";",
"this",
".",
"options",
".",
"sentValues",
"=",
"this",
".",
"sentValues",
";",
"// for compatibility",
"this",
".",
"checkedValue",
"=",
"this",
".",
"sentValues",
"[",
"0",
"]",
";",
"this",
".",
"uncheckedValue",
"=",
"this",
".",
"sentValues",
"[",
"1",
"]",
";",
"}"
]
| Adds the CheckBox specific options
@param {Object} options Options object as passed to the constructor | [
"Adds",
"the",
"CheckBox",
"specific",
"options"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L7083-L7096 |
|
42,360 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
// Awful Hack to work in IE6 and below (the checkbox doesn't fire the change event)
// It seems IE 8 removed this behavior from IE7 so it only works with IE 7 ??
/*if( YAHOO.env.ua.ie && parseInt(YAHOO.env.ua.ie,10) != 7 ) {
Event.addListener(this.el, "click", function() { this.fireUpdatedEvt(); }, this, true);
}*/
if( YAHOO.env.ua.ie ) {
Event.addListener(this.el, "click", function(e) { YAHOO.lang.later(10,this,function(){this.onChange(e);}); }, this, true);
} else {
Event.addListener(this.el, "change", this.onChange, this, true);
}
Event.addFocusListener(this.el, this.onFocus, this, true);
Event.addBlurListener(this.el, this.onBlur, this, true);
} | javascript | function() {
// Awful Hack to work in IE6 and below (the checkbox doesn't fire the change event)
// It seems IE 8 removed this behavior from IE7 so it only works with IE 7 ??
/*if( YAHOO.env.ua.ie && parseInt(YAHOO.env.ua.ie,10) != 7 ) {
Event.addListener(this.el, "click", function() { this.fireUpdatedEvt(); }, this, true);
}*/
if( YAHOO.env.ua.ie ) {
Event.addListener(this.el, "click", function(e) { YAHOO.lang.later(10,this,function(){this.onChange(e);}); }, this, true);
} else {
Event.addListener(this.el, "change", this.onChange, this, true);
}
Event.addFocusListener(this.el, this.onFocus, this, true);
Event.addBlurListener(this.el, this.onBlur, this, true);
} | [
"function",
"(",
")",
"{",
"// Awful Hack to work in IE6 and below (the checkbox doesn't fire the change event)",
"// It seems IE 8 removed this behavior from IE7 so it only works with IE 7 ??",
"/*if( YAHOO.env.ua.ie && parseInt(YAHOO.env.ua.ie,10) != 7 ) {\n\t Event.addListener(this.el, \"click\", function() { this.fireUpdatedEvt(); }, this, true);\t\n\t }*/",
"if",
"(",
"YAHOO",
".",
"env",
".",
"ua",
".",
"ie",
")",
"{",
"Event",
".",
"addListener",
"(",
"this",
".",
"el",
",",
"\"click\"",
",",
"function",
"(",
"e",
")",
"{",
"YAHOO",
".",
"lang",
".",
"later",
"(",
"10",
",",
"this",
",",
"function",
"(",
")",
"{",
"this",
".",
"onChange",
"(",
"e",
")",
";",
"}",
")",
";",
"}",
",",
"this",
",",
"true",
")",
";",
"}",
"else",
"{",
"Event",
".",
"addListener",
"(",
"this",
".",
"el",
",",
"\"change\"",
",",
"this",
".",
"onChange",
",",
"this",
",",
"true",
")",
";",
"}",
"Event",
".",
"addFocusListener",
"(",
"this",
".",
"el",
",",
"this",
".",
"onFocus",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"addBlurListener",
"(",
"this",
".",
"el",
",",
"this",
".",
"onBlur",
",",
"this",
",",
"true",
")",
";",
"}"
]
| Clear the previous events and listen for the "change" event | [
"Clear",
"the",
"previous",
"events",
"and",
"listen",
"for",
"the",
"change",
"event"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L7120-L7135 |
|
42,361 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(value, sendUpdatedEvt) {
if (value===this.checkedValue || (typeof(value) == 'string' && typeof(this.checkedValue) == 'boolean' &&
value === String(this.checkedValue))) {
this.hiddenEl.value = this.checkedValue;
// check checkbox (all browsers)
this.el.checked = true;
// hacks for IE6, because input is not operational at init,
// so "this.el.checked = true" would work for default values !
// (but still work for later setValue calls)
if (YAHOO.env.ua.ie === 6) {
this.el.setAttribute("defaultChecked","checked"); // for IE6
}
}
else {
// DEBUG :
/*if (value!==this.uncheckedValue && lang.isObject(console) && lang.isFunction(console.log) ) {
console.log("inputEx.CheckBox: value is *"+value+"*, schould be in ["+this.checkedValue+","+this.uncheckedValue+"]");
}*/
this.hiddenEl.value = this.uncheckedValue;
// uncheck checkbox (all browsers)
this.el.checked = false;
// hacks for IE6, because input is not operational at init,
// so "this.el.checked = false" would work for default values !
// (but still work for later setValue calls)
if (YAHOO.env.ua.ie === 6) {
this.el.removeAttribute("defaultChecked"); // for IE6
}
}
// Call Field.setValue to set class and fire updated event
inputEx.CheckBox.superclass.setValue.call(this,value, sendUpdatedEvt);
} | javascript | function(value, sendUpdatedEvt) {
if (value===this.checkedValue || (typeof(value) == 'string' && typeof(this.checkedValue) == 'boolean' &&
value === String(this.checkedValue))) {
this.hiddenEl.value = this.checkedValue;
// check checkbox (all browsers)
this.el.checked = true;
// hacks for IE6, because input is not operational at init,
// so "this.el.checked = true" would work for default values !
// (but still work for later setValue calls)
if (YAHOO.env.ua.ie === 6) {
this.el.setAttribute("defaultChecked","checked"); // for IE6
}
}
else {
// DEBUG :
/*if (value!==this.uncheckedValue && lang.isObject(console) && lang.isFunction(console.log) ) {
console.log("inputEx.CheckBox: value is *"+value+"*, schould be in ["+this.checkedValue+","+this.uncheckedValue+"]");
}*/
this.hiddenEl.value = this.uncheckedValue;
// uncheck checkbox (all browsers)
this.el.checked = false;
// hacks for IE6, because input is not operational at init,
// so "this.el.checked = false" would work for default values !
// (but still work for later setValue calls)
if (YAHOO.env.ua.ie === 6) {
this.el.removeAttribute("defaultChecked"); // for IE6
}
}
// Call Field.setValue to set class and fire updated event
inputEx.CheckBox.superclass.setValue.call(this,value, sendUpdatedEvt);
} | [
"function",
"(",
"value",
",",
"sendUpdatedEvt",
")",
"{",
"if",
"(",
"value",
"===",
"this",
".",
"checkedValue",
"||",
"(",
"typeof",
"(",
"value",
")",
"==",
"'string'",
"&&",
"typeof",
"(",
"this",
".",
"checkedValue",
")",
"==",
"'boolean'",
"&&",
"value",
"===",
"String",
"(",
"this",
".",
"checkedValue",
")",
")",
")",
"{",
"this",
".",
"hiddenEl",
".",
"value",
"=",
"this",
".",
"checkedValue",
";",
"// check checkbox (all browsers)",
"this",
".",
"el",
".",
"checked",
"=",
"true",
";",
"// hacks for IE6, because input is not operational at init, ",
"// so \"this.el.checked = true\" would work for default values !",
"// (but still work for later setValue calls)",
"if",
"(",
"YAHOO",
".",
"env",
".",
"ua",
".",
"ie",
"===",
"6",
")",
"{",
"this",
".",
"el",
".",
"setAttribute",
"(",
"\"defaultChecked\"",
",",
"\"checked\"",
")",
";",
"// for IE6",
"}",
"}",
"else",
"{",
"// DEBUG :",
"/*if (value!==this.uncheckedValue && lang.isObject(console) && lang.isFunction(console.log) ) {\n\t console.log(\"inputEx.CheckBox: value is *\"+value+\"*, schould be in [\"+this.checkedValue+\",\"+this.uncheckedValue+\"]\");\n }*/",
"this",
".",
"hiddenEl",
".",
"value",
"=",
"this",
".",
"uncheckedValue",
";",
"// uncheck checkbox (all browsers)",
"this",
".",
"el",
".",
"checked",
"=",
"false",
";",
"// hacks for IE6, because input is not operational at init, ",
"// so \"this.el.checked = false\" would work for default values !",
"// (but still work for later setValue calls)",
"if",
"(",
"YAHOO",
".",
"env",
".",
"ua",
".",
"ie",
"===",
"6",
")",
"{",
"this",
".",
"el",
".",
"removeAttribute",
"(",
"\"defaultChecked\"",
")",
";",
"// for IE6",
"}",
"}",
"// Call Field.setValue to set class and fire updated event",
"inputEx",
".",
"CheckBox",
".",
"superclass",
".",
"setValue",
".",
"call",
"(",
"this",
",",
"value",
",",
"sendUpdatedEvt",
")",
";",
"}"
]
| Set the value of the checkedbox
@param {Any} value The value schould be one of [checkedValue,uncheckedValue]
@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",
"checkedbox"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L7160-L7195 |
|
42,362 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(text) {
var sel, startPos, endPos;
//IE support
if (document.selection) {
this.el.focus();
sel = document.selection.createRange();
sel.text = text;
}
//Mozilla/Firefox/Netscape 7+ support
else if (this.el.selectionStart || this.el.selectionStart == '0') {
startPos = this.el.selectionStart;
endPos = this.el.selectionEnd;
this.el.value = this.el.value.substring(0, startPos)+ text+ this.el.value.substring(endPos, this.el.value.length);
}
else {
this.el.value += text;
}
} | javascript | function(text) {
var sel, startPos, endPos;
//IE support
if (document.selection) {
this.el.focus();
sel = document.selection.createRange();
sel.text = text;
}
//Mozilla/Firefox/Netscape 7+ support
else if (this.el.selectionStart || this.el.selectionStart == '0') {
startPos = this.el.selectionStart;
endPos = this.el.selectionEnd;
this.el.value = this.el.value.substring(0, startPos)+ text+ this.el.value.substring(endPos, this.el.value.length);
}
else {
this.el.value += text;
}
} | [
"function",
"(",
"text",
")",
"{",
"var",
"sel",
",",
"startPos",
",",
"endPos",
";",
"//IE support",
"if",
"(",
"document",
".",
"selection",
")",
"{",
"this",
".",
"el",
".",
"focus",
"(",
")",
";",
"sel",
"=",
"document",
".",
"selection",
".",
"createRange",
"(",
")",
";",
"sel",
".",
"text",
"=",
"text",
";",
"}",
"//Mozilla/Firefox/Netscape 7+ support",
"else",
"if",
"(",
"this",
".",
"el",
".",
"selectionStart",
"||",
"this",
".",
"el",
".",
"selectionStart",
"==",
"'0'",
")",
"{",
"startPos",
"=",
"this",
".",
"el",
".",
"selectionStart",
";",
"endPos",
"=",
"this",
".",
"el",
".",
"selectionEnd",
";",
"this",
".",
"el",
".",
"value",
"=",
"this",
".",
"el",
".",
"value",
".",
"substring",
"(",
"0",
",",
"startPos",
")",
"+",
"text",
"+",
"this",
".",
"el",
".",
"value",
".",
"substring",
"(",
"endPos",
",",
"this",
".",
"el",
".",
"value",
".",
"length",
")",
";",
"}",
"else",
"{",
"this",
".",
"el",
".",
"value",
"+=",
"text",
";",
"}",
"}"
]
| Insert text at the current cursor position
@param {String} text Text to insert | [
"Insert",
"text",
"at",
"the",
"current",
"cursor",
"position"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L7311-L7330 |
|
42,363 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
this.editorContainer = inputEx.cn('div', {className: CSS_PREFIX+'editor'}, {display: 'none'});
// Render the editor field
this.editorField = inputEx(this.options.editorField,this);
var editorFieldEl = this.editorField.getEl();
this.editorContainer.appendChild( editorFieldEl );
Dom.addClass( editorFieldEl , CSS_PREFIX+'editorDiv');
this.okButton = new inputEx.widget.Button({
type: this.options.buttonTypes.ok,
parentEl: this.editorContainer,
value: inputEx.messages.okEditor,
className: "inputEx-Button "+CSS_PREFIX+'OkButton',
onClick: {fn: this.onOkEditor, scope:this}
});
this.cancelLink = new inputEx.widget.Button({
type: this.options.buttonTypes.cancel,
parentEl: this.editorContainer,
value: inputEx.messages.cancelEditor,
className: "inputEx-Button "+CSS_PREFIX+'CancelLink',
onClick: {fn: this.onCancelEditor, scope:this}
});
// Line breaker ()
this.editorContainer.appendChild( inputEx.cn('div',null, {clear: 'both'}) );
this.fieldContainer.appendChild(this.editorContainer);
} | javascript | function() {
this.editorContainer = inputEx.cn('div', {className: CSS_PREFIX+'editor'}, {display: 'none'});
// Render the editor field
this.editorField = inputEx(this.options.editorField,this);
var editorFieldEl = this.editorField.getEl();
this.editorContainer.appendChild( editorFieldEl );
Dom.addClass( editorFieldEl , CSS_PREFIX+'editorDiv');
this.okButton = new inputEx.widget.Button({
type: this.options.buttonTypes.ok,
parentEl: this.editorContainer,
value: inputEx.messages.okEditor,
className: "inputEx-Button "+CSS_PREFIX+'OkButton',
onClick: {fn: this.onOkEditor, scope:this}
});
this.cancelLink = new inputEx.widget.Button({
type: this.options.buttonTypes.cancel,
parentEl: this.editorContainer,
value: inputEx.messages.cancelEditor,
className: "inputEx-Button "+CSS_PREFIX+'CancelLink',
onClick: {fn: this.onCancelEditor, scope:this}
});
// Line breaker ()
this.editorContainer.appendChild( inputEx.cn('div',null, {clear: 'both'}) );
this.fieldContainer.appendChild(this.editorContainer);
} | [
"function",
"(",
")",
"{",
"this",
".",
"editorContainer",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"CSS_PREFIX",
"+",
"'editor'",
"}",
",",
"{",
"display",
":",
"'none'",
"}",
")",
";",
"// Render the editor field",
"this",
".",
"editorField",
"=",
"inputEx",
"(",
"this",
".",
"options",
".",
"editorField",
",",
"this",
")",
";",
"var",
"editorFieldEl",
"=",
"this",
".",
"editorField",
".",
"getEl",
"(",
")",
";",
"this",
".",
"editorContainer",
".",
"appendChild",
"(",
"editorFieldEl",
")",
";",
"Dom",
".",
"addClass",
"(",
"editorFieldEl",
",",
"CSS_PREFIX",
"+",
"'editorDiv'",
")",
";",
"this",
".",
"okButton",
"=",
"new",
"inputEx",
".",
"widget",
".",
"Button",
"(",
"{",
"type",
":",
"this",
".",
"options",
".",
"buttonTypes",
".",
"ok",
",",
"parentEl",
":",
"this",
".",
"editorContainer",
",",
"value",
":",
"inputEx",
".",
"messages",
".",
"okEditor",
",",
"className",
":",
"\"inputEx-Button \"",
"+",
"CSS_PREFIX",
"+",
"'OkButton'",
",",
"onClick",
":",
"{",
"fn",
":",
"this",
".",
"onOkEditor",
",",
"scope",
":",
"this",
"}",
"}",
")",
";",
"this",
".",
"cancelLink",
"=",
"new",
"inputEx",
".",
"widget",
".",
"Button",
"(",
"{",
"type",
":",
"this",
".",
"options",
".",
"buttonTypes",
".",
"cancel",
",",
"parentEl",
":",
"this",
".",
"editorContainer",
",",
"value",
":",
"inputEx",
".",
"messages",
".",
"cancelEditor",
",",
"className",
":",
"\"inputEx-Button \"",
"+",
"CSS_PREFIX",
"+",
"'CancelLink'",
",",
"onClick",
":",
"{",
"fn",
":",
"this",
".",
"onCancelEditor",
",",
"scope",
":",
"this",
"}",
"}",
")",
";",
"// Line breaker ()",
"this",
".",
"editorContainer",
".",
"appendChild",
"(",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"null",
",",
"{",
"clear",
":",
"'both'",
"}",
")",
")",
";",
"this",
".",
"fieldContainer",
".",
"appendChild",
"(",
"this",
".",
"editorContainer",
")",
";",
"}"
]
| Render the editor | [
"Render",
"the",
"editor"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L7390-L7422 |
|
42,364 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(e) {
if(this.colorAnim) {
this.colorAnim.stop(true);
}
inputEx.sn(this.formattedContainer, null, {backgroundColor: this.options.animColors.from });
} | javascript | function(e) {
if(this.colorAnim) {
this.colorAnim.stop(true);
}
inputEx.sn(this.formattedContainer, null, {backgroundColor: this.options.animColors.from });
} | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"this",
".",
"colorAnim",
")",
"{",
"this",
".",
"colorAnim",
".",
"stop",
"(",
"true",
")",
";",
"}",
"inputEx",
".",
"sn",
"(",
"this",
".",
"formattedContainer",
",",
"null",
",",
"{",
"backgroundColor",
":",
"this",
".",
"options",
".",
"animColors",
".",
"from",
"}",
")",
";",
"}"
]
| Set the color when hovering the field
@param {Event} e The original mouseover event | [
"Set",
"the",
"color",
"when",
"hovering",
"the",
"field"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L7428-L7433 |
|
42,365 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(e) {
// Start animation
if(this.colorAnim) {
this.colorAnim.stop(true);
}
this.colorAnim = new YAHOO.util.ColorAnim(this.formattedContainer, {backgroundColor: this.options.animColors}, 1);
this.colorAnim.onComplete.subscribe(function() { Dom.setStyle(this.formattedContainer, 'background-color', ''); }, this, true);
this.colorAnim.animate();
} | javascript | function(e) {
// Start animation
if(this.colorAnim) {
this.colorAnim.stop(true);
}
this.colorAnim = new YAHOO.util.ColorAnim(this.formattedContainer, {backgroundColor: this.options.animColors}, 1);
this.colorAnim.onComplete.subscribe(function() { Dom.setStyle(this.formattedContainer, 'background-color', ''); }, this, true);
this.colorAnim.animate();
} | [
"function",
"(",
"e",
")",
"{",
"// Start animation",
"if",
"(",
"this",
".",
"colorAnim",
")",
"{",
"this",
".",
"colorAnim",
".",
"stop",
"(",
"true",
")",
";",
"}",
"this",
".",
"colorAnim",
"=",
"new",
"YAHOO",
".",
"util",
".",
"ColorAnim",
"(",
"this",
".",
"formattedContainer",
",",
"{",
"backgroundColor",
":",
"this",
".",
"options",
".",
"animColors",
"}",
",",
"1",
")",
";",
"this",
".",
"colorAnim",
".",
"onComplete",
".",
"subscribe",
"(",
"function",
"(",
")",
"{",
"Dom",
".",
"setStyle",
"(",
"this",
".",
"formattedContainer",
",",
"'background-color'",
",",
"''",
")",
";",
"}",
",",
"this",
",",
"true",
")",
";",
"this",
".",
"colorAnim",
".",
"animate",
"(",
")",
";",
"}"
]
| Start the color animation when hovering the field
@param {Event} e The original mouseout event | [
"Start",
"the",
"color",
"animation",
"when",
"hovering",
"the",
"field"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L7439-L7447 |
|
42,366 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
this.formattedContainer = inputEx.cn('div', {className: 'inputEx-InPlaceEdit-visu'});
if( lang.isFunction(this.options.formatDom) ) {
this.formattedContainer.appendChild( this.options.formatDom(this.options.value) );
}
else if( lang.isFunction(this.options.formatValue) ) {
this.formattedContainer.innerHTML = this.options.formatValue(this.options.value);
}
else {
this.formattedContainer.innerHTML = lang.isUndefined(this.options.value) ? inputEx.messages.emptyInPlaceEdit: this.options.value;
}
this.fieldContainer.appendChild(this.formattedContainer);
} | javascript | function() {
this.formattedContainer = inputEx.cn('div', {className: 'inputEx-InPlaceEdit-visu'});
if( lang.isFunction(this.options.formatDom) ) {
this.formattedContainer.appendChild( this.options.formatDom(this.options.value) );
}
else if( lang.isFunction(this.options.formatValue) ) {
this.formattedContainer.innerHTML = this.options.formatValue(this.options.value);
}
else {
this.formattedContainer.innerHTML = lang.isUndefined(this.options.value) ? inputEx.messages.emptyInPlaceEdit: this.options.value;
}
this.fieldContainer.appendChild(this.formattedContainer);
} | [
"function",
"(",
")",
"{",
"this",
".",
"formattedContainer",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"'inputEx-InPlaceEdit-visu'",
"}",
")",
";",
"if",
"(",
"lang",
".",
"isFunction",
"(",
"this",
".",
"options",
".",
"formatDom",
")",
")",
"{",
"this",
".",
"formattedContainer",
".",
"appendChild",
"(",
"this",
".",
"options",
".",
"formatDom",
"(",
"this",
".",
"options",
".",
"value",
")",
")",
";",
"}",
"else",
"if",
"(",
"lang",
".",
"isFunction",
"(",
"this",
".",
"options",
".",
"formatValue",
")",
")",
"{",
"this",
".",
"formattedContainer",
".",
"innerHTML",
"=",
"this",
".",
"options",
".",
"formatValue",
"(",
"this",
".",
"options",
".",
"value",
")",
";",
"}",
"else",
"{",
"this",
".",
"formattedContainer",
".",
"innerHTML",
"=",
"lang",
".",
"isUndefined",
"(",
"this",
".",
"options",
".",
"value",
")",
"?",
"inputEx",
".",
"messages",
".",
"emptyInPlaceEdit",
":",
"this",
".",
"options",
".",
"value",
";",
"}",
"this",
".",
"fieldContainer",
".",
"appendChild",
"(",
"this",
".",
"formattedContainer",
")",
";",
"}"
]
| Create the div that will contain the visualization of the value | [
"Create",
"the",
"div",
"that",
"will",
"contain",
"the",
"visualization",
"of",
"the",
"value"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L7452-L7467 |
|
42,367 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
Event.addListener(this.formattedContainer, "click", this.openEditor, this, true);
// For color animation (if specified)
if (this.options.animColors) {
Event.addListener(this.formattedContainer, 'mouseover', this.onVisuMouseOver, this, true);
Event.addListener(this.formattedContainer, 'mouseout', this.onVisuMouseOut, this, true);
}
if(this.editorField.el) {
// Register some listeners
Event.addListener(this.editorField.el, "keyup", this.onKeyUp, this, true);
Event.addListener(this.editorField.el, "keydown", this.onKeyDown, this, true);
}
} | javascript | function() {
Event.addListener(this.formattedContainer, "click", this.openEditor, this, true);
// For color animation (if specified)
if (this.options.animColors) {
Event.addListener(this.formattedContainer, 'mouseover', this.onVisuMouseOver, this, true);
Event.addListener(this.formattedContainer, 'mouseout', this.onVisuMouseOut, this, true);
}
if(this.editorField.el) {
// Register some listeners
Event.addListener(this.editorField.el, "keyup", this.onKeyUp, this, true);
Event.addListener(this.editorField.el, "keydown", this.onKeyDown, this, true);
}
} | [
"function",
"(",
")",
"{",
"Event",
".",
"addListener",
"(",
"this",
".",
"formattedContainer",
",",
"\"click\"",
",",
"this",
".",
"openEditor",
",",
"this",
",",
"true",
")",
";",
"// For color animation (if specified)",
"if",
"(",
"this",
".",
"options",
".",
"animColors",
")",
"{",
"Event",
".",
"addListener",
"(",
"this",
".",
"formattedContainer",
",",
"'mouseover'",
",",
"this",
".",
"onVisuMouseOver",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"addListener",
"(",
"this",
".",
"formattedContainer",
",",
"'mouseout'",
",",
"this",
".",
"onVisuMouseOut",
",",
"this",
",",
"true",
")",
";",
"}",
"if",
"(",
"this",
".",
"editorField",
".",
"el",
")",
"{",
"// Register some listeners",
"Event",
".",
"addListener",
"(",
"this",
".",
"editorField",
".",
"el",
",",
"\"keyup\"",
",",
"this",
".",
"onKeyUp",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"addListener",
"(",
"this",
".",
"editorField",
".",
"el",
",",
"\"keydown\"",
",",
"this",
".",
"onKeyDown",
",",
"this",
",",
"true",
")",
";",
"}",
"}"
]
| Adds the events for the editor and color animations | [
"Adds",
"the",
"events",
"for",
"the",
"editor",
"and",
"color",
"animations"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L7472-L7486 |
|
42,368 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
var value = this.getValue();
this.editorContainer.style.display = '';
this.formattedContainer.style.display = 'none';
if(!lang.isUndefined(value)) {
this.editorField.setValue(value);
}
// Set focus in the element !
this.editorField.focus();
// Select the content
if(this.editorField.el && lang.isFunction(this.editorField.el.setSelectionRange) && (!!value && !!value.length)) {
this.editorField.el.setSelectionRange(0,value.length);
}
} | javascript | function() {
var value = this.getValue();
this.editorContainer.style.display = '';
this.formattedContainer.style.display = 'none';
if(!lang.isUndefined(value)) {
this.editorField.setValue(value);
}
// Set focus in the element !
this.editorField.focus();
// Select the content
if(this.editorField.el && lang.isFunction(this.editorField.el.setSelectionRange) && (!!value && !!value.length)) {
this.editorField.el.setSelectionRange(0,value.length);
}
} | [
"function",
"(",
")",
"{",
"var",
"value",
"=",
"this",
".",
"getValue",
"(",
")",
";",
"this",
".",
"editorContainer",
".",
"style",
".",
"display",
"=",
"''",
";",
"this",
".",
"formattedContainer",
".",
"style",
".",
"display",
"=",
"'none'",
";",
"if",
"(",
"!",
"lang",
".",
"isUndefined",
"(",
"value",
")",
")",
"{",
"this",
".",
"editorField",
".",
"setValue",
"(",
"value",
")",
";",
"}",
"// Set focus in the element !",
"this",
".",
"editorField",
".",
"focus",
"(",
")",
";",
"// Select the content",
"if",
"(",
"this",
".",
"editorField",
".",
"el",
"&&",
"lang",
".",
"isFunction",
"(",
"this",
".",
"editorField",
".",
"el",
".",
"setSelectionRange",
")",
"&&",
"(",
"!",
"!",
"value",
"&&",
"!",
"!",
"value",
".",
"length",
")",
")",
"{",
"this",
".",
"editorField",
".",
"el",
".",
"setSelectionRange",
"(",
"0",
",",
"value",
".",
"length",
")",
";",
"}",
"}"
]
| Display the editor | [
"Display",
"the",
"editor"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L7544-L7561 |
|
42,369 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(value, sendUpdatedEvt) {
// Store the value
this.value = value;
if(lang.isUndefined(value) || value == "") {
inputEx.renderVisu(this.options.visu, inputEx.messages.emptyInPlaceEdit, this.formattedContainer);
}
else {
inputEx.renderVisu(this.options.visu, this.value, this.formattedContainer);
}
// If the editor is opened, update it
if(this.editorContainer.style.display == '') {
this.editorField.setValue(value);
}
inputEx.InPlaceEdit.superclass.setValue.call(this, value, sendUpdatedEvt);
} | javascript | function(value, sendUpdatedEvt) {
// Store the value
this.value = value;
if(lang.isUndefined(value) || value == "") {
inputEx.renderVisu(this.options.visu, inputEx.messages.emptyInPlaceEdit, this.formattedContainer);
}
else {
inputEx.renderVisu(this.options.visu, this.value, this.formattedContainer);
}
// If the editor is opened, update it
if(this.editorContainer.style.display == '') {
this.editorField.setValue(value);
}
inputEx.InPlaceEdit.superclass.setValue.call(this, value, sendUpdatedEvt);
} | [
"function",
"(",
"value",
",",
"sendUpdatedEvt",
")",
"{",
"// Store the value",
"this",
".",
"value",
"=",
"value",
";",
"if",
"(",
"lang",
".",
"isUndefined",
"(",
"value",
")",
"||",
"value",
"==",
"\"\"",
")",
"{",
"inputEx",
".",
"renderVisu",
"(",
"this",
".",
"options",
".",
"visu",
",",
"inputEx",
".",
"messages",
".",
"emptyInPlaceEdit",
",",
"this",
".",
"formattedContainer",
")",
";",
"}",
"else",
"{",
"inputEx",
".",
"renderVisu",
"(",
"this",
".",
"options",
".",
"visu",
",",
"this",
".",
"value",
",",
"this",
".",
"formattedContainer",
")",
";",
"}",
"// If the editor is opened, update it ",
"if",
"(",
"this",
".",
"editorContainer",
".",
"style",
".",
"display",
"==",
"''",
")",
"{",
"this",
".",
"editorField",
".",
"setValue",
"(",
"value",
")",
";",
"}",
"inputEx",
".",
"InPlaceEdit",
".",
"superclass",
".",
"setValue",
".",
"call",
"(",
"this",
",",
"value",
",",
"sendUpdatedEvt",
")",
";",
"}"
]
| Set the value and update the display
@param {Any} value The value 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",
"and",
"update",
"the",
"display"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L7577-L7594 |
|
42,370 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
try {
// Save the previous value:
var previousVal = null;
// Close a previously created group
if(this.group) {
previousVal = this.group.getValue();
this.group.close();
this.group.destroy();
this.groupOptionsWrapper.innerHTML = "";
}
// Get value is directly the class !!
var classO = inputEx.getFieldClass(this.typeSelect.getValue());
// Instanciate the group
var groupParams = {fields: classO.groupOptions, parentEl: this.groupOptionsWrapper};
this.group = new inputEx.Group(groupParams);
// Set the previous name/label
if(previousVal) {
this.group.setValue({
name: previousVal.name,
label: previousVal.label
});
}
// Register the updated event
this.group.updatedEvt.subscribe(this.onChangeGroupOptions, this, true);
// Create the value field
this.updateFieldValue();
} catch(ex) {
if(YAHOO.lang.isObject(window["console"]) && YAHOO.lang.isFunction(window["console"]["log"]) ) {
console.log("inputEx.TypeField.rebuildGroupOptions: ", ex);
}
}
} | javascript | function() {
try {
// Save the previous value:
var previousVal = null;
// Close a previously created group
if(this.group) {
previousVal = this.group.getValue();
this.group.close();
this.group.destroy();
this.groupOptionsWrapper.innerHTML = "";
}
// Get value is directly the class !!
var classO = inputEx.getFieldClass(this.typeSelect.getValue());
// Instanciate the group
var groupParams = {fields: classO.groupOptions, parentEl: this.groupOptionsWrapper};
this.group = new inputEx.Group(groupParams);
// Set the previous name/label
if(previousVal) {
this.group.setValue({
name: previousVal.name,
label: previousVal.label
});
}
// Register the updated event
this.group.updatedEvt.subscribe(this.onChangeGroupOptions, this, true);
// Create the value field
this.updateFieldValue();
} catch(ex) {
if(YAHOO.lang.isObject(window["console"]) && YAHOO.lang.isFunction(window["console"]["log"]) ) {
console.log("inputEx.TypeField.rebuildGroupOptions: ", ex);
}
}
} | [
"function",
"(",
")",
"{",
"try",
"{",
"// Save the previous value:",
"var",
"previousVal",
"=",
"null",
";",
"// Close a previously created group",
"if",
"(",
"this",
".",
"group",
")",
"{",
"previousVal",
"=",
"this",
".",
"group",
".",
"getValue",
"(",
")",
";",
"this",
".",
"group",
".",
"close",
"(",
")",
";",
"this",
".",
"group",
".",
"destroy",
"(",
")",
";",
"this",
".",
"groupOptionsWrapper",
".",
"innerHTML",
"=",
"\"\"",
";",
"}",
"// Get value is directly the class !!",
"var",
"classO",
"=",
"inputEx",
".",
"getFieldClass",
"(",
"this",
".",
"typeSelect",
".",
"getValue",
"(",
")",
")",
";",
"// Instanciate the group",
"var",
"groupParams",
"=",
"{",
"fields",
":",
"classO",
".",
"groupOptions",
",",
"parentEl",
":",
"this",
".",
"groupOptionsWrapper",
"}",
";",
"this",
".",
"group",
"=",
"new",
"inputEx",
".",
"Group",
"(",
"groupParams",
")",
";",
"// Set the previous name/label",
"if",
"(",
"previousVal",
")",
"{",
"this",
".",
"group",
".",
"setValue",
"(",
"{",
"name",
":",
"previousVal",
".",
"name",
",",
"label",
":",
"previousVal",
".",
"label",
"}",
")",
";",
"}",
"// Register the updated event",
"this",
".",
"group",
".",
"updatedEvt",
".",
"subscribe",
"(",
"this",
".",
"onChangeGroupOptions",
",",
"this",
",",
"true",
")",
";",
"// Create the value field",
"this",
".",
"updateFieldValue",
"(",
")",
";",
"}",
"catch",
"(",
"ex",
")",
"{",
"if",
"(",
"YAHOO",
".",
"lang",
".",
"isObject",
"(",
"window",
"[",
"\"console\"",
"]",
")",
"&&",
"YAHOO",
".",
"lang",
".",
"isFunction",
"(",
"window",
"[",
"\"console\"",
"]",
"[",
"\"log\"",
"]",
")",
")",
"{",
"console",
".",
"log",
"(",
"\"inputEx.TypeField.rebuildGroupOptions: \"",
",",
"ex",
")",
";",
"}",
"}",
"}"
]
| Regenerate the property form | [
"Regenerate",
"the",
"property",
"form"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L7689-L7730 |
|
42,371 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
if (this.propertyPanel.style.display == 'none') {
this.propertyPanel.style.display = '';
Dom.addClass(this.button, "opened");
} else {
this.propertyPanel.style.display = 'none';
Dom.removeClass(this.button, "opened");
}
} | javascript | function() {
if (this.propertyPanel.style.display == 'none') {
this.propertyPanel.style.display = '';
Dom.addClass(this.button, "opened");
} else {
this.propertyPanel.style.display = 'none';
Dom.removeClass(this.button, "opened");
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"propertyPanel",
".",
"style",
".",
"display",
"==",
"'none'",
")",
"{",
"this",
".",
"propertyPanel",
".",
"style",
".",
"display",
"=",
"''",
";",
"Dom",
".",
"addClass",
"(",
"this",
".",
"button",
",",
"\"opened\"",
")",
";",
"}",
"else",
"{",
"this",
".",
"propertyPanel",
".",
"style",
".",
"display",
"=",
"'none'",
";",
"Dom",
".",
"removeClass",
"(",
"this",
".",
"button",
",",
"\"opened\"",
")",
";",
"}",
"}"
]
| Toggle the property panel | [
"Toggle",
"the",
"property",
"panel"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L7735-L7743 |
|
42,372 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
try {
// Close previous field
if(this.fieldValue) {
this.fieldValue.close();
this.fieldValue.destroy();
delete this.fieldValue;
this.fieldValueWrapper.innerHTML = '';
}
// Re-build the fieldValue
var fieldOptions = this.group.getValue();
fieldOptions.type = this.getValue().type;
fieldOptions.parentEl = this.fieldValueWrapper;
this.fieldValue = inputEx(fieldOptions,this);
// Refire the event when the fieldValue is updated
this.fieldValue.updatedEvt.subscribe(this.fireUpdatedEvt, this, true);
}
catch(ex) {
console.log("Error while updateFieldValue", ex.message);
}
} | javascript | function() {
try {
// Close previous field
if(this.fieldValue) {
this.fieldValue.close();
this.fieldValue.destroy();
delete this.fieldValue;
this.fieldValueWrapper.innerHTML = '';
}
// Re-build the fieldValue
var fieldOptions = this.group.getValue();
fieldOptions.type = this.getValue().type;
fieldOptions.parentEl = this.fieldValueWrapper;
this.fieldValue = inputEx(fieldOptions,this);
// Refire the event when the fieldValue is updated
this.fieldValue.updatedEvt.subscribe(this.fireUpdatedEvt, this, true);
}
catch(ex) {
console.log("Error while updateFieldValue", ex.message);
}
} | [
"function",
"(",
")",
"{",
"try",
"{",
"// Close previous field",
"if",
"(",
"this",
".",
"fieldValue",
")",
"{",
"this",
".",
"fieldValue",
".",
"close",
"(",
")",
";",
"this",
".",
"fieldValue",
".",
"destroy",
"(",
")",
";",
"delete",
"this",
".",
"fieldValue",
";",
"this",
".",
"fieldValueWrapper",
".",
"innerHTML",
"=",
"''",
";",
"}",
"// Re-build the fieldValue",
"var",
"fieldOptions",
"=",
"this",
".",
"group",
".",
"getValue",
"(",
")",
";",
"fieldOptions",
".",
"type",
"=",
"this",
".",
"getValue",
"(",
")",
".",
"type",
";",
"fieldOptions",
".",
"parentEl",
"=",
"this",
".",
"fieldValueWrapper",
";",
"this",
".",
"fieldValue",
"=",
"inputEx",
"(",
"fieldOptions",
",",
"this",
")",
";",
"// Refire the event when the fieldValue is updated",
"this",
".",
"fieldValue",
".",
"updatedEvt",
".",
"subscribe",
"(",
"this",
".",
"fireUpdatedEvt",
",",
"this",
",",
"true",
")",
";",
"}",
"catch",
"(",
"ex",
")",
"{",
"console",
".",
"log",
"(",
"\"Error while updateFieldValue\"",
",",
"ex",
".",
"message",
")",
";",
"}",
"}"
]
| Update the fieldValue | [
"Update",
"the",
"fieldValue"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L7760-L7784 |
|
42,373 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(value, sendUpdatedEvt) {
// Set type in property panel
this.typeSelect.setValue(value.type, false);
// Rebuild the panel propertues
this.rebuildGroupOptions();
// Set the parameters value
// Retro-compatibility with deprecated inputParams Object
if (lang.isObject(value.inputParams)) {
this.group.setValue(value.inputParams, false);
// New prefered way to describe a field
} else {
this.group.setValue(value, false);
}
// Rebuild the fieldValue
this.updateFieldValue();
// Set field value : TODO -> fix it for default value (because updateFieldValue is called after first setValue)
// Retro-compatibility with deprecated inputParams Object
if(lang.isObject(value.inputParams) && !lang.isUndefined(value.inputParams.value)) {
this.fieldValue.setValue(value.inputParams.value);
// New prefered way to describe a field
} else if (!lang.isUndefined(value.value)) {
this.fieldValue.setValue(value.value);
}
if(sendUpdatedEvt !== false) {
// fire update event
this.fireUpdatedEvt();
}
} | javascript | function(value, sendUpdatedEvt) {
// Set type in property panel
this.typeSelect.setValue(value.type, false);
// Rebuild the panel propertues
this.rebuildGroupOptions();
// Set the parameters value
// Retro-compatibility with deprecated inputParams Object
if (lang.isObject(value.inputParams)) {
this.group.setValue(value.inputParams, false);
// New prefered way to describe a field
} else {
this.group.setValue(value, false);
}
// Rebuild the fieldValue
this.updateFieldValue();
// Set field value : TODO -> fix it for default value (because updateFieldValue is called after first setValue)
// Retro-compatibility with deprecated inputParams Object
if(lang.isObject(value.inputParams) && !lang.isUndefined(value.inputParams.value)) {
this.fieldValue.setValue(value.inputParams.value);
// New prefered way to describe a field
} else if (!lang.isUndefined(value.value)) {
this.fieldValue.setValue(value.value);
}
if(sendUpdatedEvt !== false) {
// fire update event
this.fireUpdatedEvt();
}
} | [
"function",
"(",
"value",
",",
"sendUpdatedEvt",
")",
"{",
"// Set type in property panel",
"this",
".",
"typeSelect",
".",
"setValue",
"(",
"value",
".",
"type",
",",
"false",
")",
";",
"// Rebuild the panel propertues",
"this",
".",
"rebuildGroupOptions",
"(",
")",
";",
"// Set the parameters value",
"// Retro-compatibility with deprecated inputParams Object",
"if",
"(",
"lang",
".",
"isObject",
"(",
"value",
".",
"inputParams",
")",
")",
"{",
"this",
".",
"group",
".",
"setValue",
"(",
"value",
".",
"inputParams",
",",
"false",
")",
";",
"// New prefered way to describe a field",
"}",
"else",
"{",
"this",
".",
"group",
".",
"setValue",
"(",
"value",
",",
"false",
")",
";",
"}",
"// Rebuild the fieldValue",
"this",
".",
"updateFieldValue",
"(",
")",
";",
"// Set field value : TODO -> fix it for default value (because updateFieldValue is called after first setValue)",
"// Retro-compatibility with deprecated inputParams Object",
"if",
"(",
"lang",
".",
"isObject",
"(",
"value",
".",
"inputParams",
")",
"&&",
"!",
"lang",
".",
"isUndefined",
"(",
"value",
".",
"inputParams",
".",
"value",
")",
")",
"{",
"this",
".",
"fieldValue",
".",
"setValue",
"(",
"value",
".",
"inputParams",
".",
"value",
")",
";",
"// New prefered way to describe a field",
"}",
"else",
"if",
"(",
"!",
"lang",
".",
"isUndefined",
"(",
"value",
".",
"value",
")",
")",
"{",
"this",
".",
"fieldValue",
".",
"setValue",
"(",
"value",
".",
"value",
")",
";",
"}",
"if",
"(",
"sendUpdatedEvt",
"!==",
"false",
")",
"{",
"// fire update event",
"this",
".",
"fireUpdatedEvt",
"(",
")",
";",
"}",
"}"
]
| Set the value of the label, typeProperties and group
@param {Object} value Type object configuration
@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",
"label",
"typeProperties",
"and",
"group"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L7792-L7829 |
|
42,374 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
var getDefaultValueForField = function (classObj, paramName) {
var i, length = classObj.groupOptions.length, f;
for(i = 0 ; i < length ; i++) {
f = classObj.groupOptions[i];
// Retro-compatibility with deprecated inputParams Object
if(lang.isObject(f.inputParams) && f.inputParams.name == paramName) {
return f.inputParams.value;
// New prefered way to use field options
} else if (f.name == paramName) {
return f.value;
}
}
return undefined;
};
// The field parameters
var fieldParams = this.group.getValue();
var classObj = inputEx.getFieldClass(this.typeSelect.getValue());
// + default values
for(var key in fieldParams) {
if( fieldParams.hasOwnProperty(key) ) {
var value1 = getDefaultValueForField(classObj, key);
var value2 = fieldParams[key];
if(value1 == value2) {
fieldParams[key] = undefined;
}
}
}
// The field type
fieldParams.type = this.typeSelect.getValue();
// The value defined by the fieldValue
if(this.fieldValue) fieldParams.value = this.fieldValue.getValue();
return fieldParams;
} | javascript | function() {
var getDefaultValueForField = function (classObj, paramName) {
var i, length = classObj.groupOptions.length, f;
for(i = 0 ; i < length ; i++) {
f = classObj.groupOptions[i];
// Retro-compatibility with deprecated inputParams Object
if(lang.isObject(f.inputParams) && f.inputParams.name == paramName) {
return f.inputParams.value;
// New prefered way to use field options
} else if (f.name == paramName) {
return f.value;
}
}
return undefined;
};
// The field parameters
var fieldParams = this.group.getValue();
var classObj = inputEx.getFieldClass(this.typeSelect.getValue());
// + default values
for(var key in fieldParams) {
if( fieldParams.hasOwnProperty(key) ) {
var value1 = getDefaultValueForField(classObj, key);
var value2 = fieldParams[key];
if(value1 == value2) {
fieldParams[key] = undefined;
}
}
}
// The field type
fieldParams.type = this.typeSelect.getValue();
// The value defined by the fieldValue
if(this.fieldValue) fieldParams.value = this.fieldValue.getValue();
return fieldParams;
} | [
"function",
"(",
")",
"{",
"var",
"getDefaultValueForField",
"=",
"function",
"(",
"classObj",
",",
"paramName",
")",
"{",
"var",
"i",
",",
"length",
"=",
"classObj",
".",
"groupOptions",
".",
"length",
",",
"f",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"i",
"++",
")",
"{",
"f",
"=",
"classObj",
".",
"groupOptions",
"[",
"i",
"]",
";",
"// Retro-compatibility with deprecated inputParams Object",
"if",
"(",
"lang",
".",
"isObject",
"(",
"f",
".",
"inputParams",
")",
"&&",
"f",
".",
"inputParams",
".",
"name",
"==",
"paramName",
")",
"{",
"return",
"f",
".",
"inputParams",
".",
"value",
";",
"// New prefered way to use field options",
"}",
"else",
"if",
"(",
"f",
".",
"name",
"==",
"paramName",
")",
"{",
"return",
"f",
".",
"value",
";",
"}",
"}",
"return",
"undefined",
";",
"}",
";",
"// The field parameters",
"var",
"fieldParams",
"=",
"this",
".",
"group",
".",
"getValue",
"(",
")",
";",
"var",
"classObj",
"=",
"inputEx",
".",
"getFieldClass",
"(",
"this",
".",
"typeSelect",
".",
"getValue",
"(",
")",
")",
";",
"// + default values",
"for",
"(",
"var",
"key",
"in",
"fieldParams",
")",
"{",
"if",
"(",
"fieldParams",
".",
"hasOwnProperty",
"(",
"key",
")",
")",
"{",
"var",
"value1",
"=",
"getDefaultValueForField",
"(",
"classObj",
",",
"key",
")",
";",
"var",
"value2",
"=",
"fieldParams",
"[",
"key",
"]",
";",
"if",
"(",
"value1",
"==",
"value2",
")",
"{",
"fieldParams",
"[",
"key",
"]",
"=",
"undefined",
";",
"}",
"}",
"}",
"// The field type",
"fieldParams",
".",
"type",
"=",
"this",
".",
"typeSelect",
".",
"getValue",
"(",
")",
";",
"// The value defined by the fieldValue",
"if",
"(",
"this",
".",
"fieldValue",
")",
"fieldParams",
".",
"value",
"=",
"this",
".",
"fieldValue",
".",
"getValue",
"(",
")",
";",
"return",
"fieldParams",
";",
"}"
]
| Return the config for a entry in an Group
@return {Object} Type object configuration | [
"Return",
"the",
"config",
"for",
"a",
"entry",
"in",
"an",
"Group"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L7835-L7878 |
|
42,375 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
// Render the help panel
this.renderHelpPanel();
/**
* @property layout
* @type {YAHOO.widget.Layout}
*/
this.layout = new widget.Layout(this.el, this.options.layoutOptions);
this.layout.render();
// Right accordion
this.renderPropertiesAccordion();
// Render buttons
this.renderButtons();
// Saved status
this.renderSavedStatus();
// Properties Form
this.renderPropertiesForm();
} | javascript | function() {
// Render the help panel
this.renderHelpPanel();
/**
* @property layout
* @type {YAHOO.widget.Layout}
*/
this.layout = new widget.Layout(this.el, this.options.layoutOptions);
this.layout.render();
// Right accordion
this.renderPropertiesAccordion();
// Render buttons
this.renderButtons();
// Saved status
this.renderSavedStatus();
// Properties Form
this.renderPropertiesForm();
} | [
"function",
"(",
")",
"{",
"// Render the help panel",
"this",
".",
"renderHelpPanel",
"(",
")",
";",
"/**\n\t * @property layout\n\t * @type {YAHOO.widget.Layout}\n\t */",
"this",
".",
"layout",
"=",
"new",
"widget",
".",
"Layout",
"(",
"this",
".",
"el",
",",
"this",
".",
"options",
".",
"layoutOptions",
")",
";",
"this",
".",
"layout",
".",
"render",
"(",
")",
";",
"// Right accordion",
"this",
".",
"renderPropertiesAccordion",
"(",
")",
";",
"// Render buttons",
"this",
".",
"renderButtons",
"(",
")",
";",
"// Saved status",
"this",
".",
"renderSavedStatus",
"(",
")",
";",
"// Properties Form",
"this",
".",
"renderPropertiesForm",
"(",
")",
";",
"}"
]
| Render the layout & panels | [
"Render",
"the",
"layout",
"&",
"panels"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L7975-L7999 |
|
42,376 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
/**
* @property helpPanel
* @type {YAHOO.widget.Panel}
*/
this.helpPanel = new widget.Panel('helpPanel', {
fixedcenter: true,
draggable: true,
visible: false,
modal: true
});
this.helpPanel.render();
} | javascript | function() {
/**
* @property helpPanel
* @type {YAHOO.widget.Panel}
*/
this.helpPanel = new widget.Panel('helpPanel', {
fixedcenter: true,
draggable: true,
visible: false,
modal: true
});
this.helpPanel.render();
} | [
"function",
"(",
")",
"{",
"/**\n\t * @property helpPanel\n\t * @type {YAHOO.widget.Panel}\n\t */",
"this",
".",
"helpPanel",
"=",
"new",
"widget",
".",
"Panel",
"(",
"'helpPanel'",
",",
"{",
"fixedcenter",
":",
"true",
",",
"draggable",
":",
"true",
",",
"visible",
":",
"false",
",",
"modal",
":",
"true",
"}",
")",
";",
"this",
".",
"helpPanel",
".",
"render",
"(",
")",
";",
"}"
]
| Render the help dialog | [
"Render",
"the",
"help",
"dialog"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L8004-L8016 |
|
42,377 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
/**
* @property alertPanel
* @type {YAHOO.widget.Panel}
*/
this.alertPanel = new widget.Panel('WiringEditor-alertPanel', {
fixedcenter: true,
draggable: true,
width: '500px',
visible: false,
modal: true
});
this.alertPanel.setHeader("Message");
this.alertPanel.setBody("<div id='alertPanelBody'></div><button id='alertPanelButton'>Ok</button>");
this.alertPanel.render(document.body);
Event.addListener('alertPanelButton','click', function() {
this.alertPanel.hide();
}, this, true);
} | javascript | function() {
/**
* @property alertPanel
* @type {YAHOO.widget.Panel}
*/
this.alertPanel = new widget.Panel('WiringEditor-alertPanel', {
fixedcenter: true,
draggable: true,
width: '500px',
visible: false,
modal: true
});
this.alertPanel.setHeader("Message");
this.alertPanel.setBody("<div id='alertPanelBody'></div><button id='alertPanelButton'>Ok</button>");
this.alertPanel.render(document.body);
Event.addListener('alertPanelButton','click', function() {
this.alertPanel.hide();
}, this, true);
} | [
"function",
"(",
")",
"{",
"/**\n * @property alertPanel\n * @type {YAHOO.widget.Panel}\n */",
"this",
".",
"alertPanel",
"=",
"new",
"widget",
".",
"Panel",
"(",
"'WiringEditor-alertPanel'",
",",
"{",
"fixedcenter",
":",
"true",
",",
"draggable",
":",
"true",
",",
"width",
":",
"'500px'",
",",
"visible",
":",
"false",
",",
"modal",
":",
"true",
"}",
")",
";",
"this",
".",
"alertPanel",
".",
"setHeader",
"(",
"\"Message\"",
")",
";",
"this",
".",
"alertPanel",
".",
"setBody",
"(",
"\"<div id='alertPanelBody'></div><button id='alertPanelButton'>Ok</button>\"",
")",
";",
"this",
".",
"alertPanel",
".",
"render",
"(",
"document",
".",
"body",
")",
";",
"Event",
".",
"addListener",
"(",
"'alertPanelButton'",
",",
"'click'",
",",
"function",
"(",
")",
"{",
"this",
".",
"alertPanel",
".",
"hide",
"(",
")",
";",
"}",
",",
"this",
",",
"true",
")",
";",
"}"
]
| Render the alert panel | [
"Render",
"the",
"alert",
"panel"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L8021-L8040 |
|
42,378 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
this.propertiesForm = new inputEx.Group({
parentEl: YAHOO.util.Dom.get('propertiesForm'),
fields: this.options.propertiesFields
});
this.propertiesForm.updatedEvt.subscribe(function() {
this.markUnsaved();
}, this, true);
} | javascript | function() {
this.propertiesForm = new inputEx.Group({
parentEl: YAHOO.util.Dom.get('propertiesForm'),
fields: this.options.propertiesFields
});
this.propertiesForm.updatedEvt.subscribe(function() {
this.markUnsaved();
}, this, true);
} | [
"function",
"(",
")",
"{",
"this",
".",
"propertiesForm",
"=",
"new",
"inputEx",
".",
"Group",
"(",
"{",
"parentEl",
":",
"YAHOO",
".",
"util",
".",
"Dom",
".",
"get",
"(",
"'propertiesForm'",
")",
",",
"fields",
":",
"this",
".",
"options",
".",
"propertiesFields",
"}",
")",
";",
"this",
".",
"propertiesForm",
".",
"updatedEvt",
".",
"subscribe",
"(",
"function",
"(",
")",
"{",
"this",
".",
"markUnsaved",
"(",
")",
";",
"}",
",",
"this",
",",
"true",
")",
";",
"}"
]
| Render the properties form
@method renderPropertiesForm | [
"Render",
"the",
"properties",
"form"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L8117-L8126 |
|
42,379 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(e) {
WireIt.ModuleProxy.superclass.startDrag.call(this,e);
var del = this.getDragEl(),
lel = this.getEl();
del.innerHTML = lel.innerHTML;
del.className = lel.className;
} | javascript | function(e) {
WireIt.ModuleProxy.superclass.startDrag.call(this,e);
var del = this.getDragEl(),
lel = this.getEl();
del.innerHTML = lel.innerHTML;
del.className = lel.className;
} | [
"function",
"(",
"e",
")",
"{",
"WireIt",
".",
"ModuleProxy",
".",
"superclass",
".",
"startDrag",
".",
"call",
"(",
"this",
",",
"e",
")",
";",
"var",
"del",
"=",
"this",
".",
"getDragEl",
"(",
")",
",",
"lel",
"=",
"this",
".",
"getEl",
"(",
")",
";",
"del",
".",
"innerHTML",
"=",
"lel",
".",
"innerHTML",
";",
"del",
".",
"className",
"=",
"lel",
".",
"className",
";",
"}"
]
| copy the html and apply selected classes
@method startDrag | [
"copy",
"the",
"html",
"and",
"apply",
"selected",
"classes"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L8180-L8186 |
|
42,380 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(e, ddTargets) {
// The layer is the only target :
var layerTarget = ddTargets[0],
layer = ddTargets[0]._layer,
del = this.getDragEl(),
pos = Dom.getXY(del),
layerPos = Dom.getXY(layer.el);
this._WiringEditor.addModule( this._module ,[pos[0]-layerPos[0]+layer.el.scrollLeft, pos[1]-layerPos[1]+layer.el.scrollTop]);
} | javascript | function(e, ddTargets) {
// The layer is the only target :
var layerTarget = ddTargets[0],
layer = ddTargets[0]._layer,
del = this.getDragEl(),
pos = Dom.getXY(del),
layerPos = Dom.getXY(layer.el);
this._WiringEditor.addModule( this._module ,[pos[0]-layerPos[0]+layer.el.scrollLeft, pos[1]-layerPos[1]+layer.el.scrollTop]);
} | [
"function",
"(",
"e",
",",
"ddTargets",
")",
"{",
"// The layer is the only target :",
"var",
"layerTarget",
"=",
"ddTargets",
"[",
"0",
"]",
",",
"layer",
"=",
"ddTargets",
"[",
"0",
"]",
".",
"_layer",
",",
"del",
"=",
"this",
".",
"getDragEl",
"(",
")",
",",
"pos",
"=",
"Dom",
".",
"getXY",
"(",
"del",
")",
",",
"layerPos",
"=",
"Dom",
".",
"getXY",
"(",
"layer",
".",
"el",
")",
";",
"this",
".",
"_WiringEditor",
".",
"addModule",
"(",
"this",
".",
"_module",
",",
"[",
"pos",
"[",
"0",
"]",
"-",
"layerPos",
"[",
"0",
"]",
"+",
"layer",
".",
"el",
".",
"scrollLeft",
",",
"pos",
"[",
"1",
"]",
"-",
"layerPos",
"[",
"1",
"]",
"+",
"layer",
".",
"el",
".",
"scrollTop",
"]",
")",
";",
"}"
]
| Add the module to the WiringEditor on drop on layer
@method onDragDrop | [
"Add",
"the",
"module",
"to",
"the",
"WiringEditor",
"on",
"drop",
"on",
"layer"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L8198-L8206 |
|
42,381 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
WireIt.WiringEditor.superclass.render.call(this);
/**
* @property layer
* @type {WireIt.Layer}
*/
this.layer = new WireIt.Layer(this.options.layerOptions);
this.layer.eventChanged.subscribe(this.onLayerChanged, this, true);
// Left Accordion
this.renderModulesAccordion();
// Render module list
this.buildModulesList();
} | javascript | function() {
WireIt.WiringEditor.superclass.render.call(this);
/**
* @property layer
* @type {WireIt.Layer}
*/
this.layer = new WireIt.Layer(this.options.layerOptions);
this.layer.eventChanged.subscribe(this.onLayerChanged, this, true);
// Left Accordion
this.renderModulesAccordion();
// Render module list
this.buildModulesList();
} | [
"function",
"(",
")",
"{",
"WireIt",
".",
"WiringEditor",
".",
"superclass",
".",
"render",
".",
"call",
"(",
"this",
")",
";",
"/**\n\t * @property layer\n\t * @type {WireIt.Layer}\n\t */",
"this",
".",
"layer",
"=",
"new",
"WireIt",
".",
"Layer",
"(",
"this",
".",
"options",
".",
"layerOptions",
")",
";",
"this",
".",
"layer",
".",
"eventChanged",
".",
"subscribe",
"(",
"this",
".",
"onLayerChanged",
",",
"this",
",",
"true",
")",
";",
"// Left Accordion",
"this",
".",
"renderModulesAccordion",
"(",
")",
";",
"// Render module list",
"this",
".",
"buildModulesList",
"(",
")",
";",
"}"
]
| Add the rendering of the layer | [
"Add",
"the",
"rendering",
"of",
"the",
"layer"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L8299-L8315 |
|
42,382 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
// Create the modules accordion DOM if not found
if(!Dom.get('modulesAccordionView')) {
Dom.get('left').appendChild( WireIt.cn('ul', {id: 'modulesAccordionView'}) );
var li = WireIt.cn('li');
li.appendChild(WireIt.cn('h2',null,null,"Main"));
var d = WireIt.cn('div');
d.appendChild( WireIt.cn('div', {id: "module-category-main"}) );
li.appendChild(d);
Dom.get('modulesAccordionView').appendChild(li);
}
this.modulesAccordionView = new YAHOO.widget.AccordionView('modulesAccordionView', this.options.modulesAccordionViewParams);
// Open all panels
for(var l = 1, n = this.modulesAccordionView.getPanels().length; l < n ; l++) {
this.modulesAccordionView.openPanel(l);
}
} | javascript | function() {
// Create the modules accordion DOM if not found
if(!Dom.get('modulesAccordionView')) {
Dom.get('left').appendChild( WireIt.cn('ul', {id: 'modulesAccordionView'}) );
var li = WireIt.cn('li');
li.appendChild(WireIt.cn('h2',null,null,"Main"));
var d = WireIt.cn('div');
d.appendChild( WireIt.cn('div', {id: "module-category-main"}) );
li.appendChild(d);
Dom.get('modulesAccordionView').appendChild(li);
}
this.modulesAccordionView = new YAHOO.widget.AccordionView('modulesAccordionView', this.options.modulesAccordionViewParams);
// Open all panels
for(var l = 1, n = this.modulesAccordionView.getPanels().length; l < n ; l++) {
this.modulesAccordionView.openPanel(l);
}
} | [
"function",
"(",
")",
"{",
"// Create the modules accordion DOM if not found",
"if",
"(",
"!",
"Dom",
".",
"get",
"(",
"'modulesAccordionView'",
")",
")",
"{",
"Dom",
".",
"get",
"(",
"'left'",
")",
".",
"appendChild",
"(",
"WireIt",
".",
"cn",
"(",
"'ul'",
",",
"{",
"id",
":",
"'modulesAccordionView'",
"}",
")",
")",
";",
"var",
"li",
"=",
"WireIt",
".",
"cn",
"(",
"'li'",
")",
";",
"li",
".",
"appendChild",
"(",
"WireIt",
".",
"cn",
"(",
"'h2'",
",",
"null",
",",
"null",
",",
"\"Main\"",
")",
")",
";",
"var",
"d",
"=",
"WireIt",
".",
"cn",
"(",
"'div'",
")",
";",
"d",
".",
"appendChild",
"(",
"WireIt",
".",
"cn",
"(",
"'div'",
",",
"{",
"id",
":",
"\"module-category-main\"",
"}",
")",
")",
";",
"li",
".",
"appendChild",
"(",
"d",
")",
";",
"Dom",
".",
"get",
"(",
"'modulesAccordionView'",
")",
".",
"appendChild",
"(",
"li",
")",
";",
"}",
"this",
".",
"modulesAccordionView",
"=",
"new",
"YAHOO",
".",
"widget",
".",
"AccordionView",
"(",
"'modulesAccordionView'",
",",
"this",
".",
"options",
".",
"modulesAccordionViewParams",
")",
";",
"// Open all panels",
"for",
"(",
"var",
"l",
"=",
"1",
",",
"n",
"=",
"this",
".",
"modulesAccordionView",
".",
"getPanels",
"(",
")",
".",
"length",
";",
"l",
"<",
"n",
";",
"l",
"++",
")",
"{",
"this",
".",
"modulesAccordionView",
".",
"openPanel",
"(",
"l",
")",
";",
"}",
"}"
]
| render the modules accordion in the left panel | [
"render",
"the",
"modules",
"accordion",
"in",
"the",
"left",
"panel"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L8320-L8339 |
|
42,383 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
var modules = this.modules;
for(var i = 0 ; i < modules.length ; i++) {
this.addModuleToList(modules[i]);
}
// Make the layer a drag drop target
if(!this.ddTarget) {
this.ddTarget = new YAHOO.util.DDTarget(this.layer.el, "module");
this.ddTarget._layer = this.layer;
}
} | javascript | function() {
var modules = this.modules;
for(var i = 0 ; i < modules.length ; i++) {
this.addModuleToList(modules[i]);
}
// Make the layer a drag drop target
if(!this.ddTarget) {
this.ddTarget = new YAHOO.util.DDTarget(this.layer.el, "module");
this.ddTarget._layer = this.layer;
}
} | [
"function",
"(",
")",
"{",
"var",
"modules",
"=",
"this",
".",
"modules",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"modules",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"addModuleToList",
"(",
"modules",
"[",
"i",
"]",
")",
";",
"}",
"// Make the layer a drag drop target",
"if",
"(",
"!",
"this",
".",
"ddTarget",
")",
"{",
"this",
".",
"ddTarget",
"=",
"new",
"YAHOO",
".",
"util",
".",
"DDTarget",
"(",
"this",
".",
"layer",
".",
"el",
",",
"\"module\"",
")",
";",
"this",
".",
"ddTarget",
".",
"_layer",
"=",
"this",
".",
"layer",
";",
"}",
"}"
]
| Build the left menu on the left
@method buildModulesList | [
"Build",
"the",
"left",
"menu",
"on",
"the",
"left"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L8346-L8358 |
|
42,384 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(module) {
try {
var div = WireIt.cn('div', {className: "WiringEditor-module"});
if(module.description) {
div.title = module.description;
}
if(module.container.icon) {
div.appendChild( WireIt.cn('img',{src: module.container.icon}) );
}
div.appendChild( WireIt.cn('span', null, null, module.name) );
var ddProxy = new WireIt.ModuleProxy(div, this);
ddProxy._module = module;
// Get the category element in the accordion or create a new one
var category = module.category || "main";
var el = Dom.get("module-category-"+category);
if( !el ) {
this.modulesAccordionView.addPanel({
label: category,
content: "<div id='module-category-"+category+"'></div>"
});
this.modulesAccordionView.openPanel(this.modulesAccordionView._panels.length-1);
el = Dom.get("module-category-"+category);
}
el.appendChild(div);
}catch(ex){ console.log(ex);}
} | javascript | function(module) {
try {
var div = WireIt.cn('div', {className: "WiringEditor-module"});
if(module.description) {
div.title = module.description;
}
if(module.container.icon) {
div.appendChild( WireIt.cn('img',{src: module.container.icon}) );
}
div.appendChild( WireIt.cn('span', null, null, module.name) );
var ddProxy = new WireIt.ModuleProxy(div, this);
ddProxy._module = module;
// Get the category element in the accordion or create a new one
var category = module.category || "main";
var el = Dom.get("module-category-"+category);
if( !el ) {
this.modulesAccordionView.addPanel({
label: category,
content: "<div id='module-category-"+category+"'></div>"
});
this.modulesAccordionView.openPanel(this.modulesAccordionView._panels.length-1);
el = Dom.get("module-category-"+category);
}
el.appendChild(div);
}catch(ex){ console.log(ex);}
} | [
"function",
"(",
"module",
")",
"{",
"try",
"{",
"var",
"div",
"=",
"WireIt",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"\"WiringEditor-module\"",
"}",
")",
";",
"if",
"(",
"module",
".",
"description",
")",
"{",
"div",
".",
"title",
"=",
"module",
".",
"description",
";",
"}",
"if",
"(",
"module",
".",
"container",
".",
"icon",
")",
"{",
"div",
".",
"appendChild",
"(",
"WireIt",
".",
"cn",
"(",
"'img'",
",",
"{",
"src",
":",
"module",
".",
"container",
".",
"icon",
"}",
")",
")",
";",
"}",
"div",
".",
"appendChild",
"(",
"WireIt",
".",
"cn",
"(",
"'span'",
",",
"null",
",",
"null",
",",
"module",
".",
"name",
")",
")",
";",
"var",
"ddProxy",
"=",
"new",
"WireIt",
".",
"ModuleProxy",
"(",
"div",
",",
"this",
")",
";",
"ddProxy",
".",
"_module",
"=",
"module",
";",
"// Get the category element in the accordion or create a new one",
"var",
"category",
"=",
"module",
".",
"category",
"||",
"\"main\"",
";",
"var",
"el",
"=",
"Dom",
".",
"get",
"(",
"\"module-category-\"",
"+",
"category",
")",
";",
"if",
"(",
"!",
"el",
")",
"{",
"this",
".",
"modulesAccordionView",
".",
"addPanel",
"(",
"{",
"label",
":",
"category",
",",
"content",
":",
"\"<div id='module-category-\"",
"+",
"category",
"+",
"\"'></div>\"",
"}",
")",
";",
"this",
".",
"modulesAccordionView",
".",
"openPanel",
"(",
"this",
".",
"modulesAccordionView",
".",
"_panels",
".",
"length",
"-",
"1",
")",
";",
"el",
"=",
"Dom",
".",
"get",
"(",
"\"module-category-\"",
"+",
"category",
")",
";",
"}",
"el",
".",
"appendChild",
"(",
"div",
")",
";",
"}",
"catch",
"(",
"ex",
")",
"{",
"console",
".",
"log",
"(",
"ex",
")",
";",
"}",
"}"
]
| Add a module definition to the left list | [
"Add",
"a",
"module",
"definition",
"to",
"the",
"left",
"list"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L8363-L8393 |
|
42,385 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(module, pos) {
try {
var containerConfig = module.container;
containerConfig.position = pos;
containerConfig.title = module.name;
var temp = this;
containerConfig.getGrouper = function() { return temp.getCurrentGrouper(temp); };
var container = this.layer.addContainer(containerConfig);
// Adding the category CSS class name
var category = module.category || "main";
Dom.addClass(container.el, "WiringEditor-module-category-"+category.replace(/ /g,'-'));
// Adding the module CSS class name
Dom.addClass(container.el, "WiringEditor-module-"+module.name.replace(/ /g,'-'));
}
catch(ex) {
this.alert("Error Layer.addContainer: "+ ex.message);
if(window.console && YAHOO.lang.isFunction(console.log)) {
console.log(ex);
}
}
} | javascript | function(module, pos) {
try {
var containerConfig = module.container;
containerConfig.position = pos;
containerConfig.title = module.name;
var temp = this;
containerConfig.getGrouper = function() { return temp.getCurrentGrouper(temp); };
var container = this.layer.addContainer(containerConfig);
// Adding the category CSS class name
var category = module.category || "main";
Dom.addClass(container.el, "WiringEditor-module-category-"+category.replace(/ /g,'-'));
// Adding the module CSS class name
Dom.addClass(container.el, "WiringEditor-module-"+module.name.replace(/ /g,'-'));
}
catch(ex) {
this.alert("Error Layer.addContainer: "+ ex.message);
if(window.console && YAHOO.lang.isFunction(console.log)) {
console.log(ex);
}
}
} | [
"function",
"(",
"module",
",",
"pos",
")",
"{",
"try",
"{",
"var",
"containerConfig",
"=",
"module",
".",
"container",
";",
"containerConfig",
".",
"position",
"=",
"pos",
";",
"containerConfig",
".",
"title",
"=",
"module",
".",
"name",
";",
"var",
"temp",
"=",
"this",
";",
"containerConfig",
".",
"getGrouper",
"=",
"function",
"(",
")",
"{",
"return",
"temp",
".",
"getCurrentGrouper",
"(",
"temp",
")",
";",
"}",
";",
"var",
"container",
"=",
"this",
".",
"layer",
".",
"addContainer",
"(",
"containerConfig",
")",
";",
"// Adding the category CSS class name",
"var",
"category",
"=",
"module",
".",
"category",
"||",
"\"main\"",
";",
"Dom",
".",
"addClass",
"(",
"container",
".",
"el",
",",
"\"WiringEditor-module-category-\"",
"+",
"category",
".",
"replace",
"(",
"/",
" ",
"/",
"g",
",",
"'-'",
")",
")",
";",
"// Adding the module CSS class name",
"Dom",
".",
"addClass",
"(",
"container",
".",
"el",
",",
"\"WiringEditor-module-\"",
"+",
"module",
".",
"name",
".",
"replace",
"(",
"/",
" ",
"/",
"g",
",",
"'-'",
")",
")",
";",
"}",
"catch",
"(",
"ex",
")",
"{",
"this",
".",
"alert",
"(",
"\"Error Layer.addContainer: \"",
"+",
"ex",
".",
"message",
")",
";",
"if",
"(",
"window",
".",
"console",
"&&",
"YAHOO",
".",
"lang",
".",
"isFunction",
"(",
"console",
".",
"log",
")",
")",
"{",
"console",
".",
"log",
"(",
"ex",
")",
";",
"}",
"}",
"}"
]
| add a module at the given pos | [
"add",
"a",
"module",
"at",
"the",
"given",
"pos"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L8403-L8426 |
|
42,386 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
if(this.inputFilterTimeout) {
clearTimeout(this.inputFilterTimeout);
this.inputFilterTimeout = null;
}
var that = this;
this.inputFilterTimeout = setTimeout(function() {
that.updateLoadPanelList(Dom.get('loadFilter').value);
}, 500);
} | javascript | function() {
if(this.inputFilterTimeout) {
clearTimeout(this.inputFilterTimeout);
this.inputFilterTimeout = null;
}
var that = this;
this.inputFilterTimeout = setTimeout(function() {
that.updateLoadPanelList(Dom.get('loadFilter').value);
}, 500);
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"inputFilterTimeout",
")",
"{",
"clearTimeout",
"(",
"this",
".",
"inputFilterTimeout",
")",
";",
"this",
".",
"inputFilterTimeout",
"=",
"null",
";",
"}",
"var",
"that",
"=",
"this",
";",
"this",
".",
"inputFilterTimeout",
"=",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"that",
".",
"updateLoadPanelList",
"(",
"Dom",
".",
"get",
"(",
"'loadFilter'",
")",
".",
"value",
")",
";",
"}",
",",
"500",
")",
";",
"}"
]
| Method called from each keyup on the search filter in load panel.
The real filtering occurs only after 500ms so that the filter process isn't called too often | [
"Method",
"called",
"from",
"each",
"keyup",
"on",
"the",
"search",
"filter",
"in",
"load",
"panel",
".",
"The",
"real",
"filtering",
"occurs",
"only",
"after",
"500ms",
"so",
"that",
"the",
"filter",
"process",
"isn",
"t",
"called",
"too",
"often"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L8542-L8551 |
|
42,387 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
var i;
var obj = {modules: [], wires: [], properties: null};
for( i = 0 ; i < this.layer.containers.length ; i++) {
obj.modules.push( {name: this.layer.containers[i].title, value: this.layer.containers[i].getValue(), config: this.layer.containers[i].getConfig()});
}
for( i = 0 ; i < this.layer.wires.length ; i++) {
var wire = this.layer.wires[i];
var wireObj = wire.getConfig();
wireObj.src = {moduleId: WireIt.indexOf(wire.terminal1.container, this.layer.containers), terminal: wire.terminal1.name };
wireObj.tgt = {moduleId: WireIt.indexOf(wire.terminal2.container, this.layer.containers), terminal: wire.terminal2.name };
obj.wires.push(wireObj);
}
obj.properties = this.propertiesForm.getValue();
return {
name: obj.properties.name,
working: obj
};
} | javascript | function() {
var i;
var obj = {modules: [], wires: [], properties: null};
for( i = 0 ; i < this.layer.containers.length ; i++) {
obj.modules.push( {name: this.layer.containers[i].title, value: this.layer.containers[i].getValue(), config: this.layer.containers[i].getConfig()});
}
for( i = 0 ; i < this.layer.wires.length ; i++) {
var wire = this.layer.wires[i];
var wireObj = wire.getConfig();
wireObj.src = {moduleId: WireIt.indexOf(wire.terminal1.container, this.layer.containers), terminal: wire.terminal1.name };
wireObj.tgt = {moduleId: WireIt.indexOf(wire.terminal2.container, this.layer.containers), terminal: wire.terminal2.name };
obj.wires.push(wireObj);
}
obj.properties = this.propertiesForm.getValue();
return {
name: obj.properties.name,
working: obj
};
} | [
"function",
"(",
")",
"{",
"var",
"i",
";",
"var",
"obj",
"=",
"{",
"modules",
":",
"[",
"]",
",",
"wires",
":",
"[",
"]",
",",
"properties",
":",
"null",
"}",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"layer",
".",
"containers",
".",
"length",
";",
"i",
"++",
")",
"{",
"obj",
".",
"modules",
".",
"push",
"(",
"{",
"name",
":",
"this",
".",
"layer",
".",
"containers",
"[",
"i",
"]",
".",
"title",
",",
"value",
":",
"this",
".",
"layer",
".",
"containers",
"[",
"i",
"]",
".",
"getValue",
"(",
")",
",",
"config",
":",
"this",
".",
"layer",
".",
"containers",
"[",
"i",
"]",
".",
"getConfig",
"(",
")",
"}",
")",
";",
"}",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"layer",
".",
"wires",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"wire",
"=",
"this",
".",
"layer",
".",
"wires",
"[",
"i",
"]",
";",
"var",
"wireObj",
"=",
"wire",
".",
"getConfig",
"(",
")",
";",
"wireObj",
".",
"src",
"=",
"{",
"moduleId",
":",
"WireIt",
".",
"indexOf",
"(",
"wire",
".",
"terminal1",
".",
"container",
",",
"this",
".",
"layer",
".",
"containers",
")",
",",
"terminal",
":",
"wire",
".",
"terminal1",
".",
"name",
"}",
";",
"wireObj",
".",
"tgt",
"=",
"{",
"moduleId",
":",
"WireIt",
".",
"indexOf",
"(",
"wire",
".",
"terminal2",
".",
"container",
",",
"this",
".",
"layer",
".",
"containers",
")",
",",
"terminal",
":",
"wire",
".",
"terminal2",
".",
"name",
"}",
";",
"obj",
".",
"wires",
".",
"push",
"(",
"wireObj",
")",
";",
"}",
"obj",
".",
"properties",
"=",
"this",
".",
"propertiesForm",
".",
"getValue",
"(",
")",
";",
"return",
"{",
"name",
":",
"obj",
".",
"properties",
".",
"name",
",",
"working",
":",
"obj",
"}",
";",
"}"
]
| This method return a wiring within the given vocabulary described by the modules list
@method getValue | [
"This",
"method",
"return",
"a",
"wiring",
"within",
"the",
"given",
"vocabulary",
"described",
"by",
"the",
"modules",
"list"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L8725-L8748 |
|
42,388 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(group, deep, func, context)
{
if (!lang.isValue(context))
context = this;
if (lang.isValue(group.groupContainer))
func.call(context, group.groupContainer);
else
{
for (var cI in group.containers)
func.call(context, group.containers[cI].container)
if (deep)
{
for (var gI in group.groups)
WireIt.GroupUtils.applyToContainers(group.groups[gI].group, deep, func, context);
}
}
} | javascript | function(group, deep, func, context)
{
if (!lang.isValue(context))
context = this;
if (lang.isValue(group.groupContainer))
func.call(context, group.groupContainer);
else
{
for (var cI in group.containers)
func.call(context, group.containers[cI].container)
if (deep)
{
for (var gI in group.groups)
WireIt.GroupUtils.applyToContainers(group.groups[gI].group, deep, func, context);
}
}
} | [
"function",
"(",
"group",
",",
"deep",
",",
"func",
",",
"context",
")",
"{",
"if",
"(",
"!",
"lang",
".",
"isValue",
"(",
"context",
")",
")",
"context",
"=",
"this",
";",
"if",
"(",
"lang",
".",
"isValue",
"(",
"group",
".",
"groupContainer",
")",
")",
"func",
".",
"call",
"(",
"context",
",",
"group",
".",
"groupContainer",
")",
";",
"else",
"{",
"for",
"(",
"var",
"cI",
"in",
"group",
".",
"containers",
")",
"func",
".",
"call",
"(",
"context",
",",
"group",
".",
"containers",
"[",
"cI",
"]",
".",
"container",
")",
"if",
"(",
"deep",
")",
"{",
"for",
"(",
"var",
"gI",
"in",
"group",
".",
"groups",
")",
"WireIt",
".",
"GroupUtils",
".",
"applyToContainers",
"(",
"group",
".",
"groups",
"[",
"gI",
"]",
".",
"group",
",",
"deep",
",",
"func",
",",
"context",
")",
";",
"}",
"}",
"}"
]
| Applys the given function to all containers in the group.
@method applyToContainers
@param {WireIt.Group} group The group object to work with
@param {boolean} deep Whether to recurse down into sub groups applying to their containers as well
@param {Function} func The function to apply (takes 1 arg, the container)
@param {Object} context The context to call the function with | [
"Applys",
"the",
"given",
"function",
"to",
"all",
"containers",
"in",
"the",
"group",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L10192-L10210 |
|
42,389 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(group, layer)
{
group.collapsing = true;
if (lang.isValue(group.groupContainer))
layer.removeContainer(group.groupContainer);
else
{
for (var i in group.containers)
layer.removeContainer(group.containers[i])
for (var i in group.groups)
WireIt.GroupUtils.removeGroupFromLayer(group.groups[i], layer);
}
group.collapsing = false;
} | javascript | function(group, layer)
{
group.collapsing = true;
if (lang.isValue(group.groupContainer))
layer.removeContainer(group.groupContainer);
else
{
for (var i in group.containers)
layer.removeContainer(group.containers[i])
for (var i in group.groups)
WireIt.GroupUtils.removeGroupFromLayer(group.groups[i], layer);
}
group.collapsing = false;
} | [
"function",
"(",
"group",
",",
"layer",
")",
"{",
"group",
".",
"collapsing",
"=",
"true",
";",
"if",
"(",
"lang",
".",
"isValue",
"(",
"group",
".",
"groupContainer",
")",
")",
"layer",
".",
"removeContainer",
"(",
"group",
".",
"groupContainer",
")",
";",
"else",
"{",
"for",
"(",
"var",
"i",
"in",
"group",
".",
"containers",
")",
"layer",
".",
"removeContainer",
"(",
"group",
".",
"containers",
"[",
"i",
"]",
")",
"for",
"(",
"var",
"i",
"in",
"group",
".",
"groups",
")",
"WireIt",
".",
"GroupUtils",
".",
"removeGroupFromLayer",
"(",
"group",
".",
"groups",
"[",
"i",
"]",
",",
"layer",
")",
";",
"}",
"group",
".",
"collapsing",
"=",
"false",
";",
"}"
]
| Removes the group's containers and sub groups from the layer
@param {WireIt.Group} The group to remove
@param {WireIt.Layer} The layer to remove them from | [
"Removes",
"the",
"group",
"s",
"containers",
"and",
"sub",
"groups",
"from",
"the",
"layer"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L10228-L10243 |
|
42,390 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(group, map)
{
if (!lang.isObject(map))
map = WireIt.GroupUtils.getMap(group);
var fieldConfigs = [];
var terminalConfigs = [];
var generateExternal = function(ftMap)
{
for (var cI in ftMap)
{
var c = ftMap[cI];
for (var fName in c.fields)
{
var fMap = c.fields[fName];
if (fMap.visible)
{
var fc = {};
lang.augmentObject(fc, fMap.fieldConfig);
fc.name = fMap.externalName;
fc.label = fMap.externalName;
lang.augmentObject(fc, fMap.fieldConfig)
fieldConfigs.push(fc);
}
}
for (var tName in c.terminals)
{
var tMap = c.terminals[tName];
if (tMap.visible)
{
var tc = {};
tc.name = tMap.externalName;
tc.side = tMap.side;
lang.augmentObject(tc, tMap.terminalConfig);
terminalConfigs.push(tc)
}
}
}
}
if (lang.isValue(map.groupContainerMap))
generateExternal([map.groupContainerMap])
else
{
generateExternal(map.containerMap);
generateExternal(map.groupMap);
}
var center = this.workOutCenter(group);
return { "fields" : fieldConfigs, "terminals" : terminalConfigs, "position" : center, "center" : center};
} | javascript | function(group, map)
{
if (!lang.isObject(map))
map = WireIt.GroupUtils.getMap(group);
var fieldConfigs = [];
var terminalConfigs = [];
var generateExternal = function(ftMap)
{
for (var cI in ftMap)
{
var c = ftMap[cI];
for (var fName in c.fields)
{
var fMap = c.fields[fName];
if (fMap.visible)
{
var fc = {};
lang.augmentObject(fc, fMap.fieldConfig);
fc.name = fMap.externalName;
fc.label = fMap.externalName;
lang.augmentObject(fc, fMap.fieldConfig)
fieldConfigs.push(fc);
}
}
for (var tName in c.terminals)
{
var tMap = c.terminals[tName];
if (tMap.visible)
{
var tc = {};
tc.name = tMap.externalName;
tc.side = tMap.side;
lang.augmentObject(tc, tMap.terminalConfig);
terminalConfigs.push(tc)
}
}
}
}
if (lang.isValue(map.groupContainerMap))
generateExternal([map.groupContainerMap])
else
{
generateExternal(map.containerMap);
generateExternal(map.groupMap);
}
var center = this.workOutCenter(group);
return { "fields" : fieldConfigs, "terminals" : terminalConfigs, "position" : center, "center" : center};
} | [
"function",
"(",
"group",
",",
"map",
")",
"{",
"if",
"(",
"!",
"lang",
".",
"isObject",
"(",
"map",
")",
")",
"map",
"=",
"WireIt",
".",
"GroupUtils",
".",
"getMap",
"(",
"group",
")",
";",
"var",
"fieldConfigs",
"=",
"[",
"]",
";",
"var",
"terminalConfigs",
"=",
"[",
"]",
";",
"var",
"generateExternal",
"=",
"function",
"(",
"ftMap",
")",
"{",
"for",
"(",
"var",
"cI",
"in",
"ftMap",
")",
"{",
"var",
"c",
"=",
"ftMap",
"[",
"cI",
"]",
";",
"for",
"(",
"var",
"fName",
"in",
"c",
".",
"fields",
")",
"{",
"var",
"fMap",
"=",
"c",
".",
"fields",
"[",
"fName",
"]",
";",
"if",
"(",
"fMap",
".",
"visible",
")",
"{",
"var",
"fc",
"=",
"{",
"}",
";",
"lang",
".",
"augmentObject",
"(",
"fc",
",",
"fMap",
".",
"fieldConfig",
")",
";",
"fc",
".",
"name",
"=",
"fMap",
".",
"externalName",
";",
"fc",
".",
"label",
"=",
"fMap",
".",
"externalName",
";",
"lang",
".",
"augmentObject",
"(",
"fc",
",",
"fMap",
".",
"fieldConfig",
")",
"fieldConfigs",
".",
"push",
"(",
"fc",
")",
";",
"}",
"}",
"for",
"(",
"var",
"tName",
"in",
"c",
".",
"terminals",
")",
"{",
"var",
"tMap",
"=",
"c",
".",
"terminals",
"[",
"tName",
"]",
";",
"if",
"(",
"tMap",
".",
"visible",
")",
"{",
"var",
"tc",
"=",
"{",
"}",
";",
"tc",
".",
"name",
"=",
"tMap",
".",
"externalName",
";",
"tc",
".",
"side",
"=",
"tMap",
".",
"side",
";",
"lang",
".",
"augmentObject",
"(",
"tc",
",",
"tMap",
".",
"terminalConfig",
")",
";",
"terminalConfigs",
".",
"push",
"(",
"tc",
")",
"}",
"}",
"}",
"}",
"if",
"(",
"lang",
".",
"isValue",
"(",
"map",
".",
"groupContainerMap",
")",
")",
"generateExternal",
"(",
"[",
"map",
".",
"groupContainerMap",
"]",
")",
"else",
"{",
"generateExternal",
"(",
"map",
".",
"containerMap",
")",
";",
"generateExternal",
"(",
"map",
".",
"groupMap",
")",
";",
"}",
"var",
"center",
"=",
"this",
".",
"workOutCenter",
"(",
"group",
")",
";",
"return",
"{",
"\"fields\"",
":",
"fieldConfigs",
",",
"\"terminals\"",
":",
"terminalConfigs",
",",
"\"position\"",
":",
"center",
",",
"\"center\"",
":",
"center",
"}",
";",
"}"
]
| Get the configuration to pass to a group container
@param {WireIt.Group} group The group to get the config for
@param {object} map Optional The group's map (obtained by WireIt.GroupUtils.getMap(group))
@return {object} The collapsed config | [
"Get",
"the",
"configuration",
"to",
"pass",
"to",
"a",
"group",
"container"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L10327-L10386 |
|
42,391 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(group)
{
var bounds = {};
var setBound = function(position)
{
var left, top;
left = position[0];
top = position[1];
if ((typeof bounds["left"] == "undefined") || bounds["left"] > left)
bounds["left"] = left;
if ((typeof bounds["right"] == "undefined") || bounds["right"] < left)
bounds["right"] = left;
if ((typeof bounds["top"] == "undefined") || bounds["top"] > top)
bounds["top"] = top;
if ((typeof bounds["bottom"] == "undefined") || bounds["bottom"] < top)
bounds["bottom"] = top;
}
if (lang.isObject(group.groupContainer))
{
setBound(group.groupContainer.getConfig().position)
}
else
{
for (var cI in group.containers)
{
var c = group.containers[cI].container;
var config = c.getConfig();
setBound(config.position);
}
for (var gI in group.groups)
{
var g = group.groups[gI].group;
setBound(WireIt.GroupUtils.workOutCenter(g));
}
}
return [
((bounds.right + bounds.left)/2),
((bounds.top + bounds.bottom)/2)
];
} | javascript | function(group)
{
var bounds = {};
var setBound = function(position)
{
var left, top;
left = position[0];
top = position[1];
if ((typeof bounds["left"] == "undefined") || bounds["left"] > left)
bounds["left"] = left;
if ((typeof bounds["right"] == "undefined") || bounds["right"] < left)
bounds["right"] = left;
if ((typeof bounds["top"] == "undefined") || bounds["top"] > top)
bounds["top"] = top;
if ((typeof bounds["bottom"] == "undefined") || bounds["bottom"] < top)
bounds["bottom"] = top;
}
if (lang.isObject(group.groupContainer))
{
setBound(group.groupContainer.getConfig().position)
}
else
{
for (var cI in group.containers)
{
var c = group.containers[cI].container;
var config = c.getConfig();
setBound(config.position);
}
for (var gI in group.groups)
{
var g = group.groups[gI].group;
setBound(WireIt.GroupUtils.workOutCenter(g));
}
}
return [
((bounds.right + bounds.left)/2),
((bounds.top + bounds.bottom)/2)
];
} | [
"function",
"(",
"group",
")",
"{",
"var",
"bounds",
"=",
"{",
"}",
";",
"var",
"setBound",
"=",
"function",
"(",
"position",
")",
"{",
"var",
"left",
",",
"top",
";",
"left",
"=",
"position",
"[",
"0",
"]",
";",
"top",
"=",
"position",
"[",
"1",
"]",
";",
"if",
"(",
"(",
"typeof",
"bounds",
"[",
"\"left\"",
"]",
"==",
"\"undefined\"",
")",
"||",
"bounds",
"[",
"\"left\"",
"]",
">",
"left",
")",
"bounds",
"[",
"\"left\"",
"]",
"=",
"left",
";",
"if",
"(",
"(",
"typeof",
"bounds",
"[",
"\"right\"",
"]",
"==",
"\"undefined\"",
")",
"||",
"bounds",
"[",
"\"right\"",
"]",
"<",
"left",
")",
"bounds",
"[",
"\"right\"",
"]",
"=",
"left",
";",
"if",
"(",
"(",
"typeof",
"bounds",
"[",
"\"top\"",
"]",
"==",
"\"undefined\"",
")",
"||",
"bounds",
"[",
"\"top\"",
"]",
">",
"top",
")",
"bounds",
"[",
"\"top\"",
"]",
"=",
"top",
";",
"if",
"(",
"(",
"typeof",
"bounds",
"[",
"\"bottom\"",
"]",
"==",
"\"undefined\"",
")",
"||",
"bounds",
"[",
"\"bottom\"",
"]",
"<",
"top",
")",
"bounds",
"[",
"\"bottom\"",
"]",
"=",
"top",
";",
"}",
"if",
"(",
"lang",
".",
"isObject",
"(",
"group",
".",
"groupContainer",
")",
")",
"{",
"setBound",
"(",
"group",
".",
"groupContainer",
".",
"getConfig",
"(",
")",
".",
"position",
")",
"}",
"else",
"{",
"for",
"(",
"var",
"cI",
"in",
"group",
".",
"containers",
")",
"{",
"var",
"c",
"=",
"group",
".",
"containers",
"[",
"cI",
"]",
".",
"container",
";",
"var",
"config",
"=",
"c",
".",
"getConfig",
"(",
")",
";",
"setBound",
"(",
"config",
".",
"position",
")",
";",
"}",
"for",
"(",
"var",
"gI",
"in",
"group",
".",
"groups",
")",
"{",
"var",
"g",
"=",
"group",
".",
"groups",
"[",
"gI",
"]",
".",
"group",
";",
"setBound",
"(",
"WireIt",
".",
"GroupUtils",
".",
"workOutCenter",
"(",
"g",
")",
")",
";",
"}",
"}",
"return",
"[",
"(",
"(",
"bounds",
".",
"right",
"+",
"bounds",
".",
"left",
")",
"/",
"2",
")",
",",
"(",
"(",
"bounds",
".",
"top",
"+",
"bounds",
".",
"bottom",
")",
"/",
"2",
")",
"]",
";",
"}"
]
| Works out the center point of a group
@param {WireIt.Group} group The group to get the center of
@return {Array} the x, y position of the center | [
"Works",
"out",
"the",
"center",
"point",
"of",
"a",
"group"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L10393-L10441 |
|
42,392 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(event) {
var elem = this.grouper.layer.el;
var rect = elem.getBoundingClientRect();
var xNoScroll = event.clientX-rect.left;
var yNoScroll = event.clientY-rect.top;
if (xNoScroll < elem.clientWidth && yNoScroll < elem.clientHeight) {
this.start();
}
} | javascript | function(event) {
var elem = this.grouper.layer.el;
var rect = elem.getBoundingClientRect();
var xNoScroll = event.clientX-rect.left;
var yNoScroll = event.clientY-rect.top;
if (xNoScroll < elem.clientWidth && yNoScroll < elem.clientHeight) {
this.start();
}
} | [
"function",
"(",
"event",
")",
"{",
"var",
"elem",
"=",
"this",
".",
"grouper",
".",
"layer",
".",
"el",
";",
"var",
"rect",
"=",
"elem",
".",
"getBoundingClientRect",
"(",
")",
";",
"var",
"xNoScroll",
"=",
"event",
".",
"clientX",
"-",
"rect",
".",
"left",
";",
"var",
"yNoScroll",
"=",
"event",
".",
"clientY",
"-",
"rect",
".",
"top",
";",
"if",
"(",
"xNoScroll",
"<",
"elem",
".",
"clientWidth",
"&&",
"yNoScroll",
"<",
"elem",
".",
"clientHeight",
")",
"{",
"this",
".",
"start",
"(",
")",
";",
"}",
"}"
]
| Check if clicked in the layer and start the drawing mode | [
"Check",
"if",
"clicked",
"in",
"the",
"layer",
"and",
"start",
"the",
"drawing",
"mode"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L11487-L11497 |
|
42,393 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
this.show();
this.SetCanvasRegion(0, 0, this.grouper.layer.el.scrollWidth, this.grouper.layer.el.scrollHeight);
var ctxt = this.getContext();
ctxt.beginPath();
ctxt.moveTo(this.lastX, this.lastY);
this.startX = this.lastX;
this.startY = this.lastY;
this.timer = YAHOO.lang.later(WireIt.RubberBand.defaultDelay, this, function() {
this.nextPoint(this.lastX, this.lastY);
this.scroll(this.directions);
}, 0, true);
} | javascript | function() {
this.show();
this.SetCanvasRegion(0, 0, this.grouper.layer.el.scrollWidth, this.grouper.layer.el.scrollHeight);
var ctxt = this.getContext();
ctxt.beginPath();
ctxt.moveTo(this.lastX, this.lastY);
this.startX = this.lastX;
this.startY = this.lastY;
this.timer = YAHOO.lang.later(WireIt.RubberBand.defaultDelay, this, function() {
this.nextPoint(this.lastX, this.lastY);
this.scroll(this.directions);
}, 0, true);
} | [
"function",
"(",
")",
"{",
"this",
".",
"show",
"(",
")",
";",
"this",
".",
"SetCanvasRegion",
"(",
"0",
",",
"0",
",",
"this",
".",
"grouper",
".",
"layer",
".",
"el",
".",
"scrollWidth",
",",
"this",
".",
"grouper",
".",
"layer",
".",
"el",
".",
"scrollHeight",
")",
";",
"var",
"ctxt",
"=",
"this",
".",
"getContext",
"(",
")",
";",
"ctxt",
".",
"beginPath",
"(",
")",
";",
"ctxt",
".",
"moveTo",
"(",
"this",
".",
"lastX",
",",
"this",
".",
"lastY",
")",
";",
"this",
".",
"startX",
"=",
"this",
".",
"lastX",
";",
"this",
".",
"startY",
"=",
"this",
".",
"lastY",
";",
"this",
".",
"timer",
"=",
"YAHOO",
".",
"lang",
".",
"later",
"(",
"WireIt",
".",
"RubberBand",
".",
"defaultDelay",
",",
"this",
",",
"function",
"(",
")",
"{",
"this",
".",
"nextPoint",
"(",
"this",
".",
"lastX",
",",
"this",
".",
"lastY",
")",
";",
"this",
".",
"scroll",
"(",
"this",
".",
"directions",
")",
";",
"}",
",",
"0",
",",
"true",
")",
";",
"}"
]
| Start the drawing mode | [
"Start",
"the",
"drawing",
"mode"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L11502-L11515 |
|
42,394 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(directions) {
var elem = this.grouper.layer.el;
if (directions.left)
elem.scrollLeft = Math.max(0, elem.scrollLeft-this.scrollAmount);
else if (directions.right)
elem.scrollLeft = Math.min(elem.scrollWidth, elem.scrollLeft+this.scrollAmount);
if (directions.up)
elem.scrollTop = Math.max(0, elem.scrollTop-this.scrollAmount);
else if (directions.down)
elem.scrollTop = Math.min(elem.scrollHeight, elem.scrollTop+this.scrollAmount);
} | javascript | function(directions) {
var elem = this.grouper.layer.el;
if (directions.left)
elem.scrollLeft = Math.max(0, elem.scrollLeft-this.scrollAmount);
else if (directions.right)
elem.scrollLeft = Math.min(elem.scrollWidth, elem.scrollLeft+this.scrollAmount);
if (directions.up)
elem.scrollTop = Math.max(0, elem.scrollTop-this.scrollAmount);
else if (directions.down)
elem.scrollTop = Math.min(elem.scrollHeight, elem.scrollTop+this.scrollAmount);
} | [
"function",
"(",
"directions",
")",
"{",
"var",
"elem",
"=",
"this",
".",
"grouper",
".",
"layer",
".",
"el",
";",
"if",
"(",
"directions",
".",
"left",
")",
"elem",
".",
"scrollLeft",
"=",
"Math",
".",
"max",
"(",
"0",
",",
"elem",
".",
"scrollLeft",
"-",
"this",
".",
"scrollAmount",
")",
";",
"else",
"if",
"(",
"directions",
".",
"right",
")",
"elem",
".",
"scrollLeft",
"=",
"Math",
".",
"min",
"(",
"elem",
".",
"scrollWidth",
",",
"elem",
".",
"scrollLeft",
"+",
"this",
".",
"scrollAmount",
")",
";",
"if",
"(",
"directions",
".",
"up",
")",
"elem",
".",
"scrollTop",
"=",
"Math",
".",
"max",
"(",
"0",
",",
"elem",
".",
"scrollTop",
"-",
"this",
".",
"scrollAmount",
")",
";",
"else",
"if",
"(",
"directions",
".",
"down",
")",
"elem",
".",
"scrollTop",
"=",
"Math",
".",
"min",
"(",
"elem",
".",
"scrollHeight",
",",
"elem",
".",
"scrollTop",
"+",
"this",
".",
"scrollAmount",
")",
";",
"}"
]
| Scroll the associated WireIt.Layer | [
"Scroll",
"the",
"associated",
"WireIt",
".",
"Layer"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L11520-L11532 |
|
42,395 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
if (lang.isObject(this.timer)) {
this.timer.cancel();
this.timer = null;
var ctxt = this.getContext();
this.nextPoint(this.startX, this.startY);
YAHOO.lang.later(1000, this, this.hide, 0, false);
}
} | javascript | function() {
if (lang.isObject(this.timer)) {
this.timer.cancel();
this.timer = null;
var ctxt = this.getContext();
this.nextPoint(this.startX, this.startY);
YAHOO.lang.later(1000, this, this.hide, 0, false);
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"lang",
".",
"isObject",
"(",
"this",
".",
"timer",
")",
")",
"{",
"this",
".",
"timer",
".",
"cancel",
"(",
")",
";",
"this",
".",
"timer",
"=",
"null",
";",
"var",
"ctxt",
"=",
"this",
".",
"getContext",
"(",
")",
";",
"this",
".",
"nextPoint",
"(",
"this",
".",
"startX",
",",
"this",
".",
"startY",
")",
";",
"YAHOO",
".",
"lang",
".",
"later",
"(",
"1000",
",",
"this",
",",
"this",
".",
"hide",
",",
"0",
",",
"false",
")",
";",
"}",
"}"
]
| End the drawing mode | [
"End",
"the",
"drawing",
"mode"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L11537-L11547 |
|
42,396 | neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(x, y) {
if (lang.isValue(x) && lang.isValue(y)) {
var ctxt = this.getContext();
// Draw the inner bezier curve
ctxt.lineCap= "round";
ctxt.strokeStyle="green";
ctxt.lineWidth="3";
ctxt.lineTo(x, y);
ctxt.stroke();
}
} | javascript | function(x, y) {
if (lang.isValue(x) && lang.isValue(y)) {
var ctxt = this.getContext();
// Draw the inner bezier curve
ctxt.lineCap= "round";
ctxt.strokeStyle="green";
ctxt.lineWidth="3";
ctxt.lineTo(x, y);
ctxt.stroke();
}
} | [
"function",
"(",
"x",
",",
"y",
")",
"{",
"if",
"(",
"lang",
".",
"isValue",
"(",
"x",
")",
"&&",
"lang",
".",
"isValue",
"(",
"y",
")",
")",
"{",
"var",
"ctxt",
"=",
"this",
".",
"getContext",
"(",
")",
";",
"// Draw the inner bezier curve",
"ctxt",
".",
"lineCap",
"=",
"\"round\"",
";",
"ctxt",
".",
"strokeStyle",
"=",
"\"green\"",
";",
"ctxt",
".",
"lineWidth",
"=",
"\"3\"",
";",
"ctxt",
".",
"lineTo",
"(",
"x",
",",
"y",
")",
";",
"ctxt",
".",
"stroke",
"(",
")",
";",
"}",
"}"
]
| Add a point to the RubberBand | [
"Add",
"a",
"point",
"to",
"the",
"RubberBand"
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L11572-L11584 |
|
42,397 | 3rd-Eden/licenses | content.js | parse | function parse(data, options, next) {
data = this.get(data);
if ('function' === typeof options) {
next = options;
options = {};
}
//
// We cannot detect a license so we call the callback without any arguments
// which symbolises a failed attempt.
//
if (!data) return next();
//
// Optimize the matches by trying to locate where the licensing information
// starts in the given content. Usually, we, as developers add it at the
// bottom of our README.md files and prefix it with "LICENSE" as header.
//
if (data.file && /readme/i.test(data.file)) {
data.content.split('\n')
.some(function some(line, index, lines) {
if (
/^.{0,7}\s{0,}(?:licen[cs]e[s]?|copyright).{0,2}\s{0,}$/gim.test(
line.trim())
) {
data.content = lines.slice(index).join('\n');
debug('matched %s as license header, slicing data', JSON.stringify(line));
return true;
}
return false;
});
}
var license = this.scan(data.content);
if (!license) {
license = this.test(data.content);
if (license) debug('used regexp to detect %s in content', license);
} else {
debug('license file scan resulted in %s as matching license', license);
}
next(undefined, this.normalize(license));
} | javascript | function parse(data, options, next) {
data = this.get(data);
if ('function' === typeof options) {
next = options;
options = {};
}
//
// We cannot detect a license so we call the callback without any arguments
// which symbolises a failed attempt.
//
if (!data) return next();
//
// Optimize the matches by trying to locate where the licensing information
// starts in the given content. Usually, we, as developers add it at the
// bottom of our README.md files and prefix it with "LICENSE" as header.
//
if (data.file && /readme/i.test(data.file)) {
data.content.split('\n')
.some(function some(line, index, lines) {
if (
/^.{0,7}\s{0,}(?:licen[cs]e[s]?|copyright).{0,2}\s{0,}$/gim.test(
line.trim())
) {
data.content = lines.slice(index).join('\n');
debug('matched %s as license header, slicing data', JSON.stringify(line));
return true;
}
return false;
});
}
var license = this.scan(data.content);
if (!license) {
license = this.test(data.content);
if (license) debug('used regexp to detect %s in content', license);
} else {
debug('license file scan resulted in %s as matching license', license);
}
next(undefined, this.normalize(license));
} | [
"function",
"parse",
"(",
"data",
",",
"options",
",",
"next",
")",
"{",
"data",
"=",
"this",
".",
"get",
"(",
"data",
")",
";",
"if",
"(",
"'function'",
"===",
"typeof",
"options",
")",
"{",
"next",
"=",
"options",
";",
"options",
"=",
"{",
"}",
";",
"}",
"//",
"// We cannot detect a license so we call the callback without any arguments",
"// which symbolises a failed attempt.",
"//",
"if",
"(",
"!",
"data",
")",
"return",
"next",
"(",
")",
";",
"//",
"// Optimize the matches by trying to locate where the licensing information",
"// starts in the given content. Usually, we, as developers add it at the",
"// bottom of our README.md files and prefix it with \"LICENSE\" as header.",
"//",
"if",
"(",
"data",
".",
"file",
"&&",
"/",
"readme",
"/",
"i",
".",
"test",
"(",
"data",
".",
"file",
")",
")",
"{",
"data",
".",
"content",
".",
"split",
"(",
"'\\n'",
")",
".",
"some",
"(",
"function",
"some",
"(",
"line",
",",
"index",
",",
"lines",
")",
"{",
"if",
"(",
"/",
"^.{0,7}\\s{0,}(?:licen[cs]e[s]?|copyright).{0,2}\\s{0,}$",
"/",
"gim",
".",
"test",
"(",
"line",
".",
"trim",
"(",
")",
")",
")",
"{",
"data",
".",
"content",
"=",
"lines",
".",
"slice",
"(",
"index",
")",
".",
"join",
"(",
"'\\n'",
")",
";",
"debug",
"(",
"'matched %s as license header, slicing data'",
",",
"JSON",
".",
"stringify",
"(",
"line",
")",
")",
";",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}",
")",
";",
"}",
"var",
"license",
"=",
"this",
".",
"scan",
"(",
"data",
".",
"content",
")",
";",
"if",
"(",
"!",
"license",
")",
"{",
"license",
"=",
"this",
".",
"test",
"(",
"data",
".",
"content",
")",
";",
"if",
"(",
"license",
")",
"debug",
"(",
"'used regexp to detect %s in content'",
",",
"license",
")",
";",
"}",
"else",
"{",
"debug",
"(",
"'license file scan resulted in %s as matching license'",
",",
"license",
")",
";",
"}",
"next",
"(",
"undefined",
",",
"this",
".",
"normalize",
"(",
"license",
")",
")",
";",
"}"
]
| Parse the markdown information from the package.
@param {Object} data The package.json or npm package contents.
@param {Object} options Optional options.
@param {Function} next Continuation.
@api public | [
"Parse",
"the",
"markdown",
"information",
"from",
"the",
"package",
"."
]
| 8f58b7700fd03de0e095cc408852fa12d1379c3f | https://github.com/3rd-Eden/licenses/blob/8f58b7700fd03de0e095cc408852fa12d1379c3f/content.js#L22-L68 |
42,398 | 3rd-Eden/licenses | content.js | get | function get(data) {
if ('string' === typeof data) return { content: data };
if (data.readme) return { content: data.readme, file: 'readme' };
if (data.content) return data;
} | javascript | function get(data) {
if ('string' === typeof data) return { content: data };
if (data.readme) return { content: data.readme, file: 'readme' };
if (data.content) return data;
} | [
"function",
"get",
"(",
"data",
")",
"{",
"if",
"(",
"'string'",
"===",
"typeof",
"data",
")",
"return",
"{",
"content",
":",
"data",
"}",
";",
"if",
"(",
"data",
".",
"readme",
")",
"return",
"{",
"content",
":",
"data",
".",
"readme",
",",
"file",
":",
"'readme'",
"}",
";",
"if",
"(",
"data",
".",
"content",
")",
"return",
"data",
";",
"}"
]
| Retrieve the only possible location of data. Which is the `readme` content
but that's only available for packages that are retrieved through npm.
@param {Object} data The package.json or npm package contents. | [
"Retrieve",
"the",
"only",
"possible",
"location",
"of",
"data",
".",
"Which",
"is",
"the",
"readme",
"content",
"but",
"that",
"s",
"only",
"available",
"for",
"packages",
"that",
"are",
"retrieved",
"through",
"npm",
"."
]
| 8f58b7700fd03de0e095cc408852fa12d1379c3f | https://github.com/3rd-Eden/licenses/blob/8f58b7700fd03de0e095cc408852fa12d1379c3f/content.js#L87-L91 |
42,399 | neyric/webhookit | public/javascripts/WireIt/plugins/grouping/examples/sawire/util.js | xmlValue | function xmlValue(node) {
if (!node) {
return '';
}
var ret = '';
if (node.nodeType == DOM_TEXT_NODE ||
node.nodeType == DOM_CDATA_SECTION_NODE) {
ret += node.nodeValue;
} else if (node.nodeType == DOM_ATTRIBUTE_NODE) {
if (ajaxsltIsIE6) {
ret += xmlValueIE6Hack(node);
} else {
ret += node.nodeValue;
}
} else if (node.nodeType == DOM_ELEMENT_NODE ||
node.nodeType == DOM_DOCUMENT_NODE ||
node.nodeType == DOM_DOCUMENT_FRAGMENT_NODE) {
for (var i = 0; i < node.childNodes.length; ++i) {
ret += arguments.callee(node.childNodes[i]);
}
}
return ret;
} | javascript | function xmlValue(node) {
if (!node) {
return '';
}
var ret = '';
if (node.nodeType == DOM_TEXT_NODE ||
node.nodeType == DOM_CDATA_SECTION_NODE) {
ret += node.nodeValue;
} else if (node.nodeType == DOM_ATTRIBUTE_NODE) {
if (ajaxsltIsIE6) {
ret += xmlValueIE6Hack(node);
} else {
ret += node.nodeValue;
}
} else if (node.nodeType == DOM_ELEMENT_NODE ||
node.nodeType == DOM_DOCUMENT_NODE ||
node.nodeType == DOM_DOCUMENT_FRAGMENT_NODE) {
for (var i = 0; i < node.childNodes.length; ++i) {
ret += arguments.callee(node.childNodes[i]);
}
}
return ret;
} | [
"function",
"xmlValue",
"(",
"node",
")",
"{",
"if",
"(",
"!",
"node",
")",
"{",
"return",
"''",
";",
"}",
"var",
"ret",
"=",
"''",
";",
"if",
"(",
"node",
".",
"nodeType",
"==",
"DOM_TEXT_NODE",
"||",
"node",
".",
"nodeType",
"==",
"DOM_CDATA_SECTION_NODE",
")",
"{",
"ret",
"+=",
"node",
".",
"nodeValue",
";",
"}",
"else",
"if",
"(",
"node",
".",
"nodeType",
"==",
"DOM_ATTRIBUTE_NODE",
")",
"{",
"if",
"(",
"ajaxsltIsIE6",
")",
"{",
"ret",
"+=",
"xmlValueIE6Hack",
"(",
"node",
")",
";",
"}",
"else",
"{",
"ret",
"+=",
"node",
".",
"nodeValue",
";",
"}",
"}",
"else",
"if",
"(",
"node",
".",
"nodeType",
"==",
"DOM_ELEMENT_NODE",
"||",
"node",
".",
"nodeType",
"==",
"DOM_DOCUMENT_NODE",
"||",
"node",
".",
"nodeType",
"==",
"DOM_DOCUMENT_FRAGMENT_NODE",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"node",
".",
"childNodes",
".",
"length",
";",
"++",
"i",
")",
"{",
"ret",
"+=",
"arguments",
".",
"callee",
"(",
"node",
".",
"childNodes",
"[",
"i",
"]",
")",
";",
"}",
"}",
"return",
"ret",
";",
"}"
]
| Returns the text value of a node; for nodes without children this is the nodeValue, for nodes with children this is the concatenation of the value of all children. | [
"Returns",
"the",
"text",
"value",
"of",
"a",
"node",
";",
"for",
"nodes",
"without",
"children",
"this",
"is",
"the",
"nodeValue",
"for",
"nodes",
"with",
"children",
"this",
"is",
"the",
"concatenation",
"of",
"the",
"value",
"of",
"all",
"children",
"."
]
| 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/plugins/grouping/examples/sawire/util.js#L250-L274 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.