diff --git a/js/client-teambuilder.js b/js/client-teambuilder.js index 2215eca058..b3c819e57b 100644 --- a/js/client-teambuilder.js +++ b/js/client-teambuilder.js @@ -152,7 +152,13 @@ buf += '
'; } else { buf = '
'; - buf += '
'; + buf += '
'; } this.$el.html(buf); this.$('.teamedit textarea').focus().select(); diff --git a/js/storage.js b/js/storage.js index ca3ef101b3..d2018b60c3 100644 --- a/js/storage.js +++ b/js/storage.js @@ -1022,9 +1022,9 @@ Storage.getPackedTeam = function (team) { return team.team; }; -Storage.importTeam = function (text, teams) { - var text = text.split("\n"); - var team = []; +Storage.importTeam = function (buffer, teams) { + var text = buffer.split("\n"); + var team = teams ? null : []; var curSet = null; if (teams === true) { Storage.teams = []; @@ -1062,6 +1062,10 @@ Storage.importTeam = function (text, teams) { folder: folder, iconCache: '' }); + } else if (!team) { + // not in backup format + Storage.teams = Storage.unpackAllTeams(buffer); + return; } else if (!curSet) { curSet = {name: '', species: '', gender: ''}; team.push(curSet);