mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-09 03:50:45 +08:00
Load underscore globally
This commit is contained in:
parent
03a5b47067
commit
7717a986d1
@ -63,7 +63,22 @@ module.exports = new Promise(function(resolve, reject) {
|
||||
Object.defineProperty(window, 'CodeMirror', codeMirrorProperty);
|
||||
console.log('CodeMirror loaded and available in global namespace');
|
||||
|
||||
resolve();
|
||||
|
||||
requirejs(['underscore'], function(_) {
|
||||
var underscoreProperty = {
|
||||
get: function() {
|
||||
return _;
|
||||
},
|
||||
configurable: false
|
||||
};
|
||||
Object.defineProperty(window, '_', underscoreProperty);
|
||||
console.log('underscore loaded and available in global namespace');
|
||||
|
||||
resolve();
|
||||
}, function(err) {
|
||||
console.error('could not load underscore');
|
||||
reject(err);
|
||||
});
|
||||
}, function(err) {
|
||||
console.error('could not load CodeMirror and/or it\'s plugins');
|
||||
reject(err);
|
||||
|
@ -11,7 +11,6 @@
|
||||
"use strict";
|
||||
|
||||
var utils = require('base/js/utils');
|
||||
var _ = require('underscore');
|
||||
|
||||
|
||||
/**
|
||||
|
@ -3,7 +3,6 @@
|
||||
'use strict';
|
||||
|
||||
var dialog = require('base/js/dialog');
|
||||
var _ = require('underscore');
|
||||
var IPython = require('base/js/namespace');
|
||||
|
||||
$('#notebook_about').click(function () {
|
||||
|
@ -2,8 +2,6 @@
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
"use strict";
|
||||
|
||||
var _ = require('underscore');
|
||||
|
||||
var _deserialize_array_buffer = function (buf) {
|
||||
var data = new DataView(buf);
|
||||
// read the header: 1 + nbufs 32b integers
|
||||
|
@ -42,7 +42,6 @@
|
||||
"rimraf": "^2.4.2",
|
||||
"term.js": "~0.0.4",
|
||||
"text-encoding": "~0.1",
|
||||
"typeahead": "^0.2.0",
|
||||
"underscore": "~1.5"
|
||||
"typeahead": "^0.2.0"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user