First, select a BBCode and find its tag. For example, for
[hashtag][/hashtag]
it is hashtag
. Then find an icon for your BBcode from Font Awesome 4.The code that will display your BBcode as an icon instead of text in editor is as follows.
Code: Select all
$(document).ready(function(){
$('.bbcode-hashtag').html("<i class='icon fa-hashtag fa-fw'></i>");
});
.bbcode-hashtag
. It should be .bbcode-BBcodeTag. Change <i class='icon fa-hashtag fa-fw'></i>
or even just fa-hashtag
depending on the icon you choose.Then open the /template/ajax.js file of the style you are using. Find the following line at the bottom of the file:
Code: Select all
})(jQuery); // Avoid conflicts with other libraries
Now your BBcode is shown with an icon.