id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
sequence
docstring
stringlengths
4
11.8k
docstring_tokens
sequence
sha
stringlengths
40
40
url
stringlengths
86
226
4,500
SAP/openui5
src/sap.ui.core/src/sap/ui/core/format/DateFormat.js
function(oField, oDate, bUTC, oFormat) { var iDay = bUTC ? oDate.getUTCDay() : oDate.getDay(); if (oField.digits < 4) { return oFormat.aDaysAbbrev[iDay]; } else if (oField.digits == 4) { return oFormat.aDaysWide[iDay]; } else if (oField.digits == 5) { return oFormat.aDaysNarrow[iDay]; } else { return oFormat.aDaysShort[iDay]; } }
javascript
function(oField, oDate, bUTC, oFormat) { var iDay = bUTC ? oDate.getUTCDay() : oDate.getDay(); if (oField.digits < 4) { return oFormat.aDaysAbbrev[iDay]; } else if (oField.digits == 4) { return oFormat.aDaysWide[iDay]; } else if (oField.digits == 5) { return oFormat.aDaysNarrow[iDay]; } else { return oFormat.aDaysShort[iDay]; } }
[ "function", "(", "oField", ",", "oDate", ",", "bUTC", ",", "oFormat", ")", "{", "var", "iDay", "=", "bUTC", "?", "oDate", ".", "getUTCDay", "(", ")", ":", "oDate", ".", "getDay", "(", ")", ";", "if", "(", "oField", ".", "digits", "<", "4", ")", "{", "return", "oFormat", ".", "aDaysAbbrev", "[", "iDay", "]", ";", "}", "else", "if", "(", "oField", ".", "digits", "==", "4", ")", "{", "return", "oFormat", ".", "aDaysWide", "[", "iDay", "]", ";", "}", "else", "if", "(", "oField", ".", "digits", "==", "5", ")", "{", "return", "oFormat", ".", "aDaysNarrow", "[", "iDay", "]", ";", "}", "else", "{", "return", "oFormat", ".", "aDaysShort", "[", "iDay", "]", ";", "}", "}" ]
Day of week name, format style.
[ "Day", "of", "week", "name", "format", "style", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/format/DateFormat.js#L996-L1007
4,501
SAP/openui5
src/sap.ui.core/src/sap/ui/core/format/DateFormat.js
mergeWithoutOverwrite
function mergeWithoutOverwrite(object1, object2) { if (object1 === object2) { return object1; } var oMergedObject = {}; // Clone object1 Object.keys(object1).forEach(function(sKey) { oMergedObject[sKey] = object1[sKey]; }); // merge Object.keys(object2).forEach(function(sKey) { if (!oMergedObject.hasOwnProperty(sKey)) { oMergedObject[sKey] = object2[sKey]; } }); return oMergedObject; }
javascript
function mergeWithoutOverwrite(object1, object2) { if (object1 === object2) { return object1; } var oMergedObject = {}; // Clone object1 Object.keys(object1).forEach(function(sKey) { oMergedObject[sKey] = object1[sKey]; }); // merge Object.keys(object2).forEach(function(sKey) { if (!oMergedObject.hasOwnProperty(sKey)) { oMergedObject[sKey] = object2[sKey]; } }); return oMergedObject; }
[ "function", "mergeWithoutOverwrite", "(", "object1", ",", "object2", ")", "{", "if", "(", "object1", "===", "object2", ")", "{", "return", "object1", ";", "}", "var", "oMergedObject", "=", "{", "}", ";", "// Clone object1", "Object", ".", "keys", "(", "object1", ")", ".", "forEach", "(", "function", "(", "sKey", ")", "{", "oMergedObject", "[", "sKey", "]", "=", "object1", "[", "sKey", "]", ";", "}", ")", ";", "// merge", "Object", ".", "keys", "(", "object2", ")", ".", "forEach", "(", "function", "(", "sKey", ")", "{", "if", "(", "!", "oMergedObject", ".", "hasOwnProperty", "(", "sKey", ")", ")", "{", "oMergedObject", "[", "sKey", "]", "=", "object2", "[", "sKey", "]", ";", "}", "}", ")", ";", "return", "oMergedObject", ";", "}" ]
Copy the properties of object2 into object1 without overwriting the existing properties in object1
[ "Copy", "the", "properties", "of", "object2", "into", "object1", "without", "overwriting", "the", "existing", "properties", "in", "object1" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/format/DateFormat.js#L1794-L1814
4,502
SAP/openui5
src/sap.ui.fl/src/sap/ui/fl/ControlPersonalizationAPI.js
function(oControl) { var oAppComponent = Utils.getAppComponentForControl(oControl); var oFlexController = FlexControllerFactory.createForControl(oAppComponent); var oRootControl = oAppComponent.getRootControl(); var oView = Utils.getViewForControl(oControl); var oVariantModel = oAppComponent.getModel("$FlexVariants"); var mParams = { rootControl : oRootControl, view : oView, variantModel : oVariantModel, variantManagement : {}, flexController: oFlexController }; var oVMControl; var aForControlTypes; jQuery.makeArray(mParams.rootControl.$().find(".sapUiFlVarMngmt")).map(function(oVariantManagementNode) { oVMControl = sap.ui.getCore().byId(oVariantManagementNode.id); if (oVMControl.getMetadata().getName() === "sap.ui.fl.variants.VariantManagement") { aForControlTypes = oVMControl.getFor(); aForControlTypes.forEach(function(sControlType) { mParams.variantManagement[sControlType] = mParams.variantModel.getLocalId(oVariantManagementNode.id, oAppComponent); }); } }); return mParams; }
javascript
function(oControl) { var oAppComponent = Utils.getAppComponentForControl(oControl); var oFlexController = FlexControllerFactory.createForControl(oAppComponent); var oRootControl = oAppComponent.getRootControl(); var oView = Utils.getViewForControl(oControl); var oVariantModel = oAppComponent.getModel("$FlexVariants"); var mParams = { rootControl : oRootControl, view : oView, variantModel : oVariantModel, variantManagement : {}, flexController: oFlexController }; var oVMControl; var aForControlTypes; jQuery.makeArray(mParams.rootControl.$().find(".sapUiFlVarMngmt")).map(function(oVariantManagementNode) { oVMControl = sap.ui.getCore().byId(oVariantManagementNode.id); if (oVMControl.getMetadata().getName() === "sap.ui.fl.variants.VariantManagement") { aForControlTypes = oVMControl.getFor(); aForControlTypes.forEach(function(sControlType) { mParams.variantManagement[sControlType] = mParams.variantModel.getLocalId(oVariantManagementNode.id, oAppComponent); }); } }); return mParams; }
[ "function", "(", "oControl", ")", "{", "var", "oAppComponent", "=", "Utils", ".", "getAppComponentForControl", "(", "oControl", ")", ";", "var", "oFlexController", "=", "FlexControllerFactory", ".", "createForControl", "(", "oAppComponent", ")", ";", "var", "oRootControl", "=", "oAppComponent", ".", "getRootControl", "(", ")", ";", "var", "oView", "=", "Utils", ".", "getViewForControl", "(", "oControl", ")", ";", "var", "oVariantModel", "=", "oAppComponent", ".", "getModel", "(", "\"$FlexVariants\"", ")", ";", "var", "mParams", "=", "{", "rootControl", ":", "oRootControl", ",", "view", ":", "oView", ",", "variantModel", ":", "oVariantModel", ",", "variantManagement", ":", "{", "}", ",", "flexController", ":", "oFlexController", "}", ";", "var", "oVMControl", ";", "var", "aForControlTypes", ";", "jQuery", ".", "makeArray", "(", "mParams", ".", "rootControl", ".", "$", "(", ")", ".", "find", "(", "\".sapUiFlVarMngmt\"", ")", ")", ".", "map", "(", "function", "(", "oVariantManagementNode", ")", "{", "oVMControl", "=", "sap", ".", "ui", ".", "getCore", "(", ")", ".", "byId", "(", "oVariantManagementNode", ".", "id", ")", ";", "if", "(", "oVMControl", ".", "getMetadata", "(", ")", ".", "getName", "(", ")", "===", "\"sap.ui.fl.variants.VariantManagement\"", ")", "{", "aForControlTypes", "=", "oVMControl", ".", "getFor", "(", ")", ";", "aForControlTypes", ".", "forEach", "(", "function", "(", "sControlType", ")", "{", "mParams", ".", "variantManagement", "[", "sControlType", "]", "=", "mParams", ".", "variantModel", ".", "getLocalId", "(", "oVariantManagementNode", ".", "id", ",", "oAppComponent", ")", ";", "}", ")", ";", "}", "}", ")", ";", "return", "mParams", ";", "}" ]
Returns a map of parameters used in public functions. @param {sap.ui.core.Element} oControl - The control for which a variant management control has to be evaluated @returns {object} Returns a map with needed parameters @private
[ "Returns", "a", "map", "of", "parameters", "used", "in", "public", "functions", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/ControlPersonalizationAPI.js#L66-L94
4,503
SAP/openui5
src/sap.ui.fl/src/sap/ui/fl/ControlPersonalizationAPI.js
function(oControl, mParams) { mParams = mParams || this._determineParameters(oControl); var fnCheckForControl = function (oControl) { if (!mParams.variantManagement[oControl.getId()] && oControl.getParent() && oControl.getId() !== mParams.rootControl.getId()) { return fnCheckForControl(oControl.getParent()); } else if (!oControl.getParent() || oControl.getId() === mParams.rootControl.getId()) { return mParams.variantManagement[oControl.getId()] || ""; } else { return mParams.variantManagement[oControl.getId()]; } }; return fnCheckForControl(oControl); }
javascript
function(oControl, mParams) { mParams = mParams || this._determineParameters(oControl); var fnCheckForControl = function (oControl) { if (!mParams.variantManagement[oControl.getId()] && oControl.getParent() && oControl.getId() !== mParams.rootControl.getId()) { return fnCheckForControl(oControl.getParent()); } else if (!oControl.getParent() || oControl.getId() === mParams.rootControl.getId()) { return mParams.variantManagement[oControl.getId()] || ""; } else { return mParams.variantManagement[oControl.getId()]; } }; return fnCheckForControl(oControl); }
[ "function", "(", "oControl", ",", "mParams", ")", "{", "mParams", "=", "mParams", "||", "this", ".", "_determineParameters", "(", "oControl", ")", ";", "var", "fnCheckForControl", "=", "function", "(", "oControl", ")", "{", "if", "(", "!", "mParams", ".", "variantManagement", "[", "oControl", ".", "getId", "(", ")", "]", "&&", "oControl", ".", "getParent", "(", ")", "&&", "oControl", ".", "getId", "(", ")", "!==", "mParams", ".", "rootControl", ".", "getId", "(", ")", ")", "{", "return", "fnCheckForControl", "(", "oControl", ".", "getParent", "(", ")", ")", ";", "}", "else", "if", "(", "!", "oControl", ".", "getParent", "(", ")", "||", "oControl", ".", "getId", "(", ")", "===", "mParams", ".", "rootControl", ".", "getId", "(", ")", ")", "{", "return", "mParams", ".", "variantManagement", "[", "oControl", ".", "getId", "(", ")", "]", "||", "\"\"", ";", "}", "else", "{", "return", "mParams", ".", "variantManagement", "[", "oControl", ".", "getId", "(", ")", "]", ";", "}", "}", ";", "return", "fnCheckForControl", "(", "oControl", ")", ";", "}" ]
Returns the local ID of the encompassing variant management control. @param {sap.ui.core.Element} oControl - The control for which a variant management control has to be evaluated @returns {object} Returns a map with needed parameters @private
[ "Returns", "the", "local", "ID", "of", "the", "encompassing", "variant", "management", "control", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/ControlPersonalizationAPI.js#L103-L116
4,504
SAP/openui5
src/sap.ui.fl/src/sap/ui/fl/ControlPersonalizationAPI.js
function(aControls, aChangeTypes) { if (!aControls || aControls.length === 0) { return this._reject("At least one control ID has to be provided as a parameter"); } var oAppComponent = aControls[0].appComponent || Utils.getAppComponentForControl(aControls[0]); if (!oAppComponent) { return this._reject("App Component could not be determined"); } var aIdsOfPassedControls = aControls.map(function (oControl) { return oControl.id || oControl.getId(); }); var oFlexController = FlexControllerFactory.createForControl(oAppComponent); return oFlexController.getComponentChanges({currentLayer: "USER", includeCtrlVariants: true}) .then(function (aChanges) { return aChanges .filter(this._filterBySelectors.bind(this, oAppComponent, aIdsOfPassedControls)) .filter(this._filterByChangeType.bind(this, aChangeTypes)) .some(this._ifValidFileType); }.bind(this)); }
javascript
function(aControls, aChangeTypes) { if (!aControls || aControls.length === 0) { return this._reject("At least one control ID has to be provided as a parameter"); } var oAppComponent = aControls[0].appComponent || Utils.getAppComponentForControl(aControls[0]); if (!oAppComponent) { return this._reject("App Component could not be determined"); } var aIdsOfPassedControls = aControls.map(function (oControl) { return oControl.id || oControl.getId(); }); var oFlexController = FlexControllerFactory.createForControl(oAppComponent); return oFlexController.getComponentChanges({currentLayer: "USER", includeCtrlVariants: true}) .then(function (aChanges) { return aChanges .filter(this._filterBySelectors.bind(this, oAppComponent, aIdsOfPassedControls)) .filter(this._filterByChangeType.bind(this, aChangeTypes)) .some(this._ifValidFileType); }.bind(this)); }
[ "function", "(", "aControls", ",", "aChangeTypes", ")", "{", "if", "(", "!", "aControls", "||", "aControls", ".", "length", "===", "0", ")", "{", "return", "this", ".", "_reject", "(", "\"At least one control ID has to be provided as a parameter\"", ")", ";", "}", "var", "oAppComponent", "=", "aControls", "[", "0", "]", ".", "appComponent", "||", "Utils", ".", "getAppComponentForControl", "(", "aControls", "[", "0", "]", ")", ";", "if", "(", "!", "oAppComponent", ")", "{", "return", "this", ".", "_reject", "(", "\"App Component could not be determined\"", ")", ";", "}", "var", "aIdsOfPassedControls", "=", "aControls", ".", "map", "(", "function", "(", "oControl", ")", "{", "return", "oControl", ".", "id", "||", "oControl", ".", "getId", "(", ")", ";", "}", ")", ";", "var", "oFlexController", "=", "FlexControllerFactory", ".", "createForControl", "(", "oAppComponent", ")", ";", "return", "oFlexController", ".", "getComponentChanges", "(", "{", "currentLayer", ":", "\"USER\"", ",", "includeCtrlVariants", ":", "true", "}", ")", ".", "then", "(", "function", "(", "aChanges", ")", "{", "return", "aChanges", ".", "filter", "(", "this", ".", "_filterBySelectors", ".", "bind", "(", "this", ",", "oAppComponent", ",", "aIdsOfPassedControls", ")", ")", ".", "filter", "(", "this", ".", "_filterByChangeType", ".", "bind", "(", "this", ",", "aChangeTypes", ")", ")", ".", "some", "(", "this", ".", "_ifValidFileType", ")", ";", "}", ".", "bind", "(", "this", ")", ")", ";", "}" ]
Checks if personalization changes exists for control. @param {sap.ui.core.Element[] | map[]} aControls - an array of instances of controls, a map with control IDs including a app component or a mixture for which personalization exists @param {array} [aChangeTypes] - Types of changes that have existing personalization. @param {sap.ui.core.Component} aControls.appComponent - Application component of the controls at runtime in case a map has been used @param {string} aControls.id - ID of the control in case a map has been used to specify the control @returns {Promise} Promise resolving with true if personalization changes exists, otherwise false. @method sap.ui.fl.ControlPersonalizationAPI.isPersonalized @public
[ "Checks", "if", "personalization", "changes", "exists", "for", "control", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/ControlPersonalizationAPI.js#L316-L339
4,505
SAP/openui5
src/sap.ui.fl/src/sap/ui/fl/ControlPersonalizationAPI.js
function(oControl) { try { return !!this._getVariantManagement(oControl); } catch (oError) { Utils.log.error(oError.message); return false; } }
javascript
function(oControl) { try { return !!this._getVariantManagement(oControl); } catch (oError) { Utils.log.error(oError.message); return false; } }
[ "function", "(", "oControl", ")", "{", "try", "{", "return", "!", "!", "this", ".", "_getVariantManagement", "(", "oControl", ")", ";", "}", "catch", "(", "oError", ")", "{", "Utils", ".", "log", ".", "error", "(", "oError", ".", "message", ")", ";", "return", "false", ";", "}", "}" ]
Determines the availability of an encompassing variant management control. @param {sap.ui.core.Element} oControl - The control which should be tested for an encompassing variant management control @returns {boolean} Returns true if a variant management control is encompassing the given control, else false @method sap.ui.fl.ControlPersonalizationAPI.hasVariantManagement @public
[ "Determines", "the", "availability", "of", "an", "encompassing", "variant", "management", "control", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/ControlPersonalizationAPI.js#L433-L440
4,506
SAP/openui5
src/sap.m/src/sap/m/MaskInputRule.js
validateRegex
function validateRegex(sRegex) { if (/.+/i.test(sRegex)) { return true; } Log.error("The regex value '" + sRegex + "' is not valid"); return false; }
javascript
function validateRegex(sRegex) { if (/.+/i.test(sRegex)) { return true; } Log.error("The regex value '" + sRegex + "' is not valid"); return false; }
[ "function", "validateRegex", "(", "sRegex", ")", "{", "if", "(", "/", ".+", "/", "i", ".", "test", "(", "sRegex", ")", ")", "{", "return", "true", ";", "}", "Log", ".", "error", "(", "\"The regex value '\"", "+", "sRegex", "+", "\"' is not valid\"", ")", ";", "return", "false", ";", "}" ]
Checks if the specified regular expression is valid. @param {String} sRegex The regular expression string to be validated @returns {boolean} True of the specified regular expression string is valid, false otherwise @private
[ "Checks", "if", "the", "specified", "regular", "expression", "is", "valid", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/MaskInputRule.js#L108-L114
4,507
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js
function(oAtt, aResult){ if (!oAtt.getSelected()) { return; } aResult.push(oAtt); var aValues = oAtt.getAttributesInternal(); for (var idx = 0; idx < aValues.length; idx++) { _computeSelectedAttributes(aValues[idx], aResult); } }
javascript
function(oAtt, aResult){ if (!oAtt.getSelected()) { return; } aResult.push(oAtt); var aValues = oAtt.getAttributesInternal(); for (var idx = 0; idx < aValues.length; idx++) { _computeSelectedAttributes(aValues[idx], aResult); } }
[ "function", "(", "oAtt", ",", "aResult", ")", "{", "if", "(", "!", "oAtt", ".", "getSelected", "(", ")", ")", "{", "return", ";", "}", "aResult", ".", "push", "(", "oAtt", ")", ";", "var", "aValues", "=", "oAtt", ".", "getAttributesInternal", "(", ")", ";", "for", "(", "var", "idx", "=", "0", ";", "idx", "<", "aValues", ".", "length", ";", "idx", "++", ")", "{", "_computeSelectedAttributes", "(", "aValues", "[", "idx", "]", ",", "aResult", ")", ";", "}", "}" ]
Computes recursivly all selected attributes and adds them to the given result list
[ "Computes", "recursivly", "all", "selected", "attributes", "and", "adds", "them", "to", "the", "given", "result", "list" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L861-L870
4,508
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js
function(oList, bArrow){ function getNextOnSameLevel(oLst){ var oParent = oLst.getParent(); var aParentSubLists = oParent.getSubLists(); var idx = oParent.indexOfSubList(oLst) + 1; if (idx < aParentSubLists.length) { return aParentSubLists[idx]; } return null; } function getFirstChild(oLst){ var aSubLists = oLst.getSubLists(); if (aSubLists.length > 0) { return aSubLists[0]; } return null; } function getNext(oLst){ var oNextListRef = getNextOnSameLevel(oLst); if (oNextListRef) { return oNextListRef; } var oParent = oLst.getParent(); if (oParent._iLevel > (bArrow ? 1 : 0)) { return getNext(oParent); } else { return null; } } if (oList._iLevel == 0) { return getFirstChild(oList); } else if (oList._iLevel == 1) { return bArrow ? getFirstChild(oList) : getNextOnSameLevel(oList); } else if (oList._iLevel > 1) { var oNextList = getFirstChild(oList); if (oNextList) { return oNextList; } return getNext(oList); } return null; }
javascript
function(oList, bArrow){ function getNextOnSameLevel(oLst){ var oParent = oLst.getParent(); var aParentSubLists = oParent.getSubLists(); var idx = oParent.indexOfSubList(oLst) + 1; if (idx < aParentSubLists.length) { return aParentSubLists[idx]; } return null; } function getFirstChild(oLst){ var aSubLists = oLst.getSubLists(); if (aSubLists.length > 0) { return aSubLists[0]; } return null; } function getNext(oLst){ var oNextListRef = getNextOnSameLevel(oLst); if (oNextListRef) { return oNextListRef; } var oParent = oLst.getParent(); if (oParent._iLevel > (bArrow ? 1 : 0)) { return getNext(oParent); } else { return null; } } if (oList._iLevel == 0) { return getFirstChild(oList); } else if (oList._iLevel == 1) { return bArrow ? getFirstChild(oList) : getNextOnSameLevel(oList); } else if (oList._iLevel > 1) { var oNextList = getFirstChild(oList); if (oNextList) { return oNextList; } return getNext(oList); } return null; }
[ "function", "(", "oList", ",", "bArrow", ")", "{", "function", "getNextOnSameLevel", "(", "oLst", ")", "{", "var", "oParent", "=", "oLst", ".", "getParent", "(", ")", ";", "var", "aParentSubLists", "=", "oParent", ".", "getSubLists", "(", ")", ";", "var", "idx", "=", "oParent", ".", "indexOfSubList", "(", "oLst", ")", "+", "1", ";", "if", "(", "idx", "<", "aParentSubLists", ".", "length", ")", "{", "return", "aParentSubLists", "[", "idx", "]", ";", "}", "return", "null", ";", "}", "function", "getFirstChild", "(", "oLst", ")", "{", "var", "aSubLists", "=", "oLst", ".", "getSubLists", "(", ")", ";", "if", "(", "aSubLists", ".", "length", ">", "0", ")", "{", "return", "aSubLists", "[", "0", "]", ";", "}", "return", "null", ";", "}", "function", "getNext", "(", "oLst", ")", "{", "var", "oNextListRef", "=", "getNextOnSameLevel", "(", "oLst", ")", ";", "if", "(", "oNextListRef", ")", "{", "return", "oNextListRef", ";", "}", "var", "oParent", "=", "oLst", ".", "getParent", "(", ")", ";", "if", "(", "oParent", ".", "_iLevel", ">", "(", "bArrow", "?", "1", ":", "0", ")", ")", "{", "return", "getNext", "(", "oParent", ")", ";", "}", "else", "{", "return", "null", ";", "}", "}", "if", "(", "oList", ".", "_iLevel", "==", "0", ")", "{", "return", "getFirstChild", "(", "oList", ")", ";", "}", "else", "if", "(", "oList", ".", "_iLevel", "==", "1", ")", "{", "return", "bArrow", "?", "getFirstChild", "(", "oList", ")", ":", "getNextOnSameLevel", "(", "oList", ")", ";", "}", "else", "if", "(", "oList", ".", "_iLevel", ">", "1", ")", "{", "var", "oNextList", "=", "getFirstChild", "(", "oList", ")", ";", "if", "(", "oNextList", ")", "{", "return", "oNextList", ";", "}", "return", "getNext", "(", "oList", ")", ";", "}", "return", "null", ";", "}" ]
Returns the successor of the given list based on the level and whether TAB or the arrow keys are used
[ "Returns", "the", "successor", "of", "the", "given", "list", "based", "on", "the", "level", "and", "whether", "TAB", "or", "the", "arrow", "keys", "are", "used" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L960-L1005
4,509
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js
function(oList, oAttr){ if (oList._getAtt().getListOrder() != ExactOrder.Fixed /*Select*/) { return -1; } var aAttributes = oList._getAtt().getAttributes(); var idx = 0; for (var i = 0; i < aAttributes.length; i++) { if (aAttributes[i] === oAttr) { break; } if (aAttributes[i].getChangeListener()) { idx++; } } return idx; }
javascript
function(oList, oAttr){ if (oList._getAtt().getListOrder() != ExactOrder.Fixed /*Select*/) { return -1; } var aAttributes = oList._getAtt().getAttributes(); var idx = 0; for (var i = 0; i < aAttributes.length; i++) { if (aAttributes[i] === oAttr) { break; } if (aAttributes[i].getChangeListener()) { idx++; } } return idx; }
[ "function", "(", "oList", ",", "oAttr", ")", "{", "if", "(", "oList", ".", "_getAtt", "(", ")", ".", "getListOrder", "(", ")", "!=", "ExactOrder", ".", "Fixed", "/*Select*/", ")", "{", "return", "-", "1", ";", "}", "var", "aAttributes", "=", "oList", ".", "_getAtt", "(", ")", ".", "getAttributes", "(", ")", ";", "var", "idx", "=", "0", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "aAttributes", ".", "length", ";", "i", "++", ")", "{", "if", "(", "aAttributes", "[", "i", "]", "===", "oAttr", ")", "{", "break", ";", "}", "if", "(", "aAttributes", "[", "i", "]", ".", "getChangeListener", "(", ")", ")", "{", "idx", "++", ";", "}", "}", "return", "idx", ";", "}" ]
Returns the index in the sublists of the given list for a new list of the given attribute
[ "Returns", "the", "index", "in", "the", "sublists", "of", "the", "given", "list", "for", "a", "new", "list", "of", "the", "given", "attribute" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1024-L1040
4,510
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js
function(jRef, bWidth, iValue, fDoBefore, fDoAfter){ if (fDoBefore) { var iVal = fDoBefore(jRef); if (iVal != undefined) { iValue = iVal; } } var _fDoAfter = fDoAfter ? function(){fDoAfter(jRef);} : function(){}; if (jQuery.fx.off) { if (bWidth) { jRef.width(iValue); } else { jRef.height(iValue); } _fDoAfter(); } else { var oParam = bWidth ? {width: iValue} : {height: iValue}; jRef.stop(true, true).animate(oParam, 200, 'linear', _fDoAfter); } }
javascript
function(jRef, bWidth, iValue, fDoBefore, fDoAfter){ if (fDoBefore) { var iVal = fDoBefore(jRef); if (iVal != undefined) { iValue = iVal; } } var _fDoAfter = fDoAfter ? function(){fDoAfter(jRef);} : function(){}; if (jQuery.fx.off) { if (bWidth) { jRef.width(iValue); } else { jRef.height(iValue); } _fDoAfter(); } else { var oParam = bWidth ? {width: iValue} : {height: iValue}; jRef.stop(true, true).animate(oParam, 200, 'linear', _fDoAfter); } }
[ "function", "(", "jRef", ",", "bWidth", ",", "iValue", ",", "fDoBefore", ",", "fDoAfter", ")", "{", "if", "(", "fDoBefore", ")", "{", "var", "iVal", "=", "fDoBefore", "(", "jRef", ")", ";", "if", "(", "iVal", "!=", "undefined", ")", "{", "iValue", "=", "iVal", ";", "}", "}", "var", "_fDoAfter", "=", "fDoAfter", "?", "function", "(", ")", "{", "fDoAfter", "(", "jRef", ")", ";", "}", ":", "function", "(", ")", "{", "}", ";", "if", "(", "jQuery", ".", "fx", ".", "off", ")", "{", "if", "(", "bWidth", ")", "{", "jRef", ".", "width", "(", "iValue", ")", ";", "}", "else", "{", "jRef", ".", "height", "(", "iValue", ")", ";", "}", "_fDoAfter", "(", ")", ";", "}", "else", "{", "var", "oParam", "=", "bWidth", "?", "{", "width", ":", "iValue", "}", ":", "{", "height", ":", "iValue", "}", ";", "jRef", ".", "stop", "(", "true", ",", "true", ")", ".", "animate", "(", "oParam", ",", "200", ",", "'linear'", ",", "_fDoAfter", ")", ";", "}", "}" ]
Animates the width or height of the given jRef to the given target value Optional callbacks are possible which are called before and after the animation
[ "Animates", "the", "width", "or", "height", "of", "the", "given", "jRef", "to", "the", "given", "target", "value", "Optional", "callbacks", "are", "possible", "which", "are", "called", "before", "and", "after", "the", "animation" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1138-L1157
4,511
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js
function(oEvent){ var iCurrentX = oEvent.pageX; var iDiff = this._bRTL ? (this._iStartDragX - iCurrentX) : (iCurrentX - this._iStartDragX); setWidth(this, this._iStartWidth + iDiff); }
javascript
function(oEvent){ var iCurrentX = oEvent.pageX; var iDiff = this._bRTL ? (this._iStartDragX - iCurrentX) : (iCurrentX - this._iStartDragX); setWidth(this, this._iStartWidth + iDiff); }
[ "function", "(", "oEvent", ")", "{", "var", "iCurrentX", "=", "oEvent", ".", "pageX", ";", "var", "iDiff", "=", "this", ".", "_bRTL", "?", "(", "this", ".", "_iStartDragX", "-", "iCurrentX", ")", ":", "(", "iCurrentX", "-", "this", ".", "_iStartDragX", ")", ";", "setWidth", "(", "this", ",", "this", ".", "_iStartWidth", "+", "iDiff", ")", ";", "}" ]
Handles the MouseMove event during resizing @see sap.ui.ux3.ExactList.prototype.onmousedown
[ "Handles", "the", "MouseMove", "event", "during", "resizing" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1171-L1175
4,512
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js
function(oEvent){ jQuery(document.body).unbind("selectstart." + this.getId()).unbind("mouseup." + this.getId()).unbind("mousemove." + this.getId()); this.$("ghost").remove(); this.$("rsz").removeClass("sapUiUx3ExactLstRSzDrag"); this._iStartWidth = undefined; this._iStartDragX = undefined; this.focus(); }
javascript
function(oEvent){ jQuery(document.body).unbind("selectstart." + this.getId()).unbind("mouseup." + this.getId()).unbind("mousemove." + this.getId()); this.$("ghost").remove(); this.$("rsz").removeClass("sapUiUx3ExactLstRSzDrag"); this._iStartWidth = undefined; this._iStartDragX = undefined; this.focus(); }
[ "function", "(", "oEvent", ")", "{", "jQuery", "(", "document", ".", "body", ")", ".", "unbind", "(", "\"selectstart.\"", "+", "this", ".", "getId", "(", ")", ")", ".", "unbind", "(", "\"mouseup.\"", "+", "this", ".", "getId", "(", ")", ")", ".", "unbind", "(", "\"mousemove.\"", "+", "this", ".", "getId", "(", ")", ")", ";", "this", ".", "$", "(", "\"ghost\"", ")", ".", "remove", "(", ")", ";", "this", ".", "$", "(", "\"rsz\"", ")", ".", "removeClass", "(", "\"sapUiUx3ExactLstRSzDrag\"", ")", ";", "this", ".", "_iStartWidth", "=", "undefined", ";", "this", ".", "_iStartDragX", "=", "undefined", ";", "this", ".", "focus", "(", ")", ";", "}" ]
Handles the MouseUp event during resizing @see sap.ui.ux3.ExactList.prototype.onmousedown
[ "Handles", "the", "MouseUp", "event", "during", "resizing" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1180-L1187
4,513
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js
function(oList, iWidth){ iWidth = ExactAttribute._checkWidth(iWidth); var sPos = oList._bRTL ? "right" : "left"; oList._iCurrentWidth = iWidth; oList._getAtt()._setWidth(oList._iCurrentWidth); oList.$("lst").css("width", iWidth + "px"); oList.$("rsz").css(sPos, (iWidth - 4) + "px"); if (oList._isTop()) { if (!isTopHidden(oList)) { oList.$("head").css("width", iWidth + "px"); oList.$("cntnt").css(sPos, (iWidth + 8) + "px"); oList.$("scroll").css(sPos, (iWidth + 8) + "px"); } } else { if (!oList.$().hasClass("sapUiUx3ExactLstCollapsed")) { oList.$("cntnt").css("margin-" + sPos, iWidth + "px"); } } }
javascript
function(oList, iWidth){ iWidth = ExactAttribute._checkWidth(iWidth); var sPos = oList._bRTL ? "right" : "left"; oList._iCurrentWidth = iWidth; oList._getAtt()._setWidth(oList._iCurrentWidth); oList.$("lst").css("width", iWidth + "px"); oList.$("rsz").css(sPos, (iWidth - 4) + "px"); if (oList._isTop()) { if (!isTopHidden(oList)) { oList.$("head").css("width", iWidth + "px"); oList.$("cntnt").css(sPos, (iWidth + 8) + "px"); oList.$("scroll").css(sPos, (iWidth + 8) + "px"); } } else { if (!oList.$().hasClass("sapUiUx3ExactLstCollapsed")) { oList.$("cntnt").css("margin-" + sPos, iWidth + "px"); } } }
[ "function", "(", "oList", ",", "iWidth", ")", "{", "iWidth", "=", "ExactAttribute", ".", "_checkWidth", "(", "iWidth", ")", ";", "var", "sPos", "=", "oList", ".", "_bRTL", "?", "\"right\"", ":", "\"left\"", ";", "oList", ".", "_iCurrentWidth", "=", "iWidth", ";", "oList", ".", "_getAtt", "(", ")", ".", "_setWidth", "(", "oList", ".", "_iCurrentWidth", ")", ";", "oList", ".", "$", "(", "\"lst\"", ")", ".", "css", "(", "\"width\"", ",", "iWidth", "+", "\"px\"", ")", ";", "oList", ".", "$", "(", "\"rsz\"", ")", ".", "css", "(", "sPos", ",", "(", "iWidth", "-", "4", ")", "+", "\"px\"", ")", ";", "if", "(", "oList", ".", "_isTop", "(", ")", ")", "{", "if", "(", "!", "isTopHidden", "(", "oList", ")", ")", "{", "oList", ".", "$", "(", "\"head\"", ")", ".", "css", "(", "\"width\"", ",", "iWidth", "+", "\"px\"", ")", ";", "oList", ".", "$", "(", "\"cntnt\"", ")", ".", "css", "(", "sPos", ",", "(", "iWidth", "+", "8", ")", "+", "\"px\"", ")", ";", "oList", ".", "$", "(", "\"scroll\"", ")", ".", "css", "(", "sPos", ",", "(", "iWidth", "+", "8", ")", "+", "\"px\"", ")", ";", "}", "}", "else", "{", "if", "(", "!", "oList", ".", "$", "(", ")", ".", "hasClass", "(", "\"sapUiUx3ExactLstCollapsed\"", ")", ")", "{", "oList", ".", "$", "(", "\"cntnt\"", ")", ".", "css", "(", "\"margin-\"", "+", "sPos", ",", "iWidth", "+", "\"px\"", ")", ";", "}", "}", "}" ]
Sets the width of the list to the given width (maybe the width is adapted to the allowed range (@see checkWidth))
[ "Sets", "the", "width", "of", "the", "list", "to", "the", "given", "width", "(", "maybe", "the", "width", "is", "adapted", "to", "the", "allowed", "range", "(" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1191-L1209
4,514
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js
function(oList){ var oAtt = oList._getAtt(); if (oAtt && !oList._isTop()) { oList.$("head-txt").html(encodeXML(oAtt.getText()) + "<span class=\"sapUiUx3ExactLstHeadInfo\">&nbsp;(" + oList._lb.getSelectedIndices().length + "/" + oList._lb.getItems().length + ")</span>"); } }
javascript
function(oList){ var oAtt = oList._getAtt(); if (oAtt && !oList._isTop()) { oList.$("head-txt").html(encodeXML(oAtt.getText()) + "<span class=\"sapUiUx3ExactLstHeadInfo\">&nbsp;(" + oList._lb.getSelectedIndices().length + "/" + oList._lb.getItems().length + ")</span>"); } }
[ "function", "(", "oList", ")", "{", "var", "oAtt", "=", "oList", ".", "_getAtt", "(", ")", ";", "if", "(", "oAtt", "&&", "!", "oList", ".", "_isTop", "(", ")", ")", "{", "oList", ".", "$", "(", "\"head-txt\"", ")", ".", "html", "(", "encodeXML", "(", "oAtt", ".", "getText", "(", ")", ")", "+", "\"<span class=\\\"sapUiUx3ExactLstHeadInfo\\\">&nbsp;(\"", "+", "oList", ".", "_lb", ".", "getSelectedIndices", "(", ")", ".", "length", "+", "\"/\"", "+", "oList", ".", "_lb", ".", "getItems", "(", ")", ".", "length", "+", "\")</span>\"", ")", ";", "}", "}" ]
Refresh the header text of the list
[ "Refresh", "the", "header", "text", "of", "the", "list" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1213-L1219
4,515
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js
function(oList, iLevel){ oList._iLevel = iLevel; var aLists = oList.getSubLists(); for (var i = 0; i < aLists.length; i++) { setLevel(aLists[i], iLevel + 1); } }
javascript
function(oList, iLevel){ oList._iLevel = iLevel; var aLists = oList.getSubLists(); for (var i = 0; i < aLists.length; i++) { setLevel(aLists[i], iLevel + 1); } }
[ "function", "(", "oList", ",", "iLevel", ")", "{", "oList", ".", "_iLevel", "=", "iLevel", ";", "var", "aLists", "=", "oList", ".", "getSubLists", "(", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "aLists", ".", "length", ";", "i", "++", ")", "{", "setLevel", "(", "aLists", "[", "i", "]", ",", "iLevel", "+", "1", ")", ";", "}", "}" ]
Sets the level of the list and its sublists
[ "Sets", "the", "level", "of", "the", "list", "and", "its", "sublists" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1223-L1229
4,516
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js
function(oList){ if (oList._lb) { var jListRef = jQuery(oList._lb.getDomRef()); oList.$("lst").removeClass("sapUiUx3ExactLstScroll"); if (jListRef.length > 0 && jListRef.outerHeight() < jListRef[0].scrollHeight) { oList.$("lst").addClass("sapUiUx3ExactLstScroll"); return true; } } return false; }
javascript
function(oList){ if (oList._lb) { var jListRef = jQuery(oList._lb.getDomRef()); oList.$("lst").removeClass("sapUiUx3ExactLstScroll"); if (jListRef.length > 0 && jListRef.outerHeight() < jListRef[0].scrollHeight) { oList.$("lst").addClass("sapUiUx3ExactLstScroll"); return true; } } return false; }
[ "function", "(", "oList", ")", "{", "if", "(", "oList", ".", "_lb", ")", "{", "var", "jListRef", "=", "jQuery", "(", "oList", ".", "_lb", ".", "getDomRef", "(", ")", ")", ";", "oList", ".", "$", "(", "\"lst\"", ")", ".", "removeClass", "(", "\"sapUiUx3ExactLstScroll\"", ")", ";", "if", "(", "jListRef", ".", "length", ">", "0", "&&", "jListRef", ".", "outerHeight", "(", ")", "<", "jListRef", "[", "0", "]", ".", "scrollHeight", ")", "{", "oList", ".", "$", "(", "\"lst\"", ")", ".", "addClass", "(", "\"sapUiUx3ExactLstScroll\"", ")", ";", "return", "true", ";", "}", "}", "return", "false", ";", "}" ]
Adapt the scrolling behavior when not all list items can be shown and return whether adaptation was done or not.
[ "Adapt", "the", "scrolling", "behavior", "when", "not", "all", "list", "items", "can", "be", "shown", "and", "return", "whether", "adaptation", "was", "done", "or", "not", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1233-L1243
4,517
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js
function(oList) { if (oList._bCollapsed) { var iWidth = oList.$("cntnt").height() - 50/*Space for Header Action Buttons - Maybe provide theme parameter in future*/; var $txt = oList.$("head-txt"); $txt.css("width", iWidth + "px"); } var aSubLists = oList.getSubLists(); for (var i = 0; i < aSubLists.length; i++) { refreshCollapseHeaderTextWidth(aSubLists[i]); } }
javascript
function(oList) { if (oList._bCollapsed) { var iWidth = oList.$("cntnt").height() - 50/*Space for Header Action Buttons - Maybe provide theme parameter in future*/; var $txt = oList.$("head-txt"); $txt.css("width", iWidth + "px"); } var aSubLists = oList.getSubLists(); for (var i = 0; i < aSubLists.length; i++) { refreshCollapseHeaderTextWidth(aSubLists[i]); } }
[ "function", "(", "oList", ")", "{", "if", "(", "oList", ".", "_bCollapsed", ")", "{", "var", "iWidth", "=", "oList", ".", "$", "(", "\"cntnt\"", ")", ".", "height", "(", ")", "-", "50", "/*Space for Header Action Buttons - Maybe provide theme parameter in future*/", ";", "var", "$txt", "=", "oList", ".", "$", "(", "\"head-txt\"", ")", ";", "$txt", ".", "css", "(", "\"width\"", ",", "iWidth", "+", "\"px\"", ")", ";", "}", "var", "aSubLists", "=", "oList", ".", "getSubLists", "(", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "aSubLists", ".", "length", ";", "i", "++", ")", "{", "refreshCollapseHeaderTextWidth", "(", "aSubLists", "[", "i", "]", ")", ";", "}", "}" ]
Refreshs the header text width of all collapsed lists
[ "Refreshs", "the", "header", "text", "width", "of", "all", "collapsed", "lists" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1348-L1358
4,518
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js
function(oList){ var jListContRef = oList.$("lst"); if (jListContRef.hasClass("sapUiUx3ExactLstExpanded")) { //collapse oList._oPopup.close(); } else { //expand oList._oPopup.open(); } }
javascript
function(oList){ var jListContRef = oList.$("lst"); if (jListContRef.hasClass("sapUiUx3ExactLstExpanded")) { //collapse oList._oPopup.close(); } else { //expand oList._oPopup.open(); } }
[ "function", "(", "oList", ")", "{", "var", "jListContRef", "=", "oList", ".", "$", "(", "\"lst\"", ")", ";", "if", "(", "jListContRef", ".", "hasClass", "(", "\"sapUiUx3ExactLstExpanded\"", ")", ")", "{", "//collapse", "oList", ".", "_oPopup", ".", "close", "(", ")", ";", "}", "else", "{", "//expand", "oList", ".", "_oPopup", ".", "open", "(", ")", ";", "}", "}" ]
Toggles the vertical Collapse State
[ "Toggles", "the", "vertical", "Collapse", "State" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1362-L1371
4,519
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js
function(oList, bSkipNotify, fCallback){ var fFinalize = function(jRef) { if (!bSkipNotify) { var oAttr = oList._getAtt(); var iSelectedIndex = oAttr.getParent().indexOfAttribute(oAttr); clearAttribute(oList.getParent(), oAttr, iSelectedIndex, true); setHeaderText(oList.getParent()); getTopList(oList)._selectionChanged(oAttr); } oList.destroy(); if (fCallback) { fCallback(); } }; var oListRef = oList.getDomRef(); if (oListRef) { animate(jQuery(oListRef), true, 0, function(jRef) { jRef.css("overflow", "hidden"); }, fFinalize); } else { fFinalize(); } }
javascript
function(oList, bSkipNotify, fCallback){ var fFinalize = function(jRef) { if (!bSkipNotify) { var oAttr = oList._getAtt(); var iSelectedIndex = oAttr.getParent().indexOfAttribute(oAttr); clearAttribute(oList.getParent(), oAttr, iSelectedIndex, true); setHeaderText(oList.getParent()); getTopList(oList)._selectionChanged(oAttr); } oList.destroy(); if (fCallback) { fCallback(); } }; var oListRef = oList.getDomRef(); if (oListRef) { animate(jQuery(oListRef), true, 0, function(jRef) { jRef.css("overflow", "hidden"); }, fFinalize); } else { fFinalize(); } }
[ "function", "(", "oList", ",", "bSkipNotify", ",", "fCallback", ")", "{", "var", "fFinalize", "=", "function", "(", "jRef", ")", "{", "if", "(", "!", "bSkipNotify", ")", "{", "var", "oAttr", "=", "oList", ".", "_getAtt", "(", ")", ";", "var", "iSelectedIndex", "=", "oAttr", ".", "getParent", "(", ")", ".", "indexOfAttribute", "(", "oAttr", ")", ";", "clearAttribute", "(", "oList", ".", "getParent", "(", ")", ",", "oAttr", ",", "iSelectedIndex", ",", "true", ")", ";", "setHeaderText", "(", "oList", ".", "getParent", "(", ")", ")", ";", "getTopList", "(", "oList", ")", ".", "_selectionChanged", "(", "oAttr", ")", ";", "}", "oList", ".", "destroy", "(", ")", ";", "if", "(", "fCallback", ")", "{", "fCallback", "(", ")", ";", "}", "}", ";", "var", "oListRef", "=", "oList", ".", "getDomRef", "(", ")", ";", "if", "(", "oListRef", ")", "{", "animate", "(", "jQuery", "(", "oListRef", ")", ",", "true", ",", "0", ",", "function", "(", "jRef", ")", "{", "jRef", ".", "css", "(", "\"overflow\"", ",", "\"hidden\"", ")", ";", "}", ",", "fFinalize", ")", ";", "}", "else", "{", "fFinalize", "(", ")", ";", "}", "}" ]
Handles the close of the list
[ "Handles", "the", "close", "of", "the", "list" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1375-L1398
4,520
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js
function(oList, oAttribute) { if (oAttribute.getSelected()) { var aAttributes = oAttribute.getAttributesInternal(true); if (aAttributes.length > 0) { var oSubList; if (oAttribute.getChangeListener()) { oSubList = sap.ui.getCore().byId(oAttribute.getChangeListener().id); } else { oSubList = new ExactList(); } oSubList.setData(oAttribute); return oSubList; } } return null; }
javascript
function(oList, oAttribute) { if (oAttribute.getSelected()) { var aAttributes = oAttribute.getAttributesInternal(true); if (aAttributes.length > 0) { var oSubList; if (oAttribute.getChangeListener()) { oSubList = sap.ui.getCore().byId(oAttribute.getChangeListener().id); } else { oSubList = new ExactList(); } oSubList.setData(oAttribute); return oSubList; } } return null; }
[ "function", "(", "oList", ",", "oAttribute", ")", "{", "if", "(", "oAttribute", ".", "getSelected", "(", ")", ")", "{", "var", "aAttributes", "=", "oAttribute", ".", "getAttributesInternal", "(", "true", ")", ";", "if", "(", "aAttributes", ".", "length", ">", "0", ")", "{", "var", "oSubList", ";", "if", "(", "oAttribute", ".", "getChangeListener", "(", ")", ")", "{", "oSubList", "=", "sap", ".", "ui", ".", "getCore", "(", ")", ".", "byId", "(", "oAttribute", ".", "getChangeListener", "(", ")", ".", "id", ")", ";", "}", "else", "{", "oSubList", "=", "new", "ExactList", "(", ")", ";", "}", "oSubList", ".", "setData", "(", "oAttribute", ")", ";", "return", "oSubList", ";", "}", "}", "return", "null", ";", "}" ]
Creates a new ExactList for the given attribute if the attribute is selected and does not have a corresponding list yet. If the attribute has a corresponding list already this list is returned.
[ "Creates", "a", "new", "ExactList", "for", "the", "given", "attribute", "if", "the", "attribute", "is", "selected", "and", "does", "not", "have", "a", "corresponding", "list", "yet", ".", "If", "the", "attribute", "has", "a", "corresponding", "list", "already", "this", "list", "is", "returned", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1403-L1420
4,521
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js
function(oList, oAttribute, iSelectedIndex, bSkipNotify){ oList._lb.removeSelectedIndex(iSelectedIndex); oAttribute._clearSelection(); if (!bSkipNotify) { var aSubLists = oList.getSubLists(); for (var i = 0; i < aSubLists.length; i++) { if (aSubLists[i].getData() === oAttribute.getId()) { close(aSubLists[i], true); } } } }
javascript
function(oList, oAttribute, iSelectedIndex, bSkipNotify){ oList._lb.removeSelectedIndex(iSelectedIndex); oAttribute._clearSelection(); if (!bSkipNotify) { var aSubLists = oList.getSubLists(); for (var i = 0; i < aSubLists.length; i++) { if (aSubLists[i].getData() === oAttribute.getId()) { close(aSubLists[i], true); } } } }
[ "function", "(", "oList", ",", "oAttribute", ",", "iSelectedIndex", ",", "bSkipNotify", ")", "{", "oList", ".", "_lb", ".", "removeSelectedIndex", "(", "iSelectedIndex", ")", ";", "oAttribute", ".", "_clearSelection", "(", ")", ";", "if", "(", "!", "bSkipNotify", ")", "{", "var", "aSubLists", "=", "oList", ".", "getSubLists", "(", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "aSubLists", ".", "length", ";", "i", "++", ")", "{", "if", "(", "aSubLists", "[", "i", "]", ".", "getData", "(", ")", "===", "oAttribute", ".", "getId", "(", ")", ")", "{", "close", "(", "aSubLists", "[", "i", "]", ",", "true", ")", ";", "}", "}", "}", "}" ]
Sets the selection property of the given attribute and all its sub-attributes to false. Additionally the given index in the lists ListBox is unselected. ExactLists which corresponds to the cleared attributes are closed if bSkipNotify is not set.
[ "Sets", "the", "selection", "property", "of", "the", "given", "attribute", "and", "all", "its", "sub", "-", "attributes", "to", "false", ".", "Additionally", "the", "given", "index", "in", "the", "lists", "ListBox", "is", "unselected", ".", "ExactLists", "which", "corresponds", "to", "the", "cleared", "attributes", "are", "closed", "if", "bSkipNotify", "is", "not", "set", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1426-L1437
4,522
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js
function(oList) { var oAttr = oList._getAtt(); if (oAttr && oAttr.getChangeListener() && oAttr.getChangeListener().id === oList.getId()) { oAttr.setChangeListener(null); } }
javascript
function(oList) { var oAttr = oList._getAtt(); if (oAttr && oAttr.getChangeListener() && oAttr.getChangeListener().id === oList.getId()) { oAttr.setChangeListener(null); } }
[ "function", "(", "oList", ")", "{", "var", "oAttr", "=", "oList", ".", "_getAtt", "(", ")", ";", "if", "(", "oAttr", "&&", "oAttr", ".", "getChangeListener", "(", ")", "&&", "oAttr", ".", "getChangeListener", "(", ")", ".", "id", "===", "oList", ".", "getId", "(", ")", ")", "{", "oAttr", ".", "setChangeListener", "(", "null", ")", ";", "}", "}" ]
Removes the change listener which is attached to the lists attribute.
[ "Removes", "the", "change", "listener", "which", "is", "attached", "to", "the", "lists", "attribute", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1441-L1446
4,523
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js
function(oList) { if (oList._isTop()) { return oList; } if (!oList._oTopList) { oList._oTopList = getTopList(oList.getParent()); } return oList._oTopList; }
javascript
function(oList) { if (oList._isTop()) { return oList; } if (!oList._oTopList) { oList._oTopList = getTopList(oList.getParent()); } return oList._oTopList; }
[ "function", "(", "oList", ")", "{", "if", "(", "oList", ".", "_isTop", "(", ")", ")", "{", "return", "oList", ";", "}", "if", "(", "!", "oList", ".", "_oTopList", ")", "{", "oList", ".", "_oTopList", "=", "getTopList", "(", "oList", ".", "getParent", "(", ")", ")", ";", "}", "return", "oList", ".", "_oTopList", ";", "}" ]
Returns the top most list.
[ "Returns", "the", "top", "most", "list", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1450-L1458
4,524
SAP/openui5
src/sap.ui.core/src/sap/ui/thirdparty/blanket.js
parseWithStatement
function parseWithStatement() { var object, body; if (strict) { // TODO(ikarienator): Should we update the test cases instead? skipComment(); throwErrorTolerant({}, Messages.StrictModeWith); } expectKeyword('with'); expect('('); object = parseExpression(); expect(')'); body = parseStatement(); return delegate.createWithStatement(object, body); }
javascript
function parseWithStatement() { var object, body; if (strict) { // TODO(ikarienator): Should we update the test cases instead? skipComment(); throwErrorTolerant({}, Messages.StrictModeWith); } expectKeyword('with'); expect('('); object = parseExpression(); expect(')'); body = parseStatement(); return delegate.createWithStatement(object, body); }
[ "function", "parseWithStatement", "(", ")", "{", "var", "object", ",", "body", ";", "if", "(", "strict", ")", "{", "// TODO(ikarienator): Should we update the test cases instead?", "skipComment", "(", ")", ";", "throwErrorTolerant", "(", "{", "}", ",", "Messages", ".", "StrictModeWith", ")", ";", "}", "expectKeyword", "(", "'with'", ")", ";", "expect", "(", "'('", ")", ";", "object", "=", "parseExpression", "(", ")", ";", "expect", "(", "')'", ")", ";", "body", "=", "parseStatement", "(", ")", ";", "return", "delegate", ".", "createWithStatement", "(", "object", ",", "body", ")", ";", "}" ]
12.10 The with statement
[ "12", ".", "10", "The", "with", "statement" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/blanket.js#L3019-L3039
4,525
SAP/openui5
src/sap.ui.core/src/sap/ui/thirdparty/blanket.js
function(numSt, numCov, numBranch, numCovBr, moduleName) { var totalPercent = percentage(numCov, numSt); var statusClass = totalPercent < successRate ? "bl-error" : "bl-success"; var rowTitle = ( moduleName ? "Total for module: " + moduleName : "Global total" ); var totalsOutput = grandTotalTemplate.replace("{{rowTitle}}", rowTitle) .replace("{{percentage}}", totalPercent) .replace("{{numberCovered}}", numCov) .replace("{{totalSmts}}", numSt) .replace("{{passedBranches}}", numCovBr) .replace("{{totalBranches}}", numBranch) .replace("{{statusclass}}", statusClass); bodyContent += totalsOutput; }
javascript
function(numSt, numCov, numBranch, numCovBr, moduleName) { var totalPercent = percentage(numCov, numSt); var statusClass = totalPercent < successRate ? "bl-error" : "bl-success"; var rowTitle = ( moduleName ? "Total for module: " + moduleName : "Global total" ); var totalsOutput = grandTotalTemplate.replace("{{rowTitle}}", rowTitle) .replace("{{percentage}}", totalPercent) .replace("{{numberCovered}}", numCov) .replace("{{totalSmts}}", numSt) .replace("{{passedBranches}}", numCovBr) .replace("{{totalBranches}}", numBranch) .replace("{{statusclass}}", statusClass); bodyContent += totalsOutput; }
[ "function", "(", "numSt", ",", "numCov", ",", "numBranch", ",", "numCovBr", ",", "moduleName", ")", "{", "var", "totalPercent", "=", "percentage", "(", "numCov", ",", "numSt", ")", ";", "var", "statusClass", "=", "totalPercent", "<", "successRate", "?", "\"bl-error\"", ":", "\"bl-success\"", ";", "var", "rowTitle", "=", "(", "moduleName", "?", "\"Total for module: \"", "+", "moduleName", ":", "\"Global total\"", ")", ";", "var", "totalsOutput", "=", "grandTotalTemplate", ".", "replace", "(", "\"{{rowTitle}}\"", ",", "rowTitle", ")", ".", "replace", "(", "\"{{percentage}}\"", ",", "totalPercent", ")", ".", "replace", "(", "\"{{numberCovered}}\"", ",", "numCov", ")", ".", "replace", "(", "\"{{totalSmts}}\"", ",", "numSt", ")", ".", "replace", "(", "\"{{passedBranches}}\"", ",", "numCovBr", ")", ".", "replace", "(", "\"{{totalBranches}}\"", ",", "numBranch", ")", ".", "replace", "(", "\"{{statusclass}}\"", ",", "statusClass", ")", ";", "bodyContent", "+=", "totalsOutput", ";", "}" ]
create temporary function for use by the global totals reporter, as well as the per-module totals reporter
[ "create", "temporary", "function", "for", "use", "by", "the", "global", "totals", "reporter", "as", "well", "as", "the", "per", "-", "module", "totals", "reporter" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/blanket.js#L4765-L4779
4,526
SAP/openui5
src/sap.ui.fl/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js
function(sChangeType,mParameters,mTexts) { //parameter correspond to inline change format //exception: appdescr_app_setTitle, and similar Utils.checkTexts(mTexts); this._mParameters = {}; this._mParameters.changeType = sChangeType; this._mParameters.content = mParameters; this._mParameters.texts = mTexts; }
javascript
function(sChangeType,mParameters,mTexts) { //parameter correspond to inline change format //exception: appdescr_app_setTitle, and similar Utils.checkTexts(mTexts); this._mParameters = {}; this._mParameters.changeType = sChangeType; this._mParameters.content = mParameters; this._mParameters.texts = mTexts; }
[ "function", "(", "sChangeType", ",", "mParameters", ",", "mTexts", ")", "{", "//parameter correspond to inline change format", "//exception: appdescr_app_setTitle, and similar", "Utils", ".", "checkTexts", "(", "mTexts", ")", ";", "this", ".", "_mParameters", "=", "{", "}", ";", "this", ".", "_mParameters", ".", "changeType", "=", "sChangeType", ";", "this", ".", "_mParameters", ".", "content", "=", "mParameters", ";", "this", ".", "_mParameters", ".", "texts", "=", "mTexts", ";", "}" ]
Descriptor Inline Change @param {string} sChangeType change type @param {object} [mParameters] parameters of the inline change for the provided change type @param {object} [mTexts] texts for the inline change @constructor @alias sap.ui.fl.descriptorRelated.api.DescriptorInlineChange @author SAP SE @version ${version} @private @sap-restricted
[ "Descriptor", "Inline", "Change" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js#L23-L33
4,527
SAP/openui5
src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js
function () { this._initAndBindSelectedContentModel(); var oRouter = sap.ui.core.UIComponent.getRouterFor(this); oRouter.getRoute("ContentDetails").attachMatched(this._onRouteMatched, this); oRouter.getRoute("ContentDetailsFlip").attachMatched(this._onRouteMatched, this); }
javascript
function () { this._initAndBindSelectedContentModel(); var oRouter = sap.ui.core.UIComponent.getRouterFor(this); oRouter.getRoute("ContentDetails").attachMatched(this._onRouteMatched, this); oRouter.getRoute("ContentDetailsFlip").attachMatched(this._onRouteMatched, this); }
[ "function", "(", ")", "{", "this", ".", "_initAndBindSelectedContentModel", "(", ")", ";", "var", "oRouter", "=", "sap", ".", "ui", ".", "core", ".", "UIComponent", ".", "getRouterFor", "(", "this", ")", ";", "oRouter", ".", "getRoute", "(", "\"ContentDetails\"", ")", ".", "attachMatched", "(", "this", ".", "_onRouteMatched", ",", "this", ")", ";", "oRouter", ".", "getRoute", "(", "\"ContentDetailsFlip\"", ")", ".", "attachMatched", "(", "this", ".", "_onRouteMatched", ",", "this", ")", ";", "}" ]
Initialize function; Handles data binding and route matching. @public
[ "Initialize", "function", ";", "Handles", "data", "binding", "and", "route", "matching", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js#L41-L46
4,528
SAP/openui5
src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js
function (oModelData, oPage, oMetadata) { oModelData.metadata = oMetadata; this.oSelectedContentModel.setData(oModelData); var oCore = sap.ui.getCore(); var sIconTabBarId = this.getView().createId("contentDetailsIconTabBar"); var oIconTabBar = oCore.getElementById(sIconTabBarId); if (oIconTabBar){ var oFirstIconTabBarItem = oIconTabBar.getItems()[0]; if (oIconTabBar.getSelectedKey() !== oFirstIconTabBarItem.getId()) { oIconTabBar.setSelectedItem(oFirstIconTabBarItem); } } oPage.setBusy(false); }
javascript
function (oModelData, oPage, oMetadata) { oModelData.metadata = oMetadata; this.oSelectedContentModel.setData(oModelData); var oCore = sap.ui.getCore(); var sIconTabBarId = this.getView().createId("contentDetailsIconTabBar"); var oIconTabBar = oCore.getElementById(sIconTabBarId); if (oIconTabBar){ var oFirstIconTabBarItem = oIconTabBar.getItems()[0]; if (oIconTabBar.getSelectedKey() !== oFirstIconTabBarItem.getId()) { oIconTabBar.setSelectedItem(oFirstIconTabBarItem); } } oPage.setBusy(false); }
[ "function", "(", "oModelData", ",", "oPage", ",", "oMetadata", ")", "{", "oModelData", ".", "metadata", "=", "oMetadata", ";", "this", ".", "oSelectedContentModel", ".", "setData", "(", "oModelData", ")", ";", "var", "oCore", "=", "sap", ".", "ui", ".", "getCore", "(", ")", ";", "var", "sIconTabBarId", "=", "this", ".", "getView", "(", ")", ".", "createId", "(", "\"contentDetailsIconTabBar\"", ")", ";", "var", "oIconTabBar", "=", "oCore", ".", "getElementById", "(", "sIconTabBarId", ")", ";", "if", "(", "oIconTabBar", ")", "{", "var", "oFirstIconTabBarItem", "=", "oIconTabBar", ".", "getItems", "(", ")", "[", "0", "]", ";", "if", "(", "oIconTabBar", ".", "getSelectedKey", "(", ")", "!==", "oFirstIconTabBarItem", ".", "getId", "(", ")", ")", "{", "oIconTabBar", ".", "setSelectedItem", "(", "oFirstIconTabBarItem", ")", ";", "}", "}", "oPage", ".", "setBusy", "(", "false", ")", ";", "}" ]
Handler if content metadata was received; Sets the received data to the current content model, updates the icon tab bar, and releases the busy mode of the current page. @param {Object} oModelData - model data of current page @param {Object} oPage - current page used to set display busy mode on/off @param {Object} oMetadata - metadata which is received from <code>LRepConnector</code> "getContent" promise @private
[ "Handler", "if", "content", "metadata", "was", "received", ";", "Sets", "the", "received", "data", "to", "the", "current", "content", "model", "updates", "the", "icon", "tab", "bar", "and", "releases", "the", "busy", "mode", "of", "the", "current", "page", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js#L124-L137
4,529
SAP/openui5
src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js
function () { var oSelectedContentModel = this.getView().getModel("selectedContent"); var oContentData = oSelectedContentModel.getData(); var oRouter = sap.ui.core.UIComponent.getRouterFor(this); oRouter.navTo("ContentDetailsEdit", { "layer": oContentData.layer, "namespace": encodeURIComponent(oContentData.namespace), "fileName": oContentData.fileName, "fileType": oContentData.fileType }); }
javascript
function () { var oSelectedContentModel = this.getView().getModel("selectedContent"); var oContentData = oSelectedContentModel.getData(); var oRouter = sap.ui.core.UIComponent.getRouterFor(this); oRouter.navTo("ContentDetailsEdit", { "layer": oContentData.layer, "namespace": encodeURIComponent(oContentData.namespace), "fileName": oContentData.fileName, "fileType": oContentData.fileType }); }
[ "function", "(", ")", "{", "var", "oSelectedContentModel", "=", "this", ".", "getView", "(", ")", ".", "getModel", "(", "\"selectedContent\"", ")", ";", "var", "oContentData", "=", "oSelectedContentModel", ".", "getData", "(", ")", ";", "var", "oRouter", "=", "sap", ".", "ui", ".", "core", ".", "UIComponent", ".", "getRouterFor", "(", "this", ")", ";", "oRouter", ".", "navTo", "(", "\"ContentDetailsEdit\"", ",", "{", "\"layer\"", ":", "oContentData", ".", "layer", ",", "\"namespace\"", ":", "encodeURIComponent", "(", "oContentData", ".", "namespace", ")", ",", "\"fileName\"", ":", "oContentData", ".", "fileName", ",", "\"fileType\"", ":", "oContentData", ".", "fileType", "}", ")", ";", "}" ]
Navigates to Edit mode of content. @public
[ "Navigates", "to", "Edit", "mode", "of", "content", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js#L143-L154
4,530
SAP/openui5
src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js
function () { var that = this; var oDialog = new Dialog({ title: "{i18n>confirmDeletionTitle}", type: "Message", content: new Text({text: "{i18n>questionFileDeletion}"}), beginButton: new Button({ text: "{i18n>confirm}", type: ButtonType.Reject, press: function () { oDialog.close(); that._selectTransportAndDeleteFile(); } }), endButton: new Button({ text: "{i18n>cancel}", press: function () { oDialog.close(); } }), afterClose: function () { oDialog.destroy(); } }); this.getView().addDependent(oDialog); oDialog.open(); }
javascript
function () { var that = this; var oDialog = new Dialog({ title: "{i18n>confirmDeletionTitle}", type: "Message", content: new Text({text: "{i18n>questionFileDeletion}"}), beginButton: new Button({ text: "{i18n>confirm}", type: ButtonType.Reject, press: function () { oDialog.close(); that._selectTransportAndDeleteFile(); } }), endButton: new Button({ text: "{i18n>cancel}", press: function () { oDialog.close(); } }), afterClose: function () { oDialog.destroy(); } }); this.getView().addDependent(oDialog); oDialog.open(); }
[ "function", "(", ")", "{", "var", "that", "=", "this", ";", "var", "oDialog", "=", "new", "Dialog", "(", "{", "title", ":", "\"{i18n>confirmDeletionTitle}\"", ",", "type", ":", "\"Message\"", ",", "content", ":", "new", "Text", "(", "{", "text", ":", "\"{i18n>questionFileDeletion}\"", "}", ")", ",", "beginButton", ":", "new", "Button", "(", "{", "text", ":", "\"{i18n>confirm}\"", ",", "type", ":", "ButtonType", ".", "Reject", ",", "press", ":", "function", "(", ")", "{", "oDialog", ".", "close", "(", ")", ";", "that", ".", "_selectTransportAndDeleteFile", "(", ")", ";", "}", "}", ")", ",", "endButton", ":", "new", "Button", "(", "{", "text", ":", "\"{i18n>cancel}\"", ",", "press", ":", "function", "(", ")", "{", "oDialog", ".", "close", "(", ")", ";", "}", "}", ")", ",", "afterClose", ":", "function", "(", ")", "{", "oDialog", ".", "destroy", "(", ")", ";", "}", "}", ")", ";", "this", ".", "getView", "(", ")", ".", "addDependent", "(", "oDialog", ")", ";", "oDialog", ".", "open", "(", ")", ";", "}" ]
Handles the deletion button; The function displays a confirmation dialog. On confirmation, the deletion of the displayed content is triggered. @public
[ "Handles", "the", "deletion", "button", ";", "The", "function", "displays", "a", "confirmation", "dialog", ".", "On", "confirmation", "the", "deletion", "of", "the", "displayed", "content", "is", "triggered", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js#L161-L190
4,531
SAP/openui5
src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js
function (sLayer, sNamespace, sFileName, sFileType, sTransportId, sSelectedLayer) { return LRepConnector.deleteFile(sLayer, sNamespace, sFileName, sFileType, sTransportId, sSelectedLayer).then(function () { var oRouter = sap.ui.core.UIComponent.getRouterFor(this); oRouter.navTo("LayerContentMaster", { "layer": sSelectedLayer, "namespace": encodeURIComponent(sNamespace) }); }.bind(this)); }
javascript
function (sLayer, sNamespace, sFileName, sFileType, sTransportId, sSelectedLayer) { return LRepConnector.deleteFile(sLayer, sNamespace, sFileName, sFileType, sTransportId, sSelectedLayer).then(function () { var oRouter = sap.ui.core.UIComponent.getRouterFor(this); oRouter.navTo("LayerContentMaster", { "layer": sSelectedLayer, "namespace": encodeURIComponent(sNamespace) }); }.bind(this)); }
[ "function", "(", "sLayer", ",", "sNamespace", ",", "sFileName", ",", "sFileType", ",", "sTransportId", ",", "sSelectedLayer", ")", "{", "return", "LRepConnector", ".", "deleteFile", "(", "sLayer", ",", "sNamespace", ",", "sFileName", ",", "sFileType", ",", "sTransportId", ",", "sSelectedLayer", ")", ".", "then", "(", "function", "(", ")", "{", "var", "oRouter", "=", "sap", ".", "ui", ".", "core", ".", "UIComponent", ".", "getRouterFor", "(", "this", ")", ";", "oRouter", ".", "navTo", "(", "\"LayerContentMaster\"", ",", "{", "\"layer\"", ":", "sSelectedLayer", ",", "\"namespace\"", ":", "encodeURIComponent", "(", "sNamespace", ")", "}", ")", ";", "}", ".", "bind", "(", "this", ")", ")", ";", "}" ]
Handler if a deletion was confirmed. @returns {Promise} - <code>LRepConnector</code> "deleteFile" promise @private
[ "Handler", "if", "a", "deletion", "was", "confirmed", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js#L275-L283
4,532
SAP/openui5
src/sap.ui.core/src/sap/ui/events/F6Navigation.js
filterStaticAreaContent
function filterStaticAreaContent($Refs, aScopes) { var oStaticArea = window.document.getElementById("sap-ui-static"); if (!oStaticArea) { return $Refs; } var aScopesInStaticArea = []; for (var i = 0; i < aScopes.length; i++) { if (jQuery.contains(oStaticArea, aScopes[i])) { aScopesInStaticArea.push(aScopes[i]); } } return $Refs.filter(function() { if (aScopesInStaticArea.length && isContained(aScopesInStaticArea, this)) { return true; } return !jQuery.contains(oStaticArea, this); }); }
javascript
function filterStaticAreaContent($Refs, aScopes) { var oStaticArea = window.document.getElementById("sap-ui-static"); if (!oStaticArea) { return $Refs; } var aScopesInStaticArea = []; for (var i = 0; i < aScopes.length; i++) { if (jQuery.contains(oStaticArea, aScopes[i])) { aScopesInStaticArea.push(aScopes[i]); } } return $Refs.filter(function() { if (aScopesInStaticArea.length && isContained(aScopesInStaticArea, this)) { return true; } return !jQuery.contains(oStaticArea, this); }); }
[ "function", "filterStaticAreaContent", "(", "$Refs", ",", "aScopes", ")", "{", "var", "oStaticArea", "=", "window", ".", "document", ".", "getElementById", "(", "\"sap-ui-static\"", ")", ";", "if", "(", "!", "oStaticArea", ")", "{", "return", "$Refs", ";", "}", "var", "aScopesInStaticArea", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "aScopes", ".", "length", ";", "i", "++", ")", "{", "if", "(", "jQuery", ".", "contains", "(", "oStaticArea", ",", "aScopes", "[", "i", "]", ")", ")", "{", "aScopesInStaticArea", ".", "push", "(", "aScopes", "[", "i", "]", ")", ";", "}", "}", "return", "$Refs", ".", "filter", "(", "function", "(", ")", "{", "if", "(", "aScopesInStaticArea", ".", "length", "&&", "isContained", "(", "aScopesInStaticArea", ",", "this", ")", ")", "{", "return", "true", ";", "}", "return", "!", "jQuery", ".", "contains", "(", "oStaticArea", ",", "this", ")", ";", "}", ")", ";", "}" ]
Filters all elements in the given jQuery object which are in the static UIArea and which are not in the given scopes.
[ "Filters", "all", "elements", "in", "the", "given", "jQuery", "object", "which", "are", "in", "the", "static", "UIArea", "and", "which", "are", "not", "in", "the", "given", "scopes", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/events/F6Navigation.js#L92-L111
4,533
SAP/openui5
src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js
function (oModules, oResult) { var modules = oModules.modules, vDebugInfo = window["sap-ui-debug"]; // create tree with all modules and empty selection jQuery.each(modules, function (sName) { this.set(oResult, sName, false, true); }.bind(this)); // apply current debug info as tree selection if (vDebugInfo === true || vDebugInfo === 'x' || vDebugInfo === 'X') { this.set(oResult, '/', true); } else if (vDebugInfo && typeof vDebugInfo === 'string') { vDebugInfo.split(/,/).forEach(function (sPattern) { if (/\*/.test(sPattern)) { // if a glob pattern is found, select all modules that are matched by it var rFilter = new RegExp("^(?:" + this.makeRegExp(sPattern) + ")"); // collect namespaces var oNamespacesAndModules = {}; Object.keys(modules).forEach(function (sModule) { var sModulePath = sModule.split("/").slice(0, -1).join("/") + "/"; oNamespacesAndModules[sModulePath] = ""; }); // join namespaces and modules object for (var sKey in modules) { oNamespacesAndModules[sKey] = modules[sKey]; } jQuery.each(oNamespacesAndModules, function (sName) { if (rFilter.test(sName)) { this.set(oResult, sName, true); } }.bind(this)); } else { // for simple package / module names, just select the corresponding tree node this.set(oResult, sPattern, true); } }.bind(this)); } }
javascript
function (oModules, oResult) { var modules = oModules.modules, vDebugInfo = window["sap-ui-debug"]; // create tree with all modules and empty selection jQuery.each(modules, function (sName) { this.set(oResult, sName, false, true); }.bind(this)); // apply current debug info as tree selection if (vDebugInfo === true || vDebugInfo === 'x' || vDebugInfo === 'X') { this.set(oResult, '/', true); } else if (vDebugInfo && typeof vDebugInfo === 'string') { vDebugInfo.split(/,/).forEach(function (sPattern) { if (/\*/.test(sPattern)) { // if a glob pattern is found, select all modules that are matched by it var rFilter = new RegExp("^(?:" + this.makeRegExp(sPattern) + ")"); // collect namespaces var oNamespacesAndModules = {}; Object.keys(modules).forEach(function (sModule) { var sModulePath = sModule.split("/").slice(0, -1).join("/") + "/"; oNamespacesAndModules[sModulePath] = ""; }); // join namespaces and modules object for (var sKey in modules) { oNamespacesAndModules[sKey] = modules[sKey]; } jQuery.each(oNamespacesAndModules, function (sName) { if (rFilter.test(sName)) { this.set(oResult, sName, true); } }.bind(this)); } else { // for simple package / module names, just select the corresponding tree node this.set(oResult, sPattern, true); } }.bind(this)); } }
[ "function", "(", "oModules", ",", "oResult", ")", "{", "var", "modules", "=", "oModules", ".", "modules", ",", "vDebugInfo", "=", "window", "[", "\"sap-ui-debug\"", "]", ";", "// create tree with all modules and empty selection", "jQuery", ".", "each", "(", "modules", ",", "function", "(", "sName", ")", "{", "this", ".", "set", "(", "oResult", ",", "sName", ",", "false", ",", "true", ")", ";", "}", ".", "bind", "(", "this", ")", ")", ";", "// apply current debug info as tree selection", "if", "(", "vDebugInfo", "===", "true", "||", "vDebugInfo", "===", "'x'", "||", "vDebugInfo", "===", "'X'", ")", "{", "this", ".", "set", "(", "oResult", ",", "'/'", ",", "true", ")", ";", "}", "else", "if", "(", "vDebugInfo", "&&", "typeof", "vDebugInfo", "===", "'string'", ")", "{", "vDebugInfo", ".", "split", "(", "/", ",", "/", ")", ".", "forEach", "(", "function", "(", "sPattern", ")", "{", "if", "(", "/", "\\*", "/", ".", "test", "(", "sPattern", ")", ")", "{", "// if a glob pattern is found, select all modules that are matched by it", "var", "rFilter", "=", "new", "RegExp", "(", "\"^(?:\"", "+", "this", ".", "makeRegExp", "(", "sPattern", ")", "+", "\")\"", ")", ";", "// collect namespaces", "var", "oNamespacesAndModules", "=", "{", "}", ";", "Object", ".", "keys", "(", "modules", ")", ".", "forEach", "(", "function", "(", "sModule", ")", "{", "var", "sModulePath", "=", "sModule", ".", "split", "(", "\"/\"", ")", ".", "slice", "(", "0", ",", "-", "1", ")", ".", "join", "(", "\"/\"", ")", "+", "\"/\"", ";", "oNamespacesAndModules", "[", "sModulePath", "]", "=", "\"\"", ";", "}", ")", ";", "// join namespaces and modules object", "for", "(", "var", "sKey", "in", "modules", ")", "{", "oNamespacesAndModules", "[", "sKey", "]", "=", "modules", "[", "sKey", "]", ";", "}", "jQuery", ".", "each", "(", "oNamespacesAndModules", ",", "function", "(", "sName", ")", "{", "if", "(", "rFilter", ".", "test", "(", "sName", ")", ")", "{", "this", ".", "set", "(", "oResult", ",", "sName", ",", "true", ")", ";", "}", "}", ".", "bind", "(", "this", ")", ")", ";", "}", "else", "{", "// for simple package / module names, just select the corresponding tree node", "this", ".", "set", "(", "oResult", ",", "sPattern", ",", "true", ")", ";", "}", "}", ".", "bind", "(", "this", ")", ")", ";", "}", "}" ]
Converts a module object to a module hierarchy with selections state based on sap-ui-debug @param {object} oModules Flat object of modules @param {object} oResult Hierarchical tree of modules including selection state
[ "Converts", "a", "module", "object", "to", "a", "module", "hierarchy", "with", "selections", "state", "based", "on", "sap", "-", "ui", "-", "debug" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js#L73-L111
4,534
SAP/openui5
src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js
function (oModules) { var oHierarchy = {}, oTree = { text: "All" }, iSelectionDepth; this.modulesToHierarchy(oModules, oHierarchy); iSelectionDepth = this.setTreeNode(oHierarchy, oTree, 0, window["sap-ui-debug"] === true); if (!iSelectionDepth) { iSelectionDepth = 0; } return { tree: oTree, depth: iSelectionDepth }; }
javascript
function (oModules) { var oHierarchy = {}, oTree = { text: "All" }, iSelectionDepth; this.modulesToHierarchy(oModules, oHierarchy); iSelectionDepth = this.setTreeNode(oHierarchy, oTree, 0, window["sap-ui-debug"] === true); if (!iSelectionDepth) { iSelectionDepth = 0; } return { tree: oTree, depth: iSelectionDepth }; }
[ "function", "(", "oModules", ")", "{", "var", "oHierarchy", "=", "{", "}", ",", "oTree", "=", "{", "text", ":", "\"All\"", "}", ",", "iSelectionDepth", ";", "this", ".", "modulesToHierarchy", "(", "oModules", ",", "oHierarchy", ")", ";", "iSelectionDepth", "=", "this", ".", "setTreeNode", "(", "oHierarchy", ",", "oTree", ",", "0", ",", "window", "[", "\"sap-ui-debug\"", "]", "===", "true", ")", ";", "if", "(", "!", "iSelectionDepth", ")", "{", "iSelectionDepth", "=", "0", ";", "}", "return", "{", "tree", ":", "oTree", ",", "depth", ":", "iSelectionDepth", "}", ";", "}" ]
Converts a module hierarchy to a bindable tree model structure The returning object contains the tree structure and depth of the deepest selected node @param {object} oModules Flat object of modules @return {{tree: {text: string}, depth: number}} The resulting tree and the depth
[ "Converts", "a", "module", "hierarchy", "to", "a", "bindable", "tree", "model", "structure", "The", "returning", "object", "contains", "the", "tree", "structure", "and", "depth", "of", "the", "deepest", "selected", "node" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js#L119-L137
4,535
SAP/openui5
src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js
function (oHierarchy, oTree, iDepth, bSelected) { var iSelectionDepth, iInnerSelectionDepth; bSelected = oHierarchy === true || oHierarchy[""] || bSelected; oTree.nodes = []; oTree.selected = bSelected; if (bSelected) { iSelectionDepth = iDepth; } for (var sProperty in oHierarchy) { if (sProperty === "") { continue; } var oChildNode = { text: sProperty }; iInnerSelectionDepth = this.setTreeNode(oHierarchy[sProperty], oChildNode, iDepth + 1, bSelected); if (iInnerSelectionDepth > iSelectionDepth || !iSelectionDepth) { iSelectionDepth = iInnerSelectionDepth; } oTree.nodes.push(oChildNode); } return iSelectionDepth; }
javascript
function (oHierarchy, oTree, iDepth, bSelected) { var iSelectionDepth, iInnerSelectionDepth; bSelected = oHierarchy === true || oHierarchy[""] || bSelected; oTree.nodes = []; oTree.selected = bSelected; if (bSelected) { iSelectionDepth = iDepth; } for (var sProperty in oHierarchy) { if (sProperty === "") { continue; } var oChildNode = { text: sProperty }; iInnerSelectionDepth = this.setTreeNode(oHierarchy[sProperty], oChildNode, iDepth + 1, bSelected); if (iInnerSelectionDepth > iSelectionDepth || !iSelectionDepth) { iSelectionDepth = iInnerSelectionDepth; } oTree.nodes.push(oChildNode); } return iSelectionDepth; }
[ "function", "(", "oHierarchy", ",", "oTree", ",", "iDepth", ",", "bSelected", ")", "{", "var", "iSelectionDepth", ",", "iInnerSelectionDepth", ";", "bSelected", "=", "oHierarchy", "===", "true", "||", "oHierarchy", "[", "\"\"", "]", "||", "bSelected", ";", "oTree", ".", "nodes", "=", "[", "]", ";", "oTree", ".", "selected", "=", "bSelected", ";", "if", "(", "bSelected", ")", "{", "iSelectionDepth", "=", "iDepth", ";", "}", "for", "(", "var", "sProperty", "in", "oHierarchy", ")", "{", "if", "(", "sProperty", "===", "\"\"", ")", "{", "continue", ";", "}", "var", "oChildNode", "=", "{", "text", ":", "sProperty", "}", ";", "iInnerSelectionDepth", "=", "this", ".", "setTreeNode", "(", "oHierarchy", "[", "sProperty", "]", ",", "oChildNode", ",", "iDepth", "+", "1", ",", "bSelected", ")", ";", "if", "(", "iInnerSelectionDepth", ">", "iSelectionDepth", "||", "!", "iSelectionDepth", ")", "{", "iSelectionDepth", "=", "iInnerSelectionDepth", ";", "}", "oTree", ".", "nodes", ".", "push", "(", "oChildNode", ")", ";", "}", "return", "iSelectionDepth", ";", "}" ]
Recursively constructs tree nodes in a format that it can be bound to a sap.m.Tree control @param {object} oHierarchy The module hierarchy node with selected state @param {object} oTree The tree node to be filled with the hierarchy information @param {int} iDepth The current depth of the recursion @param {boolean} bSelected The selected state of the parent node @return {int} The depth of the deepest node in the tree
[ "Recursively", "constructs", "tree", "nodes", "in", "a", "format", "that", "it", "can", "be", "bound", "to", "a", "sap", ".", "m", ".", "Tree", "control" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js#L147-L174
4,536
SAP/openui5
src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js
function (oTree) { var oResult = {}; oTree.selected = this.isNodeSelected(oTree); this.setHierarchyNode(oResult, oTree); return oResult; }
javascript
function (oTree) { var oResult = {}; oTree.selected = this.isNodeSelected(oTree); this.setHierarchyNode(oResult, oTree); return oResult; }
[ "function", "(", "oTree", ")", "{", "var", "oResult", "=", "{", "}", ";", "oTree", ".", "selected", "=", "this", ".", "isNodeSelected", "(", "oTree", ")", ";", "this", ".", "setHierarchyNode", "(", "oResult", ",", "oTree", ")", ";", "return", "oResult", ";", "}" ]
Converts a bindable tree back to the module hierarchy structure @param {object} oTree The tree to be converted @return {object} The module hierarchy with the current selection state of the UI
[ "Converts", "a", "bindable", "tree", "back", "to", "the", "module", "hierarchy", "structure" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js#L181-L186
4,537
SAP/openui5
src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js
function (oNode) { var iSelectedNodesCount = 0, oChildNode; for (var i = 0; i < oNode.nodes.length; i++) { oChildNode = oNode.nodes[i]; if (oChildNode.nodes.length) { oChildNode.selected = this.isNodeSelected(oChildNode); } if (oChildNode.selected) { iSelectedNodesCount++; } } return iSelectedNodesCount === oNode.nodes.length; }
javascript
function (oNode) { var iSelectedNodesCount = 0, oChildNode; for (var i = 0; i < oNode.nodes.length; i++) { oChildNode = oNode.nodes[i]; if (oChildNode.nodes.length) { oChildNode.selected = this.isNodeSelected(oChildNode); } if (oChildNode.selected) { iSelectedNodesCount++; } } return iSelectedNodesCount === oNode.nodes.length; }
[ "function", "(", "oNode", ")", "{", "var", "iSelectedNodesCount", "=", "0", ",", "oChildNode", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "oNode", ".", "nodes", ".", "length", ";", "i", "++", ")", "{", "oChildNode", "=", "oNode", ".", "nodes", "[", "i", "]", ";", "if", "(", "oChildNode", ".", "nodes", ".", "length", ")", "{", "oChildNode", ".", "selected", "=", "this", ".", "isNodeSelected", "(", "oChildNode", ")", ";", "}", "if", "(", "oChildNode", ".", "selected", ")", "{", "iSelectedNodesCount", "++", ";", "}", "}", "return", "iSelectedNodesCount", "===", "oNode", ".", "nodes", ".", "length", ";", "}" ]
Checks and update the tree model based on selected child nodes. @param oNode The tree to be updated @returns {boolean} The selected of the node.
[ "Checks", "and", "update", "the", "tree", "model", "based", "on", "selected", "child", "nodes", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js#L193-L208
4,538
SAP/openui5
src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js
function (oHierarchy, oTree) { if (oTree.selected) { oHierarchy[""] = true; } for (var i = 0; i < oTree.nodes.length; i++) { oHierarchy[oTree.nodes[i].text] = {}; if (oTree.nodes[i].nodes.length) { this.setHierarchyNode(oHierarchy[oTree.nodes[i].text], oTree.nodes[i]); } else { oHierarchy[oTree.nodes[i].text] = oTree.nodes[i].selected; } } }
javascript
function (oHierarchy, oTree) { if (oTree.selected) { oHierarchy[""] = true; } for (var i = 0; i < oTree.nodes.length; i++) { oHierarchy[oTree.nodes[i].text] = {}; if (oTree.nodes[i].nodes.length) { this.setHierarchyNode(oHierarchy[oTree.nodes[i].text], oTree.nodes[i]); } else { oHierarchy[oTree.nodes[i].text] = oTree.nodes[i].selected; } } }
[ "function", "(", "oHierarchy", ",", "oTree", ")", "{", "if", "(", "oTree", ".", "selected", ")", "{", "oHierarchy", "[", "\"\"", "]", "=", "true", ";", "}", "for", "(", "var", "i", "=", "0", ";", "i", "<", "oTree", ".", "nodes", ".", "length", ";", "i", "++", ")", "{", "oHierarchy", "[", "oTree", ".", "nodes", "[", "i", "]", ".", "text", "]", "=", "{", "}", ";", "if", "(", "oTree", ".", "nodes", "[", "i", "]", ".", "nodes", ".", "length", ")", "{", "this", ".", "setHierarchyNode", "(", "oHierarchy", "[", "oTree", ".", "nodes", "[", "i", "]", ".", "text", "]", ",", "oTree", ".", "nodes", "[", "i", "]", ")", ";", "}", "else", "{", "oHierarchy", "[", "oTree", ".", "nodes", "[", "i", "]", ".", "text", "]", "=", "oTree", ".", "nodes", "[", "i", "]", ".", "selected", ";", "}", "}", "}" ]
Recursively converts a bindable tree node to a hierarchical model tree node @param {object} oHierarchy The module hierarchy node with selected state @param {object} oTree The tree node to be filled with the hierarchy information
[ "Recursively", "converts", "a", "bindable", "tree", "node", "to", "a", "hierarchical", "model", "tree", "node" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js#L214-L227
4,539
SAP/openui5
src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js
function (oTree, sSeparator) { var oObject = this.toHierarchy(oTree), aFilters = []; function collect(sName, oObject) { var aChildren, bChildren; if (typeof oObject === 'object') { if (oObject['']) { aFilters.push(sName + '/'); return; } aChildren = Object.keys(oObject); bChildren = aChildren.length; } if (bChildren) { aChildren.forEach(function (sChild) { if (sChild === '') { return; } if (oObject[sChild] === true) { aFilters.push((sName ? sName + '/' : '') + sChild); } else if (typeof oObject[sChild] === 'object') { collect((sName ? sName + '/' : '') + sChild, oObject[sChild]); } }); } } if (this.get(oObject, '/')) { return true; } collect('', oObject); return (aFilters.length > 0 ? aFilters.join(sSeparator || ',') : false); }
javascript
function (oTree, sSeparator) { var oObject = this.toHierarchy(oTree), aFilters = []; function collect(sName, oObject) { var aChildren, bChildren; if (typeof oObject === 'object') { if (oObject['']) { aFilters.push(sName + '/'); return; } aChildren = Object.keys(oObject); bChildren = aChildren.length; } if (bChildren) { aChildren.forEach(function (sChild) { if (sChild === '') { return; } if (oObject[sChild] === true) { aFilters.push((sName ? sName + '/' : '') + sChild); } else if (typeof oObject[sChild] === 'object') { collect((sName ? sName + '/' : '') + sChild, oObject[sChild]); } }); } } if (this.get(oObject, '/')) { return true; } collect('', oObject); return (aFilters.length > 0 ? aFilters.join(sSeparator || ',') : false); }
[ "function", "(", "oTree", ",", "sSeparator", ")", "{", "var", "oObject", "=", "this", ".", "toHierarchy", "(", "oTree", ")", ",", "aFilters", "=", "[", "]", ";", "function", "collect", "(", "sName", ",", "oObject", ")", "{", "var", "aChildren", ",", "bChildren", ";", "if", "(", "typeof", "oObject", "===", "'object'", ")", "{", "if", "(", "oObject", "[", "''", "]", ")", "{", "aFilters", ".", "push", "(", "sName", "+", "'/'", ")", ";", "return", ";", "}", "aChildren", "=", "Object", ".", "keys", "(", "oObject", ")", ";", "bChildren", "=", "aChildren", ".", "length", ";", "}", "if", "(", "bChildren", ")", "{", "aChildren", ".", "forEach", "(", "function", "(", "sChild", ")", "{", "if", "(", "sChild", "===", "''", ")", "{", "return", ";", "}", "if", "(", "oObject", "[", "sChild", "]", "===", "true", ")", "{", "aFilters", ".", "push", "(", "(", "sName", "?", "sName", "+", "'/'", ":", "''", ")", "+", "sChild", ")", ";", "}", "else", "if", "(", "typeof", "oObject", "[", "sChild", "]", "===", "'object'", ")", "{", "collect", "(", "(", "sName", "?", "sName", "+", "'/'", ":", "''", ")", "+", "sChild", ",", "oObject", "[", "sChild", "]", ")", ";", "}", "}", ")", ";", "}", "}", "if", "(", "this", ".", "get", "(", "oObject", ",", "'/'", ")", ")", "{", "return", "true", ";", "}", "collect", "(", "''", ",", "oObject", ")", ";", "return", "(", "aFilters", ".", "length", ">", "0", "?", "aFilters", ".", "join", "(", "sSeparator", "||", "','", ")", ":", "false", ")", ";", "}" ]
Converts a bindable tree structure to a valid value for sap-ui-debug @param {object} oTree The tree to be converted @param {string} sSeparator=, A separator character, default is a comma @return {string} The tree selection represented as string
[ "Converts", "a", "bindable", "tree", "structure", "to", "a", "valid", "value", "for", "sap", "-", "ui", "-", "debug" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js#L235-L270
4,540
SAP/openui5
src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js
function (oTree) { var sDebugString = this.toDebugInfo(oTree); if (sDebugString === true) { return 1; } else if (sDebugString) { return sDebugString.split(",").length; } return 0; }
javascript
function (oTree) { var sDebugString = this.toDebugInfo(oTree); if (sDebugString === true) { return 1; } else if (sDebugString) { return sDebugString.split(",").length; } return 0; }
[ "function", "(", "oTree", ")", "{", "var", "sDebugString", "=", "this", ".", "toDebugInfo", "(", "oTree", ")", ";", "if", "(", "sDebugString", "===", "true", ")", "{", "return", "1", ";", "}", "else", "if", "(", "sDebugString", ")", "{", "return", "sDebugString", ".", "split", "(", "\",\"", ")", ".", "length", ";", "}", "return", "0", ";", "}" ]
Calculates the number of currently selected debug modules @param {object} oTree The tree to be analyzed @return {int} The amount of selected tree nodes
[ "Calculates", "the", "number", "of", "currently", "selected", "debug", "modules" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js#L298-L307
4,541
SAP/openui5
src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js
function (oTree, bSelected) { oTree.selected = bSelected; for (var i = 0; i < oTree.nodes.length; i++) { this.recursiveSelect(oTree.nodes[i], bSelected); } }
javascript
function (oTree, bSelected) { oTree.selected = bSelected; for (var i = 0; i < oTree.nodes.length; i++) { this.recursiveSelect(oTree.nodes[i], bSelected); } }
[ "function", "(", "oTree", ",", "bSelected", ")", "{", "oTree", ".", "selected", "=", "bSelected", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "oTree", ".", "nodes", ".", "length", ";", "i", "++", ")", "{", "this", ".", "recursiveSelect", "(", "oTree", ".", "nodes", "[", "i", "]", ",", "bSelected", ")", ";", "}", "}" ]
Recursively selected or deselects a branch of the tree @param {object} oTree The tree to be selected @param {boolean} bSelected Whether the branch should be selected or not
[ "Recursively", "selected", "or", "deselects", "a", "branch", "of", "the", "tree" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/moduleTreeHelper.js#L314-L319
4,542
SAP/openui5
src/sap.ui.commons/src/sap/ui/commons/layout/PositionContainer.js
function(oThis, sChangeType) { var oLayout = oThis.getParent(); if (oLayout) { oLayout.contentChanged(oThis, sChangeType); } }
javascript
function(oThis, sChangeType) { var oLayout = oThis.getParent(); if (oLayout) { oLayout.contentChanged(oThis, sChangeType); } }
[ "function", "(", "oThis", ",", "sChangeType", ")", "{", "var", "oLayout", "=", "oThis", ".", "getParent", "(", ")", ";", "if", "(", "oLayout", ")", "{", "oLayout", ".", "contentChanged", "(", "oThis", ",", "sChangeType", ")", ";", "}", "}" ]
Notifies the layout of this container about the change of the given type. @private
[ "Notifies", "the", "layout", "of", "this", "container", "about", "the", "change", "of", "the", "given", "type", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/layout/PositionContainer.js#L349-L354
4,543
SAP/openui5
src/sap.ui.commons/src/sap/ui/commons/layout/PositionContainer.js
function(oControl, sPropertyName) { var oPropertyInfo = oControl.getMetadata().getProperty(sPropertyName); if (oPropertyInfo && oPropertyInfo.type === 'sap.ui.core.CSSSize') { return oPropertyInfo; } return null; }
javascript
function(oControl, sPropertyName) { var oPropertyInfo = oControl.getMetadata().getProperty(sPropertyName); if (oPropertyInfo && oPropertyInfo.type === 'sap.ui.core.CSSSize') { return oPropertyInfo; } return null; }
[ "function", "(", "oControl", ",", "sPropertyName", ")", "{", "var", "oPropertyInfo", "=", "oControl", ".", "getMetadata", "(", ")", ".", "getProperty", "(", "sPropertyName", ")", ";", "if", "(", "oPropertyInfo", "&&", "oPropertyInfo", ".", "type", "===", "'sap.ui.core.CSSSize'", ")", "{", "return", "oPropertyInfo", ";", "}", "return", "null", ";", "}" ]
Checks whether the given control has a property with the given name and type 'sap.ui.core.CSSSize' and returns the corresponding metadata object. @private
[ "Checks", "whether", "the", "given", "control", "has", "a", "property", "with", "the", "given", "name", "and", "type", "sap", ".", "ui", ".", "core", ".", "CSSSize", "and", "returns", "the", "corresponding", "metadata", "object", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/layout/PositionContainer.js#L405-L411
4,544
SAP/openui5
src/sap.ui.commons/src/sap/ui/commons/layout/PositionContainer.js
function(oEvent){ var sProp = oEvent.getParameter("name"); var parent = this.getParent(); if ((sProp === "width" || sProp === "height") && parent && parent.getDomRef()) { notifyLayoutOnChange(this, "CTRL_POS"); } }
javascript
function(oEvent){ var sProp = oEvent.getParameter("name"); var parent = this.getParent(); if ((sProp === "width" || sProp === "height") && parent && parent.getDomRef()) { notifyLayoutOnChange(this, "CTRL_POS"); } }
[ "function", "(", "oEvent", ")", "{", "var", "sProp", "=", "oEvent", ".", "getParameter", "(", "\"name\"", ")", ";", "var", "parent", "=", "this", ".", "getParent", "(", ")", ";", "if", "(", "(", "sProp", "===", "\"width\"", "||", "sProp", "===", "\"height\"", ")", "&&", "parent", "&&", "parent", ".", "getDomRef", "(", ")", ")", "{", "notifyLayoutOnChange", "(", "this", ",", "\"CTRL_POS\"", ")", ";", "}", "}" ]
Handler on child control to check for property changes on width or height attribute. @private
[ "Handler", "on", "child", "control", "to", "check", "for", "property", "changes", "on", "width", "or", "height", "attribute", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/layout/PositionContainer.js#L437-L444
4,545
SAP/openui5
src/sap.ui.core/src/sap/ui/core/routing/Route.js
function () { EventProvider.prototype.destroy.apply(this); this._aPattern = null; this._aRoutes = null; this._oParent = null; this._oConfig = null; this.bIsDestroyed = true; return this; }
javascript
function () { EventProvider.prototype.destroy.apply(this); this._aPattern = null; this._aRoutes = null; this._oParent = null; this._oConfig = null; this.bIsDestroyed = true; return this; }
[ "function", "(", ")", "{", "EventProvider", ".", "prototype", ".", "destroy", ".", "apply", "(", "this", ")", ";", "this", ".", "_aPattern", "=", "null", ";", "this", ".", "_aRoutes", "=", "null", ";", "this", ".", "_oParent", "=", "null", ";", "this", ".", "_oConfig", "=", "null", ";", "this", ".", "bIsDestroyed", "=", "true", ";", "return", "this", ";", "}" ]
Destroys a route @public @returns { sap.ui.core.routing.Route } this for chaining.
[ "Destroys", "a", "route" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/Route.js#L179-L190
4,546
SAP/openui5
src/sap.ui.core/src/sap/ui/core/IconPool.js
getInfo
function getInfo() { var collection = mRegistry[collectionName]; var info = collection && collection[iconName]; // convert raw data lazily to the icon info if (typeof info === 'number') { mRegistry[collectionName][iconName] = undefined; // avoid duplicate icon warning info = IconPool.addIcon(iconName, collectionName, { fontFamily: mFontRegistry[collectionName].config.fontFamily, content: info & 0xFFFF, suppressMirroring: !!(info & 0x10000), resourceBundle: getCoreResourceBundle() }); } return info; }
javascript
function getInfo() { var collection = mRegistry[collectionName]; var info = collection && collection[iconName]; // convert raw data lazily to the icon info if (typeof info === 'number') { mRegistry[collectionName][iconName] = undefined; // avoid duplicate icon warning info = IconPool.addIcon(iconName, collectionName, { fontFamily: mFontRegistry[collectionName].config.fontFamily, content: info & 0xFFFF, suppressMirroring: !!(info & 0x10000), resourceBundle: getCoreResourceBundle() }); } return info; }
[ "function", "getInfo", "(", ")", "{", "var", "collection", "=", "mRegistry", "[", "collectionName", "]", ";", "var", "info", "=", "collection", "&&", "collection", "[", "iconName", "]", ";", "// convert raw data lazily to the icon info", "if", "(", "typeof", "info", "===", "'number'", ")", "{", "mRegistry", "[", "collectionName", "]", "[", "iconName", "]", "=", "undefined", ";", "// avoid duplicate icon warning", "info", "=", "IconPool", ".", "addIcon", "(", "iconName", ",", "collectionName", ",", "{", "fontFamily", ":", "mFontRegistry", "[", "collectionName", "]", ".", "config", ".", "fontFamily", ",", "content", ":", "info", "&", "0xFFFF", ",", "suppressMirroring", ":", "!", "!", "(", "info", "&", "0x10000", ")", ",", "resourceBundle", ":", "getCoreResourceBundle", "(", ")", "}", ")", ";", "}", "return", "info", ";", "}" ]
retrieves the icon info from the internal registry
[ "retrieves", "the", "icon", "info", "from", "the", "internal", "registry" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/IconPool.js#L931-L947
4,547
SAP/openui5
src/sap.ui.core/src/sap/ui/core/IconPool.js
loadFont
function loadFont(oFontMetadata) { for (var sKey in oFontMetadata) { oFontMetadata[sKey] = parseInt(oFontMetadata[sKey], 16); } mRegistry[collectionName] = oFontMetadata; IconPool.insertFontFaceStyle(oConfig.fontFamily, oConfig.fontURI, collectionName); mFontRegistry[collectionName].metadataLoaded = true; }
javascript
function loadFont(oFontMetadata) { for (var sKey in oFontMetadata) { oFontMetadata[sKey] = parseInt(oFontMetadata[sKey], 16); } mRegistry[collectionName] = oFontMetadata; IconPool.insertFontFaceStyle(oConfig.fontFamily, oConfig.fontURI, collectionName); mFontRegistry[collectionName].metadataLoaded = true; }
[ "function", "loadFont", "(", "oFontMetadata", ")", "{", "for", "(", "var", "sKey", "in", "oFontMetadata", ")", "{", "oFontMetadata", "[", "sKey", "]", "=", "parseInt", "(", "oFontMetadata", "[", "sKey", "]", ",", "16", ")", ";", "}", "mRegistry", "[", "collectionName", "]", "=", "oFontMetadata", ";", "IconPool", ".", "insertFontFaceStyle", "(", "oConfig", ".", "fontFamily", ",", "oConfig", ".", "fontURI", ",", "collectionName", ")", ";", "mFontRegistry", "[", "collectionName", "]", ".", "metadataLoaded", "=", "true", ";", "}" ]
add icons to registry and insert the font style
[ "add", "icons", "to", "registry", "and", "insert", "the", "font", "style" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/IconPool.js#L1227-L1234
4,548
SAP/openui5
src/sap.ui.commons/src/sap/ui/commons/Toolbar.js
function (aNavigableItems) { // Initialize the ItemNavigation if required if (!this.oItemNavigation) { this.oItemNavigation = new ItemNavigation(); this.addDelegate(this.oItemNavigation); } this.oItemNavigation.setRootDomRef(ToolbarRenderer.getPopupArea(this.oToolbar)); this.oItemNavigation.setItemDomRefs(aNavigableItems); this.oItemNavigation.focusItem(0); }
javascript
function (aNavigableItems) { // Initialize the ItemNavigation if required if (!this.oItemNavigation) { this.oItemNavigation = new ItemNavigation(); this.addDelegate(this.oItemNavigation); } this.oItemNavigation.setRootDomRef(ToolbarRenderer.getPopupArea(this.oToolbar)); this.oItemNavigation.setItemDomRefs(aNavigableItems); this.oItemNavigation.focusItem(0); }
[ "function", "(", "aNavigableItems", ")", "{", "// Initialize the ItemNavigation if required", "if", "(", "!", "this", ".", "oItemNavigation", ")", "{", "this", ".", "oItemNavigation", "=", "new", "ItemNavigation", "(", ")", ";", "this", ".", "addDelegate", "(", "this", ".", "oItemNavigation", ")", ";", "}", "this", ".", "oItemNavigation", ".", "setRootDomRef", "(", "ToolbarRenderer", ".", "getPopupArea", "(", "this", ".", "oToolbar", ")", ")", ";", "this", ".", "oItemNavigation", ".", "setItemDomRefs", "(", "aNavigableItems", ")", ";", "this", ".", "oItemNavigation", ".", "focusItem", "(", "0", ")", ";", "}" ]
Initializes the ItemNavigation for this popup and focuses the first item @param aNavigableItems The DOM references of the toolbar items displayed in this popup @private
[ "Initializes", "the", "ItemNavigation", "for", "this", "popup", "and", "focuses", "the", "first", "item" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/Toolbar.js#L817-L827
4,549
SAP/openui5
src/sap.uxap/src/sap/uxap/component/ObjectPageLayoutUXDrivenFactory.controller.js
function (oModel) { var bHasPendingRequest = jQueryDOM.isEmptyObject(oModel.getData()); //ensure a 1 way binding otherwise it cause any block property change to update the entire subSections oModel.setDefaultBindingMode(BindingMode.OneWay); var fnHeaderFactory = jQueryDOM.proxy(function () { if (bHasPendingRequest) { oModel.detachRequestCompleted(fnHeaderFactory); } var oHeaderTitleContext = new Context(oModel, "/headerTitle"), oObjectPageLayout = this.getView().byId("ObjectPageLayout"); //create the header title if provided in the config if (oHeaderTitleContext.getProperty("")) { try { //retrieve the header class this._oHeader = this.controlFactory(oObjectPageLayout.getId(), oHeaderTitleContext); oObjectPageLayout.setHeaderTitle(this._oHeader); } catch (sError) { Log.error("ObjectPageLayoutFactory :: error in header creation from config: " + sError); } } }, this); //if data are not there yet, we wait for them if (bHasPendingRequest) { oModel.attachRequestCompleted(fnHeaderFactory); } else { //otherwise we apply the header factory immediately fnHeaderFactory(); } }
javascript
function (oModel) { var bHasPendingRequest = jQueryDOM.isEmptyObject(oModel.getData()); //ensure a 1 way binding otherwise it cause any block property change to update the entire subSections oModel.setDefaultBindingMode(BindingMode.OneWay); var fnHeaderFactory = jQueryDOM.proxy(function () { if (bHasPendingRequest) { oModel.detachRequestCompleted(fnHeaderFactory); } var oHeaderTitleContext = new Context(oModel, "/headerTitle"), oObjectPageLayout = this.getView().byId("ObjectPageLayout"); //create the header title if provided in the config if (oHeaderTitleContext.getProperty("")) { try { //retrieve the header class this._oHeader = this.controlFactory(oObjectPageLayout.getId(), oHeaderTitleContext); oObjectPageLayout.setHeaderTitle(this._oHeader); } catch (sError) { Log.error("ObjectPageLayoutFactory :: error in header creation from config: " + sError); } } }, this); //if data are not there yet, we wait for them if (bHasPendingRequest) { oModel.attachRequestCompleted(fnHeaderFactory); } else { //otherwise we apply the header factory immediately fnHeaderFactory(); } }
[ "function", "(", "oModel", ")", "{", "var", "bHasPendingRequest", "=", "jQueryDOM", ".", "isEmptyObject", "(", "oModel", ".", "getData", "(", ")", ")", ";", "//ensure a 1 way binding otherwise it cause any block property change to update the entire subSections", "oModel", ".", "setDefaultBindingMode", "(", "BindingMode", ".", "OneWay", ")", ";", "var", "fnHeaderFactory", "=", "jQueryDOM", ".", "proxy", "(", "function", "(", ")", "{", "if", "(", "bHasPendingRequest", ")", "{", "oModel", ".", "detachRequestCompleted", "(", "fnHeaderFactory", ")", ";", "}", "var", "oHeaderTitleContext", "=", "new", "Context", "(", "oModel", ",", "\"/headerTitle\"", ")", ",", "oObjectPageLayout", "=", "this", ".", "getView", "(", ")", ".", "byId", "(", "\"ObjectPageLayout\"", ")", ";", "//create the header title if provided in the config", "if", "(", "oHeaderTitleContext", ".", "getProperty", "(", "\"\"", ")", ")", "{", "try", "{", "//retrieve the header class", "this", ".", "_oHeader", "=", "this", ".", "controlFactory", "(", "oObjectPageLayout", ".", "getId", "(", ")", ",", "oHeaderTitleContext", ")", ";", "oObjectPageLayout", ".", "setHeaderTitle", "(", "this", ".", "_oHeader", ")", ";", "}", "catch", "(", "sError", ")", "{", "Log", ".", "error", "(", "\"ObjectPageLayoutFactory :: error in header creation from config: \"", "+", "sError", ")", ";", "}", "}", "}", ",", "this", ")", ";", "//if data are not there yet, we wait for them", "if", "(", "bHasPendingRequest", ")", "{", "oModel", ".", "attachRequestCompleted", "(", "fnHeaderFactory", ")", ";", "}", "else", "{", "//otherwise we apply the header factory immediately", "fnHeaderFactory", "(", ")", ";", "}", "}" ]
injects the header based on configuration @param {object} oModel model instanse
[ "injects", "the", "header", "based", "on", "configuration" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.uxap/src/sap/uxap/component/ObjectPageLayoutUXDrivenFactory.controller.js#L32-L67
4,550
SAP/openui5
src/sap.uxap/src/sap/uxap/component/ObjectPageLayoutUXDrivenFactory.controller.js
function (sStaticHandlerName) { var fnNameSpace = window, aNameSpaceParts = sStaticHandlerName.split('.'); try { jQueryDOM.each(aNameSpaceParts, function (iIndex, sNameSpacePart) { fnNameSpace = fnNameSpace[sNameSpacePart]; }); } catch (sError) { Log.error("ObjectPageLayoutFactory :: undefined event handler: " + sStaticHandlerName + ". Did you forget to require its static class?"); fnNameSpace = undefined; } return fnNameSpace; }
javascript
function (sStaticHandlerName) { var fnNameSpace = window, aNameSpaceParts = sStaticHandlerName.split('.'); try { jQueryDOM.each(aNameSpaceParts, function (iIndex, sNameSpacePart) { fnNameSpace = fnNameSpace[sNameSpacePart]; }); } catch (sError) { Log.error("ObjectPageLayoutFactory :: undefined event handler: " + sStaticHandlerName + ". Did you forget to require its static class?"); fnNameSpace = undefined; } return fnNameSpace; }
[ "function", "(", "sStaticHandlerName", ")", "{", "var", "fnNameSpace", "=", "window", ",", "aNameSpaceParts", "=", "sStaticHandlerName", ".", "split", "(", "'.'", ")", ";", "try", "{", "jQueryDOM", ".", "each", "(", "aNameSpaceParts", ",", "function", "(", "iIndex", ",", "sNameSpacePart", ")", "{", "fnNameSpace", "=", "fnNameSpace", "[", "sNameSpacePart", "]", ";", "}", ")", ";", "}", "catch", "(", "sError", ")", "{", "Log", ".", "error", "(", "\"ObjectPageLayoutFactory :: undefined event handler: \"", "+", "sStaticHandlerName", "+", "\". Did you forget to require its static class?\"", ")", ";", "fnNameSpace", "=", "undefined", ";", "}", "return", "fnNameSpace", ";", "}" ]
determine the static function to use from its name @param {string} sStaticHandlerName the name of the handler @returns {*|window|window} function
[ "determine", "the", "static", "function", "to", "use", "from", "its", "name" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.uxap/src/sap/uxap/component/ObjectPageLayoutUXDrivenFactory.controller.js#L112-L126
4,551
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_V2Requestor.js
addSelects
function addSelects(vSelects, sExpandPath) { if (!Array.isArray(vSelects)) { vSelects = vSelects.split(","); } vSelects.forEach(function (sSelect) { var iIndex = sSelect.indexOf("/"); if (iIndex >= 0 && sSelect.indexOf(".") < 0) { // only strip if there is no type cast and no bound action (avoid "correcting" // unsupported selects in V2) sSelect = sSelect.slice(0, iIndex); } mSelects[_Helper.buildPath(sExpandPath, sSelect)] = true; }); }
javascript
function addSelects(vSelects, sExpandPath) { if (!Array.isArray(vSelects)) { vSelects = vSelects.split(","); } vSelects.forEach(function (sSelect) { var iIndex = sSelect.indexOf("/"); if (iIndex >= 0 && sSelect.indexOf(".") < 0) { // only strip if there is no type cast and no bound action (avoid "correcting" // unsupported selects in V2) sSelect = sSelect.slice(0, iIndex); } mSelects[_Helper.buildPath(sExpandPath, sSelect)] = true; }); }
[ "function", "addSelects", "(", "vSelects", ",", "sExpandPath", ")", "{", "if", "(", "!", "Array", ".", "isArray", "(", "vSelects", ")", ")", "{", "vSelects", "=", "vSelects", ".", "split", "(", "\",\"", ")", ";", "}", "vSelects", ".", "forEach", "(", "function", "(", "sSelect", ")", "{", "var", "iIndex", "=", "sSelect", ".", "indexOf", "(", "\"/\"", ")", ";", "if", "(", "iIndex", ">=", "0", "&&", "sSelect", ".", "indexOf", "(", "\".\"", ")", "<", "0", ")", "{", "// only strip if there is no type cast and no bound action (avoid \"correcting\"", "// unsupported selects in V2)", "sSelect", "=", "sSelect", ".", "slice", "(", "0", ",", "iIndex", ")", ";", "}", "mSelects", "[", "_Helper", ".", "buildPath", "(", "sExpandPath", ",", "sSelect", ")", "]", "=", "true", ";", "}", ")", ";", "}" ]
Strips all selects to their first segment and adds them to mSelects. @param {string|string[]} vSelects The selects for the given expand path as comma-separated list or array @param {string} [sExpandPath] The expand path
[ "Strips", "all", "selects", "to", "their", "first", "segment", "and", "adds", "them", "to", "mSelects", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_V2Requestor.js#L643-L657
4,552
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_V2Requestor.js
parseAndCheck
function parseAndCheck(oDateFormat, sValue) { var oDate = oDateFormat.parse(sValue); if (!oDate) { throw new Error("Not a valid " + oPropertyMetadata.$Type + " value: " + sValue); } return oDate; }
javascript
function parseAndCheck(oDateFormat, sValue) { var oDate = oDateFormat.parse(sValue); if (!oDate) { throw new Error("Not a valid " + oPropertyMetadata.$Type + " value: " + sValue); } return oDate; }
[ "function", "parseAndCheck", "(", "oDateFormat", ",", "sValue", ")", "{", "var", "oDate", "=", "oDateFormat", ".", "parse", "(", "sValue", ")", ";", "if", "(", "!", "oDate", ")", "{", "throw", "new", "Error", "(", "\"Not a valid \"", "+", "oPropertyMetadata", ".", "$Type", "+", "\" value: \"", "+", "sValue", ")", ";", "}", "return", "oDate", ";", "}" ]
Parse using the given formatter and check that the result is valid
[ "Parse", "using", "the", "given", "formatter", "and", "check", "that", "the", "result", "is", "valid" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_V2Requestor.js#L769-L775
4,553
SAP/openui5
src/sap.ui.core/src/sap/ui/dom/jquery/Aria.js
removeFromAttributeList
function removeFromAttributeList(sAttribute, sValue) { var sAttributes = this.attr(sAttribute) || "", aAttributes = sAttributes.split(" "), iIndex = aAttributes.indexOf(sValue); if (iIndex == -1) { return this; } aAttributes.splice(iIndex, 1); if (aAttributes.length) { this.attr(sAttribute, aAttributes.join(" ")); } else { this.removeAttr(sAttribute); } return this; }
javascript
function removeFromAttributeList(sAttribute, sValue) { var sAttributes = this.attr(sAttribute) || "", aAttributes = sAttributes.split(" "), iIndex = aAttributes.indexOf(sValue); if (iIndex == -1) { return this; } aAttributes.splice(iIndex, 1); if (aAttributes.length) { this.attr(sAttribute, aAttributes.join(" ")); } else { this.removeAttr(sAttribute); } return this; }
[ "function", "removeFromAttributeList", "(", "sAttribute", ",", "sValue", ")", "{", "var", "sAttributes", "=", "this", ".", "attr", "(", "sAttribute", ")", "||", "\"\"", ",", "aAttributes", "=", "sAttributes", ".", "split", "(", "\" \"", ")", ",", "iIndex", "=", "aAttributes", ".", "indexOf", "(", "sValue", ")", ";", "if", "(", "iIndex", "==", "-", "1", ")", "{", "return", "this", ";", "}", "aAttributes", ".", "splice", "(", "iIndex", ",", "1", ")", ";", "if", "(", "aAttributes", ".", "length", ")", "{", "this", ".", "attr", "(", "sAttribute", ",", "aAttributes", ".", "join", "(", "\" \"", ")", ")", ";", "}", "else", "{", "this", ".", "removeAttr", "(", "sAttribute", ")", ";", "}", "return", "this", ";", "}" ]
Remove space separated value from the given attribute. @this {jQuery} jQuery context @param {string} sAttribute The name of the attribute. @param {string} sValue The value of the attribute to be inserted. @return {jQuery} <code>this</code> to allow method chaining. @author SAP SE @function @private
[ "Remove", "space", "separated", "value", "from", "the", "given", "attribute", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/dom/jquery/Aria.js#L62-L79
4,554
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/ODataTreeBindingAdapter.js
function() { // ensure only TreeBindings are enhanced which have not been enhanced yet if (!(this instanceof TreeBinding) || this._bIsAdapted) { return; } TreeBindingAdapter.apply(this); // apply the methods of the adapters prototype to the TreeBinding instance for (var fn in ODataTreeBindingAdapter.prototype) { if (ODataTreeBindingAdapter.prototype.hasOwnProperty(fn)) { this[fn] = ODataTreeBindingAdapter.prototype[fn]; } } // make sure we have a parameter object this.mParameters = this.mParameters || {}; // initialize the contexts this._aRowIndexMap = []; //Store length and threshold for all requests this._iThreshold = 0; this._iPageSize = 0; //set the default auto expand mode this.setAutoExpandMode(this.mParameters.autoExpandMode || TreeAutoExpandMode.Sequential); //default value for collapse recursive if (this.mParameters.collapseRecursive === undefined) { this.bCollapseRecursive = true; } else { this.bCollapseRecursive = !!this.mParameters.collapseRecursive; } //create general tree structure this._createTreeState(); // restore old tree state if given AND if the binding is running in OperationMode.Client // OperationMode.Auto is not supported, as the binding would behave fundamentally different in case the threshold is rejected. if (this.mParameters.treeState && this.sOperationMode == OperationMode.Client) { this.setTreeState(this.mParameters.treeState); } }
javascript
function() { // ensure only TreeBindings are enhanced which have not been enhanced yet if (!(this instanceof TreeBinding) || this._bIsAdapted) { return; } TreeBindingAdapter.apply(this); // apply the methods of the adapters prototype to the TreeBinding instance for (var fn in ODataTreeBindingAdapter.prototype) { if (ODataTreeBindingAdapter.prototype.hasOwnProperty(fn)) { this[fn] = ODataTreeBindingAdapter.prototype[fn]; } } // make sure we have a parameter object this.mParameters = this.mParameters || {}; // initialize the contexts this._aRowIndexMap = []; //Store length and threshold for all requests this._iThreshold = 0; this._iPageSize = 0; //set the default auto expand mode this.setAutoExpandMode(this.mParameters.autoExpandMode || TreeAutoExpandMode.Sequential); //default value for collapse recursive if (this.mParameters.collapseRecursive === undefined) { this.bCollapseRecursive = true; } else { this.bCollapseRecursive = !!this.mParameters.collapseRecursive; } //create general tree structure this._createTreeState(); // restore old tree state if given AND if the binding is running in OperationMode.Client // OperationMode.Auto is not supported, as the binding would behave fundamentally different in case the threshold is rejected. if (this.mParameters.treeState && this.sOperationMode == OperationMode.Client) { this.setTreeState(this.mParameters.treeState); } }
[ "function", "(", ")", "{", "// ensure only TreeBindings are enhanced which have not been enhanced yet", "if", "(", "!", "(", "this", "instanceof", "TreeBinding", ")", "||", "this", ".", "_bIsAdapted", ")", "{", "return", ";", "}", "TreeBindingAdapter", ".", "apply", "(", "this", ")", ";", "// apply the methods of the adapters prototype to the TreeBinding instance", "for", "(", "var", "fn", "in", "ODataTreeBindingAdapter", ".", "prototype", ")", "{", "if", "(", "ODataTreeBindingAdapter", ".", "prototype", ".", "hasOwnProperty", "(", "fn", ")", ")", "{", "this", "[", "fn", "]", "=", "ODataTreeBindingAdapter", ".", "prototype", "[", "fn", "]", ";", "}", "}", "// make sure we have a parameter object", "this", ".", "mParameters", "=", "this", ".", "mParameters", "||", "{", "}", ";", "// initialize the contexts", "this", ".", "_aRowIndexMap", "=", "[", "]", ";", "//Store length and threshold for all requests", "this", ".", "_iThreshold", "=", "0", ";", "this", ".", "_iPageSize", "=", "0", ";", "//set the default auto expand mode", "this", ".", "setAutoExpandMode", "(", "this", ".", "mParameters", ".", "autoExpandMode", "||", "TreeAutoExpandMode", ".", "Sequential", ")", ";", "//default value for collapse recursive", "if", "(", "this", ".", "mParameters", ".", "collapseRecursive", "===", "undefined", ")", "{", "this", ".", "bCollapseRecursive", "=", "true", ";", "}", "else", "{", "this", ".", "bCollapseRecursive", "=", "!", "!", "this", ".", "mParameters", ".", "collapseRecursive", ";", "}", "//create general tree structure", "this", ".", "_createTreeState", "(", ")", ";", "// restore old tree state if given AND if the binding is running in OperationMode.Client", "// OperationMode.Auto is not supported, as the binding would behave fundamentally different in case the threshold is rejected.", "if", "(", "this", ".", "mParameters", ".", "treeState", "&&", "this", ".", "sOperationMode", "==", "OperationMode", ".", "Client", ")", "{", "this", ".", "setTreeState", "(", "this", ".", "mParameters", ".", "treeState", ")", ";", "}", "}" ]
Adapter for TreeBindings to add the ListBinding functionality and use the tree structure in list based controls. Only usable with the sap.ui.table.TreeTable control. The functions defined here are only available when you are using a TreeTable and an ODataModel. @alias sap.ui.model.odata.ODataTreeBindingAdapter @function @experimental This module is only for experimental and internal use! @public
[ "Adapter", "for", "TreeBindings", "to", "add", "the", "ListBinding", "functionality", "and", "use", "the", "tree", "structure", "in", "list", "based", "controls", ".", "Only", "usable", "with", "the", "sap", ".", "ui", ".", "table", ".", "TreeTable", "control", ".", "The", "functions", "defined", "here", "are", "only", "available", "when", "you", "are", "using", "a", "TreeTable", "and", "an", "ODataModel", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/ODataTreeBindingAdapter.js#L22-L66
4,555
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Cache.js
cleanUp
function cleanUp() { _Helper.removeByPath(that.mPostRequests, sPath, oEntityData); aCollection.splice(aCollection.indexOf(oEntityData), 1); aCollection.$created -= 1; addToCount(that.mChangeListeners, sPath, aCollection, -1); delete aCollection.$byPredicate[sTransientPredicate]; if (!sPath) { // Note: sPath is empty only in a CollectionCache, so we may call adjustReadRequests that.adjustReadRequests(0, -1); } fnCancelCallback(); }
javascript
function cleanUp() { _Helper.removeByPath(that.mPostRequests, sPath, oEntityData); aCollection.splice(aCollection.indexOf(oEntityData), 1); aCollection.$created -= 1; addToCount(that.mChangeListeners, sPath, aCollection, -1); delete aCollection.$byPredicate[sTransientPredicate]; if (!sPath) { // Note: sPath is empty only in a CollectionCache, so we may call adjustReadRequests that.adjustReadRequests(0, -1); } fnCancelCallback(); }
[ "function", "cleanUp", "(", ")", "{", "_Helper", ".", "removeByPath", "(", "that", ".", "mPostRequests", ",", "sPath", ",", "oEntityData", ")", ";", "aCollection", ".", "splice", "(", "aCollection", ".", "indexOf", "(", "oEntityData", ")", ",", "1", ")", ";", "aCollection", ".", "$created", "-=", "1", ";", "addToCount", "(", "that", ".", "mChangeListeners", ",", "sPath", ",", "aCollection", ",", "-", "1", ")", ";", "delete", "aCollection", ".", "$byPredicate", "[", "sTransientPredicate", "]", ";", "if", "(", "!", "sPath", ")", "{", "// Note: sPath is empty only in a CollectionCache, so we may call adjustReadRequests", "that", ".", "adjustReadRequests", "(", "0", ",", "-", "1", ")", ";", "}", "fnCancelCallback", "(", ")", ";", "}" ]
Clean-up when the create has been canceled.
[ "Clean", "-", "up", "when", "the", "create", "has", "been", "canceled", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Cache.js#L289-L300
4,556
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Cache.js
missingValue
function missingValue(oValue, sSegment, iPathLength) { var sPropertyPath = "", sReadLink, sServiceUrl; if (sPath[0] !== '(') { sPropertyPath += "/"; } sPropertyPath += sPath.split("/").slice(0, iPathLength).join("/"); return that.oRequestor.getModelInterface() .fetchMetadata(that.sMetaPath + _Helper.getMetaPath(sPropertyPath)) .then(function (oProperty) { if (!oProperty) { return invalidSegment(sSegment); } if (oProperty.$Type === "Edm.Stream") { sReadLink = oValue[sSegment + "@odata.mediaReadLink"]; sServiceUrl = that.oRequestor.getServiceUrl(); return sReadLink || sServiceUrl + that.sResourcePath + sPropertyPath; } if (!bTransient) { return invalidSegment(sSegment); } if (oProperty.$kind === "NavigationProperty") { return null; } if (!oProperty.$Type.startsWith("Edm.")) { return {}; } if ("$DefaultValue" in oProperty) { return oProperty.$Type === "Edm.String" ? oProperty.$DefaultValue : _Helper.parseLiteral(oProperty.$DefaultValue, oProperty.$Type, sPropertyPath); } return null; }); }
javascript
function missingValue(oValue, sSegment, iPathLength) { var sPropertyPath = "", sReadLink, sServiceUrl; if (sPath[0] !== '(') { sPropertyPath += "/"; } sPropertyPath += sPath.split("/").slice(0, iPathLength).join("/"); return that.oRequestor.getModelInterface() .fetchMetadata(that.sMetaPath + _Helper.getMetaPath(sPropertyPath)) .then(function (oProperty) { if (!oProperty) { return invalidSegment(sSegment); } if (oProperty.$Type === "Edm.Stream") { sReadLink = oValue[sSegment + "@odata.mediaReadLink"]; sServiceUrl = that.oRequestor.getServiceUrl(); return sReadLink || sServiceUrl + that.sResourcePath + sPropertyPath; } if (!bTransient) { return invalidSegment(sSegment); } if (oProperty.$kind === "NavigationProperty") { return null; } if (!oProperty.$Type.startsWith("Edm.")) { return {}; } if ("$DefaultValue" in oProperty) { return oProperty.$Type === "Edm.String" ? oProperty.$DefaultValue : _Helper.parseLiteral(oProperty.$DefaultValue, oProperty.$Type, sPropertyPath); } return null; }); }
[ "function", "missingValue", "(", "oValue", ",", "sSegment", ",", "iPathLength", ")", "{", "var", "sPropertyPath", "=", "\"\"", ",", "sReadLink", ",", "sServiceUrl", ";", "if", "(", "sPath", "[", "0", "]", "!==", "'('", ")", "{", "sPropertyPath", "+=", "\"/\"", ";", "}", "sPropertyPath", "+=", "sPath", ".", "split", "(", "\"/\"", ")", ".", "slice", "(", "0", ",", "iPathLength", ")", ".", "join", "(", "\"/\"", ")", ";", "return", "that", ".", "oRequestor", ".", "getModelInterface", "(", ")", ".", "fetchMetadata", "(", "that", ".", "sMetaPath", "+", "_Helper", ".", "getMetaPath", "(", "sPropertyPath", ")", ")", ".", "then", "(", "function", "(", "oProperty", ")", "{", "if", "(", "!", "oProperty", ")", "{", "return", "invalidSegment", "(", "sSegment", ")", ";", "}", "if", "(", "oProperty", ".", "$Type", "===", "\"Edm.Stream\"", ")", "{", "sReadLink", "=", "oValue", "[", "sSegment", "+", "\"@odata.mediaReadLink\"", "]", ";", "sServiceUrl", "=", "that", ".", "oRequestor", ".", "getServiceUrl", "(", ")", ";", "return", "sReadLink", "||", "sServiceUrl", "+", "that", ".", "sResourcePath", "+", "sPropertyPath", ";", "}", "if", "(", "!", "bTransient", ")", "{", "return", "invalidSegment", "(", "sSegment", ")", ";", "}", "if", "(", "oProperty", ".", "$kind", "===", "\"NavigationProperty\"", ")", "{", "return", "null", ";", "}", "if", "(", "!", "oProperty", ".", "$Type", ".", "startsWith", "(", "\"Edm.\"", ")", ")", "{", "return", "{", "}", ";", "}", "if", "(", "\"$DefaultValue\"", "in", "oProperty", ")", "{", "return", "oProperty", ".", "$Type", "===", "\"Edm.String\"", "?", "oProperty", ".", "$DefaultValue", ":", "_Helper", ".", "parseLiteral", "(", "oProperty", ".", "$DefaultValue", ",", "oProperty", ".", "$Type", ",", "sPropertyPath", ")", ";", "}", "return", "null", ";", "}", ")", ";", "}" ]
Determine the implicit value if the value is missing in the cache. Report an invalid segment if there is no implicit value.
[ "Determine", "the", "implicit", "value", "if", "the", "value", "is", "missing", "in", "the", "cache", ".", "Report", "an", "invalid", "segment", "if", "there", "is", "no", "implicit", "value", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Cache.js#L429-L466
4,557
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Cache.js
addFilter
function addFilter(oFilterElement) { var sFilter = _Helper.getKeyFilter(oFilterElement, that.sMetaPath, mTypeForMetaPath); aFilters.push(sFilter); return sFilter; }
javascript
function addFilter(oFilterElement) { var sFilter = _Helper.getKeyFilter(oFilterElement, that.sMetaPath, mTypeForMetaPath); aFilters.push(sFilter); return sFilter; }
[ "function", "addFilter", "(", "oFilterElement", ")", "{", "var", "sFilter", "=", "_Helper", ".", "getKeyFilter", "(", "oFilterElement", ",", "that", ".", "sMetaPath", ",", "mTypeForMetaPath", ")", ";", "aFilters", ".", "push", "(", "sFilter", ")", ";", "return", "sFilter", ";", "}" ]
Adds the filter for the given element to the array of filters. @param {object} oFilterElement The element for which a filter is computed @returns {string} The filter for the given element; <code>undefined</code> if a key property for the element is missing.
[ "Adds", "the", "filter", "for", "the", "given", "element", "to", "the", "array", "of", "filters", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Cache.js#L1844-L1849
4,558
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/NotificationBar.js
function(oEvent) { var oCallout = oEvent.getParameter("callout"); switch (oEvent.getParameter("type")) { case "added": case "removed": var oNotifier = oEvent.getParameter("notifier"); if (this.getMessageNotifier() && this.getMessageNotifier().getId() === oNotifier.getId()) { // clone the message array to sort it fnSortMessages(this, this.getMessageNotifier()); } if (fnChangeVisibility(this)) { var bShouldBeVisible = this.hasItems(); this.fireDisplay({ show : bShouldBeVisible }); } else { /* * Needed if i.e. all messages of a notifier were removed but if * there are still notifications or messages to display */ this.invalidate(); /* * Needed if the message is directly removed from the Callout * without any request to the user. */ if (oEvent.getParameter("type") === "removed") { /* * Since the Callout has only one content - the NotifierView - * it can be checked this way. If there is no content the * Callout has been closed already. */ if (oCallout.getContent().length > 0) { var oNotiView = oCallout.getContent()[0]; var oMessage = oEvent.getParameter("message"); var aMessageViews = oNotiView.getMessages(); var tmpMsgView; for (var i = 0; i < aMessageViews.length; i++) { tmpMsgView = aMessageViews[i]; if (oMessage.getId() === tmpMsgView._message.getId()) { tmpMsgView.destroy(); /* * A normal invalidate on the NotifierView * doesn't work here since the invalidate is * delegated to the most upper parent -> the * NotificationBar. If the NotificationBar is * rendered it doesn't know something of the * corresponding Callout. It would be possible * to rerender the NotifierView but since the * height of the Callout is reduced the * Callout's position must be fixed as well. * This happens also when the Callout is * rerendered, so it saves some lines of codes * to rerender the Callout itself. */ oCallout.rerender(); /* * An open Callout would loose its correct * position due to the re-rendering. The * followOf-functionality of the Popup doesn't * work here, since the opener hasn't moved. See * CSN 1625930 2013 */ oCallout.adjustPosition(); break; } } } } } break; case "openCallout": oCallout.destroyContent(); var oNotifier = oEvent.getParameter("notifier"); // destroy (renew) views that were previously created in maximized // mode oNotifier.destroyAggregation("views", true); var sId = oNotifier.getId(); var oMessageNotifier = this.getMessageNotifier(); if (oMessageNotifier && sId === oMessageNotifier.getId()) { sId += "-messageNotifierView"; } else { sId += "-messageView"; } // create control that renders the notifier's messages var oNotifierView = new NotificationBar.NotifierView(sId, { title : oNotifier.getTitle(), visibleItems : this._visibleItems }); if (oNotifier._bEnableMessageSelect) { oNotifierView.addStyleClass("sapUiNotifierSelectable"); } var aMessages = oNotifier.getMessages(); for (var i = 0; i < aMessages.length; i++) { var oView = fnCreateMessageView(aMessages[i], oNotifier, this); oNotifierView.addMessage(oView); } // with adding this aggregation the view is destroyed as well if // needed oNotifier.addAggregation("views", oNotifierView, true); oCallout.addContent(oNotifierView); break; } }
javascript
function(oEvent) { var oCallout = oEvent.getParameter("callout"); switch (oEvent.getParameter("type")) { case "added": case "removed": var oNotifier = oEvent.getParameter("notifier"); if (this.getMessageNotifier() && this.getMessageNotifier().getId() === oNotifier.getId()) { // clone the message array to sort it fnSortMessages(this, this.getMessageNotifier()); } if (fnChangeVisibility(this)) { var bShouldBeVisible = this.hasItems(); this.fireDisplay({ show : bShouldBeVisible }); } else { /* * Needed if i.e. all messages of a notifier were removed but if * there are still notifications or messages to display */ this.invalidate(); /* * Needed if the message is directly removed from the Callout * without any request to the user. */ if (oEvent.getParameter("type") === "removed") { /* * Since the Callout has only one content - the NotifierView - * it can be checked this way. If there is no content the * Callout has been closed already. */ if (oCallout.getContent().length > 0) { var oNotiView = oCallout.getContent()[0]; var oMessage = oEvent.getParameter("message"); var aMessageViews = oNotiView.getMessages(); var tmpMsgView; for (var i = 0; i < aMessageViews.length; i++) { tmpMsgView = aMessageViews[i]; if (oMessage.getId() === tmpMsgView._message.getId()) { tmpMsgView.destroy(); /* * A normal invalidate on the NotifierView * doesn't work here since the invalidate is * delegated to the most upper parent -> the * NotificationBar. If the NotificationBar is * rendered it doesn't know something of the * corresponding Callout. It would be possible * to rerender the NotifierView but since the * height of the Callout is reduced the * Callout's position must be fixed as well. * This happens also when the Callout is * rerendered, so it saves some lines of codes * to rerender the Callout itself. */ oCallout.rerender(); /* * An open Callout would loose its correct * position due to the re-rendering. The * followOf-functionality of the Popup doesn't * work here, since the opener hasn't moved. See * CSN 1625930 2013 */ oCallout.adjustPosition(); break; } } } } } break; case "openCallout": oCallout.destroyContent(); var oNotifier = oEvent.getParameter("notifier"); // destroy (renew) views that were previously created in maximized // mode oNotifier.destroyAggregation("views", true); var sId = oNotifier.getId(); var oMessageNotifier = this.getMessageNotifier(); if (oMessageNotifier && sId === oMessageNotifier.getId()) { sId += "-messageNotifierView"; } else { sId += "-messageView"; } // create control that renders the notifier's messages var oNotifierView = new NotificationBar.NotifierView(sId, { title : oNotifier.getTitle(), visibleItems : this._visibleItems }); if (oNotifier._bEnableMessageSelect) { oNotifierView.addStyleClass("sapUiNotifierSelectable"); } var aMessages = oNotifier.getMessages(); for (var i = 0; i < aMessages.length; i++) { var oView = fnCreateMessageView(aMessages[i], oNotifier, this); oNotifierView.addMessage(oView); } // with adding this aggregation the view is destroyed as well if // needed oNotifier.addAggregation("views", oNotifierView, true); oCallout.addContent(oNotifierView); break; } }
[ "function", "(", "oEvent", ")", "{", "var", "oCallout", "=", "oEvent", ".", "getParameter", "(", "\"callout\"", ")", ";", "switch", "(", "oEvent", ".", "getParameter", "(", "\"type\"", ")", ")", "{", "case", "\"added\"", ":", "case", "\"removed\"", ":", "var", "oNotifier", "=", "oEvent", ".", "getParameter", "(", "\"notifier\"", ")", ";", "if", "(", "this", ".", "getMessageNotifier", "(", ")", "&&", "this", ".", "getMessageNotifier", "(", ")", ".", "getId", "(", ")", "===", "oNotifier", ".", "getId", "(", ")", ")", "{", "// clone the message array to sort it", "fnSortMessages", "(", "this", ",", "this", ".", "getMessageNotifier", "(", ")", ")", ";", "}", "if", "(", "fnChangeVisibility", "(", "this", ")", ")", "{", "var", "bShouldBeVisible", "=", "this", ".", "hasItems", "(", ")", ";", "this", ".", "fireDisplay", "(", "{", "show", ":", "bShouldBeVisible", "}", ")", ";", "}", "else", "{", "/*\n\t\t\t\t\t * Needed if i.e. all messages of a notifier were removed but if\n\t\t\t\t\t * there are still notifications or messages to display\n\t\t\t\t\t */", "this", ".", "invalidate", "(", ")", ";", "/*\n\t\t\t\t\t * Needed if the message is directly removed from the Callout\n\t\t\t\t\t * without any request to the user.\n\t\t\t\t\t */", "if", "(", "oEvent", ".", "getParameter", "(", "\"type\"", ")", "===", "\"removed\"", ")", "{", "/*\n\t\t\t\t\t\t * Since the Callout has only one content - the NotifierView -\n\t\t\t\t\t\t * it can be checked this way. If there is no content the\n\t\t\t\t\t\t * Callout has been closed already.\n\t\t\t\t\t\t */", "if", "(", "oCallout", ".", "getContent", "(", ")", ".", "length", ">", "0", ")", "{", "var", "oNotiView", "=", "oCallout", ".", "getContent", "(", ")", "[", "0", "]", ";", "var", "oMessage", "=", "oEvent", ".", "getParameter", "(", "\"message\"", ")", ";", "var", "aMessageViews", "=", "oNotiView", ".", "getMessages", "(", ")", ";", "var", "tmpMsgView", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "aMessageViews", ".", "length", ";", "i", "++", ")", "{", "tmpMsgView", "=", "aMessageViews", "[", "i", "]", ";", "if", "(", "oMessage", ".", "getId", "(", ")", "===", "tmpMsgView", ".", "_message", ".", "getId", "(", ")", ")", "{", "tmpMsgView", ".", "destroy", "(", ")", ";", "/*\n\t\t\t\t\t\t\t\t\t * A normal invalidate on the NotifierView\n\t\t\t\t\t\t\t\t\t * doesn't work here since the invalidate is\n\t\t\t\t\t\t\t\t\t * delegated to the most upper parent -> the\n\t\t\t\t\t\t\t\t\t * NotificationBar. If the NotificationBar is\n\t\t\t\t\t\t\t\t\t * rendered it doesn't know something of the\n\t\t\t\t\t\t\t\t\t * corresponding Callout. It would be possible\n\t\t\t\t\t\t\t\t\t * to rerender the NotifierView but since the\n\t\t\t\t\t\t\t\t\t * height of the Callout is reduced the\n\t\t\t\t\t\t\t\t\t * Callout's position must be fixed as well.\n\t\t\t\t\t\t\t\t\t * This happens also when the Callout is\n\t\t\t\t\t\t\t\t\t * rerendered, so it saves some lines of codes\n\t\t\t\t\t\t\t\t\t * to rerender the Callout itself.\n\t\t\t\t\t\t\t\t\t */", "oCallout", ".", "rerender", "(", ")", ";", "/*\n\t\t\t\t\t\t\t\t\t * An open Callout would loose its correct\n\t\t\t\t\t\t\t\t\t * position due to the re-rendering. The\n\t\t\t\t\t\t\t\t\t * followOf-functionality of the Popup doesn't\n\t\t\t\t\t\t\t\t\t * work here, since the opener hasn't moved. See\n\t\t\t\t\t\t\t\t\t * CSN 1625930 2013\n\t\t\t\t\t\t\t\t\t */", "oCallout", ".", "adjustPosition", "(", ")", ";", "break", ";", "}", "}", "}", "}", "}", "break", ";", "case", "\"openCallout\"", ":", "oCallout", ".", "destroyContent", "(", ")", ";", "var", "oNotifier", "=", "oEvent", ".", "getParameter", "(", "\"notifier\"", ")", ";", "// destroy (renew) views that were previously created in maximized", "// mode", "oNotifier", ".", "destroyAggregation", "(", "\"views\"", ",", "true", ")", ";", "var", "sId", "=", "oNotifier", ".", "getId", "(", ")", ";", "var", "oMessageNotifier", "=", "this", ".", "getMessageNotifier", "(", ")", ";", "if", "(", "oMessageNotifier", "&&", "sId", "===", "oMessageNotifier", ".", "getId", "(", ")", ")", "{", "sId", "+=", "\"-messageNotifierView\"", ";", "}", "else", "{", "sId", "+=", "\"-messageView\"", ";", "}", "// create control that renders the notifier's messages", "var", "oNotifierView", "=", "new", "NotificationBar", ".", "NotifierView", "(", "sId", ",", "{", "title", ":", "oNotifier", ".", "getTitle", "(", ")", ",", "visibleItems", ":", "this", ".", "_visibleItems", "}", ")", ";", "if", "(", "oNotifier", ".", "_bEnableMessageSelect", ")", "{", "oNotifierView", ".", "addStyleClass", "(", "\"sapUiNotifierSelectable\"", ")", ";", "}", "var", "aMessages", "=", "oNotifier", ".", "getMessages", "(", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "aMessages", ".", "length", ";", "i", "++", ")", "{", "var", "oView", "=", "fnCreateMessageView", "(", "aMessages", "[", "i", "]", ",", "oNotifier", ",", "this", ")", ";", "oNotifierView", ".", "addMessage", "(", "oView", ")", ";", "}", "// with adding this aggregation the view is destroyed as well if", "// needed", "oNotifier", ".", "addAggregation", "(", "\"views\"", ",", "oNotifierView", ",", "true", ")", ";", "oCallout", ".", "addContent", "(", "oNotifierView", ")", ";", "break", ";", "}", "}" ]
This is the eventListener of the NotificationBar. All triggered events from the bar's notifiers will be caught here. @param {sap.ui.base.Event} oEvent the event will all needed stuff. It can contain 'added', 'removed' or 'openCallout' as a parameter to identify the event.
[ "This", "is", "the", "eventListener", "of", "the", "NotificationBar", ".", "All", "triggered", "events", "from", "the", "bar", "s", "notifiers", "will", "be", "caught", "here", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/NotificationBar.js#L404-L525
4,559
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/NotificationBar.js
function(oThis, oMN) { if (oMN && oMN.hasItems()) { var $messageCount = oMN.$("counter"); // remove all possible classes $messageCount.removeClass("sapUiMessageInformation"); $messageCount.removeClass("sapUiMessageSuccess"); $messageCount.removeClass("sapUiMessageWarning"); $messageCount.removeClass("sapUiMessageError"); // re-sort the messages and re-calc the severity level because they could have been changed // if the NotiBar was invisible fnSortMessages(oThis, oMN); // add new corresponding class var sLvl = oThis._sSeverestMessageLevel; $messageCount.addClass("sapUiMessage" + sLvl); // create key for description text var iCount = oMN.getMessages().length; var sKey = "NOTIBAR_MESSAGE_NOTIFIER_DESC_LEVEL_" + sLvl.toUpperCase() + (iCount === 1 ? "_SING" : "_PL"); // set description (i.e. "3 messages available: Highest severity // "Error") fnSetNotifierDescription(oThis, oMN, sKey, iCount); } }
javascript
function(oThis, oMN) { if (oMN && oMN.hasItems()) { var $messageCount = oMN.$("counter"); // remove all possible classes $messageCount.removeClass("sapUiMessageInformation"); $messageCount.removeClass("sapUiMessageSuccess"); $messageCount.removeClass("sapUiMessageWarning"); $messageCount.removeClass("sapUiMessageError"); // re-sort the messages and re-calc the severity level because they could have been changed // if the NotiBar was invisible fnSortMessages(oThis, oMN); // add new corresponding class var sLvl = oThis._sSeverestMessageLevel; $messageCount.addClass("sapUiMessage" + sLvl); // create key for description text var iCount = oMN.getMessages().length; var sKey = "NOTIBAR_MESSAGE_NOTIFIER_DESC_LEVEL_" + sLvl.toUpperCase() + (iCount === 1 ? "_SING" : "_PL"); // set description (i.e. "3 messages available: Highest severity // "Error") fnSetNotifierDescription(oThis, oMN, sKey, iCount); } }
[ "function", "(", "oThis", ",", "oMN", ")", "{", "if", "(", "oMN", "&&", "oMN", ".", "hasItems", "(", ")", ")", "{", "var", "$messageCount", "=", "oMN", ".", "$", "(", "\"counter\"", ")", ";", "// remove all possible classes", "$messageCount", ".", "removeClass", "(", "\"sapUiMessageInformation\"", ")", ";", "$messageCount", ".", "removeClass", "(", "\"sapUiMessageSuccess\"", ")", ";", "$messageCount", ".", "removeClass", "(", "\"sapUiMessageWarning\"", ")", ";", "$messageCount", ".", "removeClass", "(", "\"sapUiMessageError\"", ")", ";", "// re-sort the messages and re-calc the severity level because they could have been changed", "// if the NotiBar was invisible", "fnSortMessages", "(", "oThis", ",", "oMN", ")", ";", "// add new corresponding class", "var", "sLvl", "=", "oThis", ".", "_sSeverestMessageLevel", ";", "$messageCount", ".", "addClass", "(", "\"sapUiMessage\"", "+", "sLvl", ")", ";", "// create key for description text", "var", "iCount", "=", "oMN", ".", "getMessages", "(", ")", ".", "length", ";", "var", "sKey", "=", "\"NOTIBAR_MESSAGE_NOTIFIER_DESC_LEVEL_\"", "+", "sLvl", ".", "toUpperCase", "(", ")", "+", "(", "iCount", "===", "1", "?", "\"_SING\"", ":", "\"_PL\"", ")", ";", "// set description (i.e. \"3 messages available: Highest severity", "// \"Error\")", "fnSetNotifierDescription", "(", "oThis", ",", "oMN", ",", "sKey", ",", "iCount", ")", ";", "}", "}" ]
This method sets the corresponding CSS class to the message notifier's counter to set its corresponding color and sets the corresponding ARIA information to the notifier's description element @private
[ "This", "method", "sets", "the", "corresponding", "CSS", "class", "to", "the", "message", "notifier", "s", "counter", "to", "set", "its", "corresponding", "color", "and", "sets", "the", "corresponding", "ARIA", "information", "to", "the", "notifier", "s", "description", "element" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/NotificationBar.js#L986-L1011
4,560
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/NotificationBar.js
function(oThis) { var aNotifiers = oThis.getNotifiers(); for (var i = 0; i < aNotifiers.length; i++) { var iCount = aNotifiers[i].getMessages().length; var sKey = "NOTIBAR_NOTIFIER_COUNT_TEXT_" + (iCount === 1 ? "SING" : "PL"); fnSetNotifierDescription(oThis, aNotifiers[i], sKey, iCount); } }
javascript
function(oThis) { var aNotifiers = oThis.getNotifiers(); for (var i = 0; i < aNotifiers.length; i++) { var iCount = aNotifiers[i].getMessages().length; var sKey = "NOTIBAR_NOTIFIER_COUNT_TEXT_" + (iCount === 1 ? "SING" : "PL"); fnSetNotifierDescription(oThis, aNotifiers[i], sKey, iCount); } }
[ "function", "(", "oThis", ")", "{", "var", "aNotifiers", "=", "oThis", ".", "getNotifiers", "(", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "aNotifiers", ".", "length", ";", "i", "++", ")", "{", "var", "iCount", "=", "aNotifiers", "[", "i", "]", ".", "getMessages", "(", ")", ".", "length", ";", "var", "sKey", "=", "\"NOTIBAR_NOTIFIER_COUNT_TEXT_\"", "+", "(", "iCount", "===", "1", "?", "\"SING\"", ":", "\"PL\"", ")", ";", "fnSetNotifierDescription", "(", "oThis", ",", "aNotifiers", "[", "i", "]", ",", "sKey", ",", "iCount", ")", ";", "}", "}" ]
Sets all description of all notifiers @private
[ "Sets", "all", "description", "of", "all", "notifiers" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/NotificationBar.js#L1018-L1027
4,561
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/NotificationBar.js
function(that) { var mNotifiers = that.getNotifiers(); for (var i = 0; i < mNotifiers.length; i++) { var oNotifier = mNotifiers[i]; oNotifier._oCallout.close(); } if (that.getMessageNotifier()) { that.getMessageNotifier()._oCallout.close(); } }
javascript
function(that) { var mNotifiers = that.getNotifiers(); for (var i = 0; i < mNotifiers.length; i++) { var oNotifier = mNotifiers[i]; oNotifier._oCallout.close(); } if (that.getMessageNotifier()) { that.getMessageNotifier()._oCallout.close(); } }
[ "function", "(", "that", ")", "{", "var", "mNotifiers", "=", "that", ".", "getNotifiers", "(", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "mNotifiers", ".", "length", ";", "i", "++", ")", "{", "var", "oNotifier", "=", "mNotifiers", "[", "i", "]", ";", "oNotifier", ".", "_oCallout", ".", "close", "(", ")", ";", "}", "if", "(", "that", ".", "getMessageNotifier", "(", ")", ")", "{", "that", ".", "getMessageNotifier", "(", ")", ".", "_oCallout", ".", "close", "(", ")", ";", "}", "}" ]
Forces a close of all Callouts of all notifiers of the NotificationBar.
[ "Forces", "a", "close", "of", "all", "Callouts", "of", "all", "notifiers", "of", "the", "NotificationBar", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/NotificationBar.js#L1245-L1257
4,562
SAP/openui5
src/sap.ui.core/src/sap/ui/core/LocaleData.js
function(sWidth, sCalendarType) { assert(sWidth == "narrow" || sWidth == "abbreviated" || sWidth == "wide", "sWidth must be narrow, abbreviated or wide"); return this._get(getCLDRCalendarName(sCalendarType), "dayPeriods", "stand-alone", sWidth); }
javascript
function(sWidth, sCalendarType) { assert(sWidth == "narrow" || sWidth == "abbreviated" || sWidth == "wide", "sWidth must be narrow, abbreviated or wide"); return this._get(getCLDRCalendarName(sCalendarType), "dayPeriods", "stand-alone", sWidth); }
[ "function", "(", "sWidth", ",", "sCalendarType", ")", "{", "assert", "(", "sWidth", "==", "\"narrow\"", "||", "sWidth", "==", "\"abbreviated\"", "||", "sWidth", "==", "\"wide\"", ",", "\"sWidth must be narrow, abbreviated or wide\"", ")", ";", "return", "this", ".", "_get", "(", "getCLDRCalendarName", "(", "sCalendarType", ")", ",", "\"dayPeriods\"", ",", "\"stand-alone\"", ",", "sWidth", ")", ";", "}" ]
Get standalone day periods in width "narrow", "abbreviated" or "wide". @param {string} sWidth the required width for the day period names @param {sap.ui.core.CalendarType} [sCalendarType] the type of calendar. If it's not set, it falls back to the calendar type either set in configuration or calculated from locale. @returns {array} array of day periods (AM, PM) @public
[ "Get", "standalone", "day", "periods", "in", "width", "narrow", "abbreviated", "or", "wide", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L194-L197
4,563
SAP/openui5
src/sap.ui.core/src/sap/ui/core/LocaleData.js
function(sStyle, sCalendarType) { assert(sStyle == "short" || sStyle == "medium" || sStyle == "long" || sStyle == "full", "sStyle must be short, medium, long or full"); return this._get(getCLDRCalendarName(sCalendarType), "dateFormats", sStyle); }
javascript
function(sStyle, sCalendarType) { assert(sStyle == "short" || sStyle == "medium" || sStyle == "long" || sStyle == "full", "sStyle must be short, medium, long or full"); return this._get(getCLDRCalendarName(sCalendarType), "dateFormats", sStyle); }
[ "function", "(", "sStyle", ",", "sCalendarType", ")", "{", "assert", "(", "sStyle", "==", "\"short\"", "||", "sStyle", "==", "\"medium\"", "||", "sStyle", "==", "\"long\"", "||", "sStyle", "==", "\"full\"", ",", "\"sStyle must be short, medium, long or full\"", ")", ";", "return", "this", ".", "_get", "(", "getCLDRCalendarName", "(", "sCalendarType", ")", ",", "\"dateFormats\"", ",", "sStyle", ")", ";", "}" ]
Get date pattern in format "short", "medium", "long" or "full". @param {string} sStyle the required style for the date pattern @param {sap.ui.core.CalendarType} [sCalendarType] the type of calendar. If it's not set, it falls back to the calendar type either set in configuration or calculated from locale. @returns {string} the selected date pattern @public
[ "Get", "date", "pattern", "in", "format", "short", "medium", "long", "or", "full", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L207-L210
4,564
SAP/openui5
src/sap.ui.core/src/sap/ui/core/LocaleData.js
function(sDateStyle, sTimeStyle, sCalendarType) { assert(sDateStyle == "short" || sDateStyle == "medium" || sDateStyle == "long" || sDateStyle == "full", "sStyle must be short, medium, long or full"); assert(sTimeStyle == "short" || sTimeStyle == "medium" || sTimeStyle == "long" || sTimeStyle == "full", "sStyle must be short, medium, long or full"); var sDateTimePattern = this.getDateTimePattern(sDateStyle, sCalendarType), sDatePattern = this.getDatePattern(sDateStyle, sCalendarType), sTimePattern = this.getTimePattern(sTimeStyle, sCalendarType); return sDateTimePattern.replace("{0}", sTimePattern).replace("{1}", sDatePattern); }
javascript
function(sDateStyle, sTimeStyle, sCalendarType) { assert(sDateStyle == "short" || sDateStyle == "medium" || sDateStyle == "long" || sDateStyle == "full", "sStyle must be short, medium, long or full"); assert(sTimeStyle == "short" || sTimeStyle == "medium" || sTimeStyle == "long" || sTimeStyle == "full", "sStyle must be short, medium, long or full"); var sDateTimePattern = this.getDateTimePattern(sDateStyle, sCalendarType), sDatePattern = this.getDatePattern(sDateStyle, sCalendarType), sTimePattern = this.getTimePattern(sTimeStyle, sCalendarType); return sDateTimePattern.replace("{0}", sTimePattern).replace("{1}", sDatePattern); }
[ "function", "(", "sDateStyle", ",", "sTimeStyle", ",", "sCalendarType", ")", "{", "assert", "(", "sDateStyle", "==", "\"short\"", "||", "sDateStyle", "==", "\"medium\"", "||", "sDateStyle", "==", "\"long\"", "||", "sDateStyle", "==", "\"full\"", ",", "\"sStyle must be short, medium, long or full\"", ")", ";", "assert", "(", "sTimeStyle", "==", "\"short\"", "||", "sTimeStyle", "==", "\"medium\"", "||", "sTimeStyle", "==", "\"long\"", "||", "sTimeStyle", "==", "\"full\"", ",", "\"sStyle must be short, medium, long or full\"", ")", ";", "var", "sDateTimePattern", "=", "this", ".", "getDateTimePattern", "(", "sDateStyle", ",", "sCalendarType", ")", ",", "sDatePattern", "=", "this", ".", "getDatePattern", "(", "sDateStyle", ",", "sCalendarType", ")", ",", "sTimePattern", "=", "this", ".", "getTimePattern", "(", "sTimeStyle", ",", "sCalendarType", ")", ";", "return", "sDateTimePattern", ".", "replace", "(", "\"{0}\"", ",", "sTimePattern", ")", ".", "replace", "(", "\"{1}\"", ",", "sDatePattern", ")", ";", "}" ]
Get combined datetime pattern with given date and and time style. @param {string} sDateStyle the required style for the date part @param {string} sTimeStyle the required style for the time part @param {sap.ui.core.CalendarType} [sCalendarType] the type of calendar. If it's not set, it falls back to the calendar type either set in configuration or calculated from locale. @returns {string} the combined datetime pattern @public
[ "Get", "combined", "datetime", "pattern", "with", "given", "date", "and", "and", "time", "style", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L247-L254
4,565
SAP/openui5
src/sap.ui.core/src/sap/ui/core/LocaleData.js
function(sPattern, sCalendarType) { var oIntervalFormats = this._get(getCLDRCalendarName(sCalendarType), "dateTimeFormats", "intervalFormats"), sFallbackPattern = oIntervalFormats.intervalFormatFallback; return sFallbackPattern.replace(/\{(0|1)\}/g, sPattern); }
javascript
function(sPattern, sCalendarType) { var oIntervalFormats = this._get(getCLDRCalendarName(sCalendarType), "dateTimeFormats", "intervalFormats"), sFallbackPattern = oIntervalFormats.intervalFormatFallback; return sFallbackPattern.replace(/\{(0|1)\}/g, sPattern); }
[ "function", "(", "sPattern", ",", "sCalendarType", ")", "{", "var", "oIntervalFormats", "=", "this", ".", "_get", "(", "getCLDRCalendarName", "(", "sCalendarType", ")", ",", "\"dateTimeFormats\"", ",", "\"intervalFormats\"", ")", ",", "sFallbackPattern", "=", "oIntervalFormats", ".", "intervalFormatFallback", ";", "return", "sFallbackPattern", ".", "replace", "(", "/", "\\{(0|1)\\}", "/", "g", ",", "sPattern", ")", ";", "}" ]
Get combined interval pattern using a given pattern and the fallback interval pattern. If a skeleton based pattern is not available or not wanted, this method can be used to create an interval pattern based on a given pattern, using the fallback interval pattern. @param {string} sPattern the single date pattern to use within the interval pattern @param {sap.ui.core.CalendarType} [sCalendarType] the type of calendar. If it's not set, it falls back to the calendar type either set in configuration or calculated from locale. @returns {string} the calculated interval pattern @since 1.46 @public
[ "Get", "combined", "interval", "pattern", "using", "a", "given", "pattern", "and", "the", "fallback", "interval", "pattern", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L319-L323
4,566
SAP/openui5
src/sap.ui.core/src/sap/ui/core/LocaleData.js
function(sSkeleton, vGreatestDiff, sCalendarType) { var oAvailableFormats = this._get(getCLDRCalendarName(sCalendarType), "dateTimeFormats", "intervalFormats"); return this._getFormatPattern(sSkeleton, oAvailableFormats, sCalendarType, vGreatestDiff); }
javascript
function(sSkeleton, vGreatestDiff, sCalendarType) { var oAvailableFormats = this._get(getCLDRCalendarName(sCalendarType), "dateTimeFormats", "intervalFormats"); return this._getFormatPattern(sSkeleton, oAvailableFormats, sCalendarType, vGreatestDiff); }
[ "function", "(", "sSkeleton", ",", "vGreatestDiff", ",", "sCalendarType", ")", "{", "var", "oAvailableFormats", "=", "this", ".", "_get", "(", "getCLDRCalendarName", "(", "sCalendarType", ")", ",", "\"dateTimeFormats\"", ",", "\"intervalFormats\"", ")", ";", "return", "this", ".", "_getFormatPattern", "(", "sSkeleton", ",", "oAvailableFormats", ",", "sCalendarType", ",", "vGreatestDiff", ")", ";", "}" ]
Get interval pattern for a given skeleton format. The format string does contain pattern symbols (e.g. "yMMMd" or "Hms") and will be converted into the pattern in the used locale, which matches the wanted symbols best. The symbols must be in canonical order, that is: Era (G), Year (y/Y), Quarter (q/Q), Month (M/L), Week (w/W), Day-Of-Week (E/e/c), Day (d/D), Hour (h/H/k/K/), Minute (m), Second (s), Timezone (z/Z/v/V/O/X/x) See http://unicode.org/reports/tr35/tr35-dates.html#availableFormats_appendItems @param {string} sSkeleton the wanted skeleton format for the datetime pattern @param {object|string} vGreatestDiff is either a string which represents the symbol matching the greatest difference in the two dates to format or an object which contains key-value pairs. The value is always true. The key is one of the date field symbol groups whose value are different between the two dates. The key can only be set with 'Year', 'Quarter', 'Month', 'Week', 'Day', 'DayPeriod', 'Hour', 'Minute', or 'Second'. @param {sap.ui.core.CalendarType} [sCalendarType] the type of calendar. If it's not set, it falls back to the calendar type either set in configuration or calculated from locale. @returns {string|string[]} the best matching interval pattern if interval difference is given otherwise an array with all possible interval patterns which match the given skeleton format @since 1.46 @public
[ "Get", "interval", "pattern", "for", "a", "given", "skeleton", "format", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L344-L347
4,567
SAP/openui5
src/sap.ui.core/src/sap/ui/core/LocaleData.js
function () { var mCustomCurrencies = this._get("currency") || {}, mCustomCurrencyCodes = {}; Object.keys(mCustomCurrencies).forEach(function (sCurrencyKey) { mCustomCurrencyCodes[sCurrencyKey] = sCurrencyKey; }); return mCustomCurrencyCodes; }
javascript
function () { var mCustomCurrencies = this._get("currency") || {}, mCustomCurrencyCodes = {}; Object.keys(mCustomCurrencies).forEach(function (sCurrencyKey) { mCustomCurrencyCodes[sCurrencyKey] = sCurrencyKey; }); return mCustomCurrencyCodes; }
[ "function", "(", ")", "{", "var", "mCustomCurrencies", "=", "this", ".", "_get", "(", "\"currency\"", ")", "||", "{", "}", ",", "mCustomCurrencyCodes", "=", "{", "}", ";", "Object", ".", "keys", "(", "mCustomCurrencies", ")", ".", "forEach", "(", "function", "(", "sCurrencyKey", ")", "{", "mCustomCurrencyCodes", "[", "sCurrencyKey", "]", "=", "sCurrencyKey", ";", "}", ")", ";", "return", "mCustomCurrencyCodes", ";", "}" ]
Returns a map of custom currency codes, defined via global configuration. @returns {object} map of custom currency codes, e.g. { "AUD": "AUD", "BRL": "BRL", "EUR": "EUR", "GBP": "GBP", } @sap-restricted sap.ui.core.format.NumberFormat @private @since 1.63
[ "Returns", "a", "map", "of", "custom", "currency", "codes", "defined", "via", "global", "configuration", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L944-L953
4,568
SAP/openui5
src/sap.ui.core/src/sap/ui/core/LocaleData.js
function(sCurrency) { // try to lookup currency digits from custom currencies var mCustomCurrencies = this._get("currency"); if (mCustomCurrencies) { if (mCustomCurrencies[sCurrency] && mCustomCurrencies[sCurrency].hasOwnProperty("digits")) { return mCustomCurrencies[sCurrency].digits; } else if (mCustomCurrencies["DEFAULT"] && mCustomCurrencies["DEFAULT"].hasOwnProperty("digits")) { return mCustomCurrencies["DEFAULT"].digits; } } var iDigits = this._get("currencyDigits", sCurrency); if (iDigits == null) { iDigits = this._get("currencyDigits", "DEFAULT"); if (iDigits == null) { iDigits = 2; // default } } return iDigits; }
javascript
function(sCurrency) { // try to lookup currency digits from custom currencies var mCustomCurrencies = this._get("currency"); if (mCustomCurrencies) { if (mCustomCurrencies[sCurrency] && mCustomCurrencies[sCurrency].hasOwnProperty("digits")) { return mCustomCurrencies[sCurrency].digits; } else if (mCustomCurrencies["DEFAULT"] && mCustomCurrencies["DEFAULT"].hasOwnProperty("digits")) { return mCustomCurrencies["DEFAULT"].digits; } } var iDigits = this._get("currencyDigits", sCurrency); if (iDigits == null) { iDigits = this._get("currencyDigits", "DEFAULT"); if (iDigits == null) { iDigits = 2; // default } } return iDigits; }
[ "function", "(", "sCurrency", ")", "{", "// try to lookup currency digits from custom currencies", "var", "mCustomCurrencies", "=", "this", ".", "_get", "(", "\"currency\"", ")", ";", "if", "(", "mCustomCurrencies", ")", "{", "if", "(", "mCustomCurrencies", "[", "sCurrency", "]", "&&", "mCustomCurrencies", "[", "sCurrency", "]", ".", "hasOwnProperty", "(", "\"digits\"", ")", ")", "{", "return", "mCustomCurrencies", "[", "sCurrency", "]", ".", "digits", ";", "}", "else", "if", "(", "mCustomCurrencies", "[", "\"DEFAULT\"", "]", "&&", "mCustomCurrencies", "[", "\"DEFAULT\"", "]", ".", "hasOwnProperty", "(", "\"digits\"", ")", ")", "{", "return", "mCustomCurrencies", "[", "\"DEFAULT\"", "]", ".", "digits", ";", "}", "}", "var", "iDigits", "=", "this", ".", "_get", "(", "\"currencyDigits\"", ",", "sCurrency", ")", ";", "if", "(", "iDigits", "==", "null", ")", "{", "iDigits", "=", "this", ".", "_get", "(", "\"currencyDigits\"", ",", "\"DEFAULT\"", ")", ";", "if", "(", "iDigits", "==", "null", ")", "{", "iDigits", "=", "2", ";", "// default", "}", "}", "return", "iDigits", ";", "}" ]
Returns the number of digits of the specified currency. @param {string} sCurrency ISO 4217 currency code @returns {int} digits of the currency @public @since 1.21.1
[ "Returns", "the", "number", "of", "digits", "of", "the", "specified", "currency", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L963-L984
4,569
SAP/openui5
src/sap.ui.core/src/sap/ui/core/LocaleData.js
function(sCurrencySymbol) { var oCurrencySymbols = this._get("currencySymbols"), sCurrencyCode; for (sCurrencyCode in oCurrencySymbols) { if (oCurrencySymbols[sCurrencyCode] === sCurrencySymbol) { return sCurrencyCode; } } return sCurrencySymbol; }
javascript
function(sCurrencySymbol) { var oCurrencySymbols = this._get("currencySymbols"), sCurrencyCode; for (sCurrencyCode in oCurrencySymbols) { if (oCurrencySymbols[sCurrencyCode] === sCurrencySymbol) { return sCurrencyCode; } } return sCurrencySymbol; }
[ "function", "(", "sCurrencySymbol", ")", "{", "var", "oCurrencySymbols", "=", "this", ".", "_get", "(", "\"currencySymbols\"", ")", ",", "sCurrencyCode", ";", "for", "(", "sCurrencyCode", "in", "oCurrencySymbols", ")", "{", "if", "(", "oCurrencySymbols", "[", "sCurrencyCode", "]", "===", "sCurrencySymbol", ")", "{", "return", "sCurrencyCode", ";", "}", "}", "return", "sCurrencySymbol", ";", "}" ]
Returns the currency code which is corresponded with the given currency symbol. @param {string} sCurrencySymbol The currency symbol which needs to be converted to currency code @return {string} The corresponded currency code defined for the given currency symbol. The given currency symbol is returned if no currency code can be found by using the given currency symbol. @public @since 1.27.0
[ "Returns", "the", "currency", "code", "which", "is", "corresponded", "with", "the", "given", "currency", "symbol", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L1007-L1015
4,570
SAP/openui5
src/sap.ui.core/src/sap/ui/core/LocaleData.js
function() { // Lookup into global Config var mCustomCurrencies = this._get("currency"), mCustomCurrencySymbols = {}, sIsoCode; for (var sCurrencyKey in mCustomCurrencies) { sIsoCode = mCustomCurrencies[sCurrencyKey].isoCode; if (mCustomCurrencies[sCurrencyKey].symbol) { mCustomCurrencySymbols[sCurrencyKey] = mCustomCurrencies[sCurrencyKey].symbol; } else if (sIsoCode) { mCustomCurrencySymbols[sCurrencyKey] = this._get("currencySymbols")[sIsoCode]; } } return Object.assign({}, this._get("currencySymbols"), mCustomCurrencySymbols); }
javascript
function() { // Lookup into global Config var mCustomCurrencies = this._get("currency"), mCustomCurrencySymbols = {}, sIsoCode; for (var sCurrencyKey in mCustomCurrencies) { sIsoCode = mCustomCurrencies[sCurrencyKey].isoCode; if (mCustomCurrencies[sCurrencyKey].symbol) { mCustomCurrencySymbols[sCurrencyKey] = mCustomCurrencies[sCurrencyKey].symbol; } else if (sIsoCode) { mCustomCurrencySymbols[sCurrencyKey] = this._get("currencySymbols")[sIsoCode]; } } return Object.assign({}, this._get("currencySymbols"), mCustomCurrencySymbols); }
[ "function", "(", ")", "{", "// Lookup into global Config", "var", "mCustomCurrencies", "=", "this", ".", "_get", "(", "\"currency\"", ")", ",", "mCustomCurrencySymbols", "=", "{", "}", ",", "sIsoCode", ";", "for", "(", "var", "sCurrencyKey", "in", "mCustomCurrencies", ")", "{", "sIsoCode", "=", "mCustomCurrencies", "[", "sCurrencyKey", "]", ".", "isoCode", ";", "if", "(", "mCustomCurrencies", "[", "sCurrencyKey", "]", ".", "symbol", ")", "{", "mCustomCurrencySymbols", "[", "sCurrencyKey", "]", "=", "mCustomCurrencies", "[", "sCurrencyKey", "]", ".", "symbol", ";", "}", "else", "if", "(", "sIsoCode", ")", "{", "mCustomCurrencySymbols", "[", "sCurrencyKey", "]", "=", "this", ".", "_get", "(", "\"currencySymbols\"", ")", "[", "sIsoCode", "]", ";", "}", "}", "return", "Object", ".", "assign", "(", "{", "}", ",", "this", ".", "_get", "(", "\"currencySymbols\"", ")", ",", "mCustomCurrencySymbols", ")", ";", "}" ]
Returns the currency symbols available for this locale. Currency symbols get accumulated by custom currency symbols. @returns {object} the map of all currency symbols available in this locale, e.g. { "AUD": "A$", "BRL": "R$", "EUR": "€", "GBP": "£", } @public @since 1.60
[ "Returns", "the", "currency", "symbols", "available", "for", "this", "locale", ".", "Currency", "symbols", "get", "accumulated", "by", "custom", "currency", "symbols", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L1031-L1048
4,571
SAP/openui5
src/sap.ui.core/src/sap/ui/core/LocaleData.js
function(aScales, sStyle) { if (sStyle === undefined) { sStyle = "wide"; } assert(sStyle === "wide" || sStyle === "short" || sStyle === "narrow", "sStyle is only allowed to be set with 'wide', 'short' or 'narrow'"); var aPatterns = [], aPluralCategories = this.getPluralCategories(), oScale, oTimeEntry, iValue, iSign; if (!aScales) { aScales = ["year", "month", "week", "day", "hour", "minute", "second"]; } aScales.forEach(function(sScale) { oScale = this._get("dateFields", sScale + "-" + sStyle); for (var sEntry in oScale) { if (sEntry.indexOf("relative-type-") === 0) { iValue = parseInt(sEntry.substr(14)); aPatterns.push({ scale: sScale, value: iValue, pattern: oScale[sEntry] }); } else if (sEntry.indexOf("relativeTime-type-") == 0) { oTimeEntry = oScale[sEntry]; iSign = sEntry.substr(18) === "past" ? -1 : 1; aPluralCategories.forEach(function(sKey) { // eslint-disable-line no-loop-func aPatterns.push({ scale: sScale, sign: iSign, pattern: oTimeEntry["relativeTimePattern-count-" + sKey] }); }); } } }.bind(this)); return aPatterns; }
javascript
function(aScales, sStyle) { if (sStyle === undefined) { sStyle = "wide"; } assert(sStyle === "wide" || sStyle === "short" || sStyle === "narrow", "sStyle is only allowed to be set with 'wide', 'short' or 'narrow'"); var aPatterns = [], aPluralCategories = this.getPluralCategories(), oScale, oTimeEntry, iValue, iSign; if (!aScales) { aScales = ["year", "month", "week", "day", "hour", "minute", "second"]; } aScales.forEach(function(sScale) { oScale = this._get("dateFields", sScale + "-" + sStyle); for (var sEntry in oScale) { if (sEntry.indexOf("relative-type-") === 0) { iValue = parseInt(sEntry.substr(14)); aPatterns.push({ scale: sScale, value: iValue, pattern: oScale[sEntry] }); } else if (sEntry.indexOf("relativeTime-type-") == 0) { oTimeEntry = oScale[sEntry]; iSign = sEntry.substr(18) === "past" ? -1 : 1; aPluralCategories.forEach(function(sKey) { // eslint-disable-line no-loop-func aPatterns.push({ scale: sScale, sign: iSign, pattern: oTimeEntry["relativeTimePattern-count-" + sKey] }); }); } } }.bind(this)); return aPatterns; }
[ "function", "(", "aScales", ",", "sStyle", ")", "{", "if", "(", "sStyle", "===", "undefined", ")", "{", "sStyle", "=", "\"wide\"", ";", "}", "assert", "(", "sStyle", "===", "\"wide\"", "||", "sStyle", "===", "\"short\"", "||", "sStyle", "===", "\"narrow\"", ",", "\"sStyle is only allowed to be set with 'wide', 'short' or 'narrow'\"", ")", ";", "var", "aPatterns", "=", "[", "]", ",", "aPluralCategories", "=", "this", ".", "getPluralCategories", "(", ")", ",", "oScale", ",", "oTimeEntry", ",", "iValue", ",", "iSign", ";", "if", "(", "!", "aScales", ")", "{", "aScales", "=", "[", "\"year\"", ",", "\"month\"", ",", "\"week\"", ",", "\"day\"", ",", "\"hour\"", ",", "\"minute\"", ",", "\"second\"", "]", ";", "}", "aScales", ".", "forEach", "(", "function", "(", "sScale", ")", "{", "oScale", "=", "this", ".", "_get", "(", "\"dateFields\"", ",", "sScale", "+", "\"-\"", "+", "sStyle", ")", ";", "for", "(", "var", "sEntry", "in", "oScale", ")", "{", "if", "(", "sEntry", ".", "indexOf", "(", "\"relative-type-\"", ")", "===", "0", ")", "{", "iValue", "=", "parseInt", "(", "sEntry", ".", "substr", "(", "14", ")", ")", ";", "aPatterns", ".", "push", "(", "{", "scale", ":", "sScale", ",", "value", ":", "iValue", ",", "pattern", ":", "oScale", "[", "sEntry", "]", "}", ")", ";", "}", "else", "if", "(", "sEntry", ".", "indexOf", "(", "\"relativeTime-type-\"", ")", "==", "0", ")", "{", "oTimeEntry", "=", "oScale", "[", "sEntry", "]", ";", "iSign", "=", "sEntry", ".", "substr", "(", "18", ")", "===", "\"past\"", "?", "-", "1", ":", "1", ";", "aPluralCategories", ".", "forEach", "(", "function", "(", "sKey", ")", "{", "// eslint-disable-line no-loop-func", "aPatterns", ".", "push", "(", "{", "scale", ":", "sScale", ",", "sign", ":", "iSign", ",", "pattern", ":", "oTimeEntry", "[", "\"relativeTimePattern-count-\"", "+", "sKey", "]", "}", ")", ";", "}", ")", ";", "}", "}", "}", ".", "bind", "(", "this", ")", ")", ";", "return", "aPatterns", ";", "}" ]
Returns relative time patterns for the given scales as an array of objects containing scale, value and pattern. The array may contain the following values: "year", "month", "week", "day", "hour", "minute" and "second". If no scales are given, patterns for all available scales will be returned. The return array will contain objects looking like: <pre> { scale: "minute", sign: 1, pattern: "in {0} minutes" } </pre> @param {string[]} aScales The scales for which the available patterns should be returned @param {string} [sStyle="wide"] @since 1.32.10, 1.34.4 The style of the scale patterns. The valid values are "wide", "short" and "narrow". @returns {object[]} An array of all relative time patterns @public @since 1.34
[ "Returns", "relative", "time", "patterns", "for", "the", "given", "scales", "as", "an", "array", "of", "objects", "containing", "scale", "value", "and", "pattern", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L1084-L1127
4,572
SAP/openui5
src/sap.ui.core/src/sap/ui/core/LocaleData.js
function(sWidth, sCalendarType) { assert(sWidth == "wide" || sWidth == "abbreviated" || sWidth == "narrow" , "sWidth must be wide, abbreviate or narrow"); //TODO Adapt generation so that eras are an array instead of object var oEras = this._get(getCLDRCalendarName(sCalendarType), "era-" + sWidth), aEras = []; for (var i in oEras) { aEras[parseInt(i)] = oEras[i]; } return aEras; }
javascript
function(sWidth, sCalendarType) { assert(sWidth == "wide" || sWidth == "abbreviated" || sWidth == "narrow" , "sWidth must be wide, abbreviate or narrow"); //TODO Adapt generation so that eras are an array instead of object var oEras = this._get(getCLDRCalendarName(sCalendarType), "era-" + sWidth), aEras = []; for (var i in oEras) { aEras[parseInt(i)] = oEras[i]; } return aEras; }
[ "function", "(", "sWidth", ",", "sCalendarType", ")", "{", "assert", "(", "sWidth", "==", "\"wide\"", "||", "sWidth", "==", "\"abbreviated\"", "||", "sWidth", "==", "\"narrow\"", ",", "\"sWidth must be wide, abbreviate or narrow\"", ")", ";", "//TODO Adapt generation so that eras are an array instead of object", "var", "oEras", "=", "this", ".", "_get", "(", "getCLDRCalendarName", "(", "sCalendarType", ")", ",", "\"era-\"", "+", "sWidth", ")", ",", "aEras", "=", "[", "]", ";", "for", "(", "var", "i", "in", "oEras", ")", "{", "aEras", "[", "parseInt", "(", "i", ")", "]", "=", "oEras", "[", "i", "]", ";", "}", "return", "aEras", ";", "}" ]
Returns array of eras. @param {string} sWidth the style of the era name. It can be 'wide', 'abbreviated' or 'narrow' @param {sap.ui.core.CalendarType} [sCalendarType] the type of calendar @return {array} the array of eras @public @since 1.32.0
[ "Returns", "array", "of", "eras", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L1466-L1476
4,573
SAP/openui5
src/sap.ui.core/src/sap/ui/core/LocaleData.js
function(sCalendarType) { //TODO Adapt generation so that eradates are an array instead of object var oEraDates = this._get("eras-" + sCalendarType.toLowerCase()), aEraDates = []; for (var i in oEraDates) { aEraDates[parseInt(i)] = oEraDates[i]; } return aEraDates; }
javascript
function(sCalendarType) { //TODO Adapt generation so that eradates are an array instead of object var oEraDates = this._get("eras-" + sCalendarType.toLowerCase()), aEraDates = []; for (var i in oEraDates) { aEraDates[parseInt(i)] = oEraDates[i]; } return aEraDates; }
[ "function", "(", "sCalendarType", ")", "{", "//TODO Adapt generation so that eradates are an array instead of object", "var", "oEraDates", "=", "this", ".", "_get", "(", "\"eras-\"", "+", "sCalendarType", ".", "toLowerCase", "(", ")", ")", ",", "aEraDates", "=", "[", "]", ";", "for", "(", "var", "i", "in", "oEraDates", ")", "{", "aEraDates", "[", "parseInt", "(", "i", ")", "]", "=", "oEraDates", "[", "i", "]", ";", "}", "return", "aEraDates", ";", "}" ]
Returns the map of era IDs to era dates. @param {sap.ui.core.CalendarType} [sCalendarType] the type of calendar @return {array} the array of eras containing objects with either an _end or _start property with a date @public @since 1.32.0
[ "Returns", "the", "map", "of", "era", "IDs", "to", "era", "dates", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L1486-L1494
4,574
SAP/openui5
src/sap.ui.core/src/sap/ui/core/LocaleData.js
function(sStyle, iWeekNumber) { assert(sStyle == "wide" || sStyle == "narrow" , "sStyle must be wide or narrow"); var oMessageBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.core", this.oLocale.toString()), sKey = "date.week.calendarweek." + sStyle; return oMessageBundle.getText(sKey, iWeekNumber); }
javascript
function(sStyle, iWeekNumber) { assert(sStyle == "wide" || sStyle == "narrow" , "sStyle must be wide or narrow"); var oMessageBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.core", this.oLocale.toString()), sKey = "date.week.calendarweek." + sStyle; return oMessageBundle.getText(sKey, iWeekNumber); }
[ "function", "(", "sStyle", ",", "iWeekNumber", ")", "{", "assert", "(", "sStyle", "==", "\"wide\"", "||", "sStyle", "==", "\"narrow\"", ",", "\"sStyle must be wide or narrow\"", ")", ";", "var", "oMessageBundle", "=", "sap", ".", "ui", ".", "getCore", "(", ")", ".", "getLibraryResourceBundle", "(", "\"sap.ui.core\"", ",", "this", ".", "oLocale", ".", "toString", "(", ")", ")", ",", "sKey", "=", "\"date.week.calendarweek.\"", "+", "sStyle", ";", "return", "oMessageBundle", ".", "getText", "(", "sKey", ",", "iWeekNumber", ")", ";", "}" ]
Returns the defined pattern for representing the calendar week number. @param {string} sStyle the style of the pattern. It can only be either "wide" or "narrow". @param {int} iWeekNumber the week number @return {string} the week number string @public @since 1.32.0
[ "Returns", "the", "defined", "pattern", "for", "representing", "the", "calendar", "week", "number", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L1506-L1513
4,575
SAP/openui5
src/sap.ui.core/src/sap/ui/core/LocaleData.js
getCLDRCalendarName
function getCLDRCalendarName(sCalendarType) { if (!sCalendarType) { sCalendarType = sap.ui.getCore().getConfiguration().getCalendarType(); } return "ca-" + sCalendarType.toLowerCase(); }
javascript
function getCLDRCalendarName(sCalendarType) { if (!sCalendarType) { sCalendarType = sap.ui.getCore().getConfiguration().getCalendarType(); } return "ca-" + sCalendarType.toLowerCase(); }
[ "function", "getCLDRCalendarName", "(", "sCalendarType", ")", "{", "if", "(", "!", "sCalendarType", ")", "{", "sCalendarType", "=", "sap", ".", "ui", ".", "getCore", "(", ")", ".", "getConfiguration", "(", ")", ".", "getCalendarType", "(", ")", ";", "}", "return", "\"ca-\"", "+", "sCalendarType", ".", "toLowerCase", "(", ")", ";", "}" ]
Returns the corresponding calendar name in CLDR of the given calendar type, or the calendar type from the configuration, in case sCalendarType is undefined. @param {sap.ui.core.CalendarType} sCalendarType the type defined in {@link sap.ui.core.CalendarType}. @private
[ "Returns", "the", "corresponding", "calendar", "name", "in", "CLDR", "of", "the", "given", "calendar", "type", "or", "the", "calendar", "type", "from", "the", "configuration", "in", "case", "sCalendarType", "is", "undefined", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L3190-L3195
4,576
SAP/openui5
src/sap.ui.core/src/sap/ui/core/LocaleData.js
getData
function getData(oLocale) { var sLanguage = oLocale.getLanguage() || "", sScript = oLocale.getScript() || "", sRegion = oLocale.getRegion() || "", mData; /* * Merge a CLDR delta file and a CLDR fallback file. * * Note: the contract of this method reg. null values differs from both, * jQuery.extend as well as jQuery.sap.extend. */ function merge(obj, fallbackObj) { var name, value, fallbackValue; if ( !fallbackObj ) { return; } for ( name in fallbackObj ) { if ( fallbackObj.hasOwnProperty(name) ) { value = obj[ name ]; fallbackValue = fallbackObj[ name ]; if ( value === undefined ) { // 'undefined': value doesn't exist in delta, so take it from the fallback object // Note: undefined is not a valid value in JSON, so we can't misunderstand an existing undefined obj[name] = fallbackValue; } else if ( value === null ) { // 'null' is used by the delta tooling as a marker that a value must not be taken form the fallback delete obj[name]; } else if ( typeof value === 'object' && typeof fallbackValue === 'object' ) { // both values are objects, merge them recursively merge(value, fallbackValue); } } } } function getOrLoad(sId) { if ( !mLocaleDatas[sId] && (!M_SUPPORTED_LOCALES || M_SUPPORTED_LOCALES[sId] === true) ) { var data = mLocaleDatas[sId] = LoaderExtensions.loadResource("sap/ui/core/cldr/" + sId + ".json", { dataType: "json", failOnError : false }); // check if the data is a minified delta file. // If so, load the corresponding fallback data as well, merge it and remove the fallback marker if ( data && data.__fallbackLocale ) { merge(data, getOrLoad(data.__fallbackLocale)); delete data.__fallbackLocale; } // if load fails, null is returned // -> caller will process the fallback chain, in the end a result is identified and stored in mDatas under the originally requested ID } return mLocaleDatas[sId]; } // normalize language and handle special cases sLanguage = (sLanguage && M_ISO639_OLD_TO_NEW[sLanguage]) || sLanguage; // Special case 1: in an SAP context, the inclusive language code "no" always means Norwegian Bokmal ("nb") if ( sLanguage === "no" ) { sLanguage = "nb"; } // Special case 2: for Chinese, derive a default region from the script (this behavior is inherited from Java) if ( sLanguage === "zh" && !sRegion ) { if ( sScript === "Hans" ) { sRegion = "CN"; } else if ( sScript === "Hant" ) { sRegion = "TW"; } } var sId = sLanguage + "_" + sRegion; // the originally requested locale; this is the key under which the result (even a fallback one) will be stored in the end // first try: load CLDR data for specific language / region combination if ( sLanguage && sRegion ) { mData = getOrLoad(sId); } // second try: load data for language only if ( !mData && sLanguage ) { mData = getOrLoad(sLanguage); } // last try: use fallback data mLocaleDatas[sId] = mData || M_DEFAULT_DATA; return mLocaleDatas[sId]; }
javascript
function getData(oLocale) { var sLanguage = oLocale.getLanguage() || "", sScript = oLocale.getScript() || "", sRegion = oLocale.getRegion() || "", mData; /* * Merge a CLDR delta file and a CLDR fallback file. * * Note: the contract of this method reg. null values differs from both, * jQuery.extend as well as jQuery.sap.extend. */ function merge(obj, fallbackObj) { var name, value, fallbackValue; if ( !fallbackObj ) { return; } for ( name in fallbackObj ) { if ( fallbackObj.hasOwnProperty(name) ) { value = obj[ name ]; fallbackValue = fallbackObj[ name ]; if ( value === undefined ) { // 'undefined': value doesn't exist in delta, so take it from the fallback object // Note: undefined is not a valid value in JSON, so we can't misunderstand an existing undefined obj[name] = fallbackValue; } else if ( value === null ) { // 'null' is used by the delta tooling as a marker that a value must not be taken form the fallback delete obj[name]; } else if ( typeof value === 'object' && typeof fallbackValue === 'object' ) { // both values are objects, merge them recursively merge(value, fallbackValue); } } } } function getOrLoad(sId) { if ( !mLocaleDatas[sId] && (!M_SUPPORTED_LOCALES || M_SUPPORTED_LOCALES[sId] === true) ) { var data = mLocaleDatas[sId] = LoaderExtensions.loadResource("sap/ui/core/cldr/" + sId + ".json", { dataType: "json", failOnError : false }); // check if the data is a minified delta file. // If so, load the corresponding fallback data as well, merge it and remove the fallback marker if ( data && data.__fallbackLocale ) { merge(data, getOrLoad(data.__fallbackLocale)); delete data.__fallbackLocale; } // if load fails, null is returned // -> caller will process the fallback chain, in the end a result is identified and stored in mDatas under the originally requested ID } return mLocaleDatas[sId]; } // normalize language and handle special cases sLanguage = (sLanguage && M_ISO639_OLD_TO_NEW[sLanguage]) || sLanguage; // Special case 1: in an SAP context, the inclusive language code "no" always means Norwegian Bokmal ("nb") if ( sLanguage === "no" ) { sLanguage = "nb"; } // Special case 2: for Chinese, derive a default region from the script (this behavior is inherited from Java) if ( sLanguage === "zh" && !sRegion ) { if ( sScript === "Hans" ) { sRegion = "CN"; } else if ( sScript === "Hant" ) { sRegion = "TW"; } } var sId = sLanguage + "_" + sRegion; // the originally requested locale; this is the key under which the result (even a fallback one) will be stored in the end // first try: load CLDR data for specific language / region combination if ( sLanguage && sRegion ) { mData = getOrLoad(sId); } // second try: load data for language only if ( !mData && sLanguage ) { mData = getOrLoad(sLanguage); } // last try: use fallback data mLocaleDatas[sId] = mData || M_DEFAULT_DATA; return mLocaleDatas[sId]; }
[ "function", "getData", "(", "oLocale", ")", "{", "var", "sLanguage", "=", "oLocale", ".", "getLanguage", "(", ")", "||", "\"\"", ",", "sScript", "=", "oLocale", ".", "getScript", "(", ")", "||", "\"\"", ",", "sRegion", "=", "oLocale", ".", "getRegion", "(", ")", "||", "\"\"", ",", "mData", ";", "/*\n\t\t * Merge a CLDR delta file and a CLDR fallback file.\n\t\t *\n\t\t * Note: the contract of this method reg. null values differs from both,\n\t\t * jQuery.extend as well as jQuery.sap.extend.\n\t\t */", "function", "merge", "(", "obj", ",", "fallbackObj", ")", "{", "var", "name", ",", "value", ",", "fallbackValue", ";", "if", "(", "!", "fallbackObj", ")", "{", "return", ";", "}", "for", "(", "name", "in", "fallbackObj", ")", "{", "if", "(", "fallbackObj", ".", "hasOwnProperty", "(", "name", ")", ")", "{", "value", "=", "obj", "[", "name", "]", ";", "fallbackValue", "=", "fallbackObj", "[", "name", "]", ";", "if", "(", "value", "===", "undefined", ")", "{", "// 'undefined': value doesn't exist in delta, so take it from the fallback object", "// Note: undefined is not a valid value in JSON, so we can't misunderstand an existing undefined", "obj", "[", "name", "]", "=", "fallbackValue", ";", "}", "else", "if", "(", "value", "===", "null", ")", "{", "// 'null' is used by the delta tooling as a marker that a value must not be taken form the fallback", "delete", "obj", "[", "name", "]", ";", "}", "else", "if", "(", "typeof", "value", "===", "'object'", "&&", "typeof", "fallbackValue", "===", "'object'", ")", "{", "// both values are objects, merge them recursively", "merge", "(", "value", ",", "fallbackValue", ")", ";", "}", "}", "}", "}", "function", "getOrLoad", "(", "sId", ")", "{", "if", "(", "!", "mLocaleDatas", "[", "sId", "]", "&&", "(", "!", "M_SUPPORTED_LOCALES", "||", "M_SUPPORTED_LOCALES", "[", "sId", "]", "===", "true", ")", ")", "{", "var", "data", "=", "mLocaleDatas", "[", "sId", "]", "=", "LoaderExtensions", ".", "loadResource", "(", "\"sap/ui/core/cldr/\"", "+", "sId", "+", "\".json\"", ",", "{", "dataType", ":", "\"json\"", ",", "failOnError", ":", "false", "}", ")", ";", "// check if the data is a minified delta file.", "// If so, load the corresponding fallback data as well, merge it and remove the fallback marker", "if", "(", "data", "&&", "data", ".", "__fallbackLocale", ")", "{", "merge", "(", "data", ",", "getOrLoad", "(", "data", ".", "__fallbackLocale", ")", ")", ";", "delete", "data", ".", "__fallbackLocale", ";", "}", "// if load fails, null is returned", "// -> caller will process the fallback chain, in the end a result is identified and stored in mDatas under the originally requested ID", "}", "return", "mLocaleDatas", "[", "sId", "]", ";", "}", "// normalize language and handle special cases", "sLanguage", "=", "(", "sLanguage", "&&", "M_ISO639_OLD_TO_NEW", "[", "sLanguage", "]", ")", "||", "sLanguage", ";", "// Special case 1: in an SAP context, the inclusive language code \"no\" always means Norwegian Bokmal (\"nb\")", "if", "(", "sLanguage", "===", "\"no\"", ")", "{", "sLanguage", "=", "\"nb\"", ";", "}", "// Special case 2: for Chinese, derive a default region from the script (this behavior is inherited from Java)", "if", "(", "sLanguage", "===", "\"zh\"", "&&", "!", "sRegion", ")", "{", "if", "(", "sScript", "===", "\"Hans\"", ")", "{", "sRegion", "=", "\"CN\"", ";", "}", "else", "if", "(", "sScript", "===", "\"Hant\"", ")", "{", "sRegion", "=", "\"TW\"", ";", "}", "}", "var", "sId", "=", "sLanguage", "+", "\"_\"", "+", "sRegion", ";", "// the originally requested locale; this is the key under which the result (even a fallback one) will be stored in the end", "// first try: load CLDR data for specific language / region combination", "if", "(", "sLanguage", "&&", "sRegion", ")", "{", "mData", "=", "getOrLoad", "(", "sId", ")", ";", "}", "// second try: load data for language only", "if", "(", "!", "mData", "&&", "sLanguage", ")", "{", "mData", "=", "getOrLoad", "(", "sLanguage", ")", ";", "}", "// last try: use fallback data", "mLocaleDatas", "[", "sId", "]", "=", "mData", "||", "M_DEFAULT_DATA", ";", "return", "mLocaleDatas", "[", "sId", "]", ";", "}" ]
Load LocaleData data from the CLDR generated files.
[ "Load", "LocaleData", "data", "from", "the", "CLDR", "generated", "files", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L3200-L3293
4,577
SAP/openui5
src/sap.ui.core/src/sap/ui/events/isSpecialKey.js
isModifierKey
function isModifierKey(oEvent) { var sKey = oEvent.key; // based on KeyBoardEvent.key (https://www.w3.org/TR/uievents/) and (https://www.w3.org/TR/uievents-key/) return (sKey === 'Shift') || (sKey === 'Control') || (sKey === 'Alt') || // Chrome uses 'Alt' and 'AltGraph, IE only use 'Alt' (sKey === 'AltGraph') || // see above -^ (sKey === 'CapsLock') || (sKey === 'NumLock'); }
javascript
function isModifierKey(oEvent) { var sKey = oEvent.key; // based on KeyBoardEvent.key (https://www.w3.org/TR/uievents/) and (https://www.w3.org/TR/uievents-key/) return (sKey === 'Shift') || (sKey === 'Control') || (sKey === 'Alt') || // Chrome uses 'Alt' and 'AltGraph, IE only use 'Alt' (sKey === 'AltGraph') || // see above -^ (sKey === 'CapsLock') || (sKey === 'NumLock'); }
[ "function", "isModifierKey", "(", "oEvent", ")", "{", "var", "sKey", "=", "oEvent", ".", "key", ";", "// based on KeyBoardEvent.key (https://www.w3.org/TR/uievents/) and (https://www.w3.org/TR/uievents-key/)", "return", "(", "sKey", "===", "'Shift'", ")", "||", "(", "sKey", "===", "'Control'", ")", "||", "(", "sKey", "===", "'Alt'", ")", "||", "// Chrome uses 'Alt' and 'AltGraph, IE only use 'Alt'", "(", "sKey", "===", "'AltGraph'", ")", "||", "// see above -^", "(", "sKey", "===", "'CapsLock'", ")", "||", "(", "sKey", "===", "'NumLock'", ")", ";", "}" ]
Detect whether the pressed key is a modifier. Modifier keys are considered: SHIFT, CONTROL, ALT, ALTGRAPH, CAPS_LOCK, NUM_LOCK These keys don't send characters, but modify the characters sent by other keys. @param {jQuery.Event} oEvent The event object of the <code>keydown</code>, <code>keyup</code> or <code>keypress</code> events. @static @returns {boolean} True if a modifier key was pressed
[ "Detect", "whether", "the", "pressed", "key", "is", "a", "modifier", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/events/isSpecialKey.js#L40-L48
4,578
SAP/openui5
src/sap.f/src/sap/f/DynamicPage.js
hasDOMElementSize
function hasDOMElementSize(oElement) { var oClientRect; if (!oElement) { return false; } oClientRect = oElement.getBoundingClientRect(); return !!(oClientRect.width && oClientRect.height); }
javascript
function hasDOMElementSize(oElement) { var oClientRect; if (!oElement) { return false; } oClientRect = oElement.getBoundingClientRect(); return !!(oClientRect.width && oClientRect.height); }
[ "function", "hasDOMElementSize", "(", "oElement", ")", "{", "var", "oClientRect", ";", "if", "(", "!", "oElement", ")", "{", "return", "false", ";", "}", "oClientRect", "=", "oElement", ".", "getBoundingClientRect", "(", ")", ";", "return", "!", "!", "(", "oClientRect", ".", "width", "&&", "oClientRect", ".", "height", ")", ";", "}" ]
Determines if DOM element has both width and height. @param {DOM Element} oElement @returns {boolean}
[ "Determines", "if", "DOM", "element", "has", "both", "width", "and", "height", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.f/src/sap/f/DynamicPage.js#L265-L275
4,579
SAP/openui5
src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/SubApiDetail.controller.js
function (oEvent) { var aPopoverContent = this._aSubClasses.map(function (oElement) { return new Link({ text: oElement, href: "#/api/" + oElement }).addStyleClass("sapUiTinyMarginBottom sapUiTinyMarginEnd"); }), oPopover = this._getSubClassesAndImplementationsPopover(aPopoverContent); oPopover.openBy(oEvent.getSource()); }
javascript
function (oEvent) { var aPopoverContent = this._aSubClasses.map(function (oElement) { return new Link({ text: oElement, href: "#/api/" + oElement }).addStyleClass("sapUiTinyMarginBottom sapUiTinyMarginEnd"); }), oPopover = this._getSubClassesAndImplementationsPopover(aPopoverContent); oPopover.openBy(oEvent.getSource()); }
[ "function", "(", "oEvent", ")", "{", "var", "aPopoverContent", "=", "this", ".", "_aSubClasses", ".", "map", "(", "function", "(", "oElement", ")", "{", "return", "new", "Link", "(", "{", "text", ":", "oElement", ",", "href", ":", "\"#/api/\"", "+", "oElement", "}", ")", ".", "addStyleClass", "(", "\"sapUiTinyMarginBottom sapUiTinyMarginEnd\"", ")", ";", "}", ")", ",", "oPopover", "=", "this", ".", "_getSubClassesAndImplementationsPopover", "(", "aPopoverContent", ")", ";", "oPopover", ".", "openBy", "(", "oEvent", ".", "getSource", "(", ")", ")", ";", "}" ]
Opens the Popover, which displays the entity subclasses, if the entity is a class. Or, it displays the direct implementations, if the entity is interface.
[ "Opens", "the", "Popover", "which", "displays", "the", "entity", "subclasses", "if", "the", "entity", "is", "a", "class", ".", "Or", "it", "displays", "the", "direct", "implementations", "if", "the", "entity", "is", "interface", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/SubApiDetail.controller.js#L427-L436
4,580
SAP/openui5
src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js
function(aUndoStack) { while (aUndoStack.length) { var oOperation = aUndoStack.pop(); this[oOperation.name].apply(this, oOperation.properties); } }
javascript
function(aUndoStack) { while (aUndoStack.length) { var oOperation = aUndoStack.pop(); this[oOperation.name].apply(this, oOperation.properties); } }
[ "function", "(", "aUndoStack", ")", "{", "while", "(", "aUndoStack", ".", "length", ")", "{", "var", "oOperation", "=", "aUndoStack", ".", "pop", "(", ")", ";", "this", "[", "oOperation", ".", "name", "]", ".", "apply", "(", "this", ",", "oOperation", ".", "properties", ")", ";", "}", "}" ]
Execute all recorded undo operations from stack @param {Array} aUndoStack stack of recorded undo operations
[ "Execute", "all", "recorded", "undo", "operations", "from", "stack" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js#L52-L57
4,581
SAP/openui5
src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js
function (oControl, bVisible) { var bOldVisible = this.getVisible(oControl); var vReturnValue = JsControlTreeModifier.setVisible.apply(this, arguments); /* If the visibility changed, record the reversal as undo operation */ if (bOldVisible !== this.getVisible(oControl)){ this._saveUndoOperation("setVisible", [oControl, bOldVisible]); } return vReturnValue; }
javascript
function (oControl, bVisible) { var bOldVisible = this.getVisible(oControl); var vReturnValue = JsControlTreeModifier.setVisible.apply(this, arguments); /* If the visibility changed, record the reversal as undo operation */ if (bOldVisible !== this.getVisible(oControl)){ this._saveUndoOperation("setVisible", [oControl, bOldVisible]); } return vReturnValue; }
[ "function", "(", "oControl", ",", "bVisible", ")", "{", "var", "bOldVisible", "=", "this", ".", "getVisible", "(", "oControl", ")", ";", "var", "vReturnValue", "=", "JsControlTreeModifier", ".", "setVisible", ".", "apply", "(", "this", ",", "arguments", ")", ";", "/* If the visibility changed, record the reversal as undo operation */", "if", "(", "bOldVisible", "!==", "this", ".", "getVisible", "(", "oControl", ")", ")", "{", "this", ".", "_saveUndoOperation", "(", "\"setVisible\"", ",", "[", "oControl", ",", "bOldVisible", "]", ")", ";", "}", "return", "vReturnValue", ";", "}" ]
Execute the visibility change from parent and record the opposite visibility as undo operation @override
[ "Execute", "the", "visibility", "change", "from", "parent", "and", "record", "the", "opposite", "visibility", "as", "undo", "operation" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js#L77-L88
4,582
SAP/openui5
src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js
function (oControl, sPropertyName, mBindingInfos) { var mOldBindingInfos = oControl.getBindingInfo(sPropertyName); var vOldValue; var oMetadata = oControl.getMetadata().getPropertyLikeSetting(sPropertyName); if (oMetadata) { var sPropertyGetter = oMetadata._sGetter; vOldValue = oControl[sPropertyGetter](); } JsControlTreeModifier.bindProperty.apply(this, arguments); if (mOldBindingInfos){ this._saveUndoOperation("bindProperty", [oControl, sPropertyName, mOldBindingInfos]); } else { this._saveUndoOperation("unbindProperty", [oControl, sPropertyName]); } if (vOldValue) { this._saveUndoOperation("setProperty", [oControl, sPropertyName, vOldValue]); } }
javascript
function (oControl, sPropertyName, mBindingInfos) { var mOldBindingInfos = oControl.getBindingInfo(sPropertyName); var vOldValue; var oMetadata = oControl.getMetadata().getPropertyLikeSetting(sPropertyName); if (oMetadata) { var sPropertyGetter = oMetadata._sGetter; vOldValue = oControl[sPropertyGetter](); } JsControlTreeModifier.bindProperty.apply(this, arguments); if (mOldBindingInfos){ this._saveUndoOperation("bindProperty", [oControl, sPropertyName, mOldBindingInfos]); } else { this._saveUndoOperation("unbindProperty", [oControl, sPropertyName]); } if (vOldValue) { this._saveUndoOperation("setProperty", [oControl, sPropertyName, vOldValue]); } }
[ "function", "(", "oControl", ",", "sPropertyName", ",", "mBindingInfos", ")", "{", "var", "mOldBindingInfos", "=", "oControl", ".", "getBindingInfo", "(", "sPropertyName", ")", ";", "var", "vOldValue", ";", "var", "oMetadata", "=", "oControl", ".", "getMetadata", "(", ")", ".", "getPropertyLikeSetting", "(", "sPropertyName", ")", ";", "if", "(", "oMetadata", ")", "{", "var", "sPropertyGetter", "=", "oMetadata", ".", "_sGetter", ";", "vOldValue", "=", "oControl", "[", "sPropertyGetter", "]", "(", ")", ";", "}", "JsControlTreeModifier", ".", "bindProperty", ".", "apply", "(", "this", ",", "arguments", ")", ";", "if", "(", "mOldBindingInfos", ")", "{", "this", ".", "_saveUndoOperation", "(", "\"bindProperty\"", ",", "[", "oControl", ",", "sPropertyName", ",", "mOldBindingInfos", "]", ")", ";", "}", "else", "{", "this", ".", "_saveUndoOperation", "(", "\"unbindProperty\"", ",", "[", "oControl", ",", "sPropertyName", "]", ")", ";", "}", "if", "(", "vOldValue", ")", "{", "this", ".", "_saveUndoOperation", "(", "\"setProperty\"", ",", "[", "oControl", ",", "sPropertyName", ",", "vOldValue", "]", ")", ";", "}", "}" ]
Execute the bind property and record unbindProperty as undo operation if property was not previously bound + save property value If the property had a previous value, this value is restored with the undo @override
[ "Execute", "the", "bind", "property", "and", "record", "unbindProperty", "as", "undo", "operation", "if", "property", "was", "not", "previously", "bound", "+", "save", "property", "value", "If", "the", "property", "had", "a", "previous", "value", "this", "value", "is", "restored", "with", "the", "undo" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js#L122-L142
4,583
SAP/openui5
src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js
function (oControl, sPropertyName) { var mOldBindingInfos = oControl.getBindingInfo(sPropertyName); JsControlTreeModifier.unbindProperty.apply(this, arguments); if (mOldBindingInfos){ this._saveUndoOperation("bindProperty", [oControl, sPropertyName, mOldBindingInfos]); } }
javascript
function (oControl, sPropertyName) { var mOldBindingInfos = oControl.getBindingInfo(sPropertyName); JsControlTreeModifier.unbindProperty.apply(this, arguments); if (mOldBindingInfos){ this._saveUndoOperation("bindProperty", [oControl, sPropertyName, mOldBindingInfos]); } }
[ "function", "(", "oControl", ",", "sPropertyName", ")", "{", "var", "mOldBindingInfos", "=", "oControl", ".", "getBindingInfo", "(", "sPropertyName", ")", ";", "JsControlTreeModifier", ".", "unbindProperty", ".", "apply", "(", "this", ",", "arguments", ")", ";", "if", "(", "mOldBindingInfos", ")", "{", "this", ".", "_saveUndoOperation", "(", "\"bindProperty\"", ",", "[", "oControl", ",", "sPropertyName", ",", "mOldBindingInfos", "]", ")", ";", "}", "}" ]
Unbind a property and record bindProperty as undo operation @param {sap.ui.core.Control} oControl The control containing the property @param {string} sPropertyName The property to be unbound
[ "Unbind", "a", "property", "and", "record", "bindProperty", "as", "undo", "operation" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js#L150-L158
4,584
SAP/openui5
src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js
function (oControl, sPropertyName, oPropertyValue) { var vOldValue; var oMetadata = oControl.getMetadata().getPropertyLikeSetting(sPropertyName); if (oMetadata) { var sPropertyGetter = oMetadata._sGetter; vOldValue = oControl[sPropertyGetter](); } var vReturnValue = JsControlTreeModifier.setProperty.apply(this, arguments); /* If the value changed, record the reversal as undo operation */ if (vOldValue !== oPropertyValue){ this._saveUndoOperation("setProperty", [oControl, sPropertyName, vOldValue]); } return vReturnValue; }
javascript
function (oControl, sPropertyName, oPropertyValue) { var vOldValue; var oMetadata = oControl.getMetadata().getPropertyLikeSetting(sPropertyName); if (oMetadata) { var sPropertyGetter = oMetadata._sGetter; vOldValue = oControl[sPropertyGetter](); } var vReturnValue = JsControlTreeModifier.setProperty.apply(this, arguments); /* If the value changed, record the reversal as undo operation */ if (vOldValue !== oPropertyValue){ this._saveUndoOperation("setProperty", [oControl, sPropertyName, vOldValue]); } return vReturnValue; }
[ "function", "(", "oControl", ",", "sPropertyName", ",", "oPropertyValue", ")", "{", "var", "vOldValue", ";", "var", "oMetadata", "=", "oControl", ".", "getMetadata", "(", ")", ".", "getPropertyLikeSetting", "(", "sPropertyName", ")", ";", "if", "(", "oMetadata", ")", "{", "var", "sPropertyGetter", "=", "oMetadata", ".", "_sGetter", ";", "vOldValue", "=", "oControl", "[", "sPropertyGetter", "]", "(", ")", ";", "}", "var", "vReturnValue", "=", "JsControlTreeModifier", ".", "setProperty", ".", "apply", "(", "this", ",", "arguments", ")", ";", "/* If the value changed, record the reversal as undo operation */", "if", "(", "vOldValue", "!==", "oPropertyValue", ")", "{", "this", ".", "_saveUndoOperation", "(", "\"setProperty\"", ",", "[", "oControl", ",", "sPropertyName", ",", "vOldValue", "]", ")", ";", "}", "return", "vReturnValue", ";", "}" ]
Record the previous value of the property in the undo operation @override
[ "Record", "the", "previous", "value", "of", "the", "property", "in", "the", "undo", "operation" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js#L164-L181
4,585
SAP/openui5
src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js
function (oControl, sPropertyName, oPropertyBinding) { var oOldValue; var oMetadata = oControl.getMetadata().getPropertyLikeSetting(sPropertyName); if (oMetadata) { var sPropertyGetter = oMetadata._sGetter; oOldValue = oControl[sPropertyGetter](); } JsControlTreeModifier.setPropertyBinding.apply(this, arguments); /* If the value changed, record the reversal as undo operation */ if (oOldValue !== oPropertyBinding) { this._saveUndoOperation("setPropertyBinding", [oControl, sPropertyName, oOldValue]); } }
javascript
function (oControl, sPropertyName, oPropertyBinding) { var oOldValue; var oMetadata = oControl.getMetadata().getPropertyLikeSetting(sPropertyName); if (oMetadata) { var sPropertyGetter = oMetadata._sGetter; oOldValue = oControl[sPropertyGetter](); } JsControlTreeModifier.setPropertyBinding.apply(this, arguments); /* If the value changed, record the reversal as undo operation */ if (oOldValue !== oPropertyBinding) { this._saveUndoOperation("setPropertyBinding", [oControl, sPropertyName, oOldValue]); } }
[ "function", "(", "oControl", ",", "sPropertyName", ",", "oPropertyBinding", ")", "{", "var", "oOldValue", ";", "var", "oMetadata", "=", "oControl", ".", "getMetadata", "(", ")", ".", "getPropertyLikeSetting", "(", "sPropertyName", ")", ";", "if", "(", "oMetadata", ")", "{", "var", "sPropertyGetter", "=", "oMetadata", ".", "_sGetter", ";", "oOldValue", "=", "oControl", "[", "sPropertyGetter", "]", "(", ")", ";", "}", "JsControlTreeModifier", ".", "setPropertyBinding", ".", "apply", "(", "this", ",", "arguments", ")", ";", "/* If the value changed, record the reversal as undo operation */", "if", "(", "oOldValue", "!==", "oPropertyBinding", ")", "{", "this", ".", "_saveUndoOperation", "(", "\"setPropertyBinding\"", ",", "[", "oControl", ",", "sPropertyName", ",", "oOldValue", "]", ")", ";", "}", "}" ]
Record the previous value of the property binding in the undo operation @override
[ "Record", "the", "previous", "value", "of", "the", "property", "binding", "in", "the", "undo", "operation" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js#L187-L202
4,586
SAP/openui5
src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js
function (sClassName, oAppComponent, oView, oSelector, mSettings, bAsync) { var oExistingControl = this.bySelector(oSelector, oAppComponent); var fnCreateUndoOperation = function() { if (!oExistingControl) { var oCreatedControl = this.bySelector(oSelector, oAppComponent); RtaControlTreeModifier._saveUndoOperation("destroy", [oCreatedControl]); } }.bind(this); var vReturnValue = JsControlTreeModifier.createControl.apply(this, arguments); if (bAsync) { return vReturnValue.then(function(oReturnedControl) { fnCreateUndoOperation(); return oReturnedControl; }); } fnCreateUndoOperation(); return vReturnValue; }
javascript
function (sClassName, oAppComponent, oView, oSelector, mSettings, bAsync) { var oExistingControl = this.bySelector(oSelector, oAppComponent); var fnCreateUndoOperation = function() { if (!oExistingControl) { var oCreatedControl = this.bySelector(oSelector, oAppComponent); RtaControlTreeModifier._saveUndoOperation("destroy", [oCreatedControl]); } }.bind(this); var vReturnValue = JsControlTreeModifier.createControl.apply(this, arguments); if (bAsync) { return vReturnValue.then(function(oReturnedControl) { fnCreateUndoOperation(); return oReturnedControl; }); } fnCreateUndoOperation(); return vReturnValue; }
[ "function", "(", "sClassName", ",", "oAppComponent", ",", "oView", ",", "oSelector", ",", "mSettings", ",", "bAsync", ")", "{", "var", "oExistingControl", "=", "this", ".", "bySelector", "(", "oSelector", ",", "oAppComponent", ")", ";", "var", "fnCreateUndoOperation", "=", "function", "(", ")", "{", "if", "(", "!", "oExistingControl", ")", "{", "var", "oCreatedControl", "=", "this", ".", "bySelector", "(", "oSelector", ",", "oAppComponent", ")", ";", "RtaControlTreeModifier", ".", "_saveUndoOperation", "(", "\"destroy\"", ",", "[", "oCreatedControl", "]", ")", ";", "}", "}", ".", "bind", "(", "this", ")", ";", "var", "vReturnValue", "=", "JsControlTreeModifier", ".", "createControl", ".", "apply", "(", "this", ",", "arguments", ")", ";", "if", "(", "bAsync", ")", "{", "return", "vReturnValue", ".", "then", "(", "function", "(", "oReturnedControl", ")", "{", "fnCreateUndoOperation", "(", ")", ";", "return", "oReturnedControl", ";", "}", ")", ";", "}", "fnCreateUndoOperation", "(", ")", ";", "return", "vReturnValue", ";", "}" ]
Record destroy as undo operation @override
[ "Record", "destroy", "as", "undo", "operation" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js#L208-L228
4,587
SAP/openui5
src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js
function(sFragment, sChangeId, oView, oController) { var aControls = JsControlTreeModifier.instantiateFragment.apply(this, arguments); aControls.forEach(function(oControl) { this._saveUndoOperation("destroy", [oControl]); }.bind(this)); return aControls; }
javascript
function(sFragment, sChangeId, oView, oController) { var aControls = JsControlTreeModifier.instantiateFragment.apply(this, arguments); aControls.forEach(function(oControl) { this._saveUndoOperation("destroy", [oControl]); }.bind(this)); return aControls; }
[ "function", "(", "sFragment", ",", "sChangeId", ",", "oView", ",", "oController", ")", "{", "var", "aControls", "=", "JsControlTreeModifier", ".", "instantiateFragment", ".", "apply", "(", "this", ",", "arguments", ")", ";", "aControls", ".", "forEach", "(", "function", "(", "oControl", ")", "{", "this", ".", "_saveUndoOperation", "(", "\"destroy\"", ",", "[", "oControl", "]", ")", ";", "}", ".", "bind", "(", "this", ")", ")", ";", "return", "aControls", ";", "}" ]
When a fragment is instantiated in JS, a control is created. This control has to be destroyed on undo @override
[ "When", "a", "fragment", "is", "instantiated", "in", "JS", "a", "control", "is", "created", ".", "This", "control", "has", "to", "be", "destroyed", "on", "undo" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js#L235-L242
4,588
SAP/openui5
src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js
function (oParent, sName, oObject, iIndex) { var oOldAggregationValue = JsControlTreeModifier.getAggregation.call(this, oParent, sName); JsControlTreeModifier.insertAggregation.apply(this, arguments); if (oParent) { if (oParent.getMetadata) { var oMetadata = oParent.getMetadata(); var oAggregations = oMetadata.getAllAggregations(); if (oAggregations) { var oAggregation = oAggregations[sName]; if (oAggregation) { if (oAggregation.multiple) { this._saveUndoOperation("removeAggregation", [oParent, sName, oObject]); } else { this._saveUndoOperation("insertAggregation", [oParent, sName, oOldAggregationValue]); } } } } } }
javascript
function (oParent, sName, oObject, iIndex) { var oOldAggregationValue = JsControlTreeModifier.getAggregation.call(this, oParent, sName); JsControlTreeModifier.insertAggregation.apply(this, arguments); if (oParent) { if (oParent.getMetadata) { var oMetadata = oParent.getMetadata(); var oAggregations = oMetadata.getAllAggregations(); if (oAggregations) { var oAggregation = oAggregations[sName]; if (oAggregation) { if (oAggregation.multiple) { this._saveUndoOperation("removeAggregation", [oParent, sName, oObject]); } else { this._saveUndoOperation("insertAggregation", [oParent, sName, oOldAggregationValue]); } } } } } }
[ "function", "(", "oParent", ",", "sName", ",", "oObject", ",", "iIndex", ")", "{", "var", "oOldAggregationValue", "=", "JsControlTreeModifier", ".", "getAggregation", ".", "call", "(", "this", ",", "oParent", ",", "sName", ")", ";", "JsControlTreeModifier", ".", "insertAggregation", ".", "apply", "(", "this", ",", "arguments", ")", ";", "if", "(", "oParent", ")", "{", "if", "(", "oParent", ".", "getMetadata", ")", "{", "var", "oMetadata", "=", "oParent", ".", "getMetadata", "(", ")", ";", "var", "oAggregations", "=", "oMetadata", ".", "getAllAggregations", "(", ")", ";", "if", "(", "oAggregations", ")", "{", "var", "oAggregation", "=", "oAggregations", "[", "sName", "]", ";", "if", "(", "oAggregation", ")", "{", "if", "(", "oAggregation", ".", "multiple", ")", "{", "this", ".", "_saveUndoOperation", "(", "\"removeAggregation\"", ",", "[", "oParent", ",", "sName", ",", "oObject", "]", ")", ";", "}", "else", "{", "this", ".", "_saveUndoOperation", "(", "\"insertAggregation\"", ",", "[", "oParent", ",", "sName", ",", "oOldAggregationValue", "]", ")", ";", "}", "}", "}", "}", "}", "}" ]
Adds an additional item to the aggregation or changes it in case it is not a multiple one Adds removeAggregation as the undo operation @override
[ "Adds", "an", "additional", "item", "to", "the", "aggregation", "or", "changes", "it", "in", "case", "it", "is", "not", "a", "multiple", "one", "Adds", "removeAggregation", "as", "the", "undo", "operation" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js#L261-L282
4,589
SAP/openui5
src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js
function (oParent, sName) { var aOldAggregationElements = []; var vAggregationElements; if (oParent) { vAggregationElements = JsControlTreeModifier.getAggregation.call(this, oParent, sName); } if (vAggregationElements && vAggregationElements instanceof Array) { aOldAggregationElements = vAggregationElements.slice(); } else if (vAggregationElements && vAggregationElements instanceof Object) { aOldAggregationElements[0] = vAggregationElements; } JsControlTreeModifier.removeAllAggregation(oParent, sName); if (aOldAggregationElements){ aOldAggregationElements.forEach(function(oElement) { this._saveUndoOperation("insertAggregation", [oParent, sName, oElement]); }, this); } }
javascript
function (oParent, sName) { var aOldAggregationElements = []; var vAggregationElements; if (oParent) { vAggregationElements = JsControlTreeModifier.getAggregation.call(this, oParent, sName); } if (vAggregationElements && vAggregationElements instanceof Array) { aOldAggregationElements = vAggregationElements.slice(); } else if (vAggregationElements && vAggregationElements instanceof Object) { aOldAggregationElements[0] = vAggregationElements; } JsControlTreeModifier.removeAllAggregation(oParent, sName); if (aOldAggregationElements){ aOldAggregationElements.forEach(function(oElement) { this._saveUndoOperation("insertAggregation", [oParent, sName, oElement]); }, this); } }
[ "function", "(", "oParent", ",", "sName", ")", "{", "var", "aOldAggregationElements", "=", "[", "]", ";", "var", "vAggregationElements", ";", "if", "(", "oParent", ")", "{", "vAggregationElements", "=", "JsControlTreeModifier", ".", "getAggregation", ".", "call", "(", "this", ",", "oParent", ",", "sName", ")", ";", "}", "if", "(", "vAggregationElements", "&&", "vAggregationElements", "instanceof", "Array", ")", "{", "aOldAggregationElements", "=", "vAggregationElements", ".", "slice", "(", ")", ";", "}", "else", "if", "(", "vAggregationElements", "&&", "vAggregationElements", "instanceof", "Object", ")", "{", "aOldAggregationElements", "[", "0", "]", "=", "vAggregationElements", ";", "}", "JsControlTreeModifier", ".", "removeAllAggregation", "(", "oParent", ",", "sName", ")", ";", "if", "(", "aOldAggregationElements", ")", "{", "aOldAggregationElements", ".", "forEach", "(", "function", "(", "oElement", ")", "{", "this", ".", "_saveUndoOperation", "(", "\"insertAggregation\"", ",", "[", "oParent", ",", "sName", ",", "oElement", "]", ")", ";", "}", ",", "this", ")", ";", "}", "}" ]
Removes all objects from an aggregation of the given control Adds one insertAggregation per removed object as undo operations @override
[ "Removes", "all", "objects", "from", "an", "aggregation", "of", "the", "given", "control", "Adds", "one", "insertAggregation", "per", "removed", "object", "as", "undo", "operations" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js#L317-L337
4,590
SAP/openui5
src/sap.ui.demokit/src/sap/ui/demokit/explored/view/master.controller.js
function () { // calculate text var sFilterText = ""; jQuery.each(this._oViewSettings.filter, function (sProperty, aValues) { jQuery.each(aValues, function (i, aValue) { sFilterText += aValue + ", "; }); }); if (sFilterText.length > 0) { var iIndex = sFilterText.lastIndexOf(", "); sFilterText = sFilterText.substring(0, iIndex); } // update view var oView = this.getView(); oView.byId("vsFilterBar").setVisible(sFilterText.length > 0); oView.byId("vsFilterLabel").setText(sFilterText); }
javascript
function () { // calculate text var sFilterText = ""; jQuery.each(this._oViewSettings.filter, function (sProperty, aValues) { jQuery.each(aValues, function (i, aValue) { sFilterText += aValue + ", "; }); }); if (sFilterText.length > 0) { var iIndex = sFilterText.lastIndexOf(", "); sFilterText = sFilterText.substring(0, iIndex); } // update view var oView = this.getView(); oView.byId("vsFilterBar").setVisible(sFilterText.length > 0); oView.byId("vsFilterLabel").setText(sFilterText); }
[ "function", "(", ")", "{", "// calculate text", "var", "sFilterText", "=", "\"\"", ";", "jQuery", ".", "each", "(", "this", ".", "_oViewSettings", ".", "filter", ",", "function", "(", "sProperty", ",", "aValues", ")", "{", "jQuery", ".", "each", "(", "aValues", ",", "function", "(", "i", ",", "aValue", ")", "{", "sFilterText", "+=", "aValue", "+", "\", \"", ";", "}", ")", ";", "}", ")", ";", "if", "(", "sFilterText", ".", "length", ">", "0", ")", "{", "var", "iIndex", "=", "sFilterText", ".", "lastIndexOf", "(", "\", \"", ")", ";", "sFilterText", "=", "sFilterText", ".", "substring", "(", "0", ",", "iIndex", ")", ";", "}", "// update view", "var", "oView", "=", "this", ".", "getView", "(", ")", ";", "oView", ".", "byId", "(", "\"vsFilterBar\"", ")", ".", "setVisible", "(", "sFilterText", ".", "length", ">", "0", ")", ";", "oView", ".", "byId", "(", "\"vsFilterLabel\"", ")", ".", "setText", "(", "sFilterText", ")", ";", "}" ]
Updates the filter bar in the view
[ "Updates", "the", "filter", "bar", "in", "the", "view" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.demokit/src/sap/ui/demokit/explored/view/master.controller.js#L294-L312
4,591
SAP/openui5
src/sap.ui.demokit/src/sap/ui/demokit/explored/view/master.controller.js
function () { var aFilters = [], aSorters = [], bFilterChanged = false, bGroupChanged = false, oSearchField = this.byId("searchField"), oList = this.byId("list"), oBinding = oList.getBinding("items"); // add filter for search var sQuery = oSearchField.getValue().trim(); bFilterChanged = true; aFilters.push(new Filter("searchTags", "Contains", sQuery)); // add filters for view settings jQuery.each(this._oViewSettings.filter, function (sProperty, aValues) { var aPropertyFilters = []; jQuery.each(aValues, function (i, aValue) { var sOperator = (sProperty === "formFactors") ? "Contains" : "EQ"; aPropertyFilters.push(new Filter(sProperty, sOperator, aValue)); }); var oFilter = new Filter(aPropertyFilters, false); // second parameter stands for "or" bFilterChanged = true; aFilters.push(oFilter); }); // filter if (bFilterChanged && aFilters.length === 0) { oBinding.filter(aFilters, "Application"); } else if (bFilterChanged && aFilters.length > 0) { var oFilter = new Filter(aFilters, true); // second parameter stands for "and" oBinding.filter(oFilter, "Application"); } if (this._oViewSettings.groupProperty && this._oViewSettings.groupProperty !== this._sCurrentGroup) { bGroupChanged = true; } else if (this._oViewSettings.groupProperty && this._oViewSettings.groupDescending !== this._bCurrentlyGroupedDescending) { bGroupChanged = true; } // group if (bGroupChanged) { var oSorter = new Sorter( this._oViewSettings.groupProperty, this._oViewSettings.groupDescending, this._mGroupFunctions[this._oViewSettings.groupProperty]); aSorters.push(oSorter); aSorters.push(new Sorter("name", false)); oBinding.sort(aSorters); } this._sCurrentGroup = this._oViewSettings.groupProperty; this._bCurrentlyGroupedDescending = this._oViewSettings.groupDescending; // memorize that this function was executed at least once this._bIsViewUpdatedAtLeastOnce = true; }
javascript
function () { var aFilters = [], aSorters = [], bFilterChanged = false, bGroupChanged = false, oSearchField = this.byId("searchField"), oList = this.byId("list"), oBinding = oList.getBinding("items"); // add filter for search var sQuery = oSearchField.getValue().trim(); bFilterChanged = true; aFilters.push(new Filter("searchTags", "Contains", sQuery)); // add filters for view settings jQuery.each(this._oViewSettings.filter, function (sProperty, aValues) { var aPropertyFilters = []; jQuery.each(aValues, function (i, aValue) { var sOperator = (sProperty === "formFactors") ? "Contains" : "EQ"; aPropertyFilters.push(new Filter(sProperty, sOperator, aValue)); }); var oFilter = new Filter(aPropertyFilters, false); // second parameter stands for "or" bFilterChanged = true; aFilters.push(oFilter); }); // filter if (bFilterChanged && aFilters.length === 0) { oBinding.filter(aFilters, "Application"); } else if (bFilterChanged && aFilters.length > 0) { var oFilter = new Filter(aFilters, true); // second parameter stands for "and" oBinding.filter(oFilter, "Application"); } if (this._oViewSettings.groupProperty && this._oViewSettings.groupProperty !== this._sCurrentGroup) { bGroupChanged = true; } else if (this._oViewSettings.groupProperty && this._oViewSettings.groupDescending !== this._bCurrentlyGroupedDescending) { bGroupChanged = true; } // group if (bGroupChanged) { var oSorter = new Sorter( this._oViewSettings.groupProperty, this._oViewSettings.groupDescending, this._mGroupFunctions[this._oViewSettings.groupProperty]); aSorters.push(oSorter); aSorters.push(new Sorter("name", false)); oBinding.sort(aSorters); } this._sCurrentGroup = this._oViewSettings.groupProperty; this._bCurrentlyGroupedDescending = this._oViewSettings.groupDescending; // memorize that this function was executed at least once this._bIsViewUpdatedAtLeastOnce = true; }
[ "function", "(", ")", "{", "var", "aFilters", "=", "[", "]", ",", "aSorters", "=", "[", "]", ",", "bFilterChanged", "=", "false", ",", "bGroupChanged", "=", "false", ",", "oSearchField", "=", "this", ".", "byId", "(", "\"searchField\"", ")", ",", "oList", "=", "this", ".", "byId", "(", "\"list\"", ")", ",", "oBinding", "=", "oList", ".", "getBinding", "(", "\"items\"", ")", ";", "// add filter for search", "var", "sQuery", "=", "oSearchField", ".", "getValue", "(", ")", ".", "trim", "(", ")", ";", "bFilterChanged", "=", "true", ";", "aFilters", ".", "push", "(", "new", "Filter", "(", "\"searchTags\"", ",", "\"Contains\"", ",", "sQuery", ")", ")", ";", "// add filters for view settings", "jQuery", ".", "each", "(", "this", ".", "_oViewSettings", ".", "filter", ",", "function", "(", "sProperty", ",", "aValues", ")", "{", "var", "aPropertyFilters", "=", "[", "]", ";", "jQuery", ".", "each", "(", "aValues", ",", "function", "(", "i", ",", "aValue", ")", "{", "var", "sOperator", "=", "(", "sProperty", "===", "\"formFactors\"", ")", "?", "\"Contains\"", ":", "\"EQ\"", ";", "aPropertyFilters", ".", "push", "(", "new", "Filter", "(", "sProperty", ",", "sOperator", ",", "aValue", ")", ")", ";", "}", ")", ";", "var", "oFilter", "=", "new", "Filter", "(", "aPropertyFilters", ",", "false", ")", ";", "// second parameter stands for \"or\"", "bFilterChanged", "=", "true", ";", "aFilters", ".", "push", "(", "oFilter", ")", ";", "}", ")", ";", "// filter", "if", "(", "bFilterChanged", "&&", "aFilters", ".", "length", "===", "0", ")", "{", "oBinding", ".", "filter", "(", "aFilters", ",", "\"Application\"", ")", ";", "}", "else", "if", "(", "bFilterChanged", "&&", "aFilters", ".", "length", ">", "0", ")", "{", "var", "oFilter", "=", "new", "Filter", "(", "aFilters", ",", "true", ")", ";", "// second parameter stands for \"and\"", "oBinding", ".", "filter", "(", "oFilter", ",", "\"Application\"", ")", ";", "}", "if", "(", "this", ".", "_oViewSettings", ".", "groupProperty", "&&", "this", ".", "_oViewSettings", ".", "groupProperty", "!==", "this", ".", "_sCurrentGroup", ")", "{", "bGroupChanged", "=", "true", ";", "}", "else", "if", "(", "this", ".", "_oViewSettings", ".", "groupProperty", "&&", "this", ".", "_oViewSettings", ".", "groupDescending", "!==", "this", ".", "_bCurrentlyGroupedDescending", ")", "{", "bGroupChanged", "=", "true", ";", "}", "// group", "if", "(", "bGroupChanged", ")", "{", "var", "oSorter", "=", "new", "Sorter", "(", "this", ".", "_oViewSettings", ".", "groupProperty", ",", "this", ".", "_oViewSettings", ".", "groupDescending", ",", "this", ".", "_mGroupFunctions", "[", "this", ".", "_oViewSettings", ".", "groupProperty", "]", ")", ";", "aSorters", ".", "push", "(", "oSorter", ")", ";", "aSorters", ".", "push", "(", "new", "Sorter", "(", "\"name\"", ",", "false", ")", ")", ";", "oBinding", ".", "sort", "(", "aSorters", ")", ";", "}", "this", ".", "_sCurrentGroup", "=", "this", ".", "_oViewSettings", ".", "groupProperty", ";", "this", ".", "_bCurrentlyGroupedDescending", "=", "this", ".", "_oViewSettings", ".", "groupDescending", ";", "// memorize that this function was executed at least once", "this", ".", "_bIsViewUpdatedAtLeastOnce", "=", "true", ";", "}" ]
Updates the binding of the master list and applies filters and groups Dear maintainer having more time than i currently have - this function does way too much and gets called everywhere the list gets rerendered a lot of times. So i build in some very small detection to at least reduce the rerenderings when starting the app. For future refactorings this has to be split up into functions responsible for filtering sorting and only trigger those filters if a user really changed them. currently everytime the list items will be destroyed.
[ "Updates", "the", "binding", "of", "the", "master", "list", "and", "applies", "filters", "and", "groups" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.demokit/src/sap/ui/demokit/explored/view/master.controller.js#L323-L381
4,592
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/type/Date.js
getModelFormatter
function getModelFormatter() { if (!oModelFormatter) { oModelFormatter = DateFormat.getDateInstance({ pattern : 'yyyy-MM-dd', strictParsing : true, UTC : true }); } return oModelFormatter; }
javascript
function getModelFormatter() { if (!oModelFormatter) { oModelFormatter = DateFormat.getDateInstance({ pattern : 'yyyy-MM-dd', strictParsing : true, UTC : true }); } return oModelFormatter; }
[ "function", "getModelFormatter", "(", ")", "{", "if", "(", "!", "oModelFormatter", ")", "{", "oModelFormatter", "=", "DateFormat", ".", "getDateInstance", "(", "{", "pattern", ":", "'yyyy-MM-dd'", ",", "strictParsing", ":", "true", ",", "UTC", ":", "true", "}", ")", ";", "}", "return", "oModelFormatter", ";", "}" ]
Returns a formatter that formats the date into YYYY-MM-DD. Creates it lazily. @returns {sap.ui.core.format.DateFormat} the formatter
[ "Returns", "a", "formatter", "that", "formats", "the", "date", "into", "YYYY", "-", "MM", "-", "DD", ".", "Creates", "it", "lazily", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/type/Date.js#L58-L67
4,593
SAP/openui5
src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ApiMaster.controller.js
function (sTopicId) { this._bIncludeDeprecated = true; // Switch internal flag this.byId("includeDeprecated").setSelected(true); // Update checkbox UI this.buildAndApplyFilters(); // Apply filters this._expandTreeToNode(sTopicId, this.getModel("treeData")); // Select the searched entity }
javascript
function (sTopicId) { this._bIncludeDeprecated = true; // Switch internal flag this.byId("includeDeprecated").setSelected(true); // Update checkbox UI this.buildAndApplyFilters(); // Apply filters this._expandTreeToNode(sTopicId, this.getModel("treeData")); // Select the searched entity }
[ "function", "(", "sTopicId", ")", "{", "this", ".", "_bIncludeDeprecated", "=", "true", ";", "// Switch internal flag", "this", ".", "byId", "(", "\"includeDeprecated\"", ")", ".", "setSelected", "(", "true", ")", ";", "// Update checkbox UI", "this", ".", "buildAndApplyFilters", "(", ")", ";", "// Apply filters", "this", ".", "_expandTreeToNode", "(", "sTopicId", ",", "this", ".", "getModel", "(", "\"treeData\"", ")", ")", ";", "// Select the searched entity", "}" ]
Selects a deprecated symbol in the tree and switches the filter to displaying deprecated symbols @param {string} sTopicId the name of the deprecated symbol to be selected
[ "Selects", "a", "deprecated", "symbol", "in", "the", "tree", "and", "switches", "the", "filter", "to", "displaying", "deprecated", "symbols" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ApiMaster.controller.js#L106-L111
4,594
SAP/openui5
src/sap.ui.core/src/sap/ui/base/syncXHRFix.js
wrapTimerHandler
function wrapTimerHandler(vHandler) { var fnWrappedHandler = function() { var aArgs, fnHandler; if (bPromisesQueued) { aArgs = [fnWrappedHandler, 0].concat(arguments); _timeout.apply(window, aArgs); } else { fnHandler = typeof vHandler !== "function" ? new Function(vHandler) : vHandler; // eslint-disable-line no-new-func fnHandler.apply(window, arguments); } }; return fnWrappedHandler; }
javascript
function wrapTimerHandler(vHandler) { var fnWrappedHandler = function() { var aArgs, fnHandler; if (bPromisesQueued) { aArgs = [fnWrappedHandler, 0].concat(arguments); _timeout.apply(window, aArgs); } else { fnHandler = typeof vHandler !== "function" ? new Function(vHandler) : vHandler; // eslint-disable-line no-new-func fnHandler.apply(window, arguments); } }; return fnWrappedHandler; }
[ "function", "wrapTimerHandler", "(", "vHandler", ")", "{", "var", "fnWrappedHandler", "=", "function", "(", ")", "{", "var", "aArgs", ",", "fnHandler", ";", "if", "(", "bPromisesQueued", ")", "{", "aArgs", "=", "[", "fnWrappedHandler", ",", "0", "]", ".", "concat", "(", "arguments", ")", ";", "_timeout", ".", "apply", "(", "window", ",", "aArgs", ")", ";", "}", "else", "{", "fnHandler", "=", "typeof", "vHandler", "!==", "\"function\"", "?", "new", "Function", "(", "vHandler", ")", ":", "vHandler", ";", "// eslint-disable-line no-new-func", "fnHandler", ".", "apply", "(", "window", ",", "arguments", ")", ";", "}", "}", ";", "return", "fnWrappedHandler", ";", "}" ]
If there are promise handlers waiting for execution at the time the timeout fires, start another timeout to postpone timer execution after promise execution.
[ "If", "there", "are", "promise", "handlers", "waiting", "for", "execution", "at", "the", "time", "the", "timeout", "fires", "start", "another", "timeout", "to", "postpone", "timer", "execution", "after", "promise", "execution", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/syncXHRFix.js#L94-L106
4,595
SAP/openui5
src/sap.ui.core/src/sap/ui/base/syncXHRFix.js
wrapHandler
function wrapHandler(fnHandler) { var fnWrappedHandler = function(oEvent) { // The ready state at the time the event is occurring needs to // be preserved, to restore it when the handler is called delayed var iCurrentState = oXHR.readyState; function callHandler() { iReadyState = iCurrentState; // Only if the event has not been removed in the meantime // the handler needs to be called after the timeout if (fnWrappedHandler.active) { return fnHandler.call(oProxy, oEvent); } } // If this is an asynchronous request and a sync request is ongoing, // the execution of all following handler calls needs to be delayed if (!bSync && bSyncRequestOngoing) { bDelay = true; } if (bDelay) { _timeout(callHandler, 0); return true; } return callHandler(); }; fnHandler.wrappedHandler = fnWrappedHandler; fnWrappedHandler.active = true; return fnWrappedHandler; }
javascript
function wrapHandler(fnHandler) { var fnWrappedHandler = function(oEvent) { // The ready state at the time the event is occurring needs to // be preserved, to restore it when the handler is called delayed var iCurrentState = oXHR.readyState; function callHandler() { iReadyState = iCurrentState; // Only if the event has not been removed in the meantime // the handler needs to be called after the timeout if (fnWrappedHandler.active) { return fnHandler.call(oProxy, oEvent); } } // If this is an asynchronous request and a sync request is ongoing, // the execution of all following handler calls needs to be delayed if (!bSync && bSyncRequestOngoing) { bDelay = true; } if (bDelay) { _timeout(callHandler, 0); return true; } return callHandler(); }; fnHandler.wrappedHandler = fnWrappedHandler; fnWrappedHandler.active = true; return fnWrappedHandler; }
[ "function", "wrapHandler", "(", "fnHandler", ")", "{", "var", "fnWrappedHandler", "=", "function", "(", "oEvent", ")", "{", "// The ready state at the time the event is occurring needs to", "// be preserved, to restore it when the handler is called delayed", "var", "iCurrentState", "=", "oXHR", ".", "readyState", ";", "function", "callHandler", "(", ")", "{", "iReadyState", "=", "iCurrentState", ";", "// Only if the event has not been removed in the meantime", "// the handler needs to be called after the timeout", "if", "(", "fnWrappedHandler", ".", "active", ")", "{", "return", "fnHandler", ".", "call", "(", "oProxy", ",", "oEvent", ")", ";", "}", "}", "// If this is an asynchronous request and a sync request is ongoing,", "// the execution of all following handler calls needs to be delayed", "if", "(", "!", "bSync", "&&", "bSyncRequestOngoing", ")", "{", "bDelay", "=", "true", ";", "}", "if", "(", "bDelay", ")", "{", "_timeout", "(", "callHandler", ",", "0", ")", ";", "return", "true", ";", "}", "return", "callHandler", "(", ")", ";", "}", ";", "fnHandler", ".", "wrappedHandler", "=", "fnWrappedHandler", ";", "fnWrappedHandler", ".", "active", "=", "true", ";", "return", "fnWrappedHandler", ";", "}" ]
Return a wrapped handler function for the given function, which checks whether a synchronous request is currently in progress.
[ "Return", "a", "wrapped", "handler", "function", "for", "the", "given", "function", "which", "checks", "whether", "a", "synchronous", "request", "is", "currently", "in", "progress", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/syncXHRFix.js#L136-L163
4,596
SAP/openui5
src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ControlsMaster.controller.js
function(oBody, sDensityMode){ switch (sDensityMode) { case COMPACT: oBody.toggleClass("sapUiSizeCompact", true).toggleClass("sapUiSizeCozy", false).toggleClass("sapUiSizeCondensed", false); break; case CONDENSED: oBody.toggleClass("sapUiSizeCondensed", true).toggleClass("sapUiSizeCozy", false).toggleClass("sapUiSizeCompact", true); break; default: oBody.toggleClass("sapUiSizeCozy", true).toggleClass("sapUiSizeCondensed", false).toggleClass("sapUiSizeCompact", false); } }
javascript
function(oBody, sDensityMode){ switch (sDensityMode) { case COMPACT: oBody.toggleClass("sapUiSizeCompact", true).toggleClass("sapUiSizeCozy", false).toggleClass("sapUiSizeCondensed", false); break; case CONDENSED: oBody.toggleClass("sapUiSizeCondensed", true).toggleClass("sapUiSizeCozy", false).toggleClass("sapUiSizeCompact", true); break; default: oBody.toggleClass("sapUiSizeCozy", true).toggleClass("sapUiSizeCondensed", false).toggleClass("sapUiSizeCompact", false); } }
[ "function", "(", "oBody", ",", "sDensityMode", ")", "{", "switch", "(", "sDensityMode", ")", "{", "case", "COMPACT", ":", "oBody", ".", "toggleClass", "(", "\"sapUiSizeCompact\"", ",", "true", ")", ".", "toggleClass", "(", "\"sapUiSizeCozy\"", ",", "false", ")", ".", "toggleClass", "(", "\"sapUiSizeCondensed\"", ",", "false", ")", ";", "break", ";", "case", "CONDENSED", ":", "oBody", ".", "toggleClass", "(", "\"sapUiSizeCondensed\"", ",", "true", ")", ".", "toggleClass", "(", "\"sapUiSizeCozy\"", ",", "false", ")", ".", "toggleClass", "(", "\"sapUiSizeCompact\"", ",", "true", ")", ";", "break", ";", "default", ":", "oBody", ".", "toggleClass", "(", "\"sapUiSizeCozy\"", ",", "true", ")", ".", "toggleClass", "(", "\"sapUiSizeCondensed\"", ",", "false", ")", ".", "toggleClass", "(", "\"sapUiSizeCompact\"", ",", "false", ")", ";", "}", "}" ]
Toggles content density classes in the provided html body @param {object} oBody the html body to set the correct class on @param {string} sDensityMode content density mode @private
[ "Toggles", "content", "density", "classes", "in", "the", "provided", "html", "body" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ControlsMaster.controller.js#L203-L214
4,597
SAP/openui5
src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ControlsMaster.controller.js
function(sThemeActive, sDensityMode, bRTL){ var oSampleFrameContent, oSampleFrameCore, $SampleFrame, bRTLChanged, bThemeChanged, bContentDensityChanged; // Handle content density change if (this._oViewSettings.densityMode !== sDensityMode) { this._toggleContentDensityClasses(jQueryDOM(document.body), sDensityMode); this._oViewSettings.densityMode = sDensityMode; bContentDensityChanged = true; } // Handle RTL mode change if (this._oViewSettings.rtl !== bRTL) { this._oCore.getConfiguration().setRTL(bRTL); this._oViewSettings.rtl = bRTL; bRTLChanged = true; } // Handle theme change if (this._oViewSettings.themeActive !== sThemeActive) { this._oCore.applyTheme(sThemeActive); this._oViewSettings.themeActive = sThemeActive; bThemeChanged = true; } else if (bContentDensityChanged) { // NOTE: We notify for content density change only if no theme change is applied because both // methods fire the same event which may lead to unpredictable result. this._oCore.notifyContentDensityChanged(); } // Apply theme and compact mode also to iframe samples if there is actually a change if (bRTLChanged || bContentDensityChanged || bThemeChanged) { $SampleFrame = jQueryDOM("#sampleFrame"); if ($SampleFrame.length > 0) { oSampleFrameContent = $SampleFrame[0].contentWindow; if (oSampleFrameContent) { oSampleFrameCore = oSampleFrameContent.sap.ui.getCore(); if (bContentDensityChanged) { this._toggleContentDensityClasses(oSampleFrameContent.jQuery('body'), sDensityMode); } if (bRTLChanged) { oSampleFrameCore.getConfiguration().setRTL(bRTL); } if (bThemeChanged) { oSampleFrameCore.applyTheme(sThemeActive); } else if (bContentDensityChanged) { // Notify Core for content density change only if no theme change happened oSampleFrameCore.notifyContentDensityChanged(); } } } } }
javascript
function(sThemeActive, sDensityMode, bRTL){ var oSampleFrameContent, oSampleFrameCore, $SampleFrame, bRTLChanged, bThemeChanged, bContentDensityChanged; // Handle content density change if (this._oViewSettings.densityMode !== sDensityMode) { this._toggleContentDensityClasses(jQueryDOM(document.body), sDensityMode); this._oViewSettings.densityMode = sDensityMode; bContentDensityChanged = true; } // Handle RTL mode change if (this._oViewSettings.rtl !== bRTL) { this._oCore.getConfiguration().setRTL(bRTL); this._oViewSettings.rtl = bRTL; bRTLChanged = true; } // Handle theme change if (this._oViewSettings.themeActive !== sThemeActive) { this._oCore.applyTheme(sThemeActive); this._oViewSettings.themeActive = sThemeActive; bThemeChanged = true; } else if (bContentDensityChanged) { // NOTE: We notify for content density change only if no theme change is applied because both // methods fire the same event which may lead to unpredictable result. this._oCore.notifyContentDensityChanged(); } // Apply theme and compact mode also to iframe samples if there is actually a change if (bRTLChanged || bContentDensityChanged || bThemeChanged) { $SampleFrame = jQueryDOM("#sampleFrame"); if ($SampleFrame.length > 0) { oSampleFrameContent = $SampleFrame[0].contentWindow; if (oSampleFrameContent) { oSampleFrameCore = oSampleFrameContent.sap.ui.getCore(); if (bContentDensityChanged) { this._toggleContentDensityClasses(oSampleFrameContent.jQuery('body'), sDensityMode); } if (bRTLChanged) { oSampleFrameCore.getConfiguration().setRTL(bRTL); } if (bThemeChanged) { oSampleFrameCore.applyTheme(sThemeActive); } else if (bContentDensityChanged) { // Notify Core for content density change only if no theme change happened oSampleFrameCore.notifyContentDensityChanged(); } } } } }
[ "function", "(", "sThemeActive", ",", "sDensityMode", ",", "bRTL", ")", "{", "var", "oSampleFrameContent", ",", "oSampleFrameCore", ",", "$SampleFrame", ",", "bRTLChanged", ",", "bThemeChanged", ",", "bContentDensityChanged", ";", "// Handle content density change", "if", "(", "this", ".", "_oViewSettings", ".", "densityMode", "!==", "sDensityMode", ")", "{", "this", ".", "_toggleContentDensityClasses", "(", "jQueryDOM", "(", "document", ".", "body", ")", ",", "sDensityMode", ")", ";", "this", ".", "_oViewSettings", ".", "densityMode", "=", "sDensityMode", ";", "bContentDensityChanged", "=", "true", ";", "}", "// Handle RTL mode change", "if", "(", "this", ".", "_oViewSettings", ".", "rtl", "!==", "bRTL", ")", "{", "this", ".", "_oCore", ".", "getConfiguration", "(", ")", ".", "setRTL", "(", "bRTL", ")", ";", "this", ".", "_oViewSettings", ".", "rtl", "=", "bRTL", ";", "bRTLChanged", "=", "true", ";", "}", "// Handle theme change", "if", "(", "this", ".", "_oViewSettings", ".", "themeActive", "!==", "sThemeActive", ")", "{", "this", ".", "_oCore", ".", "applyTheme", "(", "sThemeActive", ")", ";", "this", ".", "_oViewSettings", ".", "themeActive", "=", "sThemeActive", ";", "bThemeChanged", "=", "true", ";", "}", "else", "if", "(", "bContentDensityChanged", ")", "{", "// NOTE: We notify for content density change only if no theme change is applied because both", "// methods fire the same event which may lead to unpredictable result.", "this", ".", "_oCore", ".", "notifyContentDensityChanged", "(", ")", ";", "}", "// Apply theme and compact mode also to iframe samples if there is actually a change", "if", "(", "bRTLChanged", "||", "bContentDensityChanged", "||", "bThemeChanged", ")", "{", "$SampleFrame", "=", "jQueryDOM", "(", "\"#sampleFrame\"", ")", ";", "if", "(", "$SampleFrame", ".", "length", ">", "0", ")", "{", "oSampleFrameContent", "=", "$SampleFrame", "[", "0", "]", ".", "contentWindow", ";", "if", "(", "oSampleFrameContent", ")", "{", "oSampleFrameCore", "=", "oSampleFrameContent", ".", "sap", ".", "ui", ".", "getCore", "(", ")", ";", "if", "(", "bContentDensityChanged", ")", "{", "this", ".", "_toggleContentDensityClasses", "(", "oSampleFrameContent", ".", "jQuery", "(", "'body'", ")", ",", "sDensityMode", ")", ";", "}", "if", "(", "bRTLChanged", ")", "{", "oSampleFrameCore", ".", "getConfiguration", "(", ")", ".", "setRTL", "(", "bRTL", ")", ";", "}", "if", "(", "bThemeChanged", ")", "{", "oSampleFrameCore", ".", "applyTheme", "(", "sThemeActive", ")", ";", "}", "else", "if", "(", "bContentDensityChanged", ")", "{", "// Notify Core for content density change only if no theme change happened", "oSampleFrameCore", ".", "notifyContentDensityChanged", "(", ")", ";", "}", "}", "}", "}", "}" ]
Apply content configuration @param {string} sThemeActive name of the theme @param {string} sDensityMode content density mode @param {boolean} bRTL right to left mode @private
[ "Apply", "content", "configuration" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ControlsMaster.controller.js#L223-L287
4,598
SAP/openui5
src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ControlsMaster.controller.js
function () { if (!this._oSettingsDialog) { this._oSettingsDialog = new sap.ui.xmlfragment("sap.ui.documentation.sdk.view.appSettingsDialog", this); this._oView.addDependent(this._oSettingsDialog); } setTimeout(function () { var oAppSettings = this._oCore.getConfiguration(), oThemeSelect = this._oCore.byId("ThemeSelect"), sUriParamTheme = new UriParameters(window.location.href).get("sap-theme"), bDensityMode = this._oViewSettings.densityMode; // Theme select oThemeSelect.setSelectedKey(sUriParamTheme ? sUriParamTheme : oAppSettings.getTheme()); // RTL this._oCore.byId("RTLSwitch").setState(oAppSettings.getRTL()); // Density mode select this._oCore.byId("DensityModeSwitch").setSelectedKey(bDensityMode); this._oSettingsDialog.open(); }.bind(this), 0); }
javascript
function () { if (!this._oSettingsDialog) { this._oSettingsDialog = new sap.ui.xmlfragment("sap.ui.documentation.sdk.view.appSettingsDialog", this); this._oView.addDependent(this._oSettingsDialog); } setTimeout(function () { var oAppSettings = this._oCore.getConfiguration(), oThemeSelect = this._oCore.byId("ThemeSelect"), sUriParamTheme = new UriParameters(window.location.href).get("sap-theme"), bDensityMode = this._oViewSettings.densityMode; // Theme select oThemeSelect.setSelectedKey(sUriParamTheme ? sUriParamTheme : oAppSettings.getTheme()); // RTL this._oCore.byId("RTLSwitch").setState(oAppSettings.getRTL()); // Density mode select this._oCore.byId("DensityModeSwitch").setSelectedKey(bDensityMode); this._oSettingsDialog.open(); }.bind(this), 0); }
[ "function", "(", ")", "{", "if", "(", "!", "this", ".", "_oSettingsDialog", ")", "{", "this", ".", "_oSettingsDialog", "=", "new", "sap", ".", "ui", ".", "xmlfragment", "(", "\"sap.ui.documentation.sdk.view.appSettingsDialog\"", ",", "this", ")", ";", "this", ".", "_oView", ".", "addDependent", "(", "this", ".", "_oSettingsDialog", ")", ";", "}", "setTimeout", "(", "function", "(", ")", "{", "var", "oAppSettings", "=", "this", ".", "_oCore", ".", "getConfiguration", "(", ")", ",", "oThemeSelect", "=", "this", ".", "_oCore", ".", "byId", "(", "\"ThemeSelect\"", ")", ",", "sUriParamTheme", "=", "new", "UriParameters", "(", "window", ".", "location", ".", "href", ")", ".", "get", "(", "\"sap-theme\"", ")", ",", "bDensityMode", "=", "this", ".", "_oViewSettings", ".", "densityMode", ";", "// Theme select", "oThemeSelect", ".", "setSelectedKey", "(", "sUriParamTheme", "?", "sUriParamTheme", ":", "oAppSettings", ".", "getTheme", "(", ")", ")", ";", "// RTL", "this", ".", "_oCore", ".", "byId", "(", "\"RTLSwitch\"", ")", ".", "setState", "(", "oAppSettings", ".", "getRTL", "(", ")", ")", ";", "// Density mode select", "this", ".", "_oCore", ".", "byId", "(", "\"DensityModeSwitch\"", ")", ".", "setSelectedKey", "(", "bDensityMode", ")", ";", "this", ".", "_oSettingsDialog", ".", "open", "(", ")", ";", "}", ".", "bind", "(", "this", ")", ",", "0", ")", ";", "}" ]
Opens the View settings dialog @public
[ "Opens", "the", "View", "settings", "dialog" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ControlsMaster.controller.js#L653-L675
4,599
SAP/openui5
src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ControlsMaster.controller.js
function () { var BusyDialog, sDensityMode = this._oCore.byId('DensityModeSwitch').getSelectedKey(), sTheme = this._oCore.byId('ThemeSelect').getSelectedKey(), bRTL = this._oCore.byId('RTLSwitch').getState(); this._oSettingsDialog.close(); // Lazy loading of busy dialog if (!this._oBusyDialog) { //TODO: global jquery call found jQuery.sap.require("sap.m.BusyDialog"); BusyDialog = sap.ui.require("sap/m/BusyDialog"); this._oBusyDialog = new BusyDialog(); this.getView().addDependent(this._oBusyDialog); } // Handle busy dialog this._oBusyDialog.open(); setTimeout(function () { this._oBusyDialog.close(); }.bind(this), 1000); // handle settings change this._applyAppConfiguration(sTheme, sDensityMode, bRTL); // If we are navigating outside the Explored App section: view settings should be reset this.getRouter().attachBeforeRouteMatched(this._viewSettingsResetOnNavigation, this); }
javascript
function () { var BusyDialog, sDensityMode = this._oCore.byId('DensityModeSwitch').getSelectedKey(), sTheme = this._oCore.byId('ThemeSelect').getSelectedKey(), bRTL = this._oCore.byId('RTLSwitch').getState(); this._oSettingsDialog.close(); // Lazy loading of busy dialog if (!this._oBusyDialog) { //TODO: global jquery call found jQuery.sap.require("sap.m.BusyDialog"); BusyDialog = sap.ui.require("sap/m/BusyDialog"); this._oBusyDialog = new BusyDialog(); this.getView().addDependent(this._oBusyDialog); } // Handle busy dialog this._oBusyDialog.open(); setTimeout(function () { this._oBusyDialog.close(); }.bind(this), 1000); // handle settings change this._applyAppConfiguration(sTheme, sDensityMode, bRTL); // If we are navigating outside the Explored App section: view settings should be reset this.getRouter().attachBeforeRouteMatched(this._viewSettingsResetOnNavigation, this); }
[ "function", "(", ")", "{", "var", "BusyDialog", ",", "sDensityMode", "=", "this", ".", "_oCore", ".", "byId", "(", "'DensityModeSwitch'", ")", ".", "getSelectedKey", "(", ")", ",", "sTheme", "=", "this", ".", "_oCore", ".", "byId", "(", "'ThemeSelect'", ")", ".", "getSelectedKey", "(", ")", ",", "bRTL", "=", "this", ".", "_oCore", ".", "byId", "(", "'RTLSwitch'", ")", ".", "getState", "(", ")", ";", "this", ".", "_oSettingsDialog", ".", "close", "(", ")", ";", "// Lazy loading of busy dialog", "if", "(", "!", "this", ".", "_oBusyDialog", ")", "{", "//TODO: global jquery call found", "jQuery", ".", "sap", ".", "require", "(", "\"sap.m.BusyDialog\"", ")", ";", "BusyDialog", "=", "sap", ".", "ui", ".", "require", "(", "\"sap/m/BusyDialog\"", ")", ";", "this", ".", "_oBusyDialog", "=", "new", "BusyDialog", "(", ")", ";", "this", ".", "getView", "(", ")", ".", "addDependent", "(", "this", ".", "_oBusyDialog", ")", ";", "}", "// Handle busy dialog", "this", ".", "_oBusyDialog", ".", "open", "(", ")", ";", "setTimeout", "(", "function", "(", ")", "{", "this", ".", "_oBusyDialog", ".", "close", "(", ")", ";", "}", ".", "bind", "(", "this", ")", ",", "1000", ")", ";", "// handle settings change", "this", ".", "_applyAppConfiguration", "(", "sTheme", ",", "sDensityMode", ",", "bRTL", ")", ";", "// If we are navigating outside the Explored App section: view settings should be reset", "this", ".", "getRouter", "(", ")", ".", "attachBeforeRouteMatched", "(", "this", ".", "_viewSettingsResetOnNavigation", ",", "this", ")", ";", "}" ]
Saves settings from the view settings dialog @public
[ "Saves", "settings", "from", "the", "view", "settings", "dialog" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ControlsMaster.controller.js#L689-L717