Browse files

Now working in opera, only safari is ua sniffed as it does not suppor…

…t dynamic favicons
  • Loading branch information...
1 parent 0493d29 commit e78a392393595c3ccfa0a4d712247183d1759a94 @tommoor committed Feb 7, 2012
Showing with 12 additions and 8 deletions.
  1. BIN examples/favicon.ico
  2. +10 −6 examples/index.html
  3. +2 −2 tinycon.js
View
BIN examples/favicon.ico
Binary file not shown.
View
16 examples/index.html
@@ -1,15 +1,19 @@
<html>
<head>
- <link rel="icon" href="/favicon.ico">
+ <link rel="icon" href="favicon.ico">
<title>Tinycon</title>
<script src="../tinycon.js"></script>
<script>
- var count = 0;
-
- setInterval(function(){
- Tinycon.setBubble(++count);
- }, 1000);
+ (function(){
+ var count = 0;
+ setInterval(function(){
+
+ if (++count > 99) count = 0;
+ Tinycon.setBubble(count);
+
+ }, 1000);
+ })();
</script>
</head>
<body>
View
4 tinycon.js
@@ -100,7 +100,7 @@
var drawFavicon = function(num, colour) {
// fallback to updating the browser title if unsupported
- if (!getCanvas().getContext || (!browser.chrome && !browser.mozilla)) {
+ if (!getCanvas().getContext || browser.safari) {
return updateTitle(num);
}
@@ -180,7 +180,7 @@
context.textBaseline = "top";
// unfortunately webkit/mozilla are a pixel different in text positioning
- context.fillText(num, 15, browser.webkit ? 6 : 7);
+ context.fillText(num, 15, browser.mozilla ? 7 : 6);
};
var refreshFavicon = function(){

0 comments on commit e78a392

Please sign in to comment.