##// END OF EJS Templates
Eliminate remaining uses of extra_settings
Thomas Kluyver -
Show More
@@ -1892,7 +1892,7 define([
1892 *
1892 *
1893 * @method save_notebook
1893 * @method save_notebook
1894 */
1894 */
1895 Notebook.prototype.save_notebook = function (extra_settings) {
1895 Notebook.prototype.save_notebook = function () {
1896 // Create a JSON model to be sent to the server.
1896 // Create a JSON model to be sent to the server.
1897 var model = {
1897 var model = {
1898 type : "notebook",
1898 type : "notebook",
@@ -1903,7 +1903,6 define([
1903
1903
1904 var that = this;
1904 var that = this;
1905 this.contents.save(this.notebook_path, model, {
1905 this.contents.save(this.notebook_path, model, {
1906 extra_settings: extra_settings,
1907 success: $.proxy(this.save_notebook_success, this, start),
1906 success: $.proxy(this.save_notebook_success, this, start),
1908 error: function (error) {
1907 error: function (error) {
1909 that.events.trigger('notebook_save_failed.Notebook', error);
1908 that.events.trigger('notebook_save_failed.Notebook', error);
@@ -1977,7 +1976,7 define([
1977 *
1976 *
1978 * @method trust_notebook
1977 * @method trust_notebook
1979 */
1978 */
1980 Notebook.prototype.trust_notebook = function (extra_settings) {
1979 Notebook.prototype.trust_notebook = function () {
1981 var body = $("<div>").append($("<p>")
1980 var body = $("<div>").append($("<p>")
1982 .text("A trusted IPython notebook may execute hidden malicious code ")
1981 .text("A trusted IPython notebook may execute hidden malicious code ")
1983 .append($("<strong>")
1982 .append($("<strong>")
@@ -2024,15 +2023,18 define([
2024
2023
2025 Notebook.prototype.copy_notebook = function(){
2024 Notebook.prototype.copy_notebook = function(){
2026 var base_url = this.base_url;
2025 var base_url = this.base_url;
2026 var w = window.open();
2027 var parent = utils.url_path_split(this.notebook_path)[0];
2027 var parent = utils.url_path_split(this.notebook_path)[0];
2028 this.contents.copy(this.notebook_path, parent, {
2028 this.contents.copy(this.notebook_path, parent, {
2029 // synchronous so we can open a new window on success
2030 extra_settings: {async: false},
2031 success: function (data) {
2029 success: function (data) {
2032 window.open(utils.url_join_encode(
2030 w.location = utils.url_join_encode(
2033 base_url, 'notebooks', data.path
2031 base_url, 'notebooks', data.path
2034 ), '_blank');
2032 );
2035 }
2033 },
2034 error : function(error) {
2035 w.close();
2036 console.log(error);
2037 },
2036 });
2038 });
2037 };
2039 };
2038
2040
@@ -162,9 +162,6 define([
162 success : options.success || function() {},
162 success : options.success || function() {},
163 error : this.create_basic_error_handler(options.error)
163 error : this.create_basic_error_handler(options.error)
164 };
164 };
165 if (options.extra_settings) {
166 $.extend(settings, options.extra_settings);
167 }
168 var url = this.api_url(path);
165 var url = this.api_url(path);
169 $.ajax(url, settings);
166 $.ajax(url, settings);
170 };
167 };
@@ -182,9 +179,6 define([
182 success: options.success || function() {},
179 success: options.success || function() {},
183 error: this.create_basic_error_handler(options.error)
180 error: this.create_basic_error_handler(options.error)
184 };
181 };
185 if (options.extra_settings) {
186 $.extend(settings, options.extra_settings);
187 }
188 $.ajax(url, settings);
182 $.ajax(url, settings);
189 };
183 };
190
184
General Comments 0
You need to be logged in to leave comments. Login now