Skip to content

Commit

Permalink
Remove a few IPython references
Browse files Browse the repository at this point in the history
Ref jupyter#141

(c) Copyright IBM Corp. 2016
  • Loading branch information
jhpedemonte committed Mar 8, 2016
1 parent 1ab1213 commit c9ca0f2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
4 changes: 2 additions & 2 deletions elements/urth-core-behaviors/jupyter-notebook-env.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<script>
'use strict';
(function() {
window.Urth = window.Urth || {};
var Urth = window.Urth = window.Urth || {};

/**
* Behavior that contains notebook related properties
Expand All @@ -22,7 +22,7 @@
properties: {
_baseURL: {
value: function(){
return window['IPython'] ? IPython.notebook.base_url : '/';
return Urth._baseURL;
}
},

Expand Down
4 changes: 2 additions & 2 deletions elements/urth-core-behaviors/jupyter-widget-behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<script>
'use strict';
(function() {
window.Urth = window.Urth || {};
var Urth = window.Urth = window.Urth || {};

/**
* Behavior that encapsulate some of the functions needed by
Expand Down Expand Up @@ -45,7 +45,7 @@

_doCreateModel: function(){
console.debug('Urth.JupyterWidgetBehavior createModel', this.kernelClass);
IPython.notebook.kernel.widget_manager.new_widget(
Urth.widget_manager.new_widget(
{
model_name: 'DeclWidgetModel',
widget_class: this.kernelClass
Expand Down
20 changes: 14 additions & 6 deletions nb-extension/js/init/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,21 @@ define([
window.Polymer.dom = 'shadow';

// Expose the base URL being used.
window.Urth = window.Urth || {};
var Urth = window.Urth = window.Urth || {};

// Global promise which is resolved when widgets are fully initialized
window.Urth.widgets = window.Urth.widgets || {};
window.Urth.widgets.whenReady = $.Deferred();
Urth.widgets = Urth.widgets || {};
Urth.widgets.whenReady = $.Deferred();

// expose suppressErrors, false by default to display errors
window.Urth.suppressErrors = config.suppressErrors;
Urth.suppressErrors = config.suppressErrors;

if (config.WidgetManager) {
Urth.widget_manager = config.WidgetManager;
} else if (window.IPython) {
// backwards compatibility
Urth.widget_manager = window.IPython.notebook.kernel.widget_manager;
}

isServerExtensionAvailable(baseURL + COMPONENTS_DIR, function(isAvailable){
console.log('Server extension is ' + (isAvailable ? '' : 'NOT ') + 'available!');
Expand All @@ -195,7 +202,8 @@ define([
? baseURL
: getModuleBasedComponentRoot(module);

window.Urth.BASE_URL = components_root;
Urth.BASE_URL = components_root;
Urth._baseURL = baseURL;
components_root += COMPONENTS_DIR;

loadPolyfill(components_root, function() {
Expand All @@ -206,6 +214,6 @@ define([
});
});

return window.Urth.widgets.whenReady;
return Urth.widgets.whenReady;
};
});

0 comments on commit c9ca0f2

Please sign in to comment.