remove webpack shims

restore explicit imports of jquery, etc.
Min RK 9 years ago
parent 8a644a9794
commit 47d4451958

@ -199,8 +199,8 @@ class IPythonHandler(AuthenticatedHandler):
@property
def contents_js_source(self):
self.log.debug("Using contents: %s", self.settings.get('contents_js_source',
'services/built/contents'))
return self.settings.get('contents_js_source', 'services/built/contents')
'services/contents'))
return self.settings.get('contents_js_source', 'services/contents')
#---------------------------------------------------------------
# Manager objects

@ -1,7 +1,7 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
define(['base/js/namespace', 'base/js/page'], function(IPython, page) {
define(['jquery', 'base/js/namespace', 'base/js/page'], function($, IPython, page) {
function login_main() {
var page_instance = new page.Page();
$('button#login_submit').addClass("btn btn-default");

@ -2,8 +2,9 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/utils',
], function(utils){
], function($, utils){
"use strict";
var LoginWidget = function (selector, options) {

@ -1,6 +1,5 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
__webpack_public_path__ = window['staticURL'] + 'auth/js/built/';
define(['./loginmain', './logoutmain'], function (login_main, logout_main) {
return {

@ -5,6 +5,8 @@ define(function(require) {
"use strict";
var CodeMirror = require('codemirror/lib/codemirror');
var bs = require('bootstrap');
var $ = require('jquery');
/**
* A wrapper around bootstrap modal for easier use

@ -9,7 +9,7 @@
// events.on("event.Namespace", function () { do_stuff(); });
// });
define(['base/js/namespace'], function(Jupyter) {
define(['jquery', 'base/js/namespace'], function($, Jupyter) {
"use strict";
// Events singleton

@ -1,11 +0,0 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
// TODO: Remove me in 6.0!
define([], function() {
console.warn(['Importing jquery and associated libraries, such as',
'bootstrap, is deprecated. This functionality will be remove in the',
'notebook 6.0 in favor of a fully loaded jQuery global'].join(' '));
return window.$;
});

@ -9,9 +9,10 @@
*/
define([
'jquery',
'base/js/utils',
'underscore',
], function(utils, _) {
], function($, utils, _) {
"use strict";

@ -2,79 +2,76 @@
// Distributed under the terms of the Modified BSD License.
var Jupyter;
if (typeof window !== 'undefined') {
Jupyter = window['Jupyter'] = window['Jupyter'] || {};
} else {
Jupyter = Jupyter || {};
}
var Jupyter = Jupyter || {};
var jprop = function(name, loadedModule, modulePath){
var jprop = function(name, module_path){
Object.defineProperty(Jupyter, name, {
get: function() {
console.warn('accessing `'+name+'` is deprecated. Use `require("'+modulePath+'")`');
return loadedModule;
console.warn('accessing `'+name+'` is deprecated. Use `require("'+module_path+'")`');
return require(module_path);
},
enumerable: true,
configurable: false
});
};
}
var jglobal = function(name, loadedModule, modulePath){
var jglobal = function(name, module_path){
Object.defineProperty(Jupyter, name, {
get: function() {
console.warn('accessing `'+name+'` is deprecated. Use `require("'+modulePath+'").'+name+'`');
return loadedModule[name];
console.warn('accessing `'+name+'` is deprecated. Use `require("'+module_path+'").'+name+'`');
return require(module_path)[name];
},
enumerable: true,
configurable: false
});
};
}
define(function(){
"use strict";
// expose modules
if (!Jupyter.hasOwnProperty('utils')) jprop('utils',require('base/js/utils'), 'base/js/utils');
if (!Jupyter.hasOwnProperty('security')) jprop('security',require('base/js/security'), 'base/js/security');
if (!Jupyter.hasOwnProperty('keyboard')) jprop('keyboard',require('base/js/keyboard'), 'base/js/keyboard');
if (!Jupyter.hasOwnProperty('dialog')) jprop('dialog',require('base/js/dialog'), 'base/js/dialog');
if (!Jupyter.hasOwnProperty('mathjaxutils')) jprop('mathjaxutils',require('notebook/js/mathjaxutils'), 'notebook/js/mathjaxutils');
jprop('utils','base/js/utils')
//Jupyter.load_extensions = Jupyter.utils.load_extensions;
//
jprop('security','base/js/security');
jprop('keyboard','base/js/keyboard');
jprop('dialog','base/js/dialog');
jprop('mathjaxutils','notebook/js/mathjaxutils');
//// exposed constructors
if (!Jupyter.hasOwnProperty('CommManager')) jglobal('CommManager',require('services/kernels/comm'), 'services/kernels/comm');
if (!Jupyter.hasOwnProperty('Comm')) jglobal('Comm',require('services/kernels/comm'), 'services/kernels/comm');
jglobal('CommManager','services/kernels/comm')
jglobal('Comm','services/kernels/comm')
if (!Jupyter.hasOwnProperty('NotificationWidget')) jglobal('NotificationWidget',require('base/js/notificationwidget'), 'base/js/notificationwidget');
if (!Jupyter.hasOwnProperty('Kernel')) jglobal('Kernel',require('services/kernels/kernel'), 'services/kernels/kernel');
if (!Jupyter.hasOwnProperty('Session')) jglobal('Session',require('services/sessions/session'), 'services/sessions/session');
if (!Jupyter.hasOwnProperty('LoginWidget')) jglobal('LoginWidget',require('auth/js/loginwidget'), 'auth/js/loginwidget');
if (!Jupyter.hasOwnProperty('Page')) jglobal('Page',require('base/js/page'), 'base/js/page');
jglobal('NotificationWidget','base/js/notificationwidget');
jglobal('Kernel','services/kernels/kernel');
jglobal('Session','services/sessions/session');
jglobal('LoginWidget','auth/js/loginwidget');
jglobal('Page','base/js/page');
// notebook
if (!Jupyter.hasOwnProperty('TextCell')) jglobal('TextCell',require('notebook/js/textcell'), 'notebook/js/textcell');
if (!Jupyter.hasOwnProperty('OutputArea')) jglobal('OutputArea',require('notebook/js/outputarea'), 'notebook/js/outputarea');
if (!Jupyter.hasOwnProperty('KeyboardManager')) jglobal('KeyboardManager',require('notebook/js/keyboardmanager'), 'notebook/js/keyboardmanager');
if (!Jupyter.hasOwnProperty('Completer')) jglobal('Completer',require('notebook/js/completer'), 'notebook/js/completer');
if (!Jupyter.hasOwnProperty('Notebook')) jglobal('Notebook',require('notebook/js/notebook'), 'notebook/js/notebook');
if (!Jupyter.hasOwnProperty('Tooltip')) jglobal('Tooltip',require('notebook/js/tooltip'), 'notebook/js/tooltip');
if (!Jupyter.hasOwnProperty('Toolbar')) jglobal('Toolbar',require('notebook/js/toolbar'), 'notebook/js/toolbar');
if (!Jupyter.hasOwnProperty('SaveWidget')) jglobal('SaveWidget',require('notebook/js/savewidget'), 'notebook/js/savewidget');
if (!Jupyter.hasOwnProperty('Pager')) jglobal('Pager',require('notebook/js/pager'), 'notebook/js/pager');
if (!Jupyter.hasOwnProperty('QuickHelp')) jglobal('QuickHelp',require('notebook/js/quickhelp'), 'notebook/js/quickhelp');
if (!Jupyter.hasOwnProperty('MarkdownCell')) jglobal('MarkdownCell',require('notebook/js/textcell'), 'notebook/js/textcell');
if (!Jupyter.hasOwnProperty('RawCell')) jglobal('RawCell',require('notebook/js/textcell'), 'notebook/js/textcell');
if (!Jupyter.hasOwnProperty('Cell')) jglobal('Cell',require('notebook/js/cell'), 'notebook/js/cell');
if (!Jupyter.hasOwnProperty('MainToolBar')) jglobal('MainToolBar',require('notebook/js/maintoolbar'), 'notebook/js/maintoolbar');
if (!Jupyter.hasOwnProperty('NotebookNotificationArea')) jglobal('NotebookNotificationArea',require('notebook/js/notificationarea'), 'notebook/js/notificationarea');
if (!Jupyter.hasOwnProperty('NotebookTour')) jglobal('NotebookTour',require('notebook/js/tour'), 'notebook/js/tour');
if (!Jupyter.hasOwnProperty('MenuBar')) jglobal('MenuBar',require('notebook/js/menubar'), 'notebook/js/menubar');
jglobal('TextCell','notebook/js/textcell');
jglobal('OutputArea','notebook/js/outputarea');
jglobal('KeyboardManager','notebook/js/keyboardmanager');
jglobal('Completer','notebook/js/completer');
jglobal('Notebook','notebook/js/notebook');
jglobal('Tooltip','notebook/js/tooltip');
jglobal('Toolbar','notebook/js/toolbar');
jglobal('SaveWidget','notebook/js/savewidget');
jglobal('Pager','notebook/js/pager');
jglobal('QuickHelp','notebook/js/quickhelp');
jglobal('MarkdownCell','notebook/js/textcell');
jglobal('RawCell','notebook/js/textcell');
jglobal('Cell','notebook/js/cell');
jglobal('MainToolBar','notebook/js/maintoolbar');
jglobal('NotebookNotificationArea','notebook/js/notificationarea');
jglobal('NotebookTour', 'notebook/js/tour');
jglobal('MenuBar', 'notebook/js/menubar');
// tree
if (!Jupyter.hasOwnProperty('SessionList')) jglobal('SessionList',require('tree/js/sessionlist'), 'tree/js/sessionlist');
jglobal('SessionList','tree/js/sessionlist');
Jupyter.version = "5.0.0.dev";
Jupyter._target = '_blank';
@ -82,4 +79,4 @@ define(function(){
});
// deprecated since 4.0, remove in 5+
window['IPython'] = Jupyter;
var IPython = Jupyter

@ -2,8 +2,9 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/notificationwidget',
], function(notificationwidget) {
], function($, notificationwidget) {
"use strict";
// store reference to the NotificationWidget class

@ -1,7 +1,7 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
define([], function() {
define(['jquery'], function($) {
"use strict";
/**

@ -2,8 +2,9 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/events',
], function(events){
], function($, events){
"use strict";
var Page = function () {

@ -2,8 +2,9 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'components/google-caja/html-css-sanitizer-minified',
], function(sanitize) {
], function($, sanitize) {
"use strict";
var noop = function (x) { return x; };
@ -116,7 +117,7 @@ define([
if (allow_css) {
// sanitize style tags as stylesheets
sanitized = sanitize_stylesheets(result.sanitized, policy);
sanitized = sanitize_stylesheets(sanitized, policy);
}
return sanitized;

@ -1,10 +0,0 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
// TODO: Remove me in 6.0!
define([], function() {
console.warn(['Importing bootstrap tour is deprecated. This feature will',
'be remove in the notebook 6.0 in favor of the Tour global object.'].join(' '));
return window.Tour;
});

@ -1,12 +0,0 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
// TODO: Remove me in 6.0!
define([], function() {
console.warn(['Importing typeahead is deprecated because it is associated',
'with a global jquery variable. This feature will be removed in the',
'notebook 6.0 in favor of a jquery global. Alternatively use',
'typeahead via `$.typeahead.`'].join(' '));
return $.typeahead;
});

@ -2,12 +2,13 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'codemirror/lib/codemirror',
'moment',
'underscore',
// silently upgrades CodeMirror
'codemirror/mode/meta',
], function(CodeMirror, moment, _){
], function($, CodeMirror, moment, _){
"use strict";
// keep track of which extensions have been loaded already
@ -603,7 +604,7 @@ define([
var to_absolute_cursor_pos = function (cm, cursor) {
console.warn('`utils.to_absolute_cursor_pos(cm, pos)` is deprecated. Use `cm.indexFromPos(cursor)`');
return cm.indexFromPos(cusrsor);
return cm.indexFromPos(cursor);
};
var from_absolute_cursor_pos = function (cm, cursor_pos) {

@ -1,79 +0,0 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
// TODO: Remove me in notebook version 6.0
[
'edit/js/savewidget',
'edit/js/main',
'edit/js/menubar',
'edit/js/editor',
'edit/js/notificationarea',
'base/js/keyboard',
'base/js/dialog',
'base/js/notificationwidget',
'base/js/namespace',
'base/js/utils',
'base/js/notificationarea',
'base/js/events',
'base/js/security',
'base/js/page',
'auth/js/main',
'auth/js/logoutmain',
'auth/js/loginmain',
'auth/js/loginwidget',
'terminal/js/main',
'terminal/js/terminado',
'notebook/js/toolbar',
'notebook/js/savewidget',
'notebook/js/main',
'notebook/js/completer',
'notebook/js/contexthint',
'notebook/js/textcell',
'notebook/js/cell',
'notebook/js/tour',
'notebook/js/menubar',
'notebook/js/mathjaxutils',
'notebook/js/codecell',
'notebook/js/codemirror-ipython',
'notebook/js/kernelselector',
'notebook/js/codemirror-ipythongfm',
'notebook/js/celltoolbarpresets/example',
'notebook/js/celltoolbarpresets/default',
'notebook/js/celltoolbarpresets/slideshow',
'notebook/js/celltoolbarpresets/rawcell',
'notebook/js/tooltip',
'notebook/js/maintoolbar',
'notebook/js/about',
'notebook/js/notificationarea',
'notebook/js/quickhelp',
'notebook/js/actions',
'notebook/js/pager',
'notebook/js/searchandreplace',
'notebook/js/keyboardmanager',
'notebook/js/notebook',
'notebook/js/scrollmanager',
'notebook/js/outputarea',
'notebook/js/celltoolbar',
'notebook/js/commandpalette',
'tree/js/sessionlist',
'tree/js/main',
'tree/js/kernellist',
'tree/js/newnotebook',
'tree/js/terminallist',
'tree/js/notebooklist',
'services/sessions/session',
'services/contents',
'services/kernels/serialize',
'services/kernels/comm',
'services/kernels/kernel',
'services/config'
].forEach(function (modulePath) {
define(modulePath, ['notebook'], function(notebookApp) {
console.warn(["Direct module require deprecated. Instead of using",
"`define(['" + modulePath + "'], function(module) {});`, use",
"`define(['notebook'], function(notebookApp) { var module = ",
"notebookApp['" + modulePath + "']});`"].join(' '));
return notebookApp[modulePath];
});
});

@ -2,6 +2,7 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/utils',
'codemirror/lib/codemirror',
'codemirror/mode/meta',
@ -16,6 +17,7 @@ define([
'codemirror/keymap/vim',
],
function(
$,
utils,
CodeMirror
) {

@ -1,9 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
__webpack_public_path__ = window['staticURL'] + 'edit/js/built/';
requirejs(['contents'], function(contents) {
require([
'jquery',
'base/js/namespace',
'base/js/utils',
'base/js/page',
@ -14,6 +14,7 @@ require([
'edit/js/savewidget',
'edit/js/notificationarea',
], function(
$,
IPython,
utils,
page,

@ -2,12 +2,13 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/namespace',
'base/js/utils',
'base/js/dialog',
'codemirror/lib/codemirror',
'codemirror/mode/meta',
], function(IPython, utils, dialog, CodeMirror) {
], function($, IPython, utils, dialog, CodeMirror) {
"use strict";
var MenuBar = function (selector, options) {

@ -2,11 +2,12 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/utils',
'base/js/dialog',
'base/js/keyboard',
'moment',
], function(utils, dialog, keyboard, moment) {
], function($, utils, dialog, keyboard, moment) {
"use strict";
var SaveWidget = function (selector, options) {

@ -1,70 +0,0 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
__webpack_public_path__ = window['staticURL'] + 'built/';
module.exports = {
'edit/js/savewidget': require('./edit/js/savewidget.js'),
// 'edit/js/main': require('./edit/js/main.js'),
'edit/js/menubar': require('./edit/js/menubar.js'),
'edit/js/editor': require('./edit/js/editor.js'),
'edit/js/notificationarea': require('./edit/js/notificationarea.js'),
'base/js/keyboard': require('./base/js/keyboard.js'),
'base/js/dialog': require('./base/js/dialog.js'),
'base/js/notificationwidget': require('./base/js/notificationwidget.js'),
'base/js/namespace': require('./base/js/namespace.js'),
'base/js/utils': require('./base/js/utils.js'),
'base/js/notificationarea': require('./base/js/notificationarea.js'),
'base/js/events': require('./base/js/events.js'),
'base/js/security': require('./base/js/security.js'),
'base/js/page': require('./base/js/page.js'),
'auth/js/main': require('./auth/js/main.js'),
'auth/js/logoutmain': require('./auth/js/logoutmain.js'),
'auth/js/loginmain': require('./auth/js/loginmain.js'),
'auth/js/loginwidget': require('./auth/js/loginwidget.js'),
// 'terminal/js/main': require('./terminal/js/main.js'),
'terminal/js/terminado': require('./terminal/js/terminado.js'),
'notebook/js/toolbar': require('./notebook/js/toolbar.js'),
'notebook/js/savewidget': require('./notebook/js/savewidget.js'),
// 'notebook/js/main': require('./notebook/js/main.js'),
'notebook/js/completer': require('./notebook/js/completer.js'),
'notebook/js/contexthint': require('./notebook/js/contexthint.js'),
'notebook/js/textcell': require('./notebook/js/textcell.js'),
'notebook/js/cell': require('./notebook/js/cell.js'),
'notebook/js/tour': require('./notebook/js/tour.js'),
'notebook/js/menubar': require('./notebook/js/menubar.js'),
'notebook/js/mathjaxutils': require('./notebook/js/mathjaxutils.js'),
'notebook/js/codecell': require('./notebook/js/codecell.js'),
'notebook/js/codemirror-ipython': require('./notebook/js/codemirror-ipython.js'),
'notebook/js/kernelselector': require('./notebook/js/kernelselector.js'),
'notebook/js/codemirror-ipythongfm': require('./notebook/js/codemirror-ipythongfm.js'),
'notebook/js/celltoolbarpresets/example': require('./notebook/js/celltoolbarpresets/example.js'),
'notebook/js/celltoolbarpresets/default': require('./notebook/js/celltoolbarpresets/default.js'),
'notebook/js/celltoolbarpresets/slideshow': require('./notebook/js/celltoolbarpresets/slideshow.js'),
'notebook/js/celltoolbarpresets/rawcell': require('./notebook/js/celltoolbarpresets/rawcell.js'),
'notebook/js/tooltip': require('./notebook/js/tooltip.js'),
'notebook/js/maintoolbar': require('./notebook/js/maintoolbar.js'),
'notebook/js/about': require('./notebook/js/about.js'),
'notebook/js/notificationarea': require('./notebook/js/notificationarea.js'),
'notebook/js/quickhelp': require('./notebook/js/quickhelp.js'),
'notebook/js/actions': require('./notebook/js/actions.js'),
'notebook/js/pager': require('./notebook/js/pager.js'),
'notebook/js/searchandreplace': require('./notebook/js/searchandreplace.js'),
'notebook/js/keyboardmanager': require('./notebook/js/keyboardmanager.js'),
'notebook/js/notebook': require('./notebook/js/notebook.js'),
'notebook/js/scrollmanager': require('./notebook/js/scrollmanager.js'),
'notebook/js/outputarea': require('./notebook/js/outputarea.js'),
'notebook/js/celltoolbar': require('./notebook/js/celltoolbar.js'),
'notebook/js/commandpalette': require('./notebook/js/commandpalette.js'),
'tree/js/sessionlist': require('./tree/js/sessionlist.js'),
// 'tree/js/main': require('./tree/js/main.js'),
'tree/js/kernellist': require('./tree/js/kernellist.js'),
'tree/js/newnotebook': require('./tree/js/newnotebook.js'),
'tree/js/terminallist': require('./tree/js/terminallist.js'),
'tree/js/notebooklist': require('./tree/js/notebooklist.js'),
'services/sessions/session': require('./services/sessions/session.js'),
'services/contents': require('./services/contents.js'),
'services/kernels/serialize': require('./services/kernels/serialize.js'),
'services/kernels/comm': require('./services/kernels/comm.js'),
'services/kernels/kernel': require('./services/kernels/kernel.js'),
'services/config': require('./services/config.js'),
};

@ -1,10 +1,11 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
require([
'jquery',
'base/js/dialog',
'underscore',
'base/js/namespace'
], function (dialog, _, IPython) {
], function ($, dialog, _, IPython) {
'use strict';
$('#notebook_about').click(function () {
// use underscore template to auto html escape

@ -34,6 +34,7 @@ define(function(require){
Object.seal(this);
};
var $ = require('jquery');
var events = require('base/js/events');
/**

@ -10,13 +10,14 @@
define([
'jquery',
'base/js/utils',
'codemirror/lib/codemirror',
'codemirror/addon/edit/matchbrackets',
'codemirror/addon/edit/closebrackets',
'codemirror/addon/comment/comment',
'services/config',
], function(utils, CodeMirror, cm_match, cm_closeb, cm_comment, configmod) {
], function($, utils, CodeMirror, cm_match, cm_closeb, cm_comment, configmod) {
"use strict";
var overlayHack = CodeMirror.scrollbarModel.native.prototype.overlayHack;

@ -2,9 +2,10 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/namespace',
'base/js/events'
], function(IPython, events) {
], function($, IPython, events) {
"use strict";
var CellToolbar = function (options) {

@ -2,10 +2,11 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/namespace',
'base/js/utils',
'base/js/dialog'
], function(Jupyter, utils, dialog) {
], function($, Jupyter, utils, dialog) {
var jcbprefix = '<pre class="jupyter-nb-cells-json">';
var jcbsuffix = '</pre>';

@ -10,6 +10,7 @@
define([
'jquery',
'base/js/namespace',
'base/js/utils',
'base/js/keyboard',
@ -21,7 +22,9 @@ define([
'codemirror/lib/codemirror',
'codemirror/mode/python/python',
'notebook/js/codemirror-ipython'
], function(IPython,
], function(
$,
IPython,
utils,
keyboard,
configmod,

@ -5,35 +5,34 @@
(function(mod) {
if (typeof exports == "object" && typeof module == "object"){ // CommonJS
mod(require("codemirror/lib/codemirror")
mod(require("codemirror/lib/codemirror"),
require("codemirror/mode/python/python")
);
} else if (typeof define == "function" && define.amd){ // AMD
define(["codemirror/lib/codemirror"], mod);
define(["codemirror/lib/codemirror",
"codemirror/mode/python/python"], mod);
} else {// Plain browser env
mod(CodeMirror);
}
})(function(CodeMirror) {
"use strict";
requirejs(['codemirror/mode/python/python'], function () {
CodeMirror.defineMode("ipython", function(conf, parserConf) {
var pythonConf = {};
for (var prop in parserConf) {
if (parserConf.hasOwnProperty(prop)) {
pythonConf[prop] = parserConf[prop];
}
CodeMirror.defineMode("ipython", function(conf, parserConf) {
var pythonConf = {};
for (var prop in parserConf) {
if (parserConf.hasOwnProperty(prop)) {
pythonConf[prop] = parserConf[prop];
}
pythonConf.name = 'python';
pythonConf.singleOperators = new RegExp("^[\\+\\-\\*/%&|@\\^~<>!\\?]");
if (pythonConf.version === 3) {
pythonConf.identifiers = new RegExp("^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*");
} else if (pythonConf.version === 2) {
pythonConf.identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*");
}
return CodeMirror.getMode(conf, pythonConf);
}, 'python');
CodeMirror.defineMIME("text/x-ipython", "ipython");
}
pythonConf.name = 'python';
pythonConf.singleOperators = new RegExp("^[\\+\\-\\*/%&|@\\^~<>!\\?]");
if (pythonConf.version === 3) {
pythonConf.identifiers = new RegExp("^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*");
} else if (pythonConf.version === 2) {
pythonConf.identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*");
}
return CodeMirror.getMode(conf, pythonConf);
}, 'python');
});
CodeMirror.defineMIME("text/x-ipython", "ipython");
})

@ -10,9 +10,15 @@
(function(mod) {
if (typeof exports == "object" && typeof module == "object"){ // CommonJS
mod(require("codemirror/lib/codemirror")
,require("codemirror/addon/mode/multiplex")
,require("codemirror/mode/gfm/gfm")
,require("codemirror/mode/stex/stex")
);
} else if (typeof define == "function" && define.amd){ // AMD
define(["codemirror/lib/codemirror"
,"codemirror/addon/mode/multiplex"
,"codemirror/mode/python/python"
,"codemirror/mode/stex/stex"
], mod);
} else {// Plain browser env
mod(CodeMirror);
@ -20,51 +26,37 @@
})( function(CodeMirror){
"use strict";
requirejs(["codemirror/addon/mode/multiplex", "codemirror/mode/gfm/gfm", "codemirror/mode/stex/stex"], function () {
CodeMirror.defineMode("ipythongfm", function(config, parserConfig) {
var gfm_mode = CodeMirror.getMode(config, "gfm");
var tex_mode = CodeMirror.getMode(config, "stex");
return CodeMirror.multiplexingMode(
gfm_mode,
{
open: "$", close: "$",
mode: tex_mode,
delimStyle: "delimit"
},
{
// not sure this works as $$ is interpreted at (opening $, closing $, as defined just above)
open: "$$", close: "$$",
mode: tex_mode,
delimStyle: "delimit"
},
{
open: "\\(", close: "\\)",
mode: tex_mode,
delimStyle: "delimit"
},
{
open: "\\[", close: "\\]",
mode: tex_mode,
delimStyle: "delimit"
}
// .. more multiplexed styles can follow here
);
}, 'gfm');
CodeMirror.defineMIME("text/x-ipythongfm", "ipythongfm");
CodeMirror.defineMode("ipythongfm", function(config, parserConfig) {
var gfm_mode = CodeMirror.getMode(config, "gfm");
var tex_mode = CodeMirror.getMode(config, "stex");
return CodeMirror.multiplexingMode(
gfm_mode,
{
open: "$", close: "$",
mode: tex_mode,
delimStyle: "delimit"
},
{
// not sure this works as $$ is interpreted at (opening $, closing $, as defined just above)
open: "$$", close: "$$",
mode: tex_mode,
delimStyle: "delimit"
},
{
open: "\\(", close: "\\)",
mode: tex_mode,
delimStyle: "delimit"
},
{
open: "\\[", close: "\\]",
mode: tex_mode,
delimStyle: "delimit"
}
// .. more multiplexed styles can follow here
);
}, 'gfm');
// async workaround:
// Cells may be loaded before this mode is defined.
// If that happens, trigger re-load of the mode:
if (Jupyter && Jupyter.notebook) {
Jupyter.notebook.get_cells().map(function (cell) {
if (cell.code_mirror && cell.code_mirror.getOption('mode') === 'ipythongfm') {
cell.code_mirror.setOption('mode', 'ipythongfm');
}
});
}
});
});
CodeMirror.defineMIME("text/x-ipythongfm", "ipythongfm");
})

@ -4,6 +4,7 @@
define(function(require){
"use strict";
var $ = require('jquery');
var QH = require("notebook/js/quickhelp");
/**

@ -2,11 +2,12 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/utils',
'base/js/keyboard',
'notebook/js/contexthint',
'codemirror/lib/codemirror',
], function(utils, keyboard, CodeMirror) {
], function($, utils, keyboard, CodeMirror) {
"use strict";
// easier key mapping

@ -2,10 +2,11 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/namespace',
'base/js/dialog',
'base/js/utils'
], function(IPython, dialog, utils) {
], function($, IPython, dialog, utils) {
"use strict";
var KernelSelector = function(selector, notebook) {

@ -9,9 +9,10 @@
*/
define([
'jquery',
'base/js/utils',
'base/js/keyboard',
], function(utils, keyboard) {
], function($, utils, keyboard) {
"use strict";
// Main keyboard manager for the notebook

@ -1,6 +1,5 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
__webpack_public_path__ = window['staticURL'] + 'notebook/js/built/';
// adapted from Mozilla Developer Network example at
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind
@ -23,8 +22,8 @@ Function.prototype.bind = Function.prototype.bind || bind ;
requirejs(['contents'], function(contentsModule) {
require([
'base/js/namespace',
'jquery',
'base/js/namespace',
'notebook/js/notebook',
'services/config',
'base/js/utils',
@ -45,8 +44,8 @@ require([
'notebook/js/searchandreplace',
'notebook/js/clipboard'
], function(
IPython,
$,
IPython,
notebook,
configmod,
utils,

@ -2,10 +2,11 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'require',
'./toolbar',
'./celltoolbar'
], function(require, toolbar, celltoolbar) {
], function($, require, toolbar, celltoolbar) {
"use strict";
var MainToolBar = function (selector, options) {

@ -2,9 +2,10 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/utils',
'base/js/dialog',
], function(utils, dialog) {
], function($, utils, dialog) {
"use strict";
var init = function () {

@ -2,13 +2,14 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/namespace',
'base/js/dialog',
'base/js/utils',
'./celltoolbar',
'./tour',
'moment',
], function(IPython, dialog, utils, celltoolbar, tour, moment) {
], function($, IPython, dialog, utils, celltoolbar, tour, moment) {
"use strict";
var MenuBar = function (selector, options) {

@ -5,30 +5,61 @@
* @module notebook
*/
"use strict";
import IPython from 'base/js/namespace';
import _ from 'underscore';
import utils from 'base/js/utils';
import dialog from 'base/js/dialog';
import cellmod from 'notebook/js/cell';
import textcell from 'notebook/js/textcell';
import codecell from 'notebook/js/codecell';
import moment from 'moment';
import configmod from 'services/config';
import session from 'services/sessions/session';
import celltoolbar from 'notebook/js/celltoolbar';
import marked from 'components/marked/lib/marked';
import CodeMirror from 'codemirror/lib/codemirror';
import runMode from 'codemirror/addon/runmode/runmode';
import mathjaxutils from 'notebook/js/mathjaxutils';
import keyboard from 'base/js/keyboard';
import tooltip from 'notebook/js/tooltip';
import default_celltoolbar from 'notebook/js/celltoolbarpresets/default';
import rawcell_celltoolbar from 'notebook/js/celltoolbarpresets/rawcell';
import slideshow_celltoolbar from 'notebook/js/celltoolbarpresets/slideshow';
import attachments_celltoolbar from 'notebook/js/celltoolbarpresets/attachments';
import scrollmanager from 'notebook/js/scrollmanager';
import commandpalette from 'notebook/js/commandpalette';
import {ShortcutEditor} from 'notebook/js/shortcuteditor';
define([
'jquery',
'base/js/namespace',
'underscore',
'base/js/utils',
'base/js/dialog',
'./cell',
'./textcell',
'./codecell',
'moment',
'services/config',
'services/sessions/session',
'./celltoolbar',
'components/marked/lib/marked',
'codemirror/lib/codemirror',
'codemirror/addon/runmode/runmode',
'./mathjaxutils',
'base/js/keyboard',
'./tooltip',
'./celltoolbarpresets/default',
'./celltoolbarpresets/rawcell',
'./celltoolbarpresets/slideshow',
'./celltoolbarpresets/attachments',
'./scrollmanager',
'./commandpalette',
// FIXME: shortcut-editor uses preact,
// which doesn't boewr install
// 'notebook/js/shortcuteditor',
], function (
$,
IPython,
_,
utils,
dialog,
cellmod,
textcell,
codecell,
moment,
configmod,
session,
celltoolbar,
marked,
CodeMirror,
runMode,
mathjaxutils,
keyboard,
tooltip,
default_celltoolbar,
rawcell_celltoolbar,
slideshow_celltoolbar,
attachments_celltoolbar,
scrollmanager,
commandpalette
// ShortcutEditor
) {
var _SOFT_SELECTION_CLASS = 'jupyter-soft-selected';
@ -50,7 +81,7 @@ import {ShortcutEditor} from 'notebook/js/shortcuteditor';
* @param {string} options.notebook_path
* @param {string} options.notebook_name
*/
export function Notebook(selector, options) {
function Notebook(selector, options) {
this.config = options.config;
this.class_config = new configmod.ConfigWithDefaults(this.config,
Notebook.options_default, 'Notebook');
@ -411,7 +442,8 @@ import {ShortcutEditor} from 'notebook/js/shortcuteditor';
};
Notebook.prototype.show_shortcuts_editor = function() {
new ShortcutEditor(this);
// FIXME: ShortcutEditor disabled for now
// new ShortcutEditor(this);
};
/**
@ -3231,3 +3263,6 @@ import {ShortcutEditor} from 'notebook/js/shortcuteditor';
this.events.trigger('checkpoint_deleted.Notebook');
this.load_notebook(this.notebook_path);
};
return {Notebook: Notebook};
})

@ -1,9 +1,10 @@
define([
'jquery',
'base/js/utils',
'base/js/dialog',
'base/js/notificationarea',
'moment'
], function(utils, dialog, notificationarea, moment) {
], function($, utils, dialog, notificationarea, moment) {
"use strict";
var NotificationArea = notificationarea.NotificationArea;

@ -2,13 +2,14 @@
// Distributed under the terms of the Modified BSD License.
// jshint esnext: true
define([
'jquery',
'base/js/utils',
'base/js/security',
'base/js/keyboard',
'services/config',
'notebook/js/mathjaxutils',
'components/marked/lib/marked',
], function(utils, security, keyboard, configmod, mathjaxutils, marked) {
], function($, utils, security, keyboard, configmod, mathjaxutils, marked) {
"use strict";
/**

@ -2,8 +2,10 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/utils',
], function(utils) {
'jquery-ui'
], function($, utils) {
"use strict";
var Pager = function (pager_selector, options) {

@ -2,10 +2,11 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/utils',
'base/js/dialog',
'underscore'
], function(utils, dialog, _) {
], function($, utils, dialog, _) {
"use strict";
var platform = utils.platform;
@ -267,7 +268,7 @@ define([
QuickHelp.prototype.build_edit_help = function (cm_shortcuts) {
var edit_shortcuts = this.keyboard_manager.edit_shortcuts.help();
edit_shortcuts = jQuery.merge(jQuery.merge([], cm_shortcuts), edit_shortcuts);
edit_shortcuts = $.merge($.merge([], cm_shortcuts), edit_shortcuts);
return build_div('<h4>Edit Mode (press <kbd>Enter</kbd> to enable)</h4>', edit_shortcuts);
};

@ -2,11 +2,12 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/utils',
'base/js/dialog',
'base/js/keyboard',
'moment',
], function(utils, dialog, keyboard, moment) {
], function($, utils, dialog, keyboard, moment) {
"use strict";
var SaveWidget = function (selector, options) {

@ -1,6 +1,6 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
define([], function() {
define(['jquery'], function($) {
"use strict";
var ScrollManager = function(notebook, options) {

@ -1,6 +1,7 @@
define(function(require){
"use strict";
var $ = require('jquery');
var dialog = require('base/js/dialog');
/**

@ -1,12 +1,23 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
"notebook/js/quickhelp",
"base/js/dialog",
"preact",
"preact-compat",
'components/marked/lib/marked',
], function (
$,
QH,
dialog,
preact,
preact_compat,
marked
) {
var createClass = preact_compat.createClass;
import QH from "notebook/js/quickhelp";
import dialog from "base/js/dialog";
import {render} from "preact";
import {createElement, createClass} from "preact-compat";
import marked from 'components/marked/lib/marked';
/**
* Humanize the action name to be consumed by user.
@ -14,7 +25,7 @@ import marked from 'components/marked/lib/marked';
* <namespace>:<description-with-dashes>
* we drop <namespace> and replace dashes for space.
*/
const humanize_action_id = function(str) {
var humanize_action_id = function(str) {
return str.split(':')[1].replace(/-/g, ' ').replace(/_/g, '-');
};
@ -24,7 +35,7 @@ const humanize_action_id = function(str) {
* Wether an action have a keybinding or not.
**/
const KeyBinding = createClass({
var KeyBinding = createClass({
displayName: 'KeyBindings',
getInitialState: function() {
return {shrt:''};
@ -33,12 +44,12 @@ const KeyBinding = createClass({
this.setState({shrt:element.target.value});
},
render: function(){
const that = this;
const available = this.props.available(this.state.shrt);
const empty = (this.state.shrt === '');
var that = this;
var available = this.props.available(this.state.shrt);
var empty = (this.state.shrt === '');
return createElement('div', {className:'jupyter-keybindings'},
createElement('i', {className: "pull-right fa fa-plus", alt: 'add-keyboard-shortcut',
onClick:()=>{
onClick: function () {
available?that.props.onAddBindings(that.state.shrt, that.props.ckey):null;
that.state.shrt='';
}
@ -50,12 +61,12 @@ const KeyBinding = createClass({
value:this.state.shrt,
onChange:this.handleShrtChange
}),
this.props.shortcuts?this.props.shortcuts.map((item, index) => {
this.props.shortcuts?this.props.shortcuts.map(function (item, index) {
return createElement('span', {className: 'pull-right'},
createElement('kbd', {}, [
item.h,
createElement('i', {className: "fa fa-times", alt: 'remove '+item.h,
onClick:()=>{
onClick:function () {
that.props.unbind(item.raw);
}
})
@ -67,7 +78,7 @@ const KeyBinding = createClass({
}
});
const KeyBindingList = createClass({
var KeyBindingList = createClass({
displayName: 'KeyBindingList',
getInitialState: function(){
return {data:[]};
@ -76,13 +87,14 @@ const KeyBindingList = createClass({
this.setState({data:this.props.callback()});
},
render: function() {
const childrens = this.state.data.map((binding)=>{
return createElement(KeyBinding, Object.assign({}, binding, {onAddBindings:(shortcut, action)=>{
var childrens = this.state.data.map(function (binding) {
return createElement(KeyBinding, Object.assign({}, binding, {
onAddBindings: function (shortcut, action) {
this.props.bind(shortcut, action);
this.setState({data:this.props.callback()});
},
available:this.props.available,
unbind: (shortcut) => {
available:this.props.available,
unbind: function (shortcut) {
this.props.unbind(shortcut);
this.setState({data:this.props.callback()});
}
@ -109,18 +121,18 @@ const KeyBindingList = createClass({
}
});
const get_shortcuts_data = function(notebook) {
const actions = Object.keys(notebook.keyboard_manager.actions._actions);
const src = [];
var get_shortcuts_data = function(notebook) {
var actions = Object.keys(notebook.keyboard_manager.actions._actions);
var src = [];
for (let i = 0; i < actions.length; i++) {
const action_id = actions[i];
const action = notebook.keyboard_manager.actions.get(action_id);
var action_id = actions[i];
var action = notebook.keyboard_manager.actions.get(action_id);
let shortcuts = notebook.keyboard_manager.command_shortcuts.get_action_shortcuts(action_id);
let hshortcuts;
if (shortcuts.length > 0) {
hshortcuts = shortcuts.map((raw)=>{
hshortcuts = shortcuts.map(function (raw) {
return {h:QH._humanize_sequence(raw),raw:raw};}
);
}
@ -135,14 +147,14 @@ const get_shortcuts_data = function(notebook) {
};
export const ShortcutEditor = function(notebook) {
var ShortcutEditor = function(notebook) {
if(!notebook){
throw new Error("CommandPalette takes a notebook non-null mandatory arguement");
}
const body = $('<div>');
const mod = dialog.modal({
var body = $('<div>');
var mod = dialog.modal({
notebook: notebook,
keyboard_manager: notebook.keyboard_manager,
title : "Edit Command mode Shortcuts",
@ -152,22 +164,24 @@ export const ShortcutEditor = function(notebook) {
}
});
const src = get_shortcuts_data(notebook);
var src = get_shortcuts_data(notebook);
mod.addClass("modal_stretch");
mod.modal('show');
render(
createElement(KeyBindingList, {
callback:()=>{ return get_shortcuts_data(notebook);},
bind: (shortcut, command) => {
callback:function () { return get_shortcuts_data(notebook);},
bind: function (shortcut, command) {
return notebook.keyboard_manager.command_shortcuts._persist_shortcut(shortcut, command);
},
unbind: (shortcut) => {
unbind: function (shortcut) {
return notebook.keyboard_manager.command_shortcuts._persist_remove_shortcut(shortcut);
},
available: (shrt) => { return notebook.keyboard_manager.command_shortcuts.is_available_shortcut(shrt);}
available: function (shrt) { return notebook.keyboard_manager.command_shortcuts.is_available_shortcut(shrt);}
}),
body.get(0)
);
};
return {ShortcutEditor};
})

@ -2,6 +2,7 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/utils',
'notebook/js/cell',
'base/js/security',
@ -13,6 +14,7 @@ define([
'codemirror/mode/gfm/gfm',
'notebook/js/codemirror-ipythongfm'
], function(
$,
utils,
cell,
security,

@ -1,7 +1,7 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
define([], function() {
define(['jquery'], function($) {
"use strict";
/**

@ -2,8 +2,9 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/utils',
], function(utils) {
], function($, utils) {
"use strict";
// tooltip constructor

@ -1,7 +1,7 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
define([], function() {
define(['jquery', 'bootstraptour'], function($, Tour) {
"use strict";
var tour_style = "<div class='popover tour'>\n" +

@ -1,10 +1,10 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
__webpack_public_path__ = window['staticURL'] + 'services/built/';
define(function(require) {
"use strict";
var $ = require('jquery');
var utils = require('base/js/utils');
var Contents = function(options) {

@ -2,8 +2,9 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/utils',
], function(utils) {
], function($, utils) {
"use strict";
//-----------------------------------------------------------------------

@ -2,11 +2,12 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/utils',
'./comm',
'./serialize',
'base/js/events'
], function(utils, comm, serialize, events) {
], function($, utils, comm, serialize, events) {
"use strict";
/**

@ -2,9 +2,10 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/utils',
'services/kernels/kernel',
], function(utils, kernel) {
], function($, utils, kernel) {
"use strict";
/**

@ -1,15 +1,15 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
__webpack_public_path__ = window['staticURL'] + 'terminal/js/built/';
require('xterm/src/xterm.css');
require([
'jquery',
'base/js/utils',
'base/js/page',
'auth/js/loginwidget',
'services/config',
'terminal/js/terminado',
], function(
$,
utils,
page,
loginwidget,

@ -2,9 +2,10 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/namespace',
'tree/js/notebooklist',
], function(IPython, notebooklist) {
], function($, IPython, notebooklist) {
"use strict";
var KernelList = function (selector, options) {

@ -1,6 +1,5 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
__webpack_public_path__ = window['staticURL'] + 'tree/js/built/';
// adapted from Mozilla Developer Network example at
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind
@ -23,6 +22,7 @@ Function.prototype.bind = Function.prototype.bind || bind ;
requirejs(['contents'], function(contents_service) {
require([
'jquery',
'base/js/namespace',
'base/js/dialog',
'base/js/events',
@ -36,6 +36,7 @@ require([
'tree/js/newnotebook',
'auth/js/loginwidget',
], function(
$,
IPython,
dialog,
events,

@ -2,10 +2,11 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/namespace',
'base/js/utils',
'base/js/dialog',
], function (IPython, utils, dialog) {
], function ($, IPython, utils, dialog) {
"use strict";
var NewNotebookWidget = function (selector, options) {

@ -2,13 +2,14 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/namespace',
'base/js/utils',
'base/js/dialog',
'base/js/events',
'base/js/keyboard',
'moment'
], function(IPython, utils, dialog, events, keyboard, moment) {
], function($, IPython, utils, dialog, events, keyboard, moment) {
"use strict";
var NotebookList = function (selector, options) {

@ -2,8 +2,9 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/utils',
], function(utils) {
], function($, utils) {
"use strict";
var SesssionList = function (options) {

@ -2,10 +2,11 @@
// Distributed under the terms of the Modified BSD License.
define([
'jquery',
'base/js/namespace',
'base/js/utils',
'tree/js/notebooklist',
], function(IPython, utils, notebooklist) {
], function($, IPython, utils, notebooklist) {
"use strict";
var TerminalList = function (selector, options) {

@ -97,5 +97,5 @@ data-file-path="{{file_path}}"
{{super()}}
<script src="{{ static_url("edit/js/built/main.min.js") }}" type="text/javascript" charset="utf-8"></script>
<script src="{{ static_url("edit/js/main.min.js") }}" type="text/javascript" charset="utf-8"></script>
{% endblock %}

@ -358,6 +358,6 @@ data-notebook-path="{{notebook_path | urlencode}}"
<script src="{{ static_url("components/text-encoding/lib/encoding.js") }}" charset="utf-8"></script>
<script src="{{ static_url("notebook/js/built/main.min.js") }}" type="text/javascript" charset="utf-8"></script>
<script src="{{ static_url("notebook/js/main.min.js") }}" type="text/javascript" charset="utf-8"></script>
{% endblock %}

@ -5,58 +5,45 @@
<meta charset="utf-8">
<title>{% block title %}Jupyter Notebook{% endblock %}</title>
{% block favicon %}<link id="favicon" rel="shortcut icon" type="image/x-icon" href="{{static_url("base/images/favicon.ico") }}">{% endblock %}
{% block favicon %}<link rel="shortcut icon" type="image/x-icon" href="{{static_url("base/images/favicon.ico") }}">{% endblock %}
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" href="{{static_url("components/jquery-ui/themes/smoothness/jquery-ui.min.css") }}" type="text/css" />
<link rel="stylesheet" href="{{static_url("components/jquery-typeahead/dist/jquery.typeahead.min.css") }}" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% block stylesheet %}
<link rel="stylesheet" href="{{ static_url("style/style.min.css") }}" type="text/css"/>
{% endblock %}
<link rel="stylesheet" href="{{ base_url }}custom/custom.css" type="text/css" />
<script src="{{static_url("components/jquery/jquery.min.js") }}" type="text/javascript" charset="utf-8"></script> <!-- window.$ -->
<script src="{{static_url("components/jquery-ui/ui/minified/jquery-ui.min.js") }}" type="text/javascript" charset="utf-8"></script> <!-- extends window.$ -->
<script src="{{static_url("components/bootstrap/js/bootstrap.min.js") }}" type="text/javascript" charset="utf-8"></script> <!-- extends window.$ -->
<script src="{{static_url("components/bootstrap-tour/build/js/bootstrap-tour.min.js") }}" type="text/javascript" charset="utf-8"></script> <!-- window.Tour -->
<script src="{{static_url("components/jquery-typeahead/dist/jquery.typeahead.min.js") }}" type="text/javascript" charset="utf-8"></script> <!-- extends window.$ -->
<script src="{{static_url("components/codemirror/lib/codemirror.js") }}" type="text/javascript" charset="utf-8"></script>
<script src="{{static_url("components/codemirror/mode/meta.js") }}" type="text/javascript" charset="utf-8"></script>
<script src="{{static_url("components/es6-promise/promise.min.js")}}" type="text/javascript" charset="utf-8"></script>
<script src="{{static_url("components/requirejs/require.js") }}" type="text/javascript" charset="utf-8"></script>
<script>
window['staticURL'] = "{{static_url("", include_version=False)}}";
require.config({
{% if version_hash %}
urlArgs: "v={{version_hash}}",
{% endif %}
baseUrl: '{{static_url("", include_version=False)}}',
paths: {
'auth/js/main': 'auth/js/built/main.min',
'auth/js/main': 'auth/js/main.min',
custom : '{{ base_url }}custom',
nbextensions : '{{ base_url }}nbextensions',
kernelspecs : '{{ base_url }}kernelspecs',
underscore : 'components/underscore/underscore-min',
backbone : 'components/backbone/backbone-min',
jquery: 'components/jquery/jquery.min',
bootstrap: 'components/bootstrap/js/bootstrap.min',
bootstraptour: 'components/bootstrap-tour/build/js/bootstrap-tour.min',
'jquery-ui': 'components/jquery-ui/ui/minified/jquery-ui.min',
moment: 'components/moment/moment',
codemirror: 'components/codemirror',
// Define aliases for requirejs webpack imports
notebook: 'built/index',
// Anything jQuery related is loaded globally because it will
// pollute the global object regardless and we want to avoid one
// jQuery thinger from clompering another.
jquery: 'base/js/jquery',
bootstrap: 'base/js/jquery',
bootstraptour: 'base/js/tour',
'jquery-ui': 'base/js/jquery',
jqueryui: 'base/js/jquery',
typeahead: 'base/js/typeahead'
},
map: { // for backward compatibility
"*": {
"jqueryui": "jquery-ui",
}
termjs: 'components/xterm.js/dist/xterm',
typeahead: 'components/jquery-typeahead/dist/jquery.typeahead.min',
},
map: { // for backward compatibility
"*": {
"jqueryui": "jquery-ui",
}
},
shim: {
typeahead: {
deps: ["jquery"],
@ -83,75 +70,6 @@
}
},
waitSeconds: 30,
// TODO: Remove me in notebook version 6.0
bundles: {
'deprecated-imports': [
'edit/js/savewidget',
'edit/js/main',
'edit/js/menubar',
'edit/js/editor',
'edit/js/notificationarea',
'base/js/keyboard',
'base/js/dialog',
'base/js/notificationwidget',
'base/js/namespace',
'base/js/utils',
'base/js/notificationarea',
'base/js/events',
'base/js/security',
'base/js/page',
'auth/js/main',
'auth/js/logoutmain',
'auth/js/loginmain',
'auth/js/loginwidget',
'terminal/js/main',
'terminal/js/terminado',
'notebook/js/toolbar',
'notebook/js/savewidget',
'notebook/js/main',
'notebook/js/completer',
'notebook/js/contexthint',
'notebook/js/textcell',
'notebook/js/cell',
'notebook/js/tour',
'notebook/js/menubar',
'notebook/js/mathjaxutils',
'notebook/js/codecell',
'notebook/js/codemirror-ipython',
'notebook/js/kernelselector',
'notebook/js/codemirror-ipythongfm',
'notebook/js/celltoolbarpresets/example',
'notebook/js/celltoolbarpresets/default',
'notebook/js/celltoolbarpresets/slideshow',
'notebook/js/celltoolbarpresets/rawcell',
'notebook/js/tooltip',
'notebook/js/maintoolbar',
'notebook/js/about',
'notebook/js/notificationarea',
'notebook/js/quickhelp',
'notebook/js/actions',
'notebook/js/pager',
'notebook/js/searchandreplace',
'notebook/js/keyboardmanager',
'notebook/js/notebook',
'notebook/js/scrollmanager',
'notebook/js/outputarea',
'notebook/js/celltoolbar',
'notebook/js/commandpalette',
'tree/js/sessionlist',
'tree/js/main',
'tree/js/kernellist',
'tree/js/newnotebook',
'tree/js/terminallist',
'tree/js/notebooklist',
'services/sessions/session',
'services/contents',
'services/kernels/serialize',
'services/kernels/comm',
'services/kernels/kernel',
'services/config'
]
}
});
require.config({
@ -159,37 +77,20 @@
'*':{
'contents': '{{ contents_js_source }}',
}
},
});
define("bootstrap", function () {
return window.$;
});
define("jquery", function () {
return window.$;
});
define("jqueryui", function () {
return window.$;
});
define("jquery-ui", function () {
return window.$;
});
define("codemirror/lib/codemirror", function () {
return window.CodeMirror;
});
define("codemirror/mode/meta", function () {
return window.CodeMirror;
});
define("CodeMirror", function () {
return window.CodeMirror;
}
});
// error-catching custom.js shim.
define("custom", function (require, exports, module) {
try {
var custom = require('custom/custom');
console.debug('loaded custom.js');
return custom;
} catch (e) {
console.error("error loading custom.js", e);
return {};
}
})
</script>
{% block meta %}
@ -197,7 +98,13 @@
</head>
<body class="{% block bodyclasses %}{% endblock %}" {% block params %}{% endblock %}>
<body class="{% block bodyclasses %}{% endblock %}"
{% block params %}
{% if logged_in and token %}
data-jupyter-api-token="{{token | urlencode}}"
{% endif %}
{% endblock params %}
>
<noscript>
<div id='noscript'>
@ -211,7 +118,7 @@
<div id="ipython_notebook" class="nav navbar-brand pull-left"><a href="{{default_url}}" title='dashboard'>{% block logo %}<img src='{{static_url("base/images/logo.png") }}' alt='Jupyter Notebook'/>{% endblock %}</a></div>
{% block header_buttons %}
{% block login_widget %}
<span id="login_widget">

@ -61,5 +61,5 @@ data-ws-path="{{ws_path}}"
{{super()}}
<script src="{{ static_url("terminal/js/built/main.min.js") }}" type="text/javascript" charset="utf-8"></script>
<script src="{{ static_url("terminal/js/main.min.js") }}" type="text/javascript" charset="utf-8"></script>
{% endblock %}

@ -181,5 +181,5 @@ data-terminals-available="{{terminals_available}}"
{{super()}}
<script src="{{ static_url("tree/js/built/main.min.js") }}" type="text/javascript" charset="utf-8"></script>
<script src="{{ static_url("tree/js/main.min.js") }}" type="text/javascript" charset="utf-8"></script>
{% endblock %}

Loading…
Cancel
Save