Opened 13 years ago

Closed 12 years ago

#89 closed defect (wontfix)

Idea + Patch: call events of textarea

Reported by: Niko <ns@…> Owned by: niko
Priority: normal Milestone:
Component: Xinha Core Version:
Severity: normal Keywords:
Cc:

Description

in my cms we have a table with several Xinhas. If the content of onw xinha was changed the row sould be marked (using JavaScript?).

my idea is now that i could set a onKeypress for the textarea and xinha calls this function.

--- htmlarea.js (Revision 48)
+++ htmlarea.js (Arbeitskopie)
@@ -3046,6 +3046,11 @@
   var editor = this;
   var keyEvent = (HTMLArea.is_ie && ev.type == "keydown") || (!HTMLArea.is_ie && ev.type == "keypress");

+  //call events of textarea
+  if(typeof editor._textArea['on'+ev.type] == "function") {
+    editor._textArea['on'+ev.type]();
+  }
+
   if(HTMLArea.is_gecko && keyEvent && ev.ctrlKey &&  this._unLink && this._unlinkOnUndo)
   {
     if(String.fromCharCode(ev.charCode).toLowerCase() == 'z')

i don't know if this is the right place for this call and i don't know if this will work in all browsers (tested it in IE6 and FF) - don't know why the (HTMLArea.is_ie && ev.type == "keydown") || (!HTMLArea.is_ie && ev.type == "keypress"); is needed...

Change History (4)

comment:1 Changed 12 years ago by gogo

Hmm. It would be better as (a trivial) plugin maybe, so that it can be done without having those comparisons every keypress if it's not required.

If you make a plugin, feel free to add it to the subversion.

comment:2 Changed 12 years ago by gogo

  • Owner changed from gogo to niko

comment:3 Changed 12 years ago by gogo

niko, perhaps this should be rolled into the CharacterCount? plugin that is in development, it's kind of the same sort of area?

comment:4 Changed 12 years ago by niko

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

actually i wrote allready a plugin but didn't post it here as its very specific for our cms and is actually only one line of code *g*

CheckOnKeyPress.prototype.onKeyPress = function(ev) {
   //call some external functions...
}

i will close this bug for now...

Note: See TracTickets for help on using tickets.