_id
stringlengths
2
6
title
stringlengths
0
58
partition
stringclasses
3 values
text
stringlengths
52
373k
language
stringclasses
1 value
meta_information
dict
q19500
train
function(oList, bSkipNotify, fCallback){ var fFinalize = function(jRef) { if (!bSkipNotify) { var oAttr = oList._getAtt(); var iSelectedIndex = oAttr.getParent().indexOfAttribute(oAttr); clearAttribute(oList.getParent(), oAttr, iSelectedIndex, true); setHeaderText(oList.getParent()); getTopList(oList)._selectionChanged(oAttr); } oList.destroy(); if (fCallback) { fCallback(); } }; var oListRef = oList.getDomRef(); if (oListRef) { animate(jQuery(oListRef), true, 0, function(jRef) { jRef.css("overflow", "hidden"); }, fFinalize); } else { fFinalize(); } }
javascript
{ "resource": "" }
q19501
train
function(oList, oAttribute) { if (oAttribute.getSelected()) { var aAttributes = oAttribute.getAttributesInternal(true); if (aAttributes.length > 0) { var oSubList; if (oAttribute.getChangeListener()) { oSubList = sap.ui.getCore().byId(oAttribute.getChangeListener().id); } else { oSubList = new ExactList(); } oSubList.setData(oAttribute); return oSubList; } } return null; }
javascript
{ "resource": "" }
q19502
train
function(oList, oAttribute, iSelectedIndex, bSkipNotify){ oList._lb.removeSelectedIndex(iSelectedIndex); oAttribute._clearSelection(); if (!bSkipNotify) { var aSubLists = oList.getSubLists(); for (var i = 0; i < aSubLists.length; i++) { if (aSubLists[i].getData() === oAttribute.getId()) { close(aSubLists[i], true); } } } }
javascript
{ "resource": "" }
q19503
train
function(oList) { var oAttr = oList._getAtt(); if (oAttr && oAttr.getChangeListener() && oAttr.getChangeListener().id === oList.getId()) { oAttr.setChangeListener(null); } }
javascript
{ "resource": "" }
q19504
train
function(oList) { if (oList._isTop()) { return oList; } if (!oList._oTopList) { oList._oTopList = getTopList(oList.getParent()); } return oList._oTopList; }
javascript
{ "resource": "" }
q19505
parseWithStatement
train
function parseWithStatement() { var object, body; if (strict) { // TODO(ikarienator): Should we update the test cases instead? skipComment(); throwErrorTolerant({}, Messages.StrictModeWith); } expectKeyword('with'); expect('('); object = parseExpression(); expect(')'); body = parseStatement(); return delegate.createWithStatement(object, body); }
javascript
{ "resource": "" }
q19506
train
function(numSt, numCov, numBranch, numCovBr, moduleName) { var totalPercent = percentage(numCov, numSt); var statusClass = totalPercent < successRate ? "bl-error" : "bl-success"; var rowTitle = ( moduleName ? "Total for module: " + moduleName : "Global total" ); var totalsOutput = grandTotalTemplate.replace("{{rowTitle}}", rowTitle) .replace("{{percentage}}", totalPercent) .replace("{{numberCovered}}", numCov) .replace("{{totalSmts}}", numSt) .replace("{{passedBranches}}", numCovBr) .replace("{{totalBranches}}", numBranch) .replace("{{statusclass}}", statusClass); bodyContent += totalsOutput; }
javascript
{ "resource": "" }
q19507
train
function(sChangeType,mParameters,mTexts) { //parameter correspond to inline change format //exception: appdescr_app_setTitle, and similar Utils.checkTexts(mTexts); this._mParameters = {}; this._mParameters.changeType = sChangeType; this._mParameters.content = mParameters; this._mParameters.texts = mTexts; }
javascript
{ "resource": "" }
q19508
train
function () { this._initAndBindSelectedContentModel(); var oRouter = sap.ui.core.UIComponent.getRouterFor(this); oRouter.getRoute("ContentDetails").attachMatched(this._onRouteMatched, this); oRouter.getRoute("ContentDetailsFlip").attachMatched(this._onRouteMatched, this); }
javascript
{ "resource": "" }
q19509
train
function (oModelData, oPage, oMetadata) { oModelData.metadata = oMetadata; this.oSelectedContentModel.setData(oModelData); var oCore = sap.ui.getCore(); var sIconTabBarId = this.getView().createId("contentDetailsIconTabBar"); var oIconTabBar = oCore.getElementById(sIconTabBarId); if (oIconTabBar){ var oFirstIconTabBarItem = oIconTabBar.getItems()[0]; if (oIconTabBar.getSelectedKey() !== oFirstIconTabBarItem.getId()) { oIconTabBar.setSelectedItem(oFirstIconTabBarItem); } } oPage.setBusy(false); }
javascript
{ "resource": "" }
q19510
train
function () { var oSelectedContentModel = this.getView().getModel("selectedContent"); var oContentData = oSelectedContentModel.getData(); var oRouter = sap.ui.core.UIComponent.getRouterFor(this); oRouter.navTo("ContentDetailsEdit", { "layer": oContentData.layer, "namespace": encodeURIComponent(oContentData.namespace), "fileName": oContentData.fileName, "fileType": oContentData.fileType }); }
javascript
{ "resource": "" }
q19511
train
function () { var that = this; var oDialog = new Dialog({ title: "{i18n>confirmDeletionTitle}", type: "Message", content: new Text({text: "{i18n>questionFileDeletion}"}), beginButton: new Button({ text: "{i18n>confirm}", type: ButtonType.Reject, press: function () { oDialog.close(); that._selectTransportAndDeleteFile(); } }), endButton: new Button({ text: "{i18n>cancel}", press: function () { oDialog.close(); } }), afterClose: function () { oDialog.destroy(); } }); this.getView().addDependent(oDialog); oDialog.open(); }
javascript
{ "resource": "" }
q19512
train
function (sLayer, sNamespace, sFileName, sFileType, sTransportId, sSelectedLayer) { return LRepConnector.deleteFile(sLayer, sNamespace, sFileName, sFileType, sTransportId, sSelectedLayer).then(function () { var oRouter = sap.ui.core.UIComponent.getRouterFor(this); oRouter.navTo("LayerContentMaster", { "layer": sSelectedLayer, "namespace": encodeURIComponent(sNamespace) }); }.bind(this)); }
javascript
{ "resource": "" }
q19513
filterStaticAreaContent
train
function filterStaticAreaContent($Refs, aScopes) { var oStaticArea = window.document.getElementById("sap-ui-static"); if (!oStaticArea) { return $Refs; } var aScopesInStaticArea = []; for (var i = 0; i < aScopes.length; i++) { if (jQuery.contains(oStaticArea, aScopes[i])) { aScopesInStaticArea.push(aScopes[i]); } } return $Refs.filter(function() { if (aScopesInStaticArea.length && isContained(aScopesInStaticArea, this)) { return true; } return !jQuery.contains(oStaticArea, this); }); }
javascript
{ "resource": "" }
q19514
train
function (oModules, oResult) { var modules = oModules.modules, vDebugInfo = window["sap-ui-debug"]; // create tree with all modules and empty selection jQuery.each(modules, function (sName) { this.set(oResult, sName, false, true); }.bind(this)); // apply current debug info as tree selection if (vDebugInfo === true || vDebugInfo === 'x' || vDebugInfo === 'X') { this.set(oResult, '/', true); } else if (vDebugInfo && typeof vDebugInfo === 'string') { vDebugInfo.split(/,/).forEach(function (sPattern) { if (/\*/.test(sPattern)) { // if a glob pattern is found, select all modules that are matched by it var rFilter = new RegExp("^(?:" + this.makeRegExp(sPattern) + ")"); // collect namespaces var oNamespacesAndModules = {}; Object.keys(modules).forEach(function (sModule) { var sModulePath = sModule.split("/").slice(0, -1).join("/") + "/"; oNamespacesAndModules[sModulePath] = ""; }); // join namespaces and modules object for (var sKey in modules) { oNamespacesAndModules[sKey] = modules[sKey]; } jQuery.each(oNamespacesAndModules, function (sName) { if (rFilter.test(sName)) { this.set(oResult, sName, true); } }.bind(this)); } else { // for simple package / module names, just select the corresponding tree node this.set(oResult, sPattern, true); } }.bind(this)); } }
javascript
{ "resource": "" }
q19515
train
function (oModules) { var oHierarchy = {}, oTree = { text: "All" }, iSelectionDepth; this.modulesToHierarchy(oModules, oHierarchy); iSelectionDepth = this.setTreeNode(oHierarchy, oTree, 0, window["sap-ui-debug"] === true); if (!iSelectionDepth) { iSelectionDepth = 0; } return { tree: oTree, depth: iSelectionDepth }; }
javascript
{ "resource": "" }
q19516
train
function (oHierarchy, oTree, iDepth, bSelected) { var iSelectionDepth, iInnerSelectionDepth; bSelected = oHierarchy === true || oHierarchy[""] || bSelected; oTree.nodes = []; oTree.selected = bSelected; if (bSelected) { iSelectionDepth = iDepth; } for (var sProperty in oHierarchy) { if (sProperty === "") { continue; } var oChildNode = { text: sProperty }; iInnerSelectionDepth = this.setTreeNode(oHierarchy[sProperty], oChildNode, iDepth + 1, bSelected); if (iInnerSelectionDepth > iSelectionDepth || !iSelectionDepth) { iSelectionDepth = iInnerSelectionDepth; } oTree.nodes.push(oChildNode); } return iSelectionDepth; }
javascript
{ "resource": "" }
q19517
train
function (oTree) { var oResult = {}; oTree.selected = this.isNodeSelected(oTree); this.setHierarchyNode(oResult, oTree); return oResult; }
javascript
{ "resource": "" }
q19518
train
function (oNode) { var iSelectedNodesCount = 0, oChildNode; for (var i = 0; i < oNode.nodes.length; i++) { oChildNode = oNode.nodes[i]; if (oChildNode.nodes.length) { oChildNode.selected = this.isNodeSelected(oChildNode); } if (oChildNode.selected) { iSelectedNodesCount++; } } return iSelectedNodesCount === oNode.nodes.length; }
javascript
{ "resource": "" }
q19519
train
function (oHierarchy, oTree) { if (oTree.selected) { oHierarchy[""] = true; } for (var i = 0; i < oTree.nodes.length; i++) { oHierarchy[oTree.nodes[i].text] = {}; if (oTree.nodes[i].nodes.length) { this.setHierarchyNode(oHierarchy[oTree.nodes[i].text], oTree.nodes[i]); } else { oHierarchy[oTree.nodes[i].text] = oTree.nodes[i].selected; } } }
javascript
{ "resource": "" }
q19520
train
function (oTree, sSeparator) { var oObject = this.toHierarchy(oTree), aFilters = []; function collect(sName, oObject) { var aChildren, bChildren; if (typeof oObject === 'object') { if (oObject['']) { aFilters.push(sName + '/'); return; } aChildren = Object.keys(oObject); bChildren = aChildren.length; } if (bChildren) { aChildren.forEach(function (sChild) { if (sChild === '') { return; } if (oObject[sChild] === true) { aFilters.push((sName ? sName + '/' : '') + sChild); } else if (typeof oObject[sChild] === 'object') { collect((sName ? sName + '/' : '') + sChild, oObject[sChild]); } }); } } if (this.get(oObject, '/')) { return true; } collect('', oObject); return (aFilters.length > 0 ? aFilters.join(sSeparator || ',') : false); }
javascript
{ "resource": "" }
q19521
train
function (oTree) { var sDebugString = this.toDebugInfo(oTree); if (sDebugString === true) { return 1; } else if (sDebugString) { return sDebugString.split(",").length; } return 0; }
javascript
{ "resource": "" }
q19522
train
function (oTree, bSelected) { oTree.selected = bSelected; for (var i = 0; i < oTree.nodes.length; i++) { this.recursiveSelect(oTree.nodes[i], bSelected); } }
javascript
{ "resource": "" }
q19523
train
function(oThis, sChangeType) { var oLayout = oThis.getParent(); if (oLayout) { oLayout.contentChanged(oThis, sChangeType); } }
javascript
{ "resource": "" }
q19524
train
function(oControl, sPropertyName) { var oPropertyInfo = oControl.getMetadata().getProperty(sPropertyName); if (oPropertyInfo && oPropertyInfo.type === 'sap.ui.core.CSSSize') { return oPropertyInfo; } return null; }
javascript
{ "resource": "" }
q19525
train
function(oEvent){ var sProp = oEvent.getParameter("name"); var parent = this.getParent(); if ((sProp === "width" || sProp === "height") && parent && parent.getDomRef()) { notifyLayoutOnChange(this, "CTRL_POS"); } }
javascript
{ "resource": "" }
q19526
train
function () { EventProvider.prototype.destroy.apply(this); this._aPattern = null; this._aRoutes = null; this._oParent = null; this._oConfig = null; this.bIsDestroyed = true; return this; }
javascript
{ "resource": "" }
q19527
getInfo
train
function getInfo() { var collection = mRegistry[collectionName]; var info = collection && collection[iconName]; // convert raw data lazily to the icon info if (typeof info === 'number') { mRegistry[collectionName][iconName] = undefined; // avoid duplicate icon warning info = IconPool.addIcon(iconName, collectionName, { fontFamily: mFontRegistry[collectionName].config.fontFamily, content: info & 0xFFFF, suppressMirroring: !!(info & 0x10000), resourceBundle: getCoreResourceBundle() }); } return info; }
javascript
{ "resource": "" }
q19528
loadFont
train
function loadFont(oFontMetadata) { for (var sKey in oFontMetadata) { oFontMetadata[sKey] = parseInt(oFontMetadata[sKey], 16); } mRegistry[collectionName] = oFontMetadata; IconPool.insertFontFaceStyle(oConfig.fontFamily, oConfig.fontURI, collectionName); mFontRegistry[collectionName].metadataLoaded = true; }
javascript
{ "resource": "" }
q19529
train
function (aNavigableItems) { // Initialize the ItemNavigation if required if (!this.oItemNavigation) { this.oItemNavigation = new ItemNavigation(); this.addDelegate(this.oItemNavigation); } this.oItemNavigation.setRootDomRef(ToolbarRenderer.getPopupArea(this.oToolbar)); this.oItemNavigation.setItemDomRefs(aNavigableItems); this.oItemNavigation.focusItem(0); }
javascript
{ "resource": "" }
q19530
train
function (oModel) { var bHasPendingRequest = jQueryDOM.isEmptyObject(oModel.getData()); //ensure a 1 way binding otherwise it cause any block property change to update the entire subSections oModel.setDefaultBindingMode(BindingMode.OneWay); var fnHeaderFactory = jQueryDOM.proxy(function () { if (bHasPendingRequest) { oModel.detachRequestCompleted(fnHeaderFactory); } var oHeaderTitleContext = new Context(oModel, "/headerTitle"), oObjectPageLayout = this.getView().byId("ObjectPageLayout"); //create the header title if provided in the config if (oHeaderTitleContext.getProperty("")) { try { //retrieve the header class this._oHeader = this.controlFactory(oObjectPageLayout.getId(), oHeaderTitleContext); oObjectPageLayout.setHeaderTitle(this._oHeader); } catch (sError) { Log.error("ObjectPageLayoutFactory :: error in header creation from config: " + sError); } } }, this); //if data are not there yet, we wait for them if (bHasPendingRequest) { oModel.attachRequestCompleted(fnHeaderFactory); } else { //otherwise we apply the header factory immediately fnHeaderFactory(); } }
javascript
{ "resource": "" }
q19531
train
function (sStaticHandlerName) { var fnNameSpace = window, aNameSpaceParts = sStaticHandlerName.split('.'); try { jQueryDOM.each(aNameSpaceParts, function (iIndex, sNameSpacePart) { fnNameSpace = fnNameSpace[sNameSpacePart]; }); } catch (sError) { Log.error("ObjectPageLayoutFactory :: undefined event handler: " + sStaticHandlerName + ". Did you forget to require its static class?"); fnNameSpace = undefined; } return fnNameSpace; }
javascript
{ "resource": "" }
q19532
addSelects
train
function addSelects(vSelects, sExpandPath) { if (!Array.isArray(vSelects)) { vSelects = vSelects.split(","); } vSelects.forEach(function (sSelect) { var iIndex = sSelect.indexOf("/"); if (iIndex >= 0 && sSelect.indexOf(".") < 0) { // only strip if there is no type cast and no bound action (avoid "correcting" // unsupported selects in V2) sSelect = sSelect.slice(0, iIndex); } mSelects[_Helper.buildPath(sExpandPath, sSelect)] = true; }); }
javascript
{ "resource": "" }
q19533
parseAndCheck
train
function parseAndCheck(oDateFormat, sValue) { var oDate = oDateFormat.parse(sValue); if (!oDate) { throw new Error("Not a valid " + oPropertyMetadata.$Type + " value: " + sValue); } return oDate; }
javascript
{ "resource": "" }
q19534
removeFromAttributeList
train
function removeFromAttributeList(sAttribute, sValue) { var sAttributes = this.attr(sAttribute) || "", aAttributes = sAttributes.split(" "), iIndex = aAttributes.indexOf(sValue); if (iIndex == -1) { return this; } aAttributes.splice(iIndex, 1); if (aAttributes.length) { this.attr(sAttribute, aAttributes.join(" ")); } else { this.removeAttr(sAttribute); } return this; }
javascript
{ "resource": "" }
q19535
train
function() { // ensure only TreeBindings are enhanced which have not been enhanced yet if (!(this instanceof TreeBinding) || this._bIsAdapted) { return; } TreeBindingAdapter.apply(this); // apply the methods of the adapters prototype to the TreeBinding instance for (var fn in ODataTreeBindingAdapter.prototype) { if (ODataTreeBindingAdapter.prototype.hasOwnProperty(fn)) { this[fn] = ODataTreeBindingAdapter.prototype[fn]; } } // make sure we have a parameter object this.mParameters = this.mParameters || {}; // initialize the contexts this._aRowIndexMap = []; //Store length and threshold for all requests this._iThreshold = 0; this._iPageSize = 0; //set the default auto expand mode this.setAutoExpandMode(this.mParameters.autoExpandMode || TreeAutoExpandMode.Sequential); //default value for collapse recursive if (this.mParameters.collapseRecursive === undefined) { this.bCollapseRecursive = true; } else { this.bCollapseRecursive = !!this.mParameters.collapseRecursive; } //create general tree structure this._createTreeState(); // restore old tree state if given AND if the binding is running in OperationMode.Client // OperationMode.Auto is not supported, as the binding would behave fundamentally different in case the threshold is rejected. if (this.mParameters.treeState && this.sOperationMode == OperationMode.Client) { this.setTreeState(this.mParameters.treeState); } }
javascript
{ "resource": "" }
q19536
cleanUp
train
function cleanUp() { _Helper.removeByPath(that.mPostRequests, sPath, oEntityData); aCollection.splice(aCollection.indexOf(oEntityData), 1); aCollection.$created -= 1; addToCount(that.mChangeListeners, sPath, aCollection, -1); delete aCollection.$byPredicate[sTransientPredicate]; if (!sPath) { // Note: sPath is empty only in a CollectionCache, so we may call adjustReadRequests that.adjustReadRequests(0, -1); } fnCancelCallback(); }
javascript
{ "resource": "" }
q19537
missingValue
train
function missingValue(oValue, sSegment, iPathLength) { var sPropertyPath = "", sReadLink, sServiceUrl; if (sPath[0] !== '(') { sPropertyPath += "/"; } sPropertyPath += sPath.split("/").slice(0, iPathLength).join("/"); return that.oRequestor.getModelInterface() .fetchMetadata(that.sMetaPath + _Helper.getMetaPath(sPropertyPath)) .then(function (oProperty) { if (!oProperty) { return invalidSegment(sSegment); } if (oProperty.$Type === "Edm.Stream") { sReadLink = oValue[sSegment + "@odata.mediaReadLink"]; sServiceUrl = that.oRequestor.getServiceUrl(); return sReadLink || sServiceUrl + that.sResourcePath + sPropertyPath; } if (!bTransient) { return invalidSegment(sSegment); } if (oProperty.$kind === "NavigationProperty") { return null; } if (!oProperty.$Type.startsWith("Edm.")) { return {}; } if ("$DefaultValue" in oProperty) { return oProperty.$Type === "Edm.String" ? oProperty.$DefaultValue : _Helper.parseLiteral(oProperty.$DefaultValue, oProperty.$Type, sPropertyPath); } return null; }); }
javascript
{ "resource": "" }
q19538
addFilter
train
function addFilter(oFilterElement) { var sFilter = _Helper.getKeyFilter(oFilterElement, that.sMetaPath, mTypeForMetaPath); aFilters.push(sFilter); return sFilter; }
javascript
{ "resource": "" }
q19539
train
function(oEvent) { var oCallout = oEvent.getParameter("callout"); switch (oEvent.getParameter("type")) { case "added": case "removed": var oNotifier = oEvent.getParameter("notifier"); if (this.getMessageNotifier() && this.getMessageNotifier().getId() === oNotifier.getId()) { // clone the message array to sort it fnSortMessages(this, this.getMessageNotifier()); } if (fnChangeVisibility(this)) { var bShouldBeVisible = this.hasItems(); this.fireDisplay({ show : bShouldBeVisible }); } else { /* * Needed if i.e. all messages of a notifier were removed but if * there are still notifications or messages to display */ this.invalidate(); /* * Needed if the message is directly removed from the Callout * without any request to the user. */ if (oEvent.getParameter("type") === "removed") { /* * Since the Callout has only one content - the NotifierView - * it can be checked this way. If there is no content the * Callout has been closed already. */ if (oCallout.getContent().length > 0) { var oNotiView = oCallout.getContent()[0]; var oMessage = oEvent.getParameter("message"); var aMessageViews = oNotiView.getMessages(); var tmpMsgView; for (var i = 0; i < aMessageViews.length; i++) { tmpMsgView = aMessageViews[i]; if (oMessage.getId() === tmpMsgView._message.getId()) { tmpMsgView.destroy(); /* * A normal invalidate on the NotifierView * doesn't work here since the invalidate is * delegated to the most upper parent -> the * NotificationBar. If the NotificationBar is * rendered it doesn't know something of the * corresponding Callout. It would be possible * to rerender the NotifierView but since the * height of the Callout is reduced the * Callout's position must be fixed as well. * This happens also when the Callout is * rerendered, so it saves some lines of codes * to rerender the Callout itself. */ oCallout.rerender(); /* * An open Callout would loose its correct * position due to the re-rendering. The * followOf-functionality of the Popup doesn't * work here, since the opener hasn't moved. See * CSN 1625930 2013 */ oCallout.adjustPosition(); break; } } } } } break; case "openCallout": oCallout.destroyContent(); var oNotifier = oEvent.getParameter("notifier"); // destroy (renew) views that were previously created in maximized // mode oNotifier.destroyAggregation("views", true); var sId = oNotifier.getId(); var oMessageNotifier = this.getMessageNotifier(); if (oMessageNotifier && sId === oMessageNotifier.getId()) { sId += "-messageNotifierView"; } else { sId += "-messageView"; } // create control that renders the notifier's messages var oNotifierView = new NotificationBar.NotifierView(sId, { title : oNotifier.getTitle(), visibleItems : this._visibleItems }); if (oNotifier._bEnableMessageSelect) { oNotifierView.addStyleClass("sapUiNotifierSelectable"); } var aMessages = oNotifier.getMessages(); for (var i = 0; i < aMessages.length; i++) { var oView = fnCreateMessageView(aMessages[i], oNotifier, this); oNotifierView.addMessage(oView); } // with adding this aggregation the view is destroyed as well if // needed oNotifier.addAggregation("views", oNotifierView, true); oCallout.addContent(oNotifierView); break; } }
javascript
{ "resource": "" }
q19540
train
function(oThis, oMN) { if (oMN && oMN.hasItems()) { var $messageCount = oMN.$("counter"); // remove all possible classes $messageCount.removeClass("sapUiMessageInformation"); $messageCount.removeClass("sapUiMessageSuccess"); $messageCount.removeClass("sapUiMessageWarning"); $messageCount.removeClass("sapUiMessageError"); // re-sort the messages and re-calc the severity level because they could have been changed // if the NotiBar was invisible fnSortMessages(oThis, oMN); // add new corresponding class var sLvl = oThis._sSeverestMessageLevel; $messageCount.addClass("sapUiMessage" + sLvl); // create key for description text var iCount = oMN.getMessages().length; var sKey = "NOTIBAR_MESSAGE_NOTIFIER_DESC_LEVEL_" + sLvl.toUpperCase() + (iCount === 1 ? "_SING" : "_PL"); // set description (i.e. "3 messages available: Highest severity // "Error") fnSetNotifierDescription(oThis, oMN, sKey, iCount); } }
javascript
{ "resource": "" }
q19541
train
function(oThis) { var aNotifiers = oThis.getNotifiers(); for (var i = 0; i < aNotifiers.length; i++) { var iCount = aNotifiers[i].getMessages().length; var sKey = "NOTIBAR_NOTIFIER_COUNT_TEXT_" + (iCount === 1 ? "SING" : "PL"); fnSetNotifierDescription(oThis, aNotifiers[i], sKey, iCount); } }
javascript
{ "resource": "" }
q19542
train
function(that) { var mNotifiers = that.getNotifiers(); for (var i = 0; i < mNotifiers.length; i++) { var oNotifier = mNotifiers[i]; oNotifier._oCallout.close(); } if (that.getMessageNotifier()) { that.getMessageNotifier()._oCallout.close(); } }
javascript
{ "resource": "" }
q19543
train
function(sWidth, sCalendarType) { assert(sWidth == "narrow" || sWidth == "abbreviated" || sWidth == "wide", "sWidth must be narrow, abbreviated or wide"); return this._get(getCLDRCalendarName(sCalendarType), "dayPeriods", "stand-alone", sWidth); }
javascript
{ "resource": "" }
q19544
train
function(sStyle, sCalendarType) { assert(sStyle == "short" || sStyle == "medium" || sStyle == "long" || sStyle == "full", "sStyle must be short, medium, long or full"); return this._get(getCLDRCalendarName(sCalendarType), "dateFormats", sStyle); }
javascript
{ "resource": "" }
q19545
train
function(sDateStyle, sTimeStyle, sCalendarType) { assert(sDateStyle == "short" || sDateStyle == "medium" || sDateStyle == "long" || sDateStyle == "full", "sStyle must be short, medium, long or full"); assert(sTimeStyle == "short" || sTimeStyle == "medium" || sTimeStyle == "long" || sTimeStyle == "full", "sStyle must be short, medium, long or full"); var sDateTimePattern = this.getDateTimePattern(sDateStyle, sCalendarType), sDatePattern = this.getDatePattern(sDateStyle, sCalendarType), sTimePattern = this.getTimePattern(sTimeStyle, sCalendarType); return sDateTimePattern.replace("{0}", sTimePattern).replace("{1}", sDatePattern); }
javascript
{ "resource": "" }
q19546
train
function(sPattern, sCalendarType) { var oIntervalFormats = this._get(getCLDRCalendarName(sCalendarType), "dateTimeFormats", "intervalFormats"), sFallbackPattern = oIntervalFormats.intervalFormatFallback; return sFallbackPattern.replace(/\{(0|1)\}/g, sPattern); }
javascript
{ "resource": "" }
q19547
train
function(sSkeleton, vGreatestDiff, sCalendarType) { var oAvailableFormats = this._get(getCLDRCalendarName(sCalendarType), "dateTimeFormats", "intervalFormats"); return this._getFormatPattern(sSkeleton, oAvailableFormats, sCalendarType, vGreatestDiff); }
javascript
{ "resource": "" }
q19548
train
function () { var mCustomCurrencies = this._get("currency") || {}, mCustomCurrencyCodes = {}; Object.keys(mCustomCurrencies).forEach(function (sCurrencyKey) { mCustomCurrencyCodes[sCurrencyKey] = sCurrencyKey; }); return mCustomCurrencyCodes; }
javascript
{ "resource": "" }
q19549
train
function(sCurrency) { // try to lookup currency digits from custom currencies var mCustomCurrencies = this._get("currency"); if (mCustomCurrencies) { if (mCustomCurrencies[sCurrency] && mCustomCurrencies[sCurrency].hasOwnProperty("digits")) { return mCustomCurrencies[sCurrency].digits; } else if (mCustomCurrencies["DEFAULT"] && mCustomCurrencies["DEFAULT"].hasOwnProperty("digits")) { return mCustomCurrencies["DEFAULT"].digits; } } var iDigits = this._get("currencyDigits", sCurrency); if (iDigits == null) { iDigits = this._get("currencyDigits", "DEFAULT"); if (iDigits == null) { iDigits = 2; // default } } return iDigits; }
javascript
{ "resource": "" }
q19550
train
function(sCurrencySymbol) { var oCurrencySymbols = this._get("currencySymbols"), sCurrencyCode; for (sCurrencyCode in oCurrencySymbols) { if (oCurrencySymbols[sCurrencyCode] === sCurrencySymbol) { return sCurrencyCode; } } return sCurrencySymbol; }
javascript
{ "resource": "" }
q19551
train
function() { // Lookup into global Config var mCustomCurrencies = this._get("currency"), mCustomCurrencySymbols = {}, sIsoCode; for (var sCurrencyKey in mCustomCurrencies) { sIsoCode = mCustomCurrencies[sCurrencyKey].isoCode; if (mCustomCurrencies[sCurrencyKey].symbol) { mCustomCurrencySymbols[sCurrencyKey] = mCustomCurrencies[sCurrencyKey].symbol; } else if (sIsoCode) { mCustomCurrencySymbols[sCurrencyKey] = this._get("currencySymbols")[sIsoCode]; } } return Object.assign({}, this._get("currencySymbols"), mCustomCurrencySymbols); }
javascript
{ "resource": "" }
q19552
train
function(aScales, sStyle) { if (sStyle === undefined) { sStyle = "wide"; } assert(sStyle === "wide" || sStyle === "short" || sStyle === "narrow", "sStyle is only allowed to be set with 'wide', 'short' or 'narrow'"); var aPatterns = [], aPluralCategories = this.getPluralCategories(), oScale, oTimeEntry, iValue, iSign; if (!aScales) { aScales = ["year", "month", "week", "day", "hour", "minute", "second"]; } aScales.forEach(function(sScale) { oScale = this._get("dateFields", sScale + "-" + sStyle); for (var sEntry in oScale) { if (sEntry.indexOf("relative-type-") === 0) { iValue = parseInt(sEntry.substr(14)); aPatterns.push({ scale: sScale, value: iValue, pattern: oScale[sEntry] }); } else if (sEntry.indexOf("relativeTime-type-") == 0) { oTimeEntry = oScale[sEntry]; iSign = sEntry.substr(18) === "past" ? -1 : 1; aPluralCategories.forEach(function(sKey) { // eslint-disable-line no-loop-func aPatterns.push({ scale: sScale, sign: iSign, pattern: oTimeEntry["relativeTimePattern-count-" + sKey] }); }); } } }.bind(this)); return aPatterns; }
javascript
{ "resource": "" }
q19553
train
function(sWidth, sCalendarType) { assert(sWidth == "wide" || sWidth == "abbreviated" || sWidth == "narrow" , "sWidth must be wide, abbreviate or narrow"); //TODO Adapt generation so that eras are an array instead of object var oEras = this._get(getCLDRCalendarName(sCalendarType), "era-" + sWidth), aEras = []; for (var i in oEras) { aEras[parseInt(i)] = oEras[i]; } return aEras; }
javascript
{ "resource": "" }
q19554
train
function(sCalendarType) { //TODO Adapt generation so that eradates are an array instead of object var oEraDates = this._get("eras-" + sCalendarType.toLowerCase()), aEraDates = []; for (var i in oEraDates) { aEraDates[parseInt(i)] = oEraDates[i]; } return aEraDates; }
javascript
{ "resource": "" }
q19555
train
function(sStyle, iWeekNumber) { assert(sStyle == "wide" || sStyle == "narrow" , "sStyle must be wide or narrow"); var oMessageBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.core", this.oLocale.toString()), sKey = "date.week.calendarweek." + sStyle; return oMessageBundle.getText(sKey, iWeekNumber); }
javascript
{ "resource": "" }
q19556
getCLDRCalendarName
train
function getCLDRCalendarName(sCalendarType) { if (!sCalendarType) { sCalendarType = sap.ui.getCore().getConfiguration().getCalendarType(); } return "ca-" + sCalendarType.toLowerCase(); }
javascript
{ "resource": "" }
q19557
getData
train
function getData(oLocale) { var sLanguage = oLocale.getLanguage() || "", sScript = oLocale.getScript() || "", sRegion = oLocale.getRegion() || "", mData; /* * Merge a CLDR delta file and a CLDR fallback file. * * Note: the contract of this method reg. null values differs from both, * jQuery.extend as well as jQuery.sap.extend. */ function merge(obj, fallbackObj) { var name, value, fallbackValue; if ( !fallbackObj ) { return; } for ( name in fallbackObj ) { if ( fallbackObj.hasOwnProperty(name) ) { value = obj[ name ]; fallbackValue = fallbackObj[ name ]; if ( value === undefined ) { // 'undefined': value doesn't exist in delta, so take it from the fallback object // Note: undefined is not a valid value in JSON, so we can't misunderstand an existing undefined obj[name] = fallbackValue; } else if ( value === null ) { // 'null' is used by the delta tooling as a marker that a value must not be taken form the fallback delete obj[name]; } else if ( typeof value === 'object' && typeof fallbackValue === 'object' ) { // both values are objects, merge them recursively merge(value, fallbackValue); } } } } function getOrLoad(sId) { if ( !mLocaleDatas[sId] && (!M_SUPPORTED_LOCALES || M_SUPPORTED_LOCALES[sId] === true) ) { var data = mLocaleDatas[sId] = LoaderExtensions.loadResource("sap/ui/core/cldr/" + sId + ".json", { dataType: "json", failOnError : false }); // check if the data is a minified delta file. // If so, load the corresponding fallback data as well, merge it and remove the fallback marker if ( data && data.__fallbackLocale ) { merge(data, getOrLoad(data.__fallbackLocale)); delete data.__fallbackLocale; } // if load fails, null is returned // -> caller will process the fallback chain, in the end a result is identified and stored in mDatas under the originally requested ID } return mLocaleDatas[sId]; } // normalize language and handle special cases sLanguage = (sLanguage && M_ISO639_OLD_TO_NEW[sLanguage]) || sLanguage; // Special case 1: in an SAP context, the inclusive language code "no" always means Norwegian Bokmal ("nb") if ( sLanguage === "no" ) { sLanguage = "nb"; } // Special case 2: for Chinese, derive a default region from the script (this behavior is inherited from Java) if ( sLanguage === "zh" && !sRegion ) { if ( sScript === "Hans" ) { sRegion = "CN"; } else if ( sScript === "Hant" ) { sRegion = "TW"; } } var sId = sLanguage + "_" + sRegion; // the originally requested locale; this is the key under which the result (even a fallback one) will be stored in the end // first try: load CLDR data for specific language / region combination if ( sLanguage && sRegion ) { mData = getOrLoad(sId); } // second try: load data for language only if ( !mData && sLanguage ) { mData = getOrLoad(sLanguage); } // last try: use fallback data mLocaleDatas[sId] = mData || M_DEFAULT_DATA; return mLocaleDatas[sId]; }
javascript
{ "resource": "" }
q19558
isModifierKey
train
function isModifierKey(oEvent) { var sKey = oEvent.key; // based on KeyBoardEvent.key (https://www.w3.org/TR/uievents/) and (https://www.w3.org/TR/uievents-key/) return (sKey === 'Shift') || (sKey === 'Control') || (sKey === 'Alt') || // Chrome uses 'Alt' and 'AltGraph, IE only use 'Alt' (sKey === 'AltGraph') || // see above -^ (sKey === 'CapsLock') || (sKey === 'NumLock'); }
javascript
{ "resource": "" }
q19559
hasDOMElementSize
train
function hasDOMElementSize(oElement) { var oClientRect; if (!oElement) { return false; } oClientRect = oElement.getBoundingClientRect(); return !!(oClientRect.width && oClientRect.height); }
javascript
{ "resource": "" }
q19560
train
function (oEvent) { var aPopoverContent = this._aSubClasses.map(function (oElement) { return new Link({ text: oElement, href: "#/api/" + oElement }).addStyleClass("sapUiTinyMarginBottom sapUiTinyMarginEnd"); }), oPopover = this._getSubClassesAndImplementationsPopover(aPopoverContent); oPopover.openBy(oEvent.getSource()); }
javascript
{ "resource": "" }
q19561
train
function(aUndoStack) { while (aUndoStack.length) { var oOperation = aUndoStack.pop(); this[oOperation.name].apply(this, oOperation.properties); } }
javascript
{ "resource": "" }
q19562
train
function (oControl, bVisible) { var bOldVisible = this.getVisible(oControl); var vReturnValue = JsControlTreeModifier.setVisible.apply(this, arguments); /* If the visibility changed, record the reversal as undo operation */ if (bOldVisible !== this.getVisible(oControl)){ this._saveUndoOperation("setVisible", [oControl, bOldVisible]); } return vReturnValue; }
javascript
{ "resource": "" }
q19563
train
function (oControl, sPropertyName, mBindingInfos) { var mOldBindingInfos = oControl.getBindingInfo(sPropertyName); var vOldValue; var oMetadata = oControl.getMetadata().getPropertyLikeSetting(sPropertyName); if (oMetadata) { var sPropertyGetter = oMetadata._sGetter; vOldValue = oControl[sPropertyGetter](); } JsControlTreeModifier.bindProperty.apply(this, arguments); if (mOldBindingInfos){ this._saveUndoOperation("bindProperty", [oControl, sPropertyName, mOldBindingInfos]); } else { this._saveUndoOperation("unbindProperty", [oControl, sPropertyName]); } if (vOldValue) { this._saveUndoOperation("setProperty", [oControl, sPropertyName, vOldValue]); } }
javascript
{ "resource": "" }
q19564
train
function (oControl, sPropertyName) { var mOldBindingInfos = oControl.getBindingInfo(sPropertyName); JsControlTreeModifier.unbindProperty.apply(this, arguments); if (mOldBindingInfos){ this._saveUndoOperation("bindProperty", [oControl, sPropertyName, mOldBindingInfos]); } }
javascript
{ "resource": "" }
q19565
train
function (oControl, sPropertyName, oPropertyValue) { var vOldValue; var oMetadata = oControl.getMetadata().getPropertyLikeSetting(sPropertyName); if (oMetadata) { var sPropertyGetter = oMetadata._sGetter; vOldValue = oControl[sPropertyGetter](); } var vReturnValue = JsControlTreeModifier.setProperty.apply(this, arguments); /* If the value changed, record the reversal as undo operation */ if (vOldValue !== oPropertyValue){ this._saveUndoOperation("setProperty", [oControl, sPropertyName, vOldValue]); } return vReturnValue; }
javascript
{ "resource": "" }
q19566
train
function (oControl, sPropertyName, oPropertyBinding) { var oOldValue; var oMetadata = oControl.getMetadata().getPropertyLikeSetting(sPropertyName); if (oMetadata) { var sPropertyGetter = oMetadata._sGetter; oOldValue = oControl[sPropertyGetter](); } JsControlTreeModifier.setPropertyBinding.apply(this, arguments); /* If the value changed, record the reversal as undo operation */ if (oOldValue !== oPropertyBinding) { this._saveUndoOperation("setPropertyBinding", [oControl, sPropertyName, oOldValue]); } }
javascript
{ "resource": "" }
q19567
train
function (sClassName, oAppComponent, oView, oSelector, mSettings, bAsync) { var oExistingControl = this.bySelector(oSelector, oAppComponent); var fnCreateUndoOperation = function() { if (!oExistingControl) { var oCreatedControl = this.bySelector(oSelector, oAppComponent); RtaControlTreeModifier._saveUndoOperation("destroy", [oCreatedControl]); } }.bind(this); var vReturnValue = JsControlTreeModifier.createControl.apply(this, arguments); if (bAsync) { return vReturnValue.then(function(oReturnedControl) { fnCreateUndoOperation(); return oReturnedControl; }); } fnCreateUndoOperation(); return vReturnValue; }
javascript
{ "resource": "" }
q19568
train
function(sFragment, sChangeId, oView, oController) { var aControls = JsControlTreeModifier.instantiateFragment.apply(this, arguments); aControls.forEach(function(oControl) { this._saveUndoOperation("destroy", [oControl]); }.bind(this)); return aControls; }
javascript
{ "resource": "" }
q19569
train
function (oParent, sName, oObject, iIndex) { var oOldAggregationValue = JsControlTreeModifier.getAggregation.call(this, oParent, sName); JsControlTreeModifier.insertAggregation.apply(this, arguments); if (oParent) { if (oParent.getMetadata) { var oMetadata = oParent.getMetadata(); var oAggregations = oMetadata.getAllAggregations(); if (oAggregations) { var oAggregation = oAggregations[sName]; if (oAggregation) { if (oAggregation.multiple) { this._saveUndoOperation("removeAggregation", [oParent, sName, oObject]); } else { this._saveUndoOperation("insertAggregation", [oParent, sName, oOldAggregationValue]); } } } } } }
javascript
{ "resource": "" }
q19570
train
function (oParent, sName) { var aOldAggregationElements = []; var vAggregationElements; if (oParent) { vAggregationElements = JsControlTreeModifier.getAggregation.call(this, oParent, sName); } if (vAggregationElements && vAggregationElements instanceof Array) { aOldAggregationElements = vAggregationElements.slice(); } else if (vAggregationElements && vAggregationElements instanceof Object) { aOldAggregationElements[0] = vAggregationElements; } JsControlTreeModifier.removeAllAggregation(oParent, sName); if (aOldAggregationElements){ aOldAggregationElements.forEach(function(oElement) { this._saveUndoOperation("insertAggregation", [oParent, sName, oElement]); }, this); } }
javascript
{ "resource": "" }
q19571
train
function () { // calculate text var sFilterText = ""; jQuery.each(this._oViewSettings.filter, function (sProperty, aValues) { jQuery.each(aValues, function (i, aValue) { sFilterText += aValue + ", "; }); }); if (sFilterText.length > 0) { var iIndex = sFilterText.lastIndexOf(", "); sFilterText = sFilterText.substring(0, iIndex); } // update view var oView = this.getView(); oView.byId("vsFilterBar").setVisible(sFilterText.length > 0); oView.byId("vsFilterLabel").setText(sFilterText); }
javascript
{ "resource": "" }
q19572
train
function () { var aFilters = [], aSorters = [], bFilterChanged = false, bGroupChanged = false, oSearchField = this.byId("searchField"), oList = this.byId("list"), oBinding = oList.getBinding("items"); // add filter for search var sQuery = oSearchField.getValue().trim(); bFilterChanged = true; aFilters.push(new Filter("searchTags", "Contains", sQuery)); // add filters for view settings jQuery.each(this._oViewSettings.filter, function (sProperty, aValues) { var aPropertyFilters = []; jQuery.each(aValues, function (i, aValue) { var sOperator = (sProperty === "formFactors") ? "Contains" : "EQ"; aPropertyFilters.push(new Filter(sProperty, sOperator, aValue)); }); var oFilter = new Filter(aPropertyFilters, false); // second parameter stands for "or" bFilterChanged = true; aFilters.push(oFilter); }); // filter if (bFilterChanged && aFilters.length === 0) { oBinding.filter(aFilters, "Application"); } else if (bFilterChanged && aFilters.length > 0) { var oFilter = new Filter(aFilters, true); // second parameter stands for "and" oBinding.filter(oFilter, "Application"); } if (this._oViewSettings.groupProperty && this._oViewSettings.groupProperty !== this._sCurrentGroup) { bGroupChanged = true; } else if (this._oViewSettings.groupProperty && this._oViewSettings.groupDescending !== this._bCurrentlyGroupedDescending) { bGroupChanged = true; } // group if (bGroupChanged) { var oSorter = new Sorter( this._oViewSettings.groupProperty, this._oViewSettings.groupDescending, this._mGroupFunctions[this._oViewSettings.groupProperty]); aSorters.push(oSorter); aSorters.push(new Sorter("name", false)); oBinding.sort(aSorters); } this._sCurrentGroup = this._oViewSettings.groupProperty; this._bCurrentlyGroupedDescending = this._oViewSettings.groupDescending; // memorize that this function was executed at least once this._bIsViewUpdatedAtLeastOnce = true; }
javascript
{ "resource": "" }
q19573
getModelFormatter
train
function getModelFormatter() { if (!oModelFormatter) { oModelFormatter = DateFormat.getDateInstance({ pattern : 'yyyy-MM-dd', strictParsing : true, UTC : true }); } return oModelFormatter; }
javascript
{ "resource": "" }
q19574
train
function (sTopicId) { this._bIncludeDeprecated = true; // Switch internal flag this.byId("includeDeprecated").setSelected(true); // Update checkbox UI this.buildAndApplyFilters(); // Apply filters this._expandTreeToNode(sTopicId, this.getModel("treeData")); // Select the searched entity }
javascript
{ "resource": "" }
q19575
wrapTimerHandler
train
function wrapTimerHandler(vHandler) { var fnWrappedHandler = function() { var aArgs, fnHandler; if (bPromisesQueued) { aArgs = [fnWrappedHandler, 0].concat(arguments); _timeout.apply(window, aArgs); } else { fnHandler = typeof vHandler !== "function" ? new Function(vHandler) : vHandler; // eslint-disable-line no-new-func fnHandler.apply(window, arguments); } }; return fnWrappedHandler; }
javascript
{ "resource": "" }
q19576
wrapHandler
train
function wrapHandler(fnHandler) { var fnWrappedHandler = function(oEvent) { // The ready state at the time the event is occurring needs to // be preserved, to restore it when the handler is called delayed var iCurrentState = oXHR.readyState; function callHandler() { iReadyState = iCurrentState; // Only if the event has not been removed in the meantime // the handler needs to be called after the timeout if (fnWrappedHandler.active) { return fnHandler.call(oProxy, oEvent); } } // If this is an asynchronous request and a sync request is ongoing, // the execution of all following handler calls needs to be delayed if (!bSync && bSyncRequestOngoing) { bDelay = true; } if (bDelay) { _timeout(callHandler, 0); return true; } return callHandler(); }; fnHandler.wrappedHandler = fnWrappedHandler; fnWrappedHandler.active = true; return fnWrappedHandler; }
javascript
{ "resource": "" }
q19577
train
function(oBody, sDensityMode){ switch (sDensityMode) { case COMPACT: oBody.toggleClass("sapUiSizeCompact", true).toggleClass("sapUiSizeCozy", false).toggleClass("sapUiSizeCondensed", false); break; case CONDENSED: oBody.toggleClass("sapUiSizeCondensed", true).toggleClass("sapUiSizeCozy", false).toggleClass("sapUiSizeCompact", true); break; default: oBody.toggleClass("sapUiSizeCozy", true).toggleClass("sapUiSizeCondensed", false).toggleClass("sapUiSizeCompact", false); } }
javascript
{ "resource": "" }
q19578
train
function(sThemeActive, sDensityMode, bRTL){ var oSampleFrameContent, oSampleFrameCore, $SampleFrame, bRTLChanged, bThemeChanged, bContentDensityChanged; // Handle content density change if (this._oViewSettings.densityMode !== sDensityMode) { this._toggleContentDensityClasses(jQueryDOM(document.body), sDensityMode); this._oViewSettings.densityMode = sDensityMode; bContentDensityChanged = true; } // Handle RTL mode change if (this._oViewSettings.rtl !== bRTL) { this._oCore.getConfiguration().setRTL(bRTL); this._oViewSettings.rtl = bRTL; bRTLChanged = true; } // Handle theme change if (this._oViewSettings.themeActive !== sThemeActive) { this._oCore.applyTheme(sThemeActive); this._oViewSettings.themeActive = sThemeActive; bThemeChanged = true; } else if (bContentDensityChanged) { // NOTE: We notify for content density change only if no theme change is applied because both // methods fire the same event which may lead to unpredictable result. this._oCore.notifyContentDensityChanged(); } // Apply theme and compact mode also to iframe samples if there is actually a change if (bRTLChanged || bContentDensityChanged || bThemeChanged) { $SampleFrame = jQueryDOM("#sampleFrame"); if ($SampleFrame.length > 0) { oSampleFrameContent = $SampleFrame[0].contentWindow; if (oSampleFrameContent) { oSampleFrameCore = oSampleFrameContent.sap.ui.getCore(); if (bContentDensityChanged) { this._toggleContentDensityClasses(oSampleFrameContent.jQuery('body'), sDensityMode); } if (bRTLChanged) { oSampleFrameCore.getConfiguration().setRTL(bRTL); } if (bThemeChanged) { oSampleFrameCore.applyTheme(sThemeActive); } else if (bContentDensityChanged) { // Notify Core for content density change only if no theme change happened oSampleFrameCore.notifyContentDensityChanged(); } } } } }
javascript
{ "resource": "" }
q19579
train
function () { if (!this._oSettingsDialog) { this._oSettingsDialog = new sap.ui.xmlfragment("sap.ui.documentation.sdk.view.appSettingsDialog", this); this._oView.addDependent(this._oSettingsDialog); } setTimeout(function () { var oAppSettings = this._oCore.getConfiguration(), oThemeSelect = this._oCore.byId("ThemeSelect"), sUriParamTheme = new UriParameters(window.location.href).get("sap-theme"), bDensityMode = this._oViewSettings.densityMode; // Theme select oThemeSelect.setSelectedKey(sUriParamTheme ? sUriParamTheme : oAppSettings.getTheme()); // RTL this._oCore.byId("RTLSwitch").setState(oAppSettings.getRTL()); // Density mode select this._oCore.byId("DensityModeSwitch").setSelectedKey(bDensityMode); this._oSettingsDialog.open(); }.bind(this), 0); }
javascript
{ "resource": "" }
q19580
train
function () { var BusyDialog, sDensityMode = this._oCore.byId('DensityModeSwitch').getSelectedKey(), sTheme = this._oCore.byId('ThemeSelect').getSelectedKey(), bRTL = this._oCore.byId('RTLSwitch').getState(); this._oSettingsDialog.close(); // Lazy loading of busy dialog if (!this._oBusyDialog) { //TODO: global jquery call found jQuery.sap.require("sap.m.BusyDialog"); BusyDialog = sap.ui.require("sap/m/BusyDialog"); this._oBusyDialog = new BusyDialog(); this.getView().addDependent(this._oBusyDialog); } // Handle busy dialog this._oBusyDialog.open(); setTimeout(function () { this._oBusyDialog.close(); }.bind(this), 1000); // handle settings change this._applyAppConfiguration(sTheme, sDensityMode, bRTL); // If we are navigating outside the Explored App section: view settings should be reset this.getRouter().attachBeforeRouteMatched(this._viewSettingsResetOnNavigation, this); }
javascript
{ "resource": "" }
q19581
render
train
function render(issues, enableFiltering) { var content = ''; if (enableFiltering) { content += '<div class="filters">' + getSeverityFilters(issues) + '<div>\n'; } content += '<div>' + getIssues(issues) + '</div>'; return '<div>' + content + '</div>'; }
javascript
{ "resource": "" }
q19582
train
function() { clearTimeout(this._delayedCallId); // if interval is active and there are registered listeners var bHasListeners = this._oEventBus._defaultChannel.hasListeners(_EVENT_ID); if (this._iInterval > 0 && bHasListeners) { this._oEventBus.publish(_EVENT_ID); this._delayedCallId = setTimeout(this._trigger, this._iInterval); } }
javascript
{ "resource": "" }
q19583
openSuggestions
train
function openSuggestions(oSF) { if (oSF.getEnableSuggestions()) { if (!oSF._oSuggest) { oSF._oSuggest = new Suggest(oSF); } oSF._oSuggest.open(); } }
javascript
{ "resource": "" }
q19584
train
function(oRm, oTable) { if (!oTable._getAccExtension().getAccMode()) { return; } var sTableId = oTable.getId(); oRm.write("<div class='sapUiTableHiddenTexts' style='display:none;' aria-hidden='true'>"); // aria description for the row and column count _writeAccText(oRm, sTableId, "ariacount"); // aria description for toggling the edit mode _writeAccText(oRm, sTableId, "toggleedit", TableUtils.getResourceText("TBL_TOGGLE_EDIT_KEY")); // aria description for select all button var bAllRowsSelected = TableUtils.areAllRowsSelected(oTable); var mRenderConfig = oTable._oSelectionPlugin.getRenderConfig(); var sSelectAllResourceTextID; if (mRenderConfig.headerSelector.type === "toggle") { sSelectAllResourceTextID = bAllRowsSelected ? "TBL_DESELECT_ALL" : "TBL_SELECT_ALL"; } else if (mRenderConfig.headerSelector.type === "clear") { sSelectAllResourceTextID = "TBL_DESELECT_ALL"; } _writeAccText(oRm, sTableId, "ariaselectall", TableUtils.getResourceText(sSelectAllResourceTextID)); // aria label for row headers _writeAccText(oRm, sTableId, "ariarowheaderlabel", TableUtils.getResourceText("TBL_ROW_HEADER_LABEL")); // aria label for group rows _writeAccText(oRm, sTableId, "ariarowgrouplabel", TableUtils.getResourceText("TBL_ROW_GROUP_LABEL")); // aria label for grand total sums _writeAccText(oRm, sTableId, "ariagrandtotallabel", TableUtils.getResourceText("TBL_GRAND_TOTAL_ROW")); // aria label for group total sums _writeAccText(oRm, sTableId, "ariagrouptotallabel", TableUtils.getResourceText("TBL_GROUP_TOTAL_ROW")); // aria label for column row header _writeAccText(oRm, sTableId, "ariacolrowheaderlabel", TableUtils.getResourceText("TBL_ROW_COL_HEADER_LABEL")); // aria description for table row count _writeAccText(oRm, sTableId, "rownumberofrows"); // aria description for table column count _writeAccText(oRm, sTableId, "colnumberofcols"); // aria description for table cell content _writeAccText(oRm, sTableId, "cellacc"); // aria description for selected row _writeAccText(oRm, sTableId, "ariarowselected", TableUtils.getResourceText("TBL_ROW_DESC_SELECTED")); // aria description for column menu _writeAccText(oRm, sTableId, "ariacolmenu", TableUtils.getResourceText("TBL_COL_DESC_MENU")); // aria description for column header span _writeAccText(oRm, sTableId, "ariacolspan"); // aria description for a filtered column _writeAccText(oRm, sTableId, "ariacolfiltered", TableUtils.getResourceText("TBL_COL_DESC_FILTERED")); // aria description for a sorted column _writeAccText(oRm, sTableId, "ariacolsortedasc", TableUtils.getResourceText("TBL_COL_DESC_SORTED_ASC")); // aria description for a sorted column _writeAccText(oRm, sTableId, "ariacolsorteddes", TableUtils.getResourceText("TBL_COL_DESC_SORTED_DES")); // aria description for invalid table (table with overlay) _writeAccText(oRm, sTableId, "ariainvalid", TableUtils.getResourceText("TBL_TABLE_INVALID")); // aria description for column vsisiblity menu item (Show Column) _writeAccText(oRm, sTableId, "ariashowcolmenu", TableUtils.getResourceText("TBL_COL_VISBILITY_MENUITEM_SHOW")); // aria description for column vsisiblity menu item (Hide Column) _writeAccText(oRm, sTableId, "ariahidecolmenu", TableUtils.getResourceText("TBL_COL_VISBILITY_MENUITEM_HIDE")); // aria description for row expansion via keyboard _writeAccText(oRm, sTableId, "rowexpandtext", TableUtils.getResourceText("TBL_ROW_EXPAND_KEY")); // aria description for row collapse via keyboard _writeAccText(oRm, sTableId, "rowcollapsetext", TableUtils.getResourceText("TBL_ROW_COLLAPSE_KEY")); var oSelectionMode = oTable.getSelectionMode(); if (oSelectionMode !== SelectionMode.None) { // aria description for selection mode in table _writeAccText(oRm, sTableId, "ariaselection", TableUtils.getResourceText(oSelectionMode == SelectionMode.MultiToggle ? "TBL_TABLE_SELECTION_MULTI" : "TBL_TABLE_SELECTION_SINGLE")); } if (oTable.getComputedFixedColumnCount() > 0) { // aria description for fixed columns _writeAccText(oRm, sTableId, "ariafixedcolumn", TableUtils.getResourceText("TBL_FIXED_COLUMN")); } oRm.write("</div>"); }
javascript
{ "resource": "" }
q19585
train
function(oRm, oTable, sType, mParams) { var oExtension = oTable._getAccExtension(); if (!oExtension.getAccMode()) { return; } var mAttributes = oExtension.getAriaAttributesFor(sType, mParams); var oValue, sKey; for (sKey in mAttributes) { oValue = mAttributes[sKey]; if (Array.isArray(oValue)) { oValue = oValue.join(" "); } if (oValue) { oRm.writeAttributeEscaped(sKey, oValue); } } }
javascript
{ "resource": "" }
q19586
train
function(oRm, oTable, oRow, iRowIndex) { if (!oTable._getAccExtension().getAccMode()) { return; } var bIsSelected = oTable.isIndexSelected(iRowIndex); var mTooltipTexts = oTable._getAccExtension().getAriaTextsForSelectionMode(true); var sText = mTooltipTexts.keyboard[bIsSelected ? "rowDeselect" : "rowSelect"]; _writeAccText(oRm, oRow.getId(), "rowselecttext", oRow._bHidden ? "" : sText, ["sapUiTableAriaRowSel"]); }
javascript
{ "resource": "" }
q19587
train
function(oRm, oTable, oRow, iRowIndex) { if (!oTable._getAccExtension().getAccMode()) { return; } var oRowSettings = oRow.getAggregation("_settings"); var sHighlightText = oRowSettings._getHighlightText(); _writeAccText(oRm, oRow.getId(), "highlighttext", sHighlightText); }
javascript
{ "resource": "" }
q19588
train
function(oRm, oTable, oCreationRow) { if (!oTable._getAccExtension().getAccMode()) { return; } _writeAccText(oRm, oCreationRow.getId(), "label", TableUtils.getResourceText("TBL_CREATEROW_LABEL")); }
javascript
{ "resource": "" }
q19589
_applyChange
train
function _applyChange(oChange, oRelevantContainer, mPropertyBag, fnIterator) { var oModifier = mPropertyBag.modifier, oView = mPropertyBag.view, oAppComponent = mPropertyBag.appComponent, oChangeContent = oChange.getContent(), oTargetSource = oChange.getDependentControl(SOURCE_ALIAS, mPropertyBag), oTable = oChange.getDependentControl(TARGET_ALIAS, mPropertyBag), aColumns = oModifier.getAggregation(oTable, COLUMNS_AGGREGATION_NAME), switchCells = function (oRow, iSourceIndex, iTargetIndex) { var aCells = oModifier.getAggregation(oRow, CELLS_AGGREGATION_NAME); // ColumnListItem and GroupHeaderListItem are only allowed for the tables items aggregation. if (!aCells) { Log.warning("Aggregation cells to move not found"); return; } if (iSourceIndex < 0 || iSourceIndex >= aCells.length) { Log.warning("Move cells in table item called with invalid index: " + iSourceIndex); return; } var oMovedCell = aCells[iSourceIndex]; oModifier.removeAggregation(oRow, CELLS_AGGREGATION_NAME, oMovedCell); oModifier.insertAggregation(oRow, CELLS_AGGREGATION_NAME, oMovedCell, iTargetIndex, oView); }, moveColumns = function (iSourceIndex, iTargetIndex) { oModifier.getAggregation(oTable, ITEMS_AGGREGATION_NAME).forEach(function (oItem) { // We are skipping the GroupHeaderListItems, because they are valid for the whole row and does not have cells to move. if (oModifier.getControlType(oItem) === "sap.m.GroupHeaderListItem") { return; } switchCells(oItem, iSourceIndex, iTargetIndex); }); }; if (oTargetSource !== oTable) { Log.warning("Moving columns between different tables is not yet supported."); return false; } // Fetch the information about the movedElements together with the source and target index. oChangeContent.movedElements.forEach(function (mMovedElement) { var oMovedElement = oModifier.bySelector(mMovedElement.selector, oAppComponent, oView), iSourceIndex, iTargetIndex, iCurrentIndexInAggregation, iStoredSourceIndexInChange, sMovedElementId; if (!oMovedElement) { sMovedElementId = mMovedElement.selector && mMovedElement.selector.id; Log.warning("The table column with id: '" + sMovedElementId + "' stored in the change is not found and the move operation cannot be applied"); return; } iCurrentIndexInAggregation = aColumns.indexOf(oMovedElement); iStoredSourceIndexInChange = mMovedElement.sourceIndex; iTargetIndex = jQuery.isFunction(fnIterator) && fnIterator(iCurrentIndexInAggregation); iTargetIndex = jQuery.isNumeric(iTargetIndex) ? iTargetIndex : mMovedElement.targetIndex; if (iCurrentIndexInAggregation !== iTargetIndex) { // By default we are getting the index from the aggregation, because it is possible that the order is // already modified and the column that we want to move is not on the passed source index iSourceIndex = iCurrentIndexInAggregation; } else { // In RTA edit mode, the condition will be false, because the aggregation is modified by the drag and drop action. // Therefore, we need to use the passed source index iSourceIndex = iStoredSourceIndexInChange; } // move children in `columns` aggregation oModifier.removeAggregation(oTable, COLUMNS_AGGREGATION_NAME, oMovedElement); oModifier.insertAggregation(oTable, COLUMNS_AGGREGATION_NAME, oMovedElement, iTargetIndex, oView); // move children in `items` aggregation (actual content) var oTemplate = oModifier.getBindingTemplate(oTable, ITEMS_AGGREGATION_NAME); if (oTemplate) { switchCells(oTemplate, iSourceIndex, iTargetIndex); oModifier.updateAggregation(oTable, ITEMS_AGGREGATION_NAME); } else { moveColumns(iSourceIndex, iTargetIndex); } }, this); return true; }
javascript
{ "resource": "" }
q19590
train
function(oScript, rRegex) { if (oScript && oScript.getAttribute("src") && rRegex.exec(oScript.getAttribute("src"))) { return oScript; } }
javascript
{ "resource": "" }
q19591
findConfig
train
function findConfig(sType, vObject, fnCheck) { var sComponentId = vObject && typeof vObject === "string" ? vObject : (vObject && Component.getOwnerIdFor(vObject)); if (sComponentId) { // if a component name is given only the component customizing // configuration is checked - the customizing configuration is // merged in case of extending components - so the configuration // should be available properly var oComponent = Component.get(sComponentId); var sComponentName = oComponent && oComponent.getMetadata().getComponentName(); // starting with manifest first we need to check the instance // specific configuration first and fallback to the general // customizing configuration of the component var oConfig = mComponentConfigs[sComponentName + "::" + sComponentId]; if (oConfig && oConfig[sType] && fnCheck(oConfig[sType])) { return false; } else { oConfig = mComponentConfigs[sComponentName]; if (oConfig && oConfig[sType] && fnCheck(oConfig[sType])) { return false; } } } else { // TODO: checking order of components? jQuery.each(mComponentConfigs, function(sComponentName, oConfig) { if (oConfig && oConfig[sType] && fnCheck(oConfig[sType])) { return false; } }); } }
javascript
{ "resource": "" }
q19592
train
function(sComponentName) { Log.info("CustomizingConfiguration: activateForComponent('" + sComponentName + "')"); var sFullComponentName = sComponentName + ".Component"; sap.ui.requireSync(sFullComponentName.replace(/\./g, "/")); var oCustomizingConfig = ObjectPath.get(sFullComponentName).getMetadata().getCustomizing(); mComponentConfigs[sComponentName] = oCustomizingConfig; Log.debug("CustomizingConfiguration: customizing configuration for component '" + sComponentName + "' loaded: " + JSON.stringify(oCustomizingConfig)); }
javascript
{ "resource": "" }
q19593
train
function(oComponent) { Log.info("CustomizingConfiguration: activateForComponentInstance('" + oComponent.getId() + "')"); var sComponentName = oComponent.getMetadata().getComponentName(), sKey = sComponentName + "::" + oComponent.getId(), oCustomizingConfig = oComponent.getManifest()["sap.ui5"] && oComponent.getManifest()["sap.ui5"]["extends"] && oComponent.getManifest()["sap.ui5"]["extends"]["extensions"]; mComponentConfigs[sKey] = oCustomizingConfig; Log.debug("CustomizingConfiguration: customizing configuration for component '" + sKey + "' loaded: " + JSON.stringify(oCustomizingConfig)); }
javascript
{ "resource": "" }
q19594
train
function(oComponent) { var sComponentName = oComponent.getMetadata().getComponentName(), sKey = sComponentName + "::" + oComponent.getId(); if (mComponentConfigs[sKey]) { Log.info("CustomizingConfiguration: deactivateForComponent('" + sKey + "')"); delete mComponentConfigs[sKey]; } }
javascript
{ "resource": "" }
q19595
train
function(sViewName, vObject) { var oResultConfig; // TODO: checking order of components? findConfig(CONFIG_VIEW_REPLACEMENTS, vObject, function(oConfig) { oResultConfig = oConfig[sViewName]; return !!oResultConfig; }); return oResultConfig; }
javascript
{ "resource": "" }
q19596
train
function(sViewName, sExtensionPointName, vObject) { // FIXME: currently ONE extension wins, but they should be somehow merged - but how to define the order? var oResultConfig; // TODO: checking order of components? findConfig(CONFIG_VIEW_EXTENSIONS, vObject, function(oConfig) { oResultConfig = oConfig[sViewName] && oConfig[sViewName][sExtensionPointName]; return !!oResultConfig; }); return oResultConfig; }
javascript
{ "resource": "" }
q19597
train
function(sControllerName, vObject) { var oResultConfig; findConfig(CONFIG_CONTROLLER_EXTENSIONS, vObject, function(oConfig) { oResultConfig = oConfig[sControllerName]; return !!oResultConfig; }); return oResultConfig; }
javascript
{ "resource": "" }
q19598
train
function(sControllerName, vObject) { var oResultConfig; findConfig(CONFIG_CONTROLLER_REPLACEMENTS, vObject, function(oConfig) { oResultConfig = oConfig[sControllerName]; return !!oResultConfig; }); return oResultConfig; }
javascript
{ "resource": "" }
q19599
train
function(aIssues) { aIssues.forEach(function(element){ switch (element.severity) { case constants.SUPPORT_ASSISTANT_ISSUE_SEVERITY_LOW: element.severityIcon = mIssueSettings.severityIcons.Low; element.severityColor = constants.SUPPORT_ASSISTANT_SEVERITY_LOW_COLOR; break; case constants.SUPPORT_ASSISTANT_ISSUE_SEVERITY_MEDIUM: element.severityIcon = mIssueSettings.severityIcons.Medium; element.severityColor = constants.SUPPORT_ASSISTANT_SEVERITY_MEDIUM_COLOR; break; case constants.SUPPORT_ASSISTANT_ISSUE_SEVERITY_HIGH: element.severityIcon = mIssueSettings.severityIcons.High; element.severityColor = constants.SUPPORT_ASSISTANT_SEVERITY_HIGH_COLOR; break; } }); }
javascript
{ "resource": "" }