1
novlang1984
Oledrion and CKEditor : how to compress html ?

I use Oledrion with CKEditor.

There is a simple change to do :

oledrion/xoops_version.php
/**
 * Editor to use
 */

$cpto++;

$modversion['config'][$cpto]['name'] = 'bl_form_options';

$modversion['config'][$cpto]['title'] = "_MI_OLEDRION_FORM_OPTIONS";

$modversion['config'][$cpto]['description'] = '_MI_OLEDRION_FORM_OPTIONS_DESC';

$modversion['config'][$cpto]['formtype'] = 'select';

$modversion['config'][$cpto]['valuetype'] = 'text';

$modversion['config'][$cpto]['options'] = array(

    
_MI_OLEDRION_FORM_DHTML=>'dhtmltextarea',
    
_MI_OLEDRION_FORM_COMPACT=>'textarea',

    
_MI_OLEDRION_FORM_HTMLAREA=>'htmlarea',

    
_MI_OLEDRION_FORM_KOIVI=>'koivi',
    
_MI_OLEDRION_FORM_FCK=>'fckeditor',

    
_MI_OLEDRION_FORM_TINYEDITOR=>'tinyeditor',
    
// Addition    
    
_MI_OLEDRION_FORM_CK=>'CKEditor',
    
'tinymce' => 'tinymce'

    
);

$modversion['config'][$cpto]['default'] = 'dhtmltextarea';


oledrion/class/utils.php
case 'ckeditor':
    if ( 
is_readable(XOOPS_ROOT_PATH '/class/ckeditor/ckeditor.php'))    {
        require_once(
XOOPS_ROOT_PATH '/class/ckeditor/ckeditor.php');
        
$editor = new XoopsFormFckeditor($caption$name$value);
    }
break;



Troubleshooting : html code is rendered with white spaces on front page.

Example :
Quote:


 


The standard chunk of Lorem Ipsum




  1. used since the 1500s is reproduced below for those interested.


  2. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum"


  3. by Cicero are also reproduced in their exact original form,


  4. accompanied by English versions from the 1914 translation by H. Rackham.




If I compress html code before submit form (Source window), it is displayed fine.

I have looked for a solution with CKEditor faq and forums. It seems that this matter is related to Xoops (at least Oledrion module, because if I compare with xNews module, there is a checkbox bellow the submit form to compress html code).

I don't know where to look for now

Thanks for help !!


2
novlang1984
Re: Oledrion and CKEditor : how to compress html ?

I'm sorry... solution was here

Just add this to ckeditor/config.js
CKEDITOR.on'instanceReady', function( ev )
    {
        
ev.editor.dataProcessor.writer.setRules('p',
            {
                
indent            false,
                
breakBeforeOpen    false,
                
breakAfterOpen    false,
                
breakBeforeClosefalse,
                
breakAfterClose    false
            
}
        );
        
ev.editor.dataProcessor.writer.setRules('ol',
            {
                
indent            false,
                
breakBeforeOpen    false,
                
breakAfterOpen    false,
                
breakBeforeClosefalse,
                
breakAfterClose    false
            
}
        );
        
ev.editor.dataProcessor.writer.setRules('ul',
            {
                
indent            false,
                
breakBeforeOpen    false,
                
breakAfterOpen    false,
                
breakBeforeClosefalse,
                
breakAfterClose    false
            
}
        );
        
ev.editor.dataProcessor.writer.setRules('li',
            {
                
indent            true,
                
breakBeforeOpen    false,
                
breakAfterOpen    false,
                
breakBeforeClosefalse,
                
breakAfterClose    false
            
}
        );


    });

(if it not works, clean cache)

3
bumciach
Re: Oledrion and CKEditor : how to compress html ?
  • 2010/12/20 14:36

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25


Quote:

novlang1984 wrote:
Just add this to ckeditor/config.js

You can also add this to file ckeditor/module/config.oledrion.js (it's placeholder for module specific configurations in CKEditor). In case when updating CKEditor file ckeditor/config.js will be replaced by the original one.

Login

Who's Online

439 user(s) are online (314 user(s) are browsing Support Forums)


Members: 0


Guests: 439


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits