Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.pyc
*.log
/index.html
/service-worker.js
/js/version.json
cache.manifest
tiles/
2 changes: 1 addition & 1 deletion DEVELOPER_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ To get a copy of the code and run a test web server:

1. [Fork the repository](https://github.com/projecthorus/sondehub-tracker/fork) by visiting [https://github.com/projecthorus/sondehub-tracker/fork](https://github.com/projecthorus/sondehub-tracker/fork).
2. Clone the repository with your git tool of choice.
3. Run `build.sh` to generate `index.html` and `js/version.json`.
3. Run `build.sh` to generate `index.html`, `service-worker.js`, and `js/version.json`.
4. Run `python serve.py` to run a simple web server to (This requires python 3.x)
5. Visit [http://localhost:8000](http://localhost:8000) to view the local version of the server!
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ echo -n "Generating index.html... "
sed -e "s/{VER}/$VERSION/" -e "s/{BUILD_DATE}/$BUILD_DATE/" index.template.html > index.html
echo "Done!"

echo -n "Generating service-worker.js... "
sed -e "s/{VER}/$VERSION/" service-worker.template.js > service-worker.js
echo "Done!"

echo "Build version: $VERSION Build date: $BUILD_DATE"
6 changes: 3 additions & 3 deletions index.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<script type="text/javascript" language="javascript" src="js/pwa.js?v={VER}"></script>

</head>
<body data-version="{VER}" data-build-date="{BUILD_DATE}">
<body data-version="{VER}">

<div id="loading">
<div>
Expand Down Expand Up @@ -150,9 +150,9 @@ <h4>Contribute</h4>
<a href="https://github.com/projecthorus/sondehub-tracker" target="_blank" rel="noopener">github/sondehub-tracker</a>.
Bug reports, suggestions and pull requests are welcome. A huge thanks to RGP for developing the mobile tracker that this site is based on.
<br/><br/>
Tracker Revision: <span class="r" id="build_version"></span>
Tracker Revision: <span class="r">{VER}</span>
<br/>
Build Date: <span class="r" id="build_date"></span>
Build Date: <span class="r">{BUILD_DATE}</span>

</p>
</div>
Expand Down
4 changes: 0 additions & 4 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,6 @@ $(window).ready(function() {
updateTime(new Date());
}, 1000);

// Update Tracker version info
$('#build_version').text(document.body.dataset.version);
$('#build_date').text(document.body.dataset.buildDate);

// resize elements if needed
checkSize();

Expand Down
2 changes: 1 addition & 1 deletion service-worker.js → service-worker.template.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
self.addEventListener('install', function(event) {
event.waitUntil(
caches.open(document.body.dataset.version).then(function(cache) {
caches.open("{VER}").then(function(cache) {
return cache.addAll(
[
'/css/base.css',
Expand Down