Browse Source

addCategories: add edit link

master
parent
commit
28db34cf93
  1. 3
      conf.php-dist
  2. 13
      src/addCategories.js

3
conf.php-dist

@ -5,6 +5,9 @@ $config['categoriesDir'] = 'node_modules/openstreetbrowser-categories-main';
// Set to true to reload categories on every page visit.
$config['categoriesAlwaysReload'] = true;
// (optional) URL, which points to the OpenStreetBrowser Editor
#$config['urlCategoriesEditor'] = 'editor/';
// URL of the Overpass API
$config['overpassUrl'] = array(
'//overpass-api.de/api/interpreter',

13
src/addCategories.js

@ -67,7 +67,18 @@ function addCategoriesShow (repo) {
li.appendChild(a)
a.appendChild(document.createTextNode('name' in data ? lang(data.name) : id))
li.appendChild(a)
if (config.urlCategoriesEditor) {
a = document.createElement('a')
if (repo) {
a.href = config.urlCategoriesEditor + '?id=' + repo + '.' + id
} else {
a.href = config.urlCategoriesEditor + '?repo=' + id
}
a.target = '_blank'
a.innerHTML = '<img src="img/edit.png"/>'
li.appendChild(a)
}
ul.appendChild(li)
}

Loading…
Cancel
Save