Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding extra code in bbcode view #182

Open
dmdotin opened this issue Aug 17, 2017 · 0 comments
Open

Adding extra code in bbcode view #182

dmdotin opened this issue Aug 17, 2017 · 0 comments

Comments

@dmdotin
Copy link

dmdotin commented Aug 17, 2017

I made 2 buttons

1 for youtube

`videoyoutube: {

  title: "Insert Youtube Video",
  buttonHTML: '<i class="fa fa-youtube fa-2x"></i>',
  modal: { //Description of modal window
    title: "Insert Youtube Video",
    width: "600px",
    tabs: [
      { //First tab
        title: "Add Youtube Video ID",
        input: [ //List of form fields
          {param: "SRC",title:"Enter Youtube ID",validation: '^([a-z0-9_-]+)$'}
        ]
      },
      { //The second tab
        title: "How to get Youtube ID ?",
        html: "<p><h4>Check Youtube Video URL / Link</h4></p> <p> <h5>Ex: https://www.youtube.com/watch?v=<b>qi2m4V21bw4</b></h5></p> <p> OR</p> <p><h5> https://youtu.be/<b>qi2m4V21bw4</b> </h5></p> <p>Above URL Youtube ID will be <b><font color=blue>qi2m4V21bw4</font></b></p>"
      },
    ],
    onLoad: function() {
      //Callback function that will be called after the display of a modal window
    },
    onSubmit: function() {
      //Callback function that will be called by pressing the "Save"
      //If function return false, it means sending data WysiBB not be made
    }
  },
  transform: {
    '<iframe src="http://www.youtube.com/embed/{SRC}" width="640" height="480" frameborder="0"></iframe>':'[youtube]{SRC}[/youtube]'
  }

},`

2nd for vimeo

`videovimeo: {

  title: "Insert Vimeo Video",
  buttonHTML: '<i class="fa fa-vimeo fa-2x"></i>',
  modal: { //Description of modal window
    title: "Insert Vimeo Video",
    width: "600px",
    tabs: [
      { //First tab
        title: "Add Vimeo Video ID",
        input: [ //List of form fields
          {param: "SRC",title:"Enter Vimeo ID",validation: '^([0-9_-]+)$'}
        ]
      },
      { //The second tab
        title: "How to get Vimeo ID ?",
        html: "<p><h4>Check Vimeo Video URL / Link</h4></p> <p> <h5>Vimeo URL - https://vimeo.com/<b>67847803</b> </h5></p> <p>Above URL Vimeo ID will be <b><font color=blue>67847803</font></b></p>"
      },
    ],
    onLoad: function() {
      //Callback function that will be called after the display of a modal window
    },
    onSubmit: function() {
      //Callback function that will be called by pressing the "Save"
      //If function return false, it means sending data WysiBB not be made
    }
  },
  transform: {
    '<iframe src="https://player.vimeo.com/video/{SRC}" width="640" height="480" frameborder="0"></iframe>':'[vimeo]{SRC}[/vimeo]'
  }

},`

Once i Insert all working fine .. But Once i check source through BBCODE button then Vimeo code will change to

[vimeo]123456[/vimeo][youtube][/youtube]

Each time i check source with BBCODE Button [youtube][/youtube] code will be added after [vimeo]123456[/vimeo] code shown the above line .. :(

Any one can help .. Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant