Add version check for javascript files versus plugin version

This commit is contained in:
Mike Primm 2011-09-08 09:44:21 +08:00 committed by mikeprimm
parent 9322c5426d
commit 6181aa8ba9
2 changed files with 8 additions and 0 deletions

View File

@ -21,6 +21,7 @@ public class ClientConfigurationComponent extends Component {
s(t, "webprefix", unescapeString(c.getString("webprefix", "[WEB] ")));
s(t, "defaultzoom", c.getInteger("defaultzoom", 0));
s(t, "sidebaropened", c.getString("sidebaropened", "false"));
s(t, "dynmapversion", plugin.getDescription().getVersion());
DynmapWorld defaultWorld = null;
String defmap = null;

View File

@ -1,6 +1,7 @@
"use strict";
//if (!console) console = { log: function() {} };
var dynmapversion = "0.22"; // This needs to match plugin verison
var componentconstructors = {};
var maptypes = {};
var map = null; // Leaflet assumes top-level 'map'...
@ -287,6 +288,12 @@ DynMap.prototype = {
.hide()
.appendTo(container);
if(dynmapversion != me.options.dynmapversion) {
me.alertbox
.text('Web files are not matched with plugin version: All files need to be same version (' + me.options.dynmapverion + ')')
.show();
}
me.selectMap(me.defaultworld.defaultmap);
var componentstoload = 0;