微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何编辑现有的 TinyMCE 对话框面板?

如何解决如何编辑现有的 TinyMCE 对话框面板?

我目前正在使用 tinyMCE 和 react 开发文本编辑器。当我转到“插入 > 媒体”时,会出现一个对话框面板。它有几个选项卡,如常规、嵌入和高级。我需要的是从面板中删除常规选项卡。

我确定有办法做到这一点,但我似乎无法在文档中找到它。 有没有办法做到这一点?

这是我的代码的一部分,因为我无法发布所有代码

<Editor
      apiKey={this.props.tinymceApiKey}
      initialValue={this.props.initialContent}
      init={{
        height: 500,convert_urls: false,ie7_compat: false,force_br_newlines: false,force_p_newlines: false,default_link_target: "_blank",link_context_toolbar: true,link_assume_external_targets: true,link_title: false,custom_elements:
          "math,maction,maligngroup,malignmark,menclose,merror,mfenced,mfrac," +
          "mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mroot," +
          "mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub," +
          "msup,msubsup,mtable,mtd,mtext,mtr,munder,munderover,script,svg,mjx-container,defs,path,g,use,mjx-assistive-mml",extended_valid_elements:
          "span[class|style],line[x1|y1|x2|y2],g[stroke-width|stroke|fill|transform],svg[style|role]" +
          ",div[onclick|class|contenteditable],path[id|d],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|onclick|type],audio[id],source[src|type],img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align|onclick|class|data-mce-resize|data-mce-placeholder]",plugins:
          "print preview paste searchreplace autolink autosave save directionality code visualblocks" +
          "visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking" +
          "anchor toc insertdatetime advlist lists wordcount imagetools textpattern noneditable help charmap quickbars emoticons",menubar: "file edit view insert format tools table",menu: {
          file: { title: "File",items: "preview | print " },edit: {
            title: "Edit",items:
              "undo redo | cut copy paste pastetext | selectall | searchreplace",},view: {
            title: "View",items: "code | spellchecker | preview fullscreen",insert: {
            title: "Insert",items:
              "image link media inserttable Math codesample | charmap emoticons hr | pagebreak anchor toc | insertdatetime",format: {
            title: "Format",items:
              "bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | removeformat",tools: { title: "Tools",items: "spellchecker | code wordcount" },table: {
            title: "Table",items: "inserttable | cell row column | tableprops deletetable",toolbar: this.props.toolbar,toolbar_sticky: true,height: 600,quickbars_selection_toolbar:
          "bold italic | quicklink h2 h3 blockquote quickimage quicktable",noneditable_noneditable_class: "mceNonEditable",toolbar_mode: "sliding",contextmenu: "link image imagetools table",image_title: false,image_description: false,image_dimensions: false,images_upload_handler: this.props.imageUploadHandler,setup: function (editor) {
          that.editor = editor;
          editor.ui.registry.addButton("Math",{
            text: "Math",tooltip: "Math equation",onAction: function (_) {
              that.setEditorOpen(true);
            },});

          editor.ui.registry.addButton("Focus",{
            text: "Focus",tooltip: "Focus editor",onAction: function (_) {
              that.editor.focus();
            },});

          editor.ui.registry.addMenuItem("Math",{
            text: "Math equation",onAction: function () {
              that.setEditorOpen(true);
            },});
        },}}
      onEditorChange={this.handleEditorChange}
    />

TinyMCE default dialog panel

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。