TinyMCE API v4 windowManager.open - 我可以为 body 选项配置哪些小部件? [英] TinyMCE API v4 windowManager.open - What widgets can I configure for the body option?

查看:34
本文介绍了TinyMCE API v4 windowManager.open - 我可以为 body 选项配置哪些小部件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用 Javascript 生成的自定义 HTML 填充模态对话框的主体.

I would like to fill the body of a modal dialog with custom HTML, generated by Javascript.

此方法的文档大部分是空的.

我只找到了

是否有可用类型的文档?更具体地说,是否有一种类型可以将通用标记从 Javascript 变量添加到对话框的主体?

Is there a documentation for the available types? More specifically, is there a type to add general markup to the body of a dialog from a Javascript variable?

推荐答案

我美化了tinymce的缩小版后,发现这些可能是windowManager.open的一些body类型.我不确定如何全部使用它们,因为所有这些信息都是通过试验收集的并且失败了.由于文档非常糟糕,因此无法收集到真实信息.这里还有一个链接,其中包含有关复选框的一些有用信息.

After I beautified the minified version of tinymce, i found that these may be some of the body types for windowManager.open. I'm not sure how to use them all, as all this info was gathered through trial and fail. Since the documentation is really bad, no real info can be gathered. Also here's a link which includes some good info on checkbox.

https://wordpress.stackexchange.com/questions/172853/how-disable-checkbox-when-listbox-value-changes-in-tinymce

我花了一个小时左右来检查和测试所有东西,所以我真的希望这可以省去你自己做的麻烦.

It took me an hour or so to check and test all so I really hope this will save you the trouble of doing it yourself.

LE:文本框参数:文本框设置表

LE: textbox params: textbox settings table

https://www.tiny.cloud/docs-4x/api/tinymce.ui/tinymce.ui.textbox/

LE2:你可以尝试浏览下面提到的所有tinymce.ui.*元素并检查它是否有设置表,我认为如果有的话,它可以用作body的有效参数

LE2: you can try and browse all the tinymce.ui.* elements mentioned down and check if it has a settings table, I think it may be used as a valid parameter for body if they have it

LE3:这是旧文档 http://archive.tinymce.com/wiki.php/api4:index,因为它比新的更有用它是现在唯一可用的文档 https://www.tinymce.com/docs/api/

                {
                    type   : 'listbox',
                    name   : 'listbox',
                    label  : 'listbox',
                    values : [
                        { text: 'Test1', value: 'test1' },
                        { text: 'Test2', value: 'test2' },
                        { text: 'Test3', value: 'test3' }
                    ],
                    value : 'test2' // Sets the default
                },
                {
                    type   : 'combobox',
                    name   : 'combobox',
                    label  : 'combobox',
                    values : [
                        { text: 'Test', value: 'test' },
                        { text: 'Test2', value: 'test2' }
                    ]
                },
                {
                    type   : 'textbox',
                    name   : 'textbox',
                    label  : 'textbox',
                    tooltip: 'Some nice tooltip to use',
                    value  : 'default value'
                },
                {
                    type   : 'container',
                    name   : 'container',
                    label  : 'container',
                    html   : '<h1>container<h1> is <i>ANY</i> html i guess...<br/><br/><pre>but needs some styling?!?</pre>'
                },
                {
                    type   : 'tooltip',
                    name   : 'tooltip',
                    label  : 'tooltip ( you dont use it like this check textbox params )'
                },
                {
                    type   : 'button',
                    name   : 'button',
                    label  : 'button ( i dont know the other params )',
                    text   : 'My Button'
                },
                {
                    type   : 'buttongroup',
                    name   : 'buttongroup',
                    label  : 'buttongroup ( i dont know the other params )',
                    items  : [
                        { text: 'Button 1', value: 'button1' },
                        { text: 'Button 2', value: 'button2' }
                    ]
                },
                {
                    type   : 'checkbox',
                    name   : 'checkbox',
                    label  : 'checkbox ( it doesn`t seem to accept more than 1 )',
                    text   : 'My Checkbox',
                    checked : true
                },
                {
                    type   : 'colorbox',
                    name   : 'colorbox',
                    label  : 'colorbox ( i have no idea how it works )',
                    // text   : '#fff',
                    values : [
                        { text: 'White', value: '#fff' },
                        { text: 'Black', value: '#000' }
                    ]
                },
                {
                    type   : 'panelbutton',
                    name   : 'panelbutton',
                    label  : 'panelbutton ( adds active state class to it,visible only on hover )',
                    text   : 'My Panel Button'
                },
                {
                    type   : 'colorbutton',
                    name   : 'colorbutton',
                    label  : 'colorbutton ( no idea... )',
                    // text   : 'My colorbutton'
                },
                {
                    type   : 'colorpicker',
                    name   : 'colorpicker',
                    label  : 'colorpicker'
                },
                {
                    type   : 'radio',
                    name   : 'radio',
                    label  : 'radio ( defaults to checkbox, or i`m missing something )',
                    text   : 'My Radio Button'
                }

这篇关于TinyMCE API v4 windowManager.open - 我可以为 body 选项配置哪些小部件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