CcmNG: Some experiments with the TinyMCE API
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5685 8810af33-2d31-482b-a856-94f89814c4df
parent
216fd13620
commit
0e09b2256f
|
|
@ -30,18 +30,88 @@ function openDialog(editor) {
|
|||
|
||||
console.log("Opening dialog");
|
||||
|
||||
editor.windowManager.open(
|
||||
{
|
||||
editor.windowManager.open({
|
||||
body: [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
label: "Search term",
|
||||
name: "searchterm",
|
||||
type: "textbox"
|
||||
onPostRender: function() {
|
||||
this.getEl().value = "Hello there";
|
||||
},
|
||||
type: "textbox",
|
||||
},
|
||||
{
|
||||
html: `<ul><li id="alpha">eins</li><li id="bravo">zwei</li></ul>`,
|
||||
onClick: function(event) {
|
||||
alert(`${event.target.id} clicked.`);
|
||||
},
|
||||
type: "container",
|
||||
}
|
||||
],
|
||||
name: "insertmedia_dialog_container",
|
||||
type: "container",
|
||||
},
|
||||
],
|
||||
onsubmit: function(event) {
|
||||
|
||||
},
|
||||
// onPostRender: function(event) {
|
||||
// console.log(`this = ${this}`);
|
||||
// console.log(`this.getEl = ${this.getEl}`);
|
||||
// this.getEl("searchterm").value = "Hello there";
|
||||
// },
|
||||
title: "Insert media",
|
||||
});
|
||||
|
||||
console.log("Dialog opened.");
|
||||
// const dialog = editor.windowManager.open(
|
||||
// body: [
|
||||
// {
|
||||
// items: [
|
||||
// {
|
||||
// label: "Search term",
|
||||
// name: "searchterm",
|
||||
// type: "textbox",
|
||||
// },
|
||||
// ],
|
||||
// name: "insertmedia_dialog_container",
|
||||
// type: "container",
|
||||
// },
|
||||
// ],
|
||||
// onsubmit: function(event) {
|
||||
//
|
||||
// },
|
||||
// onPostRender: function() {
|
||||
// this.getEl("searchterm").value = "Hello there";
|
||||
// },
|
||||
// title: "Insert media",
|
||||
// );
|
||||
|
||||
// console.log("Dialog opened.");
|
||||
|
||||
// dialog.add(
|
||||
// [
|
||||
// {
|
||||
// label: "Group",
|
||||
// name: "group",
|
||||
// type: "textbox",
|
||||
// },
|
||||
// ],
|
||||
// );
|
||||
//
|
||||
// console.log("Element added");
|
||||
|
||||
// dialog.insert([
|
||||
// {
|
||||
// label: "Group",
|
||||
// name: "group",
|
||||
// type: "textbox",
|
||||
// },
|
||||
// ],
|
||||
// dialog.items().length,
|
||||
// false);
|
||||
//
|
||||
// console.log("element inserted");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ tinymce.PluginManager.add("ccm-cms-insertmedia",
|
|||
text: "Insert media",
|
||||
icon: false,
|
||||
onclick: function() {
|
||||
openDialog(editor);
|
||||
const dialog = openDialog(editor);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue