Show More
@@ -77,7 +77,7 b' var IPython = (function (IPython) {' | |||
|
77 | 77 | IPython.notebook.new_notebook(); |
|
78 | 78 | }); |
|
79 | 79 | this.element.find('#open_notebook').click(function () { |
|
80 |
window.open(utils.url_ |
|
|
80 | window.open(utils.url_join_encode( | |
|
81 | 81 | that.baseProjectUrl(), |
|
82 | 82 | 'tree', |
|
83 | 83 | that.notebookPath() |
@@ -93,7 +93,7 b' var IPython = (function (IPython) {' | |||
|
93 | 93 | IPython.notebook.save_notebook({async : false}); |
|
94 | 94 | } |
|
95 | 95 | |
|
96 |
var url = utils.url_ |
|
|
96 | var url = utils.url_join_encode( | |
|
97 | 97 | that.baseProjectUrl(), |
|
98 | 98 | 'files', |
|
99 | 99 | that.notebookPath(), |
@@ -79,15 +79,11 b' var IPython = (function (IPython) {' | |||
|
79 | 79 | }; |
|
80 | 80 | |
|
81 | 81 | Notebook.prototype.notebookName = function() { |
|
82 |
|
|
|
83 | name = decodeURIComponent(name); | |
|
84 | return name; | |
|
82 | return $('body').data('notebookName'); | |
|
85 | 83 | }; |
|
86 | 84 | |
|
87 | 85 | Notebook.prototype.notebookPath = function() { |
|
88 |
|
|
|
89 | path = decodeURIComponent(path); | |
|
90 | return path | |
|
86 | return $('body').data('notebookPath'); | |
|
91 | 87 | }; |
|
92 | 88 | |
|
93 | 89 | /** |
@@ -1689,10 +1685,10 b' var IPython = (function (IPython) {' | |||
|
1689 | 1685 | } |
|
1690 | 1686 | } |
|
1691 | 1687 | $([IPython.events]).trigger('notebook_saving.Notebook'); |
|
1692 |
var url = utils.url_ |
|
|
1693 |
this.baseProjectUrl |
|
|
1688 | var url = utils.url_join_encode( | |
|
1689 | this._baseProjectUrl, | |
|
1694 | 1690 | 'api/notebooks', |
|
1695 |
this.notebook |
|
|
1691 | this.notebook_path, | |
|
1696 | 1692 | this.notebook_name |
|
1697 | 1693 | ); |
|
1698 | 1694 | $.ajax(url, settings); |
@@ -1750,8 +1746,8 b' var IPython = (function (IPython) {' | |||
|
1750 | 1746 | }; |
|
1751 | 1747 | |
|
1752 | 1748 | Notebook.prototype.new_notebook = function(){ |
|
1753 |
var path = this.notebook |
|
|
1754 |
var base_project_url = this.baseProjectUrl |
|
|
1749 | var path = this.notebook_path; | |
|
1750 | var base_project_url = this._baseProjectUrl; | |
|
1755 | 1751 | var settings = { |
|
1756 | 1752 | processData : false, |
|
1757 | 1753 | cache : false, |
@@ -1761,7 +1757,7 b' var IPython = (function (IPython) {' | |||
|
1761 | 1757 | success : function (data, status, xhr){ |
|
1762 | 1758 | var notebook_name = data.name; |
|
1763 | 1759 | window.open( |
|
1764 |
utils.url_ |
|
|
1760 | utils.url_join_encode( | |
|
1765 | 1761 | base_project_url, |
|
1766 | 1762 | 'notebooks', |
|
1767 | 1763 | path, |
@@ -1771,7 +1767,7 b' var IPython = (function (IPython) {' | |||
|
1771 | 1767 | ); |
|
1772 | 1768 | } |
|
1773 | 1769 | }; |
|
1774 |
var url = utils.url_ |
|
|
1770 | var url = utils.url_join_encode( | |
|
1775 | 1771 | base_project_url, |
|
1776 | 1772 | 'api/notebooks', |
|
1777 | 1773 | path |
@@ -1781,8 +1777,8 b' var IPython = (function (IPython) {' | |||
|
1781 | 1777 | |
|
1782 | 1778 | |
|
1783 | 1779 | Notebook.prototype.copy_notebook = function(){ |
|
1784 |
var path = this.notebook |
|
|
1785 |
var base_project_url = this.baseProjectUrl |
|
|
1780 | var path = this.notebook_path; | |
|
1781 | var base_project_url = this._baseProjectUrl; | |
|
1786 | 1782 | var settings = { |
|
1787 | 1783 | processData : false, |
|
1788 | 1784 | cache : false, |
@@ -1791,7 +1787,7 b' var IPython = (function (IPython) {' | |||
|
1791 | 1787 | data : JSON.stringify({copy_from : this.notebook_name}), |
|
1792 | 1788 | async : false, |
|
1793 | 1789 | success : function (data, status, xhr) { |
|
1794 |
window.open(utils.url_ |
|
|
1790 | window.open(utils.url_join_encode( | |
|
1795 | 1791 | base_project_url, |
|
1796 | 1792 | 'notebooks', |
|
1797 | 1793 | data.path, |
@@ -1799,7 +1795,7 b' var IPython = (function (IPython) {' | |||
|
1799 | 1795 | ), '_blank'); |
|
1800 | 1796 | } |
|
1801 | 1797 | }; |
|
1802 |
var url = utils.url_ |
|
|
1798 | var url = utils.url_join_encode( | |
|
1803 | 1799 | base_project_url, |
|
1804 | 1800 | 'api/notebooks', |
|
1805 | 1801 | path |
@@ -1821,10 +1817,10 b' var IPython = (function (IPython) {' | |||
|
1821 | 1817 | error : $.proxy(that.rename_error, this) |
|
1822 | 1818 | }; |
|
1823 | 1819 | $([IPython.events]).trigger('rename_notebook.Notebook', data); |
|
1824 |
var url = utils.url_ |
|
|
1825 |
this.baseProjectUrl |
|
|
1820 | var url = utils.url_join_encode( | |
|
1821 | this._baseProjectUrl, | |
|
1826 | 1822 | 'api/notebooks', |
|
1827 |
this.notebook |
|
|
1823 | this.notebook_path, | |
|
1828 | 1824 | this.notebook_name |
|
1829 | 1825 | ); |
|
1830 | 1826 | $.ajax(url, settings); |
@@ -1832,9 +1828,9 b' var IPython = (function (IPython) {' | |||
|
1832 | 1828 | |
|
1833 | 1829 | |
|
1834 | 1830 | Notebook.prototype.rename_success = function (json, status, xhr) { |
|
1835 | this.notebook_name = json.name | |
|
1836 | var name = this.notebook_name | |
|
1837 | var path = json.path | |
|
1831 | this.notebook_name = json.name; | |
|
1832 | var name = this.notebook_name; | |
|
1833 | var path = json.path; | |
|
1838 | 1834 | this.session.rename_notebook(name, path); |
|
1839 | 1835 | $([IPython.events]).trigger('notebook_renamed.Notebook', json); |
|
1840 | 1836 | } |
@@ -1889,10 +1885,10 b' var IPython = (function (IPython) {' | |||
|
1889 | 1885 | error : $.proxy(this.load_notebook_error,this), |
|
1890 | 1886 | }; |
|
1891 | 1887 | $([IPython.events]).trigger('notebook_loading.Notebook'); |
|
1892 |
var url = utils.url_ |
|
|
1888 | var url = utils.url_join_encode( | |
|
1893 | 1889 | this._baseProjectUrl, |
|
1894 | 1890 | 'api/notebooks', |
|
1895 |
this.notebook |
|
|
1891 | this.notebook_path, | |
|
1896 | 1892 | this.notebook_name |
|
1897 | 1893 | ); |
|
1898 | 1894 | $.ajax(url, settings); |
@@ -2027,10 +2023,10 b' var IPython = (function (IPython) {' | |||
|
2027 | 2023 | * @method list_checkpoints |
|
2028 | 2024 | */ |
|
2029 | 2025 | Notebook.prototype.list_checkpoints = function () { |
|
2030 |
var url = utils.url_ |
|
|
2031 |
this.baseProjectUrl |
|
|
2026 | var url = utils.url_join_encode( | |
|
2027 | this._baseProjectUrl, | |
|
2032 | 2028 | 'api/notebooks', |
|
2033 |
this.notebook |
|
|
2029 | this.notebook_path, | |
|
2034 | 2030 | this.notebook_name, |
|
2035 | 2031 | 'checkpoints' |
|
2036 | 2032 | ); |
@@ -2078,8 +2074,8 b' var IPython = (function (IPython) {' | |||
|
2078 | 2074 | * @method create_checkpoint |
|
2079 | 2075 | */ |
|
2080 | 2076 | Notebook.prototype.create_checkpoint = function () { |
|
2081 |
var url = utils.url_ |
|
|
2082 |
this.baseProjectUrl |
|
|
2077 | var url = utils.url_join_encode( | |
|
2078 | this._baseProjectUrl, | |
|
2083 | 2079 | 'api/notebooks', |
|
2084 | 2080 | this.notebookPath(), |
|
2085 | 2081 | this.notebook_name, |
@@ -2165,8 +2161,8 b' var IPython = (function (IPython) {' | |||
|
2165 | 2161 | */ |
|
2166 | 2162 | Notebook.prototype.restore_checkpoint = function (checkpoint) { |
|
2167 | 2163 | $([IPython.events]).trigger('notebook_restoring.Notebook', checkpoint); |
|
2168 |
var url = utils.url_ |
|
|
2169 |
this.baseProjectUrl |
|
|
2164 | var url = utils.url_join_encode( | |
|
2165 | this._baseProjectUrl, | |
|
2170 | 2166 | 'api/notebooks', |
|
2171 | 2167 | this.notebookPath(), |
|
2172 | 2168 | this.notebook_name, |
@@ -2213,8 +2209,8 b' var IPython = (function (IPython) {' | |||
|
2213 | 2209 | */ |
|
2214 | 2210 | Notebook.prototype.delete_checkpoint = function (checkpoint) { |
|
2215 | 2211 | $([IPython.events]).trigger('notebook_restoring.Notebook', checkpoint); |
|
2216 |
var url = utils.url_ |
|
|
2217 |
this.baseProjectUrl |
|
|
2212 | var url = utils.url_join_encode( | |
|
2213 | this._baseProjectUrl, | |
|
2218 | 2214 | 'api/notebooks', |
|
2219 | 2215 | this.notebookPath(), |
|
2220 | 2216 | this.notebook_name, |
@@ -128,8 +128,8 b' var IPython = (function (IPython) {' | |||
|
128 | 128 | SaveWidget.prototype.update_address_bar = function(){ |
|
129 | 129 | var nbname = IPython.notebook.notebook_name; |
|
130 | 130 | var path = IPython.notebook.notebookPath(); |
|
131 |
var state = {path : utils.url_ |
|
|
132 |
window.history.replaceState(state, "", utils.url_ |
|
|
131 | var state = {path : utils.url_join_encode(path, nbname)}; | |
|
132 | window.history.replaceState(state, "", utils.url_join_encode( | |
|
133 | 133 | "/notebooks", |
|
134 | 134 | path, |
|
135 | 135 | nbname) |
@@ -113,7 +113,7 b' var IPython = (function (IPython) {' | |||
|
113 | 113 | $([IPython.events]).trigger('status_restarting.Kernel', {kernel: this}); |
|
114 | 114 | if (this.running) { |
|
115 | 115 | this.stop_channels(); |
|
116 |
var url = utils.url_ |
|
|
116 | var url = utils.url_join_encode(this.kernel_url, "restart"); | |
|
117 | 117 | $.post(url, |
|
118 | 118 | $.proxy(this._kernel_started, this), |
|
119 | 119 | 'json' |
@@ -133,7 +133,7 b' var IPython = (function (IPython) {' | |||
|
133 | 133 | ws_url = prot + location.host + ws_url; |
|
134 | 134 | } |
|
135 | 135 | this.ws_url = ws_url; |
|
136 |
this.kernel_url = utils.url_ |
|
|
136 | this.kernel_url = utils.url_join_encode(this.base_url, this.kernel_id); | |
|
137 | 137 | this.start_channels(); |
|
138 | 138 | }; |
|
139 | 139 |
@@ -44,7 +44,7 b' var IPython = (function (IPython) {' | |||
|
44 | 44 | } |
|
45 | 45 | }, |
|
46 | 46 | }; |
|
47 |
var url = utils.url_ |
|
|
47 | var url = utils.url_join_encode(this._baseProjectUrl, 'api/sessions'); | |
|
48 | 48 | $.ajax(url, settings); |
|
49 | 49 | }; |
|
50 | 50 | |
@@ -64,7 +64,7 b' var IPython = (function (IPython) {' | |||
|
64 | 64 | data: JSON.stringify(model), |
|
65 | 65 | dataType : "json", |
|
66 | 66 | }; |
|
67 |
var url = utils.url_ |
|
|
67 | var url = utils.url_join_encode(this._baseProjectUrl, 'api/sessions', this.id); | |
|
68 | 68 | $.ajax(url, settings); |
|
69 | 69 | }; |
|
70 | 70 | |
@@ -76,7 +76,7 b' var IPython = (function (IPython) {' | |||
|
76 | 76 | dataType : "json", |
|
77 | 77 | }; |
|
78 | 78 | this.kernel.running = false; |
|
79 |
var url = utils.url_ |
|
|
79 | var url = utils.url_join_encode(this._baseProjectUrl, 'api/sessions', this.id); | |
|
80 | 80 | $.ajax(url, settings); |
|
81 | 81 | }; |
|
82 | 82 |
@@ -51,7 +51,7 b' var IPython = (function (IPython) {' | |||
|
51 | 51 | dataType : "json", |
|
52 | 52 | success : $.proxy(this.load_list_success, this) |
|
53 | 53 | }; |
|
54 |
var url = utils.url_ |
|
|
54 | var url = utils.url_join_encode(this.baseProjectUrl(), 'clusters'); | |
|
55 | 55 | $.ajax(url, settings); |
|
56 | 56 | }; |
|
57 | 57 | |
@@ -137,7 +137,7 b' var IPython = (function (IPython) {' | |||
|
137 | 137 | } |
|
138 | 138 | }; |
|
139 | 139 | status_col.html('starting'); |
|
140 |
var url = utils.url_ |
|
|
140 | var url = utils.url_join_encode( | |
|
141 | 141 | that.baseProjectUrl(), |
|
142 | 142 | 'clusters', |
|
143 | 143 | that.data.profile, |
@@ -179,7 +179,7 b' var IPython = (function (IPython) {' | |||
|
179 | 179 | } |
|
180 | 180 | }; |
|
181 | 181 | status_col.html('stopping'); |
|
182 |
var url = utils.url_ |
|
|
182 | var url = utils.url_join_encode( | |
|
183 | 183 | that.baseProjectUrl(), |
|
184 | 184 | 'clusters', |
|
185 | 185 | that.data.profile, |
@@ -147,7 +147,7 b' var IPython = (function (IPython) {' | |||
|
147 | 147 | },this) |
|
148 | 148 | }; |
|
149 | 149 | |
|
150 |
var url = utils.url_ |
|
|
150 | var url = utils.url_join_encode( | |
|
151 | 151 | this.baseProjectUrl(), |
|
152 | 152 | 'api', |
|
153 | 153 | 'notebooks', |
@@ -177,7 +177,7 b' var IPython = (function (IPython) {' | |||
|
177 | 177 | var nbname = utils.splitext(name)[0]; |
|
178 | 178 | var item = this.new_notebook_item(i); |
|
179 | 179 | this.add_link(path, nbname, item); |
|
180 |
name = utils.url_path_join( |
|
|
180 | name = utils.url_path_join(path, name); | |
|
181 | 181 | if(this.sessions[name] === undefined){ |
|
182 | 182 | this.add_delete_button(item); |
|
183 | 183 | } else { |
@@ -214,10 +214,10 b' var IPython = (function (IPython) {' | |||
|
214 | 214 | item.find(".item_name").text(nbname); |
|
215 | 215 | item.find("a.item_link") |
|
216 | 216 | .attr('href', |
|
217 |
utils.url_ |
|
|
217 | utils.url_join_encode( | |
|
218 | 218 | this.baseProjectUrl(), |
|
219 | 219 | "notebooks", |
|
220 |
|
|
|
220 | path, | |
|
221 | 221 | nbname + ".ipynb" |
|
222 | 222 | ) |
|
223 | 223 | ).attr('target','_blank'); |
@@ -254,7 +254,7 b' var IPython = (function (IPython) {' | |||
|
254 | 254 | that.load_sessions(); |
|
255 | 255 | } |
|
256 | 256 | }; |
|
257 |
var url = utils.url_ |
|
|
257 | var url = utils.url_join_encode( | |
|
258 | 258 | that.baseProjectUrl(), |
|
259 | 259 | 'api/sessions', |
|
260 | 260 | session |
@@ -294,11 +294,11 b' var IPython = (function (IPython) {' | |||
|
294 | 294 | parent_item.remove(); |
|
295 | 295 | } |
|
296 | 296 | }; |
|
297 |
var url = utils.url_ |
|
|
297 | var url = utils.url_join_encode( | |
|
298 | 298 | notebooklist.baseProjectUrl(), |
|
299 | 299 | 'api/notebooks', |
|
300 | 300 | notebooklist.notebookPath(), |
|
301 |
|
|
|
301 | nbname + '.ipynb' | |
|
302 | 302 | ); |
|
303 | 303 | $.ajax(url, settings); |
|
304 | 304 | } |
@@ -339,7 +339,7 b' var IPython = (function (IPython) {' | |||
|
339 | 339 | } |
|
340 | 340 | }; |
|
341 | 341 | |
|
342 |
var url = utils.url_ |
|
|
342 | var url = utils.url_join_encode( | |
|
343 | 343 | that.baseProjectUrl(), |
|
344 | 344 | 'api/notebooks', |
|
345 | 345 | that.notebookPath(), |
@@ -373,7 +373,7 b' var IPython = (function (IPython) {' | |||
|
373 | 373 | success : function (data, status, xhr) { |
|
374 | 374 | var notebook_name = data.name; |
|
375 | 375 | window.open( |
|
376 |
utils.url_ |
|
|
376 | utils.url_join_encode( | |
|
377 | 377 | base_project_url, |
|
378 | 378 | 'notebooks', |
|
379 | 379 | path, |
@@ -382,7 +382,7 b' var IPython = (function (IPython) {' | |||
|
382 | 382 | ); |
|
383 | 383 | } |
|
384 | 384 | }; |
|
385 |
var url = utils.url_ |
|
|
385 | var url = utils.url_join_encode( | |
|
386 | 386 | base_project_url, |
|
387 | 387 | 'api/notebooks', |
|
388 | 388 | path |
General Comments 0
You need to be logged in to leave comments.
Login now