TinyMCE cannot subscribe to onKeyUp event. The anonymous function that processes the 'onKeyUp' event is never called. Please advise how we can trap the 'onKeyUp' event from the tinyMCE editor.

      The file is /tomcat/webapps/share/components/comments/comment-list.js. The code snippet is
      // Add validation to the rich text editor
      var keyUpIdentifier = (Alfresco.constants.HTML_EDITOR === 'YAHOO.widget.SimpleEditor') ? 'editorKeyUp' : 'onKeyUp';
      editor.subscribe(keyUpIdentifier, function (e)

      • Doing a form validation on every key stroke is process consuming, below we try to make sure we only do
      • a form validation if it's necessarry.
      • NOTE: Don't check for zero-length in commentsLength, due to HTML <br>, <span> tags, etc. possibly
      • being present. Only a "Select all" followed by delete will clean all tags, otherwise leftovers will
      • be there even if the form looks empty.
        if (editor.getContent().length < 20 || !this.widgets.commentForm.isValid()) { // Submit was disabled and something has been typed, validate and submit will be enabled; this.widgets.commentForm.validate() }

        }, this, true);

      Steps To Reproduce

      1) Run out-of-the-box Alfresco v5.0.3 or v5.1 in a browser
      2) Login and upload a file
      3) Go to document details page
      4) F12 to open the developer's debug view
      5) Open comments-list.js
      6) Put a break point on line 142. It should read as

      • if (G.getContent().length < 20 || !this.widgets.commentForm.isValid()) {

      7) Hit 'F5' to reload the page
      8) Walk through and debug the code - you'll notice that the subscribing the 'onKeyUp' event did not call the .add() function
      9) In the new tinyMCE v4 editor, enter a letter to add a comment
      10) Notice that the break point you inserted previously in the anonymous function to intercept the 'onKeyUp' did not break there.

      • If you follow these same steps in Alfresco 4.2, the point break is picked up. Use line 143 which reads as:
        if (this.widgets.editor.getContent().length < 20 || !this.widgets.commentForm.isValid()) {

      See attached word doc

      Expected Results
      In 5.0.3, the point break should be picked up because the function is being called.

      Actual Results
      The point break is not picked up in 5.0.3 because the function is not called.





              • Assignee:
                closedbugs Closed Bugs (Inactive)
                ccollins Cody Collins
              • Votes:
                0 Vote for this issue
                4 Start watching this issue


                • Created:

                  Time Tracking

                  Original Estimate - Not Specified
                  Not Specified
                  Remaining Estimate - 0 minutes
                  Time Spent - 1 day, 3 hours
                  1d 3h

                    Structure Helper Panel