Opened 14 years ago

Closed 14 years ago

#713 closed defect (invalid)

Dynamically loading plugins

Reported by: mr.morphic Owned by: gogo
Priority: normal Milestone:
Component: Xinha Core Version:
Severity: normal Keywords:


Hi. I'm using xinha in an application I'm building. It's a great component, and works better than anything else I've tried, especially with XHTML. So thanks.

The application I'm building asynchronously loads objects to edit, and dynamically builds interfaces in javascript using metadata about the types of objects. So in general, there are multiple xinha editors for an item, and the names of the textareas are not known up front (so can't be coded into the initialisation code given on the newbies page.) Most of these things have been reaonsably straightforward.

The problem I have right now is that I want a javascript method to be called whenever a change is made to the value as the user edits ("modified" appears immediately on the status bar as soon as they edit a value). I have had a look through the forum, and seen a thread about creating a plugin called CheckOnKeyPress?, which gives the code for the plug-in but doesn't show how to register that plugin.

The only thing I've seen about registering a plug-in is in the setting of xinha_plugins. This seems to go to a file though, and the plug-in code is inline in JavaScript?, not in a file.

So I've got:

function CheckOnKeyyPress(editor)
{ ... }

CheckOnKeyPress._pluginInfo =

CheckOnKeyPress.prototype.onKeyPress = function(ev)

  1. How do I register this plugin in the Config object dynamically?
  2. Are there events other than KeyPress? that need to be trapped o check for changes (e.g. user selects text with a mouse and clicks Bold - does that generate a KeyPress??)

Any help would be much appreciated.

Change History (2)

comment:1 Changed 14 years ago by mr.morphic

Hi. This was supposed to be a forum topic, not a ticket. My fault, sorry. This can be closed as a ticket as I've posted it properly as a forum item.

comment:2 Changed 14 years ago by anonymous

  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.