mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-27 20:58:40 +01:00
Fixed small browser incompatibilities
This commit is contained in:
parent
b5deec79be
commit
b22a48d5cb
14
web/map.js
14
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 = $('<img/>')
|
||||
.attr({ src: 'player.png' }))
|
||||
.append($('<span/>')
|
||||
.addClass('playerName')
|
||||
.text(mi.text));
|
||||
.text(mi.text))
|
||||
|
||||
getMinecraftHead(mi.text, 32, function(head) {
|
||||
$(head)
|
||||
.addClass('playerIcon')
|
||||
.prependTo(div);
|
||||
playerImage.remove();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user