Changes between Version 11 and Version 12 of AddWYSIWYGEditor
- Timestamp:
- Oct 30, 2007, 1:17:47 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AddWYSIWYGEditor
v11 v12 72 72 Basically '''js''' option includes tuple items as !JavaScript files in the header of CRUD pages for this model (see [http://www.djangoproject.com/documentation/model_api/#admin-options Django Model Reference / Admin Options]). The first script is the main TinyMCE file. '' If you use TinyMCE compressor, include '/tiny_mce/tiny_mce_gzip.php' instead.'' The second script is your configuration file created in step !#2. 73 73 74 '''With [wiki:NewformsAdminBranch newforms-admin]''', please note that you need to override the javascript()-method in [source:django/branches/newforms-admin/django/contrib/admin/options.py your model's option class] and add TinyMCE's javascript files to the returned list. 74 === With newforms-admin === 75 '''With [wiki:NewformsAdminBranch newforms-admin]''', please note that you need to override the {{{__init___}}} method in [source:django/branches/newforms-admin/django/contrib/admin/options.py your model's option class] and add TinyMCE's JavaScripts to {{{self.media}}}, which is a property. 75 76 77 {{{ 78 #!python 79 class MyAdminOpts(admin.ModelOptions): 80 # Fully emulate the super function, even returning whatever from __init__, 81 # in case there'll be future hackeries on the internal API. 82 def __init__(self, *a, **kw): 83 r = super(MyAdminOpts, self).__init__(*a, **kw) 84 self.media.add_js(("http://path/to/TinyMCE/files", "http://more/paths")) 85 return r 86 }}} 87 88 ''[ed: I haven't tried this yet, so you may have to do some own researh.]'' 76 89 ---- 77 90