From 4bbd255f16679b189bed1dc5dfc1c5f7e6758727 Mon Sep 17 00:00:00 2001 From: David Neto Date: Thu, 17 Apr 2014 16:15:26 -0400 Subject: [PATCH 1/5] Change the order of Cancel and OK button in the renaming function so it matches the user experience for the same dialog boxes used in the main dashboard --- IPython/html/static/notebook/js/savewidget.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IPython/html/static/notebook/js/savewidget.js b/IPython/html/static/notebook/js/savewidget.js index f2cfb5c56..8c7f3338a 100644 --- a/IPython/html/static/notebook/js/savewidget.js +++ b/IPython/html/static/notebook/js/savewidget.js @@ -77,7 +77,6 @@ define([ notebook: options.notebook, keyboard_manager: this.keyboard_manager, buttons : { - "Cancel": {}, "OK": { class: "btn-primary", click: function () { @@ -92,7 +91,8 @@ define([ } else { that.notebook.rename(new_name); } - }} + }}, + "Cancel": {} }, open : function (event, ui) { var that = $(this); From 6aae1e219f477ee4c4abf766affc3b2282c576e2 Mon Sep 17 00:00:00 2001 From: David Neto Date: Thu, 17 Apr 2014 16:16:42 -0400 Subject: [PATCH 2/5] Add the "Duplicate" button in the main dashboard so we can copy an existing notebook without having to start it's instance --- IPython/html/static/tree/js/notebooklist.js | 51 ++++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/IPython/html/static/tree/js/notebooklist.js b/IPython/html/static/tree/js/notebooklist.js index 8e727f50e..7ef34bec0 100644 --- a/IPython/html/static/tree/js/notebooklist.js +++ b/IPython/html/static/tree/js/notebooklist.js @@ -254,6 +254,7 @@ define([ } else if (model.type == 'notebook') { if(this.sessions[path_name] === undefined){ this.add_delete_button(item); + this.add_duplicate_button(item); } else { this.add_shutdown_button(item, this.sessions[path_name]); } @@ -306,7 +307,53 @@ define([ return false; }); // var new_buttons = item.find('a'); // shutdown_button; - item.find(".item_buttons").text("").append(shutdown_button); + item.find(".item_buttons").append(shutdown_button); + }; + + NotebookList.prototype.add_duplicate_button = function (item) { + var new_buttons = $('').addClass("btn-group pull-right"); + var notebooklist = this; + var duplicate_button = $("