I can't see a bugfix for the JQuery extension in the JQMedia thread — please link directly to the comment in quesiton (use the #numbers to the right of the blockuser/comment links on the right of the comment).
P.S. Mark, uploading RAR files no longer seems to work as I get the following error: You are not allowed to upload (JQuery-v12-1.1.4.rar) the requested file type: application/force-download
Looks like a great fix - but it's not my extension unfortunately, so I can't do anything to it since I'm not an admin. Have you tried contacting MSB directly?
v13-1.2.1 Released 2007-09-19
+ Updated the JS library to jQuery 1.2.1.
+ Changed the default jQuery library to a minified version instead of packed
(for clientside decode speed up). I have also included the packed, original
uncompressed and gzip versions of all the above. If gzip works for you, the
best one is the gzipped min file (even though it's 1kb bigger than the
gzipped pack file). Just edit line 29 to whatever suits you best
$Head->AddScript('extensions/JQuery/jquery-1.2.1.min.js');
- Removed the /src/ directory from the package as it is now unecessary.
I'm having a problem here Luke... After upgrading to the latest version, JQMedia won't work. See this page, the YouTube video isn't showing up and I made sure to disable all the extensions, enable JQuery first then the rest.
A hacked up version of 0.5.1 seems to be working for me, so this is most strange. I'll see about getting an option up with the compatibility script as a simple "uncomment this line". I'll also do a little more testing to see why JQMedia's not working correctly with 1.2 as it will obviously have to be updated to work with it since 1.2 has some compelling new stuff
v14-1.2.1 Released 2007-09-21
+ Added commented line to default.php for easy enabling of jQuery 1.1.4 - just in case
you're using something incompatible with the 1.2 branch. It isn't elegant, but it works :P
+ added minified, packed, gzipped versions of jQuery 1.1.4 to the /old/ directory.
I should also have pointed out with v13-1.2.1 that you now need to call the JQuery extension in addons that require it using includeJQuery(); Here's an example from JQThickBox...
// Specify which pages to add JavaScript and CSS to Head Control and do it.
if (in_array($Context->SelfUrl, array(
'account.php',
'categories.php',
'comments.php',
'extension.php',
'index.php',
'people.php',
'post.php',
'search.php',
'settings.php',
'termsofservice.php'))) {
includeJQuery(); // call JQuery to ensure it's loaded first
/* use ThickBox 3.1 */
$Head->AddStylesheet($Context->Configuration['JQTHICKBOX_PATH'].'thickbox-3.1.css');
$Head->AddScript($Context->Configuration['JQTHICKBOX_PATH'].'thickbox-3.1.min.js');
/* use ThickBox 2.1.1 by removing the // from the beginning of the next three lines and adding // to the beginning of the previous two lines. */
// $Head->AddStylesheet($Context->Configuration['JQTHICKBOX_PATH'].'old/thickbox-2.1.1.css');
// $Head->AddStylesheet($Context->Configuration['JQTHICKBOX_PATH'].'old/thickbox-2.1.1.ie.css');
// $Head->AddScript($Context->Configuration['JQTHICKBOX_PATH'].'old/thickbox-2.1.1.min.js');
}
I remember there was an issue about the order this extension is loaded. If it hasn't been solved, here is a solution:class MyExtensionInit extends Control {
function MyExtensionInit(&$Context) {
$this->Name = 'MyExtensionInit';
$this->Control($Context);
}
function Render() {
if (defined('JQUERY_EXTENSION')) {
includeJQuery();
global $Head;
$Head->AddScript('extensions/MyExtenion/MyJQueryScript.js');
...
} else {
$this->Context->WarningCollector->Add('You need to install the jQuery extension...');
}
}
}
$MyExtensionInit = $Context->ObjectFactory->CreateControl($Context, 'MyExtensionInit ');
$Page->AddRenderControl($MyExtensionInit, 1);
By using the Page event you are sure the jQuery extensions is loaded when you try to use it.
Update: It will only work with php5. The Head controller will be passed by reference to Head object with php5 but by value with php4. Maybe a new event, called just after the functions are loaded, could be added. and the Controller could be added to Page object passed by reference.
Sorry Doniboff, you know what you're doing and I just stumble around in php/js land - does this fix jQuery being loaded before extensions or does it fix it being loaded in the wrong order with scriptaculous?
Comments
P.S. Mark, uploading RAR files no longer seems to work as I get the following error:
JQMedia # 81
v13-1.2.1 Released 2007-09-19 + Updated the JS library to jQuery 1.2.1. + Changed the default jQuery library to a minified version instead of packed (for clientside decode speed up). I have also included the packed, original uncompressed and gzip versions of all the above. If gzip works for you, the best one is the gzipped min file (even though it's 1kb bigger than the gzipped pack file). Just edit line 29 to whatever suits you best $Head->AddScript('extensions/JQuery/jquery-1.2.1.min.js'); - Removed the /src/ directory from the package as it is now unecessary.
After upgrading to the latest version, JQMedia won't work. See this page, the YouTube video isn't showing up and I made sure to disable all the extensions, enable JQuery first then the rest.
Any thoughts?!
v14-1.2.1 Released 2007-09-21 + Added commented line to default.php for easy enabling of jQuery 1.1.4 - just in case you're using something incompatible with the 1.2 branch. It isn't elegant, but it works :P + added minified, packed, gzipped versions of jQuery 1.1.4 to the /old/ directory.
I should also have pointed out with v13-1.2.1 that you now need to call the JQuery extension in addons that require it using
includeJQuery();
Here's an example from JQThickBox...// Specify which pages to add JavaScript and CSS to Head Control and do it. if (in_array($Context->SelfUrl, array( 'account.php', 'categories.php', 'comments.php', 'extension.php', 'index.php', 'people.php', 'post.php', 'search.php', 'settings.php', 'termsofservice.php'))) { includeJQuery(); // call JQuery to ensure it's loaded first /* use ThickBox 3.1 */ $Head->AddStylesheet($Context->Configuration['JQTHICKBOX_PATH'].'thickbox-3.1.css'); $Head->AddScript($Context->Configuration['JQTHICKBOX_PATH'].'thickbox-3.1.min.js'); /* use ThickBox 2.1.1 by removing the // from the beginning of the next three lines and adding // to the beginning of the previous two lines. */ // $Head->AddStylesheet($Context->Configuration['JQTHICKBOX_PATH'].'old/thickbox-2.1.1.css'); // $Head->AddStylesheet($Context->Configuration['JQTHICKBOX_PATH'].'old/thickbox-2.1.1.ie.css'); // $Head->AddScript($Context->Configuration['JQTHICKBOX_PATH'].'old/thickbox-2.1.1.min.js'); }
class MyExtensionInit extends Control { function MyExtensionInit(&$Context) { $this->Name = 'MyExtensionInit'; $this->Control($Context); } function Render() { if (defined('JQUERY_EXTENSION')) { includeJQuery(); global $Head; $Head->AddScript('extensions/MyExtenion/MyJQueryScript.js'); ... } else { $this->Context->WarningCollector->Add('You need to install the jQuery extension...'); } } } $MyExtensionInit = $Context->ObjectFactory->CreateControl($Context, 'MyExtensionInit '); $Page->AddRenderControl($MyExtensionInit, 1);
By using the Page event you are sure the jQuery extensions is loaded when you try to use it.
Update: It will only work with php5. The Head controller will be passed by reference to Head object with php5 but by value with php4. Maybe a new event, called just after the functions are loaded, could be added. and the Controller could be added to Page object passed by reference.
(But it need a fix in the core to work)
And what's wrong with the way I'm doing it now? (other than the warning collector of course )
With that, after they failed to install, e.g., jQmedia, they just need to install
It should be fix in 1.1.3, and in 1.2 jQuery should be in the core :-)