@openui5/sap.ui.documentation 1.94.0 → 1.97.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.
Files changed (98) hide show
  1. package/.reuse/dep5 +12 -12
  2. package/THIRDPARTY.txt +21 -17
  3. package/package.json +6 -6
  4. package/src/sap/ui/documentation/.library +1 -6
  5. package/src/sap/ui/documentation/library.js +2 -2
  6. package/src/sap/ui/documentation/messagebundle.properties +39 -4
  7. package/src/sap/ui/documentation/messagebundle_ar.properties +23 -4
  8. package/src/sap/ui/documentation/messagebundle_bg.properties +23 -4
  9. package/src/sap/ui/documentation/messagebundle_ca.properties +21 -2
  10. package/src/sap/ui/documentation/messagebundle_cs.properties +21 -2
  11. package/src/sap/ui/documentation/messagebundle_cy.properties +23 -4
  12. package/src/sap/ui/documentation/messagebundle_da.properties +21 -2
  13. package/src/sap/ui/documentation/messagebundle_de.properties +21 -2
  14. package/src/sap/ui/documentation/messagebundle_el.properties +21 -2
  15. package/src/sap/ui/documentation/messagebundle_en.properties +21 -2
  16. package/src/sap/ui/documentation/messagebundle_en_GB.properties +21 -2
  17. package/src/sap/ui/documentation/messagebundle_en_US_sappsd.properties +23 -3
  18. package/src/sap/ui/documentation/messagebundle_en_US_saptrc.properties +23 -3
  19. package/src/sap/ui/documentation/messagebundle_es.properties +21 -2
  20. package/src/sap/ui/documentation/messagebundle_es_MX.properties +21 -2
  21. package/src/sap/ui/documentation/messagebundle_et.properties +21 -2
  22. package/src/sap/ui/documentation/messagebundle_fi.properties +23 -4
  23. package/src/sap/ui/documentation/messagebundle_fr.properties +23 -4
  24. package/src/sap/ui/documentation/messagebundle_fr_CA.properties +24 -5
  25. package/src/sap/ui/documentation/messagebundle_hi.properties +23 -4
  26. package/src/sap/ui/documentation/messagebundle_hr.properties +23 -4
  27. package/src/sap/ui/documentation/messagebundle_hu.properties +23 -4
  28. package/src/sap/ui/documentation/messagebundle_id.properties +22 -3
  29. package/src/sap/ui/documentation/messagebundle_it.properties +23 -4
  30. package/src/sap/ui/documentation/messagebundle_iw.properties +21 -2
  31. package/src/sap/ui/documentation/messagebundle_ja.properties +21 -2
  32. package/src/sap/ui/documentation/messagebundle_kk.properties +23 -4
  33. package/src/sap/ui/documentation/messagebundle_ko.properties +21 -2
  34. package/src/sap/ui/documentation/messagebundle_lt.properties +21 -2
  35. package/src/sap/ui/documentation/messagebundle_lv.properties +23 -4
  36. package/src/sap/ui/documentation/messagebundle_ms.properties +21 -2
  37. package/src/sap/ui/documentation/messagebundle_nl.properties +21 -2
  38. package/src/sap/ui/documentation/messagebundle_no.properties +23 -4
  39. package/src/sap/ui/documentation/messagebundle_pl.properties +21 -2
  40. package/src/sap/ui/documentation/messagebundle_pt.properties +23 -4
  41. package/src/sap/ui/documentation/messagebundle_pt_PT.properties +23 -4
  42. package/src/sap/ui/documentation/messagebundle_ro.properties +23 -4
  43. package/src/sap/ui/documentation/messagebundle_ru.properties +23 -4
  44. package/src/sap/ui/documentation/messagebundle_sh.properties +23 -4
  45. package/src/sap/ui/documentation/messagebundle_sk.properties +21 -2
  46. package/src/sap/ui/documentation/messagebundle_sl.properties +23 -4
  47. package/src/sap/ui/documentation/messagebundle_sv.properties +21 -2
  48. package/src/sap/ui/documentation/messagebundle_th.properties +21 -2
  49. package/src/sap/ui/documentation/messagebundle_tr.properties +21 -2
  50. package/src/sap/ui/documentation/messagebundle_uk.properties +34 -15
  51. package/src/sap/ui/documentation/messagebundle_vi.properties +23 -4
  52. package/src/sap/ui/documentation/messagebundle_zh_CN.properties +23 -4
  53. package/src/sap/ui/documentation/messagebundle_zh_TW.properties +23 -4
  54. package/src/sap/ui/documentation/sdk/Component.js +3 -2
  55. package/src/sap/ui/documentation/sdk/controller/ApiDetailIndexDeprecatedExperimental.controller.js +1 -38
  56. package/src/sap/ui/documentation/sdk/controller/App.controller.js +99 -16
  57. package/src/sap/ui/documentation/sdk/controller/News.controller.js +77 -0
  58. package/src/sap/ui/documentation/sdk/controller/Sample.controller.js +28 -30
  59. package/src/sap/ui/documentation/sdk/controller/SampleBaseController.js +6 -4
  60. package/src/sap/ui/documentation/sdk/controller/SampleNotFound.controller.js +14 -0
  61. package/src/sap/ui/documentation/sdk/controller/SubApiDetail.controller.js +1 -1
  62. package/src/sap/ui/documentation/sdk/controller/TopicDetail.controller.js +1 -1
  63. package/src/sap/ui/documentation/sdk/controller/util/ConfigUtil.js +16 -0
  64. package/src/sap/ui/documentation/sdk/controller/util/NewsInfo.js +188 -0
  65. package/src/sap/ui/documentation/sdk/controller/util/ToolsInfo.js +7 -1
  66. package/src/sap/ui/documentation/sdk/css/style.css +31 -5
  67. package/src/sap/ui/documentation/sdk/images/tools/FlexibleProgrammingModelExplorer.jpg +0 -0
  68. package/src/sap/ui/documentation/sdk/index.html +55 -0
  69. package/src/sap/ui/documentation/sdk/manifest.json +23 -0
  70. package/src/sap/ui/documentation/sdk/util/DocumentationRouter.js +20 -12
  71. package/src/sap/ui/documentation/sdk/util/Resources.js +12 -7
  72. package/src/sap/ui/documentation/sdk/view/App.view.xml +27 -1
  73. package/src/sap/ui/documentation/sdk/view/ChangeVersionDialog.fragment.xml +16 -7
  74. package/src/sap/ui/documentation/sdk/view/News.view.xml +68 -0
  75. package/src/sap/ui/documentation/sdk/view/NewsPopover.fragment.xml +51 -0
  76. package/src/sap/ui/documentation/sdk/view/ReleaseDialog.fragment.xml +1 -1
  77. package/src/sap/ui/documentation/sdk/view/SampleNotFound.view.xml +17 -0
  78. package/src/sap/ui/documentation/sdk/view/Tools.view.xml +25 -27
  79. package/src/sap/ui/documentation/sdk/view/Welcome.view.xml +40 -6
  80. package/src/sap/ui/documentation/themes/base/Documentation.less +8 -13
  81. package/src/sap/ui/documentation/themes/sap_belize/library.source.less +3 -1
  82. package/src/sap/ui/documentation/themes/sap_belize_hcb/library.source.less +3 -1
  83. package/src/sap/ui/documentation/themes/sap_belize_hcw/library.source.less +3 -1
  84. package/src/sap/ui/documentation/themes/sap_belize_plus/library.source.less +3 -1
  85. package/src/sap/ui/documentation/themes/sap_fiori_3/library.source.less +3 -10
  86. package/src/sap/ui/documentation/themes/sap_fiori_3_dark/library.source.less +4 -11
  87. package/src/sap/ui/documentation/themes/sap_fiori_3_hcb/library.source.less +3 -1
  88. package/src/sap/ui/documentation/themes/sap_fiori_3_hcw/library.source.less +3 -1
  89. package/src/sap/ui/documentation/themes/sap_horizon/library.source.less +9 -0
  90. package/ui5.yaml +8 -2
  91. package/src/sap/ui/documentation/sdk/thirdparty/google-code-prettify/lang-css.js +0 -160
  92. package/src/sap/ui/documentation/sdk/thirdparty/google-code-prettify/lang-feature.js +0 -33
  93. package/src/sap/ui/documentation/sdk/thirdparty/google-code-prettify/lang-properties.js +0 -22
  94. package/src/sap/ui/documentation/sdk/thirdparty/google-code-prettify/lang-text.js +0 -11
  95. package/src/sap/ui/documentation/sdk/thirdparty/google-code-prettify/prettify.css +0 -232
  96. package/src/sap/ui/documentation/sdk/thirdparty/google-code-prettify/prettify.js +0 -1740
  97. package/src/sap/ui/documentation/sdk/thirdparty/google-code-prettify/run-prettify.js +0 -27
  98. package/src/sap/ui/documentation/sdk/thirdparty/google-code-prettify/run_prettify.js +0 -34
@@ -0,0 +1,188 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ // Provides reuse functionality for reading news from news RSS files
8
+ sap.ui.define([
9
+ "sap/ui/core/Core",
10
+ "sap/ui/thirdparty/jquery",
11
+ "sap/ui/documentation/sdk/util/Resources",
12
+ "sap/base/Log"
13
+ ],
14
+ function(Core, jQuery, ResourcesUtil, Log) {
15
+ "use strict";
16
+
17
+ var _oNewsDataCache = {},
18
+ _aNewNews = [],
19
+ _aOldNews = [],
20
+ _sPreparationFailureMessage = null,
21
+ _bInitiallySplit = false,
22
+ _sOldNewsLocalStorageKey = 'OLD_NEWS_IDS',
23
+ _sLocalStorageNewsName,
24
+ _oConfigUtilInstance;
25
+
26
+ function prepareNewsData(oConfigUtilInstance) {
27
+
28
+ if (_oNewsDataCache["newsRSS"]) {
29
+ return Promise.resolve(_oNewsDataCache["newsRSS"]);
30
+ }
31
+
32
+ _oConfigUtilInstance = oConfigUtilInstance;
33
+ _sLocalStorageNewsName = _oConfigUtilInstance.LOCAL_STORAGE_NAMES[_sOldNewsLocalStorageKey];
34
+
35
+ return _requireConfigJSON()
36
+ .then(_requireFeedXML)
37
+ .then(_parseDateToLocaleString)
38
+ .then(_splitNewAndOldItems)
39
+ .catch(function (vReason) {
40
+ _sPreparationFailureMessage = vReason.message;
41
+ Log.error(_sPreparationFailureMessage);
42
+ })
43
+ .finally(_publishNewsChangedEvent);
44
+ }
45
+
46
+ function _splitNewAndOldItems() {
47
+
48
+ if (_bInitiallySplit) {
49
+ return Promise.resolve();
50
+ }
51
+
52
+ var aLocalStorageCachedIDs = _oConfigUtilInstance.getLocalStorageItem(_sLocalStorageNewsName);
53
+
54
+ return new Promise(function (resolve) {
55
+
56
+ var aItems = _oNewsDataCache["newsRSS"].items,
57
+ oCurrItem;
58
+
59
+ if (Array.isArray(aLocalStorageCachedIDs)) {
60
+ for (var i = 0; i < aItems.length; i++) {
61
+ oCurrItem = aItems[i];
62
+ if (aLocalStorageCachedIDs.indexOf(oCurrItem.id) !== -1) {
63
+ _aOldNews.push(oCurrItem);
64
+ } else {
65
+ _aNewNews.push(oCurrItem);
66
+ }
67
+ }
68
+ } else {
69
+ _aNewNews = aItems.slice();
70
+ }
71
+ _bInitiallySplit = true;
72
+ resolve();
73
+ });
74
+ }
75
+
76
+ function getPreparationFailureMessage() {
77
+ return _sPreparationFailureMessage;
78
+ }
79
+
80
+ function getNewNewsArray() {
81
+ return _aNewNews;
82
+ }
83
+
84
+ function getOldNewsArray() {
85
+ return _aOldNews;
86
+ }
87
+
88
+ function moveNewItemToOld(oItem) {
89
+ var iIndexInNewArr = _aNewNews.indexOf(oItem),
90
+ aLocalStorageIDs = _oConfigUtilInstance.getLocalStorageItem(_sLocalStorageNewsName) || [];
91
+
92
+ if (iIndexInNewArr > -1) {
93
+ _aNewNews.splice(iIndexInNewArr, 1);
94
+ }
95
+
96
+ _aOldNews.push(oItem);
97
+ aLocalStorageIDs.push(oItem.id);
98
+
99
+ _oConfigUtilInstance.setLocalStorageItem(_sLocalStorageNewsName, aLocalStorageIDs);
100
+ _publishNewsChangedEvent();
101
+ }
102
+
103
+ function moveAllNewItemsToOld() {
104
+ var aLocalStorageIDs = _oConfigUtilInstance.getLocalStorageItem(_sLocalStorageNewsName) || [],
105
+ oCurrItem;
106
+
107
+ for (var i = 0; i < _aNewNews.length; i++) {
108
+ oCurrItem = _aNewNews[i];
109
+ _aOldNews.push(oCurrItem);
110
+ aLocalStorageIDs.push(oCurrItem.id);
111
+ }
112
+
113
+ _aNewNews = [];
114
+ _oConfigUtilInstance.setLocalStorageItem(_sLocalStorageNewsName, aLocalStorageIDs);
115
+
116
+ _publishNewsChangedEvent();
117
+ }
118
+
119
+ function _parseDateToLocaleString() {
120
+ var aItems = _oNewsDataCache["newsRSS"].items;
121
+
122
+ aItems.forEach(function(oItem) {
123
+ oItem.updated = new Date(oItem.updated).toLocaleString();
124
+ });
125
+ }
126
+
127
+ function _publishNewsChangedEvent() {
128
+ Core.getEventBus().publish("newsChanged", "onDemoKitNewsChanged");
129
+ }
130
+
131
+ function _requireConfigJSON() {
132
+ return new Promise(function (resolve) {
133
+ jQuery.ajax(ResourcesUtil.getResourceOriginPath("/news-config.json"), {
134
+ type: "GET",
135
+ dataType: "JSON",
136
+ success : function(oResult) {
137
+ resolve(oResult);
138
+ },
139
+ error : function () {
140
+ Log.error("failed to load news-config.json");
141
+ resolve();
142
+ }
143
+ });
144
+ });
145
+ }
146
+
147
+ function _requireFeedXML(oJSON) {
148
+ return new Promise(function (resolve) {
149
+ jQuery.ajax(ResourcesUtil.getResourceOriginPath(oJSON.feedPath), {
150
+ type: "GET",
151
+ dataType: "xml",
152
+ success : function(oResult) {
153
+
154
+ var items = [];
155
+ jQuery('item', oResult).each( function() {
156
+ var item = {};
157
+ item.title = jQuery(this).find('title').eq(0).text();
158
+ item.link = jQuery(this).find('link').eq(0).text();
159
+ item.description = jQuery(this).find('description').eq(0).text();
160
+ item.updated = jQuery(this).find('pubDate').eq(0).text();
161
+ item.id = jQuery(this).find('guid').eq(0).text();
162
+ items.push(item);
163
+ });
164
+
165
+ _oNewsDataCache["newsRSS"] = {"items" : items};
166
+ resolve(
167
+ _oNewsDataCache["newsRSS"]
168
+ );
169
+ },
170
+ error : function () {
171
+ Log.error("failed to load news rss");
172
+ _oNewsDataCache["newsRSS"] = null;
173
+ resolve();
174
+ }
175
+ });
176
+ });
177
+ }
178
+
179
+ return {
180
+ moveAllNewItemsToOld: moveAllNewItemsToOld,
181
+ moveNewItemToOld: moveNewItemToOld,
182
+ prepareNewsData: prepareNewsData,
183
+ getPreparationFailureMessage: getPreparationFailureMessage,
184
+ getNewNewsArray: getNewNewsArray,
185
+ getOldNewsArray: getOldNewsArray
186
+ };
187
+
188
+ });
@@ -12,7 +12,8 @@ sap.ui.define([],
12
12
  var aTools = [
13
13
  {
14
14
  "id": "uiThemeDesigner",
15
- "text": "UI Theme Designer"
15
+ "text": "UI Theme Designer",
16
+ "href": "https://www.sap.com/community/topics/ui-theme-designer.html"
16
17
  },
17
18
  {
18
19
  "id": "businessApplicationStudio",
@@ -63,6 +64,11 @@ sap.ui.define([],
63
64
  "id": "fioriTools",
64
65
  "text": "SAP Fiori Tools",
65
66
  "href": "https://help.sap.com/viewer/product/SAP_FIORI_tools/Latest/en-US"
67
+ },
68
+ {
69
+ "id": "flexibleProgrammingModelExplorer",
70
+ "text": "Flexible Programming Model Explorer",
71
+ "href": "https://sapui5.hana.ondemand.com/test-resources/sap/fe/core/fpmExplorer/index.html#/overview/introduction"
66
72
  }
67
73
  ];
68
74
 
@@ -11,6 +11,22 @@
11
11
  vertical-align: bottom;
12
12
  }
13
13
 
14
+ .newsButton.sapMBtn .sapMBadgeTopRight.sapMBadge .sapMBadgeIndicator {
15
+ position: absolute;
16
+ top: 0;
17
+ right: 0;
18
+ padding: 0;
19
+ }
20
+
21
+ .sapUiSizeCompact .newsButton.sapMBtn .sapMBadgeTopRight.sapMBadge .sapMBadgeIndicator {
22
+ top: -0.25rem;
23
+ right: -0.125rem;
24
+ }
25
+
26
+ .sapUiDemokitCustomNLI.sapMNLI {
27
+ cursor: default;
28
+ }
29
+
14
30
  .aboutDialog .sapMMsgStrip .sapMFT {
15
31
  word-break: break-word;
16
32
  }
@@ -1089,6 +1105,21 @@ html:not(.sapUiTheme-sap_belize_hcw):not(.sapUiTheme-sap_belize_hcb):not(.sapUiT
1089
1105
  }
1090
1106
  }
1091
1107
 
1108
+ .sapUiDemokit .videoWrapper {
1109
+ position: relative;
1110
+ padding-bottom: 56.25%;
1111
+ height: 0;
1112
+ }
1113
+
1114
+ .sapUiDemokit .videoWrapper iframe {
1115
+ position: absolute;
1116
+ top: 0;
1117
+ left: 0;
1118
+ width: 100%;
1119
+ height: 100%;
1120
+ border: none;
1121
+ }
1122
+
1092
1123
  /* ==========================================================================
1093
1124
  Documentation Page Header styles
1094
1125
  ========================================================================== */
@@ -1508,11 +1539,6 @@ html.sapUiTheme-sap_belize_hcb .sapUiDocumentationTopicsIframe {
1508
1539
  background: #fff;
1509
1540
  }
1510
1541
 
1511
- /* Prettified text looks bigger when viewed from mac, even if it has the same font size */
1512
- html[data-sap-ui-os="mac"] pre.prettyprint.prettyprinted {
1513
- font-size: 0.8rem;
1514
- }
1515
-
1516
1542
  /*
1517
1543
  * API Detail page specific CSS improving readability
1518
1544
  * Note: Keep in mind this is applicable only for the sap_belize and sap_belize_plus themes
@@ -0,0 +1,55 @@
1
+ <!DOCTYPE html>
2
+ <html style="height: 100%;">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>SAPUI5 Navigation</title>
7
+ <script>
8
+
9
+ var sSampleId = new window.URLSearchParams(window.location.search).get('sap-ui-xx-sample-id'),
10
+ sSamplePath = new window.URLSearchParams(window.location.search).get('sap-ui-xx-sample-path'),
11
+ sOrigin = new window.URLSearchParams(window.location.search).get('sap-ui-xx-sample-origin'),
12
+ sVersion = new window.URLSearchParams(window.location.search).get('sap-ui-xx-sample-version'),
13
+
14
+ oPath = {};
15
+ if (!sOrigin || sOrigin == ".") {
16
+ sOrigin = window.location.origin + (window.location.pathname.includes("testsuite") ? "/testsuite" : "");
17
+ } else {
18
+ sOrigin = sOrigin + sVersion;
19
+ }
20
+
21
+ oPath[sSampleId.replace(/\./g, "/")] = sSamplePath;
22
+ oPath["sap/ui/demo/mock"] = sOrigin + "/test-resources/sap/ui/documentation/sdk";
23
+ oPath["test-resources/sap/ui/documentation/sdk"] = ".";
24
+ oPath["sap/uxap/sample"] = sOrigin + "/test-resources/sap/uxap/demokit/sample";
25
+
26
+
27
+
28
+ document.write("<script src=" + sOrigin + '/resources/sap-ui-core.js' + " id='sap-ui-bootstrap' " +
29
+ "data-sap-ui-libs='sap.m' data-sap-ui-bindingSyntax='complex' data-sap-ui-compatVersion='edge'></scr" + "ipt>");
30
+ document.write("<base href=" + sOrigin + "/>");
31
+
32
+ </script>
33
+ </head>
34
+ <body class="sapUiBody sapUiSizeCompact" id="content">
35
+ <script>
36
+ sap.ui.getCore().attachInit(function () {
37
+ sap.ui.require([
38
+ "sap/ui/core/ComponentContainer"
39
+ ], function (ComponentContainer) {
40
+
41
+ sap.ui.loader.config({
42
+ paths: oPath
43
+ });
44
+
45
+ var oContainer = new ComponentContainer({
46
+ name : sSampleId,
47
+ height : "100%",
48
+ manifest: false
49
+ }).placeAt('content');
50
+
51
+ });
52
+ });
53
+ </script>
54
+ </body>
55
+ </html>
@@ -32,6 +32,13 @@
32
32
  "async": true,
33
33
  "id": "app"
34
34
  },
35
+ "resources": {
36
+ "css": [
37
+ {
38
+ "uri": "css/style.css"
39
+ }
40
+ ]
41
+ },
35
42
  "dependencies": {
36
43
  "minUI5Version": "1.46.0",
37
44
  "libs": {
@@ -290,6 +297,13 @@
290
297
  "tools"
291
298
  ]
292
299
  },
300
+ {
301
+ "pattern": "news",
302
+ "name": "news",
303
+ "target": [
304
+ "news"
305
+ ]
306
+ },
293
307
  {
294
308
  "pattern": "search/{searchParam}:?options:",
295
309
  "name": "search",
@@ -415,6 +429,11 @@
415
429
  "viewLevel": 2,
416
430
  "viewId": "tools"
417
431
  },
432
+ "news": {
433
+ "viewName": "News",
434
+ "viewLevel": 2,
435
+ "viewId": "news"
436
+ },
418
437
  "apiDetailInitial": {
419
438
  "viewName": "ApiDetailInitial",
420
439
  "viewId": "apiDetailInitial",
@@ -462,6 +481,10 @@
462
481
  "viewLevel": 2,
463
482
  "controlAggregation": "detailPages"
464
483
  },
484
+ "sampleNotFound": {
485
+ "viewName": "SampleNotFound",
486
+ "viewId": "sampleNotFound"
487
+ },
465
488
  "notFound": {
466
489
  "viewName": "NotFound",
467
490
  "viewId": "notFound"
@@ -9,8 +9,9 @@ sap.ui.define([
9
9
  'sap/m/routing/Router',
10
10
  'sap/ui/core/routing/History',
11
11
  'sap/ui/thirdparty/hasher',
12
- "sap/ui/documentation/sdk/controller/util/ControlsInfo"
13
- ], function(Router, History, Hasher, ControlsInfo) {
12
+ "sap/ui/documentation/sdk/controller/util/ControlsInfo",
13
+ "sap/ui/thirdparty/URI"
14
+ ], function(Router, History, Hasher, ControlsInfo, URI) {
14
15
  "use strict";
15
16
 
16
17
  // We need to set the global hasher instance to not encode URL's. This is specific for the SDK
@@ -238,7 +239,7 @@ sap.ui.define([
238
239
  return;
239
240
  }
240
241
 
241
- oAnchorElement = getClosestParentLink(oElement);
242
+ oAnchorElement = getClosestParentLink(oElement, true);
242
243
 
243
244
  if (!oAnchorElement) {
244
245
  return;
@@ -293,7 +294,9 @@ sap.ui.define([
293
294
  oTarget = oEvent.target,
294
295
  oAnchorElement = getClosestParentLink(oTarget),
295
296
  bCtrlHold = oEvent.ctrlKey || oEvent.metaKey,
296
- sTargetHref;
297
+ sTargetHref,
298
+ bNewWindow,
299
+ oUri;
297
300
 
298
301
  if (oAnchorElement) {
299
302
  // The links from the static documentation are already preprocessed at build-time
@@ -302,17 +305,18 @@ sap.ui.define([
302
305
  return;
303
306
  }
304
307
  sTargetHref = getHref(oAnchorElement);
308
+ bNewWindow = bCtrlHold || !getSameWindow(oAnchorElement);
305
309
  }
306
310
 
307
311
  // Do not change href if it's already changed or if it's a stand-alone HTML page
308
- if (!sTargetHref || /^https?:\/\//.test(sTargetHref) || sTargetHref.endsWith(".html")) {
312
+ if (!sTargetHref || (oUri = URI(sTargetHref)).is("absolute") || oUri.suffix() === "html") {
309
313
  return;
310
314
  }
311
315
 
312
316
  // When context menu of the Browser is opened or when the aux button is clicked,
313
317
  // or if the ctrl is hold and left mouse button is clicked
314
318
  // we change the href of the anchor element
315
- if (iPressedButton === 2 || iPressedButton === 4 || (bCtrlHold && iPressedButton === 1)) {
319
+ if (iPressedButton === 2 || iPressedButton === 4 || (bNewWindow && iPressedButton === 1)) {
316
320
  sTargetHref = this.convertToStaticFormat(sTargetHref);
317
321
  oAnchorElement.setAttribute("href", sTargetHref);
318
322
  }
@@ -649,21 +653,21 @@ sap.ui.define([
649
653
  };
650
654
 
651
655
  // util
652
- function getClosestParentLink(oAnchorElement, iMaxDrillUp) {
653
- var bIsAnchor = isAnchorElement(oAnchorElement), iDrillUp = 0;
656
+ function getClosestParentLink(oAnchorElement, bSameWindow, iMaxDrillUp) {
657
+ var bIsAnchor = isAnchorElement(oAnchorElement, bSameWindow), iDrillUp = 0;
654
658
  iMaxDrillUp || (iMaxDrillUp = 3);
655
659
 
656
660
  while (!bIsAnchor && iDrillUp++ < iMaxDrillUp) {
657
661
  oAnchorElement = oAnchorElement && oAnchorElement.parentElement;
658
- bIsAnchor = isAnchorElement(oAnchorElement);
662
+ bIsAnchor = isAnchorElement(oAnchorElement, bSameWindow);
659
663
  }
660
664
 
661
665
  return oAnchorElement;
662
666
  }
663
667
 
664
- function isAnchorElement(oAnchorElement) {
665
- if (oAnchorElement && oAnchorElement.nodeName === "A" && oAnchorElement.getAttribute("target") !== "_blank") {
666
- return true;
668
+ function isAnchorElement(oAnchorElement, bSameWindow) {
669
+ if (oAnchorElement && oAnchorElement.nodeName === "A") {
670
+ return bSameWindow ? getSameWindow(oAnchorElement) : true;
667
671
  }
668
672
 
669
673
  return false;
@@ -673,6 +677,10 @@ sap.ui.define([
673
677
  return oAnchorElement.getAttribute("href");
674
678
  }
675
679
 
680
+ function getSameWindow(oAnchorElement) {
681
+ return oAnchorElement.getAttribute("target") !== "_blank";
682
+ }
683
+
676
684
  return DocumentationRouter;
677
685
 
678
686
  });
@@ -22,22 +22,27 @@
22
22
  *
23
23
  * @param {string} sPath Relative path to resources
24
24
  */
