Ticket #7044: 7044.patch

File 7044.patch, 3.5 KB (added by Wiktor Walc, 13 years ago)
  • _samples/bbcode.html

     
    1717</head>
    1818<body>
    1919        <h1 class="samples">
    20                 CKEditor Sample &mdash; Replace Textarea Elements by Class Name
     20                CKEditor Sample &mdash; BBCode plugin
    2121        </h1>
    2222        <div class="description">
    2323        <p>
     
    7777                                colorButton_colors : 'Red/FF0000,Green/00FF00,Blue/0000FF',
    7878                                toolbar :
    7979                                [
    80                                         ['Source', '-', 'Save','NewPage','Preview','-','Bold', 'Italic','Underline','-', 'TextColor', 'FontSize','-','Link', 'Image'],
     80                                        ['Source', '-', 'Save','NewPage','Preview','-','Undo','Redo'],
     81                                        ['Find','Replace','-','SelectAll','RemoveFormat'],
     82                                        ['Link', 'Image'],
    8183                                        '/',
     84                                        ['FontSize', 'Bold', 'Italic','Underline'],
    8285                                        ['NumberedList','BulletedList','-','Blockquote'],
    83                                         ['Smiley','SpecialChar'],
    84                                         ['Find','Replace','-','SelectAll','RemoveFormat']
     86                                        ['TextColor', '-', 'Smiley','SpecialChar', '-', 'Maximize']
    8587                                ]
    8688                        });
    8789
  • _samples/index.html

     
    7979                <li><a class="samples" href="output_for_flash.html">Output for Flash</a><br />
    8080                        Configuring CKEditor to produce HTML code that can be used with Adobe Flash.
    8181                </li>
     82                <li><a class="samples" href="bbcode.html">BBCodes</a><br />
     83                        Configuring CKEditor to produce BBCode tags instead of HTML.
     84                </li>
    8285                <li><a class="samples" href="placeholder.html">Placeholder plugin</a><br />
    8386                        Using the Placeholder plugin to create uneditable sections that can only be created and modified with a proper dialog window.
    8487                </li>
  • _source/plugins/bbcode/plugin.js

     
    55
    66(function()
    77{
     8        CKEDITOR.on( 'dialogDefinition', function( ev )
     9        {
     10                var tab, name = ev.data.name,
     11                        definition = ev.data.definition;
     12
     13                if ( name == 'link' )
     14                {
     15                        definition.removeContents( 'target' );
     16                        definition.removeContents( 'upload' );
     17                        definition.removeContents( 'advanced' );
     18                        tab = definition.getContents( 'info' );
     19                        tab.remove( 'emailSubject' );
     20                        tab.remove( 'emailBody' );
     21                }
     22                if ( name == 'image' )
     23                {
     24                        definition.removeContents( 'advanced' );
     25                        tab = definition.getContents( 'Link' );
     26                        tab.remove('cmbTarget');
     27                        tab = definition.getContents( 'info' );
     28                        // TODO: get rid of lock ratio
     29                        tab.remove('txtAlt');
     30                        tab.remove('txtHeight');
     31                        tab.remove('txtWidth');
     32                        tab.remove('txtBorder');
     33                        tab.remove('txtHSpace');
     34                        tab.remove('txtVSpace');
     35                        tab.remove('cmbAlign');
     36                }
     37                if ( name == 'numberedListStyle' )
     38                {
     39                        tab = definition.getContents( 'info' );
     40                        tab.remove('start');
     41                }
     42        });
     43
    844        var bbcodeMap = { 'b' : 'strong', 'u': 'u', 'i' : 'em', 'color' : 'span', 'size' : 'span', 'quote' : 'blockquote', 'code' : 'code', 'url' : 'a', 'email' : 'span', 'img' : 'span', '*' : 'li', 'list' : 'ol' },
    945                        convertMap = { 'strong' : 'b' , 'b' : 'b', 'u': 'u', 'em' : 'i', 'i': 'i', 'code' : 'code', 'li' : '*' },
    1046                        tagnameMap = { 'strong' : 'b', 'em' : 'i', 'u' : 'u', 'li' : '*', 'ul' : 'list', 'ol' : 'list', 'code' : 'code', 'a' : 'link', 'img' : 'img', 'blockquote' : 'quote' },
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy