MediaWiki:Common.js: Difference between revisions
Content added Content deleted
No edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ |
/* Any JavaScript here will be loaded for all users on every page load. */ |
||
if ( mw.config.get('wgPageName') === 'Current_worldguards' ) { |
|||
function fetch_worldguard_data() { |
function fetch_worldguard_data() { |
||
fetch("https://puucraft-dynmap-regionsworldjson-test.mixarium.repl.co/", {"method": "GET", "mode": 'cors', 'headers': {"content-security-policy": "connect-src 'self'"}) gosh, how do i get around CSP? |
fetch("https://puucraft-dynmap-regionsworldjson-test.mixarium.repl.co/", {"method": "GET", "mode": 'cors', 'headers': {"content-security-policy": "connect-src 'self'"}) gosh, how do i get around CSP? |
||
.then(function(response) { |
.then(function(response) { |
||
if (response.ok) { |
if (response.ok) { |
||
return response.json() |
return response.json(); |
||
} else { |
} else { |
||
throw new Error("NETWORK RESPONSE ERROR") |
throw new Error("NETWORK RESPONSE ERROR"); |
||
}; |
}; |
||
}) |
}) |
||
Line 26: | Line 26: | ||
fetch_worldguard_data() |
fetch_worldguard_data() |
||
}; |
}; |
||
*/ |
|||
if ( mw.config.get('wgPageName') === 'Puucraft' ) { |
if ( mw.config.get('wgPageName') === 'Puucraft' ) { |
||
function get_time_difference_from_current(unix_in_ms) { |
function get_time_difference_from_current(unix_in_ms) { |