0
我是新來的tinymce。我一直在試圖找出我需要使用的所有屬性來創建用戶填充並創建短代碼輸出的體面的對話框。在下面的代碼示例中,標籤和文本框之間沒有空白或填充,並且標籤文本中的任何尾部空格都被剪裁,這只是我想要做的一個更改。我已經查閱了文檔,以找到簡單的代碼示例。Wordpress tinymce對話框正文元素和屬性正式文檔
我的問題1:我在哪裏可以找到這個windowManager.open方法的正式完整文檔以及與之相關的所有可能的屬性和方法?
我的問題2 & 3:這些屬性實際上是原生JavaScript嗎?如果是的話,我在哪裏可以找到正式的完整文檔?
感謝您的幫助,您可以通過css sytle sheet(w/.mce-widget或.mce-textbox)獲取文檔或可能的格式以及在Wordpress中註冊此樣式表的位置和方式。
(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);
})();