mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-03-21 17:50:29 -05:00
Add query string syntax to testclient.html
This commit is contained in:
parent
7917f89a49
commit
6ed5c51aeb
|
|
@ -13,10 +13,13 @@ Testing
|
|||
------------------------------------------------------------------------
|
||||
|
||||
You can make and test client changes simply by opening `testclient.html`.
|
||||
|
||||
This will allow you to test changes to the client without setting up your
|
||||
own login server.
|
||||
|
||||
You can connect to an arbitrary server by navigating to
|
||||
`testclient.html?~~host:port`. For example, to connect to a server running
|
||||
locally on port 8000, you can navigate to `testclient.html?~~localhost:8000`.
|
||||
|
||||
Certain things will fail:
|
||||
|
||||
+ Registering
|
||||
|
|
|
|||
|
|
@ -19,6 +19,20 @@
|
|||
serverprotocol: 'ws',
|
||||
testclient: true
|
||||
};
|
||||
(function() {
|
||||
if (location.search !== '') {
|
||||
var m = /\?~~(([^:\/]*)(:[0-9]*)?)/.exec(location.search);
|
||||
if (m) {
|
||||
Config.serverid = m[1];
|
||||
Config.server = m[2];
|
||||
if (m[3]) {
|
||||
Config.serverport = m[3];
|
||||
}
|
||||
} else {
|
||||
alert('Unrecognised query string syntax: ' + location.search);
|
||||
}
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<!--[if lte IE 8]><script>
|
||||
oldie = true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user