Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var style = document.createElement('style');
- style.type = 'text/css';
- var container = '<div id="player_container"></div>';
- function hidemc(){
- document.getElementById("alert").style.display = "none";
- }
- style.innerHTML = `
- #player_container {
- width: 370px;
- min-height: 100px;
- max-height: 400px;
- display: inline-block;
- text-align: center;
- overflow: hidden;
- overflow-y: scroll;
- }
- .online_player {
- border: 1px solid #694b0e;
- padding: 3px 8px 3px;
- display: inline-block;
- width: 110px;
- margin: 1px;
- background: #1b1717;
- font-size: 13px;
- line-height: 13px;
- cursor: pointer;
- color: orange;
- box-sizing: border-box;
- text-decoration: none;
- text-align: center;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- }
- `;
- document.getElementsByTagName('head')[0].appendChild(style);
- $('#lagmeter').click(function() {
- var url = "https://crossorigin.me/http://www.margonem.pl/?task=stats";
- var world = g.worldname;
- var httpRequest = new XMLHttpRequest();
- httpRequest.open("GET", url, false);
- httpRequest.send();
- var respo = httpRequest.response;
- var parser = new DOMParser();
- var htmlDoc = parser.parseFromString(respo, "text/html");
- var stats_mc = htmlDoc.querySelector(`#online_${world} p b`);
- if(stats_mc === null)
- {
- message("<span style='color: #a5a5ff'>Żaden moderator czatu nie jest online :(</span>");
- }
- else{
- stats_mc = htmlDoc.querySelector(`#online_${world} p b`).textContent;
- var x = '';
- var mcarray = new Array();
- mcarray = stats_mc.split(", ");
- for (var i in mcarray) {
- x += '<div class="online_player" onclick="chatTo(\'' + mcarray[i] + '\');hidemc();" style="color: gold; font-weight: bold;">' + mcarray[i] + '</div>';
- }
- container = `<div id="player_container">${x}</div>`;
- mAlert("<span style='font-weight: bold; font-size: 20px; text-align: center'>Moderatorzy online:</span><br>"+container, 0, function() {
- hidemc();
- });
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement