Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 51.87 KB | None | 0 0
  1. <html><head><style type="text/css">.gm-style .gm-style-mtc label,.gm-style .gm-style-mtc div{font-weight:400}</style><style type="text/css">.gm-style-pbc{transition:opacity ease-in-out;background-color:black;text-align:center}.gm-style-pbt{font-size:22px;color:white;font-family:Roboto,Arial,sans-serif;position:relative;margin:0;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}</style><link type="text/css" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700"><style type="text/css">.gm-style .gm-style-cc span,.gm-style .gm-style-cc a,.gm-style .gm-style-mtc div{font-size:10px}</style><style type="text/css">@media print {  .gm-style .gmnoprint, .gmnoprint {    display:none  }}@media screen {  .gm-style .gmnoscreen, .gmnoscreen {    display:none  }}</style><style type="text/css">.gm-style{font-family:Roboto,Arial,sans-serif;font-size:11px;font-weight:400;text-decoration:none}.gm-style img{max-width:none}</style>
  2.         <meta charset="UTF-8">
  3.         <title>PokeBot Viewer</title>
  4.  
  5.         <!-- Latest compiled and minified CSS -->
  6.         <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
  7.         <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css">
  8.        
  9.         <link rel="stylesheet" href="css/toastr.min.css">
  10.  
  11.  
  12.        
  13.  
  14.         <style>
  15.           html, body {
  16.             height: 100%;
  17.             margin: 0;
  18.             padding: 0;
  19.           }
  20.           #map {
  21.             height: 100%;
  22.           }
  23.  
  24.           #leftBoxContainer {
  25.             position:fixed;
  26.             z-index:1;
  27.             top:50px;
  28.             left:10px;
  29.             width:250px;
  30.  
  31.             max-height:800px;
  32.             overflow-y: scroll;
  33.           }
  34.  
  35.           #spectateContainer {
  36.             z-index:1;
  37.             width:100%;
  38.             background-color:#eee;
  39.             border: 1px solid #aaa;
  40.             padding:0px 15px;
  41.             padding-bottom:10px;
  42.           }
  43.  
  44.           #spectatedUsersContainer {
  45.             z-index:1;
  46.             width:100%;
  47.             background-color:#eee;
  48.             border: 1px solid #aaa;
  49.             padding:0px 15px;
  50.             padding-bottom:10px;
  51.             max-height:200px;
  52.             overflow-y: scroll;
  53.             margin-top:10px;
  54.           }
  55.  
  56.  
  57.           #onlineUserListContainer {
  58.             z-index:1;
  59.             width:100%;
  60.             background-color:#eee;
  61.             border: 1px solid #aaa;
  62.             padding:0px 15px;
  63.             padding-bottom:10px;
  64.             max-height:300px;
  65.             overflow-y: scroll;
  66.             margin-top:10px;
  67.           }
  68.  
  69.          
  70.           #notLoggedInContainer {
  71.             position:fixed;
  72.             z-index:1;
  73.             top:50px;
  74.             right:10px;
  75.             width:200px;
  76.             background-color:#eee;
  77.             border: 1px solid #aaa;
  78.             padding:10px 15px;
  79.             padding-bottom:10px;
  80.             text-align:center;
  81.             display:none;
  82.           }
  83.  
  84.           #loggedInContainer {
  85.             position:fixed;
  86.             z-index:1;
  87.             top:50px;
  88.             right:10px;
  89.             width:200px;
  90.             background-color:#eee;
  91.             border: 1px solid #aaa;
  92.             padding:10px 15px;
  93.             padding-bottom:10px;
  94.             text-align:center;
  95.             display:none;
  96.           }
  97.  
  98.           #specateContainer button {
  99.             width:100%;
  100.           }
  101.  
  102.           #notLoggedInContainer button {
  103.             width:100%;
  104.           }
  105.           #loggedInContainer button {
  106.             width:100%;
  107.           }
  108.  
  109.  
  110.           #loginForms {
  111.             display:none;
  112.           }
  113.  
  114.           #createAccountForms {
  115.             display:none;
  116.           }
  117.  
  118.           .list-group-item {
  119.             padding:1px 10px;
  120.           }
  121.  
  122.         ::-webkit-scrollbar{width:6px;height:8px;}
  123.         ::-webkit-scrollbar-thumb{background:#F2BE35;}
  124.         ::-webkit-scrollbar-thumb:window-inactive{background:#F2BE35;}
  125.  
  126.  
  127.  
  128.  
  129.         </style>
  130.  
  131.     <script type="text/javascript" charset="UTF-8" src="https://maps.googleapis.com/maps-api-v3/api/js/25/9/intl/fr_ALL/common.js"></script><script type="text/javascript" charset="UTF-8" src="https://maps.googleapis.com/maps-api-v3/api/js/25/9/intl/fr_ALL/map.js"></script><script type="text/javascript" charset="UTF-8" src="https://maps.googleapis.com/maps-api-v3/api/js/25/9/intl/fr_ALL/util.js"></script><script type="text/javascript" charset="UTF-8" src="https://maps.googleapis.com/maps-api-v3/api/js/25/9/intl/fr_ALL/onion.js"></script><script type="text/javascript" charset="UTF-8" src="https://maps.googleapis.com/maps-api-v3/api/js/25/9/intl/fr_ALL/controls.js"></script><script type="text/javascript" charset="UTF-8" src="https://maps.googleapis.com/maps-api-v3/api/js/25/9/intl/fr_ALL/marker.js"></script><script type="text/javascript" charset="UTF-8" src="https://maps.googleapis.com/maps-api-v3/api/js/25/9/intl/fr_ALL/stats.js"></script></head>
  132.  
  133.     <body>
  134.         <div id="loggedInContainer">
  135.             <div style="font-weight:bold;margin-bottom:6px;">
  136.                 User: <span id="loggedInUser"></span>
  137.             </div>
  138.  
  139.             <div class="form-group" style="margin-bottom:10px;" id="loginButtonContainer"><button id="toggleApiToken" class="btn btn-primary">Show Api Token</button></div>
  140.             <input id="apiTokenInput" type="text" class="form-control" placeholder="Failed to load" style="display:none;">
  141.  
  142.  
  143.             <div class="form-group" style="margin-bottom:0px;" id="loginButtonContainer"><button id="logout" class="btn btn-danger">Logout</button></div>
  144.         </div>
  145.  
  146.         <div id="leftBoxContainer">
  147.             <div id="spectateContainer">
  148.                 <h4>Spectate User</h4>
  149.                 <div id="expandDiv">
  150.                     <input type="text" id="spectateUserInput" placeholder="User Name" class="form-control">
  151.                     <button type="submit" id="addUser" class="btn btn-success" style="width:100%;">Add to Spectated</button>
  152.                 </div>         
  153.             </div>
  154.  
  155.             <div id="onlineUserListContainer">
  156.                 <h4>Specated Users <small id="spectatedCount">(0)</small></h4>
  157.                 <ul class="list-group" id="spectatedUserList">
  158.                     <li class="list-group-item">loading...</li>
  159.                 </ul>
  160.  
  161.             </div>
  162.  
  163.  
  164.             <div id="onlineUserListContainer">
  165.                 <h4>Online Users <small id="onlineCount">(0)</small></h4>
  166.                 <ul class="list-group" id="onlineUserList">
  167.  
  168.                 </ul>
  169.  
  170.             </div>
  171.  
  172.  
  173.         </div>
  174.         <div id="notLoggedInContainer" style="display: block;">
  175.             <div class="form-group" id="loginButtonContainer"><button id="openLogin" class="btn btn-primary">Login</button></div>
  176.             <div id="loginForms">
  177.                 <div class="form-group">
  178.                     <input id="loginUsername" type="text" class="form-control" placeholder="Username">
  179.                 </div>
  180.                 <div class="form-group">
  181.                     <input id="loginPassword" type="password" class="form-control" placeholder="Password">
  182.                 </div>
  183.                 <button id="doLogin" class="btn btn-success">Login</button>
  184.  
  185.                 <div class="form-group"><button class="goBack btn btn-danger">Go Back</button></div>
  186.             </div>
  187.  
  188.             <div class="form-group" id="createAccountButtonContainer"><button id="openCreateAccount" class="btn btn-primary">Create Account</button></div>
  189.             <div id="createAccountForms">
  190.                 <div class="form-group">
  191.                     <input id="registerUsername" type="text" class="form-control" placeholder="Username">
  192.                 </div>
  193.                 <div class="form-group">
  194.                     <input id="registerPassword" type="password" class="form-control" placeholder="Password">
  195.                 </div>
  196.                 <div class="form-group">
  197.                     <input id="registerPasswordConfirmation" type="password" class="form-control" placeholder="Confirm Password">
  198.                 </div>
  199.  
  200.             <button id="doRegister" class="btn btn-success">Register</button>
  201.                 <div class="form-group"><button class="goBack btn btn-danger">Go Back</button></div>
  202.             </div>
  203.  
  204.         </div>
  205.  
  206.  
  207.         <div id="map" style="position: relative; overflow: hidden; transform: translateZ(0px); background-color: rgb(229, 227, 223);"><div class="gm-style" style="position: absolute; left: 0px; top: 0px; overflow: hidden; width: 100%; height: 100%; z-index: 0;"><div style="position: absolute; left: 0px; top: 0px; overflow: hidden; width: 100%; height: 100%; z-index: 0; cursor: url(&quot;https://maps.gstatic.com/mapfiles/openhand_8_8.cur&quot;) 8 8, default;"><div style="position: absolute; left: 0px; top: 0px; z-index: 1; width: 100%; transform-origin: 0px 0px 0px; transform: matrix(1, 0, 0, 1, 0, 0);"><div style="transform: translateZ(0px); position: absolute; left: 0px; top: 0px; z-index: 100; width: 100%;"><div style="position: absolute; left: 0px; top: 0px; z-index: 0;"><div aria-hidden="true" style="position: absolute; left: 0px; top: 0px; z-index: 1; visibility: inherit;"><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: 704px; top: 549px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: 704px; top: 293px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: 704px; top: 805px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: 448px; top: 293px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: 448px; top: 549px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: 704px; top: 37px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: 448px; top: 37px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: 448px; top: 805px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: 704px; top: 1061px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: 704px; top: -219px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: 192px; top: 293px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: 192px; top: 549px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: 192px; top: 37px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: 448px; top: 1061px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: 448px; top: -219px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: 192px; top: 805px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: -64px; top: 549px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: 192px; top: -219px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: 192px; top: 1061px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: -64px; top: 293px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: -64px; top: 805px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: -64px; top: 37px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: -64px; top: 1061px;"></div><div style="width: 256px; height: 256px; transform: translateZ(0px); position: absolute; left: -64px; top: -219px;"></div></div></div></div><div style="transform: translateZ(0px); position: absolute; left: 0px; top: 0px; z-index: 101; width: 100%;"></div><div style="transform: translateZ(0px); position: absolute; left: 0px; top: 0px; z-index: 102; width: 100%;"></div><div style="transform: translateZ(0px); position: absolute; left: 0px; top: 0px; z-index: 103; width: 100%;"><div style="position: absolute; left: 0px; top: 0px; z-index: -1;"><div aria-hidden="true" style="position: absolute; left: 0px; top: 0px; z-index: 1; visibility: inherit;"><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: 704px; top: 549px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: 704px; top: 293px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: 704px; top: 805px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: 448px; top: 293px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: 448px; top: 549px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: 704px; top: 37px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: 448px; top: 37px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: 448px; top: 805px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: 704px; top: 1061px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: 704px; top: -219px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: 192px; top: 293px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: 192px; top: 549px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: 192px; top: 37px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: 448px; top: 1061px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: 448px; top: -219px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: 192px; top: 805px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: -64px; top: 549px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: 192px; top: -219px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: 192px; top: 1061px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: -64px; top: 293px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: -64px; top: 805px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: -64px; top: 37px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: -64px; top: 1061px;"></div><div style="width: 256px; height: 256px; overflow: hidden; transform: translateZ(0px); position: absolute; left: -64px; top: -219px;"></div></div></div></div><div style="position: absolute; left: 0px; top: 0px; z-index: 0;"><div aria-hidden="true" style="position: absolute; left: 0px; top: 0px; z-index: 1; visibility: inherit;"><div style="transform: translateZ(0px); position: absolute; left: 448px; top: 1061px; transition: opacity 200ms ease-out;"><img src="https://maps.gstatic.com/mapfiles/transparent.png" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: 704px; top: -219px; transition: opacity 200ms ease-out;"><img src="https://maps.gstatic.com/mapfiles/transparent.png" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: 192px; top: 1061px; transition: opacity 200ms ease-out;"><img src="https://maps.gstatic.com/mapfiles/transparent.png" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: -64px; top: 1061px; transition: opacity 200ms ease-out;"><img src="https://maps.gstatic.com/mapfiles/transparent.png" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: 192px; top: -219px; transition: opacity 200ms ease-out;"><img src="https://maps.gstatic.com/mapfiles/transparent.png" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: 448px; top: -219px; transition: opacity 200ms ease-out;"><img src="https://maps.gstatic.com/mapfiles/transparent.png" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: 704px; top: 1061px; transition: opacity 200ms ease-out;"><img src="https://maps.gstatic.com/mapfiles/transparent.png" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: -64px; top: -219px; transition: opacity 200ms ease-out;"><img src="https://maps.gstatic.com/mapfiles/transparent.png" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: 704px; top: 549px; transition: opacity 200ms ease-out;"><img src="https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i2!2i1!3i2!4i256!2m3!1e4!2st!3i356!2m3!1e0!2sr!3i356027877!3m9!2sfr-FR!3sUS!5e18!12m1!1e63!12m3!1e37!2m1!1ssmartmaps!4e0&amp;token=55597" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: 704px; top: 293px; transition: opacity 200ms ease-out;"><img src="https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i2!2i1!3i1!4i256!2m3!1e4!2st!3i356!2m3!1e0!2sr!3i356027877!3m9!2sfr-FR!3sUS!5e18!12m1!1e63!12m3!1e37!2m1!1ssmartmaps!4e0&amp;token=77762" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: -64px; top: 549px; transition: opacity 200ms ease-out;"><img src="https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i2!2i2!3i2!4i256!2m3!1e4!2st!3i356!2m3!1e0!2sr!3i356027877!3m9!2sfr-FR!3sUS!5e18!12m1!1e63!12m3!1e37!2m1!1ssmartmaps!4e0&amp;token=67999" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: -64px; top: 293px; transition: opacity 200ms ease-out;"><img src="https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i2!2i2!3i1!4i256!2m3!1e4!2st!3i356!2m3!1e0!2sr!3i356027877!3m9!2sfr-FR!3sUS!5e18!12m1!1e63!12m3!1e37!2m1!1ssmartmaps!4e0&amp;token=90164" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: 192px; top: 293px; transition: opacity 200ms ease-out;"><img src="https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i2!2i3!3i1!4i256!2m3!1e4!2st!3i356!2m3!1e0!2sr!3i356027877!3m9!2sfr-FR!3sUS!5e18!12m1!1e63!12m3!1e37!2m1!1ssmartmaps!4e0&amp;token=102566" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: 704px; top: 805px; transition: opacity 200ms ease-out;"><img src="https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i2!2i1!3i3!4i256!2m3!1e4!2st!3i356!2m3!1e0!2sr!3i356027877!3m9!2sfr-FR!3sUS!5e18!12m1!1e63!12m3!1e37!2m1!1ssmartmaps!4e0&amp;token=33432" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: 448px; top: 293px; transition: opacity 200ms ease-out;"><img src="https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i2!2i0!3i1!4i256!2m3!1e4!2st!3i356!2m3!1e0!2sr!3i356027877!3m9!2sfr-FR!3sUS!5e18!12m1!1e63!12m3!1e37!2m1!1ssmartmaps!4e0&amp;token=65360" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: -64px; top: 37px; transition: opacity 200ms ease-out;"><img src="https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i2!2i2!3i0!4i256!2m3!1e4!2st!3i356!2m3!1e0!2sr!3i356027877!3m9!2sfr-FR!3sUS!5e18!12m1!1e63!12m3!1e37!2m1!1ssmartmaps!4e0&amp;token=112329" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: 448px; top: 549px; transition: opacity 200ms ease-out;"><img src="https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i2!2i0!3i2!4i256!2m3!1e4!2st!3i356!2m3!1e0!2sr!3i356027877!3m9!2sfr-FR!3sUS!5e18!12m1!1e63!12m3!1e37!2m1!1ssmartmaps!4e0&amp;token=43195" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: 704px; top: 37px; transition: opacity 200ms ease-out;"><img src="https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i2!2i1!3i0!4i256!2m3!1e4!2st!3i356!2m3!1e0!2sr!3i356027877!3m9!2sfr-FR!3sUS!5e18!12m1!1e63!12m3!1e37!2m1!1ssmartmaps!4e0&amp;token=99927" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: -64px; top: 805px; transition: opacity 200ms ease-out;"><img src="https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i2!2i2!3i3!4i256!2m3!1e4!2st!3i356!2m3!1e0!2sr!3i356027877!3m9!2sfr-FR!3sUS!5e18!12m1!1e63!12m3!1e37!2m1!1ssmartmaps!4e0&amp;token=45834" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: 192px; top: 549px; transition: opacity 200ms ease-out;"><img src="https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i2!2i3!3i2!4i256!2m3!1e4!2st!3i356!2m3!1e0!2sr!3i356027877!3m9!2sfr-FR!3sUS!5e18!12m1!1e63!12m3!1e37!2m1!1ssmartmaps!4e0&amp;token=80401" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: 448px; top: 37px; transition: opacity 200ms ease-out;"><img src="https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i2!2i0!3i0!4i256!2m3!1e4!2st!3i356!2m3!1e0!2sr!3i356027877!3m9!2sfr-FR!3sUS!5e18!12m1!1e63!12m3!1e37!2m1!1ssmartmaps!4e0&amp;token=87525" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: 192px; top: 805px; transition: opacity 200ms ease-out;"><img src="https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i2!2i3!3i3!4i256!2m3!1e4!2st!3i356!2m3!1e0!2sr!3i356027877!3m9!2sfr-FR!3sUS!5e18!12m1!1e63!12m3!1e37!2m1!1ssmartmaps!4e0&amp;token=58236" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: 192px; top: 37px; transition: opacity 200ms ease-out;"><img src="https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i2!2i3!3i0!4i256!2m3!1e4!2st!3i356!2m3!1e0!2sr!3i356027877!3m9!2sfr-FR!3sUS!5e18!12m1!1e63!12m3!1e37!2m1!1ssmartmaps!4e0&amp;token=124731" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div style="transform: translateZ(0px); position: absolute; left: 448px; top: 805px; transition: opacity 200ms ease-out;"><img src="https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i2!2i0!3i3!4i256!2m3!1e4!2st!3i356!2m3!1e0!2sr!3i356027877!3m9!2sfr-FR!3sUS!5e18!12m1!1e63!12m3!1e37!2m1!1ssmartmaps!4e0&amp;token=21030" draggable="false" alt="" style="position: absolute; left: 0px; top: 0px; width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div></div></div></div><div style="position: absolute; left: 0px; top: 0px; z-index: 2; width: 100%; height: 100%; transition-duration: 0.3s; opacity: 0; display: none;" class="gm-style-pbc"><p class="gm-style-pbt">Utilisez deux doigts pour déplacer la carte</p></div><div style="position: absolute; left: 0px; top: 0px; z-index: 3; width: 100%; height: 100%;"></div><div style="position: absolute; left: 0px; top: 0px; z-index: 4; width: 100%; transform-origin: 0px 0px 0px; transform: matrix(1, 0, 0, 1, 0, 0);"><div style="transform: translateZ(0px); position: absolute; left: 0px; top: 0px; z-index: 104; width: 100%;"></div><div style="transform: translateZ(0px); position: absolute; left: 0px; top: 0px; z-index: 105; width: 100%;"></div><div style="transform: translateZ(0px); position: absolute; left: 0px; top: 0px; z-index: 106; width: 100%;"></div><div style="transform: translateZ(0px); position: absolute; left: 0px; top: 0px; z-index: 107; width: 100%;"></div></div></div><div style="margin-left: 5px; margin-right: 5px; z-index: 1000000; position: absolute; left: 0px; bottom: 0px;"><a target="_blank" href="https://maps.google.com/maps?ll=0,173.496094&amp;z=2&amp;t=p&amp;hl=fr-FR&amp;gl=US&amp;mapclient=apiv3" title="Cliquez ici pour afficher cette zone sur Google&nbsp;Maps" style="position: static; overflow: visible; float: none; display: inline;"><div style="width: 66px; height: 26px; cursor: pointer;"><img src="https://maps.gstatic.com/mapfiles/api-3/images/google4.png" draggable="false" style="position: absolute; left: 0px; top: 0px; width: 66px; height: 26px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px;"></div></a></div><div style="padding: 15px 21px; border: 1px solid rgb(171, 171, 171); font-family: Roboto, Arial, sans-serif; color: rgb(34, 34, 34); box-shadow: rgba(0, 0, 0, 0.2) 0px 4px 16px; z-index: 10000002; display: none; width: 256px; height: 148px; position: absolute; left: 280px; top: 460px; background-color: white;"><div style="padding: 0px 0px 10px; font-size: 16px;">Données cartographiques</div><div style="font-size: 13px;">Données cartographiques ©2016</div><div style="width: 13px; height: 13px; overflow: hidden; position: absolute; opacity: 0.7; right: 12px; top: 12px; z-index: 10000; cursor: pointer;"><img src="https://maps.gstatic.com/mapfiles/api-3/images/mapcnt6.png" draggable="false" style="position: absolute; left: -2px; top: -336px; width: 59px; height: 492px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div></div><div class="gmnoprint" style="z-index: 1000001; position: absolute; right: 113px; bottom: 0px; width: 159px;"><div draggable="false" class="gm-style-cc" style="-webkit-user-select: none; height: 14px; line-height: 14px;"><div style="opacity: 0.7; width: 100%; height: 100%; position: absolute;"><div style="width: 1px;"></div><div style="width: auto; height: 100%; margin-left: 1px; background-color: rgb(245, 245, 245);"></div></div><div style="position: relative; padding-right: 6px; padding-left: 6px; font-family: Roboto, Arial, sans-serif; font-size: 10px; color: rgb(68, 68, 68); white-space: nowrap; direction: ltr; text-align: right; vertical-align: middle; display: inline-block;"><a style="color: rgb(68, 68, 68); text-decoration: none; cursor: pointer; display: none;">Données cartographiques</a><span>Données cartographiques ©2016</span></div></div></div><div class="gmnoscreen" style="position: absolute; right: 0px; bottom: 0px;"><div style="font-family: Roboto, Arial, sans-serif; font-size: 11px; color: rgb(68, 68, 68); direction: ltr; text-align: right; background-color: rgb(245, 245, 245);">Données cartographiques ©2016</div></div><div class="gmnoprint gm-style-cc" draggable="false" style="z-index: 1000001; -webkit-user-select: none; height: 14px; line-height: 14px; position: absolute; right: 0px; bottom: 0px;"><div style="opacity: 0.7; width: 100%; height: 100%; position: absolute;"><div style="width: 1px;"></div><div style="width: auto; height: 100%; margin-left: 1px; background-color: rgb(245, 245, 245);"></div></div><div style="position: relative; padding-right: 6px; padding-left: 6px; font-family: Roboto, Arial, sans-serif; font-size: 10px; color: rgb(68, 68, 68); white-space: nowrap; direction: ltr; text-align: right; vertical-align: middle; display: inline-block;"><a href="https://www.google.com/intl/fr-FR_US/help/terms_maps.html" target="_blank" style="text-decoration: none; cursor: pointer; color: rgb(68, 68, 68);">Conditions d'utilisation</a></div></div><div style="width: 25px; height: 25px; overflow: hidden; display: none; margin: 10px 14px; position: absolute; top: 0px; right: 0px;"><img src="https://maps.gstatic.com/mapfiles/api-3/images/sv5.png" draggable="false" class="gm-fullscreen-control" style="position: absolute; left: -52px; top: -86px; width: 164px; height: 112px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px;"></div><div draggable="false" class="gm-style-cc" style="-webkit-user-select: none; height: 14px; line-height: 14px; display: none; position: absolute; right: 0px; bottom: 0px;"><div style="opacity: 0.7; width: 100%; height: 100%; position: absolute;"><div style="width: 1px;"></div><div style="width: auto; height: 100%; margin-left: 1px; background-color: rgb(245, 245, 245);"></div></div><div style="position: relative; padding-right: 6px; padding-left: 6px; font-family: Roboto, Arial, sans-serif; font-size: 10px; color: rgb(68, 68, 68); white-space: nowrap; direction: ltr; text-align: right; vertical-align: middle; display: inline-block;"><a target="_new" title="Signaler à Google une erreur dans la carte routière ou les images" href="https://www.google.com/maps/@0,-186.5039063,2z/data=!5m1!1e4!10m1!1e1!12b1?source=apiv3&amp;rapsrc=apiv3" style="font-family: Roboto, Arial, sans-serif; font-size: 10px; color: rgb(68, 68, 68); text-decoration: none; position: relative;">Signaler une erreur cartographique</a></div></div><div class="gmnoprint gm-bundled-control gm-bundled-control-on-bottom" draggable="false" controlwidth="28" controlheight="93" style="margin: 10px; -webkit-user-select: none; position: absolute; bottom: 107px; right: 28px;"><div class="gmnoprint" controlwidth="28" controlheight="55" style="position: absolute; left: 0px; top: 38px;"><div draggable="false" style="-webkit-user-select: none; box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; border-radius: 2px; cursor: pointer; width: 28px; height: 55px; background-color: rgb(255, 255, 255);"><div title="Zoom avant" style="position: relative; width: 28px; height: 27px; left: 0px; top: 0px;"><div style="overflow: hidden; position: absolute; width: 15px; height: 15px; left: 7px; top: 6px;"><img src="https://maps.gstatic.com/mapfiles/api-3/images/tmapctrl.png" draggable="false" style="position: absolute; left: 0px; top: 0px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none; width: 120px; height: 54px;"></div></div><div style="position: relative; overflow: hidden; width: 67%; height: 1px; left: 16%; top: 0px; background-color: rgb(230, 230, 230);"></div><div title="Zoom arrière" style="position: relative; width: 28px; height: 27px; left: 0px; top: 0px;"><div style="overflow: hidden; position: absolute; width: 15px; height: 15px; left: 7px; top: 6px;"><img src="https://maps.gstatic.com/mapfiles/api-3/images/tmapctrl.png" draggable="false" style="position: absolute; left: 0px; top: -15px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none; width: 120px; height: 54px;"></div></div></div></div><div class="gm-svpc" controlwidth="28" controlheight="28" style="box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; border-radius: 2px; width: 28px; height: 28px; cursor: url(&quot;https://maps.gstatic.com/mapfiles/openhand_8_8.cur&quot;) 8 8, default; position: absolute; left: 0px; top: 0px; background-color: rgb(255, 255, 255);"><div style="position: absolute; left: 1px; top: 1px;"></div><div style="position: absolute; left: 1px; top: 1px;"><div aria-label="Contrôle de Pegman dans Street View" style="width: 26px; height: 26px; overflow: hidden; position: absolute; left: 0px; top: 0px;"><img src="https://maps.gstatic.com/mapfiles/api-3/images/cb_scout5.png" draggable="false" style="position: absolute; left: -147px; top: -26px; width: 215px; height: 835px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div aria-label="Pegman est au-dessus de la carte." style="width: 26px; height: 26px; overflow: hidden; position: absolute; left: 0px; top: 0px; visibility: hidden;"><img src="https://maps.gstatic.com/mapfiles/api-3/images/cb_scout5.png" draggable="false" style="position: absolute; left: -147px; top: -52px; width: 215px; height: 835px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div aria-label="Contrôle de Pegman dans Street View" style="width: 26px; height: 26px; overflow: hidden; position: absolute; left: 0px; top: 0px; visibility: hidden;"><img src="https://maps.gstatic.com/mapfiles/api-3/images/cb_scout5.png" draggable="false" style="position: absolute; left: -147px; top: -78px; width: 215px; height: 835px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div></div></div><div class="gmnoprint" controlwidth="28" controlheight="0" style="display: none; position: absolute;"><div title="Faire pivoter le plan à 90°" style="width: 28px; height: 28px; overflow: hidden; position: absolute; border-radius: 2px; box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; cursor: pointer; display: none; background-color: rgb(255, 255, 255);"><img src="https://maps.gstatic.com/mapfiles/api-3/images/tmapctrl4.png" draggable="false" style="position: absolute; left: -141px; top: 6px; width: 170px; height: 54px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div><div class="gm-tilt" style="width: 28px; height: 28px; overflow: hidden; position: absolute; border-radius: 2px; box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; top: 0px; cursor: pointer; background-color: rgb(255, 255, 255);"><img src="https://maps.gstatic.com/mapfiles/api-3/images/tmapctrl4.png" draggable="false" style="position: absolute; left: -141px; top: -13px; width: 170px; height: 54px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;"></div></div></div><div class="gmnoprint" style="margin: 10px; z-index: 0; position: absolute; cursor: pointer; left: 0px; top: 0px;"><div class="gm-style-mtc" style="float: left;"><div draggable="false" title="Afficher un plan de ville" style="direction: ltr; overflow: hidden; text-align: center; position: relative; color: rgb(0, 0, 0); font-family: Roboto, Arial, sans-serif; -webkit-user-select: none; font-size: 11px; padding: 8px; border-bottom-left-radius: 2px; border-top-left-radius: 2px; -webkit-background-clip: padding-box; box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; min-width: 22px; font-weight: 500; background-color: rgb(255, 255, 255); background-clip: padding-box;">Plan</div><div style="z-index: -1; padding: 2px; border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; position: absolute; left: 0px; top: 31px; text-align: left; display: none; background-color: white;"><div draggable="false" title="Afficher le relief sur la carte" style="color: rgb(0, 0, 0); font-family: Roboto, Arial, sans-serif; -webkit-user-select: none; font-size: 11px; padding: 6px 8px 6px 6px; direction: ltr; text-align: left; white-space: nowrap; background-color: rgb(255, 255, 255);"><span role="checkbox" style="box-sizing: border-box; position: relative; line-height: 0; font-size: 0px; margin: 0px 5px 0px 0px; display: inline-block; border: 1px solid rgb(198, 198, 198); border-radius: 1px; width: 13px; height: 13px; vertical-align: middle; background-color: rgb(255, 255, 255);"><div style="position: absolute; left: 1px; top: -2px; width: 13px; height: 11px; overflow: hidden;"><img src="https://maps.gstatic.com/mapfiles/mv/imgs8.png" draggable="false" style="position: absolute; left: -52px; top: -44px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none; width: 68px; height: 67px;"></div></span><label style="vertical-align: middle; cursor: pointer;">Relief</label></div></div></div><div class="gm-style-mtc" style="float: left;"><div draggable="false" title="Afficher les images satellite" style="direction: ltr; overflow: hidden; text-align: center; position: relative; color: rgb(86, 86, 86); font-family: Roboto, Arial, sans-serif; -webkit-user-select: none; font-size: 11px; padding: 8px; border-bottom-right-radius: 2px; border-top-right-radius: 2px; -webkit-background-clip: padding-box; box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; border-left-width: 0px; min-width: 40px; background-color: rgb(255, 255, 255); background-clip: padding-box;">Satellite</div><div style="z-index: -1; padding: 2px; border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; position: absolute; right: 0px; top: 31px; text-align: left; display: none; background-color: white;"><div draggable="false" title="Afficher les images satellite avec le nom des rues" style="color: rgb(0, 0, 0); font-family: Roboto, Arial, sans-serif; -webkit-user-select: none; font-size: 11px; padding: 6px 8px 6px 6px; direction: ltr; text-align: left; white-space: nowrap; background-color: rgb(255, 255, 255);"><span role="checkbox" style="box-sizing: border-box; position: relative; line-height: 0; font-size: 0px; margin: 0px 5px 0px 0px; display: inline-block; border: 1px solid rgb(198, 198, 198); border-radius: 1px; width: 13px; height: 13px; vertical-align: middle; background-color: rgb(255, 255, 255);"><div style="position: absolute; left: 1px; top: -2px; width: 13px; height: 11px; overflow: hidden;"><img src="https://maps.gstatic.com/mapfiles/mv/imgs8.png" draggable="false" style="position: absolute; left: -52px; top: -44px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none; width: 68px; height: 67px;"></div></span><label style="vertical-align: middle; cursor: pointer;">Légendes</label></div></div></div></div></div></div>
  208.    
  209.     <!-- Latest compiled and minified JavaScript -->
  210.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  211.     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
  212.     <script src="js/toastr.min.js"></script>
  213.  
  214.     <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBUBrX1N-nAYoWn71ml7idrepNfXkmfbng" type="text/javascript"></script>
  215.     <script src="js/lib.js" type="text/javascript"></script>
  216.     <script>
  217.  
  218.  
  219.  
  220.  
  221.         var map;
  222.         var bots = [];
  223.         var source;
  224.         var onlineAccountsTimer;
  225.         var onlineAccounts = [];
  226.         window.onload = function()
  227.         {
  228.             map = new google.maps.Map(document.getElementById("map"), {
  229.                 center: {lat: 0, lng: 0},
  230.                 zoom: 2,
  231.                 mapTypeId: google.maps.MapTypeId.TERRAIN
  232.             });
  233.  
  234.             bot_handler_ = {
  235.                 bot_hash_:{},
  236.                 map_:null,
  237.                 default_color_:null,
  238.                 default_icon_:"http://archives.bulbagarden.net/media/upload/1/12/ORAS_Beauty_Icon.png",
  239.                 handleEvent:function(event)
  240.                 {
  241.                     //console.log(event);
  242.                     if(event.hasOwnProperty("user_id") && event.hasOwnProperty("bot_id"))
  243.                     {
  244.                         var botName = event["user_id"] + "_" + event["bot_id"];
  245.                         if(typeof this.bot_hash_[botName] === "undefined")
  246.                         {
  247.                             console.log("added new bot!");
  248.                             this.bot_hash_[botName] = new CPokemonBot(botName, this.map_, this.default_color_, true, this.default_icon_);
  249.                         }
  250.                        
  251.                         this.bot_hash_[botName].handleBotEvent(event);
  252.                     }
  253.                 },
  254.                 getBot:function(user_id)
  255.                 {
  256.                     return this.bot_hash_.hasOwnProperty(user_id) ? this.bot_hash_[user_id] : null;
  257.                 },
  258.  
  259.             };
  260.  
  261.             bot_handler_.map_ = map;
  262.             bot_handler_.default_color_ = "#ff0000";
  263.             bot_handler_.default_icon_ = "img/default.png";
  264.  
  265.  
  266.             requestLib.loadUserData(function(data) {
  267.                 if(data.success) {
  268.                     console.log(data);
  269.                     var userName = getCookie("userName");
  270.                     $("#loggedInUser").text(userName);
  271.                     triggerNotification("Welcome!", "Welcome back " + userName, "success");
  272.                     $("#notLoggedInContainer").fadeOut(500, function() {$("#loggedInContainer").fadeIn(500);});
  273.                     $("#apiTokenInput").val(requestLib.authorizationToken);
  274.  
  275.                     source = new EventSource("https://api.locatoad.xyz:8443/cApi/events?oauth_token="+requestLib.authorizationToken);
  276.                     source.onmessage = function(event) {   
  277.  
  278.                         if(event.data !== "p" && event.data !== "connected") {
  279.                             try
  280.                             {
  281.                                 var json = JSON.parse(event.data);
  282.                                 bot_handler_.handleEvent(json);
  283.                             }
  284.                             catch(e)
  285.                             {
  286.                                 console.log(e);
  287.                             }
  288.                         }
  289.                     };
  290.  
  291.                     $("#spectatedUserList").empty();
  292.  
  293.                     if(data.response.userAccount.spectated.length > 0) {
  294.                         data.response.userAccount.spectated.forEach(function(spectated) {
  295.                             $("#spectatedUserList").append($("<li>").addClass("list-group-item").attr("data-id", spectated).html(spectated + " <span color='red;'><i class='fa fa-trash-o'></i></span>"));
  296.                         });
  297.                         $("#spectatedCount").text("("+data.response.userAccount.spectated.length+")");
  298.                     }
  299.  
  300.  
  301.                     requestLib.onlineUsers(function(data){
  302.                         if(data.success) {
  303.                             onlineAccounts = data.response.data;
  304.                             //console.log(data);
  305.                             applyOnlineUsersData(data.response);
  306.                         } else {
  307.                             triggerNotification("Failed to get online users", "Failed to get online users, trying again in 30 seconds.", "warning");
  308.                         }
  309.  
  310.                     });
  311.                     onlineAccountsTimer = setInterval(function() {
  312.                         requestLib.onlineUsers(function(data){
  313.                             if(data.success) {
  314.                                 onlineAccounts = data.response.data;
  315.                                 //console.log(data);
  316.                                 applyOnlineUsersData(data.response);
  317.                             } else {
  318.                                 triggerNotification("Failed to get online users", "Failed to get online users, trying again in 30 seconds.", "warning");
  319.                             }
  320.  
  321.                         });
  322.                     },15000);
  323.  
  324.  
  325.  
  326.  
  327.  
  328.                 } else {
  329.                     triggerNotification("Debug Message","not logged in", "warning");
  330.                     $("#notLoggedInContainer").show();
  331.                 }
  332.             });    
  333.         }
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.         $("#spectateUserInput").on("keyup", function(e) {
  341.  
  342.         });
  343.  
  344.  
  345.         $("#expandButton").click(function(e) {
  346.             e.preventDefault();
  347.             $("#expandDiv").hide();
  348.             $("#formContainer").fadeIn(500);
  349.         });
  350.  
  351.         $("#closeButton").click(function(e) {
  352.             e.preventDefault();
  353.  
  354.             $("#formContainer").fadeOut(200, function() { $("#expandDiv").fadeIn(500);});
  355.         });
  356.  
  357.         $("#addBot").click(function(e) {
  358.             e.preventDefault();
  359.             var ip = $("#ip").val();
  360.             var port = $("#port").val();
  361.             var nickname = $("#nickname").val();
  362.             var color = $("#color").val();
  363.             var icon = $("#icon").val();
  364.             if($("#showPokemon").val("yes")) {
  365.                 var showPokemon = true;
  366.             } else {
  367.                 var showPokemon = false;
  368.             }
  369.  
  370.  
  371.             if(ip == "" || port == "") {
  372.                 triggerNotification("Missing fields","please provide both ip and port","warning");
  373.             } else {
  374.                 console.log(color);
  375.                 var bot = new CPokemonBot(nickname, map, color, showPokemon, icon);
  376.                 triggerNotification("Connecting","connecting to " + ip + ":" + port,"success");
  377.                 bot.connect(ip, parseInt(port));
  378.                 bots.push(bot);
  379.  
  380.  
  381.                 $("#formContainer").fadeOut(500, function() {$("#expandDiv").fadeIn(200);});
  382.             }
  383.         });
  384.  
  385.         $("#openLogin").click(function() {
  386.             $("#loginForms").show();
  387.             $("#createAccountForms").hide();
  388.             $("#createAccountButtonContainer").hide();
  389.             $("#loginButtonContainer").hide();
  390.         });
  391.  
  392.         $("#openCreateAccount").click(function() {
  393.             $("#loginForms").hide();
  394.             $("#createAccountForms").show();
  395.             $("#createAccountButtonContainer").hide();
  396.             $("#loginButtonContainer").hide();
  397.         });
  398.  
  399.         $(".goBack").click(function() {
  400.             $("#loginForms").hide();
  401.             $("#createAccountForms").hide();
  402.             $("#createAccountButtonContainer").show();
  403.             $("#loginButtonContainer").show();
  404.         });
  405.  
  406.         $("#toggleApiToken").click(function() {
  407.             if($("#apiTokenInput").is(":visible")) {
  408.                 $("#apiTokenInput").hide();
  409.                 $(this).text("Show Api token");
  410.             } else {
  411.                 $("#apiTokenInput").show();
  412.                 $(this).text("Hide Api token");
  413.             }
  414.         });
  415.  
  416.         $("#doLogin").click(function(e) {
  417.             e.preventDefault();
  418.  
  419.             if(typeof $("#loginUsername").val() === "string" && $("#loginUsername").val() !== "") {
  420.                 var username = $("#loginUsername").val();
  421.             }  else {
  422.                 triggerNotification("Incorrect username", "Please provide a valid username", "warning");
  423.                 return false;
  424.             }
  425.             if(typeof $("#loginPassword").val() === "string" && $("#loginPassword").val() !== "") {
  426.                 var password = $("#loginPassword").val();
  427.             }  else {
  428.                 triggerNotification("Missing password", "Please provide your password to login.", "warning");
  429.                 return false;
  430.             }
  431.  
  432.  
  433.  
  434.             $.ajaxSetup({headers: {"Authorization": "Basic " + btoa(username+":"+password)}});
  435.  
  436.             requestLib.getRequest(apiDomain + apiPort + apiPath + "/useraccountlogin", false, function (data) {
  437.                 console.log(data);
  438.                 if (data.success) {
  439.                     console.log("login success");
  440.                     triggerNotification("Success!", data.response, "success");
  441.                     location.reload();
  442.                     setCookie("userName", username,1);
  443.                     setCookie("accessToken", data.access_token ,1);
  444.                 } else {
  445.                     console.log("Login failed");
  446.                     triggerNotification("Failed to log in", data.response, "error");
  447.                 }
  448.             });
  449.         });
  450.  
  451.         $("#doRegister").click(function(e) {
  452.         e.preventDefault();
  453.  
  454.             if(true || $("#tos").is(":checked")) {
  455.                 var password = $("#registerPassword").val();
  456.                 var repeatpassword = $("#registerPasswordConfirmation").val();
  457.                 var email = $("#registerUsername").val();
  458.  
  459.                 if(typeof $("#registerPassword").val() === "string" && $("#registerPassword").val() !== "") {
  460.                     var password = $("#registerPassword").val();
  461.                 }  else {
  462.                     triggerNotification("Missing password", "Please provide a your password to login.", "warning");
  463.                     return false;
  464.                 }
  465.  
  466.                 if(typeof $("#registerPasswordConfirmation").val() === "string" && $("#registerPasswordConfirmation").val() !== "") {
  467.                     var repeatpassword = $("#registerPasswordConfirmation").val();
  468.                 }  else {
  469.                     triggerNotification("Missing repeat password", "Please confirm your password.", "warning");
  470.                     return false;
  471.                 }
  472.                 if(typeof $("#registerUsername").val() === "string" && $("#registerUsername").val() !== "") {
  473.                     var email = $("#registerUsername").val();
  474.                 }  else {
  475.                     triggerNotification("Missing username", "Please provide a your email to login.", "warning");
  476.                     return false;
  477.                 }
  478.  
  479.                 if(repeatpassword !== password) {
  480.                     triggerNotification("Passwords don't match", "Please reconfirm your passwords.", "warning");
  481.                     return false;
  482.                 }
  483.  
  484.  
  485.                 var formData = {plainPassword:password, userName:email};
  486.                 requestLib.postRequest(apiDomain + apiPort + apiPath + "/useraccountregister", formData, false, function(data){
  487.                     console.log(data);
  488.                     if(data.success) {
  489.                         triggerNotification("Registered!", "Successfully registered your account, you may now login.", "success");
  490.                         $("#loginForms").hide();
  491.                         $("#createAccountForms").hide();
  492.                         $("#createAccountButtonContainer").show();
  493.                         $("#loginButtonContainer").show();
  494.                     } else {
  495.                         console.log("Login failed");
  496.                         triggerNotification("Request failed", data.response, "error");
  497.                     }
  498.                 });
  499.             } else {
  500.                 triggerNotification("ToS Error", "We require you to agree with our Terms of Service and Privacy Policy before creating an account with us.", "warning");
  501.             }
  502.         });
  503.  
  504.         $("#logout").click(function(e) {
  505.             e.preventDefault();
  506.             deleteCookie('userName');
  507.             deleteCookie('accessToken');
  508.             location.reload();
  509.  
  510.         });
  511.  
  512.         $("#addUser").click(function() {
  513.             var userName = $("#spectateUserInput").val();
  514.             if(!empty(userName)) {
  515.                 requestLib.spectateUser(userName, function(data) {
  516.                     if(data.success) {
  517.                         triggerNotification("Success!", "You are now spectating " + userName,"success");
  518.                     } else {
  519.                         triggerNotification("Invalid input", data.response,"error");
  520.                     }
  521.                 });
  522.             } else {
  523.                 triggerNotification("Invalid input", "Please provide a username","warning");
  524.             }
  525.         });
  526.  
  527.         $("#removeUser").click(function() {
  528.             var userName = $("#unSpectateUserInput").val();
  529.             //$(this).attr("data-id");
  530.             if(!empty(userName)) {
  531.                 requestLib.unspectateUser(userName, function(data) {
  532.                     if(data.success) {
  533.                         triggerNotification("Success!", "You are now spectating " + userName,"success");
  534.                     } else {
  535.                         triggerNotification("Invalid input", data.response,"error");
  536.                     }
  537.                 });
  538.             } else {
  539.                 triggerNotification("Invalid input", "Please provide a username","warning");
  540.             }
  541.         });
  542.  
  543.  
  544.         function applyOnlineUsersData(data) {
  545.             console.log(data);
  546.             $("#onlineCount").text("("+data.total+")");
  547.             $("#onlineUserList").empty();
  548.  
  549.             var userContainer = $("<div>");
  550.             data.data.forEach(function(user){
  551.                 userContainer.append($("<li>").attr("data-id", user.userAccount.accountName).addClass("list-group-item").text(user.userAccount.accountName));
  552.             });
  553.  
  554.             $("#onlineUserList").empty().append(userContainer);
  555.  
  556.             // userContainer.find("li").sort(function (a, b) {
  557.          //      var contentA =parseInt( $(a).attr('data-id'));
  558.          //      var contentB =parseInt( $(b).attr('data-id'));
  559.          //      return (contentA > contentB) ? -1 : (contentA < contentB) ? 1 : 0;
  560.          //   }).appendTo("#onlineUserList");
  561.  
  562.  
  563.  
  564.  
  565.  
  566.         }
  567.  
  568.     </script>
  569. </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement