I want to add a plugin in my existing ckeditor, but I don’t know how to do it.
What I want to add is… (http://pierrebaron.fr/pbckcode/docs/)
CKEDITOR.editorConfig = function( config ) {
// CKEDITOR TOOLBAR CUSTOMIZATION
// I only set the needed buttons, so feel free to add those you want in the array
config.toolbarGroups = [
{ name: 'pbckcode' } ,
// your other buttons here
];
// CKEDITOR PLUGINS LOADING
config.extraPlugins = 'pbckcode'; // add other plugins here (comma separated)
// ADVANCED CONTENT FILTER (ACF)
// ACF protects your CKEditor instance of adding unofficial tags
// however it strips out the pre tag of pbckcode plugin
// add this rule to enable it, useful when you want to re edit a post
// Only needed on v1.1.x and v1.2.0
config.allowedContent= 'pre[*]{*}(*)'; // add other rules here
// PBCKCODE CUSTOMIZATION
config.pbckcode = {
// An optional class to your pre tag.
cls : '',
// The syntax highlighter you will use in the output view
highlighter : 'PRETTIFY',
// An array of the available modes for you plugin.
// The key corresponds to the string shown in the select tag.
// The value correspond to the loaded file for ACE Editor.
modes : [ ['HTML', 'html'], ['CSS', 'css'], ['PHP', 'php'], ['JS', 'javascript'] ],
// The theme of the ACE Editor of the plugin.
theme : 'textmate',
// Tab indentation (in spaces)
tab_size : '4',
// the root path of ACE Editor. Useful if you want to use the plugin
// without any Internet connection
js : "http://cdn.jsdelivr.net//ace/1.1.4/noconflict/"
};
};
My existing codes is…
<div class="form-group">
<div class="col-sm-12">
<?php echo $form->textArea($model, 'introtext', array('id'=>'media','class'=>'col-sm-12')); ?>
<?php echo $form->error($model,'introtext'); ?>
</div>
</div>
<script type="text/javascript">
CKEDITOR.replace( 'media', {
filebrowserBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/ckeditor/ckfinder/ckfinder.html',
filebrowserImageBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/ckeditor/ckfinder/ckfinder.html?type=Images',
filebrowserFlashBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/ckeditor/ckfinder/ckfinder.html?type=Flash',
filebrowserUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/ckeditor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
filebrowserImageUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/ckeditor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
filebrowserFlashUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/ckeditor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash',
toolbar: [
['Source'],
['Link','Unlink' ],
['Image'],
['Flash'],
['Maximize']
],
});
</script>
If I put the plugin codes in ‘config.js’ ckeditor, all toolbal will gone.
How I can integrate plugin codes to my ckeditor.replace codes?
Thank you very much