Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9007855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:48:06+00:00 2026-06-16T01:48:06+00:00

Google Closure Library editor: demo , documentation . The editable area is an iframe.

  • 0

Google Closure Library editor: demo, documentation.

The editable area is an iframe. How can I set the default font of the editable area? Now it is the default font of the browser. I prefer not to put a font tag around the content in the editable area**. That way, I can change the font of my website in the future, without the need to modify every HTML-content written in the editor.

** What I mean by that is something like this:

<font size="2" face="georgia, serif"><b>content</b></font>

I would prefer just this:

<b>content</b>

… and then style the editable area of the editor with the georgia font using CSS. That way, the HTML-content (produced by the editor) in my database wouldn’t contain a hard-coded font, so I could change the font in the future.

Edit: maybe I should use a SeamlessField instead of a Field for the editable area?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:48:07+00:00Added an answer on June 16, 2026 at 1:48 am

    Once you call makeEditable() on the goog.editor.Field, which creates the iFrame you referenced, the Field fires an event of type goog.editor.Field.EventType.LOAD. If you listen to that event, you can pull out the iFrame and toss in a link element to a CSS stylesheet so you can easily modify the content in your editor.

    Here’s the equivalent of one of my listeners that should get you on the right track. (I didn’t check if the goog.editor.Field was the target of the event, but I assume it is).

    some.namespace.Page.prototype.onEditorLoad_ = function(event) {
      var editor = /** @type {goog.editor.Field} */ (event.target);
      var iFrame = editor.getEditableIframe();
      if (iFrame) {
        var fieldDomHelper = editor.getEditableDomHelper();
        var documentNode =
          fieldDomHelper.getFrameContentDocument(iFrame).documentElement;
    
        var head = documentNode.getElementsByTagName(goog.dom.TagName.HEAD)[0];
        if (!head) {
          head = fieldDomHelper.createDom(goog.dom.TagName.HEAD);
          goog.dom.insertChildAt(documentNode, head, 0);
        }
    
        fieldDomHelper.appendChild(
          head,
          fieldDomHelper.createDom(
            goog.dom.TagName.LINK,
            { 'href': '/css/myCSS.css', 'rel': 'stylesheet', 'type': 'text/css' }
          )
        );
      }
    }
    

    Finally, in that CSS file, you can add whatever styling you want. Such as your font change.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can the Google Closure UI Library be used with Google DART?
The Google closure library is huge, how can I reduce size of it to
Google Closure library provides export symbols option to provide access to constructors through window
The Google Closure (GC) Javascript Library makes it very easy to create an AutoComplete
I am trying to teach myself the Google Closure javascript library. I am examining
I've been trying to figure out how to use the google closure library for
I've been unable to find a .jar for the new google-closure-library for use with
Possible Duplicate: Closure library dom node from html text in jQuery you can create
I'm using the Google Closure Library for a large scale web app. Basically I
I'm relatively new to the Google Closure library and my current obstacle is getting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.