Skip to content
Snippets Groups Projects
Unverified Commit 7bf5d4c5 authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire:
Browse files

Allow globally overriding slots in the light dom of components and use it to...

Allow globally overriding slots in the light dom of components and use it to override the auth-info slot in the Nextcloud file picker
parent cff4f7d0
No related branches found
No related tags found
No related merge requests found
Pipeline #47499 passed
......@@ -92,10 +92,10 @@
nextcloud-web-app-password-url="<%= nextcloudWebAppPasswordURL %>"
nextcloud-webdav-url="<%= nextcloudWebDavURL %>"
nextcloud-name="<%= nextcloudName %>"
nextcloud-auth-info=""
nextcloud-file-url="<%= nextcloudFileURL %>"
initial-file-handling-state
clipboard-files
html-overrides="global-override"
auth requested-login-status analytics-event
src="<%= getUrl(name + '.topic.metadata.json') %>"
base-path="<%= getUrl('') %>"
......@@ -137,28 +137,23 @@
</template>
</<%= name %>>
<template id="global-override">
<template id="dbp-nextcloud-file-picker">
<div slot="auth-info">
<dbp-translated subscribe="lang">
<div slot="de">
<%= nextcloudAuthInfoDE %>
</div>
<div slot="en">
<%= nextcloudAuthInfoEN %>
</div>
</dbp-translated>
</div>
</template>
</template>
<!-- Error handling for too old browsers -->
<script src="<%= getPrivateUrl('browser-check.js') %>" defer></script>
<noscript>Diese Applikation benötigt Javascript / This application requires Javascript</noscript>
<script>
const langTexts = {
"de": {
"nextcloud-auth-info": "<%= nextcloudAuthInfoDE %>",
},
"en": {
"nextcloud-auth-info": "<%= nextcloudAuthInfoEN %>",
},
}
window.addEventListener('dbp-lang', function (e) {
const lang = e.detail;
if (!lang) {
return;
}
const app = document.getElementById("app");
app.setAttribute("nextcloud-auth-info", langTexts[lang]["nextcloud-auth-info"]);
});
</script>
</body>
</html>
\ No newline at end of file
Subproject commit 1c81f7e344a4fdd5a3aec0612f5ba325b64fbad9
Subproject commit e3594e1de8d3ed44c88b2d7afa5316a91933a001
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