日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

TinyMCE 富文本编辑器 ━━ 自定义插件之弹窗基础设置(整理)

發(fā)布時間:2023/12/10 编程问答 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 TinyMCE 富文本编辑器 ━━ 自定义插件之弹窗基础设置(整理) 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

TinyMCE彈窗很多時候并不需要單獨做一個頁面去引入,如非必要,直接利用現(xiàn)有配置我覺得更加合適。
這里先將stackoverflow回帖中的精華整理一下:

原貼引用
LE: textbox params: textbox settings table https://www.tinymce.com/docs/api/tinymce.ui/tinymce.ui.textbox/
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: this is the old documentation http://archive.tinymce.com/wiki.php/api4:index, since it’s more useful than the new one it’s the only documentation available now https://www.tinymce.com/docs/api/

editor.windowManager.open({"title": "tinymce body element types","body":[{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'}],"width": 450,"height": 180,"buttons": [{"text":"Start uploading","subtype":"primary","onclick":settings.format_function},{"text":"Close","onclick":"close"}] });

展示如圖

//獲得選中內(nèi)容 editor.selection.getContent(txt); //修改選中內(nèi)容 editor.selection.setContent(txt);//獲得全部內(nèi)容 editor.getContent(txt); //修改全部內(nèi)容 editor.setContent(txt);

總結(jié)

以上是生活随笔為你收集整理的TinyMCE 富文本编辑器 ━━ 自定义插件之弹窗基础设置(整理)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。