Hardcode references to the widgets.

Jonathan Frederic 11 years ago
parent ac5f6c1713
commit 32fd103bad

@ -238,6 +238,20 @@ class NotebookWebApplication(web.Application):
handlers.extend(load_handlers('services.nbconvert.handlers'))
handlers.extend(load_handlers('services.kernelspecs.handlers'))
handlers.extend(load_handlers('services.security.handlers'))
# BEGIN HARDCODED WIDGETS HACK
try:
import ipywidgets
handlers.append(
(r"/nbextensions/widgets/(.*)", FileFindHandler, {
'path': ipywidgets.find_static_assets(),
'no_cache_paths': ['/'], # don't cache anything in nbextensions
}),
)
except:
self.log.warn('ipywidgets package not installed. Widgets are unavailable.')
# END HARDCODED WIDGETS HACK
handlers.append(
(r"/nbextensions/(.*)", FileFindHandler, {
'path': settings['nbextensions_path'],

@ -50,6 +50,12 @@ require([
) {
"use strict";
// BEGIN HARDCODED WIDGETS HACK
// Don't include in above require call, avoiding r.js
// and crash on import failure.
require(['nbextensions/widgets/notebook/js/extension'], function(){});
// END HARDCODED WIDGETS HACK
// compat with old IPython, remove for IPython > 3.0
window.CodeMirror = CodeMirror;

Loading…
Cancel
Save