mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-04-24 23:30:37 -05:00
Fix dragging teams from teambuilder to computer
Apparently this was broken in the loginserver refactor because we all forgot it existed...
This commit is contained in:
parent
157dc18cbe
commit
ab44f2de45
|
|
@ -948,10 +948,11 @@
|
|||
if (team.format) filename = '[' + team.format + '] ' + filename;
|
||||
filename = $.trim(filename).replace(/[\\\/]+/g, '') + '.txt';
|
||||
var urlprefix = "data:text/plain;base64,";
|
||||
if (document.location.protocol === 'https:') {
|
||||
// Chrome is dumb and doesn't support data URLs in HTTPS
|
||||
urlprefix = "https://" + Config.routes.client + "/action.php?act=dlteam&team=";
|
||||
}
|
||||
// fixed in modern Chrome versions, and this route is no longer maintained
|
||||
// if (document.location.protocol === 'https:') {
|
||||
// // Chrome is dumb and doesn't support data URLs in HTTPS
|
||||
// urlprefix = "https://" + Config.routes.client + "/action.php?act=dlteam&team=";
|
||||
// }
|
||||
var contents = Storage.exportTeam(team.team, team.gen).replace(/\n/g, '\r\n');
|
||||
var downloadurl = "text/plain:" + filename + ":" + urlprefix + encodeURIComponent(window.btoa(unescape(encodeURIComponent(contents))));
|
||||
console.log(downloadurl);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user