jQuery Easy Help

download jQuery Easy Help

of 13

Transcript of jQuery Easy Help

  • 1 | P a g e

    jQuery Easy v1.4.0

    Install the plugin through the extension manager.

    It will update itself if the plugin has been previously installed. In case of an update, make sure you read the changes

    that have been made and are aware of potential backward compatibility issues.

    Note: in Joomla! 1.5, the plugin needs to be un-installed before it can be updated.

  • 2 | P a g e

    Using the plugin

    Go to the menu Extensions -> Plugin Manager.

    Select the system type to narrow down the list of available plugins.

    Enable the System jQuery Easy plugin. Select it to access its options.

  • 3 | P a g e

    The list of options

    Here is the list of available parameters for the plugin.

    Note: Front or Frontend is the terminology used to represent your website. Back and Backend represent the

    administrative side of your site (the Joomla! administration).

    Basic options

  • 4 | P a g e

    Option Description Front Back

    Enable jQuery Enable jQuery on the website (disabled by default).

    If jQuery UI is not already present on your site, you probably dont need it X X

    jQuery Version

    Set the version of jQuery to use (from the Google CDN, framework (Joomla! v3.0 only)

    or locally). For every major version, it loads the latest release automatically (when

    using the Content Delivery Network)

    X X

    jQuery Sub-Version

    The optional explicit jQuery version number (does not apply to local files)

    Example:

    2 (the 2 in 1.7.2)

    X X

    Local Version Path

    When using the option custom/local, set the path to the local file (path including the

    file name).

    Example:

    /libraries/jquery/v1.7/jquery.min.js

    X X

    jQuery UI Version

    Set the version of jQuery UI to use (from the Google CDN, framework (Joomla! v3.0

    only) or locally). For every major version, it loads the latest release automatically

    (when using the CDN)

    X X

    jQuery UI Sub-Version

    The optional explicit jQuery UI version number (does not apply to local files)

    Example:

    21 (the 21 in 1.8.21)

    X X

    Local Version Path

    When using the option custom/local, set the path to the local file (path including the

    file name)

    The jQuery UI file can be the full blown library or a custom one created at the jQuery

    UI website http://jqueryui.com/download

    Example:

    /libraries/jquery-ui/v1.8/jquery-ui-custom.min.js

    X X

    Theme Set the UI theme that will be used in conjunction with jQuery UI.

    Some custom jQuery UI libraries may not need a theme. X X

    Custom/Local Theme

    Path

    The path to the local or custom CSS file used for jQuery UI (path including the file

    name).

    Typically, you would have a sub-directory images/ containing the themes images.

    The jQuery UI css file can be a full blown theme or a custom one created at the jQuery

    UI theme roller website http://jqueryui.com/themeroller/

    Example:

    /libraries/jquery-ui/v1.8/jquery-ui.css

    X X

    Protocol Set the protocol that will be used to load the libraries (http or https). HTTPS may be

    required on specifically secured sites. X X

    Libraries

    Load the jQuery and jQuery UI libraries compressed or not. The minified option is

    selected by default (best loading times).

    The un-compressed libraries would be mostly used for jQuery debugging.

    X X

    Preview A preview of jQuery and jQuery UIs simple test in order to make sure jQuery and/or

    jQuery UI libraries are loaded correctly, alongside the jQuery UI theme X

  • 5 | P a g e

    Most of the times you wont need to use jQuery in the backend

    If your administration console gets unresponsive for any reason after enabling jQuery, you will need to access your

    database and disable the plugin from the extensions table.

    UPDATE `mydatabasename`.`mytableprefix_extensions` SET `enabled` = '0' WHERE

    `mytableprefix_extensions`.`element` = "jqueryeasy";

    Backend features are not available for Joomla! 3.0

  • 6 | P a g e

    Notes:

    The Googles CDN server is optimized and will most likely have better loading times than having the libraries located on your websites server (it will depend on how efficient is your Internet Service Provider mostly). The only way to find out which server results in fastest loading times is by testing the 2 cases.

    The removal of the jQuery libraries is limited to the ones found in a script tag. The removal of the stylesheets is limited to the ones found in a link tag.

    Using sub-versions is useful for caching the library files for a year and therefore optimize website loading times. Please check this link for more information: http://blog.bucketsoft.com/2012/03/maximize-your-chances-of-caching-your.html

    The local library files could be arranged on your server in the following manner:

  • 7 | P a g e

    Advanced options for expert users

  • 8 | P a g e

    Option Description Front Back

    Plugin

    Enable only in pages(a)

    Enable the plugin in the pages listed only (one path per line).

    Examples:

    /contact (will match that page only)

    */product (will match all pages containing /product)

    / (will match the home page only)

    X X

    Disable in pages(a)

    Disable the plugin in the pages listed only (one path per line).

    Examples:

    /downloads (will match that page only)

    */product (will match all pages containing /product)

    / (will match the home page only)

    X X

    jQuery

    Strip remaining scripts

    Get rid of the scripts that have not been automatically removed by the plugin but still

    need to be stripped out (one path per line). The path is the content of the src attribute

    of the script tag.

    Example:

    /js/unwanted_script.js

    X X

    Strip remaining CSS

    Get rid of the stylesheets that have not been automatically removed by the plugin but

    still need to be stripped out (one path per line). The path is the content of the href

    attribute of the link tag.

    Example:

    /css/unwanted_stylesheet.css

    X X

    Strip no conflict code

    Get rid of all jQuery.noConflict(); and $.noConflict(); code (enabled

    by default)

    Takes care of jQuery.noConflict(true) and $.noConflict(true) also.

    When found, the whole script line is removed.

    X X

    Add no conflict code

    Add the jQuery.noConflict(); code (from the jquerynoconflict.js file by

    default). It can be added through script declaration, but adding the file instead ensures

    it is called right after the jQuery library is loaded.

    X X

    Fix document ready Replaces all $(document).ready(function() with

    jQuery(document).ready(function($) X X

    MooTools

    Disable when possible Will disable the MooTools libraries following a set of rules for safe removal(b)

    DISABLE AT YOUR OWN RISK X

    Keep in pages

    When MooTools is disabled, it can still be enabled in the pages listed (one path per line).

    Examples:

    /fitness (will match that page only)

    */product (will match all pages containing /product)

    / (will match the home page only)

    X

  • 9 | P a g e

    Option Description Front Back

    Other(c)

    Disable Captions Gets rid of caption.js (that usually loads alongside the MooTools libraries) which will

    remove image captions. Enable it to improve loading times. X

    Strip blank lines Removes the blank lines created by the plugins cleaning. Disabled by default because it

    may slow down the loading of long pages. X X

    Add scripts (d)

    Add javascripts (one path per line)

    Example:

    http://www.mysite.com/tidi.js

    X X

    Add script declarations

    (d)

    Add javascript declarations

    Example:

    var myVar = jQuery.noConflict();

    X X

    Add styles (d)

    Add CSS stylesheets (one path per line)

    Example:

    http://www.mysite.com/tidi.css

    X X

    Add style declarations

    (d)

    Add CSS styles

    Example:

    div span { font-size: 20px; }

    X X

    (a) use one or the other but not both options

    (b) MooTools libraries are disabled:

    WHEN no other library using MooTools is loaded from '/media/system/js' (won't be deleted if using mootree.js for instance)

    AND if there is no edition of articles, weblinks (MooTools is needed for article saving for instance) i.e. when view!= form

    AND if component.php is not in use (MooTools is needed to import images for instance) i.e. when tmpl != component

    AND we are not in the pages specified in keep in pages

    (c) These options are available when the plugin is enabled, independently of jQuery being enabled or not

    (d) Scripts and stylesheets are added after all the plugins changes and before the removal of blank lines. So the scripts can contain any

    jQuery code without the risk of being removed by the plugin. Moreover, the script declarations are added in front of any other script

    declaration.

  • 10 | P a g e

  • 11 | P a g e

    Help

    Reporting has been added to version 1.3.0 to make it easier to understand what the plugin does in the background and

    to help in finding out potential issues.

    The report is located at the bottom of the page that is viewed.

  • 12 | P a g e

    Example of a report:

  • 13 | P a g e

    Additional information

    Although jQuery Easy can solve a certain number of jQuery issues (code conflicts, multiple jQuery libraries load...),

    some problems can still occur. These problems can come from different sources:

    some components installed are not compatible with the version of jQuery you set through the plugin, some jQuery code may need to be modified, ...

    More information can be found at:

    Using jQuery with other libraries

    jQuery no conflict API

    Solving jQuery/jQuery and jQuery/MooTools conflict issues with the jQuery Easy plugin

    Solving jQuery issues with jQuery Easy: a case study

    DISABLE MOOTOOLS AT YOUR OWN RISK

    If you disable MooTools you may break some features (search filters functionality and frontend article submission for

    instance). If your Joomla! website does not use MooTools, you will benefit from disabling it:

    It will increase the page load speed by removing un-needed javascript code, It will eliminate conflicts between MooTools and jQuery.

    Visit the forum at http://www.simplifyyourweb.com/index.php/forum/19-jquery-easy for additional support.