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

Merge branch 'master' into provider-component

parents 4c1a9909 4b6be2af
No related branches found
No related tags found
No related merge requests found
Showing
with 71 additions and 21 deletions
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
}, },
"routing_name": "example", "routing_name": "example",
"activities": [ "activities": [
{"path": "example.metadata.json"} {"path": "example.metadata.json"},
{"path": "example2.metadata.json"}
], ],
"attributes": [] "attributes": []
} }
\ No newline at end of file
{
"element": "dbp-activity-example",
"module_src": "dbp-activity-example.js",
"routing_name": "activity-example2",
"name": {
"de": "Beispielaktivität 2",
"en": "Example Activity 2"
},
"short_name": {
"de": "Beispielaktivität 2",
"en": "Example Activity 2"
},
"description": {
"de": "Eine Beschreibung",
"en": "A Description"
}
}
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
"watch": "npm run watch-local", "watch": "npm run watch-local",
"watch-local": "rollup -c --watch", "watch-local": "rollup -c --watch",
"test": "npm run build-test && karma start --singleRun", "test": "npm run build-test && karma start --singleRun",
"publish": "can-npm-publish --verbose && npm run build && echo 'Todo: Publish' || true", "publish": "can-npm-publish --verbose 2>&1 && npm run build && echo 'Todo: Publish' || true",
"lint": "eslint ." "lint": "eslint ."
} }
} }
...@@ -65,6 +65,10 @@ export class AppShell extends ScopedElementsMixin(LitElement) { ...@@ -65,6 +65,10 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
this.matomo = null; this.matomo = null;
this._attrObserver = new MutationObserver(this.onAttributeObserved); this._attrObserver = new MutationObserver(this.onAttributeObserved);
this.shellName = 'TU Graz';
this.shellSubname= 'Graz University of Technology';
this.noBrand = false;
} }
static get scopedElements() { static get scopedElements() {
...@@ -233,7 +237,10 @@ export class AppShell extends ScopedElementsMixin(LitElement) { ...@@ -233,7 +237,10 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
_loginStatus: { type: Boolean, attribute: false }, _loginStatus: { type: Boolean, attribute: false },
matomoUrl: { type: String, attribute: "matomo-url" }, matomoUrl: { type: String, attribute: "matomo-url" },
matomoSiteId: { type: Number, attribute: "matomo-site-id" }, matomoSiteId: { type: Number, attribute: "matomo-site-id" },
noWelcomePage: { type: Boolean, attribute: "no-welcome-page" } noWelcomePage: { type: Boolean, attribute: "no-welcome-page" },
shellName: { type: String, attribute: "shell-name" },
shellSubname: { type: String, attribute: "shell-subname" },
noBrand: { type: Boolean, attribute: "no-brand" }
}; };
} }
...@@ -624,6 +631,12 @@ export class AppShell extends ScopedElementsMixin(LitElement) { ...@@ -624,6 +631,12 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
aside .menu { aside .menu {
border-bottom: black 1px solid; border-bottom: black 1px solid;
border-top-width: 0; border-top-width: 0;
width: 100%;
position: absolute;
background-color: white;
z-index: 10;
overflow-y: scroll;
white-space: nowrap;
} }
.menu li { .menu li {
...@@ -644,8 +657,6 @@ export class AppShell extends ScopedElementsMixin(LitElement) { ...@@ -644,8 +657,6 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
ul.menu.hidden { ul.menu.hidden {
display: none; display: none;
} }
} }
`; `;
} }
...@@ -762,18 +773,17 @@ export class AppShell extends ScopedElementsMixin(LitElement) { ...@@ -762,18 +773,17 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
</div> </div>
<div class="hd2-left"> <div class="hd2-left">
<div class="header"> <div class="header">
TU Graz<br>Graz University of Technology ${this.shellName}<br>${this.shellSubname}
</div> </div>
</div> </div>
<div class="hd2-right"> <div class="hd2-right">
<dbp-tugraz-logo id="main-logo" lang="${this.lang}"></dbp-tugraz-logo> <dbp-tugraz-logo id="main-logo" lang="${this.lang}" class="${classMap({hidden: this.noBrand})}"></dbp-tugraz-logo>
</div> </div>
</header> </header>
<div id="headline"> <div id="headline">
<h1 class="title">${this.topicMetaDataText('name')}</h1> <h1 class="title">${this.topicMetaDataText('name')}</h1>
</div> </div>
<aside> <aside>
<h2 class="subtitle" @click="${this.toggleMenu}"> <h2 class="subtitle" @click="${this.toggleMenu}">
${this.subtitle} ${this.subtitle}
......
...@@ -31,7 +31,8 @@ class ActivityExample extends LitElement { ...@@ -31,7 +31,8 @@ class ActivityExample extends LitElement {
render() { render() {
return html` return html`
<p>${ i18n.t('activity-example.hello-world') }</p> <h3>${i18n.t('activity-example.hello-world')}</h3>
<ul>${(Array.from(Array(100).keys())).map(i => html`<li>${i18n.t('activity-example.hello-world') + ' ' + i}</li>`)}</ul>
`; `;
} }
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="module" src="dbp-check-in-place-select-demo.js"></script> <script type="module" src="dbp-check-in-place-select-demo.js"></script>
</head> </head>
......
...@@ -45,6 +45,6 @@ ...@@ -45,6 +45,6 @@
"watch-local": "rollup -c --watch", "watch-local": "rollup -c --watch",
"watch-dev": "rollup -c --watch --environment BUILD:development", "watch-dev": "rollup -c --watch --environment BUILD:development",
"test": "npm run build-test && karma start --singleRun", "test": "npm run build-test && karma start --singleRun",
"publish": "can-npm-publish --verbose && npm run build && echo 'Todo: Publish' || true" "publish": "can-npm-publish --verbose 2>&1 && npm run build && echo 'Todo: Publish' || true"
} }
} }
...@@ -168,6 +168,8 @@ export class CheckInPlaceSelect extends ScopedElementsMixin(LitElement) { ...@@ -168,6 +168,8 @@ export class CheckInPlaceSelect extends ScopedElementsMixin(LitElement) {
}; };
}, },
processResults: function (data) { processResults: function (data) {
that.$('#check-in-place-select-dropdown').addClass('select2-bug');
that.lastResult = data; that.lastResult = data;
let transformed = that.jsonld.transformMembers(data, checkInPlaceContext); let transformed = that.jsonld.transformMembers(data, checkInPlaceContext);
const results = []; const results = [];
...@@ -185,6 +187,8 @@ export class CheckInPlaceSelect extends ScopedElementsMixin(LitElement) { ...@@ -185,6 +187,8 @@ export class CheckInPlaceSelect extends ScopedElementsMixin(LitElement) {
} }
} }
}).on("select2:select", function (e) { }).on("select2:select", function (e) {
that.$('#check-in-place-select-dropdown').removeClass('select2-bug');
// set custom element attributes // set custom element attributes
const identifier = e.params.data.id; const identifier = e.params.data.id;
const maxCapacity = e.params.data.maximumPhysicalAttendeeCapacity; const maxCapacity = e.params.data.maximumPhysicalAttendeeCapacity;
...@@ -356,6 +360,10 @@ export class CheckInPlaceSelect extends ScopedElementsMixin(LitElement) { ...@@ -356,6 +360,10 @@ export class CheckInPlaceSelect extends ScopedElementsMixin(LitElement) {
-webkit-appearance: none; -webkit-appearance: none;
} }
/* https://github.com/select2/select2/issues/5457 */
.select2-bug .loading-results {
display: none !important;
}
` `
]; ];
} }
......
...@@ -74,6 +74,13 @@ function supportsEval() { ...@@ -74,6 +74,13 @@ function supportsEval() {
return true; return true;
} }
// https://caniuse.com/abortcontroller
function supportsAbortController() {
// AbortController in older Safari is broken, so check for the signal property
// as well.
return (!!window.AbortController && Request.prototype.hasOwnProperty('signal'));
}
function isBrowserSupported() { function isBrowserSupported() {
if (!supportsEval()) { if (!supportsEval()) {
console.log("Eval support disabled, skipping browser feature detection."); console.log("Eval support disabled, skipping browser feature detection.");
...@@ -110,6 +117,11 @@ function isBrowserSupported() { ...@@ -110,6 +117,11 @@ function isBrowserSupported() {
return false; return false;
} }
if (!supportsAbortController()) {
console.log("AbortController not supported");
return false;
}
return true; return true;
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
"test": "npm run build-test && karma start --singleRun", "test": "npm run build-test && karma start --singleRun",
"watch": "rollup -c --watch", "watch": "rollup -c --watch",
"lint": "eslint .", "lint": "eslint .",
"publish": "can-npm-publish --verbose && npm run build && echo 'Todo: Publish' || true" "publish": "can-npm-publish --verbose 2>&1 && npm run build && echo 'Todo: Publish' || true"
}, },
"dependencies": { "dependencies": {
"@open-wc/scoped-elements": "^1.3.2", "@open-wc/scoped-elements": "^1.3.2",
......
...@@ -156,7 +156,7 @@ export class LoadingButton extends ScopedElementsMixin(LitElement) { ...@@ -156,7 +156,7 @@ export class LoadingButton extends ScopedElementsMixin(LitElement) {
render() { render() {
return html` return html`
<button class="button ${this.type} loading-container ${!this.loading ? "is-not-loading" : ""}" ?disabled="${this.disabled}"> <button class="button ${this.type} loading-container ${!this.loading ? "is-not-loading" : ""}" ?disabled="${this.disabled}">
<div class="label"><slot>${this.value}</slot></div> <dbp-mini-spinner class="spinner" style="display: ${this.loading ? "inline" : "none"}"></dbp-mini-spinner> <div class="label">${this.value}</div> <dbp-mini-spinner class="spinner" style="display: ${this.loading ? "inline" : "none"}"></dbp-mini-spinner>
</button> </button>
`; `;
} }
......
...@@ -51,6 +51,6 @@ ...@@ -51,6 +51,6 @@
"watch-local": "rollup -c --watch", "watch-local": "rollup -c --watch",
"watch-dev": "rollup -c --watch --environment BUILD:development", "watch-dev": "rollup -c --watch --environment BUILD:development",
"test": "npm run build-test && karma start --singleRun", "test": "npm run build-test && karma start --singleRun",
"publish": "can-npm-publish --verbose && npm run build && echo 'Todo: Publish' || true" "publish": "can-npm-publish --verbose 2>&1 && npm run build && echo 'Todo: Publish' || true"
} }
} }
{ {
"name": "@dbp-toolkit/file-handling", "name": "@dbp-toolkit/file-handling",
"version": "0.1.6", "version": "0.1.5",
"main": "src/index.js", "main": "src/index.js",
"license": "LGPL-2.1-or-later", "license": "LGPL-2.1-or-later",
"devDependencies": { "devDependencies": {
...@@ -46,6 +46,6 @@ ...@@ -46,6 +46,6 @@
"watch-local": "rollup -c --watch", "watch-local": "rollup -c --watch",
"watch-dev": "rollup -c --watch --environment BUILD:development", "watch-dev": "rollup -c --watch --environment BUILD:development",
"test": "npm run build-test && karma start --singleRun", "test": "npm run build-test && karma start --singleRun",
"publish": "can-npm-publish --verbose && npm run build && echo 'Todo: Publish' || true" "publish": "can-npm-publish --verbose 2>&1 && npm run build && echo 'Todo: Publish' || true"
} }
} }
...@@ -44,6 +44,6 @@ ...@@ -44,6 +44,6 @@
"watch-local": "rollup -c --watch", "watch-local": "rollup -c --watch",
"watch-dev": "rollup -c --watch --environment BUILD:development", "watch-dev": "rollup -c --watch --environment BUILD:development",
"test": "npm run build-test && karma start --singleRun", "test": "npm run build-test && karma start --singleRun",
"publish": "can-npm-publish --verbose && npm run build && echo 'Todo: Publish' || true" "publish": "can-npm-publish --verbose 2>&1 && npm run build && echo 'Todo: Publish' || true"
} }
} }
...@@ -40,6 +40,6 @@ ...@@ -40,6 +40,6 @@
"watch-local": "rollup -c --watch", "watch-local": "rollup -c --watch",
"watch-dev": "rollup -c --watch --environment BUILD:development", "watch-dev": "rollup -c --watch --environment BUILD:development",
"test": "npm run build-test && karma start --singleRun", "test": "npm run build-test && karma start --singleRun",
"publish": "can-npm-publish --verbose && npm run build && echo 'Todo: Publish' || true" "publish": "can-npm-publish --verbose 2>&1 && npm run build && echo 'Todo: Publish' || true"
} }
} }
...@@ -41,6 +41,6 @@ ...@@ -41,6 +41,6 @@
"watch-local": "rollup -c --watch", "watch-local": "rollup -c --watch",
"watch-dev": "rollup -c --watch --environment BUILD:development", "watch-dev": "rollup -c --watch --environment BUILD:development",
"test": "npm run build-test && karma start --singleRun", "test": "npm run build-test && karma start --singleRun",
"publish": "can-npm-publish --verbose && npm run build && echo 'Todo: Publish' || true" "publish": "can-npm-publish --verbose 2>&1 && npm run build && echo 'Todo: Publish' || true"
} }
} }
...@@ -44,6 +44,6 @@ ...@@ -44,6 +44,6 @@
"watch-local": "rollup -c --watch", "watch-local": "rollup -c --watch",
"watch-dev": "rollup -c --watch --environment BUILD:development", "watch-dev": "rollup -c --watch --environment BUILD:development",
"test": "npm run build-test && karma start --singleRun", "test": "npm run build-test && karma start --singleRun",
"publish": "can-npm-publish --verbose && npm run build && echo 'Todo: Publish' || true" "publish": "can-npm-publish --verbose 2>&1 && npm run build && echo 'Todo: Publish' || true"
} }
} }
...@@ -45,6 +45,6 @@ ...@@ -45,6 +45,6 @@
"watch-local": "rollup -c --watch", "watch-local": "rollup -c --watch",
"watch-dev": "rollup -c --watch --environment BUILD:development", "watch-dev": "rollup -c --watch --environment BUILD:development",
"test": "npm run build-test && karma start --singleRun", "test": "npm run build-test && karma start --singleRun",
"publish": "can-npm-publish --verbose && npm run build && echo 'Todo: Publish' || true" "publish": "can-npm-publish --verbose 2>&1 && npm run build && echo 'Todo: Publish' || true"
} }
} }
...@@ -47,6 +47,6 @@ ...@@ -47,6 +47,6 @@
"watch-dev": "rollup -c --watch --environment BUILD:development", "watch-dev": "rollup -c --watch --environment BUILD:development",
"test": "npm run build-test && karma start --singleRun", "test": "npm run build-test && karma start --singleRun",
"lint": "eslint .", "lint": "eslint .",
"publish": "can-npm-publish --verbose && npm run build && echo 'Todo: Publish' || true" "publish": "can-npm-publish --verbose 2>&1 && npm run build && echo 'Todo: Publish' || true"
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment