CcmNG: Some experiments with the TinyMCE API
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5685 8810af33-2d31-482b-a856-94f89814c4df
Former-commit-id: 0e09b2256f
pull/2/head
parent
d17d413646
commit
27ac0ba1a4
|
|
@ -30,18 +30,88 @@ function openDialog(editor) {
|
||||||
|
|
||||||
console.log("Opening dialog");
|
console.log("Opening dialog");
|
||||||
|
|
||||||
editor.windowManager.open(
|
editor.windowManager.open({
|
||||||
{
|
|
||||||
body: [
|
body: [
|
||||||
|
{
|
||||||
|
items: [
|
||||||
{
|
{
|
||||||
label: "Search term",
|
label: "Search term",
|
||||||
name: "searchterm",
|
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) {
|
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",
|
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",
|
text: "Insert media",
|
||||||
icon: false,
|
icon: false,
|
||||||
onclick: function() {
|
onclick: function() {
|
||||||
openDialog(editor);
|
const dialog = openDialog(editor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue