_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 52 373k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q19600 | train | function(oEvent) {
this.byId("phoneImage").setVisible(oEvent.name === "Phone");
this.byId("desktopImage").setVisible(oEvent.name !== "Phone");
this.byId("phoneImage").toggleStyleClass("phoneHeaderImageDesktop", oEvent.name === "Phone");
} | javascript | {
"resource": ""
} | |
q19601 | train | function(oIconTabBar, fnScrollEndCallback, fnScrollStartCallback) {
this._oIconTabBar = oIconTabBar;
this._fnScrollEndCallback = jQuery.proxy(fnScrollEndCallback, oIconTabBar);
this._fnScrollStartCallback = jQuery.proxy(fnScrollStartCallback, oIconTabBar);
return this;
} | javascript | {
"resource": ""
} | |
q19602 | train | function(vElement) {
// check if vElement is a DOM element and if yes convert it to jQuery object
var $Element = vElement instanceof jQuery ? vElement : jQuery(vElement),
oElementPosition = $Element.position(),
$OffsetParent = $Element.offsetParent(),
oAddUpPosition;
while (!$OffsetParent.is... | javascript | {
"resource": ""
} | |
q19603 | train | function(oElement, iTime, aOffset) {
aOffset = aOffset || [0, 0];
// do nothing if _$Container is not a (grand)parent of oElement
if (!this._$Container[0].contains(oElement) ||
oElement.style.display === "none" ||
oElement.offsetParent.nodeName.toUpperCase() === "HTML") {
return this;
}... | javascript | {
"resource": ""
} | |
q19604 | Generator | train | function Generator(sOutputFolder, bPrettyPrint) {
if (!(this instanceof Generator)) {
return new Generator(sOutputFolder, bPrettyPrint);
}
this._sOutputFolder = sOutputFolder;
this._bPrettyPrint = bPrettyPrint;
events.EventEmitter.call(this);
} | javascript | {
"resource": ""
} |
q19605 | init | train | function init() {
if (!oInitPromise) {
oInitPromise = new Promise(function(resolve, reject) {
oWorker = new window.Worker(WORKER.URL);
// listen for confirmation from worker
oWorker.addEventListener('message', function(oEvent) {
var oData = oEvent.data;
resolve(oData && oData[WORKER.... | javascript | {
"resource": ""
} |
q19606 | search | train | function search(sQuery) {
return new Promise(function(resolve, reject) {
init().then(function() {
oWorker.addEventListener('message', function(oEvent) {
var oData = oEvent.data;
resolve(oData && oData[WORKER.RESPONSE_FIELDS.SEARCH_RESULT]);
}, false);
oWorker.postMessage({
"cm... | javascript | {
"resource": ""
} |
q19607 | train | function () {
var bLoaded = sap.ui.getCore().getLoadedLibraries()["sap.ui.support"],
deferred = jQueryDOM.Deferred();
if (!bLoaded) {
sap.ui.require(["sap/ui/support/Bootstrap"], function (bootstrap) {
bootstrap.initSupportRules(["true", "silent"], {
onReady: function () {
deferred.reso... | javascript | {
"resource": ""
} | |
q19608 | train | function(options) {
var ruleDeferred = jQueryDOM.Deferred(),
options = options[0] || {},
failOnAnyRuleIssues = options["failOnAnyIssues"],
failOnHighRuleIssues = options["failOnHighIssues"],
rules = options.rules,
preset = options.preset,
metadata = options.metadata,
execu... | javascript | {
"resource": ""
} | |
q19609 | train | function () {
var ruleDeferred = jQueryDOM.Deferred(),
history = RuleAnalyzer.getFormattedAnalysisHistory(),
analysisHistory = RuleAnalyzer.getAnalysisHistory(),
totalIssues = analysisHistory.reduce(function (total, analysis) {
return total + analysis.issues.length;
}, 0),
resu... | javascript | {
"resource": ""
} | |
q19610 | train | function (oODataModelInstance) {
var iVersion;
var sODataModelName;
// check if the given object has metadata and a class name
if (oODataModelInstance && oODataModelInstance.getMetadata) {
sODataModelName = oODataModelInstance.getMetadata().getName();
}
switch (sODataModelName) {
case "sap.u... | javascript | {
"resource": ""
} | |
q19611 | createOverride | train | function createOverride(sXHRMethod) {
mRegistry[sXHRMethod] = Object.create(null);
// backup the original function
mXHRFunctions[sXHRMethod] = window.XMLHttpRequest.prototype[sXHRMethod];
window.XMLHttpRequest.prototype[sXHRMethod] = function() {
var oArgs = arguments;
// call the original function f... | javascript | {
"resource": ""
} |
q19612 | train | function(sName, sXHRMethod, fnCallback) {
Log.debug("Register '" + sName + "' for XHR function '" + sXHRMethod + "'", XHRINTERCEPTOR);
// initially the override needs to be placed per XHR method
if (!mRegistry[sXHRMethod]) {
createOverride(sXHRMethod);
}
mRegistry[sXHRMethod][sName] = fnCallback;
... | javascript | {
"resource": ""
} | |
q19613 | train | function(sName, sXHRMethod) {
var bRemove = delete mRegistry[sXHRMethod][sName];
Log.debug("Unregister '" + sName + "' for XHR function '" + sXHRMethod + (bRemove ? "'" : "' failed"), XHRINTERCEPTOR);
return bRemove;
} | javascript | {
"resource": ""
} | |
q19614 | train | function (sTopicId) {
var sUrl = "",
sVersion = "",
sFullVersion = sap.ui.getVersionInfo().version,
iMajorVersion = jQuery.sap.Version(sFullVersion).getMajor(),
iMinorVersion = jQuery.sap.Version(sFullVersion).getMinor(),
sOrigin = window.location.origin;
//This check is to make sure that ver... | javascript | {
"resource": ""
} | |
q19615 | train | function (sUrl, sTopicId) {
this._pingUrl(sUrl).then(function success() {
mLibrary.URLHelper.redirect(sUrl, true);
}, function error() {
jQuery.sap.log.info("Support Assistant tried to load documentation link in " + sUrl + "but fail");
sUrl = "https://ui5.sap.com/#/topic/" + sTopicId;
mLibrary.URL... | javascript | {
"resource": ""
} | |
q19616 | CLDR | train | function CLDR(oOptions) {
if (!(this instanceof CLDR)) {
return new CLDR(oOptions);
}
this._oOptions = oOptions;
events.EventEmitter.call(this);
} | javascript | {
"resource": ""
} |
q19617 | toIslamic | train | function toIslamic(oGregorian) {
var iGregorianYear = oGregorian.year,
iGregorianMonth = oGregorian.month,
iGregorianDay = oGregorian.day,
iIslamicYear,
iIslamicMonth,
iIslamicDay,
iMonths,
iDays,
iLeapAdj,
iJulianDay;
iLeapAdj = 0;
if ((iGregorianMonth + 1) > 2) {
iLeapAdj = isGreg... | javascript | {
"resource": ""
} |
q19618 | train | function(oEvent){
var oItem = oEvent.getParameter("item");
this.fireItemSelected({itemId: oItem.getId(), item: oItem});
this.firePress({itemId: oItem.getId(), item: oItem});
} | javascript | {
"resource": ""
} | |
q19619 | each | train | function each(collection, callback) {
if (!collection) {
return;
}
for (var i = 0, l = collection.length; i < l; i += 1) {
callback(collection[i]);
}
} | javascript | {
"resource": ""
} |
q19620 | isDigitSequence | train | function isDigitSequence(sValue, oConstraints) {
return oConstraints && oConstraints.isDigitSequence && sValue && sValue.match(rDigitsOnly);
} | javascript | {
"resource": ""
} |
q19621 | _bind | train | function _bind(sAggregation, oControl, oBindingInfo) {
var oBindingContext = this.getBindingContext();
if (oBindingContext) {
oBindingInfo.path = oBindingContext.getPath();
oControl.bindAggregation(sAggregation, oBindingInfo);
}
} | javascript | {
"resource": ""
} |
q19622 | train | function (oRun, sLibraryName, sRuleName) {
var aIssues = [];
if (oRun.issues[sLibraryName] && oRun.issues[sLibraryName][sRuleName]) {
oRun.issues[sLibraryName][sRuleName].forEach(function (oIssue) {
var oMinimizedIssue = {
"context": oIssue.context,
"details": oIssue.details,
"name": oIssue.n... | javascript | {
"resource": ""
} | |
q19623 | train | function (oContext) {
var mIssues = IssueManager.groupIssues(IssueManager.getIssuesModel()),
aIssues = IssueManager.getIssues(),
mRules = RuleSetLoader.getRuleSets(),
mSelectedRules = oContext._oSelectedRulesIds,
oSelectedRulePreset = oContext._oSelectedRulePreset;
_aRuns.push({
date: new Dat... | javascript | {
"resource": ""
} | |
q19624 | train | function () {
var aOutput = [];
_aRuns.forEach(function (oRun) {
var oTmp = _generateRootLevelKeys(oRun);
for (var sLibraryName in oRun.rules) {
_generateLibraryStructure(oTmp, sLibraryName, oRun);
for (var sRuleName in oRun.rules[sLibraryName]) {
_generateRuleStructure(oTmp, sLibraryNa... | javascript | {
"resource": ""
} | |
q19625 | train | function (sFormat) {
var oFormattedHistory,
aHistory = this.getHistory();
switch (sFormat) {
case library.HistoryFormats.Abap:
oFormattedHistory = AbapHistoryFormatter.format(aHistory);
break;
default :
oFormattedHistory = StringHistoryFormatter.format(aHistory);
}
return oForma... | javascript | {
"resource": ""
} | |
q19626 | _createHighLighter | train | function _createHighLighter() {
var highLighter = document.createElement("div");
highLighter.style.cssText = "box-sizing: border-box;border:1px solid blue;background: rgba(20, 20, 200, 0.4);position: absolute";
var highLighterWrapper = document.createElement("div");
highLighterWrapper.id = "ui5-highlight... | javascript | {
"resource": ""
} |
q19627 | train | function (elementId) {
var highlighter;
var targetDomElement;
var targetRect;
if (_highLighter === null && !document.getElementById("ui5-highlighter")) {
_createHighLighter();
} else {
_showHighLighter();
}
highlighter = _highLighter.firstElementChild;
targetDomElement = docu... | javascript | {
"resource": ""
} | |
q19628 | train | function() {
var aVisibleColumnsIds = [],
aColumns = SelectionUtils.treeTable.getColumns();
aColumns.forEach(function (oColumn) {
if (oColumn.getVisible()){
aVisibleColumnsIds.push(oColumn.sId);
}
});
storage.setVisibleColumns(aVisibleColumnsIds);
} | javascript | {
"resource": ""
} | |
q19629 | fnAddHTML | train | function fnAddHTML (oBlockSection, sBlockedLayerId) {
var oContainer = document.createElement("div");
oContainer.id = sBlockedLayerId;
oContainer.className = "sapUiBlockLayer ";
BlockLayerUtils.addAriaAttributes(oContainer);
oBlockSection.appendChild(oContainer);
return oContainer;
} | javascript | {
"resource": ""
} |
q19630 | suppressDefaultAndStopPropagation | train | function suppressDefaultAndStopPropagation(oEvent) {
var bTargetIsBlockLayer = oEvent.target === this.$blockLayer.get(0),
oTabbable;
if (bTargetIsBlockLayer && oEvent.type === 'keydown' && oEvent.keyCode === 9) {
// Special handling for "tab" keydown: redirect to next element before or after busy section... | javascript | {
"resource": ""
} |
q19631 | registerInteractionHandler | train | function registerInteractionHandler(fnHandler) {
var aSuppressHandler = [],
oParentDOM = this.$parent.get(0),
oBlockLayerDOM = this.$blockLayer.get(0);
for (var i = 0; i < aPreventedEvents.length; i++) {
// Add event listeners with "useCapture" settings to suppress events before dispatching/bubbling ... | javascript | {
"resource": ""
} |
q19632 | deregisterInteractionHandler | train | function deregisterInteractionHandler(fnHandler) {
var i,
oParentDOM = this.$parent.get(0),
oBlockLayerDOM = this.$blockLayer.get(0);
if (oParentDOM) {
for (i = 0; i < aPreventedEvents.length; i++) {
// Remove event listeners with "useCapture" settings
oParentDOM.removeEventListener(aPrevent... | javascript | {
"resource": ""
} |
q19633 | train | function() {
if (!this._aHistory) {
var aHistory = this._oStorage.get(this._sHistoryId);
if (typeof (aHistory) === "string") {
// in case it is a string, convert it to an array
aHistory = aHistory.split(",");
} else if (!aHistory) {
// or create a new one in case of non existence
aHis... | javascript | {
"resource": ""
} | |
q19634 | train | function(sValue) {
var aHistory = this._initHistory();
var aResult = [];
for (var i = 0; i < aHistory.length; i++) {
if (this._fFilter(aHistory[i], sValue)) {
aResult.push(aHistory[i]);
}
}
return aResult;
} | javascript | {
"resource": ""
} | |
q19635 | train | function(sValue) {
var aHistory = this._initHistory();
for (var i = 0; i < aHistory.length; i++) {
if (aHistory[i] == sValue) {
aHistory.splice(i, 1);
break;
}
}
} | javascript | {
"resource": ""
} | |
q19636 | train | function(sValue) {
var aHistory = this._initHistory();
// ensure it is not contained twice -> remove
for (var i = 0; i < aHistory.length; i++) {
if (aHistory[i] === sValue) {
aHistory.splice(i,1);
break;
}
}
// and put it to the 'very top'
aHistory.unshift(sValue);
// but do not s... | javascript | {
"resource": ""
} | |
q19637 | each | train | function each(obj, cb) {
if (!obj)
return;
if (!Array.isArray(obj) && typeof obj === "object")
obj = Object.keys(obj);
obj.forEach(cb);
} | javascript | {
"resource": ""
} |
q19638 | train | function (oEvent) {
var sValue = this.getValue();
if (sValue) {
that.setValue(sValue);
that._selectItemByKey();
this.setValue(that._sOldInput);
that.close();
}
} | javascript | {
"resource": ""
} | |
q19639 | handleChange | train | function handleChange(sType, oObject, sName, fnCreateChange) {
var sId = oObject.getId(),
oTargetConfig = mTargets[sId];
if (oTargetConfig) {
var oChange;
for (var i = 0; i < oTargetConfig.listeners.length; i++) {
if (isObserving(oTargetConfig.configurations[i], sType, sName)) {
if (!oChange) {
... | javascript | {
"resource": ""
} |
q19640 | isObserving | train | function isObserving(oConfiguration, sType, sName) {
// no configuration, listen to all types
if (oConfiguration == null || !sType) {
return false;
}
if (sType != "destroy" && sType != "parent" && !sName) {
return false;
}
// either all (true) properties/aggregations/associations are relevant or a s... | javascript | {
"resource": ""
} |
q19641 | remove | train | function remove(oTarget, oListener, oConfiguration) {
oConfiguration = oConfiguration || getConfiguration(oTarget, oListener);
updateConfiguration(oTarget, oListener, oConfiguration, true);
} | javascript | {
"resource": ""
} |
q19642 | destroy | train | function destroy(oListener) {
for (var n in mTargets) {
var oTargetConfig = mTargets[n];
for (var i = 0; i < oTargetConfig.listeners.length; i++) {
if (oTargetConfig.listeners[i] === oListener) {
oTargetConfig.listeners.splice(i, 1);
oTargetConfig.configurations.splice(i, 1);
}
}
if (oTa... | javascript | {
"resource": ""
} |
q19643 | updateConfiguration | train | function updateConfiguration(oTarget, oListener, oConfiguration, bRemove) {
var sId = oTarget.getId(),
oTargetConfig = mTargets[sId],
oCurrentConfig,
iIndex;
if (bRemove) {
if (!oTargetConfig) {
// no registration so far, nothing to remove
return;
}
iIndex = oTargetConfig.listeners.indexO... | javascript | {
"resource": ""
} |
q19644 | updateSingleArray | train | function updateSingleArray(aOrig, aAdditional, bRemove) {
if (!aAdditional) {
return;
}
for (var i = 0; i < aAdditional.length; i++) {
var iIndex = aOrig.indexOf(aAdditional[i]);
if (iIndex > -1 && bRemove) {
aOrig.splice(iIndex, 1);
} else if (iIndex === -1 && !bRemove) {
aOrig.push(aAdditio... | javascript | {
"resource": ""
} |
q19645 | normalizeConfiguration | train | function normalizeConfiguration(oObject, oConfiguration) {
var oMetadata = oObject.getMetadata(),
aProperties = Object.keys(oMetadata.getAllProperties()),
aAggregations = Object.keys(oMetadata.getAllAggregations()),
aAssociations = Object.keys(oMetadata.getAllAssociations()),
aBindings = uniqueSort(aPrope... | javascript | {
"resource": ""
} |
q19646 | getLogEntryListenerInstance | train | function getLogEntryListenerInstance(){
if (!oListener) {
oListener = {
listeners: [],
onLogEntry: function(oLogEntry){
for (var i = 0; i < oListener.listeners.length; i++) {
if (oListener.listeners[i].onLogEntry) {
oListener.listeners[i].onLogEntry(oLogEntry);
}
}
},
a... | javascript | {
"resource": ""
} |
q19647 | log | train | function log(iLevel, sMessage, sDetails, sComponent, fnSupportInfo) {
if (!fnSupportInfo && !sComponent && typeof sDetails === "function") {
fnSupportInfo = sDetails;
sDetails = "";
}
if (!fnSupportInfo && typeof sComponent === "function") {
fnSupportInfo = sComponent;
sComponent = "";
}
sCompone... | javascript | {
"resource": ""
} |
q19648 | filter | train | function filter(mMap, fnFilter) {
return Object.keys(mMap).filter(fnFilter).reduce(copyTo.bind(mMap), {});
} | javascript | {
"resource": ""
} |
q19649 | train | function () {
// 1. call overridden init (calls createContent)
UIComponent.prototype.init.apply(this, arguments);
// 2. nav to initial pages
var router = this.getRouter();
if (!Device.system.phone) {
router.myNavToWithoutHash("sap.ui.demokit.explored.view.master", "XML", true);
router.myNavToWi... | javascript | {
"resource": ""
} | |
q19650 | train | function (oModel, oBinding, sPath, iIndex, oCreatePromise) {
return new Context(oModel, oBinding, sPath, iIndex, oCreatePromise);
} | javascript | {
"resource": ""
} | |
q19651 | onLoadstart | train | function onLoadstart(event) {
Log.info(getTstmp(event.timeStamp) + ", " + this.xidx + ": loadstart");
this.xfirstByteSent = getTstmp(event.timeStamp);
} | javascript | {
"resource": ""
} |
q19652 | train | function(oSettings) {
var oMetadata = this.getMetadata(),
aValidKeys = oMetadata.getJSONKeys(), // UID names required, they're part of the documented contract
sKey, oValue, oKeyInfo;
for (sKey in oSettings) {
// get info object for the key
if ( (oKeyInfo = aValidKeys[sKey]) !== undefined... | javascript | {
"resource": ""
} | |
q19653 | getVersionWithoutSuffix | train | function getVersionWithoutSuffix(sVersion) {
var oVersion = Version(sVersion);
return oVersion.getSuffix() ? Version(oVersion.getMajor() + "." + oVersion.getMinor() + "." + oVersion.getPatch()) : oVersion;
} | javascript | {
"resource": ""
} |
q19654 | getObject | train | function getObject(oObject, sPath) {
// if the incoming sPath is a path we do a nested lookup in the
// manifest object and return the concrete value, e.g. "/sap.ui5/extends"
if (oObject && sPath && typeof sPath === "string" && sPath[0] === "/") {
var aPaths = sPath.substring(1).split("/"),
sPathSegment... | javascript | {
"resource": ""
} |
q19655 | deepFreeze | train | function deepFreeze(oObject) {
if (oObject && typeof oObject === 'object' && !Object.isFrozen(oObject)) {
Object.freeze(oObject);
for (var sKey in oObject) {
if (oObject.hasOwnProperty(sKey)) {
deepFreeze(oObject[sKey]);
}
}
}
} | javascript | {
"resource": ""
} |
q19656 | train | function(sPath) {
if (!sPath || sPath.indexOf(".") <= 0) {
Log.warning("Manifest entries with keys without namespace prefix can not be read via getEntry. Key: " + sPath + ", Component: " + this.getComponentName());
return null;
}
var oManifest = this.getJson();
var oEntry = getObject(oManifest, sPa... | javascript | {
"resource": ""
} | |
q19657 | train | function() {
// version check => only if minVersion is available a warning
// will be logged and the debug mode is turned on
// TODO: enhance version check also for libraries and components
var sMinUI5Version = this.getEntry("/sap.ui5/dependencies/minUI5Version");
if (sMinUI5Version &&
Log.isLoggabl... | javascript | {
"resource": ""
} | |
q19658 | train | function() {
// skip loading includes once already loaded
if (this._bIncludesLoaded) {
return;
}
var mResources = this.getEntry("/sap.ui5/resources");
if (!mResources) {
return;
}
var sComponentName = this.getComponentName();
// load JS files
var aJSResources = mResources["js"];
... | javascript | {
"resource": ""
} | |
q19659 | train | function() {
// skip removing includes when not loaded yet
if (!this._bIncludesLoaded) {
return;
}
var mResources = this.getEntry("/sap.ui5/resources");
if (!mResources) {
return;
}
var sComponentName = this.getComponentName();
// remove CSS files
var aCSSResources = mResources["... | javascript | {
"resource": ""
} | |
q19660 | train | function(sUri, sRelativeTo) {
var oUri = this._resolveUri(new URI(sUri), sRelativeTo);
return oUri && oUri.toString();
} | javascript | {
"resource": ""
} | |
q19661 | train | function(oInstance) {
if (this._iInstanceCount === 0) {
// version check => only if minVersion is available a warning
// will be logged and the debug mode is turned on
this.checkUI5Version();
// define the resource roots
// => if not loaded via manifest first approach the resource roots
//... | javascript | {
"resource": ""
} | |
q19662 | train | function(oInstance) {
// ensure that the instance count is never negative
var iInstanceCount = Math.max(this._iInstanceCount - 1, 0);
// deactivate the instance customizing
if (oInstance) {
this.deactivateCustomizing(oInstance);
}
if (iInstanceCount === 0) {
// deactivcate the customizing
... | javascript | {
"resource": ""
} | |
q19663 | train | function(oInstance) {
// activate the customizing configuration
var oUI5Manifest = this.getEntry("sap.ui5", true),
mExtensions = oUI5Manifest && oUI5Manifest["extends"] && oUI5Manifest["extends"].extensions;
if (!jQuery.isEmptyObject(mExtensions)) {
var CustomizingConfiguration = sap.ui.requireSync('sa... | javascript | {
"resource": ""
} | |
q19664 | train | function(oInstance) {
// deactivate the customizing configuration
var CustomizingConfiguration = sap.ui.require('sap/ui/core/CustomizingConfiguration');
if (CustomizingConfiguration) {
if (!oInstance) {
CustomizingConfiguration.deactivateForComponent(this.getComponentName());
} else {
Customi... | javascript | {
"resource": ""
} | |
q19665 | train | function (sDateString) {
var iMillis = NativeDate_parse.apply(Date, arguments);
if (sDateString && typeof sDateString === "string") {
// if the year is gt/eq 2034 we need to increment the
// date by one additional day since this is broken in
// PhantomJS => this is a workaround for the upper BUG!
... | javascript | {
"resource": ""
} | |
q19666 | mapKeyCodeToKey | train | function mapKeyCodeToKey(sKeyCode) {
// look up number in KeyCodes enum to get the string
if (!isNaN(sKeyCode)) {
sKeyCode = getKeyCodeStringFromNumber(sKeyCode);
}
if (!sKeyCode) {
return undefined;
}
sKeyCode = sKeyCode.toLowerCase();
// replace underscores with dash character such as 'ARROW_LEFT... | javascript | {
"resource": ""
} |
q19667 | getKeyCodeStringFromNumber | train | function getKeyCodeStringFromNumber(iKeyCode) {
for (var sKey in KeyCodes) {
if (KeyCodes.hasOwnProperty(sKey)) {
if (KeyCodes[sKey] === iKeyCode) {
return sKey;
}
}
}
} | javascript | {
"resource": ""
} |
q19668 | offset | train | function offset(a,b,va,vb) {
return abOffset[a * N + b] + va * params[b].n + vb;
} | javascript | {
"resource": ""
} |
q19669 | calcCost | train | function calcCost(a, va) {
var score = { va: va, pairs:0, redundant:0 };
for (var c = 0; c < N; c++) {
var count;
if ( c < a ) {
count = occurs[offset(c,a,value_index[c],va)];
} else if ( c > a ) {
var j = offset(a,c,va,0),
end = j + params[c].n;
for (count = occ... | javascript | {
"resource": ""
} |
q19670 | normalize | train | function normalize(sResourceName, sBaseName) {
var p = sResourceName.search(rDotSegmentAnywhere),
aSegments,
sSegment,
i,j,l;
// check whether the name needs to be resolved at all - if not, just return the sModuleName as it is.
if ( p < 0 ) {
return sResourceName;
}
// if the name starts with a... | javascript | {
"resource": ""
} |
q19671 | registerResourcePath | train | function registerResourcePath(sResourceNamePrefix, sUrlPrefix) {
sResourceNamePrefix = String(sResourceNamePrefix || "");
if ( sUrlPrefix == null ) {
// remove a registered URL prefix, if it wasn't for the empty resource name prefix
if ( sResourceNamePrefix ) {
if ( mUrlPrefixes[sResourceNamePrefix] ) {... | javascript | {
"resource": ""
} |
q19672 | getResourcePath | train | function getResourcePath(sResourceName, sSuffix) {
var sNamePrefix = sResourceName,
p = sResourceName.length,
sPath;
// search for a registered name prefix, starting with the full name and successively removing one segment
while ( p > 0 && !mUrlPrefixes[sNamePrefix] ) {
p = sNamePrefix.lastIndexOf('/')... | javascript | {
"resource": ""
} |
q19673 | findMapForContext | train | function findMapForContext(sContext) {
var p, mMap;
if ( sContext != null ) {
// maps are defined on module IDs, reduce URN to module ID
sContext = urnToIDAndType(sContext).id;
p = sContext.length;
mMap = mMaps[sContext];
while ( p > 0 && mMap == null ) {
p = sContext.lastIndexOf('/');
if ( p... | javascript | {
"resource": ""
} |
q19674 | loadSyncXHR | train | function loadSyncXHR(oModule) {
var xhr = new XMLHttpRequest();
function enrichXHRError(error) {
error = error || ensureStacktrace(new Error(xhr.status + " - " + xhr.statusText));
error.status = xhr.status;
error.statusText = xhr.statusText;
error.loadError = true;
return error;
}
xhr.addEventL... | javascript | {
"resource": ""
} |
q19675 | execModule | train | function execModule(sModuleName, bAsync) {
var oModule = mModules[sModuleName],
oShim = mShims[sModuleName],
bLoggable = log.isLoggable(),
sOldPrefix, sScript, vAMD, oMatch, bOldForceSyncDefines;
if ( oModule && oModule.state === LOADED && typeof oModule.data !== "undefined" ) {
// check whether the ... | javascript | {
"resource": ""
} |
q19676 | dumpInternals | train | function dumpInternals(iThreshold) {
var states = [PRELOADED, INITIAL, LOADED, READY, FAILED, EXECUTING, LOADING];
var stateNames = {};
stateNames[PRELOADED] = 'PRELOADED';
stateNames[INITIAL] = 'INITIAL';
stateNames[LOADING] = 'LOADING';
stateNames[LOADED] = 'LOADED';
stateNames[EXECUTING] = 'EXECUTING'... | javascript | {
"resource": ""
} |
q19677 | getUrlPrefixes | train | function getUrlPrefixes() {
var mUrlPrefixesCopy = Object.create(null);
forEach(mUrlPrefixes, function(sNamePrefix, oUrlInfo) {
mUrlPrefixesCopy[sNamePrefix] = oUrlInfo.url;
});
return mUrlPrefixesCopy;
} | javascript | {
"resource": ""
} |
q19678 | unloadResources | train | function unloadResources(sName, bPreloadGroup, bUnloadAll, bDeleteExports) {
var aModules = [],
sURN, oModule;
if ( bPreloadGroup == null ) {
bPreloadGroup = true;
}
if ( bPreloadGroup ) {
// collect modules that belong to the given group
for ( sURN in mModules ) {
oModule = mModules[sURN];
... | javascript | {
"resource": ""
} |
q19679 | getAllModules | train | function getAllModules() {
var mSnapshot = Object.create(null);
forEach(mModules, function(sURN, oModule) {
mSnapshot[sURN] = {
state: oModule.state,
ui5: urnToUI5(sURN)
};
});
return mSnapshot;
} | javascript | {
"resource": ""
} |
q19680 | train | function(module, shim) {
if ( Array.isArray(shim) ) {
shim = { deps : shim };
}
mShims[module + '.js'] = shim;
} | javascript | {
"resource": ""
} | |
q19681 | handleConfigObject | train | function handleConfigObject(oCfg, mHandlers) {
function processConfig(key, value) {
var handler = mHandlers[key];
if ( typeof handler === 'function' ) {
if ( handler.length === 1) {
handler(value);
} else if ( value != null ) {
forEach(value, handler);
}
} else {
log.warning("confi... | javascript | {
"resource": ""
} |
q19682 | train | function(oWindow, sRootId) {
this.oWindow = oWindow;
this.oDomNode = oWindow.document.getElementById(sRootId);
if (!this.oDomNode) {
var oDiv = this.oWindow.document.createElement("DIV");
oDiv.setAttribute("id", sRootId);
oDiv.style.overflow = "auto";
oDiv.style.tabIndex = "-1";
oDiv.style.position... | javascript | {
"resource": ""
} | |
q19683 | processPlaceholder | train | function processPlaceholder (sPlaceholder, oParam) {
var sISODate = new Date().toISOString();
var sProcessed = sPlaceholder.replace("{{parameters.NOW_ISO}}", sISODate);
sProcessed = sProcessed.replace("{{parameters.TODAY_ISO}}", sISODate.slice(0, 10));
if (oParam) {
for (var oProperty in oParam) {
sProce... | javascript | {
"resource": ""
} |
q19684 | process | train | function process (oObject, oTranslator, iCurrentLevel, iMaxLevel, oParams) {
if (iCurrentLevel === iMaxLevel) {
return;
}
if (Array.isArray(oObject)) {
oObject.forEach(function (vItem, iIndex, aArray) {
if (typeof vItem === "object") {
process(vItem, oTranslator, iCurrentLevel + 1, iMaxLevel, oPar... | javascript | {
"resource": ""
} |
q19685 | _getElementTreeLeftColumnOfListItem | train | function _getElementTreeLeftColumnOfListItem(controls, paddingLeft) {
var html = "<offset style=\"padding-left:" + paddingLeft + "px\" >";
if (controls.content.length > 0) {
html += "<arrow down=\"true\"></arrow>";
} else {
html += "<place-holder></place-holder>";
}
html += "</offset>";
ret... | javascript | {
"resource": ""
} |
q19686 | _getElementTreeRightColumnOfListItem | train | function _getElementTreeRightColumnOfListItem(control, numberOfIssues) {
var splitControlName = control.name.split(".");
var name = splitControlName[splitControlName.length - 1];
var nameSpace = control.name.replace(name, "");
var hideShowClass = (numberOfIssues > 0) ? "showNumbOfIssues" : "hideNumbOfIssues... | javascript | {
"resource": ""
} |
q19687 | _findNearestDOMParent | train | function _findNearestDOMParent(element, parentNodeName) {
while (element.nodeName !== parentNodeName) {
if (element.nodeName === "CONTROL-TREE") {
break;
}
element = element.parentNode;
}
return element;
} | javascript | {
"resource": ""
} |
q19688 | ElementTree | train | function ElementTree(id, instantiationOptions) {
var areInstantiationOptionsAnObject = _isObject(instantiationOptions);
var options;
/**
* Make sure that the options parameter is Object and
* that the ElementTree can be instantiate without initial options.
*/
if (areInstantiationOptionsAnObject... | javascript | {
"resource": ""
} |
q19689 | _storeBreakpoints | train | function _storeBreakpoints() {
if (bHasLocalStorage) {
localStorage.setItem("sap-ui-support.aSupportInfosBreakpoints/" + document.location.href, JSON.stringify(aSupportInfosBreakpoints));
}
} | javascript | {
"resource": ""
} |
q19690 | _storeXMLModifications | train | function _storeXMLModifications() {
if (bHasLocalStorage) {
localStorage.setItem("sap-ui-support.aSupportXMLModifications/" + document.location.href, JSON.stringify(aSupportXMLModifications));
}
} | javascript | {
"resource": ""
} |
q19691 | train | function (oConfig, oParent) {
if (!oConfig.name) {
Log.error("A name has to be specified for every route", this);
}
if (this._oRoutes[oConfig.name]) {
Log.error("Route with name " + oConfig.name + " already exists", this);
}
this._oRoutes[oConfig.name] = this._createRoute(this, oConfig, o... | javascript | {
"resource": ""
} | |
q19692 | train | function (sName, oParameters) {
if (oParameters === undefined) {
//even if there are only optional parameters crossroads cannot navigate with undefined
oParameters = {};
}
var oRoute = this.getRoute(sName);
if (!oRoute) {
Log.warning("Route with name " + sName + " does not exist", this);... | javascript | {
"resource": ""
} | |
q19693 | train | function (sHash) {
return Object.keys(this._oRoutes).some(function(sRouteName) {
return this._oRoutes[sRouteName].match(sHash);
}.bind(this));
} | javascript | {
"resource": ""
} | |
q19694 | train | function (sViewName, sViewType, sViewId) {
Log.warning("Deprecated API Router#getView called - use Router#getViews instead.", this);
var oView = this._oViews._getViewWithGlobalId({
viewName: sViewName,
type: sViewType,
id: sViewId
});
this.fireViewCreated({
view: oView,
viewNa... | javascript | {
"resource": ""
} | |
q19695 | train | function(oData, fnFunction, oListener) {
return this.attachEvent(Router.M_EVENTS.BYPASSED, oData, fnFunction, oListener);
} | javascript | {
"resource": ""
} | |
q19696 | train | function(oData, fnFunction, oListener) {
this.attachEvent(Router.M_EVENTS.TITLE_CHANGED, oData, fnFunction, oListener);
return this;
} | javascript | {
"resource": ""
} | |
q19697 | patch | train | function patch(oOldDom, oNewDom) {
// start checking with most common use case and backwards compatible
if (oOldDom.childElementCount != oNewDom.childElementCount ||
oOldDom.tagName != oNewDom.tagName) {
oOldDom.parentNode.replaceChild(oNewDom, oOldDom);
return false;
}
// go with native... if nodes ... | javascript | {
"resource": ""
} |
q19698 | _submit | train | function _submit(){
// execute the request and use the metadata if available
if (that.bUseBatch) {
that.updateSecurityToken();
// batch requests only need the path without the service URL
// extract query of url and combine it with the path...
var sUriQuery = URI.parse(oRequest.requestUri).query;... | javascript | {
"resource": ""
} |
q19699 | train | function (sUrl, bAnnotations, bPrefetch) {
var oPromise;
function convertXMLMetadata(oJSON) {
var Converter = sODataVersion === "4.0" || bAnnotations
? _V4MetadataConverter
: _V2MetadataConverter,
oData = oJSON.$XML;
delete oJSON.$XML; // be nice to the garbage collector
... | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.