Ticket #2787: 2787.patch

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

     
    1717                        html.push( '<tbody>' );
    1818
    1919                        var i = 0 ;
    20 
    2120                        while ( i < editor.config.specialchar.characters.length )
    2221                        {
    2322                                html.push("<tr>") ;
     
    4443                                id : 'info',
    4544                                label : editor.lang.common.generalTab,
    4645                                title : editor.lang.common.generalTab,
     46                                align : 'top',
    4747                                elements : [
    4848                                        {
    4949                                                type : 'hbox',
    5050                                                align : 'top',
    51                                                 widths : [ '300px', '90px' ],
     51                                                widths : [ '320px', '90px' ],
    5252                                                children :
    5353                                                [
    5454                                                        {
    55                                                                 type : 'hbox',
    56                                                                 align : 'top',
    57                                                                 padding : 0,
    58                                                                 widths : [ '350px' ],
    59                                                                 children :
    60                                                                 [
    61                                                                         {
    62                                                                                 type : 'html',
    63                                                                                 id : 'charContainer',
    64                                                                                 html : '',
    65                                                                                 onMouseover : function( evt )
    66                                                                                 {
    67                                                                                         var dialog = this.getDialog();
    68                                                                                         var htmlPreview = dialog.getContentElement( 'info', 'htmlPreview' ).getElement();
    69                                                                                         var preview = dialog.getContentElement( 'info', 'charPreview' ).getElement();
    70                                                                                         var target = evt.data.getTarget();
    71                                                                                         var targetName = target.getName();
     55                                                                type : 'html',
     56                                                                id : 'charContainer',
     57                                                                html : '',
     58                                                                onMouseover : function( evt )
     59                                                                {
     60                                                                        var target = evt.data.getTarget();
     61                                                                        var targetName = target.getName();
    7262
    73                                                                                         if ( targetName == 'td' )
    74                                                                                                 if ( value = target.$.getAttribute( 'value' ) )
    75                                                                                                 {
    76                                                                                                         preview.setHtml( value );
    77                                                                                                         target.addClass( "LightBackground" );
    78                                                                                                         htmlPreview.setHtml( CKEDITOR.tools.htmlEncode( value ) );
    79                                                                                                 }
    80                                                                                 },
    81                                                                                 onMouseout : function( evt )
     63                                                                        if ( targetName == 'td' )
     64                                                                                if ( value = target.$.getAttribute( 'value' ) )
    8265                                                                                {
    8366                                                                                        var dialog = this.getDialog();
    8467                                                                                        var preview = dialog.getContentElement( 'info', 'charPreview' ).getElement();
    8568                                                                                        var htmlPreview = dialog.getContentElement( 'info', 'htmlPreview' ).getElement();
    86                                                                                         var target = evt.data.getTarget();
    87                                                                                         var targetName = target.getName();
    88                                                                                         preview.setHtml( '&nbsp;' );
    89                                                                                         htmlPreview.setHtml( '&nbsp;' );
    90 
    91                                                                                         if ( targetName == 'td' )
    92                                                                                                 target.removeClass( "LightBackground" );
    93                                                                                 },
    94                                                                                 onClick : function( evt )
    95                                                                                 {
    96                                                                                         var target = evt.data.getTarget();
    97                                                                                         var targetName = target.getName();
    98                                                                                         var editor = this.getDialog().getParentEditor();
    99                                                                                         if ( targetName == 'td' )
    100                                                                                         {
    101                                                                                                 target = target.$;
    102                                                                                                 if ( value = target.getAttribute( 'value' ) )
    103                                                                                                 {
    104                                                                                                         this.getDialog().restoreSelection();
    105                                                                                                         editor.insertElement( CKEDITOR.dom.element.createFromHtml( value ) );
    106                                                                                                         this.getDialog().hide();
    107                                                                                                 }
    108                                                                                         }
     69                                                                                        preview.setHtml( value );
     70                                                                                        target.addClass( "LightBackground" );
     71                                                                                        htmlPreview.setHtml( CKEDITOR.tools.htmlEncode( value ) );
    10972                                                                                }
     73                                                                },
     74                                                                onMouseout : function( evt )
     75                                                                {
     76                                                                        var target = evt.data.getTarget();
     77                                                                        var targetName = target.getName();
     78                                                                        if ( targetName == 'td' )
     79                                                                        {
     80                                                                                var dialog = this.getDialog();
     81                                                                                var preview = dialog.getContentElement( 'info', 'charPreview' ).getElement();
     82                                                                                var htmlPreview = dialog.getContentElement( 'info', 'htmlPreview' ).getElement();
     83                                                                                preview.setHtml( '&nbsp;' );
     84                                                                                htmlPreview.setHtml( '&nbsp;' );
     85                                                                                target.removeClass( "LightBackground" );
    11086                                                                        }
    111                                                                 ]
     87                                                                },
     88                                                                onClick : function( evt )
     89                                                                {
     90                                                                        var target = evt.data.getTarget();
     91                                                                        var targetName = target.getName();
     92                                                                        var editor = this.getDialog().getParentEditor();
     93                                                                        if ( ( targetName == 'td' ) && ( value = target.$.getAttribute( 'value' )) )
     94                                                                        {
     95                                                                                target.removeClass( "LightBackground" );
     96                                                                                this.getDialog().restoreSelection();
     97                                                                                editor.insertHtml( value );
     98                                                                                this.getDialog().hide();
     99                                                                        }
     100                                                                }
    112101                                                        },
    113102                                                        {
    114                                                                 type : 'vbox',
     103                                                                type : 'hbox',
    115104                                                                align : 'top',
     105                                                                widths : [ '100%' ],
    116106                                                                children :
    117107                                                                [
    118108                                                                        {
    119                                                                                 type : 'html',
    120                                                                                 html : '<div></div>'
    121                                                                         },
    122                                                                         {
    123                                                                                 type : 'html',
    124                                                                                 id : 'charPreview',
    125                                                                                 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;',
    126                                                                                 html : '<div>&nbsp;</div>'
    127                                                                         },
    128                                                                         {
    129                                                                                 type : 'html',
    130                                                                                 id : 'htmlPreview',
    131                                                                                 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;',
    132                                                                                 html : '<div>&nbsp;</div>'
     109                                                                                type : 'vbox',
     110                                                                                align : 'top',
     111                                                                                children :
     112                                                                                [
     113                                                                                        {
     114                                                                                                type : 'html',
     115                                                                                                html : '<div></div>'
     116                                                                                        },
     117                                                                                        {
     118                                                                                                type : 'html',
     119                                                                                                id : 'charPreview',
     120                                                                                                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;',
     121                                                                                                html : '<div>&nbsp;</div>'
     122                                                                                        },
     123                                                                                        {
     124                                                                                                type : 'html',
     125                                                                                                id : 'htmlPreview',
     126                                                                                                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;',
     127                                                                                                html : '<div>&nbsp;</div>'
     128                                                                                        }
     129                                                                                ]
    133130                                                                        }
    134131                                                                ]
    135132                                                        }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy