Guest User

Uber's Godview HTML

a guest
Nov 18th, 2014
2,007
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <title>godView</title>
  6. <meta charset="utf-8">
  7. <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
  8.  
  9. <link rel="stylesheet" href="css/leaflet.css" type="text/css" media="screen" />
  10. <link rel ="stylesheet" href="css/god_view.css" type="text/css" media="screen" />
  11. <link rel ="stylesheet" href="css/chosen.css" type="text/css" media="screen" />
  12.  
  13. <script src="js/jquery-1.9.1.min.js" type="text/javascript"></script>
  14. <script src="js/jquery.cookie.js" type="text/javascript"></script>
  15. <script src="js/jquery.ui.effects.min.js"></script>
  16. <script src="js/timezone.js"></script>
  17.  
  18. <script type="text/javascript">
  19. $(function() {
  20.  
  21. window.gvToken = null;
  22. // At this time, tools and partners use different approaches to authentication (partners is better)
  23. if (/tools/.test(location.host)) {
  24. gvToken = $.cookie('token');
  25. if (!gvToken) {
  26. $.cookie('redirect', '#/godview', {path: '/'});
  27. location.href = '/#/login';
  28. }
  29. } else if (/partners/.test(location.host)) {
  30. $("title").html("Live View");
  31. $("#app_title").html("LiveView");
  32. var user = $.parseJSON($.cookie('user'));
  33. gvToken = user.token;
  34. if (!gvToken) {
  35. location.href = '/';
  36. }
  37. } else if (!gvToken) {
  38. location.href = 'https://www.uber.com';
  39. }
  40.  
  41. function currency(sSymbol, vValue) {
  42. aDigits = parseFloat(vValue).toFixed(2).split(".");
  43. aDigits[0] = aDigits[0].split("").reverse().join("").replace(/(\d{3})(?=\d)/g, "$1,").split("").reverse().join("");
  44. return sSymbol + aDigits.join(".");
  45. }
  46.  
  47. if(/tools/.test(location.host)){
  48. var rrKeys = [];
  49. var rrCode = '49,48,16,54,56';
  50. var rrCode2 = '49,48,16,54,57';
  51. var soundCode = '77,79,16,52,52';
  52. var sound = 'cash_register.mp3'
  53. var $rr = $('#rr');
  54. $(window).bind('keydown', function(e){
  55. rrKeys.push(e.keyCode);
  56. if(rrKeys.toString().indexOf(soundCode) >= 0) {
  57. sound = 'straight_cash_homey.mp3';
  58. $rr.css('backgroundImage', 'url(/godview/img/moss.jpg)');
  59. rrKeys = rrCode.split(',');
  60. }
  61. if(rrKeys.toString().indexOf(rrCode2) >= 0) {
  62. rrKeys = [];
  63. $('body').find('embed').remove()
  64. $('body').append('<embed src="/godview/'+sound+'" autoplay="true" loop="false"></embed>');
  65. $.get('/api/metrics/run_rate?token='+gvToken, function(data){
  66. rr = currency('$', data.run_rate);
  67. $rr.css('backgroundImage', 'url(/godview/img/dr_evil.jpg)');
  68. $rr.text(rr);
  69. $rr.show('scale', {}, 2000, function() {
  70. $rr.show('shake', {}, 100, function() {
  71. $rr.hide('scale', {}, 1000);
  72. });
  73. });
  74. });
  75. }
  76. if(rrKeys.toString().indexOf(rrCode) >= 0) {
  77. rrKeys = [];
  78. $rr.css('backgroundImage', 'url(/godview/img/mission_accomplished.jpg)');
  79. $rr.text('');
  80. $rr.show('scale', {}, 2000, function() {
  81. $rr.show('shake', {}, 100, function() {
  82. $rr.hide('scale', {}, 1000);
  83. });
  84. });
  85. }
  86. });
  87. }
  88. });
  89.  
  90. var getMultipliers = function() {
  91. var now = new Date();
  92. $.get('/api/dynamic_fares?limit=999999&token='+$.cookie('token'), function(data) {
  93. var dfares = data.resources;
  94. $.get('/api/cities?token='+$.cookie('token'), function(data) {
  95. cities = data;
  96. $.each(cities, function(n, city) {
  97. if (city.display_name === 'Washington Dc') {
  98. cities[n].display_name = 'Washington D.C.';
  99. }
  100. if (city.display_name === 'San Francisco') {
  101. cities[n].display_name = 'San Fransisco';
  102. }
  103. for (var i = 0; i < dfares.length; i++) {
  104. var end = Date.parse(dfares[i].end_at);
  105. var start = Date.parse(dfares[i].start_at);
  106. if (!dfares[i].deleted_at && end > now && start < now && dfares[i].city_id === city.id) {
  107. cities[n].dynamic_fare = dfares[i];
  108. break;
  109. }
  110. }
  111. });
  112. $('#citiesTable tr a').each(function() {
  113. $this = $(this);
  114. $.each(cities, function(n, city) {
  115. re = new RegExp(city.display_name);
  116. if (re.test($this.text())) {
  117. if (city.dynamic_fare) {
  118. var multiplier = city.dynamic_fare.fixed_multiplier;
  119. } else {
  120. var multiplier = 1;
  121. }
  122. $this.text(city.display_name+' ('+multiplier+'x)');
  123. }
  124. });
  125. });
  126. });
  127. });
  128. };
  129. $(document).on('click', '#globalTab', null, function() {
  130. getMultipliers();
  131. setInterval(function() {
  132. getMultipliers();
  133. }, 10000 * 60 * 2);
  134. });
  135. </script>
  136.  
  137. <script type="text/javascript" src="js/leaflet.js"></script>
  138. <script type="text/javascript" src="js/chosen.min.js"></script>
  139.  
  140. <script type="text/javascript" src="js/core.js"></script>
  141. <script type="text/javascript" src="js/dom.js"></script>
  142. <script type="text/javascript" src="js/core-ui.js"></script>
  143.  
  144. <script type="text/javascript" src="js/scrollbar.js"></script>
  145. <script type="text/javascript" src="js/dynamic_checklist.js"></script>
  146. <script type="text/javascript" src="js/utils.js"></script>
  147.  
  148. <script type="text/javascript" src="js/polyline_encoder.js"></script>
  149.  
  150. <script type="text/javascript" src="js/application.js"></script>
  151. <script type="text/javascript" src="js/data.js"></script>
  152. <script type="text/javascript" src="js/events.js"></script>
  153. <script type="text/javascript" src="js/header.js"></script>
  154.  
  155. <script type="text/javascript" src="js/sidebar.js"></script>
  156. <script type="text/javascript" src="js/global_panel.js"></script>
  157. <script type="text/javascript" src="js/city_panel.js"></script>
  158.  
  159. <script type="text/javascript" src="js/cities_table.js"></script>
  160. <script type="text/javascript" src="js/drivers_clients_table.js"></script>
  161. <script type="text/javascript" src="js/trip_state_changes_table.js"></script>
  162.  
  163. <script type="text/javascript" src="js/end-trip-dialog.js"></script>
  164. <script type="text/javascript" src="js/end-trip-message-box.js"></script>
  165.  
  166. <script type="text/javascript" src="js/force-off-duty-message-box.js"></script>
  167.  
  168. <script type="text/javascript" src="js/map.js"></script>
  169. <script type="text/javascript" src="js/global_map_view.js"></script>
  170. <script type="text/javascript" src="js/city_map_view.js"></script>
  171.  
  172. <script type="text/javascript" src="js/client_icon.js"></script>
  173. <script type="text/javascript" src="js/driver_icon.js"></script>
  174. <script type="text/javascript" src="js/pickup_line.js"></script>
  175. <script type="text/javascript" src="js/trip_line.js"></script>
  176. <script type="text/javascript" src="js/city_circle.js"></script>
  177.  
  178. <script type="text/javascript" src="js/drivers_selected_table.js"></script>
  179. <script type="text/javascript" src="js/text-drivers-dialog.js"></script>
  180. </head>
  181.  
  182. <body onload="Application.init(gvToken)">
  183. <div id="rr"></div>
  184.  
  185. <div id="header">
  186. <img id="logo" src="img/logo.png" />
  187. <span id="appTitle">God View</span>
  188. <input id="searchInput" placeholder="Search" />
  189.  
  190. <select id="citySelect">
  191. <option value="">GLOBAL</option>
  192. </select>
  193.  
  194. <div id="localTime"></div>
  195. <div id="utilization">(0 / 0) 0.0%</div>
  196. <div id="averageRating">Avg: 5/5</div>
  197. </div>
  198.  
  199. <div id="expandButton">
  200. <div class="expandArrow"></div>
  201. </div>
  202.  
  203. <div id="sidebar">
  204. <div id="globalPanel">
  205. <div id="globalPanelHeader">
  206. <span id="globalPanelTitle">Global</span>
  207. </div>
  208.  
  209. <table id="citiesTableHeader" cellspacing="0" cellpadding="0">
  210. </table>
  211. <div id="citiesTableFrame">
  212. <table id="citiesTable" cellspacing="0" cellpadding="0">
  213. </table>
  214. </div>
  215. </div>
  216. <div id="cityPanel">
  217. <div id="cityPanelHeader">
  218. <span id="displayAllTab" class="sidebarTabSelected">All</span>
  219. <span id="displayTripsTab" class="sidebarTab"><a href="#">Trips</a></span>
  220. <span id="displayDispatchedTab" class="sidebarTab"><a href="#">Dispatched</a></span>
  221. <span id="displayOpenDriversTab" class="sidebarTab"><a href="#">Open Drivers</a></span>
  222. </div>
  223. <div id="contractButton">
  224. <div class="contractArrow"></div>
  225. </div>
  226. <div id="expandButton2">
  227. <div class="expandArrow2"></div>
  228. </div>
  229.  
  230. <table id="driversClientsTableHeader" cellspacing="0" cellpadding="0">
  231. <tr>
  232. </tr>
  233. </table>
  234. <div id="driversClientsTableFrame">
  235. <table id="driversClientsTable" cellspacing="0" cellpadding="0">
  236. </table>
  237. </div>
  238. </div>
  239. </div>
  240.  
  241. <div id="map"></div>
  242.  
  243. <div id="mapRightColumn">
  244. <div id="vehicleViewsChecklist"></div>
  245. <div id="mapOptionsChecklist"></div>
  246. <div id="driversSelected">
  247. <span><a id="textDrivers-button" class="button">Text Selected Drivers</a></span>
  248. </div>
  249. </div>
  250.  
  251. <div id="tripStateChanges">
  252. <span id="tripStateChangesLabel">Client:</span><span id="tripStateChangesTitle"></span>
  253.  
  254. <span><a id="endTripButton" class="button">End Trip</a></span>
  255.  
  256. <table id="tripStateChangesTable" cellspacing="0" cellpadding="0">
  257. <tr>
  258. <td class="tableHeader" style="border-bottom: none;" width="80">Timestamp</td>
  259. <td class="tableHeader" style="border-bottom: none;" width="110">Driver</td>
  260. <td class="tableHeader" style="border-bottom: none;" width="90">State</td>
  261. </tr>
  262. </table>
  263. </div>
  264.  
  265. <div id="endTripDialog">
  266. <div id="endTripDialog-header">
  267. <span id="endTripDialog-title">End Trip</span>
  268. </div>
  269.  
  270. <div id="endTripDialog-tripInfo">
  271. <span id="endTripDialog-clientLabel">Client:</span>
  272. <span id="endTripDialog-clientName"></span>
  273.  
  274. <span id="endTripDialog-driverLabel">Driver:</span>
  275. <span id="endTripDialog-driverName"></span>
  276. </div>
  277.  
  278. <div id="endTripDialog-cancelTripByClientOptionContainer" class="endTripDialog-optionContainer">
  279. <input id="endTripDialog-cancelTripByClientOption" type="radio" name="endTripType" />
  280. <label for="endTripDialog-cancelTripByClientOption" class="endTripDialog-optionLabel">Cancel Trip (by Client)</label>
  281. <span class="endTripDialog-optionDescription">Effects the same behavior as if the client canceled the trip.</span>
  282. </div>
  283. <div id="endTripDialog-cancelTripByDriverOptionContainer" class="endTripDialog-optionContainer">
  284. <input id="endTripDialog-cancelTripByDriverOption" type="radio" name="endTripType" />
  285. <label for="endTripDialog-cancelTripByDriverOption" class="endTripDialog-optionLabel">Cancel Trip (by Driver)</label>
  286. <span class="endTripDialog-optionDescription">Effects the same behavior as if the driver canceled the trip.</span>
  287. </div>
  288. <div id="endTripDialog-dropoffOptionContainer" class="endTripDialog-optionContainer">
  289. <input id="endTripDialog-dropoffOption" type="radio" name="endTripType" />
  290. <label for="endTripDialog-dropoffOption" class="endTripDialog-optionLabel">Dropoff</label>
  291. <span class="endTripDialog-optionDescription">Effects the same behavior as if the driver dropped off the client.</span>
  292. </div>
  293.  
  294. <div id="endTripDialog-buttons">
  295. <a id="endTripDialog-okButton" href="#">OK</a>
  296. <a id="endTripDialog-cancelButton" href="#">Cancel</a>
  297. </div>
  298. </div>
  299.  
  300. <div id="endTripMessageBox">
  301. <div id="endTripMessageBox-title"></div>
  302.  
  303. <div id="endTripMessageBox-message"></div>
  304.  
  305. <div id="endTripMessageBox-clientInfo">
  306. <span id="endTripMessageBox-clientLabel">Client:</span>
  307. <span id="endTripMessageBox-clientName"></span>
  308. </div>
  309.  
  310. <div id="endTripMessageBox-driverInfo">
  311. <span id="endTripMessageBox-driverLabel">Driver:</span>
  312. <span id="endTripMessageBox-driverName"></span>
  313. </div>
  314.  
  315. <div id="endTripMessageBox-tripInfo">
  316. <span id="endTripMessageBox-tripLabel">Trip ID:</span>
  317. <span id="endTripMessageBox-tripID"></span>
  318. </div>
  319.  
  320. <div id="endTripMessageBox-fareInfo">
  321. <span id="endTripMessageBox-fareLabel">Fare:</span>
  322. <span id="endTripMessageBox-fare"></span>
  323. </div>
  324.  
  325. <div id="endTripMessageBox-buttons">
  326. <a id="endTripMessageBox-okButton" href="#">OK</a>
  327. </div>
  328. </div>
  329.  
  330. <div id="forceOffDutyMessageBox">
  331. <div id="forceOffDutyMessageBox-title"></div>
  332.  
  333. <div id="forceOffDutyMessageBox-message"></div>
  334.  
  335. <div id="forceOffDutyMessageBox-buttons">
  336. <a id="forceOffDutyMessageBox-okButton" href="#">OK</a>
  337. </div>
  338. </div>
  339.  
  340. <div id="textDriversDialog">
  341. <div id="textDriversDialog-title">Send text message to selected drivers</div>
  342.  
  343. <div class="textDriversDialog-row">
  344. <span class="textDriversDialog-label">Drivers:</span>
  345. <select id="textDriversDialog-driversSelect" name="driver_ids" multiple></select>
  346. </div>
  347.  
  348. <div class="textDriversDialog-row">
  349. <span class="textDriversDialog-label">Message:</span>
  350. <textarea name="textDriversDialog-message"></textarea>
  351. <span id='textDriversDialog-charsRemaining'>160</span>
  352. </div>
  353.  
  354. <div class="textDriversDialog-row textDriversDialog-status">
  355. <span class="textDriversDialog-label">Status:</span>
  356. <span id='textDriversDialog-status'>Sending ....</span>
  357. </div>
  358.  
  359. <div id="textDriversDialog-buttons">
  360. <a id="textDriversDialog-cancelButton" href="#" class="button">CANCEL</a>
  361. <a id="textDriversDialog-sendButton" href="#" class="button">SEND</a>
  362. </div>
  363. </div>
  364.  
  365. </body>
  366. </html>
RAW Paste Data