Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. $.ajaxSetup(
  2. {
  3. headers:
  4. {
  5. 'X-CSRF-TOKEN':$('meta[name="csrf-token"]').attr('content')
  6. }
  7. }
  8. );
  9. $(function()
  10. {
  11. var point=337001;
  12. var pointx=337001;
  13. $(".button-finger").bind("tap touchstart",function(e)
  14. {
  15. ga('send','event','Shake','ShakeButton');
  16. $('#timer').timer(
  17. {
  18. duration:'5s',callback:function()
  19. {
  20. eventPost(e)
  21. }
  22. }
  23. );
  24. $('.icon-hand').addClass('shake');
  25. tapHandler();
  26. eventTime()
  27. }
  28. );
  29. function tapHandler(event)
  30. {
  31. $.shake(
  32. {
  33. violence:3.0,hf:0.2,shakethreshold:5,debounce:100,callback:function()
  34. {
  35. point++;
  36. var pengali='1';
  37. $('#point').text(point*parseInt(pengali));
  38. if(point<2000)
  39. {
  40. $(".scroll").css("margin-bottom",(0-point)+"px");
  41. $(".bar-bottom").css("margin-top",(0+point)+"px")
  42. }
  43. $('#timer').timer('reset')
  44. }
  45. }
  46. )
  47. }
  48. $(".button-finger").bind('touchend',function(event,ui)
  49. {
  50. eventPost()
  51. }
  52. );
  53. function eventPost()
  54. {
  55. $('.icon-hand').removeClass('shake');
  56. var pengali='1';
  57. $.post("/detect-result-mid",
  58. {
  59. point:(point*parseInt(pengali)),points:pointx
  60. }
  61. ).success(function(data)
  62. {
  63. $(location).attr('href','/result')
  64. }
  65. )
  66. }
  67. function eventTime()
  68. {
  69. $.get("/detect-result-mids",
  70. {
  71. }
  72. ).success(function(data)
  73. {
  74. pointx=data
  75. }
  76. )
  77. }
  78. }
  79. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement