Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

In this Discussion

Tutorial: How To Add a Mathjax option to your buttonbar.

This discussion is related to the Mathjax CDN addon.
peregrineperegrine MVP
edited June 2014 in Tutorials

To add a mathjax option insert to your buttonbar.

1) copy the plugins/MathJaxCDN/math.png to plugins/ButtonBar/design/images/math.png

2) Add this to your plugins/ButtonBar/design/buttonbar.css

.ButtonBar .ButtonBarMath { background-image: url('images/math.png'); }

3) Add this to ButtonBar/views/buttonbar.php

echo '<span class="ButtonWrap"><span>math </span></span>';


4) Add among the other case statement ButtonBar/js/buttonbar.js

        case 'math':
        $(TextArea).insertRoundTag('math',bbcodeOpts);
        break; 

5) change in buttonbar.js

        PerformHtml: function(TextArea, Operation) {
        var htmlOpts = {
        opener: '<',
        closer: '>'
        }
        to
        PerformHtml: function(TextArea, Operation) {
        var htmlOpts = {
        opener: '<',
        closer: '>'
        }
        bbcodeOpts = {
        opener: '[',
        closer: ']'
        }

also add the bbcodeOpts to Markdown

from 

        PerformMarkdown: function(TextArea, Operation) {
        var markdownOpts = {
        opener: '',
        closer: '',
        closeslice: ''
        }


    TO:


        PerformMarkdown: function(TextArea, Operation) {
        var markdownOpts = {
        opener: '',
        closer: '',
        closeslice: ''
        }
        bbcodeOpts = {
        opener: '[',
        closer: ']'
        }

I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

vrijvlinder

Comments

Sign In or Register to comment.