##// END OF EJS Templates
add missing error dialogs to tree actions...
Min RK -
Show More
@@ -85,16 +85,20 b' define(['
85 85 url += "?kernel_name=" + kernel_name;
86 86 }
87 87 w.location = url;
88 },
89 function (error) {
90 w.close();
91 dialog.modal({
92 title : 'Creating Notebook Failed',
93 body : "The error was: " + error.message,
94 buttons : {'OK' : {'class' : 'btn-primary'}}
95 });
96 }
97 );
88 }).catch(function (e) {
89 w.close();
90 dialog.modal({
91 title : 'Creating Notebook Failed',
92 body : $('<div/>')
93 .text("An error occurred while creating a new notebook.")
94 .append($('<div/>')
95 .addClass('alert alert-danger')
96 .text(e.message || e)),
97 buttons: {
98 OK: {'class' : 'btn-primary'}
99 }
100 });
101 });
98 102 };
99 103
100 104 return {'NewNotebookWidget': NewNotebookWidget};
@@ -78,6 +78,19 b' define(['
78 78 that.base_url, 'edit', data.path
79 79 );
80 80 w.location = url;
81 }).catch(function (e) {
82 w.close();
83 dialog.modal({
84 title: 'Creating File Failed',
85 body: $('<div/>')
86 .text("An error occurred while creating a new file.")
87 .append($('<div/>')
88 .addClass('alert alert-danger')
89 .text(e.message || e)),
90 buttons: {
91 OK: {'class': 'btn-primary'}
92 }
93 });
81 94 });
82 95 that.load_sessions();
83 96 });
@@ -85,7 +98,20 b' define(['
85 98 that.contents.new_untitled(that.notebook_path || '', {type: 'directory'})
86 99 .then(function(){
87 100 that.load_list();
101 }).catch(function (e) {
102 dialog.modal({
103 title: 'Creating Folder Failed',
104 body: $('<div/>')
105 .text("An error occurred while creating a new folder.")
106 .append($('<div/>')
107 .addClass('alert alert-danger')
108 .text(e.message || e)),
109 buttons: {
110 OK: {'class': 'btn-primary'}
111 }
112 });
88 113 });
114 that.load_sessions();
89 115 });
90 116
91 117 $('.rename-button').click($.proxy(this.rename_selected, this));
@@ -462,7 +488,7 b' define(['
462 488 );
463 489 $.ajax(url, settings);
464 490 }
465 }
491 };
466 492
467 493 NotebookList.prototype.rename_selected = function() {
468 494 if (this.selected.length != 1) return;
@@ -488,12 +514,14 b' define(['
488 514 that.load_list();
489 515 }).catch(function(e) {
490 516 dialog.modal({
491 title : "Error",
492 body : $('<div/>')
517 title: "Rename Failed",
518 body: $('<div/>')
493 519 .text("An error occurred while renaming \"" + path + "\" to \"" + input.val() + "\".")
494 .append($('<div/>').addClass('alert alert-danger').text(String(e))),
495 buttons : {
496 OK : {}
520 .append($('<div/>')
521 .addClass('alert alert-danger')
522 .text(e.message || e)),
523 buttons: {
524 OK: {'class': 'btn-primary'}
497 525 }
498 526 });
499 527 });
@@ -539,12 +567,14 b' define(['
539 567 that.notebook_deleted(item.path);
540 568 }).catch(function(e) {
541 569 dialog.modal({
542 title : "Error",
543 body : $('<div/>')
570 title: "Delete Failed",
571 body: $('<div/>')
544 572 .text("An error occurred while deleting \"" + item.path + "\".")
545 .append($('<div/>').addClass('alert alert-danger').text(String(e))),
546 buttons : {
547 OK : {}
573 .append($('<div/>')
574 .addClass('alert alert-danger')
575 .text(e.message || e)),
576 buttons: {
577 OK: {'class': 'btn-primary'}
548 578 }
549 579 });
550 580 });
@@ -576,12 +606,14 b' define(['
576 606 that.load_list();
577 607 }).catch(function(e) {
578 608 dialog.modal({
579 title : "Error",
580 body : $('<div/>')
581 .text("An error occurred while copying \"" + item.path + "\".")
582 .append($('<div/>').addClass('alert alert-danger').text(String(e))),
583 buttons : {
584 OK : {}
609 title: "Delete Failed",
610 body: $('<div/>')
611 .text("An error occurred while deleting \"" + item.path + "\".")
612 .append($('<div/>')
613 .addClass('alert alert-danger')
614 .text(e.message || e)),
615 buttons: {
616 OK: {'class': 'btn-primary'}
585 617 }
586 618 });
587 619 });
General Comments 0
You need to be logged in to leave comments. Login now