据我所知,TinyMCE复选框的复选框只返回true或false。这是正确的吗?
有没有办法获得复选框列表?并且复选框列表中选中的所有项目值都将通过editor.insertContent()
方法
或者,做一个for
循环以检查是否已检查其中的每一项,如果已检查,则检索一个值?
(function() {
tinymce.PluginManager.add(\'portfolio_shuffle_button\', function( editor, url ) {
editor.addButton( \'portfolio_shuffle_button\', {
text: \'Popup\',
icon: false,
onclick: function() {
editor.windowManager.open( {
title: \'Choose which Items\',
body: [
//or perhaps do a for loop to check each of these are checked and if they are retrieve a value?
{
type: \'checkbox\',
name: \'title\',
label: \'Your title\',
classes: \'what\'
},
{
type: \'checkbox\',
name: \'lol\',
label: \'Your title\',
classes: \'what\'
},
],
onsubmit: function( e ) {
console.log(e.data[0]);
console.log(e);
editor.insertContent( \'<h3>\' + e.data.body + \'</h3>\');
}
});
}
});
});
})();