diff --git a/conf.php-dist b/conf.php-dist index caa529f2..600dd113 100644 --- a/conf.php-dist +++ b/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', diff --git a/src/addCategories.js b/src/addCategories.js index 4998a3b8..aa1fca98 100644 --- a/src/addCategories.js +++ b/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 = '' + li.appendChild(a) + } ul.appendChild(li) }