This commit is contained in:
FrozenCow 2011-02-20 17:46:27 +01:00
commit 618d1b05c9
6 changed files with 19 additions and 56 deletions

View File

@ -38,6 +38,7 @@ web:
# showchat: modal/balloons
showchat: modal
messagettl: 15000
showplayerfacesonmap: true
showplayerfacesinmenu: true
focuschatballoons: false

View File

@ -1,4 +1,4 @@
#chat {
.chat {
position:absolute;
bottom:0px;
left:14px;
@ -20,14 +20,7 @@
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.4);
border-radius: 3px 3px 0px 0px;
}
#chatcursor {
position:absolute;
left:5px;
bottom:5px;
color: white;
padding:0px;
}
#chatinput {
.chatinput {
margin:4px;
width:608px;
height:12px;
@ -36,17 +29,18 @@
color: white;
border: 0px;
background: rgba(0, 0, 0, 0.6);
background: url(chat_cursor.png) rgba(0,0,0,0.6); background-repeat: no-repeat; background-position:left;
outline: none;
}
#messagelist {
.messagelist {
margin:4px 4px 0px 4px;
width:622px;
max-height:198px;
padding:1px;
color: white;
overflow:hidden;
display:none;
}
#messagerow {
.messagerow {
position:relative;
left:0px;
bottom:0px;

View File

@ -24,8 +24,8 @@ MinecraftTimeOfDay.prototype = {
this.elementmoon.addClass('timeofday');
this.elementmoon.addClass('moon');
this.elementmoon.html(" ‏ ");
this.elementsun.css("background-position", (-120) + "px " + (-120) + "px");
this.elementmoon.css("background-position", (-120) + "px " + (-120) + "px");
this.elementsun.css("background-position", (-150) + "px " + (-150) + "px");
this.elementmoon.css("background-position", (-150) + "px " + (-150) + "px");
return element;
},

View File

@ -1,16 +0,0 @@
.clock {
padding-left: 16px;
color: #dede90;
background-repeat: no-repeat;
}
.clock.night { background-image: url(clock_night.png); }
.clock.day { background-image: url(clock_day.png); }
.timeofday { background-repeat: no-repeat; }
.timeofday.sun { background-image: url(sun.png); }
.timeofday.moon { background-image: url(moon.png); }
.compass {
background-repeat: no-repeat;
background-image: url(compass.png);
}

View File

@ -11,7 +11,6 @@
<link rel="shortcut icon" href="follow_off.png" type="image/png" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<link rel="stylesheet" type="text/css" href="dynmap_style.css" media="screen" />
<link rel="stylesheet" type="text/css" href="clock_style.css" media="screen" />
<link rel="stylesheet" type="text/css" href="chat_style.css" media="screen" />
<script type="text/javascript" src="jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="jquery.json.js"></script>

View File

@ -31,20 +31,6 @@ DynMapType.prototype = {
updateTileSize: function(zoom) {}
};
function MinecraftCompass(element) { this.element = element; }
MinecraftCompass.prototype = {
element: null,
create: function(element) {
if (!element) element = $('<div/>');
this.element = element;
return element;
},
initialize: function() {
this.element.html("&nbsp;&rlm;&nbsp;");
this.element.height(120);
}
};
function DynMap(options) {
var me = this;
me.options = options;
@ -195,21 +181,17 @@ DynMap.prototype = {
.appendTo(panel);
// The Compass
var compass = me.compass = new MinecraftCompass(
$('<div/>')
var compass = $('<div/>')
.addClass('compass')
.appendTo(container)
);
// The chat
if (me.options.showchat == 'modal') {
var chat = me.chat = $('<div/>')
.addClass('chat')
.attr({ id: 'chat' })
.appendTo(container);
var messagelist = me.messagelist = $('<div/>')
.addClass('messagelist')
.attr({ id: 'messagelist' })
.appendTo(chat);
var chatinput = me.chatinput = $('<input/>')
.addClass('chatinput')
@ -226,10 +208,6 @@ DynMap.prototype = {
}
})
.appendTo(chat);
var chatcursor = me.chatcursor = $('<span/>')
.attr({ id: 'chatcursor'})
.text('>_')
.appendTo(chat);
}
// TODO: Enable hash-links.
@ -313,6 +291,10 @@ DynMap.prototype = {
}, function(type) {
console.log('Unknown type ', value, '!');
});
/* remove older messages from chat*/
//var timestamp = event.timeStamp;
//var divs = $('div[rel]');
//divs.filter(function(i){return parseInt(divs[i].attr('rel')) > timestamp+me.options.messagettl;}).remove();
});
for(var m in me.markers) {
@ -412,9 +394,11 @@ DynMap.prototype = {
} else if (me.options.showchat == 'modal') {
var me = this;
var messagelist = me.messagelist;
var timestamp = event.timeStamp;
var messageRow = $('<div/>')
.addClass('messagerow')
.attr({ "rel": timestamp})
var playerIconContainer = $('<span/>')
.addClass('messageicon')
@ -447,6 +431,7 @@ DynMap.prototype = {
messageRow.append(playerIconContainer,playerNameContainer,playerMessageContainer);
//messageRow.append(playerIconContainer,playerWorldContainer,playerGroupContainer,playerNameContainer,playerMessageContainer);
setTimeout(function() { messageRow.remove(); }, me.options.messagettl);
messagelist.append(messageRow);
me.messagelist.show();