Fixes:
- Google aVideo from other domains then google.com (i.e. google.uk google.nl) are supported
- MetaCafe is working.
Here is the new Javascript code:
Code:
* Insert Video Link
*/
this.createvideolink = function(e, url)
{
var my_colors=prompt("Please enter MySpace, Metacafe, YouTube or Google video URL","");
if ((my_colors=="") || (my_colors==null))
{
alert("Please Enter The Full URL!");
}
else
{
if (my_colors.match("www.youtube.com"))
{
var col_array=my_colors.split("?v=");
var part_num=1;
return this.insert_text("[youtube]" + col_array[part_num] + "[/youtube]");
}
else
if (my_colors.match("myspace.com"))
{
if (my_colors.match("videoID="))
{
var col_array=my_colors.split("videoID=");
}
else
{
var col_array=my_colors.split("videoid=");
}
var part_num=1;
return this.insert_text("[myspace]" + col_array[part_num] + "[/myspace]");
}
else
if (my_colors.match("video.google"))
{
var col_array=my_colors.split("docid=");
var part_num=1;
return this.insert_text("[googlevideo]" + col_array[part_num] + "[/googlevideo]");
}
else
if (my_colors.match("metacafe.com"))
{
var col_array=my_colors.split("/watch/");
var part_num=1;
var cafeStr=col_array[part_num];
if (cafeStr.lastIndexOf('/') == cafeStr.length-1)
{
return this.insert_text("[metacafe]" + cafeStr.substring(0,cafeStr.length-1) + "[/metacafe]");
}
else
{
return this.insert_text("[metacafe]" + cafeStr + "[/metacafe]");
}
}
else
{
alert("No valid Google, YouTube, MetaCafe or Myspace URL");
}
}
};
A few things, in your instructions, please add that there are about four or five places (lost count) to add the code after
/**
* Insert Link
*/
In addition, each time you add a BB code it asks you for an example, that would be beneficial for us noncoder types.
On the image that shows up in the reply boxes, it's this link: http://wwwstagemc.nhmccd.edu/resourc...video_icon.gif is that smart to do? I look at that as bandwith theft. You might tell people to download that image and where to change the code with your own server URL of the image.
Now, with that said, did everything, but it doesn't work for me, does nothing other than display the image. Something doesn't make the javascript work I'm guessing, perhaps VBSEO? Let me know, seems like a nice hack, thanks rg.
hmm it seems it doesn't work when you change it into normal text edit from WYSIWYG. So it only works in WYSIWYG, i'm sure theres a second place to put the JS edit for it to work in both, i just don't know it yet.
hmm it seems it doesn't work when you change it into normal text edit from WYSIWYG. So it only works in WYSIWYG, i'm sure theres a second place to put the JS edit for it to work in both, i just don't know it yet.
In the same javascript file, but before this (actually, works in many places around that part of the JS):