Browse Source

Append rev of category to URL when loading to force correct version

master
parent
commit
1c6962f593
  1. 10
      index.php
  2. 3
      src/OpenStreetBrowserLoader.js

10
index.php

@ -3,6 +3,16 @@
<?php include "modulekit/loader.php"; /* loads all php-includes */ ?>
<?php call_hooks("init"); /* initialize submodules */ ?>
<?php
if (isset($config['categoriesDir'])) {
if (file_exists("{$config['categoriesDir']}/.git")) {
exec("chdir " . escapeShellArg($config['categoriesDir']) . "; git rev-parse --short HEAD", $x);
$config['categoriesRev'] = $x[0];
}
else {
$config['categoriesRev'] = $modulekit['version'];
}
}
html_export_var(array(
'config' => $config,
));

3
src/OpenStreetBrowserLoader.js

@ -33,8 +33,9 @@ OpenStreetBrowserLoader.prototype.getCategory = function (id, callback) {
var req = new XMLHttpRequest()
req.addEventListener("load", reqListener.bind(this, req))
req.open("GET", config.categoriesDir + '/' + id + ".json")
req.open("GET", config.categoriesDir + '/' + id + ".json?" + config.categoriesRev)
req.send()
}
OpenStreetBrowserLoader.prototype.getCategoryFromData = function (id, data, callback) {

Loading…
Cancel
Save