link_class_list插件允许创建添加链接时要选择的类列表。有没有办法添加开放输入而不是下拉列表,以便用户可以输入任何类?
这些是文档中的参数,但没有提及开放输入字段。
tinymce.init({
selector: "textarea", // change this value according to your HTML
plugins: "link",
menubar: "insert",
toolbar: "link",
link_class_list: [
{title: 'None', value: ''},
{title: 'Dog', value: 'dog'},
{title: 'Cat', value: 'cat'}
]
});
答案 0 :(得分:0)
<script>
tinymce.init({
selector: 'textarea',
menubar:false,
plugins: [
'advlist autolink link image lists charmap print preview hr anchor pagebreak',
'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',
'save table contextmenu directionality emoticons template paste textcolor code pageembed codesample advcode '
],
toolbar: 'bold italic | link image preview media fullpage pageembed | code codesample forecolor backcolor | emoticons styleselect alignleft aligncenter alignright alignjustify bullist numlist outdent indent |table tabledelete | tableprops tablerowprops tablecellprops | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol',
default_link_target: '_blank',
style_formats: [{title: 'Button (Default)', selector: 'a', classes: ''}, {title: 'Button (primary)', selector: 'a', classes: 'btn btn-primary'}, {title: 'Button (success)', selector: 'a', classes: 'btn btn-success'}],
link_class_list: [{title:'Button (Default)', value:''}, {title:'Button (primary)', value:'btn btn-primary'}, {title:'Button (success)', value:'btn btn-success'}]
});
</script>
尝试一下。