mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-30 12:11:32 +08:00
es5ify
- const, let -> var - evaluated object keys
This commit is contained in:
parent
cec4205bee
commit
4f7160aac6
@ -417,8 +417,8 @@ define([
|
||||
|
||||
shortcut = shortcut.toLowerCase();
|
||||
this.remove_shortcut(shortcut);
|
||||
const patch = {keys:{}};
|
||||
const b = {bind:{}};
|
||||
var patch = {keys: {}};
|
||||
var b = {bind: {}};
|
||||
patch.keys[this._mode] = {bind:{}};
|
||||
patch.keys[this._mode].bind[shortcut] = null;
|
||||
this._config.update(patch);
|
||||
@ -426,16 +426,16 @@ define([
|
||||
// if the shortcut we unbind is a default one, we add it to the list of
|
||||
// things to unbind at startup
|
||||
if( this._defaults_bindings.indexOf(shortcut) !== -1 ){
|
||||
const cnf = (this._config.data.keys||{})[this._mode];
|
||||
const unbind_array = cnf.unbind||[];
|
||||
var cnf = (this._config.data.keys || {})[this._mode];
|
||||
var unbind_array = cnf.unbind || [];
|
||||
|
||||
|
||||
// unless it's already there (like if we have remapped a default
|
||||
// shortcut to another command): unbind it)
|
||||
if(unbind_array.indexOf(shortcut) === -1){
|
||||
const _parray = unbind_array.concat(shortcut);
|
||||
const unbind_patch = {keys:{}};
|
||||
unbind_patch.keys[this._mode] = {unbind:_parray}
|
||||
var _parray = unbind_array.concat(shortcut);
|
||||
var unbind_patch = {keys:{}};
|
||||
unbind_patch.keys[this._mode] = {unbind:_parray};
|
||||
console.warn('up:', unbind_patch);
|
||||
this._config.update(unbind_patch);
|
||||
}
|
||||
|
@ -79,4 +79,4 @@ define(function(){
|
||||
});
|
||||
|
||||
// deprecated since 4.0, remove in 5+
|
||||
var IPython = Jupyter
|
||||
var IPython = Jupyter;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright (c) Jupyter Development Team.
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
// jshint esnext: true
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'base/js/utils',
|
||||
@ -242,15 +242,15 @@ define([
|
||||
};
|
||||
|
||||
// Declare mime type as constants
|
||||
const MIME_JAVASCRIPT = 'application/javascript';
|
||||
const MIME_HTML = 'text/html';
|
||||
const MIME_MARKDOWN = 'text/markdown';
|
||||
const MIME_LATEX = 'text/latex';
|
||||
const MIME_SVG = 'image/svg+xml';
|
||||
const MIME_PNG = 'image/png';
|
||||
const MIME_JPEG = 'image/jpeg';
|
||||
const MIME_PDF = 'application/pdf';
|
||||
const MIME_TEXT = 'text/plain';
|
||||
var MIME_JAVASCRIPT = 'application/javascript';
|
||||
var MIME_HTML = 'text/html';
|
||||
var MIME_MARKDOWN = 'text/markdown';
|
||||
var MIME_LATEX = 'text/latex';
|
||||
var MIME_SVG = 'image/svg+xml';
|
||||
var MIME_PNG = 'image/png';
|
||||
var MIME_JPEG = 'image/jpeg';
|
||||
var MIME_PDF = 'application/pdf';
|
||||
var MIME_TEXT = 'text/plain';
|
||||
|
||||
|
||||
OutputArea.output_types = [
|
||||
@ -262,7 +262,7 @@ define([
|
||||
MIME_PNG,
|
||||
MIME_JPEG,
|
||||
MIME_PDF,
|
||||
MIME_TEXT
|
||||
MIME_TEXT,
|
||||
];
|
||||
|
||||
OutputArea.prototype.validate_mimebundle = function (bundle) {
|
||||
@ -637,13 +637,11 @@ define([
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
OutputArea.safe_outputs = {
|
||||
[MIME_TEXT] : true,
|
||||
[MIME_LATEX] : true,
|
||||
[MIME_PNG] : true,
|
||||
[MIME_JPEG] : true
|
||||
};
|
||||
OutputArea.safe_outputs = {};
|
||||
OutputArea.safe_outputs[MIME_TEXT] = true;
|
||||
OutputArea.safe_outputs[MIME_LATEX] = true;
|
||||
OutputArea.safe_outputs[MIME_PNG] = true;
|
||||
OutputArea.safe_outputs[MIME_JPEG] = true;
|
||||
|
||||
OutputArea.prototype.append_mime_type = function (json, element, handle_inserted) {
|
||||
for (var i=0; i < OutputArea.display_order.length; i++) {
|
||||
@ -1057,17 +1055,16 @@ define([
|
||||
MIME_TEXT
|
||||
];
|
||||
|
||||
OutputArea.append_map = {
|
||||
[MIME_TEXT] : append_text,
|
||||
[MIME_HTML] : append_html,
|
||||
[MIME_MARKDOWN]: append_markdown,
|
||||
[MIME_SVG] : append_svg,
|
||||
[MIME_PNG] : append_png,
|
||||
[MIME_JPEG] : append_jpeg,
|
||||
[MIME_LATEX] : append_latex,
|
||||
[MIME_JAVASCRIPT] : append_javascript,
|
||||
[MIME_PDF] : append_pdf
|
||||
};
|
||||
OutputArea.append_map = {};
|
||||
OutputArea.append_map[MIME_TEXT] = append_text;
|
||||
OutputArea.append_map[MIME_HTML] = append_html;
|
||||
OutputArea.append_map[MIME_MARKDOWN] = append_markdown;
|
||||
OutputArea.append_map[MIME_SVG] = append_svg;
|
||||
OutputArea.append_map[MIME_PNG] = append_png;
|
||||
OutputArea.append_map[MIME_JPEG] = append_jpeg;
|
||||
OutputArea.append_map[MIME_LATEX] = append_latex;
|
||||
OutputArea.append_map[MIME_JAVASCRIPT] = append_javascript;
|
||||
OutputArea.append_map[MIME_PDF] = append_pdf;
|
||||
|
||||
OutputArea.prototype.mime_types = function () {
|
||||
return OutputArea.display_order;
|
||||
|
@ -979,7 +979,7 @@ define([
|
||||
*/
|
||||
Kernel.prototype.output_callback_overrides_push = function(msg_id, callback_id) {
|
||||
var output_callbacks = this._msg_callbacks_overrides[msg_id];
|
||||
if (output_callbacks === void 0) {
|
||||
if (!output_callbacks) {
|
||||
this._msg_callbacks_overrides[msg_id] = output_callbacks = [];
|
||||
}
|
||||
output_callbacks.push(callback_id);
|
||||
|
Loading…
Reference in New Issue
Block a user