Changes between Version 14 and Version 15 of AddWYSIWYGEditor
- Timestamp:
- Feb 1, 2008, 9:05:48 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AddWYSIWYGEditor
v14 v15 75 75 '''With [wiki:NewformsAdminBranch newforms-admin]''', you have to use black magic, at the time of writing. 76 76 77 If you look at [source:django/branches/newforms-admin/django/contrib/admin/options.py the AdminOptionsclass], you'll note that there's a {{{media}}} property, which generates a78 new {{{Media}}} object each time you access the attribute. To get by that, we need to remake this property and "inject" our own JavaScripts.77 If you look at [source:django/branches/newforms-admin/django/contrib/admin/options.py the ModelAdmin class], you'll note that there's a {{{media}}} property, which generates a 78 new {{{Media}}} object each time you access the attribute. To get by that, we need to remake this property and "inject" our !JavaScript locations. 79 79 80 80 {{{ 81 81 #!python 82 class MyAdminOpts(admin.Model Options):82 class MyAdminOpts(admin.ModelAdmin): 83 83 def _media(self): 84 84 media = super(MyAdminOpts, self)._media() 85 85 media.add_js([ 86 86 "http://path/to/tiny_mce.js", 87 "http://path/to/ settings/"])87 "http://path/to/textarea.js"]) 88 88 return media 89 89 media = property(_media)