|
| 1 | +(()=>{ |
| 2 | +varlatestStable='0.21'; |
| 3 | +vargoodPaths=['stable','dev',latestStable]; |
| 4 | +varshowWarning=(msg)=>{ |
| 5 | +$('.header').append( |
| 6 | +'<p style="'+ |
| 7 | +[ |
| 8 | +'padding: 1em', |
| 9 | +'font-size: 1.5em', |
| 10 | +'border: 1px solid red', |
| 11 | +'background: pink', |
| 12 | +'width: 100%', |
| 13 | +].join('; ')+ |
| 14 | +'">'+msg+'</p>') |
| 15 | +}; |
| 16 | +/// if (location.hostname == 'scikit-learn.org') { |
| 17 | +varversionPath=location.pathname.split('/')[1]; |
| 18 | +if(!goodPaths.includes(versionPath)){ |
| 19 | +showWarning('You are looking at documentation for an old release of '+ |
| 20 | +'Scikit-learn (version '+versionPath+'). Try the '+ |
| 21 | +'<a href="https://scikit-learn.org">latest release</a> or '+ |
| 22 | +'<a href="https://scikit-learn.org/dev">development</a> '+ |
| 23 | +'versions.') |
| 24 | +}elseif(versionPath=='dev'){ |
| 25 | +showWarning('You are looking at documentation for the unstable '+ |
| 26 | +'development version of Scikit-learn. See also the '+ |
| 27 | +'<a href="https://scikit-learn.org">latest release</a> '+ |
| 28 | +'version.') |
| 29 | +} |
| 30 | +///} |
| 31 | +})() |