Examples of RichTextConfiguration


Examples of org.olat.core.gui.components.form.flexible.impl.elements.richText.RichTextConfiguration

  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {

    richText = uifactory.addRichTextElementForStringData("mce", null, htmlContent, 14, -1, false, true, qtiPackage.getBaseDir(), null,
        formLayout, ureq.getUserSession(), getWindowControl());

    RichTextConfiguration richTextConfig = richText.getEditorConfiguration();
    // disable <p> element for enabling vertical layouts
    richTextConfig.disableRootParagraphElement();
    // set upload dir to the media dir
    richTextConfig.setFileBrowserUploadRelPath("media");
    // manually enable the source edit button
    richTextConfig.setQuotedConfigValue(RichTextConfiguration.THEME_ADVANCED_BUTTONS3_ADD, RichTextConfiguration.SEPARATOR_BUTTON + "," + RichTextConfiguration.CODE_BUTTON);
    //allow script tags...
    richTextConfig.setQuotedConfigValue(RichTextConfiguration.INVALID_ELEMENTS, RichTextConfiguration.INVALID_ELEMENTS_FORM_FULL_VALUE_UNSAVE_WITH_SCRIPT);
    richTextConfig.setQuotedConfigValue(RichTextConfiguration.EXTENDED_VALID_ELEMENTS, "script[src,type,defer]");
   
    uifactory.addFormSubmitButton("submit", formLayout);
  }
View Full Code Here

Examples of org.olat.core.gui.components.form.flexible.impl.elements.richText.RichTextConfiguration

    StaticTextElement type = uifactory.addStaticTextElement("type", "form.imd.type", typeName, formLayout);

    // Description
    desc = uifactory.addRichTextElementForStringData("desc", "form.imd.descr", item.getObjectives(), 8, -1, false, true, null, null,
        formLayout, ureq.getUserSession(), getWindowControl());
    RichTextConfiguration richTextConfig = desc.getEditorConfiguration();
    // set upload dir to the media dir
    richTextConfig.setFileBrowserUploadRelPath("media");

    // Layout/Alignment
    Question q = item.getQuestion();
    // alignment of KPRIM is only horizontal
    if (q instanceof ChoiceQuestion && item.getQuestion().getType() != Question.TYPE_KPRIM) {
View Full Code Here

Examples of org.olat.core.gui.components.form.flexible.impl.elements.richText.RichTextConfiguration

    VFSContainer baseDir = FeedManager.getInstance().getItemContainer(post, blog);
    // Description
    description = uifactory.addRichTextElementForStringData("description", "feed.form.description", post.getDescription(), 8, -1, false,
        false, baseDir, null, formLayout, ureq.getUserSession(), getWindowControl());
    RichTextConfiguration descRichTextConfig = description.getEditorConfiguration();
    // set upload dir to the media dir
    descRichTextConfig.setFileBrowserUploadRelPath("media");

    // Content
    content = uifactory.addRichTextElementForStringData("content", "blog.form.content", post.getContent(), 18, -1, false, false,
        baseDir, null, formLayout, ureq.getUserSession(), getWindowControl());
    RichTextConfiguration richTextConfig = content.getEditorConfiguration();
    // set upload dir to the media dir
    richTextConfig.setFileBrowserUploadRelPath("media");

    final FormLayoutContainer dateAndTimeLayout = FormLayoutContainer.createHorizontalFormLayout("feed.publish.date", getTranslator());
    formLayout.add(dateAndTimeLayout);
    dateAndTimeLayout.setLabel("feed.publish.date", null);
    dateAndTimeLayout.setMandatory(true);
View Full Code Here

Examples of org.olat.core.gui.components.form.flexible.impl.elements.richText.RichTextConfiguration

    description = uifactory.addRichTextElementForStringDataMinimalistic("description", "feed.form.description", feed
        .getDescription(), 5, -1, false, formLayout, ureq.getUserSession(), getWindowControl());
    description.setMandatory(true);
    description.setMaxLength(4000);
    description.setNotEmptyCheck("feed.form.field.is_mandatory");
    RichTextConfiguration richTextConfig = description.getEditorConfiguration();
    // set upload dir to the media dir
    richTextConfig.setFileBrowserUploadRelPath("media");

    String VELOCITY_ROOT = Util.getPackageVelocityRoot(this.getClass());
    imageContainer = FormLayoutContainer.createCustomFormLayout("imageContainer", getTranslator(), VELOCITY_ROOT + "/image_container.html");
    imageContainer.setLabel("feed.file.label", null);
    flc.add(imageContainer);
View Full Code Here

Examples of org.olat.core.gui.components.form.flexible.impl.elements.richText.RichTextConfiguration

    title.setMandatory(true);
    title.setNotEmptyCheck("feed.form.field.is_mandatory");

    desc = uifactory.addRichTextElementForStringData("desc", "feed.form.description", episode.getDescription(), 12, -1, false,
        false, baseDir, null, formLayout, ureq.getUserSession(), getWindowControl());
    RichTextConfiguration richTextConfig = desc.getEditorConfiguration();
    // set upload dir to the media dir
    richTextConfig.setFileBrowserUploadRelPath("media");

    file = uifactory.addFileElement("file", this.flc);
    file.setLabel("podcast.episode.file.label", null);
    file.setMandatory(true, "podcast.episode.mandatory");
    File mediaFile = FeedManager.getInstance().getItemEnclosureFile(episode, podcast);
View Full Code Here

Examples of org.olat.core.gui.components.form.flexible.impl.elements.richText.RichTextConfiguration

  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    htmlElement = uifactory.addRichTextElementForStringData("rtfElement", null, body, -1, -1, false, true ,baseContainer, customLinkTreeModel, formLayout, ureq.getUserSession(), getWindowControl());
    //
    // Add resize handler
    RichTextConfiguration editorConfiguration = htmlElement.getEditorConfiguration();
    editorConfiguration.addOnInitCallbackFunction("b_resizetofit_htmleditor");
    editorConfiguration.setNonQuotedConfigValue(RichTextConfiguration.HEIGHT, "b_initialEditorHeight()");
    //
    // The buttons
    save = uifactory.addFormLink("savebuttontext", formLayout, Link.BUTTON);
    save.addActionListener(this, FormEvent.ONCLICK);
    cancel = uifactory.addFormLink("cancel", formLayout, Link.BUTTON);
View Full Code Here

Examples of org.olat.core.gui.components.form.flexible.impl.elements.richText.RichTextConfiguration

  @Override
  protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    htmlElement = uifactory.addRichTextElementForFileData("rtfElement", null, body, -1, -1, false, baseContainer, fileName, customLinkTreeModel, formLayout, ureq.getUserSession(), getWindowControl());
    //
    // Add resize handler
    RichTextConfiguration editorConfiguration = htmlElement.getEditorConfiguration();
    editorConfiguration.addOnInitCallbackFunction("b_resizetofit_htmleditor");
    editorConfiguration.setNonQuotedConfigValue(RichTextConfiguration.HEIGHT, "b_initialEditorHeight()");
    //
    // The buttons
    save = uifactory.addFormLink("savebuttontext", formLayout, Link.BUTTON);
    save.addActionListener(this, FormEvent.ONCLICK);
    cancel = uifactory.addFormLink("cancel", formLayout, Link.BUTTON);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.