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/modules/RequestMgr.js | function (requestPath, params) {
if (!params || params.length === 0) {
// Nothing to do if there are no parameters
return requestPath;
}
// Flatten the array of global parameters
var flat = [];
for (var i = 0, len = params.leng... | javascript | function (requestPath, params) {
if (!params || params.length === 0) {
// Nothing to do if there are no parameters
return requestPath;
}
// Flatten the array of global parameters
var flat = [];
for (var i = 0, len = params.leng... | [
"function",
"(",
"requestPath",
",",
"params",
")",
"{",
"if",
"(",
"!",
"params",
"||",
"params",
".",
"length",
"===",
"0",
")",
"{",
"// Nothing to do if there are no parameters",
"return",
"requestPath",
";",
"}",
"// Flatten the array of global parameters",
"va... | Append the global parameters to a url request path. Global parameters are objects with properties name and
value
@param {String} requestPath The base requestPath
@param {Array} params List of parameters (added through addParam)
@return {String} the final requestPath
@private | [
"Append",
"the",
"global",
"parameters",
"to",
"a",
"url",
"request",
"path",
".",
"Global",
"parameters",
"are",
"objects",
"with",
"properties",
"name",
"and",
"value"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/modules/RequestMgr.js#L692-L715 | train | |
ariatemplates/ariatemplates | src/aria/modules/RequestMgr.js | function (requestPath, params) {
requestPath = requestPath || "";
if (!params) {
// Nothing to do if there are no parameters
return requestPath;
}
var idx = requestPath.indexOf('?');
/*
* Just in case we want to c... | javascript | function (requestPath, params) {
requestPath = requestPath || "";
if (!params) {
// Nothing to do if there are no parameters
return requestPath;
}
var idx = requestPath.indexOf('?');
/*
* Just in case we want to c... | [
"function",
"(",
"requestPath",
",",
"params",
")",
"{",
"requestPath",
"=",
"requestPath",
"||",
"\"\"",
";",
"if",
"(",
"!",
"params",
")",
"{",
"// Nothing to do if there are no parameters",
"return",
"requestPath",
";",
"}",
"var",
"idx",
"=",
"requestPath",... | Append the action parameters to a url request path. Action parameters are strings
@param {String} requestPath The base requestPath
@param {String} params String with the parameters
@return {String} the final requestPath
@private | [
"Append",
"the",
"action",
"parameters",
"to",
"a",
"url",
"request",
"path",
".",
"Action",
"parameters",
"are",
"strings"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/modules/RequestMgr.js#L724-L746 | train | |
ariatemplates/ariatemplates | src/aria/modules/RequestMgr.js | function (actionName) {
actionName = actionName || "";
var idx = actionName.indexOf("?");
var object = {
name : "",
params : ""
};
if (idx < 0) {
object.name = actionName;
} else {
o... | javascript | function (actionName) {
actionName = actionName || "";
var idx = actionName.indexOf("?");
var object = {
name : "",
params : ""
};
if (idx < 0) {
object.name = actionName;
} else {
o... | [
"function",
"(",
"actionName",
")",
"{",
"actionName",
"=",
"actionName",
"||",
"\"\"",
";",
"var",
"idx",
"=",
"actionName",
".",
"indexOf",
"(",
"\"?\"",
")",
";",
"var",
"object",
"=",
"{",
"name",
":",
"\"\"",
",",
"params",
":",
"\"\"",
"}",
";"... | Given an action name extract the request parameters after a question mark
@param {String} actionName Action name i.e. "action?par1=2"
@return {Object} properties "name" and "params"
@private | [
"Given",
"an",
"action",
"name",
"extract",
"the",
"request",
"parameters",
"after",
"a",
"question",
"mark"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/modules/RequestMgr.js#L754-L773 | train | |
ariatemplates/ariatemplates | src/aria/modules/RequestMgr.js | function () {
if (!this._urlService) {
var cfg = ariaModulesUrlServiceEnvironmentUrlService.getUrlServiceCfg(), actionUrlPattern = cfg.args[0], i18nUrlPattern = cfg.args[1];
var ClassRef = Aria.getClassRef(cfg.implementation);
this._urlService = new (ClassRef)... | javascript | function () {
if (!this._urlService) {
var cfg = ariaModulesUrlServiceEnvironmentUrlService.getUrlServiceCfg(), actionUrlPattern = cfg.args[0], i18nUrlPattern = cfg.args[1];
var ClassRef = Aria.getClassRef(cfg.implementation);
this._urlService = new (ClassRef)... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_urlService",
")",
"{",
"var",
"cfg",
"=",
"ariaModulesUrlServiceEnvironmentUrlService",
".",
"getUrlServiceCfg",
"(",
")",
",",
"actionUrlPattern",
"=",
"cfg",
".",
"args",
"[",
"0",
"]",
",",
"i18n... | Internal function to get an instance implementation of UrlService
@private
@return {Object} the instance | [
"Internal",
"function",
"to",
"get",
"an",
"instance",
"implementation",
"of",
"UrlService"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/modules/RequestMgr.js#L780-L787 | train | |
ariatemplates/ariatemplates | src/aria/modules/RequestMgr.js | function () {
if (!this._requestHandler) {
var cfg = ariaModulesRequestHandlerEnvironmentRequestHandler.getRequestHandlerCfg();
this._requestHandler = Aria.getClassInstance(cfg.implementation, cfg.args);
}
return this._requestHandler;
} | javascript | function () {
if (!this._requestHandler) {
var cfg = ariaModulesRequestHandlerEnvironmentRequestHandler.getRequestHandlerCfg();
this._requestHandler = Aria.getClassInstance(cfg.implementation, cfg.args);
}
return this._requestHandler;
} | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_requestHandler",
")",
"{",
"var",
"cfg",
"=",
"ariaModulesRequestHandlerEnvironmentRequestHandler",
".",
"getRequestHandlerCfg",
"(",
")",
";",
"this",
".",
"_requestHandler",
"=",
"Aria",
".",
"getClassI... | Internal function to get an instance implementation of RequestHandler
@private
@return {Object} the instance | [
"Internal",
"function",
"to",
"get",
"an",
"instance",
"implementation",
"of",
"RequestHandler"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/modules/RequestMgr.js#L794-L800 | train | |
ariatemplates/ariatemplates | src/aria/touch/widgets/Slider.js | function () {
var val = this._value;
if (val >= this._switchThreshold) {
this._onContainer.style.width = this._cfg.width + "px";
this._onContainer.style.left = "0px";
this._offContainer.style.width = "0px";
this._value = 1;
... | javascript | function () {
var val = this._value;
if (val >= this._switchThreshold) {
this._onContainer.style.width = this._cfg.width + "px";
this._onContainer.style.left = "0px";
this._offContainer.style.width = "0px";
this._value = 1;
... | [
"function",
"(",
")",
"{",
"var",
"val",
"=",
"this",
".",
"_value",
";",
"if",
"(",
"val",
">=",
"this",
".",
"_switchThreshold",
")",
"{",
"this",
".",
"_onContainer",
".",
"style",
".",
"width",
"=",
"this",
".",
"_cfg",
".",
"width",
"+",
"\"px... | Update the position of the on and off labels
@protected | [
"Update",
"the",
"position",
"of",
"the",
"on",
"and",
"off",
"labels"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/touch/widgets/Slider.js#L336-L352 | train | |
ariatemplates/ariatemplates | src/aria/touch/widgets/Slider.js | function () {
var binding = this._binding;
if (binding) {
ariaUtilsJson.setValue(binding.inside, binding.to, this._value, this._bindingCallback);
}
} | javascript | function () {
var binding = this._binding;
if (binding) {
ariaUtilsJson.setValue(binding.inside, binding.to, this._value, this._bindingCallback);
}
} | [
"function",
"(",
")",
"{",
"var",
"binding",
"=",
"this",
".",
"_binding",
";",
"if",
"(",
"binding",
")",
"{",
"ariaUtilsJson",
".",
"setValue",
"(",
"binding",
".",
"inside",
",",
"binding",
".",
"to",
",",
"this",
".",
"_value",
",",
"this",
".",
... | Store the current widget value in the bound location
@param {Integer} value Value of the slider
@protected | [
"Store",
"the",
"current",
"widget",
"value",
"in",
"the",
"bound",
"location"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/touch/widgets/Slider.js#L431-L436 | train | |
ariatemplates/ariatemplates | src/aria/touch/widgets/Slider.js | function () {
var dragVal = this._slider.offsetLeft;
this._onContainer.style.width = (this._sliderWidth + dragVal) + "px";
this._offContainer.style.left = dragVal + "px";
this._offContainer.style.width = (this._cfg.width - dragVal) + "px";
} | javascript | function () {
var dragVal = this._slider.offsetLeft;
this._onContainer.style.width = (this._sliderWidth + dragVal) + "px";
this._offContainer.style.left = dragVal + "px";
this._offContainer.style.width = (this._cfg.width - dragVal) + "px";
} | [
"function",
"(",
")",
"{",
"var",
"dragVal",
"=",
"this",
".",
"_slider",
".",
"offsetLeft",
";",
"this",
".",
"_onContainer",
".",
"style",
".",
"width",
"=",
"(",
"this",
".",
"_sliderWidth",
"+",
"dragVal",
")",
"+",
"\"px\"",
";",
"this",
".",
"_... | Move the On and Off state elements
@protected | [
"Move",
"the",
"On",
"and",
"Off",
"state",
"elements"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/touch/widgets/Slider.js#L457-L462 | train | |
ariatemplates/ariatemplates | src/aria/touch/widgets/Slider.js | function () {
var pos = this._savedX, newValue = Math.max(pos / this._railWidth, 0);
if (newValue !== this._value) {
this._value = newValue;
this._storeValue();
} else {
this._notifyDataChange();
}
return;
... | javascript | function () {
var pos = this._savedX, newValue = Math.max(pos / this._railWidth, 0);
if (newValue !== this._value) {
this._value = newValue;
this._storeValue();
} else {
this._notifyDataChange();
}
return;
... | [
"function",
"(",
")",
"{",
"var",
"pos",
"=",
"this",
".",
"_savedX",
",",
"newValue",
"=",
"Math",
".",
"max",
"(",
"pos",
"/",
"this",
".",
"_railWidth",
",",
"0",
")",
";",
"if",
"(",
"newValue",
"!==",
"this",
".",
"_value",
")",
"{",
"this",... | Set the value of the slider in the data model.
@param {Number} newValue new value
@protected | [
"Set",
"the",
"value",
"of",
"the",
"slider",
"in",
"the",
"data",
"model",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/touch/widgets/Slider.js#L469-L478 | train | |
ariatemplates/ariatemplates | src/aria/touch/widgets/Slider.js | function (applySwitchMargins) {
var value;
var binding = this._binding;
if (!binding) {
return;
}
value = binding.inside[binding.to];
if (value == null) {
value = 0;
}
if (value < 0) {
... | javascript | function (applySwitchMargins) {
var value;
var binding = this._binding;
if (!binding) {
return;
}
value = binding.inside[binding.to];
if (value == null) {
value = 0;
}
if (value < 0) {
... | [
"function",
"(",
"applySwitchMargins",
")",
"{",
"var",
"value",
";",
"var",
"binding",
"=",
"this",
".",
"_binding",
";",
"if",
"(",
"!",
"binding",
")",
"{",
"return",
";",
"}",
"value",
"=",
"binding",
".",
"inside",
"[",
"binding",
".",
"to",
"]"... | Read the bound value in the data model, ensure it is defined, between 0 and 1, and assign the _value
property.
@param {Boolean} applySwitchMargins Whether or not the value should be set to either 0 or 1 when the widget
is used as a switch
@protected | [
"Read",
"the",
"bound",
"value",
"in",
"the",
"data",
"model",
"ensure",
"it",
"is",
"defined",
"between",
"0",
"and",
"1",
"and",
"assign",
"the",
"_value",
"property",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/touch/widgets/Slider.js#L487-L513 | train | |
ariatemplates/ariatemplates | src/aria/touch/widgets/Slider.js | function (evt) {
if (evt.type === "tap") {
var cfg = this._cfg;
if (!cfg) {
// Widget already disposed
return true;
}
if ((cfg.tapToToggle || cfg.tapToMove) && this._isSwitch) {
// Wi... | javascript | function (evt) {
if (evt.type === "tap") {
var cfg = this._cfg;
if (!cfg) {
// Widget already disposed
return true;
}
if ((cfg.tapToToggle || cfg.tapToMove) && this._isSwitch) {
// Wi... | [
"function",
"(",
"evt",
")",
"{",
"if",
"(",
"evt",
".",
"type",
"===",
"\"tap\"",
")",
"{",
"var",
"cfg",
"=",
"this",
".",
"_cfg",
";",
"if",
"(",
"!",
"cfg",
")",
"{",
"// Widget already disposed",
"return",
"true",
";",
"}",
"if",
"(",
"(",
"... | Handle delegated events
@param {HTMLEvent} evt Browser event | [
"Handle",
"delegated",
"events"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/touch/widgets/Slider.js#L555-L575 | train | |
ariatemplates/ariatemplates | src/aria/embed/controllers/MapController.js | function (container, cfg) {
var localMapStatus = this.mapManager.getMapStatus(cfg.id);
var mapDom = mapDoms[cfg.id];
if (localMapStatus === null) {
this._createMap(container, cfg);
} else {
container.appendChild(mapD... | javascript | function (container, cfg) {
var localMapStatus = this.mapManager.getMapStatus(cfg.id);
var mapDom = mapDoms[cfg.id];
if (localMapStatus === null) {
this._createMap(container, cfg);
} else {
container.appendChild(mapD... | [
"function",
"(",
"container",
",",
"cfg",
")",
"{",
"var",
"localMapStatus",
"=",
"this",
".",
"mapManager",
".",
"getMapStatus",
"(",
"cfg",
".",
"id",
")",
";",
"var",
"mapDom",
"=",
"mapDoms",
"[",
"cfg",
".",
"id",
"]",
";",
"if",
"(",
"localMapS... | Called by the Map embed widget at initialization
@param {HTMLElement} container
@param {Object} cfg | [
"Called",
"by",
"the",
"Map",
"embed",
"widget",
"at",
"initialization"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/embed/controllers/MapController.js#L75-L87 | train | |
ariatemplates/ariatemplates | src/aria/embed/controllers/MapController.js | function (evt) {
var args = mapReadyHandlerArgs[evt.mapId];
if (args) {
this._triggerLoadingIndicator(args.container, false);
delete mapReadyHandlerArgs[evt.mapId];
this._listeners--;
if (this._listeners === ... | javascript | function (evt) {
var args = mapReadyHandlerArgs[evt.mapId];
if (args) {
this._triggerLoadingIndicator(args.container, false);
delete mapReadyHandlerArgs[evt.mapId];
this._listeners--;
if (this._listeners === ... | [
"function",
"(",
"evt",
")",
"{",
"var",
"args",
"=",
"mapReadyHandlerArgs",
"[",
"evt",
".",
"mapId",
"]",
";",
"if",
"(",
"args",
")",
"{",
"this",
".",
"_triggerLoadingIndicator",
"(",
"args",
".",
"container",
",",
"false",
")",
";",
"delete",
"map... | "mapReady" event handler. Used in case the map is loading
@param {Object} evt Event description
@private | [
"mapReady",
"event",
"handler",
".",
"Used",
"in",
"case",
"the",
"map",
"is",
"loading"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/embed/controllers/MapController.js#L132-L148 | train | |
ariatemplates/ariatemplates | src/aria/embed/controllers/MapController.js | function (container, cfg) {
var id = cfg.id;
if (cfg.loadingIndicator) {
this._triggerLoadingIndicator(container, false);
}
var mapDom = mapDoms[id];
if (mapDom) {
var parent = mapDom.parentNode;
... | javascript | function (container, cfg) {
var id = cfg.id;
if (cfg.loadingIndicator) {
this._triggerLoadingIndicator(container, false);
}
var mapDom = mapDoms[id];
if (mapDom) {
var parent = mapDom.parentNode;
... | [
"function",
"(",
"container",
",",
"cfg",
")",
"{",
"var",
"id",
"=",
"cfg",
".",
"id",
";",
"if",
"(",
"cfg",
".",
"loadingIndicator",
")",
"{",
"this",
".",
"_triggerLoadingIndicator",
"(",
"container",
",",
"false",
")",
";",
"}",
"var",
"mapDom",
... | Called by the Map embed widget at disposal
@param {HTMLElement} container
@param {Object} cfg | [
"Called",
"by",
"the",
"Map",
"embed",
"widget",
"at",
"disposal"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/embed/controllers/MapController.js#L155-L167 | train | |
ariatemplates/ariatemplates | src/aria/utils/Mouse.js | connectMouseEvents | function connectMouseEvents (scope) {
var root = (aria.core.Browser.isIE7 || aria.core.Browser.isIE8) ? Aria.$window.document.body : Aria.$window;
eventUtil.addListener(root, "mousemove", {
fn : scope._onMouseMove,
scope : scope
});
eventUtil.addListener(root, "mo... | javascript | function connectMouseEvents (scope) {
var root = (aria.core.Browser.isIE7 || aria.core.Browser.isIE8) ? Aria.$window.document.body : Aria.$window;
eventUtil.addListener(root, "mousemove", {
fn : scope._onMouseMove,
scope : scope
});
eventUtil.addListener(root, "mo... | [
"function",
"connectMouseEvents",
"(",
"scope",
")",
"{",
"var",
"root",
"=",
"(",
"aria",
".",
"core",
".",
"Browser",
".",
"isIE7",
"||",
"aria",
".",
"core",
".",
"Browser",
".",
"isIE8",
")",
"?",
"Aria",
".",
"$window",
".",
"document",
".",
"bo... | Connect delegated mousemove and mouseup events. For performances these are attached only after a mousedown.
@param {aria.utils.Mouse} scope Instance of the listening class | [
"Connect",
"delegated",
"mousemove",
"and",
"mouseup",
"events",
".",
"For",
"performances",
"these",
"are",
"attached",
"only",
"after",
"a",
"mousedown",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Mouse.js#L39-L57 | train |
ariatemplates/ariatemplates | src/aria/utils/Mouse.js | disconnectMouseEvents | function disconnectMouseEvents (scope) {
var root = (aria.core.Browser.isIE7 || aria.core.Browser.isIE8) ? Aria.$window.document.body : Aria.$window;
eventUtil.removeListener(root, "mousemove", {
fn : scope._onMouseMove,
scope : scope
});
eventUtil.removeListener(... | javascript | function disconnectMouseEvents (scope) {
var root = (aria.core.Browser.isIE7 || aria.core.Browser.isIE8) ? Aria.$window.document.body : Aria.$window;
eventUtil.removeListener(root, "mousemove", {
fn : scope._onMouseMove,
scope : scope
});
eventUtil.removeListener(... | [
"function",
"disconnectMouseEvents",
"(",
"scope",
")",
"{",
"var",
"root",
"=",
"(",
"aria",
".",
"core",
".",
"Browser",
".",
"isIE7",
"||",
"aria",
".",
"core",
".",
"Browser",
".",
"isIE8",
")",
"?",
"Aria",
".",
"$window",
".",
"document",
".",
... | Disconnect delegated mousemove and mouseup events.
@param {aria.utils.Mouse} scope Instance of the listening class | [
"Disconnect",
"delegated",
"mousemove",
"and",
"mouseup",
"events",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Mouse.js#L63-L81 | train |
ariatemplates/ariatemplates | src/aria/utils/Mouse.js | findByAttribute | function findByAttribute (start, attribute, maxDepth, stopper) {
var target = start, expandoValue;
while (maxDepth && target && target != stopper) {
if (target.attributes) {
var expandoValue = target.attributes[attribute];
if (expandoValue) {
... | javascript | function findByAttribute (start, attribute, maxDepth, stopper) {
var target = start, expandoValue;
while (maxDepth && target && target != stopper) {
if (target.attributes) {
var expandoValue = target.attributes[attribute];
if (expandoValue) {
... | [
"function",
"findByAttribute",
"(",
"start",
",",
"attribute",
",",
"maxDepth",
",",
"stopper",
")",
"{",
"var",
"target",
"=",
"start",
",",
"expandoValue",
";",
"while",
"(",
"maxDepth",
"&&",
"target",
"&&",
"target",
"!=",
"stopper",
")",
"{",
"if",
... | Find the first parent of 'start' element with the attribute specified by 'attribute'
@param {HTMLElement} start Node element from which we start searching
@param {String} attribute Attribute name
@param {Number} maxDepth Maximum number of elements to traverse, -1 for infinite
@param {HTMLElement} stopper Stop the searc... | [
"Find",
"the",
"first",
"parent",
"of",
"start",
"element",
"with",
"the",
"attribute",
"specified",
"by",
"attribute"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Mouse.js#L91-L104 | train |
ariatemplates/ariatemplates | src/aria/utils/Mouse.js | function () {
eventUtil.addListener(Aria.$window.document.body, "mousedown", {
fn : this._onMouseDown,
scope : this
});
eventUtil.addListener(Aria.$window.document.body, "touchstart", {
fn : this._onMouseDown,
... | javascript | function () {
eventUtil.addListener(Aria.$window.document.body, "mousedown", {
fn : this._onMouseDown,
scope : this
});
eventUtil.addListener(Aria.$window.document.body, "touchstart", {
fn : this._onMouseDown,
... | [
"function",
"(",
")",
"{",
"eventUtil",
".",
"addListener",
"(",
"Aria",
".",
"$window",
".",
"document",
".",
"body",
",",
"\"mousedown\"",
",",
"{",
"fn",
":",
"this",
".",
"_onMouseDown",
",",
"scope",
":",
"this",
"}",
")",
";",
"eventUtil",
".",
... | This method is called when AriaWindow sends an attachWindow event. It registers a listener on the
mousedown event. | [
"This",
"method",
"is",
"called",
"when",
"AriaWindow",
"sends",
"an",
"attachWindow",
"event",
".",
"It",
"registers",
"a",
"listener",
"on",
"the",
"mousedown",
"event",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Mouse.js#L159-L168 | train | |
ariatemplates/ariatemplates | src/aria/utils/Mouse.js | function () {
eventUtil.removeListener(Aria.$window.document.body, "mousedown", {
fn : this._onMouseDown,
scope : this
});
eventUtil.removeListener(Aria.$window.document.body, "touchstart", {
fn : this._onMouseDo... | javascript | function () {
eventUtil.removeListener(Aria.$window.document.body, "mousedown", {
fn : this._onMouseDown,
scope : this
});
eventUtil.removeListener(Aria.$window.document.body, "touchstart", {
fn : this._onMouseDo... | [
"function",
"(",
")",
"{",
"eventUtil",
".",
"removeListener",
"(",
"Aria",
".",
"$window",
".",
"document",
".",
"body",
",",
"\"mousedown\"",
",",
"{",
"fn",
":",
"this",
".",
"_onMouseDown",
",",
"scope",
":",
"this",
"}",
")",
";",
"eventUtil",
"."... | This method is called when AriaWindow sends a detachWindow event. It unregisters the listener on the
mousedown event. | [
"This",
"method",
"is",
"called",
"when",
"AriaWindow",
"sends",
"a",
"detachWindow",
"event",
".",
"It",
"unregisters",
"the",
"listener",
"on",
"the",
"mousedown",
"event",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Mouse.js#L174-L184 | train | |
ariatemplates/ariatemplates | src/aria/utils/Mouse.js | function (gesture, id) {
if (this._idList[gesture]) {
var element = this._idList[gesture][id];
if (gesture == "drag" && element && element == this._activeDrag) {
// the element being dragged has been disposed,
// ter... | javascript | function (gesture, id) {
if (this._idList[gesture]) {
var element = this._idList[gesture][id];
if (gesture == "drag" && element && element == this._activeDrag) {
// the element being dragged has been disposed,
// ter... | [
"function",
"(",
"gesture",
",",
"id",
")",
"{",
"if",
"(",
"this",
".",
"_idList",
"[",
"gesture",
"]",
")",
"{",
"var",
"element",
"=",
"this",
".",
"_idList",
"[",
"gesture",
"]",
"[",
"id",
"]",
";",
"if",
"(",
"gesture",
"==",
"\"drag\"",
"&... | Remove a listener for a mouse action or gesture.
@param {String} gesture mouse action or gesture
@param {String} id id of the listening instance | [
"Remove",
"a",
"listener",
"for",
"a",
"mouse",
"action",
"or",
"gesture",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Mouse.js#L257-L270 | train | |
ariatemplates/ariatemplates | src/aria/utils/Mouse.js | function (evt) {
var event = new ariaDomEvent(evt);
connectMouseEvents(this);
if (evt.type === "touchstart") {
// The position of touch events is not determined correctly by clientX/Y
var elementPosition = ariaTouchEvent.getPositi... | javascript | function (evt) {
var event = new ariaDomEvent(evt);
connectMouseEvents(this);
if (evt.type === "touchstart") {
// The position of touch events is not determined correctly by clientX/Y
var elementPosition = ariaTouchEvent.getPositi... | [
"function",
"(",
"evt",
")",
"{",
"var",
"event",
"=",
"new",
"ariaDomEvent",
"(",
"evt",
")",
";",
"connectMouseEvents",
"(",
"this",
")",
";",
"if",
"(",
"evt",
".",
"type",
"===",
"\"touchstart\"",
")",
"{",
"// The position of touch events is not determine... | Listener for the mouse down event. It detects possible gestures
@param {HTMLEvent} evt mousedown event. It is not wrapped yet
@private | [
"Listener",
"for",
"the",
"mouse",
"down",
"event",
".",
"It",
"detects",
"possible",
"gestures"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Mouse.js#L277-L295 | train | |
ariatemplates/ariatemplates | src/aria/utils/Mouse.js | function (evt) {
var stopper = Aria.$window.document.body;
var elementId = findByAttribute(evt.target, this.DRAGGABLE_ATTRIBUTE, this.maxDepth, stopper);
if (!elementId) {
return;
}
var candidate = this._idList.drag[ele... | javascript | function (evt) {
var stopper = Aria.$window.document.body;
var elementId = findByAttribute(evt.target, this.DRAGGABLE_ATTRIBUTE, this.maxDepth, stopper);
if (!elementId) {
return;
}
var candidate = this._idList.drag[ele... | [
"function",
"(",
"evt",
")",
"{",
"var",
"stopper",
"=",
"Aria",
".",
"$window",
".",
"document",
".",
"body",
";",
"var",
"elementId",
"=",
"findByAttribute",
"(",
"evt",
".",
"target",
",",
"this",
".",
"DRAGGABLE_ATTRIBUTE",
",",
"this",
".",
"maxDept... | Base function to detect if a drag gesture is happening or not.
@param {aria.DomEvent} evt mouse down event
@private | [
"Base",
"function",
"to",
"detect",
"if",
"a",
"drag",
"gesture",
"is",
"happening",
"or",
"not",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Mouse.js#L302-L320 | train | |
ariatemplates/ariatemplates | src/aria/utils/Mouse.js | function (coordinates) {
var element = this._candidateForDrag;
if (!element) {
return;
}
this._activeDrag = element;
this._dragStarted = true;
element.start(coordinates);
} | javascript | function (coordinates) {
var element = this._candidateForDrag;
if (!element) {
return;
}
this._activeDrag = element;
this._dragStarted = true;
element.start(coordinates);
} | [
"function",
"(",
"coordinates",
")",
"{",
"var",
"element",
"=",
"this",
".",
"_candidateForDrag",
";",
"if",
"(",
"!",
"element",
")",
"{",
"return",
";",
"}",
"this",
".",
"_activeDrag",
"=",
"element",
";",
"this",
".",
"_dragStarted",
"=",
"true",
... | After an activation delay, if no mouseup event is raised the drag has started.
@param {Object} coordinates X and Y coordinates of the initial mouse position
@private | [
"After",
"an",
"activation",
"delay",
"if",
"no",
"mouseup",
"event",
"is",
"raised",
"the",
"drag",
"has",
"started",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Mouse.js#L327-L336 | train | |
ariatemplates/ariatemplates | src/aria/utils/Mouse.js | function (evt) {
var event = new ariaDomEvent(evt);
if (event.type === "touchmove") {
var elementPosition = ariaTouchEvent.getPositions(evt);
if (elementPosition.length === 1) {
event.clientX = elementPosition[0].x;
... | javascript | function (evt) {
var event = new ariaDomEvent(evt);
if (event.type === "touchmove") {
var elementPosition = ariaTouchEvent.getPositions(evt);
if (elementPosition.length === 1) {
event.clientX = elementPosition[0].x;
... | [
"function",
"(",
"evt",
")",
"{",
"var",
"event",
"=",
"new",
"ariaDomEvent",
"(",
"evt",
")",
";",
"if",
"(",
"event",
".",
"type",
"===",
"\"touchmove\"",
")",
"{",
"var",
"elementPosition",
"=",
"ariaTouchEvent",
".",
"getPositions",
"(",
"evt",
")",
... | Listener for the mouse move event.
@param {HTMLEvent} evt mouse event. It is not wrapped yet
@private | [
"Listener",
"for",
"the",
"mouse",
"move",
"event",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Mouse.js#L343-L372 | train | |
ariatemplates/ariatemplates | src/aria/utils/Mouse.js | function (evt) {
this._dragStartPosition = null;
disconnectMouseEvents(this);
var element = this._activeDrag;
if (element) {
element.end();
}
this._candidateForDrag = null;
this._activeD... | javascript | function (evt) {
this._dragStartPosition = null;
disconnectMouseEvents(this);
var element = this._activeDrag;
if (element) {
element.end();
}
this._candidateForDrag = null;
this._activeD... | [
"function",
"(",
"evt",
")",
"{",
"this",
".",
"_dragStartPosition",
"=",
"null",
";",
"disconnectMouseEvents",
"(",
"this",
")",
";",
"var",
"element",
"=",
"this",
".",
"_activeDrag",
";",
"if",
"(",
"element",
")",
"{",
"element",
".",
"end",
"(",
"... | Listener for the mouse up event.
@param {HTMLEvent} evt mouse event. It is not wrapped yet
@private | [
"Listener",
"for",
"the",
"mouse",
"up",
"event",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Mouse.js#L379-L390 | train | |
ariatemplates/ariatemplates | src/aria/utils/overlay/Overlay.js | function (element, overlay) {
// --------------------------------------------------- destructuring
var window = Aria.$window;
var document = window.document;
var body = document.body;
// ------------------------------------------------- local functions
... | javascript | function (element, overlay) {
// --------------------------------------------------- destructuring
var window = Aria.$window;
var document = window.document;
var body = document.body;
// ------------------------------------------------- local functions
... | [
"function",
"(",
"element",
",",
"overlay",
")",
"{",
"// --------------------------------------------------- destructuring",
"var",
"window",
"=",
"Aria",
".",
"$window",
";",
"var",
"document",
"=",
"window",
".",
"document",
";",
"var",
"body",
"=",
"document",
... | Apply a zIndex to the overlay
<p>Resources: </p>
<ul>
<li><a href="http://www.cssmojo.com/everything_you_always_wanted_to_know_about_z-index_but_were_afraid_to_ask/">Find out how elements stack and start using low z-index values</a></li>
<li><a href="https://philipwalton.com/articles/what-no-one-told-you-about-z-index... | [
"Apply",
"a",
"zIndex",
"to",
"the",
"overlay"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/overlay/Overlay.js#L159-L257 | train | |
ariatemplates/ariatemplates | src/aria/core/log/AjaxAppender.js | function (className, msg, level) {
var logObject = {
classpath : className,
msg : msg,
level : level,
time : new Date().getTime()
};
this._logStack.push(logObject);
this._processStack();
} | javascript | function (className, msg, level) {
var logObject = {
classpath : className,
msg : msg,
level : level,
time : new Date().getTime()
};
this._logStack.push(logObject);
this._processStack();
} | [
"function",
"(",
"className",
",",
"msg",
",",
"level",
")",
"{",
"var",
"logObject",
"=",
"{",
"classpath",
":",
"className",
",",
"msg",
":",
"msg",
",",
"level",
":",
"level",
",",
"time",
":",
"new",
"Date",
"(",
")",
".",
"getTime",
"(",
")",
... | Stack a new log entry in the internal stack. This method will then ask to process the stack.
@private
@param {String} className The classname of the object sending the log
@param {String} msg The message
@param {String} level The level | [
"Stack",
"a",
"new",
"log",
"entry",
"in",
"the",
"internal",
"stack",
".",
"This",
"method",
"will",
"then",
"ask",
"to",
"process",
"the",
"stack",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/log/AjaxAppender.js#L49-L58 | train | |
ariatemplates/ariatemplates | src/aria/core/log/AjaxAppender.js | function () {
// The strategy to send logs is either after a certain delay, or when the stack is bigger than ...
var now = new Date().getTime();
if (this._logStack.length > this.minimumLogNb && now > this._lastLogSent + this.minimumInterval) {
this._lastLogSent = new ... | javascript | function () {
// The strategy to send logs is either after a certain delay, or when the stack is bigger than ...
var now = new Date().getTime();
if (this._logStack.length > this.minimumLogNb && now > this._lastLogSent + this.minimumInterval) {
this._lastLogSent = new ... | [
"function",
"(",
")",
"{",
"// The strategy to send logs is either after a certain delay, or when the stack is bigger than ...",
"var",
"now",
"=",
"new",
"Date",
"(",
")",
".",
"getTime",
"(",
")",
";",
"if",
"(",
"this",
".",
"_logStack",
".",
"length",
">",
"this... | Process the stack. Ask to send the request to the server according to the minim delay and minimum number of
logs. Flush the stack if request sent.
@private | [
"Process",
"the",
"stack",
".",
"Ask",
"to",
"send",
"the",
"request",
"to",
"the",
"server",
"according",
"to",
"the",
"minim",
"delay",
"and",
"minimum",
"number",
"of",
"logs",
".",
"Flush",
"the",
"stack",
"if",
"request",
"sent",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/log/AjaxAppender.js#L65-L73 | train | |
ariatemplates/ariatemplates | src/aria/core/log/AjaxAppender.js | function () {
// stringify the json data
var data = ariaUtilsJson.convertToJsonString({
logs : this._logStack
}, {
maxDepth : 4
});
// Send json post request
ariaCoreIO.asyncRequest({
sender : {
... | javascript | function () {
// stringify the json data
var data = ariaUtilsJson.convertToJsonString({
logs : this._logStack
}, {
maxDepth : 4
});
// Send json post request
ariaCoreIO.asyncRequest({
sender : {
... | [
"function",
"(",
")",
"{",
"// stringify the json data",
"var",
"data",
"=",
"ariaUtilsJson",
".",
"convertToJsonString",
"(",
"{",
"logs",
":",
"this",
".",
"_logStack",
"}",
",",
"{",
"maxDepth",
":",
"4",
"}",
")",
";",
"// Send json post request",
"ariaCor... | Actually send the stack to the server. See aria.core.IO. | [
"Actually",
"send",
"the",
"stack",
"to",
"the",
"server",
".",
"See",
"aria",
".",
"core",
".",
"IO",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/log/AjaxAppender.js#L78-L99 | train | |
ariatemplates/ariatemplates | src/aria/core/log/AjaxAppender.js | function (e) {
var str = "";
if (typeof e == 'undefined' || e == null) {
return str;
}
str = "\nException";
str += "\n" + '---------------------------------------------------';
if (e.fileName)
str += '\nFile: ' + e... | javascript | function (e) {
var str = "";
if (typeof e == 'undefined' || e == null) {
return str;
}
str = "\nException";
str += "\n" + '---------------------------------------------------';
if (e.fileName)
str += '\nFile: ' + e... | [
"function",
"(",
"e",
")",
"{",
"var",
"str",
"=",
"\"\"",
";",
"if",
"(",
"typeof",
"e",
"==",
"'undefined'",
"||",
"e",
"==",
"null",
")",
"{",
"return",
"str",
";",
"}",
"str",
"=",
"\"\\nException\"",
";",
"str",
"+=",
"\"\\n\"",
"+",
"'-------... | Format an exception object
@param {Object} e The exception to format
@return {String} The message ready to be shown
@private | [
"Format",
"an",
"exception",
"object"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/log/AjaxAppender.js#L156-L178 | train | |
ariatemplates/ariatemplates | src/aria/widgets/container/Splitter.js | function (element, orientation) {
if (element.style && element.color) {
if (orientation == "V") {
return element.leftWidth + element.rightWidth;
} else if (orientation == "H") {
return element.topWidth + element.bottomWidth;
... | javascript | function (element, orientation) {
if (element.style && element.color) {
if (orientation == "V") {
return element.leftWidth + element.rightWidth;
} else if (orientation == "H") {
return element.topWidth + element.bottomWidth;
... | [
"function",
"(",
"element",
",",
"orientation",
")",
"{",
"if",
"(",
"element",
".",
"style",
"&&",
"element",
".",
"color",
")",
"{",
"if",
"(",
"orientation",
"==",
"\"V\"",
")",
"{",
"return",
"element",
".",
"leftWidth",
"+",
"element",
".",
"right... | calculate the border size of an element
@param {aria.widgets.CfgBeans:BorderCfg}
@param {String} H, V
@return {Number} border size | [
"calculate",
"the",
"border",
"size",
"of",
"an",
"element"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/container/Splitter.js#L353-L362 | train | |
ariatemplates/ariatemplates | src/aria/core/JsObject.js | function (allInterceptors, name, scope, fn) {
for (var i in allInterceptors[name]) {
if (allInterceptors[name].hasOwnProperty(i)) {
__removeCallback(allInterceptors[name], i, scope, fn);
}
}
} | javascript | function (allInterceptors, name, scope, fn) {
for (var i in allInterceptors[name]) {
if (allInterceptors[name].hasOwnProperty(i)) {
__removeCallback(allInterceptors[name], i, scope, fn);
}
}
} | [
"function",
"(",
"allInterceptors",
",",
"name",
",",
"scope",
",",
"fn",
")",
"{",
"for",
"(",
"var",
"i",
"in",
"allInterceptors",
"[",
"name",
"]",
")",
"{",
"if",
"(",
"allInterceptors",
"[",
"name",
"]",
".",
"hasOwnProperty",
"(",
"i",
")",
")"... | Private method to remove interceptors.
@param {Object} allInterceptors obj.__$interceptors
@param {String} name [mandatory] name interface name
@param {Object} scope [optional] if specified, only interceptors with that scope will be removed
@param {Function} fn [optional] if specified, only interceptors with that funct... | [
"Private",
"method",
"to",
"remove",
"interceptors",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsObject.js#L28-L34 | train | |
ariatemplates/ariatemplates | src/aria/core/JsObject.js | function (callbacksMap, name, scope, fn, src, firstOnly) {
if (callbacksMap == null) {
return; // nothing to remove
}
var arr = callbacksMap[name];
if (arr) {
var length = arr.length, removeThis = false, cb;
for (var i = 0; i < length; i++) {
... | javascript | function (callbacksMap, name, scope, fn, src, firstOnly) {
if (callbacksMap == null) {
return; // nothing to remove
}
var arr = callbacksMap[name];
if (arr) {
var length = arr.length, removeThis = false, cb;
for (var i = 0; i < length; i++) {
... | [
"function",
"(",
"callbacksMap",
",",
"name",
",",
"scope",
",",
"fn",
",",
"src",
",",
"firstOnly",
")",
"{",
"if",
"(",
"callbacksMap",
"==",
"null",
")",
"{",
"return",
";",
"// nothing to remove",
"}",
"var",
"arr",
"=",
"callbacksMap",
"[",
"name",
... | Private method used to remove callbacks from a map of callbacks associated to a given scope and function
@param {Object} callbacksMap map of callbacks, which can be currently: obj._listeners
@param {String} name [mandatory] name in the map, may be the event name (if callbacksMap == _listeners)
@param {Object} scope [op... | [
"Private",
"method",
"used",
"to",
"remove",
"callbacks",
"from",
"a",
"map",
"of",
"callbacks",
"associated",
"to",
"a",
"given",
"scope",
"and",
"function"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsObject.js#L47-L91 | train | |
ariatemplates/ariatemplates | src/aria/core/JsObject.js | function (info) {
var methodName = require("../utils/String").capitalize(info.method);
var fctRef = this["on" + methodName + info.step];
if (fctRef) {
return fctRef.call(this, info);
}
fctRef = this["on" + info.method + info.step];
if (fctRef) {
re... | javascript | function (info) {
var methodName = require("../utils/String").capitalize(info.method);
var fctRef = this["on" + methodName + info.step];
if (fctRef) {
return fctRef.call(this, info);
}
fctRef = this["on" + info.method + info.step];
if (fctRef) {
re... | [
"function",
"(",
"info",
")",
"{",
"var",
"methodName",
"=",
"require",
"(",
"\"../utils/String\"",
")",
".",
"capitalize",
"(",
"info",
".",
"method",
")",
";",
"var",
"fctRef",
"=",
"this",
"[",
"\"on\"",
"+",
"methodName",
"+",
"info",
".",
"step",
... | Interceptor dispatch function.
@param {Object} interc interceptor instance
@param {Object} info interceptor parameters | [
"Interceptor",
"dispatch",
"function",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsObject.js#L98-L108 | train | |
ariatemplates/ariatemplates | src/aria/core/JsObject.js | function (args, commonInfo, interceptorIndex) {
if (interceptorIndex >= commonInfo.nbInterceptors) {
// end of recursion: call the real method:
return this[commonInfo.method].apply(this, args);
}
var interc = commonInfo.interceptors[interceptorIndex];
if (interc.r... | javascript | function (args, commonInfo, interceptorIndex) {
if (interceptorIndex >= commonInfo.nbInterceptors) {
// end of recursion: call the real method:
return this[commonInfo.method].apply(this, args);
}
var interc = commonInfo.interceptors[interceptorIndex];
if (interc.r... | [
"function",
"(",
"args",
",",
"commonInfo",
",",
"interceptorIndex",
")",
"{",
"if",
"(",
"interceptorIndex",
">=",
"commonInfo",
".",
"nbInterceptors",
")",
"{",
"// end of recursion: call the real method:",
"return",
"this",
"[",
"commonInfo",
".",
"method",
"]",
... | Recursive method to call wrappers. This method should be called with "this" refering to the object whose method
is called. | [
"Recursive",
"method",
"to",
"call",
"wrappers",
".",
"This",
"method",
"should",
"be",
"called",
"with",
"this",
"refering",
"to",
"the",
"object",
"whose",
"method",
"is",
"called",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsObject.js#L114-L174 | train | |
ariatemplates/ariatemplates | src/aria/core/JsObject.js | function (res, args) {
var interc = args.interc;
if (interc.removed) {
// the interceptor was removed in the mean time, call the original callback directly
return this.$callback(args.origCb, res);
}
var info = args.info;
info.step = "Callback";
inf... | javascript | function (res, args) {
var interc = args.interc;
if (interc.removed) {
// the interceptor was removed in the mean time, call the original callback directly
return this.$callback(args.origCb, res);
}
var info = args.info;
info.step = "Callback";
inf... | [
"function",
"(",
"res",
",",
"args",
")",
"{",
"var",
"interc",
"=",
"args",
".",
"interc",
";",
"if",
"(",
"interc",
".",
"removed",
")",
"{",
"// the interceptor was removed in the mean time, call the original callback directly",
"return",
"this",
".",
"$callback"... | Callback wrapper. | [
"Callback",
"wrapper",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsObject.js#L179-L196 | train | |
ariatemplates/ariatemplates | src/aria/core/JsObject.js | function (interfaceMethods, interceptor, allInterceptors) {
var interceptedMethods = allInterceptors || {};
// for a callback, intercept all methods of an interface
for (var i in interfaceMethods) {
if (interfaceMethods.hasOwnProperty(i)) {
(interceptedMethods[i] || (... | javascript | function (interfaceMethods, interceptor, allInterceptors) {
var interceptedMethods = allInterceptors || {};
// for a callback, intercept all methods of an interface
for (var i in interfaceMethods) {
if (interfaceMethods.hasOwnProperty(i)) {
(interceptedMethods[i] || (... | [
"function",
"(",
"interfaceMethods",
",",
"interceptor",
",",
"allInterceptors",
")",
"{",
"var",
"interceptedMethods",
"=",
"allInterceptors",
"||",
"{",
"}",
";",
"// for a callback, intercept all methods of an interface",
"for",
"(",
"var",
"i",
"in",
"interfaceMetho... | Adds an interceptor to all methods.
@param {Object} interfaceMethods all methods for the interface
@param {aria.core.CfgBeans:Callback} interceptor a callback which will receive notifications
@return {Object} interceptedMethods | [
"Adds",
"an",
"interceptor",
"to",
"all",
"methods",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsObject.js#L222-L231 | train | |
ariatemplates/ariatemplates | src/aria/core/JsObject.js | function (interfaceMethods, interceptor, allInterceptors) {
var interceptedMethods = allInterceptors || {};
// for a class object, intercept specific methods
for (var m in interfaceMethods) {
if (interfaceMethods.hasOwnProperty(m) && __hasBeenIntercepted(m, interceptor)) {
... | javascript | function (interfaceMethods, interceptor, allInterceptors) {
var interceptedMethods = allInterceptors || {};
// for a class object, intercept specific methods
for (var m in interfaceMethods) {
if (interfaceMethods.hasOwnProperty(m) && __hasBeenIntercepted(m, interceptor)) {
... | [
"function",
"(",
"interfaceMethods",
",",
"interceptor",
",",
"allInterceptors",
")",
"{",
"var",
"interceptedMethods",
"=",
"allInterceptors",
"||",
"{",
"}",
";",
"// for a class object, intercept specific methods",
"for",
"(",
"var",
"m",
"in",
"interfaceMethods",
... | Targets specific methods to be intercepted.
@param {Object} interfaceMethods all methods for the interface
@param {Object} interceptor an object/class which will receive notifications
@return {Object} interceptedMethods | [
"Targets",
"specific",
"methods",
"to",
"be",
"intercepted",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsObject.js#L239-L251 | train | |
ariatemplates/ariatemplates | src/aria/core/JsObject.js | function () {
this.$destructor(); // call $destructor
// TODO - cleanup object
if (this._listeners) {
this._listeners = null;
delete this._listeners;
}
if (this.__$interceptors) {
... | javascript | function () {
this.$destructor(); // call $destructor
// TODO - cleanup object
if (this._listeners) {
this._listeners = null;
delete this._listeners;
}
if (this.__$interceptors) {
... | [
"function",
"(",
")",
"{",
"this",
".",
"$destructor",
"(",
")",
";",
"// call $destructor",
"// TODO - cleanup object",
"if",
"(",
"this",
".",
"_listeners",
")",
"{",
"this",
".",
"_listeners",
"=",
"null",
";",
"delete",
"this",
".",
"_listeners",
";",
... | Method to call on any object prior to deletion | [
"Method",
"to",
"call",
"on",
"any",
"object",
"prior",
"to",
"deletion"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsObject.js#L305-L319 | train | |
ariatemplates/ariatemplates | src/aria/core/JsObject.js | function (msg, msgArgs, err) {
// replaced by the true logging function when
// aria.core.Log is loaded
// If it's not replaced because the log is never
// downloaded, at least there will be errors in the
// console.
if (Ari... | javascript | function (msg, msgArgs, err) {
// replaced by the true logging function when
// aria.core.Log is loaded
// If it's not replaced because the log is never
// downloaded, at least there will be errors in the
// console.
if (Ari... | [
"function",
"(",
"msg",
",",
"msgArgs",
",",
"err",
")",
"{",
"// replaced by the true logging function when",
"// aria.core.Log is loaded",
"// If it's not replaced because the log is never",
"// downloaded, at least there will be errors in the",
"// console.",
"if",
"(",
"Aria",
... | Log an error message to the logger
@param {String} msg the message text
@param {Array} msgArgs An array of arguments to be used for string replacement in the message text
@param {Object} err The actual JS error object that was created or an object to be inspected in the
logged message | [
"Log",
"an",
"error",
"message",
"to",
"the",
"logger"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsObject.js#L382-L396 | train | |
ariatemplates/ariatemplates | src/aria/core/JsObject.js | function (cb, res, errorId) {
try {
if (!cb) {
return; // callback is sometimes not used
}
if (cb.$Callback) {
return cb.call(res);
}
// perf optimisation... | javascript | function (cb, res, errorId) {
try {
if (!cb) {
return; // callback is sometimes not used
}
if (cb.$Callback) {
return cb.call(res);
}
// perf optimisation... | [
"function",
"(",
"cb",
",",
"res",
",",
"errorId",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"cb",
")",
"{",
"return",
";",
"// callback is sometimes not used",
"}",
"if",
"(",
"cb",
".",
"$Callback",
")",
"{",
"return",
"cb",
".",
"call",
"(",
"res",
... | Generic method allowing to call-back a caller in asynchronous processes
@param {aria.core.CfgBeans:Callback} cb callback description
@param {MultiTypes} res first result argument to pass to cb.fn (second argument will be cb.args)
@param {String} errorId error raised if an exception occurs in the callback
@return {Multi... | [
"Generic",
"method",
"allowing",
"to",
"call",
"-",
"back",
"a",
"caller",
"in",
"asynchronous",
"processes"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsObject.js#L406-L442 | train | |
ariatemplates/ariatemplates | src/aria/core/JsObject.js | function (cb) {
var scope = cb.scope, callback;
scope = scope ? scope : this;
if (!cb.fn) {
callback = cb;
} else {
callback = cb.fn;
}
if (typeof(callback) == 'string') {
... | javascript | function (cb) {
var scope = cb.scope, callback;
scope = scope ? scope : this;
if (!cb.fn) {
callback = cb;
} else {
callback = cb.fn;
}
if (typeof(callback) == 'string') {
... | [
"function",
"(",
"cb",
")",
"{",
"var",
"scope",
"=",
"cb",
".",
"scope",
",",
"callback",
";",
"scope",
"=",
"scope",
"?",
"scope",
":",
"this",
";",
"if",
"(",
"!",
"cb",
".",
"fn",
")",
"{",
"callback",
"=",
"cb",
";",
"}",
"else",
"{",
"c... | Gets a proper signature callback from description given in argument
@param {Object|String} cn callback signature
@return {Object} callback object with fn and scope | [
"Gets",
"a",
"proper",
"signature",
"callback",
"from",
"description",
"given",
"in",
"argument"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsObject.js#L449-L468 | train | |
ariatemplates/ariatemplates | src/aria/core/JsObject.js | function (itf, interceptor) {
// get the interface constructor:
var itfCstr = this.$interfaces[itf];
if (!itfCstr) {
this.$logError(this.INTERFACE_NOT_SUPPORTED, [itf, this.$classpath]);
return;
}
var... | javascript | function (itf, interceptor) {
// get the interface constructor:
var itfCstr = this.$interfaces[itf];
if (!itfCstr) {
this.$logError(this.INTERFACE_NOT_SUPPORTED, [itf, this.$classpath]);
return;
}
var... | [
"function",
"(",
"itf",
",",
"interceptor",
")",
"{",
"// get the interface constructor:",
"var",
"itfCstr",
"=",
"this",
".",
"$interfaces",
"[",
"itf",
"]",
";",
"if",
"(",
"!",
"itfCstr",
")",
"{",
"this",
".",
"$logError",
"(",
"this",
".",
"INTERFACE_... | Add an interceptor callback on an interface specified by its classpath.
@param {String} itf [mandatory] interface which will be intercepted
@param {Object|aria.core.CfgBeans:Callback} interceptor either a callback or an object/class which will
receive notifications | [
"Add",
"an",
"interceptor",
"callback",
"on",
"an",
"interface",
"specified",
"by",
"its",
"classpath",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsObject.js#L512-L535 | train | |
ariatemplates/ariatemplates | src/aria/core/JsObject.js | function (itf, scope, fn) {
var itfCstr = this.$interfaces[itf];
var allInterceptors = this.__$interceptors;
if (!itfCstr || !allInterceptors) {
return;
}
var itfs = itfCstr.prototype.$interfaces;
// also... | javascript | function (itf, scope, fn) {
var itfCstr = this.$interfaces[itf];
var allInterceptors = this.__$interceptors;
if (!itfCstr || !allInterceptors) {
return;
}
var itfs = itfCstr.prototype.$interfaces;
// also... | [
"function",
"(",
"itf",
",",
"scope",
",",
"fn",
")",
"{",
"var",
"itfCstr",
"=",
"this",
".",
"$interfaces",
"[",
"itf",
"]",
";",
"var",
"allInterceptors",
"=",
"this",
".",
"__$interceptors",
";",
"if",
"(",
"!",
"itfCstr",
"||",
"!",
"allIntercepto... | Remove interceptor callbacks or interceptor objects on an interface.
@param {String} itf [mandatory] interface which is intercepted
@param {Object} scope [optional] scope of the callbacks/objects to remove
@param {Function} fn [optional] function in the callbacks to remove | [
"Remove",
"interceptor",
"callbacks",
"or",
"interceptor",
"objects",
"on",
"an",
"interface",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsObject.js#L543-L556 | train | |
ariatemplates/ariatemplates | src/aria/core/JsObject.js | function (interfaceName, methodName, args, asyncCbParam) {
var interceptors;
if (this.__$interceptors == null || this.__$interceptors[interfaceName] == null
|| (interceptors = this.__$interceptors[interfaceName][methodName]) == null) {
// no in... | javascript | function (interfaceName, methodName, args, asyncCbParam) {
var interceptors;
if (this.__$interceptors == null || this.__$interceptors[interfaceName] == null
|| (interceptors = this.__$interceptors[interfaceName][methodName]) == null) {
// no in... | [
"function",
"(",
"interfaceName",
",",
"methodName",
",",
"args",
",",
"asyncCbParam",
")",
"{",
"var",
"interceptors",
";",
"if",
"(",
"this",
".",
"__$interceptors",
"==",
"null",
"||",
"this",
".",
"__$interceptors",
"[",
"interfaceName",
"]",
"==",
"null... | Call a method from this class, taking into account any registered interceptor.
@param {String} interfaceName Classpath of the interface in which the method is declared (directly). The
actual interface from which this method is called maybe an interface which extends this one.
@param {String} methodName Method name.
@pa... | [
"Call",
"a",
"method",
"from",
"this",
"class",
"taking",
"into",
"account",
"any",
"registered",
"interceptor",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsObject.js#L567-L580 | train | |
ariatemplates/ariatemplates | src/aria/core/JsObject.js | function (lstCfg, itfWrap) {
if (this._listeners == null) {
return;
}
var defaultScope = (lstCfg.scope) ? lstCfg.scope : null;
var lsn;
for (var evt in lstCfg) {
if (!lstCfg.hasOwnProperty(evt)) {
... | javascript | function (lstCfg, itfWrap) {
if (this._listeners == null) {
return;
}
var defaultScope = (lstCfg.scope) ? lstCfg.scope : null;
var lsn;
for (var evt in lstCfg) {
if (!lstCfg.hasOwnProperty(evt)) {
... | [
"function",
"(",
"lstCfg",
",",
"itfWrap",
")",
"{",
"if",
"(",
"this",
".",
"_listeners",
"==",
"null",
")",
"{",
"return",
";",
"}",
"var",
"defaultScope",
"=",
"(",
"lstCfg",
".",
"scope",
")",
"?",
"lstCfg",
".",
"scope",
":",
"null",
";",
"var... | Remove a listener from the listener list
@param {Object} lstCfg list of events to disconnect - same as for addListener(), except that scope is
mandatory Note: if fn is not provided, all listeners associated to the scope will be removed
@param {Object} itfWrap | [
"Remove",
"a",
"listener",
"from",
"the",
"listener",
"list"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsObject.js#L698-L733 | train | |
ariatemplates/ariatemplates | src/aria/core/JsObject.js | function (scope, itfWrap) {
if (this._listeners == null) {
return;
}
// We must check itfWrap == null, so that it is not possible to unregister all the events of an object
// from its interface, if they have not been registered through ... | javascript | function (scope, itfWrap) {
if (this._listeners == null) {
return;
}
// We must check itfWrap == null, so that it is not possible to unregister all the events of an object
// from its interface, if they have not been registered through ... | [
"function",
"(",
"scope",
",",
"itfWrap",
")",
"{",
"if",
"(",
"this",
".",
"_listeners",
"==",
"null",
")",
"{",
"return",
";",
"}",
"// We must check itfWrap == null, so that it is not possible to unregister all the events of an object",
"// from its interface, if they have... | Remove all listeners associated to a given scope - if no scope is provided all listeneres will be removed
@param {Object} scope the scope of the listeners to remove
@param {Object} itfWrap | [
"Remove",
"all",
"listeners",
"associated",
"to",
"a",
"given",
"scope",
"-",
"if",
"no",
"scope",
"is",
"provided",
"all",
"listeneres",
"will",
"be",
"removed"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/JsObject.js#L740-L765 | train | |
ariatemplates/ariatemplates | src/aria/jsunit/RobotPhantomJS.js | function (position, callback) {
var lastPosition = this._lastMousePosition;
lastPosition.x = position.x;
lastPosition.y = position.y;
this._sendEvent('mousemove', position.x, position.y);
this._callCallback(callback);
} | javascript | function (position, callback) {
var lastPosition = this._lastMousePosition;
lastPosition.x = position.x;
lastPosition.y = position.y;
this._sendEvent('mousemove', position.x, position.y);
this._callCallback(callback);
} | [
"function",
"(",
"position",
",",
"callback",
")",
"{",
"var",
"lastPosition",
"=",
"this",
".",
"_lastMousePosition",
";",
"lastPosition",
".",
"x",
"=",
"position",
".",
"x",
";",
"lastPosition",
".",
"y",
"=",
"position",
".",
"y",
";",
"this",
".",
... | Sets the mouse position, with PhantomJS screen coordinates.
@param {Object} position position where to set the mouse (given as an object with x and y properties, in
PhantomJS screen coordinates)
@param {aria.core.CfgBeans:Callback} callback | [
"Sets",
"the",
"mouse",
"position",
"with",
"PhantomJS",
"screen",
"coordinates",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/jsunit/RobotPhantomJS.js#L178-L184 | train | |
ariatemplates/ariatemplates | src/aria/jsunit/RobotPhantomJS.js | function (from, to, duration, cb) {
var translatedFromPosition = this._translateCoordinates(from);
var translatedToPosition = this._translateCoordinates(to);
this.smoothAbsoluteMouseMove(translatedFromPosition, translatedToPosition, duration, cb);
} | javascript | function (from, to, duration, cb) {
var translatedFromPosition = this._translateCoordinates(from);
var translatedToPosition = this._translateCoordinates(to);
this.smoothAbsoluteMouseMove(translatedFromPosition, translatedToPosition, duration, cb);
} | [
"function",
"(",
"from",
",",
"to",
",",
"duration",
",",
"cb",
")",
"{",
"var",
"translatedFromPosition",
"=",
"this",
".",
"_translateCoordinates",
"(",
"from",
")",
";",
"var",
"translatedToPosition",
"=",
"this",
".",
"_translateCoordinates",
"(",
"to",
... | Smoothly moves the mouse from one position to another, with coordinates relative to the viewport.
@param {Object} fromPosition initial position where to set the mouse first (given as an object with x and y
properties, in viewport coordinates)
@param {Object} toPosition final position of mouse (given as an object with x... | [
"Smoothly",
"moves",
"the",
"mouse",
"from",
"one",
"position",
"to",
"another",
"with",
"coordinates",
"relative",
"to",
"the",
"viewport",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/jsunit/RobotPhantomJS.js#L195-L199 | train | |
ariatemplates/ariatemplates | src/aria/jsunit/RobotPhantomJS.js | function (from, to, duration, cb) {
this.absoluteMouseMove(from, {
fn : this._stepSmoothAbsoluteMouseMove,
scope : this,
resIndex : -1,
args : {
from : from,
to : to,
duration : durati... | javascript | function (from, to, duration, cb) {
this.absoluteMouseMove(from, {
fn : this._stepSmoothAbsoluteMouseMove,
scope : this,
resIndex : -1,
args : {
from : from,
to : to,
duration : durati... | [
"function",
"(",
"from",
",",
"to",
",",
"duration",
",",
"cb",
")",
"{",
"this",
".",
"absoluteMouseMove",
"(",
"from",
",",
"{",
"fn",
":",
"this",
".",
"_stepSmoothAbsoluteMouseMove",
",",
"scope",
":",
"this",
",",
"resIndex",
":",
"-",
"1",
",",
... | Smoothly moves the mouse from one position to another, with PhantomJS screen coordinates.
@param {Object} fromPosition initial position where to set the mouse first (given as an object with x and y
properties, in PhantomJS screen coordinates)
@param {Object} toPosition final position of mouse (given as an object with x... | [
"Smoothly",
"moves",
"the",
"mouse",
"from",
"one",
"position",
"to",
"another",
"with",
"PhantomJS",
"screen",
"coordinates",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/jsunit/RobotPhantomJS.js#L210-L223 | train | |
ariatemplates/ariatemplates | src/aria/jsunit/RobotPhantomJS.js | function (button, cb) {
var lastPosition = this._lastMousePosition;
this._sendEvent('mousedown', lastPosition.x, lastPosition.y, this.BUTTONS[button]);
this._callCallback(cb);
} | javascript | function (button, cb) {
var lastPosition = this._lastMousePosition;
this._sendEvent('mousedown', lastPosition.x, lastPosition.y, this.BUTTONS[button]);
this._callCallback(cb);
} | [
"function",
"(",
"button",
",",
"cb",
")",
"{",
"var",
"lastPosition",
"=",
"this",
".",
"_lastMousePosition",
";",
"this",
".",
"_sendEvent",
"(",
"'mousedown'",
",",
"lastPosition",
".",
"x",
",",
"lastPosition",
".",
"y",
",",
"this",
".",
"BUTTONS",
... | Simulates a mouse button press.
@param {Number} button Button to be pressed (should be the value of aria.jsunit.Robot.BUTTONx_MASK, with x
replaced by 1, 2 or 3).
@param {aria.core.CfgBeans:Callback} callback | [
"Simulates",
"a",
"mouse",
"button",
"press",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/jsunit/RobotPhantomJS.js#L254-L258 | train | |
ariatemplates/ariatemplates | src/aria/jsunit/RobotPhantomJS.js | function (keyCode, cb) {
if (keyCode == this.KEYS.VK_SHIFT) {
this._keyShift = true;
}
if (keyCode == this.KEYS.VK_CTRL) {
this._keyCtrl = true;
}
if (typeof keyCode == "string" && this._keyShift) {
keyCode = key... | javascript | function (keyCode, cb) {
if (keyCode == this.KEYS.VK_SHIFT) {
this._keyShift = true;
}
if (keyCode == this.KEYS.VK_CTRL) {
this._keyCtrl = true;
}
if (typeof keyCode == "string" && this._keyShift) {
keyCode = key... | [
"function",
"(",
"keyCode",
",",
"cb",
")",
"{",
"if",
"(",
"keyCode",
"==",
"this",
".",
"KEYS",
".",
"VK_SHIFT",
")",
"{",
"this",
".",
"_keyShift",
"=",
"true",
";",
"}",
"if",
"(",
"keyCode",
"==",
"this",
".",
"KEYS",
".",
"VK_CTRL",
")",
"{... | Simulates a keyboard key press.
@param {MultiTypes} key specifies which key should be pressed. It can be any value among the ones in the KEYS
property.
@param {aria.core.CfgBeans:Callback} callback | [
"Simulates",
"a",
"keyboard",
"key",
"press",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/jsunit/RobotPhantomJS.js#L285-L300 | train | |
ariatemplates/ariatemplates | src/aria/widgets/frames/FixedHeightFrame.js | function (skipBorder, icons) {
var hasBorder = (skipBorder === false);
if (skipBorder == "dependsOnIcon") {
hasBorder = (icons.length === 0);
}
return hasBorder;
} | javascript | function (skipBorder, icons) {
var hasBorder = (skipBorder === false);
if (skipBorder == "dependsOnIcon") {
hasBorder = (icons.length === 0);
}
return hasBorder;
} | [
"function",
"(",
"skipBorder",
",",
"icons",
")",
"{",
"var",
"hasBorder",
"=",
"(",
"skipBorder",
"===",
"false",
")",
";",
"if",
"(",
"skipBorder",
"==",
"\"dependsOnIcon\"",
")",
"{",
"hasBorder",
"=",
"(",
"icons",
".",
"length",
"===",
"0",
")",
"... | Checks for any border in left or right.
@protected
@param {String} border
@param {Array} Icons
@return {Boolean} | [
"Checks",
"for",
"any",
"border",
"in",
"left",
"or",
"right",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/frames/FixedHeightFrame.js#L180-L186 | train | |
ariatemplates/ariatemplates | src/aria/utils/Orientation.js | function () {
var window = Aria.$window;
if (typeof(window.orientation) != "undefined") { // check if browser support orientation change
this.screenOrientation = window.orientation;
this.isPortrait = this.__isPortrait();
// start listening native event orinetationcha... | javascript | function () {
var window = Aria.$window;
if (typeof(window.orientation) != "undefined") { // check if browser support orientation change
this.screenOrientation = window.orientation;
this.isPortrait = this.__isPortrait();
// start listening native event orinetationcha... | [
"function",
"(",
")",
"{",
"var",
"window",
"=",
"Aria",
".",
"$window",
";",
"if",
"(",
"typeof",
"(",
"window",
".",
"orientation",
")",
"!=",
"\"undefined\"",
")",
"{",
"// check if browser support orientation change",
"this",
".",
"screenOrientation",
"=",
... | Adding a listener while initializing Orientation to listen to the native orientationchange event. | [
"Adding",
"a",
"listener",
"while",
"initializing",
"Orientation",
"to",
"listen",
"to",
"the",
"native",
"orientationchange",
"event",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Orientation.js#L35-L47 | train | |
ariatemplates/ariatemplates | src/aria/utils/Orientation.js | function () {
this.screenOrientation = Aria.$window.orientation;
this.isPortrait = this.__isPortrait();
// raise event "change" to notify about orientation change along with properties for current orientation
this.$raiseEvent({
name : "change",
... | javascript | function () {
this.screenOrientation = Aria.$window.orientation;
this.isPortrait = this.__isPortrait();
// raise event "change" to notify about orientation change along with properties for current orientation
this.$raiseEvent({
name : "change",
... | [
"function",
"(",
")",
"{",
"this",
".",
"screenOrientation",
"=",
"Aria",
".",
"$window",
".",
"orientation",
";",
"this",
".",
"isPortrait",
"=",
"this",
".",
"__isPortrait",
"(",
")",
";",
"// raise event \"change\" to notify about orientation change along with prop... | Callback executed after orientation of the device is changed. This raises a wrapper event for the native
event orientationchange and provides properties screenOrientation which is exact value of window.orientation
and additional variable isPortrait to tell if device orientation is portrait
@protected | [
"Callback",
"executed",
"after",
"orientation",
"of",
"the",
"device",
"is",
"changed",
".",
"This",
"raises",
"a",
"wrapper",
"event",
"for",
"the",
"native",
"event",
"orientationchange",
"and",
"provides",
"properties",
"screenOrientation",
"which",
"is",
"exac... | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Orientation.js#L63-L72 | train | |
ariatemplates/ariatemplates | src/aria/touch/widgets/DoubleSlider.js | function () {
var value, binding = this._binding;
if (!binding) {
return;
}
value = binding.inside[binding.to];
if (ariaUtilsType.isArray(value)) {
// Constrain values to be between 0 and 1 and the first to be smaller
... | javascript | function () {
var value, binding = this._binding;
if (!binding) {
return;
}
value = binding.inside[binding.to];
if (ariaUtilsType.isArray(value)) {
// Constrain values to be between 0 and 1 and the first to be smaller
... | [
"function",
"(",
")",
"{",
"var",
"value",
",",
"binding",
"=",
"this",
".",
"_binding",
";",
"if",
"(",
"!",
"binding",
")",
"{",
"return",
";",
"}",
"value",
"=",
"binding",
".",
"inside",
"[",
"binding",
".",
"to",
"]",
";",
"if",
"(",
"ariaUt... | Read the bound value in the data model, ensure it is defined, between 0 and 1, and assign the value property.
@protected | [
"Read",
"the",
"bound",
"value",
"in",
"the",
"data",
"model",
"ensure",
"it",
"is",
"defined",
"between",
"0",
"and",
"1",
"and",
"assign",
"the",
"value",
"property",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/touch/widgets/DoubleSlider.js#L297-L309 | train | |
ariatemplates/ariatemplates | src/aria/touch/widgets/DoubleSlider.js | function () {
var first = Math.max(0, Math.min(this.value[0], this.value[1], 1));
var second = Math.min(1, Math.max(this.value[0], this.value[1], 0));
this._savedX1 = Math.floor(first * this._railWidth);
this._savedX2 = Math.ceil(second * this._railWidth + this._firstWidt... | javascript | function () {
var first = Math.max(0, Math.min(this.value[0], this.value[1], 1));
var second = Math.min(1, Math.max(this.value[0], this.value[1], 0));
this._savedX1 = Math.floor(first * this._railWidth);
this._savedX2 = Math.ceil(second * this._railWidth + this._firstWidt... | [
"function",
"(",
")",
"{",
"var",
"first",
"=",
"Math",
".",
"max",
"(",
"0",
",",
"Math",
".",
"min",
"(",
"this",
".",
"value",
"[",
"0",
"]",
",",
"this",
".",
"value",
"[",
"1",
"]",
",",
"1",
")",
")",
";",
"var",
"second",
"=",
"Math"... | Set the left position of the two thumbs without knowing if they are correct. The first thumb is aligned on
the left, while the second on the right. | [
"Set",
"the",
"left",
"position",
"of",
"the",
"two",
"thumbs",
"without",
"knowing",
"if",
"they",
"are",
"correct",
".",
"The",
"first",
"thumb",
"is",
"aligned",
"on",
"the",
"left",
"while",
"the",
"second",
"on",
"the",
"right",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/touch/widgets/DoubleSlider.js#L315-L320 | train | |
ariatemplates/ariatemplates | src/aria/touch/widgets/DoubleSlider.js | function () {
var left = this._savedX1 + this._firstWidth / 2;
var widthHighlight = this._savedX2 + (this._secondWidth / 2) - left;
this._highlight.style.left = left + "px";
this._highlight.style.width = widthHighlight + "px";
} | javascript | function () {
var left = this._savedX1 + this._firstWidth / 2;
var widthHighlight = this._savedX2 + (this._secondWidth / 2) - left;
this._highlight.style.left = left + "px";
this._highlight.style.width = widthHighlight + "px";
} | [
"function",
"(",
")",
"{",
"var",
"left",
"=",
"this",
".",
"_savedX1",
"+",
"this",
".",
"_firstWidth",
"/",
"2",
";",
"var",
"widthHighlight",
"=",
"this",
".",
"_savedX2",
"+",
"(",
"this",
".",
"_secondWidth",
"/",
"2",
")",
"-",
"left",
";",
"... | Update the width and position of the highlight between two thumbs.
@protected | [
"Update",
"the",
"width",
"and",
"position",
"of",
"the",
"highlight",
"between",
"two",
"thumbs",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/touch/widgets/DoubleSlider.js#L337-L342 | train | |
ariatemplates/ariatemplates | src/aria/touch/widgets/DoubleSlider.js | function (evt) {
this._oldValue = [this.value[0], this.value[1]];
// Just store the initial position of the element to compute the move later
this._initialDrag = evt.src.posX;
this._initialSavedX = evt.src.id === this._firstDomId ? this._savedX1 : this._savedX2;
} | javascript | function (evt) {
this._oldValue = [this.value[0], this.value[1]];
// Just store the initial position of the element to compute the move later
this._initialDrag = evt.src.posX;
this._initialSavedX = evt.src.id === this._firstDomId ? this._savedX1 : this._savedX2;
} | [
"function",
"(",
"evt",
")",
"{",
"this",
".",
"_oldValue",
"=",
"[",
"this",
".",
"value",
"[",
"0",
"]",
",",
"this",
".",
"value",
"[",
"1",
"]",
"]",
";",
"// Just store the initial position of the element to compute the move later",
"this",
".",
"_initial... | Handle the beginning of a drag
@protected
@param {aria.DomEvent} evt | [
"Handle",
"the",
"beginning",
"of",
"a",
"drag"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/touch/widgets/DoubleSlider.js#L390-L395 | train | |
ariatemplates/ariatemplates | src/aria/touch/widgets/DoubleSlider.js | function () {
var left = this._savedX1, right = this._savedX2;
var first = Math.max(left / this._railWidth, 0);
var second = Math.min((right - this._firstWidth) / this._railWidth, 1);
if (this.value[0] !== first || this.value[1] !== second) {
this.value ... | javascript | function () {
var left = this._savedX1, right = this._savedX2;
var first = Math.max(left / this._railWidth, 0);
var second = Math.min((right - this._firstWidth) / this._railWidth, 1);
if (this.value[0] !== first || this.value[1] !== second) {
this.value ... | [
"function",
"(",
")",
"{",
"var",
"left",
"=",
"this",
".",
"_savedX1",
",",
"right",
"=",
"this",
".",
"_savedX2",
";",
"var",
"first",
"=",
"Math",
".",
"max",
"(",
"left",
"/",
"this",
".",
"_railWidth",
",",
"0",
")",
";",
"var",
"second",
"=... | Set the value of the slider in the data model given the left position of the thumbs.
@protected | [
"Set",
"the",
"value",
"of",
"the",
"slider",
"in",
"the",
"data",
"model",
"given",
"the",
"left",
"position",
"of",
"the",
"thumbs",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/touch/widgets/DoubleSlider.js#L453-L468 | train | |
ariatemplates/ariatemplates | src/aria/utils/FrameATLoader.js | function (frame, cb, options) {
this.loadBootstrap({
fn : this._loadATInFrameCb1,
scope : this,
args : {
options : options || {},
frame : frame,
cb : cb
}
});
} | javascript | function (frame, cb, options) {
this.loadBootstrap({
fn : this._loadATInFrameCb1,
scope : this,
args : {
options : options || {},
frame : frame,
cb : cb
}
});
} | [
"function",
"(",
"frame",
",",
"cb",
",",
"options",
")",
"{",
"this",
".",
"loadBootstrap",
"(",
"{",
"fn",
":",
"this",
".",
"_loadATInFrameCb1",
",",
"scope",
":",
"this",
",",
"args",
":",
"{",
"options",
":",
"options",
"||",
"{",
"}",
",",
"f... | Load Aria Templates in the given frame and call the callback. This replaces the content of the frame.
@param {HTMLElement} frame frame
@param {aria.core.CfgBeans:Callback} cb callback. The first argument is an object containing success
information.
@param {Object} options The following options are supported:<ul>
<li>if... | [
"Load",
"Aria",
"Templates",
"in",
"the",
"given",
"frame",
"and",
"call",
"the",
"callback",
".",
"This",
"replaces",
"the",
"content",
"of",
"the",
"frame",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/FrameATLoader.js#L139-L149 | train | |
ariatemplates/ariatemplates | src/aria/utils/FrameATLoader.js | function (pattern) {
var scripts = Aria.$frameworkWindow.document.getElementsByTagName("script");
for (var i = 0, l = scripts.length; i < l; i++) {
var script = scripts[i];
if (script.attributes && script.attributes["src"]) {
var src = script.a... | javascript | function (pattern) {
var scripts = Aria.$frameworkWindow.document.getElementsByTagName("script");
for (var i = 0, l = scripts.length; i < l; i++) {
var script = scripts[i];
if (script.attributes && script.attributes["src"]) {
var src = script.a... | [
"function",
"(",
"pattern",
")",
"{",
"var",
"scripts",
"=",
"Aria",
".",
"$frameworkWindow",
".",
"document",
".",
"getElementsByTagName",
"(",
"\"script\"",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"l",
"=",
"scripts",
".",
"length",
";",
"i"... | Loop over script tags in the current document and return the address of the script which matches the pattern.
@param {RegExp} pattern
@return {String} | [
"Loop",
"over",
"script",
"tags",
"in",
"the",
"current",
"document",
"and",
"return",
"the",
"address",
"of",
"the",
"script",
"which",
"matches",
"the",
"pattern",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/FrameATLoader.js#L321-L334 | train | |
ariatemplates/ariatemplates | src/aria/pageEngine/pageProviders/BasePageProvider.js | function (res, cb) {
if (res.downloadFailed) {
this.__onFailure(res, cb.args);
} else {
var fileContent = ariaCoreDownloadMgr.getFileContent(res.logicalPaths[0]);
var responseJSON = ariaUtilsJson.load(fileContent);
if (responseJSON)... | javascript | function (res, cb) {
if (res.downloadFailed) {
this.__onFailure(res, cb.args);
} else {
var fileContent = ariaCoreDownloadMgr.getFileContent(res.logicalPaths[0]);
var responseJSON = ariaUtilsJson.load(fileContent);
if (responseJSON)... | [
"function",
"(",
"res",
",",
"cb",
")",
"{",
"if",
"(",
"res",
".",
"downloadFailed",
")",
"{",
"this",
".",
"__onFailure",
"(",
"res",
",",
"cb",
".",
"args",
")",
";",
"}",
"else",
"{",
"var",
"fileContent",
"=",
"ariaCoreDownloadMgr",
".",
"getFil... | Retrieve the file content after it has been downloaded and parses it to turn it into a JSON object
@param {Object} res Response received from the loadFile method of aria.core.DownloadManager
@param {aria.core.CfgBeans:Callback} cb Callback to be called after the response has been parsed | [
"Retrieve",
"the",
"file",
"content",
"after",
"it",
"has",
"been",
"downloaded",
"and",
"parses",
"it",
"to",
"turn",
"it",
"into",
"a",
"JSON",
"object"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/pageEngine/pageProviders/BasePageProvider.js#L147-L159 | train | |
ariatemplates/ariatemplates | src/aria/pageEngine/pageProviders/BasePageProvider.js | function (pageRequest) {
var map = this.__urlMap.urlToPageId, pageId = pageRequest.pageId, url = pageRequest.url;
if (pageId) {
return pageId;
}
if (url) {
var returnUrl = map[url] || map[url + "/"] || map[url.replace(/\/$/, "")];
... | javascript | function (pageRequest) {
var map = this.__urlMap.urlToPageId, pageId = pageRequest.pageId, url = pageRequest.url;
if (pageId) {
return pageId;
}
if (url) {
var returnUrl = map[url] || map[url + "/"] || map[url.replace(/\/$/, "")];
... | [
"function",
"(",
"pageRequest",
")",
"{",
"var",
"map",
"=",
"this",
".",
"__urlMap",
".",
"urlToPageId",
",",
"pageId",
"=",
"pageRequest",
".",
"pageId",
",",
"url",
"=",
"pageRequest",
".",
"url",
";",
"if",
"(",
"pageId",
")",
"{",
"return",
"pageI... | Retrieve the pageId based on the pageRequest information, as well as the url map. As a default, the
homePageId is returned
@param {aria.pageEngine.CfgBeans:PageRequest} pageRequest
@return {String} the pageId
@private | [
"Retrieve",
"the",
"pageId",
"based",
"on",
"the",
"pageRequest",
"information",
"as",
"well",
"as",
"the",
"url",
"map",
".",
"As",
"a",
"default",
"the",
"homePageId",
"is",
"returned"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/pageEngine/pageProviders/BasePageProvider.js#L244-L256 | train | |
ariatemplates/ariatemplates | src/aria/core/AppEnvironment.js | function (cfg, callback, update) {
update = !!update;
var keys = ariaUtilsObject.keys(cfg);
if (update) {
ariaUtilsJson.inject(cfg, this.applicationSettings, true);
} else {
if (keys.length === 0) {
// reset stored appli... | javascript | function (cfg, callback, update) {
update = !!update;
var keys = ariaUtilsObject.keys(cfg);
if (update) {
ariaUtilsJson.inject(cfg, this.applicationSettings, true);
} else {
if (keys.length === 0) {
// reset stored appli... | [
"function",
"(",
"cfg",
",",
"callback",
",",
"update",
")",
"{",
"update",
"=",
"!",
"!",
"update",
";",
"var",
"keys",
"=",
"ariaUtilsObject",
".",
"keys",
"(",
"cfg",
")",
";",
"if",
"(",
"update",
")",
"{",
"ariaUtilsJson",
".",
"inject",
"(",
... | Stores the application variables. Please refer to documentation for parameter types.
@public
@param {Object} cfg Configuration object
@param {aria.core.CfgBeans:Callback} cb Method to be called after the setting is done
@param {Boolean} update flag to update existing application settings, when false will overwrite exis... | [
"Stores",
"the",
"application",
"variables",
".",
"Please",
"refer",
"to",
"documentation",
"for",
"parameter",
"types",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/core/AppEnvironment.js#L58-L98 | train | |
ariatemplates/ariatemplates | src/aria/widgets/Text.js | function (textContent) {
// String cast
if (textContent !== null) {
textContent = '' + textContent;
} else {
textContent = '';
}
var dom = this.getDom();
if (dom) {
var stringUtils = ariaUtilsString;
... | javascript | function (textContent) {
// String cast
if (textContent !== null) {
textContent = '' + textContent;
} else {
textContent = '';
}
var dom = this.getDom();
if (dom) {
var stringUtils = ariaUtilsString;
... | [
"function",
"(",
"textContent",
")",
"{",
"// String cast",
"if",
"(",
"textContent",
"!==",
"null",
")",
"{",
"textContent",
"=",
"''",
"+",
"textContent",
";",
"}",
"else",
"{",
"textContent",
"=",
"''",
";",
"}",
"var",
"dom",
"=",
"this",
".",
"get... | Check if the width of text is too long and if so, ellipse it
@param {String} textContent the text to be ellipsed
@private | [
"Check",
"if",
"the",
"width",
"of",
"text",
"is",
"too",
"long",
"and",
"if",
"so",
"ellipse",
"it"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/Text.js#L114-L152 | train | |
ariatemplates/ariatemplates | src/aria/map/MapManager.js | function (providerName, provider) {
if (providers[providerName]) {
this.$logError(this.DUPLICATED_PROVIDER, providerName);
} else {
if (ariaUtilsType.isObject(provider)) {
if (this._isValidProvider(provider)) {
... | javascript | function (providerName, provider) {
if (providers[providerName]) {
this.$logError(this.DUPLICATED_PROVIDER, providerName);
} else {
if (ariaUtilsType.isObject(provider)) {
if (this._isValidProvider(provider)) {
... | [
"function",
"(",
"providerName",
",",
"provider",
")",
"{",
"if",
"(",
"providers",
"[",
"providerName",
"]",
")",
"{",
"this",
".",
"$logError",
"(",
"this",
".",
"DUPLICATED_PROVIDER",
",",
"providerName",
")",
";",
"}",
"else",
"{",
"if",
"(",
"ariaUt... | Add a provider by specifying the class that should be used to load dependencies and create maps instances
@param {String} providerName
@param {String|Object} provider classpath or Object with methods "load", "getMap" and "disposeMap" | [
"Add",
"a",
"provider",
"by",
"specifying",
"the",
"class",
"that",
"should",
"be",
"used",
"to",
"load",
"dependencies",
"and",
"create",
"maps",
"instances"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/map/MapManager.js#L221-L236 | train | |
ariatemplates/ariatemplates | src/aria/map/MapManager.js | function (providerName) {
this.destroyAllMaps(providerName);
delete providers[providerName];
if (providerInstancesToDispose[providerName]) {
providerInstancesToDispose[providerName].$dispose();
delete providerInstancesToDispose[prov... | javascript | function (providerName) {
this.destroyAllMaps(providerName);
delete providers[providerName];
if (providerInstancesToDispose[providerName]) {
providerInstancesToDispose[providerName].$dispose();
delete providerInstancesToDispose[prov... | [
"function",
"(",
"providerName",
")",
"{",
"this",
".",
"destroyAllMaps",
"(",
"providerName",
")",
";",
"delete",
"providers",
"[",
"providerName",
"]",
";",
"if",
"(",
"providerInstancesToDispose",
"[",
"providerName",
"]",
")",
"{",
"providerInstancesToDispose"... | Remove a provider by specifying the shortcut for the provider. It destroys all the maps created with that
provider
@param {String} provider | [
"Remove",
"a",
"provider",
"by",
"specifying",
"the",
"shortcut",
"for",
"the",
"provider",
".",
"It",
"destroys",
"all",
"the",
"maps",
"created",
"with",
"that",
"provider"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/map/MapManager.js#L243-L251 | train | |
ariatemplates/ariatemplates | src/aria/map/MapManager.js | function (provider) {
var valid = true, methods = ["load", "getMap", "disposeMap"];
for (var i = 0; i < methods.length; i++) {
valid = valid && provider[methods[i]] && ariaUtilsType.isFunction(provider[methods[i]]);
}
return valid;
... | javascript | function (provider) {
var valid = true, methods = ["load", "getMap", "disposeMap"];
for (var i = 0; i < methods.length; i++) {
valid = valid && provider[methods[i]] && ariaUtilsType.isFunction(provider[methods[i]]);
}
return valid;
... | [
"function",
"(",
"provider",
")",
"{",
"var",
"valid",
"=",
"true",
",",
"methods",
"=",
"[",
"\"load\"",
",",
"\"getMap\"",
",",
"\"disposeMap\"",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"methods",
".",
"length",
";",
"i",
"++",... | Check that the given provider has the right methods
@param {Object} provider
@return {Boolean} | [
"Check",
"that",
"the",
"given",
"provider",
"has",
"the",
"right",
"methods"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/map/MapManager.js#L342-L348 | train | |
ariatemplates/ariatemplates | src/aria/map/MapManager.js | function (res, cfg) {
var providerInstance = providerInstances[cfg.provider];
providerInstance.load({
fn : this._retrieveMapInstance,
scope : this,
args : cfg
});
} | javascript | function (res, cfg) {
var providerInstance = providerInstances[cfg.provider];
providerInstance.load({
fn : this._retrieveMapInstance,
scope : this,
args : cfg
});
} | [
"function",
"(",
"res",
",",
"cfg",
")",
"{",
"var",
"providerInstance",
"=",
"providerInstances",
"[",
"cfg",
".",
"provider",
"]",
";",
"providerInstance",
".",
"load",
"(",
"{",
"fn",
":",
"this",
".",
"_retrieveMapInstance",
",",
"scope",
":",
"this",
... | Load the provider dependencies. Called after loading the provider class
@param {Object} res
@param {aria.map.CfgBeans:CreateMapCfg} cfg
@private | [
"Load",
"the",
"provider",
"dependencies",
".",
"Called",
"after",
"loading",
"the",
"provider",
"class"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/map/MapManager.js#L356-L363 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/AutoCompleteController.js | function () {
var freeTxtStatus = false, dataListContent = this._dataModel.listContent;
for (var i = 0, len = dataListContent.length; i < len; i += 1) {
if (this._dataModel.text === dataListContent[i].value.label) {
freeTxtStatus = true;
... | javascript | function () {
var freeTxtStatus = false, dataListContent = this._dataModel.listContent;
for (var i = 0, len = dataListContent.length; i < len; i += 1) {
if (this._dataModel.text === dataListContent[i].value.label) {
freeTxtStatus = true;
... | [
"function",
"(",
")",
"{",
"var",
"freeTxtStatus",
"=",
"false",
",",
"dataListContent",
"=",
"this",
".",
"_dataModel",
".",
"listContent",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"dataListContent",
".",
"length",
";",
"i",
"<",
"len",... | Checks the displayed text is available in the returned suggestion, this will apply only in case of
freetext is set to false
@param {Object} value
@return {Boolean} | [
"Checks",
"the",
"displayed",
"text",
"is",
"available",
"in",
"the",
"returned",
"suggestion",
"this",
"will",
"apply",
"only",
"in",
"case",
"of",
"freetext",
"is",
"set",
"to",
"false"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/AutoCompleteController.js#L201-L210 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/AutoCompleteController.js | function (value) {
var report = new ariaWidgetsControllersReportsDropDownControllerReport(), dataModel = this._dataModel;
if (value == null) {
// can be null either because it bound to null or because a request is in progress
dataModel.text = (this... | javascript | function (value) {
var report = new ariaWidgetsControllersReportsDropDownControllerReport(), dataModel = this._dataModel;
if (value == null) {
// can be null either because it bound to null or because a request is in progress
dataModel.text = (this... | [
"function",
"(",
"value",
")",
"{",
"var",
"report",
"=",
"new",
"ariaWidgetsControllersReportsDropDownControllerReport",
"(",
")",
",",
"dataModel",
"=",
"this",
".",
"_dataModel",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"// can be null either because it... | OVERRIDE Verify a given value
@param {Object} value
@return {aria.widgets.controllers.reports.DropDownControllerReport}
@override | [
"OVERRIDE",
"Verify",
"a",
"given",
"value"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/AutoCompleteController.js#L218-L252 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/AutoCompleteController.js | function (suggestions, textEntry) {
var matchValueIndex = -1, suggestion;
for (var index = 0, len = suggestions.length, label, ariaLabel; index < len; index += 1) {
suggestion = suggestions[index];
// if it's the first exact match, store it
... | javascript | function (suggestions, textEntry) {
var matchValueIndex = -1, suggestion;
for (var index = 0, len = suggestions.length, label, ariaLabel; index < len; index += 1) {
suggestion = suggestions[index];
// if it's the first exact match, store it
... | [
"function",
"(",
"suggestions",
",",
"textEntry",
")",
"{",
"var",
"matchValueIndex",
"=",
"-",
"1",
",",
"suggestion",
";",
"for",
"(",
"var",
"index",
"=",
"0",
",",
"len",
"=",
"suggestions",
".",
"length",
",",
"label",
",",
"ariaLabel",
";",
"inde... | reformat the suggestions to be compatible with the list widget and search for perfect match
@protected
@param {Array} suggestions
@param {String} textEntry
@return {Number} index of the first exact match, or -1 | [
"reformat",
"the",
"suggestions",
"to",
"be",
"compatible",
"with",
"the",
"list",
"widget",
"and",
"search",
"for",
"perfect",
"match"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/AutoCompleteController.js#L420-L445 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/AutoCompleteController.js | function (config, event) {
return (event.altKey == !!config.alt) && (event.shiftKey == !!config.shift)
&& (event.ctrlKey == !!config.ctrl);
} | javascript | function (config, event) {
return (event.altKey == !!config.alt) && (event.shiftKey == !!config.shift)
&& (event.ctrlKey == !!config.ctrl);
} | [
"function",
"(",
"config",
",",
"event",
")",
"{",
"return",
"(",
"event",
".",
"altKey",
"==",
"!",
"!",
"config",
".",
"alt",
")",
"&&",
"(",
"event",
".",
"shiftKey",
"==",
"!",
"!",
"config",
".",
"shift",
")",
"&&",
"(",
"event",
".",
"ctrlK... | Validates an event against a configuration
@param {Object} config
@param {aria.DomEvent} event
@protected | [
"Validates",
"an",
"event",
"against",
"a",
"configuration"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/AutoCompleteController.js#L517-L520 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/AutoCompleteController.js | function (event) {
var specialKey = false, keyCode = event.keyCode;
for (var index = 0, keyMap; index < this.selectionKeys.length; index++) {
keyMap = this.selectionKeys[index];
if (this._validateModifiers(keyMap, event)) {
... | javascript | function (event) {
var specialKey = false, keyCode = event.keyCode;
for (var index = 0, keyMap; index < this.selectionKeys.length; index++) {
keyMap = this.selectionKeys[index];
if (this._validateModifiers(keyMap, event)) {
... | [
"function",
"(",
"event",
")",
"{",
"var",
"specialKey",
"=",
"false",
",",
"keyCode",
"=",
"event",
".",
"keyCode",
";",
"for",
"(",
"var",
"index",
"=",
"0",
",",
"keyMap",
";",
"index",
"<",
"this",
".",
"selectionKeys",
".",
"length",
";",
"index... | Checking against special key combinations that trigger a selection of the item in the dropdown
@param {aria.DomEvent} event
@return {Boolean} Whether the event corresponds to a selection key | [
"Checking",
"against",
"special",
"key",
"combinations",
"that",
"trigger",
"a",
"selection",
"of",
"the",
"item",
"in",
"the",
"dropdown"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/AutoCompleteController.js#L527-L550 | train | |
ariatemplates/ariatemplates | src/aria/utils/Ellipsis.js | function (el) {
var document = Aria.$window.document;
// Need to make sure the new element has the same exact styling applied as the original element so we use
// the same tag, class, style and append it to the same parent
var tempSizerEl = document.createElement(el.tagN... | javascript | function (el) {
var document = Aria.$window.document;
// Need to make sure the new element has the same exact styling applied as the original element so we use
// the same tag, class, style and append it to the same parent
var tempSizerEl = document.createElement(el.tagN... | [
"function",
"(",
"el",
")",
"{",
"var",
"document",
"=",
"Aria",
".",
"$window",
".",
"document",
";",
"// Need to make sure the new element has the same exact styling applied as the original element so we use",
"// the same tag, class, style and append it to the same parent",
"var",... | Create the temporary sizer element to be used internally to measure text
@param {HTMLElement} el The element that will be measured thanks to this sizer
@return {HTMLElement} The sizer element
@private | [
"Create",
"the",
"temporary",
"sizer",
"element",
"to",
"be",
"used",
"internally",
"to",
"measure",
"text"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Ellipsis.js#L231-L247 | train | |
ariatemplates/ariatemplates | src/aria/utils/Ellipsis.js | function (relatedTarget) {
if (this.callbackID) {
ariaCoreTimer.cancelCallback(this.callbackID);
}
if (this._popup != null) {
if (!ariaUtilsDom.isAncestor(relatedTarget, this._popup.domElement)) {
if (this._popup) {
... | javascript | function (relatedTarget) {
if (this.callbackID) {
ariaCoreTimer.cancelCallback(this.callbackID);
}
if (this._popup != null) {
if (!ariaUtilsDom.isAncestor(relatedTarget, this._popup.domElement)) {
if (this._popup) {
... | [
"function",
"(",
"relatedTarget",
")",
"{",
"if",
"(",
"this",
".",
"callbackID",
")",
"{",
"ariaCoreTimer",
".",
"cancelCallback",
"(",
"this",
".",
"callbackID",
")",
";",
"}",
"if",
"(",
"this",
".",
"_popup",
"!=",
"null",
")",
"{",
"if",
"(",
"!... | This hides the Full version of the ellipsised element
@param {Object} domEvt The click DOM event
@protected | [
"This",
"hides",
"the",
"Full",
"version",
"of",
"the",
"ellipsised",
"element"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Ellipsis.js#L332-L347 | train | |
ariatemplates/ariatemplates | src/aria/utils/Function.js | function (fn, context) {
var args = [];
for (var i = 2; i < arguments.length; i++) {
args.push(arguments[i]);
}
return function () {
// need to make a copy each time
var finalArgs = args.slice(0);
// concat w... | javascript | function (fn, context) {
var args = [];
for (var i = 2; i < arguments.length; i++) {
args.push(arguments[i]);
}
return function () {
// need to make a copy each time
var finalArgs = args.slice(0);
// concat w... | [
"function",
"(",
"fn",
",",
"context",
")",
"{",
"var",
"args",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"2",
";",
"i",
"<",
"arguments",
".",
"length",
";",
"i",
"++",
")",
"{",
"args",
".",
"push",
"(",
"arguments",
"[",
"i",
"]",
... | Bind a function to a particular context. As a consequence, in the function 'this' will correspond to the
context. Additional arguments will be prepend to the arguments of the binded function
@param {Function} fn
@param {Object} context
@return {Function} | [
"Bind",
"a",
"function",
"to",
"a",
"particular",
"context",
".",
"As",
"a",
"consequence",
"in",
"the",
"function",
"this",
"will",
"correspond",
"to",
"the",
"context",
".",
"Additional",
"arguments",
"will",
"be",
"prepend",
"to",
"the",
"arguments",
"of"... | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Function.js#L32-L46 | train | |
ariatemplates/ariatemplates | src/aria/utils/Function.js | function (src, dest, fnNames, prefix) {
if (!prefix) {
prefix = '';
}
for (var index = 0, l = fnNames.length; index < l; index++) {
var key = fnNames[index];
dest[prefix + key] = this.bind(src[key], src);
}
} | javascript | function (src, dest, fnNames, prefix) {
if (!prefix) {
prefix = '';
}
for (var index = 0, l = fnNames.length; index < l; index++) {
var key = fnNames[index];
dest[prefix + key] = this.bind(src[key], src);
}
} | [
"function",
"(",
"src",
",",
"dest",
",",
"fnNames",
",",
"prefix",
")",
"{",
"if",
"(",
"!",
"prefix",
")",
"{",
"prefix",
"=",
"''",
";",
"}",
"for",
"(",
"var",
"index",
"=",
"0",
",",
"l",
"=",
"fnNames",
".",
"length",
";",
"index",
"<",
... | Put on destination object functions from source object, keeping the source object as scope for these
functions
@param {Object} src source object
@param {Object} dest destination object
@param {Array} fnNames list of function names
@param {String} optional string prefix for functions on the target object | [
"Put",
"on",
"destination",
"object",
"functions",
"from",
"source",
"object",
"keeping",
"the",
"source",
"object",
"as",
"scope",
"for",
"these",
"functions"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/Function.js#L56-L64 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/SelectController.js | function (options) {
var dataModel = this._dataModel;
// normalize labels to lowerCase
var sz = options.length, item;
for (var i = 0; sz > i; i++) {
item = options[i];
item[this.LABEL_META] = item.label.toLowerCase()... | javascript | function (options) {
var dataModel = this._dataModel;
// normalize labels to lowerCase
var sz = options.length, item;
for (var i = 0; sz > i; i++) {
item = options[i];
item[this.LABEL_META] = item.label.toLowerCase()... | [
"function",
"(",
"options",
")",
"{",
"var",
"dataModel",
"=",
"this",
".",
"_dataModel",
";",
"// normalize labels to lowerCase",
"var",
"sz",
"=",
"options",
".",
"length",
",",
"item",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"sz",
">",
"i",
";",... | Set the list content
@param {aria.widgets.CfgBeans:SelectCfg.options} options | [
"Set",
"the",
"list",
"content"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/SelectController.js#L83-L93 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/SelectController.js | function (includeValue) {
var dataModel = this._dataModel;
var report = new ariaWidgetsControllersReportsDropDownControllerReport();
report.ok = true;
if (includeValue) {
report.value = dataModel.value;
}
... | javascript | function (includeValue) {
var dataModel = this._dataModel;
var report = new ariaWidgetsControllersReportsDropDownControllerReport();
report.ok = true;
if (includeValue) {
report.value = dataModel.value;
}
... | [
"function",
"(",
"includeValue",
")",
"{",
"var",
"dataModel",
"=",
"this",
".",
"_dataModel",
";",
"var",
"report",
"=",
"new",
"ariaWidgetsControllersReportsDropDownControllerReport",
"(",
")",
";",
"report",
".",
"ok",
"=",
"true",
";",
"if",
"(",
"includeV... | Create a report containing the current display value.
@return {aria.widgets.controllers.reports.DropDownControllerReport}
@protected | [
"Create",
"a",
"report",
"containing",
"the",
"current",
"display",
"value",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/SelectController.js#L100-L109 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/SelectController.js | function (displayIdx) {
var dataModel = this._dataModel;
var options = dataModel.listContent;
if (options.length === 0) {
displayIdx = -1;
} else if (displayIdx >= options.length) {
displayIdx = options.length - 1;
... | javascript | function (displayIdx) {
var dataModel = this._dataModel;
var options = dataModel.listContent;
if (options.length === 0) {
displayIdx = -1;
} else if (displayIdx >= options.length) {
displayIdx = options.length - 1;
... | [
"function",
"(",
"displayIdx",
")",
"{",
"var",
"dataModel",
"=",
"this",
".",
"_dataModel",
";",
"var",
"options",
"=",
"dataModel",
".",
"listContent",
";",
"if",
"(",
"options",
".",
"length",
"===",
"0",
")",
"{",
"displayIdx",
"=",
"-",
"1",
";",
... | Set the display index in the data model and update other dependent values.
@param {Number} displayIdx index (in listContent) of the new display text
@protected | [
"Set",
"the",
"display",
"index",
"in",
"the",
"data",
"model",
"and",
"update",
"other",
"dependent",
"values",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/SelectController.js#L116-L137 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/SelectController.js | function (lastTypedKeys, newMatch) {
var LABEL_META = this.LABEL_META;
var options = this._dataModel.listContent;
var keyNbr = lastTypedKeys.length;
var index = this._dataModel.selectedIdx + (newMatch ? 1 : 0); // start point to search for a match
... | javascript | function (lastTypedKeys, newMatch) {
var LABEL_META = this.LABEL_META;
var options = this._dataModel.listContent;
var keyNbr = lastTypedKeys.length;
var index = this._dataModel.selectedIdx + (newMatch ? 1 : 0); // start point to search for a match
... | [
"function",
"(",
"lastTypedKeys",
",",
"newMatch",
")",
"{",
"var",
"LABEL_META",
"=",
"this",
".",
"LABEL_META",
";",
"var",
"options",
"=",
"this",
".",
"_dataModel",
".",
"listContent",
";",
"var",
"keyNbr",
"=",
"lastTypedKeys",
".",
"length",
";",
"va... | Search for an item matching the last typed keys in the options and return its index. An item is matching
if the whole lastTypedKeys string is a prefix of its label.
@param {String} lastTypedKeys
@param {Boolean} newMatch
@return {Number} index of the matching item or -1 if no matching item was found
@protected | [
"Search",
"for",
"an",
"item",
"matching",
"the",
"last",
"typed",
"keys",
"in",
"the",
"options",
"and",
"return",
"its",
"index",
".",
"An",
"item",
"is",
"matching",
"if",
"the",
"whole",
"lastTypedKeys",
"string",
"is",
"a",
"prefix",
"of",
"its",
"l... | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/SelectController.js#L179-L195 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/SelectController.js | function (charCode, keyCode) {
var dataModel = this._dataModel;
var report;
if (domEvent.isNavigationKey(keyCode)) {
var newIdx;
var validationKey = false;
if (keyCode == domEvent.KC_LEFT || keyCode == domEvent.K... | javascript | function (charCode, keyCode) {
var dataModel = this._dataModel;
var report;
if (domEvent.isNavigationKey(keyCode)) {
var newIdx;
var validationKey = false;
if (keyCode == domEvent.KC_LEFT || keyCode == domEvent.K... | [
"function",
"(",
"charCode",
",",
"keyCode",
")",
"{",
"var",
"dataModel",
"=",
"this",
".",
"_dataModel",
";",
"var",
"report",
";",
"if",
"(",
"domEvent",
".",
"isNavigationKey",
"(",
"keyCode",
")",
")",
"{",
"var",
"newIdx",
";",
"var",
"validationKe... | Verify a given keyStroke and return a report.
@param {Integer} charCode
@param {Integer} keyCode
@return {aria.widgets.controllers.reports.DropDownControllerReport} | [
"Verify",
"a",
"given",
"keyStroke",
"and",
"return",
"a",
"report",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/SelectController.js#L230-L304 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/SelectController.js | function (internalValue) {
var options = this._dataModel.listContent;
var indexFound = -1;
for (var i = 0, l = options.length; i < l; i++) {
if (options[i].value == internalValue) {
indexFound = i;
break;... | javascript | function (internalValue) {
var options = this._dataModel.listContent;
var indexFound = -1;
for (var i = 0, l = options.length; i < l; i++) {
if (options[i].value == internalValue) {
indexFound = i;
break;... | [
"function",
"(",
"internalValue",
")",
"{",
"var",
"options",
"=",
"this",
".",
"_dataModel",
".",
"listContent",
";",
"var",
"indexFound",
"=",
"-",
"1",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"l",
"=",
"options",
".",
"length",
";",
"i",
"<"... | Verify a given value and return a report.
@param {String} internalValue value
@return {aria.widgets.controllers.reports.DropDownControllerReport} | [
"Verify",
"a",
"given",
"value",
"and",
"return",
"a",
"report",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/SelectController.js#L311-L322 | train | |
ariatemplates/ariatemplates | src/aria/widgets/controllers/SelectController.js | function () {
var report = new ariaWidgetsControllersReportsDropDownControllerReport();
report.displayDropDown = (this._listWidget == null);
if (this._dataModel && this._dataModel.displayIdx !== this._dataModel.selectedIdx) {
this._setDisplayIdx(this._... | javascript | function () {
var report = new ariaWidgetsControllersReportsDropDownControllerReport();
report.displayDropDown = (this._listWidget == null);
if (this._dataModel && this._dataModel.displayIdx !== this._dataModel.selectedIdx) {
this._setDisplayIdx(this._... | [
"function",
"(",
")",
"{",
"var",
"report",
"=",
"new",
"ariaWidgetsControllersReportsDropDownControllerReport",
"(",
")",
";",
"report",
".",
"displayDropDown",
"=",
"(",
"this",
".",
"_listWidget",
"==",
"null",
")",
";",
"if",
"(",
"this",
".",
"_dataModel"... | Called when the user wants to toggle the display of the dropdown.
@return {aria.widgets.controllers.reports.DropDownControllerReport} | [
"Called",
"when",
"the",
"user",
"wants",
"to",
"toggle",
"the",
"display",
"of",
"the",
"dropdown",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/widgets/controllers/SelectController.js#L347-L354 | train | |
ariatemplates/ariatemplates | src/aria/utils/sandbox/DOMProperties.js | function (tagName, propertyName) {
if (!__properties.hasOwnProperty(propertyName)) {
return "--";
}
var property = __properties[propertyName];
if (typeof property == "object") {
tagName = tagName.toUpperCase();
... | javascript | function (tagName, propertyName) {
if (!__properties.hasOwnProperty(propertyName)) {
return "--";
}
var property = __properties[propertyName];
if (typeof property == "object") {
tagName = tagName.toUpperCase();
... | [
"function",
"(",
"tagName",
",",
"propertyName",
")",
"{",
"if",
"(",
"!",
"__properties",
".",
"hasOwnProperty",
"(",
"propertyName",
")",
")",
"{",
"return",
"\"--\"",
";",
"}",
"var",
"property",
"=",
"__properties",
"[",
"propertyName",
"]",
";",
"if",... | Gives information about what access should be granted for a given property of a DOM element of a given
type.
@param {String} tagName tag name (this is case insensitive, for example "a" and "A" are equivalent)
@param {String} propertyName property name (this is case sensitive)
@return {String} "--" for no access, "r-" f... | [
"Gives",
"information",
"about",
"what",
"access",
"should",
"be",
"granted",
"for",
"a",
"given",
"property",
"of",
"a",
"DOM",
"element",
"of",
"a",
"given",
"type",
"."
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/utils/sandbox/DOMProperties.js#L336-L349 | train | |
ariatemplates/ariatemplates | src/aria/Aria.js | function (path, context) {
if (!path || typeof(path) != 'string') {
Aria.$logError(Aria.NULL_CLASSPATH);
return false;
}
var classpathParts = path.split('.'), nbParts = classpathParts.length;
for (var index = 0; index < nbParts - 1; index++) {
if (!__c... | javascript | function (path, context) {
if (!path || typeof(path) != 'string') {
Aria.$logError(Aria.NULL_CLASSPATH);
return false;
}
var classpathParts = path.split('.'), nbParts = classpathParts.length;
for (var index = 0; index < nbParts - 1; index++) {
if (!__c... | [
"function",
"(",
"path",
",",
"context",
")",
"{",
"if",
"(",
"!",
"path",
"||",
"typeof",
"(",
"path",
")",
"!=",
"'string'",
")",
"{",
"Aria",
".",
"$logError",
"(",
"Aria",
".",
"NULL_CLASSPATH",
")",
";",
"return",
"false",
";",
"}",
"var",
"cl... | Classpath validation method
@param {String} path class path to validate - e.g. 'aria.jsunit.TestSuite'
@param {String} context additional context information
@return {Boolean} true if class path is OK | [
"Classpath",
"validation",
"method"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/Aria.js#L211-L226 | train | |
ariatemplates/ariatemplates | src/aria/Aria.js | function (className, context) {
context = context || '';
if (!className || !className.match(/^[_A-Z]\w*$/)) {
Aria.$logError(Aria.INVALID_CLASSNAME_FORMAT, [className, context]);
return false;
}
if (Aria.isJsReservedWord(className)) {
Aria.$logError(Ar... | javascript | function (className, context) {
context = context || '';
if (!className || !className.match(/^[_A-Z]\w*$/)) {
Aria.$logError(Aria.INVALID_CLASSNAME_FORMAT, [className, context]);
return false;
}
if (Aria.isJsReservedWord(className)) {
Aria.$logError(Ar... | [
"function",
"(",
"className",
",",
"context",
")",
"{",
"context",
"=",
"context",
"||",
"''",
";",
"if",
"(",
"!",
"className",
"||",
"!",
"className",
".",
"match",
"(",
"/",
"^[_A-Z]\\w*$",
"/",
")",
")",
"{",
"Aria",
".",
"$logError",
"(",
"Aria"... | Class name validation method
@param {String} className class name to validate - e.g. 'TestSuite'
@param {String} context additional context information
@return {Boolean} true if class path is OK | [
"Class",
"name",
"validation",
"method"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/Aria.js#L234-L245 | train | |
ariatemplates/ariatemplates | src/aria/Aria.js | function (packageName, context) {
context = context || '';
if (!packageName) {
Aria.$logError(Aria.INVALID_PACKAGENAME_FORMAT, [packageName, context]);
return false;
}
if (Aria.isJsReservedWord(packageName)) {
Aria.$logError(Aria.INVALID_PACKAGENAME_RE... | javascript | function (packageName, context) {
context = context || '';
if (!packageName) {
Aria.$logError(Aria.INVALID_PACKAGENAME_FORMAT, [packageName, context]);
return false;
}
if (Aria.isJsReservedWord(packageName)) {
Aria.$logError(Aria.INVALID_PACKAGENAME_RE... | [
"function",
"(",
"packageName",
",",
"context",
")",
"{",
"context",
"=",
"context",
"||",
"''",
";",
"if",
"(",
"!",
"packageName",
")",
"{",
"Aria",
".",
"$logError",
"(",
"Aria",
".",
"INVALID_PACKAGENAME_FORMAT",
",",
"[",
"packageName",
",",
"context"... | Package name validation method
@param {String} packageName package name to validate - e.g. 'TestSuite'
@param {String} context additional context information
@return {Boolean} true if class path is OK | [
"Package",
"name",
"validation",
"method"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/Aria.js#L253-L267 | train | |
ariatemplates/ariatemplates | src/aria/Aria.js | function (obj, def, superclass, fn, params) {
var newcall = (!obj["aria:nextCall"]);
if (!newcall && obj["aria:nextCall"] != def.$classpath) {
Aria.$logError(Aria.WRONGPARENT_CALLED, [fn, def.$classpath, obj["aria:nextCall"], obj.$classpath]);
}
obj["aria:nextCall"] = (superc... | javascript | function (obj, def, superclass, fn, params) {
var newcall = (!obj["aria:nextCall"]);
if (!newcall && obj["aria:nextCall"] != def.$classpath) {
Aria.$logError(Aria.WRONGPARENT_CALLED, [fn, def.$classpath, obj["aria:nextCall"], obj.$classpath]);
}
obj["aria:nextCall"] = (superc... | [
"function",
"(",
"obj",
",",
"def",
",",
"superclass",
",",
"fn",
",",
"params",
")",
"{",
"var",
"newcall",
"=",
"(",
"!",
"obj",
"[",
"\"aria:nextCall\"",
"]",
")",
";",
"if",
"(",
"!",
"newcall",
"&&",
"obj",
"[",
"\"aria:nextCall\"",
"]",
"!=",
... | Wrapper function for constructors or destructors on an object. It is used only when Aria.memCheckMode==true. When
the constructor or destructor of an object is called, this function is called, and this function calls the
corresponding constructor or destructor in the object definition and check that it calls its parent... | [
"Wrapper",
"function",
"for",
"constructors",
"or",
"destructors",
"on",
"an",
"object",
".",
"It",
"is",
"used",
"only",
"when",
"Aria",
".",
"memCheckMode",
"==",
"true",
".",
"When",
"the",
"constructor",
"or",
"destructor",
"of",
"an",
"object",
"is",
... | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/Aria.js#L303-L322 | train | |
ariatemplates/ariatemplates | src/aria/Aria.js | function (mergeTo, mergeFrom, classpathTo) {
var hasEvents = false;
for (var k in mergeFrom) {
if (mergeFrom.hasOwnProperty(k)) {
if (!hasEvents) {
hasEvents = true;
}
// The comparison with null below is important, as an em... | javascript | function (mergeTo, mergeFrom, classpathTo) {
var hasEvents = false;
for (var k in mergeFrom) {
if (mergeFrom.hasOwnProperty(k)) {
if (!hasEvents) {
hasEvents = true;
}
// The comparison with null below is important, as an em... | [
"function",
"(",
"mergeTo",
",",
"mergeFrom",
",",
"classpathTo",
")",
"{",
"var",
"hasEvents",
"=",
"false",
";",
"for",
"(",
"var",
"k",
"in",
"mergeFrom",
")",
"{",
"if",
"(",
"mergeFrom",
".",
"hasOwnProperty",
"(",
"k",
")",
")",
"{",
"if",
"(",... | Copies the content of mergeFrom into mergeTo. mergeFrom and mergeTo are maps of event definitions. If an event
declared in mergeFrom already exists in mergeTo, the error is logged and the event is not overriden.
@name Aria.__mergeEvents
@private
@method
@param {Object} mergeTo Destrination object (map of events).
@para... | [
"Copies",
"the",
"content",
"of",
"mergeFrom",
"into",
"mergeTo",
".",
"mergeFrom",
"and",
"mergeTo",
"are",
"maps",
"of",
"event",
"definitions",
".",
"If",
"an",
"event",
"declared",
"in",
"mergeFrom",
"already",
"exists",
"in",
"mergeTo",
"the",
"error",
... | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/Aria.js#L438-L454 | train | |
ariatemplates/ariatemplates | src/aria/storage/AbstractStorage.js | function (options) {
/**
* Whether the serializer instance should be disposed when this instance is disposed
* @type Boolean
* @protected
*/
this._disposeSerializer = false;
/**
* Callback for storage events
* @type aria.core.CfgBeans:Callba... | javascript | function (options) {
/**
* Whether the serializer instance should be disposed when this instance is disposed
* @type Boolean
* @protected
*/
this._disposeSerializer = false;
/**
* Callback for storage events
* @type aria.core.CfgBeans:Callba... | [
"function",
"(",
"options",
")",
"{",
"/**\n * Whether the serializer instance should be disposed when this instance is disposed\n * @type Boolean\n * @protected\n */",
"this",
".",
"_disposeSerializer",
"=",
"false",
";",
"/**\n * Callback for storage... | Create an abstract instance of storage
@param {aria.storage.Beans:ConstructorArgs} options Constructor options | [
"Create",
"an",
"abstract",
"instance",
"of",
"storage"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/storage/AbstractStorage.js#L48-L106 | train | |
ariatemplates/ariatemplates | src/aria/storage/AbstractStorage.js | function (event) {
if (event.key === null || event.namespace === this.namespace) {
var lessDetailedEvent = ariaUtilsJson.copy(event, false, this.EVENT_KEYS);
this.$raiseEvent(lessDetailedEvent);
}
} | javascript | function (event) {
if (event.key === null || event.namespace === this.namespace) {
var lessDetailedEvent = ariaUtilsJson.copy(event, false, this.EVENT_KEYS);
this.$raiseEvent(lessDetailedEvent);
}
} | [
"function",
"(",
"event",
")",
"{",
"if",
"(",
"event",
".",
"key",
"===",
"null",
"||",
"event",
".",
"namespace",
"===",
"this",
".",
"namespace",
")",
"{",
"var",
"lessDetailedEvent",
"=",
"ariaUtilsJson",
".",
"copy",
"(",
"event",
",",
"false",
",... | React to storage event coming from the EventBus. This function raises an Aria Templates event making sure
that it's not raised when namespacing is applied
@param {HTMLEvent} event Event raised by the browser | [
"React",
"to",
"storage",
"event",
"coming",
"from",
"the",
"EventBus",
".",
"This",
"function",
"raises",
"an",
"Aria",
"Templates",
"event",
"making",
"sure",
"that",
"it",
"s",
"not",
"raised",
"when",
"namespacing",
"is",
"applied"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/storage/AbstractStorage.js#L193-L198 | train | |
ariatemplates/ariatemplates | src/aria/tools/inspector/TemplateInspectorScript.js | function (event, widgetDesc) {
var widget = widgetDesc.widget;
var domElt = widget.getDom();
if (domElt) {
this.moduleCtrl.displayHighlight(domElt, "#FF6666");
}
this.mouseOver(event);
event.stopPropagation();
} | javascript | function (event, widgetDesc) {
var widget = widgetDesc.widget;
var domElt = widget.getDom();
if (domElt) {
this.moduleCtrl.displayHighlight(domElt, "#FF6666");
}
this.mouseOver(event);
event.stopPropagation();
} | [
"function",
"(",
"event",
",",
"widgetDesc",
")",
"{",
"var",
"widget",
"=",
"widgetDesc",
".",
"widget",
";",
"var",
"domElt",
"=",
"widget",
".",
"getDom",
"(",
")",
";",
"if",
"(",
"domElt",
")",
"{",
"this",
".",
"moduleCtrl",
".",
"displayHighligh... | Highlight a widget in the application on mouseover
@param {Object} event
@param {Object} widgetDesc description | [
"Highlight",
"a",
"widget",
"in",
"the",
"application",
"on",
"mouseover"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/tools/inspector/TemplateInspectorScript.js#L32-L40 | train | |
ariatemplates/ariatemplates | src/aria/tools/inspector/TemplateInspectorScript.js | function (event) {
this.data.showSource = !this.data.showSource;
if (this.data.showSource) {
this.data.initialSource = true;
var filePath = this.data.templateCtxt.tplClasspath.replace(/\./g, "/") + ".tpl";
this.data.source = this.moduleCtrl.getSour... | javascript | function (event) {
this.data.showSource = !this.data.showSource;
if (this.data.showSource) {
this.data.initialSource = true;
var filePath = this.data.templateCtxt.tplClasspath.replace(/\./g, "/") + ".tpl";
this.data.source = this.moduleCtrl.getSour... | [
"function",
"(",
"event",
")",
"{",
"this",
".",
"data",
".",
"showSource",
"=",
"!",
"this",
".",
"data",
".",
"showSource",
";",
"if",
"(",
"this",
".",
"data",
".",
"showSource",
")",
"{",
"this",
".",
"data",
".",
"initialSource",
"=",
"true",
... | Change visibility of source, and retrieve it if not available
@param {aria.DomEvent} event | [
"Change",
"visibility",
"of",
"source",
"and",
"retrieve",
"it",
"if",
"not",
"available"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/tools/inspector/TemplateInspectorScript.js#L114-L122 | train | |
ariatemplates/ariatemplates | src/aria/tools/inspector/TemplateInspectorScript.js | function (event) {
if (this.data.initialSource) {
ariaUtilsJson.setValue(this.data, "initialSource", false);
this.$refresh({
section : "controls"
});
}
this.data.tplSrcEdit = event.target.getValue();
} | javascript | function (event) {
if (this.data.initialSource) {
ariaUtilsJson.setValue(this.data, "initialSource", false);
this.$refresh({
section : "controls"
});
}
this.data.tplSrcEdit = event.target.getValue();
} | [
"function",
"(",
"event",
")",
"{",
"if",
"(",
"this",
".",
"data",
".",
"initialSource",
")",
"{",
"ariaUtilsJson",
".",
"setValue",
"(",
"this",
".",
"data",
",",
"\"initialSource\"",
",",
"false",
")",
";",
"this",
".",
"$refresh",
"(",
"{",
"sectio... | Edit source code of template
@param {aria.DomEvent} event | [
"Edit",
"source",
"code",
"of",
"template"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/tools/inspector/TemplateInspectorScript.js#L128-L136 | train | |
ariatemplates/ariatemplates | src/aria/templates/CSSParser.js | function (template, context, statements, throwErrors) {
this.context = context;
// Remove comments
this._prepare(template, throwErrors);
// Preprocess
if (!this.__preprocess(statements, throwErrors)) {
return null;
}
// ... | javascript | function (template, context, statements, throwErrors) {
this.context = context;
// Remove comments
this._prepare(template, throwErrors);
// Preprocess
if (!this.__preprocess(statements, throwErrors)) {
return null;
}
// ... | [
"function",
"(",
"template",
",",
"context",
",",
"statements",
",",
"throwErrors",
")",
"{",
"this",
".",
"context",
"=",
"context",
";",
"// Remove comments",
"this",
".",
"_prepare",
"(",
"template",
",",
"throwErrors",
")",
";",
"// Preprocess",
"if",
"(... | Parse the given CSS template and return a tree representing the template. Overrides aria.templates.Parser to
preprocess the text and escape curly brackets
@param {String} template to parse
@param {Object} context template context data, passes additional information the to error log
@param {Object} statements list of st... | [
"Parse",
"the",
"given",
"CSS",
"template",
"and",
"return",
"a",
"tree",
"representing",
"the",
"template",
".",
"Overrides",
"aria",
".",
"templates",
".",
"Parser",
"to",
"preprocess",
"the",
"text",
"and",
"escape",
"curly",
"brackets"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/templates/CSSParser.js#L44-L56 | train | |
ariatemplates/ariatemplates | src/aria/templates/CSSParser.js | function (dictionary, throwErrors) {
// Everyting starts on the first {
var text = this.template, utilString = ariaUtilsString, currentPosition = 0, nextOpening = -1, nextClosing = -1, wholeText = [], nameExtractor = /^\{[\s\/]*?([\w]+)\b/, lastCopiedPosition = 0, textLength = text.length, state... | javascript | function (dictionary, throwErrors) {
// Everyting starts on the first {
var text = this.template, utilString = ariaUtilsString, currentPosition = 0, nextOpening = -1, nextClosing = -1, wholeText = [], nameExtractor = /^\{[\s\/]*?([\w]+)\b/, lastCopiedPosition = 0, textLength = text.length, state... | [
"function",
"(",
"dictionary",
",",
"throwErrors",
")",
"{",
"// Everyting starts on the first {",
"var",
"text",
"=",
"this",
".",
"template",
",",
"utilString",
"=",
"ariaUtilsString",
",",
"currentPosition",
"=",
"0",
",",
"nextOpening",
"=",
"-",
"1",
",",
... | Preprocess the CSS template to escape any curly brackets that will break the tree build
@param {Object} dictionary list of statementes allowed by the class generator
@return {Boolean} true if preprocessing was done successfully or false if there was a mismatch between '{'
and '}'
@private | [
"Preprocess",
"the",
"CSS",
"template",
"to",
"escape",
"any",
"curly",
"brackets",
"that",
"will",
"break",
"the",
"tree",
"build"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/templates/CSSParser.js#L65-L139 | train | |
ariatemplates/ariatemplates | src/aria/touch/widgets/Button.js | function (event) {
if (event.type == "tapstart") {
this.timerId = ariaCoreTimer.addCallback({
fn : this._delayedHighlightCB,
scope : this,
delay : this._timeDelay
});
}
if (event.type == "tapc... | javascript | function (event) {
if (event.type == "tapstart") {
this.timerId = ariaCoreTimer.addCallback({
fn : this._delayedHighlightCB,
scope : this,
delay : this._timeDelay
});
}
if (event.type == "tapc... | [
"function",
"(",
"event",
")",
"{",
"if",
"(",
"event",
".",
"type",
"==",
"\"tapstart\"",
")",
"{",
"this",
".",
"timerId",
"=",
"ariaCoreTimer",
".",
"addCallback",
"(",
"{",
"fn",
":",
"this",
".",
"_delayedHighlightCB",
",",
"scope",
":",
"this",
"... | Manage the touch events defined by the widget itself
@param {HTMLEvent} event Native event | [
"Manage",
"the",
"touch",
"events",
"defined",
"by",
"the",
"widget",
"itself"
] | 7ed5d065818ae159bf361c9dfb209b1cf3883c90 | https://github.com/ariatemplates/ariatemplates/blob/7ed5d065818ae159bf361c9dfb209b1cf3883c90/src/aria/touch/widgets/Button.js#L132-L150 | 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.