mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-18 11:55:46 +08:00
Merge pull request #102 from Carreau/no-global
Start working on removing global JS IPython
This commit is contained in:
commit
5c18ecb151
@ -11,7 +11,7 @@
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Starting with IPython 2.0 keyboard shortcuts in command and edit mode are fully customizable. These customizations are made using the IPython JavaScript API. Here is an example that makes the `r` key available for running a cell:"
|
||||
"Starting with IPython 2.0 keyboard shortcuts in command and edit mode are fully customizable. These customizations are made using the Jupyter JavaScript API. Here is an example that makes the `r` key available for running a cell:"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -24,7 +24,7 @@
|
||||
"source": [
|
||||
"%%javascript\n",
|
||||
"\n",
|
||||
"IPython.keyboard_manager.command_shortcuts.add_shortcut('r', {\n",
|
||||
"Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', {\n",
|
||||
" help : 'run cell',\n",
|
||||
" help_index : 'zz',\n",
|
||||
" handler : function (event) {\n",
|
||||
@ -34,6 +34,13 @@
|
||||
");"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\"By default the keypress `r`, while in command mode, changes the type of the selected cell to `raw`. This shortcut is overridden by the code in the previous cell, and thus the action no longer be available via the keypress `r`.\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
@ -55,7 +62,7 @@
|
||||
"source": [
|
||||
"%%javascript\n",
|
||||
"\n",
|
||||
"IPython.keyboard_manager.command_shortcuts.add_shortcut('r', function (event) {\n",
|
||||
"Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', function (event) {\n",
|
||||
" IPython.notebook.execute_cell();\n",
|
||||
" return false;\n",
|
||||
"});"
|
||||
@ -78,14 +85,36 @@
|
||||
"source": [
|
||||
"%%javascript\n",
|
||||
"\n",
|
||||
"IPython.keyboard_manager.command_shortcuts.remove_shortcut('r');"
|
||||
"Jupyter.keyboard_manager.command_shortcuts.remove_shortcut('r');"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"If you want your keyboard shortcuts to be active for all of your notebooks, put the above API calls into your `<profile>/static/custom/custom.js` file."
|
||||
"If you want your keyboard shortcuts to be active for all of your notebooks, put the above API calls into your `custom.js` file."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"source": [
|
||||
"Of course we provide name for majority of existing action so that you do not have to re-write everything, here is for example how to bind `r` back to it's initial behavior:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"%%javascript\n",
|
||||
"\n",
|
||||
"Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', 'ipython.change-selected-cell-to-raw-cell');"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@ -2,10 +2,9 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'base/js/utils',
|
||||
'jquery',
|
||||
], function(IPython, utils, $){
|
||||
], function(utils, $){
|
||||
"use strict";
|
||||
|
||||
var LoginWidget = function (selector, options) {
|
||||
@ -19,7 +18,6 @@ define([
|
||||
};
|
||||
|
||||
|
||||
|
||||
LoginWidget.prototype.bind_events = function () {
|
||||
var that = this;
|
||||
this.element.find("button#logout").click(function () {
|
||||
@ -36,8 +34,5 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
// Set module variables
|
||||
IPython.LoginWidget = LoginWidget;
|
||||
|
||||
return {'LoginWidget': LoginWidget};
|
||||
});
|
||||
|
@ -5,7 +5,6 @@ define(function(require) {
|
||||
"use strict";
|
||||
|
||||
var CodeMirror = require('codemirror/lib/codemirror');
|
||||
var IPython = require('base/js/namespace');
|
||||
var $ = require('jquery');
|
||||
|
||||
/**
|
||||
@ -205,8 +204,5 @@ define(function(require) {
|
||||
edit_metadata : edit_metadata,
|
||||
};
|
||||
|
||||
// Backwards compatability.
|
||||
IPython.dialog = dialog;
|
||||
|
||||
return dialog;
|
||||
});
|
||||
|
@ -9,11 +9,10 @@
|
||||
*/
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'base/js/utils',
|
||||
'underscore',
|
||||
], function(IPython, $, utils, _) {
|
||||
], function($, utils, _) {
|
||||
"use strict";
|
||||
|
||||
|
||||
@ -447,8 +446,5 @@ define([
|
||||
event_to_shortcut : event_to_shortcut,
|
||||
};
|
||||
|
||||
// For backwards compatibility.
|
||||
IPython.keyboard = keyboard;
|
||||
|
||||
return keyboard;
|
||||
});
|
||||
|
@ -1,10 +1,84 @@
|
||||
// Copyright (c) Jupyter Development Team.
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
var IPython = IPython || {};
|
||||
define([], function(){
|
||||
|
||||
var Jupyter = Jupyter || {};
|
||||
|
||||
var jprop = function(name, module_path){
|
||||
Object.defineProperty(Jupyter, name, {
|
||||
get: function() {
|
||||
console.warn('accessing `'+name+'` is deprecated. Use `require("'+module_path+'")`');
|
||||
return require(module_path);
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: false
|
||||
});
|
||||
}
|
||||
|
||||
var jglobal = function(name, module_path){
|
||||
Object.defineProperty(Jupyter, name, {
|
||||
get: function() {
|
||||
console.warn('accessing `'+name+'` is deprecated. Use `require("'+module_path+'").'+name+'`');
|
||||
return require(module_path)[name];
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: false
|
||||
});
|
||||
}
|
||||
|
||||
define(function(){
|
||||
"use strict";
|
||||
IPython.version = "4.0.0.dev";
|
||||
IPython._target = '_blank';
|
||||
return IPython;
|
||||
|
||||
// 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');
|
||||
jglobal('ClusterList','tree/js/clusterlist');
|
||||
jglobal('ClusterItem','tree/js/clusterlist');
|
||||
|
||||
Jupyter.version = "4.0.0.dev";
|
||||
Jupyter._target = '_blank';
|
||||
return Jupyter;
|
||||
});
|
||||
|
||||
// deprecated since 4.0, remove in 5+
|
||||
var IPython = Jupyter
|
||||
|
@ -2,9 +2,8 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
], function(IPython, $) {
|
||||
], function($) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
@ -167,8 +166,5 @@ define([
|
||||
return this.inner.html();
|
||||
};
|
||||
|
||||
// For backwards compatibility.
|
||||
IPython.NotificationWidget = NotificationWidget;
|
||||
|
||||
return {'NotificationWidget': NotificationWidget};
|
||||
});
|
||||
|
@ -2,10 +2,9 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'base/js/events',
|
||||
], function(IPython, $, events){
|
||||
], function($, events){
|
||||
"use strict";
|
||||
|
||||
var Page = function () {
|
||||
@ -59,7 +58,5 @@ define([
|
||||
$('div#site').height($(window).height() - $('#header').height());
|
||||
};
|
||||
|
||||
// Register self in the global namespace for convenience.
|
||||
IPython.Page = Page;
|
||||
return {'Page': Page};
|
||||
});
|
||||
|
@ -2,10 +2,9 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'components/google-caja/html-css-sanitizer-minified',
|
||||
], function(IPython, $) {
|
||||
], function($, sanitize) {
|
||||
"use strict";
|
||||
|
||||
var noop = function (x) { return x; };
|
||||
@ -123,7 +122,5 @@ define([
|
||||
sanitize_html: sanitize_html
|
||||
};
|
||||
|
||||
IPython.security = security;
|
||||
|
||||
return security;
|
||||
});
|
||||
|
@ -2,17 +2,16 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'codemirror/lib/codemirror',
|
||||
'moment',
|
||||
// silently upgrades CodeMirror
|
||||
'codemirror/mode/meta',
|
||||
], function(IPython, $, CodeMirror, moment){
|
||||
], function($, CodeMirror, moment){
|
||||
"use strict";
|
||||
|
||||
var load_extensions = function () {
|
||||
// load one or more IPython notebook extensions with requirejs
|
||||
// load one or more Jupyter notebook extensions with requirejs
|
||||
|
||||
var extensions = [];
|
||||
var extension_names = arguments;
|
||||
@ -39,8 +38,6 @@ define([
|
||||
);
|
||||
};
|
||||
|
||||
IPython.load_extensions = load_extensions;
|
||||
|
||||
/**
|
||||
* Wait for a config section to load, and then load the extensions specified
|
||||
* in a 'load_extensions' key inside it.
|
||||
@ -505,7 +502,7 @@ define([
|
||||
|
||||
var from_absolute_cursor_pos = function (cm, cursor_pos) {
|
||||
/**
|
||||
* turn absolute cursor postion into CodeMirror col, ch cursor
|
||||
* turn absolute cursor position into CodeMirror col, ch cursor
|
||||
*/
|
||||
var i, line, next_line;
|
||||
var offset = 0;
|
||||
@ -881,8 +878,5 @@ define([
|
||||
time: time,
|
||||
};
|
||||
|
||||
// Backwards compatability.
|
||||
IPython.utils = utils;
|
||||
|
||||
return utils;
|
||||
});
|
||||
|
@ -2,13 +2,12 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'base/js/utils',
|
||||
'base/js/dialog',
|
||||
'base/js/keyboard',
|
||||
'moment',
|
||||
], function(IPython, $, utils, dialog, keyboard, moment) {
|
||||
], function($, utils, dialog, keyboard, moment) {
|
||||
"use strict";
|
||||
|
||||
var SaveWidget = function (selector, options) {
|
||||
|
@ -9,7 +9,7 @@ require([
|
||||
'use strict';
|
||||
$('#notebook_about').click(function () {
|
||||
// use underscore template to auto html escape
|
||||
var text = 'You are using IPython notebook.<br/><br/>';
|
||||
var text = 'You are using Jupyter notebook.<br/><br/>';
|
||||
text = text + 'The version of the notebook server is ';
|
||||
text = text + _.template('<b><%- version %></b>')({ version: sys_info.ipython_version });
|
||||
if (sys_info.commit_hash) {
|
||||
@ -23,7 +23,7 @@ require([
|
||||
body.append($('<h4/>').text('Current Kernel Information:'));
|
||||
body.append(kinfo);
|
||||
dialog.modal({
|
||||
title: 'About IPython Notebook',
|
||||
title: 'About Jupyter Notebook',
|
||||
body: body,
|
||||
buttons: { 'OK': {} }
|
||||
});
|
||||
|
@ -10,7 +10,7 @@ define(function(require){
|
||||
};
|
||||
|
||||
/**
|
||||
* A bunch of predefined `Simple Actions` used by IPython.
|
||||
* A bunch of predefined `Simple Actions` used by Jupyter.
|
||||
* `Simple Actions` have the following keys:
|
||||
* help (optional): a short string the describe the action.
|
||||
* will be used in various context, like as menu name, tool tips on buttons,
|
||||
@ -29,7 +29,7 @@ define(function(require){
|
||||
* avoid conflict the prefix should be all lowercase and end with a dot `.`
|
||||
* in the absence of a prefix the behavior of the action is undefined.
|
||||
*
|
||||
* All action provided by IPython are prefixed with `ipython.`.
|
||||
* All action provided by Jupyter are prefixed with `ipython.`.
|
||||
*
|
||||
* One can register extra actions or replace an existing action with another one is possible
|
||||
* but is considered undefined behavior.
|
||||
@ -298,7 +298,7 @@ define(function(require){
|
||||
};
|
||||
|
||||
/**
|
||||
* A bunch of `Advance actions` for IPython.
|
||||
* A bunch of `Advance actions` for Jupyter.
|
||||
* Cf `Simple Action` plus the following properties.
|
||||
*
|
||||
* handler: first argument of the handler is the event that triggerd the action
|
||||
@ -412,7 +412,7 @@ define(function(require){
|
||||
return source[subkey].handler;
|
||||
};
|
||||
|
||||
// Will actually generate/register all the IPython actions
|
||||
// Will actually generate/register all the Jupyter actions
|
||||
var fun = function(){
|
||||
var final_actions = {};
|
||||
var k;
|
||||
|
@ -11,15 +11,13 @@
|
||||
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'base/js/utils',
|
||||
'codemirror/lib/codemirror',
|
||||
'codemirror/addon/edit/matchbrackets',
|
||||
'codemirror/addon/edit/closebrackets',
|
||||
'codemirror/addon/comment/comment'
|
||||
], function(IPython, $, utils, CodeMirror, cm_match, cm_closeb, cm_comment) {
|
||||
// TODO: remove IPython dependency here
|
||||
], function($, utils, CodeMirror, cm_match, cm_closeb, cm_comment) {
|
||||
"use strict";
|
||||
|
||||
var overlayHack = CodeMirror.scrollbarModel.native.prototype.overlayHack;
|
||||
@ -319,7 +317,7 @@ define([
|
||||
};
|
||||
|
||||
/**
|
||||
* Delegates keyboard shortcut handling to either IPython keyboard
|
||||
* Delegates keyboard shortcut handling to either Jupyter keyboard
|
||||
* manager when in command mode, or CodeMirror when in edit mode
|
||||
*
|
||||
* @method handle_keyevent
|
||||
@ -590,7 +588,7 @@ define([
|
||||
// On 3.0 and below, these things were regex.
|
||||
// But now should be string for json-able config.
|
||||
// We should get rid of assuming they might be already
|
||||
// in a later version of IPython.
|
||||
// in a later version of Jupyter.
|
||||
var re = regs[i];
|
||||
if(typeof(re) === 'string'){
|
||||
re = new RegExp(re)
|
||||
@ -710,9 +708,6 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
// Backwards compatibility.
|
||||
IPython.Cell = Cell;
|
||||
|
||||
return {
|
||||
Cell: Cell,
|
||||
UnrecognizedCell: UnrecognizedCell
|
||||
|
@ -2,13 +2,12 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'base/js/utils',
|
||||
'base/js/keyboard',
|
||||
'notebook/js/contexthint',
|
||||
'codemirror/lib/codemirror',
|
||||
], function(IPython, $, utils, keyboard, CodeMirror) {
|
||||
], function($, utils, keyboard, CodeMirror) {
|
||||
"use strict";
|
||||
|
||||
// easier key mapping
|
||||
@ -409,8 +408,5 @@ define([
|
||||
}, 50);
|
||||
};
|
||||
|
||||
// For backwards compatability.
|
||||
IPython.Completer = Completer;
|
||||
|
||||
return {'Completer': Completer};
|
||||
});
|
||||
|
@ -9,11 +9,10 @@
|
||||
*/
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'base/js/utils',
|
||||
'base/js/keyboard',
|
||||
], function(IPython, $, utils, keyboard) {
|
||||
], function($, utils, keyboard) {
|
||||
"use strict";
|
||||
|
||||
// Main keyboard manager for the notebook
|
||||
@ -223,9 +222,5 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// For backwards compatibility.
|
||||
IPython.KeyboardManager = KeyboardManager;
|
||||
|
||||
return {'KeyboardManager': KeyboardManager};
|
||||
});
|
||||
|
@ -3,11 +3,10 @@
|
||||
|
||||
define([
|
||||
'require',
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'./toolbar',
|
||||
'./celltoolbar'
|
||||
], function(require, IPython, $, toolbar, celltoolbar) {
|
||||
], function(require, $, toolbar, celltoolbar) {
|
||||
"use strict";
|
||||
|
||||
var MainToolBar = function (selector, options) {
|
||||
@ -158,8 +157,5 @@ define([
|
||||
return wrapper;
|
||||
};
|
||||
|
||||
// Backwards compatibility.
|
||||
IPython.MainToolBar = MainToolBar;
|
||||
|
||||
return {'MainToolBar': MainToolBar};
|
||||
});
|
||||
|
@ -2,11 +2,10 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'base/js/utils',
|
||||
'base/js/dialog',
|
||||
], function(IPython, $, utils, dialog) {
|
||||
], function($, utils, dialog) {
|
||||
"use strict";
|
||||
|
||||
var init = function () {
|
||||
@ -44,19 +43,19 @@ define([
|
||||
"If you have administrative access to the notebook server and" +
|
||||
" a working internet connection, you can install a local copy" +
|
||||
" of MathJax for offline use with the following command on the server" +
|
||||
" at a Python or IPython prompt:"
|
||||
" at a Python or Jupyter prompt:"
|
||||
)
|
||||
).append(
|
||||
$("<pre></pre>").addClass('dialog').text(
|
||||
">>> from IPython.external import mathjax; mathjax.install_mathjax()"
|
||||
">>> from Jupyter.external import mathjax; mathjax.install_mathjax()"
|
||||
)
|
||||
).append(
|
||||
$("<p></p>").addClass('dialog').text(
|
||||
"This will try to install MathJax into the IPython source directory."
|
||||
"This will try to install MathJax into the Jupyter source directory."
|
||||
)
|
||||
).append(
|
||||
$("<p></p>").addClass('dialog').text(
|
||||
"If IPython is installed to a location that requires" +
|
||||
"If Jupyter is installed to a location that requires" +
|
||||
" administrative privileges to write, you will need to make this call as" +
|
||||
" an administrator, via 'sudo'."
|
||||
)
|
||||
@ -246,7 +245,5 @@ define([
|
||||
replace_math : replace_math
|
||||
};
|
||||
|
||||
IPython.mathjaxutils = mathjaxutils;
|
||||
|
||||
return mathjaxutils;
|
||||
});
|
||||
|
@ -16,7 +16,7 @@ define([
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* A MenuBar Class to generate the menubar of IPython notebook
|
||||
* A MenuBar Class to generate the menubar of Jupyter notebook
|
||||
*
|
||||
* Parameters:
|
||||
* selector: string
|
||||
@ -414,8 +414,5 @@ define([
|
||||
|
||||
};
|
||||
|
||||
// Backwards compatability.
|
||||
IPython.MenuBar = MenuBar;
|
||||
|
||||
return {'MenuBar': MenuBar};
|
||||
});
|
||||
|
@ -179,7 +179,7 @@ define(function (require) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Bind JavaScript events: key presses and custom IPython events.
|
||||
* Bind JavaScript events: key presses and custom Jupyter events.
|
||||
*/
|
||||
Notebook.prototype.bind_events = function () {
|
||||
var that = this;
|
||||
@ -1140,7 +1140,7 @@ define(function (require) {
|
||||
keyboard_manager: this.keyboard_manager,
|
||||
title : "Use markdown headings",
|
||||
body : $("<p/>").text(
|
||||
'IPython no longer uses special heading cells. ' +
|
||||
'Jupyter no longer uses special heading cells. ' +
|
||||
'Instead, write your headings in Markdown cells using # characters:'
|
||||
).append($('<pre/>').text(
|
||||
'## This is a level 2 heading'
|
||||
@ -1618,7 +1618,7 @@ define(function (require) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Prompt the user to restart the IPython kernel.
|
||||
* Prompt the user to restart the Jupyter kernel.
|
||||
*/
|
||||
Notebook.prototype.restart_kernel = function () {
|
||||
var that = this;
|
||||
@ -2032,7 +2032,7 @@ define(function (require) {
|
||||
*/
|
||||
Notebook.prototype.trust_notebook = function () {
|
||||
var body = $("<div>").append($("<p>")
|
||||
.text("A trusted IPython notebook may execute hidden malicious code ")
|
||||
.text("A trusted Jupyter notebook may execute hidden malicious code ")
|
||||
.append($("<strong>")
|
||||
.append(
|
||||
$("<em>").text("when you open it")
|
||||
@ -2042,7 +2042,7 @@ define(function (require) {
|
||||
).append(
|
||||
" For more information, see the "
|
||||
).append($("<a>").attr("href", "http://ipython.org/ipython-doc/2/notebook/security.html")
|
||||
.text("IPython security documentation")
|
||||
.text("Jupyter security documentation")
|
||||
).append(".")
|
||||
);
|
||||
|
||||
@ -2237,7 +2237,7 @@ define(function (require) {
|
||||
"current notebook format will be used.";
|
||||
|
||||
if (nbmodel.nbformat > orig_nbformat) {
|
||||
msg += " Older versions of IPython may not be able to read the new format.";
|
||||
msg += " Older versions of Jupyter may not be able to read the new format.";
|
||||
} else {
|
||||
msg += " Some features of the original notebook may not be available.";
|
||||
}
|
||||
@ -2509,9 +2509,5 @@ define(function (require) {
|
||||
this.load_notebook(this.notebook_path);
|
||||
};
|
||||
|
||||
|
||||
// For backwards compatability.
|
||||
IPython.Notebook = Notebook;
|
||||
|
||||
return {'Notebook': Notebook};
|
||||
});
|
||||
|
@ -1,11 +1,10 @@
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'base/js/utils',
|
||||
'base/js/dialog',
|
||||
'base/js/notificationarea',
|
||||
'moment'
|
||||
], function(IPython, $, utils, dialog, notificationarea, moment) {
|
||||
], function($, utils, dialog, notificationarea, moment) {
|
||||
"use strict";
|
||||
var NotificationArea = notificationarea.NotificationArea;
|
||||
|
||||
@ -340,8 +339,5 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
// Backwards compatibility.
|
||||
IPython.NotificationArea = NotebookNotificationArea;
|
||||
|
||||
return {'NotebookNotificationArea': NotebookNotificationArea};
|
||||
});
|
||||
|
@ -2,14 +2,13 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jqueryui',
|
||||
'base/js/utils',
|
||||
'base/js/security',
|
||||
'base/js/keyboard',
|
||||
'notebook/js/mathjaxutils',
|
||||
'components/marked/lib/marked',
|
||||
], function(IPython, $, utils, security, keyboard, mathjaxutils, marked) {
|
||||
], function($, utils, security, keyboard, mathjaxutils, marked) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
@ -962,8 +961,5 @@ define([
|
||||
"application/pdf" : append_pdf
|
||||
};
|
||||
|
||||
// For backwards compatability.
|
||||
IPython.OutputArea = OutputArea;
|
||||
|
||||
return {'OutputArea': OutputArea};
|
||||
});
|
||||
|
@ -2,10 +2,9 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jqueryui',
|
||||
'base/js/utils',
|
||||
], function(IPython, $, utils) {
|
||||
], function($, utils) {
|
||||
"use strict";
|
||||
|
||||
var Pager = function (pager_selector, options) {
|
||||
@ -132,7 +131,7 @@ define([
|
||||
.attr('type',"text/css")
|
||||
)
|
||||
.append(
|
||||
$('<title>').text("IPython Pager")
|
||||
$('<title>').text("Jupyter Pager")
|
||||
);
|
||||
var pager_body = $(w.document.body);
|
||||
pager_body.css('overflow','scroll');
|
||||
@ -162,8 +161,5 @@ define([
|
||||
$('.end_space').css('height', Math.max(this.pager_element.height(), this._default_end_space));
|
||||
};
|
||||
|
||||
// Backwards compatability.
|
||||
IPython.Pager = Pager;
|
||||
|
||||
return {'Pager': Pager};
|
||||
});
|
||||
|
@ -2,11 +2,10 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'base/js/utils',
|
||||
'base/js/dialog',
|
||||
], function(IPython, $, utils, dialog) {
|
||||
], function($, utils, dialog) {
|
||||
"use strict";
|
||||
var platform = utils.platform;
|
||||
|
||||
@ -173,7 +172,7 @@ define([
|
||||
doc.append(
|
||||
$('<button/>').addClass('close').attr('data-dismiss','alert').html('×')
|
||||
).append(
|
||||
'The IPython Notebook has two different keyboard input modes. <b>Edit mode</b> '+
|
||||
'The Jupyter Notebook has two different keyboard input modes. <b>Edit mode</b> '+
|
||||
'allows you to type code/text into a cell and is indicated by a green cell '+
|
||||
'border. <b>Command mode</b> binds the keyboard to notebook level actions '+
|
||||
'and is indicated by a grey cell border.'
|
||||
@ -293,8 +292,5 @@ define([
|
||||
return div;
|
||||
};
|
||||
|
||||
// Backwards compatability.
|
||||
IPython.QuickHelp = QuickHelp;
|
||||
|
||||
return {'QuickHelp': QuickHelp};
|
||||
});
|
||||
|
@ -2,13 +2,12 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'base/js/utils',
|
||||
'base/js/dialog',
|
||||
'base/js/keyboard',
|
||||
'moment',
|
||||
], function(IPython, $, utils, dialog, keyboard, moment) {
|
||||
], function($, utils, dialog, keyboard, moment) {
|
||||
"use strict";
|
||||
|
||||
var SaveWidget = function (selector, options) {
|
||||
@ -217,9 +216,6 @@ define([
|
||||
}
|
||||
};
|
||||
|
||||
// Backwards compatibility.
|
||||
IPython.SaveWidget = SaveWidget;
|
||||
|
||||
return {'SaveWidget': SaveWidget};
|
||||
|
||||
});
|
||||
|
@ -2,7 +2,6 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'base/js/utils',
|
||||
'jquery',
|
||||
'notebook/js/cell',
|
||||
@ -14,7 +13,7 @@ define([
|
||||
'codemirror/lib/codemirror',
|
||||
'codemirror/mode/gfm/gfm',
|
||||
'notebook/js/codemirror-ipythongfm'
|
||||
], function(IPython,
|
||||
], function(
|
||||
utils,
|
||||
$,
|
||||
cell,
|
||||
@ -360,11 +359,6 @@ define([
|
||||
return cont;
|
||||
};
|
||||
|
||||
// Backwards compatability.
|
||||
IPython.TextCell = TextCell;
|
||||
IPython.MarkdownCell = MarkdownCell;
|
||||
IPython.RawCell = RawCell;
|
||||
|
||||
var textcell = {
|
||||
TextCell: TextCell,
|
||||
MarkdownCell: MarkdownCell,
|
||||
|
@ -2,9 +2,8 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery'
|
||||
], function(IPython, $) {
|
||||
], function($) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
@ -53,27 +52,6 @@ define([
|
||||
* ...
|
||||
* ]
|
||||
*
|
||||
* For backward compatibility this also support the
|
||||
* old methods of adding a button directly bound to callbacks:
|
||||
* @example
|
||||
* # deprecate, do not use
|
||||
* IPython.toolbar.add_buttons_group([
|
||||
* {
|
||||
* label:'my button',
|
||||
* icon:'icon-hdd',
|
||||
* callback:function(){alert('hoho')},
|
||||
* id : 'my_button_id', // this is optional
|
||||
* },
|
||||
* {
|
||||
* label:'my second button',
|
||||
* icon:'icon-play',
|
||||
* callback:function(){alert('be carefull I cut')}
|
||||
* }
|
||||
* ],
|
||||
* "my_button_group_id"
|
||||
* )
|
||||
*
|
||||
* @method add_buttons_group
|
||||
* @param list {List}
|
||||
* List of button of the group, with the following paramter for each :
|
||||
* @param list.label {string} text to show on button hover
|
||||
@ -154,8 +132,5 @@ define([
|
||||
this.element.toggle();
|
||||
};
|
||||
|
||||
// Backwards compatibility.
|
||||
IPython.ToolBar = ToolBar;
|
||||
|
||||
return {'ToolBar': ToolBar};
|
||||
});
|
||||
|
@ -2,10 +2,9 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'base/js/utils',
|
||||
], function(IPython, $, utils) {
|
||||
], function($, utils) {
|
||||
"use strict";
|
||||
|
||||
// tooltip constructor
|
||||
@ -319,8 +318,5 @@ define([
|
||||
this.text.scrollTop(0);
|
||||
};
|
||||
|
||||
// Backwards compatibility.
|
||||
IPython.Tooltip = Tooltip;
|
||||
|
||||
return {'Tooltip': Tooltip};
|
||||
});
|
||||
|
@ -2,10 +2,9 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'bootstraptour',
|
||||
], function(IPython, $, Tour) {
|
||||
], function($, Tour) {
|
||||
"use strict";
|
||||
|
||||
var tour_style = "<div class='popover tour'>\n" +
|
||||
@ -113,7 +112,7 @@ define([
|
||||
title: "Fin.",
|
||||
placement: 'bottom',
|
||||
orphan: true,
|
||||
content: "This concludes the IPython Notebook User Interface Tour. Happy hacking!"
|
||||
content: "This concludes the Jupyter Notebook User Interface Tour. Happy hacking!"
|
||||
}
|
||||
];
|
||||
|
||||
@ -159,9 +158,6 @@ define([
|
||||
this.notebook.edit_mode();
|
||||
};
|
||||
|
||||
// For backwards compatability.
|
||||
IPython.NotebookTour = NotebookTour;
|
||||
|
||||
return {'Tour': NotebookTour};
|
||||
|
||||
});
|
||||
|
@ -2,10 +2,9 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'base/js/utils',
|
||||
], function(IPython, $, utils) {
|
||||
], function($, utils) {
|
||||
"use strict";
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
@ -35,7 +34,7 @@ define([
|
||||
CommManager.prototype.new_comm = function (target_name, data, callbacks, metadata) {
|
||||
/**
|
||||
* Create a new Comm, register it, and open its Kernel-side counterpart
|
||||
* Mimics the auto-registration in `Comm.__init__` in the IPython Comm
|
||||
* Mimics the auto-registration in `Comm.__init__` in the Jupyter Comm
|
||||
*/
|
||||
var comm = new Comm(target_name);
|
||||
this.register_comm(comm);
|
||||
@ -208,10 +207,6 @@ define([
|
||||
this._callback('close', msg);
|
||||
};
|
||||
|
||||
// For backwards compatability.
|
||||
IPython.CommManager = CommManager;
|
||||
IPython.Comm = Comm;
|
||||
|
||||
return {
|
||||
'CommManager': CommManager,
|
||||
'Comm': Comm
|
||||
|
@ -2,13 +2,12 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'base/js/utils',
|
||||
'./comm',
|
||||
'./serialize',
|
||||
'base/js/events'
|
||||
], function(IPython, $, utils, comm, serialize, events) {
|
||||
], function($, utils, comm, serialize, events) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
@ -31,7 +30,7 @@ define([
|
||||
|
||||
this.kernel_service_url = kernel_service_url;
|
||||
this.kernel_url = null;
|
||||
this.ws_url = ws_url || IPython.utils.get_body_data("wsUrl");
|
||||
this.ws_url = ws_url || utils.get_body_data("wsUrl");
|
||||
if (!this.ws_url) {
|
||||
// trailing 's' in https will become wss for secure web sockets
|
||||
this.ws_url = location.protocol.replace('http', 'ws') + "//" + location.host;
|
||||
@ -1058,8 +1057,5 @@ define([
|
||||
}
|
||||
};
|
||||
|
||||
// Backwards compatability.
|
||||
IPython.Kernel = Kernel;
|
||||
|
||||
return {'Kernel': Kernel};
|
||||
});
|
||||
|
@ -2,11 +2,10 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'base/js/utils',
|
||||
'services/kernels/kernel',
|
||||
], function(IPython, $, utils, kernel) {
|
||||
], function($, utils, kernel) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
@ -309,11 +308,9 @@ define([
|
||||
this.name = "SessionAlreadyStarting";
|
||||
this.message = (message || "");
|
||||
};
|
||||
|
||||
SessionAlreadyStarting.prototype = Error.prototype;
|
||||
|
||||
// For backwards compatability.
|
||||
IPython.Session = Session;
|
||||
|
||||
return {
|
||||
Session: Session,
|
||||
SessionAlreadyStarting: SessionAlreadyStarting
|
||||
|
@ -2,10 +2,9 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'base/js/utils',
|
||||
], function(IPython, $, utils) {
|
||||
], function($, utils) {
|
||||
"use strict";
|
||||
|
||||
var ClusterList = function (selector, options) {
|
||||
@ -182,10 +181,6 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
// For backwards compatability.
|
||||
IPython.ClusterList = ClusterList;
|
||||
IPython.ClusterItem = ClusterItem;
|
||||
|
||||
return {
|
||||
'ClusterList': ClusterList,
|
||||
'ClusterItem': ClusterItem,
|
||||
|
@ -39,6 +39,8 @@ require([
|
||||
loginwidget){
|
||||
"use strict";
|
||||
|
||||
IPython.NotebookList = notebooklist.NotebookList;
|
||||
|
||||
page = new page.Page();
|
||||
|
||||
var common_options = {
|
||||
|
@ -874,9 +874,5 @@ define([
|
||||
.append(cancel_button);
|
||||
};
|
||||
|
||||
|
||||
// Backwards compatability.
|
||||
IPython.NotebookList = NotebookList;
|
||||
|
||||
return {'NotebookList': NotebookList};
|
||||
});
|
||||
|
@ -2,10 +2,9 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
define([
|
||||
'base/js/namespace',
|
||||
'jquery',
|
||||
'base/js/utils',
|
||||
], function(IPython, $, utils) {
|
||||
], function($, utils) {
|
||||
"use strict";
|
||||
|
||||
var SesssionList = function (options) {
|
||||
@ -78,8 +77,5 @@ define([
|
||||
this.events.trigger('sessions_loaded.Dashboard', this.sessions);
|
||||
};
|
||||
|
||||
// Backwards compatability.
|
||||
IPython.SesssionList = SesssionList;
|
||||
|
||||
return {'SesssionList': SesssionList};
|
||||
});
|
||||
|
12
setupbase.py
12
setupbase.py
@ -17,12 +17,10 @@ import os
|
||||
import sys
|
||||
|
||||
from distutils import log
|
||||
from distutils.command.build_py import build_py
|
||||
from distutils.cmd import Command
|
||||
from distutils.errors import DistutilsExecError
|
||||
from fnmatch import fnmatch
|
||||
from glob import glob
|
||||
from subprocess import Popen, PIPE, check_call
|
||||
from subprocess import check_call
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Useful globals and utility functions
|
||||
@ -409,7 +407,7 @@ class CompileJS(Command):
|
||||
|
||||
class JavascriptVersion(Command):
|
||||
"""write the javascript version to notebook javascript"""
|
||||
description = "Write IPython version to javascript"
|
||||
description = "Write Jupyter version to javascript"
|
||||
user_options = []
|
||||
|
||||
def initialize_options(self):
|
||||
@ -425,12 +423,12 @@ class JavascriptVersion(Command):
|
||||
with open(nsfile, 'w') as f:
|
||||
found = False
|
||||
for line in lines:
|
||||
if line.strip().startswith("IPython.version"):
|
||||
line = ' IPython.version = "{0}";\n'.format(version)
|
||||
if line.strip().startswith("Jupyter.version"):
|
||||
line = ' Jupyter.version = "{0}";\n'.format(version)
|
||||
found = True
|
||||
f.write(line)
|
||||
if not found:
|
||||
raise RuntimeError("Didn't find IPython.version line in %s" % nsfile)
|
||||
raise RuntimeError("Didn't find Jupyter.version line in %s" % nsfile)
|
||||
|
||||
|
||||
def css_js_prerelease(command, strict=False):
|
||||
|
Loading…
Reference in New Issue
Block a user