diff --git a/web/map.js b/web/map.js index d41bd334..3dd7a659 100644 --- a/web/map.js +++ b/web/map.js @@ -1,15 +1,15 @@ -if (!console) console = { log: function() {} }; +//if (!console) console = { log: function() {} }; function splitArgs(s) { var r = s.split(' '); delete arguments[0]; var obj = {}; var index = 0; - for(var argumentIndex in arguments) { - var argument = arguments[argumentIndex]; + $.each(arguments, function(argumentIndex, argument) { + if (!argumentIndex) return; var value = r[argumentIndex-1]; obj[argument] = value; - } + }); return obj; } @@ -272,17 +272,21 @@ DynMap.prototype = { }; if (mi.type == 'player') { contentfun = function(div, mi) { + var playerImage; $(div) .addClass('Marker') .addClass('playerMarker') + .append(playerImage = $('') + .attr({ src: 'player.png' })) .append($('') .addClass('playerName') - .text(mi.text)); + .text(mi.text)) getMinecraftHead(mi.text, 32, function(head) { $(head) .addClass('playerIcon') .prependTo(div); + playerImage.remove(); }); }; } diff --git a/web/minecraft.js b/web/minecraft.js index 0951be4e..cfb00bbc 100644 --- a/web/minecraft.js +++ b/web/minecraft.js @@ -51,9 +51,9 @@ function getMinecraftHead(player,size,completed) { // Asynchronous if (!head) { playerHeads[player] = { working: true, hooks: [{f:completed,s:size}] }; - console.log('Creating head for ',player,'...'); + //console.log('Creating head for ',player,'...'); createMinecraftHead(player, function(head) { - console.log('Created head for ',player,': ', head); + //console.log('Created head for ',player,': ', head); hooks = playerHeads[player].hooks; playerHeads[player] = head; var i; @@ -62,7 +62,7 @@ function getMinecraftHead(player,size,completed) { } }); } else if (head.working) { - console.log('Other process working on head of ',player,', will add myself to hooks...'); + //console.log('Other process working on head of ',player,', will add myself to hooks...'); head.hooks[head.hooks.length] = {f:completed,s:size}; } else { completed(resizeImage(head,size));