Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.
Help keep Vanilla free:
http://www.youtube.com/watch?v=i1q_8QQO70Q and submit the comment.<a href="http://www.youtube.com/watch?v=i1q_8QQO70Q">Conan's Emmy Entry Hilarious!!!'</a>
$VideoScript = '<script>$(document).ready(function(){';To $VideoScript = '<script type="text/javascript">(function($) { $(document).ready(function(){'; $VideoScript .= '});</script>';To $VideoScript .= '});})(jQuery)</script>';
<html>
<head>
<script src="prototype.js"></script>
<script src="jquery.js"></script>
<script>
jQuery.noConflict();
// Put all your code in your document ready area
jQuery(document).ready(function($){
// Do jQuery stuff using $
$("div").hide();
});
// Use Prototype with $(...), etc.
$('someid').style.display = 'none';
</script>
</head>
<body></body>
</html>
2. Is it possible to add a video (using above method) AND a simple link to a page in YouTube?
I only ask because when I added a link to a user page (i.e. not a video) the add-on tried to return a video and got locked in an infinite loop.
Cheers...
if (!window.Vanilla){
var Vanilla = new PathFinder();
Vanilla.webRoot = Vanilla.getRootPath('script', 'src', 'js/global.js');
Vanilla.styleUrl = Vanilla.getRootPath('link', 'href', 'vanilla.css');
Vanilla.baseURL = Vanilla.params.httpMethod + Vanilla.params.domain + Vanilla.webRoot;
}$jqm=jQuery.noConflict();
$jqm(document).ready(function(){};'if (!window.Vanilla){
var Vanilla = new PathFinder();
Vanilla.webRoot = Vanilla.getRootPath('script', 'src', 'js/global.js');
Vanilla.styleUrl = Vanilla.getRootPath('link', 'href', 'vanilla.css');
Vanilla.baseURL = Vanilla.params.httpMethod + Vanilla.params.domain + Vanilla.webRoot;
}
if (!window.Vanilla){
var Vanilla = new PathFinder();
Vanilla.webRoot = Vanilla.getRootPath('script', 'src', 'js/global.js');
Vanilla.styleUrl = Vanilla.getRootPath('link', 'href', 'vanilla.css');
Vanilla.baseURL = Vanilla.params.httpMethod + Vanilla.params.domain + Vanilla.webRoot;
}
alert(Vanilla.webRoot);And it is working. What is problem you get with this code?
var mediaplayer = jqmediaPath.webRoot + 'extensions/jQmedia/mediaplayer.swf';to: var mediaplayer = jqmediaPath.webRoot + 'extensions/JQMedia/mediaplayer.swf';so that the cases match the rest of the extension. if (caption && sourceVideo!='playlist') embedCode.push('<p><a rel="nofollow" target="_blank" href="' + url+ '">' + caption + '</a><img src="' + jqmediaPath.webRoot +'extensions/jQmedia/external.gif" /></p>');to: if (caption && sourceVideo!='playlist') embedCode.push('<p><a rel="nofollow" target="_blank" href="' + url+ '">' + caption + '</a><img src="' + jqmediaPath.webRoot +'extensions/JQMedia/external.gif" /></p>');$Context->Dictionary['ExtensionOptions'] = 'Extension Options';
$Context->Dictionary['JQmedia'] = 'jQmedia';
$Context->Dictionary['JQmediaSettings'] = 'jQmedia Settings';
$Context->Dictionary['JQmediaNotes'] = 'These settings are specific to jQmedia. With this extension you can allow embedded online video services like Youtube etc. The user just enters a url to the youtube video and this extension will make it live, so you can watch it right inside the comment';
$Context->Dictionary['JQmediaVideo'] = 'Select online video services to embed';
$Context->Dictionary['JQmediaYoutube'] = 'Youtube video';
$Context->Dictionary['JQmediaGoogle'] = 'Google video';
$Context->Dictionary['JQmediaMyspace'] = 'Myspace video';
$Context->Dictionary['JQmediaIfilm'] = 'Ifilm video';
$Context->Dictionary['JQmediaMp3'] = 'Allow embedding of mp3 player';to this:$Context->SetDefinition('ExtensionOptions', 'Extension Options');
$Context->SetDefinition('JQmedia', 'jQmedia');
$Context->SetDefinition('JQmediaSettings', 'jQmedia Settings');
$Context->SetDefinition('JQmediaNotes', 'These settings are specific to jQmedia. With this extension you can allow embedded online video services like Youtube etc. The user just enters a url to the youtube video and this extension will make it live, so you can watch it right inside the comment');
$Context->SetDefinition('JQmediaVideo', 'Select online video services to embed');
$Context->SetDefinition('JQmediaYoutube', 'Youtube video');
$Context->SetDefinition('JQmediaGoogle', 'Google video');
$Context->SetDefinition('JQmediaMyspace', 'Myspace video');
$Context->SetDefinition('JQmediaIfilm', 'Ifilm video');
$Context->SetDefinition('JQmediaMp3', 'Allow embedding of mp3 player');ref: http://lussumo.com/docs/doku.php?id=vanilla:development:languageupkeepAddConfigurationSetting($Context, 'JQMEDIA_VERSION_EXT', '0.2');to this:AddConfigurationSetting($Context, 'JQMEDIA_VERSION_EXT', '0.3');So that the version number matches $VideoScript = '<script>var $jqm=jQuery.noConflict();
$jqm(document).ready(function(){';
if ($Context->Configuration['JQMEDIA_ALLOW_YOUTUBE'] == '1') {
$VideoScript .= '$jqm(\'#ContentBody .CommentBody a[@href^="http://www.youtube.com/"],#ContentBody .CommentBody a[@href^="http://youtube.com/"]\').jQmedia(\'youtube\');';}
if ($Context->Configuration['JQMEDIA_ALLOW_GOOGLE'] == '1') {
$VideoScript .= '$jqm(\'#ContentBody .CommentBody a[@href^="http://video.google."]\').jQmedia(\'google\');';}
if ($Context->Configuration['JQMEDIA_ALLOW_MYSPACE'] == '1') {
$VideoScript .= '$jqm(\'#ContentBody .CommentBody a[@href^="http://vids.myspace.com/"]\').jQmedia(\'myspace\');';}
if ($Context->Configuration['JQMEDIA_ALLOW_IFILM'] == '1') {
$VideoScript .= '$jqm(\'#ContentBody .CommentBody a[@href^="http://www.ifilm.com/"]\').jQmedia(\'ifilm\');';}
if ($Context->Configuration['JQMEDIA_ALLOW_MP3'] == '1') {
$VideoScript .= '$jqm(\'#ContentBody .CommentBody a[@href$=".mp3"]\').jQmedia(\'mp3\');';}
$VideoScript .= '});</script>';to: $VideoScript = ' <script type="text/javascript">
$j(document).ready(function(){
';
if ($Context->Configuration['JQMEDIA_ALLOW_YOUTUBE'] == '1') {
$VideoScript .= ' $j(\'#ContentBody .CommentBody a[@href^="http://www.youtube.com/"],#ContentBody .CommentBody a[@href^="http://youtube.com/"]\').jQmedia(\'youtube\');
';}
if ($Context->Configuration['JQMEDIA_ALLOW_GOOGLE'] == '1') {
$VideoScript .= ' $j(\'#ContentBody .CommentBody a[@href^="http://video.google."]\').jQmedia(\'google\');
';}
if ($Context->Configuration['JQMEDIA_ALLOW_MYSPACE'] == '1') {
$VideoScript .= ' $j(\'#ContentBody .CommentBody a[@href^="http://vids.myspace.com/"]\').jQmedia(\'myspace\');
';}
if ($Context->Configuration['JQMEDIA_ALLOW_IFILM'] == '1') {
$VideoScript .= ' $j(\'#ContentBody .CommentBody a[@href^="http://www.ifilm.com/"]\').jQmedia(\'ifilm\');
';}
if ($Context->Configuration['JQMEDIA_ALLOW_MP3'] == '1') {
$VideoScript .= ' $j(\'#ContentBody .CommentBody a[@href$=".mp3"]\').jQmedia(\'mp3\');
';}
$VideoScript .= ' });
</script>
'; so that you end up with nice neat source to read in the final page :) Feel free to completely ignore this bit ;) Of course, I would include the type="text/javascript" bit and there's no reason not to use the shorter $j(document).ready(function(){ and $j(\'#ContentBody bits ;) var mediaplayer = jqmediaPath.webRoot + 'extensions/JQmedia/mediaplayer.swf';is still wrong. It needs to be JQMedia, not JQmedia.jqmediaPath.webRoot +'extensions/JQmedia/external.gif"should be:jqmediaPath.webRoot +'extensions/JQMedia/external.gif"var $j=jQuery.noConflict(); is not needed as it's included in JQuery extension 1.1.4