Jump to:

23377 Posts in 18296 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » New Versions of Prototype & Scriptaculous

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
Go to End
Author Topic: 734 Views
  • rbquirke
    Avatar
    Community Member
    70 Posts

    New Versions of Prototype & Scriptaculous Link to this post

    Hi folks

    I have been trying out a new autocomplete field in a SilverStripe site I have been working on.
    My main difficulty was finding a decent implementation that loaded fairly fast. I did find one (http://www.beauscott.com/2008/06/05/autocompletejs-update-12/) that I am pleased with, but I am still in difficulties as it requires more recent versions of Prototype (1.6.0.2) & Scriptaculous (1.8.1) than those that come with SilverStripe 2.3.1.

    These new versions are not backwardly compatible with core SilverStripe code (messes up the CMS greatly).

    I tried installing the newer libraries separately, and calling them directly from the pages I require them for, but this is not working 100%.

    Essentially, the issue is that I would need to ensure the libraries in the jsparty folder only load in the CMS backend, and my new libraries only load in the front end.

    This is tricky to do, but not impossible. My question is though:
    1) Is it practical? Will I be forever firefighting problems?

    2) Is there a more elegant way to do this?

    Thanks

    Ronan

  • Nicolaas
    Avatar
    Forum Moderator
    213 Posts

    Re: New Versions of Prototype & Scriptaculous Link to this post

    I would

    add:
    Requirements::javascript( ... my new files ....)
    Requirements::block( .... outdated files .....)

    make sure this codes only runs when the field shows and not in other circumstances.

    I think that should work.

    However, if possible, I would look at something that uses jQuery as this is the preferred JS library.

  • rbquirke
    Avatar
    Community Member
    70 Posts

    Re: New Versions of Prototype & Scriptaculous Link to this post

    Thanks Nicolaas, yes, I had those in, but I was finding that the script was intermittently breaking nonetheless.

    I think the reason for this was the login page (which is used in the front end) was calling the jsparty versions and this was causing things to get complicated!

    I have since switched to a jquery solution as you suggested. No sense in swimming against the tide!

    There is a working demo of it up at: http://www.cashtrack.co.nz/ (the location field on the form to the right)

    I will publish a code example when I have it working better (code isn't 100% reusable yet).

    Ronan

    734 Views
Page: 1
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.