diff --git a/src/app/shared/filevisualizer/services/mol-file-visualizer.service.ts b/src/app/shared/filevisualizer/services/mol-file-visualizer.service.ts index 308453c0295ec13b5704d93cd88099887bb710bd..2d9b38524125049fa9d5ae6d8fcdb8b477f20d49 100644 --- a/src/app/shared/filevisualizer/services/mol-file-visualizer.service.ts +++ b/src/app/shared/filevisualizer/services/mol-file-visualizer.service.ts @@ -62,7 +62,7 @@ export class MolFileVisualizerService implements AbstractFileVisualizer { const molUrl = URL.createObjectURL(fileInfo.blob); 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" + " color: \"#FFFFFF\",\n" + " height: 450,\n" + diff --git a/src/index.html b/src/index.html index c74953df992d8d84929cdd75e54b2a6086a7f0f3..b8fbc28cb7669fae5ad33dc85b886fc68e3a3890 100644 --- a/src/index.html +++ b/src/index.html @@ -4,17 +4,14 @@ <meta charset="utf-8"> <title>Portal</title> <base href="/"> - <script src="/assets/jsmol/JSmol.min.js" - type="text/javascript" - ></script> <script> - var attributeTempSuffix = "-temp"; + var attributeTempSuffix = "-temp"; - var base = document.getElementsByTagName("base")[0]; - if (base) { - base.href = window.location.pathname.replace(/\/[^\/]+$/, "/"); - base.removeAttribute("href" + attributeTempSuffix); - } + var base = document.getElementsByTagName("base")[0]; + if (base) { + base.href = window.location.pathname.replace(/\/[^\/]+$/, "/"); + base.removeAttribute("href" + attributeTempSuffix); + } </script> <meta name="viewport" @@ -31,44 +28,48 @@ <dlcm-root></dlcm-root> <noscript>Please enable JavaScript to continue using this application.</noscript> <script> - var ua = window.navigator.userAgent; + var ua = window.navigator.userAgent; - var browserUnnsuported; - var msie = ua.indexOf('MSIE '); - if (msie > -1) { - // IE 10 or older => return version number - browserUnnsuported = "Internet Explorer " + parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10); - } + var browserUnnsuported; + var msie = ua.indexOf('MSIE '); + if (msie > -1) { + // IE 10 or older => return version number + browserUnnsuported = "Internet Explorer " + parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10); + } - var trident = ua.indexOf('Trident/'); - if (trident > -1) { - // IE 11 => return version number - var rv = ua.indexOf('rv:'); - browserUnnsuported = "Internet Explorer " + parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10); - } + var trident = ua.indexOf('Trident/'); + if (trident > -1) { + // IE 11 => return version number + var rv = ua.indexOf('rv:'); + browserUnnsuported = "Internet Explorer " + parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10); + } - var edge = ua.indexOf('Edge/'); - if (edge > -1) { - // Edge (IE 12+) => return version number - browserUnnsuported = "Edge " + parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10); - } + var edge = ua.indexOf('Edge/'); + if (edge > -1) { + // Edge (IE 12+) => return version number + browserUnnsuported = "Edge " + parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10); + } - if (browserUnnsuported) { - alert("Your browser " + browserUnnsuported + " is not supported by this application.\nPlease use a browser more recent like Chrome or Firefox."); - document.body.style.display = "none"; - } + if (browserUnnsuported) { + alert("Your browser " + browserUnnsuported + " is not supported by this application.\nPlease use a browser more recent like Chrome or Firefox."); + document.body.style.display = "none"; + } </script> </body> +<script src="./assets/jsmol/JSmol.min.js" + type="text/javascript" +></script> <script> - function handleTempAttribute(attributeName) { - document.querySelectorAll("[" + attributeName + attributeTempSuffix + "]") - .forEach(function (element) { - element.setAttribute(attributeName, element.getAttribute(attributeName + attributeTempSuffix)); - element.removeAttribute(attributeName + attributeTempSuffix); - }); - } + function handleTempAttribute(attributeName) { + document.querySelectorAll("[" + attributeName + attributeTempSuffix + "]") + .forEach(function (element) { + element.setAttribute(attributeName, element.getAttribute(attributeName + attributeTempSuffix)); + element.removeAttribute(attributeName + attributeTempSuffix); + }); + } - handleTempAttribute("href"); - handleTempAttribute("src"); + handleTempAttribute("href"); + handleTempAttribute("src"); </script> + </html>