page.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>{% block title %}Jupyter Notebook{% endblock %}</title>
  6. {% block favicon %}<link id="favicon" rel="shortcut icon" type="image/x-icon" href="{{static_url("base/images/favicon.ico") }}">{% endblock %}
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  8. <link rel="stylesheet" href="{{static_url("components/jquery-ui/themes/smoothness/jquery-ui.min.css") }}" type="text/css" />
  9. <link rel="stylesheet" href="{{static_url("components/jquery-typeahead/dist/jquery.typeahead.min.css") }}" type="text/css" />
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. {% block stylesheet %}
  12. <link rel="stylesheet" href="{{ static_url("style/style.min.css") }}" type="text/css"/>
  13. {% endblock %}
  14. <link rel="stylesheet" href="{{ base_url }}custom/custom.css" type="text/css" />
  15. <script src="{{static_url("components/es6-promise/promise.min.js")}}" type="text/javascript" charset="utf-8"></script>
  16. <script src="{{static_url('components/react/react.production.min.js')}}" type="text/javascript"></script>
  17. <script src="{{static_url('components/react/react-dom.production.min.js')}}" type="text/javascript"></script>
  18. <script src="{{static_url('components/create-react-class/index.js')}}" type="text/javascript"></script>
  19. <script src="{{static_url('components/requirejs/require.js') }}" type="text/javascript" charset="utf-8"></script>
  20. <script>
  21. require.config({
  22. {% if version_hash %}
  23. urlArgs: "v={{version_hash}}",
  24. {% endif %}
  25. baseUrl: '{{static_url("", include_version=False)}}',
  26. paths: {
  27. 'auth/js/main': 'auth/js/main.min',
  28. custom : '{{ base_url }}custom',
  29. nbextensions : '{{ base_url }}nbextensions',
  30. kernelspecs : '{{ base_url }}kernelspecs',
  31. underscore : 'components/underscore/underscore-min',
  32. backbone : 'components/backbone/backbone-min',
  33. jed: 'components/jed/jed',
  34. jquery: 'components/jquery/jquery.min',
  35. json: 'components/requirejs-plugins/src/json',
  36. text: 'components/requirejs-text/text',
  37. bootstrap: 'components/bootstrap/dist/js/bootstrap.min',
  38. bootstraptour: 'components/bootstrap-tour/build/js/bootstrap-tour.min',
  39. 'jquery-ui': 'components/jquery-ui/jquery-ui.min',
  40. moment: 'components/moment/min/moment-with-locales',
  41. codemirror: 'components/codemirror',
  42. termjs: 'components/xterm.js/xterm',
  43. typeahead: 'components/jquery-typeahead/dist/jquery.typeahead.min',
  44. },
  45. map: { // for backward compatibility
  46. "*": {
  47. "jqueryui": "jquery-ui",
  48. }
  49. },
  50. shim: {
  51. typeahead: {
  52. deps: ["jquery"],
  53. exports: "typeahead"
  54. },
  55. underscore: {
  56. exports: '_'
  57. },
  58. backbone: {
  59. deps: ["underscore", "jquery"],
  60. exports: "Backbone"
  61. },
  62. bootstrap: {
  63. deps: ["jquery"],
  64. exports: "bootstrap"
  65. },
  66. bootstraptour: {
  67. deps: ["bootstrap"],
  68. exports: "Tour"
  69. },
  70. "jquery-ui": {
  71. deps: ["jquery"],
  72. exports: "$"
  73. }
  74. },
  75. waitSeconds: 30,
  76. });
  77. require.config({
  78. map: {
  79. '*':{
  80. 'contents': '{{ contents_js_source }}',
  81. }
  82. }
  83. });
  84. // error-catching custom.js shim.
  85. define("custom", function (require, exports, module) {
  86. try {
  87. var custom = require('custom/custom');
  88. console.debug('loaded custom.js');
  89. return custom;
  90. } catch (e) {
  91. console.error("error loading custom.js", e);
  92. return {};
  93. }
  94. })
  95. document.nbjs_translations = {{ nbjs_translations|safe }};
  96. document.documentElement.lang = navigator.language.toLowerCase();
  97. </script>
  98. {% block meta %}
  99. {% endblock %}
  100. </head>
  101. <body class="{% block bodyclasses %}{% endblock %}"
  102. {% block params %}
  103. {% if logged_in and token %}
  104. data-jupyter-api-token="{{token | urlencode}}"
  105. {% endif %}
  106. {% endblock params %}
  107. dir="ltr">
  108. <noscript>
  109. <div id='noscript'>
  110. {% trans %}Jupyter Notebook requires JavaScript.{% endtrans %}<br>
  111. {% trans %}Please enable it to proceed. {% endtrans %}
  112. </div>
  113. </noscript>
  114. <div id="header">
  115. <div id="header-container" class="container">
  116. <div id="ipython_notebook" class="nav navbar-brand"><a href="{{default_url}}
  117. {%- if logged_in and token -%}?token={{token}}{%- endif -%}" title='{% trans %}dashboard{% endtrans %}'>
  118. {% block logo %}<img src='{{static_url("base/images/logo.png") }}' alt='Jupyter Notebook'/>{% endblock %}
  119. </a></div>
  120. {% block headercontainer %}
  121. {% endblock %}
  122. {% block header_buttons %}
  123. {% block login_widget %}
  124. <span id="login_widget">
  125. {% if logged_in %}
  126. <button id="logout" class="btn btn-sm navbar-btn">{% trans %}Logout{% endtrans %}</button>
  127. {% elif login_available and not logged_in %}
  128. <button id="login" class="btn btn-sm navbar-btn">{% trans %}Login{% endtrans %}</button>
  129. {% endif %}
  130. </span>
  131. {% endblock %}
  132. {% endblock header_buttons %}
  133. </div>
  134. <div class="header-bar"></div>
  135. {% block header %}
  136. {% endblock %}
  137. </div>
  138. <div id="site">
  139. {% block site %}
  140. {% endblock %}
  141. </div>
  142. {% block after_site %}
  143. {% endblock %}
  144. {% block script %}
  145. {% endblock %}
  146. <script type='text/javascript'>
  147. function _remove_token_from_url() {
  148. if (window.location.search.length <= 1) {
  149. return;
  150. }
  151. var search_parameters = window.location.search.slice(1).split('&');
  152. for (var i = 0; i < search_parameters.length; i++) {
  153. if (search_parameters[i].split('=')[0] === 'token') {
  154. // remote token from search parameters
  155. search_parameters.splice(i, 1);
  156. var new_search = '';
  157. if (search_parameters.length) {
  158. new_search = '?' + search_parameters.join('&');
  159. }
  160. var new_url = window.location.origin +
  161. window.location.pathname +
  162. new_search +
  163. window.location.hash;
  164. window.history.replaceState({}, "", new_url);
  165. return;
  166. }
  167. }
  168. }
  169. _remove_token_from_url();
  170. </script>
  171. </body>
  172. </html>