【问题标题】:Button Codes for Primefaces' Text EditorPrimefaces 文本编辑器的按钮代码
【发布时间】:2017-05-20 06:13:32
【问题描述】:

Primefaces 有两个文本编辑器,已弃用的“editor”和更新的“text editor”。以前我可以找到特定按钮的代码,但我找不到新按钮的任何此类代码,令人失望的是旧代码似乎无法翻译。例如:

controls="bold italic underline strikethrough subscript superscript 
font size style color highlight bullets numbering alignleft center 
alignright justify link unlink outdent indent"

适用于旧版编辑器,但仅限于:粗体、斜体、下划线、删除线、字体、大小、链接,当使用 HTML 标签添加时显示为按钮:

<button class="ql-bold"></button>

上述按钮以及删除格式按钮的代码是什么?网站上提供的文档已过期。

【问题讨论】:

    标签: html jsf primefaces


    【解决方案1】:

    这是列表。删除或设置style="display: none;"您不想显示的按钮。

    <p:textEditor
        id="descriptionId"
        widgetVar="descriptionWidget"
        value="#{bean.model.description}">
        <f:facet name="toolbar">
            <span class="ql-formats">
                <select class="ql-font" />
                <select class="ql-size" />
            </span>
            <span class="ql-formats">
                <button class="ql-bold" />
                <button class="ql-italic" />
                <button class="ql-underline" />
                <button class="ql-strike" />
            </span>
            <span class="ql-formats">
                <select class="ql-color" />
                <select class="ql-background" />
            </span>
            <span class="ql-formats">
                <button class="ql-script" value="sub" />
                <button class="ql-script" value="super" />
            </span>
            <span class="ql-formats">
                <button class="ql-header" value="1" />
                <button class="ql-header" value="2" />
                <button class="ql-blockquote" />
                <button class="ql-code-block" />
            </span>
            <span class="ql-formats">
                <button class="ql-list" value="ordered" />
                <button class="ql-list" value="bullet" />
                <button class="ql-indent" value="-1" />
                <button class="ql-indent" value="+1" />
            </span>
            <span class="ql-formats">
                <button class="ql-direction" value="rtl" />
                <select class="ql-align" />
            </span>
            <span class="ql-formats">
                <button class="ql-link" />
                <button class="ql-image" />
                <button class="ql-video" />
                <button class="ql-formula" />
            </span>
            <span class="ql-formats">
                <button class="ql-clean" />
            </span>
        </f:facet>
    </p:textEditor>
    

    【讨论】:

    • 很好的答案,对我很有帮助。
    • 很好的答案。我将更新文档以包含所有内容。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-10-09
    • 2019-05-25
    • 2015-07-21
    • 1970-01-01
    • 2010-09-06
    • 2019-01-08
    • 1970-01-01
    相关资源
    最近更新 更多