Ticket #2787: 2787_2.patch

File 2787_2.patch, 5.9 KB (added by Artur Formella, 15 years ago)
  • plugins/specialchar/dialogs/specialchar.js

     
    8282                                id : 'info',
    8383                                label : editor.lang.common.generalTab,
    8484                                title : editor.lang.common.generalTab,
     85                                align : top,
    8586                                elements : [
    8687                                        {
    8788                                                type : 'hbox',
    8889                                                align : 'top',
    89                                                 widths : [ '300px', '90px' ],
     90                                                widths : [ '320px', '90px' ],
    9091                                                children :
    9192                                                [
    9293                                                        {
    93                                                                 type : 'hbox',
    94                                                                 align : 'top',
    95                                                                 padding : 0,
    96                                                                 widths : [ '350px' ],
    97                                                                 children :
    98                                                                 [
     94                                                                type : 'html',
     95                                                                id : 'charContainer',
     96                                                                html : '',
     97                                                                onMouseover : function( evt )
     98                                                                {
     99                                                                        var target = evt.data.getTarget(),
     100                                                                                value;
     101                                                                        if ( target.getName() == 'td' && ( value = target.getAttribute( 'value' ) ) )
    99102                                                                        {
    100                                                                                 type : 'html',
    101                                                                                 id : 'charContainer',
    102                                                                                 html : '',
    103                                                                                 onMouseover : function( evt )
    104                                                                                 {
    105                                                                                         var target = evt.data.getTarget(),
    106                                                                                                 targetName = target.getName(),
    107                                                                                                 value;
     103                                                                                var dialog = this.getDialog(),
     104                                                                                        htmlPreview = dialog.getContentElement( 'info', 'htmlPreview' ).getElement();
    108105
    109                                                                                         if ( targetName == 'td' && ( value = target.getAttribute( 'value' ) ) )
    110                                                                                         {
    111                                                                                                 var dialog = this.getDialog(),
    112                                                                                                         preview = dialog.getContentElement( 'info', 'charPreview' ).getElement(),
    113                                                                                                         htmlPreview = dialog.getContentElement( 'info', 'htmlPreview' ).getElement();
    114 
    115                                                                                                 preview.setHtml( value );
    116                                                                                                 htmlPreview.setHtml( CKEDITOR.tools.htmlEncode( value ) );
    117                                                                                                 target.addClass( "LightBackground" );
    118                                                                                         }
    119                                                                                 },
    120                                                                                 onMouseout : function( evt )
    121                                                                                 {
    122                                                                                         var dialog = this.getDialog();
    123                                                                                         var preview = dialog.getContentElement( 'info', 'charPreview' ).getElement();
    124                                                                                         var htmlPreview = dialog.getContentElement( 'info', 'htmlPreview' ).getElement();
    125                                                                                         var target = evt.data.getTarget();
    126                                                                                         var targetName = target.getName();
    127                                                                                         preview.setHtml( ' ' );
    128                                                                                         htmlPreview.setHtml( ' ' );
    129 
    130                                                                                         if ( targetName == 'td' )
    131                                                                                                 target.removeClass( "LightBackground" );
    132                                                                                 },
    133                                                                                 onClick : function( evt )
    134                                                                                 {
    135                                                                                         var target = evt.data.getTarget();
    136                                                                                         var targetName = target.getName();
    137                                                                                         var editor = this.getDialog().getParentEditor();
    138                                                                                         var value;
    139 
    140                                                                                         if ( targetName == 'td' )
    141                                                                                         {
    142                                                                                                 target = target.$;
    143                                                                                                 if ( ( value = target.getAttribute( 'value' ) ) )
    144                                                                                                 {
    145                                                                                                         this.getDialog().restoreSelection();
    146                                                                                                         editor.insertHtml( value );
    147                                                                                                         this.getDialog().hide();
    148                                                                                                 }
    149                                                                                         }
    150                                                                                 }
     106                                                                                dialog.getContentElement( 'info', 'charPreview' ).getElement().setHtml( value );
     107                                                                                htmlPreview.setHtml( CKEDITOR.tools.htmlEncode( value ) );
     108                                                                                target.addClass( "LightBackground" );
    151109                                                                        }
    152                                                                 ]
     110                                                                },
     111                                                                onMouseout : function( evt )
     112                                                                {
     113                                                                        var target = evt.data.getTarget();
     114                                                                        if ( target.getName() == 'td' )
     115                                                                        {
     116                                                                                var dialog = this.getDialog();
     117                                                                                dialog.getContentElement( 'info', 'charPreview' ).getElement().setHtml( ' ' );
     118                                                                                dialog.getContentElement( 'info', 'htmlPreview' ).getElement().setHtml( ' ' );
     119                                                                                target.removeClass( "LightBackground" );
     120                                                                        }
     121                                                                },
     122                                                                onClick : function( evt )
     123                                                                {
     124                                                                        var target = evt.data.getTarget();
     125                                                                        if ( target.getName() == 'td' && ( value = target.$.getAttribute( 'value' )) )
     126                                                                        {
     127                                                                                var dialog = this.getDialog();
     128                                                                                target.removeClass( "LightBackground" );
     129                                                                                dialog.restoreSelection();
     130                                                                                dialog.getParentEditor().insertHtml( value );
     131                                                                                dialog.hide();
     132                                                                        }
     133                                                                }
    153134                                                        },
    154135                                                        {
    155                                                                 type : 'vbox',
     136                                                                type : 'hbox',
    156137                                                                align : 'top',
     138                                                                widths : [ '100%' ],
    157139                                                                children :
    158140                                                                [
    159141                                                                        {
    160                                                                                 type : 'html',
    161                                                                                 html : '<div></div>'
    162                                                                         },
    163                                                                         {
    164                                                                                 type : 'html',
    165                                                                                 id : 'charPreview',
    166                                                                                 style : 'border:1px solid #eeeeee;background-color:#EAEAD1;font-size:28px;height:40px;padding-top:9px;font-family:\'Microsoft Sans Serif\',Arial,Helvetica,Verdana;text-align:center;',
    167                                                                                 html : '<div>&nbsp;</div>'
    168                                                                         },
    169                                                                         {
    170                                                                                 type : 'html',
    171                                                                                 id : 'htmlPreview',
    172                                                                                 style : 'border:1px solid #eeeeee;background-color:#EAEAD1;font-size:14px;height:20px;padding-top:2px;font-family:\'Microsoft Sans Serif\',Arial,Helvetica,Verdana;text-align:center;',
    173                                                                                 html : '<div>&nbsp;</div>'
     142                                                                                type : 'vbox',
     143                                                                                align : 'top',
     144                                                                                children :
     145                                                                                [
     146                                                                                        {
     147                                                                                                type : 'html',
     148                                                                                                html : '<div></div>'
     149                                                                                        },
     150                                                                                        {
     151                                                                                                type : 'html',
     152                                                                                                id : 'charPreview',
     153                                                                                                style : 'border:1px solid #eeeeee;background-color:#EAEAD1;font-size:28px;height:40px;width:70px;padding-top:9px;font-family:\'Microsoft Sans Serif\',Arial,Helvetica,Verdana;text-align:center;',
     154                                                                                                html : '<div>&nbsp;</div>'
     155                                                                                        },
     156                                                                                        {
     157                                                                                                type : 'html',
     158                                                                                                id : 'htmlPreview',
     159                                                                                                style : 'border:1px solid #eeeeee;background-color:#EAEAD1;font-size:14px;height:20px;width:70px;padding-top:2px;font-family:\'Microsoft Sans Serif\',Arial,Helvetica,Verdana;text-align:center;',
     160                                                                                                html : '<div>&nbsp;</div>'
     161                                                                                        }
     162                                                                                ]
    174163                                                                        }
    175164                                                                ]
    176165                                                        }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy