<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.ckeditor.com/4.14.1/standard/ckeditor.js"></script>
</head>
<body>
<textarea name="editor1"></textarea>
<script>
CKEDITOR.replace( 'editor1', {
on: {
instanceReady: function( evt ) {
var editor = evt.editor;
editor.addRichCombo( 'sampleList', {
label: 'Sample List',
title: 'Sample List',
multiSelect: false,
panel: {
css: [ CKEDITOR.skin.getPath( 'editor' ) ].concat( editor.config.contentsCss ),
multiSelect: false,
attributes: { 'aria-label': 'Sample List' }
},
init: function() {
this.add( 'Option 1', 'Option 1', 'Option 1' );
this.add( 'Option 2', 'Option 2', 'Option 2' );
this.add( 'Option 3', 'Option 3', 'Option 3' );
},
onClick: function( value ) {
editor.focus();
editor.fire( 'saveSnapshot' );
editor.insertHtml( value );
editor.fire( 'saveSnapshot' );
}
} );
}
}
} );
</script>
</body>
</html>