Bug Tracker

Opened 5 years ago

Closed 5 years ago

#7049 closed feature (fixed)

making jQuery.noConflict() callable anytime

Reported by: jclain Owned by:
Priority: low Milestone: 1.6
Component: core Version: 1.4.2
Keywords: noConflict Cc:
Blocked by: Blocking:

Description

hello,

I use jQuery in an environnement where other js library than jquery are loaded, and the loading order of libraries may be difficult to control properly. I use a code like this in all my pages (this is autogenerated):

jQuery.noConflict()(function ($) { ... });

I understand that jQuery.noConflict() should only be callled if jquery is loaded *after* the other library. I would like noConflict() to be callable anytime. I attach a patch that return control of $ and jQuery only if really necessary

This patch work for me. But if there are any defiencies in this code that can't see, please let me know

with best regards, jephte clain

Attachments (1)

jquery.js.patch (356 bytes) - added by jclain 5 years ago.
this patch is against the nightly build as of sept 18, 2010

Download all attachments as: .zip

Change History (9)

Changed 5 years ago by jclain

this patch is against the nightly build as of sept 18, 2010

comment:1 follow-up: Changed 5 years ago by snover

  • Milestone 1.4.3 deleted
  • Priority set to low
  • Status changed from new to open

The best way to get patches into core is to submit them as pull requests on GitHub.

Last edited 5 years ago by snover (previous) (diff)

comment:2 in reply to: ↑ 1 Changed 5 years ago by jclain

Replying to snover:

The best way to get patches into core is to submit them as pull requests on GitHub.

hello, I submitted a pull-request.

regards, jephte clain

comment:3 Changed 5 years ago by snover

3rd party pull request

comment:4 follow-up: Changed 5 years ago by rwaldron

snover, this patch does not conform to the current source style. The if statement must have opening and closing curly braces.

comment:5 in reply to: ↑ 4 ; follow-up: Changed 5 years ago by jclain

Replying to rwaldron:

snover, this patch does not conform to the current source style. The if statement must have opening and closing curly braces.

hello,

should I submit another pull request, or will you fix the patch? thanks in advance

comment:6 in reply to: ↑ 5 ; follow-up: Changed 5 years ago by jclain

Replying to jclain:

Replying to rwaldron:

snover, this patch does not conform to the current source style. The if statement must have opening and closing curly braces.

should I submit another pull request, or will you fix the patch? thanks in advance

I modified the code to respect current source style. it seems to have automatically merged with the pull request on github regards, jephte clain

comment:7 in reply to: ↑ 6 Changed 5 years ago by jclain

Replying to jclain:

I modified the code to respect current source style. it seems to have automatically merged with the pull request on github

well... I may have screwed the pull request. I hope you can sort it out.

comment:8 Changed 5 years ago by john

  • Milestone set to 1.6
  • Resolution set to fixed
  • Status changed from open to closed

Landed.

Note: See TracTickets for help on using tickets.