私はtinymceを初めて使っています。私は、ユーザーが記入してショートコード出力を作成するまともな見た目のダイアログを作成するために使用する必要があるすべての属性を把握しようとしています。下のコード例では、ラベルとテキストボックスはマージンやパディングなしでお互いに突き合わされており、ラベルテキストの末尾の空白は切り詰められています。私はtinymceのドキュメントを見てきましたが、私が見つけたのは簡単な簡単なコード例です。Wordpress tinymceダイアログボックスボディエレメント&アトリビュートフォーマルドキュメンテーション
私の質問1:このwindowManager.openメソッドとそれに関連するすべての可能な属性とメソッドについて、正式な文書はどこにありますか?
私の質問2 & 3:これらの属性は実際にはネイティブのjavascriptですか?もしそうなら、正式な文書をどこで見つけることができますか?
何か助けてくれてありがとうございました。私は、Wordpressでこのスタイルシートを登録する場所と方法について、css sytleシート(.mce-widgetまたは.mce-textbox)を使ってドキュメントを検索したり、フォーマットすることができます。
(function() {
tinymce.create("tinymce.plugins.youtube_plugin", {
//url argument holds the absolute url of our plugin directory
init : function(ed, url) {
alert('in youtube');
//add new button
ed.addButton("youtube_button", {
title : "Youtube Video Responsive Embed",
cmd : "youtube_command",
image : "https://cdn0.iconfinder.com/data/icons/social-flat-rounded-rects/512/youtube_v2-32.png"
});
//button functionality.
ed.addCommand("youtube_command", function() {
//alert('hello youtube');
ed.windowManager.open({
title: "YouTube Video Settings", // The title of the dialog window.
//file : url + '/../html/youtube.html',
width : 800,
height : 300,
inline : 1,
body: [{
type: 'container',
//label : 'flow',
//layout: 'flow',
items: [
{type: 'label', text: 'Youtube ServerPath:'},
{type: 'textbox', size: '80', name: 'title', value: 'http://www.youtube.com/embed/'},
//{type: 'label', text: 'and two labels'}
]
}],
buttons: [{
text: 'Submit',
onclick: 'submit'
}, {
text: 'Cancel',
onclick: 'close'
}],
onsubmit: function(e) {
//form = $('#youtube_plugin_id iframe').contents().find('form');
alert('hello');
ed.insertContent('Title: ' + e.data.title);
}
});
//var selected_text = ed.selection.getContent();
// var return_text = "<span style='color: green'>" + selected_text + "</span>";
//ed.execCommand("mceInsertContent", 0, return_text);
});
} // end init
}); // end tinymce.create
tinymce.PluginManager.add("youtube_button_plugin", tinymce.plugins.youtube_plugin);
})();