From 79608ae57e09cdc22673db19e3b9b3a965d43af6 Mon Sep 17 00:00:00 2001 From: Cloos <36499953+Clooos@users.noreply.github.com> Date: Wed, 14 Feb 2024 15:35:17 +0100 Subject: [PATCH] Delete src/bubble-pop-up.ts --- src/bubble-pop-up.ts | 67 -------------------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 src/bubble-pop-up.ts diff --git a/src/bubble-pop-up.ts b/src/bubble-pop-up.ts deleted file mode 100644 index 18ed8f24..00000000 --- a/src/bubble-pop-up.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { version } from './var/version.ts'; -import { addUrlListener } from './tools/url-listener.ts'; -import { initializeContent, checkEditor } from './tools/init.ts'; -import { handlePopUp } from './cards/pop-up.ts'; -import { bubblePopUpEditor } from './editor/bubble-pop-up-editor.ts'; - -let editor; -addUrlListener(); - -class BubblePopUp extends HTMLElement { - - set hass(hass) { - - this._hass = hass; - - editor = checkEditor(); - this.editor = editor; - - initializeContent(this); - - // Initialize pop-up card - handlePopUp(this); - - if (!window.columnFix) { - window.columnFix = this.config.column_fix - } - } - - setConfig(config) { - if (!config.hash) { - throw new Error("You need to define an hash. Please note that this card must be placed inside a vertical_stack to work as a pop-up."); - } - this.config = config; - } - - getCardSize() { - // Fix the empty columns caused by the pop-ups on the dashboard - return window.columnFix ? 0 : -1; - } - - static getConfigElement() { - return document.createElement("bubble-pop-up-editor"); - } -} - -let customElementObserver = new MutationObserver((mutationsList, observer) => { - if (customElements.get("ha-panel-lovelace")) { - customElements.define("bubble-pop-up", BubblePopUp); - observer.disconnect(); - } -}); - -customElementObserver.observe(document, { childList: true, subtree: true }); - -window.customCards = window.customCards || []; -window.customCards.push({ - type: "bubble-pop-up", - name: "Bubble Pop-up", - preview: false, - description: "Just add it in a vertical-stack first." -}); - -console.info( - `%c Bubble Card - Pop-up %c ${version} `, - 'background-color: #555;color: #fff;padding: 3px 2px 3px 3px;border-radius: 14px 0 0 14px;font-family: DejaVu Sans,Verdana,Geneva,sans-serif;text-shadow: 0 1px 0 rgba(1, 1, 1, 0.3)', - 'background-color: #506eac;color: #fff;padding: 3px 3px 3px 2px;border-radius: 0 14px 14px 0;font-family: DejaVu Sans,Verdana,Geneva,sans-serif;text-shadow: 0 1px 0 rgba(1, 1, 1, 0.3)' -); \ No newline at end of file