/**
  * Constructs the default code definitions.
  */
 public function __construct()
 {
     /* [b] bold tag */
     $builder = new CodeDefinitionBuilder('b', '<strong>{param}</strong>');
     array_push($this->definitions, $builder->build());
     /* [i] italics tag */
     $builder = new CodeDefinitionBuilder('i', '<em>{param}</em>');
     array_push($this->definitions, $builder->build());
     /* [u] italics tag */
     $builder = new CodeDefinitionBuilder('u', '<u>{param}</u>');
     array_push($this->definitions, $builder->build());
     $urlValidator = new \JBBCode\validators\UrlValidator();
     /* [url] link tag */
     $builder = new CodeDefinitionBuilder('url', '<a href="{param}">{param}</a>');
     $builder->setParseContent(false)->setBodyValidator($urlValidator);
     array_push($this->definitions, $builder->build());
     /* [url=http://example.com] link tag */
     $builder = new CodeDefinitionBuilder('url', '<a href="{option}">{param}</a>');
     $builder->setUseOption(true)->setParseContent(true)->setOptionValidator($urlValidator);
     array_push($this->definitions, $builder->build());
     /* [img] image tag */
     $builder = new CodeDefinitionBuilder('img', '<img src="{param}" />');
     $builder->setUseOption(false)->setParseContent(false)->setBodyValidator($urlValidator);
     array_push($this->definitions, $builder->build());
     /* [img=alt text] image tag */
     $builder = new CodeDefinitionBuilder('img', '<img src="{param} alt="{option}" />');
     $builder->setUseOption(true);
     array_push($this->definitions, $builder->build());
     /* [color] color tag */
     $builder = new CodeDefinitionBuilder('color', '<span style="color: {option}">{param}</span>');
     $builder->setUseOption(true)->setOptionValidator(new \JBBCode\validators\CssColorValidator());
     array_push($this->definitions, $builder->build());
 }
 /**
  * Constructs the default code definitions.
  */
 public function __construct()
 {
     /* [b] bold tag */
     $builder = new CodeDefinitionBuilder('b', '<strong>{param}</strong>');
     array_push($this->definitions, $builder->build());
     /* [i] italics tag */
     $builder = new CodeDefinitionBuilder('i', '<em>{param}</em>');
     array_push($this->definitions, $builder->build());
     /* [u] italics tag */
     $builder = new CodeDefinitionBuilder('u', '<u>{param}</u>');
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('s', '<s>{param}</s>');
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('trigger', '<small>{param}</small>');
     array_push($this->definitions, $builder->build());
     /* [url] link tag */
     $builder = new CodeDefinitionBuilder('url', '<a href="{param}">{param}</a>');
     $builder->setParseContent(false);
     array_push($this->definitions, $builder->build());
     /* [url=http://example.com] link tag */
     $builder = new CodeDefinitionBuilder('url', '<a href="{option}">{param}</a>');
     $builder->setUseOption(true)->setParseContent(true);
     array_push($this->definitions, $builder->build());
     /* [img] image tag */
     $builder = new CodeDefinitionBuilder('img', '<img class="img-responsive" src="{param}" />');
     $builder->setUseOption(false)->setParseContent(false);
     array_push($this->definitions, $builder->build());
     /* [img=alt text] image tag */
     $builder = new CodeDefinitionBuilder('img', '<img "img-responsive" src="{param} alt="{option}" />');
     $builder->setUseOption(true);
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('code', '<pre>{param}</pre>');
     $builder->setParseContent(false);
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('list', '<ul class="list-group">{param}</ul>');
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('list', '<ol class="list-group">{param}</ol>');
     $builder->setUseOption(true);
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('*', '<li class="list-group-item">{param}</li>');
     array_push($this->definitions, $builder->build());
     // $builder = new CodeDefinitionBuilder('video', '<div class="embed-responsive  embed-responsive-4by3"><iframe class="embed-responsive-item" src="{param}"></iframe></div>');
     // $builder->setParseContent(false);
     // array_push($this->definitions, $builder->build());
     /* [color] color tag */
     // $builder = new CodeDefinitionBuilder('color', '<span style="color: {option}">{param}</span>');
     // $builder->setUseOption(true)->setOptionValidator(new \JBBCode\validators\CssColorValidator());
     // array_push($this->definitions, $builder->build());
 }
 public function __construct()
 {
     $youtube = new \YoutubeCodeDefinition();
     array_push($this->definitions, $youtube);
     $image = new \ImageCodeDefinition();
     array_push($this->definitions, $image);
     $ul = new \ULCodeDefinition();
     array_push($this->definitions, $ul);
     $ol = new \OLCodeDefinition();
     array_push($this->definitions, $ol);
     $table = new \TableCodeDefinition();
     array_push($this->definitions, $table);
     $builder = new CodeDefinitionBuilder('s', '<span style="text-decoration: line-through">{param}</span>');
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('sup', '<sup>{param}</sup>');
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('sub', '<sub>{param}</sub>');
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('code', '<pre>{param}</pre>');
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('left', '<div class="text-left">{param}</div>');
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('right', '<div class="text-right">{param}</div>');
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('center', '<div class="text-center">{param}</div>');
     array_push($this->definitions, $builder->build());
     $builder = new \JBBCode\CodeDefinitionBuilder('quote', '<blockquote>{param}</blockquote>');
     $builder->setUseOption(true);
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('size', '<span class="cj-font-size-{option}">{param}</span>');
     $builder->setUseOption(true)->setParseContent(true);
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('attachment', '{CJATTACHMENT ["id": {option}]}');
     $builder->setUseOption(true)->setParseContent(true);
     array_push($this->definitions, $builder->build());
     //         $builder = new \JBBCode\CodeDefinitionBuilder('font', '<span style="font-family: {option}">{param}</span>');
     //         $builder->setUseOption(true);
     //         $builder->setOptionValidator($cssValidator);
     //         array_push($this->definitions, $builder->build());
 }
 /**
  * Constructs the default code definitions.
  */
 public function __construct()
 {
     $builder = new CodeDefinitionBuilder('b', '<strong>{param}</strong>');
     /* [b] bold tag */
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('i', '<em>{param}</em>');
     /* [i] italics tag */
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('u', '<u>{param}</u>');
     /* [u] underline tag */
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('br', '<br />{param}');
     /* [br] new line tag */
     array_push($this->definitions, $builder->build());
     $urlValidator = new \JBBCode\validators\UrlValidator();
     $imageValidator = new \JBBCode\validators\ImageValidator();
     $builder = new CodeDefinitionBuilder('url', '<a href="{param}">{param}</a>');
     /* [url] link tag */
     $builder->setParseContent(false)->setBodyValidator($urlValidator);
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('url', '<a href="{option}">{param}</a>');
     /* [url=http://example.com] link tag */
     $builder->setUseOption(true)->setParseContent(true)->setOptionValidator($urlValidator);
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('urlnew', '<a href="{param}" target="new">{param}</a>');
     /* [urlnew] link tag */
     $builder->setParseContent(false)->setBodyValidator($urlValidator);
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('urlnew', '<a href="{option}" target="new">{param}</a>');
     /* [urlnew=http://example.com] link tag */
     $builder->setUseOption(true)->setParseContent(true)->setOptionValidator($urlValidator);
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('color', '<span style="color: {option}">{param}</span>');
     /* [color] color tag */
     $builder->setUseOption(true)->setOptionValidator(new \JBBCode\validators\CssColorValidator());
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('colour', '<span style="color: {option}">{param}</span>');
     /* [colour] color tag */
     $builder->setUseOption(true)->setOptionValidator(new \JBBCode\validators\CssColorValidator());
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('small', '<span class="small">{param}</span>');
     /* [small] small text tag */
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('big', '<span style="font-size:1.5em;">{param}</span>');
     /* [big] big text tag */
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('size', '<span style="font-size:{option}em;">{param}</span>');
     /* [size] size tag, uses em measurement */
     $builder->setUseOption(true)->setParseContent(true);
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('quote', '<div class="quotetop">Quote</div><div class="quotemain">{param}</div>');
     /* [quote] quote tag */
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('quote', '<div class="quotetop">Quote</div><div class="quotemain">{param}<br /><em class="small">- {option}</em></div>');
     /* [quote=author]  tag */
     $builder->setUseOption(true)->setParseContent(true);
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('s', '<span style="text-decoration:line-through;">{param}</span>');
     /* [s] strikethrough tag */
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('sub', '<sub>{param}</sub>');
     /* [sub] subscript tag */
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('sup', '<sup>{param}</sup>');
     /* [sup] superscript tag */
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('info', '<div class="info">{param}</div>');
     /* [info] $mtg->info() tag */
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('error', '<div class="error">{param}</div>');
     /* [error] $mtg->error() tag */
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('success', '<div class="success">{param}</div>');
     /* [success] $mtg->success() tag */
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('warning', '<div class="warning">{param}</div>');
     /* [warning] $mtg->warning() tag */
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('quo', '&ldquo;{param}&rdquo;');
     /* [quo] HTML entity quotation marks tag */
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('img', '<img src="{param}" />');
     /* [img] image tag */
     $builder->setUseOption(false)->setParseContent(false)->setBodyValidator($imageValidator);
     array_push($this->definitions, $builder->build());
     $builder = new CodeDefinitionBuilder('img', '<img src="{param}" alt="{option}" />');
     /* [img=alt text] image tag */
     $builder->setUseOption(true)->setParseContent(false)->setBodyValidator($imageValidator);
     array_push($this->definitions, $builder->build());
 }