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:
Guangcong Luo 2025-04-20 01:07:17 +00:00
parent 157dc18cbe
commit ab44f2de45

View File

@ -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);