Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add strikethrough #250

Open
Tymewalk opened this issue Sep 28, 2016 · 1 comment
Open

Add strikethrough #250

Tymewalk opened this issue Sep 28, 2016 · 1 comment

Comments

@Tymewalk
Copy link

Many forums support strikethrough, yet AJAX chat does not.

[s]Example[/s]

Appears as Example

From my view it should be simple, do the same thing with [b], [i], and [u], but with <s></s> instead.

@phillipkirk
Copy link

phillipkirk commented Sep 1, 2023

Method

Giving AJAX-Chat the ability to parse the BBCode

This can be done by looking for the following code in config.js (chat/js/config.js);

// Defines the list of allowed BBCodes:
bbCodeTags:[
	'b',
	'i',
	'u',
	'quote',
	'code',
	'color',
	'url',
	'img'
],

and amend to the following;

// Defines the list of allowed BBCodes:
bbCodeTags:[
	'b',
	'i',
	'u',
	's',
	'quote',
	'code',
	'color',
	'url',
	'img'
],

Adding a button to the BBCode toolbar

Adding a button is takes a bit more, in loggedIn.html (chat/lib/template/loggedIn.html) find the block towards the bottom with id's like bbCodeBold and bbCodeItalic and add this line of code where you want the button;

<input id="bbCodeStrikethrough" type="button" value="[LANG]bbCodeLabelStrikethrough[/LANG]" title="[LANG]bbCodeTitleStrikethrough[/LANG]" onclick="ajaxChat.insertBBCode('s');" style="text-decoration:line-through;"/>

Then edit every PHP file in chat\lib\lang to add (with the appropriate translations, here written for en.php);

$lang['bbCodeLabelStrikethrough'] = 's';
$lang['bbCodeTitleStrikethrough'] = 'Strikethrough text: [s]text[/s]';

Screenshots

  • Output in chat
    ajax_chat_s_output

  • Button on BBCode toolbar
    ajax_chat_s_button

  • Tooltip for button
    ajax_chat_s_button_tooltip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants