Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. var style = document.createElement('style');
  2. style.type = 'text/css';
  3. var container = '<div id="player_container"></div>';
  4. function hidemc(){
  5. document.getElementById("alert").style.display = "none";
  6. }
  7. style.innerHTML = `
  8. #player_container {
  9. width: 370px;
  10. min-height: 100px;
  11. max-height: 400px;
  12. display: inline-block;
  13. text-align: center;
  14. overflow: hidden;
  15. overflow-y: scroll;
  16. }
  17. .online_player {
  18. border: 1px solid #694b0e;
  19. padding: 3px 8px 3px;
  20. display: inline-block;
  21. width: 110px;
  22. margin: 1px;
  23. background: #1b1717;
  24. font-size: 13px;
  25. line-height: 13px;
  26. cursor: pointer;
  27. color: orange;
  28. box-sizing: border-box;
  29. text-decoration: none;
  30. text-align: center;
  31. text-overflow: ellipsis;
  32. white-space: nowrap;
  33. overflow: hidden;
  34. }
  35. `;
  36. document.getElementsByTagName('head')[0].appendChild(style);
  37. $('#lagmeter').click(function() {
  38. var url = "https://crossorigin.me/http://www.margonem.pl/?task=stats";
  39. var world = g.worldname;
  40. var httpRequest = new XMLHttpRequest();
  41. httpRequest.open("GET", url, false);
  42. httpRequest.send();
  43. var respo = httpRequest.response;
  44. var parser = new DOMParser();
  45. var htmlDoc = parser.parseFromString(respo, "text/html");
  46. var stats_mc = htmlDoc.querySelector(`#online_${world} p b`);
  47. if(stats_mc === null)
  48. {
  49. message("<span style='color: #a5a5ff'>Żaden moderator czatu nie jest online :(</span>");
  50. }
  51. else{
  52. stats_mc = htmlDoc.querySelector(`#online_${world} p b`).textContent;
  53. var x = '';
  54. var mcarray = new Array();
  55. mcarray = stats_mc.split(", ");
  56. for (var i in mcarray) {
  57. x += '<div class="online_player" onclick="chatTo(\'' + mcarray[i] + '\');hidemc();" style="color: gold; font-weight: bold;">' + mcarray[i] + '</div>';
  58. }
  59. container = `<div id="player_container">${x}</div>`;
  60. mAlert("<span style='font-weight: bold; font-size: 20px; text-align: center'>Moderatorzy online:</span><br>"+container, 0, function() {
  61. hidemc();
  62. });
  63. }
  64. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement