Skip to content

Commit 1a4e351

Browse files
committed
Mainframe: Remove old css
1 parent 379bb08 commit 1a4e351

File tree

2 files changed

+26
-215
lines changed

2 files changed

+26
-215
lines changed

layouts/_default/baseof.html

Lines changed: 18 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1,185 +1,60 @@
11
<!DOCTYPE html>
22
<html lang="{{ .Site.LanguageCode }}">
33

4-
<head>
5-
<style>
6-
body {
7-
/* Hide entire body for first paint. This suppresses flicker when theme is loading. */
8-
visibility: hidden;
9-
height: 100vh;
10-
display: flex;
11-
flex-direction: column;
12-
}
13-
</style>
14-
15-
<noscript>
16-
<style>
17-
/* Styles when JavaScript is disabled. Fallsback to old theme. */
18-
body {
19-
visibility: visible;
20-
}
21-
</style>
22-
</noscript>
23-
24-
25-
26-
<script>
27-
28-
const setTheme = (isNewTheme) => {
29-
localStorage.setItem("useNewTheme", `${isNewTheme}`);
30-
// swap out v1 and v2 css style
31-
const v1cssIds = [
32-
"cssFA1",
33-
"cssFA2",
34-
"cssFA3",
35-
"cssBootstrap",
36-
"css1",
37-
"css2",
38-
"css3",
39-
"css4",
40-
"css5",
41-
"css6",
42-
];
43-
44-
v1cssIds.forEach((cssId) => {
45-
const element = document.getElementById(cssId);
46-
if (element !== null) {
47-
element.disabled = isNewTheme;
48-
}
49-
});
50-
51-
const v2cssIds = ["css7", "css9"];
52-
v2cssIds.forEach((cssId) => {
53-
const element = document.getElementById(cssId);
54-
if (element !== null) {
55-
element.disabled = !isNewTheme;
56-
}
57-
});
58-
59-
// swap out v1 and v2 elements
60-
const v1ElementIds = ["sidebar", "footer", "toc", "api", "search-v1", "breadcrumb-v1", "list-v1"]
61-
62-
v1ElementIds.forEach((elementId) => {
63-
const element = document.getElementById(elementId);
64-
if (element !== null) {
65-
element.style.display = isNewTheme ? "none" : "";
66-
}
67-
68-
const trustarc = document.getElementById("teconsent-v1");
69-
if (trustarc) {
70-
trustarc.id = isNewTheme ? "teconsent-v1" : "teconsent";
71-
}
72-
});
73-
74-
document.querySelectorAll(".table-v1").forEach((table) => {
75-
table.style.display = isNewTheme ? "none" : "";
76-
});
77-
78-
const notMfElements = ['[data-mf="false"]'];
79-
notMfElements.forEach((elementId) => {
80-
document.querySelectorAll(elementId).forEach((element) => {
81-
element.style.display = isNewTheme ? "none" : "";
82-
});
83-
})
84-
85-
const mfElements = ['[data-mf="true"]'];
86-
mfElements.forEach((elementId) => {
87-
document.querySelectorAll(elementId).forEach((element) => {
88-
element.style.display = isNewTheme ? "" : "none";
89-
90-
const trustarc = document.getElementById("teconsent-v2");
91-
if (trustarc) {
92-
trustarc.id = isNewTheme ? "teconsent" : "teconsent-v2";
93-
}
94-
});
95-
});
96-
97-
document.getElementById("body").style.visibility = "visible";
98-
};
99-
100-
const toggleTheme = () => {
101-
setTheme(!(localStorage.getItem("useNewTheme") === "true"));
102-
};
103-
104-
// toggle theme aliases
105-
const mf = toggleTheme;
106-
const useNewTheme = toggleTheme;
107-
108-
document.addEventListener("DOMContentLoaded", () => {
109-
setTheme(localStorage.getItem("useNewTheme") === "true");
110-
});
111-
112-
function gameCode(callback) {
113-
let kkeys = [];
114-
// up,up,down,down,left,right,left,right,B,A
115-
const code = "38,38,40,40,37,39,37,39,66,65";
116-
return (event) => {
117-
kkeys.push(event.keyCode);
118-
if (kkeys.toString().indexOf(code) >= 0) {
119-
callback(event);
120-
kkeys = [];
121-
}
122-
};
123-
}
124-
const handler = gameCode(() => {
125-
mf();
126-
});
127-
window.addEventListener("keydown", handler);
128-
129-
</script>
4+
<head>
1305

1316
{{ block "head" . }}
1327

1338
{{ partial "meta.html" . }}
134-
9+
13510
{{ partial "favicon.html" . }}
136-
11+
13712
{{ partial "styles.html" . }}
138-
13+
13914
{{ if in .Params.doctypes "devportal" }}
14015
{{ partial "devportal/style.html" . }}
14116
{{ end }}
142-
17+
14318
{{ if fileExists "/layouts/partials/head_custom.html" }}
14419
{{ partial "head_custom.html" . }}
14520
{{ end }}
146-
21+
14722
{{ if or ( not hugo.IsServer ) ( not ( in .Site.Params.buildtype "package" ) ) }}
148-
23+
14924
{{ partial "trustarc.html" . }}
150-
25+
15126
{{ partial "tealium-profile.html" . }}
152-
27+
15328
{{ end }}
154-
29+
15530
{{ end }}
156-
31+
15732
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
15833
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
15934
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
16035
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
16136
})(window,document,'script','dataLayer','GTM-K5HG9JT');</script>
162-
37+
16338
</head>
164-
39+
16540
<body id="body">
16641
{{ if or ( not hugo.IsServer ) ( not ( in .Site.Params.buildtype "package" ) ) }}
16742
{{ partial "universal-tag.html" . }}
16843
{{ end }}
169-
44+
17045
<header>
17146
{{ block "header" . }}{{end}}
17247
</header>
173-
48+
17449
<section class="base-layout" data-testid="base-layout">
17550
<section id="breadcrumb-v1">
17651
{{ if not .IsHome }}
17752
{{ if not (in .Params.display_breadcrumb "false" ) }}
178-
{{ partial "breadcrumb" .}}
53+
{{ partial "breadcrumb" .}}
17954
{{ end }}
18055
{{ end }}
18156
</section>
182-
57+
18358
<div class="main container-fluid min-page-height" data-menu-id="{{.RelPermalink}}">
18459
{{ block "main" . }}{{ end }}
18560
</div>
@@ -196,7 +71,7 @@
19671
{{ partial "footer-v2.html" . }}
19772
{{ end }}
19873
</footer>
199-
{{ partial "scripts.html" . }}
74+
{{ partial "scripts.html" . }}
20075
<div id="consent_blackbar"></div>
20176
</body>
20277
</html>

layouts/partials/styles.html

Lines changed: 8 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,18 @@
1-
{{ $css1 := resources.Get "css/docs-nginx-com/nginx-site-header.css" }}
2-
{{ $css2 := resources.Get "css/docs-nginx-com/style.css" }}
3-
{{ $css3 := resources.Get "css/bootstrap-docs.css" }}
4-
{{ $css4 := resources.Get "css/f5-hugo.css" }}
5-
{{ $css5 := resources.Get "css/highlight.css" }}
6-
{{ $css6 := resources.Get "css/coveo.css" }}
7-
{{ $css7 := resources.Get "css/v2/style.css" }}
8-
{{ $css8 := resources.Get "css/inline-overrides.css" }}
9-
{{ $css9 := resources.Get "css/v2/highlight.css" }}
1+
{{ $style := resources.Get "css/v2/style.css" | minify | fingerprint "sha512" }}
2+
<link href="{{ $style.RelPermalink }}" integrity="{{ $style.Data.Integrity }}" rel="stylesheet" type="text/css">
103

11-
<!-- load v2 theme assets -->
12-
<link href="{{ $css7.RelPermalink }}" integrity="{{ $css7.Data.Integrity }}" rel="stylesheet" type="text/css" id="css7"
13-
disabled>
4+
{{ $cssInter := resources.Get "css/inter/inter.css" | minify | fingerprint "sha512" }}
5+
<link href="{{ $cssInter.RelPermalink }}" integrity="{{ $cssInter.Data.Integrity }}" rel="stylesheet" type="text/css">
146

15-
{{ $cssInter := resources.Get "css/inter/inter.css" | fingerprint "sha512" }}
16-
<link href="{{ $cssInter.RelPermalink }}" integrity="{{ $cssInter.Data.Integrity }}" rel="stylesheet" type="text/css"
17-
id="cssInter">
7+
{{ $cssHighlight := resources.Get "css/v2/highlight.css" | minify | fingerprint "sha512"}}
8+
<link href="{{ $cssHighlight.RelPermalink }}" rel="stylesheet" type="text/css">
189

19-
{{ $cssHighlight := $css9 | minify | fingerprint "sha512"}}
20-
<link href="{{ $cssHighlight.RelPermalink }}" rel="stylesheet" type="text/css" id="css9">
21-
<!-- end v2 theme assets -->
22-
23-
24-
<!-- load FontAwesome from assets -->
25-
{{ $cssFA1 := resources.Get "fontawesome/css/all.min.css" | fingerprint "sha512" }}
26-
<link href="{{ $cssFA1.RelPermalink }}" integrity="{{ $cssFA1.Data.Integrity }}" rel="stylesheet" type="text/css"
27-
id="cssFA1">
28-
29-
{{ $cssFA2 := resources.Get "fontawesome/css/v4-font-face.min.css" | fingerprint "sha512" }}
30-
<link href="{{ $cssFA2.RelPermalink }}" integrity="{{ $cssFA2.Data.Integrity }}" rel="stylesheet" type="text/css"
31-
id="cssFA2">
32-
33-
{{ $cssFA3 := resources.Get "fontawesome/css/v5-font-face.min.css" | fingerprint "sha512" }}
34-
<link href="{{ $cssFA3.RelPermalink }}" integrity="{{ $cssFA3.Data.Integrity }}" rel="stylesheet" type="text/css"
35-
id="cssFA3">
36-
37-
<!-- load Bootstrap from local assets -->
38-
{{ $cssBootstrap := resources.Get "css/bootstrap.min.css" | fingerprint "sha512" }}
39-
<link href="{{ $cssBootstrap.RelPermalink }}" integrity="{{ $cssBootstrap.Data.Integrity }}" rel="stylesheet"
40-
type="text/css" id="cssBootstrap">
41-
42-
{{ if ( not ( in .Site.Params.buildtype "package" ) ) }}
43-
<!-- load Coveo CSS -->
44-
<link rel="stylesheet" href="https://static.cloud.coveo.com/searchui/v2.10104/0/css/CoveoFullSearch.min.css"
45-
integrity="sha512-9/A9yVCU4GS6/iIwTRJKnan4Hf8gDKj3anwItN9QCsU8SixaT5xkjjWsZ/iq0TWaizhtqOLacadXJfxHlwYCcA=="
46-
crossorigin="anonymous" />{{ end }}
10+
{{ $cssOverrides := resources.Get "css/inline-overrides.css" | minify | fingerprint "sha512"}}
11+
<link href="{{ $cssOverrides.RelPermalink }}" rel="stylesheet" type="text/css" >
4712

4813
<!-- load CSS Atomic CSS -->
4914
<link
5015
rel="stylesheet"
5116
href="https://static.cloud.coveo.com/atomic/v3.19.0/themes/coveo.css"
5217
integrity="sha512-m2BufPi8Tc6H2jcQfDj/PIl5H57C9jeqhbDFgFXKTtOhoC4S7ULXmx74FseZ8WXpfdT9uyccMHDBJDrIZlrUUQ=="
5318
crossorigin="anonymous"/>
54-
55-
{{ $cssHeader := $css1 | minify | fingerprint "sha512"}}
56-
<link href="{{ $cssHeader.RelPermalink }}" rel="stylesheet" type="text/css" id="css1">
57-
58-
{{ $cssNginxStyles := $css2 | minify | fingerprint "sha512"}}
59-
<link href="{{ $cssNginxStyles.RelPermalink }}" rel="stylesheet" type="text/css" id="css2">
60-
61-
{{ $bootstrapDocs := $css3 | minify | fingerprint "sha512"}}
62-
<link href="{{ $bootstrapDocs.RelPermalink }}" rel="stylesheet" type="text/css" id="css3">
63-
64-
{{ if ( not ( in .Site.Params.buildtype "package" ) ) }}
65-
{{ $cssCoveo := $css6 | minify | fingerprint "sha512"}}
66-
<link href="{{ $cssCoveo.RelPermalink }}" rel="stylesheet" type="text/css" id="css6">
67-
{{ end }}
68-
69-
{{ $cssF5Hugo := $css4 | minify | fingerprint "sha512"}}
70-
<link href="{{ $cssF5Hugo.RelPermalink }}" rel="stylesheet" type="text/css" id="css4">
71-
72-
{{ $cssOverrides := $css8 | minify | fingerprint "sha512"}}
73-
<link href="{{ $cssOverrides.RelPermalink }}" rel="stylesheet" type="text/css" id="css8">
74-
75-
{{ if fileExists "assets/css/custom.css" }}
76-
{{ $customCSS := resources.Get "css/custom.css" | minify | fingerprint "sha512" }}
77-
<link href="{{ $customCSS.RelPermalink }}" rel="stylesheet" type="text/css">
78-
{{ end }}
79-
80-
<!-- load Highlight CSS -->
81-
{{ $cssHighlight := $css5 | minify | fingerprint "sha512"}}
82-
<link href="{{ $cssHighlight.RelPermalink }}" rel="stylesheet" type="text/css" id="css5">

0 commit comments

Comments
 (0)