Files
DocuSighn/html/master.html

127 lines
7.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Master - PDF Unterschrift System</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf-lib/1.17.1/pdf-lib.min.js"></script>
<link rel="stylesheet" href="../css/master.css">
</head>
<body>
<div class="container">
<div class="header">
<h1>📄 Master Station</h1>
<p>PDF hochladen und Unterschrift empfangen</p>
</div>
<div class="content">
<div class="connection-status" id="connectionStatus" style="display: none;">
<span class="status-indicator disconnected" id="statusIndicator"></span>
<span id="connectionText">Warte auf Signatur-Station...</span>
</div>
<div class="upload-section" id="uploadSection">
<h2>PDF Dokument auswählen</h2>
<p style="margin: 20px 0; color: #666;">Wähle eine PDF-Datei aus, die unterschrieben werden soll</p>
<input type="file" id="pdfInput" accept=".pdf" disabled>
<button class="upload-button" id="pdfSelectButton" onclick="document.getElementById('pdfInput').click()" disabled>
PDF auswählen
</button>
<p id="pdfSelectHint" style="margin-top: 15px; color: #856404; font-style: italic; display: block;">
⚠️ Bitte warten Sie, bis die Signatur-Station verbunden ist.
</p>
</div>
<div id="statusSection" style="display: none;">
<div class="status waiting" id="statusMessage">
Warte auf Unterschrift von der Signatur-Station...
</div>
<div class="text-input-section" id="textInputSection" style="display: none;">
<label for="textInput" style="display: block; margin-bottom: 10px; font-weight: 500; color: #667eea;">
📝 Text für Unterschrifts-Overlay (wird oben links angezeigt):
</label>
<input type="text" id="textInput"
style="width: 100%; padding: 12px; border: 2px solid #667eea; border-radius: 8px; font-size: 1em;">
</div>
<!-- Page Navigation -->
<div class="page-navigation" id="pageNavigation" style="display: none;">
<button class="nav-button" id="prevPageBtn" onclick="changePage(-1)">◀ Zurück</button>
<span id="pageInfo">Seite 1 von 1</span>
<button class="nav-button" id="nextPageBtn" onclick="changePage(1)">Weiter ▶</button>
<div class="page-jump">
<input type="number" id="jumpToPageInput" min="1" max="1" placeholder="Seite" style="width: 60px; padding: 5px; border: 1px solid #667eea; border-radius: 4px; text-align: center;">
<button class="nav-button" id="jumpToPageBtn" onclick="jumpToPage()">Springe zu Seite</button>
</div>
</div>
<div class="signature-placeholder" id="signaturePlaceholder" style="display: none;">
<div class="placeholder-content" id="placeholderContent">
<span class="placeholder-icon">✍️</span>
<span class="placeholder-text">Empfangene Unterschrift wird hier angezeigt</span>
</div>
<img id="placeholderSignatureImage" src="" alt="Unterschrift" style="display: none;">
</div>
<div class="pdf-preview" id="pdfPreview">
<div id="pdfCanvasContainer">
<canvas id="pdfCanvas"></canvas>
</div>
<div class="signature-overlay" id="signatureOverlay">
<div class="handle" onclick="removeSignatureOverlay()" title="Unterschrift entfernen">×</div>
<div class="text-overlay-content" id="textOverlayContent" style="display: none;"></div>
<img id="signatureImage" src="" alt="Unterschrift">
<div class="resize-handle" id="resizeHandle"></div>
</div>
</div>
<div class="signature-controls" id="signatureControls">
<p><strong>📝 Unterschrift positionieren:</strong> Ziehe die Unterschrift an die gewünschte Position im PDF. Nutze den Griff rechts unten zum Skalieren.</p>
<div class="page-selector" id="pageSelector" style="display: none; margin: 15px 0; padding: 15px; background: #f0f2ff; border-radius: 8px;">
<p style="margin-bottom: 10px;"><strong>Auf welchen Seiten platzieren?</strong></p>
<div style="display: flex; gap: 10px; flex-wrap: wrap;">
<label style="cursor: pointer;">
<input type="checkbox" id="currentPageOnly" checked onchange="updatePageSelection()">
Nur aktuelle Seite (<span id="currentPageNum">1</span>)
</label>
<label style="cursor: pointer;">
<input type="checkbox" id="allPages" onchange="updatePageSelection()">
Alle Seiten
</label>
</div>
</div>
<div style="display: flex; gap: 15px; margin-top: 15px;">
<button class="upload-button" onclick="removeSignatureOverlay()" style="flex: 1; background: #dc3545;">
🗑️ Unterschrift entfernen
</button>
<button class="upload-button" id="placeSignatureButton" style="flex: 2; background: linear-gradient(135deg, #28a745 0%, #20c997 100%);">
✓ Unterschrift & Text platzieren & PDF erstellen
</button>
</div>
</div>
<div style="text-align: center;">
<div style="display: flex; gap: 15px; justify-content: center; flex-wrap: wrap;">
<button class="download-button" id="downloadButton" disabled>
⬇ Unterschriebene PDF herunterladen
</button>
<button class="discard-button" id="discardButton">
🗑️ Verwerfen
</button>
</div>
<p id="downloadHint" style="margin-top: 10px; color: #666; display: none;">
PDF wurde erstellt und ist bereit zum Download
</p>
</div>
</div>
</div>
</div>
<script src="../js/master.js"></script>
</body>
</html>