@openui5/sap.ui.documentation 1.96.5 → 1.99.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 +26 -31
- package/THIRDPARTY.txt +15 -21
- package/package.json +6 -6
- package/src/sap/ui/documentation/.library +1 -1
- package/src/sap/ui/documentation/library.js +2 -2
- package/src/sap/ui/documentation/messagebundle.properties +56 -10
- package/src/sap/ui/documentation/messagebundle_ar.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_bg.properties +31 -5
- package/src/sap/ui/documentation/messagebundle_ca.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_cs.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_cy.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_da.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_de.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_el.properties +31 -5
- package/src/sap/ui/documentation/messagebundle_en.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_en_GB.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_en_US_sappsd.properties +35 -9
- package/src/sap/ui/documentation/messagebundle_en_US_saprigi.properties +4 -9
- package/src/sap/ui/documentation/messagebundle_en_US_saptrc.properties +35 -9
- package/src/sap/ui/documentation/messagebundle_es.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_es_MX.properties +34 -8
- package/src/sap/ui/documentation/messagebundle_et.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_fi.properties +33 -7
- package/src/sap/ui/documentation/messagebundle_fr.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_fr_CA.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_hi.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_hr.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_hu.properties +31 -5
- package/src/sap/ui/documentation/messagebundle_id.properties +33 -7
- package/src/sap/ui/documentation/messagebundle_it.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_iw.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_ja.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_kk.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_ko.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_lt.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_lv.properties +31 -5
- package/src/sap/ui/documentation/messagebundle_ms.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_nl.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_no.properties +33 -7
- package/src/sap/ui/documentation/messagebundle_pl.properties +31 -5
- package/src/sap/ui/documentation/messagebundle_pt.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_pt_PT.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_ro.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_ru.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_sh.properties +33 -7
- package/src/sap/ui/documentation/messagebundle_sk.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_sl.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_sv.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_th.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_tr.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_uk.properties +47 -21
- package/src/sap/ui/documentation/messagebundle_vi.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_zh_CN.properties +32 -6
- package/src/sap/ui/documentation/messagebundle_zh_TW.properties +32 -6
- package/src/sap/ui/documentation/sdk/controller/ApiDetail.controller.js +2 -2
- package/src/sap/ui/documentation/sdk/controller/App.controller.js +78 -2
- package/src/sap/ui/documentation/sdk/controller/BaseController.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/ControlsMaster.controller.js +6 -5
- package/src/sap/ui/documentation/sdk/controller/News.controller.js +77 -0
- package/src/sap/ui/documentation/sdk/controller/Sample.controller.js +246 -25
- package/src/sap/ui/documentation/sdk/controller/TopicDetail.controller.js +7 -7
- package/src/sap/ui/documentation/sdk/controller/VersionNotFound.controller.js +106 -0
- package/src/sap/ui/documentation/sdk/controller/config/sampleForwardingConfig.js +40 -0
- package/src/sap/ui/documentation/sdk/controller/util/ConfigUtil.js +16 -0
- package/src/sap/ui/documentation/sdk/controller/util/NewsInfo.js +188 -0
- package/src/sap/ui/documentation/sdk/controller/util/ToolsInfo.js +7 -1
- package/src/sap/ui/documentation/sdk/controller/util/datatable/filters/DataTableFilterDropDownRenderer.js +7 -1
- package/src/sap/ui/documentation/sdk/css/style.css +42 -2
- package/src/sap/ui/documentation/sdk/images/tools/FlexibleProgrammingModelExplorer.jpg +0 -0
- package/src/sap/ui/documentation/sdk/manifest.json +16 -0
- package/src/sap/ui/documentation/sdk/util/DocumentationRouter.js +3 -1
- package/src/sap/ui/documentation/sdk/view/App.view.xml +18 -0
- package/src/sap/ui/documentation/sdk/view/ChangeVersionDialog.fragment.xml +1 -2
- package/src/sap/ui/documentation/sdk/view/News.view.xml +68 -0
- package/src/sap/ui/documentation/sdk/view/NewsPopover.fragment.xml +51 -0
- package/src/sap/ui/documentation/sdk/view/Sample.view.xml +5 -1
- package/src/sap/ui/documentation/sdk/view/Tools.view.xml +23 -25
- package/src/sap/ui/documentation/sdk/view/VersionNotFound.view.xml +44 -0
- package/src/sap/ui/documentation/sdk/view/Welcome.view.xml +90 -8
- package/src/sap/ui/documentation/sdk/view/appSettingsDialog.fragment.xml +1 -0
- package/src/sap/ui/documentation/themes/base/Documentation.less +1 -7
- package/ui5.yaml +4 -1
|
@@ -8,6 +8,7 @@ sap.ui.define([
|
|
|
8
8
|
"sap/ui/events/KeyCodes",
|
|
9
9
|
"sap/ui/thirdparty/jquery",
|
|
10
10
|
"sap/ui/documentation/sdk/controller/BaseController",
|
|
11
|
+
"sap/ui/documentation/sdk/controller/util/NewsInfo",
|
|
11
12
|
"sap/ui/documentation/sdk/controller/util/SearchUtil",
|
|
12
13
|
"sap/ui/core/mvc/Controller",
|
|
13
14
|
"sap/ui/model/Filter",
|
|
@@ -36,6 +37,7 @@ sap.ui.define([
|
|
|
36
37
|
KeyCodes,
|
|
37
38
|
jQuery,
|
|
38
39
|
BaseController,
|
|
40
|
+
NewsInfo,
|
|
39
41
|
SearchUtil,
|
|
40
42
|
Controller,
|
|
41
43
|
Filter,
|
|
@@ -129,7 +131,8 @@ sap.ui.define([
|
|
|
129
131
|
aResultArr.push({
|
|
130
132
|
"groupTitle": sCurrGroupTitle,
|
|
131
133
|
"version": sCurrGroupTitle + " (" + iCounter + " versions)",
|
|
132
|
-
"nodes": aNodes
|
|
134
|
+
"nodes": aNodes,
|
|
135
|
+
"path": aNodes[0].path
|
|
133
136
|
});
|
|
134
137
|
}
|
|
135
138
|
|
|
@@ -194,6 +197,9 @@ sap.ui.define([
|
|
|
194
197
|
|
|
195
198
|
}.bind(this));
|
|
196
199
|
|
|
200
|
+
this._oNewsModel = new JSONModel();
|
|
201
|
+
this.setModel(this._oNewsModel, "news");
|
|
202
|
+
|
|
197
203
|
// Cache view reference
|
|
198
204
|
this._oSupportedLangModel = new JSONModel();
|
|
199
205
|
|
|
@@ -213,6 +219,10 @@ sap.ui.define([
|
|
|
213
219
|
|
|
214
220
|
this._oConfigUtil = this.getOwnerComponent().getConfigUtil();
|
|
215
221
|
this._oCookieNames = this._oConfigUtil.COOKIE_NAMES;
|
|
222
|
+
this._sLocalStorageNewsName = this._oConfigUtil.LOCAL_STORAGE_NAMES['OLD_NEWS_IDS'];
|
|
223
|
+
|
|
224
|
+
NewsInfo.prepareNewsData(this._oConfigUtil);
|
|
225
|
+
|
|
216
226
|
this._bSupportsPrefersColorScheme = !!(window.matchMedia &&
|
|
217
227
|
(window.matchMedia('(prefers-color-scheme: dark)').matches ||
|
|
218
228
|
window.matchMedia('(prefers-color-scheme: light)').matches));
|
|
@@ -232,6 +242,7 @@ sap.ui.define([
|
|
|
232
242
|
}, this);
|
|
233
243
|
|
|
234
244
|
this.bus = Core.getEventBus();
|
|
245
|
+
this.bus.subscribe("newsChanged", "onDemoKitNewsChanged", this._syncNewsModelWithNewsInfo, this);
|
|
235
246
|
|
|
236
247
|
this._createConfigurationBasedOnURIInput();
|
|
237
248
|
|
|
@@ -288,6 +299,8 @@ sap.ui.define([
|
|
|
288
299
|
jQuery(document.body).addClass(this.getOwnerComponent().getContentDensityClass());
|
|
289
300
|
|
|
290
301
|
Device.orientation.attachHandler(this._onOrientationChange, this);
|
|
302
|
+
|
|
303
|
+
this._syncNewsModelWithNewsInfo();
|
|
291
304
|
},
|
|
292
305
|
|
|
293
306
|
onExit: function() {
|
|
@@ -379,6 +392,69 @@ sap.ui.define([
|
|
|
379
392
|
}
|
|
380
393
|
},
|
|
381
394
|
|
|
395
|
+
navigateToNews: function() {
|
|
396
|
+
this.getRouter().navTo("news");
|
|
397
|
+
},
|
|
398
|
+
|
|
399
|
+
handleNewsPress: function (oEvent) {
|
|
400
|
+
var oButton = oEvent.getSource(),
|
|
401
|
+
oView = this.getView();
|
|
402
|
+
|
|
403
|
+
if (this._oNewsModel.getProperty("/newsCount") === 0) {
|
|
404
|
+
this.navigateToNews();
|
|
405
|
+
} else if (!this._oNewsPopover) {
|
|
406
|
+
Fragment.load({
|
|
407
|
+
name: "sap.ui.documentation.sdk.view.NewsPopover",
|
|
408
|
+
controller: this
|
|
409
|
+
}).then(function(oPopover) {
|
|
410
|
+
oView.addDependent(oPopover);
|
|
411
|
+
this._oNewsPopover = oPopover;
|
|
412
|
+
this._oNewsPopover.openBy(oButton);
|
|
413
|
+
}.bind(this));
|
|
414
|
+
} else {
|
|
415
|
+
this._oNewsPopover.openBy(oButton);
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
|
|
419
|
+
handleShowAllPress: function () {
|
|
420
|
+
this._oNewsPopover.close();
|
|
421
|
+
this.navigateToNews();
|
|
422
|
+
},
|
|
423
|
+
|
|
424
|
+
handleDismissAllPress: function () {
|
|
425
|
+
NewsInfo.moveAllNewItemsToOld();
|
|
426
|
+
},
|
|
427
|
+
|
|
428
|
+
handleNewsItemClose: function (oEvent) {
|
|
429
|
+
var oItem = oEvent.getSource(),
|
|
430
|
+
iItemCustomId = oItem.getCustomData()[0].getValue(),
|
|
431
|
+
oItemInfoInItemsProperty = this._oNewsModel.getProperty("/items").find(function(oItem){
|
|
432
|
+
return oItem.id === iItemCustomId;
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
NewsInfo.moveNewItemToOld(oItemInfoInItemsProperty);
|
|
436
|
+
},
|
|
437
|
+
|
|
438
|
+
handleVisitNewsLink: function(oEvent) {
|
|
439
|
+
var oItem = oEvent.getSource(),
|
|
440
|
+
sItemLink = oItem.getCustomData()[0].getValue();
|
|
441
|
+
|
|
442
|
+
URLHelper.redirect(sItemLink, true);
|
|
443
|
+
},
|
|
444
|
+
|
|
445
|
+
_syncNewsModelWithNewsInfo: function() {
|
|
446
|
+
var aNewsInfoCopy,
|
|
447
|
+
sPreparationFailureMessage = NewsInfo.getPreparationFailureMessage();
|
|
448
|
+
|
|
449
|
+
if (!sPreparationFailureMessage) {
|
|
450
|
+
aNewsInfoCopy = NewsInfo.getNewNewsArray().slice();
|
|
451
|
+
this._oNewsModel.setProperty("/items", aNewsInfoCopy);
|
|
452
|
+
this._oNewsModel.setProperty("/newsCount", aNewsInfoCopy.length);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
this._oNewsModel.setProperty("/newsPreparationFailureMessage", sPreparationFailureMessage);
|
|
456
|
+
},
|
|
457
|
+
|
|
382
458
|
handleMenuItemClick: function (oEvent) {
|
|
383
459
|
var sTargetText = oEvent.getParameter("item").getKey(),
|
|
384
460
|
sTarget = this.MENU_LINKS_MAP[sTargetText];
|
|
@@ -1264,7 +1340,7 @@ sap.ui.define([
|
|
|
1264
1340
|
|
|
1265
1341
|
/**
|
|
1266
1342
|
* Event handler for the rating to update the label and the data
|
|
1267
|
-
* @param {sap.ui.base.Event}
|
|
1343
|
+
* @param {sap.ui.base.Event} oEvent
|
|
1268
1344
|
*/
|
|
1269
1345
|
onPressRatingButton: function(oEvent) {
|
|
1270
1346
|
var that = this;
|
|
@@ -161,7 +161,7 @@ sap.ui.define([
|
|
|
161
161
|
|
|
162
162
|
/**
|
|
163
163
|
* Opens a legal disclaimer for Links Popover.
|
|
164
|
-
* @param {sap.ui.base.Event} oEvent
|
|
164
|
+
* @param {sap.ui.base.Event} oEvent the <code>Image</code> press event
|
|
165
165
|
* @public
|
|
166
166
|
*/
|
|
167
167
|
onDisclaimerLinkPress: function (oEvent) {
|
|
@@ -19,7 +19,8 @@ sap.ui.define([
|
|
|
19
19
|
"sap/base/util/UriParameters",
|
|
20
20
|
"sap/ui/util/Storage",
|
|
21
21
|
"sap/ui/core/Core",
|
|
22
|
-
"sap/ui/documentation/sdk/controller/util/Highlighter"
|
|
22
|
+
"sap/ui/documentation/sdk/controller/util/Highlighter",
|
|
23
|
+
"sap/ui/documentation/sdk/util/Resources"
|
|
23
24
|
], function(
|
|
24
25
|
jQuery,
|
|
25
26
|
Device,
|
|
@@ -35,7 +36,8 @@ sap.ui.define([
|
|
|
35
36
|
UriParameters,
|
|
36
37
|
Storage,
|
|
37
38
|
Core,
|
|
38
|
-
Highlighter
|
|
39
|
+
Highlighter,
|
|
40
|
+
ResourcesUtil
|
|
39
41
|
) {
|
|
40
42
|
"use strict";
|
|
41
43
|
|
|
@@ -280,7 +282,7 @@ sap.ui.define([
|
|
|
280
282
|
}
|
|
281
283
|
|
|
282
284
|
// Apply theme and compact mode also to iframe samples if there is actually a change
|
|
283
|
-
if (bRTLChanged || bContentDensityChanged || bThemeChanged) {
|
|
285
|
+
if ((bRTLChanged || bContentDensityChanged || bThemeChanged) && !ResourcesUtil.getHasProxy()) {
|
|
284
286
|
|
|
285
287
|
$SampleFrame = jQueryDOM("#sampleFrame");
|
|
286
288
|
if ($SampleFrame.length > 0) {
|
|
@@ -403,8 +405,7 @@ sap.ui.define([
|
|
|
403
405
|
|
|
404
406
|
getGroupHeader: function (oGroup) {
|
|
405
407
|
return new GroupHeaderListItem({
|
|
406
|
-
title: oGroup.key
|
|
407
|
-
upperCase: false
|
|
408
|
+
title: oGroup.key
|
|
408
409
|
});
|
|
409
410
|
},
|
|
410
411
|
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2022 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/documentation/sdk/controller/BaseController",
|
|
9
|
+
'sap/ui/model/json/JSONModel',
|
|
10
|
+
"sap/ui/documentation/sdk/controller/util/NewsInfo",
|
|
11
|
+
"sap/ui/core/Core",
|
|
12
|
+
"sap/m/library"
|
|
13
|
+
],
|
|
14
|
+
function (BaseController, JSONModel, NewsInfo, Core, mobileLibrary) {
|
|
15
|
+
'use strict';
|
|
16
|
+
|
|
17
|
+
return BaseController.extend('sap.ui.documentation.sdk.controller.News', {
|
|
18
|
+
onInit: function() {
|
|
19
|
+
this.getRouter().getRoute("news").attachPatternMatched(this._onMatched, this);
|
|
20
|
+
|
|
21
|
+
this._oModel = new JSONModel();
|
|
22
|
+
this.setModel(this._oModel);
|
|
23
|
+
|
|
24
|
+
NewsInfo.prepareNewsData(this.getOwnerComponent().getConfigUtil());
|
|
25
|
+
|
|
26
|
+
Core.getEventBus().subscribe("newsChanged", "onDemoKitNewsChanged", this._syncModelWithNewsInfo, this);
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
onAfterRendering: function() {
|
|
30
|
+
this._syncModelWithNewsInfo();
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
handleNewsItemClose: function (oEvent) {
|
|
34
|
+
var oItem = oEvent.getSource(),
|
|
35
|
+
iItemCustomId = oItem.getCustomData()[0].getValue(),
|
|
36
|
+
oItemInfoInItemsProperty = this._oModel.getProperty("/new").find(function(oItem){
|
|
37
|
+
return oItem.id === iItemCustomId;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
NewsInfo.moveNewItemToOld(oItemInfoInItemsProperty);
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
handleMarkAsRead: function () {
|
|
44
|
+
NewsInfo.moveAllNewItemsToOld();
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
handleVisitLink: function(oEvent) {
|
|
48
|
+
var oItem = oEvent.getSource(),
|
|
49
|
+
sItemLink = oItem.getCustomData()[0].getValue();
|
|
50
|
+
|
|
51
|
+
mobileLibrary.URLHelper.redirect(sItemLink, true);
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
_syncModelWithNewsInfo: function() {
|
|
55
|
+
var sPreparationFailureMessage = NewsInfo.getPreparationFailureMessage();
|
|
56
|
+
|
|
57
|
+
if (!sPreparationFailureMessage) {
|
|
58
|
+
this._oModel.setProperty("/new", NewsInfo.getNewNewsArray().slice());
|
|
59
|
+
this._oModel.setProperty("/old", NewsInfo.getOldNewsArray().slice());
|
|
60
|
+
}
|
|
61
|
+
this._oModel.setProperty("/preparationFailureMessage", sPreparationFailureMessage);
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Handles "demoapps" routing
|
|
66
|
+
* @function
|
|
67
|
+
* @private
|
|
68
|
+
*/
|
|
69
|
+
_onMatched: function () {
|
|
70
|
+
try {
|
|
71
|
+
this.hideMasterSide();
|
|
72
|
+
} catch (e) {
|
|
73
|
+
// try-catch due to a bug in UI5 SplitApp, CL 1898264 should fix it
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
});
|
|
@@ -17,8 +17,10 @@ sap.ui.define([
|
|
|
17
17
|
"sap/ui/core/HTML",
|
|
18
18
|
"sap/m/library",
|
|
19
19
|
"sap/base/Log",
|
|
20
|
+
"sap/base/util/UriParameters",
|
|
20
21
|
"sap/ui/core/Fragment",
|
|
21
|
-
"sap/ui/documentation/sdk/util/Resources"
|
|
22
|
+
"sap/ui/documentation/sdk/util/Resources",
|
|
23
|
+
"./config/sampleForwardingConfig"
|
|
22
24
|
], function(
|
|
23
25
|
jQuery,
|
|
24
26
|
SampleBaseController,
|
|
@@ -31,14 +33,20 @@ sap.ui.define([
|
|
|
31
33
|
HTML,
|
|
32
34
|
mobileLibrary,
|
|
33
35
|
Log,
|
|
36
|
+
UriParameters,
|
|
34
37
|
Fragment,
|
|
35
|
-
ResourcesUtil
|
|
38
|
+
ResourcesUtil,
|
|
39
|
+
sampleForwardingConfig
|
|
36
40
|
) {
|
|
37
41
|
"use strict";
|
|
38
42
|
|
|
39
43
|
// shortcut for sap.m.URLHelper
|
|
40
44
|
var URLHelper = mobileLibrary.URLHelper;
|
|
41
45
|
|
|
46
|
+
var COZY = "cozy",
|
|
47
|
+
COMPACT = "compact",
|
|
48
|
+
CONDENSED = "condensed";
|
|
49
|
+
|
|
42
50
|
return SampleBaseController.extend("sap.ui.documentation.sdk.controller.Sample", {
|
|
43
51
|
/* =========================================================== */
|
|
44
52
|
/* lifecycle methods */
|
|
@@ -54,15 +62,29 @@ sap.ui.define([
|
|
|
54
62
|
showNewTab: false,
|
|
55
63
|
rtaLoaded: false
|
|
56
64
|
});
|
|
65
|
+
this._oSampleIframeSettings = {
|
|
66
|
+
densityMode: COMPACT,
|
|
67
|
+
themeActive: "sap_fiori_3",
|
|
68
|
+
rtl: false
|
|
69
|
+
};
|
|
57
70
|
|
|
58
71
|
this._sId = null; // Used to hold sample ID
|
|
59
72
|
this._sEntityId = null; // Used to hold entity ID for the sample currently shown
|
|
73
|
+
this.router = this.getRouter();
|
|
60
74
|
|
|
61
75
|
// Load runtime authoring asynchronously
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
76
|
+
if (!ResourcesUtil.getHasProxy()) {
|
|
77
|
+
Promise.all([
|
|
78
|
+
sap.ui.getCore().loadLibrary("sap.ui.fl", {async: true}),
|
|
79
|
+
sap.ui.getCore().loadLibrary("sap.ui.rta", {async: true})
|
|
80
|
+
]).then(function () {
|
|
81
|
+
sap.ui.require([
|
|
82
|
+
"sap/ui/fl/Utils",
|
|
83
|
+
"sap/ui/fl/FakeLrepConnectorLocalStorage",
|
|
84
|
+
"sap/ui/core/util/reflection/JsControlTreeModifier"
|
|
85
|
+
], this._loadRTA.bind(this));
|
|
86
|
+
}.bind(this));
|
|
87
|
+
}
|
|
66
88
|
|
|
67
89
|
this.getView().setModel(this.oModel);
|
|
68
90
|
|
|
@@ -85,6 +107,14 @@ sap.ui.define([
|
|
|
85
107
|
this._sEntityId = event.getParameter("arguments").entityId;
|
|
86
108
|
|
|
87
109
|
this.byId("page").setBusy(true);
|
|
110
|
+
|
|
111
|
+
if (sampleForwardingConfig[this._sId]) {
|
|
112
|
+
return this.router.navTo("sample", {
|
|
113
|
+
entityId: sampleForwardingConfig[this._sId].entityId,
|
|
114
|
+
sampleId: sampleForwardingConfig[this._sId].sampleId
|
|
115
|
+
}, true);
|
|
116
|
+
}
|
|
117
|
+
|
|
88
118
|
this.getModel("appView").setProperty("/bHasMaster", false);
|
|
89
119
|
|
|
90
120
|
ControlsInfo.loadData().then(this._loadSample.bind(this));
|
|
@@ -145,11 +175,12 @@ sap.ui.define([
|
|
|
145
175
|
var oSampleConfig = oConfig && oConfig.sample || {};
|
|
146
176
|
|
|
147
177
|
// only have the option to run standalone if there is an iframe
|
|
148
|
-
oModelData.showNewTab = !!oSampleConfig.iframe || ResourcesUtil.getHasProxy();
|
|
178
|
+
oModelData.showNewTab = !!oSampleConfig.iframe || !!ResourcesUtil.getHasProxy();
|
|
149
179
|
oModelData.id = oSample.id;
|
|
150
180
|
oModelData.name = oSample.name;
|
|
151
181
|
oModelData.details = oSample.details;
|
|
152
182
|
oModelData.description = oSample.description;
|
|
183
|
+
oModelData.showSettings = !!ResourcesUtil.getHasProxy();
|
|
153
184
|
|
|
154
185
|
if (oSampleConfig) {
|
|
155
186
|
|
|
@@ -211,6 +242,141 @@ sap.ui.define([
|
|
|
211
242
|
});
|
|
212
243
|
},
|
|
213
244
|
|
|
245
|
+
/**
|
|
246
|
+
* Opens the View settings dialog
|
|
247
|
+
* @public
|
|
248
|
+
*/
|
|
249
|
+
handleSettings: function () {
|
|
250
|
+
var oSampleFrame = this._oHtmlControl.$()[0].contentWindow,
|
|
251
|
+
oSampleFrameCore = oSampleFrame.sap.ui.getCore(),
|
|
252
|
+
oView;
|
|
253
|
+
|
|
254
|
+
if (!this._oMessageBundle) {
|
|
255
|
+
this._oMessageBundle = new oSampleFrame.sap.ui.model.resource.ResourceModel({
|
|
256
|
+
bundleName: "sap.ui.documentation.messagebundle"
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if (!this._oSettingsDialog) {
|
|
261
|
+
this._oSettingsDialog = new oSampleFrame.sap.ui.xmlfragment("sap.ui.documentation.sdk.view.appSettingsDialog", this);
|
|
262
|
+
|
|
263
|
+
oView = oSampleFrameCore.byId("__xmlview0");
|
|
264
|
+
oView.setModel(this._oMessageBundle, "i18n");
|
|
265
|
+
oView.addDependent(this._oSettingsDialog);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
setTimeout(function () {
|
|
269
|
+
var oAppSettings = oSampleFrameCore.getConfiguration(),
|
|
270
|
+
oThemeSelect = oSampleFrameCore.byId("ThemeSelect"),
|
|
271
|
+
sUriParamTheme = UriParameters.fromQuery(window.location.search).get("sap-theme"),
|
|
272
|
+
bDensityMode = this._oSampleIframeSettings.densityMode;
|
|
273
|
+
|
|
274
|
+
// Theme select
|
|
275
|
+
oThemeSelect.setSelectedKey(sUriParamTheme ? sUriParamTheme : oAppSettings.getTheme());
|
|
276
|
+
|
|
277
|
+
// RTL
|
|
278
|
+
oSampleFrameCore.byId("RTLSwitch").setState(oAppSettings.getRTL());
|
|
279
|
+
|
|
280
|
+
// Density mode select
|
|
281
|
+
oSampleFrameCore.byId("DensityModeSwitch").setSelectedKey(bDensityMode);
|
|
282
|
+
|
|
283
|
+
this._oSettingsDialog.open();
|
|
284
|
+
}.bind(this), 0);
|
|
285
|
+
},
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Closes the View settings dialog
|
|
289
|
+
* @public
|
|
290
|
+
*/
|
|
291
|
+
handleCloseAppSettings: function () {
|
|
292
|
+
this._oSettingsDialog.close();
|
|
293
|
+
},
|
|
294
|
+
|
|
295
|
+
handleSaveAppSettings: function () {
|
|
296
|
+
var oSampleFrame = this._oHtmlControl.$()[0].contentWindow,
|
|
297
|
+
oSampleFrameCore = oSampleFrame.sap.ui.getCore(),
|
|
298
|
+
sDensityMode = oSampleFrameCore.byId("DensityModeSwitch").getSelectedKey(),
|
|
299
|
+
sTheme = oSampleFrameCore.byId("ThemeSelect").getSelectedKey(),
|
|
300
|
+
bRTL = oSampleFrameCore.byId("RTLSwitch").getState(),
|
|
301
|
+
oView = oSampleFrameCore.byId("__xmlview0");
|
|
302
|
+
|
|
303
|
+
this._oSettingsDialog.close();
|
|
304
|
+
|
|
305
|
+
// Lazy loading of busy dialog
|
|
306
|
+
if (!this._oBusyDialog) {
|
|
307
|
+
oSampleFrame.sap.ui.require(["sap/m/BusyDialog"], function () {
|
|
308
|
+
this._oBusyDialog = new oSampleFrame.sap.m.BusyDialog();
|
|
309
|
+
oView.addDependent(this._oBusyDialog);
|
|
310
|
+
this._handleBusyDialog();
|
|
311
|
+
}.bind(this));
|
|
312
|
+
} else {
|
|
313
|
+
this._handleBusyDialog();
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// handle settings change
|
|
317
|
+
this._applyAppConfiguration(sTheme, sDensityMode, bRTL);
|
|
318
|
+
},
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Apply content configuration
|
|
322
|
+
* @param {string} sThemeActive name of the theme
|
|
323
|
+
* @param {string} sDensityMode content density mode
|
|
324
|
+
* @param {boolean} bRTL right to left mode
|
|
325
|
+
* @private
|
|
326
|
+
*/
|
|
327
|
+
_applyAppConfiguration: function(sThemeActive, sDensityMode, bRTL){
|
|
328
|
+
var oSampleFrame = this._oHtmlControl.$()[0].contentWindow,
|
|
329
|
+
oSampleFrameCore = oSampleFrame.sap.ui.getCore();
|
|
330
|
+
|
|
331
|
+
if (this._oSampleIframeSettings.densityMode !== sDensityMode) {
|
|
332
|
+
this._oSampleIframeSettings.densityMode = sDensityMode;
|
|
333
|
+
this._toggleContentDensityClasses(oSampleFrame.jQuery("body"), sDensityMode);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
if (this._oSampleIframeSettings.rtl !== bRTL) {
|
|
337
|
+
oSampleFrameCore.getConfiguration().setRTL(bRTL);
|
|
338
|
+
this._oSampleIframeSettings.rtl = bRTL;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
if (oSampleFrameCore.getConfiguration().getTheme() !== sThemeActive) {
|
|
342
|
+
oSampleFrameCore.applyTheme(sThemeActive);
|
|
343
|
+
this._oSampleIframeSettings.themeActive = sThemeActive;
|
|
344
|
+
} else if (this._oSampleIframeSettings.densityMode !== sDensityMode) {
|
|
345
|
+
// Notify Core for content density change only if no theme change happened
|
|
346
|
+
oSampleFrameCore.notifyContentDensityChanged();
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Toggles content density classes in the provided html body
|
|
352
|
+
* @param {object} oBody the html body to set the correct class on
|
|
353
|
+
* @param {string} sDensityMode content density mode
|
|
354
|
+
* @private
|
|
355
|
+
*/
|
|
356
|
+
_toggleContentDensityClasses: function(oBody, sDensityMode){
|
|
357
|
+
switch (sDensityMode) {
|
|
358
|
+
case COMPACT:
|
|
359
|
+
oBody.toggleClass("sapUiSizeCompact", true).toggleClass("sapUiSizeCozy", false).toggleClass("sapUiSizeCondensed", false);
|
|
360
|
+
break;
|
|
361
|
+
case CONDENSED:
|
|
362
|
+
oBody.toggleClass("sapUiSizeCondensed", true).toggleClass("sapUiSizeCozy", false).toggleClass("sapUiSizeCompact", true);
|
|
363
|
+
break;
|
|
364
|
+
default:
|
|
365
|
+
oBody.toggleClass("sapUiSizeCozy", true).toggleClass("sapUiSizeCondensed", false).toggleClass("sapUiSizeCompact", false);
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Handles View settings dialog
|
|
371
|
+
* @public
|
|
372
|
+
*/
|
|
373
|
+
_handleBusyDialog : function () {
|
|
374
|
+
this._oBusyDialog.open();
|
|
375
|
+
setTimeout(function () {
|
|
376
|
+
this._oBusyDialog.close();
|
|
377
|
+
}.bind(this), 1000);
|
|
378
|
+
},
|
|
379
|
+
|
|
214
380
|
_updateFileContent: function(sRef, sFile) {
|
|
215
381
|
this.fetchSourceFile(sRef + "/" + sFile).then(function(vContent) {
|
|
216
382
|
var aFiles = this.oModel.getProperty("/files");
|
|
@@ -267,7 +433,7 @@ sap.ui.define([
|
|
|
267
433
|
/**
|
|
268
434
|
* Extends the sSampleId with the relative path defined in sIframePath and returns the resulting path.
|
|
269
435
|
* @param {string} sSampleId
|
|
270
|
-
* @param {string}
|
|
436
|
+
* @param {string} sIframePath
|
|
271
437
|
* @returns {string}
|
|
272
438
|
* @private
|
|
273
439
|
*/
|
|
@@ -325,6 +491,20 @@ sap.ui.define([
|
|
|
325
491
|
}
|
|
326
492
|
|
|
327
493
|
if (!this._oHtmlControl) {
|
|
494
|
+
var oComponent = this.getOwnerComponent();
|
|
495
|
+
|
|
496
|
+
// Guarantees the sample initially to have the same content density, as the whole Demo Kit
|
|
497
|
+
switch (oComponent.getContentDensityClass()) {
|
|
498
|
+
case "sapUiSizeCompact":
|
|
499
|
+
this._oSampleIframeSettings.densityMode = COMPACT;
|
|
500
|
+
break;
|
|
501
|
+
case "sapUiSizeCondensed":
|
|
502
|
+
this._oSampleIframeSettings.densityMode = CONDENSED;
|
|
503
|
+
break;
|
|
504
|
+
default:
|
|
505
|
+
this._oSampleIframeSettings.densityMode = COZY;
|
|
506
|
+
}
|
|
507
|
+
|
|
328
508
|
this._oHtmlControl = new HTML({
|
|
329
509
|
id : "sampleFrame",
|
|
330
510
|
content : '<iframe src="' + this.sIFrameUrl + '" id="sampleFrame" frameBorder="0"></iframe>'
|
|
@@ -335,17 +515,58 @@ sap.ui.define([
|
|
|
335
515
|
if (!this._oHtmlControl._jQueryHTMLControlLoadEventAttached) {
|
|
336
516
|
this._oHtmlControl.$().on("load", function () {
|
|
337
517
|
var oSampleFrame = this._oHtmlControl.$()[0].contentWindow,
|
|
338
|
-
oSampleFrameCore = oSampleFrame.sap.ui.getCore()
|
|
518
|
+
oSampleFrameCore = oSampleFrame.sap.ui.getCore(),
|
|
519
|
+
oFrame = document.getElementById("sampleFrame");
|
|
520
|
+
|
|
521
|
+
this._oMessageBundle = null;
|
|
522
|
+
this._oSettingsDialog = null;
|
|
523
|
+
this._oBusyDialog = null;
|
|
524
|
+
|
|
525
|
+
if (this.oModel.getData().iframe) {
|
|
526
|
+
Promise.all([
|
|
527
|
+
oSampleFrameCore.loadLibrary("sap.ui.fl", {async: true}),
|
|
528
|
+
oSampleFrameCore.loadLibrary("sap.ui.rta", {async: true})
|
|
529
|
+
]).then(function () {
|
|
530
|
+
oSampleFrame.sap.ui.require([
|
|
531
|
+
"sap/ui/fl/Utils",
|
|
532
|
+
"sap/ui/fl/FakeLrepConnectorLocalStorage",
|
|
533
|
+
"sap/ui/core/util/reflection/JsControlTreeModifier"
|
|
534
|
+
], this._loadRTA.bind(this));
|
|
535
|
+
}.bind(this));
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
oFrame.onToggleAdaptationMode = function () {
|
|
539
|
+
oSampleFrame.sap.ui.require([
|
|
540
|
+
"sap/ui/rta/api/startKeyUserAdaptation"
|
|
541
|
+
], function (
|
|
542
|
+
startKeyUserAdaptation
|
|
543
|
+
) {
|
|
544
|
+
if (!this._oRTA) {
|
|
545
|
+
var oContainer = oSampleFrameCore.byId("__container0");
|
|
546
|
+
|
|
547
|
+
startKeyUserAdaptation({
|
|
548
|
+
rootControl : oContainer.getComponentInstance()
|
|
549
|
+
}).then(function(oRta) {
|
|
550
|
+
this._oRTA = oRta;
|
|
551
|
+
oContainer.$().css({"padding-top": "2.5rem", "box-sizing": "border-box"});
|
|
552
|
+
this._oRTA.attachStop(function () {
|
|
553
|
+
oContainer.$().css({"padding-top": "0", "box-sizing": "content-box"});
|
|
554
|
+
this._oRTA.destroy();
|
|
555
|
+
delete this._oRTA;
|
|
556
|
+
}.bind(this));
|
|
557
|
+
}.bind(this));
|
|
558
|
+
}
|
|
559
|
+
}.bind(this));
|
|
560
|
+
};
|
|
561
|
+
}
|
|
339
562
|
|
|
340
563
|
// Apply theme settings to iframe sample
|
|
341
564
|
oSampleFrame.sap.ui.getCore().attachInit(function () {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
oSampleFrameCore.
|
|
345
|
-
|
|
346
|
-
oSampleFrame.jQuery('body')
|
|
347
|
-
.toggleClass("sapUiSizeCompact", bCompact)
|
|
348
|
-
.toggleClass("sapUiSizeCozy", !bCompact);
|
|
565
|
+
oSampleFrameCore.applyTheme(ResourcesUtil.getHasProxy() ?
|
|
566
|
+
this._oSampleIframeSettings.themeActive : this._oCore.getConfiguration().getTheme());
|
|
567
|
+
oSampleFrameCore.getConfiguration().setRTL(ResourcesUtil.getHasProxy() ?
|
|
568
|
+
this._oSampleIframeSettings.rtl : this._oCore.getConfiguration().getRTL());
|
|
569
|
+
this._toggleContentDensityClasses(oSampleFrame.jQuery('body'), this._oSampleIframeSettings.densityMode);
|
|
349
570
|
|
|
350
571
|
// Notify Core for content density change
|
|
351
572
|
oSampleFrameCore.notifyContentDensityChanged();
|
|
@@ -395,7 +616,7 @@ sap.ui.define([
|
|
|
395
616
|
},
|
|
396
617
|
|
|
397
618
|
onDemoKitThemeChanged: function(sChannelId, sEventId, oData) {
|
|
398
|
-
if (this._oHtmlControl) {
|
|
619
|
+
if (this._oHtmlControl && !ResourcesUtil.getHasProxy()) {
|
|
399
620
|
this._oHtmlControl.$()[0].contentWindow.sap.ui.getCore().applyTheme(oData.sThemeActive);
|
|
400
621
|
}
|
|
401
622
|
this.setDefaultSampleTheme();
|
|
@@ -436,12 +657,7 @@ sap.ui.define([
|
|
|
436
657
|
this.sIFrameUrl = this.sIFrameUrl + decodeURI(oIFrameURL.search);
|
|
437
658
|
},
|
|
438
659
|
|
|
439
|
-
_loadRTA: function (
|
|
440
|
-
sap.ui.require([
|
|
441
|
-
"sap/ui/fl/Utils",
|
|
442
|
-
"sap/ui/fl/FakeLrepConnectorLocalStorage",
|
|
443
|
-
"sap/ui/core/util/reflection/JsControlTreeModifier"
|
|
444
|
-
], function (
|
|
660
|
+
_loadRTA: function (
|
|
445
661
|
Utils,
|
|
446
662
|
FakeLrepConnectorLocalStorage,
|
|
447
663
|
JsControlTreeModifier
|
|
@@ -469,18 +685,23 @@ sap.ui.define([
|
|
|
469
685
|
this._oRTA = null;
|
|
470
686
|
}
|
|
471
687
|
}, this);
|
|
472
|
-
}.bind(this));
|
|
473
688
|
},
|
|
474
689
|
|
|
475
690
|
onToggleAdaptationMode : function (oEvt) {
|
|
691
|
+
if (this.oModel.getData().iframe) {
|
|
692
|
+
window.document.getElementsByTagName("iframe")[0].onToggleAdaptationMode();
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
476
695
|
sap.ui.require([
|
|
477
696
|
"sap/ui/rta/api/startKeyUserAdaptation"
|
|
478
697
|
], function (
|
|
479
698
|
startKeyUserAdaptation
|
|
480
699
|
) {
|
|
481
700
|
if (!this._oRTA) {
|
|
701
|
+
var oContainer = this.byId("page").getContent()[0];
|
|
702
|
+
|
|
482
703
|
startKeyUserAdaptation({
|
|
483
|
-
rootControl :
|
|
704
|
+
rootControl : oContainer.getComponentInstance()
|
|
484
705
|
}).then(function(oRta) {
|
|
485
706
|
this._oRTA = oRta;
|
|
486
707
|
this._oRTA.attachStop(function () {
|
|
@@ -405,7 +405,7 @@ sap.ui.define([
|
|
|
405
405
|
/**
|
|
406
406
|
* Iterates over all links marked as external and adds a icon and disclaimer proxy
|
|
407
407
|
*
|
|
408
|
-
* @param oElement
|
|
408
|
+
* @param {Element} oElement the DOM ref to the container
|
|
409
409
|
* @private
|
|
410
410
|
*/
|
|
411
411
|
_fixExternalLinks: function (oElement) {
|
|
@@ -432,7 +432,7 @@ sap.ui.define([
|
|
|
432
432
|
* 1. First loop - calculates the sum of all colgroup children
|
|
433
433
|
* 2. Second loop - transforms the origin values to percent
|
|
434
434
|
*
|
|
435
|
-
* @param oElement
|
|
435
|
+
* @param {Element} oElement the DOM ref to the container
|
|
436
436
|
* @private
|
|
437
437
|
*/
|
|
438
438
|
_computeColumnGroupValues: function (oElement) {
|
|
@@ -471,8 +471,8 @@ sap.ui.define([
|
|
|
471
471
|
* 1) The link is a non SAP and the icon image is link-external.png
|
|
472
472
|
* 2) The link is a SAP and the icon image is link-sap.png
|
|
473
473
|
*
|
|
474
|
-
* @param aDomRef
|
|
475
|
-
* @param sHref
|
|
474
|
+
* @param {Element} aDomRef the DOM ref to the external link
|
|
475
|
+
* @param {string} sHref the url string
|
|
476
476
|
* @private
|
|
477
477
|
*/
|
|
478
478
|
_addIconToExternalUrl: function (aDomRef, sHref) {
|
|
@@ -529,9 +529,9 @@ sap.ui.define([
|
|
|
529
529
|
* 3) The first seven symbols from the ID used in the Demo Kit URLs are added at the end
|
|
530
530
|
* 4) The file type is added at the end “.md”
|
|
531
531
|
*
|
|
532
|
-
* @param sUrl
|
|
533
|
-
* @param sTitle
|
|
534
|
-
* @returns {string}
|
|
532
|
+
* @param {string} sUrl the url of the file in the internal repo
|
|
533
|
+
* @param {string} sTitle the title of the file
|
|
534
|
+
* @returns {string} the url of the file in the GitHub repo
|
|
535
535
|
* @private
|
|
536
536
|
*/
|
|
537
537
|
_formatToGitHubUrl: function(sUrl, sTitle) {
|