miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Suggestions miniBB Support Forums / Suggestions /  
 

Avoiding [youtube=null] on cancel?

 
Author tom322
Active Member
#1 | Posted: 9 Oct 2014 22:13 
Currently the Youtube video Javascript prompt looks like:

<a href="JavaScript:paste_strinL(selektion,4,'[youtube='+prompt('YouTube%20movie%20URL:','http://youtu.be/')+']','','')" onmousemove="pasteSel()"><img src="https://www.minibb.com/forums/img/button_youtube.gif" style="width:23px;height:22px" alt="" title="Insert YouTube video"></a>
A small 'issue' is that after clicking on the Cancel button, the following is still pasted into the form:

[youtube=null]
It seems the code is almost the same as for the URL, so I'm not sure it behaves differently with the youtube link.. Ideally, there should be nothing pasted when user clicks on the Cancel button.

Author Paul
Lead Developer 
#2 | Posted: 10 Oct 2014 16:29 
Here's the exact code:

if(bbCode1=='[youtube=null]
') { bbCode1=''; bbCode2=''; myValue=''; }
You need to put it before the line saying

//MOZILLA/NETSCAPE/OPERA support
of templates/form.js -> function insertAtCursor.

If you confirm it works on your end, I could add it to the TODO list for YouTube add-on for the future.

Author tom322
Active Member
#3 | Posted: 10 Oct 2014 16:57 
Thank you Paul, will be testing today and post the results here.

Author tom322
Active Member
#4 | Posted: 10 Oct 2014 18:51 
I can confirm the change works correctly, thank you!

Author Steve Shaw
Partaker
#5 | Posted: 6 Jul 2019 18:47 
I've just installed the YouTube plugin, and I still get the '[youtube=null]' insertion into the message when 'cancel' is selected...
The form.js script is edited correctly.

Steve

Author tom322
Active Member
#6 | Posted: 7 Jul 2019 06:21 
Maybe the code in form.js is still cached. I'd reload /form.js file.

Author Paul
Lead Developer 
#7 | Posted: 8 Jul 2019 13:45 
Steve Shaw:
The form.js script is edited correctly.
You should double check on it. If you check the miniBB demo and its file.js, the line of code mentioned above is installed, and it brings no insertion when you cancel on the Youtube's BB code button. Also it's included in the official add-on and in the Compiler, so I'm pretty sure it should work.

Author Steve Shaw
Partaker
#8 | Posted: 8 Jul 2019 14:08 
It must have been a 'cache' issue, although I had used Ctrl+F5...
All is ok now.

Steve

Suggestions miniBB Support Forums / Suggestions /
 Avoiding [youtube=null] on cancel?
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Proceed with the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