Ticket #30942: 30942.patch
File 30942.patch, 2.8 KB (added by , 9 years ago) |
---|
-
src/wp-includes/js/quicktags.js
223 223 224 224 if ( tb.addEventListener ) { 225 225 tb.addEventListener( 'click', onclick, false ); 226 226 227 227 if ( wrap ) { 228 228 wrap.addEventListener( 'click', setActiveEditor, false ); 229 229 } … … 265 265 266 266 qt._buttonsInit = function() { 267 267 var t = this, canvas, name, settings, theButtons, html, inst, ed, id, i, use, 268 defaults = ' ,strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,';268 defaults = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close'; 269 269 270 270 for ( inst in t.instances ) { 271 271 if ( '0' === inst ) { … … 280 280 theButtons = {}; 281 281 use = ''; 282 282 283 if ( settings.buttons === 'undefined' ) { 284 settings.buttons = defaults; 285 } 286 283 287 // set buttons 284 288 if ( settings.buttons ) { 285 use = ',' +settings.buttons+',';286 }289 use = ',' + settings.buttons + ','; 290 defaults = ',' + defaults + ','; 287 291 288 for ( i in edButtons ) {289 if ( !edButtons[i] ) {290 continue;291 }292 for ( i in edButtons ) { 293 if ( !edButtons[i] ) { 294 continue; 295 } 292 296 293 id = edButtons[i].id;294 if ( use && defaults.indexOf( ',' + id + ',' ) !== -1 && use.indexOf( ',' + id + ',' ) === -1 ) {295 continue;296 }297 id = edButtons[i].id; 298 if ( use && defaults.indexOf( ',' + id + ',' ) !== -1 && use.indexOf( ',' + id + ',' ) === -1 ) { 299 continue; 300 } 297 301 298 if ( !edButtons[i].instance || edButtons[i].instance === inst ) {299 theButtons[id] = edButtons[i];302 if ( !edButtons[i].instance || edButtons[i].instance === inst ) { 303 theButtons[id] = edButtons[i]; 300 304 301 if ( edButtons[i].html ) { 302 html += edButtons[i].html(name + '_'); 305 if ( edButtons[i].html ) { 306 html += edButtons[i].html(name + '_'); 307 } 303 308 } 304 309 } 305 }306 310 307 if ( use &&use.indexOf(',dfw,') !== -1 ) {308 theButtons.dfw = new qt.DFWButton();309 html += theButtons.dfw.html( name + '_' );310 }311 if ( use.indexOf(',dfw,') !== -1 ) { 312 theButtons.dfw = new qt.DFWButton(); 313 html += theButtons.dfw.html( name + '_' ); 314 } 311 315 312 if ( 'rtl' === document.getElementsByTagName('html')[0].dir ) { 313 theButtons.textdirection = new qt.TextDirectionButton(); 314 html += theButtons.textdirection.html(name + '_'); 316 if ( 'rtl' === document.getElementsByTagName('html')[0].dir ) { 317 theButtons.textdirection = new qt.TextDirectionButton(); 318 html += theButtons.textdirection.html(name + '_'); 319 } 320 321 ed.toolbar.innerHTML = html; 322 } else { 323 ed.toolbar.style.display = 'none'; 315 324 } 316 325 317 ed.toolbar.innerHTML = html;318 326 ed.theButtons = theButtons; 319 327 320 328 if ( typeof jQuery !== 'undefined' ) {