Skip to content

Commit

Permalink
Version only lives in package.json
Browse files Browse the repository at this point in the history
Now all the places that use the version (filenames, link at the bottom
of the page) come from the package.json "source" attribute.
  • Loading branch information
ptgolden committed Apr 16, 2015
1 parent 8c9e9ec commit 83d43af
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
8 changes: 1 addition & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,7 @@
</div>
<div id="footer">
<div class="container">
<div id="version-number">
PeriodO client
<a href="https://github.com/periodo/periodo-client/tree/v0.4.0">
v0.4.0
</a>
&ndash; 13 April 2015
</div>
<div id="version-number"></div>
</div>
</div>
</body>
Expand Down
12 changes: 12 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,19 @@ function refreshBackend(backend) {
$('#periodo-logo').attr('href', '#p/' + backend.name + '/');
}

function initVersion() {
var version = require('../package.json').version;
version = 'v' + version;
$('#version-number').html(`
PeriodO client
<a href="https://github.com/periodo/periodo-client/tree/${version}">
${version}
</a>
`);
}

$(document).ready(function () {
initVersion();
var router = Backbone._app = new ApplicationRouter();
var spinner = new Spinner({
lines: 12,
Expand Down

0 comments on commit 83d43af

Please sign in to comment.