Opened 12 years ago
Closed 12 years ago
#10655 closed enhancement (fixed)
[Patch] Use jQuery UI provided by Trac in 1.0 and later
Reported by: | Ryan J Ollos | Owned by: | Stepan Riha |
---|---|---|---|
Priority: | normal | Component: | AdminEnumListPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description
Trac 1.0 provides jQuery UI. The attached patch uses jQuery UI from Trac when the Trac version is >= 1.0.
Attachments (2)
Change History (7)
Changed 12 years ago by
Attachment: | t10655-r7112-1.patch added |
---|
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
IMO, it would be better to check Chrome.add_jquery_ui
attribute instead of Trac version, t10655-r7112-2.diff.
comment:3 Changed 12 years ago by
Yeah, I agree that Jun's patch is the better approach. I'm glad you brought this up, because after I made the first patch, I started thinking one day of a similar approach:
try: Chrome(self.env).add_jquery_ui(req) except AttributeError: add_script(req, 'adminenumlistplugin/jquery-ui-custom.js')
I'm not sure of any advantages of try/except
vs hasattr
; I've seen both patterns used in code quite a bit and I'm fairly new to Python. From reading the docs though, it looks like hasattr effectively does the same behind the scenes by calling getattr
in a try/except
, so the approach taken in the patch is probably cleaner and more readable.
comment:4 Changed 12 years ago by
Btw, I'll just go ahead and push this change in 2 weeks (per guidelines in AdoptingHacks), if we don't hear from nonplus by then.
comment:5 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
I have repository-wide commit access, so I'd be happy to push this change if you approve.