@@ -11,6 +11,7 @@ import styles from "./useOpenWithMenuItems.module.css";
11
11
12
12
enum AppKeys {
13
13
AGAVE = "agave" ,
14
+ BROWSER = "browser" ,
14
15
NEUROGLANCER = "neuroglancer" ,
15
16
SIMULARIUM = "simularium" ,
16
17
VOLE = "vole" ,
@@ -19,6 +20,7 @@ enum AppKeys {
19
20
20
21
interface Apps {
21
22
[ AppKeys . AGAVE ] : IContextualMenuItem ;
23
+ [ AppKeys . BROWSER ] : IContextualMenuItem ;
22
24
[ AppKeys . NEUROGLANCER ] : IContextualMenuItem ;
23
25
[ AppKeys . SIMULARIUM ] : IContextualMenuItem ;
24
26
[ AppKeys . VOLE ] : IContextualMenuItem ;
@@ -72,11 +74,27 @@ const APPS = (fileDetails?: FileDetail): Apps => ({
72
74
) ;
73
75
} ,
74
76
} as IContextualMenuItem ,
77
+ [ AppKeys . BROWSER ] : {
78
+ key : AppKeys . BROWSER ,
79
+ text : "Browser" ,
80
+ title : `Open files in the current browser in a new tab` ,
81
+ href : fileDetails ?. path ,
82
+ disabled : ! fileDetails ?. path ,
83
+ target : "_blank" ,
84
+ onRenderContent ( props , defaultRenders ) {
85
+ return (
86
+ < >
87
+ { defaultRenders . renderItemName ( props ) }
88
+ < span className = { styles . secondaryText } > Web</ span >
89
+ </ >
90
+ ) ;
91
+ } ,
92
+ } as IContextualMenuItem ,
75
93
[ AppKeys . NEUROGLANCER ] : {
76
94
key : AppKeys . NEUROGLANCER ,
77
95
text : "Neuroglancer" ,
78
96
title : `Open files with Neuroglancer` ,
79
- href : `https://neuroglancer-demo.appspot.com/#!{%22layers%22:[{%22source%22:%22zarr://${ fileDetails ?. cloudPath } %22,%22name%22:%22${ fileDetails ?. name } %22}]}` ,
97
+ href : `https://neuroglancer-demo.appspot.com/#!{%22layers%22:[{%22source%22:%22zarr://${ fileDetails ?. path } %22,%22name%22:%22${ fileDetails ?. name } %22}]}` ,
80
98
disabled : ! fileDetails ?. path ,
81
99
target : "_blank" ,
82
100
onRenderContent ( props , defaultRenders ) {
@@ -92,7 +110,7 @@ const APPS = (fileDetails?: FileDetail): Apps => ({
92
110
key : AppKeys . SIMULARIUM ,
93
111
text : "Simularium" ,
94
112
title : `Open files with Simularium` ,
95
- href : `https://simularium.allencell.org/viewer?trajUrl=${ fileDetails ?. cloudPath } ` ,
113
+ href : `https://simularium.allencell.org/viewer?trajUrl=${ fileDetails ?. path } ` ,
96
114
disabled : ! fileDetails ?. path ,
97
115
target : "_blank" ,
98
116
onRenderContent ( props , defaultRenders ) {
@@ -108,7 +126,7 @@ const APPS = (fileDetails?: FileDetail): Apps => ({
108
126
key : AppKeys . VOLE ,
109
127
text : "Vol-E" ,
110
128
title : `Open files with Vol-E` ,
111
- href : `https://volumeviewer.allencell.org/viewer?url=${ fileDetails ?. cloudPath } /` ,
129
+ href : `https://volumeviewer.allencell.org/viewer?url=${ fileDetails ?. path } /` ,
112
130
disabled : ! fileDetails ?. path ,
113
131
target : "_blank" ,
114
132
onRenderContent ( props , defaultRenders ) {
@@ -124,7 +142,7 @@ const APPS = (fileDetails?: FileDetail): Apps => ({
124
142
key : AppKeys . VOLVIEW ,
125
143
text : "VolView" ,
126
144
title : `Open files with VolView` ,
127
- href : `https://volview.kitware.app/?urls=[${ fileDetails ?. cloudPath } ]` ,
145
+ href : `https://volview.kitware.app/?urls=[${ fileDetails ?. path } ]` ,
128
146
disabled : ! fileDetails ?. path ,
129
147
target : "_blank" ,
130
148
onRenderContent ( props , defaultRenders ) {
@@ -149,6 +167,17 @@ function getSupportedApps(fileDetails?: FileDetail): IContextualMenuItem[] {
149
167
const fileExt = fileDetails . path . slice ( fileDetails . path . lastIndexOf ( "." ) + 1 ) . toLowerCase ( ) ;
150
168
const apps = APPS ( fileDetails ) ;
151
169
switch ( fileExt ) {
170
+ case "bmp" :
171
+ case "html" :
172
+ case "gif" :
173
+ case "jpg" :
174
+ case "jpeg" :
175
+ case "pdf" :
176
+ case "png" :
177
+ case "svg" :
178
+ case "txt" :
179
+ case "xml" :
180
+ return [ apps . browser ] ;
152
181
case "simularium" :
153
182
return [ apps . simularium ] ;
154
183
case "dcm" :
0 commit comments