Modify

Opened 6 years ago

Closed 9 months ago

#3059 closed defect (wontfix)

[Patch] Save reference to TracWysiwyg object as textarea element attribute

Reported by: ebray Owned by: jun66j5
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)

tracwysiwyg_save_reference-r3703.patch (512 bytes) - added by ebray 6 years ago.
tracwysiwyg_save_reference-r3414.patch (682 bytes) - added by anonymous 6 years ago.
An update to this patch so that textareas that already have a wysiwyg editor are skipped in TracWysiwyg.initialize()

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by ebray

comment:1 Changed 6 years ago by ebray

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.

Changed 6 years ago by anonymous

An update to this patch so that textareas that already have a wysiwyg editor are skipped in TracWysiwyg.initialize()

comment:2 Changed 6 years ago by anonymous

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 9 months ago by jun66j5

  • Resolution set to wontfix
  • Status changed from new to closed

I think that is not good idea to save instance in textarae element. Instead, use TracWysiwyg.findInstance(textarea).

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.