Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthor[-Stash-]
    • CommentTimeDec 18th 2006 edited
     # 1

    JQuery v15-1.2.6

    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:

    1. to enable extension writers to use jQuery simply and easily.
    2. to enable Vanilla admins to easily update jQuery to the latest version.
    3. to keep Vanilla from becoming bogged down with multiple versions/copies of jQuery as extension authors decide they want to use it.

    Extension Developers

    Calling JQuery for use with your extension

    To call JQuery from your extensions use the following code

    includeJQuery(); // call JQuery to ensure it's loaded first

    Compatibility with Prototype and other libraries

    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

    Debugging

    Change $JQdev from 0 to 1 and it will load in the original JQuery code, no compression, no minifying, no nothing.

    Known extension bugs

    ! None.

    To do

    + 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.

    EXTENSION INSTALLATION INSTRUCTIONS

    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.php

    To 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 > Extensions

    Then tick the checkbox for "JQuery"

    JQuery

    History

    v15-1.2.6 Released 2008-06-18

    + 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

    v14-1.2.1 Released 2007-09-21

    + 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.

    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.

    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.

    1.1.6 Released 2007-07-12

    + Updated the JS library to jQuery 1.1.3.1.

    1.1.5 Released 2007-06-28

    ! 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!

    1.1.4 Released 2007-03-20

    + 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.

    1.1.3 Released 2007-03-13

    ! 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.

    1.1.2 Released 2007-02-28

    + Fixed to work with SirNot's PreviewPost 2.2.
    + Updated jQuery to 1.1.2.

    1.1.1 Released 2007-01-22

    + Updated jQuery to 1.1.1.

    1.1.0 Released 2007-01-20

    + 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.

    1.0.3 Released 2007-01-12

    + Made use of JQUERY_PATH, thanks Jazzman.
    ! Prevented the configuration settings code executing on every page, thanks Jazzman.

    1.0.2 Released 2007-01-08

    + 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.

    1.0.1 Released 2007-01-02

    + Added a global configuration settings so other extensions can see if JQuery is installed.

    1.0.0 Released 2006-12-19

    + 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.

  1.  # 2
    Uploaded version 1.1.3 of JQuery.
    •  
      CommentAuthorDinoboff
    • CommentTimeMar 17th 2007 edited
     # 3
    I believe conflict with other library are due to the use of the $ that many library use.

    jQuery don't have to use it. You just need to add at the end the jQuery file//You now only can use jQuery with jQuery();
    jQuery.noConflict();
    or//you now can use jQuery with jQuery() or $j()
    $j() = jQuery.noConflict();


    When you use jQuery plugins, you have to be sure that the use jQuery() and not $(). For the official plugins, I think that only Thickbox use $(). That's easy to fix.

    see jQuery page: Using jQuery with Other Libraries
  2.  # 4
    i'm using the third option
    jQuery.noConflict();

    // Put all your code in your document ready area
    jQuery(document).ready(function($){
    // Do jQuery stuff using $
    $("div").hide();
    });


    stash it would be nice if ur extension version matches the official jquery versions
    so 1.1.3 should be with 1.1.3 jquery
    •  
      CommentAuthor[-Stash-]
    • CommentTimeMar 17th 2007
     # 5
    I know it would be nice, but then how do I fix problems with my extension? ;)
    •  
      CommentAuthorTomTester
    • CommentTimeMar 17th 2007 edited
     # 6
    Use dates as version numbers. 1.1.2.070317?!?

    {tangent} did you see this: Interface Elements for JQ and the latest JQuery-Ext alpha by Jack Slocum? Whoo! {/tangent}
    • CommentAuthordhdesign
    • CommentTimeMar 17th 2007 edited
     # 7
    Stash -
    I'm the one who reported the page reordering conflict with the Page Manager, but I don't believe JQuery is the problem - I think JQThickBox is causing the issue. I've tried it with JQuery version 1.1.2 enabled (with JQTB disabled), and I am able to reorder pages just fine. If I enable JQTB, then I cannot reorder pages.
    •  
      CommentAuthor[-Stash-]
    • CommentTimeMar 18th 2007
     # 8
    Dinoboff, I'm sure you're right, it took me a while to figure out exactly what all the instructions on jquery.com meant. I'll take a closer look at that and see about modding my variation of Thickbox to replace $().

    Tom, that's a thought. At this point though I'd be going back a version number, so I wonder, will this screw up the updates system with the add-ons site?
    •  
      CommentAuthorDinoboff
    • CommentTimeMar 18th 2007
     # 9
    You should add $j() = jQuery.noConflict(); to jquery.js in the jQuery extension and replace the "$" by "jQuery" in Thickbox.js.
    • CommentAuthorabramelin
    • CommentTimeMar 19th 2007
     # 10
    this extension gives java error on ie7
    it says
    "error: 'jQuery' is undefined"
    •  
      CommentAuthor[-Stash-]
    • CommentTimeMar 19th 2007
     # 11
    Dinoboff, using that I get$j is not defined
    jquery.js Line 2

    However, using this seems to do the trick:var $j = jQuery.noConflict();
    Any particular reason I shouldn't use this?
    •  
      CommentAuthorDinoboff
    • CommentTimeMar 19th 2007
     # 12
    lol, sorry I just forgot the 'var'.
  3.  # 13
    So ur going to package jquery with conflict resolution
    u cannot just use addstring, cause all addscripts appear first then addstrings appear.
    no matter what the sequence u enable it.
  4.  # 14
    Uploaded version 1.1.4 of JQuery.
  5.  # 15
    Uploaded version 1.1.5 of JQuery.
    •  
      CommentAuthorskube
    • CommentTimeJul 11th 2007
     # 16
    How about updating to the latest jQuery 1.1.3.1?
  6.  # 17
    Uploaded version 1.1.6 of JQuery.
    •  
      CommentAuthor[-Stash-]
    • CommentTimeJul 12th 2007
     # 18
    Thanks for the heads up skube :)
  7.  # 19
    Uploaded version v12-1.1.4 of JQuery.
    •  
      CommentAuthor[-Stash-]
    • CommentTimeAug 26th 2007 edited
     # 20
    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.
    • CommentAuthorithcy
    • CommentTimeAug 26th 2007
     # 21
    stash, please check the jqmedia thread for a bugfix.
    •  
      CommentAuthor[-Stash-]
    • CommentTimeAug 26th 2007 edited
     # 22
    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
    • CommentAuthorithcy
    • CommentTimeAug 27th 2007
     # 23
    it's not a fix for JQuery, it's a fix for JQMedia.

    JQMedia # 81
    •  
      CommentAuthor[-Stash-]
    • CommentTimeAug 27th 2007
     # 24
    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?
    • CommentAuthorithcy
    • CommentTimeAug 27th 2007
     # 25
    doh! sorry, i thought you were the author.
  8.  # 26
    Uploaded version v13-1.2.1 of JQuery.
    •  
      CommentAuthor[-Stash-]
    • CommentTimeSep 18th 2007
     # 27
    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.
    •  
      CommentAuthorsjeeps
    • CommentTimeSep 18th 2007
     # 28
    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.

    Any thoughts?!
    •  
      CommentAuthor[-Stash-]
    • CommentTimeSep 18th 2007
     # 29
    If you're using 0.5.3 try 0.5.1 and let me know...
    •  
      CommentAuthorsjeeps
    • CommentTimeSep 18th 2007
     # 30
    I was using 0.5.1 and now I'm trying 0.5.3! :)
    •  
      CommentAuthoradrian.
    • CommentTimeSep 18th 2007
     # 31
    try including the 1.1.4 compatibility script with this perhaps.
    •  
      CommentAuthorsjeeps
    • CommentTimeSep 18th 2007
     # 32
    Yep, unfortunately I'm going back to JQuery 1.1.4 since I tried it with both JQMedia 0.5.1 and 0.5.3 and it works fine!
    •  
      CommentAuthor[-Stash-]
    • CommentTimeSep 19th 2007
     # 33
    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 :)
  9.  # 34
    Uploaded version v14-1.2.1 of JQuery.
    •  
      CommentAuthor[-Stash-]
    • CommentTimeSep 21st 2007 edited
     # 35
    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');
    }
    •  
      CommentAuthorDinoboff
    • CommentTimeSep 21st 2007 edited
     # 36
    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.
    •  
      CommentAuthor[-Stash-]
    • CommentTimeSep 22nd 2007
     # 37
    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?
    •  
      CommentAuthorDinoboff
    • CommentTimeSep 22nd 2007
     # 38
    That's for extensions that need your extension to be loaded first.
    (But it need a fix in the core to work)
    •  
      CommentAuthor[-Stash-]
    • CommentTimeSep 22nd 2007
     # 39
    Will this fix be in Vanilla 1.2?

    And what's wrong with the way I'm doing it now? (other than the warning collector of course ;))
    •  
      CommentAuthorDinoboff
    • CommentTimeSep 22nd 2007 edited
     # 40
    People have to install your extension first, is it right? And then they can install the extensions can depends on it.

    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 :-)
    •  
      CommentAuthor[-Stash-]
    • CommentTimeSep 22nd 2007
     # 41
    I've just tried that with 1.1.3rc1 and get the following (there should be two comments there and some images using ThickBox).

    •  
      CommentAuthorDinoboff
    • CommentTimeSep 22nd 2007 edited
     # 42
    I forgot the quotes for the constant test:
    if (defined('JQUERY_EXTENSION')) {

    This time I tested it and it work with php5 and fail in php4. It should be fixed in 1.1.3 (it's not in the rc1).
    •  
      CommentAuthor[-Stash-]
    • CommentTimeSep 22nd 2007
     # 43
    OK, that'll be why nasty things are happening. When's 1.1.3 out? ;)
  10.  # 44
    I was hoping jquery extension will be killed off and jquery based extensions can directly link to the js file hosted on amazon. since now Vanilla 1.1.3 doesn't allow duplicate js files in the header, it won't be a problem if all jquery based extensions included jquery in its code, and they can decide which pages jquery can run
    •  
      CommentAuthor[-Stash-]
    • CommentTimeSep 26th 2007
     # 45
    *shrug* no one's forcing you to use this extension, I was just trying to help make things easier...
    • CommentAuthorpm4872
    • CommentTimeSep 27th 2007
     # 46
    Made the vanilla 1.1.3 update, made the JQuery v14-1.2.1 update = no more video with jQMedia !!!
    An idea to fix this.
    Thanks.
    •  
      CommentAuthor[-Stash-]
    • CommentTimeSep 27th 2007
     # 47
    I don't have time to look into this for anywhere up to a week, so if anyone wants to and suggest a solution that would be great.
    • CommentAuthorpm4872
    • CommentTimeSep 28th 2007
     # 48
    Ok,
    Is there anyway to come back to JQuery v13-1.2.1 during the fix time ?
    •  
      CommentAuthorconradslater
    • CommentTimeSep 30th 2007 edited
     # 49
    would it be possible to post a link to v13-1.2.1?

    I've just discovered that the old versions are all archived in there - thank you to whoever had the foresight to do that.
  11.  # 50
    u created a function IncludejQuery() but u never call it, hence jquery library is never added to the head script