25
+
25
26
  getResourceOriginPath: function (sPath) {
26
- var oConfig, sOrigin,
27
+ var sOrigin,
27
28
  oUri = URI(sPath),
28
- bUseUnifiedResourceOrigin = new window.URLSearchParams(window.location.search).get('sap-ui-xx-unifiedResources') != null,
29
- sVersionPrefixPath = bUseUnifiedResourceOrigin && window.sessionStorage.getItem("versionPrefixPath") || "";
29
+ sVersionPrefixPath = this.getResourcesVersion();
30
30
  if (oUri && oUri.is("absolute")) {
31
31
  return sPath;
32
32
  }
33
- oConfig = self['sap-ui-documentation-config'];
34
- sOrigin = (oConfig && oConfig.demoKitResourceOrigin) || '.';
33
+ sOrigin = this.getConfig() || '.';
35
34
 
36
35
  return sOrigin + sVersionPrefixPath + this._formatPath(sPath);
37
36
  },
38
37
  getHasProxy: function () {
39
- var oConfig = self['sap-ui-documentation-config'];
40
- return !!(oConfig && oConfig.demoKitResourceOrigin);
38
+ return new window.URLSearchParams(window.location.search).get('sap-ui-xx-unifiedResources') != null ||
39
+ window["sap-ui-unified-resources"];
40
+ },
41
+ getResourcesVersion: function() {
42
+ return this.getHasProxy() && window.sessionStorage.getItem("versionPrefixPath") || "";
43
+ },
44
+ getConfig: function() {
45
+ return self['sap-ui-documentation-config'] && self['sap-ui-documentation-config'].demoKitResourceOrigin;
41
46
  },
42
47
  _formatPath: function(sPath) {
43
48
  sPath = sPath.replace(/^\.\//, '/');
@@ -72,7 +72,15 @@
72
72
  </items>
73
73
  </IconTabHeader>
74
74
 
75
- <ObjectStatus text="{= ${versionData>/isBetaVersion} ? ${i18n>APP_VERSION_BETA_VERSION} : ${i18n>APP_VERSION_VERSION}} {versionData>/version} {= ${versionData>/isBetaVersion} ? ${i18n>APP_VERSION_NOT_PRODUCTIVE} : ${versionData>/isDevVersion} ? ${i18n>APP_VERSION_IN_PROGRESS} : ''}" state="{= ${versionData>/isBetaVersion} ? 'Error' : ${versionData>/isDevVersion} ? 'Warning' : 'None'}" visible="{=!${appView>/bPhoneSize}}" />
75
+ <ObjectStatus text="{= ${versionData>/isBetaVersion} ? ${i18n>APP_VERSION_BETA_VERSION} :
76
+ ${i18n>APP_VERSION_VERSION}}
77
+ {versionData>/version}
78
+ {= ${versionData>/isBetaVersion} ? ${i18n>APP_VERSION_NOT_PRODUCTIVE} :
79
+ ${versionData>/isDevVersion} ? ${i18n>APP_VERSION_IN_PROGRESS} :
80
+ ${versionData>/latestVersion} === ${versionData>/version} ? '(Latest)' :
81
+ ''}" state="{= ${versionData>/isBetaVersion} ? 'Error' :
82
+ ${versionData>/isDevVersion} ? 'Warning' :
83
+ 'None'}" visible="{=!${appView>/bPhoneSize}}" />
76
84
 
77
85
  <Button id="changeVersionButton" press="onChangeVersionButtonPress" type="Transparent" text="{i18n>APP_CHANGE_VERSION_BTN}" visible="{appView>/bShowVersionSwitchInHeader}">
78
86
  <layoutData>
@@ -89,6 +97,24 @@
89
97
  </layoutData>
90
98
  </Button>
91
99
 
100
+ <Button
101
+ visible="{=!${news>/newsPreparationFailureMessage}}"
102
+ id="notificationsButton"
103
+ tooltip="{i18n>APP_NEWS_BTN_TOOLTIP}"
104
+ press="handleNewsPress"
105
+ icon="sap-icon://bell"
106
+ type="Transparent"
107
+ class="newsButton">
108
+ <customData>
109
+ <BadgeCustomData
110
+ key="badge"
111
+ value="{news>/newsCount}"/>
112
+ </customData>
113
+ <layoutData>
114
+ <OverflowToolbarLayoutData priority="NeverOverflow" />
115
+ </layoutData>
116
+ </Button>
117
+
92
118
  <MenuButton tooltip="{i18n>APP_INFORMATION_BTN_TOOLTIP}" id="aboutMenuButton" icon="sap-icon://action-settings" type="Transparent" visible="{=!${appView>/bSearchMode}}">
93
119
  <layoutData>
94
120
  <OverflowToolbarLayoutData priority="NeverOverflow" />
@@ -5,12 +5,22 @@
5
5
  title="{i18n>CHANGE_VERSION_DIALOG_TITLE}"
6
6
  contentHeight="400px"
7
7
  stretch="{appView>/bPhoneSize}">
8
- <endButton>
8
+ <buttons>
9
9
  <Button
10
- text="{i18n>CHANGE_VERSION_DIALOG_CLOSE_BTN}"
11
- press="onCloseVersionDialog">
10
+ text="{i18n>CHANGE_VERSION_DIALOG_APPLY_BTN}"
11
+ type="Emphasized"
12
+ press="onVersionItemPress">
12
13
  </Button>
13
- </endButton>
14
+ <Button
15
+ text="{i18n>CHANGE_VERSION_DIALOG_LATEST_BTN}"
16
+ type="Ghost"
17
+ press="onLatestVersionItemPress">
18
+ </Button>
19
+ <Button
20
+ text="{i18n>CHANGE_VERSION_DIALOG_CLOSE_BTN}"
21
+ press="onCloseVersionDialog">
22
+ </Button>
23
+ </buttons>
14
24
  <subHeader>
15
25
  <Bar>
16
26
  <contentMiddle>
@@ -23,7 +33,7 @@
23
33
  </subHeader>
24
34
  <Tree
25
35
  id="versionList"
26
- itemPress="onVersionItemPress"
36
+ mode="SingleSelectMaster"
27
37
  items="{
28
38
  path: '/',
29
39
  sorter: [{
@@ -37,8 +47,7 @@
37
47
  }]
38
48
  }">
