repo stringlengths 5 67 | path stringlengths 4 116 | func_name stringlengths 0 58 | original_string stringlengths 52 373k | language stringclasses 1
value | code stringlengths 52 373k | code_tokens list | docstring stringlengths 4 11.8k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 86 226 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
neyric/webhookit | public/javascripts/yui/datasource/datasource-debug.js | function(oRequest, oCallback, oCaller) {
var tId = DS._nTransactionId++;
this.fireEvent("requestEvent", {tId:tId, request:oRequest,callback:oCallback,caller:oCaller});
/* accounts for the following cases:
YAHOO.util.DataSourceBase.TYPE_UNKNOWN
YAHOO.util.DataSourceBase.TYPE_JSARRAY
YAHOO.util.D... | javascript | function(oRequest, oCallback, oCaller) {
var tId = DS._nTransactionId++;
this.fireEvent("requestEvent", {tId:tId, request:oRequest,callback:oCallback,caller:oCaller});
/* accounts for the following cases:
YAHOO.util.DataSourceBase.TYPE_UNKNOWN
YAHOO.util.DataSourceBase.TYPE_JSARRAY
YAHOO.util.D... | [
"function",
"(",
"oRequest",
",",
"oCallback",
",",
"oCaller",
")",
"{",
"var",
"tId",
"=",
"DS",
".",
"_nTransactionId",
"++",
";",
"this",
".",
"fireEvent",
"(",
"\"requestEvent\"",
",",
"{",
"tId",
":",
"tId",
",",
"request",
":",
"oRequest",
",",
"... | Overridable default method generates a unique transaction ID and passes
the live data reference directly to the handleResponse function. This
method should be implemented by subclasses to achieve more complex behavior
or to access remote data.
@method makeConnection
@param oRequest {Object} Request object.
@param oCa... | [
"Overridable",
"default",
"method",
"generates",
"a",
"unique",
"transaction",
"ID",
"and",
"passes",
"the",
"live",
"data",
"reference",
"directly",
"to",
"the",
"handleResponse",
"function",
".",
"This",
"method",
"should",
"be",
"implemented",
"by",
"subclasses... | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datasource/datasource-debug.js#L909-L925 | train | |
neyric/webhookit | public/javascripts/yui/datasource/datasource-debug.js | function(oRequest, oFullResponse) {
if(lang.isValue(oFullResponse)) {
var oParsedResponse = {results:oFullResponse,meta:{}};
YAHOO.log("Parsed generic data is " +
lang.dump(oParsedResponse), "info", this.toString());
return oParsedResponse;
}
YAHOO.log("Generic data ... | javascript | function(oRequest, oFullResponse) {
if(lang.isValue(oFullResponse)) {
var oParsedResponse = {results:oFullResponse,meta:{}};
YAHOO.log("Parsed generic data is " +
lang.dump(oParsedResponse), "info", this.toString());
return oParsedResponse;
}
YAHOO.log("Generic data ... | [
"function",
"(",
"oRequest",
",",
"oFullResponse",
")",
"{",
"if",
"(",
"lang",
".",
"isValue",
"(",
"oFullResponse",
")",
")",
"{",
"var",
"oParsedResponse",
"=",
"{",
"results",
":",
"oFullResponse",
",",
"meta",
":",
"{",
"}",
"}",
";",
"YAHOO",
"."... | Overridable method parses data of generic RESPONSE_TYPE into a response object.
@method parseData
@param oRequest {Object} Request object.
@param oFullResponse {Object} The full Array from the live database.
@return {Object} Parsed response object with the following properties:<br>
- results {Array} Array of parsed da... | [
"Overridable",
"method",
"parses",
"data",
"of",
"generic",
"RESPONSE_TYPE",
"into",
"a",
"response",
"object",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datasource/datasource-debug.js#L1196-L1207 | train | |
neyric/webhookit | public/javascripts/yui/datasource/datasource-debug.js | function(result) {
var oResult = {},
schema = this.responseSchema;
try {
// Loop through each data field in each result using the schema
for(var m = schema.fields.length-1; m >= 0 ; m--) {
var field = schema.fields[m];
var key = (lang.isValue(field.key)) ... | javascript | function(result) {
var oResult = {},
schema = this.responseSchema;
try {
// Loop through each data field in each result using the schema
for(var m = schema.fields.length-1; m >= 0 ; m--) {
var field = schema.fields[m];
var key = (lang.isValue(field.key)) ... | [
"function",
"(",
"result",
")",
"{",
"var",
"oResult",
"=",
"{",
"}",
",",
"schema",
"=",
"this",
".",
"responseSchema",
";",
"try",
"{",
"// Loop through each data field in each result using the schema",
"for",
"(",
"var",
"m",
"=",
"schema",
".",
"fields",
"... | Overridable method parses XML data for one result into an object literal.
@method parseXMLResult
@param result {XML} XML for one result.
@return {Object} Object literal of data for one result. | [
"Overridable",
"method",
"parses",
"XML",
"data",
"for",
"one",
"result",
"into",
"an",
"object",
"literal",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datasource/datasource-debug.js#L1407-L1479 | train | |
neyric/webhookit | public/javascripts/yui/datasource/datasource-debug.js | function(oRequest, oFullResponse) {
var bError = false,
schema = this.responseSchema,
oParsedResponse = {meta:{}},
xmlList = null,
metaNode = schema.metaNode,
metaLocators = schema.metaFields || {},
i,k,loc,v;
// In case oFullResponse is something funky
... | javascript | function(oRequest, oFullResponse) {
var bError = false,
schema = this.responseSchema,
oParsedResponse = {meta:{}},
xmlList = null,
metaNode = schema.metaNode,
metaLocators = schema.metaFields || {},
i,k,loc,v;
// In case oFullResponse is something funky
... | [
"function",
"(",
"oRequest",
",",
"oFullResponse",
")",
"{",
"var",
"bError",
"=",
"false",
",",
"schema",
"=",
"this",
".",
"responseSchema",
",",
"oParsedResponse",
"=",
"{",
"meta",
":",
"{",
"}",
"}",
",",
"xmlList",
"=",
"null",
",",
"metaNode",
"... | Overridable method parses XML data into a response object.
@method parseXMLData
@param oRequest {Object} Request object.
@param oFullResponse {Object} The full XML response from the live database.
@return {Object} Parsed response object with the following properties<br>
- results (Array) Array of parsed data results<b... | [
"Overridable",
"method",
"parses",
"XML",
"data",
"into",
"a",
"response",
"object",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datasource/datasource-debug.js#L1493-L1569 | train | |
neyric/webhookit | public/javascripts/yui/datasource/datasource-debug.js | function(oResponse) {
// If response ID does not match last made request ID,
// silently fail and wait for the next response
if(oResponse && (this.connXhrMode == "ignoreStaleResponses") &&
(oResponse.tId != oQueue.conn.tId)) {
YAHOO.log("Ignored stale response", "warn... | javascript | function(oResponse) {
// If response ID does not match last made request ID,
// silently fail and wait for the next response
if(oResponse && (this.connXhrMode == "ignoreStaleResponses") &&
(oResponse.tId != oQueue.conn.tId)) {
YAHOO.log("Ignored stale response", "warn... | [
"function",
"(",
"oResponse",
")",
"{",
"// If response ID does not match last made request ID,",
"// silently fail and wait for the next response",
"if",
"(",
"oResponse",
"&&",
"(",
"this",
".",
"connXhrMode",
"==",
"\"ignoreStaleResponses\"",
")",
"&&",
"(",
"oResponse",
... | Define Connection Manager success handler
@method _xhrSuccess
@param oResponse {Object} HTTPXMLRequest object
@private | [
"Define",
"Connection",
"Manager",
"success",
"handler"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datasource/datasource-debug.js#L2347-L2387 | train | |
neyric/webhookit | public/javascripts/yui/datasource/datasource-debug.js | function(oResponse) {
this.fireEvent("dataErrorEvent", {request:oRequest, response: oResponse,
callback:oCallback, caller:oCaller,
message:DS.ERROR_DATAINVALID});
YAHOO.log(DS.ERROR_DATAINVALID + ": " +
oResponse.statusText, "error", this.toString());
... | javascript | function(oResponse) {
this.fireEvent("dataErrorEvent", {request:oRequest, response: oResponse,
callback:oCallback, caller:oCaller,
message:DS.ERROR_DATAINVALID});
YAHOO.log(DS.ERROR_DATAINVALID + ": " +
oResponse.statusText, "error", this.toString());
... | [
"function",
"(",
"oResponse",
")",
"{",
"this",
".",
"fireEvent",
"(",
"\"dataErrorEvent\"",
",",
"{",
"request",
":",
"oRequest",
",",
"response",
":",
"oResponse",
",",
"callback",
":",
"oCallback",
",",
"caller",
":",
"oCaller",
",",
"message",
":",
"DS... | Define Connection Manager failure handler
@method _xhrFailure
@param oResponse {Object} HTTPXMLRequest object
@private | [
"Define",
"Connection",
"Manager",
"failure",
"handler"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datasource/datasource-debug.js#L2396-L2418 | train | |
neyric/webhookit | public/javascripts/yui/datasource/datasource-debug.js | function (oDate, oConfig, sLocale) {
oConfig = oConfig || {};
if(!(oDate instanceof Date)) {
return YAHOO.lang.isValue(oDate) ? oDate : "";
}
var format = oConfig.format || "%m/%d/%Y";
// Be backwards compatible, support strings that are
// exactly ... | javascript | function (oDate, oConfig, sLocale) {
oConfig = oConfig || {};
if(!(oDate instanceof Date)) {
return YAHOO.lang.isValue(oDate) ? oDate : "";
}
var format = oConfig.format || "%m/%d/%Y";
// Be backwards compatible, support strings that are
// exactly ... | [
"function",
"(",
"oDate",
",",
"oConfig",
",",
"sLocale",
")",
"{",
"oConfig",
"=",
"oConfig",
"||",
"{",
"}",
";",
"if",
"(",
"!",
"(",
"oDate",
"instanceof",
"Date",
")",
")",
"{",
"return",
"YAHOO",
".",
"lang",
".",
"isValue",
"(",
"oDate",
")"... | Takes a native JavaScript Date and formats to string for display to user.
@method format
@param oDate {Date} Date.
@param oConfig {Object} (Optional) Object literal of configuration values:
<dl>
<dt>format <String></dt>
<dd>
<p>
Any strftime string is supported, such as "%I:%M:%S %p". strftime has several format... | [
"Takes",
"a",
"native",
"JavaScript",
"Date",
"and",
"formats",
"to",
"string",
"for",
"display",
"to",
"user",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/datasource/datasource-debug.js#L2906-L2968 | train | |
kurko/ember-json-api | dist/ember-json-api.js | function(typeName, id, snapshot) {
// FIXME If there is a record, try and look up the self link
// - Need to use the function from the serializer to build the self key
// TODO: this basically only works in the simplest of scenarios
var route = this.getRoute(typeName, id, snapshot);
... | javascript | function(typeName, id, snapshot) {
// FIXME If there is a record, try and look up the self link
// - Need to use the function from the serializer to build the self key
// TODO: this basically only works in the simplest of scenarios
var route = this.getRoute(typeName, id, snapshot);
... | [
"function",
"(",
"typeName",
",",
"id",
",",
"snapshot",
")",
"{",
"// FIXME If there is a record, try and look up the self link",
"// - Need to use the function from the serializer to build the self key",
"// TODO: this basically only works in the simplest of scenarios",
"var",
"route",
... | Look up routes based on top-level links. | [
"Look",
"up",
"routes",
"based",
"on",
"top",
"-",
"level",
"links",
"."
] | 752003a26df5e5cb6ddfcce3526f9925d7cdb3d9 | https://github.com/kurko/ember-json-api/blob/752003a26df5e5cb6ddfcce3526f9925d7cdb3d9/dist/ember-json-api.js#L44-L79 | train | |
kurko/ember-json-api | dist/ember-json-api.js | function(store, type, ids, snapshots) {
return this.ajax(this.buildURL(type.modelName, ids.join(','), snapshots, 'findMany'), 'GET');
} | javascript | function(store, type, ids, snapshots) {
return this.ajax(this.buildURL(type.modelName, ids.join(','), snapshots, 'findMany'), 'GET');
} | [
"function",
"(",
"store",
",",
"type",
",",
"ids",
",",
"snapshots",
")",
"{",
"return",
"this",
".",
"ajax",
"(",
"this",
".",
"buildURL",
"(",
"type",
".",
"modelName",
",",
"ids",
".",
"join",
"(",
"','",
")",
",",
"snapshots",
",",
"'findMany'",
... | Fix query URL. | [
"Fix",
"query",
"URL",
"."
] | 752003a26df5e5cb6ddfcce3526f9925d7cdb3d9 | https://github.com/kurko/ember-json-api/blob/752003a26df5e5cb6ddfcce3526f9925d7cdb3d9/dist/ember-json-api.js#L84-L86 | train | |
kurko/ember-json-api | dist/ember-json-api.js | function(payload) {
if(!payload) {
return {};
}
var data = payload[this.primaryRecordKey];
if (data) {
if (Ember.isArray(data)) {
this.extractArrayData(data, payload);
} else {
this.extractSingleData(data, payload);
}
... | javascript | function(payload) {
if(!payload) {
return {};
}
var data = payload[this.primaryRecordKey];
if (data) {
if (Ember.isArray(data)) {
this.extractArrayData(data, payload);
} else {
this.extractSingleData(data, payload);
}
... | [
"function",
"(",
"payload",
")",
"{",
"if",
"(",
"!",
"payload",
")",
"{",
"return",
"{",
"}",
";",
"}",
"var",
"data",
"=",
"payload",
"[",
"this",
".",
"primaryRecordKey",
"]",
";",
"if",
"(",
"data",
")",
"{",
"if",
"(",
"Ember",
".",
"isArray... | Extract top-level "meta" & "links" before normalizing. | [
"Extract",
"top",
"-",
"level",
"meta",
"&",
"links",
"before",
"normalizing",
"."
] | 752003a26df5e5cb6ddfcce3526f9925d7cdb3d9 | https://github.com/kurko/ember-json-api/blob/752003a26df5e5cb6ddfcce3526f9925d7cdb3d9/dist/ember-json-api.js#L270-L298 | train | |
kurko/ember-json-api | dist/ember-json-api.js | function(sideloaded) {
var store = get(this, 'store');
var models = {};
var serializer = this;
sideloaded.forEach(function(link) {
var type = link.type;
if (link.relationships) {
serializer.extractRelationships(link.relationships, link);
}
... | javascript | function(sideloaded) {
var store = get(this, 'store');
var models = {};
var serializer = this;
sideloaded.forEach(function(link) {
var type = link.type;
if (link.relationships) {
serializer.extractRelationships(link.relationships, link);
}
... | [
"function",
"(",
"sideloaded",
")",
"{",
"var",
"store",
"=",
"get",
"(",
"this",
",",
"'store'",
")",
";",
"var",
"models",
"=",
"{",
"}",
";",
"var",
"serializer",
"=",
"this",
";",
"sideloaded",
".",
"forEach",
"(",
"function",
"(",
"link",
")",
... | Extract top-level "included" containing associated objects | [
"Extract",
"top",
"-",
"level",
"included",
"containing",
"associated",
"objects"
] | 752003a26df5e5cb6ddfcce3526f9925d7cdb3d9 | https://github.com/kurko/ember-json-api/blob/752003a26df5e5cb6ddfcce3526f9925d7cdb3d9/dist/ember-json-api.js#L336-L354 | train | |
kurko/ember-json-api | dist/ember-json-api.js | function(links, resource) {
var link, association, id, route, relationshipLink, cleanedRoute;
// Clear the old format
resource.links = {};
for (link in links) {
association = links[link];
link = Ember.String.camelize(link.split('.').pop());
if(!associatio... | javascript | function(links, resource) {
var link, association, id, route, relationshipLink, cleanedRoute;
// Clear the old format
resource.links = {};
for (link in links) {
association = links[link];
link = Ember.String.camelize(link.split('.').pop());
if(!associatio... | [
"function",
"(",
"links",
",",
"resource",
")",
"{",
"var",
"link",
",",
"association",
",",
"id",
",",
"route",
",",
"relationshipLink",
",",
"cleanedRoute",
";",
"// Clear the old format",
"resource",
".",
"links",
"=",
"{",
"}",
";",
"for",
"(",
"link",... | Parse the top-level "links" object. | [
"Parse",
"the",
"top",
"-",
"level",
"links",
"object",
"."
] | 752003a26df5e5cb6ddfcce3526f9925d7cdb3d9 | https://github.com/kurko/ember-json-api/blob/752003a26df5e5cb6ddfcce3526f9925d7cdb3d9/dist/ember-json-api.js#L359-L404 | train | |
kurko/ember-json-api | dist/ember-json-api.js | function(record, json, relationship) {
var attr = relationship.key;
var belongsTo = record.belongsTo(attr);
var type, key;
if (isNone(belongsTo)) {
return;
}
type = this.keyForSnapshot(belongsTo);
key = this.keyForRelationship(attr);
if (!json... | javascript | function(record, json, relationship) {
var attr = relationship.key;
var belongsTo = record.belongsTo(attr);
var type, key;
if (isNone(belongsTo)) {
return;
}
type = this.keyForSnapshot(belongsTo);
key = this.keyForRelationship(attr);
if (!json... | [
"function",
"(",
"record",
",",
"json",
",",
"relationship",
")",
"{",
"var",
"attr",
"=",
"relationship",
".",
"key",
";",
"var",
"belongsTo",
"=",
"record",
".",
"belongsTo",
"(",
"attr",
")",
";",
"var",
"type",
",",
"key",
";",
"if",
"(",
"isNone... | Use "links" key, remove support for polymorphic type | [
"Use",
"links",
"key",
"remove",
"support",
"for",
"polymorphic",
"type"
] | 752003a26df5e5cb6ddfcce3526f9925d7cdb3d9 | https://github.com/kurko/ember-json-api/blob/752003a26df5e5cb6ddfcce3526f9925d7cdb3d9/dist/ember-json-api.js#L463-L479 | train | |
kurko/ember-json-api | dist/ember-json-api.js | function(record, json, relationship) {
var attr = relationship.key;
var type = this.keyForRelationship(relationship.type);
var key = this.keyForRelationship(attr);
if (relationship.kind === 'hasMany') {
json.relationships = json.relationships || {};
json.relationship... | javascript | function(record, json, relationship) {
var attr = relationship.key;
var type = this.keyForRelationship(relationship.type);
var key = this.keyForRelationship(attr);
if (relationship.kind === 'hasMany') {
json.relationships = json.relationships || {};
json.relationship... | [
"function",
"(",
"record",
",",
"json",
",",
"relationship",
")",
"{",
"var",
"attr",
"=",
"relationship",
".",
"key",
";",
"var",
"type",
"=",
"this",
".",
"keyForRelationship",
"(",
"relationship",
".",
"type",
")",
";",
"var",
"key",
"=",
"this",
".... | Use "links" key | [
"Use",
"links",
"key"
] | 752003a26df5e5cb6ddfcce3526f9925d7cdb3d9 | https://github.com/kurko/ember-json-api/blob/752003a26df5e5cb6ddfcce3526f9925d7cdb3d9/dist/ember-json-api.js#L484-L493 | train | |
bengfarrell/nuimotion | quickstart/websocketquickstart.js | onSkeletonUpdate | function onSkeletonUpdate(skeleton) {
for (var c in connections) {
connections[c].sendUTF(JSON.stringify(skeleton));
}
} | javascript | function onSkeletonUpdate(skeleton) {
for (var c in connections) {
connections[c].sendUTF(JSON.stringify(skeleton));
}
} | [
"function",
"onSkeletonUpdate",
"(",
"skeleton",
")",
"{",
"for",
"(",
"var",
"c",
"in",
"connections",
")",
"{",
"connections",
"[",
"c",
"]",
".",
"sendUTF",
"(",
"JSON",
".",
"stringify",
"(",
"skeleton",
")",
")",
";",
"}",
"}"
] | skeleton update callback
@param skeleton | [
"skeleton",
"update",
"callback"
] | 7117c251389b68e2e5d1b8fb8fb1ccd0550b5a77 | https://github.com/bengfarrell/nuimotion/blob/7117c251389b68e2e5d1b8fb8fb1ccd0550b5a77/quickstart/websocketquickstart.js#L30-L34 | train |
bengfarrell/nuimotion | quickstart/websocketquickstart.js | onMessage | function onMessage(data) {
if (data.type == "utf8") {
message = JSON.parse(data.utf8Data);
switch (message.command) {
case "setJoints":
console.log("Client has request to add joints: " + message.data);
nuimotion.jointsTracking = message.data;
... | javascript | function onMessage(data) {
if (data.type == "utf8") {
message = JSON.parse(data.utf8Data);
switch (message.command) {
case "setJoints":
console.log("Client has request to add joints: " + message.data);
nuimotion.jointsTracking = message.data;
... | [
"function",
"onMessage",
"(",
"data",
")",
"{",
"if",
"(",
"data",
".",
"type",
"==",
"\"utf8\"",
")",
"{",
"message",
"=",
"JSON",
".",
"parse",
"(",
"data",
".",
"utf8Data",
")",
";",
"switch",
"(",
"message",
".",
"command",
")",
"{",
"case",
"\... | on message recieved from client
@param data | [
"on",
"message",
"recieved",
"from",
"client"
] | 7117c251389b68e2e5d1b8fb8fb1ccd0550b5a77 | https://github.com/bengfarrell/nuimotion/blob/7117c251389b68e2e5d1b8fb8fb1ccd0550b5a77/quickstart/websocketquickstart.js#L55-L79 | train |
neyric/webhookit | public/javascripts/WireIt/plugins/grouping/examples/sawire/xslt.js | xsltChildNodes | function xsltChildNodes(input, template, output) {
// Clone input context to keep variables declared here local to the
// siblings of the children.
var context = input.clone();
for (var i = 0; i < template.childNodes.length; ++i) {
xsltProcessContext(context, template.childNodes[i], output);
}
} | javascript | function xsltChildNodes(input, template, output) {
// Clone input context to keep variables declared here local to the
// siblings of the children.
var context = input.clone();
for (var i = 0; i < template.childNodes.length; ++i) {
xsltProcessContext(context, template.childNodes[i], output);
}
} | [
"function",
"xsltChildNodes",
"(",
"input",
",",
"template",
",",
"output",
")",
"{",
"// Clone input context to keep variables declared here local to the",
"// siblings of the children.",
"var",
"context",
"=",
"input",
".",
"clone",
"(",
")",
";",
"for",
"(",
"var",
... | Traverses the template node tree. Calls the main processing function with the current input context for every child node of the current template node. | [
"Traverses",
"the",
"template",
"node",
"tree",
".",
"Calls",
"the",
"main",
"processing",
"function",
"with",
"the",
"current",
"input",
"context",
"for",
"every",
"child",
"node",
"of",
"the",
"current",
"template",
"node",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/plugins/grouping/examples/sawire/xslt.js#L406-L413 | train |
neyric/webhookit | public/javascripts/codemirror/js/undo.js | function() {
// Make sure pending changes have been committed.
this.commit();
if (this.history.length) {
// Take the top diff from the history, apply it, and store its
// shadow in the redo history.
var item = this.history.pop();
this.redoHistory.push(this.updateTo(item, "applyChain... | javascript | function() {
// Make sure pending changes have been committed.
this.commit();
if (this.history.length) {
// Take the top diff from the history, apply it, and store its
// shadow in the redo history.
var item = this.history.pop();
this.redoHistory.push(this.updateTo(item, "applyChain... | [
"function",
"(",
")",
"{",
"// Make sure pending changes have been committed.",
"this",
".",
"commit",
"(",
")",
";",
"if",
"(",
"this",
".",
"history",
".",
"length",
")",
"{",
"// Take the top diff from the history, apply it, and store its",
"// shadow in the redo history... | Undo the last change. | [
"Undo",
"the",
"last",
"change",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/codemirror/js/undo.js#L66-L78 | train | |
neyric/webhookit | public/javascripts/codemirror/js/undo.js | function() {
this.commit();
if (this.redoHistory.length) {
// The inverse of undo, basically.
var item = this.redoHistory.pop();
this.addUndoLevel(this.updateTo(item, "applyChain"));
this.notifyEnvironment();
return this.chainNode(item);
}
} | javascript | function() {
this.commit();
if (this.redoHistory.length) {
// The inverse of undo, basically.
var item = this.redoHistory.pop();
this.addUndoLevel(this.updateTo(item, "applyChain"));
this.notifyEnvironment();
return this.chainNode(item);
}
} | [
"function",
"(",
")",
"{",
"this",
".",
"commit",
"(",
")",
";",
"if",
"(",
"this",
".",
"redoHistory",
".",
"length",
")",
"{",
"// The inverse of undo, basically.",
"var",
"item",
"=",
"this",
".",
"redoHistory",
".",
"pop",
"(",
")",
";",
"this",
".... | Redo the last undone change. | [
"Redo",
"the",
"last",
"undone",
"change",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/codemirror/js/undo.js#L81-L90 | train | |
neyric/webhookit | public/javascripts/codemirror/js/undo.js | function(from, to, lines) {
var chain = [];
for (var i = 0; i < lines.length; i++) {
var end = (i == lines.length - 1) ? to : this.container.ownerDocument.createElement("BR");
chain.push({from: from, to: end, text: cleanText(lines[i])});
from = end;
}
this.pushChains([chain], from == n... | javascript | function(from, to, lines) {
var chain = [];
for (var i = 0; i < lines.length; i++) {
var end = (i == lines.length - 1) ? to : this.container.ownerDocument.createElement("BR");
chain.push({from: from, to: end, text: cleanText(lines[i])});
from = end;
}
this.pushChains([chain], from == n... | [
"function",
"(",
"from",
",",
"to",
",",
"lines",
")",
"{",
"var",
"chain",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"lines",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"end",
"=",
"(",
"i",
"==",
"lines",
... | Push a changeset into the document. | [
"Push",
"a",
"changeset",
"into",
"the",
"document",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/codemirror/js/undo.js#L103-L112 | train | |
neyric/webhookit | public/javascripts/codemirror/js/undo.js | function(doNotHighlight) {
this.parent.clearTimeout(this.commitTimeout);
// Make sure there are no pending dirty nodes.
if (!doNotHighlight) this.editor.highlightDirty(true);
// Build set of chains.
var chains = this.touchedChains(), self = this;
if (chains.length) {
this.addUndoLevel(thi... | javascript | function(doNotHighlight) {
this.parent.clearTimeout(this.commitTimeout);
// Make sure there are no pending dirty nodes.
if (!doNotHighlight) this.editor.highlightDirty(true);
// Build set of chains.
var chains = this.touchedChains(), self = this;
if (chains.length) {
this.addUndoLevel(thi... | [
"function",
"(",
"doNotHighlight",
")",
"{",
"this",
".",
"parent",
".",
"clearTimeout",
"(",
"this",
".",
"commitTimeout",
")",
";",
"// Make sure there are no pending dirty nodes.",
"if",
"(",
"!",
"doNotHighlight",
")",
"this",
".",
"editor",
".",
"highlightDir... | Check whether the touched nodes hold any changes, if so, commit them. | [
"Check",
"whether",
"the",
"touched",
"nodes",
"hold",
"any",
"changes",
"if",
"so",
"commit",
"them",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/codemirror/js/undo.js#L155-L167 | train | |
neyric/webhookit | public/javascripts/codemirror/js/undo.js | function(chains, updateFunc) {
var shadows = [], dirty = [];
for (var i = 0; i < chains.length; i++) {
shadows.push(this.shadowChain(chains[i]));
dirty.push(this[updateFunc](chains[i]));
}
if (updateFunc == "applyChain")
this.notifyDirty(dirty);
return shadows;
} | javascript | function(chains, updateFunc) {
var shadows = [], dirty = [];
for (var i = 0; i < chains.length; i++) {
shadows.push(this.shadowChain(chains[i]));
dirty.push(this[updateFunc](chains[i]));
}
if (updateFunc == "applyChain")
this.notifyDirty(dirty);
return shadows;
} | [
"function",
"(",
"chains",
",",
"updateFunc",
")",
"{",
"var",
"shadows",
"=",
"[",
"]",
",",
"dirty",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"chains",
".",
"length",
";",
"i",
"++",
")",
"{",
"shadows",
".",
"pu... | Update the document with a given set of chains, return its shadow. updateFunc should be "applyChain" or "linkChain". In the second case, the chains are taken to correspond the the current document, and only the state of the line data is updated. In the first case, the content of the chains is also pushed iinto the docu... | [
"Update",
"the",
"document",
"with",
"a",
"given",
"set",
"of",
"chains",
"return",
"its",
"shadow",
".",
"updateFunc",
"should",
"be",
"applyChain",
"or",
"linkChain",
".",
"In",
"the",
"second",
"case",
"the",
"chains",
"are",
"taken",
"to",
"correspond",
... | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/codemirror/js/undo.js#L177-L186 | train | |
neyric/webhookit | public/javascripts/codemirror/js/undo.js | function(node) {
if (node) {
if (!node.historyTouched) {
this.touched.push(node);
node.historyTouched = true;
}
}
else {
this.firstTouched = true;
}
} | javascript | function(node) {
if (node) {
if (!node.historyTouched) {
this.touched.push(node);
node.historyTouched = true;
}
}
else {
this.firstTouched = true;
}
} | [
"function",
"(",
"node",
")",
"{",
"if",
"(",
"node",
")",
"{",
"if",
"(",
"!",
"node",
".",
"historyTouched",
")",
"{",
"this",
".",
"touched",
".",
"push",
"(",
"node",
")",
";",
"node",
".",
"historyTouched",
"=",
"true",
";",
"}",
"}",
"else"... | Mark a node as touched if it has not already been marked. | [
"Mark",
"a",
"node",
"as",
"touched",
"if",
"it",
"has",
"not",
"already",
"been",
"marked",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/codemirror/js/undo.js#L222-L232 | train | |
neyric/webhookit | public/javascripts/codemirror/js/undo.js | function(chain) {
var shadows = [], next = this.after(chain[0].from), end = chain[chain.length - 1].to;
while (true) {
shadows.push(next);
var nextNode = next.to;
if (!nextNode || nextNode == end)
break;
else
next = nextNode.historyAfter || this.before(end);
// (The... | javascript | function(chain) {
var shadows = [], next = this.after(chain[0].from), end = chain[chain.length - 1].to;
while (true) {
shadows.push(next);
var nextNode = next.to;
if (!nextNode || nextNode == end)
break;
else
next = nextNode.historyAfter || this.before(end);
// (The... | [
"function",
"(",
"chain",
")",
"{",
"var",
"shadows",
"=",
"[",
"]",
",",
"next",
"=",
"this",
".",
"after",
"(",
"chain",
"[",
"0",
"]",
".",
"from",
")",
",",
"end",
"=",
"chain",
"[",
"chain",
".",
"length",
"-",
"1",
"]",
".",
"to",
";",
... | Find the 'shadow' of a given chain by following the links in the DOM nodes at its start and end. | [
"Find",
"the",
"shadow",
"of",
"a",
"given",
"chain",
"by",
"following",
"the",
"links",
"in",
"the",
"DOM",
"nodes",
"at",
"its",
"start",
"and",
"end",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/codemirror/js/undo.js#L335-L349 | train | |
neyric/webhookit | public/javascripts/codemirror/js/undo.js | function(chain) {
// Some attempt is made to prevent the cursor from jumping
// randomly when an undo or redo happens. It still behaves a bit
// strange sometimes.
var cursor = select.cursorPos(this.container, false), self = this;
// Remove all nodes in the DOM tree between from and to (null for
... | javascript | function(chain) {
// Some attempt is made to prevent the cursor from jumping
// randomly when an undo or redo happens. It still behaves a bit
// strange sometimes.
var cursor = select.cursorPos(this.container, false), self = this;
// Remove all nodes in the DOM tree between from and to (null for
... | [
"function",
"(",
"chain",
")",
"{",
"// Some attempt is made to prevent the cursor from jumping",
"// randomly when an undo or redo happens. It still behaves a bit",
"// strange sometimes.",
"var",
"cursor",
"=",
"select",
".",
"cursorPos",
"(",
"this",
".",
"container",
",",
"... | Update the DOM tree to contain the lines specified in a given chain, link this chain into the DOM nodes. | [
"Update",
"the",
"DOM",
"tree",
"to",
"contain",
"the",
"lines",
"specified",
"in",
"a",
"given",
"chain",
"link",
"this",
"chain",
"into",
"the",
"DOM",
"nodes",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/codemirror/js/undo.js#L353-L409 | train | |
neyric/webhookit | public/javascripts/yui/cookie/cookie.js | function (hash /*:Object*/) /*:String*/ {
//shortcuts
var lang = YAHOO.lang;
if (!lang.isObject(hash)){
throw new TypeError("Cookie._createCookieHashString(): Argument must be an object.");
}
var text /*:Array*/ = [];
for (v... | javascript | function (hash /*:Object*/) /*:String*/ {
//shortcuts
var lang = YAHOO.lang;
if (!lang.isObject(hash)){
throw new TypeError("Cookie._createCookieHashString(): Argument must be an object.");
}
var text /*:Array*/ = [];
for (v... | [
"function",
"(",
"hash",
"/*:Object*/",
")",
"/*:String*/",
"{",
"//shortcuts",
"var",
"lang",
"=",
"YAHOO",
".",
"lang",
";",
"if",
"(",
"!",
"lang",
".",
"isObject",
"(",
"hash",
")",
")",
"{",
"throw",
"new",
"TypeError",
"(",
"\"Cookie._createCookieHas... | Formats a cookie value for an object containing multiple values.
@param {Object} hash An object of key-value pairs to create a string for.
@return {String} A string suitable for use as a cookie value.
@method _createCookieHashString
@private
@static | [
"Formats",
"a",
"cookie",
"value",
"for",
"an",
"object",
"containing",
"multiple",
"values",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/cookie/cookie.js#L76-L94 | train | |
neyric/webhookit | public/javascripts/yui/cookie/cookie.js | function (text /*:String*/) /*:Object*/ {
var hashParts /*:Array*/ = text.split("&"),
hashPart /*:Array*/ = null,
hash /*:Object*/ = {};
if (text.length > 0){
for (var i=0, len=hashParts.length; i < len; i++){
hashPart = hashParts[i].... | javascript | function (text /*:String*/) /*:Object*/ {
var hashParts /*:Array*/ = text.split("&"),
hashPart /*:Array*/ = null,
hash /*:Object*/ = {};
if (text.length > 0){
for (var i=0, len=hashParts.length; i < len; i++){
hashPart = hashParts[i].... | [
"function",
"(",
"text",
"/*:String*/",
")",
"/*:Object*/",
"{",
"var",
"hashParts",
"/*:Array*/",
"=",
"text",
".",
"split",
"(",
"\"&\"",
")",
",",
"hashPart",
"/*:Array*/",
"=",
"null",
",",
"hash",
"/*:Object*/",
"=",
"{",
"}",
";",
"if",
"(",
"text"... | Parses a cookie hash string into an object.
@param {String} text The cookie hash string to parse. The string should already be URL-decoded.
@return {Object} An object containing entries for each cookie value.
@method _parseCookieHash
@private
@static | [
"Parses",
"a",
"cookie",
"hash",
"string",
"into",
"an",
"object",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/cookie/cookie.js#L104-L118 | train | |
neyric/webhookit | public/javascripts/yui/cookie/cookie.js | function (text /*:String*/, decode /*:Boolean*/) /*:Object*/ {
var cookies /*:Object*/ = {};
if (YAHOO.lang.isString(text) && text.length > 0) {
var decodeValue = (decode === false ? function(s){return s;} : decodeURIComponent);
//if (/... | javascript | function (text /*:String*/, decode /*:Boolean*/) /*:Object*/ {
var cookies /*:Object*/ = {};
if (YAHOO.lang.isString(text) && text.length > 0) {
var decodeValue = (decode === false ? function(s){return s;} : decodeURIComponent);
//if (/... | [
"function",
"(",
"text",
"/*:String*/",
",",
"decode",
"/*:Boolean*/",
")",
"/*:Object*/",
"{",
"var",
"cookies",
"/*:Object*/",
"=",
"{",
"}",
";",
"if",
"(",
"YAHOO",
".",
"lang",
".",
"isString",
"(",
"text",
")",
"&&",
"text",
".",
"length",
">",
"... | Parses a cookie string into an object representing all accessible cookies.
@param {String} text The cookie string to parse.
@param {Boolean} decode (Optional) Indicates if the cookie values should be decoded or not. Default is true.
@return {Object} An object containing entries for each accessible cookie.
@method _pars... | [
"Parses",
"a",
"cookie",
"string",
"into",
"an",
"object",
"representing",
"all",
"accessible",
"cookies",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/cookie/cookie.js#L129-L165 | train | |
neyric/webhookit | public/javascripts/yui/cookie/cookie.js | function (name /*:String*/, options /*:Variant*/) /*:Variant*/{
var lang = YAHOO.lang,
converter;
if (lang.isFunction(options)) {
converter = options;
options = {};
} else if (lang.isObject(options)) {
converter = options.converte... | javascript | function (name /*:String*/, options /*:Variant*/) /*:Variant*/{
var lang = YAHOO.lang,
converter;
if (lang.isFunction(options)) {
converter = options;
options = {};
} else if (lang.isObject(options)) {
converter = options.converte... | [
"function",
"(",
"name",
"/*:String*/",
",",
"options",
"/*:Variant*/",
")",
"/*:Variant*/",
"{",
"var",
"lang",
"=",
"YAHOO",
".",
"lang",
",",
"converter",
";",
"if",
"(",
"lang",
".",
"isFunction",
"(",
"options",
")",
")",
"{",
"converter",
"=",
"opt... | Returns the cookie value for the given name.
@param {String} name The name of the cookie to retrieve.
@param {Object|Function} options (Optional) An object containing one or more
cookie options: raw (true/false) and converter (a function).
The converter function is run on the value before returning it. The
function is ... | [
"Returns",
"the",
"cookie",
"value",
"for",
"the",
"given",
"name",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/cookie/cookie.js#L204-L233 | train | |
neyric/webhookit | public/javascripts/yui/cookie/cookie.js | function (name, subName, converter) {
var lang = YAHOO.lang,
hash = this.getSubs(name);
if (hash !== null) {
if (!lang.isString(subName) || subName === ""){
throw new TypeError("Cookie.getSub(): Subcookie name must be a non-empty str... | javascript | function (name, subName, converter) {
var lang = YAHOO.lang,
hash = this.getSubs(name);
if (hash !== null) {
if (!lang.isString(subName) || subName === ""){
throw new TypeError("Cookie.getSub(): Subcookie name must be a non-empty str... | [
"function",
"(",
"name",
",",
"subName",
",",
"converter",
")",
"{",
"var",
"lang",
"=",
"YAHOO",
".",
"lang",
",",
"hash",
"=",
"this",
".",
"getSubs",
"(",
"name",
")",
";",
"if",
"(",
"hash",
"!==",
"null",
")",
"{",
"if",
"(",
"!",
"lang",
... | Returns the value of a subcookie.
@param {String} name The name of the cookie to retrieve.
@param {String} subName The name of the subcookie to retrieve.
@param {Function} converter (Optional) A function to run on the value before returning
it. The function is not used if the cookie doesn't exist.
@return {Variant} If ... | [
"Returns",
"the",
"value",
"of",
"a",
"subcookie",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/cookie/cookie.js#L248-L272 | train | |
neyric/webhookit | public/javascripts/yui/cookie/cookie.js | function (name /*:String*/) /*:Object*/ {
var isString = YAHOO.lang.isString;
//check cookie name
if (!isString(name) || name === ""){
throw new TypeError("Cookie.getSubs(): Cookie name must be a non-empty string.");
}
var cookies = this._parseC... | javascript | function (name /*:String*/) /*:Object*/ {
var isString = YAHOO.lang.isString;
//check cookie name
if (!isString(name) || name === ""){
throw new TypeError("Cookie.getSubs(): Cookie name must be a non-empty string.");
}
var cookies = this._parseC... | [
"function",
"(",
"name",
"/*:String*/",
")",
"/*:Object*/",
"{",
"var",
"isString",
"=",
"YAHOO",
".",
"lang",
".",
"isString",
";",
"//check cookie name",
"if",
"(",
"!",
"isString",
"(",
"name",
")",
"||",
"name",
"===",
"\"\"",
")",
"{",
"throw",
"new... | Returns an object containing name-value pairs stored in the cookie with the given name.
@param {String} name The name of the cookie to retrieve.
@return {Object} An object of name-value pairs if the cookie with the given name
exists, null if it does not.
@method getSubs
@static | [
"Returns",
"an",
"object",
"containing",
"name",
"-",
"value",
"pairs",
"stored",
"in",
"the",
"cookie",
"with",
"the",
"given",
"name",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/cookie/cookie.js#L282-L296 | train | |
neyric/webhookit | public/javascripts/yui/cookie/cookie.js | function (name /*:String*/, options /*:Object*/) /*:String*/ {
//check cookie name
if (!YAHOO.lang.isString(name) || name === ""){
throw new TypeError("Cookie.remove(): Cookie name must be a non-empty string.");
}
//set options - clone options so the origina... | javascript | function (name /*:String*/, options /*:Object*/) /*:String*/ {
//check cookie name
if (!YAHOO.lang.isString(name) || name === ""){
throw new TypeError("Cookie.remove(): Cookie name must be a non-empty string.");
}
//set options - clone options so the origina... | [
"function",
"(",
"name",
"/*:String*/",
",",
"options",
"/*:Object*/",
")",
"/*:String*/",
"{",
"//check cookie name",
"if",
"(",
"!",
"YAHOO",
".",
"lang",
".",
"isString",
"(",
"name",
")",
"||",
"name",
"===",
"\"\"",
")",
"{",
"throw",
"new",
"TypeErro... | Removes a cookie from the machine by setting its expiration date to
sometime in the past.
@param {String} name The name of the cookie to remove.
@param {Object} options (Optional) An object containing one or more
cookie options: path (a string), domain (a string),
and secure (true/false). The expires option will be ove... | [
"Removes",
"a",
"cookie",
"from",
"the",
"machine",
"by",
"setting",
"its",
"expiration",
"date",
"to",
"sometime",
"in",
"the",
"past",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/cookie/cookie.js#L310-L324 | train | |
neyric/webhookit | public/javascripts/yui/cookie/cookie.js | function(name /*:String*/, subName /*:String*/, options /*:Object*/) /*:String*/ {
var lang = YAHOO.lang;
options = options || {};
//check cookie name
if (!lang.isString(name) || name === ""){
throw new TypeError("Cookie.removeSub(): Cookie name mus... | javascript | function(name /*:String*/, subName /*:String*/, options /*:Object*/) /*:String*/ {
var lang = YAHOO.lang;
options = options || {};
//check cookie name
if (!lang.isString(name) || name === ""){
throw new TypeError("Cookie.removeSub(): Cookie name mus... | [
"function",
"(",
"name",
"/*:String*/",
",",
"subName",
"/*:String*/",
",",
"options",
"/*:Object*/",
")",
"/*:String*/",
"{",
"var",
"lang",
"=",
"YAHOO",
".",
"lang",
";",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"//check cookie name",
"if",
"(",
... | Removes a subcookie with a given name. Removing the last subcookie
won't remove the entire cookie unless options.removeIfEmpty is true.
@param {String} name The name of the cookie in which the subcookie exists.
@param {String} subName The name of the subcookie to remove.
@param {Object} options (Optional) An object con... | [
"Removes",
"a",
"subcookie",
"with",
"a",
"given",
"name",
".",
"Removing",
"the",
"last",
"subcookie",
"won",
"t",
"remove",
"the",
"entire",
"cookie",
"unless",
"options",
".",
"removeIfEmpty",
"is",
"true",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/cookie/cookie.js#L339-L380 | train | |
neyric/webhookit | public/javascripts/yui/cookie/cookie.js | function (name /*:String*/, value /*:Variant*/, options /*:Object*/) /*:String*/ {
var lang = YAHOO.lang;
options = options || {};
if (!lang.isString(name)){
throw new TypeError("Cookie.set(): Cookie name must be a string.");
}
if (... | javascript | function (name /*:String*/, value /*:Variant*/, options /*:Object*/) /*:String*/ {
var lang = YAHOO.lang;
options = options || {};
if (!lang.isString(name)){
throw new TypeError("Cookie.set(): Cookie name must be a string.");
}
if (... | [
"function",
"(",
"name",
"/*:String*/",
",",
"value",
"/*:Variant*/",
",",
"options",
"/*:Object*/",
")",
"/*:String*/",
"{",
"var",
"lang",
"=",
"YAHOO",
".",
"lang",
";",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"if",
"(",
"!",
"lang",
".",
"i... | Sets a cookie with a given name and value.
@param {String} name The name of the cookie to set.
@param {Variant} value The value to set for the cookie.
@param {Object} options (Optional) An object containing one or more
cookie options: path (a string), domain (a string), expires (a Date object),
raw (true/false), and se... | [
"Sets",
"a",
"cookie",
"with",
"a",
"given",
"name",
"and",
"value",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/cookie/cookie.js#L393-L410 | train | |
neyric/webhookit | public/javascripts/yui/cookie/cookie.js | function (name /*:String*/, subName /*:String*/, value /*:Variant*/, options /*:Object*/) /*:String*/ {
var lang = YAHOO.lang;
if (!lang.isString(name) || name === ""){
throw new TypeError("Cookie.setSub(): Cookie name must be a non-empty string.");
}
... | javascript | function (name /*:String*/, subName /*:String*/, value /*:Variant*/, options /*:Object*/) /*:String*/ {
var lang = YAHOO.lang;
if (!lang.isString(name) || name === ""){
throw new TypeError("Cookie.setSub(): Cookie name must be a non-empty string.");
}
... | [
"function",
"(",
"name",
"/*:String*/",
",",
"subName",
"/*:String*/",
",",
"value",
"/*:Variant*/",
",",
"options",
"/*:Object*/",
")",
"/*:String*/",
"{",
"var",
"lang",
"=",
"YAHOO",
".",
"lang",
";",
"if",
"(",
"!",
"lang",
".",
"isString",
"(",
"name"... | Sets a sub cookie with a given name to a particular value.
@param {String} name The name of the cookie to set.
@param {String} subName The name of the subcookie to set.
@param {Variant} value The value to set.
@param {Object} options (Optional) An object containing one or more
cookie options: path (a string), domain (a... | [
"Sets",
"a",
"sub",
"cookie",
"with",
"a",
"given",
"name",
"to",
"a",
"particular",
"value",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/cookie/cookie.js#L424-L450 | train | |
neyric/webhookit | public/javascripts/yui/cookie/cookie.js | function (name /*:String*/, value /*:Object*/, options /*:Object*/) /*:String*/ {
var lang = YAHOO.lang;
if (!lang.isString(name)){
throw new TypeError("Cookie.setSubs(): Cookie name must be a string.");
}
if (!lang.isObject(value)){
thr... | javascript | function (name /*:String*/, value /*:Object*/, options /*:Object*/) /*:String*/ {
var lang = YAHOO.lang;
if (!lang.isString(name)){
throw new TypeError("Cookie.setSubs(): Cookie name must be a string.");
}
if (!lang.isObject(value)){
thr... | [
"function",
"(",
"name",
"/*:String*/",
",",
"value",
"/*:Object*/",
",",
"options",
"/*:Object*/",
")",
"/*:String*/",
"{",
"var",
"lang",
"=",
"YAHOO",
".",
"lang",
";",
"if",
"(",
"!",
"lang",
".",
"isString",
"(",
"name",
")",
")",
"{",
"throw",
"n... | Sets a cookie with a given name to contain a hash of name-value pairs.
@param {String} name The name of the cookie to set.
@param {Object} value An object containing name-value pairs.
@param {Object} options (Optional) An object containing one or more
cookie options: path (a string), domain (a string), expires (a Date ... | [
"Sets",
"a",
"cookie",
"with",
"a",
"given",
"name",
"to",
"contain",
"a",
"hash",
"of",
"name",
"-",
"value",
"pairs",
"."
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/cookie/cookie.js#L463-L478 | train | |
neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function(el,style) {
var sStyle = YAHOO.util.Dom.getStyle(el, style);
return parseInt(sStyle.substr(0, sStyle.length-2), 10);
} | javascript | function(el,style) {
var sStyle = YAHOO.util.Dom.getStyle(el, style);
return parseInt(sStyle.substr(0, sStyle.length-2), 10);
} | [
"function",
"(",
"el",
",",
"style",
")",
"{",
"var",
"sStyle",
"=",
"YAHOO",
".",
"util",
".",
"Dom",
".",
"getStyle",
"(",
"el",
",",
"style",
")",
";",
"return",
"parseInt",
"(",
"sStyle",
".",
"substr",
"(",
"0",
",",
"sStyle",
".",
"length",
... | Get a css property in pixels and convert it to an integer
@method getIntStyle
@namespace WireIt
@static
@param {HTMLElement} el The element
@param {String} style css-property to get
@return {Integer} integer size | [
"Get",
"a",
"css",
"property",
"in",
"pixels",
"and",
"convert",
"it",
"to",
"an",
"integer"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L64-L67 | train | |
neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
// Remove the canvas from the dom
this.parentEl.removeChild(this.element);
// Remove the wire reference from the connected terminals
if(this.terminal1 && this.terminal1.removeWire) {
this.terminal1.removeWire(this);
}
if(this.terminal2 && this.terminal2.removeWir... | javascript | function() {
// Remove the canvas from the dom
this.parentEl.removeChild(this.element);
// Remove the wire reference from the connected terminals
if(this.terminal1 && this.terminal1.removeWire) {
this.terminal1.removeWire(this);
}
if(this.terminal2 && this.terminal2.removeWir... | [
"function",
"(",
")",
"{",
"// Remove the canvas from the dom",
"this",
".",
"parentEl",
".",
"removeChild",
"(",
"this",
".",
"element",
")",
";",
"// Remove the wire reference from the connected terminals",
"if",
"(",
"this",
".",
"terminal1",
"&&",
"this",
".",
"... | Remove a Wire from the Dom
@method remove | [
"Remove",
"a",
"Wire",
"from",
"the",
"Dom"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L463-L487 | train | |
neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
var self=this, body=document.body;
if (!body || !body.firstChild) {
window.setTimeout( function() { self.createFrame(); }, 50 );
return;
}
var div=this.getDragEl(), Dom=YAHOO.util.Dom;
if (!div) {
div = document.createElement("div");
div.id =... | javascript | function() {
var self=this, body=document.body;
if (!body || !body.firstChild) {
window.setTimeout( function() { self.createFrame(); }, 50 );
return;
}
var div=this.getDragEl(), Dom=YAHOO.util.Dom;
if (!div) {
div = document.createElement("div");
div.id =... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
",",
"body",
"=",
"document",
".",
"body",
";",
"if",
"(",
"!",
"body",
"||",
"!",
"body",
".",
"firstChild",
")",
"{",
"window",
".",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"self",
".... | Took this method from the YAHOO.util.DDProxy class
to overwrite the creation of the proxy Element with our custom size
@method createFrame | [
"Took",
"this",
"method",
"from",
"the",
"YAHOO",
".",
"util",
".",
"DDProxy",
"class",
"to",
"overwrite",
"the",
"creation",
"of",
"the",
"proxy",
"Element",
"with",
"our",
"custom",
"size"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L1342-L1369 | train | |
neyric/webhookit | public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js | function() {
// Display the cut button
this.hideNow();
this.addClass(CSS_PREFIX+"Wire-scissors");
// The scissors are within the terminal element
this.appendTo(this._terminal.container ? this._terminal.container.layer.el : this._terminal.el.parentNode.parentNode);
// A... | javascript | function() {
// Display the cut button
this.hideNow();
this.addClass(CSS_PREFIX+"Wire-scissors");
// The scissors are within the terminal element
this.appendTo(this._terminal.container ? this._terminal.container.layer.el : this._terminal.el.parentNode.parentNode);
// A... | [
"function",
"(",
")",
"{",
"// Display the cut button",
"this",
".",
"hideNow",
"(",
")",
";",
"this",
".",
"addClass",
"(",
"CSS_PREFIX",
"+",
"\"Wire-scissors\"",
")",
";",
"// The scissors are within the terminal element",
"this",
".",
"appendTo",
"(",
"this",
... | Init the scissors
@method initScissors | [
"Init",
"the",
"scissors"
] | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L1650-L1667 | train | |
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... | 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... | [
"function",
"(",
")",
"{",
"// Create the DIV element",
"this",
".",
"el",
"=",
"WireIt",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"this",
".",
"className",
"}",
")",
";",
"if",
"(",
"this",
".",
"name",
")",
"{",
"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 | train | |
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",
".",... | 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 | train | |
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:
i... | 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:
i... | [
"function",
"(",
"wire",
")",
"{",
"var",
"index",
"=",
"WireIt",
".",
"indexOf",
"(",
"wire",
",",
"this",
".",
"wires",
")",
";",
"if",
"(",
"index",
"!=",
"-",
"1",
")",
"{",
"this",
".",
"wires",
"[",
"index",
"]",
".",
"destroy",
"(",
")",... | 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 | train | |
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 && ... | 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 && ... | [
"function",
"(",
")",
"{",
"var",
"layerEl",
"=",
"this",
".",
"container",
"&&",
"this",
".",
"container",
".",
"layer",
"?",
"this",
".",
"container",
".",
"layer",
".",
"el",
":",
"document",
".",
"body",
";",
"var",
"obj",
"=",
"this",
".",
"el... | 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",... | 13abf6f072e23d536432235da78fd3e4e5d742b6 | https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/WireIt/build/wireit-inputex-editor-grouping.js#L2037-L2052 | train | |
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",
"... | 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 | train | |
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... | 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... | [
"function",
"(",
"e",
")",
"{",
"// Make sure terminalList is an array",
"var",
"terminalList",
"=",
"YAHOO",
".",
"lang",
".",
"isArray",
"(",
"this",
".",
"_WireItTerminals",
")",
"?",
"this",
".",
"_WireItTerminals",
":",
"(",
"this",
".",
"_WireItTerminals",... | 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 | train | |
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",
"... | 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 | train | |
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",
"."... | 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 | train | |
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 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 | train | |
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",
".",... | 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 | train | |
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... | 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... | [
"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",
")",
"{",
... | 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 | train | |
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",
")",
"{",
"t... | 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 | train | |
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... | 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... | [
"function",
"(",
")",
"{",
"var",
"i",
";",
"var",
"obj",
"=",
"{",
"containers",
":",
"[",
"]",
",",
"wires",
":",
"[",
"]",
"}",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"containers",
".",
"length",
";",
"i",
"++",
")",... | 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 | train | |
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.leng... | 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.leng... | [
"function",
"(",
"wiring",
")",
"{",
"this",
".",
"clear",
"(",
")",
";",
"var",
"i",
";",
"if",
"(",
"YAHOO",
".",
"lang",
".",
"isArray",
"(",
"wiring",
".",
"containers",
")",
")",
"{",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"wiring",
"... | 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 | train | |
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",
"["... | 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 | train | |
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.addListen... | 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.addListen... | [
"function",
"(",
")",
"{",
"var",
"layer",
"=",
"this",
".",
"layer",
";",
"Event",
".",
"addListener",
"(",
"this",
".",
"element",
",",
"'mousedown'",
",",
"this",
".",
"onMouseDown",
",",
"this",
",",
"true",
")",
";",
"Event",
".",
"addListener",
... | 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 | train | |
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 | train | |
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",
... | 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 | train | |
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, canvasW... | 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, canvasW... | [
"function",
"(",
")",
"{",
"var",
"ctxt",
"=",
"this",
".",
"getContext",
"(",
")",
";",
"// Canvas Region",
"var",
"canvasRegion",
"=",
"Dom",
".",
"getRegion",
"(",
"this",
".",
"element",
")",
";",
"var",
"canvasWidth",
"=",
"canvasRegion",
".",
"righ... | 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 | train | |
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,
... | 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,
... | [
"function",
"(",
"ctxt",
",",
"hRatio",
",",
"vRatio",
")",
"{",
"var",
"containers",
"=",
"this",
".",
"layer",
".",
"containers",
";",
"var",
"n",
"=",
"containers",
".",
"length",
",",
"i",
",",
"gIS",
"=",
"WireIt",
".",
"getIntStyle",
",",
"cont... | 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 | train | |
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(... | 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(... | [
"function",
"(",
"ctxt",
",",
"hRatio",
",",
"vRatio",
")",
"{",
"var",
"wires",
"=",
"this",
".",
"layer",
".",
"wires",
";",
"var",
"n",
"=",
"wires",
".",
"length",
",",
"i",
",",
"wire",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"n",... | 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 | train | |
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",... | 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 | train | |
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",
")"... | 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 | train | |
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.leng... | 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.leng... | [
"function",
"(",
"msg",
")",
"{",
"if",
"(",
"!",
"this",
".",
"fieldContainer",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"this",
".",
"msgEl",
")",
"{",
"this",
".",
"msgEl",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
... | 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 | train | |
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",
".",
"wira... | 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 | train | |
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:... | 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:... | [
"function",
"(",
")",
"{",
"var",
"wrapper",
"=",
"inputEx",
".",
"cn",
"(",
"'div'",
",",
"{",
"className",
":",
"'WireIt-InputExTerminal'",
"}",
")",
";",
"this",
".",
"divEl",
".",
"insertBefore",
"(",
"wrapper",
",",
"this",
".",
"fieldContainer",
")... | 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 | train | |
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] = fieldIn... | 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] = fieldIn... | [
"function",
"(",
"fieldOptions",
")",
"{",
"// Instanciate the field",
"var",
"fieldInstance",
"=",
"inputEx",
"(",
"fieldOptions",
",",
"this",
")",
";",
"this",
".",
"inputs",
".",
"push",
"(",
"fieldInstance",
")",
";",
"// Create an index to access fields by the... | 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 | train | |
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.get... | 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.get... | [
"function",
"(",
")",
"{",
"var",
"input",
",",
"inputName",
",",
"state",
",",
"message",
",",
"returnedObj",
"=",
"{",
"fields",
":",
"{",
"}",
",",
"validate",
":",
"true",
"}",
";",
"// Loop on all the sub fields",
"for",
"(",
"var",
"i",
"=",
"0",... | 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 | train | |
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.... | 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.... | [
"function",
"(",
")",
"{",
"var",
"o",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"inputs",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"v",
"=",
"this",
".",
"inputs",
"[",
"i",
"]",
".",
"getVa... | 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 | train | |
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",
",",
"fieldValu... | 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 | train | |
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.interactio... | 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.interactio... | [
"function",
"(",
"fieldInstance",
",",
"fieldValue",
")",
"{",
"var",
"index",
"=",
"inputEx",
".",
"indexOf",
"(",
"fieldInstance",
",",
"this",
".",
"inputs",
")",
";",
"var",
"fieldConfig",
"=",
"this",
".",
"options",
".",
"fields",
"[",
"index",
"]"... | 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 | train | |
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",
".",
"... | 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 | train | |
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... | 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 | train | |
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.inputsName... | 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.inputsName... | [
"function",
"(",
"errors",
")",
"{",
"var",
"i",
",",
"k",
";",
"if",
"(",
"YAHOO",
".",
"lang",
".",
"isArray",
"(",
"errors",
")",
")",
"{",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"errors",
".",
"length",
";",
"i",
"++",
")",
"{",
"k",... | 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 | train | |
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;
... | 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;
... | [
"function",
"(",
"options",
")",
"{",
"this",
".",
"options",
"=",
"{",
"}",
";",
"this",
".",
"options",
".",
"id",
"=",
"lang",
".",
"isString",
"(",
"options",
".",
"id",
")",
"?",
"options",
".",
"id",
":",
"Dom",
".",
"generateId",
"(",
")",... | 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 | train | |
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-... | 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-... | [
"function",
"(",
"parentEl",
")",
"{",
"var",
"innerSpan",
";",
"if",
"(",
"this",
".",
"options",
".",
"type",
"===",
"\"link\"",
"||",
"this",
".",
"options",
".",
"type",
"===",
"\"submit-link\"",
")",
"{",
"this",
".",
"el",
"=",
"inputEx",
".",
... | 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 | train | |
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");
Even... | 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");
Even... | [
"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 sub... | 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 | train | |
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",
... | 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 | train | |
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... | 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 | train | |
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();
}}... | 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();
}}... | [
"function",
"(",
")",
"{",
"Event",
".",
"addListener",
"(",
"this",
".",
"el",
",",
"\"change\"",
",",
"this",
".",
"onChange",
",",
"this",
",",
"true",
")",
";",
"if",
"(",
"YAHOO",
".",
"env",
".",
"ua",
".",
"ie",
")",
"{",
"// refer to inputE... | 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 | train | |
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",
".",
"va... | 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 | train | |
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 | train | |
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... | 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... | [
"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",
"... | 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 | train | |
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[posi... | 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[posi... | [
"function",
"(",
"config",
")",
"{",
"var",
"position",
",",
"choice",
";",
"// Get choice's position",
"position",
"=",
"this",
".",
"getChoicePosition",
"(",
"config",
")",
";",
"if",
"(",
"position",
"===",
"-",
"1",
")",
"{",
"throw",
"new",
"Error",
... | 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 | train | |
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",
"[",
... | 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 | train | |
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.choicesL... | 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.choicesL... | [
"function",
"(",
"config",
",",
"unselect",
")",
"{",
"var",
"position",
",",
"choice",
";",
"// Should we unselect choice if disabling selected choice",
"if",
"(",
"lang",
".",
"isUndefined",
"(",
"unselect",
")",
"||",
"!",
"lang",
".",
"isBoolean",
"(",
"unse... | 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 | train | |
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",
"[",
... | 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 | train | |
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>, visibl... | 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>, visibl... | [
"function",
"(",
")",
"{",
"var",
"i",
",",
"length",
";",
"// create DOM <select> node",
"this",
".",
"el",
"=",
"inputEx",
".",
"cn",
"(",
"'select'",
",",
"{",
"id",
":",
"this",
".",
"divEl",
".",
"id",
"?",
"this",
".",
"divEl",
".",
"id",
"+"... | 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 | train | |
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 {
... | 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 {
... | [
"function",
"(",
")",
"{",
"var",
"choiceIndex",
";",
"if",
"(",
"this",
".",
"el",
".",
"selectedIndex",
">=",
"0",
")",
"{",
"choiceIndex",
"=",
"inputEx",
".",
"indexOf",
"(",
"this",
".",
"el",
".",
"childNodes",
"[",
"this",
".",
"el",
".",
"s... | 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 | train | |
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 = (YA... | 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 = (YA... | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"EmailField",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"// Overwrite options",
"this",
".",
"options",
".",
"messages",
".",
"invalid",
"=",
"inputEx",
"... | 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 | train | |
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 | train | |
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... | 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... | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"UrlField",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"this",
".",
"options",
".",
"className",
"=",
"options",
".",
"className",
"?",
"options",
".",
... | 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 | train | |
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', {... | 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', {... | [
"function",
"(",
")",
"{",
"inputEx",
".",
"UrlField",
".",
"superclass",
".",
"render",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"el",
".",
"size",
"=",
"this",
".",
"options",
".",
"size",
";",
"if",
"(",
"!",
"this",
".",
"options",
".... | 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 | train | |
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 =... | 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 =... | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"ListField",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"this",
".",
"options",
".",
"className",
"=",
"options",
".",
"className",
"?",
"options",
".",
... | 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 | train | |
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( i... | 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( i... | [
"function",
"(",
")",
"{",
"// Add element button",
"if",
"(",
"this",
".",
"options",
".",
"useButtons",
")",
"{",
"this",
".",
"addButton",
"=",
"inputEx",
".",
"cn",
"(",
"'img'",
",",
"{",
"src",
":",
"inputEx",
".",
"spacerUrl",
",",
"className",
... | 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 | train | |
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) {
... | 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) {
... | [
"function",
"(",
"value",
",",
"sendUpdatedEvt",
")",
"{",
"if",
"(",
"!",
"lang",
".",
"isArray",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"inputEx.ListField.setValue expected an array, got \"",
"+",
"(",
"typeof",
"value",
")",
")",
";"... | 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 | train | |
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",
"[",
... | 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 | train | |
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... | 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... | [
"function",
"(",
"e",
")",
"{",
"Event",
".",
"stopEvent",
"(",
"e",
")",
";",
"// Prevent adding a new field if already at maxItems",
"if",
"(",
"lang",
".",
"isNumber",
"(",
"this",
".",
"options",
".",
"maxItems",
")",
"&&",
"this",
".",
"subFields",
".",... | 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 | train | |
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",
"... | 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 | train | |
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.sentVa... | 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.sentVa... | [
"function",
"(",
"options",
")",
"{",
"inputEx",
".",
"CheckBox",
".",
"superclass",
".",
"setOptions",
".",
"call",
"(",
"this",
",",
"options",
")",
";",
"// Overwrite options:",
"this",
".",
"options",
".",
"className",
"=",
"options",
".",
"className",
... | 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 | train |
Subsets and Splits
SQL Console for semeru/code-text-javascript
Retrieves 20,000 non-null code samples labeled as JavaScript, providing a basic overview of the dataset.