replace blank identicon with ghosts

This commit is contained in:
Martin Zimmermann 2013-10-09 15:33:31 +02:00
parent e58a16546b
commit 988d2032c5
2 changed files with 10 additions and 3 deletions

View File

@ -11,8 +11,7 @@ define(["behave", "app/text/html", "app/dom", "app/utils", "app/api", "app/marku
var el = $.htmlify(Mark.up(templates["postbox"])); var el = $.htmlify(Mark.up(templates["postbox"]));
// add a blank identicon to not waste CPU cycles // add a default identicon to not waste CPU cycles
// XXX show a space invader instead :>
$(".avatar > canvas", el).replace(lib.identicons.blank(48, 48)); $(".avatar > canvas", el).replace(lib.identicons.blank(48, 48));
// on text area focus, generate identicon from IP address // on text area focus, generate identicon from IP address

View File

@ -108,8 +108,16 @@ define(["q"], function(Q) {
}; };
var generateBlank = function(height, width) { var generateBlank = function(height, width) {
var el = generateIdenticon(null, height, width);
var blank = parseInt([
0, 1, 1, 1, 1,
1, 0, 1, 1, 0,
1, 1, 1, 1, 1, /* purple: */ 0, 1, 0
].join(""), 2).toString(16);
var el = generateIdenticon(blank, height, width);
el.className = "blank"; el.className = "blank";
return el; return el;
}; };