From 5b7ad0f4c97d5f198c905e9d53391bff2ccd83f7 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Mon, 15 Aug 2011 10:09:14 +0800 Subject: [PATCH] Fix IE exceptions from debug code, canvas calls --- web/js/chatballoon.js | 1 - web/js/minecraft.js | 15 ++++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/web/js/chatballoon.js b/web/js/chatballoon.js index 250c27a9..0aec1ba9 100644 --- a/web/js/chatballoon.js +++ b/web/js/chatballoon.js @@ -22,7 +22,6 @@ componentconstructors['chatballoon'] = function(dynmap, configuration) { return; } var popupPosition = dynmap.getProjection().fromLocationToLatLng(player.location); - console.log('popupPosition', popupPosition); var popup = me.chatpopups[message.name]; if (!popup) { me.chatpopups[message.name] = popup = { diff --git a/web/js/minecraft.js b/web/js/minecraft.js index 2cb7608d..6605683e 100644 --- a/web/js/minecraft.js +++ b/web/js/minecraft.js @@ -22,11 +22,16 @@ function createMinecraftHead(player,completed,failed) { var headCanvas = document.createElement('canvas'); headCanvas.width = 8; headCanvas.height = 8; - var headContext = headCanvas.getContext('2d'); - blitImage(headContext, skinImage, 8,8,8,8, 0,0,8,8); - // Turn off accessory face overlay - causes white faces, and very few skins seem to have them anyway - //blitImage(headContext, skinImage, 40,8,8,8, 0,0,8,8); - completed(headCanvas); + if(headCanvas.getContext) { + var headContext = headCanvas.getContext('2d'); + blitImage(headContext, skinImage, 8,8,8,8, 0,0,8,8); + // Turn off accessory face overlay - causes white faces, and very few skins seem to have them anyway + //blitImage(headContext, skinImage, 40,8,8,8, 0,0,8,8); + completed(headCanvas); + } + else { + failed(); + } }; skinImage.onerror = function() { if (skinImage.src == '//www.minecraft.net/img/char.png') {