Show More
@@ -134,7 +134,7 b' class NotebookManager(LoggingConfigurable):' | |||
|
134 | 134 | """Copy an existing notebook and return its new model.""" |
|
135 | 135 | model = self.get_notebook_model(name, path) |
|
136 | 136 | name = os.path.splitext(name)[0] + '-Copy' |
|
137 |
name = self.increment_filename(name, path) |
|
|
137 | name = self.increment_filename(name, path) | |
|
138 | 138 | model['name'] = name |
|
139 | 139 | model = self.save_notebook_model(model, name, path) |
|
140 | 140 | return model |
@@ -1743,47 +1743,56 b' var IPython = (function (IPython) {' | |||
|
1743 | 1743 | |
|
1744 | 1744 | Notebook.prototype.new_notebook = function(){ |
|
1745 | 1745 | var path = this.notebookPath(); |
|
1746 | var base_project_url = this.baseProjectUrl(); | |
|
1746 | 1747 | var settings = { |
|
1747 | 1748 | processData : false, |
|
1748 | 1749 | cache : false, |
|
1749 | 1750 | type : "POST", |
|
1750 | 1751 | dataType : "json", |
|
1751 | success:$.proxy(function (data, status, xhr){ | |
|
1752 | async : false, | |
|
1753 | success : function (data, status, xhr){ | |
|
1752 | 1754 | var notebook_name = data.name; |
|
1753 | 1755 | window.open( |
|
1754 | 1756 | utils.url_path_join( |
|
1755 |
|
|
|
1757 | base_project_url, | |
|
1756 | 1758 | 'notebooks', |
|
1757 |
|
|
|
1759 | path, | |
|
1758 | 1760 | notebook_name |
|
1759 | 1761 | ), |
|
1760 | 1762 | '_blank' |
|
1761 | 1763 | ); |
|
1762 |
} |
|
|
1764 | } | |
|
1763 | 1765 | }; |
|
1764 | var url = this.baseProjectUrl() + 'api/notebooks' + path; | |
|
1766 | var url = utils.url_path_join( | |
|
1767 | base_project_url, | |
|
1768 | 'api/notebooks', | |
|
1769 | path | |
|
1770 | ); | |
|
1765 | 1771 | $.ajax(url,settings); |
|
1766 | 1772 | }; |
|
1767 | 1773 | |
|
1768 | 1774 | |
|
1769 | 1775 | Notebook.prototype.copy_notebook = function(){ |
|
1770 | 1776 | var path = this.notebookPath(); |
|
1777 | var base_project_url = this.baseProjectUrl(); | |
|
1771 | 1778 | var settings = { |
|
1772 | 1779 | processData : false, |
|
1773 | 1780 | cache : false, |
|
1774 | 1781 | type : "POST", |
|
1775 | success:$.proxy(function (data, status, xhr){ | |
|
1782 | dataType : "json", | |
|
1783 | async : false, | |
|
1784 | success : function (data, status, xhr) { | |
|
1776 | 1785 | var notebook_name = data.name; |
|
1777 | 1786 | window.open(utils.url_path_join( |
|
1778 |
|
|
|
1787 | base_project_url, | |
|
1779 | 1788 | 'notebooks', |
|
1780 |
|
|
|
1789 | path, | |
|
1781 | 1790 | notebook_name |
|
1782 | )); | |
|
1783 |
} |
|
|
1791 | ), '_blank'); | |
|
1792 | } | |
|
1784 | 1793 | }; |
|
1785 | 1794 | var url = utils.url_path_join( |
|
1786 |
|
|
|
1795 | base_project_url, | |
|
1787 | 1796 | 'api/notebooks', |
|
1788 | 1797 | path, |
|
1789 | 1798 | this.notebook_name, |
@@ -364,25 +364,27 b' var IPython = (function (IPython) {' | |||
|
364 | 364 | |
|
365 | 365 | NotebookList.prototype.new_notebook = function(){ |
|
366 | 366 | var path = this.notebookPath(); |
|
367 | var base_project_url = this.baseProjectUrl(); | |
|
367 | 368 | var settings = { |
|
368 | 369 | processData : false, |
|
369 | 370 | cache : false, |
|
370 | 371 | type : "POST", |
|
371 | 372 | dataType : "json", |
|
372 | success:$.proxy(function (data, status, xhr){ | |
|
373 | async : false, | |
|
374 | success : function (data, status, xhr) { | |
|
373 | 375 | var notebook_name = data.name; |
|
374 | 376 | window.open( |
|
375 | 377 | utils.url_path_join( |
|
376 |
|
|
|
378 | base_project_url, | |
|
377 | 379 | 'notebooks', |
|
378 | 380 | path, |
|
379 | 381 | notebook_name), |
|
380 | 382 | '_blank' |
|
381 | 383 | ); |
|
382 |
} |
|
|
384 | } | |
|
383 | 385 | }; |
|
384 | 386 | var url = utils.url_path_join( |
|
385 |
|
|
|
387 | base_project_url, | |
|
386 | 388 | 'api/notebooks', |
|
387 | 389 | path |
|
388 | 390 | ); |
General Comments 0
You need to be logged in to leave comments.
Login now