[Django] #26885: django admin jquery initial changed in 1.9+

27 views
Skip to first unread message

Django

unread,
Jul 10, 2016, 12:32:42 AM7/10/16
to django-...@googlegroups.com
#26885: django admin jquery initial changed in 1.9+
-------------------------------+--------------------
Reporter: 9nix00 | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.9
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
Hi,all:

Does somebody can explain why we change `jquery.init.js` file in admin
module ?

in current code, this style cause some scope issue.
we can't get `jQuery`,`$` in global.

{{{
/*global django:true, jQuery:false*/
/* Puts the included jQuery into our own namespace using noConflict and
passing
* it 'true'. This ensures that the included jQuery doesn't pollute the
global
* namespace (i.e. this preserves pre-existing values for both window.$
and
* window.jQuery).
*/
var django = django || {};
django.jQuery = jQuery.noConflict(true);

}}}

in 1.8 release package . the code is
{{{
var django = django || {};
django.jQuery = jQuery;

var yl = yl || {};
yl.jQuery = django.jQuery;

// this file also prevents django.jQuery.noConflict
// there's got to be a better way ...

}}}

I don't think this is a better improve .

we have so many plugins depend on global jQuery or $ ! we can't use them
anymore,we have to add custom jQuery lib or change code to local scope.

I submit a PR , if you agree with me, please confirm it.

--
Ticket URL: <https://code.djangoproject.com/ticket/26885>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 10, 2016, 12:33:44 AM7/10/16
to django-...@googlegroups.com
#26885: django admin jquery initial changed in 1.9+
-------------------------------+--------------------------------------

Reporter: 9nix00 | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.9
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by 9nix00):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

github PR [https://github.com/django/django/pull/6900]

--
Ticket URL: <https://code.djangoproject.com/ticket/26885#comment:1>

Django

unread,
Jul 10, 2016, 8:41:14 PM7/10/16
to django-...@googlegroups.com
#26885: django admin jquery initial changed in 1.9+
-------------------------------+--------------------------------------

Reporter: 9nix00 | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.9
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by timgraham):

I'm confused by the report. `jquery.init.js` seems to be identical in
Django 1.8 and 1.9:
{{{


var django = django || {};
django.jQuery = jQuery.noConflict(true);
}}}

The [https://docs.djangoproject.com/en/stable/ref/contrib/admin/#jquery
rationale for namespacing] is described in the documentation.

--
Ticket URL: <https://code.djangoproject.com/ticket/26885#comment:2>

Django

unread,
Jul 11, 2016, 6:31:26 AM7/11/16
to django-...@googlegroups.com
#26885: django admin jquery initial changed in 1.9+
-------------------------------+--------------------------------------
Reporter: 9nix00 | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 1.9
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by claudep):

* status: new => closed
* resolution: => invalid


Comment:

Like Tim said, nothing changed at this level in Django 1.9.

--
Ticket URL: <https://code.djangoproject.com/ticket/26885#comment:3>

Reply all
Reply to author
Forward
0 new messages