Add location broadcast (close #5)

master
Skylar Ittner 5 years ago
parent 880725bb65
commit 7774355f67

@ -78,6 +78,25 @@ function loadQrCode(callback) {
});
}
function broadcastLocation() {
getLocation(function (position) {
callAPI("broadcast", {
key: localStorage.getItem("key"),
latitude: position.coords.latitude,
longitude: position.coords.longitude
}, function (success) {
app.toast.create({
text: "<i class=\"fas fa-check\"></i> Location sent!",
closeTimeout: 2000
}).open();
}, function (error) {
app.dialog.alert(error, "Error");
});
}, function (error) {
app.dialog.alert(error, "Location Error");
});
}
function loadHomePage(callback) {
var done = 0;
var total = 2;

@ -93,6 +93,30 @@
</div>
</div>
</div>
<div class="col-100 tablet-50 desktop-33">
<div class="card" id="broadcast-card">
<div class="card-header">
<div>
<i class="fas fa-street-view"></i> Broadcast Location
</div>
</div>
<div class="card-content card-content-padding">
Press the button to show your current location to nearby
givers. They will be able to send you money from the
map, even if they aren't close enough to scan your code.
Your position will be visible for one hour. The timer
will reset every time you push the button.
</div>
<div class="card-footer display-block">
<div class="button button-large button-fill button-round button-raised" onclick="broadcastLocation()">
Broadcast
</div>
</div>
</div>
</div>
{{/if}}
{{#if giver}}
<div class="col-100 tablet-50 desktop-33">

Loading…
Cancel
Save