File tree 1 file changed +23
-0
lines changed
notebook/static/notebook/js
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ define([
24
24
NotebookNotificationArea . prototype . init_notification_widgets = function ( ) {
25
25
this . init_kernel_notification_widget ( ) ;
26
26
this . init_notebook_notification_widget ( ) ;
27
+ this . init_trusted_notebook_notification_widget ( ) ;
27
28
} ;
28
29
29
30
/**
@@ -338,5 +339,27 @@ define([
338
339
} ) ;
339
340
} ;
340
341
342
+ /**
343
+ * Initialize the notification widget for trusted notebook messages.
344
+ *
345
+ * @method init_trusted_notebook_notification_widget
346
+ */
347
+ NotebookNotificationArea . prototype . init_trusted_notebook_notification_widget = function ( ) {
348
+ var that = this ;
349
+ var tnw = this . widget ( 'trusted' ) ;
350
+
351
+ // Notebook trust events
352
+ this . events . on ( 'trust_changed.Notebook' , function ( event , trusted ) {
353
+ if ( trusted ) {
354
+ tnw . set_message ( "Trusted" ) ;
355
+ } else {
356
+ tnw . set_message ( "Not Trusted" , undefined , function ( ) {
357
+ that . notebook . trust_notebook ( ) ;
358
+ return false ;
359
+ } ) ;
360
+ }
361
+ } ) ;
362
+ } ;
363
+
341
364
return { 'NotebookNotificationArea' : NotebookNotificationArea } ;
342
365
} ) ;
You can’t perform that action at this time.
0 commit comments