Ticket #3512: 3512.patch
File 3512.patch, 17.7 KB (added by , 15 years ago) |
---|
-
_source/skins/v2/dialog.css
1 /*1 /* 2 2 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. 3 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 4 */ … … 476 476 /* 477 477 * Some utility CSS classes for dialog authors. 478 478 */ 479 .cke_skin_v2 .cke_dialog . dark_background479 .cke_skin_v2 .cke_dialog .cke_dark_background 480 480 { 481 481 background-color: #eaead1; 482 482 } 483 483 484 .cke_skin_v2 .cke_dialog . hand484 .cke_skin_v2 .cke_dialog .cke_hand 485 485 { 486 486 cursor: pointer; 487 487 } 488 488 489 .cke_skin_v2 .cke_dialog .c entered489 .cke_skin_v2 .cke_dialog .cke_centered 490 490 { 491 491 text-align: center; 492 492 } 493 493 494 .cke_skin_v2 .cke_dialog . BtnReset494 .cke_skin_v2 .cke_dialog .cke_btn_reset 495 495 { 496 496 float: right; 497 497 background-position: 0 -32px; … … 503 503 font-size: 1px; 504 504 } 505 505 506 .cke_skin_v2 .cke_rtl .cke_dialog . BtnReset506 .cke_skin_v2 .cke_rtl .cke_dialog .cke_btn_reset 507 507 { 508 508 float: left; 509 509 } 510 510 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 512 513 { 513 514 float: left; 514 515 background-position: 0 0; … … 520 521 font-size: 1px; 521 522 } 522 523 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 524 526 { 525 527 float: right; 526 528 } 527 529 528 .cke_skin_v2 .cke_dialog . BtnUnlocked530 .cke_skin_v2 .cke_dialog .cke_btn_unlocked 529 531 { 530 532 background-position: 0 -16px; 531 533 background-image: url(images/mini.gif); 532 534 } 533 535 534 .cke_skin_v2 .cke_dialog . BtnOver536 .cke_skin_v2 .cke_dialog .cke_btn_over 535 537 { 536 538 border: outset 1px; 537 539 cursor: pointer; … … 574 576 background-color : white; 575 577 } 576 578 577 .cke_skin_v2 .cke_dialog . DarkBackground579 .cke_skin_v2 .cke_dialog .cke_dark_background 578 580 { 579 581 text-align : center; 580 582 background-color: #eaead1; 581 583 font-size : 14px; 582 584 } 583 585 584 .cke_skin_v2 .cke_dialog . LightBackground586 .cke_skin_v2 .cke_dialog .cke_light_background 585 587 { 586 588 text-align : center; 587 589 background-color: #ffffbe; 588 590 } 589 591 590 .cke_skin_v2 .cke_dialog . Hand592 .cke_skin_v2 .cke_dialog .cke_hand 591 593 { 592 594 cursor: pointer; 593 595 cursor: hand; 594 596 } 595 597 596 .cke_skin_v2 . disabled598 .cke_skin_v2 .cke_disabled 597 599 { 598 600 color: #a0a0a0; 599 601 } -
_source/plugins/specialchar/dialogs/specialchar.js
62 62 '<td width="1%"' + 63 63 ' title="', chars[i].replace( /&/g, '&' ), '"' + 64 64 ' value="', chars[i].replace( /&/g, "&" ), '"' + 65 ' class=" DarkBackground Hand">');65 ' class="cke_dark_background cke_hand">'); 66 66 html.push( chars[i] ); 67 67 } 68 68 else 69 html.push( '<td class=" DarkBackground"> ' );69 html.push( '<td class="cke_dark_background"> ' ); 70 70 71 71 html.push( '</td>' ); 72 72 } … … 106 106 107 107 dialog.getContentElement( 'info', 'charPreview' ).getElement().setHtml( value ); 108 108 htmlPreview.setHtml( CKEDITOR.tools.htmlEncode( value ) ); 109 target.addClass( " LightBackground" );109 target.addClass( "cke_light_background" ); 110 110 } 111 111 }, 112 112 onMouseout : function( evt ) … … 117 117 var dialog = this.getDialog(); 118 118 dialog.getContentElement( 'info', 'charPreview' ).getElement().setHtml( ' ' ); 119 119 dialog.getContentElement( 'info', 'htmlPreview' ).getElement().setHtml( ' ' ); 120 target.removeClass( " LightBackground" );120 target.removeClass( "cke_light_background" ); 121 121 } 122 122 }, 123 123 onClick : function( evt ) … … 127 127 if ( target.getName() == 'td' && ( value = target.$.getAttribute( 'value' )) ) 128 128 { 129 129 var dialog = this.getDialog(); 130 target.removeClass( " LightBackground" );130 target.removeClass( "cke_light_background" ); 131 131 dialog.getParentEditor().insertHtml( value ); 132 132 dialog.hide(); 133 133 } -
_source/plugins/find/dialogs/find.js
26 26 */ 27 27 var cursorStep = function() 28 28 { 29 var obj ={29 return { 30 30 textNode : this.textNode, 31 31 offset : this.offset, 32 32 character : this.textNode ? 33 33 this.textNode.getText().charAt( this.offset ) : null, 34 34 hitMatchBoundary : this._.matchBoundary 35 35 }; 36 return obj;37 36 }; 38 37 39 38 var pages = [ 'find', 'replace' ], … … 72 71 var highlightStyle = new CKEDITOR.style( editor.config.find_highlight ); 73 72 74 73 /** 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. 79 79 */ 80 80 var characterWalker = function( range , matchWord ) 81 81 { … … 193 193 range.setEnd( last.textNode, last.offset + 1 ); 194 194 return range; 195 195 }, 196 196 /** 197 * Reflect the latest changes from dom range. 198 */ 197 199 updateFromDomRange : function( domRange ) 198 200 { 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 through222 // it without stopping. So need to backtrack to the nearest non-emtpy text223 // node.224 if ( endNode.getLength() < 1 )225 {226 while ( ( endNode = endNode.getPreviousSourceNode() )227 && !( endNode.type == CKEDITOR.NODE_TEXT228 && endNode.getLength() > 0 ) )229 { /*jsl:pass*/ }230 231 endIndex = endNode.getLength();232 }233 234 // Rebuild the character range.235 201 var cursor, 236 walker = new characterWalker( 237 getRangeAfterCursor( 238 ( { textNode: startNode, offset : startIndex } ), 239 true ) ); 202 walker = new characterWalker( domRange ); 240 203 this._.cursors = []; 241 204 do 242 205 { 243 206 cursor = walker.next(); 244 this._.cursors.push( cursor ); 207 if ( cursor.character ) 208 this._.cursors.push( cursor ); 245 209 } 246 while ( !( cursor.textNode.equals( endNode ) 247 && cursor.offset == endIndex - 1 ) ); 210 while ( cursor.character ); 248 211 this._.rangeLength = this._.cursors.length; 249 212 }, 250 213 … … 439 402 this._.state = this._.overlap[ this._.state ]; 440 403 } 441 404 442 return null;443 405 }, 444 406 445 407 reset : function() … … 557 519 }; 558 520 559 521 /** 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 /**568 522 * The range in which find/replace happened, receive from user 569 523 * selection prior. 570 524 */ -
_source/plugins/smiley/dialogs/smiley.js
1 /*1 /* 2 2 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. 3 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 4 */ … … 10 10 columns = config.smiley_columns, 11 11 i; 12 12 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 13 147 // Build the HTML for the smiley images table. 14 148 var html = 15 149 [ … … 25 159 26 160 html.push( 27 161 '<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>' ); 35 171 36 172 if ( i % columns == columns - 1 ) 37 173 html.push( '</tr>' ); … … 50 186 { 51 187 type : 'html', 52 188 html : html.join( '' ), 53 on Click : function( evt )189 onLoad : function( event ) 54 190 { 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, 81 199 style : 'width: 100%; height: 100%; border-collapse: separate;' 82 200 }; 83 201 -
_source/plugins/image/dialogs/image.js
93 93 dialog.lockRatio = false; 94 94 95 95 if ( dialog.lockRatio ) 96 ratioButton.removeClass( ' BtnUnlocked' );96 ratioButton.removeClass( 'cke_btn_unlocked' ); 97 97 else 98 ratioButton.addClass( ' BtnUnlocked' );98 ratioButton.addClass( 'cke_btn_unlocked' ); 99 99 100 100 return dialog.lockRatio; 101 101 }; … … 650 650 }, 651 651 html : '<div>'+ 652 652 '<div title="' + editor.lang.image.lockRatio + 653 '" class=" BtnLocked" id="btnLockSizes"></div>' +653 '" class="cke_btn_locked" id="btnLockSizes"></div>' + 654 654 '<div title="' + editor.lang.image.resetSize + 655 '" class=" BtnReset" id="btnResetSize"></div>'+655 '" class="cke_btn_reset" id="btnResetSize"></div>'+ 656 656 '</div>' 657 657 } 658 658 ] -
_source/skins/office2003/dialog.css
1 /*1 /* 2 2 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. 3 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 4 */ … … 477 477 /* 478 478 * Some utility CSS classes for dialog authors. 479 479 */ 480 .cke_skin_office2003 .cke_dialog . dark_background480 .cke_skin_office2003 .cke_dialog .cke_dark_background 481 481 { 482 482 background-color: #eaead1; 483 483 } 484 484 485 .cke_skin_office2003 .cke_dialog . hand485 .cke_skin_office2003 .cke_dialog .cke_hand 486 486 { 487 487 cursor: pointer; 488 488 } 489 489 490 .cke_skin_office2003 .cke_dialog .c entered490 .cke_skin_office2003 .cke_dialog .cke_centered 491 491 { 492 492 text-align: center; 493 493 } 494 494 495 .cke_skin_office2003 .cke_dialog . BtnReset495 .cke_skin_office2003 .cke_dialog .cke_btn_reset 496 496 { 497 497 float: right; 498 498 background-position: 0 -32px; … … 504 504 font-size: 1px; 505 505 } 506 506 507 .cke_skin_office2003 .cke_rtl .cke_dialog . BtnReset507 .cke_skin_office2003 .cke_rtl .cke_dialog .cke_btn_reset 508 508 { 509 509 float: left; 510 510 } 511 511 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 513 514 { 514 515 float: left; 515 516 background-position: 0 0; … … 521 522 font-size: 1px; 522 523 } 523 524 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 525 527 { 526 528 float: right; 527 529 } 528 530 529 .cke_skin_office2003 .cke_dialog . BtnUnlocked531 .cke_skin_office2003 .cke_dialog .cke_btn_unlocked 530 532 { 531 533 background-position: 0 -16px; 532 534 background-image: url(images/mini.gif); 533 535 } 534 536 535 .cke_skin_office2003 .cke_dialog . BtnOver537 .cke_skin_office2003 .cke_dialog .cke_btn_over 536 538 { 537 539 border: outset 1px; 538 540 cursor: pointer; … … 575 577 background-color : white; 576 578 } 577 579 578 .cke_skin_office2003 .cke_dialog . DarkBackground580 .cke_skin_office2003 .cke_dialog .cke_dark_background 579 581 { 580 582 text-align : center; 581 583 background-color: #eaead1; 582 584 font-size : 14px; 583 585 } 584 586 585 .cke_skin_office2003 .cke_dialog . LightBackground587 .cke_skin_office2003 .cke_dialog .cke_light_background 586 588 { 587 589 text-align : center; 588 590 background-color: #ffffbe; 589 591 } 590 592 591 .cke_skin_office2003 .cke_dialog . Hand593 .cke_skin_office2003 .cke_dialog .cke_hand 592 594 { 593 595 cursor: pointer; 594 596 cursor: hand; 595 597 } 596 598 597 .cke_skin_office2003 . disabled599 .cke_skin_office2003 .cke_disabled 598 600 { 599 601 color: #a0a0a0; 600 602 }