Ticket #3073: 3073_2.patch
File 3073_2.patch, 5.0 KB (added by , 15 years ago) |
---|
-
_source/plugins/richcombo/plugin.js
82 82 render : function( editor, output ) 83 83 { 84 84 var id = 'cke_' + this.id; 85 86 85 var clickFn = CKEDITOR.tools.addFunction( function( $element ) 87 86 { 88 87 var _ = this._; … … 110 109 _.panel.showBlock( this.id, new CKEDITOR.dom.element( $element ).getFirst(), 4 ); 111 110 }, 112 111 this ); 112 113 var instance = { 114 id : id, 115 combo : this, 116 focus : function() 117 { 118 var element = CKEDITOR.document.getById( id ).getChild( 1 ); 119 element.focus(); 120 }, 121 execute : clickFn 122 }; 123 124 var keyDownFn = CKEDITOR.tools.addFunction( function( ev, element ){ 125 126 ev = new CKEDITOR.dom.event( ev ); 127 var keystroke = ev.getKeystroke(); 128 switch ( keystroke ) 129 { 130 case 13 : // ENTER 131 case 32 : // SPACE 132 // Show panel 133 CKEDITOR.tools.callFunction( clickFn, element ); 134 break; 135 default : 136 // Delegate the default behavior to toolbar button key handling. 137 instance.onkey( instance, keystroke ); 138 } 139 140 // Avoid subsequent focus grab on editor document. 141 ev.preventDefault(); 142 }); 113 143 114 144 output.push( 115 145 '<span id=', id, ' class="cke_rcombo' ); … … 118 148 output.push( ' ', this.className); 119 149 120 150 output.push( 121 151 '">' + 122 152 '<span class=cke_label>', this.label, '</span>' + 123 153 '<a hidefocus=true title="', this.title, '" tabindex="-1" href="javascript:void(\'', this.label, '\')"' ); 124 154 … … 140 170 } 141 171 142 172 output.push( 143 // ' onkeydown="return CKEDITOR.ui.button._.keydown(', id, ', event);"' +173 ' onkeydown="CKEDITOR.tools.callFunction( ', keyDownFn, ', event, this );"' + 144 174 ' onmousedown="CKEDITOR.tools.callFunction(', clickFn, ', this);">' + 145 175 '<span id="', id, '_text" class=cke_text> </span>' + 146 176 '<span class=cke_openbutton></span>' + … … 149 179 150 180 if ( this.onRender ) 151 181 this.onRender(); 152 153 return { 154 id : id, 155 combo : this, 156 focus : function() 157 { 158 var element = CKEDITOR.document.getById( id ).getChild( 1 ); 159 element.focus(); 160 }, 161 execute : clickFn 162 }; 182 183 return instance; 163 184 }, 164 185 165 186 createPanel : function() -
_source/plugins/colorbutton/plugin.js
15 15 var saveRanges, 16 16 clickFn; 17 17 18 addButton( 'TextColor', 'fore' );19 addButton( 'BGColor', 'back' );18 addButton( 'TextColor', 'fore', lang.textColorTitle ); 19 addButton( 'BGColor', 'back', lang.bgColorTitle ); 20 20 21 function addButton( name, type )21 function addButton( name, type, title ) 22 22 { 23 23 editor.ui.add( name, CKEDITOR.UI_PANELBUTTON, 24 24 { … … 23 23 editor.ui.add( name, CKEDITOR.UI_PANELBUTTON, 24 24 { 25 25 label : lang.label, 26 title : lang.panelTitle,26 title : title, 27 27 className : 'cke_button_' + name.toLowerCase(), 28 28 29 29 panel : -
_source/plugins/panelbutton/plugin.js
90 90 _.panel.showBlock( this._.id, new CKEDITOR.dom.element( $element ), 4 ); 91 91 }, 92 92 this ); 93 var keyDownFn = CKEDITOR.tools.addFunction( function( ev, element ){ 94 95 ev = new CKEDITOR.dom.event( ev ); 96 var keystroke = ev.getKeystroke(); 97 switch ( keystroke ) 98 { 99 case 13 : // ENTER 100 case 32 : // SPACE 101 // Show panel 102 CKEDITOR.tools.callFunction( clickFn, element ); 103 break; 104 default : 105 // Delegate the default behavior to toolbar button key handling. 106 instance.onkey( instance, keystroke ); 107 } 108 // Avoid subsequent focus grab on editor document. 109 ev.preventDefault(); 110 }); 93 111 94 112 var label = this.label || ''; 95 113 … … 126 144 } 127 145 128 146 output.push( 129 // ' onkeydown="return CKEDITOR.ui.button._.keydown(', index, ', event);"' +147 ' onkeydown="CKEDITOR.tools.callFunction( ', keyDownFn, ', event, this );"' + 130 148 ' onclick="CKEDITOR.tools.callFunction(', clickFn, ', this);">' + 131 149 '<span class="cke_icon"></span>' + 132 150 '<span class="cke_label">', label, '</span>' + -
_source/lang/en.js
535 535 536 536 colorButton : 537 537 { 538 textColorTitle : 'Text Color', 539 bgColorTitle : 'Background Color', 538 540 auto : 'Automatic', 539 541 more : 'More Colors...' 540 542 }