ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Compatibility check for jQuery and Prototype availability (Feature #725)


Added by Gregor Schmidt at 2011-11-22 07:35 am. Updated at 2011-11-26 08:45 am.


Status:Closed Start date:2011-11-22
Priority:Normal Due date:
Assignee:Eric Davis % Done:

0%

Category:User interface
Target version:2.5.0
Remote issue URL: Affected version:

Description

Since it is likely, that with Chili 3, jQuery and jQueryUI will be added to ChiliProject, plugins, that already use jQuery, will need to make sure, that they do not accidentally add another version of jQuery to the page. Consequently a plugin needs to be able to check, if jQuery will already be on the page or not.

I therefore propose to add a method to the ChiliProject::Compatibility class named using_jquery, that returns true for Chili 3.x and false for Chili 2.5. Additionally it would be useful to add something similar for Prototype.js support, since I guess, Prototype may vanish over time and might be removed at some point in the future.

If desired I am willing to open pull requests for the changes to stable and unstable.


Associated revisions

Revision be44bbe5
Added by Gregor Schmidt at 2011-11-25 08:18 pm

[#725] Add compatibility check for jQuery availability

In the current master a.k.a. ChiliProject 2.x, there is
no jQuery loaded by core.

Revision 13da5e04
Added by Gregor Schmidt at 2011-11-25 08:19 pm

[#725] Add compatibility check for jQuery availability

In the current master a.k.a. ChiliProject 2.x, there is
no jQuery loaded by core.

Revision 3577550c
Added by Gregor Schmidt at 2011-11-25 08:24 pm

[#725] Chili-core now loads jQuery by default

This was added to unstable with ab2856b53 and will be released with Chili 3.0

Revision 261aca65
Added by Eric Davis at 2011-11-25 09:50 pm

Merge pull request #133 from schmidt/pulls/725/master

[#725] Compatibility check for jQuery availability (master)

Revision 01e43f2e
Added by Eric Davis at 2011-11-25 09:50 pm

Merge pull request #134 from schmidt/pulls/725/unstable

[#725] Compatibility check for jQuery availability (unstable)

History

Updated by Gregor Schmidt at 2011-11-22 07:36 am

OT: Sorry for adding so many commas to my texts.

Updated by Eric Davis at 2011-11-25 10:01 am

Gregor Schmidt wrote:

I therefore propose to add a method to the ChiliProject::Compatibility class named using_jquery, that returns true for Chili 3.x and false for Chili 2.5.

Sounds good, though I think something like ChiliProject::Compatibility.jquery? would be a better name.

(Plugins will still have to check respond_to? for awhile though, previous versions won't have that compatibility method.)

Additionally it would be useful to add something similar for Prototype.js support, since I guess, Prototype may vanish over time and might be removed at some point in the future.

Let's wait on that. With all the existing Ajax and RJS code I don't think we'll stop including it anytime soon.

If desired I am willing to open pull requests for the changes to stable and unstable.

Thank you, that would be great.

Updated by Gregor Schmidt at 2011-11-25 08:13 pm

The pull requests may be found at

I have named the method using_jquery? to match it to using_acts_as_journalized?. I have cherry-picked the change to master into the unstable pull request. I hope this eases the merge of master into unstable, if both pull requests are applied at the same time.

If I can do anything else, just drop me a note.

  • Status changed from Open to Ready for review

Updated by Eric Davis at 2011-11-25 08:51 pm

Gregor Schmidt wrote:

I have named the method using_jquery? to match it to using_acts_as_journalized?.

Ah, you're right. Better to use consistent method names.

Merged into master and unstable on Github.

  • Target version set to 2.5.0
  • Assignee set to Eric Davis
  • Status changed from Ready for review to Closed

Updated by Gregor Schmidt at 2011-11-26 08:45 am

Thanks for the quick merge. I guess, I'll start using it on Monday already.

Also available in: Atom PDF