@@ -542,5 +542,65 @@ namespace Private {
542542 icon : fileIcon . bindprops ( { stylesheet : 'menuItem' } ) ,
543543 label : 'Copy Path'
544544 } ) ;
545+
546+ app . commands . addCommand ( CommandIDs . excludeDrive , {
547+ isEnabled : ( ) => {
548+ return browser . model . path === 's3:' ;
549+ } ,
550+ execute : ( ) => {
551+ const widget = tracker . currentWidget ;
552+ if ( ! widget ) {
553+ return ;
554+ }
555+ const item = widget . selectedItems ( ) . next ( ) ;
556+ if ( item . done ) {
557+ return ;
558+ }
559+
560+ const driveName : string = item . value . name ;
561+ drive . excludeDrive ( driveName ) ;
562+ } ,
563+ label : 'Exclude Drive' ,
564+ icon : driveBrowserIcon . bindprops ( { stylesheet : 'menuItem' } )
565+ } ) ;
566+
567+ app . contextMenu . addItem ( {
568+ command : CommandIDs . excludeDrive ,
569+ selector :
570+ '#drive-file-browser.jp-SidePanel .jp-DirListing-content .jp-DirListing-item[data-isdir]' ,
571+ rank : 110
572+ } ) ;
573+
574+ app . commands . addCommand ( CommandIDs . includeDrive , {
575+ isEnabled : ( ) => {
576+ return browser . model . path === 's3:' ;
577+ } ,
578+ execute : async ( ) => {
579+ return showDialog ( {
580+ title : 'Include Drive' ,
581+ body : new Private . AddPublicDriveHandler ( drive . name ) ,
582+ focusNodeSelector : 'input' ,
583+ buttons : [
584+ Dialog . cancelButton ( ) ,
585+ Dialog . okButton ( {
586+ label : 'Add' ,
587+ ariaLabel : 'Include Drive'
588+ } )
589+ ]
590+ } ) . then ( result => {
591+ if ( result . value ) {
592+ drive . includeDrive ( result . value ) ;
593+ }
594+ } ) ;
595+ } ,
596+ label : 'Include Drive' ,
597+ icon : driveBrowserIcon . bindprops ( { stylesheet : 'menuItem' } )
598+ } ) ;
599+
600+ app . contextMenu . addItem ( {
601+ command : CommandIDs . includeDrive ,
602+ selector : '#drive-file-browser.jp-SidePanel .jp-DirListing-content' ,
603+ rank : 110
604+ } ) ;
545605 }
546606}
0 commit comments