@openui5/sap.ui.documentation 1.109.0 → 1.111.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.reuse/dep5 +16 -16
- package/THIRDPARTY.txt +2 -2
- package/package.json +7 -7
- package/src/sap/ui/documentation/.library +2 -2
- package/src/sap/ui/documentation/BorrowedList.js +1 -1
- package/src/sap/ui/documentation/DemokitTreeItem.js +1 -1
- package/src/sap/ui/documentation/DemokitTreeItemRenderer.js +1 -1
- package/src/sap/ui/documentation/JSDocText.js +1 -1
- package/src/sap/ui/documentation/LightTable.js +1 -1
- package/src/sap/ui/documentation/ObjectPageSubSection.js +1 -1
- package/src/sap/ui/documentation/ParamText.js +1 -1
- package/src/sap/ui/documentation/Row.js +1 -1
- package/src/sap/ui/documentation/Search.js +4 -2
- package/src/sap/ui/documentation/TitleLink.js +1 -1
- package/src/sap/ui/documentation/WebPageTitleUtil.js +1 -1
- package/src/sap/ui/documentation/library.js +3 -3
- package/src/sap/ui/documentation/messagebundle.properties +6 -2
- package/src/sap/ui/documentation/messagebundle_ar.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_bg.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_ca.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_cs.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_cy.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_da.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_de.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_el.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_en.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_en_GB.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_en_US_sappsd.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_en_US_saprigi.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_en_US_saptrc.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_es.properties +6 -4
- package/src/sap/ui/documentation/messagebundle_es_MX.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_et.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_fi.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_fr.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_fr_CA.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_hi.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_hr.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_hu.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_id.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_it.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_iw.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_ja.properties +7 -5
- package/src/sap/ui/documentation/messagebundle_kk.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_ko.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_lt.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_lv.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_ms.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_nl.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_no.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_pl.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_pt.properties +6 -4
- package/src/sap/ui/documentation/messagebundle_pt_PT.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_ro.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_ru.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_sh.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_sk.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_sl.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_sv.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_th.properties +6 -4
- package/src/sap/ui/documentation/messagebundle_tr.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_uk.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_vi.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_zh_CN.properties +4 -2
- package/src/sap/ui/documentation/messagebundle_zh_TW.properties +4 -2
- package/src/sap/ui/documentation/sdk/Component.js +1 -1
- package/src/sap/ui/documentation/sdk/blocks/IndexEntry.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/ApiDetail.controller.js +29 -3
- package/src/sap/ui/documentation/sdk/controller/ApiDetailIndexDeprecatedExperimental.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/ApiDetailInitial.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/ApiMaster.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/App.controller.js +64 -80
- package/src/sap/ui/documentation/sdk/controller/BPSupport.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/BaseController.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/Code.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/Controls.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/ControlsMaster.controller.js +3 -179
- package/src/sap/ui/documentation/sdk/controller/DemoApps.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/Downloads.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/Entity.controller.js +4 -2
- package/src/sap/ui/documentation/sdk/controller/ErrorHandler.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/Group.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/License.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/LiveEditor.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/MasterTreeBaseController.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/News.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/NotFound.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/ReleaseNotes.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/Sample.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/SampleBaseController.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/SampleNotFound.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/SearchPage.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/Sitemap.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/SubApiDetail.controller.js +20 -5
- package/src/sap/ui/documentation/sdk/controller/TermsOfUse.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/Tools.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/TopicDetail.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/TopicDetailInitial.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/TopicMaster.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/VersionNotFound.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/Welcome.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/config/datatable.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/config/sampleForwardingConfig.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/APIInfo.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/ConfigUtil.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/ControlsInfo.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/DataTable.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/DataTableHelper.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/DataTableUtil.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/DocuInfo.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/EntityInfo.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/Highlighter.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/IndexWorker.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/JSDocUtil.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/NewsInfo.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/ResourceDownloadUtil.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/ResponsiveImageMap.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/SearchUtil.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/SidyBySideImageMap.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/ThemePicker.js +195 -0
- package/src/sap/ui/documentation/sdk/controller/util/ToolsInfo.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/Tooltip.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/TreeUtil.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/URLUtil.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/XML2JSONUtils.js +67 -15
- package/src/sap/ui/documentation/sdk/controller/util/datatable/filters/DataTableFilterDropDown.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/datatable/filters/DataTableFilterDropDownRenderer.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/datatable/filters/DataTableFilterRange.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/datatable/filters/DataTableFilterRangeRenderer.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/overlay/Overlay.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/overlay/shapes/Circle.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/overlay/shapes/Polygon.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/overlay/shapes/Rect.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/overlay/shapes/Shape.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/overlay/shapes/ShapeFactory.js +1 -1
- package/src/sap/ui/documentation/sdk/cookieSettingsDialog/Component.js +1 -1
- package/src/sap/ui/documentation/sdk/cookieSettingsDialog/controller/CookieSettingsDialog.controller.js +1 -1
- package/src/sap/ui/documentation/sdk/css/style.css +8 -2
- package/src/sap/ui/documentation/sdk/index.js +1 -1
- package/src/sap/ui/documentation/sdk/manifest.json +7 -1
- package/src/sap/ui/documentation/sdk/model/formatter.js +22 -2
- package/src/sap/ui/documentation/sdk/model/libraryData.js +1 -1
- package/src/sap/ui/documentation/sdk/model/models.js +1 -1
- package/src/sap/ui/documentation/sdk/util/DocumentationRouter.js +2 -12
- package/src/sap/ui/documentation/sdk/util/LiveEditorOutput.js +1 -1
- package/src/sap/ui/documentation/sdk/util/Resources.js +2 -2
- package/src/sap/ui/documentation/sdk/util/ToggleFullScreenHandler.js +1 -1
- package/src/sap/ui/documentation/sdk/view/App.view.xml +2 -0
- package/src/sap/ui/documentation/sdk/view/ControlsMaster.view.xml +0 -1
- package/src/sap/ui/documentation/sdk/view/License.view.xml +0 -1
- package/src/sap/ui/documentation/sdk/view/SubApiDetail.view.xml +9 -6
- package/src/sap/ui/documentation/sdk/view/TermsOfUse.view.xml +0 -1
- package/src/sap/ui/documentation/sdk/view/TopicDetail.view.xml +2 -3
- package/src/sap/ui/documentation/sdk/view/VersionInfo.view.xml +0 -1
- package/src/sap/ui/documentation/sdk/view/Welcome.view.xml +6 -108
- package/src/sap/ui/documentation/sdk/view/WelcomeCustomRowOpenUI5.fragment.xml +46 -0
- package/src/sap/ui/documentation/sdk/view/WelcomeCustomRowSAPUI5.fragment.xml +114 -0
- package/src/sap/ui/documentation/themes/base/library.source.less +1 -1
- package/src/sap/ui/documentation/themes/sap_belize/library.source.less +1 -1
- package/src/sap/ui/documentation/themes/sap_belize_hcb/library.source.less +1 -1
- package/src/sap/ui/documentation/themes/sap_belize_hcw/library.source.less +1 -1
- package/src/sap/ui/documentation/themes/sap_belize_plus/library.source.less +1 -1
- package/src/sap/ui/documentation/themes/sap_fiori_3/library.source.less +1 -1
- package/src/sap/ui/documentation/themes/sap_fiori_3_dark/library.source.less +1 -1
- package/src/sap/ui/documentation/themes/sap_fiori_3_hcb/library.source.less +1 -1
- package/src/sap/ui/documentation/themes/sap_fiori_3_hcw/library.source.less +1 -1
- package/src/sap/ui/documentation/themes/sap_horizon/library.source.less +1 -1
- package/src/sap/ui/documentation/themes/sap_horizon_dark/library.source.less +1 -1
- package/src/sap/ui/documentation/themes/sap_horizon_hcb/library.source.less +1 -1
- package/src/sap/ui/documentation/themes/sap_horizon_hcw/library.source.less +1 -1
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
"sap/ui/core/Core",
|
|
9
|
+
"sap/base/util/UriParameters"
|
|
10
|
+
], function(
|
|
11
|
+
Core,
|
|
12
|
+
UriParameters
|
|
13
|
+
) {
|
|
14
|
+
"use strict";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Utility used for changing the themes inside applications.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
var ThemePicker = {};
|
|
21
|
+
|
|
22
|
+
var CONFIGURATION_APPEARANCE = "appearance",
|
|
23
|
+
APPEARANCE_KEY_LIGHT = "light",
|
|
24
|
+
APPEARANCE_KEY_DARK = "dark",
|
|
25
|
+
APPEARANCE_KEY_HCB = "hcb",
|
|
26
|
+
APPEARANCE_KEY_HCW = "hcw",
|
|
27
|
+
APPEARANCE_KEY_AUTO = "auto",
|
|
28
|
+
APPEARANCE = Object.create(null);
|
|
29
|
+
|
|
30
|
+
APPEARANCE[APPEARANCE_KEY_LIGHT] = "sap_horizon";
|
|
31
|
+
APPEARANCE[APPEARANCE_KEY_DARK] = "sap_horizon_dark";
|
|
32
|
+
APPEARANCE[APPEARANCE_KEY_HCB] = "sap_horizon_hcb";
|
|
33
|
+
APPEARANCE[APPEARANCE_KEY_HCW] = "sap_horizon_hcw";
|
|
34
|
+
APPEARANCE[APPEARANCE_KEY_AUTO] = "sap_horizon"; // fallback if window.matchMedia is not supported
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
ThemePicker.init = function(oComponent) {
|
|
38
|
+
this.oComponent = oComponent;
|
|
39
|
+
|
|
40
|
+
this._oConfigUtil = oComponent.getOwnerComponent().getConfigUtil();
|
|
41
|
+
this._oCookieNames = this._oConfigUtil.COOKIE_NAMES;
|
|
42
|
+
|
|
43
|
+
this.bus = Core.getEventBus();
|
|
44
|
+
|
|
45
|
+
this._createConfigurationBasedOnURIInput();
|
|
46
|
+
|
|
47
|
+
this._bSupportsPrefersColorScheme = !!(window.matchMedia &&
|
|
48
|
+
(window.matchMedia('(prefers-color-scheme: dark)').matches ||
|
|
49
|
+
window.matchMedia('(prefers-color-scheme: light)').matches));
|
|
50
|
+
|
|
51
|
+
if (this._oConfigUtil.getCookieValue(this._oCookieNames.ALLOW_REQUIRED_COOKIES) === "1" && this._aConfiguration.length > 0) {
|
|
52
|
+
ThemePicker._applyCookiesConfiguration(this._aConfiguration);
|
|
53
|
+
} else {
|
|
54
|
+
ThemePicker._applyDefaultConfiguration(this._aConfiguration);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Stores and returns the available themes.
|
|
61
|
+
* @private
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
ThemePicker._getTheme = function() {
|
|
65
|
+
return APPEARANCE;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Updates the appearance of the Demo Kit depending of the incoming appearance keyword.
|
|
70
|
+
* If the keyword is "auto" the appearance will be updated to light or dark depending on the
|
|
71
|
+
* user's OS settings.
|
|
72
|
+
* @param {string} sKey the appearance keyword
|
|
73
|
+
* @private
|
|
74
|
+
*/
|
|
75
|
+
ThemePicker._updateAppearance = function(sKey) {
|
|
76
|
+
|
|
77
|
+
if (sKey === APPEARANCE_KEY_AUTO && this._bSupportsPrefersColorScheme) {
|
|
78
|
+
this._toggleLightOrDarkAppearance(window.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
79
|
+
this._attachPrefersColorSchemeChangeListener();
|
|
80
|
+
} else {
|
|
81
|
+
Core.applyTheme(this._getTheme()[sKey]);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
this._sLastKnownAppearanceKey = sKey;
|
|
85
|
+
|
|
86
|
+
this.bus.publish("themeChanged", "onThemeChanged", {sThemeActive: this._getTheme()[sKey]});
|
|
87
|
+
|
|
88
|
+
if (this._oConfigUtil.getCookieValue(this._oCookieNames.ALLOW_REQUIRED_COOKIES) === "1") {
|
|
89
|
+
this._oConfigUtil.setCookie(CONFIGURATION_APPEARANCE, sKey);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Toggles the appearance of the Demo Kit to light or dark depending on the incoming argument.
|
|
95
|
+
* @param {boolean} bIsDark whether the new appearance should be dark
|
|
96
|
+
* @private
|
|
97
|
+
*/
|
|
98
|
+
ThemePicker._toggleLightOrDarkAppearance = function (bIsDark) {
|
|
99
|
+
if (bIsDark) {
|
|
100
|
+
// dark mode
|
|
101
|
+
Core.applyTheme(this._getTheme().dark);
|
|
102
|
+
} else {
|
|
103
|
+
// light mode or unsupported prefers-color-scheme
|
|
104
|
+
Core.applyTheme(this._getTheme().light);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Attaches an event listener to the 'change' event of the prefers-color-scheme media.
|
|
110
|
+
* Depending on the change and the last known appearance, the appearance of the Demo Kit is changed to light, dark, hcb or hcw.
|
|
111
|
+
* @private
|
|
112
|
+
*/
|
|
113
|
+
ThemePicker._attachPrefersColorSchemeChangeListener = function() {
|
|
114
|
+
var that = this,
|
|
115
|
+
oQuery,
|
|
116
|
+
toggleAppearance;
|
|
117
|
+
|
|
118
|
+
if (!this._bAttachedPrefersColorSchemeChangeListener) {
|
|
119
|
+
oQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
120
|
+
|
|
121
|
+
toggleAppearance = function(e) {
|
|
122
|
+
if (that._sLastKnownAppearanceKey === APPEARANCE_KEY_AUTO) {
|
|
123
|
+
this._toggleLightOrDarkAppearance(e.matches);
|
|
124
|
+
that.bus.publish("themeChanged", "onThemeChanged", {
|
|
125
|
+
sThemeActive: APPEARANCE[e.matches ? APPEARANCE_KEY_DARK : APPEARANCE_KEY_LIGHT]
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
if (oQuery.addEventListener) {
|
|
131
|
+
oQuery.addEventListener('change', toggleAppearance);
|
|
132
|
+
} else { // Safari 13 and older only supports deprecated MediaQueryList.addListener
|
|
133
|
+
oQuery.addListener(toggleAppearance);
|
|
134
|
+
}
|
|
135
|
+
this._bAttachedPrefersColorSchemeChangeListener = true;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Applies configuration for the application regarding the cookies.
|
|
141
|
+
* @private
|
|
142
|
+
*/
|
|
143
|
+
ThemePicker._applyCookiesConfiguration = function () {
|
|
144
|
+
var sCookieValue, sConf, i;
|
|
145
|
+
|
|
146
|
+
for (i = 0; i < this._aConfiguration.length; i++) {
|
|
147
|
+
sConf = this._aConfiguration[i];
|
|
148
|
+
sCookieValue = this._oConfigUtil.getCookieValue(sConf);
|
|
149
|
+
|
|
150
|
+
if (sCookieValue !== "") {
|
|
151
|
+
if (sConf === CONFIGURATION_APPEARANCE) {
|
|
152
|
+
this._updateAppearance(sCookieValue, this.oComponent);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// If we have available value for the given cookie we remove it from the configuration array.
|
|
156
|
+
this._aConfiguration.splice(i, 1);
|
|
157
|
+
i--;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// If we still have configurations which are not set by their cookie values, we apply their default values.
|
|
162
|
+
if (this._aConfiguration.length > 0) {
|
|
163
|
+
this._applyDefaultConfiguration();
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Applies configuration for the application regarding the default values.
|
|
169
|
+
* @private
|
|
170
|
+
*/
|
|
171
|
+
ThemePicker._applyDefaultConfiguration = function () {
|
|
172
|
+
this._aConfiguration.forEach(function(sConf){
|
|
173
|
+
if (sConf === CONFIGURATION_APPEARANCE) {
|
|
174
|
+
this._updateAppearance(APPEARANCE_KEY_AUTO);
|
|
175
|
+
}
|
|
176
|
+
}, this);
|
|
177
|
+
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Creates configuration for the application regarding the URI input.
|
|
182
|
+
* @private
|
|
183
|
+
*/
|
|
184
|
+
ThemePicker._createConfigurationBasedOnURIInput = function () {
|
|
185
|
+
var oUriParams = UriParameters.fromQuery(window.location.search);
|
|
186
|
+
this._aConfiguration = [];
|
|
187
|
+
|
|
188
|
+
if (!(oUriParams.has('sap-ui-theme') || oUriParams.has('sap-theme'))) {
|
|
189
|
+
this._aConfiguration.push(CONFIGURATION_APPEARANCE);
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
return ThemePicker;
|
|
194
|
+
|
|
195
|
+
});
|
|
@@ -1,33 +1,56 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define(["sap/ui/thirdparty/jquery"],
|
|
8
|
-
function(jQuery) {
|
|
8
|
+
function (jQuery) {
|
|
9
9
|
"use strict";
|
|
10
10
|
|
|
11
11
|
function buildDocuJSON(xml, oConfig) {
|
|
12
12
|
var xmlDom = xml2dom(xml, oConfig);
|
|
13
13
|
var aSingles = ["topictitle1", "shortdesc"];
|
|
14
|
+
var aPreservedSingles = oConfig.preservedContent && oConfig.preservedContent.length
|
|
15
|
+
&& oConfig.preservedContent.map(function (e) { return e.className; });
|
|
14
16
|
|
|
15
|
-
var
|
|
17
|
+
var getPreservedTags = function (className) {
|
|
18
|
+
var preservedTags;
|
|
19
|
+
|
|
20
|
+
oConfig.preservedContent.forEach(function (item) {
|
|
21
|
+
if (item.className === className) {
|
|
22
|
+
preservedTags = item.preservedTags;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
return preservedTags;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var getNodeText = function (className, nodeHTML) {
|
|
30
|
+
var bIsNodePreserved = aPreservedSingles && aPreservedSingles.indexOf(className) > -1;
|
|
31
|
+
|
|
32
|
+
if (bIsNodePreserved) {
|
|
33
|
+
return jQuery("<div></div>").html(removeHTMLTags(nodeHTML, getPreservedTags(className))).html();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return jQuery("<div></div>").html(removeHTMLTags(nodeHTML)).text();
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var processSingleNode = function (className, xmlDOMObj) {
|
|
16
40
|
var oXMLDOM = xmlDOMObj || xmlDom;
|
|
17
41
|
var oNodes = oXMLDOM.getElementsByClassName(className);
|
|
42
|
+
|
|
18
43
|
if (oNodes.length === 0) {
|
|
19
44
|
return '';
|
|
20
45
|
}
|
|
21
|
-
var nodeText = jQuery("<div></div>").html(removeHTMLTags(oNodes[0].innerHTML)).text();
|
|
22
|
-
return oNodes && oNodes.length > 0 && ("innerHTML" in oNodes[0]) && nodeText || '';
|
|
23
|
-
};
|
|
24
46
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
47
|
+
var nodeHTML = oNodes[0].innerHTML,
|
|
48
|
+
nodeText = getNodeText(className, nodeHTML);
|
|
49
|
+
|
|
50
|
+
return oNodes && oNodes.length > 0 && ("innerHTML" in oNodes[0]) && nodeText || '';
|
|
28
51
|
};
|
|
29
52
|
|
|
30
|
-
var fixImgLocation = function(element) {
|
|
53
|
+
var fixImgLocation = function (element) {
|
|
31
54
|
var images = element.querySelectorAll("img");
|
|
32
55
|
|
|
33
56
|
for (var i = 0; i < images.length; i++) {
|
|
@@ -41,7 +64,7 @@ sap.ui.define(["sap/ui/thirdparty/jquery"],
|
|
|
41
64
|
return element.innerHTML;
|
|
42
65
|
};
|
|
43
66
|
|
|
44
|
-
var processSections = function() {
|
|
67
|
+
var processSections = function () {
|
|
45
68
|
/* "Invalid DOM Elements" (ones that should not be added to the body) are:
|
|
46
69
|
- all scripts
|
|
47
70
|
- element with class topictitle1 (this is used as title)
|
|
@@ -72,11 +95,11 @@ sap.ui.define(["sap/ui/thirdparty/jquery"],
|
|
|
72
95
|
|
|
73
96
|
fixImgLocation(wrapperContainer);
|
|
74
97
|
|
|
75
|
-
json['html'] =
|
|
98
|
+
json['html'] = wrapperContainer.innerHTML;
|
|
76
99
|
};
|
|
77
100
|
|
|
78
101
|
var json = {}, mdEditLink;
|
|
79
|
-
aSingles.forEach(function(singleNode, idx){
|
|
102
|
+
aSingles.forEach(function (singleNode, idx) {
|
|
80
103
|
json[singleNode] = processSingleNode(singleNode);
|
|
81
104
|
});
|
|
82
105
|
|
|
@@ -104,10 +127,39 @@ sap.ui.define(["sap/ui/thirdparty/jquery"],
|
|
|
104
127
|
}
|
|
105
128
|
}
|
|
106
129
|
|
|
130
|
+
/**
|
|
131
|
+
* Removes HTML tags from a string, except for those specified in the preservedTags array.
|
|
132
|
+
* @param {string} txt - The input string.
|
|
133
|
+
* @param {string[]} [preservedTags] - An optional array of HTML tags to preserve.
|
|
134
|
+
* @return {string} The input string with HTML tags removed.
|
|
135
|
+
*/
|
|
136
|
+
function removeHTMLTags(txt, preservedTags) {
|
|
137
|
+
if (preservedTags === undefined || preservedTags.length === 0) {
|
|
138
|
+
return removeAllHTMLTags(txt);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return txt.replace(/<\/?([^>]+)>/g, function (match, tag) {
|
|
142
|
+
if (preservedTags.indexOf(tag) === -1) {
|
|
143
|
+
return '';
|
|
144
|
+
}
|
|
145
|
+
return match;
|
|
146
|
+
}).replace(/\s{2,}/g, ' ');
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Removes all HTML tags from a string.
|
|
151
|
+
* @param {string} txt - The input string.
|
|
152
|
+
* @return {string} The input string with all HTML tags removed.
|
|
153
|
+
*/
|
|
154
|
+
function removeAllHTMLTags(txt) {
|
|
155
|
+
return txt.replace(/<[^>]*>/g, ' ').replace(/\s{2,}/g, ' ');
|
|
156
|
+
}
|
|
157
|
+
|
|
107
158
|
return {
|
|
108
|
-
DomXml2JSON
|
|
159
|
+
DomXml2JSON: buildDocuJSON,
|
|
109
160
|
XML2DOM: xml2dom,
|
|
110
|
-
XML2JSON: buildDocuJSON
|
|
161
|
+
XML2JSON: buildDocuJSON,
|
|
162
|
+
removeHTMLTags: removeHTMLTags
|
|
111
163
|
};
|
|
112
164
|
|
|
113
165
|
});
|
|
@@ -318,6 +318,10 @@ html.sap-desktop .sapContrast.sapMSlt.sapUiDocumentationSelect:not(.sapMSltExpan
|
|
|
318
318
|
font-family: "72Black", "72Blackfull", "72", "72full", Arial, Helvetica, sans-serif;
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
+
.sapUiDocumentationTopicSubtitle code {
|
|
322
|
+
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
|
323
|
+
}
|
|
324
|
+
|
|
321
325
|
.sapUiMedia-Std-Phone .sapUiDocumentationTopicTitle {
|
|
322
326
|
font-size: 1.5rem;
|
|
323
327
|
}
|
|
@@ -328,11 +332,13 @@ html.sap-desktop .sapContrast.sapMSlt.sapUiDocumentationSelect:not(.sapMSltExpan
|
|
|
328
332
|
padding-right: 2rem;
|
|
329
333
|
}
|
|
330
334
|
|
|
331
|
-
.sapUiTheme-sap_horizon .sapFDynamicPageHeader.sapFDynamicPageHeaderWithContent .sapMText
|
|
335
|
+
.sapUiTheme-sap_horizon .sapFDynamicPageHeader.sapFDynamicPageHeaderWithContent .sapMText,
|
|
336
|
+
.sapUiTheme-sap_horizon .sapFDynamicPageHeaderWithContent .sapUiDocumentationTopicSubtitle {
|
|
332
337
|
color: #556b82;
|
|
333
338
|
}
|
|
334
339
|
|
|
335
|
-
.sapUiTheme-sap_horizon_dark .sapFDynamicPageHeader.sapFDynamicPageHeaderWithContent .sapMText
|
|
340
|
+
.sapUiTheme-sap_horizon_dark .sapFDynamicPageHeader.sapFDynamicPageHeaderWithContent .sapMText,
|
|
341
|
+
.sapUiTheme-sap_horizon_dark .sapFDynamicPageHeaderWithContent .sapUiDocumentationTopicSubtitle {
|
|
336
342
|
color: #8396a8;
|
|
337
343
|
}
|
|
338
344
|
|
|
@@ -72,7 +72,13 @@
|
|
|
72
72
|
"config": {
|
|
73
73
|
"docuPath": "./docs/topics/",
|
|
74
74
|
"exploredURI": "./",
|
|
75
|
-
"topicHtmlMainDivId": "d4h5-main-container"
|
|
75
|
+
"topicHtmlMainDivId": "d4h5-main-container",
|
|
76
|
+
"preservedContent": [
|
|
77
|
+
{
|
|
78
|
+
"className": "shortdesc",
|
|
79
|
+
"preservedTags": ["code"]
|
|
80
|
+
}
|
|
81
|
+
]
|
|
76
82
|
},
|
|
77
83
|
"routing": {
|
|
78
84
|
"config": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -9,8 +9,10 @@ sap.ui.define([
|
|
|
9
9
|
"sap/ui/base/Object",
|
|
10
10
|
"sap/base/util/merge",
|
|
11
11
|
"sap/ui/documentation/sdk/controller/util/JSDocUtil",
|
|
12
|
+
"sap/base/security/sanitizeHTML",
|
|
13
|
+
"sap/ui/documentation/sdk/controller/util/URLUtil",
|
|
12
14
|
"sap/base/strings/formatMessage"
|
|
13
|
-
], function (BaseObject, merge, JSDocUtil,
|
|
15
|
+
], function (BaseObject, merge, JSDocUtil, sanitizeHTML, URLUtil, formatMessage) {
|
|
14
16
|
"use strict";
|
|
15
17
|
|
|
16
18
|
// regexp for an extra route parameter in the format: a single 'p' letter followed by a digit
|
|
@@ -281,6 +283,24 @@ sap.ui.define([
|
|
|
281
283
|
return formatMessage(sMsg, sParam);
|
|
282
284
|
},
|
|
283
285
|
|
|
286
|
+
//Formatter for links, coming from api.json text in static documentation format
|
|
287
|
+
formatMessageStripLinks: function (sText) {
|
|
288
|
+
var bStatic = window['sap-ui-documentation-static'];
|
|
289
|
+
|
|
290
|
+
if (sText) {
|
|
291
|
+
|
|
292
|
+
sText = sanitizeHTML(sText, {
|
|
293
|
+
uriRewriter: function(sUrl) {
|
|
294
|
+
if (bStatic && URLUtil.hasSEOOptimizedFormat("/" + sUrl)) {
|
|
295
|
+
sUrl = URLUtil.convertToNonSEOFormat(sUrl).replace(/^\//, "");
|
|
296
|
+
}
|
|
297
|
+
return sUrl;
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
return sText;
|
|
302
|
+
},
|
|
303
|
+
|
|
284
304
|
/**
|
|
285
305
|
* Formats the value of the <code>visibile</code> property of the cards in the Tools section
|
|
286
306
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* global hasher */
|
|
2
2
|
/*!
|
|
3
3
|
* OpenUI5
|
|
4
|
-
* (c) Copyright 2009-
|
|
4
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
6
6
|
*/
|
|
7
7
|
// Provides a customized router class for the 'documentation' app.
|
|
@@ -249,11 +249,6 @@ sap.ui.define([
|
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
// The links from the static documentation are already preprocessed at build-time
|
|
253
|
-
// to the correct format, so we do not need to adjust them here at run-time
|
|
254
|
-
if (window['sap-ui-documentation-static'] && oAnchorElement.classList.contains('sap-doc')) {
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
252
|
sTarget = getHref(oAnchorElement);
|
|
258
253
|
|
|
259
254
|
bParsed = /^blob:/.test(sTarget)
|
|
@@ -305,11 +300,6 @@ sap.ui.define([
|
|
|
305
300
|
oUri;
|
|
306
301
|
|
|
307
302
|
if (oAnchorElement) {
|
|
308
|
-
// The links from the static documentation are already preprocessed at build-time
|
|
309
|
-
// to the correct format, so we do not need to adjust them here at run-time
|
|
310
|
-
if (window['sap-ui-documentation-static'] && oAnchorElement.classList.contains('sap-doc')) {
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
303
|
sTargetHref = getHref(oAnchorElement);
|
|
314
304
|
bNewWindow = bCtrlHold || !getSameWindow(oAnchorElement);
|
|
315
305
|
}
|
|
@@ -679,7 +669,7 @@ sap.ui.define([
|
|
|
679
669
|
}
|
|
680
670
|
|
|
681
671
|
function isAnchorElement(oAnchorElement, bSameWindow) {
|
|
682
|
-
if (oAnchorElement && oAnchorElement.nodeName === "A") {
|
|
672
|
+
if (oAnchorElement && oAnchorElement.nodeName === "A" || oAnchorElement.nodeName === "AREA") {
|
|
683
673
|
return bSameWindow ? getSameWindow(oAnchorElement) : true;
|
|
684
674
|
}
|
|
685
675
|
|