Skip to content

Commit 9b5566f

Browse files
committed
【fix】UI走查,及去除es6语法兼容ie11 reviewed by luoxiao
1 parent 3a99cd9 commit 9b5566f

File tree

13 files changed

+67
-22
lines changed

13 files changed

+67
-22
lines changed

build/build.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ <h1>自定义打包</h1>
199199
</div>
200200
<script type="text/javascript" src="https://iclient.supermap.io/web/libs/jquery/jquery.min.js"></script>
201201
<script type="text/javascript" src="https://iclient.supermap.io/web/libs/bootstrap/js/bootstrap.min.js"></script>
202+
<script type="text/javascript" src="https://iclient.supermap.io/web/libs/css-vars-ponyfill/2.4.8/css-vars-ponyfill.min.js"></script>
202203
<script type="text/javascript" src="deps.js"></script>
203204
<script type="text/javascript" src="build.js"></script>
204205
</body>

build/jsdocs/template/static/scripts/css-vars-ponyfill.min.js

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/jsdocs/template/tmpl/layout.tmpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<meta charset="utf-8">
55
<script src="scripts/prettify/prettify.js"></script>
66
<script src="scripts/prettify/lang-css.js"></script>
7-
<script src="../../../../examples/js/theme/themeConfig.js"></script>
8-
<script src="../../../../examples/js/theme/theme.js"></script>
7+
<script src="../../examples/js/theme/themeConfig.js"></script>
8+
<script src="../../examples/js/theme/theme.js"></script>
99
<script type="text/javascript">
1010

1111
</script>
@@ -14,6 +14,7 @@
1414
<![endif]-->
1515
<script src="scripts/jquery.min.js"></script>
1616
<script src="scripts/adminlte/app.min.js"></script>
17+
<script src="scripts/css-vars-ponyfill.min.js"></script>
1718
<link type="text/css" rel="stylesheet" href="styles/bootstrap.min.css">
1819
<link type="text/css" rel="stylesheet" href="styles/adminlte/AdminLTE.min.css">
1920
<link type="text/css" rel="stylesheet" href="styles/adminlte/skin-blue.min.css">

