xoops forums

Skype-Fr

Just popping in
Posted on: 2014/5/6 21:19
Skype-Fr
Skype-Fr (Show more)
Just popping in
Posts: 28
Since: 2006/4/27
#1

replace Fckeditor by CKeditor

Hi all,

I 'm needing to use CKeditor into this code (eguide mod) :
"admin.html"

<script type="text/javascript" src="<{$xoops_url}>/class/xoopseditor/fckeditor/fckeditor.js"></script>
<
script type="text/javascript">
function 
fckeditor_exec(targetwidthheighturl) {
    var 
area_width width;
    var 
area_height height;
    var 
xoops_url url;
    var 
oFCKeditor = new FCKeditortargetarea_widtharea_height, ("<{$use_fckeditor}>"=="Basic")?"Default":"Basic" );
    
oFCKeditor.BasePath xoops_url "/class/xoopseditor/fckeditor/";
    
oFCKeditor.Config["CustomConfigurationsPath"] = xoops_url "/class/xoopseditor/fckeditor/fckconfig.js" ;
    
oFCKeditor.ReplaceTextarea();
}
fckeditor_exec("summary""98%""450""<{$xoops_url}>");
</
script>


Could you help me ...

Gilles

Skype-Fr

Just popping in
Posted on: 2014/5/10 21:11
Skype-Fr
Skype-Fr (Show more)
Just popping in
Posts: 28
Since: 2006/4/27
#2

Re: replace Fckeditor by CKeditor

All right !

It is very easy :

<script type="text/javascript" src="<{$xoops_url}>/class/xoopseditor/ckeditor/ckeditor.js"></script>

<
textarea id="summary" name="summary" wrap="virtual" cols="60" rows="40"><{$summary|escape}></textarea>

<
script type="text/javascript">
CKEDITOR.replace'summary' );
</
script>


Here, my config file [config.js]

CKEDITOR.editorConfig = function( config ) {
    
// Define changes to default configuration here. For example:
    
config.language 'fr';
    
config.uiColor '#888888';
    
config.height 550;
    
//config.width = 540;

    // Toolbar configuration generated automatically by the editor based on config.toolbarGroups.
    
config.toolbar = [
        { 
name'document'groups: [ 'mode''document''doctools' ], items: [ 'Source''-''Save''Preview''Print' ] },
        { 
name'clipboard'groups: [ 'clipboard''undo' ], items: [ 'Cut''Copy''Paste''PasteText''PasteFromWord''-''Undo''Redo' ] },
        
'/',
        { 
name'editing'groups: [ 'find''selection''spellchecker' ], items: ['SelectAll''-''Scayt' ] },
        { 
name'insert'items: [ 'Image''Flash''Table''HorizontalRule''Smiley' ] },
        { 
name'links'items: [ 'Link''Unlink''Anchor' ] },
        
'/',
        { 
name'basicstyles'groups: [ 'basicstyles''cleanup' ], items: [ 'Bold''Italic''Underline''Strike''-''RemoveFormat' ] },
        { 
name'paragraph'groups: [ 'list''indent''blocks''align''bidi' ], items: [ 'NumberedList''BulletedList''-''Outdent''Indent''-''CreateDiv''-''JustifyLeft''JustifyCenter''JustifyRight''JustifyBlock' ] },
        
'/',
        { 
name'styles'items: [ 'Styles''Format''Font''FontSize' ] },
        { 
name'colors'items: [ 'TextColor''BGColor' ] },
        { 
name'tools'items: [ 'Maximize''ShowBlocks' ] },
        { 
name'others'items: [ '-' ] },
    ];
    
    
// Toolbar groups configuration.
    
config.toolbarGroups = [
        { 
name'document'groups: [ 'mode''document''doctools' ] },
        { 
name'clipboard'groups: [ 'clipboard''undo' ] },
        { 
name'editing'groups: [ 'find''selection''spellchecker' ] },
        { 
name'forms' },
        
'/',
        { 
name'basicstyles'groups: [ 'basicstyles''cleanup' ] },
        { 
name'paragraph'groups: [ 'list''indent''blocks''align''bidi' ] },
        { 
name'links' },
        { 
name'insert' },
        
'/',
        { 
name'styles' },
        { 
name'colors' },
        { 
name'tools' },
        { 
name'others' },
        { 
name'about' }
    ];
};


Regards
Gilles

Skype-Fr

Just popping in
Posted on: 2014/5/13 11:15
Skype-Fr
Skype-Fr (Show more)
Just popping in
Posts: 28
Since: 2006/4/27
#3

Re: replace Fckeditor by CKeditor

my previous config.js is not compatible with IE8.

Good config is :

CKEDITOR.editorConfig = function( config ) {
    
config.language 'fr'// your country
    
config.uiColor '#888888';
    
//config.extraPlugins = 'autogrow';
    
config.height 550;
    
//config.width = 540;
    
config.skin 'kama';
    
//config.skin = 'office2013';

config.toolbar = [
    [ 
'mode''document''doctools' ],  [ 'Source''-''Save''Preview''Print' ],
    [ 
'clipboard''undo' ],['Undo''Redo' ],[ 'Cut''Copy''Paste''PasteText''PasteFromWord'],
    
'/',
    [ 
'find''selection''spellchecker' ],['SelectAll''-''Scayt' ],
    [ 
'Image''Flash''Table''HorizontalRule''Smiley' ],
    [ 
'Link''Unlink''Anchor' ],
    
'/',
    [ 
'basicstyles''cleanup' ],[ 'Bold''Italic''Underline''Strike''-''RemoveFormat' ],
    [ 
'list''indent''blocks''align''bidi' ],[ 'NumberedList''BulletedList''-''Outdent''Indent''-''CreateDiv''-''JustifyLeft''JustifyCenter''JustifyRight''JustifyBlock' ],
    
'/',
    [ 
'Styles''Format''Font''FontSize' ],
    [ 
'TextColor''BGColor' ],
    [ 
'Maximize''ShowBlocks' 
];

};

Cesagonchu

Moderator
Posted on: 2014/5/14 9:29
Cesagonchu
Cesagonchu (Show more)
Moderator
Posts: 872
Since: 2010/2/1 2
#4

Re: replace Fckeditor by CKeditor

Thank you for sharing!