##// END OF EJS Templates
change more baseurl
Bussonnier Matthias -
Show More
@@ -20,6 +20,10 var IPython = (function (IPython) {
20 }
20 }
21 };
21 };
22
22
23 ClusterList.prototype.baseProjectUrl = function(){
24 return this._baseProjectUrl || $('body').data('baseProjectUrl');
25 };
26
23 ClusterList.prototype.style = function () {
27 ClusterList.prototype.style = function () {
24 $('#cluster_toolbar').addClass('list_toolbar');
28 $('#cluster_toolbar').addClass('list_toolbar');
25 $('#cluster_list_info').addClass('toolbar_info');
29 $('#cluster_list_info').addClass('toolbar_info');
@@ -52,7 +56,7 var IPython = (function (IPython) {
52 dataType : "json",
56 dataType : "json",
53 success : $.proxy(this.load_list_success, this)
57 success : $.proxy(this.load_list_success, this)
54 };
58 };
55 var url = $('body').data('baseProjectUrl') + 'clusters';
59 var url = this.baseProjectUrl() + 'clusters';
56 $.ajax(url, settings);
60 $.ajax(url, settings);
57 };
61 };
58
62
@@ -134,7 +138,7 var IPython = (function (IPython) {
134 }
138 }
135 };
139 };
136 status_col.html('starting');
140 status_col.html('starting');
137 var url = $('body').data('baseProjectUrl') + 'clusters/' + that.data.profile + '/start';
141 var url = this.baseProjectUrl() + 'clusters/' + that.data.profile + '/start';
138 $.ajax(url, settings);
142 $.ajax(url, settings);
139 };
143 };
140 });
144 });
@@ -168,7 +172,7 var IPython = (function (IPython) {
168 }
172 }
169 };
173 };
170 status_col.html('stopping')
174 status_col.html('stopping')
171 var url = $('body').data('baseProjectUrl') + 'clusters/' + that.data.profile + '/stop';
175 var url = this.baseProjectUrl() + 'clusters/' + that.data.profile + '/stop';
172 $.ajax(url, settings);
176 $.ajax(url, settings);
173 });
177 });
174 };
178 };
@@ -10,9 +10,10
10 //============================================================================
10 //============================================================================
11
11
12 var IPython = (function (IPython) {
12 var IPython = (function (IPython) {
13 var base_url = $('body').data('baseProjectUrl');
14
13
15 var LoginWidget = function (selector) {
14 var LoginWidget = function (selector, options) {
15 var options = options || {};
16 this.base_url = options.baseProjectUrl ||Β $('body').data('baseProjectUrl') ;
16 this.selector = selector;
17 this.selector = selector;
17 if (this.selector !== undefined) {
18 if (this.selector !== undefined) {
18 this.element = $(selector);
19 this.element = $(selector);
@@ -30,10 +31,10 var IPython = (function (IPython) {
30 LoginWidget.prototype.bind_events = function () {
31 LoginWidget.prototype.bind_events = function () {
31 var that = this;
32 var that = this;
32 this.element.find("button#logout").click(function () {
33 this.element.find("button#logout").click(function () {
33 window.location = base_url+"logout";
34 window.location = that.base_url+"logout";
34 });
35 });
35 this.element.find("button#login").click(function () {
36 this.element.find("button#login").click(function () {
36 window.location = base_url+"login";
37 window.location = that.base_url+"login";
37 });
38 });
38 };
39 };
39
40
@@ -47,7 +47,7 var IPython = (function (IPython) {
47
47
48 MenuBar.prototype.baseProjectUrl = function(){
48 MenuBar.prototype.baseProjectUrl = function(){
49 return this._baseProjectUrl || $('body').data('baseProjectUrl');
49 return this._baseProjectUrl || $('body').data('baseProjectUrl');
50 }
50 };
51
51
52
52
53 MenuBar.prototype.style = function () {
53 MenuBar.prototype.style = function () {
@@ -46,6 +46,10 var IPython = (function (IPython) {
46 $('div#notebook').addClass('border-box-sizing');
46 $('div#notebook').addClass('border-box-sizing');
47 };
47 };
48
48
49 Notebook.prototype.baseProjectUrl = function(){
50 return this._baseProjectUrl || $('body').data('baseProjectUrl');
51 };
52
49
53
50 Notebook.prototype.create_elements = function () {
54 Notebook.prototype.create_elements = function () {
51 // We add this end_space div to the end of the notebook div to:
55 // We add this end_space div to the end of the notebook div to:
@@ -1237,7 +1241,7 var IPython = (function (IPython) {
1237 error : $.proxy(this.save_notebook_error,this)
1241 error : $.proxy(this.save_notebook_error,this)
1238 };
1242 };
1239 $([IPython.events]).trigger('notebook_saving.Notebook');
1243 $([IPython.events]).trigger('notebook_saving.Notebook');
1240 var url = $('body').data('baseProjectUrl') + 'notebooks/' + this.notebook_id;
1244 var url = this.baseProjectUrl() + 'notebooks/' + this.notebook_id;
1241 $.ajax(url, settings);
1245 $.ajax(url, settings);
1242 };
1246 };
1243
1247
@@ -1266,7 +1270,7 var IPython = (function (IPython) {
1266 error : $.proxy(this.load_notebook_error,this),
1270 error : $.proxy(this.load_notebook_error,this),
1267 };
1271 };
1268 $([IPython.events]).trigger('notebook_loading.Notebook');
1272 $([IPython.events]).trigger('notebook_loading.Notebook');
1269 var url = $('body').data('baseProjectUrl') + 'notebooks/' + this.notebook_id;
1273 var url = this.baseProjectUrl() + 'notebooks/' + this.notebook_id;
1270 $.ajax(url, settings);
1274 $.ajax(url, settings);
1271 };
1275 };
1272
1276
General Comments 0
You need to be logged in to leave comments. Login now