|
|
@ -8,6 +8,13 @@ const OpenStreetBrowserLoader = require('./OpenStreetBrowserLoader') |
|
|
|
var content |
|
|
|
|
|
|
|
function addCategoriesShow (repo) { |
|
|
|
let repoId |
|
|
|
let branchId |
|
|
|
|
|
|
|
if (repo) { |
|
|
|
[ repoId, branchId ] = repo.split(/\//) |
|
|
|
} |
|
|
|
|
|
|
|
if (!content) { |
|
|
|
content = document.createElement('div') |
|
|
|
content.id = 'contentAddCategories' |
|
|
@ -45,7 +52,7 @@ function addCategoriesShow (repo) { |
|
|
|
content.appendChild(backLink) |
|
|
|
|
|
|
|
let h = document.createElement('h2') |
|
|
|
h.appendChild(document.createTextNode(repo)) |
|
|
|
h.appendChild(document.createTextNode(repoId)) |
|
|
|
content.appendChild(h) |
|
|
|
|
|
|
|
list = repoData.categories |
|
|
@ -74,6 +81,35 @@ function addCategoriesShow (repo) { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
if ('branches' in repoData) { |
|
|
|
let text = document.createElement('span') |
|
|
|
text.innerHTML = lang('available_branches') + ': ' |
|
|
|
content.appendChild(text) |
|
|
|
|
|
|
|
let branchSelector = document.createElement('select') |
|
|
|
|
|
|
|
branchSelector.onchange = () => { |
|
|
|
let branch = branchSelector.value |
|
|
|
|
|
|
|
addCategoriesShow(repoId + '/' + branch) |
|
|
|
} |
|
|
|
|
|
|
|
Object.keys(repoData.branches).forEach( |
|
|
|
branch => { |
|
|
|
let option = document.createElement('option') |
|
|
|
option.value = branch |
|
|
|
option.appendChild(document.createTextNode(branch)) |
|
|
|
|
|
|
|
if (repoData.branch === branch) { |
|
|
|
option.selected = true |
|
|
|
} |
|
|
|
|
|
|
|
branchSelector.appendChild(option) |
|
|
|
} |
|
|
|
) |
|
|
|
content.appendChild(branchSelector) |
|
|
|
} |
|
|
|
|
|
|
|
var ul = document.createElement('ul') |
|
|
|
|
|
|
|
for (var id in list) { |
|
|
|