diff --git a/js/client-mainmenu.js b/js/client-mainmenu.js
index 496c363a1..fde115212 100644
--- a/js/client-mainmenu.js
+++ b/js/client-mainmenu.js
@@ -384,7 +384,7 @@
},
updateTeams: function() {
if (!window.BattleFormats) return;
- var teams = app.user.teams;
+ var teams = Storage.teams;
var self = this;
this.$('button[name=team]').each(function(i, el) {
@@ -424,7 +424,7 @@
var format = $pmWindow.find('button[name=format]').val();
var teamIndex = $pmWindow.find('button[name=team]').val();
var team = null;
- if (app.user.teams[teamIndex]) team = app.user.teams[teamIndex].team;
+ if (Storage.teams[teamIndex]) team = Storage.teams[teamIndex].team;
if (!window.BattleFormats[format].team && !team) {
app.addPopupMessage("You need to go into the Teambuilder and build a team for this format.");
return;
@@ -448,7 +448,7 @@
var format = $pmWindow.find('button[name=format]').val();
var teamIndex = $pmWindow.find('button[name=team]').val();
var team = null;
- if (app.user.teams[teamIndex]) team = app.user.teams[teamIndex].team;
+ if (Storage.teams[teamIndex]) team = Storage.teams[teamIndex].team;
if (!window.BattleFormats[format].team && !team) {
app.addPopupMessage("You need to go into the Teambuilder and build a team for this format.");
return;
@@ -505,7 +505,7 @@
curTeamFormat: '',
curTeamIndex: -1,
renderTeams: function(formatid, teamIndex) {
- if (!app.user.teams || !window.BattleFormats) {
+ if (!Storage.teams || !window.BattleFormats) {
return '';
}
if (!formatid) formatid = this.curFormat;
@@ -515,7 +515,7 @@
if (window.BattleFormats[formatid].team) {
return '';
}
- var teams = app.user.teams;
+ var teams = Storage.teams;
if (!teams.length) {
return ''
}
@@ -558,7 +558,7 @@
var format = $formatButton.val();
var teamIndex = $teamButton.val();
var team = null;
- if (app.user.teams[teamIndex]) team = app.user.teams[teamIndex].team;
+ if (Storage.teams[teamIndex]) team = Storage.teams[teamIndex].team;
if (!window.BattleFormats[format].team && !team) {
app.addPopupMessage("You need to go into the Teambuilder and build a team for this format.");
return;
@@ -628,7 +628,7 @@
initialize: function(data) {
var bufs = ['','','','',''];
var curBuf = 0;
- var teams = app.user.teams;
+ var teams = Storage.teams;
var bufBoundary = 128;
if (teams.length > 128 && $(window).width() > 1080) {
@@ -699,7 +699,7 @@
}
return buf;
}
- var team = app.user.teams[i];
+ var team = Storage.teams[i];
if (!team) return 'Error: Corrupted team';
var buf = ''+Tools.escapeHTML(team.name)+' ';
for (var i=0; i'
buf += '
aww thanks I\'m glad you like it :)
'
buf += '
';
- if (TeambuilderRoom.cantSave) buf += '
== CAN\'T SAVE == You hit your browser\'s limit for team storage! Please backup them and delete some of them. Your teams won\'t be saved until you\'re under the limit again.
';
+ if (Storage.cantSave) buf += '
== CAN\'T SAVE == You hit your browser\'s limit for team storage! Please backup them and delete some of them. Your teams won\'t be saved until you\'re under the limit again.
';
if (!teams.length) {
if (this.deletedTeamLoc >= 0) {
buf += '';
@@ -133,10 +133,6 @@
}
if (i >= teams.length) break;
- if (i==2 && app.user.cookieTeams) {
- buf += '
== UNSAVED TEAM LINE == All teams below this line will not be saved.
';
- }
-
var team = teams[i];
if (!team) {
@@ -165,11 +161,8 @@
buf += '';
- buf += '
Clearing your cookies or localStorage will delete your teams.
If you want to clear your cookies or localStorage, you can use the Backup/Restore feature to save your teams as text first.
';
+ buf += '
Clearing your cookies (specifically, localStorage) will delete your teams.
If you want to clear your cookies or localStorage, you can use the Backup/Restore feature to save your teams as text first.
';
- if (teams.length >= 2 && app.user.cookieTeams) {
- buf += ' WARNING: Additional teams WILL NOT BE SAVED.';
- }
buf += '';
this.$el.html(buf);
@@ -399,7 +392,7 @@
saveFlag: false,
save: function() {
this.saveFlag = true;
- TeambuilderRoom.saveTeams();
+ Storage.saveTeams();
},
teamNameChange: function(e) {
this.curTeam.name = ($.trim(e.currentTarget.value) || 'Untitled '+(this.curTeamLoc+1));
@@ -1247,8 +1240,8 @@
var team = [];
var curSet = null;
if (teams === true) {
- app.user.teams = [];
- teams = app.user.teams;
+ Storage.teams = [];
+ teams = Storage.teams;
}
for (var i=0; i