返回介绍

Quick Toolbar plugin

发布于 2019-05-06 06:50:36 字数 3289 浏览 1217 评论 0 收藏 0

The Quick Toolbar plugin (quickbars) enables new user interface components to help users create content faster. It can be used to create an experience similar to Medium, Quip, and other modern editing tools.

It replaces the capabilities of the inlite theme in TinyMCE 4 or earlier.

The Quick Toolbar plugin enables two new context toolbars:

  • Quick Selection - shown when text is selected for quick access to formatting commands such as bold, italic and link.
  • Quick Insert - shown when a new line is created for the quick insertion of objects such as tables and images.

It also enables three new toolbar controls:

  • Quick Link - an inline experience for creating and editing links without a dialog
  • Quick Image - immediately prompts a user to select a local image to upload
  • Quick Table - immediately inserts a 2x2 table without prompting the user to select the number of rows and columns
Example enabling both context toolbars with their default controls:
tinymce.init({
    selector: "div.tinymce",
    plugins: [ 'quickbars' ],
    toolbar: false,
    menubar: false,
    inline: true
});

Example disabling the Quick Insert toolbar:

tinymce.init({
    selector: "div.tinymce",
    plugins: [ 'quickbars' ],
    toolbar: false,
    menubar: false,
    inline: true,
    quickbars_insert_toolbar: false
});

Example disabling the Quick Selection minibar:

tinymce.init({
    selector: "div.tinymce",
    plugins: [ 'quickbars' ],
    toolbar: false,
    menubar: false,
    inline: true,
    quickbars_selection_toolbar: false
});

Plugin-specific controls

Quick Link

The Quick Link (quicklink) control lets the user quickly insert/edit links inline. It can only be used in the Quick Selection toolbar.

Example:
tinymce.init({
    selector: "div.tinymce",
    plugins: [ 'quickbars' ],
    toolbar: false,
    menubar: false,
    inline: true,
    quickbars_selection_toolbar: 'bold italic | quicklink h2 h3 blockquote'
});

Quick Image

The Quick Image (quickimage) control lets you quickly insert images from the local computer into the editor. These can then be automatically uploaded if you configure image uploading. It can be used in both the Quick Insert toolbar and other toolbars.

Example:
tinymce.init({
    selector: "div.tinymce",
    plugins: [ 'quickbars' ],
    toolbar: false,
    menubar: false,
    inline: true,
    quickbars_insert_toolbar: 'quickimage quicktable'
});

Quick Table

The Quick Table (quicktable) control lets you quickly insert a 2x2 table with 100% width. It can be used in both the Quick Insert toolbar and other toolbars.

Example:
tinymce.init({
    selector: "div.tinymce",
    plugins: [ 'quickbars' ],
    toolbar: false,
    menubar: false,
    inline: true,
    quickbars_insert_toolbar: 'quickimage quicktable'
});

Related configuration options

  • quickbars_insert_toolbar
  • quickbars_selection_toolbar

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文