How do I add custom BBCode?

Go down

How do I add custom BBCode?

Post by andreiwow2 on 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
avatar
andreiwow2
New Member

Posts : 1
Reputation : 1
Language : Romanian

http://www.freshgamingrp.com

Back to top Go down

Re: How do I add custom BBCode?

Post by SSYT on 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');
}
avatar
SSYT
Forumember

Male Posts : 71
Reputation : 12
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum