Skip to content

Commit 6a0b88a

Browse files
committed
add deprecation banner
1 parent 03e42a2 commit 6a0b88a

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

themes/c8ydocs/static/js/main.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var main = (function ($) {
1717
$('#dropdownVersionButton').hide();
1818
return;
1919
}
20-
20+
2121
vs = []
2222
for (var i = 0; i < urls.length; i++) {
2323
vs.push(urls[i].label);
@@ -64,6 +64,22 @@ var main = (function ($) {
6464
$('.dropdown.version').css('top', (offset + 10));
6565
}
6666

67+
if (true) {
68+
offset = 45;
69+
$('<div/>', {
70+
id: 'deprecation-banner',
71+
style: 'position: fixed; top: 0; left: 0; width: 100%; background-color: #ff9301; height: ' + offset + 'px; padding: 10px 5px 5px 5px; z-index: 50;'
72+
}).prependTo('body');
73+
74+
backURL = prefix + suffix;
75+
76+
$('<p style="text-align: center; vertical-align: center;">This documentation refers to a Cumulocity IoT release that is no longer maintained (version ' + v + '). Click <a href="' + backURL + '">here</a> to switch to the latest version.</p>').appendTo('#deprecation-banner');
77+
78+
$('.main-top-bar').css('top', offset);
79+
$('.main-nav.navbar').css('top', offset);
80+
$('.dropdown.version').css('top', (offset + 10));
81+
}
82+
6783
if (vs.indexOf(v) < 0) {
6884
active = true;
6985
$('#current-dropdown-version-toggle').text('Release ' + v);

0 commit comments

Comments
 (0)