Results 1 to 3 of 3

Thread: Custom css content htmleditor

  1. #1
    Sencha Premium User fabio.policeno's Avatar
    Join Date
    Sep 2010
    Posts
    366
    Answers
    18
    Vote Rating
    7
      0  

    Default Answered: Custom css content htmleditor

    How do I set the contents of my html editor to stay with the rules that are in my css? If for example by setting b {color: red} in my html editor, apply whenever the source content in bold blush, I tried the documentation but without success. Thank you.

  2. Code:
    getDocMarkup: function() {
            var me = this,
                h = me.iframeEl.getHeight() - me.iframePad * 2;
            return Ext.String.format('<html><head><link rel="stylesheet" type="text/css" href="resources/css/app.css"/><style type="text/css">body{border:0;margin:0;padding:{0}px;height:{1}px;box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box;cursor:text}</style></head><body></body></html>', me.iframePad, h);
        }

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,291
    Answers
    3992
    Vote Rating
    1469
      0  

    Default

    The actual editor that you see has two things. The HTML that you see like a web page is actually an iframe. The source is kept in a textarea. So where are you setting the color?
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  4. #3
    Sencha Premium User fabio.policeno's Avatar
    Join Date
    Sep 2010
    Posts
    366
    Answers
    18
    Vote Rating
    7
      0  

    Default

    Code:
    getDocMarkup: function() {
            var me = this,
                h = me.iframeEl.getHeight() - me.iframePad * 2;
            return Ext.String.format('<html><head><link rel="stylesheet" type="text/css" href="resources/css/app.css"/><style type="text/css">body{border:0;margin:0;padding:{0}px;height:{1}px;box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box;cursor:text}</style></head><body></body></html>', me.iframePad, h);
        }

Posting Permissions

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