Add Munzee code (unusable until Munzee API people talk to us)
This commit is contained in:
parent
343a467b6f
commit
a052c5a0ac
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -330,7 +330,7 @@ body {
|
||||
color: black;
|
||||
}
|
||||
|
||||
#found-box {
|
||||
.found-box {
|
||||
position: absolute;
|
||||
z-index: 9001;
|
||||
background: rgba(0, 0, 0, .5);
|
||||
@ -344,18 +344,26 @@ body {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#found-box-title {
|
||||
.found-box-title {
|
||||
font-size: 120%;
|
||||
color: white;
|
||||
border-left: 1px solid white;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
#found-box-text {
|
||||
.found-box-text {
|
||||
color: white;
|
||||
border-top: 1px solid white;
|
||||
border-right: 1px solid white;
|
||||
padding-right: 5px;
|
||||
padding-left: 5px;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
#munzeeoauth {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
@ -156,6 +156,7 @@ function dologin() {
|
||||
$('#errorbase').css('display', 'block');
|
||||
$('#loading').css('display', 'none');
|
||||
authOpInProgress = false;
|
||||
serverProblemsDialog("Cannot connect to game server.");
|
||||
});
|
||||
} else {
|
||||
$('#loginBtn').html('<i class="fa fa-sign-in"></i> Login');
|
||||
@ -172,6 +173,7 @@ function dologin() {
|
||||
$('#errorbase').css('display', 'block');
|
||||
$('#loading').css('display', 'none');
|
||||
authOpInProgress = false;
|
||||
serverProblemsDialog("Cannot connect to login server.");
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,8 @@ energy = 100;
|
||||
maxenergy = 100;
|
||||
level = 1;
|
||||
userteamid = 0;
|
||||
MUNZEE_CLIENT_ID = '616cecc70e17f4a3cb64146dce2d33f5';
|
||||
MUNZEE_REDIRECT = 'http://gs.terranquest.net/munzee.php';
|
||||
|
||||
/*
|
||||
* Runs when the app opens
|
||||
@ -22,8 +24,12 @@ function onDeviceReady() {
|
||||
}
|
||||
}
|
||||
|
||||
function serverProblemsDialog() {
|
||||
openscreen("servererror");
|
||||
function serverProblemsDialog(errmsg) {
|
||||
$('#content-zone').load("screens/servererror.html", function () {
|
||||
if (typeof errmsg !== 'undefined') {
|
||||
$('#serverproblemmsg').text(errmsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function mkApiUrl(action, server) {
|
||||
@ -84,11 +90,17 @@ function scanCode() {
|
||||
function (result) {
|
||||
if (!result.cancelled) {
|
||||
$.getJSON(mkApiUrl('code2item', 'gs'), {
|
||||
code: result.text
|
||||
code: result.text,
|
||||
latitude: latitude,
|
||||
longitude: longitude,
|
||||
accuracy: gpsaccuracy
|
||||
}, function (data) {
|
||||
if (data.status === 'OK') {
|
||||
//navigator.notification.alert("Found one " + data.message, null, "Found an item!", 'OK');
|
||||
showFoundBox("Found an item!", "Found one " + data.message);
|
||||
if (data.messages.length >= 2) {
|
||||
showFoundBox2(data.messages[0].title, data.messages[0].text, data.messages[1].title, data.messages[1].text);
|
||||
} else {
|
||||
showFoundBox(data.messages[0].title, data.messages[0].text);
|
||||
}
|
||||
} else {
|
||||
showFoundBox("Huh?", data.message);
|
||||
}
|
||||
|
@ -41,11 +41,26 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="found-box">
|
||||
<div id="found-box-title">
|
||||
<div id="found-box" class="found-box">
|
||||
<div class="found-box-title" id="found-box-title">
|
||||
|
||||
</div>
|
||||
<div id="found-box-text">
|
||||
<div class="found-box-text" id="found-box-text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="found-box-2" class="found-box">
|
||||
<div class="found-box-title" id="found-box-title-1">
|
||||
|
||||
</div>
|
||||
<div class="found-box-text" id="found-box-text-1">
|
||||
|
||||
</div>
|
||||
<div class="found-box-title" id="found-box-title-2">
|
||||
|
||||
</div>
|
||||
<div class="found-box-text" id="found-box-text-2">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -74,10 +89,25 @@
|
||||
$('#found-box').fadeOut('slow');
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
function showFoundBox2(title, text, title2, text2) {
|
||||
$('#found-box-title-1').text(title);
|
||||
$('#found-box-text-1').text(text);
|
||||
$('#found-box-title-2').text(title2);
|
||||
$('#found-box-text-2').text(text2);
|
||||
$('#found-box-2').fadeIn('fast');
|
||||
setTimeout(function () {
|
||||
$('#found-box-2').fadeOut('slow');
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
$('#found-box').click(function (e) {
|
||||
$('#found-box').fadeOut('fast');
|
||||
});
|
||||
|
||||
$('#found-box-2').click(function (e) {
|
||||
$('#found-box').fadeOut('fast');
|
||||
});
|
||||
</script>
|
||||
<script src="js/location.js"></script>
|
||||
<script src="js/user.js"></script>
|
11
platforms/android/assets/www/screens/munzeelink.html
Normal file
11
platforms/android/assets/www/screens/munzeelink.html
Normal file
@ -0,0 +1,11 @@
|
||||
<iframe id="munzeeoauth" src="about:blank"></iframe>
|
||||
|
||||
<script>
|
||||
setTimeout(function () {
|
||||
$('#munzeeoauth').attr('src', 'https://api.munzee.com/oauth?response_type=code&client_id='
|
||||
+ MUNZEE_CLIENT_ID
|
||||
+ '&redirect_uri='
|
||||
+ MUNZEE_REDIRECT
|
||||
+ '&scope=read');// capture_light');
|
||||
}, 1000);
|
||||
</script>
|
@ -5,7 +5,7 @@
|
||||
<br />
|
||||
<i class="fa fa-exclamation-triangle fa-3x"></i>
|
||||
<br />
|
||||
(sorry)
|
||||
<span id="serverproblemmsg">(sorry)</span>
|
||||
<div style="background: url(assets/mountains-simple.svg) repeat-x; background-size: auto 100%; height: 20%; position: absolute; bottom: 0; width: 100%;"></div>
|
||||
</div>
|
||||
<script>
|
||||
|
@ -6,6 +6,11 @@
|
||||
<div class='list-group-item' onclick='openRules()'>
|
||||
Show Rules
|
||||
</div>
|
||||
<div class='list-group-item' onclick='openscreen("munzeelink")'>
|
||||
Link with Munzee account
|
||||
<br />
|
||||
<span class="small">When you link a Munzee account, any Munzee QR codes you scan will be automatically captured in Munzee as well.</span>
|
||||
</div>
|
||||
<div class='list-group-item' onclick='askLogout()'>
|
||||
Logout from app
|
||||
</div>
|
||||
|
@ -330,7 +330,7 @@ body {
|
||||
color: black;
|
||||
}
|
||||
|
||||
#found-box {
|
||||
.found-box {
|
||||
position: absolute;
|
||||
z-index: 9001;
|
||||
background: rgba(0, 0, 0, .5);
|
||||
@ -344,18 +344,26 @@ body {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#found-box-title {
|
||||
.found-box-title {
|
||||
font-size: 120%;
|
||||
color: white;
|
||||
border-left: 1px solid white;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
#found-box-text {
|
||||
.found-box-text {
|
||||
color: white;
|
||||
border-top: 1px solid white;
|
||||
border-right: 1px solid white;
|
||||
padding-right: 5px;
|
||||
padding-left: 5px;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
#munzeeoauth {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
@ -156,6 +156,7 @@ function dologin() {
|
||||
$('#errorbase').css('display', 'block');
|
||||
$('#loading').css('display', 'none');
|
||||
authOpInProgress = false;
|
||||
serverProblemsDialog("Cannot connect to game server.");
|
||||
});
|
||||
} else {
|
||||
$('#loginBtn').html('<i class="fa fa-sign-in"></i> Login');
|
||||
@ -172,6 +173,7 @@ function dologin() {
|
||||
$('#errorbase').css('display', 'block');
|
||||
$('#loading').css('display', 'none');
|
||||
authOpInProgress = false;
|
||||
serverProblemsDialog("Cannot connect to login server.");
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,8 @@ energy = 100;
|
||||
maxenergy = 100;
|
||||
level = 1;
|
||||
userteamid = 0;
|
||||
MUNZEE_CLIENT_ID = '616cecc70e17f4a3cb64146dce2d33f5';
|
||||
MUNZEE_REDIRECT = 'http://gs.terranquest.net/munzee.php';
|
||||
|
||||
/*
|
||||
* Runs when the app opens
|
||||
@ -22,8 +24,12 @@ function onDeviceReady() {
|
||||
}
|
||||
}
|
||||
|
||||
function serverProblemsDialog() {
|
||||
openscreen("servererror");
|
||||
function serverProblemsDialog(errmsg) {
|
||||
$('#content-zone').load("screens/servererror.html", function () {
|
||||
if (typeof errmsg !== 'undefined') {
|
||||
$('#serverproblemmsg').text(errmsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function mkApiUrl(action, server) {
|
||||
@ -84,11 +90,17 @@ function scanCode() {
|
||||
function (result) {
|
||||
if (!result.cancelled) {
|
||||
$.getJSON(mkApiUrl('code2item', 'gs'), {
|
||||
code: result.text
|
||||
code: result.text,
|
||||
latitude: latitude,
|
||||
longitude: longitude,
|
||||
accuracy: gpsaccuracy
|
||||
}, function (data) {
|
||||
if (data.status === 'OK') {
|
||||
//navigator.notification.alert("Found one " + data.message, null, "Found an item!", 'OK');
|
||||
showFoundBox("Found an item!", "Found one " + data.message);
|
||||
if (data.messages.length >= 2) {
|
||||
showFoundBox2(data.messages[0].title, data.messages[0].text, data.messages[1].title, data.messages[1].text);
|
||||
} else {
|
||||
showFoundBox(data.messages[0].title, data.messages[0].text);
|
||||
}
|
||||
} else {
|
||||
showFoundBox("Huh?", data.message);
|
||||
}
|
||||
|
@ -41,11 +41,26 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="found-box">
|
||||
<div id="found-box-title">
|
||||
<div id="found-box" class="found-box">
|
||||
<div class="found-box-title" id="found-box-title">
|
||||
|
||||
</div>
|
||||
<div id="found-box-text">
|
||||
<div class="found-box-text" id="found-box-text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="found-box-2" class="found-box">
|
||||
<div class="found-box-title" id="found-box-title-1">
|
||||
|
||||
</div>
|
||||
<div class="found-box-text" id="found-box-text-1">
|
||||
|
||||
</div>
|
||||
<div class="found-box-title" id="found-box-title-2">
|
||||
|
||||
</div>
|
||||
<div class="found-box-text" id="found-box-text-2">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -74,10 +89,25 @@
|
||||
$('#found-box').fadeOut('slow');
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
function showFoundBox2(title, text, title2, text2) {
|
||||
$('#found-box-title-1').text(title);
|
||||
$('#found-box-text-1').text(text);
|
||||
$('#found-box-title-2').text(title2);
|
||||
$('#found-box-text-2').text(text2);
|
||||
$('#found-box-2').fadeIn('fast');
|
||||
setTimeout(function () {
|
||||
$('#found-box-2').fadeOut('slow');
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
$('#found-box').click(function (e) {
|
||||
$('#found-box').fadeOut('fast');
|
||||
});
|
||||
|
||||
$('#found-box-2').click(function (e) {
|
||||
$('#found-box').fadeOut('fast');
|
||||
});
|
||||
</script>
|
||||
<script src="js/location.js"></script>
|
||||
<script src="js/user.js"></script>
|
11
www/screens/munzeelink.html
Normal file
11
www/screens/munzeelink.html
Normal file
@ -0,0 +1,11 @@
|
||||
<iframe id="munzeeoauth" src="about:blank"></iframe>
|
||||
|
||||
<script>
|
||||
setTimeout(function () {
|
||||
$('#munzeeoauth').attr('src', 'https://api.munzee.com/oauth?response_type=code&client_id='
|
||||
+ MUNZEE_CLIENT_ID
|
||||
+ '&redirect_uri='
|
||||
+ MUNZEE_REDIRECT
|
||||
+ '&scope=read');// capture_light');
|
||||
}, 1000);
|
||||
</script>
|
@ -5,7 +5,7 @@
|
||||
<br />
|
||||
<i class="fa fa-exclamation-triangle fa-3x"></i>
|
||||
<br />
|
||||
(sorry)
|
||||
<span id="serverproblemmsg">(sorry)</span>
|
||||
<div style="background: url(assets/mountains-simple.svg) repeat-x; background-size: auto 100%; height: 20%; position: absolute; bottom: 0; width: 100%;"></div>
|
||||
</div>
|
||||
<script>
|
||||
|
@ -6,6 +6,11 @@
|
||||
<div class='list-group-item' onclick='openRules()'>
|
||||
Show Rules
|
||||
</div>
|
||||
<!--<div class='list-group-item' onclick='openscreen("munzeelink")'>
|
||||
Link with Munzee account
|
||||
<br />
|
||||
<span class="small">When you link a Munzee account, any Munzee QR codes you scan will be automatically captured in Munzee as well.</span>
|
||||
</div>-->
|
||||
<div class='list-group-item' onclick='askLogout()'>
|
||||
Logout from app
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user