Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
JQmedia
This discussion is related to the JQmedia addon.
Comments
ON your site its the other way around.
Disable both Jquery and JQmedia, and then enable jQuery followed by jQmedia
abramelin.
Contrary to popular belief i do not have a magic wand.
U have to give me more than just "stopped working"
If I enable JQThickbox (whatever load before or after JQMedia), than JQMedia does nothing in my test forum, otherwise it work fine.
JQuery & JQThickbox are ver 1.1.3
the problem is with both JQthickbox and JQmedia uses this code to get the paths
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; }
Atleast now we know where the conflict is occuring
now to fix it
Incidentally I'm going to be updating jquery.js with the compatibility option enabled, so you will need to rip it out of JQmedia when I do. If you want to time this, let me know.
I already made JQmedia compatible.
I'm using
$jqm=jQuery.noConflict(); $jqm(document).ready(function(){};'
So it shouldn't conflict with any one.
the problem is the Vanilla.webroot stuff.
I haven't uploaded it yet. will uplaod once the issue with thickbox is resolved.
it works with relative paths. So immediate fix is to use relative paths
var $j = jQuery.noConflict(); should be put just after jQuery is loaded.
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?try it now.
If you would like I can send this to you as a ZIP file...
You have packaged up the extension inside a directory named "JQMedia", so I just uploaded the whole thing. I got it working by changing line 63 of jqmedia.js from:
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.And I changed line 159 from:
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>');
As a general observation, you seem to change from JQMedia to JQmedia to jQmedia quite freely, so this is probably what has caused the problem? For simplicity sake it might just be worth changing them all to JQMedia and be done with it.
To help the language people, you should change lines 41-50 from this:
$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:languageupkeepI also noticed line 53 needs changing from:
AddConfigurationSetting($Context, 'JQMEDIA_VERSION_EXT', '0.2');
to this:AddConfigurationSetting($Context, 'JQMEDIA_VERSION_EXT', '0.3');
So that the version number matchesI've also been frivolous with default.php and changed line 66 onwards from
$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 pagetype="text/javascript"
bit and there's no reason not to use the shorter$j(document).ready(function(){
and$j(\'#ContentBody
bitsDisclaimer: I don't know if the MP3 thing is working 100% with these changes as I don't have sound on my "work" machine