Ticket #3113: 3113.patch
File 3113.patch, 12.5 KB (added by , 15 years ago) |
---|
-
_source/plugins/dialog/plugin.js
290 290 target = target.getParent(); 291 291 } 292 292 id = target.$.id.substr( 0, target.$.id.lastIndexOf( '_' ) ); 293 this.selectPage( id );293 this.selectPage( id, true ); 294 294 }, this ); 295 295 296 296 // Insert buttons. … … 424 424 var viewSize = CKEDITOR.document.getWindow().getViewPaneSize(); 425 425 this.move( ( viewSize.width - this._.size.width ) / 2, ( viewSize.height - this._.size.height ) / 2 ); 426 426 427 // Select the first tab by default. 428 this.selectPage( this.definition.contents[0].id ); 427 // Select the startup tab. 428 var startupPage = ( this.definition.startupPage ) ? this.definition.startupPage : this.definition.contents[0].id; 429 this.selectPage( startupPage, false ); 429 430 430 431 // Reset all inputs back to their default value. 431 432 this.reset(); … … 468 469 469 470 // Execute onLoad for the first show. 470 471 this.fireOnce( 'load', {} ); 472 473 // Focus on startup element. 474 var content = this.definition.contents; 475 for ( var i in content ) // Get page index. 476 { 477 if ( content[i].id == startupPage ) 478 { 479 var element = content[i].startupFocus 480 if ( element ) 481 { 482 if ( this._.contents[ startupPage ][ element ] ) 483 this._.contents[ startupPage ][ element ].focus(); 484 else 485 { 486 var contentElement = CKEDITOR.document.getById( element ); 487 if ( contentElement) 488 contentElement.focus(); 489 } 490 } 491 break; 492 } 493 } 494 471 495 this.fire( 'show', {} ); 472 496 473 497 // Save the initial values of the dialog. … … 648 672 * @example 649 673 * dialogObj.selectPage( 'tab_1' ); 650 674 */ 651 selectPage : function( id )675 selectPage : function( id, setStartupFocus ) 652 676 { 653 677 // Hide the non-selected tabs and pages. 654 678 for ( var i in this._.tabs ) … … 665 689 var selected = this._.tabs[id]; 666 690 selected[0].addClass( 'cke_dialog_tab_selected' ); 667 691 selected[1].show(); 668 var me = this; 692 693 if ( setStartupFocus ) 694 { 695 // Focus on startup element. 696 var content = this.definition.contents; 697 for ( var i in content ) // Get page index. 698 { 699 if ( content[i].id == id ) 700 { 701 var element = content[i].startupFocus 702 if ( element ) 703 { 704 if ( this._.contents[ id ][ element ] ) 705 this._.contents[ id ][ element ].getInputElement().focus(); 706 else 707 { 708 var contentElement = CKEDITOR.document.getById( element ); 709 if ( contentElement) 710 contentElement.focus(); 711 } 712 } 713 break; 714 } 715 } 716 } 669 717 }, 670 718 671 719 /** … … 1611 1659 var tabAccessKeyUp = function( dialog, key ) 1612 1660 { 1613 1661 if ( dialog._.accessKeyMap[key] ) 1614 dialog.selectPage( dialog._.accessKeyMap[key] );1662 dialog.selectPage( dialog._.accessKeyMap[key], true ); 1615 1663 }; 1616 1664 1617 1665 var tabAccessKeyDown = function( dialog, key ) … … 1993 2041 1994 2042 tabId = cursor.getAttribute( 'name' ); 1995 2043 1996 this._.dialog.selectPage( tabId );2044 this._.dialog.selectPage( tabId, false ); 1997 2045 return this; 1998 2046 }, 1999 2047 -
_source/plugins/find/dialogs/find.js
557 557 minWidth : 400, 558 558 minHeight : 255, 559 559 buttons : [ CKEDITOR.dialog.cancelButton ], //Cancel button only. 560 startupPage : ( startupPage == 'replace' ) ? 'replace' : 'find', 560 561 contents : [ 561 562 { 562 563 id : 'find', 563 564 label : editor.lang.findAndReplace.find, 564 565 title : editor.lang.findAndReplace.find, 566 startupFocus : 'txtFindFind', 565 567 accessKey : '', 566 568 elements : [ 567 569 { … … 627 629 { 628 630 id : 'replace', 629 631 label : editor.lang.findAndReplace.replace, 632 startupFocus : 'txtFindReplace', 630 633 accessKey : 'M', 631 634 elements : [ 632 635 { … … 754 757 { 755 758 return function( pageId ) 756 759 { 757 originalFunc.call( dialog, pageId );760 originalFunc.call( dialog, pageId, true ); 758 761 759 762 var currPage = dialog._.tabs[ pageId ]; 760 763 var patternFieldInput, patternFieldId, wholeWordChkFieldId; … … 785 788 { 786 789 // Establish initial searching start position. 787 790 finder.startCursor = getStartCursor.call( this ); 788 789 if ( startupPage == 'replace' )790 this.getContentElement( 'replace', 'txtFindReplace' ).focus();791 else792 this.getContentElement( 'find', 'txtFindFind' ).focus();793 791 }, 794 792 onHide : function() 795 793 { -
_source/plugins/flash/dialogs/flash.js
291 291 id : 'info', 292 292 label : editor.lang.common.generalTab, 293 293 accessKey : 'I', 294 startupFocus : 'src', 294 295 elements : 295 296 [ 296 297 { -
_source/plugins/forms/dialogs/button.js
50 50 id : 'info', 51 51 label : editor.lang.button.title, 52 52 title : editor.lang.button.title, 53 startupFocus : 'txtName', 53 54 elements : [ 54 55 { 55 56 id : 'txtName', … … 59 60 setup : function( element ) 60 61 { 61 62 this.setValue( element.getAttribute( 'name' ) ); 62 this.focus();63 63 }, 64 64 commit : function( element ) 65 65 { -
_source/plugins/forms/dialogs/checkbox.js
60 60 setup : function( element ) 61 61 { 62 62 this.setValue( element.getAttribute( 'name' ) ); 63 this.focus();64 63 }, 65 64 commit : function( element ) 66 65 { -
_source/plugins/forms/dialogs/form.js
47 47 id : 'info', 48 48 label : editor.lang.form.title, 49 49 title : editor.lang.form.title, 50 startupFocus : 'txtName', 50 51 elements : [ 51 52 { 52 53 id : 'txtName', … … 57 58 setup : function( element ) 58 59 { 59 60 this.setValue( element.getAttribute( 'name' ) ); 60 this.focus();61 61 }, 62 62 commit : function( element ) 63 63 { -
_source/plugins/forms/dialogs/hiddenfield.js
47 47 id : 'info', 48 48 label : editor.lang.hidden.title, 49 49 title : editor.lang.hidden.title, 50 startupFocus : 'txtName', 50 51 elements : [ 51 52 { 52 53 id : 'txtName', … … 57 58 setup : function( element ) 58 59 { 59 60 this.setValue( element.getAttribute( 'name' ) ); 60 this.focus();61 61 }, 62 62 commit : function( element ) 63 63 { -
_source/plugins/forms/dialogs/radio.js
47 47 id : 'info', 48 48 label : editor.lang.checkboxAndRadio.radioTitle, 49 49 title : editor.lang.checkboxAndRadio.radioTitle, 50 startupFocus : 'txtName', 50 51 elements : [ 51 52 { 52 53 id : 'txtName', … … 57 58 setup : function( element ) 58 59 { 59 60 this.setValue( element.getAttribute( 'name' ) ); 60 this.focus();61 61 }, 62 62 commit : function( element ) 63 63 { -
_source/plugins/forms/dialogs/select.js
173 173 id : 'info', 174 174 label : editor.lang.select.selectInfo, 175 175 title : editor.lang.select.selectInfo, 176 startupFocus : 'txtName', 176 177 accessKey : '', 177 178 elements : [ 178 179 { … … 188 189 setup : function( name, element ) 189 190 { 190 191 if ( name == 'select' ) 191 {192 192 this.setValue( element.getAttribute( 'name' ) ); 193 this.focus();194 }195 193 }, 196 194 commit : function( element ) 197 195 { -
_source/plugins/forms/dialogs/textarea.js
46 46 id : 'info', 47 47 label : editor.lang.textarea.title, 48 48 title : editor.lang.textarea.title, 49 startupFocus : 'txtName', 49 50 elements : [ 50 51 { 51 52 id : 'txtName', … … 56 57 setup : function( element ) 57 58 { 58 59 this.setValue( element.getAttribute( 'name' ) ); 59 this.focus();60 60 }, 61 61 commit : function( element ) 62 62 { -
_source/plugins/forms/dialogs/textfield.js
47 47 id : 'info', 48 48 label : editor.lang.textfield.title, 49 49 title : editor.lang.textfield.title, 50 startupFocus : 'txtName', 50 51 elements : [ 51 52 { 52 53 type : 'hbox', … … 62 63 setup : function( element ) 63 64 { 64 65 this.setValue( element.getAttribute( 'name' ) ); 65 this.focus();66 66 }, 67 67 commit : function( element ) 68 68 { -
_source/plugins/image/dialogs/image.js
366 366 id : 'info', 367 367 label : editor.lang.image.infoTab, 368 368 accessKey : 'I', 369 startupFocus : 'txtUrl', 369 370 elements : 370 371 [ 371 372 { … … 423 424 url = element.getAttribute( 'src' ); 424 425 dialog.dontResetSize = true; 425 426 this.setValue( url ); // And call this.onChange() 426 this.focus();427 427 } 428 428 }, 429 429 commit : function( type, element ) … … 879 879 id : 'Link', 880 880 label : editor.lang.link.title, 881 881 padding : 0, 882 startupFocus : 'txtUrl', 882 883 elements : 883 884 [ 884 885 { -
_source/plugins/link/dialogs/anchor.js
82 82 this.saveSelection(); 83 83 } 84 84 } 85 this.getContentElement( 'info', 'txtName' ).focus();86 85 }, 87 86 contents : [ 88 87 { 89 88 id : 'info', 90 89 label : editor.lang.anchor.title, 91 90 accessKey : 'I', 91 startupFocus : 'txtName', 92 92 elements : 93 93 [ 94 94 { -
_source/plugins/pastetext/dialogs/pastetext.js
19 19 { 20 20 // Reset the textarea value. 21 21 CKEDITOR.document.getById( textareaId ).setValue( '' ); 22 //CKEDITOR.document.getById( textareaId ).focus(); 22 23 }, 23 24 24 25 onOk : function() … … 38 39 [ 39 40 { 40 41 label : editor.lang.common.generalTab, 42 startupFocus : textareaId, 41 43 elements : 42 44 [ 43 45 { -
_source/plugins/table/dialogs/table.js
259 259 id : 'info', 260 260 label : editor.lang.table.title, 261 261 accessKey : 'I', 262 startupFocus : 'txtRows', 262 263 elements : 263 264 [ 264 265 {