[solved]ckeditor option

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

hi

go to config.js(ckeditor directory) and add your plugin.




CKEDITOR.editorConfig = function( config ) {

	// Define changes to default configuration here. For example:

	// config.language = 'fr';

	// config.uiColor = '#AADC6E';

	config.filebrowserBrowseUrl = 'plugin/image.php';

        config.contentsLangDirection = 'rtl';

        config.font_names = 'tahoma;b yekan;homa;B Nazanin;B Rose;B Bardiya;B Morvarid';

        

        config.extraPlugins = 'autosave';

        config.autosave_SaveKey = 'autosaveKey';

        config.autosave_NotOlderThen = 1440;

        config.autosave_saveOnDestroy = false;

        

        config.removePlugins = 'save,flash,about,image';


};



Thank you n-r, but I solved it…




<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'],

              ['pbckcode'],

              ['Maximize']

    		],

    extraPlugins: 'pbckcode',

    pbckcode: {

    highlighter : 'PRETTIFY',

    tab_size : '2',

    theme : 'ambiance',

    modes :  [

		['HTML', 'html'], 

		['CSS', 'css'], 

		['PHP', 'php'], 

		['JS', 'javascript'] 

    	],

    },

});

</script>