From 1d9db82688636f71f7fa890c4651e1fec2b3fdcf Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 31 May 2023 00:03:32 +0700 Subject: [PATCH] Added sup & sub tags in BBCode (#746) --- library/language/source/main.php | 2 ++ src/Legacy/BBCode.php | 4 ++++ styles/templates/default/posting_editor.tpl | 17 +++++++++++------ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/library/language/source/main.php b/library/language/source/main.php index b4fc2d445..1cab84d5c 100644 --- a/library/language/source/main.php +++ b/library/language/source/main.php @@ -1515,6 +1515,8 @@ $lang['BOLD'] = 'Bold text: [b]text[/b] (Ctrl+B)'; $lang['ITALIC'] = 'Italic text: [i]text[/i] (Ctrl+I)'; $lang['UNDERLINE'] = 'Underline text: [u]text[/u] (Ctrl+U)'; $lang['STRIKEOUT'] = 'Strikeout text: [s]text[/s] (Ctrl+S)'; +$lang['SUPERSCRIPT'] = 'Superscript text: [sup]text[/sup]'; +$lang['SUBSCRIPT'] = 'Subscript text: [sub]text[/sub]'; $lang['QUOTE_TITLE'] = 'Quote text: [quote]text[/quote] (Ctrl+Q)'; $lang['IMG_TITLE'] = 'Insert image: [img]https://image_url[/img] (Ctrl+R)'; $lang['URL'] = 'Url'; diff --git a/src/Legacy/BBCode.php b/src/Legacy/BBCode.php index 7284d38ad..4eed96db1 100644 --- a/src/Legacy/BBCode.php +++ b/src/Legacy/BBCode.php @@ -120,6 +120,10 @@ class BBCode '[/i]' => '', '[s]' => '', '[/s]' => '', + '[sup]' => '', + '[/sup]' => '', + '[sub]' => '', + '[/sub]' => '', '[del]' => '', '[/del]' => '', '[clear]' => '
 
', diff --git a/styles/templates/default/posting_editor.tpl b/styles/templates/default/posting_editor.tpl index f81b154c4..e21d53adb 100644 --- a/styles/templates/default/posting_editor.tpl +++ b/styles/templates/default/posting_editor.tpl @@ -27,7 +27,7 @@ ajax.callback.posts = function(data) { -  + -  +   -  +
@@ -86,7 +86,9 @@ ajax.callback.posts = function(data) { -    +   + +     @@ -107,8 +109,8 @@ ajax.callback.posts = function(data) {
{L_JAVASCRIPT_ON}
@@ -185,6 +187,9 @@ bbcode.addTag("codeI", "i", null, "I", ctrl); bbcode.addTag("codeU", "u", null, "U", ctrl); bbcode.addTag("codeS", "s", null, "S", ctrl); +bbcode.addTag("codeSup", "sup", null, "", ctrl); +bbcode.addTag("codeSub", "sub", null, "", ctrl); + bbcode.addTag("codeQuote", "quote", null, "Q", ctrl); bbcode.addTag("codeImg", "img", null, "R", ctrl); bbcode.addTag("codeUrl", "url", "/url", "W", ctrl);