39
49
  <StandardTreeItem
40
- title="{path: 'version'}"
41
- type="{= ${path: 'path'} ? 'Active' : 'Inactive'}">
50
+ title="{path: 'version'}{= ${path: 'version'} === ${versionData>/latestVersion} ? ' (Latest)' : ''}">
42
51
  <customData>
43
52
  <core:CustomData key="path" value="{path: 'path'}" />
44
53
  </customData>
@@ -0,0 +1,68 @@
1
+ <mvc:View controllerName="sap.ui.documentation.sdk.controller.News"
2
+ xmlns:mvc="sap.ui.core.mvc"
3
+ xmlns="sap.m"
4
+ xmlns:l="sap.ui.layout"
5
+ xmlns:core="sap.ui.core">
6
+
7
+ <MessagePage
8
+ visible="{=!!${/preparationFailureMessage}}"
9
+ text="{i18n>NEWS_PREP_FAILURE_TITLE}"
10
+ description="{/preparationFailureMessage}"
11
+ showHeader="false"
12
+ icon="sap-icon://message-warning"/>
13
+ <VBox visible="{=!${/preparationFailureMessage}}">
14
+ <NotificationList>
15
+
16
+ <NotificationListGroup
17
+ items="{path: '/new', templateShareable: false}"
18
+ title="{i18n>NEWS_NEW_GROUP_TITLE}"
19
+ showCloseButton="false">
20
+
21
+ <buttons>
22
+ <Button text="{i18n>NEWS_BTN_MARK_AS_READ}" press="handleMarkAsRead" />
23
+ </buttons>
24
+
25
+ <NotificationListItem
26
+ title="{title}"
27
+ description="{description}"
28
+ datetime="{updated}"
29
+ close="handleNewsItemClose"
30
+ class="sapUiDemokitCustomNLI">
31
+ <buttons>
32
+ <Button visible="{= %{link} !== ''}" text="{i18n>NEWS_BTN_VISIT_LINK}" press="handleVisitLink">
33
+ <customData>
34
+ <core:CustomData key="newsLink" value="{link}"/>
35
+ </customData>
36
+ </Button>
37
+ </buttons>
38
+ <customData>
39
+ <core:CustomData key="newsID" value="{id}"/>
40
+ </customData>
41
+ </NotificationListItem>
42
+
43
+ </NotificationListGroup>
44
+
45
+ <NotificationListGroup
46
+ items="{path: '/old', templateShareable: false}"
47
+ title="{i18n>NEWS_READ_GROUP_TITLE}"
48
+ showCloseButton="false">
49
+
50
+ <NotificationListItem
51
+ title="{title}"
52
+ description="{description}"
53
+ datetime="{updated}"
54
+ showCloseButton="false"
55
+ class="sapUiDemokitCustomNLI">
56
+ <buttons>
57
+ <Button visible="{= %{link} !== ''}" text="{i18n>NEWS_BTN_VISIT_LINK}" press="handleVisitLink">
58
+ <customData>
59
+ <core:CustomData key="newsLink" value="{link}"/>
60
+ </customData>
61
+ </Button>
62
+ </buttons>
63
+ </NotificationListItem>
64
+
65
+ </NotificationListGroup>
66
+ </NotificationList>
67
+ </VBox>
68
+ </mvc:View>