Guest User

Untitled

a guest
Feb 17th, 2017
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. var $candies = 0;
  2. function menuMap()
  3. {
  4. $('#map').touchPanView({
  5. width: $(window).width(),
  6. height: $(window).height()
  7. });
  8. if(userName != null)
  9. {
  10. $.mobile.loading('show');
  11. $.post("http://sarg.lt/app/event_map.php", {name: userName, token: userData["token"], last_size: $candies, code: "0ay3j5as1Zua55f9T9s2upo"}, function (data) {
  12. $.mobile.loading('hide');
  13. if (data == "0")
  14. {
  15. showWarningMsg("Serveris nepasiekiamas!");
  16. return;
  17. }
  18. else if (data == "-1")
  19. {
  20. showWarningMsg("Autorizacijos klaida!");
  21. return;
  22. }
  23. else
  24. {
  25. var value = parseINIString(data);
  26. if($candies < value["size"])
  27. {
  28. $candies = value["size"];
  29. var pins_array = [];
  30. for (var i = 1; i <= value["size"]; i++) {
  31. pins_array.push({
  32. x: value["place" + i + "_0"],
  33. y: value["place" + i + "_1"],
  34. point: 'center',
  35. href: 'showMsg("Saldainis gautas iš ' + value["extraid" + i] + ' namo")'
  36. });
  37. }
  38. $('#contentMenu4').empty();
  39. $('#contentMenu4').prepend('<img id="map" src="images/map.jpg" alt="map" width="1200" height="1200" />');
  40. $('#map').touchPanView({
  41. width: $(window).width(),
  42. height: $(window).height() - 60,
  43. pins: pins_array,
  44. pinDefaults: {}
  45. });
  46. }
  47. }
  48. });
  49. }
  50. }
Add Comment
Please, Sign In to add comment