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

After February 6, this site will no longer have Facebook, Twitter, or OpenID sign-in options. Read our announcement about social media SSO support in 2.8 for more info.

Make sure you have a current, valid email address set in your profile and set a password so you can login without it. If you get locked out after that time, you can choose "Forgot Password" to fix it as long as a valid email is on your account.

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.