use moment.js to display a pretty time since last activity
This commit is contained in:
parent
bab8ec1eaa
commit
58e819606a
@ -3,7 +3,7 @@
|
|||||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
|
||||||
<link rel="stylesheet" href="static/features.css">
|
<link rel="stylesheet" href="static/features.css">
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.0/showdown.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.0/showdown.min.js"></script>
|
||||||
<script src="static/jquery-3.2.1.min.js"></script>
|
<script src="static/lib/jquery-3.2.1.min.js"></script>
|
||||||
<script src="static/features.js"></script>
|
<script src="static/features.js"></script>
|
||||||
</HEAD><BODY>
|
</HEAD><BODY>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
@ -25,9 +25,9 @@
|
|||||||
<script src="static/sdr.js"></script>
|
<script src="static/sdr.js"></script>
|
||||||
<script src="static/mathbox-bundle.min.js"></script>
|
<script src="static/mathbox-bundle.min.js"></script>
|
||||||
<script src="static/openwebrx.js"></script>
|
<script src="static/openwebrx.js"></script>
|
||||||
<script src="static/jquery-3.2.1.min.js"></script>
|
<script src="static/lib/jquery-3.2.1.min.js"></script>
|
||||||
<script src="static/jquery.nanoscroller.js"></script>
|
<script src="static/lib/jquery.nanoscroller.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="static/nanoscroller.css" />
|
<link rel="stylesheet" type="text/css" href="static/lib/nanoscroller.css" />
|
||||||
<link rel="stylesheet" type="text/css" href="static/openwebrx.css" />
|
<link rel="stylesheet" type="text/css" href="static/openwebrx.css" />
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
</head>
|
</head>
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>OpenWebRX Map</title>
|
<title>OpenWebRX Map</title>
|
||||||
<script src="static/jquery-3.2.1.min.js"></script>
|
<script src="static/lib/jquery-3.2.1.min.js"></script>
|
||||||
<script src="static/map.js"></script>
|
<script src="static/map.js"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="static/map.css" />
|
<link rel="stylesheet" type="text/css" href="static/map.css" />
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
</head>
|
</head>
|
||||||
|
@ -129,7 +129,7 @@
|
|||||||
zoom: 5
|
zoom: 5
|
||||||
});
|
});
|
||||||
processUpdates(updateQueue);
|
processUpdates(updateQueue);
|
||||||
$.getScript("/static/nite-overlay.js").done(function(){
|
$.getScript("/static/lib/nite-overlay.js").done(function(){
|
||||||
nite.init(map);
|
nite.init(map);
|
||||||
setInterval(function() { nite.refresh() }, 10000); // every 10s
|
setInterval(function() { nite.refresh() }, 10000); // every 10s
|
||||||
});
|
});
|
||||||
@ -161,7 +161,7 @@
|
|||||||
var showInfoWindow = function(locator, pos) {
|
var showInfoWindow = function(locator, pos) {
|
||||||
if (!infowindow) infowindow = new google.maps.InfoWindow();
|
if (!infowindow) infowindow = new google.maps.InfoWindow();
|
||||||
var inLocator = $.map(rectangles, function(r, callsign) {
|
var inLocator = $.map(rectangles, function(r, callsign) {
|
||||||
return {callsign: callsign, locator: r.locator}
|
return {callsign: callsign, locator: r.locator, lastseen: r.lastseen}
|
||||||
}).filter(function(d) {
|
}).filter(function(d) {
|
||||||
return d.locator == locator;
|
return d.locator == locator;
|
||||||
});
|
});
|
||||||
@ -169,7 +169,10 @@
|
|||||||
'<h3>Locator: ' + locator + '</h3>' +
|
'<h3>Locator: ' + locator + '</h3>' +
|
||||||
'<div>Active Callsigns:</div>' +
|
'<div>Active Callsigns:</div>' +
|
||||||
'<ul>' +
|
'<ul>' +
|
||||||
inLocator.map(function(i){ return '<li>' + i.callsign + '</li>' }).join("") +
|
inLocator.map(function(i){
|
||||||
|
var timestring = moment(i.lastseen).fromNow();
|
||||||
|
return '<li>' + i.callsign + ' (' + timestring + ')</li>'
|
||||||
|
}).join("") +
|
||||||
'</ul>'
|
'</ul>'
|
||||||
);
|
);
|
||||||
infowindow.setPosition(pos);
|
infowindow.setPosition(pos);
|
||||||
|
Loading…
Reference in New Issue
Block a user