examples/css/common.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ a {
110110

111111
/*重写AdmineLTE 的部分效果 end*/
112112
.skin-blue .main-header .navbar {
113-
background-color: var(--background-color);
113+
background-color: var(--header-background-color);
114114
}
115115
/*footer */
116116

examples/css/editor.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ html, body, .wrapper {
2020
bottom: 0;
2121
left: 0;
2222
right: 0;
23-
margin-top: 60px;
23+
margin-top: 72px;
2424
}
2525

2626
.edit-container section.content {

examples/css/examples.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ h3.category-title {
101101
}
102102

103103
.box-header {
104-
padding-top: 22px;
104+
padding-top: 10px;
105105
padding-bottom: 5px;
106106
padding-left: 0;
107107
background-color: #f9f9f9;
@@ -117,5 +117,5 @@ h3.category-title {
117117
}
118118

119119
.category {
120-
padding-top: 72px;
120+
padding-top: 60px;
121121
}

examples/css/header.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
padding: 4px 0;
153153
left: 20px !important;
154154
border: none;
155-
border-radius: 4px;
155+
border-radius: 4px !important;
156156
box-shadow: 0px 6px 18px 0px var(--dropdown-shadow-color);
157157
}
158158
.navbar-rightbar .dropdown .dropdown-menu{

examples/js/include-web.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
inputScript(libsurl + '/i18next/i18next.min.js');
4646
inputScript(libsurl + '/jquery-i18next/jquery-i18next.min.js');
47+
inputScript(libsurl + '/css-vars-ponyfill/2.4.8/css-vars-ponyfill.min.js');
4748

4849
inputScript("../js/utils.js");
4950
inputScript("../js/localization.js");

examples/js/theme/theme.js

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,26 @@ function toStyleVariable(variable) {
22
return '--' + variable.replace(/[A-Z]/g, '-$&').toLowerCase();
33
}
44

5-
function setRootStyle(theme) {
5+
var isBrowser = typeof window !== 'undefined';
6+
var isNativeSupport = isBrowser && window.CSS && window.CSS.supports && window.CSS.supports('(--a: 0)');
7+
8+
function setRootStyle (theme) {
69
var targetTheme = null;
710
window.themeConfig.forEach(function (item) {
811
if (item.label === theme) {
912
targetTheme = item;
1013
};
1114
})
12-
let acceptedThemeStyle = targetTheme || window.themeConfig[1];
13-
const variables = {};
14-
const themeKeys = Object.keys(acceptedThemeStyle);
15-
themeKeys.forEach(function (key) {
16-
const varKey = toStyleVariable(key);
15+
var acceptedThemeStyle = targetTheme || window.themeConfig[1];
16+
var variables = {};
17+
var themeKeys = Object.keys(acceptedThemeStyle);
18+
themeKeys.forEach(function(key) {
19+
var varKey = toStyleVariable(key);
1720
variables[varKey] = acceptedThemeStyle[key];
1821
})
19-
const rootStyleSelector = ':root';
20-
const antdStyleId = 'sm-theme-style';
21-
const rootStyle = rootStyleSelector + " " + JSON.stringify(variables, null, 2)
22+
var rootStyleSelector = ':root';
23+
var antdStyleId = 'sm-theme-style';
24+
var rootStyle = rootStyleSelector + ' ' + JSON.stringify(variables, null, 2)
2225
.replace(/(:.+),/g, '$1;')
2326
.replace(/"/g, '');
2427
var rootStyleTag = document.getElementById(antdStyleId);
@@ -28,9 +31,23 @@ function setRootStyle(theme) {
2831
rootStyleTag.setAttribute('type', 'text/css');
2932
document.head.insertBefore(rootStyleTag, document.head.firstChild);
3033
}
34+
var options = {
35+
include: 'style#sm-theme-style, link[href*=css]',
36+
silent: true,
37+
onlyLegacy: true,
38+
variables: {},
39+
watch: false
40+
};
41+
if (!isNativeSupport) {
42+
options.onlyLegacy = false;
43+
options.watch = true;
44+
options.variables = variables;
45+
}
46+
cssVars(options);
3147
rootStyleTag.innerHTML = rootStyle;
3248
}
33-
document.addEventListener("DOMContentLoaded", function () {
49+
50+
document.addEventListener("DOMContentLoaded", function() {
3451
initSkin();
3552
});
3653

examples/js/theme/themeConfig.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ window.themeConfig = [
2929
"footerShadowColor": "var(--alpha06)",
3030
"activeBackgroundColor": "rgba(255,72,62,0.04)",
3131
"dropdownActiveBackground": "var(--alpha04)",
32+
"dropdownBackgroundColor": "#FFFFFF",
3233
"skinBoxBackground": "var(--alpha08)",
3334
"skinLightBg": "#ffffff",
3435
"skinDarkBg": "transparent",
@@ -55,19 +56,20 @@ window.themeConfig = [
5556
"whatsNewBackgroundColor": "rgba(10, 9, 9, 1)",
5657
"textColorThird": "var(--alpha45)",
5758
"iconColor": "var(--alpha100)",
58-
"activeColor": "rgba(224,76,64,0.85)",
59+
"activeColor": "rgba(224,76,64,1)",
5960
"backgroundColor": "#1F1F1F",
6061
"headerBackgroundColor": "#333333",
6162
"wrapperBackgroundColor": "#F5F6F6",
62-
"shadowColor": "var(--alpha04)",
63+
"shadowColor": "rgba(0, 0, 0, 0.04)",
6364
"borderColor": "var(--alpha08)",
6465
"footerShadowColor": "var(--alpha06)",
6566
"activeBackgroundColor": "rgba(255,72,62,0.04)",
6667
"dropdownActiveBackground": "var(--alpha04)",
68+
"dropdownBackgroundColor": "#414141",
6769
"skinBoxBackground": "#1F1F1F",
6870
"skinLightBg": "transparent",
6971
"skinDarkBg": "rgba(255,255,255,0.08);",
70-
"dropdownShadowColor": "var(--alpha14)",
72+
"dropdownShadowColor": "rgba(0, 0, 0, 0.35)",
7173
"suffixColor": "var(--alpha12)"
7274
}
7375
]

examples/maplibregl/examples.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
$('.wrapper').load("../template/example.html", function () {
2727
var navigation = {
2828
nav: {
29-
title: "SuperMap iClient 11i(2022)",
29+
title: "11i(2023)",
3030
path: "../../web/",
3131
isLocal: window.isLocal
3232
}

examples/template/editor.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<section class="sidebar" id="sidebar">
1818
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button" title="fold">
1919
<div class="fa fa-bars fold"></div>
20+
<span id="suffix-title"></span>
2021
</a>
2122
<!-- sidebar menu: : style can be found in sidebar.less -->
2223
<ul class="sidebar-menu" id="sidebar-menu"></ul>
@@ -47,5 +48,18 @@
4748
</div>
4849
<!-- 内容区 end-->
4950

51+
<script>
52+
$(document).ready(function () {
53+
var notFor = ['iClient Classic', '3D-WebGL'];
54+
var productArr = ['Leaflet', 'OpenLayers', 'MapboxGL', 'MaplibreGL', 'component', 'iClient Classic', '3D-WebGL']
55+
var path = window.location.pathname.split('/');
56+
var identification = productArr.find(name => name.toLowerCase().includes(path[2]) || name.toLowerCase().includes(path[3]));
57+
if (identification) {
58+
var suffixHeader = document.getElementById('suffix-title');
59+
suffixHeader.innerText = (notFor.indexOf(identification) < 0 ? 'for ' : '') + identification;
60+
}
61+
})
62+
</script>
63+
5064

5165

examples/template/example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<script>
4141
$(document).ready(function () {
4242
var notFor = ['iClient Classic', '3D-WebGL'];
43-
var productArr = ['Leaflet', 'OpenLayers', 'MapboxGL', 'component', 'iClient Classic', '3D-WebGL']
43+
var productArr = ['Leaflet', 'OpenLayers', 'MapboxGL', 'MaplibreGL', 'component', 'iClient Classic', '3D-WebGL']
4444
var path = window.location.pathname.split('/');
4545
var identification = productArr.find(name => name.toLowerCase().includes(path[2]) || name.toLowerCase().includes(path[3]));
4646
if (identification) {

0 commit comments

Comments
 (0)