From 6bfb3fb2a531c47d9e6cf8ba39fe62714cbe3ffd Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 15 Feb 2020 14:29:41 +0100 Subject: Web: Remove AdminElement and components.js. Change-Id: Ib829e99069229866a18e2a5356330bcf952b08d4 --- .../META-INF/resources/cms2/admin/AdminElement.js | 50 ---------------------- .../META-INF/resources/cms2/admin/index.html | 2 - .../META-INF/resources/cms2/components.js | 2 - src/main/resources/templates/base.html | 1 - 4 files changed, 55 deletions(-) delete mode 100644 src/main/resources/META-INF/resources/cms2/admin/AdminElement.js delete mode 100644 src/main/resources/META-INF/resources/cms2/components.js (limited to 'src') diff --git a/src/main/resources/META-INF/resources/cms2/admin/AdminElement.js b/src/main/resources/META-INF/resources/cms2/admin/AdminElement.js deleted file mode 100644 index 36db08d..0000000 --- a/src/main/resources/META-INF/resources/cms2/admin/AdminElement.js +++ /dev/null @@ -1,50 +0,0 @@ -import {html, render} from "../../web_modules/lit-html.js"; -import {createStore} from "../../web_modules/redux.js"; - -export class AdminElement extends HTMLElement { - constructor() { - super(); - this.attachShadow({mode: "open"}); - this.store = createStore(this.update.bind(this), {switched: false}); - this.store.subscribe(this.render.bind(this)); - } - - static get observedAttributes() { - return ["greetee"]; - } - - connectedCallback () { - this.render(); - } - - attributeChangedCallback(name, oldValue, newValue) { - this.render(); - } - - onSwitchClicked(event) { - this.store.dispatch({ type: "SWITCH" }); - } - - update(state, action) { - console.log(`Processing action: ${JSON.stringify(action)}`); - switch (action.type) { - case "SWITCH": - state.switched = !state.switched; - break; - } - return state; - } - - render() { - let state = this.store.getState(); - let greetee = state.switched ? "Andreas" : this.getAttribute("greetee"); - - const template = html` -

Hello ${greetee}!

- `; - - render(template, this.shadowRoot); - } -} - -customElements.define("mlk-admin", AdminElement); diff --git a/src/main/resources/META-INF/resources/cms2/admin/index.html b/src/main/resources/META-INF/resources/cms2/admin/index.html index 9e49564..b0da45d 100644 --- a/src/main/resources/META-INF/resources/cms2/admin/index.html +++ b/src/main/resources/META-INF/resources/cms2/admin/index.html @@ -4,8 +4,6 @@ MulkCMS Admin - - diff --git a/src/main/resources/META-INF/resources/cms2/components.js b/src/main/resources/META-INF/resources/cms2/components.js deleted file mode 100644 index 61d4657..0000000 --- a/src/main/resources/META-INF/resources/cms2/components.js +++ /dev/null @@ -1,2 +0,0 @@ -import {AdminElement} from "./admin/AdminElement.js"; - diff --git a/src/main/resources/templates/base.html b/src/main/resources/templates/base.html index a6e0900..36f22a0 100644 --- a/src/main/resources/templates/base.html +++ b/src/main/resources/templates/base.html @@ -8,7 +8,6 @@ - {#insert head}{/} -- cgit v1.2.3