Removed Clock

This commit is contained in:
lishid 2011-02-13 14:48:02 -05:00 committed by FrozenCow
parent 34e972eefb
commit b506e6856a
4 changed files with 0 additions and 49 deletions

View file

@ -28,47 +28,6 @@ DynMapType.prototype = {
}
};
function MinecraftClock(element) { this.element = element; }
MinecraftClock.prototype = {
element: null,
timeout: null,
time: null,
create: function(element) {
if (!element) element = $('<div/>');
this.element = element;
return element;
},
setTime: function(time) {
if (this.timeout != null) {
window.clearTimeout(this.timeout);
this.timeout = null;
}
this.time = time;
this.element
.addClass((time.day <= 4) ? 'day' : 'night')
.removeClass((time.day <= 4) ? 'day' : 'night')
.text(this.formatTime(time));
if (this.timeout == null) {
var me = this;
this.timeout = window.setTimeout(function() {
me.timeout = null;
me.setTime(getMinecraftTime(me.time.servertime+(1000/60)));
}, 700);
}
},
formatTime: function(time) {
var formatDigits = function(n, digits) {
var s = n.toString();
while (s.length < digits) {
s = '0' + s;
}
return s;
}
return formatDigits(time.hours, 2) + ':' + formatDigits(time.minutes, 2);
}
};
function MinecraftTimeOfDay(element) { this.element = element; }
MinecraftTimeOfDay.prototype = {
element: null,