From aa92fb91a4bdc78df23054365ade4dc2af435580 Mon Sep 17 00:00:00 2001 From: Vlad Chernushevich Date: Fri, 28 Jun 2013 15:14:41 +0200 Subject: [PATCH] Change favicon format to .ico. Small improvements to the script. --- client/assets/img/favicon.ico | Bin 0 -> 1150 bytes client/assets/img/favicon.png | Bin 1629 -> 0 bytes client/assets/src/index.html.tmpl | 2 +- client/assets/src/views/favicon.js | 23 +++++++++++------------ 4 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 client/assets/img/favicon.ico delete mode 100644 client/assets/img/favicon.png diff --git a/client/assets/img/favicon.ico b/client/assets/img/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..a76262a73d44107053dfdc638a09e899eb307e17 GIT binary patch literal 1150 zcmbtUT}+c_7=4VIU6@Sb#gg4EdZET-S4+$YID;?+>CZ=?D+TeV71}}}@)Jtwp!1)C zP=z@P4*J>BQlQXiMM14ZX^W^>Wq?01BV(dos7uTelQGVo;P+zA8&FE zMfcmU+_E)Y4*MI1M+bihj{oSmGEp)T`T6q~^S}S&wUT|8$GlI7VcKW%C2u?E2yAX` zUx@deLE@z|*mkWGsn3*9rzwuLv2uwcOjemtWYPkcRV;Y8-U8z?U59_NusyKWmFp8 zWR@u*v6+w(5}}$p2i2$>s(}_{4%s1$okb4MlgAp_Jcs#FKdP?#kzVRrFV&tTnV~*G zu;?I^aYWco(w?e>b%WEgepC1eImrUC^}wGL2>akC6O@BRPe>l=6u*5XVuT@y)4j%`k@G&vJX)C-BfyM9q9Z z)E!>m|MCm#NwSowp5&Z~&v|XK-dMJ!sOWNbhxJvqwI}bx|6iinPl+ra@nx`_vFvYf Wu`os$vy9&u3yehuER0zOi2edq@N2sO literal 0 HcmV?d00001 diff --git a/client/assets/img/favicon.png b/client/assets/img/favicon.png deleted file mode 100644 index 4cbbd8cbe50ba60d5a8fb8ef6c79f239da536d84..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1629 zcmaJ>eM}Q)9Ig_eb}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;!P#DN+&BvHr=j%=B-Pu?LWCBH*#73P%8Gt z(-f*Nxa4TdokKTU_msUGDXP8Ho^ydewWy*ZDz9fNGTgYi&F_9=P KiwiIRC - + diff --git a/client/assets/src/views/favicon.js b/client/assets/src/views/favicon.js index f4d5720..bbda5a0 100644 --- a/client/assets/src/views/favicon.js +++ b/client/assets/src/views/favicon.js @@ -34,16 +34,12 @@ _kiwi.view.Favicon = Backbone.View.extend({ _resetHighlights: function () { var that = this; this.highlight_count = 0; - if (this.has_canvas_support) { - this._drawFavicon(function(canvas) { - that._refreshFavicon(canvas.toDataURL()); - }); - } + this._refreshFavicon(this.original_favicon); }, _drawFavicon: function (callback) { var that = this, - context = this._createCanvas().getContext('2d'), + context = this._getCanvas().getContext('2d'), favicon_image = new Image(); // Allow cross origin resource requests @@ -52,6 +48,7 @@ _kiwi.view.Favicon = Backbone.View.extend({ favicon_image.src = this.original_favicon; favicon_image.onload = function() { + context.clearRect(0, 0, canvas.width, canvas.height); // Draw the favicon itself context.drawImage(favicon_image, 0, 0, favicon_image.width, favicon_image.height); callback(canvas); @@ -95,12 +92,14 @@ _kiwi.view.Favicon = Backbone.View.extend({ $('').appendTo($('head')); }, - _createCanvas: function () { - canvas = document.createElement('canvas'); - canvas.width = 16; - canvas.height = 16; - - return canvas; + _getCanvas: function () { + if (!this.canvas) { + canvas = document.createElement('canvas'); + canvas.width = 16; + canvas.height = 16; + this.canvas = canvas; + } + return this.canvas; }, _renderText: function (context, text, x, y, letter_spacing) { -- 2.25.1