Changes between Initial Version and Version 13 of Ticket #13414


Ignore:
Timestamp:
Jul 28, 2015, 2:26:44 PM (9 years ago)
Author:
Olek Nowodziński
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13414

    • Property Status changed from new to review
    • Property Owner set to Szymon Kupś
    • Property Version changed from 4.4.7 to
    • Property Milestone changed from to CKEditor 4.5.2
    • Property Keywords editable contenteditable=true removed
  • Ticket #13414 – Description

    initial v13  
    11I have created custom plugin for ckeditor widget "MyWiget" This plugin definition is given below.
    22
     3{{{
    34CKEDITOR.plugins.add( 'MyWidget', {
    4        
    55        requires: 'widget',
    6 
    76        icons: 'MyWidget',
    8        
    97        init: function( editor ) {             
    108                editor.widgets.add( 'MyWidget', {                       
     9                        allowedContent: 'div(!My_Div);table(!My_tbl);td(!My_td);tr(!My_tr);',
     10                        requiredContent: 'table(My_tbl)',       
    1111               
    12                         allowedContent: 'div(!My_Div);table(!My_tbl);td(!My_td);tr(!My_tr);',
    13                        
    14                         requiredContent: 'table(My_tbl)',                       
    15                        
    1612                        editables: {
    1713                                content: {
    18                                
    1914                                        selector: '.My_Div',
    2015                                        allowedContent: 'span a strong sub sup u em s br ul ol li h1 h2 h3 h4 h5 h6 hr; a[!href,name,id,style]; span[!style]{color};  '
     16                                }
     17                        },     
     18               
     19                        template:'<table mode="0" class="My_tbl ckw_contentTextWidget" border="0" cellpadding="0" cellspacing="0" align="center"><tbody><tr class="My_tr"><td class="My_td" valign="top" bgcolor="#FFFFFF" style="text-align : center"><div class="My_Div" style="text-align : left;">Enter your text here...<br>&nbsp;<br>&nbsp;</div></td></tr><tbody></table>',     
    2120
    22                                 }
    23                         },
    24                                                
    25                         template:'<table mode="0" class="My_tbl ckw_contentTextWidget" border="0" cellpadding="0" cellspacing="0" align="center"><tbody><tr class="My_tr"><td class="My_td" valign="top" bgcolor="#FFFFFF" style="text-align : center"><div class="My_Div" style="text-align : left;">Enter your text here...<br>&nbsp;<br>&nbsp;</div></td></tr><tbody></table>',     
    26                        
    2721                        button: 'Text',
    28                        
     22
    2923                        upcast: function( element ) {
    30                                
    3124                                return element.name == 'table' && element.hasClass( 'My_tbl' );
    32                                
    3325                        },
    3426
    35                         data: function(){
    36                                
    37                         }
    38                        
     27                        data: function(){       
     28                        }       
    3929                } );
    4030        }
    4131} );
     32}}}
    4233
    4334currently I am using ckeditor 4.4.7. and I have configured config file as below.
     35{{{
    4436config.enterMode = CKEDITOR.ENTER_BR;
    4537config.shiftEnterMode = CKEDITOR.ENTER_BR;
    4638config.autoParagraph = false;
     39}}}
    4740
    4841Now when I click in the editable div "My_Div" the content [Enter your text here...<br>&nbsp;<br>&nbsp;] is wrapped in enclosing p tag.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy