Jump to:

23007 Posts in 11866 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » ss2.4 beta, i18n, prototype and jQuery noconflict

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 2331 Views
  • yurigoul
    Avatar
    Community Member
    202 Posts

    ss2.4 beta, i18n, prototype and jQuery noconflict Link to this post

    Am not sure where to post this, could also post this in the module forum instead, but here I go:

    I came to understand that silverstripe 2.4 will say goodbey to prototype and favor jQuery instead. But I have noticed that the beta of 2.4 still uses prototype for i18n. Is this going to change?

    If not, this brings me to the following point: If you use i18n you are using prototype and therefor you have to use jQuery noconflict if you also want to use jQuery.

    I have noticed that at least one of the modules (the Newsletter module in its latest trunk - could also be the userdefined forms since you need to install that as well) assumes you are not using prototype, and it therefor uses $() instead of jQuery() to start it's magic in the document.ready function for the subscription page. I hope that people are aware of this and offer a way to circumvent this - or that we can stop using prototype all together at some point.

  • banal
    Avatar
    Community Member
    901 Posts

    Re: ss2.4 beta, i18n, prototype and jQuery noconflict Link to this post

    Using jQuery noConflict is not required if you wrap your jQuery code in a Block like this:

    ;(function($) {
    // your jQuery code here.. you can use $
    })(jQuery);

    This is also covered here: http://doc.silverstripe.org/doku.php?id=jquery

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: ss2.4 beta, i18n, prototype and jQuery noconflict Link to this post

    Upgraded 2.4 alpha to 2.4 beta , and now cannot access cms anymore (mydomain.com/admin).

    It is stuck in the SS loading screen.

    FF shows in the error console:

    $("separator") is null
    fixRightWidth()LeftAndMain.js... (line 57)
    anonymous()LeftAndMain.js... (line 215)
    anonymous()LeftAndMain.js... (line 8)
    anonymous()jquery.js... (line 2294)
    anonymous()jquery.js... (line 2314)
    anonymous()jquery.js... (line 745)
    anonymous()jquery.js... (line 2313)
    $('separator').style.left = (sep + 2) + 'px';\n


    which happens in /cms/javascript/LeftAndMain.js

    I see that LeftAndMain.js in 2.4 beta is totally different from 2.4 alpha. Could this be related to yurigoul's point?
    (Btw i'm not using translatable for that site, but the newsletter module.)

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: ss2.4 beta, i18n, prototype and jQuery noconflict Link to this post

    Sorry, no, that is a different issue, opened Ticket #5046 for it: /cms/javascript/CMSMain.js has 0 Bytes, and date of 28 Jan 2006 in SilverStripe-v2.4.0-beta1.tar.gz.

  • MateuszU
    Avatar
    Community Member
    89 Posts

    Re: ss2.4 beta, i18n, prototype and jQuery noconflict Link to this post

    CMSMain.js has 0 bytes because after one of the refactorizations all the code got removed, so this is more like an artifact. Got some projects running on 2.4, and they have this file empty allright.

    Edit: had a look and maybe it is a problem after all, will check after lunch

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: ss2.4 beta, i18n, prototype and jQuery noconflict Link to this post

    The site itself is running after the upgrade from 2.4 alpha to beta, it's just the cms which does not load and that seems to to be due to javascript errors (this $("separator") is null ) in LeftAndMain.js. Of course that might have a different reason, but that empty file was just too obviously looking like an error ...

  • MateuszU
    Avatar
    Community Member
    89 Posts

    Re: ss2.4 beta, i18n, prototype and jQuery noconflict Link to this post

    I think it's fine, there must be another reason for your problems. I've just installed clean branches/2.4 and CMSMain.js *is* empty. It gets populated on 2.5 though. Maybe there are some modules that are causing trouble? Or maybe some custom cms modifications you have? (since the clean install performs fine...)

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: ss2.4 beta, i18n, prototype and jQuery noconflict Link to this post

    Thanks for this feedback, mateuzs, very helpful, indeed.

    I have not touched the cms code, so it's not that, however it was an upgrade of a 2.4 alpha (not a fresh install of the beta), plus a bunch of modules and widgets, so it could be one of that. I'll do a clean install and add the modules and my stuff one by one, until the error appears.

    2331 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.