Telegram-Kategorie-Checkboxen: Nutzer koennen bei Lage-Erstellung einzelne Telegram-Quellkategorien auswaehlen
Dieser Commit ist enthalten in:
@@ -4545,3 +4545,54 @@ a.map-popup-article:hover {
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
|
||||
/* Telegram Category Selection Panel */
|
||||
.tg-categories-panel {
|
||||
margin-top: 8px;
|
||||
padding: 12px 14px;
|
||||
background: var(--bg-tertiary);
|
||||
border-radius: var(--radius);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
.tg-cat-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 6px 16px;
|
||||
}
|
||||
.tg-cat-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 13px;
|
||||
color: var(--text-primary);
|
||||
cursor: pointer;
|
||||
padding: 3px 0;
|
||||
}
|
||||
.tg-cat-item input[type="checkbox"] {
|
||||
accent-color: var(--accent);
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.tg-cat-count {
|
||||
font-size: 11px;
|
||||
color: var(--text-disabled);
|
||||
margin-left: auto;
|
||||
}
|
||||
.tg-cat-actions {
|
||||
margin-top: 8px;
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
.btn-link {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--accent);
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.btn-link:hover {
|
||||
color: var(--accent-hover);
|
||||
}
|
||||
|
||||
@@ -347,6 +347,24 @@
|
||||
</label>
|
||||
<div class="form-hint" id="telegram-hint">Nachrichten aus konfigurierten Telegram-Kanälen berücksichtigen</div>
|
||||
</div>
|
||||
<div class="tg-categories-panel" id="tg-categories-panel" style="display:none;">
|
||||
<div class="form-hint" style="margin-bottom:6px;font-weight:500;">Telegram-Kategorien auswählen:</div>
|
||||
<div class="tg-cat-grid">
|
||||
<label class="tg-cat-item"><input type="checkbox" class="tg-cat-cb" value="ukraine-russland-krieg" checked><span>Ukraine-Russland-Krieg</span><span class="tg-cat-count" data-cat="ukraine-russland-krieg"></span></label>
|
||||
<label class="tg-cat-item"><input type="checkbox" class="tg-cat-cb" value="russische-staatspropaganda" checked><span>Russische Staatspropaganda</span><span class="tg-cat-count" data-cat="russische-staatspropaganda"></span></label>
|
||||
<label class="tg-cat-item"><input type="checkbox" class="tg-cat-cb" value="russische-opposition" checked><span>Russische Opposition</span><span class="tg-cat-count" data-cat="russische-opposition"></span></label>
|
||||
<label class="tg-cat-item"><input type="checkbox" class="tg-cat-cb" value="extremismus-deutschland" checked><span>Extremismus Deutschland</span><span class="tg-cat-count" data-cat="extremismus-deutschland"></span></label>
|
||||
<label class="tg-cat-item"><input type="checkbox" class="tg-cat-cb" value="cybercrime" checked><span>Cybercrime</span><span class="tg-cat-count" data-cat="cybercrime"></span></label>
|
||||
<label class="tg-cat-item"><input type="checkbox" class="tg-cat-cb" value="cybercrime-leaks" checked><span>Cybercrime Leaks</span><span class="tg-cat-count" data-cat="cybercrime-leaks"></span></label>
|
||||
<label class="tg-cat-item"><input type="checkbox" class="tg-cat-cb" value="osint-international" checked><span>OSINT International</span><span class="tg-cat-count" data-cat="osint-international"></span></label>
|
||||
<label class="tg-cat-item"><input type="checkbox" class="tg-cat-cb" value="irankonflikt" checked><span>Irankonflikt</span><span class="tg-cat-count" data-cat="irankonflikt"></span></label>
|
||||
<label class="tg-cat-item"><input type="checkbox" class="tg-cat-cb" value="syrien-nahost" checked><span>Syrien / Nahost</span><span class="tg-cat-count" data-cat="syrien-nahost"></span></label>
|
||||
</div>
|
||||
<div class="tg-cat-actions">
|
||||
<button type="button" class="btn-link" onclick="toggleAllTgCats(true)">Alle</button>
|
||||
<button type="button" class="btn-link" onclick="toggleAllTgCats(false)">Keine</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Sichtbarkeit</label>
|
||||
@@ -466,7 +484,7 @@
|
||||
<div class="sources-form-row">
|
||||
<div class="form-group flex-1">
|
||||
<label for="src-discover-url">URL oder Domain</label>
|
||||
<input type="text" id="src-discover-url" placeholder="z.B. netzpolitik.org">
|
||||
<input type="text" id="src-discover-url" placeholder="z.B. netzpolitik.org oder t.me/kanalname">
|
||||
</div>
|
||||
<button class="btn btn-secondary btn-small" id="src-discover-btn" onclick="App.discoverSource()">Erkennen</button>
|
||||
</div>
|
||||
@@ -491,11 +509,19 @@
|
||||
<option value="regional">Regional</option>
|
||||
<option value="boulevard">Boulevard</option>
|
||||
<option value="sonstige" selected>Sonstige</option>
|
||||
<option value="ukraine-russland-krieg">Ukraine-Russland-Krieg</option>
|
||||
<option value="irankonflikt">Irankonflikt</option>
|
||||
<option value="osint-international">OSINT International</option>
|
||||
<option value="extremismus-deutschland">Extremismus Deutschland</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Typ</label>
|
||||
<input type="text" id="src-type-display" class="input-readonly" readonly>
|
||||
<label for="src-type-select">Typ</label>
|
||||
<select id="src-type-select">
|
||||
<option value="rss_feed">RSS-Feed</option>
|
||||
<option value="web_source">Web-Quelle</option>
|
||||
<option value="telegram_channel">Telegram-Kanal</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group" id="src-rss-url-group">
|
||||
<label>RSS-Feed URL</label>
|
||||
|
||||
@@ -502,6 +502,12 @@ const App = {
|
||||
document.getElementById('archive-incident-btn').addEventListener('click', () => this.handleArchive());
|
||||
document.getElementById('inc-international').addEventListener('change', () => updateSourcesHint());
|
||||
document.getElementById('inc-visibility').addEventListener('change', () => updateVisibilityHint());
|
||||
// Telegram-Kategorien Toggle
|
||||
const tgCheckbox = document.getElementById('inc-telegram');
|
||||
if (tgCheckbox) {
|
||||
tgCheckbox.addEventListener('change', function() { toggleTgCategories(this.checked); });
|
||||
}
|
||||
|
||||
|
||||
// Feedback
|
||||
document.getElementById('feedback-form').addEventListener('submit', (e) => this.submitFeedback(e));
|
||||
@@ -1453,6 +1459,9 @@ const App = {
|
||||
retention_days: parseInt(document.getElementById('inc-retention').value) || 0,
|
||||
international_sources: document.getElementById('inc-international').checked,
|
||||
include_telegram: document.getElementById('inc-telegram').checked,
|
||||
telegram_categories: document.getElementById('inc-telegram').checked
|
||||
? Array.from(document.querySelectorAll('.tg-cat-cb:checked')).map(cb => cb.value)
|
||||
: null,
|
||||
visibility: document.getElementById('inc-visibility').checked ? 'public' : 'private',
|
||||
};
|
||||
},
|
||||
@@ -1807,6 +1816,15 @@ const App = {
|
||||
document.getElementById('inc-retention').value = incident.retention_days;
|
||||
document.getElementById('inc-international').checked = incident.international_sources !== false && incident.international_sources !== 0;
|
||||
document.getElementById('inc-telegram').checked = !!incident.include_telegram;
|
||||
// Telegram-Kategorien wiederherstellen
|
||||
toggleTgCategories(!!incident.include_telegram);
|
||||
if (incident.telegram_categories) {
|
||||
let cats = incident.telegram_categories;
|
||||
if (typeof cats === 'string') { try { cats = JSON.parse(cats); } catch(e) { cats = []; } }
|
||||
document.querySelectorAll('.tg-cat-cb').forEach(cb => {
|
||||
cb.checked = cats.includes(cb.value);
|
||||
});
|
||||
}
|
||||
document.getElementById('inc-visibility').checked = incident.visibility !== 'private';
|
||||
updateVisibilityHint();
|
||||
updateSourcesHint();
|
||||
@@ -2596,6 +2614,7 @@ const App = {
|
||||
document.getElementById('src-discovery-result').style.display = 'none';
|
||||
document.getElementById('src-discover-btn').disabled = false;
|
||||
document.getElementById('src-discover-btn').textContent = 'Erkennen';
|
||||
document.getElementById('src-type-select').value = 'rss_feed';
|
||||
// Save-Button Text zurücksetzen
|
||||
const saveBtn = document.querySelector('#src-discovery-result .sources-discovery-actions .btn-primary');
|
||||
if (saveBtn) saveBtn.textContent = 'Speichern';
|
||||
@@ -2612,6 +2631,27 @@ const App = {
|
||||
|
||||
async discoverSource() {
|
||||
const urlInput = document.getElementById('src-discover-url');
|
||||
const urlVal = urlInput.value.trim();
|
||||
|
||||
// Telegram-URLs direkt behandeln (kein Discovery noetig)
|
||||
if (urlVal.match(/^(https?:\/\/)?(t\.me|telegram\.me)\//i)) {
|
||||
const channelName = urlVal.replace(/^(https?:\/\/)?(t\.me|telegram\.me)\//, '').replace(/\/$/, '');
|
||||
const tgUrl = 't.me/' + channelName;
|
||||
this._discoveredData = {
|
||||
name: '@' + channelName,
|
||||
domain: 't.me',
|
||||
source_type: 'telegram_channel',
|
||||
rss_url: null,
|
||||
};
|
||||
document.getElementById('src-name').value = '@' + channelName;
|
||||
document.getElementById('src-type-select').value = 'telegram_channel';
|
||||
document.getElementById('src-domain').value = tgUrl;
|
||||
document.getElementById('src-rss-url-group').style.display = 'none';
|
||||
document.getElementById('src-discovery-result').style.display = 'block';
|
||||
const saveBtn = document.querySelector('#src-discovery-result .sources-discovery-actions .btn-primary');
|
||||
if (saveBtn) { saveBtn.disabled = false; saveBtn.textContent = 'Speichern'; }
|
||||
return;
|
||||
}
|
||||
const url = urlInput.value.trim();
|
||||
if (!url) {
|
||||
UI.showToast('Bitte URL oder Domain eingeben.', 'warning');
|
||||
@@ -2652,6 +2692,8 @@ const App = {
|
||||
document.getElementById('src-notes').value = '';
|
||||
|
||||
const typeLabel = this._discoveredData.source_type === 'rss_feed' ? 'RSS-Feed' : this._discoveredData.source_type === 'telegram_channel' ? 'Telegram' : 'Web-Quelle';
|
||||
const typeSelect = document.getElementById('src-type-select');
|
||||
if (typeSelect) typeSelect.value = this._discoveredData.source_type || 'web_source';
|
||||
document.getElementById('src-type-display').value = typeLabel;
|
||||
|
||||
const rssGroup = document.getElementById('src-rss-url-group');
|
||||
@@ -2730,6 +2772,8 @@ const App = {
|
||||
document.getElementById('src-domain').value = source.domain || '';
|
||||
|
||||
const typeLabel = source.source_type === 'rss_feed' ? 'RSS-Feed' : source.source_type === 'telegram_channel' ? 'Telegram' : 'Web-Quelle';
|
||||
const typeSelect = document.getElementById('src-type-select');
|
||||
if (typeSelect) typeSelect.value = source.source_type || 'web_source';
|
||||
document.getElementById('src-type-display').value = typeLabel;
|
||||
|
||||
const rssGroup = document.getElementById('src-rss-url-group');
|
||||
@@ -2769,9 +2813,9 @@ const App = {
|
||||
const discovered = this._discoveredData || {};
|
||||
const data = {
|
||||
name,
|
||||
source_type: discovered.source_type || 'web_source',
|
||||
source_type: document.getElementById('src-type-select') ? document.getElementById('src-type-select').value : (discovered.source_type || 'web_source'),
|
||||
category: document.getElementById('src-category').value,
|
||||
url: discovered.rss_url || null,
|
||||
url: discovered.rss_url || (discovered.source_type === 'telegram_channel' ? (document.getElementById('src-domain').value || null) : null),
|
||||
domain: document.getElementById('src-domain').value.trim() || discovered.domain || null,
|
||||
notes: document.getElementById('src-notes').value.trim() || null,
|
||||
};
|
||||
@@ -3068,6 +3112,16 @@ function buildDetailedSourceOverview() {
|
||||
return html;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function toggleTgCategories(show) {
|
||||
const panel = document.getElementById('tg-categories-panel');
|
||||
if (panel) panel.style.display = show ? 'block' : 'none';
|
||||
}
|
||||
|
||||
function toggleAllTgCats(checked) {
|
||||
document.querySelectorAll('.tg-cat-cb').forEach(cb => { cb.checked = checked; });
|
||||
}
|
||||
function toggleRefreshInterval() {
|
||||
const mode = document.getElementById('inc-refresh-mode').value;
|
||||
const field = document.getElementById('refresh-interval-field');
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren