From fd309443ea0a4e4e37033dbf042aa9f7f445dd7a Mon Sep 17 00:00:00 2001 From: Zankaria Date: Thu, 19 Sep 2024 22:54:04 +0200 Subject: [PATCH] js: drop IE support --- js/quote-selection.js | 9 +-------- templates/main.js | 7 +------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/js/quote-selection.js b/js/quote-selection.js index 6f609319..ad7a76ed 100644 --- a/js/quote-selection.js +++ b/js/quote-selection.js @@ -97,14 +97,7 @@ $(document).ready(function(){ // console.log('Deselecting text'); selection.removeAllRanges(); - if (document.selection) { - // IE - body.focus(); - var sel = document.selection.createRange(); - sel.text = quote; - body.focus(); - } else if (body.selectionStart || body.selectionStart == '0') { - // Mozilla + if (body.selectionStart || body.selectionStart == '0') { var start = body.selectionStart; var end = body.selectionEnd; diff --git a/templates/main.js b/templates/main.js index 53150e2f..96d2fb3f 100644 --- a/templates/main.js +++ b/templates/main.js @@ -307,12 +307,7 @@ function citeReply(id, with_link) { return false; } - if (document.selection) { - // IE - textarea.focus(); - let sel = document.selection.createRange(); - sel.text = '>>' + id + '\n'; - } else if (textarea.selectionStart || textarea.selectionStart == '0') { + if (textarea.selectionStart || textarea.selectionStart == '0') { let start = textarea.selectionStart; let end = textarea.selectionEnd; textarea.value = textarea.value.substring(0, start) + '>>' + id + '\n' + textarea.value.substring(end, textarea.value.length);