Skip to content

Commit 765b498

Browse files
committed
Allow for importing via PokeBin
1 parent 25c6456 commit 765b498

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

play.pokemonshowdown.com/js/client-teambuilder.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@
13871387
type: 'GET',
13881388
url: url,
13891389
success: function (data) {
1390-
if (/^https?:\/\/pokepast\.es\/.*\/json\s*$/.test(url)) {
1390+
if (/^https?:\/\/(pokepast\.es|pokebin\.com)\/.*\/json\s*$/.test(url)) {
13911391

13921392
var notes = data.notes.split('\n');
13931393
if (notes[0].startsWith('Format: ')) {
@@ -1422,7 +1422,7 @@
14221422
}
14231423
},
14241424
importableUrl: function (value) {
1425-
var match = value.match(/^https?:\/\/(pokepast\.es|gist\.github(?:usercontent)?\.com)\/(.*)\s*$/);
1425+
var match = value.match(/^https?:\/\/(pokebin\.com|pokepast\.es|gist\.github(?:usercontent)?\.com)\/(.*)\s*$/);
14261426
if (!match) return;
14271427

14281428
var host = match[1];
@@ -1431,6 +1431,8 @@
14311431
switch (host) {
14321432
case 'pokepast.es':
14331433
return 'https://pokepast.es/' + path.replace(/\/.*/, '') + '/json';
1434+
case 'pokebin.com':
1435+
return 'https://pokebin.com/' + path.replace(/\/.*/, '') + '/json';
14341436
default: // gist
14351437
var split = path.split('/');
14361438
return split.length < 2 ? undefined : 'https://gist.githubusercontent.com/' + split[0] + '/' + split[1] + '/raw';

0 commit comments

Comments
 (0)