diff --git a/CHANGELOG.md b/CHANGELOG.md index d049d82cc..b500d080b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Release 2.4.2 🐯 ([belomaxorka](https://github.com/belomaxorka)) - Added demo mode 📺 [\#1399](https://github.com/torrentpier/torrentpier/pull/1399) ([belomaxorka](https://github.com/belomaxorka)) +- Added BBCode Acronym tag [\#1419](https://github.com/torrentpier/torrentpier/pull/1419) ([belomaxorka](https://github.com/belomaxorka)) - Added showing poll status in topic_watch.php [\#1413](https://github.com/torrentpier/torrentpier/pull/1413) ([belomaxorka](https://github.com/belomaxorka)) - Added ability to view post_text of topic [\#1401](https://github.com/torrentpier/torrentpier/pull/1401) ([belomaxorka](https://github.com/belomaxorka)) - Added support for rutracker font BBCode tag [\#1397](https://github.com/torrentpier/torrentpier/pull/1397) ([belomaxorka](https://github.com/belomaxorka)) diff --git a/library/language/source/main.php b/library/language/source/main.php index 27ea61719..d9a461602 100644 --- a/library/language/source/main.php +++ b/library/language/source/main.php @@ -1547,6 +1547,8 @@ $lang['CODE_TITLE'] = 'Code display: [code]code[/code] (Ctrl+K)'; $lang['LIST'] = 'List'; $lang['LIST_TITLE'] = 'List: [list]text[/list] (Ctrl+l)'; $lang['LIST_ITEM'] = 'Ordered list: [list=]text[/list] (Ctrl+O)'; +$lang['ACR'] = 'Acronym'; +$lang['ACR_TITLE'] = 'Acronym: [acronym=Full text]Short text[/acronym]'; $lang['QUOTE_SEL'] = 'Quote selected'; $lang['JAVASCRIPT_ON'] = 'Heads necessary to send messages to enable JavaScript'; diff --git a/src/Legacy/BBCode.php b/src/Legacy/BBCode.php index 02d65dbfe..353346297 100644 --- a/src/Legacy/BBCode.php +++ b/src/Legacy/BBCode.php @@ -82,6 +82,8 @@ class BBCode $this->preg = [ '#\[quote="(.+?)"\]#isu' => $tpl['quote_username_open'], '#\[spoiler="(.+?)"\]#isu' => $tpl['spoiler_title_open'], + '#\[acronym="([\w\- \']+)"\](.*?)\[/acronym\]#isu' => '$2', + '#\[acronym=([\w\- \']+)\](.*?)\[/acronym\]#isu' => '$2', '#\[list=(a|A|i|I|1)\]#isu' => '
$1', diff --git a/styles/templates/default/css/globals.css b/styles/templates/default/css/globals.css index 23c80be63..f49eaa9a7 100644 --- a/styles/templates/default/css/globals.css +++ b/styles/templates/default/css/globals.css @@ -384,6 +384,14 @@ a.gen, a.med, a.genmed, a.small, a.gensmall { margin-left: 2em; } +.post-acronym { + text-decoration: none; + border-bottom: 1px dashed green; + cursor: help; + color: darkgreen; + display: inline-block; +} + /* ---------------------------------- * Code blocks * ---------------------------------- */ diff --git a/styles/templates/default/posting_editor.tpl b/styles/templates/default/posting_editor.tpl index fb8118171..7a879eb23 100644 --- a/styles/templates/default/posting_editor.tpl +++ b/styles/templates/default/posting_editor.tpl @@ -94,6 +94,7 @@ ajax.callback.posts = function(data) { + @@ -194,6 +195,7 @@ function checkForm(form) { bbcode.addTag("codeCode", "code", null, "K", ctrl); bbcode.addTag("codeList", "list", null, "L", ctrl); + bbcode.addTag("codeAcronym", "acronym", null, "", ctrl); bbcode.addTag("codeOpt", "*", "", "0", ctrl);