Hi,
I'm very new to TinyMCE so sure I've missed something or misunderstood, but I'm having problems getting a drop down listbox I've added (using the ExamplePlugin) to insert/replace at the cursor in IE9 - it always adds it to the beginning of the textarea whether I have any text selected or not.
My code for the plugin and to initialise tinyMCE is below. Any help greatly appreciated!
Thanks,
Caroline
<script type="text/javascript" src="/secure/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinymce.create('tinymce.plugins.ExamplePlugin', {
createControl: function(n, cm) {
switch (n) {
case 'photolistbox':
var mlb = cm.createListBox('photolistbox', {
title : 'Photo list box',
onselect : function(v) {
tinyMCE.activeEditor.execCommand('mceReplaceContent', false, v);
}
});
for (x = 1; x <= 12; x++)
{
mlb.add('Photo ' + x, 'PHOTO' + x);
}
// Return the new listbox instance
return mlb;
}
return null;
}
});
// Register plugin with a short name
tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin);
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "-example",
// Theme options
theme_advanced_buttons1 : "photolistbox",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
width: "100%",
height: "400"
});
</script>