summaryrefslogtreecommitdiff
path: root/src/application/views/form_addpost.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/application/views/form_addpost.php')
-rw-r--r--src/application/views/form_addpost.php57
1 files changed, 0 insertions, 57 deletions
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>