JB Library Plugin - a free joomla jquery plugin

a free Joomla 1.5 / Joomla 1.7 / Joomla 2.5 jquery plugin - Free Joomla extension

JBLibraryThe JB Library plugin is a system utility we use in our Joomla templates to help ease the pain of javascript conflicts and the common occurrence of having multiple versions of a javascript library loaded into your Joomla site. The jQuery library plugin neatly loads the native version of mootools first and then it loads the latest version of jQuery from the Google api, but only when necessary. Many of our Joomla modules require this library, but you can use it on any Joomla site.

Overview

Why are we using this method for embedding jQuery?

By adding jQuery as a plugin we can add other jQuery plugins and scripts in our modules on the fly. That means that there is no need to add script references to the head of your template and it also means that scripts only get loaded if the module is present.

Examples

Since its a plugin, you can only see the effect by looking at our Strata template's source code to see the inclusion of jQuery  or take a peak under the hood of the Joomlabamboo site you are on and view its source.

 

Dependancies

Joomla 1.5

Most of our jQuery enabled modules require this plugin to be installed and published.


features

  • Easily add jQuery to your site
  • Allows you to use a copy of the jQuery library from your site, or to load it from Google
  • Strips out extra jQuery library references that other Joomla extensions might load unnecessarily
  • Ability to strip any other javascript file that is being loaded on the site
  • Option to strip mootools from the output
  • Option to replace core mootools file with one of your choice
  • Needed by many JB extensions
  • Includes an option for Scroll to top button automatically created when the user scrolls down the page.
  • Includes an option to use the jQuery Lazyload script for images.
  • Includes a browser warning for users using the outdated ie6 browser.

 

 

instructions

First make sure you install the plugin using the Joomla Installer in the administration, and then that you've published the plugin. Then you will be ready to change and configure the settings.

Go into the Joomla Administrator, and find the Plugin Manager. Here you will see a list of all plugins, and go through until you see the JB Library module. Click on the title and you will see the parameters that you can adjust. When you need more information about a setting, roll over the text to the left and a tooltip will appear. Make sure to hit save when you are done.

 

Plugin Parameters

jbLibraryUpdatedParameters

Feature Overview

jQuery Library Options

Select the version of jQuery to use on your site.

 In most cases the latest version of jQuery will work with older scripts and plugins but it may be necessary to select the 1.2.6 version if you run into trouble. All of the Joomlabamboo modules will run with jQuery v1.3.2.

 

Select source for jQuery.

Selecting the google repository is often a faster solution since the file in question may already be cached on your site plus the Google servers are most likely faster than your own so the file downloads faster. If you are developing your site locally and not connected to the internet then this option must be set to local.

 

Enable Unique jQuery.

Setting this option to yes will mean that any other instance of the jQuery library will be stripped out of the page output.

 

Regex for jQuery file. 

This is the regular expression that the plugin uses to find and remove  other instances of jQuery in the output. Only make changes here if you know what you are doing.

 

Strip other scripts from the output.

 When set to yes this option removes the files entered in the text area below from being included in the output of the site.

 

Script names.

Enter the name of the javascript file that you do not want to load on your site. eg modal.js or template.js.

 

Mootools Settings

Remove Mootools

If this option is set to yes then all mootools references will be removed from the output of the page. Please note that mootools is an essential ingredient for a lot of Joomla installations and alot of third party extensions require mootools to be loaded on your site.

 

Replace Mootools library

When set to yes this option replaces the core mootools script and replaces it with the file you nominate in the next box.

 

Path to Mootools Library

Enter the direct path to the replacement mootools file you want to load. Please note that this option should only be used if you know exactly what you are doing as a lot of the core Joomla Mootools functionality relies on the specific mootools library that it gets shipped with.


Ie6 Warning.

This option enables a warning displayed to users using the outdated ie6 browser.

 

Scroll to top button

This options adds a jQuery script that adds a button to the bottom right hand corner of your site that provides a "scroll to top" link.

a. This options enables or disables the scroll to top button.

b. The second option gives you the option of selecting a light or a dark theme for the button.

c. The third option  allows you to set the text of the scroll to top text.

 

 

Lazy Load

Lazy Load is a jQuery script that enables delayed loading of images on your page. Images are only downloaded as the user scrolls down the page so as to maximise the speed that the page loads for the user. 

 

 

Troubleshooting

I installed the plugin, but nothings changed?

When you install the plugin, you have to enable it first. Go to the Plugin Manager and enable it.

Adding the JB Library messed up my other jQuery extensions!

Chances are that you are loading the jQuery library already, so either disable the jQuery loading in the other extensions or unpublish the JB Library.



Please note that the scroll to top button does not work with internet explorer 6.

Hosted by
Rochen Joomla Hosting

joomlabamboo.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters
the trademark holder in the United States and other countries.