Hi Chris,
Thanks for notifying us of this problem! Wes is right - we have a list of extensions on our server side for which we have images. We assign each <img> element a class, e.g. EDocPDF, which has a background-image specified in WebLinkStyles.css. If we don't have an icon for the extension, we give it the EDocGeneric class, which points to a generic edoc icon.
We've filed this as a bug (SCR 131734). In the future we'll generate a class for any extension, even if we don't recognize it, and then users will be able to go into the CSS (as Brian showed) to customize the icons with the class EDoc[ArbitraryExtension].
For now, here's a hacky JavaScript solution adapted from Devin's reply here that will be helpful if you expect the documents to have the extensions in their names. Suppose you want to assign a custom image to extension EXT. Add the following to your Browse.aspx page inside of the <body>:
<script type="text/javascript">
$(function() {
$('a.DocumentBrowserNameLink').each(function (index, value) {
var re = new RegExp('.ext')
if (re.test(value.textContent.toLowerCase())) {
var imgEl = $(value).children('nobr').children('img');
imgEl.attr('class', 'ElectronicFileIcon DocumentBrowserNameImage');
imgEl.attr('src', 'images/spacer.gif');
imgEl.css('background-image', 'url("path/to/image")');
}
});
});
</script>
That just checks whether a file name contains ".EXT" and replaces the icon if so. It isn't a perfect solution, but it may work for your purposes! Keep in mind that this (1) will fail to replace icons for items with the actual extension EXT if the extension isn't in the file name, and (2) will replace icons for items that contain .EXT in their names, even if those items have a different extension (or no extension).