Revert "Feature: Analyse-Anweisungen (Direktiven) fuer Tabellen und Zusammenfassung"
This reverts commit e0bcd85d90.
Dieser Commit ist enthalten in:
@@ -1673,38 +1673,6 @@ const App = {
|
||||
}
|
||||
},
|
||||
|
||||
insertDirective(type) {
|
||||
const textarea = document.getElementById('inc-description');
|
||||
if (!textarea) return;
|
||||
const directives = {
|
||||
summary: '[ZUSAMMENFASSUNG]',
|
||||
compare: '[TABELLE: Vergleiche ... nach ...]',
|
||||
timeline: '[TABELLE: Zeitlicher Verlauf mit Datum und Ereignis]',
|
||||
procon: '[TABELLE: Pro- und Contra-Argumente]',
|
||||
custom: '[TABELLE: ]',
|
||||
};
|
||||
const directive = directives[type];
|
||||
if (!directive) return;
|
||||
|
||||
// Duplikat-Check (ausser bei custom)
|
||||
if (type !== 'custom' && textarea.value.includes(directive)) return;
|
||||
|
||||
var val = textarea.value;
|
||||
if (val.length > 0 && !val.endsWith('\n')) val += '\n';
|
||||
if (val.length > 0 && !val.endsWith('\n\n')) val += '\n';
|
||||
val += directive;
|
||||
textarea.value = val;
|
||||
|
||||
// Bei custom: Cursor vor die schliessende Klammer setzen
|
||||
if (type === 'custom') {
|
||||
textarea.focus();
|
||||
var pos = val.length - 1;
|
||||
textarea.setSelectionRange(pos, pos);
|
||||
}
|
||||
// Textarea-Groesse anpassen
|
||||
if (typeof _autoResizeTextarea === 'function') _autoResizeTextarea(textarea);
|
||||
},
|
||||
|
||||
async generateDescription() {
|
||||
const title = document.getElementById('inc-title').value.trim();
|
||||
const description = document.getElementById('inc-description').value.trim();
|
||||
@@ -1726,22 +1694,9 @@ async generateDescription() {
|
||||
textarea.readOnly = true;
|
||||
textarea.classList.add('textarea--loading');
|
||||
|
||||
// Bestehende Direktiven sichern
|
||||
var existingDirectives = [];
|
||||
var directiveRegex = /\[(?:TABELLE:.*?|ZUSAMMENFASSUNG)\]/g;
|
||||
var match;
|
||||
while ((match = directiveRegex.exec(description)) !== null) {
|
||||
existingDirectives.push(match[0]);
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await API.enhanceDescription(title, description || null, type, this._enhanceController.signal);
|
||||
var newDesc = result.description;
|
||||
// Gesicherte Direktiven wieder anhaengen
|
||||
if (existingDirectives.length > 0) {
|
||||
newDesc = newDesc.trimEnd() + '\n\n' + existingDirectives.join('\n');
|
||||
}
|
||||
textarea.value = newDesc;
|
||||
textarea.value = result.description;
|
||||
_autoResizeTextarea(textarea);
|
||||
} catch (err) {
|
||||
if (err.name !== 'AbortError') {
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren