Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/contents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export class Drive implements Contents.IDrive {
mimetype: '',
size: undefined,
writable: true,
type: 'directory'
type: 'drive'
});
}
} catch (err) {
Expand Down
14 changes: 13 additions & 1 deletion src/plugins/driveBrowserPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const driveFileBrowser: JupyterFrontEndPlugin<void> = {
console.log(
'JupyterLab extension jupyter-drives:drives-file-browser is activated!'
);
const { commands } = app;
const { commands, docRegistry } = app;

// create drive for drive file browser
const drive = new Drive({
Expand Down Expand Up @@ -196,6 +196,18 @@ export const driveFileBrowser: JupyterFrontEndPlugin<void> = {
restorer.add(driveBrowser, 'drive-file-browser');
}

// Registering the custom directory file type
docRegistry.addFileType({
name: 'drive',
displayName: 'Drive',
contentType: 'directory',
fileFormat: 'json',
mimeTypes: ['text/directory'],
extensions: [],
icon: driveBrowserIcon,
pattern: '^'
});

// Register status bar widget
if (statusBar) {
const driveStatusWidget = new DriveStatusWidget();
Expand Down
Loading