From 2a621d176da9a5b64b8161d3422eb1c3f21b28e9 Mon Sep 17 00:00:00 2001 From: Tomas Dvorak Date: Thu, 29 May 2025 13:02:29 +0200 Subject: [PATCH] efef --- admin-dashboard.html | 75 ++++++++++++++++++++++++++++++++++++++++++-- index.html | 1 - 2 files changed, 73 insertions(+), 3 deletions(-) diff --git a/admin-dashboard.html b/admin-dashboard.html index 2fd7c61..5a63ea0 100644 --- a/admin-dashboard.html +++ b/admin-dashboard.html @@ -713,8 +713,39 @@ - - +
+ +
+
+ + + +
+ + +
+ + +
+
+ +
+
Můžete použít HTML značky pro formátování textu
+
@@ -778,6 +809,46 @@ if (!token) { window.location.href = '/login.html'; } +// Rich text editor functionality +document.addEventListener('DOMContentLoaded', function() { + const bannerText = document.getElementById('bannerText'); + const bannerTextHidden = document.getElementById('bannerTextHidden'); + const toolbar = document.getElementById('bannerTextToolbar'); + + // Initialize hidden input with empty content + bannerTextHidden.value = bannerText.innerHTML; + + // Update hidden input when content changes + bannerText.addEventListener('input', function() { + bannerTextHidden.value = this.innerHTML; + }); + + // Handle toolbar button clicks + toolbar.addEventListener('click', function(e) { + const button = e.target.closest('button[data-command]'); + if (!button) return; + + const command = button.dataset.command; + document.execCommand(command, false, command === 'createLink' ? prompt('Zadejte URL:') : null); + bannerText.focus(); + }); + + // Handle paste to clean up pasted content + bannerText.addEventListener('paste', function(e) { + e.preventDefault(); + const text = (e.originalEvent || e).clipboardData.getData('text/plain'); + document.execCommand('insertHTML', false, text); + }); + + // Handle tab key for indentation + bannerText.addEventListener('keydown', function(e) { + if (e.key === 'Tab') { + e.preventDefault(); + document.execCommand('insertHTML', false, ' '); + } + }); +}); + // Show notification to user function showNotification(message, type = 'info') { const notification = document.createElement('div'); diff --git a/index.html b/index.html index 484e0e2..3a9a4dd 100644 --- a/index.html +++ b/index.html @@ -95,7 +95,6 @@ background: ${backgroundColor}; color: ${textColor}; border-radius: ${borderRadius}px; - box-shadow: 0 2px 10px rgba(0,0,0,0.1); ${style.containerStyle || ''} position: relative; overflow: hidden;