From e6546927c864d955eae218bb7376dbfd67e7a334 Mon Sep 17 00:00:00 2001 From: codedust <codedust@users.noreply.github.com> Date: Fri, 31 Mar 2017 17:10:20 +0200 Subject: [PATCH] Add optional link to CHANGELOG in config.js Closes #17 --- app.js | 13 ++++++++++++- config_template.js | 5 ++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index a5420b3..9bb1d85 100644 --- a/app.js +++ b/app.js @@ -859,11 +859,22 @@ var firmwarewizard = function() { var branches = ObjectValues(config.directories) .filter(function(value, index, self) { return self.indexOf(value) === index; }); - $('#currentVersions').innerHTML = branches.reduce(function(ret, branch, i) { + $('#currentVersions').innerText = ''; + if (config.changelog !== undefined) { + var a = document.createElement('a'); + a.href = config.changelog; + a.innerText = 'CHANGELOG'; + $('#currentVersions').appendChild(a); + var text = document.createTextNode(' // '); + $('#currentVersions').appendChild(text); + } + + var versionStr = branches.reduce(function(ret, branch, i) { ret += ((i === 0) ? '' : ' // ') + branch; ret += (branch in app.currentVersions) ? (': ' + prettyPrintVersion(app.currentVersions[branch])) : ''; return ret; }, ''); + $('#currentVersions').appendChild(document.createTextNode(versionStr)); } updateCurrentVersions(); } diff --git a/config_template.js b/config_template.js index 2398022..01f2360 100644 --- a/config_template.js +++ b/config_template.js @@ -28,5 +28,8 @@ var config = { './images/gluon-factory-example.html': 'stable', './images/gluon-sysupgrade-example.html': 'stable' }, - preview_pictures: 'pictures/' + // path to preview pictures directory + preview_pictures: 'pictures/', + // link to changelog + changelog: 'CHANGELOG.html' }; -- GitLab