You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
monkeyking/notebook/static-src/base/js/namespace.js

91 lines
3.0 KiB

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
"use strict";
var Jupyter = window.Jupyter || {};
var jprop = function(name, module_path) {
requirejs([module_path], function(loaded) {
if (!Jupyter.hasOwnProperty(name)) {
Object.defineProperty(Jupyter, name, {
get: function() {
console.warn('accessing `'+name+'` is deprecated. Use `require("'+module_path+'")`');
return loaded;
},
enumerable: true,
configurable: false
});
}
});
};
var jglobal = function(name, module_path){
requirejs([module_path], function(loaded) {
if (!Jupyter.hasOwnProperty(name)) {
Object.defineProperty(Jupyter, name, {
get: function() {
console.warn('accessing `'+name+'` is deprecated. Use `require("'+module_path+'").'+name+'`');
return loaded[name];
},
enumerable: true,
configurable: false
});
}
});
}
// expose modules
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
jglobal('CommManager','services/kernels/comm');
jglobal('Comm','services/kernels/comm');
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
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
jglobal('SessionList','tree/js/sessionlist');
Jupyter.version = "4.1.0.dev";
Jupyter._target = '_blank';
module.exports = Jupyter;
window.Jupyter = Jupyter;
// deprecated since 4.0, remove in 5+
window.IPython = Jupyter;