Support configurable URLs (#1543)

This commit is contained in:
Annika
2020-07-21 15:27:21 -07:00
committed by GitHub
parent 3f169151d3
commit 367ed82e56
43 changed files with 285 additions and 214 deletions

View File

@@ -12,13 +12,14 @@
<link rel="stylesheet" href="style/font-awesome.css" />
<meta name="robots" content="noindex" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<script src="https://play.pokemonshowdown.com/config/config.js"></script>
<script>
function loadRemoteData(src) {
var scriptEl = document.createElement('script');
scriptEl.src = src.replace(/.*\/?data\//g, 'https://play.pokemonshowdown.com/data/');
document.head.appendChild(scriptEl);
}
var Config = {testclient: true};
Config.testclient = true;
(function() {
if (location.search !== '') {
var m = /\?~~(([^:\/]*)(:[0-9]*)?)/.exec(location.search);
@@ -85,7 +86,6 @@
window.exports = window;
</script>
<script src="https://play.pokemonshowdown.com/config/config.js"></script>
<script src="js/battledata.js" onerror="alert('You must build the client with `node build` before using testclient.html')"></script>
<script src="data/pokedex-mini.js" onerror="loadRemoteData(this.src)"></script>
<script src="data/pokedex-mini-bw.js" onerror="loadRemoteData(this.src)"></script>