Opened 17 years ago
Closed 11 years ago
#3059 closed defect (wontfix)
[Patch] Save reference to TracWysiwyg object as textarea element attribute
Reported by: | Erik M. Bray | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Component: | TracWysiwygPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
I have a few wiki-related plugins that use JavaScript and that are broken when users have the Wysiwyg mode enable (but work fine otherwise since they're operating on the textarea element). There's not much I can do to get around it without specifically modify the plugins to account for the possibility that the tracwysiwyg plugin is in use, and that's fine. But I found it difficult without this patch, since no reference to the TracWysiwyg object is kept anywhere convenient. So this just attaches it directly to the textarea DOM element itself, which works fine.
Attachments (2)
Change History (5)
Changed 17 years ago by
Attachment: | tracwysiwyg_save_reference-r3703.patch added |
---|
comment:1 Changed 17 years ago by
Changed 16 years ago by
Attachment: | tracwysiwyg_save_reference-r3414.patch added |
---|
An update to this patch so that textareas that already have a wysiwyg editor are skipped in TracWysiwyg.initialize()
comment:2 Changed 16 years ago by
The above update to the patch is sort of a corollary that I found useful. Sometimes I dynamically add new elements to a page that should have wysiwyg wiki editing enabled, so I re-call TracWysiwyg.initialize(). But sometimes there are existing elements on the page that already have wysiwyg editing enabled, so I need to skip those.
comment:3 Changed 11 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I think that is not good idea to save instance in textarae element. Instead, use TracWysiwyg.findInstance(textarea)
.
My only concern with this is, which I just noticed, is that it creates a reference cycle. I'll have to see if that really gets to be a problem, but it probably won't.