@@ -11,22 +11,22 @@ import { createToolbarFactory, IToolbarWidgetRegistry } from '@jupyterlab/apputi
1111import { Widget } from '@lumino/widgets' ;
1212import { Token } from '@lumino/coreutils' ;
1313
14- export const READONLY_NOTEBOOK_FACTORY = 'ReadonlyNotebook ' ;
14+ export const VIEW_ONLY_NOTEBOOK_FACTORY = 'ViewOnlyNotebook ' ;
1515
1616const NOTEBOOK_PANEL_CLASS = 'jp-NotebookPanel' ;
1717
1818const NOTEBOOK_PANEL_TOOLBAR_CLASS = 'jp-NotebookPanel-toolbar' ;
1919
2020const NOTEBOOK_PANEL_NOTEBOOK_CLASS = 'jp-NotebookPanel-notebook' ;
2121
22- export const IReadonlyNotebookTracker = new Token < IReadonlyNotebookTracker > (
23- 'jupytereverywhere:readonly- notebook:IReadonlyNotebookTracker '
22+ export const IViewOnlyNotebookTracker = new Token < IViewOnlyNotebookTracker > (
23+ 'jupytereverywhere:view-only- notebook:IViewOnlyNotebookTracker '
2424) ;
2525
26- export interface IReadonlyNotebookTracker extends IWidgetTracker < ReadonlyNotebookPanel > { }
26+ export interface IViewOnlyNotebookTracker extends IWidgetTracker < ViewOnlyNotebookPanel > { }
2727
2828/**
29- * Creates a "View Only" header widget for read -only notebooks.
29+ * Creates a "View Only" header widget for view -only notebooks.
3030 */
3131class ViewOnlyHeader extends Widget {
3232 constructor ( ) {
@@ -39,15 +39,15 @@ class ViewOnlyHeader extends Widget {
3939 }
4040}
4141
42- class ReadonlyNotebook extends StaticNotebook {
43- // Add any customization for read -only notebook here if needed
42+ class ViewOnlyNotebook extends StaticNotebook {
43+ // Add any customization for view -only notebook here if needed
4444}
4545
46- class ReadonlyNotebookPanel extends DocumentWidget < ReadonlyNotebook , INotebookModel > {
46+ class ViewOnlyNotebookPanel extends DocumentWidget < ViewOnlyNotebook , INotebookModel > {
4747 /**
48- * Construct a new readonly notebook panel.
48+ * Construct a new view-only notebook panel.
4949 */
50- constructor ( options : DocumentWidget . IOptions < ReadonlyNotebook , INotebookModel > ) {
50+ constructor ( options : DocumentWidget . IOptions < ViewOnlyNotebook , INotebookModel > ) {
5151 super ( options ) ;
5252
5353 this . addClass ( NOTEBOOK_PANEL_CLASS ) ;
@@ -61,8 +61,8 @@ class ReadonlyNotebookPanel extends DocumentWidget<ReadonlyNotebook, INotebookMo
6161 }
6262}
6363
64- namespace ReadonlyNotebookWidgetFactory {
65- export interface IOptions extends DocumentRegistry . IWidgetFactoryOptions < ReadonlyNotebookPanel > {
64+ namespace ViewOnlyNotebookWidgetFactory {
65+ export interface IOptions extends DocumentRegistry . IWidgetFactoryOptions < ViewOnlyNotebookPanel > {
6666 rendermime : IRenderMimeRegistry ;
6767 contentFactory : Notebook . IContentFactory ;
6868 mimeTypeService : IEditorMimeTypeService ;
@@ -72,16 +72,16 @@ namespace ReadonlyNotebookWidgetFactory {
7272 }
7373}
7474
75- class ReadonlyNotebookWidgetFactory extends ABCWidgetFactory <
76- ReadonlyNotebookPanel ,
75+ class ViewOnlyNotebookWidgetFactory extends ABCWidgetFactory <
76+ ViewOnlyNotebookPanel ,
7777 INotebookModel
7878> {
7979 /**
8080 * Construct a new notebook widget factory.
8181 *
8282 * @param options - The options used to construct the factory.
8383 */
84- constructor ( private _options : ReadonlyNotebookWidgetFactory . IOptions ) {
84+ constructor ( private _options : ViewOnlyNotebookWidgetFactory . IOptions ) {
8585 super ( _options ) ;
8686 }
8787
@@ -90,8 +90,8 @@ class ReadonlyNotebookWidgetFactory extends ABCWidgetFactory<
9090 */
9191 protected createNewWidget (
9292 context : DocumentRegistry . IContext < INotebookModel > ,
93- source ?: ReadonlyNotebookPanel
94- ) : ReadonlyNotebookPanel {
93+ source ?: ViewOnlyNotebookPanel
94+ ) : ViewOnlyNotebookPanel {
9595 const translator = ( context as any ) . translator ;
9696 const { contentFactory, mimeTypeService, rendermime } = this . _options ;
9797 const nbOptions = {
@@ -108,14 +108,14 @@ class ReadonlyNotebookWidgetFactory extends ABCWidgetFactory<
108108 : this . _options . notebookConfig || StaticNotebook . defaultNotebookConfig ,
109109 translator
110110 } ;
111- const content = new ReadonlyNotebook ( nbOptions ) ;
111+ const content = new ViewOnlyNotebook ( nbOptions ) ;
112112
113- return new ReadonlyNotebookPanel ( { context, content } ) ;
113+ return new ViewOnlyNotebookPanel ( { context, content } ) ;
114114 }
115115}
116116
117- export const readonlyNotebookFactoryPlugin : JupyterFrontEndPlugin < IReadonlyNotebookTracker > = {
118- id : 'jupytereverywhere:readonly -notebook' ,
117+ export const viewOnlyNotebookFactoryPlugin : JupyterFrontEndPlugin < IViewOnlyNotebookTracker > = {
118+ id : 'jupytereverywhere:view-only -notebook' ,
119119 requires : [
120120 NotebookPanel . IContentFactory ,
121121 IEditorServices ,
@@ -124,7 +124,7 @@ export const readonlyNotebookFactoryPlugin: JupyterFrontEndPlugin<IReadonlyNoteb
124124 ISettingRegistry ,
125125 ITranslator
126126 ] ,
127- provides : IReadonlyNotebookTracker ,
127+ provides : IViewOnlyNotebookTracker ,
128128 autoStart : true ,
129129 activate : (
130130 app : JupyterFrontEnd ,
@@ -140,16 +140,16 @@ export const readonlyNotebookFactoryPlugin: JupyterFrontEndPlugin<IReadonlyNoteb
140140 const toolbarFactory = createToolbarFactory (
141141 toolbarRegistry ,
142142 settingRegistry ,
143- READONLY_NOTEBOOK_FACTORY ,
143+ VIEW_ONLY_NOTEBOOK_FACTORY ,
144144 PANEL_SETTINGS ,
145145 translator
146146 ) ;
147147
148148 const trans = translator . load ( 'jupyterlab' ) ;
149149
150- const factory = new ReadonlyNotebookWidgetFactory ( {
151- name : READONLY_NOTEBOOK_FACTORY ,
152- label : trans . __ ( 'Readonly Notebook' ) ,
150+ const factory = new ViewOnlyNotebookWidgetFactory ( {
151+ name : VIEW_ONLY_NOTEBOOK_FACTORY ,
152+ label : trans . __ ( 'View-only Notebook' ) ,
153153 fileTypes : [ 'notebook' ] ,
154154 modelName : 'notebook' ,
155155 preferKernel : false ,
@@ -162,8 +162,8 @@ export const readonlyNotebookFactoryPlugin: JupyterFrontEndPlugin<IReadonlyNoteb
162162 toolbarFactory,
163163 translator
164164 } ) ;
165- const tracker = new WidgetTracker < ReadonlyNotebookPanel > ( {
166- namespace : 'readonly -notebook'
165+ const tracker = new WidgetTracker < ViewOnlyNotebookPanel > ( {
166+ namespace : 'view-only -notebook'
167167 } ) ;
168168 factory . widgetCreated . connect ( ( sender , widget ) => {
169169 void tracker . add ( widget ) ;
0 commit comments