Compare commits

2 Commits

6 changed files with 24 additions and 24 deletions

Binary file not shown.

View File

@@ -41,7 +41,7 @@ app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(days=365) # Langlebige Session für Dark Mode-Einstellung
# OpenAI API-Konfiguration
client = OpenAI(api_key="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")
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
# Context processor für globale Template-Variablen
@app.context_processor
@@ -1109,7 +1109,7 @@ def create_default_categories():
child = Category(**child_data, parent_id=category.id)
db.session.add(child)
db.session.commit()
db.session.commit()
print("Standard-Kategorien wurden erstellt!")
def initialize_database():

BIN
website/instance/mindmap.db Normal file

Binary file not shown.

View File

@@ -714,7 +714,7 @@
<!-- Initialization Script -->
<script>
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener('DOMContentLoaded', function() {
// Mindmap-Container holen
const mindmapContainer = document.getElementById('mindmap-container');
@@ -837,7 +837,7 @@ document.addEventListener('DOMContentLoaded', function() {
});
// UI Event-Handler einrichten
document.getElementById('zoom-in-btn').addEventListener('click', function() {
document.getElementById('zoom-in-btn').addEventListener('click', function() {
if (window.mindmap) {
const transform = d3.zoomTransform(window.mindmap.svg.node());
window.mindmap.svg.call(
@@ -845,9 +845,9 @@ document.addEventListener('DOMContentLoaded', function() {
d3.zoomIdentity.translate(transform.x, transform.y).scale(transform.k * 1.3)
);
}
});
});
document.getElementById('zoom-out-btn').addEventListener('click', function() {
document.getElementById('zoom-out-btn').addEventListener('click', function() {
if (window.mindmap) {
const transform = d3.zoomTransform(window.mindmap.svg.node());
window.mindmap.svg.call(
@@ -855,18 +855,18 @@ document.addEventListener('DOMContentLoaded', function() {
d3.zoomIdentity.translate(transform.x, transform.y).scale(transform.k / 1.3)
);
}
});
});
document.getElementById('center-btn').addEventListener('click', function() {
document.getElementById('center-btn').addEventListener('click', function() {
if (window.mindmap) {
window.mindmap.svg.call(
d3.zoom().transform,
d3.zoomIdentity
);
}
});
});
document.getElementById('add-thought-btn').addEventListener('click', function() {
document.getElementById('add-thought-btn').addEventListener('click', function() {
if (window.mindmap && window.mindmap.selectedNode) {
const nodeId = window.mindmap.selectedNode.id;
const modal = document.getElementById('add-thought-modal');
@@ -923,13 +923,13 @@ document.addEventListener('DOMContentLoaded', function() {
alert('Fehler beim Hinzufügen des Gedankens.');
});
}
}
} else {
}
} else {
alert('Bitte wähle zuerst einen Knoten aus.');
}
});
}
});
document.getElementById('connect-btn').addEventListener('click', function() {
document.getElementById('connect-btn').addEventListener('click', function() {
if (window.mindmap && window.mindmap.selectedNode) {
// Speichere den ersten ausgewählten Knoten
window.mindmap.sourceNode = window.mindmap.selectedNode;
@@ -962,7 +962,7 @@ document.addEventListener('DOMContentLoaded', function() {
// Cursor-Stil ändern, um den Verbindungsmodus anzuzeigen
document.getElementById('mindmap-container').style.cursor = 'crosshair';
} else {
} else {
alert('Bitte wähle zuerst einen Knoten aus.');
}
});
@@ -1019,8 +1019,8 @@ document.addEventListener('DOMContentLoaded', function() {
.catch(error => {
console.error('Fehler beim Speichern des Gedankens:', error);
alert('Fehler beim Speichern des Gedankens. Bitte versuche es erneut.');
});
});
});
}
// Fenstergrößen-Änderung behandeln