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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ariatemplates/ariatemplates | src/aria/utils/Caret.js | function (element, start, end) {
if ("selectionStart" in element) {
element.selectionStart = start;
element.selectionEnd = end;
} else {
var document = Aria.$window.document;
if (document.selection) {
var range =... | javascript | function (element, start, end) {
if ("selectionStart" in element) {
element.selectionStart = start;
element.selectionEnd = end;
} else {
var document = Aria.$window.document;
if (document.selection) {
var range =... | [
"function",
"(",
"element",
",",
"start",
",",
"end",
")",
"{",
"if",
"(",
"\"selectionStart\"",
"in",
"element",
")",
"{",
"element",
".",
"selectionStart",
"=",
"start",
";",
"element",
".",
"selectionEnd",
"=",
"end",
";",
"}",
"else",
"{",
"var",
"... | Set the caret position of the HTML element
@param {HTMLElement} element The html element
@param {Integer} start The starting caret position
@param {Integer} end The ending caret position | [
"Set",
"the",
"caret",
"position",
"of",
"the",
"HTML",
"element"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Caret.js#L63-L76 | train | |
ariatemplates/ariatemplates | src/aria/utils/Caret.js | function (element) {
var start = 0;
var end = (element.value.length) ? element.value.length : 0;
if (end) {
this.setPosition(element, start, end);
}
} | javascript | function (element) {
var start = 0;
var end = (element.value.length) ? element.value.length : 0;
if (end) {
this.setPosition(element, start, end);
}
} | [
"function",
"(",
"element",
")",
"{",
"var",
"start",
"=",
"0",
";",
"var",
"end",
"=",
"(",
"element",
".",
"value",
".",
"length",
")",
"?",
"element",
".",
"value",
".",
"length",
":",
"0",
";",
"if",
"(",
"end",
")",
"{",
"this",
".",
"setP... | Select the element text setting the caret position to the whole input value.
@type {HTMLElement} element The html elment | [
"Select",
"the",
"element",
"text",
"setting",
"the",
"caret",
"position",
"to",
"the",
"whole",
"input",
"value",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Caret.js#L82-L88 | train | |
ariatemplates/ariatemplates | src/aria/touch/Gesture.js | function () {
if (!this.eventsAlreadyAttached) {
this.body = Aria.$window.document.body;
var map = this._getInitialListenersList();
for (var i = 0; i < map.length; i++) {
this._addListener(map[i].evt, map[i].cb);
}
... | javascript | function () {
if (!this.eventsAlreadyAttached) {
this.body = Aria.$window.document.body;
var map = this._getInitialListenersList();
for (var i = 0; i < map.length; i++) {
this._addListener(map[i].evt, map[i].cb);
}
... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"eventsAlreadyAttached",
")",
"{",
"this",
".",
"body",
"=",
"Aria",
".",
"$window",
".",
"document",
".",
"body",
";",
"var",
"map",
"=",
"this",
".",
"_getInitialListenersList",
"(",
")",
";",
... | This method is called when AriaWindow sends an attachWindow event. It registers the initial listeners for the
gesture.
@private | [
"This",
"method",
"is",
"called",
"when",
"AriaWindow",
"sends",
"an",
"attachWindow",
"event",
".",
"It",
"registers",
"the",
"initial",
"listeners",
"for",
"the",
"gesture",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/touch/Gesture.js#L86-L95 | train | |
ariatemplates/ariatemplates | src/aria/touch/Gesture.js | function () {
var map = this._getInitialListenersList();
for (var i = 0; i < map.length; i++) {
this._removeListener(map[i].evt, map[i].cb);
}
this.eventsAlreadyAttached = false;
} | javascript | function () {
var map = this._getInitialListenersList();
for (var i = 0; i < map.length; i++) {
this._removeListener(map[i].evt, map[i].cb);
}
this.eventsAlreadyAttached = false;
} | [
"function",
"(",
")",
"{",
"var",
"map",
"=",
"this",
".",
"_getInitialListenersList",
"(",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"map",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"_removeListener",
"(",
"map",
"["... | This method is called when AriaWindow sends a detachWindow event. It unregisters the listeners added in
_connectTouchEvents.
@private | [
"This",
"method",
"is",
"called",
"when",
"AriaWindow",
"sends",
"a",
"detachWindow",
"event",
".",
"It",
"unregisters",
"the",
"listeners",
"added",
"in",
"_connectTouchEvents",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/touch/Gesture.js#L102-L108 | train | |
ariatemplates/ariatemplates | src/aria/touch/Gesture.js | function () {
var map = this._getAdditionalListenersList();
for (var i = 0; i < map.length; i++) {
this._addListener(map[i].evt, map[i].cb);
}
} | javascript | function () {
var map = this._getAdditionalListenersList();
for (var i = 0; i < map.length; i++) {
this._addListener(map[i].evt, map[i].cb);
}
} | [
"function",
"(",
")",
"{",
"var",
"map",
"=",
"this",
".",
"_getAdditionalListenersList",
"(",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"map",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"_addListener",
"(",
"map",
"["... | Registers the listeners added during the gesture lifecycle, once the gesture is started.
@private | [
"Registers",
"the",
"listeners",
"added",
"during",
"the",
"gesture",
"lifecycle",
"once",
"the",
"gesture",
"is",
"started",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/touch/Gesture.js#L236-L241 | train | |
ariatemplates/ariatemplates | src/aria/touch/Gesture.js | function () {
var map = this._getAdditionalListenersList();
for (var i = 0; i < map.length; i++) {
this._removeListener(map[i].evt, map[i].cb);
}
} | javascript | function () {
var map = this._getAdditionalListenersList();
for (var i = 0; i < map.length; i++) {
this._removeListener(map[i].evt, map[i].cb);
}
} | [
"function",
"(",
")",
"{",
"var",
"map",
"=",
"this",
".",
"_getAdditionalListenersList",
"(",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"map",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"_removeListener",
"(",
"map",
... | Unregisters the listeners added during the gesture lifecycle.
@private | [
"Unregisters",
"the",
"listeners",
"added",
"during",
"the",
"gesture",
"lifecycle",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/touch/Gesture.js#L247-L252 | train | |
ariatemplates/ariatemplates | src/aria/touch/Gesture.js | function (event, name, extraData) {
var target = (event.target) ? event.target : event.srcElement;
var fakeEvent = aria.DomEvent.getFakeEvent(name, target);
if (!event.returnValue) {
fakeEvent.preventDefault();
}
if (event.cancelBubble) {
... | javascript | function (event, name, extraData) {
var target = (event.target) ? event.target : event.srcElement;
var fakeEvent = aria.DomEvent.getFakeEvent(name, target);
if (!event.returnValue) {
fakeEvent.preventDefault();
}
if (event.cancelBubble) {
... | [
"function",
"(",
"event",
",",
"name",
",",
"extraData",
")",
"{",
"var",
"target",
"=",
"(",
"event",
".",
"target",
")",
"?",
"event",
".",
"target",
":",
"event",
".",
"srcElement",
";",
"var",
"fakeEvent",
"=",
"aria",
".",
"DomEvent",
".",
"getF... | Raises a fake event, using Delegate.delegate to accurately delegate the event to the appropriate DOM element.
@param {Object} event the original event
@param {String} name the fake event name
@protected
@return {Boolean} false if preventDefault is true | [
"Raises",
"a",
"fake",
"event",
"using",
"Delegate",
".",
"delegate",
"to",
"accurately",
"delegate",
"the",
"event",
"to",
"the",
"appropriate",
"DOM",
"element",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/touch/Gesture.js#L281-L315 | train | |
ariatemplates/ariatemplates | src/aria/core/environment/Customizations.js | function (ioRes) {
var downloadFailed = (ioRes.status != '200');
if (downloadFailed) {
this.$logError(this.DESCRIPTOR_NOT_LOADED, this._customizationDescriptor);
} else {
var resJson = ariaUtilsJson.load(ioRes.responseText);
if (resJson... | javascript | function (ioRes) {
var downloadFailed = (ioRes.status != '200');
if (downloadFailed) {
this.$logError(this.DESCRIPTOR_NOT_LOADED, this._customizationDescriptor);
} else {
var resJson = ariaUtilsJson.load(ioRes.responseText);
if (resJson... | [
"function",
"(",
"ioRes",
")",
"{",
"var",
"downloadFailed",
"=",
"(",
"ioRes",
".",
"status",
"!=",
"'200'",
")",
";",
"if",
"(",
"downloadFailed",
")",
"{",
"this",
".",
"$logError",
"(",
"this",
".",
"DESCRIPTOR_NOT_LOADED",
",",
"this",
".",
"_custom... | Internal callback called by the IO object when the customization descriptor has been succesfully received
@protected
@param {Object} ioRes IO result object | [
"Internal",
"callback",
"called",
"by",
"the",
"IO",
"object",
"when",
"the",
"customization",
"descriptor",
"has",
"been",
"succesfully",
"received"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/environment/Customizations.js#L99-L117 | train | |
ariatemplates/ariatemplates | src/aria/core/environment/Customizations.js | function () {
this._isCustomized = (this._customizationDescriptor ? true : false);
if (this._isCustomized) {
this._descriptorLoaded = false;
if (ariaUtilsType.isString(this._customizationDescriptor)) {
ariaCoreIO.asyncRequest({
... | javascript | function () {
this._isCustomized = (this._customizationDescriptor ? true : false);
if (this._isCustomized) {
this._descriptorLoaded = false;
if (ariaUtilsType.isString(this._customizationDescriptor)) {
ariaCoreIO.asyncRequest({
... | [
"function",
"(",
")",
"{",
"this",
".",
"_isCustomized",
"=",
"(",
"this",
".",
"_customizationDescriptor",
"?",
"true",
":",
"false",
")",
";",
"if",
"(",
"this",
".",
"_isCustomized",
")",
"{",
"this",
".",
"_descriptorLoaded",
"=",
"false",
";",
"if",... | Reload the customization descriptor from the URL passed in the environment
@public | [
"Reload",
"the",
"customization",
"descriptor",
"from",
"the",
"URL",
"passed",
"in",
"the",
"environment"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/environment/Customizations.js#L142-L162 | train | |
ariatemplates/ariatemplates | src/aria/core/environment/Customizations.js | function (originalCP) {
var newCP = originalCP;
if (this._isCustomized) {
if (this._customizations.flows[originalCP] != null) {
newCP = this._customizations.flows[originalCP];
}
}
return newCP;
} | javascript | function (originalCP) {
var newCP = originalCP;
if (this._isCustomized) {
if (this._customizations.flows[originalCP] != null) {
newCP = this._customizations.flows[originalCP];
}
}
return newCP;
} | [
"function",
"(",
"originalCP",
")",
"{",
"var",
"newCP",
"=",
"originalCP",
";",
"if",
"(",
"this",
".",
"_isCustomized",
")",
"{",
"if",
"(",
"this",
".",
"_customizations",
".",
"flows",
"[",
"originalCP",
"]",
"!=",
"null",
")",
"{",
"newCP",
"=",
... | Returns the classpath of the custom flow which is to replace an original template, or the original template's
CP if no customization for the template was specified
@public
@param {String} originalCP The original ClassPath | [
"Returns",
"the",
"classpath",
"of",
"the",
"custom",
"flow",
"which",
"is",
"to",
"replace",
"an",
"original",
"template",
"or",
"the",
"original",
"template",
"s",
"CP",
"if",
"no",
"customization",
"for",
"the",
"template",
"was",
"specified"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/environment/Customizations.js#L188-L196 | train | |
ariatemplates/ariatemplates | src/aria/core/environment/Customizations.js | function (originalCP) {
var newCP = originalCP;
if (this._isCustomized) {
if (this._customizations.templates[originalCP] != null) {
newCP = this._customizations.templates[originalCP];
}
}
return newCP;
} | javascript | function (originalCP) {
var newCP = originalCP;
if (this._isCustomized) {
if (this._customizations.templates[originalCP] != null) {
newCP = this._customizations.templates[originalCP];
}
}
return newCP;
} | [
"function",
"(",
"originalCP",
")",
"{",
"var",
"newCP",
"=",
"originalCP",
";",
"if",
"(",
"this",
".",
"_isCustomized",
")",
"{",
"if",
"(",
"this",
".",
"_customizations",
".",
"templates",
"[",
"originalCP",
"]",
"!=",
"null",
")",
"{",
"newCP",
"=... | Returns the classpath of the custom template which is to replace an original template, or the original
template's CP if no customization for the template was specified
@public
@param {String} originalCP The original ClassPath
@return {String} customized cp | [
"Returns",
"the",
"classpath",
"of",
"the",
"custom",
"template",
"which",
"is",
"to",
"replace",
"an",
"original",
"template",
"or",
"the",
"original",
"template",
"s",
"CP",
"if",
"no",
"customization",
"for",
"the",
"template",
"was",
"specified"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/environment/Customizations.js#L231-L239 | train | |
LoginRadius/node-js-sdk | loginradius-sdk/helper.js | getSott | function getSott(callback, config, startDate, endDate ) {
var cipher = require('./sdk/sott')(config.apisecret, config.apikey, startDate, endDate);
cipher.then(
function(sott) {
return callback(sott);
},
function(reason) {
console.log(reason);
});
} | javascript | function getSott(callback, config, startDate, endDate ) {
var cipher = require('./sdk/sott')(config.apisecret, config.apikey, startDate, endDate);
cipher.then(
function(sott) {
return callback(sott);
},
function(reason) {
console.log(reason);
});
} | [
"function",
"getSott",
"(",
"callback",
",",
"config",
",",
"startDate",
",",
"endDate",
")",
"{",
"var",
"cipher",
"=",
"require",
"(",
"'./sdk/sott'",
")",
"(",
"config",
".",
"apisecret",
",",
"config",
".",
"apikey",
",",
"startDate",
",",
"endDate",
... | Calculate SOTT. | [
"Calculate",
"SOTT",
"."
] | f80a2e1d8709f24d307e8e80132da53c46d5525b | https://github.com/LoginRadius/node-js-sdk/blob/f80a2e1d8709f24d307e8e80132da53c46d5525b/loginradius-sdk/helper.js#L37-L46 | train |
ariatemplates/ariatemplates | src/aria/utils/Delegate.js | function () {
this.cleanCache();
var mapping = this.__delegateMapping;
if (mapping) {
for (var id in mapping) {
if (mapping.hasOwnProperty(id)) {
this.remove(id);
}
}
va... | javascript | function () {
this.cleanCache();
var mapping = this.__delegateMapping;
if (mapping) {
for (var id in mapping) {
if (mapping.hasOwnProperty(id)) {
this.remove(id);
}
}
va... | [
"function",
"(",
")",
"{",
"this",
".",
"cleanCache",
"(",
")",
";",
"var",
"mapping",
"=",
"this",
".",
"__delegateMapping",
";",
"if",
"(",
"mapping",
")",
"{",
"for",
"(",
"var",
"id",
"in",
"mapping",
")",
"{",
"if",
"(",
"mapping",
".",
"hasOw... | Remove all event delegation listeners, and make sure we don't store any references to DOM elements. | [
"Remove",
"all",
"event",
"delegation",
"listeners",
"and",
"make",
"sure",
"we",
"don",
"t",
"store",
"any",
"references",
"to",
"DOM",
"elements",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Delegate.js#L272-L306 | train | |
ariatemplates/ariatemplates | src/aria/utils/Delegate.js | function (handler) {
this.cleanCache();
// initialization of delegation manager
if (!this.__delegateMapping) {
ariaUtilsAriaWindow.attachWindow();
var body = Aria.$window.document.body;
this.rootListener = ariaCoreBrowser.isOldIE ? bo... | javascript | function (handler) {
this.cleanCache();
// initialization of delegation manager
if (!this.__delegateMapping) {
ariaUtilsAriaWindow.attachWindow();
var body = Aria.$window.document.body;
this.rootListener = ariaCoreBrowser.isOldIE ? bo... | [
"function",
"(",
"handler",
")",
"{",
"this",
".",
"cleanCache",
"(",
")",
";",
"// initialization of delegation manager",
"if",
"(",
"!",
"this",
".",
"__delegateMapping",
")",
"{",
"ariaUtilsAriaWindow",
".",
"attachWindow",
"(",
")",
";",
"var",
"body",
"="... | Plug event listener to be able to listen to delegated events
@param {aria.core.CfgBeans:Callback} handler
@return {String} id for delegation. | [
"Plug",
"event",
"listener",
"to",
"be",
"able",
"to",
"listen",
"to",
"delegated",
"events"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Delegate.js#L322-L353 | train | |
ariatemplates/ariatemplates | src/aria/utils/Delegate.js | function (domElt, id) {
domElt.setAttribute(this.delegateExpando, id);
// for iOS, refer to method getMarkup
if (ariaCoreBrowser.isIOS) {
if (domElt.onclick == null) {
domElt.onclick = Aria.empty;
}
}
} | javascript | function (domElt, id) {
domElt.setAttribute(this.delegateExpando, id);
// for iOS, refer to method getMarkup
if (ariaCoreBrowser.isIOS) {
if (domElt.onclick == null) {
domElt.onclick = Aria.empty;
}
}
} | [
"function",
"(",
"domElt",
",",
"id",
")",
"{",
"domElt",
".",
"setAttribute",
"(",
"this",
".",
"delegateExpando",
",",
"id",
")",
";",
"// for iOS, refer to method getMarkup",
"if",
"(",
"ariaCoreBrowser",
".",
"isIOS",
")",
"{",
"if",
"(",
"domElt",
".",
... | Add the delegate expando on an existing dom element
@param {HTMLElement} domElt
@param {string} id | [
"Add",
"the",
"delegate",
"expando",
"on",
"an",
"existing",
"dom",
"element"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Delegate.js#L375-L384 | train | |
ariatemplates/ariatemplates | src/aria/utils/Delegate.js | function (eventName, delegateId, wrapTarget) {
if (ariaCoreBrowser.isOldIE) {
this.getFallbackMarkup = function (eventName, delegateId, wrapTarget) {
wrapTarget = wrapTarget ? "true" : "false";
return " on" + eventName + "=\"aria.utils.Delegate.directC... | javascript | function (eventName, delegateId, wrapTarget) {
if (ariaCoreBrowser.isOldIE) {
this.getFallbackMarkup = function (eventName, delegateId, wrapTarget) {
wrapTarget = wrapTarget ? "true" : "false";
return " on" + eventName + "=\"aria.utils.Delegate.directC... | [
"function",
"(",
"eventName",
",",
"delegateId",
",",
"wrapTarget",
")",
"{",
"if",
"(",
"ariaCoreBrowser",
".",
"isOldIE",
")",
"{",
"this",
".",
"getFallbackMarkup",
"=",
"function",
"(",
"eventName",
",",
"delegateId",
",",
"wrapTarget",
")",
"{",
"wrapTa... | Generate classic "onsomething" markup for event not supported by delegation
@param {String} eventName
@param {String} callback id
@param {Boolean} wrapTarget, if true, wrap target into DOMWrapper
@method
@return {String} | [
"Generate",
"classic",
"onsomething",
"markup",
"for",
"event",
"not",
"supported",
"by",
"delegation"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Delegate.js#L394-L417 | train | |
ariatemplates/ariatemplates | src/aria/utils/Delegate.js | function (event, templatesWrapper) {
if (event.$DomEvent) {
// It's already wrapped
return event;
} else {
return templatesWrapper ? new aria.templates.DomEventWrapper(event) : new ariaDomEvent(event);
}
} | javascript | function (event, templatesWrapper) {
if (event.$DomEvent) {
// It's already wrapped
return event;
} else {
return templatesWrapper ? new aria.templates.DomEventWrapper(event) : new ariaDomEvent(event);
}
} | [
"function",
"(",
"event",
",",
"templatesWrapper",
")",
"{",
"if",
"(",
"event",
".",
"$DomEvent",
")",
"{",
"// It's already wrapped",
"return",
"event",
";",
"}",
"else",
"{",
"return",
"templatesWrapper",
"?",
"new",
"aria",
".",
"templates",
".",
"DomEve... | Wrap a standard HTMLElement inside a DomEvent or DomEventWrapper
@param {HTMLEvent} event Event to wrap
@param {Boolean} templatesWrapper True to wrap an aria.templates.DomEventWrapper, False for aria.DomEvent
@return {aria.DomEvent} | [
"Wrap",
"a",
"standard",
"HTMLElement",
"inside",
"a",
"DomEvent",
"or",
"DomEventWrapper"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Delegate.js#L425-L432 | train | |
ariatemplates/ariatemplates | src/aria/utils/Delegate.js | function (event, delegateId, wrapTarget, container) {
this.$assert(286, this.__delegateMapping);
var eventWrapper = this.__wrapEvent(event, wrapTarget), result;
var callback = this.__delegateMapping[delegateId];
if (callback) {
result = callback.call(event... | javascript | function (event, delegateId, wrapTarget, container) {
this.$assert(286, this.__delegateMapping);
var eventWrapper = this.__wrapEvent(event, wrapTarget), result;
var callback = this.__delegateMapping[delegateId];
if (callback) {
result = callback.call(event... | [
"function",
"(",
"event",
",",
"delegateId",
",",
"wrapTarget",
",",
"container",
")",
"{",
"this",
".",
"$assert",
"(",
"286",
",",
"this",
".",
"__delegateMapping",
")",
";",
"var",
"eventWrapper",
"=",
"this",
".",
"__wrapEvent",
"(",
"event",
",",
"w... | Entry point for event that were not delegated
@param {HTMLEvent} event HTML Event
@param {String} delegateId Id of the delegated callback
@param {Boolean} wrapTarget, if true, wrap target into DomEventWrapper
@param {HTMLElement} container HTML Element on which the listener is attached
@return {Object} Return value of ... | [
"Entry",
"point",
"for",
"event",
"that",
"were",
"not",
"delegated"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Delegate.js#L442-L451 | train | |
ariatemplates/ariatemplates | src/aria/utils/Delegate.js | function (id) {
this.cleanCache();
// store id to identify changes during callback execution
if (this._changed) {
this._changed[id] = true;
}
if (this.__delegateMapping) {
this.__delegateMapping[id].$dispose();
... | javascript | function (id) {
this.cleanCache();
// store id to identify changes during callback execution
if (this._changed) {
this._changed[id] = true;
}
if (this.__delegateMapping) {
this.__delegateMapping[id].$dispose();
... | [
"function",
"(",
"id",
")",
"{",
"this",
".",
"cleanCache",
"(",
")",
";",
"// store id to identify changes during callback execution",
"if",
"(",
"this",
".",
"_changed",
")",
"{",
"this",
".",
"_changed",
"[",
"id",
"]",
"=",
"true",
";",
"}",
"if",
"(",... | Remove delegation for a given id.
@param {String} id Mapping ID | [
"Remove",
"delegation",
"for",
"a",
"given",
"id",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Delegate.js#L475-L488 | train | |
ariatemplates/ariatemplates | src/aria/utils/Delegate.js | function () {
if (this.__stackCache) {
for (var key in this.__stackCache) {
if (this.__stackCache.hasOwnProperty(key)) {
var stack = this.__stackCache[key];
// break dom reference
for (var i = 0, l = ... | javascript | function () {
if (this.__stackCache) {
for (var key in this.__stackCache) {
if (this.__stackCache.hasOwnProperty(key)) {
var stack = this.__stackCache[key];
// break dom reference
for (var i = 0, l = ... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"__stackCache",
")",
"{",
"for",
"(",
"var",
"key",
"in",
"this",
".",
"__stackCache",
")",
"{",
"if",
"(",
"this",
".",
"__stackCache",
".",
"hasOwnProperty",
"(",
"key",
")",
")",
"{",
"var",
"st... | Clean delegate hierachy cache | [
"Clean",
"delegate",
"hierachy",
"cache"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Delegate.js#L635-L652 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/MultiAutoCompleteController.js | function (label) {
var report = new aria.widgets.controllers.reports.DropDownControllerReport();
var newSuggestions = ariaUtilsJson.copy(this.selectedSuggestions, false);
var indexToRemove = this._findSuggestion(newSuggestions, {
label : label
... | javascript | function (label) {
var report = new aria.widgets.controllers.reports.DropDownControllerReport();
var newSuggestions = ariaUtilsJson.copy(this.selectedSuggestions, false);
var indexToRemove = this._findSuggestion(newSuggestions, {
label : label
... | [
"function",
"(",
"label",
")",
"{",
"var",
"report",
"=",
"new",
"aria",
".",
"widgets",
".",
"controllers",
".",
"reports",
".",
"DropDownControllerReport",
"(",
")",
";",
"var",
"newSuggestions",
"=",
"ariaUtilsJson",
".",
"copy",
"(",
"this",
".",
"sele... | Removal of a suggestion
@param {String} label
@return {aria.widgets.controllers.reports.DropDownControllerReport}
@override | [
"Removal",
"of",
"a",
"suggestion"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/MultiAutoCompleteController.js#L132-L152 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/MultiAutoCompleteController.js | function (value, removedSuggestionIndex) {
var dataModel = this._dataModel;
this._editedSuggestionIndex = removedSuggestionIndex;
var report = new aria.widgets.controllers.reports.DropDownControllerReport();
dataModel.value = value;
dataMod... | javascript | function (value, removedSuggestionIndex) {
var dataModel = this._dataModel;
this._editedSuggestionIndex = removedSuggestionIndex;
var report = new aria.widgets.controllers.reports.DropDownControllerReport();
dataModel.value = value;
dataMod... | [
"function",
"(",
"value",
",",
"removedSuggestionIndex",
")",
"{",
"var",
"dataModel",
"=",
"this",
".",
"_dataModel",
";",
"this",
".",
"_editedSuggestionIndex",
"=",
"removedSuggestionIndex",
";",
"var",
"report",
"=",
"new",
"aria",
".",
"widgets",
".",
"co... | Start editing a value. The value is supposed to have already been removed from the selectedSuggestions
array.
@param {String|Object} value (normally coming from the selectedSuggestions array)
@return {aria.widgets.controllers.reports.DropDownControllerReport} | [
"Start",
"editing",
"a",
"value",
".",
"The",
"value",
"is",
"supposed",
"to",
"have",
"already",
"been",
"removed",
"from",
"the",
"selectedSuggestions",
"array",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/MultiAutoCompleteController.js#L160-L171 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/MultiAutoCompleteController.js | function (selectedValues) {
var selectedValuesCopy = ariaUtilsJson.copy(selectedValues, false);
var selectedSuggestionsCopy = ariaUtilsJson.copy(this.selectedSuggestions, false);
for (var i = 0, l = selectedSuggestionsCopy.length; i < l; i++) {
var cur... | javascript | function (selectedValues) {
var selectedValuesCopy = ariaUtilsJson.copy(selectedValues, false);
var selectedSuggestionsCopy = ariaUtilsJson.copy(this.selectedSuggestions, false);
for (var i = 0, l = selectedSuggestionsCopy.length; i < l; i++) {
var cur... | [
"function",
"(",
"selectedValues",
")",
"{",
"var",
"selectedValuesCopy",
"=",
"ariaUtilsJson",
".",
"copy",
"(",
"selectedValues",
",",
"false",
")",
";",
"var",
"selectedSuggestionsCopy",
"=",
"ariaUtilsJson",
".",
"copy",
"(",
"this",
".",
"selectedSuggestions"... | Updates selected values.
@param {Array} values | [
"Updates",
"selected",
"values",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/MultiAutoCompleteController.js#L177-L198 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/MultiAutoCompleteController.js | function (value) {
var report = new aria.widgets.controllers.reports.DropDownControllerReport(), dataModel = this._dataModel;
if (value == null) {
dataModel.text = (this._pendingRequestNb > 0 && dataModel.text) ? dataModel.text : "";
dataModel.val... | javascript | function (value) {
var report = new aria.widgets.controllers.reports.DropDownControllerReport(), dataModel = this._dataModel;
if (value == null) {
dataModel.text = (this._pendingRequestNb > 0 && dataModel.text) ? dataModel.text : "";
dataModel.val... | [
"function",
"(",
"value",
")",
"{",
"var",
"report",
"=",
"new",
"aria",
".",
"widgets",
".",
"controllers",
".",
"reports",
".",
"DropDownControllerReport",
"(",
")",
",",
"dataModel",
"=",
"this",
".",
"_dataModel",
";",
"if",
"(",
"value",
"==",
"null... | Checks a value coming from the data model. The MultiAutoComplete only accepts arrays or null values from
the data model.
@param {Array} value
@return {aria.widgets.controllers.reports.DropDownControllerReport}
@override | [
"Checks",
"a",
"value",
"coming",
"from",
"the",
"data",
"model",
".",
"The",
"MultiAutoComplete",
"only",
"accepts",
"arrays",
"or",
"null",
"values",
"from",
"the",
"data",
"model",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/MultiAutoCompleteController.js#L207-L235 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/MultiAutoCompleteController.js | function (value) {
if (typeUtil.isString(value) || value == null) {
return new aria.widgets.controllers.reports.DropDownControllerReport();
} else {
var report = new aria.widgets.controllers.reports.DropDownControllerReport();
v... | javascript | function (value) {
if (typeUtil.isString(value) || value == null) {
return new aria.widgets.controllers.reports.DropDownControllerReport();
} else {
var report = new aria.widgets.controllers.reports.DropDownControllerReport();
v... | [
"function",
"(",
"value",
")",
"{",
"if",
"(",
"typeUtil",
".",
"isString",
"(",
"value",
")",
"||",
"value",
"==",
"null",
")",
"{",
"return",
"new",
"aria",
".",
"widgets",
".",
"controllers",
".",
"reports",
".",
"DropDownControllerReport",
"(",
")",
... | Check the value selected by the user in the dropdown. It is called by checkKeyStroke.
@param {Object} value
@return {aria.widgets.controllers.reports.ControllerReport} | [
"Check",
"the",
"value",
"selected",
"by",
"the",
"user",
"in",
"the",
"dropdown",
".",
"It",
"is",
"called",
"by",
"checkKeyStroke",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/MultiAutoCompleteController.js#L242-L256 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/MultiAutoCompleteController.js | function (suggestionToBeAdded) {
var allSuggestions = ariaUtilsJson.copy(this.selectedSuggestions, false);
var res = [];
var maxOptions = this.maxOptions;
var length = suggestionToBeAdded.length;
if (maxOptions && allSuggestions.length + le... | javascript | function (suggestionToBeAdded) {
var allSuggestions = ariaUtilsJson.copy(this.selectedSuggestions, false);
var res = [];
var maxOptions = this.maxOptions;
var length = suggestionToBeAdded.length;
if (maxOptions && allSuggestions.length + le... | [
"function",
"(",
"suggestionToBeAdded",
")",
"{",
"var",
"allSuggestions",
"=",
"ariaUtilsJson",
".",
"copy",
"(",
"this",
".",
"selectedSuggestions",
",",
"false",
")",
";",
"var",
"res",
"=",
"[",
"]",
";",
"var",
"maxOptions",
"=",
"this",
".",
"maxOpti... | Pushes new suggestions to the array of selectedSuggestions and return the array of new suggestions.
@protected
@param {Object} suggestionToBeAdded
@return {Array} | [
"Pushes",
"new",
"suggestions",
"to",
"the",
"array",
"of",
"selectedSuggestions",
"and",
"return",
"the",
"array",
"of",
"new",
"suggestions",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/MultiAutoCompleteController.js#L264-L286 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/MultiAutoCompleteController.js | function (suggestions) {
var selectedSuggestions = this.selectedSuggestions;
var filteredSuggestions = [];
for (var i = 0; i < suggestions.length; i++) {
var curSuggestion = suggestions[i];
if (this._findSuggestion(selectedSuggestio... | javascript | function (suggestions) {
var selectedSuggestions = this.selectedSuggestions;
var filteredSuggestions = [];
for (var i = 0; i < suggestions.length; i++) {
var curSuggestion = suggestions[i];
if (this._findSuggestion(selectedSuggestio... | [
"function",
"(",
"suggestions",
")",
"{",
"var",
"selectedSuggestions",
"=",
"this",
".",
"selectedSuggestions",
";",
"var",
"filteredSuggestions",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"suggestions",
".",
"length",
";",
"i... | Internal method to filter the suggestion with the added suggestions
@param {Array} suggestions
@return {Array} | [
"Internal",
"method",
"to",
"filter",
"the",
"suggestion",
"with",
"the",
"added",
"suggestions"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/MultiAutoCompleteController.js#L419-L429 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/MultiAutoCompleteController.js | function (suggestionsList, suggestion) {
for (var i = 0, l = suggestionsList.length; i < l; i++) {
if (suggestion.label == suggestionsList[i].label) {
return i;
}
}
return -1;
} | javascript | function (suggestionsList, suggestion) {
for (var i = 0, l = suggestionsList.length; i < l; i++) {
if (suggestion.label == suggestionsList[i].label) {
return i;
}
}
return -1;
} | [
"function",
"(",
"suggestionsList",
",",
"suggestion",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"l",
"=",
"suggestionsList",
".",
"length",
";",
"i",
"<",
"l",
";",
"i",
"++",
")",
"{",
"if",
"(",
"suggestion",
".",
"label",
"==",
"suggesti... | Returns the index of the given suggestion in the given array of suggestions. The comparison is based on
labels.
@param {Array} suggestionsList
@param {Object} suggestion
@return {Boolean} | [
"Returns",
"the",
"index",
"of",
"the",
"given",
"suggestion",
"in",
"the",
"given",
"array",
"of",
"suggestions",
".",
"The",
"comparison",
"is",
"based",
"on",
"labels",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/MultiAutoCompleteController.js#L438-L445 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/MultiAutoCompleteController.js | function (arrayOfSuggestions, beanName) {
for (var k = 0, l = arrayOfSuggestions.length; k < l; k++) {
var currentSuggestion = arrayOfSuggestions[k];
if (!typeUtil.isString(currentSuggestion)
&& !ariaCoreJsonValidator.check(currentSugge... | javascript | function (arrayOfSuggestions, beanName) {
for (var k = 0, l = arrayOfSuggestions.length; k < l; k++) {
var currentSuggestion = arrayOfSuggestions[k];
if (!typeUtil.isString(currentSuggestion)
&& !ariaCoreJsonValidator.check(currentSugge... | [
"function",
"(",
"arrayOfSuggestions",
",",
"beanName",
")",
"{",
"for",
"(",
"var",
"k",
"=",
"0",
",",
"l",
"=",
"arrayOfSuggestions",
".",
"length",
";",
"k",
"<",
"l",
";",
"k",
"++",
")",
"{",
"var",
"currentSuggestion",
"=",
"arrayOfSuggestions",
... | Internal method to validate the value with suggestion bean.
@param {Array} value
@param {String} bean to validate each item of the array with
@return {Boolean} | [
"Internal",
"method",
"to",
"validate",
"the",
"value",
"with",
"suggestion",
"bean",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/MultiAutoCompleteController.js#L453-L462 | train | |
ariatemplates/ariatemplates | src/aria/utils/dragdrop/Drag.js | function (logError) {
var handle = this.handle;
var cursor = this.cursor;
var element;
if (!handle) {
element = this.getElement(logError);
} else {
var typeUtils = ariaUtilsType;
... | javascript | function (logError) {
var handle = this.handle;
var cursor = this.cursor;
var element;
if (!handle) {
element = this.getElement(logError);
} else {
var typeUtils = ariaUtilsType;
... | [
"function",
"(",
"logError",
")",
"{",
"var",
"handle",
"=",
"this",
".",
"handle",
";",
"var",
"cursor",
"=",
"this",
".",
"cursor",
";",
"var",
"element",
";",
"if",
"(",
"!",
"handle",
")",
"{",
"element",
"=",
"this",
".",
"getElement",
"(",
"l... | Get the element from which drag can start. This is the handle if specified or the draggable element
itself otherwise.
@param {Boolean} logError Whether an error should be logged when the draggable element is not found
@return {HTMLElement} | [
"Get",
"the",
"element",
"from",
"which",
"drag",
"can",
"start",
".",
"This",
"is",
"the",
"handle",
"if",
"specified",
"or",
"the",
"draggable",
"element",
"itself",
"otherwise",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/dragdrop/Drag.js#L245-L275 | train | |
ariatemplates/ariatemplates | src/aria/utils/dragdrop/Drag.js | function (logError) {
var element = this.element;
if (!element) {
element = ariaUtilsDom.getElementById(this.id);
if (!element) {
if (logError === true) {
this.$logError(this.INVALID_ATTRIBUTE, [... | javascript | function (logError) {
var element = this.element;
if (!element) {
element = ariaUtilsDom.getElementById(this.id);
if (!element) {
if (logError === true) {
this.$logError(this.INVALID_ATTRIBUTE, [... | [
"function",
"(",
"logError",
")",
"{",
"var",
"element",
"=",
"this",
".",
"element",
";",
"if",
"(",
"!",
"element",
")",
"{",
"element",
"=",
"ariaUtilsDom",
".",
"getElementById",
"(",
"this",
".",
"id",
")",
";",
"if",
"(",
"!",
"element",
")",
... | Get the draggable element. This is the element that should be moved when drag ends.
@param {Boolean} logError Whether an error should be logged when the element is not found
@return {HTMLElement} | [
"Get",
"the",
"draggable",
"element",
".",
"This",
"is",
"the",
"element",
"that",
"should",
"be",
"moved",
"when",
"drag",
"ends",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/dragdrop/Drag.js#L282-L297 | train | |
ariatemplates/ariatemplates | src/aria/utils/dragdrop/Drag.js | function (element) {
var position = ariaUtilsDom.getOffset(element);
this._elementInitialPosition = position;
var style = element.style;
style.position = "absolute";
style.left = position.left + "px";
style.top = position.t... | javascript | function (element) {
var position = ariaUtilsDom.getOffset(element);
this._elementInitialPosition = position;
var style = element.style;
style.position = "absolute";
style.left = position.left + "px";
style.top = position.t... | [
"function",
"(",
"element",
")",
"{",
"var",
"position",
"=",
"ariaUtilsDom",
".",
"getOffset",
"(",
"element",
")",
";",
"this",
".",
"_elementInitialPosition",
"=",
"position",
";",
"var",
"style",
"=",
"element",
".",
"style",
";",
"style",
".",
"positi... | Compute the initial position of the element and set its style properties
@protected
@param {HTMLElement} element | [
"Compute",
"the",
"initial",
"position",
"of",
"the",
"element",
"and",
"set",
"its",
"style",
"properties"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/dragdrop/Drag.js#L304-L313 | train | |
ariatemplates/ariatemplates | src/aria/utils/dragdrop/Drag.js | function (create) {
var proxy = this.proxy;
if (proxy) {
return proxy.overlay;
}
var params = this.params, config = params.proxy;
if (config) {
var classpath = "aria.utils.overlay." + config.type;
... | javascript | function (create) {
var proxy = this.proxy;
if (proxy) {
return proxy.overlay;
}
var params = this.params, config = params.proxy;
if (config) {
var classpath = "aria.utils.overlay." + config.type;
... | [
"function",
"(",
"create",
")",
"{",
"var",
"proxy",
"=",
"this",
".",
"proxy",
";",
"if",
"(",
"proxy",
")",
"{",
"return",
"proxy",
".",
"overlay",
";",
"}",
"var",
"params",
"=",
"this",
".",
"params",
",",
"config",
"=",
"params",
".",
"proxy",... | Get the element that moves on every mouse move. This is the proxy if specified or the draggable element
itself otherwise.
@param {Boolean} create Whether to create or not the proxy as soon as it's class is loaded. Default true
@return {HTMLElement} or undefined if the movable element is not ready yet | [
"Get",
"the",
"element",
"that",
"moves",
"on",
"every",
"mouse",
"move",
".",
"This",
"is",
"the",
"proxy",
"if",
"specified",
"or",
"the",
"draggable",
"element",
"itself",
"otherwise",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/dragdrop/Drag.js#L321-L362 | train | |
ariatemplates/ariatemplates | src/aria/utils/dragdrop/Drag.js | function (coord) {
this.posX = coord.x;
this.posY = coord.y;
this._mouseInitialPosition = {
left : coord.x,
top : coord.y
};
var element = this.getElement(true), domUtil = ariaUtilsDom;
... | javascript | function (coord) {
this.posX = coord.x;
this.posY = coord.y;
this._mouseInitialPosition = {
left : coord.x,
top : coord.y
};
var element = this.getElement(true), domUtil = ariaUtilsDom;
... | [
"function",
"(",
"coord",
")",
"{",
"this",
".",
"posX",
"=",
"coord",
".",
"x",
";",
"this",
".",
"posY",
"=",
"coord",
".",
"y",
";",
"this",
".",
"_mouseInitialPosition",
"=",
"{",
"left",
":",
"coord",
".",
"x",
",",
"top",
":",
"coord",
".",... | Handle the drag start. Initialize some reference geometries and raise the dragstart event
@param {Object} coord Contains the x and y coordinates of the mouse when a drag start has been detected | [
"Handle",
"the",
"drag",
"start",
".",
"Initialize",
"some",
"reference",
"geometries",
"and",
"raise",
"the",
"dragstart",
"event"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/dragdrop/Drag.js#L392-L423 | train | |
ariatemplates/ariatemplates | src/aria/utils/dragdrop/Drag.js | function (evt) {
var movable = this.getMovable();
var domUtil = ariaUtilsDom;
if (movable && movable.style) {
var geometry = ariaUtilsJson.copy(this._movableGeometry);
var mouseInitPos = this._mouseInitialPosition;
... | javascript | function (evt) {
var movable = this.getMovable();
var domUtil = ariaUtilsDom;
if (movable && movable.style) {
var geometry = ariaUtilsJson.copy(this._movableGeometry);
var mouseInitPos = this._mouseInitialPosition;
... | [
"function",
"(",
"evt",
")",
"{",
"var",
"movable",
"=",
"this",
".",
"getMovable",
"(",
")",
";",
"var",
"domUtil",
"=",
"ariaUtilsDom",
";",
"if",
"(",
"movable",
"&&",
"movable",
".",
"style",
")",
"{",
"var",
"geometry",
"=",
"ariaUtilsJson",
".",
... | Handle the mouse move during a drag by setting the correct position on the movable element. Raise the
move event
@param {aria.DomEvent} evt | [
"Handle",
"the",
"mouse",
"move",
"during",
"a",
"drag",
"by",
"setting",
"the",
"correct",
"position",
"on",
"the",
"movable",
"element",
".",
"Raise",
"the",
"move",
"event"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/dragdrop/Drag.js#L430-L460 | train | |
ariatemplates/ariatemplates | src/aria/utils/dragdrop/Drag.js | function () {
var element = this.getElement();
// This is to handle if there is a scroll
element.onselectstart = Aria.returnTrue;
if (this.overlay) {
// remove overlay here
this.overlay.$dispose();
... | javascript | function () {
var element = this.getElement();
// This is to handle if there is a scroll
element.onselectstart = Aria.returnTrue;
if (this.overlay) {
// remove overlay here
this.overlay.$dispose();
... | [
"function",
"(",
")",
"{",
"var",
"element",
"=",
"this",
".",
"getElement",
"(",
")",
";",
"// This is to handle if there is a scroll",
"element",
".",
"onselectstart",
"=",
"Aria",
".",
"returnTrue",
";",
"if",
"(",
"this",
".",
"overlay",
")",
"{",
"// re... | Handle the drag end. Apply the correct positioning to the draggable element | [
"Handle",
"the",
"drag",
"end",
".",
"Apply",
"the",
"correct",
"positioning",
"to",
"the",
"draggable",
"element"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/dragdrop/Drag.js#L465-L484 | train | |
ariatemplates/ariatemplates | src/aria/utils/dragdrop/Drag.js | function () {
var constrainTo = this.params.constrainTo, domUtil = ariaUtilsDom;
if (!constrainTo || constrainTo === domUtil.VIEWPORT) {
this._boundary = constrainTo;
return;
}
if (ariaUtilsType.isString(constrainTo)... | javascript | function () {
var constrainTo = this.params.constrainTo, domUtil = ariaUtilsDom;
if (!constrainTo || constrainTo === domUtil.VIEWPORT) {
this._boundary = constrainTo;
return;
}
if (ariaUtilsType.isString(constrainTo)... | [
"function",
"(",
")",
"{",
"var",
"constrainTo",
"=",
"this",
".",
"params",
".",
"constrainTo",
",",
"domUtil",
"=",
"ariaUtilsDom",
";",
"if",
"(",
"!",
"constrainTo",
"||",
"constrainTo",
"===",
"domUtil",
".",
"VIEWPORT",
")",
"{",
"this",
".",
"_bou... | Compute the geometry of the element to which the draggable element is constrained
@protected | [
"Compute",
"the",
"geometry",
"of",
"the",
"element",
"to",
"which",
"the",
"draggable",
"element",
"is",
"constrained"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/dragdrop/Drag.js#L490-L507 | train | |
ariatemplates/ariatemplates | src/aria/html/Template.js | function (cfg) {
var jsonValidator = ariaCoreJsonValidator;
this._cfgOk = jsonValidator.validateCfg("aria.html.beans.TemplateCfg.Properties", cfg);
if (this._needCreatingModuleCtrl) {
this._cfgOk = this._cfgOk
&& jsonValidator.validateCfg("aria.templa... | javascript | function (cfg) {
var jsonValidator = ariaCoreJsonValidator;
this._cfgOk = jsonValidator.validateCfg("aria.html.beans.TemplateCfg.Properties", cfg);
if (this._needCreatingModuleCtrl) {
this._cfgOk = this._cfgOk
&& jsonValidator.validateCfg("aria.templa... | [
"function",
"(",
"cfg",
")",
"{",
"var",
"jsonValidator",
"=",
"ariaCoreJsonValidator",
";",
"this",
".",
"_cfgOk",
"=",
"jsonValidator",
".",
"validateCfg",
"(",
"\"aria.html.beans.TemplateCfg.Properties\"",
",",
"cfg",
")",
";",
"if",
"(",
"this",
".",
"_needC... | Internal function called before markup generation to check the widget configuration consistency | [
"Internal",
"function",
"called",
"before",
"markup",
"generation",
"to",
"check",
"the",
"widget",
"configuration",
"consistency"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/html/Template.js#L148-L156 | train | |
ariatemplates/ariatemplates | src/aria/widgetLibs/WidgetLib.js | function (widgetName, includeLoaded) {
var classpath = this.widgets[widgetName];
if (classpath == null) {
return null;
}
if (includeLoaded || Aria.getClassRef(classpath) == null) {
return [classpath];
}
return [];
... | javascript | function (widgetName, includeLoaded) {
var classpath = this.widgets[widgetName];
if (classpath == null) {
return null;
}
if (includeLoaded || Aria.getClassRef(classpath) == null) {
return [classpath];
}
return [];
... | [
"function",
"(",
"widgetName",
",",
"includeLoaded",
")",
"{",
"var",
"classpath",
"=",
"this",
".",
"widgets",
"[",
"widgetName",
"]",
";",
"if",
"(",
"classpath",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"includeLoaded",
"||",
"... | Return a list of dependencies which must be loaded before a widget can be used.
@param {String} widgetName the name of the widget - e.g. TextField
@param {Boolean} includeLoaded [optional, default: false] if true, also include dependencies which are
already loaded
@return {Array} array of classpaths which should be loa... | [
"Return",
"a",
"list",
"of",
"dependencies",
"which",
"must",
"be",
"loaded",
"before",
"a",
"widget",
"can",
"be",
"used",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgetLibs/WidgetLib.js#L45-L54 | train | |
ariatemplates/ariatemplates | src/aria/widgetLibs/WidgetLib.js | function (widgetName, out, cfg, lineNbr) {
var classpath = this.widgets[widgetName];
try {
if (classpath) {
// default object if cfg was null
if (!cfg) {
cfg = {};
}
var widget... | javascript | function (widgetName, out, cfg, lineNbr) {
var classpath = this.widgets[widgetName];
try {
if (classpath) {
// default object if cfg was null
if (!cfg) {
cfg = {};
}
var widget... | [
"function",
"(",
"widgetName",
",",
"out",
",",
"cfg",
",",
"lineNbr",
")",
"{",
"var",
"classpath",
"=",
"this",
".",
"widgets",
"[",
"widgetName",
"]",
";",
"try",
"{",
"if",
"(",
"classpath",
")",
"{",
"// default object if cfg was null",
"if",
"(",
"... | Function called by the template engine to process a container widget markup
@param {String} widgetName the name of the widget - e.g. TextField
@param {aria.templates.MarkupWriter} out the output writer
@param {Object} cfg
@param {Number} lineNbr line number of the widget in the template | [
"Function",
"called",
"by",
"the",
"template",
"engine",
"to",
"process",
"a",
"container",
"widget",
"markup"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgetLibs/WidgetLib.js#L94-L118 | train | |
ariatemplates/ariatemplates | src/aria/core/JsonTypesCheck.js | function (baseType, args) {
jv._logError(jv.INVALID_TYPE_VALUE, [baseType.typeName, args.beanDef[jv._MD_TYPENAME], args.value, args.path]);
} | javascript | function (baseType, args) {
jv._logError(jv.INVALID_TYPE_VALUE, [baseType.typeName, args.beanDef[jv._MD_TYPENAME], args.value, args.path]);
} | [
"function",
"(",
"baseType",
",",
"args",
")",
"{",
"jv",
".",
"_logError",
"(",
"jv",
".",
"INVALID_TYPE_VALUE",
",",
"[",
"baseType",
".",
"typeName",
",",
"args",
".",
"beanDef",
"[",
"jv",
".",
"_MD_TYPENAME",
"]",
",",
"args",
".",
"value",
",",
... | Utility function which logs a bad type error.
@private
@param {Object} baseType
@param {Object} args | [
"Utility",
"function",
"which",
"logs",
"a",
"bad",
"type",
"error",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsonTypesCheck.js#L35-L37 | train | |
ariatemplates/ariatemplates | src/aria/core/JsonTypesCheck.js | function (parentType, childType) {
if (!jv._options.checkInheritance) {
return true;
}
var typeRef = childType;
while (!typeRef[jv._MD_BUILTIN]) {
if (parentType == typeRef) {
return true;
}
typeRef = typeRef[jv._MD_PARENTDE... | javascript | function (parentType, childType) {
if (!jv._options.checkInheritance) {
return true;
}
var typeRef = childType;
while (!typeRef[jv._MD_BUILTIN]) {
if (parentType == typeRef) {
return true;
}
typeRef = typeRef[jv._MD_PARENTDE... | [
"function",
"(",
"parentType",
",",
"childType",
")",
"{",
"if",
"(",
"!",
"jv",
".",
"_options",
".",
"checkInheritance",
")",
"{",
"return",
"true",
";",
"}",
"var",
"typeRef",
"=",
"childType",
";",
"while",
"(",
"!",
"typeRef",
"[",
"jv",
".",
"_... | Check that childType inherits from parentType and log any error.
@private | [
"Check",
"that",
"childType",
"inherits",
"from",
"parentType",
"and",
"log",
"any",
"error",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsonTypesCheck.js#L43-L56 | train | |
ariatemplates/ariatemplates | src/aria/core/JsonTypesCheck.js | function (beanDef, beanName, packageDef) {
var contentType = beanDef.$contentType;
var parentContentType = null;
var parent = beanDef[jv._MD_PARENTDEF];
if (!parent[jv._MD_BUILTIN]) {
parentContentType = parent.$contentType;
if (contentType == null) {
... | javascript | function (beanDef, beanName, packageDef) {
var contentType = beanDef.$contentType;
var parentContentType = null;
var parent = beanDef[jv._MD_PARENTDEF];
if (!parent[jv._MD_BUILTIN]) {
parentContentType = parent.$contentType;
if (contentType == null) {
... | [
"function",
"(",
"beanDef",
",",
"beanName",
",",
"packageDef",
")",
"{",
"var",
"contentType",
"=",
"beanDef",
".",
"$contentType",
";",
"var",
"parentContentType",
"=",
"null",
";",
"var",
"parent",
"=",
"beanDef",
"[",
"jv",
".",
"_MD_PARENTDEF",
"]",
"... | Preprocess the content type of the given bean definition
@private
@param {aria.core.BaseTypes:Bean} beanDef bean to be preprocessed
@param {String} beanName fully qualified name for this bean
@param {aria.core.BaseTypes:Package} packageDef reference package | [
"Preprocess",
"the",
"content",
"type",
"of",
"the",
"given",
"bean",
"definition"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsonTypesCheck.js#L65-L84 | train | |
ariatemplates/ariatemplates | src/aria/core/JsonTypesCheck.js | function (beanDef, beanName, packageDef) {
var keyType = beanDef.$keyType;
var parentKeyType = null;
var parent = beanDef[jv._MD_PARENTDEF];
if (!parent[jv._MD_BUILTIN]) {
parentKeyType = parent.$keyType;
if (keyType == null) {
beanDef.$keyType = p... | javascript | function (beanDef, beanName, packageDef) {
var keyType = beanDef.$keyType;
var parentKeyType = null;
var parent = beanDef[jv._MD_PARENTDEF];
if (!parent[jv._MD_BUILTIN]) {
parentKeyType = parent.$keyType;
if (keyType == null) {
beanDef.$keyType = p... | [
"function",
"(",
"beanDef",
",",
"beanName",
",",
"packageDef",
")",
"{",
"var",
"keyType",
"=",
"beanDef",
".",
"$keyType",
";",
"var",
"parentKeyType",
"=",
"null",
";",
"var",
"parent",
"=",
"beanDef",
"[",
"jv",
".",
"_MD_PARENTDEF",
"]",
";",
"if",
... | Preprocess the key type of the given bean definition
@private
@param {aria.core.BaseTypes:Bean} beanDef bean to be preprocessed
@param {String} beanName fully qualified name for this bean
@param {aria.core.BaseTypes:Package} packageDef reference package | [
"Preprocess",
"the",
"key",
"type",
"of",
"the",
"given",
"bean",
"definition"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsonTypesCheck.js#L93-L116 | train | |
ariatemplates/ariatemplates | src/aria/core/JsonTypesCheck.js | function (args) {
if (typeof(args.value) != 'string') {
return __badTypeError(this, args); // this refers to the correct object (a base type)
}
var beanDef = args.beanDef;
while (!beanDef[jv._MD_BUILTIN]) {
var regexp = beanDef.$regExp;
if (regexp != n... | javascript | function (args) {
if (typeof(args.value) != 'string') {
return __badTypeError(this, args); // this refers to the correct object (a base type)
}
var beanDef = args.beanDef;
while (!beanDef[jv._MD_BUILTIN]) {
var regexp = beanDef.$regExp;
if (regexp != n... | [
"function",
"(",
"args",
")",
"{",
"if",
"(",
"typeof",
"(",
"args",
".",
"value",
")",
"!=",
"'string'",
")",
"{",
"return",
"__badTypeError",
"(",
"this",
",",
"args",
")",
";",
"// this refers to the correct object (a base type)",
"}",
"var",
"beanDef",
"... | Processing function for regular expressions
@private | [
"Processing",
"function",
"for",
"regular",
"expressions"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsonTypesCheck.js#L122-L136 | train | |
ariatemplates/ariatemplates | src/aria/core/JsonTypesCheck.js | function (beanDef) {
var parent = beanDef[jv._MD_PARENTDEF];
if (typeof(parent.$minValue) != "undefined") {
if (typeof(beanDef.$minValue) == "undefined") {
beanDef.$minValue = parent.$minValue;
} else if (beanDef.$minValue < parent.$minValue) {
jv.... | javascript | function (beanDef) {
var parent = beanDef[jv._MD_PARENTDEF];
if (typeof(parent.$minValue) != "undefined") {
if (typeof(beanDef.$minValue) == "undefined") {
beanDef.$minValue = parent.$minValue;
} else if (beanDef.$minValue < parent.$minValue) {
jv.... | [
"function",
"(",
"beanDef",
")",
"{",
"var",
"parent",
"=",
"beanDef",
"[",
"jv",
".",
"_MD_PARENTDEF",
"]",
";",
"if",
"(",
"typeof",
"(",
"parent",
".",
"$minValue",
")",
"!=",
"\"undefined\"",
")",
"{",
"if",
"(",
"typeof",
"(",
"beanDef",
".",
"$... | Common preprocessing function for floats and integers.
@private
@param {aria.core.BaseTypes:Bean} beanDef | [
"Common",
"preprocessing",
"function",
"for",
"floats",
"and",
"integers",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsonTypesCheck.js#L143-L163 | train | |
ariatemplates/ariatemplates | src/aria/core/JsonTypesCheck.js | function (args) {
var v = args.value;
var beanDef = args.beanDef;
if (typeof(v) != 'number') {
return __badTypeError(this, args);
}
if (typeof(beanDef.$minValue) != "undefined" && v < beanDef.$minValue) {
return jv._logError(jv.NUMBER_RANGE, [args.value, a... | javascript | function (args) {
var v = args.value;
var beanDef = args.beanDef;
if (typeof(v) != 'number') {
return __badTypeError(this, args);
}
if (typeof(beanDef.$minValue) != "undefined" && v < beanDef.$minValue) {
return jv._logError(jv.NUMBER_RANGE, [args.value, a... | [
"function",
"(",
"args",
")",
"{",
"var",
"v",
"=",
"args",
".",
"value",
";",
"var",
"beanDef",
"=",
"args",
".",
"beanDef",
";",
"if",
"(",
"typeof",
"(",
"v",
")",
"!=",
"'number'",
")",
"{",
"return",
"__badTypeError",
"(",
"this",
",",
"args",... | Common processing function for floats and integers.
@private
@param {Object} args | [
"Common",
"processing",
"function",
"for",
"floats",
"and",
"integers",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsonTypesCheck.js#L170-L182 | train | |
ariatemplates/ariatemplates | src/aria/tools/ToolsModule.js | function (args, cb) {
this.bridge = args.bridge;
// add bridge to submodules init parameters
for (var i = 0, l = this.subModulesList.length; i < l; i++) {
if (!this.subModulesList[i].initArgs) {
this.subModulesList[i].initArgs = {};
... | javascript | function (args, cb) {
this.bridge = args.bridge;
// add bridge to submodules init parameters
for (var i = 0, l = this.subModulesList.length; i < l; i++) {
if (!this.subModulesList[i].initArgs) {
this.subModulesList[i].initArgs = {};
... | [
"function",
"(",
"args",
",",
"cb",
")",
"{",
"this",
".",
"bridge",
"=",
"args",
".",
"bridge",
";",
"// add bridge to submodules init parameters",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"l",
"=",
"this",
".",
"subModulesList",
".",
"length",
";",
"i",
... | Module initialization method
@param {Object} initArgs init argument expected to contain a single property "bridge" giving a reference to
the main window Bridge object.
@param {aria.core.CfgBeans:Callback} cb callback called when the initialization is finished | [
"Module",
"initialization",
"method"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/tools/ToolsModule.js#L63-L81 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/MultiSelectController.js | function (options, textFieldValue) {
var selectedOptions = [];
var trim = ariaUtilsString.trim;
var inSplit = textFieldValue.split(this._separator);
if (inSplit) {
for (var i = 0, inSplitLen = aria.utils.Math.min(inSplit.length, this._maxOptions); i < in... | javascript | function (options, textFieldValue) {
var selectedOptions = [];
var trim = ariaUtilsString.trim;
var inSplit = textFieldValue.split(this._separator);
if (inSplit) {
for (var i = 0, inSplitLen = aria.utils.Math.min(inSplit.length, this._maxOptions); i < in... | [
"function",
"(",
"options",
",",
"textFieldValue",
")",
"{",
"var",
"selectedOptions",
"=",
"[",
"]",
";",
"var",
"trim",
"=",
"ariaUtilsString",
".",
"trim",
";",
"var",
"inSplit",
"=",
"textFieldValue",
".",
"split",
"(",
"this",
".",
"_separator",
")",
... | Parse value inserted in the datefield to deduce selected objects
@protected
@param {Array} options
@param {String} textFieldValue
@return {Array} | [
"Parse",
"value",
"inserted",
"in",
"the",
"datefield",
"to",
"deduce",
"selected",
"objects"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/MultiSelectController.js#L175-L200 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/MultiSelectController.js | function (selectedValues) {
var toDisplay = this._fieldDisplay, options = this._dataModel.listContent;
var backUp = (this._fieldDisplay == 'value') ? 'label' : 'value';
var display = [], option;
for (var i = 0, l = selectedValues.length; i < l; i++) {
opt... | javascript | function (selectedValues) {
var toDisplay = this._fieldDisplay, options = this._dataModel.listContent;
var backUp = (this._fieldDisplay == 'value') ? 'label' : 'value';
var display = [], option;
for (var i = 0, l = selectedValues.length; i < l; i++) {
opt... | [
"function",
"(",
"selectedValues",
")",
"{",
"var",
"toDisplay",
"=",
"this",
".",
"_fieldDisplay",
",",
"options",
"=",
"this",
".",
"_dataModel",
".",
"listContent",
";",
"var",
"backUp",
"=",
"(",
"this",
".",
"_fieldDisplay",
"==",
"'value'",
")",
"?",... | Adds or remove items from the display value. If I am adding an item I also check that it wasn't already added
previously so there will be no duplicate items displayed.
@param {Array} selectedValues
@return {String} | [
"Adds",
"or",
"remove",
"items",
"from",
"the",
"display",
"value",
".",
"If",
"I",
"am",
"adding",
"an",
"item",
"I",
"also",
"check",
"that",
"it",
"wasn",
"t",
"already",
"added",
"previously",
"so",
"there",
"will",
"be",
"no",
"duplicate",
"items",
... | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/MultiSelectController.js#L208-L223 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/MultiSelectController.js | function (value) {
var report = new ariaWidgetsControllersReportsDropDownControllerReport();
var dataModel = this._dataModel;
if (value === null) {
report.ok = true;
dataModel.value = null;
dataModel.text = '';
} else {
... | javascript | function (value) {
var report = new ariaWidgetsControllersReportsDropDownControllerReport();
var dataModel = this._dataModel;
if (value === null) {
report.ok = true;
dataModel.value = null;
dataModel.text = '';
} else {
... | [
"function",
"(",
"value",
")",
"{",
"var",
"report",
"=",
"new",
"ariaWidgetsControllersReportsDropDownControllerReport",
"(",
")",
";",
"var",
"dataModel",
"=",
"this",
".",
"_dataModel",
";",
"if",
"(",
"value",
"===",
"null",
")",
"{",
"report",
".",
"ok"... | override DropDownListController.checkValue
@param {String} value
@return {aria.widgets.controllers.reports.DropDownControllerReport} | [
"override",
"DropDownListController",
".",
"checkValue"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/MultiSelectController.js#L230-L259 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/MultiSelectController.js | function (str) {
var dataModel = this._dataModel, options = dataModel.listContent, selectedValues;
// retrieve selection from string
selectedValues = this._parseInputString(options, str);
if (!ariaUtilsJson.equals(selectedValues, dataModel.value)) {
ar... | javascript | function (str) {
var dataModel = this._dataModel, options = dataModel.listContent, selectedValues;
// retrieve selection from string
selectedValues = this._parseInputString(options, str);
if (!ariaUtilsJson.equals(selectedValues, dataModel.value)) {
ar... | [
"function",
"(",
"str",
")",
"{",
"var",
"dataModel",
"=",
"this",
".",
"_dataModel",
",",
"options",
"=",
"dataModel",
".",
"listContent",
",",
"selectedValues",
";",
"// retrieve selection from string",
"selectedValues",
"=",
"this",
".",
"_parseInputString",
"(... | override DropDownController.checkText
@param {String} str
@return {aria.widgets.controllers.reports.DropDownControllerReport} | [
"override",
"DropDownController",
".",
"checkText"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/MultiSelectController.js#L266-L286 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/MultiSelectController.js | function () {
var options = this._dataModel.listContent, value;
for (var i = 0, len = options.length; i < len; i++) {
value = options[i].value + "";
if (value.indexOf(this._separator) != -1) {
this.$logError(this.INVALID_MULTISELECT_CONTENT);
... | javascript | function () {
var options = this._dataModel.listContent, value;
for (var i = 0, len = options.length; i < len; i++) {
value = options[i].value + "";
if (value.indexOf(this._separator) != -1) {
this.$logError(this.INVALID_MULTISELECT_CONTENT);
... | [
"function",
"(",
")",
"{",
"var",
"options",
"=",
"this",
".",
"_dataModel",
".",
"listContent",
",",
"value",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"options",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"va... | Log the Error when option value contains field separator logged message | [
"Log",
"the",
"Error",
"when",
"option",
"value",
"contains",
"field",
"separator",
"logged",
"message"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/MultiSelectController.js#L291-L301 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/MultiSelectController.js | function (text, value) {
var cachedValue = this._cacheValues[text];
if (cachedValue) {
return cachedValue;
}
this._cacheValues[text] = value;
return value;
} | javascript | function (text, value) {
var cachedValue = this._cacheValues[text];
if (cachedValue) {
return cachedValue;
}
this._cacheValues[text] = value;
return value;
} | [
"function",
"(",
"text",
",",
"value",
")",
"{",
"var",
"cachedValue",
"=",
"this",
".",
"_cacheValues",
"[",
"text",
"]",
";",
"if",
"(",
"cachedValue",
")",
"{",
"return",
"cachedValue",
";",
"}",
"this",
".",
"_cacheValues",
"[",
"text",
"]",
"=",
... | Return the value for given text in input and value
@protected
@param {String} text
@param {Object} value
@return {Object} | [
"Return",
"the",
"value",
"for",
"given",
"text",
"in",
"input",
"and",
"value"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/MultiSelectController.js#L333-L340 | train | |
ariatemplates/ariatemplates | src/aria/utils/Profiling.js | function (firstStart) {
this._startTime = (firstStart) ? Aria._start : new Date();
if (firstStart) {
this._logs = [{
classpath : "Aria",
msg : "Framework initialization",
start : Aria._start
... | javascript | function (firstStart) {
this._startTime = (firstStart) ? Aria._start : new Date();
if (firstStart) {
this._logs = [{
classpath : "Aria",
msg : "Framework initialization",
start : Aria._start
... | [
"function",
"(",
"firstStart",
")",
"{",
"this",
".",
"_startTime",
"=",
"(",
"firstStart",
")",
"?",
"Aria",
".",
"_start",
":",
"new",
"Date",
"(",
")",
";",
"if",
"(",
"firstStart",
")",
"{",
"this",
".",
"_logs",
"=",
"[",
"{",
"classpath",
":"... | Reinitialize the profiling
@param {Boolean} firstStart | [
"Reinitialize",
"the",
"profiling"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Profiling.js#L100-L130 | train | |
ariatemplates/ariatemplates | src/aria/utils/Profiling.js | function () {
this._logsPerClasspath = {};
var i, j, iLog, jLog, max, end;
max = 0;
for (i = 0; i < this._nbLogs; i++) {
iLog = this._logs[i];
if (iLog.start && !("length" in iLog)) {
for (j = i + 1; j < this._nbLogs; j+... | javascript | function () {
this._logsPerClasspath = {};
var i, j, iLog, jLog, max, end;
max = 0;
for (i = 0; i < this._nbLogs; i++) {
iLog = this._logs[i];
if (iLog.start && !("length" in iLog)) {
for (j = i + 1; j < this._nbLogs; j+... | [
"function",
"(",
")",
"{",
"this",
".",
"_logsPerClasspath",
"=",
"{",
"}",
";",
"var",
"i",
",",
"j",
",",
"iLog",
",",
"jLog",
",",
"max",
",",
"end",
";",
"max",
"=",
"0",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"_nbL... | Process measures to associate starts and stops, sort by classpath | [
"Process",
"measures",
"to",
"associate",
"starts",
"and",
"stops",
"sort",
"by",
"classpath"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Profiling.js#L135-L186 | train | |
ariatemplates/ariatemplates | src/aria/utils/Profiling.js | function (div) {
if (this._displayDiv != null) {
return;
}
this.process();
var document = Aria.$window.document;
this._displayDiv = document.createElement('div');
this._displayDiv.style.cssText = "position:absolute;top:0px;left:0... | javascript | function (div) {
if (this._displayDiv != null) {
return;
}
this.process();
var document = Aria.$window.document;
this._displayDiv = document.createElement('div');
this._displayDiv.style.cssText = "position:absolute;top:0px;left:0... | [
"function",
"(",
"div",
")",
"{",
"if",
"(",
"this",
".",
"_displayDiv",
"!=",
"null",
")",
"{",
"return",
";",
"}",
"this",
".",
"process",
"(",
")",
";",
"var",
"document",
"=",
"Aria",
".",
"$window",
".",
"document",
";",
"this",
".",
"_display... | Show an alert containing profiling data and then clears corresponding data.
@param {HTMLElement} div | [
"Show",
"an",
"alert",
"containing",
"profiling",
"data",
"and",
"then",
"clears",
"corresponding",
"data",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Profiling.js#L192-L211 | train | |
ariatemplates/ariatemplates | src/aria/utils/Profiling.js | function () {
this._displayDiv.innerHTML = '';
if (this._displayDiv != null) {
aria.utils.Dom.removeElement(this._displayDiv);
}
this._displayDiv = null;
} | javascript | function () {
this._displayDiv.innerHTML = '';
if (this._displayDiv != null) {
aria.utils.Dom.removeElement(this._displayDiv);
}
this._displayDiv = null;
} | [
"function",
"(",
")",
"{",
"this",
".",
"_displayDiv",
".",
"innerHTML",
"=",
"''",
";",
"if",
"(",
"this",
".",
"_displayDiv",
"!=",
"null",
")",
"{",
"aria",
".",
"utils",
".",
"Dom",
".",
"removeElement",
"(",
"this",
".",
"_displayDiv",
")",
";",... | Hide profiling display | [
"Hide",
"profiling",
"display"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Profiling.js#L216-L222 | train | |
ariatemplates/ariatemplates | src/aria/utils/Profiling.js | function (classpath, msg) {
this._logs[this._nbLogs++] = {
classpath : classpath,
msg : msg,
timestamp : (new Date()).getTime()
};
} | javascript | function (classpath, msg) {
this._logs[this._nbLogs++] = {
classpath : classpath,
msg : msg,
timestamp : (new Date()).getTime()
};
} | [
"function",
"(",
"classpath",
",",
"msg",
")",
"{",
"this",
".",
"_logs",
"[",
"this",
".",
"_nbLogs",
"++",
"]",
"=",
"{",
"classpath",
":",
"classpath",
",",
"msg",
":",
"msg",
",",
"timestamp",
":",
"(",
"new",
"Date",
"(",
")",
")",
".",
"get... | Log a message with a time stamp
@param {String} classpath
@param {String} msg | [
"Log",
"a",
"message",
"with",
"a",
"time",
"stamp"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Profiling.js#L229-L235 | train | |
ariatemplates/ariatemplates | src/aria/utils/Profiling.js | function (classpath, msg) {
this._logs[this._nbLogs++] = {
classpath : classpath,
msg : msg,
id : this._ids,
start : (new Date()).getTime()
};
return this._ids++;
} | javascript | function (classpath, msg) {
this._logs[this._nbLogs++] = {
classpath : classpath,
msg : msg,
id : this._ids,
start : (new Date()).getTime()
};
return this._ids++;
} | [
"function",
"(",
"classpath",
",",
"msg",
")",
"{",
"this",
".",
"_logs",
"[",
"this",
".",
"_nbLogs",
"++",
"]",
"=",
"{",
"classpath",
":",
"classpath",
",",
"msg",
":",
"msg",
",",
"id",
":",
"this",
".",
"_ids",
",",
"start",
":",
"(",
"new",... | Starts a time measure. Returns the id used to stop the measure.
@param {String} classpath
@param {String} msg
@return {Number} profilingId | [
"Starts",
"a",
"time",
"measure",
".",
"Returns",
"the",
"id",
"used",
"to",
"stop",
"the",
"measure",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Profiling.js#L243-L251 | train | |
ariatemplates/ariatemplates | src/aria/utils/Profiling.js | function (classpath, id) {
this._logs[this._nbLogs++] = {
classpath : classpath,
id : id,
stop : (new Date()).getTime()
};
} | javascript | function (classpath, id) {
this._logs[this._nbLogs++] = {
classpath : classpath,
id : id,
stop : (new Date()).getTime()
};
} | [
"function",
"(",
"classpath",
",",
"id",
")",
"{",
"this",
".",
"_logs",
"[",
"this",
".",
"_nbLogs",
"++",
"]",
"=",
"{",
"classpath",
":",
"classpath",
",",
"id",
":",
"id",
",",
"stop",
":",
"(",
"new",
"Date",
"(",
")",
")",
".",
"getTime",
... | Stops a time measure. If the id is not specified, stop the last measure with this classpath.
@param {String} classpath
@param {String} id | [
"Stops",
"a",
"time",
"measure",
".",
"If",
"the",
"id",
"is",
"not",
"specified",
"stop",
"the",
"last",
"measure",
"with",
"this",
"classpath",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Profiling.js#L258-L264 | train | |
ariatemplates/ariatemplates | src/aria/utils/Profiling.js | function (name, step) {
if (this._counters.hasOwnProperty(name)) {
this._counters[name] += (step || 1);
} else {
this._counters[name] = (step || 1);
}
} | javascript | function (name, step) {
if (this._counters.hasOwnProperty(name)) {
this._counters[name] += (step || 1);
} else {
this._counters[name] = (step || 1);
}
} | [
"function",
"(",
"name",
",",
"step",
")",
"{",
"if",
"(",
"this",
".",
"_counters",
".",
"hasOwnProperty",
"(",
"name",
")",
")",
"{",
"this",
".",
"_counters",
"[",
"name",
"]",
"+=",
"(",
"step",
"||",
"1",
")",
";",
"}",
"else",
"{",
"this",
... | Increment a counter with a given name by an arbitrary value.
@param {String} name Name of the counter
@param {Number} step Value to be added, Default 1 | [
"Increment",
"a",
"counter",
"with",
"a",
"given",
"name",
"by",
"an",
"arbitrary",
"value",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Profiling.js#L271-L277 | train | |
ariatemplates/ariatemplates | src/aria/utils/Profiling.js | function (name, reason) {
if (!this._counters[name]) {
return;
}
if (!this._counterSplits[name]) {
this._counterSplits[name] = [];
}
this._counterSplits[name].push({
value : this._counters[name],
... | javascript | function (name, reason) {
if (!this._counters[name]) {
return;
}
if (!this._counterSplits[name]) {
this._counterSplits[name] = [];
}
this._counterSplits[name].push({
value : this._counters[name],
... | [
"function",
"(",
"name",
",",
"reason",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_counters",
"[",
"name",
"]",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"this",
".",
"_counterSplits",
"[",
"name",
"]",
")",
"{",
"this",
".",
"_counterSplits",
... | Reset a counter with a given name to 0. The last value is saved as a split.
@param {String} name Name of the counter
@param {String} reason Additional information on the split, it is useful for computing averages | [
"Reset",
"a",
"counter",
"with",
"a",
"given",
"name",
"to",
"0",
".",
"The",
"last",
"value",
"is",
"saved",
"as",
"a",
"split",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Profiling.js#L284-L299 | train | |
ariatemplates/ariatemplates | src/aria/utils/Profiling.js | function (name, reason) {
if (!this._counterSplits[name]) {
return 0;
}
var total = 0;
for (var i = 0, len = this._counterSplits[name].length; i < len; i += 1) {
total += this._counterSplits[name][i].value;
}
retur... | javascript | function (name, reason) {
if (!this._counterSplits[name]) {
return 0;
}
var total = 0;
for (var i = 0, len = this._counterSplits[name].length; i < len; i += 1) {
total += this._counterSplits[name][i].value;
}
retur... | [
"function",
"(",
"name",
",",
"reason",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_counterSplits",
"[",
"name",
"]",
")",
"{",
"return",
"0",
";",
"}",
"var",
"total",
"=",
"0",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"this",
".... | Get the average value of the splits on a given counter. The current value of the counter is not taken into
account. If needed call a resetCounter before this method
@param {String} name Name of the counter
@param {String} reason Filter only the splits with this reason value
@return {Number} | [
"Get",
"the",
"average",
"value",
"of",
"the",
"splits",
"on",
"a",
"given",
"counter",
".",
"The",
"current",
"value",
"of",
"the",
"counter",
"is",
"not",
"taken",
"into",
"account",
".",
"If",
"needed",
"call",
"a",
"resetCounter",
"before",
"this",
"... | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Profiling.js#L317-L328 | train | |
ariatemplates/ariatemplates | src/aria/utils/Xml.js | function (str) {
var xmlDoc;
var DOMParser = Aria.$global.DOMParser;
if (DOMParser) {
var parser = new DOMParser();
xmlDoc = parser.parseFromString(str, "text/xml");
} else { // Internet Explorer
var ActiveXObject = Aria.$gl... | javascript | function (str) {
var xmlDoc;
var DOMParser = Aria.$global.DOMParser;
if (DOMParser) {
var parser = new DOMParser();
xmlDoc = parser.parseFromString(str, "text/xml");
} else { // Internet Explorer
var ActiveXObject = Aria.$gl... | [
"function",
"(",
"str",
")",
"{",
"var",
"xmlDoc",
";",
"var",
"DOMParser",
"=",
"Aria",
".",
"$global",
".",
"DOMParser",
";",
"if",
"(",
"DOMParser",
")",
"{",
"var",
"parser",
"=",
"new",
"DOMParser",
"(",
")",
";",
"xmlDoc",
"=",
"parser",
".",
... | Performs a lossy conversion of a Xml string to a Json object Node atrributes are omitted in the parsing
process
@param {String} str The content of the Xml document
@return {Object} Json represantation of the Xml content | [
"Performs",
"a",
"lossy",
"conversion",
"of",
"a",
"Xml",
"string",
"to",
"a",
"Json",
"object",
"Node",
"atrributes",
"are",
"omitted",
"in",
"the",
"parsing",
"process"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Xml.js#L34-L52 | train | |
ariatemplates/ariatemplates | src/aria/utils/Xml.js | function (xmlNode) {
if (!xmlNode) {
return;
}
var node = {};
for (var i = 0; i < xmlNode.childNodes.length; i++) {
var currNode = xmlNode.childNodes[i];
// if it's a text node or a CDATA section use the nodeValue directly
... | javascript | function (xmlNode) {
if (!xmlNode) {
return;
}
var node = {};
for (var i = 0; i < xmlNode.childNodes.length; i++) {
var currNode = xmlNode.childNodes[i];
// if it's a text node or a CDATA section use the nodeValue directly
... | [
"function",
"(",
"xmlNode",
")",
"{",
"if",
"(",
"!",
"xmlNode",
")",
"{",
"return",
";",
"}",
"var",
"node",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"xmlNode",
".",
"childNodes",
".",
"length",
";",
"i",
"++",
")... | Internal method used for parsing the nodes of a xml document
@param {XmlNode} xmlNode Xml node to be parsed
@return {Object} Json object representing a xml node | [
"Internal",
"method",
"used",
"for",
"parsing",
"the",
"nodes",
"of",
"a",
"xml",
"document"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Xml.js#L69-L103 | train | |
ariatemplates/ariatemplates | src/aria/utils/overlay/LoadingOverlay.js | function (element, overlayId, options) {
// ------------------------------------------ input arguments processing
if (options == null) {
options = {};
}
if (ariaUtilsType.isString(options)) {
options = {message: options};
}
var waiAria = options... | javascript | function (element, overlayId, options) {
// ------------------------------------------ input arguments processing
if (options == null) {
options = {};
}
if (ariaUtilsType.isString(options)) {
options = {message: options};
}
var waiAria = options... | [
"function",
"(",
"element",
",",
"overlayId",
",",
"options",
")",
"{",
"// ------------------------------------------ input arguments processing",
"if",
"(",
"options",
"==",
"null",
")",
"{",
"options",
"=",
"{",
"}",
";",
"}",
"if",
"(",
"ariaUtilsType",
".",
... | Creates a loading overlay above a DOM Element.
<p>The options object contains the following properties: </p>
<ul>
<li><em>message</em>: the message to display</li>
<li><em>waiAria</em>: forwarded to the parent constructor</li>
<li><em>waiAriaReadInterval</em>: when waiAria is activated, the interval (in milliseconds) ... | [
"Creates",
"a",
"loading",
"overlay",
"above",
"a",
"DOM",
"Element",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/overlay/LoadingOverlay.js#L49-L98 | train | |
ariatemplates/ariatemplates | src/aria/utils/Html.js | function (attributes) {
var result = [], whiteList = ariaTemplatesDomElementWrapper.attributesWhiteList;
var jsonUtils = ariaUtilsJson;
/*
* This assumes that white list is performed by config validation, but this is only available in debug mode :
* FIXME!
... | javascript | function (attributes) {
var result = [], whiteList = ariaTemplatesDomElementWrapper.attributesWhiteList;
var jsonUtils = ariaUtilsJson;
/*
* This assumes that white list is performed by config validation, but this is only available in debug mode :
* FIXME!
... | [
"function",
"(",
"attributes",
")",
"{",
"var",
"result",
"=",
"[",
"]",
",",
"whiteList",
"=",
"ariaTemplatesDomElementWrapper",
".",
"attributesWhiteList",
";",
"var",
"jsonUtils",
"=",
"ariaUtilsJson",
";",
"/*\n * This assumes that white list is performed ... | Build the HTML markup regarding the attributes provided.
@param {aria.templates.CfgBeans:HtmlAttribute} attributes Attributes to be parsed
@return {String} String which can be used directly in a html tag | [
"Build",
"the",
"HTML",
"markup",
"regarding",
"the",
"attributes",
"provided",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Html.js#L39-L86 | train | |
ariatemplates/ariatemplates | src/aria/utils/Html.js | function (form) {
var elements = form.elements, params = [], element, name, value;
for (var i = 0, len = elements.length; i < len; i++) {
element = elements[i];
if (this._isSerializable(element)) {
name = encodeURIComponent(element.name);
... | javascript | function (form) {
var elements = form.elements, params = [], element, name, value;
for (var i = 0, len = elements.length; i < len; i++) {
element = elements[i];
if (this._isSerializable(element)) {
name = encodeURIComponent(element.name);
... | [
"function",
"(",
"form",
")",
"{",
"var",
"elements",
"=",
"form",
".",
"elements",
",",
"params",
"=",
"[",
"]",
",",
"element",
",",
"name",
",",
"value",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"elements",
".",
"length",
";",
... | Turn an HTML form element into a string that contains the list of name-value pairs of all relevant elements
of the form. For example, the following form
<pre>
<form id="myForm">
<input type="text" name="firstname" value="Colin">
<input type="text" name=&... | [
"Turn",
"an",
"HTML",
"form",
"element",
"into",
"a",
"string",
"that",
"contains",
"the",
"list",
"of",
"name",
"-",
"value",
"pairs",
"of",
"all",
"relevant",
"elements",
"of",
"the",
"form",
".",
"For",
"example",
"the",
"following",
"form"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Html.js#L115-L126 | train | |
ariatemplates/ariatemplates | src/aria/utils/Html.js | function (element) {
var submittable = /^(?:input|select|textarea|keygen)/i;
var submitterTypes = /^(?:submit|button|image|reset|file)$/i;
var type = element.type;
var checkableTypes = /^(?:checkbox|radio)$/i;
return element.name && !element.disabled && submi... | javascript | function (element) {
var submittable = /^(?:input|select|textarea|keygen)/i;
var submitterTypes = /^(?:submit|button|image|reset|file)$/i;
var type = element.type;
var checkableTypes = /^(?:checkbox|radio)$/i;
return element.name && !element.disabled && submi... | [
"function",
"(",
"element",
")",
"{",
"var",
"submittable",
"=",
"/",
"^(?:input|select|textarea|keygen)",
"/",
"i",
";",
"var",
"submitterTypes",
"=",
"/",
"^(?:submit|button|image|reset|file)$",
"/",
"i",
";",
"var",
"type",
"=",
"element",
".",
"type",
";",
... | Return true if the HTML element is serializable in a form. Serializable elements are input, select, textarea,
keygen, which have a name attribute, a certain type, and are not disabled
@param {HTMLElement} element
@return {Boolean} | [
"Return",
"true",
"if",
"the",
"HTML",
"element",
"is",
"serializable",
"in",
"a",
"form",
".",
"Serializable",
"elements",
"are",
"input",
"select",
"textarea",
"keygen",
"which",
"have",
"a",
"name",
"attribute",
"a",
"certain",
"type",
"and",
"are",
"not"... | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Html.js#L134-L142 | train | |
ariatemplates/ariatemplates | src/aria/utils/Html.js | function (domElement, dataset, remove) {
var fullKey, stringUtil = ariaUtilsString;
for (var dataKey in dataset) {
if (dataset.hasOwnProperty(dataKey) && !ariaUtilsJson.isMetadata(dataKey)) {
if (this.datasetRegex.test(dataKey)) {
fullK... | javascript | function (domElement, dataset, remove) {
var fullKey, stringUtil = ariaUtilsString;
for (var dataKey in dataset) {
if (dataset.hasOwnProperty(dataKey) && !ariaUtilsJson.isMetadata(dataKey)) {
if (this.datasetRegex.test(dataKey)) {
fullK... | [
"function",
"(",
"domElement",
",",
"dataset",
",",
"remove",
")",
"{",
"var",
"fullKey",
",",
"stringUtil",
"=",
"ariaUtilsString",
";",
"for",
"(",
"var",
"dataKey",
"in",
"dataset",
")",
"{",
"if",
"(",
"dataset",
".",
"hasOwnProperty",
"(",
"dataKey",
... | Set or remove "data-" attributes
@param {HTMLElement} domElement
@param {Object} dataset
@param {Boolean} remove if false or undefined, attributes will be set instead | [
"Set",
"or",
"remove",
"data",
"-",
"attributes"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Html.js#L168-L184 | train | |
ariatemplates/ariatemplates | src/aria/widgets/form/TextInput.js | function () {
if (this._simpleHTML) {
return this._skinObj.states[this._state].color;
}
if (this._isIE7OrLess) {
// As "inherit" does not work in this case in IE7, we are obliged to read the property from
// the frame state and apply it... | javascript | function () {
if (this._simpleHTML) {
return this._skinObj.states[this._state].color;
}
if (this._isIE7OrLess) {
// As "inherit" does not work in this case in IE7, we are obliged to read the property from
// the frame state and apply it... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_simpleHTML",
")",
"{",
"return",
"this",
".",
"_skinObj",
".",
"states",
"[",
"this",
".",
"_state",
"]",
".",
"color",
";",
"}",
"if",
"(",
"this",
".",
"_isIE7OrLess",
")",
"{",
"// As \"inherit\... | Get the color to be set on the text field for the current state, if the helptext is not enabled.
@protected | [
"Get",
"the",
"color",
"to",
"be",
"set",
"on",
"the",
"text",
"field",
"for",
"the",
"current",
"state",
"if",
"the",
"helptext",
"is",
"not",
"enabled",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/form/TextInput.js#L203-L214 | train | |
ariatemplates/ariatemplates | src/aria/widgets/form/TextInput.js | function () {
var cfg = this._cfg;
// invalid text and value shouldn't be set at the same time
var text = cfg.invalidText || "";
if (text && cfg.value) {
// There's both a value and an invalid text, prefer the value
this.setProperty("inva... | javascript | function () {
var cfg = this._cfg;
// invalid text and value shouldn't be set at the same time
var text = cfg.invalidText || "";
if (text && cfg.value) {
// There's both a value and an invalid text, prefer the value
this.setProperty("inva... | [
"function",
"(",
")",
"{",
"var",
"cfg",
"=",
"this",
".",
"_cfg",
";",
"// invalid text and value shouldn't be set at the same time",
"var",
"text",
"=",
"cfg",
".",
"invalidText",
"||",
"\"\"",
";",
"if",
"(",
"text",
"&&",
"cfg",
".",
"value",
")",
"{",
... | Get the text value of the input field. If available it tries to use the internal valid value, otherwise uses
the invalid text. If none of them is a non empty string it return the prefilled value. This method doesn't
handle helptext, as this value is not just text but also style.
@return {String} | [
"Get",
"the",
"text",
"value",
"of",
"the",
"input",
"field",
".",
"If",
"available",
"it",
"tries",
"to",
"use",
"the",
"internal",
"valid",
"value",
"otherwise",
"uses",
"the",
"invalid",
"text",
".",
"If",
"none",
"of",
"them",
"is",
"a",
"non",
"em... | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/form/TextInput.js#L239-L270 | train | |
ariatemplates/ariatemplates | src/aria/widgets/form/TextInput.js | function (value) {
if (value == null) {
value = this._getText();
}
// _getText only handles valid / invalid values and prefills, not the helptext
if (!value && !this._isPassword) {
// We don't want to handle helptext in password fields, fi... | javascript | function (value) {
if (value == null) {
value = this._getText();
}
// _getText only handles valid / invalid values and prefills, not the helptext
if (!value && !this._isPassword) {
// We don't want to handle helptext in password fields, fi... | [
"function",
"(",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"value",
"=",
"this",
".",
"_getText",
"(",
")",
";",
"}",
"// _getText only handles valid / invalid values and prefills, not the helptext",
"if",
"(",
"!",
"value",
"&&",
"!",
"th... | Set a given text as value for the text input. This method handles helptext for non password fields.
@param {String} value Text to be set, if empty uses the value from <code>this._getText</code> or the
helptext | [
"Set",
"a",
"given",
"text",
"as",
"value",
"for",
"the",
"text",
"input",
".",
"This",
"method",
"handles",
"helptext",
"for",
"non",
"password",
"fields",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/form/TextInput.js#L277-L291 | train | |
ariatemplates/ariatemplates | src/aria/widgets/form/TextInput.js | function (event) {
if (this._keepFocus || this._hasFocus) {
this._reactToControllerReport(event.report, event.arg);
} else if (event.report) {
event.report.$dispose();
}
} | javascript | function (event) {
if (this._keepFocus || this._hasFocus) {
this._reactToControllerReport(event.report, event.arg);
} else if (event.report) {
event.report.$dispose();
}
} | [
"function",
"(",
"event",
")",
"{",
"if",
"(",
"this",
".",
"_keepFocus",
"||",
"this",
".",
"_hasFocus",
")",
"{",
"this",
".",
"_reactToControllerReport",
"(",
"event",
".",
"report",
",",
"event",
".",
"arg",
")",
";",
"}",
"else",
"if",
"(",
"eve... | Callback for asynchronous controller reporting
@param {Object} event controller onCheck event
@protected | [
"Callback",
"for",
"asynchronous",
"controller",
"reporting"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/form/TextInput.js#L520-L526 | train | |
ariatemplates/ariatemplates | src/aria/widgets/form/TextInput.js | function (report, arg) {
var hasChange = false, cfg = this._cfg;
if (report) {
var resetErrorIfOK = true;
var hasFocus = this._hasFocus;
var stopValueProp = false;
var delayedValidation = false;
if (arg) {
... | javascript | function (report, arg) {
var hasChange = false, cfg = this._cfg;
if (report) {
var resetErrorIfOK = true;
var hasFocus = this._hasFocus;
var stopValueProp = false;
var delayedValidation = false;
if (arg) {
... | [
"function",
"(",
"report",
",",
"arg",
")",
"{",
"var",
"hasChange",
"=",
"false",
",",
"cfg",
"=",
"this",
".",
"_cfg",
";",
"if",
"(",
"report",
")",
"{",
"var",
"resetErrorIfOK",
"=",
"true",
";",
"var",
"hasFocus",
"=",
"this",
".",
"_hasFocus",
... | React to a Controller report. The widget's controller generates a report on the internal status of the
widget. This function reads the report and sets some properties of the widget. It also reacts to changes in
the internal datamodel.
@param {aria.widgets.controllers.reports.ControllerReport} report
@param {Object} arg... | [
"React",
"to",
"a",
"Controller",
"report",
".",
"The",
"widget",
"s",
"controller",
"generates",
"a",
"report",
"on",
"the",
"internal",
"status",
"of",
"the",
"widget",
".",
"This",
"function",
"reads",
"the",
"report",
"and",
"sets",
"some",
"properties",... | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/form/TextInput.js#L536-L629 | train | |
ariatemplates/ariatemplates | src/aria/widgets/form/TextInput.js | function (event) {
if (this._cfg.validationDelay) {
if (this._valTimer) {
ariaCoreTimer.cancelCallback(this._valTimer);
}
this._valTimer = ariaCoreTimer.addCallback({
fn : this.checkValue,
scope : th... | javascript | function (event) {
if (this._cfg.validationDelay) {
if (this._valTimer) {
ariaCoreTimer.cancelCallback(this._valTimer);
}
this._valTimer = ariaCoreTimer.addCallback({
fn : this.checkValue,
scope : th... | [
"function",
"(",
"event",
")",
"{",
"if",
"(",
"this",
".",
"_cfg",
".",
"validationDelay",
")",
"{",
"if",
"(",
"this",
".",
"_valTimer",
")",
"{",
"ariaCoreTimer",
".",
"cancelCallback",
"(",
"this",
".",
"_valTimer",
")",
";",
"}",
"this",
".",
"_... | Internal method to handle the onkeyup event. This is called to set the value property in the data model
through the setProperty method that also handles all other widgets bound to this value.
@protected | [
"Internal",
"method",
"to",
"handle",
"the",
"onkeyup",
"event",
".",
"This",
"is",
"called",
"to",
"set",
"the",
"value",
"property",
"in",
"the",
"data",
"model",
"through",
"the",
"setProperty",
"method",
"that",
"also",
"handles",
"all",
"other",
"widget... | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/form/TextInput.js#L921-L936 | train | |
ariatemplates/ariatemplates | src/aria/widgets/form/TextInput.js | function (domEvent) {
if (!!this._cfg.onclick) {
var domEvtWrapper;
if (domEvent) {
domEvtWrapper = new ariaTemplatesDomEventWrapper(domEvent);
}
this.evalCallback(this._cfg.onclick, domEvtWrapper);
if (domEv... | javascript | function (domEvent) {
if (!!this._cfg.onclick) {
var domEvtWrapper;
if (domEvent) {
domEvtWrapper = new ariaTemplatesDomEventWrapper(domEvent);
}
this.evalCallback(this._cfg.onclick, domEvtWrapper);
if (domEv... | [
"function",
"(",
"domEvent",
")",
"{",
"if",
"(",
"!",
"!",
"this",
".",
"_cfg",
".",
"onclick",
")",
"{",
"var",
"domEvtWrapper",
";",
"if",
"(",
"domEvent",
")",
"{",
"domEvtWrapper",
"=",
"new",
"ariaTemplatesDomEventWrapper",
"(",
"domEvent",
")",
";... | DOM callback function called when the widget has been clicked on. The onclick handles the selection of a text
input widget if the autoselect property has been set to true.
@protected | [
"DOM",
"callback",
"function",
"called",
"when",
"the",
"widget",
"has",
"been",
"clicked",
"on",
".",
"The",
"onclick",
"handles",
"the",
"selection",
"of",
"a",
"text",
"input",
"widget",
"if",
"the",
"autoselect",
"property",
"has",
"been",
"set",
"to",
... | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/form/TextInput.js#L943-L954 | train | |
ariatemplates/ariatemplates | src/aria/widgets/form/TextInput.js | function (event, avoidCallback) {
this._hasFocus = true;
if (!this._keepFocus) {
var cfg = this._cfg;
if (cfg.readOnly) {
return;
}
this.setHelpText(false);
if (this._isPrefilled) {
... | javascript | function (event, avoidCallback) {
this._hasFocus = true;
if (!this._keepFocus) {
var cfg = this._cfg;
if (cfg.readOnly) {
return;
}
this.setHelpText(false);
if (this._isPrefilled) {
... | [
"function",
"(",
"event",
",",
"avoidCallback",
")",
"{",
"this",
".",
"_hasFocus",
"=",
"true",
";",
"if",
"(",
"!",
"this",
".",
"_keepFocus",
")",
"{",
"var",
"cfg",
"=",
"this",
".",
"_cfg",
";",
"if",
"(",
"cfg",
".",
"readOnly",
")",
"{",
"... | DOM callback function called when the focus is put on the input. The onFocus event is available on the input
that sits inside a span. In this function, we change the background on the parent span node, and also the
second span that has the end of the input.
@param {aria.DomEvent} event Focus event
@protected | [
"DOM",
"callback",
"function",
"called",
"when",
"the",
"focus",
"is",
"put",
"on",
"the",
"input",
".",
"The",
"onFocus",
"event",
"is",
"available",
"on",
"the",
"input",
"that",
"sits",
"inside",
"a",
"span",
".",
"In",
"this",
"function",
"we",
"chan... | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/form/TextInput.js#L963-L1011 | train | |
ariatemplates/ariatemplates | src/aria/widgets/form/TextInput.js | function (event, avoidCallback) {
if (!this._hasFocus) {
return;
}
if (!this._keepFocus) {
var cfg = this._cfg; // , htc = this._skinObj.helpText;
this._hasFocus = false;
// reinitialize for next time (autoselect feature... | javascript | function (event, avoidCallback) {
if (!this._hasFocus) {
return;
}
if (!this._keepFocus) {
var cfg = this._cfg; // , htc = this._skinObj.helpText;
this._hasFocus = false;
// reinitialize for next time (autoselect feature... | [
"function",
"(",
"event",
",",
"avoidCallback",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_hasFocus",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"this",
".",
"_keepFocus",
")",
"{",
"var",
"cfg",
"=",
"this",
".",
"_cfg",
";",
"// , htc = this._skin... | DOM callback function called when the focus is taken off the input. The onBlur event is available on the
input that sits inside a span. In this function, we change the background on the parent span node, and also
the second span that has the end of the input.
@param {aria.DomEvent} event Blur event
@protected | [
"DOM",
"callback",
"function",
"called",
"when",
"the",
"focus",
"is",
"taken",
"off",
"the",
"input",
".",
"The",
"onBlur",
"event",
"is",
"available",
"on",
"the",
"input",
"that",
"sits",
"inside",
"a",
"span",
".",
"In",
"this",
"function",
"we",
"ch... | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/form/TextInput.js#L1020-L1083 | train | |
ariatemplates/ariatemplates | src/aria/widgets/form/TextInput.js | function (enable) {
var cfg = this._cfg;
// check for disposal
if (!cfg) {
return;
}
var helpText = cfg.helptext, helpTextConfig = this._skinObj.helpText;
// stops if no helptext, or trying to disable an helptext that as
... | javascript | function (enable) {
var cfg = this._cfg;
// check for disposal
if (!cfg) {
return;
}
var helpText = cfg.helptext, helpTextConfig = this._skinObj.helpText;
// stops if no helptext, or trying to disable an helptext that as
... | [
"function",
"(",
"enable",
")",
"{",
"var",
"cfg",
"=",
"this",
".",
"_cfg",
";",
"// check for disposal",
"if",
"(",
"!",
"cfg",
")",
"{",
"return",
";",
"}",
"var",
"helpText",
"=",
"cfg",
".",
"helptext",
",",
"helpTextConfig",
"=",
"this",
".",
"... | Set the helptext of the field if needed
@param {Boolean} enable Whether to enable it or not | [
"Set",
"the",
"helptext",
"of",
"the",
"field",
"if",
"needed"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/form/TextInput.js#L1194-L1238 | train | |
ariatemplates/ariatemplates | src/aria/widgets/form/TextInput.js | function (enable, value, updateState) {
var cfg = this._cfg, prefillText;
// check for disposal
if (!cfg) {
return;
}
var field = this.getTextInputField();
if (enable) {
if (!field || (field.value && !this._helpTextS... | javascript | function (enable, value, updateState) {
var cfg = this._cfg, prefillText;
// check for disposal
if (!cfg) {
return;
}
var field = this.getTextInputField();
if (enable) {
if (!field || (field.value && !this._helpTextS... | [
"function",
"(",
"enable",
",",
"value",
",",
"updateState",
")",
"{",
"var",
"cfg",
"=",
"this",
".",
"_cfg",
",",
"prefillText",
";",
"// check for disposal",
"if",
"(",
"!",
"cfg",
")",
"{",
"return",
";",
"}",
"var",
"field",
"=",
"this",
".",
"g... | Set the prefill text of the field if needed
@param {Boolean} enable false if you want to leave the prefill state
@param {String|Array} value optional string (or array for the multiselect) to fill the field with
@param {Boolean} updateState if true a state update is triggered at the end | [
"Set",
"the",
"prefill",
"text",
"of",
"the",
"field",
"if",
"needed"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/form/TextInput.js#L1246-L1287 | train | |
ariatemplates/ariatemplates | src/aria/widgets/form/TextInput.js | function (idArray, fromSelf) {
if (this._cfg.disabled) {
return false;
}
var textInputField = this.getTextInputField();
textInputField.focus();
// IE FIX: requires the value to be reset for the cursor to be positioned
// and focused... | javascript | function (idArray, fromSelf) {
if (this._cfg.disabled) {
return false;
}
var textInputField = this.getTextInputField();
textInputField.focus();
// IE FIX: requires the value to be reset for the cursor to be positioned
// and focused... | [
"function",
"(",
"idArray",
",",
"fromSelf",
")",
"{",
"if",
"(",
"this",
".",
"_cfg",
".",
"disabled",
")",
"{",
"return",
"false",
";",
"}",
"var",
"textInputField",
"=",
"this",
".",
"getTextInputField",
"(",
")",
";",
"textInputField",
".",
"focus",
... | Focus this field
@param {Array} idArray Path of ids on which we should give focus. Should be empty
@param {Boolean} fromSelf Whether the focus is coming from the widget itself. In this case we don't try to
autoselect
@return {Boolean} true if focus was possible
@override | [
"Focus",
"this",
"field"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/form/TextInput.js#L1297-L1309 | train | |
ariatemplates/ariatemplates | src/aria/widgets/form/TextInput.js | function () {
// this._cfg can be null due to the following execution chain: native focus -> native blur -> AutoComplete
// bound value update in the data model -> bindRefreshTo section refresh
if (this._firstFocus && this._cfg && this._cfg.autoselect) {
// this allow... | javascript | function () {
// this._cfg can be null due to the following execution chain: native focus -> native blur -> AutoComplete
// bound value update in the data model -> bindRefreshTo section refresh
if (this._firstFocus && this._cfg && this._cfg.autoselect) {
// this allow... | [
"function",
"(",
")",
"{",
"// this._cfg can be null due to the following execution chain: native focus -> native blur -> AutoComplete",
"// bound value update in the data model -> bindRefreshTo section refresh",
"if",
"(",
"this",
".",
"_firstFocus",
"&&",
"this",
".",
"_cfg",
"&&",
... | If enabled, autoselect the widget text, setting the caret position to the whole input value.
@protected | [
"If",
"enabled",
"autoselect",
"the",
"widget",
"text",
"setting",
"the",
"caret",
"position",
"to",
"the",
"whole",
"input",
"value",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/form/TextInput.js#L1315-L1328 | train | |
ariatemplates/ariatemplates | src/aria/templates/ClassWriter.js | function (processStatement, processErrors) {
/**
* Callback used to process a single statement in the content
* @type aria.core.CfgBeans:Callback
* @protected
*/
this._processStatement = processStatement;
/**
* Callback used to process errors
... | javascript | function (processStatement, processErrors) {
/**
* Callback used to process a single statement in the content
* @type aria.core.CfgBeans:Callback
* @protected
*/
this._processStatement = processStatement;
/**
* Callback used to process errors
... | [
"function",
"(",
"processStatement",
",",
"processErrors",
")",
"{",
"/**\n * Callback used to process a single statement in the content\n * @type aria.core.CfgBeans:Callback\n * @protected\n */",
"this",
".",
"_processStatement",
"=",
"processStatement",
";... | Create a Class Writer instance
@param {aria.core.CfgBeans:Callback} processStatement Callback used to process a single statement in the content
@param {aria.core.CfgBeans:Callback} processErrors Callback used to process errors. Can be omitted for default
error processing (appending errors to the errors array) | [
"Create",
"a",
"Class",
"Writer",
"instance"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/templates/ClassWriter.js#L29-L228 | train | |
ariatemplates/ariatemplates | src/aria/templates/ClassWriter.js | function (dependencies, extension) {
if (dependencies) {
for (var i = dependencies.length - 1; i >= 0; i--) {
this.addDependency(dependencies[i], extension);
}
}
} | javascript | function (dependencies, extension) {
if (dependencies) {
for (var i = dependencies.length - 1; i >= 0; i--) {
this.addDependency(dependencies[i], extension);
}
}
} | [
"function",
"(",
"dependencies",
",",
"extension",
")",
"{",
"if",
"(",
"dependencies",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"dependencies",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"this",
".",
"addDependency",
"("... | Add a list of classpath dependencies
@param {Array} dependencies list of classpath
@param {String} extension dependencies extension (default: ".js") | [
"Add",
"a",
"list",
"of",
"classpath",
"dependencies"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/templates/ClassWriter.js#L235-L241 | train | |
ariatemplates/ariatemplates | src/aria/templates/ClassWriter.js | function (macroName) {
var res = this.macros[macroName];
if (res == null) {
res = {};
this.macros[macroName] = res;
}
return res;
} | javascript | function (macroName) {
var res = this.macros[macroName];
if (res == null) {
res = {};
this.macros[macroName] = res;
}
return res;
} | [
"function",
"(",
"macroName",
")",
"{",
"var",
"res",
"=",
"this",
".",
"macros",
"[",
"macroName",
"]",
";",
"if",
"(",
"res",
"==",
"null",
")",
"{",
"res",
"=",
"{",
"}",
";",
"this",
".",
"macros",
"[",
"macroName",
"]",
"=",
"res",
";",
"}... | Get a macro description
@param {String} macroName Name of the macro
@return {Object} | [
"Get",
"a",
"macro",
"description"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/templates/ClassWriter.js#L269-L276 | train | |
ariatemplates/ariatemplates | src/aria/templates/ClassWriter.js | function (viewBaseName) {
var res = this.views[viewBaseName];
if (res == null) {
res = {
baseName: viewBaseName
};
this.views[viewBaseName] = res;
}
return res;
} | javascript | function (viewBaseName) {
var res = this.views[viewBaseName];
if (res == null) {
res = {
baseName: viewBaseName
};
this.views[viewBaseName] = res;
}
return res;
} | [
"function",
"(",
"viewBaseName",
")",
"{",
"var",
"res",
"=",
"this",
".",
"views",
"[",
"viewBaseName",
"]",
";",
"if",
"(",
"res",
"==",
"null",
")",
"{",
"res",
"=",
"{",
"baseName",
":",
"viewBaseName",
"}",
";",
"this",
".",
"views",
"[",
"vie... | Get a view description
@param {String} viewBaseName Name of the view
@return {Object} | [
"Get",
"a",
"view",
"description"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/templates/ClassWriter.js#L283-L292 | train | |
ariatemplates/ariatemplates | src/aria/templates/ClassWriter.js | function (statement, msgId, msgArgs) {
if (this._processErrors) {
this.errors = true;
this._processErrors.fn.call(this._processErrors.scope, statement, msgId, msgArgs, this.errorContext);
} else {
if (!msgArgs) {
msgArgs = [];
... | javascript | function (statement, msgId, msgArgs) {
if (this._processErrors) {
this.errors = true;
this._processErrors.fn.call(this._processErrors.scope, statement, msgId, msgArgs, this.errorContext);
} else {
if (!msgArgs) {
msgArgs = [];
... | [
"function",
"(",
"statement",
",",
"msgId",
",",
"msgArgs",
")",
"{",
"if",
"(",
"this",
".",
"_processErrors",
")",
"{",
"this",
".",
"errors",
"=",
"true",
";",
"this",
".",
"_processErrors",
".",
"fn",
".",
"call",
"(",
"this",
".",
"_processErrors"... | Log an error calling the error callback defined in the constructor.
@param {aria.templates.TreeBeans:Statement} statement Statement generating the error
@param {String} msgId Message to be logged
@param {Array} msgArgs List of error parameters as in jsObject.$logError | [
"Log",
"an",
"error",
"calling",
"the",
"error",
"callback",
"defined",
"in",
"the",
"constructor",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/templates/ClassWriter.js#L395-L414 | train | |
ariatemplates/ariatemplates | src/aria/templates/ClassWriter.js | function () {
var out = this._curblock.out;
if (this._curindent) {
out.push(this._curindent);
}
out.push.apply(out, arguments);
out.push('\n');
} | javascript | function () {
var out = this._curblock.out;
if (this._curindent) {
out.push(this._curindent);
}
out.push.apply(out, arguments);
out.push('\n');
} | [
"function",
"(",
")",
"{",
"var",
"out",
"=",
"this",
".",
"_curblock",
".",
"out",
";",
"if",
"(",
"this",
".",
"_curindent",
")",
"{",
"out",
".",
"push",
"(",
"this",
".",
"_curindent",
")",
";",
"}",
"out",
".",
"push",
".",
"apply",
"(",
"... | Write a line in the current output block. The line is built concatenating all arguments and appending a new
line character.
@param {String} One or more string to be written | [
"Write",
"a",
"line",
"in",
"the",
"current",
"output",
"block",
".",
"The",
"line",
"is",
"built",
"concatenating",
"all",
"arguments",
"and",
"appending",
"a",
"new",
"line",
"character",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/templates/ClassWriter.js#L455-L462 | train | |
ariatemplates/ariatemplates | src/aria/templates/ClassWriter.js | function (exprStr, statement, errorMsg) {
var container = this.newVarName();
// stringify the expression for the eval
exprStr = this.stringify(exprStr);
this.writeln("var " + container + " = null;");
this.writeln("try {");
this.increaseIndent();
... | javascript | function (exprStr, statement, errorMsg) {
var container = this.newVarName();
// stringify the expression for the eval
exprStr = this.stringify(exprStr);
this.writeln("var " + container + " = null;");
this.writeln("try {");
this.increaseIndent();
... | [
"function",
"(",
"exprStr",
",",
"statement",
",",
"errorMsg",
")",
"{",
"var",
"container",
"=",
"this",
".",
"newVarName",
"(",
")",
";",
"// stringify the expression for the eval",
"exprStr",
"=",
"this",
".",
"stringify",
"(",
"exprStr",
")",
";",
"this",
... | Wrap an expression evaluation in a try catch and return result
@param {String} exprStr String to be eval'ed
@param {aria.templates.TreeBeans:Statement} statement Statement corresponding to the expression
@param {String} errorMsg Message to be logged in case of errors
@return {String} container the name of the variable ... | [
"Wrap",
"an",
"expression",
"evaluation",
"in",
"a",
"try",
"catch",
"and",
"return",
"result"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/templates/ClassWriter.js#L480-L500 | train | |
ariatemplates/ariatemplates | src/aria/templates/ClassWriter.js | function () {
this.parseOnly = true;
// disables functions which are only useful to generate code:
var empty = Aria.empty;
this.writeDependencies = empty;
this.newVarName = empty;
this.writeln = empty;
this.write = empty;
th... | javascript | function () {
this.parseOnly = true;
// disables functions which are only useful to generate code:
var empty = Aria.empty;
this.writeDependencies = empty;
this.newVarName = empty;
this.writeln = empty;
this.write = empty;
th... | [
"function",
"(",
")",
"{",
"this",
".",
"parseOnly",
"=",
"true",
";",
"// disables functions which are only useful to generate code:",
"var",
"empty",
"=",
"Aria",
".",
"empty",
";",
"this",
".",
"writeDependencies",
"=",
"empty",
";",
"this",
".",
"newVarName",
... | Set the parseOnly flag to true and disables functions which are only useful for class generation. | [
"Set",
"the",
"parseOnly",
"flag",
"to",
"true",
"and",
"disables",
"functions",
"which",
"are",
"only",
"useful",
"for",
"class",
"generation",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/templates/ClassWriter.js#L515-L525 | train | |
ariatemplates/ariatemplates | src/aria/utils/String.js | function (string) {
var params = Array.prototype.slice.call(arguments, 1);
params = ariaUtilsArray.flattenDeep(params);
string = string.replace(/%[0-9]+/g, function (token) {
var replacement = params[parseInt(token.substring(1), 10) - 1];
return typeo... | javascript | function (string) {
var params = Array.prototype.slice.call(arguments, 1);
params = ariaUtilsArray.flattenDeep(params);
string = string.replace(/%[0-9]+/g, function (token) {
var replacement = params[parseInt(token.substring(1), 10) - 1];
return typeo... | [
"function",
"(",
"string",
")",
"{",
"var",
"params",
"=",
"Array",
".",
"prototype",
".",
"slice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
";",
"params",
"=",
"ariaUtilsArray",
".",
"flattenDeep",
"(",
"params",
")",
";",
"string",
"=",
"string"... | Substitute %n parameters in a string
@param {String} string The source string to substitute %n occurrences in
@param {Array|String} ...params All the remaining parameters, that can form from one simple string to deeply nested arrays of strings, will be resolved to a single list of strings. These strings will be used fo... | [
"Substitute",
"%n",
"parameters",
"in",
"a",
"string"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/String.js#L33-L43 | train | |
ariatemplates/ariatemplates | src/aria/utils/String.js | function (str, index) {
var res = false;
for (var i = index - 1; i >= 0; i--) {
if (str.charAt(i) == "\\") {
res = !res;
} else {
return res;
}
}
return res;
} | javascript | function (str, index) {
var res = false;
for (var i = index - 1; i >= 0; i--) {
if (str.charAt(i) == "\\") {
res = !res;
} else {
return res;
}
}
return res;
} | [
"function",
"(",
"str",
",",
"index",
")",
"{",
"var",
"res",
"=",
"false",
";",
"for",
"(",
"var",
"i",
"=",
"index",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"if",
"(",
"str",
".",
"charAt",
"(",
"i",
")",
"==",
"\"\\\\\""... | Return true if the character at index in str is escaped with backslashes.
@param {String} str
@param {Integer} index
@return {Boolean} true if the character is escaped, false otherwise | [
"Return",
"true",
"if",
"the",
"character",
"at",
"index",
"in",
"str",
"is",
"escaped",
"with",
"backslashes",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/String.js#L60-L70 | train | |
ariatemplates/ariatemplates | src/aria/utils/String.js | function (str, findChar, start) {
var index = str.indexOf(findChar, start);
while (index != -1) {
if (!this.isEscaped(str, index)) {
return index;
}
// continue search after escaped character
index = str.indexOf(... | javascript | function (str, findChar, start) {
var index = str.indexOf(findChar, start);
while (index != -1) {
if (!this.isEscaped(str, index)) {
return index;
}
// continue search after escaped character
index = str.indexOf(... | [
"function",
"(",
"str",
",",
"findChar",
",",
"start",
")",
"{",
"var",
"index",
"=",
"str",
".",
"indexOf",
"(",
"findChar",
",",
"start",
")",
";",
"while",
"(",
"index",
"!=",
"-",
"1",
")",
"{",
"if",
"(",
"!",
"this",
".",
"isEscaped",
"(",
... | Find the next not escaped character findChar, after start in str.
@param {String} str
@param {String} findChar character to find in str
@param {Integer} start position in str (default value: 0) | [
"Find",
"the",
"next",
"not",
"escaped",
"character",
"findChar",
"after",
"start",
"in",
"str",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/String.js#L78-L88 | train | |
ariatemplates/ariatemplates | src/aria/utils/String.js | function (str, options, infos) {
// -------------------------------------- input arguments processing
// options ---------------------------------------------------------
if (options == null) {
options = true;
}
if (!ariaUtilsType.isObject(o... | javascript | function (str, options, infos) {
// -------------------------------------- input arguments processing
// options ---------------------------------------------------------
if (options == null) {
options = true;
}
if (!ariaUtilsType.isObject(o... | [
"function",
"(",
"str",
",",
"options",
",",
"infos",
")",
"{",
"// -------------------------------------- input arguments processing",
"// options ---------------------------------------------------------",
"if",
"(",
"options",
"==",
"null",
")",
"{",
"options",
"=",
"true"... | Escape the given string depending on the options. When no options is passed, the escaping is applied for all contexts.
The string can be escaped for different contexts:
<ul>
<li>safe insertion inside an HTML text node</li>
<li>safe insertion inside an attribute value</li>
</ul>
@param {String} str Input string
@pa... | [
"Escape",
"the",
"given",
"string",
"depending",
"on",
"the",
"options",
".",
"When",
"no",
"options",
"is",
"passed",
"the",
"escaping",
"is",
"applied",
"for",
"all",
"contexts",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/String.js#L139-L186 | train | |
ariatemplates/ariatemplates | src/aria/utils/String.js | function (str, start, end, regexp) {
var currentCharPos = start, whiteRegexp = regexp || /\s/, currentChar;
while (currentCharPos < end) {
currentChar = str.charAt(currentCharPos);
if (whiteRegexp.test(currentChar)) {
return currentCharPos;
... | javascript | function (str, start, end, regexp) {
var currentCharPos = start, whiteRegexp = regexp || /\s/, currentChar;
while (currentCharPos < end) {
currentChar = str.charAt(currentCharPos);
if (whiteRegexp.test(currentChar)) {
return currentCharPos;
... | [
"function",
"(",
"str",
",",
"start",
",",
"end",
",",
"regexp",
")",
"{",
"var",
"currentCharPos",
"=",
"start",
",",
"whiteRegexp",
"=",
"regexp",
"||",
"/",
"\\s",
"/",
",",
"currentChar",
";",
"while",
"(",
"currentCharPos",
"<",
"end",
")",
"{",
... | Find next white space in the given string after start position and before end position
@param {String} str The string into which we search
@param {Integer} start The position in str at which we should begin the search (included)
@param {Integer} end The position in str at which we should end the search (excluded)
@para... | [
"Find",
"next",
"white",
"space",
"in",
"the",
"given",
"string",
"after",
"start",
"position",
"and",
"before",
"end",
"position"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/String.js#L211-L221 | train | |
ariatemplates/ariatemplates | src/aria/utils/String.js | function (string, size, character, begin) {
string = "" + string;
var length = string.length;
if (length < size) {
var padding = [];
for (var difference = size - length; difference > 0; difference -= 1) {
padding.push(character);
... | javascript | function (string, size, character, begin) {
string = "" + string;
var length = string.length;
if (length < size) {
var padding = [];
for (var difference = size - length; difference > 0; difference -= 1) {
padding.push(character);
... | [
"function",
"(",
"string",
",",
"size",
",",
"character",
",",
"begin",
")",
"{",
"string",
"=",
"\"\"",
"+",
"string",
";",
"var",
"length",
"=",
"string",
".",
"length",
";",
"if",
"(",
"length",
"<",
"size",
")",
"{",
"var",
"padding",
"=",
"[",... | Add some padding to a string in order to have a minimu length. If the minimum length is smaller than the
string length, nothing is done.
@param {String} string The string that requires padding
@param {Number} size Minimum length
@param {String} character Character to add.
@param {Boolean} begin Add character at the beg... | [
"Add",
"some",
"padding",
"to",
"a",
"string",
"in",
"order",
"to",
"have",
"a",
"minimu",
"length",
".",
"If",
"the",
"minimum",
"length",
"is",
"smaller",
"than",
"the",
"string",
"length",
"nothing",
"is",
"done",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/String.js#L271-L287 | train | |
ariatemplates/ariatemplates | src/aria/utils/String.js | function (string, size, character, begin) {
var start, length;
if (begin === true) {
for (start = 0, length = string.length - size; start < length; start += 1) {
if (string.charAt(start) !== character) {
break;
}
... | javascript | function (string, size, character, begin) {
var start, length;
if (begin === true) {
for (start = 0, length = string.length - size; start < length; start += 1) {
if (string.charAt(start) !== character) {
break;
}
... | [
"function",
"(",
"string",
",",
"size",
",",
"character",
",",
"begin",
")",
"{",
"var",
"start",
",",
"length",
";",
"if",
"(",
"begin",
"===",
"true",
")",
"{",
"for",
"(",
"start",
"=",
"0",
",",
"length",
"=",
"string",
".",
"length",
"-",
"s... | Remove all consecutive occurrences of a character from the beginning or end of a string. It's like trim but
instead of removing white spaces removes the specified character. Unlike trim it works on one direction only.
@param {String} string String to be cropped
@param {Number} size Minimum size of the resulting string
... | [
"Remove",
"all",
"consecutive",
"occurrences",
"of",
"a",
"character",
"from",
"the",
"beginning",
"or",
"end",
"of",
"a",
"string",
".",
"It",
"s",
"like",
"trim",
"but",
"instead",
"of",
"removing",
"white",
"spaces",
"removes",
"the",
"specified",
"charac... | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/String.js#L298-L317 | train | |
ariatemplates/ariatemplates | src/aria/utils/Number.js | function (number, patternString, formatSymbols) {
formatSymbols = this._normalizeSymbols(formatSymbols);
var patternDescription = this._explode(patternString);
if (!patternDescription) {
return this.$logError(this.INVALID_FORMAT, ["formatCurrency", this.CURRENCY_BEAN... | javascript | function (number, patternString, formatSymbols) {
formatSymbols = this._normalizeSymbols(formatSymbols);
var patternDescription = this._explode(patternString);
if (!patternDescription) {
return this.$logError(this.INVALID_FORMAT, ["formatCurrency", this.CURRENCY_BEAN... | [
"function",
"(",
"number",
",",
"patternString",
",",
"formatSymbols",
")",
"{",
"formatSymbols",
"=",
"this",
".",
"_normalizeSymbols",
"(",
"formatSymbols",
")",
";",
"var",
"patternDescription",
"=",
"this",
".",
"_explode",
"(",
"patternString",
")",
";",
... | Take the formatted number from formatNumber and apply currency specific formatting, such as the currency
symbol
@param {Number} number The number you want to format
@param {String} patternString the pattern to be used
@param {aria.utils.environment.NumberCfgBeans:DecimalFormatSymbols} formatSymbols Optional custom form... | [
"Take",
"the",
"formatted",
"number",
"from",
"formatNumber",
"and",
"apply",
"currency",
"specific",
"formatting",
"such",
"as",
"the",
"currency",
"symbol"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Number.js#L338-L356 | 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.