YouTube BBCode support

Listen to the bartenders... :)

Moderators: Manmountain, VaiDuX461

YouTube BBCode support

jigebren
... as a Newt
jigebren
... as a Newt
Joined: 5 Dec 2009, 11:38 PM

31 May 2013, 03:00 PM #1

Embed YouTube video

I've just added support for a new BBCode to embed Youtube video directly in the post.

This works this way (the video ID is the 11 chars that can usually be found after "watch?v=" in the video URL, for example u67CWFvl5Qk):

Code: Select all

[youtube]video ID[/youtube]
Using the full URL is also supported (not officially though):

Code: Select all

[youtube]http://www.youtube.com/watch?v=u67CWFvl5Qk[/youtube]
(It just makes it easier to copy-paste the URL in case javascript in not supported by the browser...)

Here's an example:

[youtube]u67CWFvl5Qk[/youtube]

There's even a new YouTube button to insert the tags when editing a post. B)

BBCode insertion fix:

I've also added a fix (at least for Firefox) so that the BBCode tags are properly inserted at the cursor position instead of the end of the post. If some text is already selected, it will be properly placed between the opening and closing tags.

xIMG ?

I was wondering about xIMG but I'm not sure there's really a point using it...


Note that all of that only work if javascript is enabled (most users don't care, but there could be NoScript users).
Quote
Like
Share

urnemanden
... as a Newt
urnemanden
... as a Newt
Joined: 21 Apr 2008, 05:03 PM

31 May 2013, 03:42 PM #2

Awesome jigebren, I tried the new youtube support out and it seem to work nicely! Cannot seem to get the BBCode insertion fix to work for the youtube tags though. But for the rest it does so thats nice :)
Quote
Like
Share

jigebren
... as a Newt
jigebren
... as a Newt
Joined: 5 Dec 2009, 11:38 PM

31 May 2013, 04:44 PM #3

urnemanden @ May 31 2013, 04:42 PM wrote:Cannot seem to get the BBCode insertion fix to work for the youtube tags though.
Fixed.
I had not really finished it in fact... Anyway thanks for the report. Now the youtube code share the same code than the other tags, making it use the fix.
I've also modified it a bit: now a popup asks for the video ID or the video URL (the same way it's done for the IMG or URL tags).
Quote
Like
Share

Phantom
100% Proofer
Phantom
100% Proofer
Joined: 21 Mar 2011, 04:01 PM

31 May 2013, 08:58 PM #4

Congratulations! Great addition. :)
We don't stop playing because we get older, we get older because we stop playing.
Quote
Like
Share

VaiDuX461
Methanolic
VaiDuX461
Methanolic
Joined: 2 Jul 2011, 04:02 PM

1 Jun 2013, 06:12 AM #5

Thanks a lot, especially for BBCode fixes, it's now much easier and faster to use them.
To let you know, fixes works on Android internet browser too.
aka VaidX47, Vaid
--------------------
>[MediaFire Stuff]< | >[Steam Profile]<
Quote
Like
Share

RacerBG
Regular
RacerBG
Regular
Joined: 21 Sep 2012, 11:32 AM

1 Jun 2013, 07:31 AM #6

Good addition. Also Im glad to see that there are other peoples from Bulgaria too. :)
RacerBG had joined in Re-Volt!
Quote
Like
Share

urnemanden
... as a Newt
urnemanden
... as a Newt
Joined: 21 Apr 2008, 05:03 PM

2 Jun 2013, 07:40 AM #7

Fixed.
I had not really finished it in fact... Anyway thanks for the report. Now the youtube code share the same code than the other tags, making it use the fix.
Great! Can report that it works here now - using Chromium under Arch Linux 64-bit.


Btw, do you have any control over the Undo behavior in the editor?
Quote
Like
Share

jigebren
... as a Newt
jigebren
... as a Newt
Joined: 5 Dec 2009, 11:38 PM

2 Jun 2013, 12:21 PM #8

urnemanden @ Jun 2 2013, 08:40 AM wrote: Btw, do you have any control over the Undo behavior in the editor?
Not that I know of. Why?
Because we can't undo after previewing, maybe?
Quote
Like
Share

urnemanden
... as a Newt
urnemanden
... as a Newt
Joined: 21 Apr 2008, 05:03 PM

2 Jun 2013, 04:29 PM #9

Not that I know of. Why?
Because we can't undo after previewing, maybe?
No, just because the undo behavior seemed to behave oddly for me - it didn't seem very consistent. Anyway, if it is not something in your hands then i guess it doesn't matter all that much. :)
Quote
Like
Share

Huki
... as a Newt
Huki
... as a Newt
Joined: 30 Dec 2006, 04:01 PM

9 Jun 2013, 02:02 PM #10

Hey nice.. during the original revamp, I was going to suggest enabling doHTML just for this YouTube embedding feature. BTW, I find the popup on the home button quite handy.
I don't recommend xIMG though, for the obvious reasons...
Quote
Like
Share

jigebren
... as a Newt
jigebren
... as a Newt
Joined: 5 Dec 2009, 11:38 PM

10 Jun 2013, 12:31 PM #11

Huki @ Jun 9 2013, 03:02 PM wrote: BTW, I find the popup on the home button quite handy.
Oh yes, I didn't mention this one. This is a convenient way to go back to the current section - to read / reply other thread for example, which I used to miss.
It may update it eventually to display only the last member instead of the whole path (which is not really necessary).
Quote
Like
Share