Added sup & sub tags in BBCode (#746)

This commit is contained in:
Roman Kelesidis 2023-05-31 00:03:32 +07:00 committed by GitHub
commit 1d9db82688
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 6 deletions

View file

@ -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';

View file

@ -120,6 +120,10 @@ class BBCode
'[/i]' => '</span>',
'[s]' => '<span class="post-s">',
'[/s]' => '</span>',
'[sup]' => '<sup>',
'[/sup]' => '</sup>',
'[sub]' => '<sub>',
'[/sub]' => '</sub>',
'[del]' => '<span class="post-s">',
'[/del]' => '</span>',
'[clear]' => '<div class="clear">&nbsp;</div>',

View file

@ -27,7 +27,7 @@ ajax.callback.posts = function(data) {
<option style="font-family: Georgia" value="Georgia">&nbsp;Georgia</option>
<option style="font-family: Fixedsys" value="Fixedsys">&nbsp;Fixedsys</option>
</select>
&nbsp;
<select name="codeColor" class="text_color">
<option style="color: black; background: #fff;" value="black" selected="selected">{L_QR_COLOR_SEL}:</option>
<option style="color: darkred;" value="darkred">&nbsp;{L_COLOR_DARK_RED}</option>
@ -44,7 +44,7 @@ ajax.callback.posts = function(data) {
<option style="color: indigo;" value="indigo">&nbsp;{L_COLOR_INDIGO}</option>
<option style="color: #006699;" value="#006699">&nbsp;{L_COLOR_STEEL_BLUE}</option>
</select>
&nbsp;
<select name="codeSize" class="text_size">
<option value="12" selected="selected">{L_QR_SIZE_SEL}:</option>
<option value="9" class="em">{L_FONT_SMALL}</option>
@ -74,7 +74,7 @@ ajax.callback.posts = function(data) {
<input type="button" value="&para;" name="codeBR" title="{L_NEW_LINE}" style="width: 26px;" />&nbsp;
<input type="button" value="{L_SPOILER}" name="codeSpoiler" title="{L_SPOILER}" style="width: 65px;" />
</span>
&nbsp;
<div class="buttons floatR">
<input type="button" value="+" onclick="$('#message').css({height: parseInt($('#message').css('height')) + 100}); return false;">
<input type="button" value="-" onclick="$('#message').css({height: parseInt($('#message').css('height')) - 100}); return false;">
@ -86,7 +86,9 @@ ajax.callback.posts = function(data) {
<input type="button" value="B" name="codeB" title="{L_BOLD}" style="font-weight: bold; width: 25px;" />
<input type="button" value="i" name="codeI" title="{L_ITALIC}" style="width: 25px; font-style: italic;" />
<input type="button" value="u" name="codeU" title="{L_UNDERLINE}" style="width: 25px; text-decoration: underline;" />
<input type="button" value="s" name="codeS" title="{L_STRIKEOUT}" style="width: 25px; text-decoration: line-through;" />&nbsp;&nbsp;
<input type="button" value="s" name="codeS" title="{L_STRIKEOUT}" style="width: 25px; text-decoration: line-through;" />&nbsp;
<input type="button" value="sup" name="codeSup" title="{L_SUPERSCRIPT}" />
<input type="button" value="sub" name="codeSub" title="{L_SUBSCRIPT}" />&nbsp;
<input type="button" value="{L_QUOTE}" name="codeQuote" title="{L_QUOTE_TITLE}" style="width: 57px;" />
<input type="button" value="Img" name="codeImg" title="{L_IMG_TITLE}" style="width: 40px;" />
<input type="button" value="{L_URL}" name="codeUrl" title="{L_URL_TITLE}" style="width: 63px; text-decoration: underline;" />&nbsp;
@ -107,8 +109,8 @@ ajax.callback.posts = function(data) {
<div class="mrg_8 tCenter">
<div id="post-buttons-block" style="display: none;">
<div class="pad_4" align="center">{CAPTCHA_HTML}</div>
<input type="submit" name="preview" value="{L_PREVIEW}" id="post-preview-btn" onclick="$('#post-submit').remove();">&nbsp;&nbsp;
<input onclick="submitted = true;" title="Ctrl+Enter" type="submit" name="post" class="bold" value="{L_SUBMIT}" id="post-submit-btn">&nbsp;&nbsp;
<input type="submit" name="preview" value="{L_PREVIEW}" id="post-preview-btn" onclick="$('#post-submit').remove();">&nbsp;
<input onclick="submitted = true;" title="Ctrl+Enter" type="submit" name="post" class="bold" value="{L_SUBMIT}" id="post-submit-btn">&nbsp;
<input type="button" value="{L_AJAX_PREVIEW}" onclick="ajax.exec({ action: 'posts', type: 'view_message', message: $('textarea#message').val()});">
</div>
<div id="post-js-warn">{L_JAVASCRIPT_ON}</div>
@ -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);