2020-11-19 00:42:42 +01:00
window . addEventListener ( "DOMContentLoaded" , function ( ) {
2020-11-19 02:05:22 +01:00
var xhr = new XMLHttpRequest ( ) ;
2020-12-21 00:52:02 +01:00
xhr . open ( "GET" , window . location . origin + "/versions.json" ) ;
2020-11-19 02:05:22 +01:00
xhr . onload = function ( ) {
var versions = JSON . parse ( this . responseText ) ;
latest _version = ""
for ( id in versions )
if ( versions [ id ] [ "aliases" ] . length > 0 && versions [ id ] [ "aliases" ] . includes ( "latest" ) )
latest _version = "/" + versions [ id ] . version + "/"
if ( ! window . location . pathname . includes ( "/latest/" ) && ( latest _version . length > 0 && ! window . location . pathname . includes ( latest _version ) ) )
2020-12-12 23:44:01 +01:00
document . querySelector ( "div[data-md-component=announce]" ) . innerHTML = "<div id='announce-msg'>You are seeing the docs for a previous version of RAPIDS, <a href='http://www.rapids.science/'>click here to go to the latest</a></div>"
2020-11-19 02:05:22 +01:00
} ;
xhr . send ( ) ;
2020-11-19 00:42:42 +01:00
} ) ;