fix: Textarea Auto-Resize + Emdashes entfernt
Beschreibungs-Textarea waechst automatisch mit dem Inhalt (min 80px). Greift beim Tippen, nach Beschreibung generieren und im Edit-Modus. Emdashes (U+2014) durch Doppelpunkte ersetzt.
Dieser Commit ist enthalten in:
@@ -346,8 +346,8 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="inc-type">Art der Lage</label>
|
<label for="inc-type">Art der Lage</label>
|
||||||
<select id="inc-type" onchange="toggleTypeDefaults()">
|
<select id="inc-type" onchange="toggleTypeDefaults()">
|
||||||
<option value="adhoc">Live-Monitoring — Ereignis beobachten</option>
|
<option value="adhoc">Live-Monitoring : Ereignis beobachten</option>
|
||||||
<option value="research">Recherche — Thema analysieren</option>
|
<option value="research">Recherche : Thema analysieren</option>
|
||||||
</select>
|
</select>
|
||||||
<div class="form-hint" id="type-hint">
|
<div class="form-hint" id="type-hint">
|
||||||
Durchsucht laufend hunderte Nachrichtenquellen nach neuen Meldungen. Empfohlen: Automatische Aktualisierung.
|
Durchsucht laufend hunderte Nachrichtenquellen nach neuen Meldungen. Empfohlen: Automatische Aktualisierung.
|
||||||
@@ -375,7 +375,7 @@
|
|||||||
<label class="toggle-label">
|
<label class="toggle-label">
|
||||||
<input type="checkbox" id="inc-visibility" checked>
|
<input type="checkbox" id="inc-visibility" checked>
|
||||||
<span class="toggle-switch"></span>
|
<span class="toggle-switch"></span>
|
||||||
<span class="toggle-text" id="visibility-text">Öffentlich — für alle Nutzer sichtbar</span>
|
<span class="toggle-text" id="visibility-text">Öffentlich : für alle Nutzer sichtbar</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1634,6 +1634,7 @@ async generateDescription() {
|
|||||||
try {
|
try {
|
||||||
const result = await API.enhanceDescription(title, description || null, type, this._enhanceController.signal);
|
const result = await API.enhanceDescription(title, description || null, type, this._enhanceController.signal);
|
||||||
textarea.value = result.description;
|
textarea.value = result.description;
|
||||||
|
_autoResizeTextarea(textarea);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.name !== 'AbortError') {
|
if (err.name !== 'AbortError') {
|
||||||
UI.showToast('Beschreibung konnte nicht generiert werden', 'error');
|
UI.showToast('Beschreibung konnte nicht generiert werden', 'error');
|
||||||
@@ -1908,7 +1909,7 @@ async handleRefresh() {
|
|||||||
|
|
||||||
// Formular mit aktuellen Werten füllen
|
// Formular mit aktuellen Werten füllen
|
||||||
{ const _e = document.getElementById('inc-title'); if (_e) _e.value = incident.title; }
|
{ const _e = document.getElementById('inc-title'); if (_e) _e.value = incident.title; }
|
||||||
{ const _e = document.getElementById('inc-description'); if (_e) _e.value = incident.description || ''; }
|
{ const _e = document.getElementById('inc-description'); if (_e) { _e.value = incident.description || ''; _autoResizeTextarea(_e); } }
|
||||||
{ const _b = document.getElementById('btn-enhance-description'); if (_b) _b.disabled = (incident.title || '').trim().length < 3; }
|
{ const _b = document.getElementById('btn-enhance-description'); if (_b) _b.disabled = (incident.title || '').trim().length < 3; }
|
||||||
{ const _e = document.getElementById('inc-type'); if (_e) _e.value = incident.type || 'adhoc'; }
|
{ const _e = document.getElementById('inc-type'); if (_e) _e.value = incident.type || 'adhoc'; }
|
||||||
{ const _e = document.getElementById('inc-refresh-mode'); if (_e) _e.value = incident.refresh_mode; }
|
{ const _e = document.getElementById('inc-refresh-mode'); if (_e) _e.value = incident.refresh_mode; }
|
||||||
@@ -3266,7 +3267,7 @@ function toggleTypeDefaults() {
|
|||||||
const descIcon = document.getElementById('description-info-icon');
|
const descIcon = document.getElementById('description-info-icon');
|
||||||
if (descIcon) {
|
if (descIcon) {
|
||||||
descIcon.setAttribute('data-tooltip', type === 'research'
|
descIcon.setAttribute('data-tooltip', type === 'research'
|
||||||
? 'Nenne das vollst\u00e4ndige Thema, gew\u00fcnschte Schwerpunkte und relevante URLs.\nBeispiel: "Muster GmbH \u2014 Fokus auf F\u00fchrungspersonen, Kontroversen, Finanzkennzahlen"'
|
? 'Nenne das vollst\u00e4ndige Thema, gew\u00fcnschte Schwerpunkte und relevante URLs.\nBeispiel: "Muster GmbH: Fokus auf F\u00fchrungspersonen, Kontroversen, Finanzkennzahlen"'
|
||||||
: 'Beschreibe den Vorfall m\u00f6glichst genau: Was ist passiert? Wo? Wer ist beteiligt?\nJe pr\u00e4ziser, desto bessere Ergebnisse.');
|
: 'Beschreibe den Vorfall m\u00f6glichst genau: Was ist passiert? Wo? Wer ist beteiligt?\nJe pr\u00e4ziser, desto bessere Ergebnisse.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3351,7 +3352,14 @@ document.addEventListener('click', (e) => {
|
|||||||
document.addEventListener('DOMContentLoaded', () => App.init());
|
document.addEventListener('DOMContentLoaded', () => App.init());
|
||||||
|
|
||||||
|
|
||||||
// Titel-Input: Button "Beschreibung generieren" aktivieren/deaktivieren
|
// Auto-Resize fuer Textarea
|
||||||
|
function _autoResizeTextarea(el) {
|
||||||
|
if (!el) return;
|
||||||
|
el.style.height = 'auto';
|
||||||
|
el.style.height = Math.max(80, el.scrollHeight) + 'px';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Titel-Input: Button aktivieren + Textarea Auto-Resize
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const titleInput = document.getElementById('inc-title');
|
const titleInput = document.getElementById('inc-title');
|
||||||
if (titleInput) {
|
if (titleInput) {
|
||||||
@@ -3360,4 +3368,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
if (btn) btn.disabled = this.value.trim().length < 3;
|
if (btn) btn.disabled = this.value.trim().length < 3;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
const descInput = document.getElementById('inc-description');
|
||||||
|
if (descInput) {
|
||||||
|
descInput.addEventListener('input', function() { _autoResizeTextarea(this); });
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
In neuem Issue referenzieren
Einen Benutzer sperren