TinyMCE: attempt a workaround for WebKit bug inserting spans with font styles when creating UL or OL. See #17154

git-svn-id: http://core.svn.wordpress.org/trunk@24211 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2013-05-08 23:03:44 +00:00
parent 526ecaf50a
commit 72478e1bce
2 changed files with 13 additions and 11 deletions

View File

@ -7,7 +7,7 @@
tinymce.create('tinymce.plugins.WordPress', {
init : function(ed, url) {
var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML, closeOnClick, mod_key;
var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML, closeOnClick, mod_key, style;
moreHTML = '<img src="' + url + '/img/trans.gif" class="mceWPmore mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
@ -133,6 +133,18 @@
}
}
}
if ( tinymce.isWebKit && ( 'InsertUnorderedList' == cmd || 'InsertOrderedList' == cmd ) ) {
if ( !style )
style = ed.dom.create('style', {'type': 'text/css'}, '#tinymce,#tinymce span,#tinymce li,#tinymce li>span,#tinymce p,#tinymce p>span{font:medium sans-serif;color:#000;line-height:normal;}');
ed.getDoc().head.appendChild( style );
}
});
ed.onExecCommand.add( function( ed, cmd, ui, val ) {
if ( tinymce.isWebKit && style && ( 'InsertUnorderedList' == cmd || 'InsertOrderedList' == cmd ) )
ed.dom.remove( style );
});
ed.onInit.add(function(ed) {

View File

@ -45,16 +45,6 @@ body {
margin: 10px;
}
br[data-mce-bogus] {
line-height: 1em;
margin-top: -1em;
}
br[data-mce-bogus]:only-child {
line-height: inherit;
margin-top: inherit;
}
.aligncenter,
dl.aligncenter {
display: block;