Primefaces文本编辑器的按钮代码

时间:2017-01-05 16:03:40

标签: html jsf primefaces

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>

上述按钮的代码是什么,还有删除格式化按钮的代码?网站上提供的文件已经过时。

1 个答案:

答案 0 :(得分:9)

这是清单。删除或设置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>