Ticket #3079: 3079.patch
File 3079.patch, 4.3 KB (added by , 15 years ago) |
---|
-
_source/lang/en.js
27 27 */ 28 28 dir : 'ltr', 29 29 30 // Toolbar buttons states. 31 stateNormal : '%1', 32 stateOn : '%1 (On)', 33 stateDisabled : '%1 (Disabled)', 34 30 35 // Toolbar buttons without dialogs. 31 36 source : 'Source', 32 37 newPage : 'New Page', -
_source/plugins/button/plugin.js
102 102 var env = CKEDITOR.env; 103 103 104 104 var id = this._.id = 'cke_' + CKEDITOR.tools.getNextNumber(); 105 this._.editor = editor; 105 106 106 107 var instance = 107 108 { … … 148 149 if ( this.className ) 149 150 classes += ' ' + this.className; 150 151 152 var stateText = 'stateNormal'; 153 if ( this._.state == CKEDITOR.TRISTATE_DISABLED ) 154 stateText = 'stateDisabled'; 155 else if ( this._.state == CKEDITOR.TRISTATE_ON ) 156 stateText = 'stateOn'; 157 158 var title = editor.lang[ stateText ].replace( /%1/, this.title ); 159 151 160 output.push( 152 161 '<span class="cke_button">', 153 162 '<a id="', id, '"' + 154 163 ' class="', classes, '" href="javascript:void(\'', ( this.title || '' ).replace( "'", '' ), '\')"' + 155 ' title="', t his.title, '"' +164 ' title="', title, '"' + 156 165 ' tabindex="-1"' + 157 166 ' hidefocus="true"' ); 158 167 … … 199 208 if ( this._.state == state ) 200 209 return; 201 210 202 CKEDITOR.document.getById( this._.id ).setState( state ); 211 // #3079. Change button title. 212 var stateText = 'stateNormal'; 213 if ( state == CKEDITOR.TRISTATE_DISABLED ) 214 stateText = 'stateDisabled'; 215 else if ( state == CKEDITOR.TRISTATE_ON ) 216 stateText = 'stateOn'; 203 217 204 218 this._.state = state; 219 220 var title = this._.editor.lang[ stateText ].replace( /%1/, this.title ), 221 element = CKEDITOR.document.getById( this._.id ); 222 223 if ( !element ) 224 element = this.document.getById( 'cke_' + this.id ); 225 226 element.setState( state ); 227 element.setAttribute( 'title', title ); 228 if ( element.getLast().getName() == 'a' ) // Update link title. 229 element.getLast().setAttribute( 'title', title ); 205 230 } 206 231 }; 207 232 -
_source/plugins/panelbutton/plugin.js
61 61 render : function( editor, output ) 62 62 { 63 63 var id = this._.id = 'cke_' + CKEDITOR.tools.getNextNumber(); 64 this._.editor = editor; 64 65 65 66 var instance = 66 67 { -
_source/plugins/richcombo/plugin.js
69 69 renderHtml : function( editor ) 70 70 { 71 71 var output = []; 72 this._.editor = editor; 72 73 this.render( editor, output ); 73 74 return output.join( '' ); 74 75 }, … … 161 162 if ( this.className ) 162 163 output.push( ' class="', this.className, ' cke_off"'); 163 164 165 var stateText = 'stateNormal'; 166 if ( this._.state == CKEDITOR.TRISTATE_DISABLED ) 167 stateText = 'stateDisabled'; 168 else if ( this._.state == CKEDITOR.TRISTATE_ON ) 169 stateText = 'stateOn'; 170 171 var title = editor.lang[ stateText ].replace( /%1/, this.title ); 172 164 173 output.push( 165 174 '>' + 166 175 '<span class=cke_label>', this.label, '</span>' + 167 '<a hidefocus=true title="', t his.title, '" tabindex="-1" href="javascript:void(\'', this.label, '\')"' );176 '<a hidefocus=true title="', title, '" tabindex="-1" href="javascript:void(\'', this.label, '\')"' ); 168 177 169 178 // Some browsers don't cancel key events in the keydown but in the 170 179 // keypress. … … 195 204 if ( this.onRender ) 196 205 this.onRender(); 197 206 207 this._.editor = editor; 208 198 209 return instance; 199 210 }, 200 211 … … 322 333 this._.list.commit(); 323 334 }, 324 335 325 setState : function( state ) 326 { 327 if ( this._.state == state ) 328 return; 329 330 this.document.getById( 'cke_' + this.id ).setState( state ); 331 332 this._.state = state; 333 } 336 setState : CKEDITOR.ui.button.prototype.setState 334 337 } 335 338 }); 336 339