This repository has been archived on 2026-02-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
breakpilot-pwa/h5p-service/editors/timeline-editor.html
Benjamin Admin 21a844cb8a fix: Restore all files lost during destructive rebase
A previous `git pull --rebase origin main` dropped 177 local commits,
losing 3400+ files across admin-v2, backend, studio-v2, website,
klausur-service, and many other services. The partial restore attempt
(660295e2) only recovered some files.

This commit restores all missing files from pre-rebase ref 98933f5e
while preserving post-rebase additions (night-scheduler, night-mode UI,
NightModeWidget dashboard integration).

Restored features include:
- AI Module Sidebar (FAB), OCR Labeling, OCR Compare
- GPU Dashboard, RAG Pipeline, Magic Help
- Klausur-Korrektur (8 files), Abitur-Archiv (5+ files)
- Companion, Zeugnisse-Crawler, Screen Flow
- Full backend, studio-v2, website, klausur-service
- All compliance SDKs, agent-core, voice-service
- CI/CD configs, documentation, scripts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 09:51:32 +01:00

330 lines
8.6 KiB
HTML

<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Timeline Editor - BreakPilot H5P</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
background: #f5f5f5;
padding: 20px;
}
.container {
background: white;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
padding: 30px;
max-width: 900px;
margin: 0 auto;
}
h1 {
color: #333;
margin-bottom: 24px;
display: flex;
align-items: center;
gap: 12px;
}
.info-box {
background: #f0f9ff;
border-left: 4px solid #3b82f6;
padding: 16px;
margin-bottom: 24px;
border-radius: 4px;
}
.form-group {
margin-bottom: 24px;
}
label {
display: block;
font-weight: 600;
color: #374151;
margin-bottom: 8px;
}
input[type="text"], input[type="number"], textarea {
width: 100%;
padding: 10px 14px;
border: 2px solid #e5e7eb;
border-radius: 6px;
font-size: 14px;
font-family: inherit;
transition: border-color 0.2s;
}
input[type="text"]:focus, input[type="number"]:focus, textarea:focus {
outline: none;
border-color: #667eea;
}
textarea {
resize: vertical;
min-height: 80px;
}
.event-card {
background: #f9fafb;
border-left: 4px solid #667eea;
border-radius: 8px;
padding: 20px;
margin-bottom: 16px;
}
.event-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
}
.event-number {
font-weight: 700;
color: #667eea;
font-size: 16px;
}
.form-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
}
.btn {
padding: 10px 20px;
border: none;
border-radius: 6px;
font-weight: 600;
cursor: pointer;
font-size: 14px;
transition: all 0.2s;
}
.btn-primary {
background: #667eea;
color: white;
}
.btn-primary:hover {
background: #5568d3;
}
.btn-secondary {
background: #e5e7eb;
color: #374151;
}
.btn-secondary:hover {
background: #d1d5db;
}
.btn-danger {
background: #ef4444;
color: white;
}
.btn-danger:hover {
background: #dc2626;
}
.btn-group {
display: flex;
gap: 12px;
margin-top: 24px;
}
.add-event-btn {
width: 100%;
padding: 16px;
border: 2px dashed #9ca3af;
background: transparent;
color: #6b7280;
border-radius: 8px;
cursor: pointer;
font-size: 14px;
font-weight: 600;
transition: all 0.2s;
}
.add-event-btn:hover {
border-color: #667eea;
color: #667eea;
background: #f9fafb;
}
.success-message {
background: #d1fae5;
border: 2px solid #10b981;
color: #065f46;
padding: 16px;
border-radius: 6px;
margin-bottom: 20px;
display: none;
}
</style>
</head>
<body>
<div class="container">
<h1>
<span>📅</span>
Timeline Editor
</h1>
<div class="success-message" id="successMessage">
✅ Timeline erfolgreich gespeichert!
</div>
<div class="info-box">
<h3 style="color: #1e40af; margin-bottom: 8px; font-size: 14px;">💡 Wie funktioniert Timeline?</h3>
<p style="color: #475569; font-size: 14px; line-height: 1.6;">
Erstelle eine interaktive Zeitleiste mit historischen Ereignissen oder Meilensteinen.
Ideal für Geschichte, Biografie, Projektverläufe und mehr.
</p>
</div>
<div class="form-group">
<label for="title">Titel der Timeline</label>
<input type="text" id="title" placeholder="z.B. Wichtige Ereignisse des 20. Jahrhunderts">
</div>
<div class="form-group">
<label for="description">Beschreibung (optional)</label>
<textarea id="description" placeholder="Kurze Einführung zur Timeline..."></textarea>
</div>
<div id="eventsContainer"></div>
<button class="add-event-btn" onclick="addEvent()">
+ Neues Ereignis hinzufügen
</button>
<div class="btn-group">
<button class="btn btn-primary" onclick="saveTimeline()">💾 Speichern</button>
<button class="btn btn-secondary" onclick="previewTimeline()">📅 Anzeigen</button>
<button class="btn btn-secondary" onclick="window.history.back()">← Zurück</button>
</div>
</div>
<script>
let events = [];
function addEvent() {
const eventId = Date.now();
events.push({
id: eventId,
year: new Date().getFullYear(),
title: '',
description: ''
});
renderEvents();
}
function removeEvent(eventId) {
if (confirm('Ereignis wirklich löschen?')) {
events = events.filter(e => e.id !== eventId);
renderEvents();
}
}
function updateEvent(eventId, field, value) {
const event = events.find(e => e.id === eventId);
if (event) {
event[field] = field === 'year' ? parseInt(value) || 0 : value;
}
}
function renderEvents() {
const container = document.getElementById('eventsContainer');
container.innerHTML = '';
// Sort by year
const sortedEvents = [...events].sort((a, b) => a.year - b.year);
sortedEvents.forEach((event, index) => {
const eventEl = document.createElement('div');
eventEl.className = 'event-card';
eventEl.innerHTML = `
<div class="event-header">
<span class="event-number">📍 Ereignis ${index + 1}</span>
<button class="btn btn-danger" style="padding: 6px 12px; font-size: 12px;" onclick="removeEvent(${event.id})">🗑️ Löschen</button>
</div>
<div class="form-group">
<label>Jahr</label>
<input type="number"
value="${event.year}"
onchange="updateEvent(${event.id}, 'year', this.value); renderEvents();"
placeholder="z.B. 1945">
</div>
<div class="form-group">
<label>Titel des Ereignisses</label>
<input type="text"
value="${event.title}"
onchange="updateEvent(${event.id}, 'title', this.value)"
placeholder="z.B. Ende des Zweiten Weltkriegs">
</div>
<div class="form-group">
<label>Beschreibung</label>
<textarea
onchange="updateEvent(${event.id}, 'description', this.value)"
placeholder="Kurze Beschreibung des Ereignisses...">${event.description}</textarea>
</div>
`;
container.appendChild(eventEl);
});
}
function saveTimeline() {
const title = document.getElementById('title').value;
const description = document.getElementById('description').value;
if (!title) {
alert('Bitte gib einen Titel ein!');
return;
}
if (events.length < 2) {
alert('Bitte füge mindestens 2 Ereignisse hinzu!');
return;
}
for (let i = 0; i < events.length; i++) {
if (!events[i].title) {
alert(`Ereignis ${i + 1} hat keinen Titel!`);
return;
}
if (!events[i].year) {
alert(`Ereignis ${i + 1} hat kein Jahr!`);
return;
}
}
const timelineData = {
type: 'timeline',
title,
description,
events: events.sort((a, b) => a.year - b.year),
created: new Date().toISOString()
};
const contentId = 'timeline_' + Date.now();
localStorage.setItem(contentId, JSON.stringify(timelineData));
const successMsg = document.getElementById('successMessage');
successMsg.style.display = 'block';
setTimeout(() => {
successMsg.style.display = 'none';
}, 3000);
console.log('Timeline gespeichert:', timelineData);
}
function previewTimeline() {
const title = document.getElementById('title').value;
if (!title || events.length < 2) {
alert('Bitte fülle erst den Titel und mindestens 2 Ereignisse aus!');
return;
}
const previewData = encodeURIComponent(JSON.stringify({
title,
description: document.getElementById('description').value,
events: events.sort((a, b) => a.year - b.year)
}));
window.open(`/h5p/player/timeline?data=${previewData}`, '_blank');
}
// Initialize with 3 events
addEvent();
addEvent();
addEvent();
</script>
</body>
</html>