_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 52 373k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q19200 | train | function (control) {
var aggregations = control.getMetadata().getAllAggregations();
var aggregationsBindingData = Object.create(null);
for (var key in aggregations) {
if (aggregations.hasOwnProperty(key) && control.getBinding(key)) {
aggregationsBindingData[key] = Object.create(null);
aggr... | javascript | {
"resource": ""
} | |
q19201 | train | function (controlId) {
var result = Object.create(null);
var control = sap.ui.getCore().byId(controlId);
var bindingContext;
if (!control) {
return result;
}
bindingContext = control.getBindingContext();
result.meta = Object.create(null);
result.contextPath = bindingContext ? bin... | javascript | {
"resource": ""
} | |
q19202 | train | function (context) {
var that = context;
assert(!!that, "No ToolPopup instance given for _fnGetInitialFocus");
// if there is an initial focus it was already set to the Popup onBeforeRendering
if (!that._bFocusSet) {
_fnGetNewFocusElem... | javascript | {
"resource": ""
} | |
q19203 | train | function (context) {
var oElement;
var oFocusControl;
var that = context;
var defaultFocusableElements = [that._mParameters.firstFocusable, that._mParameters.lastFocusable];
// jQuery custom selectors ":sapTabbable"
var aTab... | javascript | {
"resource": ""
} | |
q19204 | _fnGetFocusControlById | train | function _fnGetFocusControlById(oToolPopup, id) {
var oControl,
parent;
if (!id) {
return null;
}
oControl = sap.ui.getCore().byId(id);
while (!oControl && oControl !== oToolPopup) {
... | javascript | {
"resource": ""
} |
q19205 | train | function (oThis) {
if (!oThis.getOpener()) {
var sId = "";
if (oThis.oPopup) {
if (oThis.oPopup._oPosition.of instanceof sap.ui.core.Element) {
sId = oThis.oPopup._oPosition.of.getId();
} ... | javascript | {
"resource": ""
} | |
q19206 | train | function (oThis) {
var sParam = "sapUiUx3ToolPopupArrowWidth";
oThis.sArrowWidth = Parameters.get(sParam);
oThis.iArrowWidth = parseInt(oThis.sArrowWidth);
sParam = "sapUiUx3ToolPopupArrowHeight";
oThis.sArrowHeight = Parameters.get(sParam... | javascript | {
"resource": ""
} | |
q19207 | train | function (oThis) {
// do not mirror the arrow direction here in RTL mode, because otherwise the offset is calculated wrong
// (Because the offset mirroring happens inside popup)
// the arrow is later mirrored at the output...
// this is the default case ... | javascript | {
"resource": ""
} | |
q19208 | train | function(rm, oControl) {
// execute the template with the above options
var sHTML = fnTemplate(oControl.getContext() || {}, {
data: {
renderManager: rm,
rootControl: oControl,
view: oView
},
helpers: HandlebarsTemplate.RENDER_HELPERS
});
// write the markup
rm.write(sHTML);
... | javascript | {
"resource": ""
} | |
q19209 | train | function (oContext) {
oControl = oContext;
// Get and calculate padding's
this._iREMSize = parseInt(jQuery("body").css("font-size"));
this._iChildControlMargin = parseInt(Parameters.get("_sap_f_ShellBar_ChildMargin"));
this._iDoubleChildControlMargin = this._iChildControlMargin * 2;
this._iCoPilotWidth = p... | javascript | {
"resource": ""
} | |
q19210 | train | function (oSelector, oAppComponent, oView) {
var sControlId = this.getControlIdBySelector(oSelector, oAppComponent);
return this._byId(sControlId, oView);
} | javascript | {
"resource": ""
} | |
q19211 | train | function (oSelector, oAppComponent) {
if (!oSelector){
return undefined;
}
if (typeof oSelector === "string") {
oSelector = {
id: oSelector
};
}
var sControlId = oSelector.id;
if (oSelector.idIsLocal) {
if (oAppComponent) {
sControlId = oAppComponent.createId(sControlId);
... | javascript | {
"resource": ""
} | |
q19212 | train | function (vControl, oAppComponent, mAdditionalSelectorInformation) {
var sControlId = vControl;
if (typeof sControlId !== "string") {
sControlId = (vControl) ? this.getId(vControl) : undefined;
} else if (!oAppComponent) {
throw new Error("App Component instance needed to get a selector from string ID"... | javascript | {
"resource": ""
} | |
q19213 | train | function (vControl, oAppComponent, bSuppressLogging) {
var sControlId = vControl instanceof ManagedObject ? vControl.getId() : vControl;
var bIsGenerated = ManagedObjectMetadata.isGeneratedId(sControlId);
if (!bIsGenerated || this.hasLocalIdSuffix(vControl, oAppComponent)) {
return true;
} else {
... | javascript | {
"resource": ""
} | |
q19214 | train | function (vControl, oAppComponent) {
var sControlId = (vControl instanceof ManagedObject) ? vControl.getId() : vControl;
if (!oAppComponent) {
Log.error("Determination of a local ID suffix failed due to missing app component for " + sControlId);
return false;
}
return !!oAppComponent.getLocalId(sC... | javascript | {
"resource": ""
} | |
q19215 | train | function(oFragment, sIdPrefix) {
var oParseError = XMLHelper.getParseError(oFragment);
if (oParseError.errorCode !== 0) {
throw new Error(oFragment.parseError.reason);
}
var oControlNodes = oFragment.documentElement;
var aRootChildren = [], aChildren = [];
if (oControlNodes.localName === "Fragme... | javascript | {
"resource": ""
} | |
q19216 | train | function(oNode) {
var aChildren = [];
var aNodes = oNode.childNodes;
for (var i = 0, n = aNodes.length; i < n; i++) {
if (aNodes[i].nodeType === 1) {
aChildren.push(aNodes[i]);
}
}
return aChildren;
} | javascript | {
"resource": ""
} | |
q19217 | train | function(oElement, sType) {
var oInstance = ObjectPath.get(sType);
if (typeof oInstance === "function") {
return oElement instanceof oInstance;
} else {
return false;
}
} | javascript | {
"resource": ""
} | |
q19218 | train | function(oControl) {
var sControlType = this._getControlTypeInXml(oControl);
jQuery.sap.require(sControlType);
var ControlType = ObjectPath.get(sControlType);
return ControlType.getMetadata();
} | javascript | {
"resource": ""
} | |
q19219 | train | function (oControl) {
var sControlType = oControl.namespaceURI;
sControlType = sControlType ? sControlType + "." : ""; // add a dot if there is already a prefix
sControlType += oControl.localName;
return sControlType;
} | javascript | {
"resource": ""
} | |
q19220 | train | function(fnCallback, oRootNode) {
function recurse(oParent, oCurrentNode, bIsAggregation) {
var oAggregations;
if (!bIsAggregation) {
var oMetadata = this._getControlMetadataInXml(oCurrentNode);
oAggregations = oMetadata.getAllAggregations();
}
var aChildren = this._getElementNodeChildren(o... | javascript | {
"resource": ""
} | |
q19221 | train | function(parentId, moduleName) {
moduleName = normalizeModule(parentId, moduleName);
var module = define.modules[moduleName];
if (!module) {
module = define.payloads[moduleName];
if (typeof module === 'function') {
var exports = {};
var mod = {
id: mo... | javascript | {
"resource": ""
} | |
q19222 | transformVersionInfo | train | function transformVersionInfo() {
// get the transitive dependencies of the given libs from the sap.ui.versioninfo
// only do this once if mKnownLibs is not created yet
if (sap.ui.versioninfo && sap.ui.versioninfo.libraries && !mKnownLibs) {
// flatten dependency lists for all libs
mKnownLibs = {};
sap.... | javascript | {
"resource": ""
} |
q19223 | process | train | function process(vValue, oModel, sPath, iCurrentLevel, iMaxLevel) {
var bReachedMaxLevel = iCurrentLevel === iMaxLevel;
if (bReachedMaxLevel) {
Log.warning("BindingResolver maximum level processing reached. Please check for circular dependencies.");
}
if (!vValue || bReachedMaxLevel) {
return vValu... | javascript | {
"resource": ""
} |
q19224 | resolveBinding | train | function resolveBinding(sBinding, oModel, sPath) {
if (!sBinding) {
return sBinding;
}
var oBindingInfo = ManagedObject.bindingParser(sBinding);
if (!oBindingInfo) {
return sBinding;
}
if (!sPath) {
sPath = "/";
}
oSimpleControl.setModel(oModel);
oSimpleControl.bindObject(sPath... | javascript | {
"resource": ""
} |
q19225 | train | function (mAggregate) {
return !!mAggregate && Object.keys(mAggregate).some(function (sAlias) {
return mAggregate[sAlias].grandTotal;
});
} | javascript | {
"resource": ""
} | |
q19226 | train | function (mAggregate) {
return !!mAggregate && Object.keys(mAggregate).some(function (sAlias) {
var oDetails = mAggregate[sAlias];
return oDetails.min || oDetails.max;
});
} | javascript | {
"resource": ""
} | |
q19227 | toggleSizeClasses | train | function toggleSizeClasses(iSize) {
var sCurrentSizeClass = 'sapMSize' + iSize,
oRef = this.$(),
i,
sClass;
if (oRef) {
for (i = 0; i < 3; i++) {
sClass = 'sapMSize' + i;
if (sClass === sCurrentSizeClass) {
oRef.addClass(sClass);
} else {
oRef.removeClass(sClass);
}
}
}
... | javascript | {
"resource": ""
} |
q19228 | mixInto | train | function mixInto(fnClass, bDefaultValue) {
// add the properties
fnClass.getMetadata().addSpecialSetting("stashed", {type: "boolean", defaultValue: !!bDefaultValue});
// mix the required methods into the target fnClass
fnClass.prototype.setStashed = function(bStashed) {
if (this.stashed === true && !bS... | javascript | {
"resource": ""
} |
q19229 | train | function (oRouteMatch) {
var that = this;
var mRouteArguments = oRouteMatch.getParameter("arguments");
this.sLayer = mRouteArguments.layer;
this.sNamespace = mRouteArguments.namespace || "";
var oPage = this.getView().getContent()[0];
oPage.setBusy(true);
that.sNamespace = decodeURIComponent(that.s... | javascript | {
"resource": ""
} | |
q19230 | train | function (oPage, oData) {
var oContentModel = this.getView().getModel("content");
oContentModel.setData(oData);
oPage.setBusy(false);
this.filterListByQuery("");
this.byId("search").setValue("");
} | javascript | {
"resource": ""
} | |
q19231 | train | function (sQuery) {
// add filter for search
var aFilters = [];
if (sQuery && sQuery.length > 0) {
aFilters = new Filter({
filters: [
new Filter("name", FilterOperator.Contains, sQuery),
new Filter("fileType", FilterOperator.Contains, sQuery)
],
and: false
});
}
// upd... | javascript | {
"resource": ""
} | |
q19232 | train | function (oEvent) {
var sSource = oEvent.getSource();
var sContentBindingPath = sSource.getBindingContextPath().substring(1);
var sContentModelData = this.getView().getModel("content").getData();
var sContent = sContentModelData[sContentBindingPath];
var sContentName = sContent.name;
var sContentFileT... | javascript | {
"resource": ""
} | |
q19233 | train | function () {
var oRouter = UIComponent.getRouterFor(this);
if (!this.sNamespace || this.sNamespace === "/") {
oRouter.navTo("Layers");
} else {
var sSplittedNamespace = this.sNamespace.split("/");
sSplittedNamespace.splice(-2, 1);
var sTargetNamespace = sSplittedNamespace.join("/");
oRoute... | javascript | {
"resource": ""
} | |
q19234 | train | function () {
if (!this.sNamespace || this.sNamespace === '/') {
return "[" + this.sLayer + "] /";
}
var aSplittedNamespace = this.sNamespace.split('/');
var sNamespaceDepth = aSplittedNamespace.length;
if (sNamespaceDepth > 2) {
return "[" + this.sLayer + "] .../" + aSplittedNamespace[sNamespac... | javascript | {
"resource": ""
} | |
q19235 | train | function (oEvent) {
var sSource = oEvent.getSource();
sap.ui.require(["sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils"], function (ErrorUtils) {
ErrorUtils.handleMessagePopoverPress(sSource);
});
} | javascript | {
"resource": ""
} | |
q19236 | train | function(oOverlay) {
var oModel = oOverlay.getElement().getModel();
if (oModel){
var oMetaModel = oModel.getMetaModel();
if (oMetaModel && oMetaModel.loaded){
oMetaModel.loaded().then(function(){
this.evaluateEditable([oOverlay], {onRegistration: true});
}.bind(this));
}
}
Plugin... | javascript | {
"resource": ""
} | |
q19237 | train | function (oEvent) {
// open field ext ui
var oUshellContainer = FlUtils.getUshellContainer();
var oCrossAppNav = oUshellContainer.getService("CrossApplicationNavigation");
var sHrefForFieldExtensionUi = (oCrossAppNav && oCrossAppNav.hrefForExternal({
target : {
semanticObject : "CustomField",
... | javascript | {
"resource": ""
} | |
q19238 | train | function(oOverlay) {
return {
asSibling: this._isEditableCheck.call(this, oOverlay, true),
asChild: this._isEditableCheck.call(this, oOverlay, false)
};
} | javascript | {
"resource": ""
} | |
q19239 | addUrlForSchema | train | function addUrlForSchema(oMetaModel, sSchema, sReferenceUri, sDocumentUri) {
var sUrl0,
mUrls = oMetaModel.mSchema2MetadataUrl[sSchema];
if (!mUrls) {
mUrls = oMetaModel.mSchema2MetadataUrl[sSchema] = {};
mUrls[sReferenceUri] = false;
} else if (!(sReferenceUri in mUrls)) {
sUrl0 = Object.keys(mUrls)... | javascript | {
"resource": ""
} |
q19240 | getQualifier | train | function getQualifier(sTerm, sExpectedTerm) {
if (sTerm === sExpectedTerm) {
return "";
}
if (sTerm.indexOf(sExpectedTerm) === 0 && sTerm[sExpectedTerm.length] === "#"
&& sTerm.indexOf("@", sExpectedTerm.length) < 0) {
return sTerm.slice(sExpectedTerm.length + 1);
}
} | javascript | {
"resource": ""
} |
q19241 | getValueListQualifier | train | function getValueListQualifier(sTerm) {
var sQualifier = getQualifier(sTerm, sValueListMapping);
return sQualifier !== undefined ? sQualifier : getQualifier(sTerm, sValueList);
} | javascript | {
"resource": ""
} |
q19242 | maybeParameter | train | function maybeParameter(sName, aOverloads) {
return aOverloads.some(function (oOverload) {
return oOverload.$Parameter && oOverload.$Parameter.some(function (oParameter) {
return oParameter.$Name === sName;
});
});
} | javascript | {
"resource": ""
} |
q19243 | reportAndThrowError | train | function reportAndThrowError(oMetaModel, sMessage, sDetails) {
var oError = new Error(sDetails + ": " + sMessage);
oMetaModel.oModel.reportError(sMessage, sODataMetaModel, oError);
throw oError;
} | javascript | {
"resource": ""
} |
q19244 | train | function () {
var aContexts = [],
oPromise = this.fetchContexts(),
that = this;
if (oPromise.isFulfilled()) {
aContexts = oPromise.getResult();
} else {
oPromise.then(function (aContexts) {
that.setContexts(aContexts);
that._fireChange({reason: ChangeReason.Change});
});
aCon... | javascript | {
"resource": ""
} | |
q19245 | prepareKeyPredicate | train | function prepareKeyPredicate(sSegment) {
aEditUrl.push({path : sInstancePath, prefix : sSegment, type : oType});
} | javascript | {
"resource": ""
} |
q19246 | stripPredicate | train | function stripPredicate(sSegment) {
var i = sSegment.indexOf("(");
return i >= 0 ? sSegment.slice(0, i) : sSegment;
} | javascript | {
"resource": ""
} |
q19247 | pushToEditUrl | train | function pushToEditUrl(sSegment) {
if (sSegment.includes("($uid=")) {
prepareKeyPredicate(stripPredicate(sSegment));
} else {
aEditUrl.push(sSegment);
}
} | javascript | {
"resource": ""
} |
q19248 | train | function () {
var oView = this.getView(),
// Collect all possible items from all lists
aItems = [].concat(
oView.byId("allList").getItems(),
oView.byId("apiList").getItems(),
oView.byId("documentationList").getItems(),
oView.byId("samplesList").getItems()
),
iLen = aItems... | javascript | {
"resource": ""
} | |
q19249 | _showYearPicker | train | function _showYearPicker(){
var oDate = this._getFocusedDate();
var oYearPicker = this.getAggregation("yearPicker");
if (oYearPicker.getDomRef()) {
// already rendered
oYearPicker.$().css("display", "");
} else {
var oRm = sap.ui.getCore().createRenderManager();
var $Container = this.$("content");... | javascript | {
"resource": ""
} |
q19250 | replaceLambdaVariables | train | function replaceLambdaVariables(sPath, mLambdaVariableToPath) {
var aSegments = sPath.split("/");
aSegments[0] = mLambdaVariableToPath[aSegments[0]];
return aSegments[0] ? aSegments.join("/") : sPath;
} | javascript | {
"resource": ""
} |
q19251 | train | function(oTable) {
return {
columnCount: oTable.getColumns().length,
visibleColumnCount: TableColumnUtils.TableUtils.getVisibleColumnCount(oTable),
columnMap: TableColumnUtils.getColumnMap(oTable)
};
} | javascript | {
"resource": ""
} | |
q19252 | train | function(oTable) {
var i;
var oColumn;
var oColumnMapItem = {};
var oColumnMap = {};
var aColumns = oTable.getColumns();
var iMaxLevel = TableColumnUtils.TableUtils.getHeaderRowCount(oTable);
var oParentReferences = {};
for (var iColumnIndex = 0; iColumnIndex < aColumns.length; iColumnIndex++... | javascript | {
"resource": ""
} | |
q19253 | train | function(oTable, sColumnId, iLevel) {
var oColumnMapItem = TableColumnUtils.getColumnMapItem(oTable, sColumnId);
if (!oColumnMapItem) {
return undefined;
}
var aParents = [];
for (var i = 0; i < oColumnMapItem.parents.length; i++) {
var oParent = oColumnMapItem.parents[i];
if (iLevel === und... | javascript | {
"resource": ""
} | |
q19254 | train | function(oTable, sColumnId, iLevel) {
var oColumnMapItem = TableColumnUtils.getColumnMapItem(oTable, sColumnId);
if (!oColumnMapItem) {
return undefined;
}
var aChildren = [];
var iEnd;
if (iLevel === undefined) {
iEnd = oColumnMapItem.levelInfo.length;
} else {
iEnd = iLevel + 1;
}... | javascript | {
"resource": ""
} | |
q19255 | train | function(oColumn) {
var oTable = oColumn.getParent();
if (!oTable || !oTable.getEnableColumnReordering()) {
// Column reordering is not active at all
return false;
}
var iCurrentIndex = oTable.indexOfColumn(oColumn);
if (iCurrentIndex < oTable.getComputedFixedColumnCount() || iCurrentIndex < oT... | javascript | {
"resource": ""
} | |
q19256 | train | function(oColumn, iNewIndex) {
var oTable = oColumn.getParent(),
iCurrentIndex = oTable.indexOfColumn(oColumn),
aColumns = oTable.getColumns();
if (iNewIndex > iCurrentIndex) {
// The index is always given for the current table setup
// -> A move consists of a remove and an insert, so if a column... | javascript | {
"resource": ""
} | |
q19257 | train | function(oColumn, iNewIndex) {
var oTable = oColumn.getParent();
if (!oTable || iNewIndex === undefined || !TableColumnUtils.isColumnMovable(oColumn)) {
// Column is not movable at all
return false;
}
iNewIndex = TableColumnUtils.normalizeColumnMoveTargetIndex(oColumn, iNewIndex);
if (iNewInde... | javascript | {
"resource": ""
} | |
q19258 | train | function(oColumn, iNewIndex) {
if (!TableColumnUtils.isColumnMovableTo(oColumn, iNewIndex)) {
return false;
}
var oTable = oColumn.getParent(),
iCurrentIndex = oTable.indexOfColumn(oColumn);
if (iNewIndex === iCurrentIndex) {
return false;
}
iNewIndex = TableColumnUtils.normalizeColumnM... | javascript | {
"resource": ""
} | |
q19259 | train | function(oTable, iColumnIndex, iWidth, bFireEvent, iColumnSpan) {
if (!oTable ||
iColumnIndex == null || iColumnIndex < 0 ||
iWidth == null || iWidth <= 0) {
return false;
}
if (iColumnSpan == null || iColumnSpan <= 0) {
iColumnSpan = 1;
}
if (bFireEvent == null) {
bFireEvent = true;
... | javascript | {
"resource": ""
} | |
q19260 | train | function(sLocationUrl) {
// Try to request the har file from the given location url
var mHarFileContent = null;
var oRequest = new XMLHttpRequest();
oRequest.open("GET", sLocationUrl, false);
oRequest.addEventListener("load", function() {
if (this.status === 200) {
mHarFileContent = JSON.parse(t... | javascript | {
"resource": ""
} | |
q19261 | train | function(mHarFileContent) {
var aEntries;
if (!mHarFileContent.log.entries || !mHarFileContent.log.entries.length) {
this.oLog.info(sModuleName + " - Empty entries array or the provided har file is empty.");
aEntries = [];
} else {
// Add start and end timestamps to determine the request and respon... | javascript | {
"resource": ""
} | |
q19262 | train | function(sMethod, sUrl) {
var sUrlResourcePart = new URI(sUrl).resource();
sUrlResourcePart = this.replaceEntriesUrlByRegex(sUrlResourcePart);
return sMethod + sUrlResourcePart;
} | javascript | {
"resource": ""
} | |
q19263 | train | function(sUrl) {
for (var i = 0; i < this.aEntriesUrlReplace.length; i++) {
var oEntry = this.aEntriesUrlReplace[i];
if (oEntry.regex instanceof RegExp && oEntry.value !== undefined) {
sUrl = sUrl.replace(oEntry.regex, oEntry.value);
} else {
this.oLog.warning(sModuleName + " - Invalid regular ... | javascript | {
"resource": ""
} | |
q19264 | train | function(bDeleteRecordings) {
// Check for the filename or ask for it (if configured)
var sFilename = (this.sFilename || this.sDefaultFilename);
if (this.bPromptForDownloadFilename) {
sFilename = window.prompt("Enter file name", sFilename + ".har");
} else {
sFilename = sFilename + ".har";
}
... | javascript | {
"resource": ""
} | |
q19265 | train | function(mDelaySettings, iTime) {
if (mDelaySettings) {
if (mDelaySettings.factor !== undefined && typeof mDelaySettings.factor === 'number') {
iTime *= mDelaySettings.factor;
}
if (mDelaySettings.offset !== undefined && typeof mDelaySettings.offset === 'number') {
iTime += mDelaySettings.offse... | javascript | {
"resource": ""
} | |
q19266 | train | function(oXhr, oEntry) {
var fnRespond = function() {
if (oXhr.readyState !== 0) {
var sResponseText = oEntry.response.content.text;
// Transform headers to the required format for XMLHttpRequests.
var oHeaders = {};
oEntry.response.headers.forEach(function(mHeader) {
oHeaders[mHeader.... | javascript | {
"resource": ""
} | |
q19267 | train | function(sUrl, aEntriesUrlFilter) {
if (this.bIsPaused) {
return true;
}
var that = this;
return aEntriesUrlFilter.every(function(regex) {
if (regex instanceof RegExp) {
return !regex.test(sUrl);
} else {
that.oLog.error(sModuleName + " - Invalid regular expression for filter.");
... | javascript | {
"resource": ""
} | |
q19268 | train | function(mOptions) {
mOptions = mOptions || {};
if (typeof mOptions !== "object") {
throw new Error("Parameter object isn't a valid object");
}
// Reset all parameters to default
this.mHarFileContent = null;
this.aRequests = [];
this.sFilename = "";
this.bIsRecording = false;
this.bIsPau... | javascript | {
"resource": ""
} | |
q19269 | train | function(locationUrl, options) {
try {
// Try to start play-mode
this.play(locationUrl, options);
} catch (e) {
// If play-mode could not be started, try to record instead.
var oUri = new URI(locationUrl);
var sExtension = oUri.suffix();
// Check if the provided URL is a har file, maybe th... | javascript | {
"resource": ""
} | |
q19270 | train | function(filename, options) {
_private.oLog.info(sModuleName + " - Record");
if (window.XMLHttpRequest.name === 'FakeXMLHttpRequest') {
_private.oLog.warning(sModuleName + " - Sinon FakeXMLHttpRequest is enabled by another application, recording could be defective");
}
if (_private.isRecordStarted()) {
... | javascript | {
"resource": ""
} | |
q19271 | train | function() {
_private.oLog.info(sModuleName + " - Stop");
var mHarContent = null;
if (_private.isRecordStarted()) {
mHarContent = _private.getHarContent(true);
}
// do this for a full cleanup
_private.init();
return mHarContent;
} | javascript | {
"resource": ""
} | |
q19272 | train | function(deleteRecordings) {
var bDeleteRecordings = deleteRecordings || false;
_private.oLog.info(sModuleName + " - Get Recordings");
return _private.getHarContent(bDeleteRecordings);
} | javascript | {
"resource": ""
} | |
q19273 | train | function(url, response, method, status, headers) {
var aHeaders = headers || [];
aHeaders.push({
"name": "Content-Type",
"value": "application/json;charset=utf-8"
});
this.addResponse(url, response, method, status, aHeaders);
} | javascript | {
"resource": ""
} | |
q19274 | train | function(url, response, method, status, headers) {
if (!_private.isPlayStarted()) {
throw new Error("Start the player first before you add a response.");
}
var sMethod = method || "GET";
var aHeaders = headers || [{
"name": "Content-Type",
"value": "text/plain;charset=utf-8"
}];
var iStatu... | javascript | {
"resource": ""
} | |
q19275 | remove | train | function remove(id) {
var oItem = sap.ui.getCore().byId(id);
if (oItem) {
oItem.destroy();
}
} | javascript | {
"resource": ""
} |
q19276 | train | function(oContext) {
var oGroup = this.fnGroup(oContext);
if (typeof oGroup === "string" || typeof oGroup === "number" || typeof oGroup === "boolean" || oGroup == null) {
oGroup = {
key: oGroup
};
}
return oGroup;
} | javascript | {
"resource": ""
} | |
q19277 | location | train | function location(doclet) {
var filename = (doclet.meta && doclet.meta.filename) || "unknown";
return " #" + ui5data(doclet).id + "@" + filename + (doclet.meta.lineno != null ? ":" + doclet.meta.lineno : "") + (doclet.synthetic ? "(synthetic)" : "");
} | javascript | {
"resource": ""
} |
q19278 | unwrap | train | function unwrap(docletSrc) {
if (!docletSrc) { return ''; }
// note: keep trailing whitespace for @examples
// extra opening/closing stars are ignored
// left margin is considered a star and a space
// use the /m flag on regex to avoid having to guess what this platform's newline is
docletSrc =
docletSrc.repla... | javascript | {
"resource": ""
} |
q19279 | preprocessComment | train | function preprocessComment(e) {
var src = e.comment;
// add a default visibility
if ( !/@private|@public|@protected|@sap-restricted|@ui5-restricted/.test(src) ) {
src = unwrap(src);
src = src + "\n@private";
src = wrap(src);
// console.log("added default visibility to '" + src + "'");
}
if ( /@class/.te... | javascript | {
"resource": ""
} |
q19280 | train | function(e) {
pathPrefixes = env.opts._.reduce(function(result, fileOrDir) {
fileOrDir = path.resolve( path.normalize(fileOrDir) );
if ( fs.statSync(fileOrDir).isDirectory() ) {
// ensure a trailing path separator
if ( fileOrDir.indexOf(path.sep, fileOrDir.length - path.sep.length) < 0 ) {
fileOrD... | javascript | {
"resource": ""
} | |
q19281 | train | function (e) {
currentProgram = undefined;
currentModule = {
name: null,
resource: getResourceName(e.filename),
module: getModuleName(getResourceName(e.filename)),
localNames: Object.create(null)
};
} | javascript | {
"resource": ""
} | |
q19282 | train | function(a, fnCallback) {
var o = {};
if (a) {
for (var i = 0, l = a.length; i < l; i++) {
var oValue = a[i];
if (typeof oValue === "string") {
o[oValue] = typeof fnCallback === "function" && fnCallback(oValue) || {};
}
}
}
return o;
} | javascript | {
"resource": ""
} | |
q19283 | parse | train | function parse(sValue) {
sValue = sValue.trim();
var oTokenizer = new JSTokenizer();
var aResult = [];
var sBuffer = "";
var iParenthesesCounter = 0;
oTokenizer.init(sValue, 0);
for (;;) {
var sSymbol = oTokenizer.next();
if ( sSymbol === '"' || sSymbol === "'" ) {
var pos =... | javascript | {
"resource": ""
} |
q19284 | initPreprocessor | train | function initPreprocessor(oPreprocessor, bAsync) {
var oPreprocessorImpl;
if (typeof oPreprocessor.preprocessor === "string") {
var sPreprocessorName = oPreprocessor.preprocessor.replace(/\./g, "/");
// module string given, resolve and retrieve object
if (bAsync) {
return new Promise(function(resolve... | javascript | {
"resource": ""
} |
q19285 | initPreprocessorQueues | train | function initPreprocessorQueues(oView, mSettings) {
var oViewClass = oView.getMetadata().getClass();
function resolvePreprocessors(oPreprocessor) {
oPreprocessor.preprocessor = initPreprocessor(oPreprocessor, mSettings.async);
}
// shallow copy to avoid issues when manipulating the internal object structur... | javascript | {
"resource": ""
} |
q19286 | train | function(oThis, mSettings) {
if (!sap.ui.getCore().getConfiguration().getControllerCodeDeactivated()) {
// only set when used internally
var oController = mSettings.controller,
sName = oController && typeof oController.getMetadata === "function" && oController.getMetadata().getName(),
bAsync = mSetting... | javascript | {
"resource": ""
} | |
q19287 | preProcessSymbols | train | function preProcessSymbols(symbols) {
// Create treeName and modify module names
symbols.forEach(oSymbol => {
let sModuleClearName = oSymbol.name.replace(/^module:/, "");
oSymbol.displayName = sModuleClearName;
oSymbol.treeName = sModuleClearName.replace(/\//g, ".");
});
// Create missing - vir... | javascript | {
"resource": ""
} |
q19288 | createApiRefApiJson | train | function createApiRefApiJson(oChainObject) {
if (returnOutputFiles) {
// If requested, return data instead of writing to FS (required by UI5 Tooling/UI5 Builder)
return JSON.stringify(oChainObject.parsedData);
}
let sOutputDir = path.dirname(oChainObject.outputFile);
// Create dir if it does not exist
... | javascript | {
"resource": ""
} |
q19289 | getLibraryPromise | train | function getLibraryPromise(oChainObject) {
return new Promise(function(oResolve) {
fs.readFile(oChainObject.libraryFile, 'utf8', (oError, oData) => {
oChainObject.libraryFileData = oData;
oResolve(oChainObject);
});
});
} | javascript | {
"resource": ""
} |
q19290 | extractComponentAndDocuindexUrl | train | function extractComponentAndDocuindexUrl(oChainObject) {
oChainObject.modules = [];
if (oChainObject.libraryFileData) {
let $ = cheerio.load(oChainObject.libraryFileData, {
ignoreWhitespace: true,
xmlMode: true,
lowerCaseTags: false
});
// Extract documentation URL
oChainObject.docuPath = ... | javascript | {
"resource": ""
} |
q19291 | flattenComponents | train | function flattenComponents(oChainObject) {
if (oChainObject.modules && oChainObject.modules.length > 0) {
oChainObject.customSymbolComponents = {};
oChainObject.modules.forEach(oComponent => {
let sCurrentComponent = oComponent.componentName;
oComponent.modules.forEach(sModule => {
oChainObject.cus... | javascript | {
"resource": ""
} |
q19292 | extractSamplesFromDocuIndex | train | function extractSamplesFromDocuIndex(oChainObject) {
// If we have not extracted docuPath we return early
if (!oChainObject.docuPath) {
return oChainObject;
}
return new Promise(function(oResolve) {
// Join .library path with relative docuindex.json path
let sPath = path.join(path.dirname(oChainObject.... | javascript | {
"resource": ""
} |
q19293 | getAPIJSONPromise | train | function getAPIJSONPromise(oChainObject) {
return new Promise(function(oResolve, oReject) {
fs.readFile(sInputFile, 'utf8', (oError, sFileData) => {
if (oError) {
oReject(oError);
} else {
oChainObject.fileData = JSON.parse(sFileData);
oResolve(oChainObject);
}
});
});
} | javascript | {
"resource": ""
} |
q19294 | train | function (target) {
var result = "";
if (target) {
target.forEach(function (element) {
result += element + '<br>';
});
}
result = this._preProcessLinksInTextBlock(result);
return result;
} | javascript | {
"resource": ""
} | |
q19295 | train | function (namespace) {
var result,
aNamespaceParts = namespace.split(".");
if (aNamespaceParts[0] === "Org" && aNamespaceParts[1] === "OData") {
result = '<a href="' + this.ANNOTATIONS_NAMESPACE_LINK + namespace + '.xml">' + namespace + '</a>';
} else {
result = namespace;
}
result = this._... | javascript | {
"resource": ""
} | |
q19296 | train | function (description, since) {
var result = description || "";
result += '<br>For more information, see ' + this.handleExternalUrl(this.ANNOTATIONS_LINK, "OData v4 Annotations");
if (since) {
result += '<br><br><i>Since: ' + since + '.</i>';
}
result = this._preProcessLinksInTextBlock(result);
... | javascript | {
"resource": ""
} | |
q19297 | train | function (description, since) {
var result = description || "";
if (since) {
result += '<br><br><i>Since: ' + since + '.</i>';
}
result = this._preProcessLinksInTextBlock(result);
return result;
} | javascript | {
"resource": ""
} | |
q19298 | train | function (defaultValue) {
var sReturn;
switch (defaultValue) {
case null:
case undefined:
sReturn = '';
break;
case '':
sReturn = 'empty string';
break;
default:
sReturn = defaultValue;
}
return Array.isArray(sReturn) ? sReturn.join(', ') : sReturn;
} | javascript | {
"resource": ""
} | |
q19299 | train | function (name, params) {
var result = '<pre class="prettyprint">new ';
if (name) {
result += name + '(';
}
if (params) {
params.forEach(function (element, index, array) {
result += element.name;
if (element.optional) {
result += '?';
}
if (index < array.length - 1) {
... | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.