Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <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>
- <meta charset="UTF-8">
- <title>PokeBot Viewer</title>
- <!-- Latest compiled and minified CSS -->
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css">
- <link rel="stylesheet" href="css/toastr.min.css">
- <style>
- html, body {
- height: 100%;
- margin: 0;
- padding: 0;
- }
- #map {
- height: 100%;
- }
- #leftBoxContainer {
- position:fixed;
- z-index:1;
- top:50px;
- left:10px;
- width:250px;
- max-height:800px;
- overflow-y: scroll;
- }
- #spectateContainer {
- z-index:1;
- width:100%;
- background-color:#eee;
- border: 1px solid #aaa;
- padding:0px 15px;
- padding-bottom:10px;
- }
- #spectatedUsersContainer {
- z-index:1;
- width:100%;
- background-color:#eee;
- border: 1px solid #aaa;
- padding:0px 15px;
- padding-bottom:10px;
- max-height:200px;
- overflow-y: scroll;
- margin-top:10px;
- }
- #onlineUserListContainer {
- z-index:1;
- width:100%;
- background-color:#eee;
- border: 1px solid #aaa;
- padding:0px 15px;
- padding-bottom:10px;
- max-height:300px;
- overflow-y: scroll;
- margin-top:10px;
- }
- #notLoggedInContainer {
- position:fixed;
- z-index:1;
- top:50px;
- right:10px;
- width:200px;
- background-color:#eee;
- border: 1px solid #aaa;
- padding:10px 15px;
- padding-bottom:10px;
- text-align:center;
- display:none;
- }
- #loggedInContainer {
- position:fixed;
- z-index:1;
- top:50px;
- right:10px;
- width:200px;
- background-color:#eee;
- border: 1px solid #aaa;
- padding:10px 15px;
- padding-bottom:10px;
- text-align:center;
- display:none;
- }
- #specateContainer button {
- width:100%;
- }
- #notLoggedInContainer button {
- width:100%;
- }
- #loggedInContainer button {
- width:100%;
- }
- #loginForms {
- display:none;
- }
- #createAccountForms {
- display:none;
- }
- .list-group-item {
- padding:1px 10px;
- }
- ::-webkit-scrollbar{width:6px;height:8px;}
- ::-webkit-scrollbar-thumb{background:#F2BE35;}
- ::-webkit-scrollbar-thumb:window-inactive{background:#F2BE35;}
- </style>
- <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>
- <body>
- <div id="loggedInContainer">
- <div style="font-weight:bold;margin-bottom:6px;">
- User: <span id="loggedInUser"></span>
- </div>
- <div class="form-group" style="margin-bottom:10px;" id="loginButtonContainer"><button id="toggleApiToken" class="btn btn-primary">Show Api Token</button></div>
- <input id="apiTokenInput" type="text" class="form-control" placeholder="Failed to load" style="display:none;">
- <div class="form-group" style="margin-bottom:0px;" id="loginButtonContainer"><button id="logout" class="btn btn-danger">Logout</button></div>
- </div>
- <div id="leftBoxContainer">
- <div id="spectateContainer">
- <h4>Spectate User</h4>
- <div id="expandDiv">
- <input type="text" id="spectateUserInput" placeholder="User Name" class="form-control">
- <button type="submit" id="addUser" class="btn btn-success" style="width:100%;">Add to Spectated</button>
- </div>
- </div>
- <div id="onlineUserListContainer">
- <h4>Specated Users <small id="spectatedCount">(0)</small></h4>
- <ul class="list-group" id="spectatedUserList">
- <li class="list-group-item">loading...</li>
- </ul>
- </div>
- <div id="onlineUserListContainer">
- <h4>Online Users <small id="onlineCount">(0)</small></h4>
- <ul class="list-group" id="onlineUserList">
- </ul>
- </div>
- </div>
- <div id="notLoggedInContainer" style="display: block;">
- <div class="form-group" id="loginButtonContainer"><button id="openLogin" class="btn btn-primary">Login</button></div>
- <div id="loginForms">
- <div class="form-group">
- <input id="loginUsername" type="text" class="form-control" placeholder="Username">
- </div>
- <div class="form-group">
- <input id="loginPassword" type="password" class="form-control" placeholder="Password">
- </div>
- <button id="doLogin" class="btn btn-success">Login</button>
- <div class="form-group"><button class="goBack btn btn-danger">Go Back</button></div>
- </div>
- <div class="form-group" id="createAccountButtonContainer"><button id="openCreateAccount" class="btn btn-primary">Create Account</button></div>
- <div id="createAccountForms">
- <div class="form-group">
- <input id="registerUsername" type="text" class="form-control" placeholder="Username">
- </div>
- <div class="form-group">
- <input id="registerPassword" type="password" class="form-control" placeholder="Password">
- </div>
- <div class="form-group">
- <input id="registerPasswordConfirmation" type="password" class="form-control" placeholder="Confirm Password">
- </div>
- <button id="doRegister" class="btn btn-success">Register</button>
- <div class="form-group"><button class="goBack btn btn-danger">Go Back</button></div>
- </div>
- </div>
- <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("https://maps.gstatic.com/mapfiles/openhand_8_8.cur") 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&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&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&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&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&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&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&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&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&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&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&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&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&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&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&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&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&z=2&t=p&hl=fr-FR&gl=US&mapclient=apiv3" title="Cliquez ici pour afficher cette zone sur Google 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&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("https://maps.gstatic.com/mapfiles/openhand_8_8.cur") 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>
- <!-- Latest compiled and minified JavaScript -->
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
- <script src="js/toastr.min.js"></script>
- <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBUBrX1N-nAYoWn71ml7idrepNfXkmfbng" type="text/javascript"></script>
- <script src="js/lib.js" type="text/javascript"></script>
- <script>
- var map;
- var bots = [];
- var source;
- var onlineAccountsTimer;
- var onlineAccounts = [];
- window.onload = function()
- {
- map = new google.maps.Map(document.getElementById("map"), {
- center: {lat: 0, lng: 0},
- zoom: 2,
- mapTypeId: google.maps.MapTypeId.TERRAIN
- });
- bot_handler_ = {
- bot_hash_:{},
- map_:null,
- default_color_:null,
- default_icon_:"http://archives.bulbagarden.net/media/upload/1/12/ORAS_Beauty_Icon.png",
- handleEvent:function(event)
- {
- //console.log(event);
- if(event.hasOwnProperty("user_id") && event.hasOwnProperty("bot_id"))
- {
- var botName = event["user_id"] + "_" + event["bot_id"];
- if(typeof this.bot_hash_[botName] === "undefined")
- {
- console.log("added new bot!");
- this.bot_hash_[botName] = new CPokemonBot(botName, this.map_, this.default_color_, true, this.default_icon_);
- }
- this.bot_hash_[botName].handleBotEvent(event);
- }
- },
- getBot:function(user_id)
- {
- return this.bot_hash_.hasOwnProperty(user_id) ? this.bot_hash_[user_id] : null;
- },
- };
- bot_handler_.map_ = map;
- bot_handler_.default_color_ = "#ff0000";
- bot_handler_.default_icon_ = "img/default.png";
- requestLib.loadUserData(function(data) {
- if(data.success) {
- console.log(data);
- var userName = getCookie("userName");
- $("#loggedInUser").text(userName);
- triggerNotification("Welcome!", "Welcome back " + userName, "success");
- $("#notLoggedInContainer").fadeOut(500, function() {$("#loggedInContainer").fadeIn(500);});
- $("#apiTokenInput").val(requestLib.authorizationToken);
- source = new EventSource("https://api.locatoad.xyz:8443/cApi/events?oauth_token="+requestLib.authorizationToken);
- source.onmessage = function(event) {
- if(event.data !== "p" && event.data !== "connected") {
- try
- {
- var json = JSON.parse(event.data);
- bot_handler_.handleEvent(json);
- }
- catch(e)
- {
- console.log(e);
- }
- }
- };
- $("#spectatedUserList").empty();
- if(data.response.userAccount.spectated.length > 0) {
- data.response.userAccount.spectated.forEach(function(spectated) {
- $("#spectatedUserList").append($("<li>").addClass("list-group-item").attr("data-id", spectated).html(spectated + " <span color='red;'><i class='fa fa-trash-o'></i></span>"));
- });
- $("#spectatedCount").text("("+data.response.userAccount.spectated.length+")");
- }
- requestLib.onlineUsers(function(data){
- if(data.success) {
- onlineAccounts = data.response.data;
- //console.log(data);
- applyOnlineUsersData(data.response);
- } else {
- triggerNotification("Failed to get online users", "Failed to get online users, trying again in 30 seconds.", "warning");
- }
- });
- onlineAccountsTimer = setInterval(function() {
- requestLib.onlineUsers(function(data){
- if(data.success) {
- onlineAccounts = data.response.data;
- //console.log(data);
- applyOnlineUsersData(data.response);
- } else {
- triggerNotification("Failed to get online users", "Failed to get online users, trying again in 30 seconds.", "warning");
- }
- });
- },15000);
- } else {
- triggerNotification("Debug Message","not logged in", "warning");
- $("#notLoggedInContainer").show();
- }
- });
- }
- $("#spectateUserInput").on("keyup", function(e) {
- });
- $("#expandButton").click(function(e) {
- e.preventDefault();
- $("#expandDiv").hide();
- $("#formContainer").fadeIn(500);
- });
- $("#closeButton").click(function(e) {
- e.preventDefault();
- $("#formContainer").fadeOut(200, function() { $("#expandDiv").fadeIn(500);});
- });
- $("#addBot").click(function(e) {
- e.preventDefault();
- var ip = $("#ip").val();
- var port = $("#port").val();
- var nickname = $("#nickname").val();
- var color = $("#color").val();
- var icon = $("#icon").val();
- if($("#showPokemon").val("yes")) {
- var showPokemon = true;
- } else {
- var showPokemon = false;
- }
- if(ip == "" || port == "") {
- triggerNotification("Missing fields","please provide both ip and port","warning");
- } else {
- console.log(color);
- var bot = new CPokemonBot(nickname, map, color, showPokemon, icon);
- triggerNotification("Connecting","connecting to " + ip + ":" + port,"success");
- bot.connect(ip, parseInt(port));
- bots.push(bot);
- $("#formContainer").fadeOut(500, function() {$("#expandDiv").fadeIn(200);});
- }
- });
- $("#openLogin").click(function() {
- $("#loginForms").show();
- $("#createAccountForms").hide();
- $("#createAccountButtonContainer").hide();
- $("#loginButtonContainer").hide();
- });
- $("#openCreateAccount").click(function() {
- $("#loginForms").hide();
- $("#createAccountForms").show();
- $("#createAccountButtonContainer").hide();
- $("#loginButtonContainer").hide();
- });
- $(".goBack").click(function() {
- $("#loginForms").hide();
- $("#createAccountForms").hide();
- $("#createAccountButtonContainer").show();
- $("#loginButtonContainer").show();
- });
- $("#toggleApiToken").click(function() {
- if($("#apiTokenInput").is(":visible")) {
- $("#apiTokenInput").hide();
- $(this).text("Show Api token");
- } else {
- $("#apiTokenInput").show();
- $(this).text("Hide Api token");
- }
- });
- $("#doLogin").click(function(e) {
- e.preventDefault();
- if(typeof $("#loginUsername").val() === "string" && $("#loginUsername").val() !== "") {
- var username = $("#loginUsername").val();
- } else {
- triggerNotification("Incorrect username", "Please provide a valid username", "warning");
- return false;
- }
- if(typeof $("#loginPassword").val() === "string" && $("#loginPassword").val() !== "") {
- var password = $("#loginPassword").val();
- } else {
- triggerNotification("Missing password", "Please provide your password to login.", "warning");
- return false;
- }
- $.ajaxSetup({headers: {"Authorization": "Basic " + btoa(username+":"+password)}});
- requestLib.getRequest(apiDomain + apiPort + apiPath + "/useraccountlogin", false, function (data) {
- console.log(data);
- if (data.success) {
- console.log("login success");
- triggerNotification("Success!", data.response, "success");
- location.reload();
- setCookie("userName", username,1);
- setCookie("accessToken", data.access_token ,1);
- } else {
- console.log("Login failed");
- triggerNotification("Failed to log in", data.response, "error");
- }
- });
- });
- $("#doRegister").click(function(e) {
- e.preventDefault();
- if(true || $("#tos").is(":checked")) {
- var password = $("#registerPassword").val();
- var repeatpassword = $("#registerPasswordConfirmation").val();
- var email = $("#registerUsername").val();
- if(typeof $("#registerPassword").val() === "string" && $("#registerPassword").val() !== "") {
- var password = $("#registerPassword").val();
- } else {
- triggerNotification("Missing password", "Please provide a your password to login.", "warning");
- return false;
- }
- if(typeof $("#registerPasswordConfirmation").val() === "string" && $("#registerPasswordConfirmation").val() !== "") {
- var repeatpassword = $("#registerPasswordConfirmation").val();
- } else {
- triggerNotification("Missing repeat password", "Please confirm your password.", "warning");
- return false;
- }
- if(typeof $("#registerUsername").val() === "string" && $("#registerUsername").val() !== "") {
- var email = $("#registerUsername").val();
- } else {
- triggerNotification("Missing username", "Please provide a your email to login.", "warning");
- return false;
- }
- if(repeatpassword !== password) {
- triggerNotification("Passwords don't match", "Please reconfirm your passwords.", "warning");
- return false;
- }
- var formData = {plainPassword:password, userName:email};
- requestLib.postRequest(apiDomain + apiPort + apiPath + "/useraccountregister", formData, false, function(data){
- console.log(data);
- if(data.success) {
- triggerNotification("Registered!", "Successfully registered your account, you may now login.", "success");
- $("#loginForms").hide();
- $("#createAccountForms").hide();
- $("#createAccountButtonContainer").show();
- $("#loginButtonContainer").show();
- } else {
- console.log("Login failed");
- triggerNotification("Request failed", data.response, "error");
- }
- });
- } else {
- triggerNotification("ToS Error", "We require you to agree with our Terms of Service and Privacy Policy before creating an account with us.", "warning");
- }
- });
- $("#logout").click(function(e) {
- e.preventDefault();
- deleteCookie('userName');
- deleteCookie('accessToken');
- location.reload();
- });
- $("#addUser").click(function() {
- var userName = $("#spectateUserInput").val();
- if(!empty(userName)) {
- requestLib.spectateUser(userName, function(data) {
- if(data.success) {
- triggerNotification("Success!", "You are now spectating " + userName,"success");
- } else {
- triggerNotification("Invalid input", data.response,"error");
- }
- });
- } else {
- triggerNotification("Invalid input", "Please provide a username","warning");
- }
- });
- $("#removeUser").click(function() {
- var userName = $("#unSpectateUserInput").val();
- //$(this).attr("data-id");
- if(!empty(userName)) {
- requestLib.unspectateUser(userName, function(data) {
- if(data.success) {
- triggerNotification("Success!", "You are now spectating " + userName,"success");
- } else {
- triggerNotification("Invalid input", data.response,"error");
- }
- });
- } else {
- triggerNotification("Invalid input", "Please provide a username","warning");
- }
- });
- function applyOnlineUsersData(data) {
- console.log(data);
- $("#onlineCount").text("("+data.total+")");
- $("#onlineUserList").empty();
- var userContainer = $("<div>");
- data.data.forEach(function(user){
- userContainer.append($("<li>").attr("data-id", user.userAccount.accountName).addClass("list-group-item").text(user.userAccount.accountName));
- });
- $("#onlineUserList").empty().append(userContainer);
- // userContainer.find("li").sort(function (a, b) {
- // var contentA =parseInt( $(a).attr('data-id'));
- // var contentB =parseInt( $(b).attr('data-id'));
- // return (contentA > contentB) ? -1 : (contentA < contentB) ? 1 : 0;
- // }).appendTo("#onlineUserList");
- }
- </script>
- </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement