diff --git a/serienfans-releasegroup-filter.user.js b/serienfans-releasegroup-filter.user.js index 6ac2c8f..fe6380e 100644 --- a/serienfans-releasegroup-filter.user.js +++ b/serienfans-releasegroup-filter.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Serienfans/Filmfans Releasegruppen Filter // @namespace https://git.ponywave.de/Akamaru/Userscripts -// @version 1.3 +// @version 1.4 // @description Blende Uploads bestimmter Releasegruppen aus // @author Akamaru // @match https://serienfans.org/* @@ -36,7 +36,7 @@ vertical-align: middle; } - #blacklist-modal { + #blacklist-modal, #confirm-modal, #alert-modal { display: none; position: fixed; z-index: 10000; @@ -182,6 +182,61 @@ #blacklist-menu-btn:hover { opacity: 0.8; } + + /* Confirm/Alert Modal Styles */ + #confirm-modal-content, #alert-modal-content { + background-color: #1a1a1a; + margin: 15% auto; + padding: 30px; + border: 1px solid #333; + border-radius: 8px; + width: 90%; + max-width: 450px; + box-shadow: 0 4px 20px rgba(0,0,0,0.5); + color: #fff; + text-align: center; + } + + #confirm-modal-message, #alert-modal-message { + margin: 20px 0 30px; + font-size: 16px; + line-height: 1.5; + } + + #confirm-modal-buttons, #alert-modal-buttons { + display: flex; + gap: 10px; + justify-content: center; + } + + .modal-btn { + padding: 10px 25px; + border: none; + border-radius: 4px; + cursor: pointer; + font-size: 14px; + font-weight: 500; + transition: background 0.2s; + min-width: 100px; + } + + .modal-btn-confirm { + background: #4caf50; + color: white; + } + + .modal-btn-confirm:hover { + background: #45a049; + } + + .modal-btn-cancel, .modal-btn-ok { + background: #666; + color: white; + } + + .modal-btn-cancel:hover, .modal-btn-ok:hover { + background: #777; + } `); // Standard-Blacklist (kann über das Menü bearbeitet werden) @@ -261,10 +316,11 @@ blockBtn.textContent = '🚫'; blockBtn.className = 'block-group-btn'; blockBtn.title = `Releasegruppe "${releasegroup}" blocken`; - blockBtn.onclick = (e) => { + blockBtn.onclick = async (e) => { e.preventDefault(); e.stopPropagation(); - if (confirm(`Releasegruppe "${releasegroup}" zur Blacklist hinzufügen?`)) { + const confirmed = await showConfirmModal(`Releasegruppe "${releasegroup}" zur Blacklist hinzufügen?`); + if (confirmed) { blockReleasegroup(releasegroup); } }; @@ -336,14 +392,14 @@ } // Funktion zum Hinzufügen einer Releasegruppe - function addToBlacklist() { + async function addToBlacklist() { const input = document.getElementById('blacklist-add-input'); const group = input.value.trim(); if (group === '') return; if (blacklist.some(blocked => blocked.toLowerCase() === group.toLowerCase())) { - alert(`"${group}" ist bereits in der Blacklist!`); + await showAlertModal(`"${group}" ist bereits in der Blacklist!`); return; } @@ -380,6 +436,95 @@ } } + // Custom Confirm Modal + function showConfirmModal(message) { + return new Promise((resolve) => { + // Erstelle Modal falls nicht vorhanden + let modal = document.getElementById('confirm-modal'); + if (!modal) { + modal = document.createElement('div'); + modal.id = 'confirm-modal'; + modal.innerHTML = ` +