Add open source license viewer dialog
This commit is contained in:
parent
e2556f27e4
commit
343a467b6f
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:gap="http://phonegap.com/ns/1.0" android-versionCode="104000" id="com.netsyms.terranquest.TerranQuest" version="1.4.0">
|
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:gap="http://phonegap.com/ns/1.0" android-versionCode="104060" id="com.netsyms.terranquest.TerranQuest" version="1.4.6">
|
||||||
<name>TerranQuest</name>
|
<name>TerranQuest</name>
|
||||||
<description>
|
<description>
|
||||||
Augmented Reality fantasy game
|
Augmented Reality fantasy game
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<manifest android:hardwareAccelerated="true" android:versionCode="104000" android:versionName="1.4.0" package="com.netsyms.terranquest.TerranQuest" xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest android:hardwareAccelerated="true" android:versionCode="104060" android:versionName="1.4.6" package="com.netsyms.terranquest.TerranQuest" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
|
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name" android:supportsRtl="true">
|
<application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name" android:supportsRtl="true">
|
||||||
|
@ -1,355 +1,355 @@
|
|||||||
/* global PositionError */
|
///* global PositionError */
|
||||||
|
//
|
||||||
//////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
// GPS and terrain stuff
|
//// GPS and terrain stuff
|
||||||
//////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* Handles GPS and terrain data.
|
// * Handles GPS and terrain data.
|
||||||
*/
|
// */
|
||||||
|
//
|
||||||
// Globals
|
//// Globals
|
||||||
lockGot = false;
|
//lockGot = false;
|
||||||
terrainGot = false;
|
//terrainGot = false;
|
||||||
latitude = 0.0000;
|
//latitude = 0.0000;
|
||||||
longitude = 0.0000;
|
//longitude = 0.0000;
|
||||||
gpsaccuracy = 9999;
|
//gpsaccuracy = 9999;
|
||||||
// End Globals
|
//// End Globals
|
||||||
|
//
|
||||||
var lastgpstime = 0;
|
//var lastgpstime = 0;
|
||||||
var terraintypeid = 0;
|
//var terraintypeid = 0;
|
||||||
var map = L.map('map');
|
//var map = L.map('map');
|
||||||
var tileurl = "http://tile.stamen.com/terrain/{z}/{x}/{y}.jpg";
|
//var tileurl = "http://tile.stamen.com/terrain/{z}/{x}/{y}.jpg";
|
||||||
map.setZoom(17);
|
//map.setZoom(17);
|
||||||
map.dragging.disable();
|
//map.dragging.disable();
|
||||||
//map.touchZoom.disable();
|
////map.touchZoom.disable();
|
||||||
//map.doubleClickZoom.disable();
|
////map.doubleClickZoom.disable();
|
||||||
//map.scrollWheelZoom.disable();
|
////map.scrollWheelZoom.disable();
|
||||||
map.keyboard.disable();
|
//map.keyboard.disable();
|
||||||
$(".leaflet-control-zoom").css("visibility", "hidden");
|
//$(".leaflet-control-zoom").css("visibility", "hidden");
|
||||||
// Disable tap handler, if present.
|
//// Disable tap handler, if present.
|
||||||
//if (map.tap) {
|
////if (map.tap) {
|
||||||
// map.tap.disable();
|
//// map.tap.disable();
|
||||||
|
////}
|
||||||
|
//
|
||||||
|
//// Tile layer
|
||||||
|
//map.addLayer(new L.tileLayer(tileurl, {minZoom: 17, maxZoom: 18}));
|
||||||
|
//// Places layer
|
||||||
|
//var placeLayer = L.geoJson(
|
||||||
|
// {"name": "Places", "type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [0, 0]}, "properties": {"osm_id": -1, "name": null}}]},
|
||||||
|
// {
|
||||||
|
// onEachFeature: onPlaceTap,
|
||||||
|
// pointToLayer: function (feature, latlng) {
|
||||||
|
// return L.circleMarker(latlng, {
|
||||||
|
// radius: 14,
|
||||||
|
// fillColor: "#ff7800",
|
||||||
|
// color: "#000",
|
||||||
|
// weight: 1,
|
||||||
|
// opacity: 1,
|
||||||
|
// fillOpacity: 0.6
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }).addTo(map);
|
||||||
|
//
|
||||||
|
//var lc = L.control.locate({
|
||||||
|
// position: 'topleft', // set the location of the control
|
||||||
|
// layer: undefined, // use your own layer for the location marker, creates a new layer by default
|
||||||
|
// drawCircle: false, // controls whether a circle is drawn that shows the uncertainty about the location
|
||||||
|
// follow: true, // follow the user's location
|
||||||
|
// setView: true, // automatically sets the map view to the user's location, enabled if `follow` is true
|
||||||
|
// keepCurrentZoomLevel: true, // keep the current map zoom level when displaying the user's location. (if `false`, use maxZoom)
|
||||||
|
// stopFollowingOnDrag: false, // stop following when the map is dragged if `follow` is true (deprecated, see below)
|
||||||
|
// remainActive: true, // if true locate control remains active on click even if the user's location is in view.
|
||||||
|
// markerClass: L.circleMarker, // L.circleMarker or L.marker
|
||||||
|
// circleStyle: {}, // change the style of the circle around the user's location
|
||||||
|
// markerStyle: {},
|
||||||
|
// followCircleStyle: {}, // set difference for the style of the circle around the user's location while following
|
||||||
|
// followMarkerStyle: {},
|
||||||
|
// icon: 'fa fa-map-marker', // class for icon, fa-location-arrow or fa-map-marker
|
||||||
|
// iconLoading: 'fa fa-spinner fa-pulse', // class for loading icon
|
||||||
|
// iconElementTag: 'span', // tag for the icon element, span or i
|
||||||
|
// circlePadding: [0, 0], // padding around accuracy circle, value is passed to setBounds
|
||||||
|
// metric: true, // use metric or imperial units
|
||||||
|
// onLocationError: function (err) {
|
||||||
|
// }, // define an error callback function
|
||||||
|
// onLocationOutsideMapBounds: function (context) { // called when outside map boundaries
|
||||||
|
// },
|
||||||
|
// showPopup: false, // display a popup when the user click on the inner marker
|
||||||
|
// strings: {
|
||||||
|
// title: ".", // title of the locate control
|
||||||
|
// metersUnit: "meters", // string for metric units
|
||||||
|
// feetUnit: "feet", // string for imperial units
|
||||||
|
// popup: "You are within {distance} {unit} from this point", // text to appear if user clicks on circle
|
||||||
|
// outsideMapBoundsMsg: "You seem located outside the boundaries of the map" // default message for onLocationOutsideMapBounds
|
||||||
|
// },
|
||||||
|
// locateOptions: {} // define location options e.g enableHighAccuracy: true or maxZoom: 10
|
||||||
|
//}).addTo(map);
|
||||||
|
//lc.start();
|
||||||
|
//function mapPos(lat, lon) {
|
||||||
|
// lockGot = true;
|
||||||
|
// hideLoading();
|
||||||
|
// loadPlaces(latitude, longitude);
|
||||||
|
// //map.setView(new L.LatLng(lat, lon), 16, {animate: true});
|
||||||
|
// //map.panTo(new L.LatLng(lat, lon));
|
||||||
|
// //map.invalidateSize();
|
||||||
|
// //redraw('.leaflet-map-pane');
|
||||||
|
//// $('.leaflet-map-plane').css('height', '90%');
|
||||||
|
//// setTimeout(function () {
|
||||||
|
//// $('#map').css('width', '100%');
|
||||||
|
//// $('#map').css('height', '100%');
|
||||||
|
//// }, 100);
|
||||||
//}
|
//}
|
||||||
|
//
|
||||||
// Tile layer
|
//function onPlaceTap(feature, layer) {
|
||||||
map.addLayer(new L.tileLayer(tileurl, {minZoom: 17, maxZoom: 18}));
|
// layer.on('click', function (e) {
|
||||||
// Places layer
|
// openPlace(feature);
|
||||||
var placeLayer = L.geoJson(
|
// });
|
||||||
{"name": "Places", "type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [0, 0]}, "properties": {"osm_id": -1, "name": null}}]},
|
//}
|
||||||
{
|
//
|
||||||
onEachFeature: onPlaceTap,
|
//function loadPlaces(lat, long) {
|
||||||
pointToLayer: function (feature, latlng) {
|
// $.getJSON(
|
||||||
return L.circleMarker(latlng, {
|
// "http://earth.apis.netsyms.net/places.php?format=geojson&lat=" + lat + "&long=" + long + "&radius=.25&names=1",
|
||||||
radius: 14,
|
// function (data) {
|
||||||
fillColor: "#ff7800",
|
// if (data.type === 'FeatureCollection') {
|
||||||
color: "#000",
|
// placeLayer.clearLayers();
|
||||||
weight: 1,
|
// data.features.forEach(function (item) {
|
||||||
opacity: 1,
|
// item.properties.popupContent = "<span class='marker-popup-text' onclick='openplace(" + item.properties.osm_id + ")'>" + item.properties.name + "</span>";
|
||||||
fillOpacity: 0.6
|
// placeLayer.addData(item);
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}).addTo(map);
|
// });
|
||||||
|
//}
|
||||||
var lc = L.control.locate({
|
//
|
||||||
position: 'topleft', // set the location of the control
|
//function openPlace(feature) {
|
||||||
layer: undefined, // use your own layer for the location marker, creates a new layer by default
|
// $('#main-content').load("screens/place.html", null, function () {
|
||||||
drawCircle: false, // controls whether a circle is drawn that shows the uncertainty about the location
|
// loadPlace(feature);
|
||||||
follow: true, // follow the user's location
|
// $('#overlay-main').css('display', 'block');
|
||||||
setView: true, // automatically sets the map view to the user's location, enabled if `follow` is true
|
// });
|
||||||
keepCurrentZoomLevel: true, // keep the current map zoom level when displaying the user's location. (if `false`, use maxZoom)
|
//}
|
||||||
stopFollowingOnDrag: false, // stop following when the map is dragged if `follow` is true (deprecated, see below)
|
//
|
||||||
remainActive: true, // if true locate control remains active on click even if the user's location is in view.
|
///**
|
||||||
markerClass: L.circleMarker, // L.circleMarker or L.marker
|
// * Hide the loading overlay if everything is loaded, otherwise do nothing
|
||||||
circleStyle: {}, // change the style of the circle around the user's location
|
// */
|
||||||
markerStyle: {},
|
//function hideLoading() {
|
||||||
followCircleStyle: {}, // set difference for the style of the circle around the user's location while following
|
// if (lockGot && terrainGot && gpsaccuracy < 30 && $('#loading').css('display') !== 'none') {
|
||||||
followMarkerStyle: {},
|
// $('#loading').fadeOut('slow', function () {
|
||||||
icon: 'fa fa-map-marker', // class for icon, fa-location-arrow or fa-map-marker
|
// $('#loading').css('display', 'none');
|
||||||
iconLoading: 'fa fa-spinner fa-pulse', // class for loading icon
|
// });
|
||||||
iconElementTag: 'span', // tag for the icon element, span or i
|
// }
|
||||||
circlePadding: [0, 0], // padding around accuracy circle, value is passed to setBounds
|
//}
|
||||||
metric: true, // use metric or imperial units
|
//
|
||||||
onLocationError: function (err) {
|
//var updatePosition = function (position) {
|
||||||
}, // define an error callback function
|
// latitude = position.coords.latitude;
|
||||||
onLocationOutsideMapBounds: function (context) { // called when outside map boundaries
|
// longitude = position.coords.longitude;
|
||||||
},
|
// lastgpstime = position.timestamp;
|
||||||
showPopup: false, // display a popup when the user click on the inner marker
|
// gpsaccuracy = position.coords.accuracy;
|
||||||
strings: {
|
// if (gpsaccuracy > 30) {
|
||||||
title: ".", // title of the locate control
|
// $('#no-lock').css('display', 'block');
|
||||||
metersUnit: "meters", // string for metric units
|
// } else {
|
||||||
feetUnit: "feet", // string for imperial units
|
// $('#no-lock').css('display', 'none');
|
||||||
popup: "You are within {distance} {unit} from this point", // text to appear if user clicks on circle
|
// }
|
||||||
outsideMapBoundsMsg: "You seem located outside the boundaries of the map" // default message for onLocationOutsideMapBounds
|
// mapPos(latitude, longitude);
|
||||||
},
|
//};
|
||||||
locateOptions: {} // define location options e.g enableHighAccuracy: true or maxZoom: 10
|
//var updateTerrain = function (position) {
|
||||||
}).addTo(map);
|
// latitude = position.coords.latitude;
|
||||||
lc.start();
|
// longitude = position.coords.longitude;
|
||||||
function mapPos(lat, lon) {
|
// lastgpstime = position.timestamp;
|
||||||
lockGot = true;
|
// gpsaccuracy = position.coords.accuracy;
|
||||||
hideLoading();
|
// var rasterurl = "http://earth.apis.netsyms.net/terrain.php?format=json&lat="
|
||||||
loadPlaces(latitude, longitude);
|
// + latitude + "&long=" + longitude;
|
||||||
//map.setView(new L.LatLng(lat, lon), 16, {animate: true});
|
// $.get(rasterurl, function (data) {
|
||||||
//map.panTo(new L.LatLng(lat, lon));
|
// if (data.status === 'OK') {
|
||||||
//map.invalidateSize();
|
// terraintypeid = data.typeid;
|
||||||
//redraw('.leaflet-map-pane');
|
// terraintypename = data.typename;
|
||||||
// $('.leaflet-map-plane').css('height', '90%');
|
// $('#terrain-image').attr('src', 'assets/terrain/' + terraintypeid + '.png');
|
||||||
// setTimeout(function () {
|
// terrainGot = true;
|
||||||
// $('#map').css('width', '100%');
|
// hideLoading();
|
||||||
// $('#map').css('height', '100%');
|
// }
|
||||||
// }, 100);
|
// }, "json").fail(function (err) {
|
||||||
}
|
// $('#terrain-image').attr('src', 'assets/terrain/0.png');
|
||||||
|
// });
|
||||||
function onPlaceTap(feature, layer) {
|
//};
|
||||||
layer.on('click', function (e) {
|
//function pingServer() {
|
||||||
openPlace(feature);
|
// if (lockGot && gpsaccuracy < 30) {
|
||||||
});
|
// $.get(mkApiUrl('ping') + "?user=" + username + "&lat=" + latitude + "&long=" + longitude);
|
||||||
}
|
// }
|
||||||
|
//}
|
||||||
function loadPlaces(lat, long) {
|
//;
|
||||||
$.getJSON(
|
//function onError(error) {
|
||||||
"http://earth.apis.netsyms.net/places.php?format=geojson&lat=" + lat + "&long=" + long + "&radius=.25&names=1",
|
// $('#loading-error').text("Check your device's network and location settings, and ensure a clear view of the sky.");
|
||||||
function (data) {
|
//}
|
||||||
if (data.type === 'FeatureCollection') {
|
//
|
||||||
placeLayer.clearLayers();
|
//function popGPS() {
|
||||||
data.features.forEach(function (item) {
|
// navigator.notification.alert("Latitude: " + latitude +
|
||||||
item.properties.popupContent = "<span class='marker-popup-text' onclick='openplace(" + item.properties.osm_id + ")'>" + item.properties.name + "</span>";
|
// "\nLongitude: " + longitude +
|
||||||
placeLayer.addData(item);
|
// "\nAccuracy: " + gpsaccuracy +
|
||||||
});
|
// "\nTerrain: " + terraintypename + " (" + terraintypeid + ")",
|
||||||
}
|
// null,
|
||||||
});
|
// "GPS Information",
|
||||||
}
|
// "Close");
|
||||||
|
//}
|
||||||
function openPlace(feature) {
|
//$('#terrain-image').click(function () {
|
||||||
$('#main-content').load("screens/place.html", null, function () {
|
// popGPS();
|
||||||
loadPlace(feature);
|
//});
|
||||||
$('#overlay-main').css('display', 'block');
|
//// Initial GPS position and stuff
|
||||||
});
|
//navigator.geolocation.getCurrentPosition(updateTerrain, onError, {timeout: 10000, enableHighAccuracy: true});
|
||||||
}
|
//// Update position
|
||||||
|
//setInterval(function () {
|
||||||
/**
|
// navigator.geolocation.getCurrentPosition(updatePosition, onError, {timeout: 10000, enableHighAccuracy: true});
|
||||||
* Hide the loading overlay if everything is loaded, otherwise do nothing
|
//}, 1000);
|
||||||
*/
|
//// Update position + terrain
|
||||||
function hideLoading() {
|
//setInterval(function () {
|
||||||
if (lockGot && terrainGot && gpsaccuracy < 30 && $('#loading').css('display') !== 'none') {
|
// navigator.geolocation.getCurrentPosition(updateTerrain, onError, {timeout: 10000, enableHighAccuracy: true});
|
||||||
$('#loading').fadeOut('slow', function () {
|
// loadPlaces(latitude, longitude);
|
||||||
$('#loading').css('display', 'none');
|
//}, 1000 * 20);
|
||||||
});
|
//// Ping the server with coordinates
|
||||||
}
|
//setInterval(pingServer, 5000);
|
||||||
}
|
//// Show error if it's taking too long
|
||||||
|
//setTimeout(function () {
|
||||||
var updatePosition = function (position) {
|
// onError();
|
||||||
latitude = position.coords.latitude;
|
//}, 15 * 1000);
|
||||||
longitude = position.coords.longitude;
|
//
|
||||||
lastgpstime = position.timestamp;
|
//
|
||||||
gpsaccuracy = position.coords.accuracy;
|
////////////////////////////////////////////////
|
||||||
if (gpsaccuracy > 30) {
|
//// Profile, stats, and chat stuff
|
||||||
$('#no-lock').css('display', 'block');
|
////////////////////////////////////////////////
|
||||||
} else {
|
//
|
||||||
$('#no-lock').css('display', 'none');
|
//
|
||||||
}
|
///*
|
||||||
mapPos(latitude, longitude);
|
// * Handles general server communication.
|
||||||
};
|
// */
|
||||||
var updateTerrain = function (position) {
|
//
|
||||||
latitude = position.coords.latitude;
|
///**
|
||||||
longitude = position.coords.longitude;
|
// * Syncs the user's stats with the server and calls refreshStats().
|
||||||
lastgpstime = position.timestamp;
|
// */
|
||||||
gpsaccuracy = position.coords.accuracy;
|
//function syncStats() {
|
||||||
var rasterurl = "http://earth.apis.netsyms.net/terrain.php?format=json&lat="
|
// $.getJSON(mkApiUrl('getstats'), {
|
||||||
+ latitude + "&long=" + longitude;
|
// user: username
|
||||||
$.get(rasterurl, function (data) {
|
// }, function (data) {
|
||||||
if (data.status === 'OK') {
|
// if (data.status === 'OK') {
|
||||||
terraintypeid = data.typeid;
|
// maxenergy = data.stats.maxenergy;
|
||||||
terraintypename = data.typename;
|
// energy = data.stats.energy;
|
||||||
$('#terrain-image').attr('src', 'assets/terrain/' + terraintypeid + '.png');
|
// level = data.stats.level;
|
||||||
terrainGot = true;
|
// refreshStats();
|
||||||
hideLoading();
|
// }
|
||||||
}
|
// });
|
||||||
}, "json").fail(function (err) {
|
//}
|
||||||
$('#terrain-image').attr('src', 'assets/terrain/0.png');
|
//
|
||||||
});
|
///**
|
||||||
};
|
// * Display the current stats on the home screen.
|
||||||
function pingServer() {
|
// */
|
||||||
if (lockGot && gpsaccuracy < 30) {
|
//function refreshStats() {
|
||||||
$.get(mkApiUrl('ping') + "?user=" + username + "&lat=" + latitude + "&long=" + longitude);
|
// energypercent = (energy * 1.0 / maxenergy * 1.0) * 100.0;
|
||||||
}
|
// $('#energybar').css('width', String(energypercent) + '%');
|
||||||
}
|
//}
|
||||||
;
|
//
|
||||||
function onError(error) {
|
//function getChat() {
|
||||||
$('#loading-error').text("Check your device's network and location settings, and ensure a clear view of the sky.");
|
// if (lockGot) {
|
||||||
}
|
// $.getJSON(mkApiUrl('chat', 'cs'), {
|
||||||
|
// lat: latitude,
|
||||||
function popGPS() {
|
// long: longitude
|
||||||
navigator.notification.alert("Latitude: " + latitude +
|
// }, function (data) {
|
||||||
"\nLongitude: " + longitude +
|
// data = sortResults(data, 'time', true);
|
||||||
"\nAccuracy: " + gpsaccuracy +
|
// var content = "";
|
||||||
"\nTerrain: " + terraintypename + " (" + terraintypeid + ")",
|
// data.forEach(function (msg) {
|
||||||
null,
|
// content += "<span class='chat-username' onclick='openProfile(\"" + msg.username + "\");'>" + msg.username + "</span> " + msg.message + "<br />";
|
||||||
"GPS Information",
|
// });
|
||||||
"Close");
|
// $('#chatmsgs').html(content);
|
||||||
}
|
// });
|
||||||
$('#terrain-image').click(function () {
|
// }
|
||||||
popGPS();
|
//}
|
||||||
});
|
//
|
||||||
// Initial GPS position and stuff
|
//
|
||||||
navigator.geolocation.getCurrentPosition(updateTerrain, onError, {timeout: 10000, enableHighAccuracy: true});
|
//syncStats();
|
||||||
// Update position
|
//setInterval(function () {
|
||||||
setInterval(function () {
|
// syncStats();
|
||||||
navigator.geolocation.getCurrentPosition(updatePosition, onError, {timeout: 10000, enableHighAccuracy: true});
|
//}, 10 * 1000);
|
||||||
}, 1000);
|
//setInterval(function () {
|
||||||
// Update position + terrain
|
// getChat();
|
||||||
setInterval(function () {
|
//}, 2000);
|
||||||
navigator.geolocation.getCurrentPosition(updateTerrain, onError, {timeout: 10000, enableHighAccuracy: true});
|
//// Send chat messages
|
||||||
loadPlaces(latitude, longitude);
|
//$("#chatsendform").submit(function (event) {
|
||||||
}, 1000 * 20);
|
// message = $('#chatbox-input').val();
|
||||||
// Ping the server with coordinates
|
// if (message !== '') {
|
||||||
setInterval(pingServer, 5000);
|
// $.post(mkApiUrl('chat', 'cs'), {
|
||||||
// Show error if it's taking too long
|
// user: username,
|
||||||
setTimeout(function () {
|
// lat: latitude,
|
||||||
onError();
|
// long: longitude,
|
||||||
}, 15 * 1000);
|
// msg: message
|
||||||
|
// }, function (data) {
|
||||||
|
// if (data.status === 'OK') {
|
||||||
//////////////////////////////////////////////
|
// $('#chatbox-input').val("");
|
||||||
// Profile, stats, and chat stuff
|
// $("#chatmsgs").animate({scrollTop: $('#chatmsgs').prop("scrollHeight")}, 1000);
|
||||||
//////////////////////////////////////////////
|
// }
|
||||||
|
// }, "json");
|
||||||
|
// }
|
||||||
/*
|
// event.preventDefault();
|
||||||
* Handles general server communication.
|
// return false;
|
||||||
*/
|
//});
|
||||||
|
//function toggleChat() {
|
||||||
/**
|
// if ($('#chatmsgs').css('display') === 'none') {
|
||||||
* Syncs the user's stats with the server and calls refreshStats().
|
// openChat();
|
||||||
*/
|
// } else {
|
||||||
function syncStats() {
|
// closeChat();
|
||||||
$.getJSON(mkApiUrl('getstats'), {
|
// }
|
||||||
user: username
|
//}
|
||||||
}, function (data) {
|
//
|
||||||
if (data.status === 'OK') {
|
//function closeChat() {
|
||||||
maxenergy = data.stats.maxenergy;
|
// $('#chatmsgs').css('display', 'none');
|
||||||
energy = data.stats.energy;
|
// $('#chatbox').css('height', 'auto');
|
||||||
level = data.stats.level;
|
//}
|
||||||
refreshStats();
|
//
|
||||||
}
|
//function openChat() {
|
||||||
});
|
// $('#chatbox').css('height', '50%');
|
||||||
}
|
// $('#chatmsgs').css('display', 'block');
|
||||||
|
// $("#chatmsgs").animate({scrollTop: $('#chatmsgs').prop("scrollHeight")}, 1000);
|
||||||
/**
|
//}
|
||||||
* Display the current stats on the home screen.
|
//
|
||||||
*/
|
//function openProfile(user) {
|
||||||
function refreshStats() {
|
// user = typeof user !== 'undefined' ? user : username;
|
||||||
energypercent = (energy * 1.0 / maxenergy * 1.0) * 100.0;
|
// $('#main-content').load("screens/profile.html", null, function (x) {
|
||||||
$('#energybar').css('width', String(energypercent) + '%');
|
// $('#overlay-main').css('display', 'block');
|
||||||
}
|
// loadProfile(user);
|
||||||
|
// });
|
||||||
function getChat() {
|
//}
|
||||||
if (lockGot) {
|
//
|
||||||
$.getJSON(mkApiUrl('chat', 'cs'), {
|
//function openRules() {
|
||||||
lat: latitude,
|
// openmodal('rules', '#rules-modal');
|
||||||
long: longitude
|
//}
|
||||||
}, function (data) {
|
//
|
||||||
data = sortResults(data, 'time', true);
|
//function openMenu(topage) {
|
||||||
var content = "";
|
// topage = typeof topage !== 'undefined' ? topage : "";
|
||||||
data.forEach(function (msg) {
|
// $('#main-content').load("screens/menu.html", null, function (x) {
|
||||||
content += "<span class='chat-username' onclick='openProfile(\"" + msg.username + "\");'>" + msg.username + "</span> " + msg.message + "<br />";
|
// $('#overlay-main').css('display', 'block');
|
||||||
});
|
// if (topage !== '') {
|
||||||
$('#chatmsgs').html(content);
|
// $('#' + topage + '-tab').tab('show');
|
||||||
});
|
// }
|
||||||
}
|
// });
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
|
//
|
||||||
syncStats();
|
//
|
||||||
setInterval(function () {
|
////////////////////////////////////////////////
|
||||||
syncStats();
|
//// Other things
|
||||||
}, 10 * 1000);
|
////////////////////////////////////////////////
|
||||||
setInterval(function () {
|
//
|
||||||
getChat();
|
//function closeMain() {
|
||||||
}, 2000);
|
// $('#overlay-main').slideDown(100, function () {
|
||||||
// Send chat messages
|
// $('#overlay-main').css('display', 'none');
|
||||||
$("#chatsendform").submit(function (event) {
|
// $('#main-content').html("");
|
||||||
message = $('#chatbox-input').val();
|
// });
|
||||||
if (message !== '') {
|
//}
|
||||||
$.post(mkApiUrl('chat', 'cs'), {
|
//
|
||||||
user: username,
|
//// Handle back button to close things
|
||||||
lat: latitude,
|
//document.addEventListener("backbutton", function (event) {
|
||||||
long: longitude,
|
// if ($('#overlay-main').css('display') !== 'none') {
|
||||||
msg: message
|
// closeMain();
|
||||||
}, function (data) {
|
// } else if ($('#chatmsgs').css('display') !== 'none') {
|
||||||
if (data.status === 'OK') {
|
// toggleChat();
|
||||||
$('#chatbox-input').val("");
|
// }
|
||||||
$("#chatmsgs").animate({scrollTop: $('#chatmsgs').prop("scrollHeight")}, 1000);
|
//}, false);
|
||||||
}
|
//// Show the rules
|
||||||
}, "json");
|
//if (localStorage.getItem("seenrules") !== 'yes') {
|
||||||
}
|
// openRules();
|
||||||
event.preventDefault();
|
// localStorage.setItem("seenrules", 'yes');
|
||||||
return false;
|
//}
|
||||||
});
|
|
||||||
function toggleChat() {
|
|
||||||
if ($('#chatmsgs').css('display') === 'none') {
|
|
||||||
openChat();
|
|
||||||
} else {
|
|
||||||
closeChat();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function closeChat() {
|
|
||||||
$('#chatmsgs').css('display', 'none');
|
|
||||||
$('#chatbox').css('height', 'auto');
|
|
||||||
}
|
|
||||||
|
|
||||||
function openChat() {
|
|
||||||
$('#chatbox').css('height', '50%');
|
|
||||||
$('#chatmsgs').css('display', 'block');
|
|
||||||
$("#chatmsgs").animate({scrollTop: $('#chatmsgs').prop("scrollHeight")}, 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
function openProfile(user) {
|
|
||||||
user = typeof user !== 'undefined' ? user : username;
|
|
||||||
$('#main-content').load("screens/profile.html", null, function (x) {
|
|
||||||
$('#overlay-main').css('display', 'block');
|
|
||||||
loadProfile(user);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function openRules() {
|
|
||||||
openmodal('rules', '#rules-modal');
|
|
||||||
}
|
|
||||||
|
|
||||||
function openMenu(topage) {
|
|
||||||
topage = typeof topage !== 'undefined' ? topage : "";
|
|
||||||
$('#main-content').load("screens/menu.html", null, function (x) {
|
|
||||||
$('#overlay-main').css('display', 'block');
|
|
||||||
if (topage !== '') {
|
|
||||||
$('#' + topage + '-tab').tab('show');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////
|
|
||||||
// Other things
|
|
||||||
//////////////////////////////////////////////
|
|
||||||
|
|
||||||
function closeMain() {
|
|
||||||
$('#overlay-main').slideDown(100, function () {
|
|
||||||
$('#overlay-main').css('display', 'none');
|
|
||||||
$('#main-content').html("");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle back button to close things
|
|
||||||
document.addEventListener("backbutton", function (event) {
|
|
||||||
if ($('#overlay-main').css('display') !== 'none') {
|
|
||||||
closeMain();
|
|
||||||
} else if ($('#chatmsgs').css('display') !== 'none') {
|
|
||||||
toggleChat();
|
|
||||||
}
|
|
||||||
}, false);
|
|
||||||
// Show the rules
|
|
||||||
if (localStorage.getItem("seenrules") !== 'yes') {
|
|
||||||
openRules();
|
|
||||||
localStorage.setItem("seenrules", 'yes');
|
|
||||||
}
|
|
199
platforms/android/assets/www/screens/licenses.html
Normal file
199
platforms/android/assets/www/screens/licenses.html
Normal file
@ -0,0 +1,199 @@
|
|||||||
|
<div id="license-modal" class="modal fade" tabindex="-1" role="dialog">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
<h4 class="modal-title">Open Source Licenses</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<h4>Apache Cordova</h4>
|
||||||
|
<p>Apache License<br>Version 2.0, January 2004<br>
|
||||||
|
http://www.apache.org/licenses/</p>
|
||||||
|
<p>TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION</p>
|
||||||
|
<p><strong>1. Definitions</strong>.</p>
|
||||||
|
<p>"License" shall mean the terms and conditions for use, reproduction, and
|
||||||
|
distribution as defined by Sections 1 through 9 of this document.</p>
|
||||||
|
<p>"Licensor" shall mean the copyright owner or entity authorized by the
|
||||||
|
copyright owner that is granting the License.</p>
|
||||||
|
<p>"Legal Entity" shall mean the union of the acting entity and all other
|
||||||
|
entities that control, are controlled by, or are under common control with
|
||||||
|
that entity. For the purposes of this definition, "control" means (i) the
|
||||||
|
power, direct or indirect, to cause the direction or management of such
|
||||||
|
entity, whether by contract or otherwise, or (ii) ownership of fifty
|
||||||
|
percent (50%) or more of the outstanding shares, or (iii) beneficial
|
||||||
|
ownership of such entity.</p>
|
||||||
|
<p>"You" (or "Your") shall mean an individual or Legal Entity exercising
|
||||||
|
permissions granted by this License.</p>
|
||||||
|
<p>"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation source,
|
||||||
|
and configuration files.</p>
|
||||||
|
<p>"Object" form shall mean any form resulting from mechanical transformation
|
||||||
|
or translation of a Source form, including but not limited to compiled
|
||||||
|
object code, generated documentation, and conversions to other media types.</p>
|
||||||
|
<p>"Work" shall mean the work of authorship, whether in Source or Object form,
|
||||||
|
made available under the License, as indicated by a copyright notice that
|
||||||
|
is included in or attached to the work (an example is provided in the
|
||||||
|
Appendix below).</p>
|
||||||
|
<p>"Derivative Works" shall mean any work, whether in Source or Object form,
|
||||||
|
that is based on (or derived from) the Work and for which the editorial
|
||||||
|
revisions, annotations, elaborations, or other modifications represent, as
|
||||||
|
a whole, an original work of authorship. For the purposes of this License,
|
||||||
|
Derivative Works shall not include works that remain separable from, or
|
||||||
|
merely link (or bind by name) to the interfaces of, the Work and Derivative
|
||||||
|
Works thereof.</p>
|
||||||
|
<p>"Contribution" shall mean any work of authorship, including the original
|
||||||
|
version of the Work and any modifications or additions to that Work or
|
||||||
|
Derivative Works thereof, that is intentionally submitted to Licensor for
|
||||||
|
inclusion in the Work by the copyright owner or by an individual or Legal
|
||||||
|
Entity authorized to submit on behalf of the copyright owner. For the
|
||||||
|
purposes of this definition, "submitted" means any form of electronic,
|
||||||
|
verbal, or written communication sent to the Licensor or its
|
||||||
|
representatives, including but not limited to communication on electronic
|
||||||
|
mailing lists, source code control systems, and issue tracking systems that
|
||||||
|
are managed by, or on behalf of, the Licensor for the purpose of discussing
|
||||||
|
and improving the Work, but excluding communication that is conspicuously
|
||||||
|
marked or otherwise designated in writing by the copyright owner as "Not a
|
||||||
|
Contribution."</p>
|
||||||
|
<p>"Contributor" shall mean Licensor and any individual or Legal Entity on
|
||||||
|
behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.</p>
|
||||||
|
<p><strong>2. Grant of Copyright License</strong>. Subject to the
|
||||||
|
terms and conditions of this License, each Contributor hereby grants to You
|
||||||
|
a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of, publicly
|
||||||
|
display, publicly perform, sublicense, and distribute the Work and such
|
||||||
|
Derivative Works in Source or Object form.</p>
|
||||||
|
<p><strong>3. Grant of Patent License</strong>. Subject to the terms
|
||||||
|
and conditions of this License, each Contributor hereby grants to You a
|
||||||
|
perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made, use,
|
||||||
|
offer to sell, sell, import, and otherwise transfer the Work, where such
|
||||||
|
license applies only to those patent claims licensable by such Contributor
|
||||||
|
that are necessarily infringed by their Contribution(s) alone or by
|
||||||
|
combination of their Contribution(s) with the Work to which such
|
||||||
|
Contribution(s) was submitted. If You institute patent litigation against
|
||||||
|
any entity (including a cross-claim or counterclaim in a lawsuit) alleging
|
||||||
|
that the Work or a Contribution incorporated within the Work constitutes
|
||||||
|
direct or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate as of the
|
||||||
|
date such litigation is filed.</p>
|
||||||
|
<p><strong>4. Redistribution</strong>. You may reproduce and
|
||||||
|
distribute copies of the Work or Derivative Works thereof in any medium,
|
||||||
|
with or without modifications, and in Source or Object form, provided that
|
||||||
|
You meet the following conditions:</p>
|
||||||
|
<ol style="list-style: lower-latin;">
|
||||||
|
<li>You must give any other recipients of the Work or Derivative Works a
|
||||||
|
copy of this License; and</li>
|
||||||
|
|
||||||
|
<li>You must cause any modified files to carry prominent notices stating
|
||||||
|
that You changed the files; and</li>
|
||||||
|
|
||||||
|
<li>You must retain, in the Source form of any Derivative Works that You
|
||||||
|
distribute, all copyright, patent, trademark, and attribution notices from
|
||||||
|
the Source form of the Work, excluding those notices that do not pertain to
|
||||||
|
any part of the Derivative Works; and</li>
|
||||||
|
|
||||||
|
<li>If the Work includes a "NOTICE" text file as part of its distribution,
|
||||||
|
then any Derivative Works that You distribute must include a readable copy
|
||||||
|
of the attribution notices contained within such NOTICE file, excluding
|
||||||
|
those notices that do not pertain to any part of the Derivative Works, in
|
||||||
|
at least one of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or documentation,
|
||||||
|
if provided along with the Derivative Works; or, within a display generated
|
||||||
|
by the Derivative Works, if and wherever such third-party notices normally
|
||||||
|
appear. The contents of the NOTICE file are for informational purposes only
|
||||||
|
and do not modify the License. You may add Your own attribution notices
|
||||||
|
within Derivative Works that You distribute, alongside or as an addendum to
|
||||||
|
the NOTICE text from the Work, provided that such additional attribution
|
||||||
|
notices cannot be construed as modifying the License.
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
You may add Your own copyright statement to Your modifications and may
|
||||||
|
provide additional or different license terms and conditions for use,
|
||||||
|
reproduction, or distribution of Your modifications, or for any such
|
||||||
|
Derivative Works as a whole, provided Your use, reproduction, and
|
||||||
|
distribution of the Work otherwise complies with the conditions stated in
|
||||||
|
this License.
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<p><strong>5. Submission of Contributions</strong>. Unless You
|
||||||
|
explicitly state otherwise, any Contribution intentionally submitted for
|
||||||
|
inclusion in the Work by You to the Licensor shall be under the terms and
|
||||||
|
conditions of this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify the
|
||||||
|
terms of any separate license agreement you may have executed with Licensor
|
||||||
|
regarding such Contributions.</p>
|
||||||
|
<p><strong>6. Trademarks</strong>. This License does not grant
|
||||||
|
permission to use the trade names, trademarks, service marks, or product
|
||||||
|
names of the Licensor, except as required for reasonable and customary use
|
||||||
|
in describing the origin of the Work and reproducing the content of the
|
||||||
|
NOTICE file.</p>
|
||||||
|
<p><strong>7. Disclaimer of Warranty</strong>. Unless required by
|
||||||
|
applicable law or agreed to in writing, Licensor provides the Work (and
|
||||||
|
each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT
|
||||||
|
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including,
|
||||||
|
without limitation, any warranties or conditions of TITLE,
|
||||||
|
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You
|
||||||
|
are solely responsible for determining the appropriateness of using or
|
||||||
|
redistributing the Work and assume any risks associated with Your exercise
|
||||||
|
of permissions under this License.</p>
|
||||||
|
<p><strong>8. Limitation of Liability</strong>. In no event and
|
||||||
|
under no legal theory, whether in tort (including negligence), contract, or
|
||||||
|
otherwise, unless required by applicable law (such as deliberate and
|
||||||
|
grossly negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a result
|
||||||
|
of this License or out of the use or inability to use the Work (including
|
||||||
|
but not limited to damages for loss of goodwill, work stoppage, computer
|
||||||
|
failure or malfunction, or any and all other commercial damages or losses),
|
||||||
|
even if such Contributor has been advised of the possibility of such
|
||||||
|
damages.</p>
|
||||||
|
<p><strong>9. Accepting Warranty or Additional Liability</strong>.
|
||||||
|
While redistributing the Work or Derivative Works thereof, You may choose
|
||||||
|
to offer, and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this License.
|
||||||
|
However, in accepting such obligations, You may act only on Your own behalf
|
||||||
|
and on Your sole responsibility, not on behalf of any other Contributor,
|
||||||
|
and only if You agree to indemnify, defend, and hold each Contributor
|
||||||
|
harmless for any liability incurred by, or claims asserted against, such
|
||||||
|
Contributor by reason of your accepting any such warranty or additional
|
||||||
|
liability.</p>
|
||||||
|
<p>END OF TERMS AND CONDITIONS</p>
|
||||||
|
<h5 id="apply">APPENDIX: How to apply the Apache License to your work</h5>
|
||||||
|
<p>To apply the Apache License to your work, attach the following boilerplate
|
||||||
|
notice, with the fields enclosed by brackets "[]" replaced with your own
|
||||||
|
identifying information. (Don't include the brackets!) The text should be
|
||||||
|
enclosed in the appropriate comment syntax for the file format. We also
|
||||||
|
recommend that a file or class name and description of purpose be included
|
||||||
|
on the same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.</p>
|
||||||
|
<div class="codehilite"><pre>Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<h4>PhoneGap Plugin BarcodeScanner</h4>
|
||||||
|
<p>The MIT License</p>
|
||||||
|
<p>Copyright (c) 2010 Matt Kane</p>
|
||||||
|
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
|
||||||
|
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
|
||||||
|
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" data-dismiss="modal" class="btn btn-default"><i class="fa fa-times"></i> Close</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -11,7 +11,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class='list-group-item'>
|
<div class='list-group-item'>
|
||||||
<p>
|
<p>
|
||||||
<span style='font-weight: bold;'>Cool Stuff We Stole</span>
|
<span style='font-weight: bold;'>Data and Libraries Used</span>
|
||||||
<br />
|
<br />
|
||||||
Map tiles by Stamen Design (stamen.com), under CC BY 3.0 (creativecommons.org/licenses/by/3.0).
|
Map tiles by Stamen Design (stamen.com), under CC BY 3.0 (creativecommons.org/licenses/by/3.0).
|
||||||
<br />
|
<br />
|
||||||
@ -21,14 +21,15 @@
|
|||||||
<br />
|
<br />
|
||||||
Map display is powered by Leaflet (leafletjs.com), copyright (c) 2010-2016, Vladimir Agafonkin and copyright (c) 2010-2011, CloudMade. BSD 2-clause license.
|
Map display is powered by Leaflet (leafletjs.com), copyright (c) 2010-2016, Vladimir Agafonkin and copyright (c) 2010-2011, CloudMade. BSD 2-clause license.
|
||||||
<br />
|
<br />
|
||||||
Terrain information for the United States from the MRLC National Land Cover Database 2011 (mrlc.gov).
|
|
||||||
<br />
|
|
||||||
Weather data Powered by Forecast (forecast.io).
|
Weather data Powered by Forecast (forecast.io).
|
||||||
<br />
|
<br />
|
||||||
Geocache data from the OpenCaching.US OKAPI. Data licensed under the CC BY-NC-SA 2.5 (creativecommons.org/licenses/by-nc-sa/2.5).
|
Application developed using Apache Cordova (Apache License 2.0).
|
||||||
<br />
|
<br />
|
||||||
If you're a developer, you might be interested in this: earth.apis.netsyms.net
|
Barcode scanner code copyright (c) 2010 Matt Kane (MIT License).
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class='list-group-item' onclick="openmodal('licenses', '#license-modal');">
|
||||||
|
Open Source Licenses
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<widget android-versionCode="104000" id="com.netsyms.terranquest.TerranQuest" version="1.4.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:gap="http://phonegap.com/ns/1.0">
|
<widget android-versionCode="104060" id="com.netsyms.terranquest.TerranQuest" version="1.4.6" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:gap="http://phonegap.com/ns/1.0">
|
||||||
<feature name="Camera">
|
<feature name="Camera">
|
||||||
<param name="android-package" value="org.apache.cordova.camera.CameraLauncher" />
|
<param name="android-package" value="org.apache.cordova.camera.CameraLauncher" />
|
||||||
</feature>
|
</feature>
|
||||||
|
708
www/js/home.js
708
www/js/home.js
@ -1,355 +1,355 @@
|
|||||||
/* global PositionError */
|
///* global PositionError */
|
||||||
|
//
|
||||||
//////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
// GPS and terrain stuff
|
//// GPS and terrain stuff
|
||||||
//////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* Handles GPS and terrain data.
|
// * Handles GPS and terrain data.
|
||||||
*/
|
// */
|
||||||
|
//
|
||||||
// Globals
|
//// Globals
|
||||||
lockGot = false;
|
//lockGot = false;
|
||||||
terrainGot = false;
|
//terrainGot = false;
|
||||||
latitude = 0.0000;
|
//latitude = 0.0000;
|
||||||
longitude = 0.0000;
|
//longitude = 0.0000;
|
||||||
gpsaccuracy = 9999;
|
//gpsaccuracy = 9999;
|
||||||
// End Globals
|
//// End Globals
|
||||||
|
//
|
||||||
var lastgpstime = 0;
|
//var lastgpstime = 0;
|
||||||
var terraintypeid = 0;
|
//var terraintypeid = 0;
|
||||||
var map = L.map('map');
|
//var map = L.map('map');
|
||||||
var tileurl = "http://tile.stamen.com/terrain/{z}/{x}/{y}.jpg";
|
//var tileurl = "http://tile.stamen.com/terrain/{z}/{x}/{y}.jpg";
|
||||||
map.setZoom(17);
|
//map.setZoom(17);
|
||||||
map.dragging.disable();
|
//map.dragging.disable();
|
||||||
//map.touchZoom.disable();
|
////map.touchZoom.disable();
|
||||||
//map.doubleClickZoom.disable();
|
////map.doubleClickZoom.disable();
|
||||||
//map.scrollWheelZoom.disable();
|
////map.scrollWheelZoom.disable();
|
||||||
map.keyboard.disable();
|
//map.keyboard.disable();
|
||||||
$(".leaflet-control-zoom").css("visibility", "hidden");
|
//$(".leaflet-control-zoom").css("visibility", "hidden");
|
||||||
// Disable tap handler, if present.
|
//// Disable tap handler, if present.
|
||||||
//if (map.tap) {
|
////if (map.tap) {
|
||||||
// map.tap.disable();
|
//// map.tap.disable();
|
||||||
|
////}
|
||||||
|
//
|
||||||
|
//// Tile layer
|
||||||
|
//map.addLayer(new L.tileLayer(tileurl, {minZoom: 17, maxZoom: 18}));
|
||||||
|
//// Places layer
|
||||||
|
//var placeLayer = L.geoJson(
|
||||||
|
// {"name": "Places", "type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [0, 0]}, "properties": {"osm_id": -1, "name": null}}]},
|
||||||
|
// {
|
||||||
|
// onEachFeature: onPlaceTap,
|
||||||
|
// pointToLayer: function (feature, latlng) {
|
||||||
|
// return L.circleMarker(latlng, {
|
||||||
|
// radius: 14,
|
||||||
|
// fillColor: "#ff7800",
|
||||||
|
// color: "#000",
|
||||||
|
// weight: 1,
|
||||||
|
// opacity: 1,
|
||||||
|
// fillOpacity: 0.6
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }).addTo(map);
|
||||||
|
//
|
||||||
|
//var lc = L.control.locate({
|
||||||
|
// position: 'topleft', // set the location of the control
|
||||||
|
// layer: undefined, // use your own layer for the location marker, creates a new layer by default
|
||||||
|
// drawCircle: false, // controls whether a circle is drawn that shows the uncertainty about the location
|
||||||
|
// follow: true, // follow the user's location
|
||||||
|
// setView: true, // automatically sets the map view to the user's location, enabled if `follow` is true
|
||||||
|
// keepCurrentZoomLevel: true, // keep the current map zoom level when displaying the user's location. (if `false`, use maxZoom)
|
||||||
|
// stopFollowingOnDrag: false, // stop following when the map is dragged if `follow` is true (deprecated, see below)
|
||||||
|
// remainActive: true, // if true locate control remains active on click even if the user's location is in view.
|
||||||
|
// markerClass: L.circleMarker, // L.circleMarker or L.marker
|
||||||
|
// circleStyle: {}, // change the style of the circle around the user's location
|
||||||
|
// markerStyle: {},
|
||||||
|
// followCircleStyle: {}, // set difference for the style of the circle around the user's location while following
|
||||||
|
// followMarkerStyle: {},
|
||||||
|
// icon: 'fa fa-map-marker', // class for icon, fa-location-arrow or fa-map-marker
|
||||||
|
// iconLoading: 'fa fa-spinner fa-pulse', // class for loading icon
|
||||||
|
// iconElementTag: 'span', // tag for the icon element, span or i
|
||||||
|
// circlePadding: [0, 0], // padding around accuracy circle, value is passed to setBounds
|
||||||
|
// metric: true, // use metric or imperial units
|
||||||
|
// onLocationError: function (err) {
|
||||||
|
// }, // define an error callback function
|
||||||
|
// onLocationOutsideMapBounds: function (context) { // called when outside map boundaries
|
||||||
|
// },
|
||||||
|
// showPopup: false, // display a popup when the user click on the inner marker
|
||||||
|
// strings: {
|
||||||
|
// title: ".", // title of the locate control
|
||||||
|
// metersUnit: "meters", // string for metric units
|
||||||
|
// feetUnit: "feet", // string for imperial units
|
||||||
|
// popup: "You are within {distance} {unit} from this point", // text to appear if user clicks on circle
|
||||||
|
// outsideMapBoundsMsg: "You seem located outside the boundaries of the map" // default message for onLocationOutsideMapBounds
|
||||||
|
// },
|
||||||
|
// locateOptions: {} // define location options e.g enableHighAccuracy: true or maxZoom: 10
|
||||||
|
//}).addTo(map);
|
||||||
|
//lc.start();
|
||||||
|
//function mapPos(lat, lon) {
|
||||||
|
// lockGot = true;
|
||||||
|
// hideLoading();
|
||||||
|
// loadPlaces(latitude, longitude);
|
||||||
|
// //map.setView(new L.LatLng(lat, lon), 16, {animate: true});
|
||||||
|
// //map.panTo(new L.LatLng(lat, lon));
|
||||||
|
// //map.invalidateSize();
|
||||||
|
// //redraw('.leaflet-map-pane');
|
||||||
|
//// $('.leaflet-map-plane').css('height', '90%');
|
||||||
|
//// setTimeout(function () {
|
||||||
|
//// $('#map').css('width', '100%');
|
||||||
|
//// $('#map').css('height', '100%');
|
||||||
|
//// }, 100);
|
||||||
//}
|
//}
|
||||||
|
//
|
||||||
// Tile layer
|
//function onPlaceTap(feature, layer) {
|
||||||
map.addLayer(new L.tileLayer(tileurl, {minZoom: 17, maxZoom: 18}));
|
// layer.on('click', function (e) {
|
||||||
// Places layer
|
// openPlace(feature);
|
||||||
var placeLayer = L.geoJson(
|
// });
|
||||||
{"name": "Places", "type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [0, 0]}, "properties": {"osm_id": -1, "name": null}}]},
|
//}
|
||||||
{
|
//
|
||||||
onEachFeature: onPlaceTap,
|
//function loadPlaces(lat, long) {
|
||||||
pointToLayer: function (feature, latlng) {
|
// $.getJSON(
|
||||||
return L.circleMarker(latlng, {
|
// "http://earth.apis.netsyms.net/places.php?format=geojson&lat=" + lat + "&long=" + long + "&radius=.25&names=1",
|
||||||
radius: 14,
|
// function (data) {
|
||||||
fillColor: "#ff7800",
|
// if (data.type === 'FeatureCollection') {
|
||||||
color: "#000",
|
// placeLayer.clearLayers();
|
||||||
weight: 1,
|
// data.features.forEach(function (item) {
|
||||||
opacity: 1,
|
// item.properties.popupContent = "<span class='marker-popup-text' onclick='openplace(" + item.properties.osm_id + ")'>" + item.properties.name + "</span>";
|
||||||
fillOpacity: 0.6
|
// placeLayer.addData(item);
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}).addTo(map);
|
// });
|
||||||
|
//}
|
||||||
var lc = L.control.locate({
|
//
|
||||||
position: 'topleft', // set the location of the control
|
//function openPlace(feature) {
|
||||||
layer: undefined, // use your own layer for the location marker, creates a new layer by default
|
// $('#main-content').load("screens/place.html", null, function () {
|
||||||
drawCircle: false, // controls whether a circle is drawn that shows the uncertainty about the location
|
// loadPlace(feature);
|
||||||
follow: true, // follow the user's location
|
// $('#overlay-main').css('display', 'block');
|
||||||
setView: true, // automatically sets the map view to the user's location, enabled if `follow` is true
|
// });
|
||||||
keepCurrentZoomLevel: true, // keep the current map zoom level when displaying the user's location. (if `false`, use maxZoom)
|
//}
|
||||||
stopFollowingOnDrag: false, // stop following when the map is dragged if `follow` is true (deprecated, see below)
|
//
|
||||||
remainActive: true, // if true locate control remains active on click even if the user's location is in view.
|
///**
|
||||||
markerClass: L.circleMarker, // L.circleMarker or L.marker
|
// * Hide the loading overlay if everything is loaded, otherwise do nothing
|
||||||
circleStyle: {}, // change the style of the circle around the user's location
|
// */
|
||||||
markerStyle: {},
|
//function hideLoading() {
|
||||||
followCircleStyle: {}, // set difference for the style of the circle around the user's location while following
|
// if (lockGot && terrainGot && gpsaccuracy < 30 && $('#loading').css('display') !== 'none') {
|
||||||
followMarkerStyle: {},
|
// $('#loading').fadeOut('slow', function () {
|
||||||
icon: 'fa fa-map-marker', // class for icon, fa-location-arrow or fa-map-marker
|
// $('#loading').css('display', 'none');
|
||||||
iconLoading: 'fa fa-spinner fa-pulse', // class for loading icon
|
// });
|
||||||
iconElementTag: 'span', // tag for the icon element, span or i
|
// }
|
||||||
circlePadding: [0, 0], // padding around accuracy circle, value is passed to setBounds
|
//}
|
||||||
metric: true, // use metric or imperial units
|
//
|
||||||
onLocationError: function (err) {
|
//var updatePosition = function (position) {
|
||||||
}, // define an error callback function
|
// latitude = position.coords.latitude;
|
||||||
onLocationOutsideMapBounds: function (context) { // called when outside map boundaries
|
// longitude = position.coords.longitude;
|
||||||
},
|
// lastgpstime = position.timestamp;
|
||||||
showPopup: false, // display a popup when the user click on the inner marker
|
// gpsaccuracy = position.coords.accuracy;
|
||||||
strings: {
|
// if (gpsaccuracy > 30) {
|
||||||
title: ".", // title of the locate control
|
// $('#no-lock').css('display', 'block');
|
||||||
metersUnit: "meters", // string for metric units
|
// } else {
|
||||||
feetUnit: "feet", // string for imperial units
|
// $('#no-lock').css('display', 'none');
|
||||||
popup: "You are within {distance} {unit} from this point", // text to appear if user clicks on circle
|
// }
|
||||||
outsideMapBoundsMsg: "You seem located outside the boundaries of the map" // default message for onLocationOutsideMapBounds
|
// mapPos(latitude, longitude);
|
||||||
},
|
//};
|
||||||
locateOptions: {} // define location options e.g enableHighAccuracy: true or maxZoom: 10
|
//var updateTerrain = function (position) {
|
||||||
}).addTo(map);
|
// latitude = position.coords.latitude;
|
||||||
lc.start();
|
// longitude = position.coords.longitude;
|
||||||
function mapPos(lat, lon) {
|
// lastgpstime = position.timestamp;
|
||||||
lockGot = true;
|
// gpsaccuracy = position.coords.accuracy;
|
||||||
hideLoading();
|
// var rasterurl = "http://earth.apis.netsyms.net/terrain.php?format=json&lat="
|
||||||
loadPlaces(latitude, longitude);
|
// + latitude + "&long=" + longitude;
|
||||||
//map.setView(new L.LatLng(lat, lon), 16, {animate: true});
|
// $.get(rasterurl, function (data) {
|
||||||
//map.panTo(new L.LatLng(lat, lon));
|
// if (data.status === 'OK') {
|
||||||
//map.invalidateSize();
|
// terraintypeid = data.typeid;
|
||||||
//redraw('.leaflet-map-pane');
|
// terraintypename = data.typename;
|
||||||
// $('.leaflet-map-plane').css('height', '90%');
|
// $('#terrain-image').attr('src', 'assets/terrain/' + terraintypeid + '.png');
|
||||||
// setTimeout(function () {
|
// terrainGot = true;
|
||||||
// $('#map').css('width', '100%');
|
// hideLoading();
|
||||||
// $('#map').css('height', '100%');
|
// }
|
||||||
// }, 100);
|
// }, "json").fail(function (err) {
|
||||||
}
|
// $('#terrain-image').attr('src', 'assets/terrain/0.png');
|
||||||
|
// });
|
||||||
function onPlaceTap(feature, layer) {
|
//};
|
||||||
layer.on('click', function (e) {
|
//function pingServer() {
|
||||||
openPlace(feature);
|
// if (lockGot && gpsaccuracy < 30) {
|
||||||
});
|
// $.get(mkApiUrl('ping') + "?user=" + username + "&lat=" + latitude + "&long=" + longitude);
|
||||||
}
|
// }
|
||||||
|
//}
|
||||||
function loadPlaces(lat, long) {
|
//;
|
||||||
$.getJSON(
|
//function onError(error) {
|
||||||
"http://earth.apis.netsyms.net/places.php?format=geojson&lat=" + lat + "&long=" + long + "&radius=.25&names=1",
|
// $('#loading-error').text("Check your device's network and location settings, and ensure a clear view of the sky.");
|
||||||
function (data) {
|
//}
|
||||||
if (data.type === 'FeatureCollection') {
|
//
|
||||||
placeLayer.clearLayers();
|
//function popGPS() {
|
||||||
data.features.forEach(function (item) {
|
// navigator.notification.alert("Latitude: " + latitude +
|
||||||
item.properties.popupContent = "<span class='marker-popup-text' onclick='openplace(" + item.properties.osm_id + ")'>" + item.properties.name + "</span>";
|
// "\nLongitude: " + longitude +
|
||||||
placeLayer.addData(item);
|
// "\nAccuracy: " + gpsaccuracy +
|
||||||
});
|
// "\nTerrain: " + terraintypename + " (" + terraintypeid + ")",
|
||||||
}
|
// null,
|
||||||
});
|
// "GPS Information",
|
||||||
}
|
// "Close");
|
||||||
|
//}
|
||||||
function openPlace(feature) {
|
//$('#terrain-image').click(function () {
|
||||||
$('#main-content').load("screens/place.html", null, function () {
|
// popGPS();
|
||||||
loadPlace(feature);
|
//});
|
||||||
$('#overlay-main').css('display', 'block');
|
//// Initial GPS position and stuff
|
||||||
});
|
//navigator.geolocation.getCurrentPosition(updateTerrain, onError, {timeout: 10000, enableHighAccuracy: true});
|
||||||
}
|
//// Update position
|
||||||
|
//setInterval(function () {
|
||||||
/**
|
// navigator.geolocation.getCurrentPosition(updatePosition, onError, {timeout: 10000, enableHighAccuracy: true});
|
||||||
* Hide the loading overlay if everything is loaded, otherwise do nothing
|
//}, 1000);
|
||||||
*/
|
//// Update position + terrain
|
||||||
function hideLoading() {
|
//setInterval(function () {
|
||||||
if (lockGot && terrainGot && gpsaccuracy < 30 && $('#loading').css('display') !== 'none') {
|
// navigator.geolocation.getCurrentPosition(updateTerrain, onError, {timeout: 10000, enableHighAccuracy: true});
|
||||||
$('#loading').fadeOut('slow', function () {
|
// loadPlaces(latitude, longitude);
|
||||||
$('#loading').css('display', 'none');
|
//}, 1000 * 20);
|
||||||
});
|
//// Ping the server with coordinates
|
||||||
}
|
//setInterval(pingServer, 5000);
|
||||||
}
|
//// Show error if it's taking too long
|
||||||
|
//setTimeout(function () {
|
||||||
var updatePosition = function (position) {
|
// onError();
|
||||||
latitude = position.coords.latitude;
|
//}, 15 * 1000);
|
||||||
longitude = position.coords.longitude;
|
//
|
||||||
lastgpstime = position.timestamp;
|
//
|
||||||
gpsaccuracy = position.coords.accuracy;
|
////////////////////////////////////////////////
|
||||||
if (gpsaccuracy > 30) {
|
//// Profile, stats, and chat stuff
|
||||||
$('#no-lock').css('display', 'block');
|
////////////////////////////////////////////////
|
||||||
} else {
|
//
|
||||||
$('#no-lock').css('display', 'none');
|
//
|
||||||
}
|
///*
|
||||||
mapPos(latitude, longitude);
|
// * Handles general server communication.
|
||||||
};
|
// */
|
||||||
var updateTerrain = function (position) {
|
//
|
||||||
latitude = position.coords.latitude;
|
///**
|
||||||
longitude = position.coords.longitude;
|
// * Syncs the user's stats with the server and calls refreshStats().
|
||||||
lastgpstime = position.timestamp;
|
// */
|
||||||
gpsaccuracy = position.coords.accuracy;
|
//function syncStats() {
|
||||||
var rasterurl = "http://earth.apis.netsyms.net/terrain.php?format=json&lat="
|
// $.getJSON(mkApiUrl('getstats'), {
|
||||||
+ latitude + "&long=" + longitude;
|
// user: username
|
||||||
$.get(rasterurl, function (data) {
|
// }, function (data) {
|
||||||
if (data.status === 'OK') {
|
// if (data.status === 'OK') {
|
||||||
terraintypeid = data.typeid;
|
// maxenergy = data.stats.maxenergy;
|
||||||
terraintypename = data.typename;
|
// energy = data.stats.energy;
|
||||||
$('#terrain-image').attr('src', 'assets/terrain/' + terraintypeid + '.png');
|
// level = data.stats.level;
|
||||||
terrainGot = true;
|
// refreshStats();
|
||||||
hideLoading();
|
// }
|
||||||
}
|
// });
|
||||||
}, "json").fail(function (err) {
|
//}
|
||||||
$('#terrain-image').attr('src', 'assets/terrain/0.png');
|
//
|
||||||
});
|
///**
|
||||||
};
|
// * Display the current stats on the home screen.
|
||||||
function pingServer() {
|
// */
|
||||||
if (lockGot && gpsaccuracy < 30) {
|
//function refreshStats() {
|
||||||
$.get(mkApiUrl('ping') + "?user=" + username + "&lat=" + latitude + "&long=" + longitude);
|
// energypercent = (energy * 1.0 / maxenergy * 1.0) * 100.0;
|
||||||
}
|
// $('#energybar').css('width', String(energypercent) + '%');
|
||||||
}
|
//}
|
||||||
;
|
//
|
||||||
function onError(error) {
|
//function getChat() {
|
||||||
$('#loading-error').text("Check your device's network and location settings, and ensure a clear view of the sky.");
|
// if (lockGot) {
|
||||||
}
|
// $.getJSON(mkApiUrl('chat', 'cs'), {
|
||||||
|
// lat: latitude,
|
||||||
function popGPS() {
|
// long: longitude
|
||||||
navigator.notification.alert("Latitude: " + latitude +
|
// }, function (data) {
|
||||||
"\nLongitude: " + longitude +
|
// data = sortResults(data, 'time', true);
|
||||||
"\nAccuracy: " + gpsaccuracy +
|
// var content = "";
|
||||||
"\nTerrain: " + terraintypename + " (" + terraintypeid + ")",
|
// data.forEach(function (msg) {
|
||||||
null,
|
// content += "<span class='chat-username' onclick='openProfile(\"" + msg.username + "\");'>" + msg.username + "</span> " + msg.message + "<br />";
|
||||||
"GPS Information",
|
// });
|
||||||
"Close");
|
// $('#chatmsgs').html(content);
|
||||||
}
|
// });
|
||||||
$('#terrain-image').click(function () {
|
// }
|
||||||
popGPS();
|
//}
|
||||||
});
|
//
|
||||||
// Initial GPS position and stuff
|
//
|
||||||
navigator.geolocation.getCurrentPosition(updateTerrain, onError, {timeout: 10000, enableHighAccuracy: true});
|
//syncStats();
|
||||||
// Update position
|
//setInterval(function () {
|
||||||
setInterval(function () {
|
// syncStats();
|
||||||
navigator.geolocation.getCurrentPosition(updatePosition, onError, {timeout: 10000, enableHighAccuracy: true});
|
//}, 10 * 1000);
|
||||||
}, 1000);
|
//setInterval(function () {
|
||||||
// Update position + terrain
|
// getChat();
|
||||||
setInterval(function () {
|
//}, 2000);
|
||||||
navigator.geolocation.getCurrentPosition(updateTerrain, onError, {timeout: 10000, enableHighAccuracy: true});
|
//// Send chat messages
|
||||||
loadPlaces(latitude, longitude);
|
//$("#chatsendform").submit(function (event) {
|
||||||
}, 1000 * 20);
|
// message = $('#chatbox-input').val();
|
||||||
// Ping the server with coordinates
|
// if (message !== '') {
|
||||||
setInterval(pingServer, 5000);
|
// $.post(mkApiUrl('chat', 'cs'), {
|
||||||
// Show error if it's taking too long
|
// user: username,
|
||||||
setTimeout(function () {
|
// lat: latitude,
|
||||||
onError();
|
// long: longitude,
|
||||||
}, 15 * 1000);
|
// msg: message
|
||||||
|
// }, function (data) {
|
||||||
|
// if (data.status === 'OK') {
|
||||||
//////////////////////////////////////////////
|
// $('#chatbox-input').val("");
|
||||||
// Profile, stats, and chat stuff
|
// $("#chatmsgs").animate({scrollTop: $('#chatmsgs').prop("scrollHeight")}, 1000);
|
||||||
//////////////////////////////////////////////
|
// }
|
||||||
|
// }, "json");
|
||||||
|
// }
|
||||||
/*
|
// event.preventDefault();
|
||||||
* Handles general server communication.
|
// return false;
|
||||||
*/
|
//});
|
||||||
|
//function toggleChat() {
|
||||||
/**
|
// if ($('#chatmsgs').css('display') === 'none') {
|
||||||
* Syncs the user's stats with the server and calls refreshStats().
|
// openChat();
|
||||||
*/
|
// } else {
|
||||||
function syncStats() {
|
// closeChat();
|
||||||
$.getJSON(mkApiUrl('getstats'), {
|
// }
|
||||||
user: username
|
//}
|
||||||
}, function (data) {
|
//
|
||||||
if (data.status === 'OK') {
|
//function closeChat() {
|
||||||
maxenergy = data.stats.maxenergy;
|
// $('#chatmsgs').css('display', 'none');
|
||||||
energy = data.stats.energy;
|
// $('#chatbox').css('height', 'auto');
|
||||||
level = data.stats.level;
|
//}
|
||||||
refreshStats();
|
//
|
||||||
}
|
//function openChat() {
|
||||||
});
|
// $('#chatbox').css('height', '50%');
|
||||||
}
|
// $('#chatmsgs').css('display', 'block');
|
||||||
|
// $("#chatmsgs").animate({scrollTop: $('#chatmsgs').prop("scrollHeight")}, 1000);
|
||||||
/**
|
//}
|
||||||
* Display the current stats on the home screen.
|
//
|
||||||
*/
|
//function openProfile(user) {
|
||||||
function refreshStats() {
|
// user = typeof user !== 'undefined' ? user : username;
|
||||||
energypercent = (energy * 1.0 / maxenergy * 1.0) * 100.0;
|
// $('#main-content').load("screens/profile.html", null, function (x) {
|
||||||
$('#energybar').css('width', String(energypercent) + '%');
|
// $('#overlay-main').css('display', 'block');
|
||||||
}
|
// loadProfile(user);
|
||||||
|
// });
|
||||||
function getChat() {
|
//}
|
||||||
if (lockGot) {
|
//
|
||||||
$.getJSON(mkApiUrl('chat', 'cs'), {
|
//function openRules() {
|
||||||
lat: latitude,
|
// openmodal('rules', '#rules-modal');
|
||||||
long: longitude
|
//}
|
||||||
}, function (data) {
|
//
|
||||||
data = sortResults(data, 'time', true);
|
//function openMenu(topage) {
|
||||||
var content = "";
|
// topage = typeof topage !== 'undefined' ? topage : "";
|
||||||
data.forEach(function (msg) {
|
// $('#main-content').load("screens/menu.html", null, function (x) {
|
||||||
content += "<span class='chat-username' onclick='openProfile(\"" + msg.username + "\");'>" + msg.username + "</span> " + msg.message + "<br />";
|
// $('#overlay-main').css('display', 'block');
|
||||||
});
|
// if (topage !== '') {
|
||||||
$('#chatmsgs').html(content);
|
// $('#' + topage + '-tab').tab('show');
|
||||||
});
|
// }
|
||||||
}
|
// });
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
|
//
|
||||||
syncStats();
|
//
|
||||||
setInterval(function () {
|
////////////////////////////////////////////////
|
||||||
syncStats();
|
//// Other things
|
||||||
}, 10 * 1000);
|
////////////////////////////////////////////////
|
||||||
setInterval(function () {
|
//
|
||||||
getChat();
|
//function closeMain() {
|
||||||
}, 2000);
|
// $('#overlay-main').slideDown(100, function () {
|
||||||
// Send chat messages
|
// $('#overlay-main').css('display', 'none');
|
||||||
$("#chatsendform").submit(function (event) {
|
// $('#main-content').html("");
|
||||||
message = $('#chatbox-input').val();
|
// });
|
||||||
if (message !== '') {
|
//}
|
||||||
$.post(mkApiUrl('chat', 'cs'), {
|
//
|
||||||
user: username,
|
//// Handle back button to close things
|
||||||
lat: latitude,
|
//document.addEventListener("backbutton", function (event) {
|
||||||
long: longitude,
|
// if ($('#overlay-main').css('display') !== 'none') {
|
||||||
msg: message
|
// closeMain();
|
||||||
}, function (data) {
|
// } else if ($('#chatmsgs').css('display') !== 'none') {
|
||||||
if (data.status === 'OK') {
|
// toggleChat();
|
||||||
$('#chatbox-input').val("");
|
// }
|
||||||
$("#chatmsgs").animate({scrollTop: $('#chatmsgs').prop("scrollHeight")}, 1000);
|
//}, false);
|
||||||
}
|
//// Show the rules
|
||||||
}, "json");
|
//if (localStorage.getItem("seenrules") !== 'yes') {
|
||||||
}
|
// openRules();
|
||||||
event.preventDefault();
|
// localStorage.setItem("seenrules", 'yes');
|
||||||
return false;
|
//}
|
||||||
});
|
|
||||||
function toggleChat() {
|
|
||||||
if ($('#chatmsgs').css('display') === 'none') {
|
|
||||||
openChat();
|
|
||||||
} else {
|
|
||||||
closeChat();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function closeChat() {
|
|
||||||
$('#chatmsgs').css('display', 'none');
|
|
||||||
$('#chatbox').css('height', 'auto');
|
|
||||||
}
|
|
||||||
|
|
||||||
function openChat() {
|
|
||||||
$('#chatbox').css('height', '50%');
|
|
||||||
$('#chatmsgs').css('display', 'block');
|
|
||||||
$("#chatmsgs").animate({scrollTop: $('#chatmsgs').prop("scrollHeight")}, 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
function openProfile(user) {
|
|
||||||
user = typeof user !== 'undefined' ? user : username;
|
|
||||||
$('#main-content').load("screens/profile.html", null, function (x) {
|
|
||||||
$('#overlay-main').css('display', 'block');
|
|
||||||
loadProfile(user);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function openRules() {
|
|
||||||
openmodal('rules', '#rules-modal');
|
|
||||||
}
|
|
||||||
|
|
||||||
function openMenu(topage) {
|
|
||||||
topage = typeof topage !== 'undefined' ? topage : "";
|
|
||||||
$('#main-content').load("screens/menu.html", null, function (x) {
|
|
||||||
$('#overlay-main').css('display', 'block');
|
|
||||||
if (topage !== '') {
|
|
||||||
$('#' + topage + '-tab').tab('show');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////
|
|
||||||
// Other things
|
|
||||||
//////////////////////////////////////////////
|
|
||||||
|
|
||||||
function closeMain() {
|
|
||||||
$('#overlay-main').slideDown(100, function () {
|
|
||||||
$('#overlay-main').css('display', 'none');
|
|
||||||
$('#main-content').html("");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle back button to close things
|
|
||||||
document.addEventListener("backbutton", function (event) {
|
|
||||||
if ($('#overlay-main').css('display') !== 'none') {
|
|
||||||
closeMain();
|
|
||||||
} else if ($('#chatmsgs').css('display') !== 'none') {
|
|
||||||
toggleChat();
|
|
||||||
}
|
|
||||||
}, false);
|
|
||||||
// Show the rules
|
|
||||||
if (localStorage.getItem("seenrules") !== 'yes') {
|
|
||||||
openRules();
|
|
||||||
localStorage.setItem("seenrules", 'yes');
|
|
||||||
}
|
|
199
www/screens/licenses.html
Normal file
199
www/screens/licenses.html
Normal file
@ -0,0 +1,199 @@
|
|||||||
|
<div id="license-modal" class="modal fade" tabindex="-1" role="dialog">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
<h4 class="modal-title">Open Source Licenses</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<h4>Apache Cordova</h4>
|
||||||
|
<p>Apache License<br>Version 2.0, January 2004<br>
|
||||||
|
http://www.apache.org/licenses/</p>
|
||||||
|
<p>TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION</p>
|
||||||
|
<p><strong>1. Definitions</strong>.</p>
|
||||||
|
<p>"License" shall mean the terms and conditions for use, reproduction, and
|
||||||
|
distribution as defined by Sections 1 through 9 of this document.</p>
|
||||||
|
<p>"Licensor" shall mean the copyright owner or entity authorized by the
|
||||||
|
copyright owner that is granting the License.</p>
|
||||||
|
<p>"Legal Entity" shall mean the union of the acting entity and all other
|
||||||
|
entities that control, are controlled by, or are under common control with
|
||||||
|
that entity. For the purposes of this definition, "control" means (i) the
|
||||||
|
power, direct or indirect, to cause the direction or management of such
|
||||||
|
entity, whether by contract or otherwise, or (ii) ownership of fifty
|
||||||
|
percent (50%) or more of the outstanding shares, or (iii) beneficial
|
||||||
|
ownership of such entity.</p>
|
||||||
|
<p>"You" (or "Your") shall mean an individual or Legal Entity exercising
|
||||||
|
permissions granted by this License.</p>
|
||||||
|
<p>"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation source,
|
||||||
|
and configuration files.</p>
|
||||||
|
<p>"Object" form shall mean any form resulting from mechanical transformation
|
||||||
|
or translation of a Source form, including but not limited to compiled
|
||||||
|
object code, generated documentation, and conversions to other media types.</p>
|
||||||
|
<p>"Work" shall mean the work of authorship, whether in Source or Object form,
|
||||||
|
made available under the License, as indicated by a copyright notice that
|
||||||
|
is included in or attached to the work (an example is provided in the
|
||||||
|
Appendix below).</p>
|
||||||
|
<p>"Derivative Works" shall mean any work, whether in Source or Object form,
|
||||||
|
that is based on (or derived from) the Work and for which the editorial
|
||||||
|
revisions, annotations, elaborations, or other modifications represent, as
|
||||||
|
a whole, an original work of authorship. For the purposes of this License,
|
||||||
|
Derivative Works shall not include works that remain separable from, or
|
||||||
|
merely link (or bind by name) to the interfaces of, the Work and Derivative
|
||||||
|
Works thereof.</p>
|
||||||
|
<p>"Contribution" shall mean any work of authorship, including the original
|
||||||
|
version of the Work and any modifications or additions to that Work or
|
||||||
|
Derivative Works thereof, that is intentionally submitted to Licensor for
|
||||||
|
inclusion in the Work by the copyright owner or by an individual or Legal
|
||||||
|
Entity authorized to submit on behalf of the copyright owner. For the
|
||||||
|
purposes of this definition, "submitted" means any form of electronic,
|
||||||
|
verbal, or written communication sent to the Licensor or its
|
||||||
|
representatives, including but not limited to communication on electronic
|
||||||
|
mailing lists, source code control systems, and issue tracking systems that
|
||||||
|
are managed by, or on behalf of, the Licensor for the purpose of discussing
|
||||||
|
and improving the Work, but excluding communication that is conspicuously
|
||||||
|
marked or otherwise designated in writing by the copyright owner as "Not a
|
||||||
|
Contribution."</p>
|
||||||
|
<p>"Contributor" shall mean Licensor and any individual or Legal Entity on
|
||||||
|
behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.</p>
|
||||||
|
<p><strong>2. Grant of Copyright License</strong>. Subject to the
|
||||||
|
terms and conditions of this License, each Contributor hereby grants to You
|
||||||
|
a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of, publicly
|
||||||
|
display, publicly perform, sublicense, and distribute the Work and such
|
||||||
|
Derivative Works in Source or Object form.</p>
|
||||||
|
<p><strong>3. Grant of Patent License</strong>. Subject to the terms
|
||||||
|
and conditions of this License, each Contributor hereby grants to You a
|
||||||
|
perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made, use,
|
||||||
|
offer to sell, sell, import, and otherwise transfer the Work, where such
|
||||||
|
license applies only to those patent claims licensable by such Contributor
|
||||||
|
that are necessarily infringed by their Contribution(s) alone or by
|
||||||
|
combination of their Contribution(s) with the Work to which such
|
||||||
|
Contribution(s) was submitted. If You institute patent litigation against
|
||||||
|
any entity (including a cross-claim or counterclaim in a lawsuit) alleging
|
||||||
|
that the Work or a Contribution incorporated within the Work constitutes
|
||||||
|
direct or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate as of the
|
||||||
|
date such litigation is filed.</p>
|
||||||
|
<p><strong>4. Redistribution</strong>. You may reproduce and
|
||||||
|
distribute copies of the Work or Derivative Works thereof in any medium,
|
||||||
|
with or without modifications, and in Source or Object form, provided that
|
||||||
|
You meet the following conditions:</p>
|
||||||
|
<ol style="list-style: lower-latin;">
|
||||||
|
<li>You must give any other recipients of the Work or Derivative Works a
|
||||||
|
copy of this License; and</li>
|
||||||
|
|
||||||
|
<li>You must cause any modified files to carry prominent notices stating
|
||||||
|
that You changed the files; and</li>
|
||||||
|
|
||||||
|
<li>You must retain, in the Source form of any Derivative Works that You
|
||||||
|
distribute, all copyright, patent, trademark, and attribution notices from
|
||||||
|
the Source form of the Work, excluding those notices that do not pertain to
|
||||||
|
any part of the Derivative Works; and</li>
|
||||||
|
|
||||||
|
<li>If the Work includes a "NOTICE" text file as part of its distribution,
|
||||||
|
then any Derivative Works that You distribute must include a readable copy
|
||||||
|
of the attribution notices contained within such NOTICE file, excluding
|
||||||
|
those notices that do not pertain to any part of the Derivative Works, in
|
||||||
|
at least one of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or documentation,
|
||||||
|
if provided along with the Derivative Works; or, within a display generated
|
||||||
|
by the Derivative Works, if and wherever such third-party notices normally
|
||||||
|
appear. The contents of the NOTICE file are for informational purposes only
|
||||||
|
and do not modify the License. You may add Your own attribution notices
|
||||||
|
within Derivative Works that You distribute, alongside or as an addendum to
|
||||||
|
the NOTICE text from the Work, provided that such additional attribution
|
||||||
|
notices cannot be construed as modifying the License.
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
You may add Your own copyright statement to Your modifications and may
|
||||||
|
provide additional or different license terms and conditions for use,
|
||||||
|
reproduction, or distribution of Your modifications, or for any such
|
||||||
|
Derivative Works as a whole, provided Your use, reproduction, and
|
||||||
|
distribution of the Work otherwise complies with the conditions stated in
|
||||||
|
this License.
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<p><strong>5. Submission of Contributions</strong>. Unless You
|
||||||
|
explicitly state otherwise, any Contribution intentionally submitted for
|
||||||
|
inclusion in the Work by You to the Licensor shall be under the terms and
|
||||||
|
conditions of this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify the
|
||||||
|
terms of any separate license agreement you may have executed with Licensor
|
||||||
|
regarding such Contributions.</p>
|
||||||
|
<p><strong>6. Trademarks</strong>. This License does not grant
|
||||||
|
permission to use the trade names, trademarks, service marks, or product
|
||||||
|
names of the Licensor, except as required for reasonable and customary use
|
||||||
|
in describing the origin of the Work and reproducing the content of the
|
||||||
|
NOTICE file.</p>
|
||||||
|
<p><strong>7. Disclaimer of Warranty</strong>. Unless required by
|
||||||
|
applicable law or agreed to in writing, Licensor provides the Work (and
|
||||||
|
each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT
|
||||||
|
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including,
|
||||||
|
without limitation, any warranties or conditions of TITLE,
|
||||||
|
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You
|
||||||
|
are solely responsible for determining the appropriateness of using or
|
||||||
|
redistributing the Work and assume any risks associated with Your exercise
|
||||||
|
of permissions under this License.</p>
|
||||||
|
<p><strong>8. Limitation of Liability</strong>. In no event and
|
||||||
|
under no legal theory, whether in tort (including negligence), contract, or
|
||||||
|
otherwise, unless required by applicable law (such as deliberate and
|
||||||
|
grossly negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a result
|
||||||
|
of this License or out of the use or inability to use the Work (including
|
||||||
|
but not limited to damages for loss of goodwill, work stoppage, computer
|
||||||
|
failure or malfunction, or any and all other commercial damages or losses),
|
||||||
|
even if such Contributor has been advised of the possibility of such
|
||||||
|
damages.</p>
|
||||||
|
<p><strong>9. Accepting Warranty or Additional Liability</strong>.
|
||||||
|
While redistributing the Work or Derivative Works thereof, You may choose
|
||||||
|
to offer, and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this License.
|
||||||
|
However, in accepting such obligations, You may act only on Your own behalf
|
||||||
|
and on Your sole responsibility, not on behalf of any other Contributor,
|
||||||
|
and only if You agree to indemnify, defend, and hold each Contributor
|
||||||
|
harmless for any liability incurred by, or claims asserted against, such
|
||||||
|
Contributor by reason of your accepting any such warranty or additional
|
||||||
|
liability.</p>
|
||||||
|
<p>END OF TERMS AND CONDITIONS</p>
|
||||||
|
<h5 id="apply">APPENDIX: How to apply the Apache License to your work</h5>
|
||||||
|
<p>To apply the Apache License to your work, attach the following boilerplate
|
||||||
|
notice, with the fields enclosed by brackets "[]" replaced with your own
|
||||||
|
identifying information. (Don't include the brackets!) The text should be
|
||||||
|
enclosed in the appropriate comment syntax for the file format. We also
|
||||||
|
recommend that a file or class name and description of purpose be included
|
||||||
|
on the same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.</p>
|
||||||
|
<div class="codehilite"><pre>Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<h4>PhoneGap Plugin BarcodeScanner</h4>
|
||||||
|
<p>The MIT License</p>
|
||||||
|
<p>Copyright (c) 2010 Matt Kane</p>
|
||||||
|
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
|
||||||
|
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
|
||||||
|
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" data-dismiss="modal" class="btn btn-default"><i class="fa fa-times"></i> Close</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -11,7 +11,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class='list-group-item'>
|
<div class='list-group-item'>
|
||||||
<p>
|
<p>
|
||||||
<span style='font-weight: bold;'>Cool Stuff We Stole</span>
|
<span style='font-weight: bold;'>Data and Libraries Used</span>
|
||||||
<br />
|
<br />
|
||||||
Map tiles by Stamen Design (stamen.com), under CC BY 3.0 (creativecommons.org/licenses/by/3.0).
|
Map tiles by Stamen Design (stamen.com), under CC BY 3.0 (creativecommons.org/licenses/by/3.0).
|
||||||
<br />
|
<br />
|
||||||
@ -21,14 +21,15 @@
|
|||||||
<br />
|
<br />
|
||||||
Map display is powered by Leaflet (leafletjs.com), copyright (c) 2010-2016, Vladimir Agafonkin and copyright (c) 2010-2011, CloudMade. BSD 2-clause license.
|
Map display is powered by Leaflet (leafletjs.com), copyright (c) 2010-2016, Vladimir Agafonkin and copyright (c) 2010-2011, CloudMade. BSD 2-clause license.
|
||||||
<br />
|
<br />
|
||||||
Terrain information for the United States from the MRLC National Land Cover Database 2011 (mrlc.gov).
|
|
||||||
<br />
|
|
||||||
Weather data Powered by Forecast (forecast.io).
|
Weather data Powered by Forecast (forecast.io).
|
||||||
<br />
|
<br />
|
||||||
Geocache data from the OpenCaching.US OKAPI. Data licensed under the CC BY-NC-SA 2.5 (creativecommons.org/licenses/by-nc-sa/2.5).
|
Application developed using Apache Cordova (Apache License 2.0).
|
||||||
<br />
|
<br />
|
||||||
If you're a developer, you might be interested in this: earth.apis.netsyms.net
|
Barcode scanner code copyright (c) 2010 Matt Kane (MIT License).
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class='list-group-item' onclick="openmodal('licenses', '#license-modal');">
|
||||||
|
Open Source Licenses
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
Reference in New Issue
Block a user