File: version_alert.js

package info (click to toggle)
pytorch-geometric 2.6.1-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,904 kB
  • sloc: python: 127,155; sh: 338; cpp: 27; makefile: 18; javascript: 16
file content (19 lines) | stat: -rw-r--r-- 749 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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('#pyg-documentation');
  if (parent)
    parent.insertBefore(note, parent.querySelector('h1'));
}

document.addEventListener('DOMContentLoaded', warnOnLatestVersion);