|
|
| Zeile 106: |
Zeile 106: |
| | */ | | */ |
| | | | |
| − | (function () { | + | /* ── Letzter Block: ersetzt den bisherigen mw.hook Block in Common.js ── */ |
| − | 'use strict';
| + | /* Diesen Block ans ENDE von MediaWiki:Common.js kopieren */ |
| | + | /* (den alten mw.hook('wikipage.content') Block vorher löschen) */ |
| | | | |
| − | /* ── 1. Webinar-Daten (aus Wikitext extrahiert) ────────────────────── */
| + | mw.hook('wikipage.content').add(function () { |
| − | var WEBINARE = [
| + | |
| − | { titel: 'Kanabis Release V11', datum: '28.01.2026', tag: 'kanabis', link: 'Kanabis_Webinare#Release_V11_Webinar_vom_28.01.26' },
| + | /* Seitennamen holen – alle Varianten abdecken */ |
| − | { titel: 'Betriebsführung: Digital & Bedarfsorientiert – Lünen', datum: '17.12.2025', tag: 'togo', link: 'ToGo-Erneuerungen#Betriebsf.C3.BChrung:_Digital_.26_Bedarfsorientiert_-_Webinar_vom_17.12.2025' },
| + | var seite = mw.config.get('wgPageName') || ''; |
| − | { titel: 'Automatische Kanalsanierungsplanung / Aquadocs', datum: '12.11.2025', tag: 'kasa', link: 'Automatische_Kanalsanierungsplanung' },
| + | |
| − | { titel: 'DWA A 118 / DWA M 119 – Überstau & Risikomanagement', datum: '08.10.2025', tag: 'hydraulik', link: 'Schutzkategorien_%26_%C3%9Cberflutungsgef%C3%A4hrdung#Webinar:_.C3.9Cberstau_.26_Risikomanagment_-_DWA_A_118_.2F_DWA_M_119_vom_08.10.2025' },
| + | /* Galerie auf diesen Seiten anzeigen (anpassen falls nötig): */ |
| − | { titel: 'V17 – Releasenews', datum: '04.06.2025', tag: 'release', link: 'Release_News_Version_17#Release_Webinar_V17' },
| + | var galerieSeiten = [ |
| − | { titel: 'GeoCPM – Worauf ist bei der Modellierung zu achten?', datum: '09.04.2025', tag: 'geocpm', link: 'GeoCPM_Modellierungsprozess#Worauf_ist_bei_der_Modellierung_zu_achten.3F_Webinar_vom_9.4.2025' },
| + | 'Webinare', |
| − | { titel: 'GeoCPM – Kommunale Sturzfluten / Risikomanagement', datum: '12.03.2025', tag: 'geocpm', link: 'Erneuerungen_GeoCPM#Webinar_vom_12.03.2025' },
| + | 'Video-Galerie', |
| − | { titel: 'MEGAMAP – Die intelligente Leitungsauskunft', datum: '05.03.2025', tag: 'allgemein', link: 'Megamap#Webinar_vom_05.03.2025' },
| + | 'Video_Galerie', |
| − | { titel: 'AQUA++ – Theorie, Modellierung und Fehlersuche', datum: '19.02.2025', tag: 'aqua', link: 'AQUA%2B%2B_Webinare#Webinar_vom_19.02.2025' },
| + | 'Webinar-Galerie', |
| − | { titel: 'ToGo – Digitalisierung im Kanalbetrieb', datum: '19.12.2024', tag: 'togo', link: 'ToGo-Erneuerungen#Digitalisierung_im_Kanalbetrieb_-_Webinar_vom_19.12.2024' },
| + | 'Webinar_Galerie' |
| − | { titel: 'Datenübernahme aus bestehenden GIS-Systemen', datum: '06.11.2024', tag: 'allgemein', link: 'Daten%C3%BCbernahme_Strakat' },
| |
| − | { titel: 'KI in der Zustandserfassung', datum: '09.10.2024', tag: 'kasa', link: 'KI_Zustandserfassung' },
| |
| − | { titel: 'INSIDe-Projekt', datum: '02.10.2024', tag: 'allgemein', link: 'Inside_Forschungsprojekt' },
| |
| − | { titel: 'V16 – Import Radklim & Beispiele', datum: '03.06.2024', tag: 'release', link: 'Import_RADKLIM' },
| |
| − | { titel: 'V16 – Zeichentool', datum: '27.06.2024', tag: 'release', link: 'Zeichen-Tool#Webinar_vom_27.06.2024' },
| |
| − | { titel: 'V16 – Geo3D Erneuerungen', datum: '25.06.2024', tag: 'geocpm', link: 'Geo3D-Allgemein#Webinar_vom_25.06.2024' },
| |
| − | { titel: 'V16 – GeoCPM Neuerungen: Durchlässe, Video', datum: '20.06.2024', tag: 'geocpm', link: 'Durchlass_GeoCPM#Durchl%C3%A4sse_-_Webinar_vom_20.06.2024' },
| |
| − | { titel: 'V16 – Releasenews', datum: '18.06.2024', tag: 'release', link: 'Release_News#Release_Webinar_vom_18.06.2024' },
| |
| − | { titel: 'GeoCPM – Tipps & Tricks rund um die DGM-Ausdünnung', datum: '24.04.2024', tag: 'geocpm', link: 'Optimierung_durch_Ausd%C3%BCnnung#Ausd.C3.BCnnungsalgorithmen_-_Webinar_vom_24.04.2024' },
| |
| − | { titel: 'Kanabis Release V10', datum: '09.04.2024', tag: 'kanabis', link: 'KANABIS-Vergangene_Webinare#Release_V10_Webinar_vom_09.04.2024' },
| |
| − | { titel: 'WIKI – Umfrage & Erneuerungen', datum: '20.03.2024', tag: 'allgemein', link: 'Wiki#Webinar_vom_20.03.2024' },
| |
| − | { titel: 'GeoCPM – Kommunales Sturzflut-Risikomanagement Bayern', datum: '16.11.2023', tag: 'geocpm', link: 'Erneuerungen_GeoCPM#Webinar_vom_16.11.2023' },
| |
| − | { titel: 'Flow V15: Neuerungen', datum: '09.11.2023', tag: 'flow', link: 'Bilanzierung_des_Zentralbeckens#Webinar_vom_09.11.2023' },
| |
| − | { titel: 'GeoCPM Best Practice V15: Strukturen', datum: '02.11.2023', tag: 'geocpm', link: 'Erneuerungen_GeoCPM#Webinar_vom_02.11.2023' },
| |
| − | { titel: 'GeoCPM Erneuerungen V15: OBOs', datum: '19.10.2023', tag: 'geocpm', link: 'Erneuerungen_GeoCPM#Webinar_vom_19.10.2023' },
| |
| − | { titel: 'Release Version 15: Inn', datum: '18.10.2023', tag: 'release', link: 'Release_News_Version_15#Webinar_vom_18.10.2023' },
| |
| − | { titel: 'Kanabis Release V9', datum: '09.02.2023', tag: 'kanabis', link: 'KANABIS-Vergangene_Webinare#Release_V9_Webinar_vom_09.02.2023' },
| |
| − | { titel: 'Neuerungen KASAnova', datum: '01.12.2022', tag: 'kasa', link: 'Kasanova_Erneuerungen#Webinar:_Kanalzustand_und_Sanierung_am_01.12.2022' },
| |
| − | { titel: 'Release Version 14.10.00: Main', datum: '24.11.2022', tag: 'release', link: 'Vergangene_Erneuerungen#Webinar_vom_24.11.2022' },
| |
| − | { titel: 'Genauigkeit von Geländemodellen & Tipps für die Modellierung', datum: '03.05.2022', tag: 'geocpm', link: 'Optimierung_durch_Ausd%C3%BCnnung#Genauigkeit_von_Gel.C3.A4ndemodellen_-_Webinar_vom_03.05.2022' },
| |
| − | { titel: 'A102 & Flow & Practice', datum: '05.04.2022', tag: 'flow', link: 'DWA_A102#Webinar_-_Flow_.26_DWA_A102_Practice' },
| |
| − | { titel: 'Radolan Daten für die ungleichmäßige Beregnung in GeoCPM', datum: '22.03.2022', tag: 'geocpm', link: 'Aquazis#Webinar_vom_22.03.2022' },
| |
| − | { titel: 'Release Version 14: Main', datum: '08.02.2022', tag: 'release', link: 'Vergangene_Erneuerungen#Webinar_vom_08.02.2022' },
| |
| − | { titel: 'Kanabis Release Version 8', datum: '09.12.2021', tag: 'kanabis', link: 'KANABIS-Vergangene_Webinare#Release_V8_Webinar_vom_09.12.2021' },
| |
| − | { titel: 'Geo3D Best-Practice', datum: '24.11.2021', tag: 'geocpm', link: 'Geo3D-Allgemein#Webinar_vom_24.11.2021' },
| |
| − | { titel: 'Numerische Simulation', datum: '17.11.2021', tag: 'hydraulik', link: 'Numerische_Simulation' },
| |
| − | { titel: 'A102 & Flow', datum: '09.11.2021', tag: 'flow', link: 'DWA_A102#Webinar_-_DWA_A102_Erneuerungen_Flow' },
| |
| − | { titel: '++SYSTEMS Projektdateimanagement 2.0', datum: '27.10.2021', tag: 'allgemein', link: 'Vergleichs-_und_Importkonfiguration#Webinar_vom_27.11.2021' },
| |
| − | { titel: 'Manueller Längsschnitt', datum: '06.10.2021', tag: 'hydraulik', link: 'Manueller_L%C3%A4ngsschnitt#Webinar_vom_06.10.2021' },
| |
| − | { titel: 'Starkregen – Kommunales Risikomanagement', datum: '20.10.2021', tag: 'geocpm', link: 'GeoCPM_Vergangene_Erneuerungen#Webinar_vom_20.10.2021' },
| |
| − | { titel: 'BIM & Betriebsprozesse', datum: '13.10.2021', tag: 'togo', link: 'ToGo-Erneuerungen#BIM_.26_Betriebsprozesse_-_Webinar_vom_13.10.2021' },
| |
| − | { titel: 'Version 13 Donau3D Erneuerungen', datum: '20.05.2021', tag: 'release', link: 'Vergangene_Erneuerungen#Webinar_vom_20.05.2021' },
| |
| − | { titel: 'Visualisierung mit dem neuen 3DTool', datum: '22.04.2021', tag: 'geocpm', link: 'Geo3D-Allgemein#Webinar_vom_21.04.2021' },
| |
| − | { titel: 'Aufbereitung von Eingangsdaten mit QGIS', datum: '13.04.2021', tag: 'allgemein', link: 'QGIS' },
| |
| − | { titel: 'Vorstellung der neuen Dokumentationsplattform WIKI', datum: '24.03.2021', tag: 'allgemein', link: 'Wiki' },
| |
| − | { titel: '++SYSTEMS Kanalzustand und Sanierung', datum: '10.03.2021', tag: 'kasa', link: 'Kasanova_Erneuerungen#Webinar:_Kanalzustand_und_Sanierung_am_10.03.2021' },
| |
| − | { titel: 'Multi-User-Plattformen', datum: '03.03.2021', tag: 'allgemein', link: 'Datenbanken#Multi-User-Plattformen-Webinar_vom_03.03.2021' },
| |
| − | { titel: 'Erneuerungen und Best-Practice', datum: '17.02.2021', tag: 'release', link: 'Vergangene_Erneuerungen#Webinar_vom_17.02.2021' },
| |
| − | { titel: 'Entwurfsplanung', datum: '09.12.2020', tag: 'hydraulik', link: 'Entwurfsplanung_Webinar' },
| |
| − | { titel: 'GeoCPM Best Practice und Erneuerungen', datum: '03.12.2020', tag: 'geocpm', link: 'GeoCPM_Vergangene_Erneuerungen#Webinar_vom_03.12.2020' },
| |
| − | { titel: 'Vom Radar zum Simulationsergebnis I', datum: '02.12.2020', tag: 'geocpm', link: 'Einbinden_von_Radardaten' },
| |
| − | { titel: 'Vom Radar zum Simulationsergebnis II', datum: '24.11.2020', tag: 'geocpm', link: 'Einbinden_von_Radardaten' },
| |
| − | { titel: 'Flow – Best Practice', datum: '18.11.2020', tag: 'flow', link: 'Schritt-f%C3%BCr-Schritt-Anleitung_Flow#Best-Practice_Webinar' },
| |
| − | { titel: 'Erneuerungen und Best-Practice (Nov 2020)', datum: '11.11.2020', tag: 'release', link: 'Vergangene_Erneuerungen#Webinar_vom_11.11.2020' },
| |
| − | { titel: 'GeoCPM Best Practice und Erneuerungen (Mai 2020)', datum: '17.05.2020', tag: 'geocpm', link: 'GeoCPM_Vergangene_Erneuerungen#Webinar_vom_17.05.2020' },
| |
| − | { titel: 'Bedarfsorientierte Kanalreinigung', datum: '12.05.2020', tag: 'togo', link: 'ToGo-Erneuerungen#Bedarfsorientiere_Kanalreinigung_-_Webinar_vom_12.05.2020' },
| |
| − | { titel: 'Erneuerungen und Best-Practice (Apr 2020)', datum: '30.04.2020', tag: 'release', link: 'Vergangene_Erneuerungen#Webinar_vom_30.04.2020' },
| |
| − | { titel: 'Release V12 – Neues Look and Feel', datum: '28.04.2020', tag: 'release', link: 'Vergangene_Erneuerungen#Webinar_vom_28.04.2020' },
| |
| − | { titel: 'Anbindung von Datenbanken', datum: '07.03.2020', tag: 'allgemein', link: 'Datenbanken#Webinar_-_Themenschwerpunkt:_Anbindung_von_Datenbanbanken_vom_07.03.2020' },
| |
| − | { titel: 'Kommunales Starkregenrisikomanagement LUBW II', datum: '29.05.2019', tag: 'geocpm', link: 'Starkregen_Risikomanagement_Baden_W%C3%BCrttemberg_LUBW#Webinar_LUBW_II' },
| |
| − | { titel: 'Bruchkanten', datum: '22.05.2019', tag: 'geocpm', link: 'Bruchkanten#Vorgehen_Bruchkanten_GeoCPM' },
| |
| − | { titel: '++SYSTEMS Projektdateimanagement', datum: '15.05.2019', tag: 'allgemein', link: 'Vergleichs-_und_Importkonfiguration#Webinar_vom_15.05.2019' },
| |
| − | { titel: 'Koordinatentransformation', datum: '30.04.2019', tag: 'allgemein', link: 'Koordinatentransformation#Webinar_vom_30.04.2019' },
| |
| − | { titel: 'Planausgabe', datum: '10.04.2019', tag: 'allgemein', link: 'Plankonfigurationen#Planausgabe_Webinar_vom_10.04.2018' },
| |
| − | { titel: 'Release V11', datum: '11.03.2019', tag: 'release', link: 'Vergangene_Erneuerungen#Webinar_vom_08.05.2019' },
| |
| − | { titel: 'Bestandsdaten(erfassung) & Dokumentation (2018)', datum: '05.12.2018', tag: 'togo', link: 'ToGo-Erneuerungen#Bestandsdaten.28erfassung.29_und_l.C3.BCckenlose_Dokumentation_-_Webinar_vom_05.12.2018' },
| |
| − | { titel: 'Funktionale Einheiten – Ergebnislisten – Erneuerungen', datum: '28.11.2018', tag: 'flow', link: 'Funktionale_Einheiten' },
| |
| − | { titel: 'KASAnova 2.0 – Sanierungsmodul Version 11', datum: '14.11.2018', tag: 'kasa', link: 'Kasanova_Erneuerungen#Webinar:_KASAnova_2.0_-_Sanierungsmodul_Version_11_am_14.11.2018' },
| |
| − | { titel: 'Release Version 11', datum: '08.11.2018', tag: 'release', link: 'GeoCPM_Vergangene_Erneuerungen#Webinar_vom_08.11.2018' },
| |
| − | { titel: 'KASAnova 2.0 – Das Sanierungsmodul neu aufgelegt', datum: '18.04.2018', tag: 'kasa', link: 'Kasanova_Erneuerungen#Webinar:_KASAnova_2.0_-_Das_Sanierungsmodul_neu_aufgelegt_am_18.04.2018' },
| |
| − | { titel: 'DYNA – Rechnet nicht', datum: '21.03.2018', tag: 'hydraulik', link: 'DYNA-Fehlerbehebung' },
| |
| − | { titel: 'Datenbanken', datum: '07.03.2018', tag: 'allgemein', link: 'Datenbanken#Datenbanken-Webinar_vom_07.03.2020' },
| |
| − | { titel: 'Kommunales Starkregenrisikomanagement LUBW I', datum: '19.07.2017', tag: 'geocpm', link: 'Starkregen_Risikomanagement_Baden_W%C3%BCrttemberg_LUBW#Webinar_LUBW_I' },
| |
| − | { titel: 'Erneuerung mit Flow++', datum: '10.05.2017', tag: 'flow', link: 'Erneuerung_mit_Flow%2B%2B' },
| |
| − | { titel: 'Messstellen', datum: '22.03.2017', tag: 'hydraulik', link: 'Messstellen' },
| |
| − | { titel: 'Import/Export – XML Formate', datum: '15.03.2017', tag: 'allgemein', link: 'Schnittstellen#Import.2FExport-Schnittstellen_Webinar_vom_15.03.2017' },
| |
| − | { titel: 'Import/Export – DXF und ESRI Shape', datum: '07.12.2016', tag: 'allgemein', link: 'Schnittstellen#Import.2FExport-Schnittstellen_Webinar_vom_07.12.2017' },
| |
| − | { titel: 'Listengenerator', datum: '23.11.2016', tag: 'allgemein', link: 'Listengenerator#Webinar_vom_23.11.2016' }, | |
| − | { titel: 'Wasseraustausch – Bi-Direktionale Kopplung', datum: '11.10.2016', tag: 'hydraulik', link: 'Bi-Direktionale_Kopplung#Webinar_-_Themenschwerpunkt:_Bi-Direktionale_Kopplung_vom_11.10.2016' }, | |
| − | { titel: 'Anwendung der Verteilvorschrift für Regenspenden (KOSTRA)', datum: '22.09.2016', tag: 'hydraulik', link: 'Verteilungsvorschriften_f%C3%BCr_extreme_Regenspenden#Webinar_-_Themenschwerpunkt:_Regenerstellung_aus_Verteilungsvorschrift_.28Kostra.29_vom_22.09.2016' }, | |
| − | { titel: 'Zustandserfassung – Daten-Wellenlänge', datum: '21.07.2016', tag: 'kasa', link: 'Kasanova_Erneuerungen#Webinar:_Zustandserfassung_-_der_Befahrer_und_Sie_auf_einer_.22Daten-Wellenl.C3.A4nge.22_am_21.07.2016' }, | |
| − | { titel: 'Themenplan', datum: '30.06.2016', tag: 'allgemein', link: 'Ansichtskonfiguration#Webinar_vom_30.06.2016' },
| |
| − | { titel: 'Schluss mit der Zettelwirtschaft', datum: '16.06.2016', tag: 'togo', link: 'ToGo-Erneuerungen#Schluss_mit_der_Zettelwirtschaft_-_Webinar_vom_16.06.2016' },
| |
| − | { titel: 'Bestandsdaten(erfassung) & Dokumentation (2015)', datum: '16.12.2015', tag: 'togo', link: 'ToGo-Erneuerungen#.2B.2BSYSTEMS_togo_-_die_Mobile_Version_-_Webinar_vom_16.12.2015' },
| |
| − | { titel: 'Einzugsgebietsmanagement', datum: '16.06.2015', tag: 'hydraulik', link: 'Einzugsgebietsmanagement' },
| |
| − | { titel: 'Integrierte Zustandsbewertung und Sanierungsplanung', datum: '09.05.2015', tag: 'kasa', link: 'Kasanova_Erneuerungen#Webinar:_Integrierte_Zustandsbewertung_und_Sanierungsplanung_am_9.05.2015' },
| |
| − | { titel: 'Untersuchungsverwaltung – Zustandsbewertung – Sanierung', datum: '21.10.2014', tag: 'kasa', link: 'Kasanova_Erneuerungen#Webinar:_Untersuchungsverwaltung_.E2.80.93_Zustandsbewertung_-_Sanierung_am_21.10.2014' }, | |
| | ]; | | ]; |
| | | | |
| − | /* ── 2. Tag-Konfiguration ───────────────────────────────────────────── */
| + | var istGalerieSeite = galerieSeiten.indexOf(seite) > -1; |
| − | var TAGS = { | |
| − | alle: { label: 'Alle', farbe: '#666699' },
| |
| − | geocpm: { label: 'GeoCPM', farbe: '#1D9E75' },
| |
| − | hydraulik:{ label: 'Hydraulik', farbe: '#185FA5' },
| |
| − | flow: { label: 'Flow', farbe: '#BA7517' },
| |
| − | togo: { label: 'ToGo', farbe: '#534AB7' },
| |
| − | kasa: { label: 'KASAnova', farbe: '#993C1D' },
| |
| − | aqua: { label: 'AQUA++', farbe: '#0F6E56' },
| |
| − | kanabis: { label: 'Kanabis', farbe: '#3B6D11' },
| |
| − | release: { label: 'Release', farbe: '#5F5E5A' },
| |
| − | allgemein:{ label: 'Allgemein', farbe: '#444441' },
| |
| − | };
| |
| − | | |
| − | /* ── 3. Thumbnail aus hochgeladenem Video generieren ────────────────── */
| |
| − | /**
| |
| − | * Versucht ein Thumbnail aus einem Wiki-Video-Link zu laden.
| |
| − | * Strategie 1: gleichnamiges PNG/JPG neben dem Video
| |
| − | * Strategie 2: canvas-Extraktion via hidden <video>
| |
| − | */
| |
| − | function ladeThumbnail(card, wikiLink) {
| |
| − | var basis = wikiLink.split('#')[0]; // Anker entfernen
| |
| − | var dateiName = basis.replace(/_/g, ' ');
| |
| − | var thumb = card.querySelector('.vg-thumb-img');
| |
| − | var canvas = document.createElement('canvas');
| |
| − | var ctx = canvas.getContext('2d');
| |
| − | canvas.width = 320;
| |
| − | canvas.height = 180;
| |
| | | | |
| − | // Strategie: Video-Element im Hintergrund – erstes Frame als Thumbnail
| + | /* ODER: div auf der Seite vorhanden (falls $wgRawHtml funktioniert) */ |
| − | // Nur wenn die Seite eine direkt eingebettete Video-Datei enthält
| + | var divContainer = document.getElementById('video-galerie'); |
| − | var videoLinks = document.querySelectorAll('video source, video[src]');
| |
| − | videoLinks.forEach(function (el) {
| |
| − | var src = el.src || el.getAttribute('src') || '';
| |
| − | if (src && src.toLowerCase().indexOf(encodeURIComponent(dateiName.toLowerCase().replace(/ /g, '_'))) > -1) {
| |
| − | var vid = document.createElement('video');
| |
| − | vid.crossOrigin = 'anonymous';
| |
| − | vid.src = src;
| |
| − | vid.muted = true;
| |
| − | vid.preload = 'metadata';
| |
| − | vid.addEventListener('loadeddata', function () {
| |
| − | vid.currentTime = 1;
| |
| − | });
| |
| − | vid.addEventListener('seeked', function () {
| |
| − | try {
| |
| − | ctx.drawImage(vid, 0, 0, canvas.width, canvas.height);
| |
| − | thumb.style.backgroundImage = 'url(' + canvas.toDataURL('image/jpeg', 0.8) + ')';
| |
| − | thumb.style.backgroundSize = 'cover';
| |
| − | thumb.style.backgroundPosition = 'center';
| |
| − | card.querySelector('.vg-icon').style.display = 'none';
| |
| − | } catch (e) { /* CORS – kein Thumbnail, Icon bleibt sichtbar */ }
| |
| − | });
| |
| − | }
| |
| − | });
| |
| − | }
| |
| | | | |
| − | /* ── 4. CSS injizieren ─────────────────────────────────────────────── */ | + | if (!istGalerieSeite && !divContainer) { |
| − | function injizierCSS() {
| + | return; /* Nicht die richtige Seite */ |
| − | if (document.getElementById('vg-styles')) return; | |
| − | var css = [
| |
| − | '#vg-container { font-family: sans-serif; margin: 1rem 0; }',
| |
| − | '#vg-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }',
| |
| − | '#vg-suche { flex: 1; min-width: 180px; padding: 6px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 13px; }',
| |
| − | '.vg-filter-btn { padding: 4px 12px; border-radius: 20px; border: 1px solid #ccc; background: #f8f8f8; font-size: 12px; cursor: pointer; transition: all .15s; }',
| |
| − | '.vg-filter-btn.aktiv { color: #fff; border-color: transparent; }',
| |
| − | '#vg-anzahl { font-size: 12px; color: #888; margin-bottom: 8px; }',
| |
| − | '#vg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }',
| |
| − | '.vg-karte { border: 1px solid #e0e0e0; border-radius: 10px; overflow: hidden; background: #fff; transition: box-shadow .15s; }',
| |
| − | '.vg-karte:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); }',
| |
| − | '.vg-thumb { width: 100%; aspect-ratio: 16/9; background: #f0f0f4; display: flex; align-items: center; justify-content: center; position: relative; text-decoration: none; }',
| |
| − | '.vg-thumb-img { position: absolute; inset: 0; background-size: cover; background-position: center; }',
| |
| − | '.vg-icon { font-size: 32px; color: #999; z-index: 1; }',
| |
| − | '.vg-play-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; background: rgba(0,0,0,.25); }',
| |
| − | '.vg-thumb:hover .vg-play-overlay { opacity: 1; }',
| |
| − | '.vg-play-dreieck { width: 0; height: 0; border-style: solid; border-width: 14px 0 14px 24px; border-color: transparent transparent transparent #fff; margin-left: 4px; }',
| |
| − | '.vg-badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 12px; color: #fff; font-weight: 500; }',
| |
| − | '.vg-body { padding: 10px 12px 12px; }',
| |
| − | '.vg-titel { font-size: 13px; font-weight: 600; color: #222; line-height: 1.4; margin: 6px 0 4px; }',
| |
| − | '.vg-datum { font-size: 11px; color: #888; }',
| |
| − | '.vg-leer { text-align: center; padding: 2rem; color: #888; font-size: 14px; grid-column: 1 / -1; }',
| |
| − | ].join('\n');
| |
| − | var style = document.createElement('style');
| |
| − | style.id = 'vg-styles';
| |
| − | style.textContent = css;
| |
| − | document.head.appendChild(style);
| |
| | } | | } |
| | | | |
| − | /* ── 5. HTML aufbauen ──────────────────────────────────────────────── */ | + | var container = divContainer; |
| − | function baueGalerie(container) {
| |
| − | injizierCSS();
| |
| − | | |
| − | var html = '<div id="vg-container">';
| |
| − | html += '<div id="vg-controls">';
| |
| − | html += '<input id="vg-suche" type="text" placeholder="Webinar suchen…" />';
| |
| − | Object.keys(TAGS).forEach(function (key) {
| |
| − | var t = TAGS[key];
| |
| − | var stil = key === 'alle' ? ' style="background:' + t.farbe + ';color:#fff;border-color:' + t.farbe + ';"' : '';
| |
| − | html += '<button class="vg-filter-btn' + (key === 'alle' ? ' aktiv' : '') + '" data-tag="' + key + '"' + stil + '>' + t.label + '</button>';
| |
| − | });
| |
| − | html += '</div>';
| |
| − | html += '<div id="vg-anzahl"></div>';
| |
| − | html += '<div id="vg-grid"></div>';
| |
| − | html += '</div>';
| |
| − | | |
| − | container.innerHTML = html;
| |
| − | | |
| − | var aktuellerTag = 'alle';
| |
| − | var suchfeld = document.getElementById('vg-suche');
| |
| − | var grid = document.getElementById('vg-grid');
| |
| − | var anzahl = document.getElementById('vg-anzahl');
| |
| − | | |
| − | function renderKarten() {
| |
| − | var q = suchfeld.value.toLowerCase().trim();
| |
| − | var gefiltert = WEBINARE.filter(function (w) {
| |
| − | var tagOk = aktuellerTag === 'alle' || w.tag === aktuellerTag;
| |
| − | var suchOk = !q || w.titel.toLowerCase().indexOf(q) > -1;
| |
| − | return tagOk && suchOk;
| |
| − | });
| |
| − | | |
| − | anzahl.textContent = gefiltert.length + ' Webinar' + (gefiltert.length !== 1 ? 'e' : '');
| |
| − | | |
| − | if (!gefiltert.length) {
| |
| − | grid.innerHTML = '<p class="vg-leer">Keine Webinare gefunden.</p>';
| |
| − | return;
| |
| − | }
| |
| | | | |
| − | var tagFarbe = TAGS[aktuellerTag] ? TAGS[aktuellerTag].farbe : '#666699';
| + | if (!container) { |
| | + | /* Kein div gefunden → automatisch in den Seiteninhalt einfügen */ |
| | + | var inhalt = document.getElementById('mw-content-text'); |
| | + | if (!inhalt) return; |
| | | | |
| − | grid.innerHTML = gefiltert.map(function (w) {
| + | container = document.createElement('div'); |
| − | var farbe = TAGS[w.tag] ? TAGS[w.tag].farbe : '#666699';
| + | container.id = 'video-galerie'; |
| − | var tagLabel = TAGS[w.tag] ? TAGS[w.tag].label : w.tag;
| |
| − | var url = mw.util.getUrl(w.link);
| |
| − | return [
| |
| − | '<div class="vg-karte">',
| |
| − | ' <a class="vg-thumb" href="' + url + '">',
| |
| − | ' <div class="vg-thumb-img" data-link="' + w.link + '"></div>',
| |
| − | ' <span class="vg-icon">▶</span>',
| |
| − | ' <div class="vg-play-overlay"><div class="vg-play-dreieck"></div></div>',
| |
| − | ' </a>',
| |
| − | ' <div class="vg-body">',
| |
| − | ' <span class="vg-badge" style="background:' + farbe + '">' + tagLabel + '</span>',
| |
| − | ' <p class="vg-titel">' + w.titel + '</p>',
| |
| − | ' <p class="vg-datum">' + w.datum + '</p>',
| |
| − | ' </div>',
| |
| − | '</div>',
| |
| − | ].join('\n');
| |
| − | }).join('\n');
| |
| | | | |
| − | // Thumbnails nachladen
| + | /* Vorhandenen Tabelleninhalt (alte Webinar-Tabelle) ausblenden */ |
| − | grid.querySelectorAll('.vg-karte').forEach(function (karte, i) {
| + | var alteTabelle = inhalt.querySelector('table'); |
| − | ladeThumbnail(karte, gefiltert[i].link);
| + | if (alteTabelle) { |
| − | });
| + | alteTabelle.style.display = 'none'; |
| | } | | } |
| | | | |
| − | // Filter-Buttons | + | /* Galerie ganz oben im Inhalt einfügen */ |
| − | document.querySelectorAll('.vg-filter-btn').forEach(function (btn) { | + | inhalt.insertBefore(container, inhalt.firstChild); |
| − | btn.addEventListener('click', function () {
| |
| − | aktuellerTag = btn.getAttribute('data-tag');
| |
| − | document.querySelectorAll('.vg-filter-btn').forEach(function (b) {
| |
| − | b.classList.remove('aktiv');
| |
| − | b.style.background = '';
| |
| − | b.style.color = '';
| |
| − | b.style.borderColor = '';
| |
| − | });
| |
| − | btn.classList.add('aktiv');
| |
| − | var farbe = TAGS[aktuellerTag] ? TAGS[aktuellerTag].farbe : '#666699';
| |
| − | btn.style.background = farbe;
| |
| − | btn.style.color = '#fff';
| |
| − | btn.style.borderColor = farbe;
| |
| − | renderKarten();
| |
| − | });
| |
| − | });
| |
| − | | |
| − | // Suche
| |
| − | suchfeld.addEventListener('input', renderKarten);
| |
| − | | |
| − | renderKarten();
| |
| | } | | } |
| | | | |
| − | /* ── 6. Initialisierung ────────────────────────────────────────────── */ | + | baueGalerie(container); |
| − | mw.hook('wikipage.content').add(function () {
| + | }); |
| − | var container = document.getElementById('video-galerie');
| |
| − | if (container) {
| |
| − | baueGalerie(container);
| |
| − | }
| |
| − | });
| |
| − | | |
| − | })(); | |