Skip to content

Commit 5c2fe24

Browse files
authored
Add v1 beta alert (#700)
1 parent a1f75e6 commit 5c2fe24

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

docs/static/js/v1-alert.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var v1AlertContainer = document.getElementById('dbc-v1-alert-container');
2+
3+
if (!window.localStorage.getItem('dbc-v1-alert-seen')) {
4+
v1AlertContainer.setAttribute('style', 'display:block');
5+
}
6+
7+
$('#dbc-v1-alert').on('closed.bs.alert', function() {
8+
console.log('triggered');
9+
window.localStorage.setItem('dbc-v1-alert-seen', 'true');
10+
v1AlertContainer.setAttribute('style', 'display:none');
11+
});

docs/templates/base.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
</head>
77
<body>
88
{% block header %}{% endblock %}
9+
{% include "partials/v1-alert.html" %}
910
{% block body %}{% endblock %}
1011
{% block scripts %}{% include "partials/scripts.html" %}{% endblock %}
1112
</body>

docs/templates/partials/scripts.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
integrity="sha384-w1Q4orYjBQndcko6MimVbzY0tgp4pWB4lZ7lr30WKz0vr/aWKhXdBNmNb5D92v7s"
1414
crossorigin="anonymous"
1515
></script>
16+
<script src="/static/js/v1-alert.js"></script>
1617
<script src="/static/js/highlight.min.js"></script>
1718
<script>
1819
hljs.configure({ignoreUnescapedHTML: true});

docs/templates/partials/v1-alert.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<div id="dbc-v1-alert-container" style="display:none" class="mt-3 px-5">
2+
<div
3+
id="dbc-v1-alert"
4+
class="alert alert-warning alert-dismissible mx-auto"
5+
style="max-width:1000px;"
6+
role="alert"
7+
>
8+
<i>dash-bootstrap-components</i> version 1 is in beta! Please check
9+
<a
10+
href="https://community.plotly.com/t/dash-bootstrap-components-v1-beta-release-available/56526"
11+
class="alert-link"
12+
>the announcement post</a
13+
>
14+
on the Plotly forum for more information, and the
15+
<a class="alert-link" href="https://dbc-v1.herokuapp.com/migration-guide"
16+
>migration guide</a
17+
>
18+
in the preview documentation for information on breaking changes, and how to
19+
continue to use version 0 if you're not ready to upgrade.
20+
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
21+
<span aria-hidden="true">&times;</span>
22+
</button>
23+
</div>
24+
</div>

0 commit comments

Comments
 (0)