MyBB Community Forums

Full Version: Custom Link Popup?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way on the edit options page to add 3 features:
Link 1
Link2
Link 3

and on every page you go you can click a button a little bar will slide to the left opening the menu and you can click the buttons
Obviously you'd need to edit the ed.selection.setContent line in the onsubmit to suit your own needs, as well as setting the correct toolbar and plugins settings.


tinymce.init({
selector: "textarea",
height : 350,
plugins: [
"link image lists preview anchor"
],
toolbar: " image bold italic | formatselect | undo redo | cut copy paste | bullist numlist | undo redo | link unlink dummyimg | preview",
menubar: false,
toolbar_items_size: 'small',
setup : function(ed) {
// Add a custom button
ed.addButton('dummyimg', {
title : 'Add image',
image : 'resources/images/img.jpg',
onclick : function() {
if($('#imageupload').val()){
ed.focus();
ed.selection.setContent('<img src="<%=strWebhost%>/news_cms/resources/images/dummyimg.jpg" />');
} else{
alert("Please select an image.");
}

}
});
},
onchange_callback: function(editor) {
tinyMCE.triggerSave();
$("#" + editor.id).valid();
}
});