The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
MySpace/YouTube/Google Video Addon (best yet) Details »» | |||||||||||||||||||||||||||
MySpace/YouTube/Google Video Addon (best yet)
Developer Last Online: Apr 2009
...
Show Your Support
|
Comments |
#212
|
||||
|
||||
did you make all of the Javascript replacements?
|
#213
|
|||
|
|||
The one thing I would add to the instructions chad and its one thing I had to figure out(now granted somebody more used to these things might have had an easier time) was the fact you had to add the code in 3 places above. But like I say I am totoaly new to anything with javascript /** * Insert Link */ |
#214
|
|||
|
|||
Ok i modified this to a better way of doing this. Adding this code 3 or 4 times is not efficient enough for me and can get complicated. For those of you who want an easy way to do this follow this step.
in clientscript/vbulletin_textedit.js find Code:
case 'PHP': { this.apply_format('removeformat'); } Code:
case 'VIDEO': { var video = this.get_selection(); if((video=="") || (video==null)){ var video=prompt("MySpace, YouTube, Google video, eBaum's World or Metacafe URL",""); } if (video.match("youtube.com")) { var col_array=video.split("?v="); var part_num=1; if(col_array[part_num] == null || col_array[part_num] == ""){ alert("Please Highlight the Full URL!"); return false; } return this.insert_text("[youtube]" + col_array[part_num] + "[/youtube]"); } else if (video.match("myspace.com")) { if (video.match("videoID=")) { var col_array=video.split("videoID="); } else { var col_array=video.split("videoid="); } var part_num=1; if(col_array[part_num] == null || col_array[part_num] == ""){ alert("Please Highlight the Full URL!"); return false; } return this.insert_text("[myspace]" + col_array[part_num] + "[/myspace]"); } else if (video.match("video.google.")) { var col_array=video.split("docid="); var part_num=1; if(col_array[part_num] == null || col_array[part_num] == ""){ alert("Please Highlight the Full URL!"); return false; } return this.insert_text("[googlevideo]" + col_array[part_num] + "[/googlevideo]"); } else if (video.match("ebaumsworld.com")) { var video = video.replace(".html",""); var col_array = video.split("ebaumsworld.com/"); if(col_array[part_num] == null || col_array[part_num] == ""){ alert("Please Highlight the Full URL!"); return false; } return this.insert_text("[ebaumsvideo]" + col_array[1] + "[/ebaumsvideo]"); } else if (video.match("metacafe.com")) { var video = video.replace(new RegExp(/\/$/),""); var col_array = video.split(new RegExp(/\/watch\//g)); if(col_array[part_num] == null || col_array[part_num] == ""){ alert("Please Highlight the Full URL!"); return false; } return this.insert_text("[metacafe]" + col_array[1] + "[/metacafe]"); } else{ alert("Please Enter The Full URL!"); return false; } return false; } now in the templates editor_toolbar_on and postbit_quickedit and showthread_quickreply find: Code:
<if condition="$show['img_bbcode']"> <td><div class="imagebutton" id="{$editorid}_cmd_insertimage"><img src="$stylevar[imgdir_editor]/insertimage.gif" width="21" height="20" alt="$vbphrase[insert_image]" /></div></td> </if> Code:
<td><div class="imagebutton" id="{$editorid}_cmd_wrap0_VIDEO"><img src="http://wwwstagemc.nhmccd.edu/resources/images/live/locations/mc/general/MC_video_icon.gif" width="21" height="20" alt="$vbphrase[insert_link]" /></div></td> Install the product file and thats it. Also if they highlight the URL it will add tags, if they highlight it but it doesnt have any type of video url it will tell them to select the entire url. if they dont highlight anything it will prompt them for something. |
#215
|
||||
|
||||
does it work on all editors kungfu?
|
#216
|
|||
|
|||
Yea it should work on all editors. I had to make a custom function for a button like this. And this works.
I just updated the code too so it will detect if they highlighted the code right. Should be good to go now. So if they have google.com/blahblah it wont try to make a bbcode. This is basically what you had in all 3-5 spots but its just one spot now. Should work on all browsers as well. Just tested it again on different browsers and editors. Seems to work fine. I only tested a few video formats so if anyone tests it out and finds something wrong let me know or post im sure chad would be able to figure it out as well. |
#217
|
|||
|
|||
I'm a little confuse with the instruction. I found four "insert link" and 1 "insert image." Do I insert the code above four "insert link" and the "insert image"
|
#218
|
||||
|
||||
just do all 4
|
#219
|
|||
|
|||
thanks chad,
Now there is a "insert link button on the text editor but when I click on it it doesn't do anything. |
#220
|
||||
|
||||
your having a javascript error then.
|
#221
|
|||
|
|||
how do i fix it? Doesn't "Inser Image" "Hyper Link" using the same java script? Those still working fine.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|