[wp-trac] Re: [WordPress Trac] #7311: Custom Admin CSS not applied
to WP2.6 Edit Image page (TinyMCE plugin wpeditimage/editimage.html)
WordPress Trac
wp-trac at lists.automattic.com
Wed Jul 16 16:00:03 GMT 2008
#7311: Custom Admin CSS not applied to WP2.6 Edit Image page (TinyMCE plugin
wpeditimage/editimage.html)
--------------------------+-------------------------------------------------
Reporter: caesarsgrunt | Owner: azaozz
Type: defect | Status: new
Priority: normal | Milestone: 2.6.1
Component: TinyMCE | Version: 2.6
Severity: normal | Resolution:
Keywords: wpeditimage |
--------------------------+-------------------------------------------------
Comment (by caesarsgrunt):
OK; I've found the problem.
Here's the function which detects the styleheet used by the parent (lines
76-84 of /wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js) :
{{{
// import colors stylesheet from parent
var win = tinyMCEPopup.getWin();
var styles = win.document.styleSheets;
for ( i = 0; i < styles.length; i++ ) {
var url = styles.item(i).href;
if ( url && url.indexOf('colors-') != -1 )
document.write( '<link rel="stylesheet" href="'+url+'"
type="text/css" media="all" />' );
}
}}}
The problem is line 82 :
{{{
if ( url && url.indexOf('colors-') != -1 )
}}}
Neither of the admin stylesheets I tried has 'colours-' in the name... so
they weren't being detected.
Is there any need for the hyphen? Removing it would increase compatibility
greatly... I removed in on my test server and it worked perfectly.
For the moment I'll rename my custom CSS file from 'admin-colours.css' to
something with a hyphen after 'colours'.
--
Ticket URL: <http://trac.wordpress.org/ticket/7311#comment:5>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list