Skip to content
Snippets Groups Projects
Commit cab6c3f0 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Use getAssetURL() from common

parent c1d34613
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<script type="module" id="vpu-auth-wc-src" src="bundle.js"></script> <script type="module" id="vpu-auth-src" src="bundle.js"></script>
</head> </head>
<body> <body>
......
export const getAssetURL = (path) => {
const elm = document.getElementById('vpu-library-app-src');
if (!elm)
return path;
const url = elm.src;
// newer browsers only
//var url = import.meta.url;
return new URL(path, url).href;
};
...@@ -3,7 +3,6 @@ import {html, LitElement} from 'lit-element'; ...@@ -3,7 +3,6 @@ import {html, LitElement} from 'lit-element';
import './vpu-auth'; import './vpu-auth';
import * as commonUtils from 'vpu-common/utils'; import * as commonUtils from 'vpu-common/utils';
import bulmaCSSPath from "bulma/css/bulma.min.css"; import bulmaCSSPath from "bulma/css/bulma.min.css";
import * as utils from "./utils";
class AuthDemo extends LitElement { class AuthDemo extends LitElement {
constructor() { constructor() {
...@@ -28,7 +27,8 @@ class AuthDemo extends LitElement { ...@@ -28,7 +27,8 @@ class AuthDemo extends LitElement {
} }
render() { render() {
const bulmaCSS = utils.getAssetURL(bulmaCSSPath); commonUtils.initAssetBaseURL('vpu-auth-src');
const bulmaCSS = commonUtils.getAssetURL(bulmaCSSPath);
return html` return html`
<link rel="stylesheet" href="${bulmaCSS}"> <link rel="stylesheet" href="${bulmaCSS}">
......
...@@ -4,7 +4,6 @@ import JSONLD from 'vpu-common/jsonld' ...@@ -4,7 +4,6 @@ import JSONLD from 'vpu-common/jsonld'
import * as commonUtils from 'vpu-common/utils'; import * as commonUtils from 'vpu-common/utils';
import 'vpu-common/vpu-icon.js'; import 'vpu-common/vpu-icon.js';
import bulmaCSSPath from "bulma/css/bulma.min.css"; import bulmaCSSPath from "bulma/css/bulma.min.css";
import * as utils from "./utils";
/** /**
* Keycloak auth web component * Keycloak auth web component
...@@ -298,7 +297,8 @@ class VPUAuth extends LitElement { ...@@ -298,7 +297,8 @@ class VPUAuth extends LitElement {
} }
render() { render() {
const bulmaCSS = utils.getAssetURL(bulmaCSSPath); commonUtils.initAssetBaseURL('vpu-auth-src');
const bulmaCSS = commonUtils.getAssetURL(bulmaCSSPath);
return html` return html`
<link rel="stylesheet" href="${bulmaCSS}"> <link rel="stylesheet" href="${bulmaCSS}">
......
common @ adbdf637
Subproject commit 91947464b55c79c5b0aa2188f512e08ebc0be612 Subproject commit adbdf63736ba48eaf93ca06f83ee3652b7f85f12
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment