Kleine Anpassungen
This commit is contained in:
@@ -233,13 +233,13 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
<div>
|
||||
<div class="mb-6">
|
||||
<div class="flex justify-between items-center mb-2">
|
||||
<label class="block text-sm font-medium text-gray-700">Bildungsinhalt</label>
|
||||
<label class="block text-sm font-medium text-gray-700">Erklärtext</label>
|
||||
<div class="flex gap-2">
|
||||
<button type="button" onclick="editor.undo()"
|
||||
<button type="button" onclick="undo()"
|
||||
class="text-gray-500 hover:text-gray-700 p-1">
|
||||
<i class="fas fa-undo"></i>
|
||||
</button>
|
||||
<button type="button" onclick="editor.redo()"
|
||||
<button type="button" onclick="redo()"
|
||||
class="text-gray-500 hover:text-gray-700 p-1">
|
||||
<i class="fas fa-redo"></i>
|
||||
</button>
|
||||
@@ -258,6 +258,15 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flow-root gap-4">
|
||||
<input type="submit" value="Thema löschen" name="submit"
|
||||
class="float-left px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-gray-200">
|
||||
<input type="submit" value="Speichern" name="submit"
|
||||
class="float-right px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700">
|
||||
<input type="button" value="Abbrechen" onclick="history.back()"
|
||||
class="float-right mx-2 px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200">
|
||||
</div>
|
||||
|
||||
<div class="border rounded-lg p-8 mt-8 bg-gray-50">
|
||||
<h4 class="text-lg font-medium text-gray-700 mb-4">Vorschau</h4>
|
||||
<div id="contentPreview" class="content-text prose prose-lg max-w-none bg-white p-6 rounded-lg shadow-sm"></div>
|
||||
@@ -312,6 +321,10 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
let html = quill.getSemanticHTML().replace(/ /g, " ");
|
||||
html = html.replaceAll("<p></p>", "<br>");
|
||||
|
||||
while (html.startsWith("<br>")) {
|
||||
html = html.replace(/^<br>/g, "");
|
||||
}
|
||||
|
||||
while (html.endsWith("<br>")) {
|
||||
html = html.replace(/<br>$/g, "");
|
||||
}
|
||||
@@ -322,6 +335,14 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
});
|
||||
quill.emitter.emit('text-change');
|
||||
|
||||
function undo() {
|
||||
quill.history.undo();
|
||||
}
|
||||
|
||||
function redo() {
|
||||
quill.history.redo();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user