Display "trusted" and "untrusted" notifications

pull/1658/head
Grant Nestor 10 years ago
parent 025f753c7d
commit fc072a221b

@ -24,6 +24,7 @@ define([
NotebookNotificationArea.prototype.init_notification_widgets = function () {
this.init_kernel_notification_widget();
this.init_notebook_notification_widget();
this.init_trusted_notebook_notification_widget();
};
/**
@ -338,5 +339,27 @@ define([
});
};
/**
* Initialize the notification widget for trusted notebook messages.
*
* @method init_trusted_notebook_notification_widget
*/
NotebookNotificationArea.prototype.init_trusted_notebook_notification_widget = function () {
var that = this;
var tnw = this.widget('trusted');
// Notebook trust events
this.events.on('trust_changed.Notebook', function (event, trusted) {
if (trusted) {
tnw.info("Trusted");
} else {
tnw.danger("Not Trusted", undefined, function() {
that.notebook.trust_notebook();
return false;
});
}
});
};
return {'NotebookNotificationArea': NotebookNotificationArea};
});

Loading…
Cancel
Save