Commit 2a6d5861 authored by Patrick's avatar Patrick

First try to add ck editor custom plugin

parent 2788334b
/**
* Created by Patrick on 13-01-17.
*/
CKEDITOR.plugins.add( 'simplebox', {
// Simple Box widget code.
requires: 'widget',
icons: 'simplebox',
init: function( editor ) {
// Plugin logic goes here...
editor.widgets.add( 'simplebox', {
// Widget code.
button: 'Create a simple box',
template:
'<div class="simplebox">' +
'<h2 class="simplebox-title">Title</h2>' +
'<div class="simplebox-content"><p>Content...</p></div>' +
'</div>',
editables: {
title: {
selector: '.simplebox-title',
allowedContent: 'br strong em'
},
content: {
selector: '.simplebox-content',
allowedContent: 'p br ul ol li strong em'
}
},
allowedContent:
'div(!simplebox); div(!simplebox-content); h2(!simplebox-title)',
requiredContent: 'div(simplebox)',
upcast: function( element ) {
return element.name == 'div' && element.hasClass( 'simplebox' );
}
} );
}
} );
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment