Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 46

Thread: [FIXED-87] [3.0RC3] HTMLEditor prepends ? to message

    You found a bug! We've classified it as a bug in our system. We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #11
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,248

    Default

    It seems as though it's not possible to retroactively remove the character, looks like we might have to revert the behaviour to using a nbsp.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  2. #12
    Sencha User MD's Avatar
    Join Date
    Mar 2007
    Posts
    178

    Default

    Out of curiosity, could you give specifics on what renders it unable to be retroactively removed? Due to character encoding, or?

    I haven't looked at the issue, but a shot in the dark here on an assumption as to the underlying 'why' -- what about converting the value string or an exploded array of the string characters into their ascii code equivalents, then doing a string replace or removal from array of the zero-width space?

  3. #13
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,248

    Default

    It just doesn't appear in the string, if you try indexOf('...') it's -1, even though it shows up on the server.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  4. #14
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    try searching for unicode character \00200B
    scratch that. doesn't work.

    interestingly though if you do htmleditorRef.getValue().length in Firefox after the htmleditor is initialised, it returns 1.

    see next post.
    Last edited by mystix; 8 Jul 2009 at 7:45 PM. Reason: edit

  5. #15
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    you need to search for the unicode equivalent of the <wbr> (i.e. word break / zero width space) tag.

    try this in the dynamic forms example immediately after focusing the HTMLEditor in Form 3:
    Code:
    Ext.getCmp('bio').getValue().length; // returns 1 because the &#8203; (i.e. <wbr>) tag is still there
    
    Ext.getCmp('bio').getValue().indexOf('\u200b'); // returns 0. YAY!

  6. #16
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    alritey this should do the trick:
    Code:
    Ext.override(Ext.form.HtmlEditor, {
        // private
        defaultValue: (Ext.isOpera || Ext.isIE6) ? '&#160;' : '&#8203;',
    
        cleanHtml: function(html) {
            var dv = this.defaultValue;
        
            html = String(html);
            
            // if (html.length > 5) {
            if (Ext.isWebKit) { // strip safari nonsense
                html = html.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi, '');
            }
            // }
            
            if (html.charCodeAt(0) == dv.replace(/\D/g, '')) {
                html = html.substring(1);
            }
            
            return html;
        }
    });

  7. #17
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    [ friendly bump ]
    to get this going again

  8. #18
    Sencha User
    Join Date
    Jun 2009
    Location
    New York City
    Posts
    29

    Default

    Quote Originally Posted by mystix View Post
    [ friendly bump ]
    to get this going again
    Why not just use "&nbsp;" everywhere?

    Code:
    *** ext-all-debug.js    Wed Jul 01 19:00:09 2009
    --- ext-all-debug_patched.js    Mon Jul 13 13:26:15 2009
    ***************
    *** 57367,57373 ****
          /**
           * @cfg {String} defaultValue A default value to be put into the editor to resolve focus issues (defaults to ? (Zero-width space), &nbsp; (Non-breaking space) in Opera and IE6).
           */
    !     defaultValue: (Ext.isOpera || Ext.isIE6) ? '&nbsp;' : '&??​#8203;',
    
          // private properties
          actionMode: 'wrap',
    --- 57367,57373 ----
          /**
           * @cfg {String} defaultValue A default value to be put into the editor to resolve focus issues (defaults to ? (Zero-width space), &nbsp; (Non-breaking space) in Opera and IE6).
           */
    !     defaultValue: '&nbsp;',
    
          // private properties
          actionMode: 'wrap',

  9. #19
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    did you try your suggestion in IE6 / Opera?
    there's a reason why there's an explicit check in there for these 2 browsers.

  10. #20
    Sencha User
    Join Date
    Jun 2009
    Location
    New York City
    Posts
    29

    Default

    Quote Originally Posted by mystix View Post
    did you try your suggestion in IE6 / Opera?
    there's a reason why there's an explicit check in there for these 2 browsers.
    My patch doesn't change the logic for IE6/Opera.

Page 2 of 5 FirstFirst 1234 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •