Skip to content

Commit

Permalink
add deprecation banner
Browse files Browse the repository at this point in the history
  • Loading branch information
BeateRixen committed Jul 16, 2024
1 parent 03e42a2 commit 6a0b88a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion themes/c8ydocs/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var main = (function ($) {
$('#dropdownVersionButton').hide();
return;
}

vs = []
for (var i = 0; i < urls.length; i++) {
vs.push(urls[i].label);
Expand Down Expand Up @@ -64,6 +64,22 @@ var main = (function ($) {
$('.dropdown.version').css('top', (offset + 10));
}

if (true) {
offset = 45;
$('<div/>', {
id: 'deprecation-banner',
style: 'position: fixed; top: 0; left: 0; width: 100%; background-color: #ff9301; height: ' + offset + 'px; padding: 10px 5px 5px 5px; z-index: 50;'
}).prependTo('body');

backURL = prefix + suffix;

$('<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');

$('.main-top-bar').css('top', offset);
$('.main-nav.navbar').css('top', offset);
$('.dropdown.version').css('top', (offset + 10));
}

if (vs.indexOf(v) < 0) {
active = true;
$('#current-dropdown-version-toggle').text('Release ' + v);
Expand Down

0 comments on commit 6a0b88a

Please sign in to comment.