Added BBCode Acronym tag (#1419)

* Added BBCode Acronym tag

* Update CHANGELOG.md

* Update BBCode.php
This commit is contained in:
Roman Kelesidis 2024-03-04 23:21:01 +07:00 committed by GitHub
commit 77fa47b5ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 15 additions and 0 deletions

View file

@ -7,6 +7,7 @@
- Release 2.4.2 🐯 ([belomaxorka](https://github.com/belomaxorka)) - 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 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 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 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)) - Added support for rutracker font BBCode tag [\#1397](https://github.com/torrentpier/torrentpier/pull/1397) ([belomaxorka](https://github.com/belomaxorka))

View file

@ -1547,6 +1547,8 @@ $lang['CODE_TITLE'] = 'Code display: [code]code[/code] (Ctrl+K)';
$lang['LIST'] = 'List'; $lang['LIST'] = 'List';
$lang['LIST_TITLE'] = 'List: [list]text[/list] (Ctrl+l)'; $lang['LIST_TITLE'] = 'List: [list]text[/list] (Ctrl+l)';
$lang['LIST_ITEM'] = 'Ordered list: [list=]text[/list] (Ctrl+O)'; $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['QUOTE_SEL'] = 'Quote selected';
$lang['JAVASCRIPT_ON'] = 'Heads necessary to send messages to enable JavaScript'; $lang['JAVASCRIPT_ON'] = 'Heads necessary to send messages to enable JavaScript';

View file

@ -82,6 +82,8 @@ class BBCode
$this->preg = [ $this->preg = [
'#\[quote="(.+?)"\]#isu' => $tpl['quote_username_open'], '#\[quote="(.+?)"\]#isu' => $tpl['quote_username_open'],
'#\[spoiler="(.+?)"\]#isu' => $tpl['spoiler_title_open'], '#\[spoiler="(.+?)"\]#isu' => $tpl['spoiler_title_open'],
'#\[acronym="([\w\- \']+)"\](.*?)\[/acronym\]#isu' => '<span class="post-acronym" title="$1">$2</span>',
'#\[acronym=([\w\- \']+)\](.*?)\[/acronym\]#isu' => '<span class="post-acronym" title="$1">$2</span>',
'#\[list=(a|A|i|I|1)\]#isu' => '<ul type="$1">', '#\[list=(a|A|i|I|1)\]#isu' => '<ul type="$1">',
'#\[\*=(\d+)\]#isu' => '<li value="$1">', '#\[\*=(\d+)\]#isu' => '<li value="$1">',
'#\[pre\](.*?)\[/pre\]#isu' => '<pre class="post-pre">$1</pre>', '#\[pre\](.*?)\[/pre\]#isu' => '<pre class="post-pre">$1</pre>',

View file

@ -384,6 +384,14 @@ a.gen, a.med, a.genmed, a.small, a.gensmall {
margin-left: 2em; margin-left: 2em;
} }
.post-acronym {
text-decoration: none;
border-bottom: 1px dashed green;
cursor: help;
color: darkgreen;
display: inline-block;
}
/* ---------------------------------- * /* ---------------------------------- *
Code blocks Code blocks
* ---------------------------------- */ * ---------------------------------- */

View file

@ -94,6 +94,7 @@ ajax.callback.posts = function(data) {
<input type="button" value="{L_URL}" name="codeUrl" title="{L_URL_TITLE}" style="text-decoration: underline;" />&nbsp; <input type="button" value="{L_URL}" name="codeUrl" title="{L_URL_TITLE}" style="text-decoration: underline;" />&nbsp;
<input type="button" value="{L_CODE}" name="codeCode" title="{L_CODE_TITLE}" /> <input type="button" value="{L_CODE}" name="codeCode" title="{L_CODE_TITLE}" />
<input type="button" value="{L_LIST}" name="codeList" title="{L_LIST_TITLE}" /> <input type="button" value="{L_LIST}" name="codeList" title="{L_LIST_TITLE}" />
<input type="button" value="{L_ACR}" name="codeAcronym" title="{L_ACR_TITLE}" />
<input type="button" value="1." name="codeOpt" title="{L_LIST_ITEM}" />&nbsp; <input type="button" value="1." name="codeOpt" title="{L_LIST_ITEM}" />&nbsp;
<input type="button" value="{L_QUOTE_SEL}" name="quoteselected" title="{L_QUOTE_SELECTED}" onclick="bbcode.onclickQuoteSel();" /> <input type="button" value="{L_QUOTE_SEL}" name="quoteselected" title="{L_QUOTE_SELECTED}" onclick="bbcode.onclickQuoteSel();" />
</div> </div>
@ -194,6 +195,7 @@ function checkForm(form) {
bbcode.addTag("codeCode", "code", null, "K", ctrl); bbcode.addTag("codeCode", "code", null, "K", ctrl);
bbcode.addTag("codeList", "list", null, "L", ctrl); bbcode.addTag("codeList", "list", null, "L", ctrl);
bbcode.addTag("codeAcronym", "acronym", null, "", ctrl);
bbcode.addTag("codeOpt", "*", "", "0", ctrl); bbcode.addTag("codeOpt", "*", "", "0", ctrl);
</script> </script>