Merge pull request #336 from mikeprimm/master

Fix Residence support with new web UI
This commit is contained in:
mikeprimm 2011-07-27 20:44:02 -07:00
commit 1a24217a98
3 changed files with 6 additions and 6 deletions

View File

@ -405,7 +405,6 @@ DynMap.prototype = {
me.servertime = update.servertime; me.servertime = update.servertime;
var newserverday = (me.servertime > 23100 || me.servertime < 12900); var newserverday = (me.servertime > 23100 || me.servertime < 12900);
if(me.serverday != newserverday) { if(me.serverday != newserverday) {
console.log('serverday changed', newserverday)
me.serverday = newserverday; me.serverday = newserverday;
me.updateBackground(); me.updateBackground();

View File

@ -69,6 +69,7 @@ componentconstructors['regions'] = function(dynmap, configuration) {
} }
function createPopupContent(name, region) { function createPopupContent(name, region) {
var members = region.members || {};
return $('<div/>').addClass('regioninfo') return $('<div/>').addClass('regioninfo')
.append($('<span/>').addClass('regionname').text(name)) .append($('<span/>').addClass('regionname').text(name))
.append($('<span/>').addClass('owners') .append($('<span/>').addClass('owners')
@ -76,8 +77,8 @@ componentconstructors['regions'] = function(dynmap, configuration) {
.append(region.owners.groups && $('<span/>').addClass('groupowners').text(region.owners.groups.concat())) .append(region.owners.groups && $('<span/>').addClass('groupowners').text(region.owners.groups.concat()))
) )
.append($('<span/>').addClass('members') .append($('<span/>').addClass('members')
.append(region.members.players && $('<span/>').addClass('playermembers').text(region.members.players.concat())) .append(members.players && $('<span/>').addClass('playermembers').text(members.players.concat()))
.append(region.members.groups && $('<span/>').addClass('groupmembers').text(region.members.groups.concat())) .append(members.groups && $('<span/>').addClass('groupmembers').text(members.groups.concat()))
) )
.append(region.parent && $('<span/>').addClass('regionparent').text(region.parent)) .append(region.parent && $('<span/>').addClass('regionparent').text(region.parent))
.append(region.flags && function() { .append(region.flags && function() {

View File

@ -4,16 +4,16 @@ regionConstructors['Residence'] = function(dynmap, configuration) {
return boxCreator(area.X1, area.X2, area.Y1, area.Y2, area.Z1, area.Z2); return boxCreator(area.X1, area.X2, area.Y1, area.Y2, area.Z1, area.Z2);
} }
$.getJSON('standalone/res_' + worldName + '.json', function(data) { $.getJSON('standalone/res_' + configuration.worldName + '.json', function(data) {
var boxLayers = []; var boxLayers = [];
$.each(data, function(name, residence) { $.each(data, function(name, residence) {
if(worldName == residence.Permissions.World) { if(configuration.worldName == residence.Permissions.World) {
$.each(residence.Areas, function(name, area) { $.each(residence.Areas, function(name, area) {
var boxLayer = configuration.createBoxLayer(area.X1, area.X2, area.Y1, area.Y2, area.Z1, area.Z2); var boxLayer = configuration.createBoxLayer(area.X1, area.X2, area.Y1, area.Y2, area.Z1, area.Z2);
boxLayer.bindPopup(configuration.createPopupContent(name, $.extend(residence, { boxLayer.bindPopup(configuration.createPopupContent(name, $.extend(residence, {
owners: { players: [residence.Permissions.Owner] }, owners: { players: [residence.Permissions.Owner] },
flags: region.Permissions.AreaFlags flags: residence.Permissions.AreaFlags
}))); })));
boxLayers.push(boxLayer); boxLayers.push(boxLayer);