discourse/discourse — pull request #1348 by chrishunt (2013-08-17 01:52:10+00:00)
Title: Re-write dynamic favicon javascript

Two things:
- [x] Fixes [meta/9037](http://meta.discourse.org/t/favicon-message-notifications-dont-work-with-custom-favicon/9037)
- [x] Add 16px + 32px (retina) default `ico` files

The dynamic favicon setting currently does not work for any favicon that is not 16px because the canvas that we drawn onto is [statically set to 16 pixels](https://github.com/discourse/discourse/blob/baff59d752ffcb4ab874e792ccb0ec8ae7e97105/app/assets/javascripts/external/jquery.faviconNotify.js#L34). If we try to use an icon larger than 16 pixels, the icon is drawn onto a 16px canvas anyway... so we just see the top-left corner of the image. :grin:

Rather than fix the existing (overly complex) dynamic favicon stuff, I re-wrote it. It's way easier to understand now. I kept the same API so Discourse is none the wiser.

In additional to working with *any size favicon* (tested with a 16, 32, 64 `ico`), the numbers are now much easier to read.

:sparkles: **Behold!** :sparkles:

![before-after](https://f.cloud.github.com/assets/65323/979137/324001a8-06df-11e3-8336-6505cd6877f2.png)