Add support for 'webpage-title' setting, default title to server-name
This commit is contained in:
parent
ab521a6346
commit
b1b8a60065
3 changed files with 10 additions and 0 deletions
|
|
@ -24,6 +24,10 @@ public class ClientConfigurationComponent extends Component {
|
||||||
s(t, "sidebaropened", c.getString("sidebaropened", "false"));
|
s(t, "sidebaropened", c.getString("sidebaropened", "false"));
|
||||||
s(t, "dynmapversion", plugin.getDescription().getVersion());
|
s(t, "dynmapversion", plugin.getDescription().getVersion());
|
||||||
s(t, "cyrillic", c.getBoolean("cyrillic-support", false));
|
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;
|
DynmapWorld defaultWorld = null;
|
||||||
String defmap = null;
|
String defmap = null;
|
||||||
|
|
|
||||||
|
|
@ -304,6 +304,9 @@ render-triggers:
|
||||||
- pistonmoved
|
- pistonmoved
|
||||||
- explosion
|
- 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.
|
# The path where the tile-files are placed.
|
||||||
tilespath: web/tiles
|
tilespath: web/tiles
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,9 @@ DynMap.prototype = {
|
||||||
.addClass('map')
|
.addClass('map')
|
||||||
.appendTo(container);
|
.appendTo(container);
|
||||||
|
|
||||||
|
if(me.options.title)
|
||||||
|
document.title = me.options.title;
|
||||||
|
|
||||||
var urlzoom = me.getIntParameterByName('zoom');
|
var urlzoom = me.getIntParameterByName('zoom');
|
||||||
if(urlzoom != null)
|
if(urlzoom != null)
|
||||||
me.options.defaultzoom = urlzoom;
|
me.options.defaultzoom = urlzoom;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue