Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.
Help keep Vanilla free:by Luke Scammell aka [-Stash-]
This extension adds the jQuery JavaScript library to the header pages of the common Vanilla pages. The idea behind this is:
To call JQuery from your extensions use the following code
includeJQuery(); // call JQuery to ensure it's loaded first In order to maintain compatibility with other JS libraries jQuery's compatibility mode is enabled by default. This may mean that your jQuery code will not work without wrapping it in the following code:
Read more about this on the jQuery website
jQuery(document).ready(function($){ // other library compatibility ... }); // other library compatibility Change $JQdev from 0 to 1 and it will load in the original JQuery code, no compression, no minifying, no nothing.
! None.
+ Only have jQuery appear in headers when called. v13-1.2.1
+ Add admin interface. v15-1.2.6
+ Add capability to change between jQuery versions and compression types in a pretty interface. v15-1.2.6
+ Add jQuery UI.
+ Add plugins interface v15-1.2.6 and dependency checking.
Download and uncompress the extension files, then upload them to:
/path/to/vanilla/extensions/JQuery/The path to this extension's default.php file should look like this:
/path/to/vanilla/extensions/JQuery/default.phpTo enable the extension you must be logged in with an account that has Administrator privileges. You can enable the extension in Vanilla by clicking on:
Settings > ExtensionsThen tick the checkbox for "JQuery"
+ Updated the JS library to jQuery 1.2.6.
+ Added Admin Interface - thanks to SetList!
+ Added "JQuery Plugins" (ThickBox, lightbox, Shadowbox, ScrollToAnchors and HideSpoiler) accessible through the admin interface
+ jQuery no longer inserts itself into the head unless it is called by another extension! PLEASE NOTE that extensions relying on this extension will no longer work until they are updated to work with this new method.
+ 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.
+ 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.
+ Updated the JS library to jQuery 1.1.4.
+ Changed the version numbering scheme to a simple RELEASENUMBER-JQUERY_VERSION_NUMBER. So for this release — v12-1.1.4 — the v12 refers to release 12 (count 'em) using version 1.1.4 of the jQuery JS library. Hopefully this will be an improvement and less confusing for people. If you have a view on this one way or another, please leave feedback in the addon discussion.
+ Updated the JS library to jQuery 1.1.3.1.
! Fixed a bug that could cause the the extensions/settings.php file to be wiped on busier servers due to the settings being written on every single page load. Thanks to little_peet for pointing this out!
+ Added the compatibility code to the bottom of jquery.js so all jQuery plugins can be used (with a small modification) along side other JS libraries. Thanks to Dinoboff for pointing me in the right direction.
! JQuery was causing a JS error and stopping categories and Page Manager pages from being reordered on settings.php and extension.php pages. Until this can be resolved I've disabled JQuery on these pages, sorry.
+ Fixed to work with SirNot's PreviewPost 2.2.
+ Updated jQuery to 1.1.2.
+ Updated jQuery to 1.1.1.
+ Updated jQuery to 1.1 - Please note that older 1.0 plugins may need to be modified/rewritten in order to function as expected with jQuery 1.1.
! JQuery now does not conflict with Prototype and SmoothPageJump :) Ensure that prototype and SPJ are enabled AFTER JQuery. Just wrap your jQuery Javascripts with (function($) { // jQuery functions using $ in here. })(jQuery) See JQThickBox as an example.
- Returned configuration settings to firing on every page as the other code wasn't updating the version numbers.
+ Made use of JQUERY_PATH, thanks Jazzman.
! Prevented the configuration settings code executing on every page, thanks Jazzman.
+ Improved readability of the code a little and added a couple more files to the array of pages to have jquery.js added to.
! Fixed a path case typo in the AddScript line.
+ Added a global configuration settings so other extensions can see if JQuery is installed.
+ Original release.
! Incompatible with Smooth Page Jump 1.0 by Jazzman :( JQuery and Smooth Page Jump are completely incompatible. Whichever one is activated last works and prevents the other one from working properly.
//You now only can use jQuery with jQuery();
jQuery.noConflict();or//you now can use jQuery with jQuery() or $j()
$j() = jQuery.noConflict();jQuery.noConflict();
// Put all your code in your document ready area
jQuery(document).ready(function($){
// Do jQuery stuff using $
$("div").hide();
});$j() = jQuery.noConflict(); to jquery.js in the jQuery extension and replace the "$" by "jQuery" in Thickbox.js.
$j is not defined
jquery.js Line 2var $j = jQuery.noConflict();v12-1.1.4 Released 2007-08-27
+ Updated the JS library to jQuery 1.1.4.
+ Changed the version numbering scheme to a simple RELEASENUMBER-JQUERY_VERSION_NUMBER.
So for this release — v12-1.1.4 — the v12 refers to release 12 (count 'em) using version 1.1.4
of the jQuery JS library. Hopefully this will be an improvement and less confusing for people.
If you have a view on this one way or another,please leave feedback in the addon discussion.
You are not allowed to upload (JQuery-v12-1.1.4.rar) the requested file type: application/force-download
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.
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.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);
if (defined('JQUERY_EXTENSION')) {