We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 01e8289 commit d6dc4feCopy full SHA for d6dc4fe
open-in-swan/src/index.js
@@ -8,10 +8,15 @@ const appInfo = {
8
{
9
extension: 'ipynb',
10
handler: (info) => {
11
- window.open(
12
- 'https://cern.ch/swanserver/cgi-bin/go?projurl=file:/' + info.filePath,
13
- '_blank'
14
- )
+ if (info.filePath.startsWith('/files')) {
+ let path = info.filePath.split('/')
+ path.splice(0, 3)
+ path = path.join('/')
15
+ window.open('https://cern.ch/swanserver/cgi-bin/go?projurl=file://' + path, '_blank')
16
+ } else {
17
+ // FIXME
18
+ alert('Cannot open this file in SWAN')
19
+ }
20
},
21
canBeDefault: false
22
}
0 commit comments