Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

Commit

Permalink
New file
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelmardojai committed Aug 26, 2015
1 parent 7efa99e commit 6c43507
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions js/plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
(function(){
tinymce.PluginManager.add( 'simple_alert_boxes', function(editor, url){

editor.addButton( 'alert_boxes_button_key', {

text: 'Insert Alert Box',
onclick: function(){
// Open window
editor.windowManager.open({
title: 'Insert Alert Box',
body: [{
type: 'textbox',
name: 'text',
label: 'Text',
multiline: true,
minWidth: 300,
minHeight: 100
},
{
type: 'listbox',
name: 'type',
label: 'Type',
'values': [
{text: 'Success Box', value: 'success'},
{text: 'Info Box', value: 'info'},
{text: 'Warning Box', value: 'warning'},
{text: 'Danger Box', value: 'danger'},
]
}],
onsubmit: function(e){
// Insert content when the window form is submitted
editor.insertContent( '[alert type='+ e.data.type +']' + e.data.text + '[/alert]');
}
});
}
});
});
})();

0 comments on commit 6c43507

Please sign in to comment.