How do I add custom BBCode? Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
2 posters

    How do I add custom BBCode?

    andreiwow2
    andreiwow2
    New Member


    Posts : 1
    Reputation : 1
    Language : Romanian

    How do I add custom BBCode? Empty How do I add custom BBCode?

    Post by andreiwow2 March 13th 2018, 6:39 pm

    Hello, what I am trying to do is add custom BBCodes for staff members for example "announcement template" etc. Is there any place where I can do the BBCode or do I have to do a workaround? Add a button to the editor which when clicked insert the text in the editor? Question
    SSYT
    SSYT
    Forumember


    Male Posts : 77
    Reputation : 15
    Language : RO-10, EN-3, FR-1
    Location : Romania

    How do I add custom BBCode? Empty Re: How do I add custom BBCode?

    Post by SSYT March 13th 2018, 8:18 pm

    Try:

    Javascript:
    Code:
    $(function() {
      $.sceditor.command.set('newcmd', {
        exec: function() {
                this.insert('a');
        },
        txtExec: function() {
                this.insert('a');
        },
        tooltip: 'Added new button'
      });

      if($.sceditor && window.toolbar) {
         window.toolbar = window.toolbar.replace(/time,/gi, "time,newcmd,");
      }
    });

    CSS:
    Code:
    .sceditor-button-newcmd {
        background: url('/images/icon.png');
    }

    Simone Boi likes this post