Show More
@@ -84,6 +84,11 var IPython = (function (IPython) { | |||||
84 | this.style(); |
|
84 | this.style(); | |
85 | }; |
|
85 | }; | |
86 |
|
86 | |||
|
87 | ClusterItem.prototype.baseProjectUrl = function(){ | |||
|
88 | return this._baseProjectUrl || $('body').data('baseProjectUrl'); | |||
|
89 | }; | |||
|
90 | ||||
|
91 | ||||
87 |
|
92 | |||
88 | ClusterItem.prototype.style = function () { |
|
93 | ClusterItem.prototype.style = function () { | |
89 | this.element.addClass('list_item ui-widget ui-widget-content ui-helper-clearfix'); |
|
94 | this.element.addClass('list_item ui-widget ui-widget-content ui-helper-clearfix'); | |
@@ -138,7 +143,7 var IPython = (function (IPython) { | |||||
138 | } |
|
143 | } | |
139 | }; |
|
144 | }; | |
140 | status_col.html('starting'); |
|
145 | status_col.html('starting'); | |
141 |
var url = th |
|
146 | var url = that.baseProjectUrl() + 'clusters/' + that.data.profile + '/start'; | |
142 | $.ajax(url, settings); |
|
147 | $.ajax(url, settings); | |
143 | }; |
|
148 | }; | |
144 | }); |
|
149 | }); | |
@@ -172,7 +177,7 var IPython = (function (IPython) { | |||||
172 | } |
|
177 | } | |
173 | }; |
|
178 | }; | |
174 | status_col.html('stopping') |
|
179 | status_col.html('stopping') | |
175 |
var url = th |
|
180 | var url = that.baseProjectUrl() + 'clusters/' + that.data.profile + '/stop'; | |
176 | $.ajax(url, settings); |
|
181 | $.ajax(url, settings); | |
177 | }); |
|
182 | }); | |
178 | }; |
|
183 | }; |
@@ -65,18 +65,19 var IPython = (function (IPython) { | |||||
65 |
|
65 | |||
66 | MenuBar.prototype.bind_events = function () { |
|
66 | MenuBar.prototype.bind_events = function () { | |
67 | // File |
|
67 | // File | |
|
68 | var that = this; | |||
68 | this.element.find('#new_notebook').click(function () { |
|
69 | this.element.find('#new_notebook').click(function () { | |
69 |
window.open(th |
|
70 | window.open(that.baseProjectUrl()+'new'); | |
70 | }); |
|
71 | }); | |
71 | this.element.find('#open_notebook').click(function () { |
|
72 | this.element.find('#open_notebook').click(function () { | |
72 |
window.open(th |
|
73 | window.open(that.baseProjectUrl()); | |
73 | }); |
|
74 | }); | |
74 | this.element.find('#rename_notebook').click(function () { |
|
75 | this.element.find('#rename_notebook').click(function () { | |
75 | IPython.save_widget.rename_notebook(); |
|
76 | IPython.save_widget.rename_notebook(); | |
76 | }); |
|
77 | }); | |
77 | this.element.find('#copy_notebook').click(function () { |
|
78 | this.element.find('#copy_notebook').click(function () { | |
78 | var notebook_id = IPython.notebook.get_notebook_id(); |
|
79 | var notebook_id = IPython.notebook.get_notebook_id(); | |
79 |
var url = th |
|
80 | var url = that.baseProjectUrl() + notebook_id + '/copy'; | |
80 | window.open(url,'_blank'); |
|
81 | window.open(url,'_blank'); | |
81 | return false; |
|
82 | return false; | |
82 | }); |
|
83 | }); | |
@@ -85,13 +86,13 var IPython = (function (IPython) { | |||||
85 | }); |
|
86 | }); | |
86 | this.element.find('#download_ipynb').click(function () { |
|
87 | this.element.find('#download_ipynb').click(function () { | |
87 | var notebook_id = IPython.notebook.get_notebook_id(); |
|
88 | var notebook_id = IPython.notebook.get_notebook_id(); | |
88 |
var url = th |
|
89 | var url = that.baseProjectUrl() + 'notebooks/' + | |
89 | notebook_id + '?format=json'; |
|
90 | notebook_id + '?format=json'; | |
90 | window.location.assign(url); |
|
91 | window.location.assign(url); | |
91 | }); |
|
92 | }); | |
92 | this.element.find('#download_py').click(function () { |
|
93 | this.element.find('#download_py').click(function () { | |
93 | var notebook_id = IPython.notebook.get_notebook_id(); |
|
94 | var notebook_id = IPython.notebook.get_notebook_id(); | |
94 |
var url = th |
|
95 | var url = that.baseProjectUrl() + 'notebooks/' + | |
95 | notebook_id + '?format=py'; |
|
96 | notebook_id + '?format=py'; | |
96 | window.location.assign(url); |
|
97 | window.location.assign(url); | |
97 | }); |
|
98 | }); |
@@ -216,7 +216,7 var IPython = (function (IPython) { | |||||
216 | that.load_list(); |
|
216 | that.load_list(); | |
217 | } |
|
217 | } | |
218 | }; |
|
218 | }; | |
219 |
var url = th |
|
219 | var url = that.baseProjectUrl() + 'kernels/'+kernel; | |
220 | $.ajax(url, settings); |
|
220 | $.ajax(url, settings); | |
221 | }); |
|
221 | }); | |
222 | new_buttons.append(shutdown_button); |
|
222 | new_buttons.append(shutdown_button); | |
@@ -257,7 +257,7 var IPython = (function (IPython) { | |||||
257 | parent_item.remove(); |
|
257 | parent_item.remove(); | |
258 | } |
|
258 | } | |
259 | }; |
|
259 | }; | |
260 |
var url = th |
|
260 | var url = that.baseProjectUrl() + 'notebooks/' + notebook_id; | |
261 | $.ajax(url, settings); |
|
261 | $.ajax(url, settings); | |
262 | $(this).dialog('close'); |
|
262 | $(this).dialog('close'); | |
263 | }, |
|
263 | }, | |
@@ -306,7 +306,7 var IPython = (function (IPython) { | |||||
306 | }; |
|
306 | }; | |
307 |
|
307 | |||
308 | var qs = $.param({name:nbname, format:nbformat}); |
|
308 | var qs = $.param({name:nbname, format:nbformat}); | |
309 |
var url = th |
|
309 | var url = that.baseProjectUrl() + 'notebooks?' + qs; | |
310 | $.ajax(url, settings); |
|
310 | $.ajax(url, settings); | |
311 | }); |
|
311 | }); | |
312 | var cancel_button = $('<button>Cancel</button>').button(). |
|
312 | var cancel_button = $('<button>Cancel</button>').button(). |
General Comments 0
You need to be logged in to leave comments.
Login now