Skip to content

Commit

Permalink
Display ""friendly"" names (mainly aimed for developers) for version/…
Browse files Browse the repository at this point in the history
…version groups that have not defined names.
  • Loading branch information
Matriks404 committed Jan 13, 2024
1 parent c6ec135 commit 88b4ad9
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions site/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ function loadConfig() {
}

function loadVersionGroupList() {

return fetchJSONData('./ids.json')
.then(function (groups) {
versionGroups = groups;
Expand All @@ -58,7 +57,15 @@ function loadVersionGroupList() {
var option = document.createElement('option');
option.setAttribute('value', id);

option.text = versionGroups[id].name;
var name;

if (versionGroups[id].name) {
name = versionGroups[id].name
} else {
name = "UNTITLED GROUP [" + id + "]"
}

option.text = name;

el.add(option);
});
Expand Down Expand Up @@ -86,7 +93,15 @@ function loadVersionList() {
var option = document.createElement('option');
option.setAttribute('value', id);

option.text = versions[id].name;
var name;

if (versions[id].name) {
name = versions[id].name
} else {
name = "UNTITLED VERSION [" + id + "]"
}

option.text = name;

el.add(option);
});
Expand Down

0 comments on commit 88b4ad9

Please sign in to comment.