-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathversion_alert.js
More file actions
27 lines (22 loc) · 898 Bytes
/
version_alert.js
File metadata and controls
27 lines (22 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
* Copyright (c) ProrokLab.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
*/
function warnOnLatestVersion() {
if (!window.READTHEDOCS_DATA || window.READTHEDOCS_DATA.version !== "latest") {
return; // not on ReadTheDocs and not latest.
}
var note = document.createElement('div');
note.setAttribute('class', 'admonition note');
note.innerHTML = "<p class='first admonition-title'>Note</p> " +
"<p> " +
"This documentation is for an <b>unreleased development version</b>. " +
"Click <a href='/en/stable'><b>here</b></a> to access the documentation of the current stable release." +
"</p>";
var parent = document.querySelector('#vmas');
if (parent)
parent.insertBefore(note, parent.querySelector('h1'));
}
document.addEventListener('DOMContentLoaded', warnOnLatestVersion);