Add version check for javascript files versus plugin version

This commit is contained in:
Mike Primm 2011-09-07 20:44:21 -05:00
parent 5adbe6bd5e
commit 6de49f89d6
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'...
@ -286,6 +287,12 @@ DynMap.prototype = {
.addClass('alertbox')
.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);