Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DLCM-Portal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DLCM
UI
DLCM-Portal
Commits
efab7043
Commit
efab7043
authored
4 years ago
by
Florent POITTEVIN
Browse files
Options
Downloads
Patches
Plain Diff
fix: path to JSMol
parent
f3d8ba17
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/shared/filevisualizer/services/mol-file-visualizer.service.ts
+1
-1
1 addition, 1 deletion
...ed/filevisualizer/services/mol-file-visualizer.service.ts
src/index.html
+41
-40
41 additions, 40 deletions
src/index.html
with
42 additions
and
41 deletions
src/app/shared/filevisualizer/services/mol-file-visualizer.service.ts
+
1
−
1
View file @
efab7043
...
@@ -62,7 +62,7 @@ export class MolFileVisualizerService implements AbstractFileVisualizer {
...
@@ -62,7 +62,7 @@ export class MolFileVisualizerService implements AbstractFileVisualizer {
const
molUrl
=
URL
.
createObjectURL
(
fileInfo
.
blob
);
const
molUrl
=
URL
.
createObjectURL
(
fileInfo
.
blob
);
const
iframe
=
document
.
createElement
(
"
iframe
"
);
const
iframe
=
document
.
createElement
(
"
iframe
"
);
const
html
=
"
<script src=
\"
/assets/jsmol/JSmol.min.js
\"
type=
\"
text/javascript
\"
></script>
"
+
const
html
=
"
<script src=
\"
.
/assets/jsmol/JSmol.min.js
\"
type=
\"
text/javascript
\"
></script>
"
+
"
<script>var info = {
\n
"
+
"
<script>var info = {
\n
"
+
"
color:
\"
#FFFFFF
\"
,
\n
"
+
"
color:
\"
#FFFFFF
\"
,
\n
"
+
"
height: 450,
\n
"
+
"
height: 450,
\n
"
+
...
...
This diff is collapsed.
Click to expand it.
src/index.html
+
41
−
40
View file @
efab7043
...
@@ -4,17 +4,14 @@
...
@@ -4,17 +4,14 @@
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<title>
Portal
</title>
<title>
Portal
</title>
<base
href=
"/"
>
<base
href=
"/"
>
<script
src=
"/assets/jsmol/JSmol.min.js"
type=
"text/javascript"
></script>
<script>
<script>
var
attributeTempSuffix
=
"
-temp
"
;
var
attributeTempSuffix
=
"
-temp
"
;
var
base
=
document
.
getElementsByTagName
(
"
base
"
)[
0
];
var
base
=
document
.
getElementsByTagName
(
"
base
"
)[
0
];
if
(
base
)
{
if
(
base
)
{
base
.
href
=
window
.
location
.
pathname
.
replace
(
/
\/[^\/]
+$/
,
"
/
"
);
base
.
href
=
window
.
location
.
pathname
.
replace
(
/
\/[^\/]
+$/
,
"
/
"
);
base
.
removeAttribute
(
"
href
"
+
attributeTempSuffix
);
base
.
removeAttribute
(
"
href
"
+
attributeTempSuffix
);
}
}
</script>
</script>
<meta
name=
"viewport"
<meta
name=
"viewport"
...
@@ -31,44 +28,48 @@
...
@@ -31,44 +28,48 @@
<dlcm-root></dlcm-root>
<dlcm-root></dlcm-root>
<noscript>
Please enable JavaScript to continue using this application.
</noscript>
<noscript>
Please enable JavaScript to continue using this application.
</noscript>
<script>
<script>
var
ua
=
window
.
navigator
.
userAgent
;
var
ua
=
window
.
navigator
.
userAgent
;
var
browserUnnsuported
;
var
browserUnnsuported
;
var
msie
=
ua
.
indexOf
(
'
MSIE
'
);
var
msie
=
ua
.
indexOf
(
'
MSIE
'
);
if
(
msie
>
-
1
)
{
if
(
msie
>
-
1
)
{
// IE 10 or older => return version number
// IE 10 or older => return version number
browserUnnsuported
=
"
Internet Explorer
"
+
parseInt
(
ua
.
substring
(
msie
+
5
,
ua
.
indexOf
(
'
.
'
,
msie
)),
10
);
browserUnnsuported
=
"
Internet Explorer
"
+
parseInt
(
ua
.
substring
(
msie
+
5
,
ua
.
indexOf
(
'
.
'
,
msie
)),
10
);
}
}
var
trident
=
ua
.
indexOf
(
'
Trident/
'
);
var
trident
=
ua
.
indexOf
(
'
Trident/
'
);
if
(
trident
>
-
1
)
{
if
(
trident
>
-
1
)
{
// IE 11 => return version number
// IE 11 => return version number
var
rv
=
ua
.
indexOf
(
'
rv:
'
);
var
rv
=
ua
.
indexOf
(
'
rv:
'
);
browserUnnsuported
=
"
Internet Explorer
"
+
parseInt
(
ua
.
substring
(
rv
+
3
,
ua
.
indexOf
(
'
.
'
,
rv
)),
10
);
browserUnnsuported
=
"
Internet Explorer
"
+
parseInt
(
ua
.
substring
(
rv
+
3
,
ua
.
indexOf
(
'
.
'
,
rv
)),
10
);
}
}
var
edge
=
ua
.
indexOf
(
'
Edge/
'
);
var
edge
=
ua
.
indexOf
(
'
Edge/
'
);
if
(
edge
>
-
1
)
{
if
(
edge
>
-
1
)
{
// Edge (IE 12+) => return version number
// Edge (IE 12+) => return version number
browserUnnsuported
=
"
Edge
"
+
parseInt
(
ua
.
substring
(
edge
+
5
,
ua
.
indexOf
(
'
.
'
,
edge
)),
10
);
browserUnnsuported
=
"
Edge
"
+
parseInt
(
ua
.
substring
(
edge
+
5
,
ua
.
indexOf
(
'
.
'
,
edge
)),
10
);
}
}
if
(
browserUnnsuported
)
{
if
(
browserUnnsuported
)
{
alert
(
"
Your browser
"
+
browserUnnsuported
+
"
is not supported by this application.
\n
Please use a browser more recent like Chrome or Firefox.
"
);
alert
(
"
Your browser
"
+
browserUnnsuported
+
"
is not supported by this application.
\n
Please use a browser more recent like Chrome or Firefox.
"
);
document
.
body
.
style
.
display
=
"
none
"
;
document
.
body
.
style
.
display
=
"
none
"
;
}
}
</script>
</script>
</body>
</body>
<script
src=
"./assets/jsmol/JSmol.min.js"
type=
"text/javascript"
></script>
<script>
<script>
function
handleTempAttribute
(
attributeName
)
{
function
handleTempAttribute
(
attributeName
)
{
document
.
querySelectorAll
(
"
[
"
+
attributeName
+
attributeTempSuffix
+
"
]
"
)
document
.
querySelectorAll
(
"
[
"
+
attributeName
+
attributeTempSuffix
+
"
]
"
)
.
forEach
(
function
(
element
)
{
.
forEach
(
function
(
element
)
{
element
.
setAttribute
(
attributeName
,
element
.
getAttribute
(
attributeName
+
attributeTempSuffix
));
element
.
setAttribute
(
attributeName
,
element
.
getAttribute
(
attributeName
+
attributeTempSuffix
));
element
.
removeAttribute
(
attributeName
+
attributeTempSuffix
);
element
.
removeAttribute
(
attributeName
+
attributeTempSuffix
);
});
});
}
}
handleTempAttribute
(
"
href
"
);
handleTempAttribute
(
"
href
"
);
handleTempAttribute
(
"
src
"
);
handleTempAttribute
(
"
src
"
);
</script>
</script>
</html>
</html>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment