Modify ↓
#10244 closed enhancement (fixed)
[Patch] Option for using JQuery from a CDN
Reported by: | Owned by: | Peter Suter | |
---|---|---|---|
Priority: | normal | Milestone: | 1.0 |
Component: | general | Version: | |
Severity: | normal | Keywords: | jquery |
Cc: | Branch: | ||
Release Notes: |
jQuery may now be served from a Content Delivery Network using |
||
API Changes: | |||
Internal Changes: |
Description
Add the option [trac] jquery_location
:
-
trac/web/chrome.py
diff -r 00b3b14d466d trac/web/chrome.py
a b 362 362 will not be made available this way and additional rewrite 363 363 rules will be needed in the web server.""") 364 364 365 jquery_location = Option('trac', 'jquery_location', '', 366 """CDN URL for JQuery. 367 368 It can be left empty, and the JQuery bundled with Trac will be used. 369 370 Alternatively you can deliver JQuery from a CDN by setting it to a URL 371 like http://code.jquery.com/jquery-1.5.1.min.js, 372 http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.min.js or 373 https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js.""") 374 365 375 metanav_order = ListOption('trac', 'metanav', 366 376 'login, logout, prefs, help, about', doc= 367 377 """Order of the items to display in the `metanav` navigation bar, … … 605 615 add_link(req, 'search', req.href.search()) 606 616 add_link(req, 'help', req.href.wiki('TracGuide')) 607 617 add_stylesheet(req, 'common/css/trac.css') 608 add_script(req, 'common/js/jquery.js')618 add_script(req, self.jquery_location or 'common/js/jquery.js') 609 619 # Only activate noConflict mode if requested to by the handler 610 620 if handler is not None and \ 611 621 getattr(handler.__class__, 'jquery_noconflict', False):
as discussed by comment:16:ticket:9643 and comment:17:ticket:9643.
Attachments (1)
Change History (8)
by , 13 years ago
Attachment: | jquery-location-option.patch added |
---|
comment:1 by , 13 years ago
Milestone: | → 0.13 |
---|---|
Owner: | set to |
comment:2 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 13 years ago
Owner: | changed from | to
---|
comment:4 by , 13 years ago
I fell in the exact same trap with the formatting. Nice to know I'm in good company. :)
comment:5 by , 13 years ago
Owner: | changed from | to
---|
comment:6 by , 13 years ago
Release Notes: | modified (diff) |
---|
comment:7 by , 13 years ago
Keywords: | jquery added |
---|
Note:
See TracTickets
for help on using tickets.
Looks good. We should make sure the docstring always references the same version of jQuery as bundled with Trac.