Ticket #3512: 3512.patch

File 3512.patch, 17.7 KB (added by Tobiasz Cudnik, 15 years ago)
  • _source/skins/v2/dialog.css

     
    1 /*
     1/*
    22Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
    33For licensing, see LICENSE.html or http://ckeditor.com/license
    44*/
     
    476476/*
    477477 * Some utility CSS classes for dialog authors.
    478478 */
    479 .cke_skin_v2 .cke_dialog .dark_background
     479.cke_skin_v2 .cke_dialog .cke_dark_background
    480480{
    481481        background-color: #eaead1;
    482482}
    483483
    484 .cke_skin_v2 .cke_dialog .hand
     484.cke_skin_v2 .cke_dialog .cke_hand
    485485{
    486486        cursor: pointer;
    487487}
    488488
    489 .cke_skin_v2 .cke_dialog .centered
     489.cke_skin_v2 .cke_dialog .cke_centered
    490490{
    491491        text-align: center;
    492492}
    493493
    494 .cke_skin_v2 .cke_dialog .BtnReset
     494.cke_skin_v2 .cke_dialog .cke_btn_reset
    495495{
    496496        float: right;
    497497        background-position: 0 -32px;
     
    503503        font-size: 1px;
    504504}
    505505
    506 .cke_skin_v2 .cke_rtl .cke_dialog .BtnReset
     506.cke_skin_v2 .cke_rtl .cke_dialog .cke_btn_reset
    507507{
    508508        float: left;
    509509}
    510510
    511 .cke_skin_v2 .cke_dialog .BtnLocked, .BtnUnlocked
     511.cke_skin_v2 .cke_dialog .cke_btn_locked,
     512.cke_skin_v2 .cke_dialog .cke_btn_unlocked
    512513{
    513514        float: left;
    514515        background-position: 0 0;
     
    520521        font-size: 1px;
    521522}
    522523
    523 .cke_skin_v2 .cke_dialog .BtnLocked, .BtnUnlocked
     524.cke_skin_v2 .cke_dialog .cke_btn_locked,
     525.cke_skin_v2 .cke_dialog .cke_btn_unlocked
    524526{
    525527        float: right;
    526528}
    527529
    528 .cke_skin_v2 .cke_dialog .BtnUnlocked
     530.cke_skin_v2 .cke_dialog .cke_btn_unlocked
    529531{
    530532        background-position: 0 -16px;
    531533        background-image: url(images/mini.gif);
    532534}
    533535
    534 .cke_skin_v2 .cke_dialog .BtnOver
     536.cke_skin_v2 .cke_dialog .cke_btn_over
    535537{
    536538        border: outset 1px;
    537539        cursor: pointer;
     
    574576        background-color : white;
    575577}
    576578
    577 .cke_skin_v2 .cke_dialog .DarkBackground
     579.cke_skin_v2 .cke_dialog .cke_dark_background
    578580{
    579581        text-align : center;
    580582        background-color: #eaead1;
    581583        font-size : 14px;
    582584}
    583585
    584 .cke_skin_v2 .cke_dialog .LightBackground
     586.cke_skin_v2 .cke_dialog .cke_light_background
    585587{
    586588        text-align : center;
    587589        background-color: #ffffbe;
    588590}
    589591
    590 .cke_skin_v2 .cke_dialog .Hand
     592.cke_skin_v2 .cke_dialog .cke_hand
    591593{
    592594        cursor: pointer;
    593595        cursor: hand;
    594596}
    595597
    596 .cke_skin_v2 .disabled
     598.cke_skin_v2 .cke_disabled
    597599{
    598600        color: #a0a0a0;
    599601}
  • _source/plugins/specialchar/dialogs/specialchar.js

     
    6262                                                        '<td width="1%"' +
    6363                                                        ' title="', chars[i].replace( /&/g, '&amp;' ), '"' +
    6464                                                        ' value="', chars[i].replace( /&/g, "&amp;" ), '"' +
    65                                                         ' class="DarkBackground Hand">');
     65                                                        ' class="cke_dark_background cke_hand">');
    6666                                                html.push( chars[i] );
    6767                                        }
    6868                                        else
    69                                                 html.push( '<td class="DarkBackground">&nbsp;' );
     69                                                html.push( '<td class="cke_dark_background">&nbsp;' );
    7070
    7171                                        html.push( '</td>' );
    7272                                }
     
    106106
    107107                                                                                dialog.getContentElement( 'info', 'charPreview' ).getElement().setHtml( value );
    108108                                                                                htmlPreview.setHtml( CKEDITOR.tools.htmlEncode( value ) );
    109                                                                                 target.addClass( "LightBackground" );
     109                                                                                target.addClass( "cke_light_background" );
    110110                                                                        }
    111111                                                                },
    112112                                                                onMouseout : function( evt )
     
    117117                                                                                var dialog = this.getDialog();
    118118                                                                                dialog.getContentElement( 'info', 'charPreview' ).getElement().setHtml( '&nbsp;' );
    119119                                                                                dialog.getContentElement( 'info', 'htmlPreview' ).getElement().setHtml( '&nbsp;' );
    120                                                                                 target.removeClass( "LightBackground" );
     120                                                                                target.removeClass( "cke_light_background" );
    121121                                                                        }
    122122                                                                },
    123123                                                                onClick : function( evt )
     
    127127                                                                        if ( target.getName() == 'td' && ( value = target.$.getAttribute( 'value' )) )
    128128                                                                        {
    129129                                                                                var dialog = this.getDialog();
    130                                                                                 target.removeClass( "LightBackground" );
     130                                                                                target.removeClass( "cke_light_background" );
    131131                                                                                dialog.getParentEditor().insertHtml( value );
    132132                                                                                dialog.hide();
    133133                                                                        }
  • _source/plugins/find/dialogs/find.js

     
    2626         */
    2727        var cursorStep = function()
    2828        {
    29                 var obj = {
     29                return {
    3030                        textNode : this.textNode,
    3131                        offset : this.offset,
    3232                        character : this.textNode ?
    3333                                this.textNode.getText().charAt( this.offset ) : null,
    3434                        hitMatchBoundary : this._.matchBoundary
    3535                };
    36                 return obj;
    3736        };
    3837
    3938        var pages = [ 'find', 'replace' ],
     
    7271                var highlightStyle = new CKEDITOR.style( editor.config.find_highlight );
    7372
    7473                /**
    75                  * Iterator which walk through document char by char.
    76                  * @param {Object} start
    77                  * @param {Number} offset
    78                  * @param {Boolean} isStrict
     74                 * Iterator which walk through the specified range char by char. By
     75                 * default the walking will not stop at the character boundaries, until
     76                 * the end of the range is encountered.
     77                 * @param { CKEDITOR.dom.range } range
     78                 * @param {Boolean} matchWord Whether the walking will stop at character boundary.
    7979                 */
    8080                var characterWalker = function( range , matchWord )
    8181                {
     
    193193                                range.setEnd( last.textNode, last.offset + 1 );
    194194                                return range;
    195195                        },
    196 
     196                        /**
     197                         * Reflect the latest changes from dom range.
     198                         */
    197199                        updateFromDomRange : function( domRange )
    198200                        {
    199                                 var startNode = domRange.startContainer,
    200                                         startIndex = domRange.startOffset,
    201                                         endNode = domRange.endContainer,
    202                                         endIndex = domRange.endOffset,
    203                                         boundaryNodes = domRange.getBoundaryNodes();
    204 
    205                                 if ( startNode.type != CKEDITOR.NODE_TEXT )
    206                                 {
    207                                         startNode = boundaryNodes.startNode;
    208                                         while ( startNode.type != CKEDITOR.NODE_TEXT )
    209                                                 startNode = startNode.getFirst();
    210                                         startIndex = 0;
    211                                 }
    212 
    213                                 if ( endNode.type != CKEDITOR.NODE_TEXT )
    214                                 {
    215                                         endNode = boundaryNodes.endNode;
    216                                         while ( endNode.type != CKEDITOR.NODE_TEXT )
    217                                                 endNode = endNode.getLast();
    218                                         endIndex = endNode.getLength();
    219                                 }
    220 
    221                                 // If the endNode is an empty text node, our walker would just walk through
    222                                 // it without stopping. So need to backtrack to the nearest non-emtpy text
    223                                 // node.
    224                                 if ( endNode.getLength() < 1 )
    225                                 {
    226                                         while ( ( endNode = endNode.getPreviousSourceNode() )
    227                                                    && !( endNode.type == CKEDITOR.NODE_TEXT
    228                                                                         && endNode.getLength() > 0 ) )
    229                                         { /*jsl:pass*/ }
    230 
    231                                         endIndex = endNode.getLength();
    232                                 }
    233 
    234                                 // Rebuild the character range.
    235201                                var cursor,
    236                                                 walker = new characterWalker(
    237                                                                 getRangeAfterCursor(
    238                                                                                                         ( { textNode: startNode, offset : startIndex } ),
    239                                                                                                         true ) );
     202                                                walker = new characterWalker( domRange );
    240203                                this._.cursors = [];
    241204                                do
    242205                                {
    243206                                        cursor = walker.next();
    244                                         this._.cursors.push( cursor );
     207                                        if ( cursor.character )
     208                                                this._.cursors.push( cursor );
    245209                                }
    246                                 while ( !( cursor.textNode.equals( endNode )
    247                                                          && cursor.offset == endIndex - 1 ) );
     210                                while ( cursor.character );
    248211                                this._.rangeLength = this._.cursors.length;
    249212                        },
    250213
     
    439402                                                this._.state = this._.overlap[ this._.state ];
    440403                                }
    441404
    442                                 return null;
    443405                        },
    444406
    445407                        reset : function()
     
    557519                };
    558520
    559521                /**
    560                  * Get the default cursor which is the start of this document.
    561                  */
    562                 function getDefaultStartCursor()
    563                 {
    564                         return { textNode : editor.document.getBody(), offset: 0 };
    565                 }
    566 
    567                 /**
    568522                 * The range in which find/replace happened, receive from user
    569523                 * selection prior.
    570524                 */
  • _source/plugins/smiley/dialogs/smiley.js

     
    1 /*
     1/*
    22Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
    33For licensing, see LICENSE.html or http://ckeditor.com/license
    44*/
     
    1010                columns = config.smiley_columns,
    1111                i;
    1212
     13        /**
     14         * Simulate "this" of a dialog for non-dialog events.
     15         * @type {CKEDITOR.dialog}
     16         */
     17        var dialog;
     18        var onClick = function( evt )
     19        {
     20                var target = evt.data.getTarget(),
     21                        targetName = target.getName();
     22
     23                if ( targetName == 'td' )
     24                        target = target.getChild( [ 0, 0 ] );
     25                else if ( targetName == 'a' )
     26                        target = target.getChild( 0 );
     27                else if ( targetName != 'img' )
     28                        return;
     29
     30                var src = target.getAttribute( 'cke_src' ),
     31                        title = target.getAttribute( 'title' );
     32
     33                var img = editor.document.createElement( 'img',
     34                        {
     35                                attributes :
     36                                {
     37                                        src : src,
     38                                        _cke_saved_src : src,
     39                                        title : title,
     40                                        alt : title
     41                                }
     42                        });
     43
     44                editor.insertElement( img );
     45
     46                dialog.hide();
     47        }
     48
     49        var onKeydown = CKEDITOR.tools.addFunction( function( ev, element )
     50        {
     51                ev = new CKEDITOR.dom.event( ev );
     52                element = new CKEDITOR.dom.element( element );
     53                var relative, nodeToMove;
     54
     55                var keystroke = ev.getKeystroke();
     56                switch ( keystroke )
     57                {
     58                        // RIGHT-ARROW
     59                        case 39 :
     60                                // relative is TD
     61                                if ( ( relative = element.getParent().getNext() ) )
     62                                {
     63                                        nodeToMove = relative.getChild( 0 );
     64                                        nodeToMove.focus();
     65                                }
     66                                ev.preventDefault();
     67                                break;
     68                        // LEFT-ARROW
     69                        case 37 :
     70                                // relative is TD
     71                                if ( ( relative = element.getParent().getPrevious() ) )
     72                                {
     73                                        nodeToMove = relative.getChild( 0 );
     74                                        nodeToMove.focus();
     75                                }
     76                                ev.preventDefault();
     77                                break;
     78                        // UP-ARROW
     79                        case 38 :
     80                                // relative is TR
     81                                if ( ( relative = element.getParent().getParent().getPrevious() ) )
     82                                {
     83                                        nodeToMove = relative.getChild( [element.getParent().getIndex(), 0] );
     84                                        nodeToMove.focus();
     85                                }
     86                                ev.preventDefault();
     87                                break;
     88                        // DOWN-ARROW
     89                        case 40 :
     90                                // relative is TR
     91                                if ( ( relative = element.getParent().getParent().getNext() ) )
     92                                {
     93                                        nodeToMove = relative.getChild( [element.getParent().getIndex(), 0] );
     94                                        if ( nodeToMove )
     95                                                nodeToMove.focus();
     96                                }
     97                                ev.preventDefault();
     98                                break;
     99                        // ENTER
     100                        // SPACE
     101                        case 13 :
     102                        case 32 :
     103                                onClick( { data: ev } );
     104                                ev.preventDefault();
     105                                break;
     106                        // TAB
     107                        case 9 :
     108                                // relative is TD
     109                                if ( ( relative = element.getParent().getNext() ) )
     110                                {
     111                                        nodeToMove = relative.getChild( 0 );
     112                                        nodeToMove.focus();
     113                                        ev.preventDefault(true);
     114                                }
     115                                // relative is TR
     116                                else if ( ( relative = element.getParent().getParent().getNext() ) )
     117                                {
     118                                        nodeToMove = relative.getChild( [0, 0] );
     119                                        if ( nodeToMove )
     120                                                nodeToMove.focus();
     121                                        ev.preventDefault(true);
     122                                }
     123                                break;
     124                        // SHIFT + TAB
     125                        case CKEDITOR.SHIFT + 9 :
     126                                // relative is TD
     127                                if ( ( relative = element.getParent().getPrevious() ) )
     128                                {
     129                                        nodeToMove = relative.getChild( 0 );
     130                                        nodeToMove.focus();
     131                                        ev.preventDefault(true);
     132                                }
     133                                // relative is TR
     134                                else if ( ( relative = element.getParent().getParent().getPrevious() ) )
     135                                {
     136                                        nodeToMove = relative.getLast().getChild( 0 );
     137                                        nodeToMove.focus();
     138                                        ev.preventDefault(true);
     139                                }
     140                                break;
     141                        default :
     142                                // Do not stop not handled events.
     143                                return;
     144                }
     145        });
     146
    13147        // Build the HTML for the smiley images table.
    14148        var html =
    15149        [
     
    25159
    26160                html.push(
    27161                        '<td class="dark_background hand centered" style="vertical-align: middle;">' +
    28                                 '<img border="0" class="hand" title="', config.smiley_descriptions[i], '"' +
    29                                         ' cke_src="', CKEDITOR.tools.htmlEncode( config.smiley_path + images[ i ] ), '"',
    30                                         ' src="', CKEDITOR.tools.htmlEncode( config.smiley_path + images[ i ] ), '"',
    31                                         // IE BUG: Below is a workaround to an IE image loading bug to ensure the image sizes are correct.
    32                                         ( CKEDITOR.env.ie ? ' onload="this.setAttribute(\'width\', 2); this.removeAttribute(\'width\');" ' : '' ),
    33                                 '>' +
    34                         '</td>' );
     162                                '<a class="cke_smile" tabindex="-1" onkeydown="CKEDITOR.tools.callFunction( ', onKeydown, ', event, this );">',
     163                                        '<img class="hand" title="', config.smiley_descriptions[i], '"' +
     164                                                ' cke_src="', CKEDITOR.tools.htmlEncode( config.smiley_path + images[ i ] ), '"',
     165                                                ' src="', CKEDITOR.tools.htmlEncode( config.smiley_path + images[ i ] ), '"',
     166                                                // IE BUG: Below is a workaround to an IE image loading bug to ensure the image sizes are correct.
     167                                                ( CKEDITOR.env.ie ? ' onload="this.setAttribute(\'width\', 2); this.removeAttribute(\'width\');" ' : '' ),
     168                                        '>' +
     169                                '</a>',
     170                        '</td>' );
    35171
    36172                if ( i % columns == columns - 1 )
    37173                        html.push( '</tr>' );
     
    50186        {
    51187                type : 'html',
    52188                html : html.join( '' ),
    53                 onClick : function( evt )
     189                onLoad : function( event )
    54190                {
    55                         var target = evt.data.getTarget(),
    56                                 targetName = target.getName();
    57 
    58                         if ( targetName == 'td' )
    59                                 target = target.getChild(0);
    60                         else if ( targetName != 'img' )
    61                                 return;
    62 
    63                         var src = target.getAttribute( 'cke_src' ),
    64                                 title = target.getAttribute( 'title' );
    65 
    66                         var img = editor.document.createElement( 'img',
    67                                 {
    68                                         attributes :
    69                                         {
    70                                                 src : src,
    71                                                 _cke_saved_src : src,
    72                                                 title : title,
    73                                                 alt : title
    74                                         }
    75                                 });
    76 
    77                         editor.insertElement( img );
    78 
    79                         this.getDialog().hide();
    80                 },
     191                        dialog = event.sender;
     192                },
     193                focus : function()
     194                {
     195                        var firstSmile = this.getElement().getChild( [0, 0, 0, 0] );
     196                        firstSmile.focus();
     197                },
     198                onClick : onClick,
    81199                style : 'width: 100%; height: 100%; border-collapse: separate;'
    82200        };
    83201
  • _source/plugins/image/dialogs/image.js

     
    9393                        dialog.lockRatio = false;
    9494
    9595                if ( dialog.lockRatio )
    96                         ratioButton.removeClass( 'BtnUnlocked' );
     96                        ratioButton.removeClass( 'cke_btn_unlocked' );
    9797                else
    98                         ratioButton.addClass( 'BtnUnlocked' );
     98                        ratioButton.addClass( 'cke_btn_unlocked' );
    9999
    100100                return dialog.lockRatio;
    101101        };
     
    650650                                                                                                        },
    651651                                                                                                        html : '<div>'+
    652652                                                                                                                '<div title="' + editor.lang.image.lockRatio +
    653                                                                                                                 '" class="BtnLocked" id="btnLockSizes"></div>' +
     653                                                                                                                '" class="cke_btn_locked" id="btnLockSizes"></div>' +
    654654                                                                                                                '<div title="' + editor.lang.image.resetSize +
    655                                                                                                                 '" class="BtnReset" id="btnResetSize"></div>'+
     655                                                                                                                '" class="cke_btn_reset" id="btnResetSize"></div>'+
    656656                                                                                                                '</div>'
    657657                                                                                                }
    658658                                                                                        ]
  • _source/skins/office2003/dialog.css

     
    1 /*
     1/*
    22Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
    33For licensing, see LICENSE.html or http://ckeditor.com/license
    44*/
     
    477477/*
    478478 * Some utility CSS classes for dialog authors.
    479479 */
    480 .cke_skin_office2003 .cke_dialog .dark_background
     480.cke_skin_office2003 .cke_dialog .cke_dark_background
    481481{
    482482        background-color: #eaead1;
    483483}
    484484
    485 .cke_skin_office2003 .cke_dialog .hand
     485.cke_skin_office2003 .cke_dialog .cke_hand
    486486{
    487487        cursor: pointer;
    488488}
    489489
    490 .cke_skin_office2003 .cke_dialog .centered
     490.cke_skin_office2003 .cke_dialog .cke_centered
    491491{
    492492        text-align: center;
    493493}
    494494
    495 .cke_skin_office2003 .cke_dialog .BtnReset
     495.cke_skin_office2003 .cke_dialog .cke_btn_reset
    496496{
    497497        float: right;
    498498        background-position: 0 -32px;
     
    504504        font-size: 1px;
    505505}
    506506
    507 .cke_skin_office2003 .cke_rtl .cke_dialog .BtnReset
     507.cke_skin_office2003 .cke_rtl .cke_dialog .cke_btn_reset
    508508{
    509509        float: left;
    510510}
    511511
    512 .cke_skin_office2003 .cke_dialog .BtnLocked, .BtnUnlocked
     512.cke_skin_office2003 .cke_dialog .cke_btn_locked,
     513.cke_skin_office2003 .cke_dialog .cke_btn_unlocked
    513514{
    514515        float: left;
    515516        background-position: 0 0;
     
    521522        font-size: 1px;
    522523}
    523524
    524 .cke_skin_office2003 .cke_dialog .BtnLocked, .BtnUnlocked
     525.cke_skin_office2003 .cke_dialog .cke_btn_locked,
     526.cke_skin_office2003 .cke_dialog .cke_btn_unlocked
    525527{
    526528        float: right;
    527529}
    528530
    529 .cke_skin_office2003 .cke_dialog .BtnUnlocked
     531.cke_skin_office2003 .cke_dialog .cke_btn_unlocked
    530532{
    531533        background-position: 0 -16px;
    532534        background-image: url(images/mini.gif);
    533535}
    534536
    535 .cke_skin_office2003 .cke_dialog .BtnOver
     537.cke_skin_office2003 .cke_dialog .cke_btn_over
    536538{
    537539        border: outset 1px;
    538540        cursor: pointer;
     
    575577        background-color : white;
    576578}
    577579
    578 .cke_skin_office2003 .cke_dialog .DarkBackground
     580.cke_skin_office2003 .cke_dialog .cke_dark_background
    579581{
    580582        text-align : center;
    581583        background-color: #eaead1;
    582584        font-size : 14px;
    583585}
    584586
    585 .cke_skin_office2003 .cke_dialog .LightBackground
     587.cke_skin_office2003 .cke_dialog .cke_light_background
    586588{
    587589        text-align : center;
    588590        background-color: #ffffbe;
    589591}
    590592
    591 .cke_skin_office2003 .cke_dialog .Hand
     593.cke_skin_office2003 .cke_dialog .cke_hand
    592594{
    593595        cursor: pointer;
    594596        cursor: hand;
    595597}
    596598
    597 .cke_skin_office2003 .disabled
     599.cke_skin_office2003 .cke_disabled
    598600{
    599601        color: #a0a0a0;
    600602}
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy