|
|
|
@ -9,10 +9,7 @@ var playerProfile = [];
|
|
|
|
|
var messages = null;
|
|
|
|
|
|
|
|
|
|
function loadHomePage(callback) {
|
|
|
|
|
callAPI("getprofile", {
|
|
|
|
|
username: localStorage.getItem("username"),
|
|
|
|
|
password: localStorage.getItem("password")
|
|
|
|
|
}, function (data) {
|
|
|
|
|
callAPI("getprofile", {}, function (data) {
|
|
|
|
|
playerProfile = data.profile;
|
|
|
|
|
setupProfile();
|
|
|
|
|
initChat();
|
|
|
|
@ -20,10 +17,7 @@ function loadHomePage(callback) {
|
|
|
|
|
setInterval(refreshChat, 1000 * 15);
|
|
|
|
|
// Refresh health bar
|
|
|
|
|
setInterval(function () {
|
|
|
|
|
callAPI("getprofile", {
|
|
|
|
|
username: localStorage.getItem("username"),
|
|
|
|
|
password: localStorage.getItem("password")
|
|
|
|
|
}, function (data) {
|
|
|
|
|
callAPI("getprofile", {}, function (data) {
|
|
|
|
|
playerProfile = data.profile;
|
|
|
|
|
setupProfile();
|
|
|
|
|
});
|
|
|
|
@ -49,8 +43,6 @@ function setupProfile() {
|
|
|
|
|
function scanCode() {
|
|
|
|
|
scanBarcode(function (text) {
|
|
|
|
|
callAPI("code", {
|
|
|
|
|
username: localStorage.getItem("username"),
|
|
|
|
|
password: localStorage.getItem("password"),
|
|
|
|
|
code: text,
|
|
|
|
|
latitude: playerPosition.coords.latitude,
|
|
|
|
|
longitude: playerPosition.coords.longitude,
|
|
|
|
@ -126,8 +118,6 @@ function openPlace(id, name) {
|
|
|
|
|
|
|
|
|
|
function updatePlaceStats(id, successCallback, errorCallback) {
|
|
|
|
|
callAPI("getplace", {
|
|
|
|
|
username: localStorage.getItem("username"),
|
|
|
|
|
password: localStorage.getItem("password"),
|
|
|
|
|
id: id
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
var place = resp.place;
|
|
|
|
@ -170,8 +160,6 @@ function updatePlaceStats(id, successCallback, errorCallback) {
|
|
|
|
|
|
|
|
|
|
$("#magic-action-button").click(function () {
|
|
|
|
|
callAPI("placeact", {
|
|
|
|
|
username: localStorage.getItem("username"),
|
|
|
|
|
password: localStorage.getItem("password"),
|
|
|
|
|
id: $("#place-popup").data("placeid")
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
updatePlaceStats($("#place-popup").data("placeid"));
|
|
|
|
|