_id
stringlengths 2
6
| title
stringlengths 0
58
| partition
stringclasses 3
values | text
stringlengths 52
373k
| language
stringclasses 1
value | meta_information
dict |
|---|---|---|---|---|---|
q57200
|
train
|
function (popup) {
var curZIndex = popup.getZIndex();
var newBaseZIndex = this.currentZIndex;
if (curZIndex === newBaseZIndex) {
// already top most, nothing to do in any case!
return;
}
// gets all popups supposed to be in front of this one, including this one
var openedPopups = this.openedPopups;
var popupsToKeepInFront = [];
var i, l;
for (i = openedPopups.length - 1; i >= 0; i--) {
var curPopup = openedPopups[i];
if (curPopup === popup || curPopup.conf.zIndexKeepOpenOrder) {
popupsToKeepInFront.unshift(curPopup);
if (curPopup.getZIndex() === newBaseZIndex) {
newBaseZIndex -= 10;
}
if (curPopup === popup) {
break;
}
}
}
if (i < 0 || newBaseZIndex + 10 === curZIndex) {
// either the popup is not in openedPopups (i < 0)
// or it is already correctly positioned (newBaseZIndex + 10 === curZIndex)
return;
}
var eventObject = {
name : "beforeBringingPopupsToFront",
popups : popupsToKeepInFront,
cancel : false
};
this.$raiseEvent(eventObject);
if (eventObject.cancel) {
return;
}
this.currentZIndex = newBaseZIndex;
for (i = 0, l = popupsToKeepInFront.length; i < l; i++) {
var curPopup = popupsToKeepInFront[i];
curPopup.setZIndex(this.getZIndexForPopup(curPopup));
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57201
|
train
|
function (event) {
var domEvent = /** @type aria.DomEvent */
new ariaDomEvent(event), target = /** @type HTMLElement */
domEvent.target;
if (this.openedPopups.length === 0) {
domEvent.$dispose();
return;
}
// restrict this to the popup on the top
var popup = /** @type aria.popups.Popup */
this.openedPopups[this.openedPopups.length - 1];
var ignoreClick = false;
for (var j = 0, length = popup._ignoreClicksOn.length; j < length; j++) {
if (utilsDom.isAncestor(target, popup._ignoreClicksOn[j])) {
ignoreClick = true;
break;
}
}
if (!(ignoreClick || utilsDom.isAncestor(target, popup.getDomElement()))) {
popup.closeOnMouseClick(domEvent);
}
var topPopup = this.findParentPopup(target);
if (topPopup) {
this.bringToFront(topPopup);
}
domEvent.$dispose();
}
|
javascript
|
{
"resource": ""
}
|
|
q57202
|
train
|
function (event) {
var domEvent = /** @type aria.DomEvent */
new ariaDomEvent(event);
var fromTarget = /** @type HTMLElement */
domEvent.target;
var toTarget = /** @type HTMLElement */
domEvent.relatedTarget;
for (var i = this.openedPopups.length - 1; i >= 0; i--) {
var popup = /** @type aria.popups.Popup */
this.openedPopups[i];
if (!utilsDom.isAncestor(toTarget, popup.getDomElement())
&& utilsDom.isAncestor(fromTarget, popup.getDomElement())) {
popup.closeOnMouseOut(domEvent);
}
}
domEvent.$dispose();
}
|
javascript
|
{
"resource": ""
}
|
|
q57203
|
train
|
function (event) {
var domEvent = /** @type aria.DomEvent */
new ariaDomEvent(event);
// Retrieve the dom target
var target = /** @type HTMLElement */
domEvent.target;
// Close first popup on the stack that can be closed
for (var i = this.openedPopups.length - 1; i >= 0; i--) {
var popup = /** @type aria.popups.Popup */
this.openedPopups[i];
if (!utilsDom.isAncestor(target, popup.getDomElement())) {
if (ariaCoreBrowser.isFirefox) {
// There's a strange bug in FF when wheelmouse'ing quickly raises an event which target is HTML instead of the popup
if (utilsDom.isAncestor(this._document.elementFromPoint(domEvent.clientX, domEvent.clientY), popup.getDomElement()))
continue;
}
var closed = popup.closeOnMouseScroll(domEvent);
if (closed) {
break;
}
}
}
domEvent.$dispose();
}
|
javascript
|
{
"resource": ""
}
|
|
q57204
|
train
|
function (popup) {
if (utilsArray.isEmpty(this.openedPopups)) {
this.connectEvents();
}
if (popup.modalMaskDomElement) {
if (this.modalPopups === 0) {
this.connectModalEvents();
this.$raiseEvent("modalPopupPresent");
}
this.modalPopups += 1;
}
this.openedPopups.push(popup);
this.$raiseEvent({
name : "popupOpen",
popup : popup
});
if (!ariaCoreBrowser.isIE7) {
// The navigation elements inserted by ensureElements make the following tests fail on IE 7:
// - test.aria.widgets.wai.popup.dialog.modal.FirstTest
// - test.aria.widgets.wai.popup.dialog.modal.FourthTest
// Those tests are blocked in _testFocusRestoration while waiting for the opening element to
// be focused again. It is not obvious why adding the navigation elements prevents the opening
// element from being correctly focused again when the dialog is closed... just an IE 7 bug!
// The issue seems not to happen if we do not remove the navigation elements from the DOM when
// the dialog is closed. However, instead of keeping those elements in the DOM a little longer
// (with a non-deterministic setTimeout), we simply avoid adding those elements on IE 7:
this._viewportNavigationInterceptor.ensureElements();
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57205
|
train
|
function (popup) {
var openedPopups = this.openedPopups;
utilsArray.remove(openedPopups, popup);
if (popup.modalMaskDomElement) {
this.modalPopups -= 1;
if (this.modalPopups === 0) {
this.disconnectModalEvents();
this.$raiseEvent("modalPopupAbsent");
this._viewportNavigationInterceptor.destroyElements();
}
}
if (utilsArray.isEmpty(openedPopups)) {
this.disconnectEvents();
}
var curZIndex = popup.getZIndex();
if (curZIndex === this.currentZIndex) {
this.currentZIndex -= 10;
}
this.$raiseEvent({
name : "popupClose",
popup : popup
});
}
|
javascript
|
{
"resource": ""
}
|
|
q57206
|
train
|
function (popup) {
if (utilsArray.contains(this.openedPopups, popup)) {
utilsArray.remove(this.openedPopups, popup);
}
if (utilsArray.contains(this.popups, popup)) {
utilsArray.remove(this.popups, popup);
}
if (utilsArray.isEmpty(this.openedPopups)) {
this.currentZIndex = this.baseZIndex;
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57207
|
train
|
function (domElement) {
var popups = this.popups;
for (var i = 0, l = popups.length; i < l; i++) {
var curPopup = popups[i];
if (curPopup.domElement == domElement) {
return curPopup;
}
}
return null;
}
|
javascript
|
{
"resource": ""
}
|
|
q57208
|
train
|
function (evt) {
if (this._inOnBoundPropertyChange) {
return;
}
if (evt.name == "update") {
if (evt.properties["startDate"]) {
this.setProperty("startDate", this._subTplData.settings.startDate);
}
} else if (evt.name == "dateClick") {
this.evalCallback(this._cfg.onclick, evt);
if (!evt.cancelDefault) {
this.dateSelect(evt.date);
}
} else if (evt.name == "dateMouseOver") {
this.evalCallback(this._cfg.onmouseover, evt);
} else if (evt.name == "dateMouseOut") {
this.evalCallback(this._cfg.onmouseout, evt);
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57209
|
train
|
function () {
var res = [];
var cfg = this._cfg;
if (cfg.fromDate || cfg.toDate) {
var cssPrefix = "x" + this._skinnableClass + "_" + this._cfg.sclass;
res.push({
fromDate : cfg.fromDate || cfg.toDate,
toDate : cfg.toDate || cfg.fromDate,
classes : {
from : cssPrefix + "_selected_from",
to : cssPrefix + "_selected_to",
fromTo : cssPrefix + "_selected_from_to",
sameFromTo : cssPrefix + "_selected_same_from_to"
}
});
}
var cfgRanges = cfg.ranges;
if (cfgRanges) {
res = res.concat(cfgRanges);
}
return res;
}
|
javascript
|
{
"resource": ""
}
|
|
q57210
|
train
|
function (propertyName, newValue, oldValue) {
this._inOnBoundPropertyChange = true;
try {
if (propertyName == "startDate") {
this._subTplModuleCtrl.navigate({}, {
date : newValue
});
} else if (propertyName == "fromDate" || propertyName == "toDate" || propertyName == "ranges") {
this._subTplModuleCtrl.setRanges(this._getRanges());
}
} finally {
this._inOnBoundPropertyChange = false;
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57211
|
train
|
function (domEvt) {
var domElt = this.getDom();
if (this.sendKey(domEvt.charCode, domEvt.keyCode)) {
domEvt.preventDefault(true);
domElt.focus();
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57212
|
train
|
function () {
this._plannedFocusUpdate = null;
if (this._focusStyle == this._hasFocus) {
// nothing to do!
return;
}
var moduleCtrl = this._subTplModuleCtrl, dom = this.getDom();
if (moduleCtrl && dom && this._cfg.tabIndex != null && this._cfg.tabIndex >= 0) {
var preventDefaultVisualAspect = moduleCtrl.notifyFocusChanged(this._hasFocus);
if (!preventDefaultVisualAspect) {
var domEltStyle = dom.style;
var visualFocusStyle = (aria.utils.VisualFocus) ? aria.utils.VisualFocus.getStyle() : null;
if (this._hasFocus) {
if (ariaCoreBrowser.isIE7) {
domEltStyle.border = "1px dotted black";
domEltStyle.padding = "0px";
} else {
if (visualFocusStyle == null) {
domEltStyle.outline = "1px dotted black";
}
}
} else {
if (ariaCoreBrowser.isIE7) {
domEltStyle.border = "0px";
domEltStyle.padding = "1px";
} else {
if (visualFocusStyle == null) {
domEltStyle.outline = "none";
}
}
}
}
if (this._hasFocus) {
moduleCtrl.selectDay({
date : this._cfg.fromDate || this._cfg.toDate,
ensureVisible : false
});
} else {
moduleCtrl.selectDay({
date : null
});
}
this._focusStyle = this._hasFocus;
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57213
|
train
|
function (charCode, keyCode) {
var moduleCtrl = this._subTplModuleCtrl;
if (moduleCtrl) {
var value = this._subTplData.settings.value;
if ((keyCode == 13 || keyCode == 32) && value) {
// SPACE or ENTER -> call dateSelect
this.dateSelect(value);
return true;
} else {
return moduleCtrl.keyevent({
charCode : charCode,
keyCode : keyCode
});
}
} else {
return false;
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57214
|
train
|
function (options, storage, throwIfMissing) {
this.$AbstractStorage.constructor.call(this, options);
/**
* Type of html5 storage. E.g. localStorage, sessionStorage
* @type String
*/
this.type = storage;
/**
* Keep a reference to the global storage object
* @type Object
*/
this.storage = Aria.$window[storage];
/**
* Event Callback for storage event happening on different windows
* @type aria.core.CfgBeans:Callback
*/
this._browserEventCb = null;
if (!this.storage && throwIfMissing !== false) {
// This might have been created by AbstractStorage
if (this._disposeSerializer && this.serializer) {
this.serializer.$dispose();
}
this.$logError(this.UNAVAILABLE, [this.type]);
throw new Error(this.type);
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57215
|
train
|
function (event) {
// In FF 3.6 this event is raised also inside the same window
if (aria.storage.EventBus.stop) {
return;
}
var isInteresting = this.namespace
? event.key.substring(0, this.namespace.length) === this.namespace
: true;
if (isInteresting) {
var oldValue = event.oldValue, newValue = event.newValue;
if (oldValue) {
try {
oldValue = this.serializer.parse(oldValue);
} catch (e) {}
}
if (newValue) {
try {
newValue = this.serializer.parse(newValue);
} catch (e) {}
}
this._onStorageEvent({
name : "change",
key : event.key,
oldValue : oldValue,
newValue : newValue,
url : event.url,
namespace : this.namespace
});
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57216
|
train
|
function () {
if (!this.storage) {
return;
}
var listeners = !!this._listeners;
var registeredBrowserEvent = !!this._browserEventCb;
if (listeners !== registeredBrowserEvent) {
if (listeners) {
this._browserEventCb = {
fn : this._browserEvent,
scope : this
};
// listen to events raised by instances in a different window but the same storage location
ariaUtilsEvent.addListener(Aria.$window, "storage", this._browserEventCb);
} else {
ariaUtilsEvent.removeListener(Aria.$window, "storage", this._browserEventCb);
this._browserEventCb = null;
}
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57217
|
train
|
function () {
this.$Test._endTest.call(this);
this.checkExpectedEventListEnd();
this.resetClassOverrides();
this.assertLogsEmpty(false, false);
this._assertCount = 0;
this._currentTestName = '';
this._isFinished = true;
this.$raiseEvent({
name : "end",
testObject : this,
testClass : this.$classpath,
nbrOfAsserts : this._totalAssertCount
});
}
|
javascript
|
{
"resource": ""
}
|
|
q57218
|
train
|
function (value, optMsg) {
this._assertCount++;
this._totalAssertCount++;
if (value !== true) {
var msg = "Assert #" + this._assertCount + " failed";
if (optMsg) {
msg += " : " + optMsg;
}
this.raiseFailure(msg);
if (console && ariaUtilsType.isFunction(console.trace)) {
console.assert(false, "Stack trace for failed Assert #" + this._assertCount + " in test : ["
+ this._currentTestName + "]");
}
// raise an exception to stop subsequent
throw {
name : this.ASSERT_FAILURE,
message : msg
};
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57219
|
train
|
function (errorMsg, count) {
var res = null;
var logAppender = this._logAppender;
var logs = logAppender.getLogs(), errFound = false, newLogs = [];
if (!errorMsg) {
this.assertTrue(false, "assertErrorInLogs was called with a null error message.");
}
if (count && count > 0) {
res = [];
var localCount = 0;
for (var i = 0; logs.length > i; i++) {
if (localCount < count && logs[i].msgId == errorMsg) {
localCount++;
res.push(logs[i]);
} else {
newLogs.push(logs[i]);
}
}
logAppender.setLogs(newLogs);
this.assertTrue(localCount == count, "Expected error " + errorMsg + " found " + localCount
+ " times in logs");
} else {
for (var i = 0; logs.length > i; i++) {
if (logs[i].msgId == errorMsg) {
errFound = true;
res = logs[i];
} else {
newLogs.push(logs[i]);
}
}
logAppender.setLogs(newLogs);
this.assertTrue(errFound, "Expected error not found in logs: " + errorMsg);
}
return res;
}
|
javascript
|
{
"resource": ""
}
|
|
q57220
|
train
|
function (evtName) {
for (var i = 0; i < this.evtLogs.length; i++) {
if (this.evtLogs[i].name == evtName) {
return this.evtLogs[i];
}
}
return null;
}
|
javascript
|
{
"resource": ""
}
|
|
q57221
|
train
|
function () {
if (this._expectedEventsList != null) {
this.$raiseEvent({
name : "failure",
testClass : this.$classpath,
testState : this._currentTestName,
description : 'Not all expected events have occured. First missing event (#'
+ this._eventIndexInList + '): '
+ this._expectedEventsList[this._eventIndexInList].name
});
this._expectedEventsList = null;
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57222
|
train
|
function (initialClass, mockClass) {
if (this._overriddenClasses == null) {
this._overriddenClasses = {};
}
var cacheKey = Aria.getLogicalPath(initialClass, ".js", true);
var clsInfos = this._overriddenClasses[initialClass];
if (clsInfos == null) { // only save the previous class if it was not already overridden
var currentClass = Aria.nspace(initialClass);
if (currentClass == null) {
return; // invalid namespace
}
var idx = initialClass.lastIndexOf('.');
if (idx > -1) {
clsInfos = {
clsNs : initialClass.slice(0, idx),
clsName : initialClass.slice(idx + 1),
initialClass : currentClass
};
} else {
clsInfos = {
clsNs : '',
clsName : initialClass,
initialClass : currentClass
};
}
clsInfos.cachedModule = require.cache[cacheKey];
this._overriddenClasses[initialClass] = clsInfos;
}
// alter the global classpath to point to the mock
var ns = Aria.nspace(clsInfos.clsNs);
ns[clsInfos.clsName] = mockClass;
// also alter require cache
delete require.cache[cacheKey];
var currentContext = require("noder-js/currentContext");
var modull;
if (currentContext) {
modull = currentContext.getModule(cacheKey);
} else {
modull = {
id : cacheKey,
filename : cacheKey
};
require.cache[cacheKey] = modull;
}
modull.exports = mockClass;
modull.loaded = true;
modull.preloaded = true;
}
|
javascript
|
{
"resource": ""
}
|
|
q57223
|
train
|
function () {
if (this._overriddenClasses != null) {
for (var i in this._overriddenClasses) {
var clsInfos = this._overriddenClasses[i];
// restore the global classpath to point to the original
var ns = Aria.nspace(clsInfos.clsNs);
ns[clsInfos.clsName] = clsInfos.initialClass;
// also restore require cache
var initialClasspath = clsInfos.clsNs + "." + clsInfos.clsName;
var cacheKey = Aria.getLogicalPath(initialClasspath, ".js", true);
require.cache[cacheKey] = clsInfos.cachedModule;
}
this._overriddenClasses = null;
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57224
|
train
|
function () {
if (this._isProcessing) {
return;
}
this.$assert(33, this._logicalPaths.length > 0);
this._isProcessing = true;
(require("./IO")).asyncRequest({
sender : {
classpath : this.$classpath,
logicalPaths : this._logicalPaths
},
url : require("./DownloadMgr").getURLWithTimestamp(this._url), // add a timestamp to the URL if
// required
callback : {
fn : this._onFileReceive,
onerror : this._onFileReceive,
scope : this
},
expectedResponseType : "text"
});
}
|
javascript
|
{
"resource": ""
}
|
|
q57225
|
train
|
function (args, ex) {
if (ex) {
this.$logError(this.EXCEPTION_CREATING_MODULECTRL, [args.desc.classpath], ex);
}
this.$callback(args.cb, {
error : true
});
}
|
javascript
|
{
"resource": ""
}
|
|
q57226
|
train
|
function (desc, cb, skipInit) {
var args = {
desc : desc,
cb : cb,
skipInit : skipInit
};
createModuleCtrl.call(this, args);
}
|
javascript
|
{
"resource": ""
}
|
|
q57227
|
train
|
function (moduleCtrlPrivate, subModulesArray, cb) {
var res = getModulePrivateInfoWithCheck(moduleCtrlPrivate, "loadSubModules");
if (!res) {
return this.$callback(cb, {
error : true
});
}
loadSubModules.call(this, res, subModulesArray, cb, false /* these are not custom modules */);
}
|
javascript
|
{
"resource": ""
}
|
|
q57228
|
train
|
function (moduleCtrlPrivate) {
if (moduleCtrlPrivate == null) {
return false;
}
var k = moduleCtrlPrivate[MODULECTRL_ID_PROPERTY];
var res = modulesPrivateInfo[k];
if (!res) {
return false;
}
if (res.moduleCtrlPrivate != moduleCtrlPrivate) {
return false;
}
var subModuleInfos = res.subModuleInfos;
return (subModuleInfos != null);
}
|
javascript
|
{
"resource": ""
}
|
|
q57229
|
train
|
function (moduleCtrlPrivate, cb) {
var res = getModulePrivateInfoWithCheck(moduleCtrlPrivate, "reloadModuleCtrl");
if (!res) {
// error is already logged
return;
}
var subModuleInfos = res.subModuleInfos;
if (subModuleInfos == null) {
this.$logError(this.RELOAD_ONLY_FOR_SUBMODULES, [moduleCtrlPrivate.$classpath]);
return;
}
var parentModule = subModuleInfos.parentModule;
this.$assert(668, parentModule != null);
var oldModuleCtrl = res.moduleCtrl;
var oldFlowCtrl = res.flowCtrl;
var classMgr = ariaCoreClassMgr;
var toBeUnloaded = [moduleCtrlPrivate.$classpath, moduleCtrlPrivate.$publicInterfaceName];
var flowCtrlPrivate = res.flowCtrlPrivate;
if (flowCtrlPrivate) {
toBeUnloaded[2] = flowCtrlPrivate.$classpath;
toBeUnloaded[3] = flowCtrlPrivate.$publicInterfaceName;
}
var objectLoading = new ariaTemplatesObjectLoading();
moduleCtrlPrivate.__$reloadingObject = objectLoading;
moduleCtrlPrivate.$dispose();
for (var i = 0, l = toBeUnloaded.length; i < l; i++) {
classMgr.unloadClass(toBeUnloaded[i], true);
}
loadSubModules.call(this, parentModule, [subModuleInfos.subModuleDesc], {
fn : reloadModuleCtrlCb,
scope : this,
args : {
objectLoading : objectLoading,
oldModuleCtrl : oldModuleCtrl,
oldFlowCtrl : oldFlowCtrl,
callback : cb
}
}, subModuleInfos.customModule);
}
|
javascript
|
{
"resource": ""
}
|
|
q57230
|
train
|
function (moduleCtrlPrivate) {
var k = moduleCtrlPrivate[MODULECTRL_ID_PROPERTY];
var res = getModulePrivateInfoWithCheck(moduleCtrlPrivate, "notifyModuleCtrlDisposed");
if (!res) {
// error is already logged
return;
}
res.isDisposing = true;
var subModuleInfos = res.subModuleInfos;
var parentModule = subModuleInfos ? subModuleInfos.parentModule : null;
if (parentModule && !parentModule.isDisposing) {
// This module is a sub-module and its parent module is not being disposed
// remove the module from parent array of sub-modules
ariaUtilsArray.remove(parentModule.subModules, moduleCtrlPrivate);
// remove module controller from refpath:
putSubModuleAtRefPath.call(this, parentModule, subModuleInfos.subModuleDesc, null, subModuleInfos.customModule);
}
// dispose sub-modules (including custom modules):
var subModules = res.subModules;
if (subModules) {
for (var i = subModules.length - 1; i >= 0; i--) {
try {
subModules[i].$dispose();
} catch (ex) {
// an error when disposing a sub-module must never prevent the parent module to be disposed
// (especially if the child module is a custom module)
this.$logError(this.EXCEPTION_SUBMODULE_DISPOSE, [moduleCtrlPrivate.$classpath,
subModules[i].$classpath], ex);
}
}
res.subModules = null;
}
modulesPrivateInfo[k] = null;
delete modulesPrivateInfo[k];
if (res.flowCtrlPrivate) {
res.flowCtrlPrivate.$dispose();
res.flowCtrlPrivate = null;
res.flowCtrl = null;
}
res.moduleCtrl = null;
res.moduleCtrlPrivate = null;
res.subModuleInfos = null;
}
|
javascript
|
{
"resource": ""
}
|
|
q57231
|
train
|
function (widgetName, skinClass, skipError) {
var widgetSkinObj = this.getSkinClasses(widgetName);
if (widgetSkinObj) {
if (skinClass == null) {
skinClass = 'std';
}
var skinClassObj = widgetSkinObj[skinClass];
if (skinClassObj) {
return skinClassObj;
} else if (!skipError) {
this.$logWarn(this.WIDGET_SKIN_CLASS_OBJECT_NOT_FOUND, [skinClass, widgetName]);
return widgetSkinObj.std;
}
return null;
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57232
|
train
|
function (widgetName) {
var widgetSkinObj = aria.widgets.AriaSkin.skinObject[widgetName];
if (!widgetSkinObj || !widgetSkinObj['aria:skinNormalized']) {
var newValue = ariaWidgetsAriaSkinNormalization.normalizeWidget(widgetName, widgetSkinObj);
if (newValue && newValue != widgetSkinObj) {
widgetSkinObj = newValue;
aria.widgets.AriaSkin.skinObject[widgetName] = newValue;
}
}
return widgetSkinObj;
}
|
javascript
|
{
"resource": ""
}
|
|
q57233
|
train
|
function (sprite, icon) {
var curSprite = this.getSkinObject("Icon", sprite, true), iconContent, iconLeft = 0, iconTop = 0;
if (curSprite && (iconContent = curSprite.content[icon]) !== undefined) {
if (curSprite.biDimensional) {
var XY = iconContent.split("_");
iconLeft = (curSprite.iconWidth + curSprite.spriteSpacing) * XY[0];
iconTop = (curSprite.iconHeight + curSprite.spriteSpacing) * XY[1];
} else if (curSprite.direction === "x") {
iconLeft = (curSprite.iconWidth + curSprite.spriteSpacing) * iconContent;
} else if (curSprite.direction === "y") {
iconTop = (curSprite.iconHeight + curSprite.spriteSpacing) * iconContent;
}
return {
"iconLeft" : iconLeft,
"iconTop" : iconTop,
"cssClass" : "xICN" + sprite,
"spriteURL" : curSprite.spriteURL,
"width" : curSprite.iconWidth,
"height" : curSprite.iconHeight,
"borderLeft" : curSprite.borderLeft,
"borderRight" : curSprite.borderRight,
"borderTop" : curSprite.borderTop,
"borderBottom" : curSprite.borderBottom
};
}
return false;
}
|
javascript
|
{
"resource": ""
}
|
|
q57234
|
train
|
function (object, images) {
if (object) {
var skinImageProperties = this.skinImageProperties;
for (var i = 0, l = skinImageProperties.length; i < l; i++) {
var propName = skinImageProperties[i];
var value = object[propName];
if (value) {
images[value] = 1;
}
}
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57235
|
train
|
function (color, imageurl, otherparams) {
var fullUrl = "";
var gifUrl = "";
if (imageurl) {
var imageFullUrl = /^(data|https?):/i.test(imageurl) ? imageurl : this.getSkinImageFullUrl(imageurl);
fullUrl = "url(" + imageFullUrl + ") ";
if (ariaUtilsString.endsWith(imageurl, ".png")) {
gifUrl = imageFullUrl.substring(0, imageFullUrl.length - 4) + ".gif";
} else {
gifUrl = imageFullUrl;
}
}
var rule = ["background: ", color, " ", fullUrl, otherparams, ";"];
if (gifUrl) {
rule.push("_background-image: url(", gifUrl, ") !important;");
}
return rule.join("");
}
|
javascript
|
{
"resource": ""
}
|
|
q57236
|
train
|
function (evt) {
this.$DropDownTextInput._frame_events.apply(this, arguments);
if (evt.event.hasPreventDefault) {
evt.event.stopPropagation();
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57237
|
train
|
function (evt) {
// when clicking on a date in the calendar, close the calendar, and save the date
var date = evt.date;
this._closeDropdown();
var report = this.controller.checkValue(date);
this._reactToControllerReport(report);
}
|
javascript
|
{
"resource": ""
}
|
|
q57238
|
train
|
function (property, targetCfg) {
var cfg = this._cfg, skinObj = this._skinObj;
var calendarProp = 'calendar' + property.substring(0, 1).toUpperCase() + property.substring(1);
targetCfg[property] = (typeof cfg[calendarProp] != 'undefined')
? cfg[calendarProp]
: skinObj.calendar[property];
}
|
javascript
|
{
"resource": ""
}
|
|
q57239
|
train
|
function (domEvtWrapper) {
if (domEvtWrapper.keyCode === 32) {
domEvtWrapper.charCode = 32;
}
if (this._isShiftF10Pressed(domEvtWrapper)) {
this._toggleDropdown();
return;
}
this._handleKey(domEvtWrapper);
}
|
javascript
|
{
"resource": ""
}
|
|
q57240
|
train
|
function (proto) {
// Using push instead of resetting the reference because items are not copied from proto but from the
// parameter of tplScriptDefinition directly
proto.ICONS.push({
type : ariaUtilsData.TYPE_ERROR,
icon : "std:error"
}, {
type : ariaUtilsData.TYPE_WARNING,
icon : "std:warning"
}, {
type : ariaUtilsData.TYPE_INFO,
icon : "std:info"
}, {
type : ariaUtilsData.TYPE_FATAL,
icon : "std:error"
}, {
type : ariaUtilsData.TYPE_NOTYPE,
icon : "std:info"
}, {
type : ariaUtilsData.TYPE_CRITICAL_WARNING,
icon : "std:warning"
}, {
type : ariaUtilsData.TYPE_CONFIRMATION,
icon : "std:confirm"
});
}
|
javascript
|
{
"resource": ""
}
|
|
q57241
|
train
|
function () {
var messageTypes = this.data.messageTypes;
var res = this.DEFAULT_ICON;
var icons = this.ICONS;
for (var i = 0, l = icons.length; i < l; i++) {
var curIcon = icons[i];
if (messageTypes[curIcon.type] > 0) {
res = curIcon.icon;
break;
}
}
return res;
}
|
javascript
|
{
"resource": ""
}
|
|
q57242
|
train
|
function (msg) {
if (this.data.displayCodes && (msg.code || msg.code === 0)) {
return msg.localizedMessage + " (" + msg.code + ")";
}
return msg.localizedMessage;
}
|
javascript
|
{
"resource": ""
}
|
|
q57243
|
train
|
function (pageId, moduleId) {
var isCommon = (moduleId.indexOf("common:") != -1);
var refpath = this.buildModuleRefpath(moduleId.replace(/^common:/, ""), isCommon, pageId);
return this._utils.resolvePath(refpath, this);
}
|
javascript
|
{
"resource": ""
}
|
|
q57244
|
train
|
function (pageId, modulesDescription, callback) {
var definitions = [];
var descriptions = [];
var modules, refpath, isCommon, def;
var loopArray = [{
modules : modulesDescription.page,
isCommon : false
}, {
modules : modulesDescription.common,
isCommon : true
}];
for (var j = 0; j < 2; j++) {
modules = loopArray[j].modules;
isCommon = loopArray[j].isCommon;
for (var i = 0, len = modules.length; i < len; i += 1) {
refpath = this.buildModuleRefpath(modules[i].refpath, isCommon, pageId);
if (this._utils.resolvePath(refpath, this) == null) {
def = ariaUtilsJson.copy(modules[i]);
def.refpath = refpath;
definitions.push({
classpath : def.classpath,
initArgs : this._injectPageEngine(def.initArgs),
refpath : refpath
});
descriptions.push(def);
this._addRefpath(pageId, isCommon, refpath);
}
}
}
this.loadSubModules(definitions, {
fn : this.createServices,
scope : this,
resIndex : -1,
args : {
pageId : pageId,
callback : callback,
modules : descriptions
}
});
}
|
javascript
|
{
"resource": ""
}
|
|
q57245
|
train
|
function (args) {
var modules = args.modules;
for (var i = 0; i < modules.length; i += 1) {
var services = modules[i].services, refpath = modules[i].refpath, moduleInstance = this._utils.resolvePath(refpath, this);
if (services) {
for (var service in services) {
if (services.hasOwnProperty(service) && !this.json.isMetadata(service)) {
if (this.services[service]) {
this.$logWarn(this.SERVICE_ALREADY_DEFINED, service);
}
if (ariaUtilsType.isFunction(moduleInstance[services[service]])) {
this.services[service] = ariaUtilsFunction.bind(moduleInstance[services[service]], moduleInstance);
if (this._serviceList[refpath]) {
this._serviceList[refpath].push(service);
} else {
this._serviceList[refpath] = [service];
}
} else {
this.$logError(this.SERVICE_METHOD_NOT_FOUND, [services[service],
moduleInstance.$classpath]);
}
}
}
}
}
this.connectBindings(args);
}
|
javascript
|
{
"resource": ""
}
|
|
q57246
|
train
|
function (modRefpaths) {
var refpath;
for (var i = 0, len = modRefpaths.length; i < len; i++) {
refpath = modRefpaths[i];
this._disconnectModuleBindings(refpath);
this.disposeSubModule(this._utils.resolvePath(refpath, this));
if (this._serviceList[refpath]) {
for (var i = 0; i < this._serviceList[refpath].length; i++) {
delete this.services[this._serviceList[refpath][i]];
}
delete this._serviceList[refpath];
}
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57247
|
train
|
function (pageId) {
var modRefpaths = (pageId && this._modulesPaths.page[pageId]) ? this._modulesPaths.page[pageId] : [];
this._unloadModules(modRefpaths);
delete this._modulesPaths.page[pageId];
}
|
javascript
|
{
"resource": ""
}
|
|
q57248
|
train
|
function () {
this.unloadCommonModules();
var pageModRefpaths = this._modulesPaths.page;
for (var pageId in pageModRefpaths) {
if (pageModRefpaths.hasOwnProperty(pageId)) {
this.unloadPageModules(pageId);
}
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57249
|
train
|
function (pageId, isCommon, refpath) {
var modulesPath = this._modulesPaths;
if (isCommon) {
modulesPath.common.push(refpath);
return;
}
modulesPath.page[pageId] = modulesPath.page[pageId] || [];
modulesPath.page[pageId].push(refpath);
}
|
javascript
|
{
"resource": ""
}
|
|
q57250
|
train
|
function (refpath) {
var bindings = this._bindings[refpath];
if (bindings) {
for (var bind in bindings) {
if (bindings.hasOwnProperty(bind)) {
var moduleDescription = this._getModuleDataDescription(refpath, bind);
this.json.removeListener(moduleDescription.container, moduleDescription.property, bindings[bind][1], true);
}
}
delete this._bindings[refpath];
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57251
|
train
|
function () {
var bindings = this._bindings;
for (var refpath in bindings) {
if (bindings.hasOwnProperty(refpath)) {
var moduleBindings = bindings[refpath];
for (var bind in moduleBindings) {
if (moduleBindings.hasOwnProperty(bind)) {
var moduleDataDescription = this._getModuleDataDescription(refpath, bind);
var location = this._getStorage(moduleBindings[bind][0]);
var storedValue = this._utils.resolvePath(location.path, location.storage);
this.json.setValue(moduleDataDescription.container, moduleDataDescription.property, storedValue, moduleBindings[bind][1]);
}
}
}
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57252
|
train
|
function (refpath, bind) {
var moduleData = this._utils.resolvePath(refpath, this._data);
// If the path is not present in the module, set it to null
if (!this._utils.resolvePath(bind, moduleData)) {
this._pathUtils.setValue(moduleData, bind, null);
}
return this._pathUtils.describe(moduleData, bind);
}
|
javascript
|
{
"resource": ""
}
|
|
q57253
|
train
|
function (res, args) {
var newValue = args.moduleDescription.container[args.moduleDescription.property];
var boundTo = args.boundTo;
if (this._utils.resolvePath(boundTo.path, boundTo.storage) == null) {
this._pathUtils.setValue(boundTo.storage, boundTo.path, null);
}
var dataDesc = this._pathUtils.describe(boundTo.storage, boundTo.path);
this.json.setValue(dataDesc.container, dataDesc.property, newValue);
}
|
javascript
|
{
"resource": ""
}
|
|
q57254
|
train
|
function (event) {
if (this._cfg.autoFill && event.domEvent) {
// Closing the dropdown after typing is not a domEvent
var value = this.controller.getDataModel().value;
if (value != null) {
var report = this.controller.checkDropdownValue(value);
this._reactToControllerReport(report);
}
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57255
|
train
|
function(event, cb) {
if (this._cfg.waiAria) {
var field = this.getTextInputField();
var listWidget = this.controller.getListWidget();
var ariaActiveDescendant = listWidget ? listWidget.getSelectedOptionDomId() : null;
if (ariaActiveDescendant != null) {
field.setAttribute("aria-activedescendant", ariaActiveDescendant);
} else {
field.removeAttribute("aria-activedescendant");
}
}
if (cb) {
this.$callback(cb, event);
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57256
|
train
|
function () {
if (this._cfg.waiAria) {
var field = this.getTextInputField();
field.removeAttribute("aria-owns");
var dropDownIcon = this._getDropdownIcon();
if (dropDownIcon) {
dropDownIcon.setAttribute("aria-expanded", "false");
}
}
this.$DropDownListTrait._afterDropdownClose.apply(this, arguments);
}
|
javascript
|
{
"resource": ""
}
|
|
q57257
|
train
|
function (conf) {
this.conf = conf;
if (conf.waiAria == null) {
conf.waiAria = environment.isWaiAria();
}
ariaCoreJsonValidator.normalize({
json : conf,
beanName : "aria.popups.Beans.PopupConf"
});
if (this.modalMaskDomElement) {
ariaUtilsDom.removeElement(this.modalMaskDomElement);
this.modalMaskDomElement = null;
}
this.popupContainer = (conf.popupContainer || ViewportPopupContainer).$interface("aria.popups.container.IPopupContainer");
if (conf.modal) {
this.modalMaskDomElement = this._createMaskDomElement(conf.maskCssClass);
}
if (this.domElement != null) {
ariaUtilsDom.removeElement(this.domElement);
}
this.domElement = this._createDomElement();
this.setPreferredPositions(conf.preferredPositions);
this.setSection(conf.section);
if (!conf.center) {
if (!conf.absolutePosition || conf.domReference) {
this.setReference(conf.domReference);
} else {
this.setPositionAsReference(conf.absolutePosition);
}
} else {
this.setPositionAsReference(this._getPosition(this._getFreeSize()));
}
this._ignoreClicksOn = conf.ignoreClicksOn;
this._parentDialog = conf.parentDialog;
}
|
javascript
|
{
"resource": ""
}
|
|
q57258
|
train
|
function () {
var document = this._document;
var cfg = this.conf;
var div = document.createElement("div");
div.style.cssText = "position:absolute;top:-15000px;left:-15000px;";
document.body.appendChild(div);
var html = [
"<div ",
ariaUtilsDelegate.getMarkup(this._delegateId),
' style="position:absolute;top:-15000px;left:-15000px;visibility:hidden;display:block;"'
];
if (cfg.waiAria) {
var role = cfg.role;
if (role) {
role = ariaUtilsString.escapeForHTML(role, {attr: true});
html.push(' role="' + role + '"');
}
var labelId = cfg.labelId;
if (labelId) {
labelId = ariaUtilsString.escapeForHTML(labelId, {attr: true});
html.push(' aria-labelledby="' + labelId + '"');
}
}
html.push("></div>");
div.innerHTML = html.join('');
var domElement = div.firstChild;
document.body.removeChild(div);
return this.popupContainer.getContainerElt().appendChild(domElement);
}
|
javascript
|
{
"resource": ""
}
|
|
q57259
|
train
|
function (className) {
var document = this._document;
var div = document.createElement("div");
div.className = className || "xModalMask-default";
div.style.cssText = "position:absolute;top:-15000px;left:-15000px;visibility:hidden;display:block;";
return this.popupContainer.getContainerElt().appendChild(div);
}
|
javascript
|
{
"resource": ""
}
|
|
q57260
|
train
|
function (size) {
var position, isInViewSet;
if (this.conf.maximized) {
var offset = this.conf.offset;
var containerScroll = this.popupContainer.getContainerScroll();
position = {
top : containerScroll.scrollTop - offset.top,
left : containerScroll.scrollLeft - offset.left
};
} else if (this.conf.center) {
// apply the offset (both left and right, and also top and bottom)
// before centering the whole thing in the container
var offset = this.conf.offset;
var newSize = {
width : size.width + offset.left + offset.right,
height : size.height + offset.top + offset.bottom
};
position = this.popupContainer.centerInside(newSize, this.reference);
position = this.popupContainer.fitInside(position, newSize, this.reference);
} else {
var i = 0, preferredPosition;
do {
preferredPosition = this.preferredPositions[i];
// Calculate position for a given anchor
position = this._getPositionForAnchor(preferredPosition, size);
// If this position+size is out of the container, try the
// next anchor available
isInViewSet = this.popupContainer.isInside(position, size);
i++;
} while (!isInViewSet && this.preferredPositions[i]);
var positionEvent = {
name : "onPositioned"
};
// If all anchors setting were out of the container, fallback
if (!isInViewSet) {
// Currently simply fallback to first anchor ...
position = this._getPositionForAnchor(this.preferredPositions[0], size);
position = this.popupContainer.fitInside(position, size);
} else {
positionEvent.position = this.preferredPositions[i - 1];
}
this.$raiseEvent(positionEvent);
}
return position;
}
|
javascript
|
{
"resource": ""
}
|
|
q57261
|
train
|
function () {
if (!this.domElement) {
return;
}
if (this.conf.animateOut) {
this._startAnimation(this.conf.animateOut, {
from : this.domElement,
type : 1
}, true);
} else {
this.domElement.style.cssText = "position:absolute;display:none;overflow:auto;";
}
if (this.modalMaskDomElement) {
// if there was was an animation defined we need to fade out the background for model popups
if (this.conf.animateIn) {
this._getMaskAnimator().start("fade reverse", {
from : this.modalMaskDomElement,
type : 1
});
} else {
this.modalMaskDomElement.style.cssText = "position:absolute;display:none";
}
if (this._containerOverflow != -1) {
this.popupContainer.changeContainerOverflow(this._containerOverflow);
this._containerOverflow = -1;
}
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57262
|
train
|
function (conf) {
if (conf) {
if ("center" in conf) {
this.conf.center = conf.center;
}
if ("absolutePosition" in conf) {
this.setPositionAsReference(conf.absolutePosition);
}
}
this.refresh();
this.refreshProcessingIndicators();
}
|
javascript
|
{
"resource": ""
}
|
|
q57263
|
train
|
function (domEvent) {
if (this.conf.closeOnMouseClick) {
var event = {
name : "onMouseClickClose",
cancelClose : false,
domEvent : domEvent
};
this.$raiseEvent(event);
// timeout needed by IE for the PTR07394450 : it allows the browser to move the focus (asynchronous in
// IE), before to close the popup
if (ariaCoreBrowser.isIE) {
var that = this;
setTimeout(function () {
that.close(domEvent);
}, 1);
} else {
this.close(domEvent);
}
return true;
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57264
|
train
|
function (domEvent) {
if (this.conf.closeOnMouseOut) {
if (!this.conf.closeOnMouseOutDelay) { // If delay is not set
// OR is equal to zero
this.close(domEvent);
} else {
this.cancelMouseOutTimer();
this._mouseOutTimer = ariaCoreTimer.addCallback({
fn : this._onMouseOutTimeout,
scope : this,
delay : this.conf.closeOnMouseOutDelay
});
this._attachMouseOverListener();
}
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57265
|
train
|
function (element) {
var size = ariaUtilsSize.getSize(element), domUtil = ariaUtilsDom;
domUtil.scrollIntoView(element);
var position = this.popupContainer.calculatePosition(element);
this.reference = element;
this.referencePosition = position;
this.referenceSize = size;
}
|
javascript
|
{
"resource": ""
}
|
|
q57266
|
train
|
function (section) {
// PROFILING // var profilingId = this.$startMeasure("Inserting
// section in DOM");
ariaUtilsDom.replaceHTML(this.domElement, section.html);
// var sectionDomElement = this.domElement.firstChild;
// Maybe the initWidget should be done after displaying the popup ?
section.initWidgets();
this.section = section;
// PROFILING // this.$stopMeasure(profilingId);
}
|
javascript
|
{
"resource": ""
}
|
|
q57267
|
train
|
function (zIndex, modalMaskZIndex) {
var computedStyle = this.computedStyle;
if (computedStyle) {
computedStyle.zIndex = zIndex;
if (modalMaskZIndex != null) {
this.modalMaskZIndex = modalMaskZIndex;
}
this.refresh();
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57268
|
train
|
function (path, inside) {
if (ariaUtilsType.isString(path)) {
path = this.parse(path);
}
inside = inside ? inside : Aria.$window;
if (ariaUtilsType.isArray(path)) {
for (var index = 0, param, len = path.length; index < len; index++) {
param = path[index];
inside = inside[param];
if (!inside && index != len - 1) {
throw {
error : this.RESOLVE_FAIL,
args : [path],
object : inside
};
}
}
return inside;
}
throw {
error : this.RESOLVE_FAIL,
args : [path],
object : inside
};
}
|
javascript
|
{
"resource": ""
}
|
|
q57269
|
train
|
function (path) {
// edge case
if (!path) {
return [];
}
// first letter will give the type
var first = path.charAt(0), closing, part, next, nextParse;
// case brackets
if (first == "[") {
closing = path.indexOf("]");
if (closing != -1) {
part = path.substring(1, closing);
next = path.substring(closing + 1);
if (/^\d+$/.test(part)) {
nextParse = this._paramParse(next);
nextParse.unshift(parseInt(part, 10));
return nextParse;
} else {
// check that part is "something" or 'somethingelse'
var strMarker = part.charAt(0), utilString = ariaUtilsString;
if ((strMarker == "'" || strMarker == '"')
&& utilString.indexOfNotEscaped(part, strMarker, 1) == part.length - 1) {
nextParse = this._paramParse(next);
nextParse.unshift(part.substring(1, part.length - 1).replace(new RegExp("\\\\" + strMarker, "gi"), strMarker));
return nextParse;
}
}
}
} else if (first == ".") {
part = /^[_A-z\$]\w*/.exec(path.substring(1));
if (part.length) {
part = part[0];
next = path.substring(part.length + 1);
nextParse = this._paramParse(next);
nextParse.unshift(part);
return nextParse;
}
}
// nothing returned -> throws an exception
throw {
error : this.WRONG_PATH_SYNTAX,
args : [path]
};
}
|
javascript
|
{
"resource": ""
}
|
|
q57270
|
train
|
function (pathParts) {
var path = [pathParts[0]];
for (var index = 1, len = pathParts.length; index < len; index++) {
path.push("[\"" + ("" + pathParts[index]).replace(/"/gi, '\\"') + "\"]");
}
return path.join('');
}
|
javascript
|
{
"resource": ""
}
|
|
q57271
|
train
|
function (evt) {
if (!evt || !evt.changedProperties || ArrayUtils.contains(evt.changedProperties, "contextualMenu")) {
Aria.load({
classes : ["aria.tools.contextual.ContextualMenu"]
});
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57272
|
train
|
function (event) {
var containerSize = this._popupContainer.getClientSize();
if (!this._popup.isOpen || containerSize.width <= 0 || containerSize.height <= 0) {
// do nothing if the container is not visible
// or if the popup was manually hidden from external code
return;
}
var domElt = this._domElt;
var maximized = this._cfg.maximized;
if (domElt) {
// Remove width and height, they will be recalculated later, to have the content size well calculated
domElt.style.width = "";
domElt.style.height = "";
// constrain dialog to containerSize
this._updateDivSize(containerSize);
this._updateContainerSize();
}
if (maximized) {
this._setMaximizedHeightAndWidth(containerSize);
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57273
|
train
|
function (cfg) {
// Note also some related operations are done beforehand, in _registerBindings
if (!("macro" in cfg) && !("bind" in cfg && "macro" in cfg.bind)) {
this.$logError(this.MISSING_CONTENT_MACRO);
}
var appEnvDialogSettings = aria.widgets.environment.WidgetSettings.getWidgetSettings().dialog;
if (!("movable" in cfg)) {
cfg.movable = appEnvDialogSettings.movable;
}
if (!("movableProxy" in cfg)) {
cfg.movableProxy = appEnvDialogSettings.movableProxy;
}
if (cfg.autoFocus == null) {
cfg.autoFocus = cfg.modal;
}
if (cfg.focusableTitle == null) {
cfg.focusableTitle = cfg.waiAria;
}
if (cfg.focusableClose == null) {
cfg.focusableClose = !!(cfg.waiAria && cfg.closeLabel);
}
if (cfg.focusableMaximize == null) {
cfg.focusableMaximize = !!(cfg.waiAria && cfg.maximizeLabel);
}
if (cfg.titleTag == null) {
cfg.titleTag = cfg.waiAria ? "h1" : "span";
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57274
|
train
|
function (out) {
var cfg = this._cfg;
var containerSize = this._popupContainer.getClientSize();
// constrain dialog to containerSize
var math = ariaUtilsMath;
var maxHeight, maxWidth;
if (this._cfg.maximized) {
maxHeight = containerSize.height + this._shadows.top + this._shadows.bottom;
maxWidth = containerSize.width + this._shadows.left + this._shadows.right;
} else {
maxHeight = math.min(this._cfg.maxHeight, containerSize.height);
maxWidth = math.min(this._cfg.maxWidth, containerSize.width);
}
if (!titleLast) {
this.writeTitleBar(out);
}
this._div = new ariaWidgetsContainerDiv({
sclass : this._skinObj.divsclass,
margins : "0 0 0 0",
block : true,
cssClass : this._context.getCSSClassNames(true) + " " + this._cfg.cssClass,
height : this._cfg.height,
minHeight : this._cfg.minHeight,
maxHeight : maxHeight,
width : this._cfg.width,
minWidth : this._cfg.minWidth,
maxWidth : maxWidth,
scrollBarX : this._cfg.scrollBarX,
scrollBarY : this._cfg.scrollBarY
}, this._context, this._lineNumber);
out.registerBehavior(this._div);
this._div.writeMarkupBegin(out);
out.beginSection({
id : "__dialogContent_" + this._domId,
keyMap : [{
key : "ESCAPE",
callback : {
fn : this._onEscape,
scope : this
}
}]
});
if (this._cfg.macro) {
out.callMacro(this._cfg.macro);
}
out.endSection();
this._div.writeMarkupEnd(out);
// for resize handle markup
if (cfg.resizable && this._handlesArr) {
var handles = this._handlesArr;
for (var i = 0, ii = handles.length; i < ii; i++) {
out.write(['<span class="x', this._skinnableClass, '_resizable xDialog_' + handles[i] + '">',
'</span>'].join(''));
}
}
if (titleLast) {
this.writeTitleBar(out);
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57275
|
train
|
function (propertyName, newValue, oldValue) {
if (propertyName === "visible") {
this._cfg.visible = newValue;
if (newValue) {
this.open();
} else {
this.close();
}
} else if (propertyName === "movable") {
this._cfg.movable = newValue;
if (this._popup && this._popup.isOpen) {
if (newValue) {
this._loadAndCreateDraggable();
} else {
this._destroyDraggable();
}
}
} else if (propertyName === "title") {
this._cfg.title = newValue;
if (this._titleDomElt) {
this._titleDomElt.innerHTML = newValue;
this._onDimensionsChanged();
}
} else if (propertyName === "macro") {
this._cfg.macro = newValue;
if (this._popup) {
if (!this._popup.isOpen) {
this.open();
} else {
var args = {
section : "__dialogContent_" + this._domId,
macro : newValue
};
this._context.$refresh(args);
}
}
} else if (propertyName === "xpos" || propertyName === "ypos") {
this._cfg[propertyName] = newValue;
this.setProperty("center", false);
this.updatePosition();
} else if (propertyName === "center") {
this._cfg.center = newValue;
this.updatePosition();
} else if (propertyName === "maximized") {
this._toggleMaximize(newValue);
} else if (propertyName === "width" || propertyName === "height") {
this._onDimensionsChanged(false);
} else if (propertyName === "restoreFocusOnClose") {
this._cfg[propertyName] = newValue;
} else {
// delegate to parent class
this.$Container._onBoundPropertyChange.apply(this, arguments);
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57276
|
train
|
function () {
var cfg = this._cfg;
var waiEscapeMsg = cfg.waiEscapeMsg;
var confirmed = !(cfg.waiAria && waiEscapeMsg);
if (!confirmed) {
var now = new Date().getTime();
confirmed = this._firstEscapeTime && (now - this._firstEscapeTime) <= 3000;
if (!confirmed) {
this._firstEscapeTime = now;
this.waiReadText(waiEscapeMsg);
}
}
if (confirmed) {
this._firstEscapeTime = null;
this.actionClose();
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57277
|
train
|
function () {
// --------------------------------------------------- destructuring
var cfg = this._cfg;
var modal = cfg.modal;
var waiAria = cfg.waiAria;
// ------------------------------------------------------ processing
// refreshParams ---------------------------------------------------
var refreshParams = {
section : "__dialog_" + this._domId,
writerCallback : {
fn : this._writerCallback,
scope : this
}
};
// popupContainer --------------------------------------------------
var popupContainer = PopupContainerManager.createPopupContainer(cfg.container);
this._popupContainer = popupContainer;
// previouslyFocusedElement ----------------------------------------
if (modal) {
this._previouslyFocusedElement = Aria.$window.document.activeElement;
}
// optionsBeforeMaximize -------------------------------------------
// store current options to reapply them when unmaximized
this._optionsBeforeMaximize = this._createOptionsBeforeMaximize(cfg);
// section ---------------------------------------------------------
var section = this._context.getRefreshedSection(refreshParams);
// popup -----------------------------------------------------------
var popup = new ariaPopupsPopup();
this._popup = popup;
popup.$on({
"onAfterOpen" : this._onAfterPopupOpen,
"onEscape" : this._onEscape,
"onAfterClose" : this._onAfterPopupClose,
scope : this
});
if (cfg.closeOnMouseClick) {
popup.$on({
"onMouseClickClose" : this._onMouseClickClose,
scope : this
});
}
popup.open({
section : section,
keepSection : true,
absolutePosition : {
left : cfg.xpos,
top : cfg.ypos
},
center : cfg.center,
maximized : cfg.maximized,
offset : cfg.maximized ? this._shadows : this._shadowsZero,
modal : modal,
maskCssClass : "xDialogMask",
popupContainer : popupContainer,
closeOnMouseClick : cfg.closeOnMouseClick,
closeOnMouseScroll : false,
parentDialog : this,
zIndexKeepOpenOrder : false, // allows to re-order dialogs (dynamic z-index)
role: modal ? "dialog" : null,
labelId: modal ? this.__getLabelId() : null,
waiAria: waiAria
});
// hiddenElements --------------------------------------------------
if (modal && waiAria) {
var container = popupContainer.getContainerElt();
this._showBack = DomNavigationManager.hidingManager.hideOthers(popup.domElement, function (element) {
return element != null && element !== container;
});
}
// -----------------------------------------------------------------
// must be registered before we check for _cfg.maximized, to fire the event correctly after overflow change
ariaTemplatesLayout.$on({
"viewportResized" : this._onViewportResized,
scope : this
});
// -----------------------------------------------------------------
// in case when bound "maximized" was toggled while Dialog was not visible
if (cfg.maximized) {
this._setContainerOverflow("hidden");
this._setMaximizedHeightAndWidth();
}
this._firstEscapeTime = null;
}
|
javascript
|
{
"resource": ""
}
|
|
q57278
|
train
|
function () {
var cfg = this._cfg;
var getDomElementChild = ariaUtilsDom.getDomElementChild;
this._domElt = this._popup.domElement;
var titleBarDomElt = this._titleBarDomElt = getDomElementChild(this._domElt, 0, titleLast);
this._titleDomElt = getDomElementChild(titleBarDomElt, cfg.icon ? 1 : 0);
this._onDimensionsChanged();
this._calculatePosition();
if (cfg.autoFocus) {
ariaTemplatesNavigationManager.focusFirst(this._domElt);
} else if (cfg.modal) {
var document = Aria.$window.document;
var activeElement = document.activeElement;
if (activeElement && activeElement !== document.body) {
activeElement.blur();
}
}
ariaCoreTimer.addCallback({
fn : function () {
// check that the dialog was not disposed
if (this._cfg) {
this.waiReadText(cfg.waiOpenMsg);
this.evalCallback(cfg.onOpen);
}
},
scope : this,
delay : 4
});
if (cfg.maximized) {
return; // don't create movable nor resizable
}
if (cfg.movable) {
this._loadAndCreateDraggable();
}
if (cfg.resizable) {
this._loadAndCreateResizable();
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57279
|
train
|
function () {
if (aria.utils.dragdrop && aria.utils.dragdrop.Drag) {
this._createDraggable();
} else {
Aria.load({
classes : ["aria.utils.dragdrop.Drag"],
oncomplete : {
fn : this._createDraggable,
scope : this
}
});
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57280
|
train
|
function () {
if (aria.utils.resize && aria.utils.resize.Resize) {
this._createResize();
} else {
Aria.load({
classes : ["aria.utils.resize.Resize"],
oncomplete : {
fn : this._createResize,
scope : this
}
});
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57281
|
train
|
function () {
var cfg = this._cfg;
var modal = cfg.modal;
if (this._showBack != null) {
this._showBack();
this._showBack = null;
}
if (this._popup) {
this.waiReadText(cfg.waiCloseMsg);
this._destroyDraggable();
this._destroyResizable();
if (cfg.maximized) {
this._setContainerOverflow(this._optionsBeforeMaximize.containerOverflow);
}
this._domElt = null;
this._titleBarDomElt = null;
this._titleDomElt = null;
if (this._closeDelegateId) {
ariaUtilsDelegate.remove(this._closeDelegateId);
}
if (this._maximizeDelegateId) {
ariaUtilsDelegate.remove(this._maximizeDelegateId);
}
this._popup.close();
this._popup.$unregisterListeners(this);
this._popup.$dispose();
this._popup = null;
PopupContainerManager.releasePopupContainer(this._popupContainer);
this._popupContainer = null;
ariaTemplatesLayout.$removeListeners({
"viewportResized" : this._onViewportResized,
scope : this
});
if (modal) {
var previouslyFocusedElement = this._previouslyFocusedElement;
if (cfg.restoreFocusOnClose && ariaUtilsDom.isInDom(previouslyFocusedElement) && !/^body$/i.test(previouslyFocusedElement.tagName)) {
setTimeout(function () {
try {
// On IE 7 and 8, focusing an element which is no longer in the DOM
// throws the "Unexpected call to method or property access." exception
previouslyFocusedElement.focus();
} catch (e) {}
}, 0);
this._previouslyFocusedElement = null;
}
}
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57282
|
train
|
function () {
if (this._popup && this._popup.isOpen) {
this._popup.moveTo({
center : this._cfg.center,
absolutePosition : {
left : this._cfg.xpos, // in maximized mode, positioning is handled by the Popup itself
top : this._cfg.ypos,
height : this._cfg.maximized ? this._cfg.heightMaximized : this._cfg.height,
width : this._cfg.maximized ? this._cfg.widthMaximized : this._cfg.width
}
});
this._calculatePosition();
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57283
|
train
|
function () {
if (!this._cfg.maximized) { // in maximized mode, positioning is handled by the Popup itself
var position = this._popupContainer.calculatePosition(this._domElt);
this.setProperty("xpos", position.left);
this.setProperty("ypos", position.top);
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57284
|
train
|
function () {
var opts = this._optionsBeforeMaximize;
if (!opts) {
return;
}
// reapply the old options
if (this._popup) {
this._popup.conf.maximized = false;
this._popup.conf.offset = this._shadowsZero;
this._setContainerOverflow(opts.containerOverflow);
}
// using setProperty instead of changeProperty for performance reasons; hence need to explicitly invoke
// _onDimensionsChanged and updatePosition, instead of relying on onBoundPropertyChange
this.setProperty("maxWidth", opts.maxWidth);
this.setProperty("maxHeight", opts.maxHeight);
this.setProperty("width", opts.width);
this.setProperty("height", opts.height);
this.setProperty("heightMaximized", null);
this.setProperty("widthMaximized", null);
this._onDimensionsChanged(false);
if (opts.center) {
this.setProperty("center", true);
} else {
this.setProperty("xpos", opts.xpos);
this.setProperty("ypos", opts.ypos);
}
this.updatePosition();
if (this._popup && this._popup.isOpen) {
if (this._cfg.resizable) {
this._loadAndCreateResizable();
}
if (this._cfg.movable) {
this._loadAndCreateDraggable();
}
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57285
|
train
|
function (cfg) {
return {
center : cfg.center,
width : cfg.width,
height : cfg.height,
maxWidth : cfg.maxWidth,
maxHeight : cfg.maxHeight,
xpos : cfg.xpos,
ypos : cfg.ypos,
containerOverflow : this._popupContainer ? this._popupContainer.getContainerOverflow() : ""
};
}
|
javascript
|
{
"resource": ""
}
|
|
q57286
|
train
|
function () {
if (!this._popup || !this._popup.isOpen || this._draggable) {
// maybe the popup was closed while loading aria.utils.dragdrop.Drag,
// or it was closed and re-opened very quickly (and we should avoid
// creating the _draggable object twice)
return;
}
this._draggable = new aria.utils.dragdrop.Drag(this._domElt, {
handle : this._titleBarDomElt,
cursor : "move",
proxy : this._cfg.movableProxy,
constrainTo : this._popupContainer.getContainerRef(),
dragOverIFrame : true
});
this._draggable.$on({
"dragstart" : {
fn : this._onDragStart,
scope : this
},
"move" : {
fn : this._onDragMove,
scope : this
},
"dragend" : {
fn : this._onDragEnd,
scope : this
}
});
}
|
javascript
|
{
"resource": ""
}
|
|
q57287
|
train
|
function () {
if (!this._popup || !this._popup.isOpen || this._resizable) {
// maybe the popup was closed while loading aria.utils.resize.Resize,
// or it was closed and re-opened very quickly (and we should avoid
// creating the _resizable object twice)
return;
}
var handleArr = this._handlesArr;
if (handleArr) {
this._resizable = {};
for (var i = 0, ii = handleArr.length; i < ii; i++) {
var handleElement = this.getResizeHandle(i), axis = null, cursor;
cursor = handleArr[i];
if (cursor == "n-resize" || cursor == "s-resize") {
axis = "y";
}
if (cursor == "w-resize" || cursor == "e-resize") {
axis = "x";
}
this._resizable[cursor] = new aria.utils.resize.Resize(this._domElt, {
handle : handleElement,
cursor : cursor,
axis : axis,
constrainTo : this._popupContainer.getContainerRef()
});
this._resizable[cursor].$on({
"beforeresize" : {
fn : this._onResizeStart,
scope : this
},
"resize" : {
fn : this._onResizing,
scope : this
},
"resizeend" : {
fn : this._onResizeEnd,
scope : this
}
});
}
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57288
|
train
|
function () {
// this.updatePosition();
if (this._popup) {
this._popup.refreshProcessingIndicators();
}
this.setProperty("center", false);
this._calculatePosition();
this.updatePosition();
this.evalCallback(this._cfg.ondragend);
}
|
javascript
|
{
"resource": ""
}
|
|
q57289
|
train
|
function () {
this._calculatePosition();
this._calculateSize();
this.setProperty("center", false);
if (this._popup) {
this._onDimensionsChanged();
this._popup.refreshProcessingIndicators();
}
this.evalCallback(this._cfg.resizeend);
}
|
javascript
|
{
"resource": ""
}
|
|
q57290
|
train
|
function () {
if (!this._draggable) {
return;
}
this._draggable.$removeListeners({
"dragstart" : {
fn : this._onDragStart,
scope : this
},
"move" : {
fn : this._onDragMove,
scope : this
},
"dragend" : {
fn : this._onDragEnd,
scope : this
}
});
this._draggable.$dispose();
this._draggable = null;
}
|
javascript
|
{
"resource": ""
}
|
|
q57291
|
train
|
function () {
var handleArr = this._handlesArr;
if (!handleArr || !this._resizable) {
return;
}
for (var i = 0, ii = handleArr.length; i < ii; i++) {
var cursor = handleArr[i];
if (this._resizable[cursor]) {
this._resizable[cursor].$dispose();
this._resizable[cursor] = null;
}
}
this._resizable = null;
}
|
javascript
|
{
"resource": ""
}
|
|
q57292
|
train
|
function () {
var cache = this._cache;
var expirationTime = ((new Date()).getTime() - this._expiresAfter * 1000);
for (var url in cache) {
if (cache.hasOwnProperty(url) && cache[url].age < expirationTime) {
delete cache[url];
}
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57293
|
callNormalizedCallback
|
train
|
function callNormalizedCallback (callback, arg) {
callback.fn.call(callback.scope, arg, callback.args);
}
|
javascript
|
{
"resource": ""
}
|
q57294
|
typeCallback
|
train
|
function typeCallback (callbackArray) {
this._typeCallback = null;
var callback;
for (var i = 0, count = callbackArray.length; i < count; i++) {
callback = this.$normCallback.call(this._context._tpl, callbackArray[i]);
callNormalizedCallback(callback, this._domElt.value);
}
}
|
javascript
|
{
"resource": ""
}
|
q57295
|
keyDownToType
|
train
|
function keyDownToType (event, callbackArray) {
this._typeCallback = ariaCoreTimer.addCallback({
fn : typeCallback,
scope : this,
delay : 12,
args : callbackArray
});
}
|
javascript
|
{
"resource": ""
}
|
q57296
|
keyDownCallback
|
train
|
function keyDownCallback (event) {
if (this._hasPlaceholder) {
if (!ariaUtilsArray.contains(specialKeys, event.keyCode)) {
this._removePlaceholder();
} else {
event.preventDefault();
}
}
}
|
javascript
|
{
"resource": ""
}
|
q57297
|
train
|
function (listeners, context) {
if (listeners.type) {
this._chainListener(listeners, "keydown", {
fn : keyDownToType,
scope : this,
args : ariaUtilsType.isArray(listeners.type) ? listeners.type : [listeners.type]
});
delete listeners.type;
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57298
|
train
|
function () {
if (this._hasPlaceholder) {
var element = this._domElt;
var cssClass = new aria.utils.ClassList(element);
element.value = "";
this._hasPlaceholder = false;
cssClass.remove('placeholder');
cssClass.$dispose();
this._domElt.unselectable = "off";
}
}
|
javascript
|
{
"resource": ""
}
|
|
q57299
|
train
|
function (element) {
var pos = {
start : 0,
end : 0
};
if ("selectionStart" in element) {
// w3c standard, available in all but IE<9
pos.start = element.selectionStart;
pos.end = element.selectionEnd;
} else {
// old IE support
var document = Aria.$window.document;
if (document.selection) {
var sel = document.selection.createRange();
var initialLength = sel.text.length;
sel.moveStart('character', -element.value.length);
var x = sel.text.length;
pos.start = x - initialLength;
pos.end = x;
}
}
return pos;
}
|
javascript
|
{
"resource": ""
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.