|
|
|
|
@ -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.set_message("Trusted");
|
|
|
|
|
} else {
|
|
|
|
|
tnw.set_message("Not Trusted", undefined, function() {
|
|
|
|
|
that.notebook.trust_notebook();
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return {'NotebookNotificationArea': NotebookNotificationArea};
|
|
|
|
|
});
|
|
|
|
|
|