Add support for 'webpage-title' setting, default title to server-name

This commit is contained in:
Mike Primm 2011-11-21 11:36:44 -06:00
parent 4db2d81fc1
commit 7f7b8c7fcb
3 changed files with 10 additions and 0 deletions

View File

@ -24,6 +24,10 @@ public class ClientConfigurationComponent extends Component {
s(t, "sidebaropened", c.getString("sidebaropened", "false"));
s(t, "dynmapversion", plugin.getDescription().getVersion());
s(t, "cyrillic", c.getBoolean("cyrillic-support", false));
String sn = plugin.getServer().getServerName();
if(sn.equals("Unknown Server"))
sn = "Minecraft Dynamic Map";
s(t, "title", c.getString("webpage-title", sn));
DynmapWorld defaultWorld = null;
String defmap = null;

View File

@ -304,6 +304,9 @@ render-triggers:
- pistonmoved
- explosion
# Title for the web page - if not specified, defaults to the server's name (unless it is the default of 'Unknown Server')
#webpage-title: "My Awesome Server Map"
# The path where the tile-files are placed.
tilespath: web/tiles

View File

@ -101,6 +101,9 @@ DynMap.prototype = {
.addClass('map')
.appendTo(container);
if(me.options.title)
document.title = me.options.title;
var urlzoom = me.getIntParameterByName('zoom');
if(urlzoom != null)
me.options.defaultzoom = urlzoom;