56 lines
1.3 KiB
JavaScript
56 lines
1.3 KiB
JavaScript
tinymce.PluginManager.add('loadimage', function(editor, url) {
|
|
|
|
function jbBox(){
|
|
editor.windowManager.open({
|
|
title: 'Invoegen afbeelding ' + url,
|
|
file: url + '/dialog-v4.htm',
|
|
width : 350,
|
|
height: 135,
|
|
buttons: [{
|
|
text: 'Upload',
|
|
classes:'widget btn primary first abs-layout-item',
|
|
disabled : false,
|
|
onclick: 'ls.schoolplancontentModel.uploadImage'
|
|
},
|
|
{
|
|
text: 'Close',
|
|
onclick: 'close'
|
|
}] //buttons
|
|
|
|
});// ed. windowmanager open
|
|
} // function jbbox
|
|
|
|
editor.addButton("loadimage", {
|
|
tooltip : "upload and insert an image",
|
|
icon:"image",
|
|
|
|
onclick:jbBox
|
|
});
|
|
|
|
// Adds a menu item to the tools menu
|
|
editor.addMenuItem('jbimages', {
|
|
text: 'Upload image',
|
|
icon : 'image',
|
|
context: 'insert',
|
|
onclick: jbBox
|
|
});
|
|
|
|
// onclick: function() {
|
|
// // Open window
|
|
// editor.windowManager.open({
|
|
// title: 'Upload image',
|
|
// body: [
|
|
// {type: 'textbox', name: 'title', label: 'Title'}
|
|
// ],
|
|
// onsubmit: function(e) {
|
|
// // Insert content when the window form is submitted
|
|
// editor.insertContent('Title: ' + e.data.title);
|
|
// }
|
|
// });
|
|
// }
|
|
|
|
|
|
|
|
|
|
}); // tinymc pluginmanager
|