Skip to content

Commit 3d68e16

Browse files
authoredFeb 7, 2022
Merge pull request #12662 from hashicorp/ds.ie11-warning
website: display warning in IE 11
2 parents d0f4786 + 591632a commit 3d68e16

File tree

3 files changed

+32
-640
lines changed

3 files changed

+32
-640
lines changed
 

‎website/pages/_document.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default class MyDocument extends Document {
1919
<script
2020
noModule
2121
dangerouslySetInnerHTML={{
22-
__html: `window.MSInputMethodContext && document.documentMode && document.write('<script src="/ie-custom-properties.js"><\\x2fscript>');`,
22+
__html: `window.MSInputMethodContext && document.documentMode && document.write('<script src="/ie-warning.js"><\\x2fscript>');`,
2323
}}
2424
/>
2525
</body>

‎website/public/ie-custom-properties.js

-639
This file was deleted.

‎website/public/ie-warning.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
!(function () {
2+
'use strict'
3+
4+
const el = document.createElement('div');
5+
el.innerHTML =
6+
'<div class="ie-warning">' +
7+
' <p class="ie-warning-description">' +
8+
' Internet Explorer is no longer supported.' +
9+
' <a href="https://support.hashicorp.com/hc/en-us/articles/4416485547795">' +
10+
' Learn more.' +
11+
' </a>' +
12+
' </p>' +
13+
'</div>' +
14+
'<style>' +
15+
' .ie-warning {' +
16+
' background-color: #FCF0F2;' +
17+
' border-bottom: 1px solid #FFD4D6;' +
18+
' color: #BA2226;' +
19+
' text-align: center;' +
20+
' font-family: "Segoe UI", sans-serif;' +
21+
' font-weight: bold;' +
22+
' }' +
23+
' .ie-warning-description {' +
24+
' padding: 16px 0;' +
25+
' margin: 0;' +
26+
' color: #BA2226;' +
27+
' }' +
28+
'</style>';
29+
30+
document.body.insertBefore(el, document.body.childNodes[0]);
31+
})();

0 commit comments

Comments
 (0)
Please sign in to comment.