From 5420ba37c5d5037617d6daab03272a5146af263c Mon Sep 17 00:00:00 2001
From: Jonas Kohl
Date: Sat, 12 Oct 2024 19:56:49 +0200
Subject: Add rich text editor to New topic page

---
 src/application/views/form_addpost.php | 57 ----------------------------------
 1 file changed, 57 deletions(-)

(limited to 'src/application/views/form_addpost.php')

diff --git a/src/application/views/form_addpost.php b/src/application/views/form_addpost.php
index 9e617d9..b2fb2f2 100644
--- a/src/application/views/form_addpost.php
+++ b/src/application/views/form_addpost.php
@@ -51,60 +51,3 @@ if (($_formError = RequestUtils::getAndClearFormError("addpost")) !== null) {
 </div>
 <button type="submit" class="btn btn-success"><?= __("Post reply") ?> <span class="fa fa-send" aria-hidden="true"></span></button>
 </form>
-
-<script type="text/javascript">
-    $(function() {
-        function insertAroundSelection(textarea, before, after) {
-            var start = textarea.selectionStart;
-            var end = textarea.selectionEnd;
-            var text = textarea.value;
-            var pre = text.substring(0, start);
-            var inner = text.substring(start, end);
-            var post = text.substring(end);
-            start += before.length;
-            end += before.length;
-            text = pre + before + inner + after + post;
-            textarea.value = text;
-            textarea.focus();
-            textarea.selectionStart = start;
-            textarea.selectionEnd = end;
-        }
-
-        function getTextarea(btn) {
-            return $($(btn).attr("data-area"))[0];
-        }
-
-        var commands = {
-            bold: function(textarea) {
-                insertAroundSelection(textarea, "[b]", "[/b]");
-            },
-            italic: function(textarea) {
-                insertAroundSelection(textarea, "[i]", "[/i]");
-            },
-            underline: function(textarea) {
-                insertAroundSelection(textarea, "[u]", "[/u]");
-            },
-            strikethrough: function(textarea) {
-                insertAroundSelection(textarea, "[s]", "[/s]");
-            },
-            sup: function(textarea) {
-                insertAroundSelection(textarea, "[^]", "[/^]");
-            },
-            sub: function(textarea) {
-                insertAroundSelection(textarea, "[_]", "[/_]");
-            },
-            quote: function(textarea) {
-                insertAroundSelection(textarea, "> ", "");
-            },
-            spoiler: function(textarea) {
-                insertAroundSelection(textarea, "[spoiler]", "[/spoiler]");
-            }
-        }
-
-        $("button[data-editor-command]").attr("data-toggle", "tooltip").attr("data-placement", "bottom").click(function() {
-            var command = $(this).attr("data-editor-command");
-            var textarea = getTextarea(this);
-            commands[command](textarea);
-        }).tooltip();
-    });
-</script>
-- 
cgit v1.2.3