Custom modal window

Many sites already used the library to display modal windows. In WysiBB the possibility of connecting their modal windows. To do this, create a function display a modal window. Consider this as an example.

var mymodal = function(cmd,opt,queryState) {
  var url = prompt("Enter the image URL");
  if (queryState) {
    //Delete the current BB code, if it is active.
    //This is necessary if you want to replace the current element
  //Call syntax wbbInsertCallback (command, params), where params - Perrin values ​​to be inserted

  //this.wbbRemoveCallback(cmd); /delete the current function BB code

$(document).ready(function() {
 var wbbOpt = {
  buttons: "myimg",
  allButtons: {
    myimg: {
      title: "Insert Picture",
      buttonText: "myimg",
      modal: mymodal, //​​function of custom modal window
      transform: {
        '<img src="{SRC}" />':'[img]{SRC}[/img]'
<textarea id="editor"></textaera>

This configuration will result.