//endSliceString = "<" //I'll do some slicing to ensure all the "api" gives me is just the content and not its design. //data = data.slice(data.indexOf(sliceString) + sliceString.length) //data = data.slice(0, data.indexOf(endSliceString)) //jQuery('.online_users').html(data); var online = JSON.parse(data); jQuery('.online_users').html(online.usercount); if (online.usercount > 10){ jQuery('#server_status').html("Online"); jQuery('#server_status').attr("color", "green"); } else { jQuery('#server_status').html("Offline"); jQuery('#server_status').attr("color", "red"); } } /*(function worker() { jQuery.ajax({ url: "/api/get_online_users", success: updateOnlineUsers, complete: function() { //Schedule next re-update: var seconds = 60; setTimeout(worker, seconds * 1000); } }); })();*/ function updateUniqueUsers(data) { var uniqueUsers = JSON.parse(data); tooltipContent = 'Daily: ' + uniqueUsers.daily.toString() + '
' tooltipContent += 'Weekly: ' + uniqueUsers.weekly.toString() + '
' tooltipContent += 'Monthly: ' + uniqueUsers.monthly.toString(); jQuery('.unique_users_tooltip_content').html(tooltipContent); } (function worker() { jQuery.ajax({ url: "/api/get_unique_users", success: updateUniqueUsers, complete: function() { //Schedule next re-update: var seconds = 10; //setTimeout(worker, seconds * 1000); //Disabling for now. } }); })(); //There's some weird rare bug in some browsers apparently where this script //wasn't executed upon reloading the page from cache by clicking "back" or //"forward" buttons; putting this (non-rescheduled) function in an //onpageshow event fixes it. That said, onpageshow takes slightly longer to //load, so... leaving both versions here; so one loads fast, and the other //is a fix for those with this bug. Code repetition ftw. window.onpageshow = (function worker() { jQuery.ajax({ url: "/api/get_online_users", success: updateOnlineUsers }); jQuery.ajax({ url: "/api/get_unique_users", success: updateUniqueUsers }); }); function smallKimmyOnClick() { let is_dark = curr_theme == 'dark'; let new_mode = is_dark ? 'light' : 'dark'; setTheme("default", new_mode, sheet_link, banner); sk = document.getElementById("smallkimmy"); sk.className = 'themeButton ' + (is_dark ? "redKimmy" : "blueKimmy"); lg = document.getElementById("loading-gif"); lg.src = is_dark ? '/static/images/hungry.gif' : '/static/images/hungryzombie.gif'; lm = document.getElementById("learnmore"); // It's all hacky, I know. I'm short on time. :( // NOTE(geospiza): :( lm.className = 'learnmore' + (lm.className.endsWith('dark') ? '' : '_dark'); } -->
Welcome to MapleLegends! We are an Old School Maplestory Server. Click here if you wish to learn more about our server.