_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 52 373k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q19100 | train | function(oTable) {
var oScrollExtension = oTable._getScrollExtension();
var iVerticalScrollRange = oScrollExtension.getVerticalScrollHeight() - oScrollExtension.getVerticalScrollbarHeight();
return Math.max(0, iVerticalScrollRange);
} | javascript | {
"resource": ""
} | |
q19101 | train | function(oTable) {
var oScrollExtension = oTable._getScrollExtension();
var iVirtualRowCount = oTable._getTotalRowCount() - oTable.getVisibleRowCount();
var iScrollRangeWithoutBuffer;
if (TableUtils.isVariableRowHeightEnabled(oTable)) {
iScrollRangeWithoutBuffer = VerticalScrollingHelper.getScrollRange... | javascript | {
"resource": ""
} | |
q19102 | train | function(oTable) {
if (!TableUtils.isVariableRowHeightEnabled(oTable)) {
return false;
}
var iScrollRange = VerticalScrollingHelper.getScrollRange(oTable);
var nScrollPosition = VerticalScrollingHelper.getScrollPosition(oTable);
var iScrollRangeBugger = VerticalScrollingHelper.getScrollRangeBuffer(o... | javascript | {
"resource": ""
} | |
q19103 | train | function(oTable) {
if (!oTable || !oTable._aRowHeights) {
return 0;
}
var aRowHeights = oTable._aRowHeights;
var iEstimatedViewportHeight = oTable._getDefaultRowHeight() * oTable.getVisibleRowCount();
// Only sum rows filled with data, ignore empty rows.
if (oTable.getVisibleRowCount() >= oTable... | javascript | {
"resource": ""
} | |
q19104 | train | function(oTable, oEvent) {
var bExecuteDefault = true;
if (internal(oTable).fnOnRowsUpdatedPreprocessor != null) {
bExecuteDefault = internal(oTable).fnOnRowsUpdatedPreprocessor.call(oTable, oEvent) !== false;
}
internal(oTable).fnOnRowsUpdatedPreprocessor = null;
return bExecuteDefault;
} | javascript | {
"resource": ""
} | |
q19105 | train | function(oTable) {
var oScrollExtension = oTable._getScrollExtension();
var aScrollAreas = VerticalScrollingHelper.getScrollAreas(oTable);
var oVSb = oScrollExtension.getVerticalScrollbar();
if (!oScrollExtension._onVerticalScrollEventHandler) {
oScrollExtension._onVerticalScrollEventHandler = Vertical... | javascript | {
"resource": ""
} | |
q19106 | train | function(oTable) {
var oScrollExtension = oTable._getScrollExtension();
var aScrollAreas = VerticalScrollingHelper.getScrollAreas(oTable);
var oVSb = oScrollExtension.getVerticalScrollbar();
if (oScrollExtension._onVerticalScrollEventHandler) {
for (var i = 0; i < aScrollAreas.length; i++) {
aScro... | javascript | {
"resource": ""
} | |
q19107 | train | function(oTable) {
var aScrollAreas = [
oTable._getScrollExtension().getVerticalScrollbar()
];
return aScrollAreas.filter(function(oScrollArea) {
return oScrollArea != null;
});
} | javascript | {
"resource": ""
} | |
q19108 | train | function(mOptions, oEvent) {
if (oEvent.type === "touchstart" || oEvent.pointerType === "touch") {
var oScrollExtension = this._getScrollExtension();
var oHSb = oScrollExtension.getHorizontalScrollbar();
var oVSb = oScrollExtension.getVerticalScrollbar();
var oTouchObject = oEvent.touches ? oEvent.to... | javascript | {
"resource": ""
} | |
q19109 | train | function(mOptions, oEvent) {
if (oEvent.type !== "touchmove" && oEvent.pointerType !== "touch") {
return;
}
var oScrollExtension = this._getScrollExtension();
var mTouchSessionData = internal(this).mTouchSessionData;
if (!mTouchSessionData) {
return;
}
var oTouchObject = oEvent.touches ?... | javascript | {
"resource": ""
} | |
q19110 | train | function(oTable) {
var oScrollExtension = oTable._getScrollExtension();
var aEventListenerTargets = ScrollingHelper.getEventListenerTargets(oTable);
oScrollExtension._mMouseWheelEventListener = this.addMouseWheelEventListener(aEventListenerTargets, oTable, {
scrollDirection: ScrollDirection.BOTH
});
... | javascript | {
"resource": ""
} | |
q19111 | train | function(aEventListenerTargets, oTable, mOptions) {
var fnOnMouseWheelEventHandler = ScrollingHelper.onMouseWheelScrolling.bind(oTable, mOptions);
for (var i = 0; i < aEventListenerTargets.length; i++) {
aEventListenerTargets[i].addEventListener("wheel", fnOnMouseWheelEventHandler);
}
return {wheel: f... | javascript | {
"resource": ""
} | |
q19112 | train | function(aEventListenerTargets, oTable, mOptions) {
var fnOnTouchStartEventHandler = ScrollingHelper.onTouchStart.bind(oTable, mOptions);
var fnOnTouchMoveEventHandler = ScrollingHelper.onTouchMoveScrolling.bind(oTable, mOptions);
var mListeners = {};
for (var i = 0; i < aEventListenerTargets.length; i++) ... | javascript | {
"resource": ""
} | |
q19113 | train | function(oTable) {
var oScrollExtension = oTable._getScrollExtension();
var aEventTargets = ScrollingHelper.getEventListenerTargets(oTable);
function removeEventListener(oTarget, mEventListenerMap) {
for (var sEventName in mEventListenerMap) {
var fnListener = mEventListenerMap[sEventName];
if (... | javascript | {
"resource": ""
} | |
q19114 | calculateStepsToHash | train | function calculateStepsToHash(sCurrentHash, sToHash, bPrefix){
var iCurrentIndex = jQuery.inArray(sCurrentHash, hashHistory),
iToIndex,
i,
tempHash;
if (iCurrentIndex > 0) {
if (bPrefix) {
for (i = iCurrentIndex - 1; i >= 0 ; i--) {
tempHash = hashHistory[i];
if (tempHash.indexOf(... | javascript | {
"resource": ""
} |
q19115 | detectHashChange | train | function detectHashChange(oEvent, bManual){
//Firefox will decode the hash when it's set to the window.location.hash,
//so we need to parse the href instead of reading the window.location.hash
var sHash = (window.location.href.split("#")[1] || "");
sHash = formatHash(sHash);
if (bManual || !mSkipHandler... | javascript | {
"resource": ""
} |
q19116 | getNextSuffix | train | function getNextSuffix(sHash){
var sPath = sHash ? sHash : "";
if (isVirtualHash(sPath)) {
var iIndex = sPath.lastIndexOf(skipSuffix);
sPath = sPath.slice(0, iIndex);
}
return sPath + skipSuffix + skipIndex++;
} | javascript | {
"resource": ""
} |
q19117 | preGenHash | train | function preGenHash(sIdf, oStateData){
var sEncodedIdf = window.encodeURIComponent(sIdf);
var sEncodedData = window.encodeURIComponent(window.JSON.stringify(oStateData));
return sEncodedIdf + sIdSeperator + sEncodedData;
} | javascript | {
"resource": ""
} |
q19118 | getAppendId | train | function getAppendId(sHash){
var iIndex = jQuery.inArray(currentHash, hashHistory),
i, sHistory;
if (iIndex > -1) {
for (i = 0 ; i < iIndex + 1 ; i++) {
sHistory = hashHistory[i];
if (sHistory.slice(0, sHistory.length - 2) === sHash) {
return uid();
}
}
}
return "";
} | javascript | {
"resource": ""
} |
q19119 | reorganizeHistoryArray | train | function reorganizeHistoryArray(sHash){
var iIndex = jQuery.inArray(currentHash, hashHistory);
if ( !(iIndex === -1 || iIndex === hashHistory.length - 1) ) {
hashHistory.splice(iIndex + 1, hashHistory.length - 1 - iIndex);
}
hashHistory.push(sHash);
} | javascript | {
"resource": ""
} |
q19120 | calcStepsToRealHistory | train | function calcStepsToRealHistory(sCurrentHash, bForward){
var iIndex = jQuery.inArray(sCurrentHash, hashHistory),
i;
if (iIndex !== -1) {
if (bForward) {
for (i = iIndex ; i < hashHistory.length ; i++) {
if (!isVirtualHash(hashHistory[i])) {
return i - iIndex;
}
}
} else {... | javascript | {
"resource": ""
} |
q19121 | onHashChange | train | function onHashChange(sHash){
var oRoute, iStep, oParsedHash, iNewHashIndex, sNavType;
//handle the nonbookmarkable hash
if (currentHash === undefined) {
//url with hash opened from bookmark
oParsedHash = parseHashToObject(sHash);
if (!oParsedHash || !oParsedHash.bBookmarkable) {
if (jQuery.... | javascript | {
"resource": ""
} |
q19122 | findRouteByIdentifier | train | function findRouteByIdentifier(sIdf){
var i;
for (i = 0 ; i < routes.length ; i++) {
if (routes[i].sIdentifier === sIdf) {
return routes[i];
}
}
} | javascript | {
"resource": ""
} |
q19123 | train | function() {
var sLanguage = this.sLanguage || "",
m;
// cut off any ext. language sub tags
if ( sLanguage.indexOf("-") >= 0 ) {
sLanguage = sLanguage.slice(0, sLanguage.indexOf("-"));
}
// convert to new ISO codes
sLanguage = M_ISO639_OLD_TO_NEW[sLanguage] || sLanguage;
// han... | javascript | {
"resource": ""
} | |
q19124 | getDesigntimePropertyAsArray | train | function getDesigntimePropertyAsArray(sValue) {
var m = /\$([-a-z0-9A-Z._]+)(?::([^$]*))?\$/.exec(sValue);
return (m && m[2]) ? m[2].split(/,/) : null;
} | javascript | {
"resource": ""
} |
q19125 | getHandleChildrenStrategy | train | function getHandleChildrenStrategy(bAsync, fnCallback) {
// sync strategy ensures processing order by just being sync
function syncStrategy(node, oAggregation, mAggregations) {
var childNode,
vChild,
aChildren = [];
for (childNode = node.firstChild; childNode; childNode = childNode.nextSibling) {
... | javascript | {
"resource": ""
} |
q19126 | syncStrategy | train | function syncStrategy(node, oAggregation, mAggregations) {
var childNode,
vChild,
aChildren = [];
for (childNode = node.firstChild; childNode; childNode = childNode.nextSibling) {
vChild = fnCallback(node, oAggregation, mAggregations, childNode);
if (vChild) {
aChildren.push(unwrapSyncPromis... | javascript | {
"resource": ""
} |
q19127 | asyncStrategy | train | function asyncStrategy(node, oAggregation, mAggregations) {
var childNode,
pChain = Promise.resolve(),
aChildPromises = [];
for (childNode = node.firstChild; childNode; childNode = childNode.nextSibling) {
pChain = pChain.then(fnCallback.bind(null, node, oAggregation, mAggregations, childNode));
... | javascript | {
"resource": ""
} |
q19128 | spliceContentIntoResult | train | function spliceContentIntoResult(vContent) {
// equivalent to aResult.apply(start, deleteCount, content1, content2...)
var args = [i, 1].concat(vContent);
Array.prototype.splice.apply(aResult, args);
} | javascript | {
"resource": ""
} |
q19129 | parseNode | train | function parseNode(xmlNode, bRoot, bIgnoreTopLevelTextNodes) {
if ( xmlNode.nodeType === 1 /* ELEMENT_NODE */ ) {
var sLocalName = localName(xmlNode);
if (xmlNode.namespaceURI === "http://www.w3.org/1999/xhtml" || xmlNode.namespaceURI === "http://www.w3.org/2000/svg") {
// write opening tag
aResu... | javascript | {
"resource": ""
} |
q19130 | parseChildren | train | function parseChildren(xmlNode, bRoot, bIgnoreToplevelTextNodes) {
var children = xmlNode.childNodes;
for (var i = 0; i < children.length; i++) {
parseNode(children[i], bRoot, bIgnoreToplevelTextNodes);
}
} | javascript | {
"resource": ""
} |
q19131 | findControlClass | train | function findControlClass(sNamespaceURI, sLocalName) {
var sClassName;
var mLibraries = sap.ui.getCore().getLoadedLibraries();
jQuery.each(mLibraries, function(sLibName, oLibrary) {
if ( sNamespaceURI === oLibrary.namespace || sNamespaceURI === oLibrary.name ) {
sClassName = oLibrary.name + "." + ((oL... | javascript | {
"resource": ""
} |
q19132 | getObjectFallback | train | function getObjectFallback(oClassObject) {
// some modules might not return a class definition, so we fallback to the global
// this is against the AMD definition, but is required for backward compatibility
if (!oClassObject) {
Log.error("Control '" + sClassName + "' did not return a class definition f... | javascript | {
"resource": ""
} |
q19133 | train | function (oViewClass) {
var mViewParameters = {
id: id ? getId(oView, node, id) : undefined,
xmlNode: node,
containingView: oView._oContainingView,
processingMode: oView._sProcessingMode // add processing mode, so it can be propagated to subviews inside the HTML block
};
//... | javascript | {
"resource": ""
} | |
q19134 | train | function() {
// Pass processingMode to Fragments only
if (oClass.getMetadata().isA("sap.ui.core.Fragment") && node.getAttribute("type") !== "JS" && oView._sProcessingMode === "sequential") {
mSettings.processingMode = "sequential";
}
if (oView.fnScopedRunWithOwner) {
return o... | javascript | {
"resource": ""
} | |
q19135 | makeFormatter | train | function makeFormatter(aFragments) {
var fnFormatter = function() {
var aResult = [],
l = aFragments.length,
i;
for (i = 0; i < l; i++) {
if ( typeof aFragments[i] === "number" ) {
// a numerical fragment references the part with the same number
aResult.push(arguments[aFragments[i]... | javascript | {
"resource": ""
} |
q19136 | makeSimpleBindingInfo | train | function makeSimpleBindingInfo(sPath) {
var iPos = sPath.indexOf(">"),
oBindingInfo = { path : sPath };
if ( iPos > 0 ) {
oBindingInfo.model = sPath.slice(0,iPos);
oBindingInfo.path = sPath.slice(iPos + 1);
}
return oBindingInfo;
} | javascript | {
"resource": ""
} |
q19137 | expression | train | function expression(sInput, iStart, oBindingMode) {
var oBinding = ExpressionParser.parse(resolveEmbeddedBinding.bind(null, oEnv), sString,
iStart, null, bStaticContext ? oContext : null);
/**
* Recursively sets the mode <code>oBindingMode</code> on the given binding (or its
* parts).
*
* @p... | javascript | {
"resource": ""
} |
q19138 | formatValue | train | function formatValue(aValues, sTargetType) {
var oFormatOptions,
that = this;
if (this.mCustomUnits === undefined && aValues && aValues[2] !== undefined) {
if (aValues[2] === null) { // no unit customizing available
this.mCustomUnits = null;
} else {
this.mCustomUnits = mCodeList2CustomUnit... | javascript | {
"resource": ""
} |
q19139 | parseValue | train | function parseValue(vValue, sSourceType, aCurrentValues) {
var iDecimals, iFractionDigits, aMatches, sUnit, aValues;
if (this.mCustomUnits === undefined) {
throw new ParseException("Cannot parse value without customizing");
}
aValues = fnBaseType.prototype.parseValue.apply(this, arguments);
sUnit =... | javascript | {
"resource": ""
} |
q19140 | train | function(oChange, oControl, mPropertyBag) {
var oModifier = mPropertyBag.modifier;
var sPropertyName = mRenameSettings.propertyName;
var oChangeDefinition = oChange.getDefinition();
var sText = oChangeDefinition.texts[mRenameSettings.changePropertyName];
var sValue = sText.value;
if (oCha... | javascript | {
"resource": ""
} | |
q19141 | train | function(oChange, oControl, mPropertyBag) {
var oModifier = mPropertyBag.modifier;
var sPropertyName = mRenameSettings.propertyName;
var vOldValue = oChange.getRevertData();
if (vOldValue || vOldValue === "") {
oModifier.setPropertyBindingOrProperty(oControl, sPropertyName, vOldValue);
... | javascript | {
"resource": ""
} | |
q19142 | train | function(oChange, mSpecificChangeInfo, mPropertyBag) {
var oChangeDefinition = oChange.getDefinition();
var sChangePropertyName = mRenameSettings.changePropertyName;
var sTranslationTextType = mRenameSettings.translationTextType;
var oControlToBeRenamed = mPropertyBag.modifier.bySelector(oChange.ge... | javascript | {
"resource": ""
} | |
q19143 | train | function (oRouteMatch) {
var that = this;
var mRouteArguments = oRouteMatch.getParameter("arguments");
var oModelData = {};
oModelData.layer = mRouteArguments.layer;
oModelData.namespace = decodeURIComponent(mRouteArguments.namespace);
oModelData.fileName = mRouteArguments.fileName;
oModelData.fil... | javascript | {
"resource": ""
} | |
q19144 | train | function (sLayer, sNameSpace, sFileName, sFileType, sData, sTransportId, sPackageName) {
return LRepConnector.saveFile(sLayer, sNameSpace, sFileName, sFileType, sData, sTransportId, sPackageName).then(this._navToDisplayMode.bind(this));
} | javascript | {
"resource": ""
} | |
q19145 | train | function () {
this._oErrorHandler = new ErrorHandler(this);
// set the device model
this.setModel(models.createDeviceModel(), "device");
// set the global libs data
this.setModel(new JSONModel(), "libsData");
// set the global version data
this.setModel(new JSONModel(), "versionData");
... | javascript | {
"resource": ""
} | |
q19146 | train | function () {
this._oErrorHandler.destroy();
this._oConfigUtil.destroy();
this._oConfigUtil = null;
// call the base component's destroy function
UIComponent.prototype.destroy.apply(this, arguments);
} | javascript | {
"resource": ""
} | |
q19147 | train | function() {
if (this._sContentDensityClass === undefined) {
// check whether FLP has already set the content density class; do nothing in this case
if (jQuery(document.body).hasClass("sapUiSizeCozy") || jQuery(document.body).hasClass("sapUiSizeCompact")) {
this._sContentDensityClass = "";
}
... | javascript | {
"resource": ""
} | |
q19148 | train | function (bDeserialize) {
var self = this, oItem,
sMsrDeserialize = "[sync ] _getAll: deserialize";
return new Promise(function (resolve, reject) {
var entries = [],
transaction = self._db.transaction([self.defaultOptions._contentStoreName], "readonly"),
objectStore = transaction.objectSt... | javascript | {
"resource": ""
} | |
q19149 | cloneMetadata | train | function cloneMetadata(source) {
var backupMetadata = initMetadata(source.__ui5version);
for (var index in source.__byIndex__) {
backupMetadata.__byIndex__[index] = source.__byIndex__[index];
}
for (var key in source.__byKey__) {
backupMetadata.__byKey__[key] = source.__byKey__[key];
}
return ... | javascript | {
"resource": ""
} |
q19150 | cleanAndStore | train | function cleanAndStore(self, key, value) {
return new Promise(function (resolve, reject) {
var attempt = 0;
_cleanAndStore(self, key, value);
function _cleanAndStore(self, key, value) {
attempt++;
Log.debug("Cache Manager LRUPersistentCache: cleanAndStore: freeing space attempt [" + (attempt)... | javascript | {
"resource": ""
} |
q19151 | deleteMetadataForEntry | train | function deleteMetadataForEntry(self, key) {
var iIndex = self._metadata.__byKey__[key];
delete self._metadata.__byKey__[key];
delete self._metadata.__byIndex__[iIndex];
seekMetadataLRU(self);
} | javascript | {
"resource": ""
} |
q19152 | debugMsr | train | function debugMsr(sMsg, sKey, sMsrId) {
//avoid redundant string concatenation & getMeasurement call
if (Log.getLevel() >= Log.Level.DEBUG) {
Log.debug(sMsg + " for key [" + sKey + "] took: " + Measurement.getMeasurement(sMsrId).duration);
}
} | javascript | {
"resource": ""
} |
q19153 | ODataParentBinding | train | function ODataParentBinding() {
// initialize members introduced by ODataBinding
asODataBinding.call(this);
// the aggregated query options
this.mAggregatedQueryOptions = {};
// whether the aggregated query options are processed the first time
this.bAggregatedQueryOptionsInitial = true;
// auto-$expand/$... | javascript | {
"resource": ""
} |
q19154 | getParamInfo | train | function getParamInfo(sParamName, aDocTags) {
//set default parameter type if there are no @ definitions for the type
var sParamType = '',
sParamDescription = '',
iParamNameIndex,
iDocStartIndex,
rEgexMatchType = /{(.*)}/,
aMatch;
for (var i = 0; i < aDocTags.length; i++) {
if ( aDoc... | javascript | {
"resource": ""
} |
q19155 | train | function(oControl) {
var sTemp = HTMLViewRenderer._getHTML(rm, oControl, sHTML);
if (sTemp) {
sHTML = sTemp;
} else {
aDeferred.push(oControl);
}
} | javascript | {
"resource": ""
} | |
q19156 | scrollIntoView | train | function scrollIntoView() {
jQuery(window).scrollTop(0);
scrollContainer.scrollTop($this.offset().top - scrollContainer.offset().top + scrollContainer.scrollTop());
} | javascript | {
"resource": ""
} |
q19157 | getMessage | train | function getMessage(sKey, aParameters) {
return sap.ui.getCore().getLibraryResourceBundle().getText(sKey, aParameters);
} | javascript | {
"resource": ""
} |
q19158 | train | function(oEvent) {
var oNewEntity = oEvent.getParameter("oEntity");
oNewEntity.IsActiveEntity = false;
oNewEntity.HasActiveEntity = false;
oNewEntity.HasDraftEntity = false;
} | javascript | {
"resource": ""
} | |
q19159 | train | function(oEvent) {
var oXhr = oEvent.getParameter("oXhr");
var oEntry = jQuery.sap.sjax({
url: oXhr.url,
dataType: "json"
}).data.d;
// navigate to draft nodes and delete nodes
for (var i = 0; i < this._oDraftMetadata.draftNodes.length; i++) {
for (var navprop in this._mEntitySets[thi... | javascript | {
"resource": ""
} | |
q19160 | train | function(sEntityset, mEntitySets) {
var aSemanticKey = [];
for (var annotationsProperty in this._oDraftMetadata.annotations) {
if (annotationsProperty.lastIndexOf(mEntitySets[sEntityset].type) > -1) {
aSemanticKey = this._oDraftMetadata.annotations[annotationsProperty][this._oConstants.COM_SAP_VOCABULARI... | javascript | {
"resource": ""
} | |
q19161 | train | function(mEntitySets) {
var that = this;
this._oDraftMetadata.draftNodes = [];
this._oDraftMetadata.draftRootKey = mEntitySets[this._oDraftMetadata.draftRootName].keys.filter(function(x) {
return that._calcSemanticKeys(that._oDraftMetadata.draftRootName, mEntitySets).indexOf(x) < 0;
})[0];
var oAnnot... | javascript | {
"resource": ""
} | |
q19162 | train | function(oEntry) {
var oResponse;
var fnGrep = function(aContains, aContained) {
return aContains.filter(function(x) {
return aContained.indexOf(x) < 0;
})[0];
};
// navigate to draft nodes and activate nodes
for (var i = 0; i < this._oDraftMetadata.draftNodes.length; i++) {
for (var nav... | javascript | {
"resource": ""
} | |
q19163 | comparePriority | train | function comparePriority(firstPriority, secondPriority) {
if (firstPriority == secondPriority) {
return firstPriority;
}
if ((firstPriority == 'None')) {
return secondPriority;
}
if ((firstPriority == 'Low') && (secondPriority != 'None')) {
return secondPriority;
}
if ((firstPriority == 'Mediu... | javascript | {
"resource": ""
} |
q19164 | train | function(iIndex, bSelected) {
var oTable = this.getTable();
var oRow = oTable.getRows()[iIndex];
if (oRow && bSelected != null) {
TableUtils.toggleRowSelection(oTable, oRow.getIndex(), bSelected);
}
} | javascript | {
"resource": ""
} | |
q19165 | train | function(iIndex, bHovered) {
var oTable = this.getTable();
var oRow = oTable.getRows()[iIndex];
if (oRow && bHovered != null) {
oRow._setHovered(bHovered);
}
} | javascript | {
"resource": ""
} | |
q19166 | train | function( handler ) {
var hooks = [];
// Hooks are ignored on skipped tests
if ( this.skip ) {
return hooks;
}
if ( this.module.testEnvironment &&
QUnit.objectType( this.module.testEnvironment[ handler ] ) === "function" ) {
hooks.push( this.queueHook( this.module.testEnvironment[ handler ], handl... | javascript | {
"resource": ""
} | |
q19167 | generateHash | train | function generateHash( module, testName ) {
var hex,
i = 0,
hash = 0,
str = module + "\x1C" + testName,
len = str.length;
for ( ; i < len; i++ ) {
hash = ( ( hash << 5 ) - hash ) + str.charCodeAt( i );
hash |= 0;
}
// Convert the possibly negative integer hash code into an 8 character hex string, whi... | javascript | {
"resource": ""
} |
q19168 | bindCallbacks | train | function bindCallbacks( o, callbacks, args ) {
var prop = QUnit.objectType( o );
if ( prop ) {
if ( QUnit.objectType( callbacks[ prop ] ) === "function" ) {
return callbacks[ prop ].apply( callbacks, args );
} else {
return callbacks[ prop ]; // or undefined
}
}
} | javascript | {
"resource": ""
} |
q19169 | train | function( fn ) {
var args,
l = fn.length;
if ( !l ) {
return "";
}
args = new Array( l );
while ( l-- ) {
// 97 is 'a'
args[ l ] = String.fromCharCode( 97 + l );
}
return " " + args.join( ", " ) + " ";
} | javascript | {
"resource": ""
} | |
q19170 | escapeText | train | function escapeText( s ) {
if ( !s ) {
return "";
}
s = s + "";
// Both single quotes and double quotes (for attributes)
return s.replace( /['"<>&]/g, function( s ) {
switch ( s ) {
case "'":
return "'";
case "\"":
return """;
case "<":
return "<";
case ">":
return ">";
c... | javascript | {
"resource": ""
} |
q19171 | train | function () {
//step1: create model from configuration
this._oModel = null; //internal component model
this._oViewConfig = { //internal view configuration
viewData: {
component: this
}
};
//step2: load model from the component configuration
switch (this.oCompo... | javascript | {
"resource": ""
} | |
q19172 | train | function () {
var oController;
//step3: create view
this._oView = sap.ui.view(this._oViewConfig);
//step4: bind the view with the model
if (this._oModel) {
oController = this._oView.getController();
//some factory requires pre-processing once the view and model are created
if (oController ... | javascript | {
"resource": ""
} | |
q19173 | train | function (vName) {
if (this.oComponentData.mode === ObjectPageConfigurationMode.JsonModel) {
var oController = this._oView.getController();
//some factory requires post-processing once the view and model are created
if (oController && oController.connectToComponent) {
oController.connectToComponen... | javascript | {
"resource": ""
} | |
q19174 | train | function () {
if (this._oView) {
this._oView.destroy();
this._oView = null;
}
if (this._oModel) {
this._oModel.destroy();
this._oModel = null;
}
if (UIComponent.prototype.destroy) {
UIComponent.prototype.destroy.call(this);
}
} | javascript | {
"resource": ""
} | |
q19175 | train | function(sControlId, sRelatedControlId, oCore){
var oControl = sControlId ? oCore && oCore.byId(sControlId) : null;
if (oControl) {
var oRelatedControl = sRelatedControlId ? oCore.byId(sRelatedControlId) : null;
var oEvent = jQuery.Event("sapfocusleave");
oEvent.target = oControl.getDomRef();
oEve... | javascript | {
"resource": ""
} | |
q19176 | toJapanese | train | function toJapanese(oGregorian) {
var iEra = UniversalDate.getEraByDate(CalendarType.Japanese, oGregorian.year, oGregorian.month, oGregorian.day),
iEraStartYear = UniversalDate.getEraStartDate(CalendarType.Japanese, iEra).year;
return {
era: iEra,
year: oGregorian.year - iEraStartYear + 1,
month: oGrego... | javascript | {
"resource": ""
} |
q19177 | toGregorian | train | function toGregorian(oJapanese) {
var iEraStartYear = UniversalDate.getEraStartDate(CalendarType.Japanese, oJapanese.era).year;
return {
year: iEraStartYear + oJapanese.year - 1,
month: oJapanese.month,
day: oJapanese.day
};
} | javascript | {
"resource": ""
} |
q19178 | toGregorianArguments | train | function toGregorianArguments(aArgs) {
var oJapanese, oGregorian,
iEra,
vYear = aArgs[0];
if (typeof vYear == "number") {
if (vYear >= 100) {
// Year greater than 100 will be treated as gregorian year
return aArgs;
} else {
// Year less than 100 is emperor year in the current era
iEra = ... | javascript | {
"resource": ""
} |
q19179 | train | function (oEvent) {
var oSource = oEvent.getSource ? oEvent.getSource() : oEvent.target;
if (!this.oDisclaimerPopover) {
sap.ui.core.Fragment.load({
name: "sap.ui.documentation.sdk.view.LegalDisclaimerPopover"
}).then(function (oPopover) {
this.oDisclaimerPopover = oPopover;
oPopov... | javascript | {
"resource": ""
} | |
q19180 | train | function (sControlName, oControlsData) {
var oLibComponentModel = oControlsData.libComponentInfos,
oLibInfo = library._getLibraryInfoSingleton();
return oLibInfo._getActualComponent(oLibComponentModel, sControlName);
} | javascript | {
"resource": ""
} | |
q19181 | train | function(oEvent) {
var oImage = this.byId("phoneImage");
if (Device.system.phone && oImage) {
oImage.toggleStyleClass("phoneHeaderImageLandscape", oEvent.landscape);
}
} | javascript | {
"resource": ""
} | |
q19182 | train | function (sControlName) {
return APIInfo.getIndexJsonPromise().then(function (aData) {
function findSymbol (a) {
return a.some(function (o) {
var bFound = o.name === sControlName;
if (!bFound && o.nodes) {
return findSymbol(o.nodes);
}
return bFound;
});
}
... | javascript | {
"resource": ""
} | |
q19183 | cssSizeToPx | train | function cssSizeToPx(sCssSize) {
if (sCssSize === 0 || sCssSize === "0") {
return 0;
}
var aMatch = sCssSize.match(/^(\d+(\.\d+)?)(px|rem)$/),
iValue;
if (aMatch) {
if (aMatch[3] === "px") {
iValue = parseFloat(aMatch[1]);
} else {
iValue = Rem.toPx(parseFloat(aMatch[1]));
}
} else {
... | javascript | {
"resource": ""
} |
q19184 | train | function (oNode) {
// do not count the artifical root node
if (!oNode || !oNode.isArtificial) {
iNodeCounter++;
}
if (oNode) {
// Always reset selectAllMode
oNode.nodeState.selectAllMode = false;
if (this._mTreeState.selected[oNode.groupID]) {
// remember changed index, push... | javascript | {
"resource": ""
} | |
q19185 | isValidTextKey | train | function isValidTextKey(oControl, sKey) {
var mTexts = oControl.getTextsToBeHyphenated();
if (typeof mTexts !== "object") {
Log.error("[UI5 Hyphenation] The result of getTextsToBeHyphenated method is not a map object.", oControl.getId());
return false;
}
if (Object.keys(mTexts).indexOf(sKey) < 0) ... | javascript | {
"resource": ""
} |
q19186 | diffTexts | train | function diffTexts(mTextsMain, mTextsToDiff) {
var aDiffs = [];
Object.keys(mTextsMain).forEach(function(sKey) {
if (!(sKey in mTextsToDiff && mTextsMain[sKey] === mTextsToDiff[sKey])) {
aDiffs.push(sKey);
}
});
return aDiffs;
} | javascript | {
"resource": ""
} |
q19187 | shouldUseThirdParty | train | function shouldUseThirdParty() {
var sHyphenationConfig = Core.getConfiguration().getHyphenation(),
oHyphenationInstance = Hyphenation.getInstance();
if (sHyphenationConfig === "native" || sHyphenationConfig === "disable") {
return false;
}
if (sHyphenationConfig === "thirdparty") {
return tru... | javascript | {
"resource": ""
} |
q19188 | shouldControlHyphenate | train | function shouldControlHyphenate(oControl) {
var sHyphenationConfig = Core.getConfiguration().getHyphenation();
if (sHyphenationConfig === 'disable') {
return false;
}
if (oControl.getWrappingType() === WrappingType.Hyphenated && !oControl.getWrapping()) {
Log.warning("[UI5 Hyphenation] The property... | javascript | {
"resource": ""
} |
q19189 | hyphenateTexts | train | function hyphenateTexts(oControl) {
if (!shouldControlHyphenate(oControl) || !shouldUseThirdParty()) {
// no hyphenation needed
oControl._mHyphenatedTexts = {};
oControl._mUnhyphenatedTexts = {};
return;
}
var mTexts = oControl.getTextsToBeHyphenated(),
aChangedTextKeys = diffTexts(mTexts,... | javascript | {
"resource": ""
} |
q19190 | parseNumberAndUnit | train | function parseNumberAndUnit(mUnitPatterns, sValue) {
var oBestMatch = {
numberValue: undefined,
cldrCode: []
};
if (typeof sValue !== "string") {
return oBestMatch;
}
var iBestLength = Number.POSITIVE_INFINITY;
var sUnitCode, sKey;
for (sUnitCode in mUnitPatterns) {
for (sKey in mUnitPatterns[... | javascript | {
"resource": ""
} |
q19191 | parseNumberAndCurrency | train | function parseNumberAndCurrency(oConfig) {
var sValue = oConfig.value;
// Search for known symbols (longest match)
// no distinction between default and custom currencies
var oMatch = findLongestMatch(sValue, oConfig.currencySymbols);
// Search for currency code
if (!oMatch.code) {
// before falling ba... | javascript | {
"resource": ""
} |
q19192 | _getLibraries | train | function _getLibraries() {
var libraries = Global.versioninfo ? Global.versioninfo.libraries : undefined;
var formattedLibraries = Object.create(null);
if (libraries !== undefined) {
libraries.forEach(function (element, index, array) {
formattedLibraries[element.name] = element.version;
});
}
... | javascript | {
"resource": ""
} |
q19193 | _getLoadedLibraries | train | function _getLoadedLibraries() {
var libraries = sap.ui.getCore().getLoadedLibraries();
var formattedLibraries = Object.create(null);
Object.keys(sap.ui.getCore().getLoadedLibraries()).forEach(function (element, index, array) {
formattedLibraries[element] = libraries[element].version;
});
return fo... | javascript | {
"resource": ""
} |
q19194 | _getFrameworkInformation | train | function _getFrameworkInformation() {
return {
commonInformation: {
frameworkName: _getFrameworkName(),
version: Global.version,
buildTime: Global.buildinfo.buildtime,
lastChange: Global.buildinfo.lastchange,
jquery: jQuery.fn.jquery,
userAgent: navigator.userAgent,
application... | javascript | {
"resource": ""
} |
q19195 | train | function (nodeElement, resultArray) {
var node = nodeElement;
var childNode = node.firstElementChild;
var results = resultArray;
var subResult = results;
var control = sap.ui.getCore().byId(node.id);
if (node.getAttribute('data-sap-ui') && control) {
results.push({
id: control.getId(... | javascript | {
"resource": ""
} | |
q19196 | train | function (control, inheritedMetadata) {
var inheritedMetadataProperties = inheritedMetadata.getProperties();
var result = Object.create(null);
result.meta = Object.create(null);
result.meta.controlName = inheritedMetadata.getName();
result.properties = Object.create(null);
Object.keys(inherite... | javascript | {
"resource": ""
} | |
q19197 | train | function (control) {
var result = [];
var inheritedMetadata = control.getMetadata().getParent();
while (inheritedMetadata instanceof ElementMetadata) {
result.push(this._copyInheritedProperties(control, inheritedMetadata));
inheritedMetadata = inheritedMetadata.getParent();
}
return resu... | javascript | {
"resource": ""
} | |
q19198 | train | function (controlId) {
var control = sap.ui.getCore().byId(controlId);
var properties = Object.create(null);
if (control) {
properties.own = this._getOwnProperties(control);
properties.inherited = this._getInheritedProperties(control);
}
return properties;
} | javascript | {
"resource": ""
} | |
q19199 | train | function (control) {
var properties = control.getMetadata().getAllProperties();
var propertiesBindingData = Object.create(null);
for (var key in properties) {
if (properties.hasOwnProperty(key) && control.getBinding(key)) {
propertiesBindingData[key] = Object.create(null);
propertiesBindin... | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.