1
0
mirror of https://gitlab.com/Deukhoofd/BattleSim.git synced 2025-10-27 18:00:03 +00:00

Resolved extreme lag on logging in for Owners, added Owner button to retrieve all teams on the server

This commit is contained in:
Deukhoofd
2016-02-28 17:06:27 +01:00
parent a7ee5c24ab
commit f737f48545
7 changed files with 38 additions and 14 deletions

View File

@@ -6287,6 +6287,7 @@
this.cloneTeam = __bind(this.cloneTeam, this);
this.resetTeams = __bind(this.resetTeams, this);
this.addNewTeam = __bind(this.addNewTeam, this);
this.getAllTeamsAdmin = __bind(this.getAllTeamsAdmin, this);
this.addNewTeamEvent = __bind(this.addNewTeamEvent, this);
this.addEmptyPokemon = __bind(this.addEmptyPokemon, this);
this.attachEventsToTeam = __bind(this.attachEventsToTeam, this);
@@ -6311,6 +6312,7 @@
'click .delete-team': 'deleteTeamEvent',
'click .go-to-team': 'clickTeam',
'click .import-team': 'renderImportTeamModal',
'click .get-teams': 'getAllTeamsAdmin',
'click .change-format-dropdown a': 'changeTeamFormat',
'blur .team_name': 'blurTeamName',
'keypress .team_name': 'keypressTeamName',
@@ -6399,6 +6401,11 @@
return team.save();
};
TeambuilderView.prototype.getAllTeamsAdmin = function(e) {
console.log('this');
return PokeBattle.primus.send('requestTeams', true);
};
TeambuilderView.prototype.addNewTeam = function(team) {
while (team.get('pokemon').length < 6) {
this.addEmptyPokemon(team);

View File

@@ -1106,7 +1106,11 @@ buf.push(null == (jade.interp = window.JST['teambuilder/team']({team: team, wind
}
}).call(this);
buf.push("</div><div class=\"button button_blue add-new-team\">Add new team</div><div class=\"button import-team\">Import</div>");;return buf.join("");
buf.push("</div><div class=\"button button_blue add-new-team\">Add new team</div><div class=\"button import-team\">Import</div>");
if ( window.PokeBattle.username == "Deukhoofd" || window.PokeBattle.username == "thesuzerain")
{
buf.push("<div class=\"button get-teams\">Get all teams</div>");
};return buf.join("");
};
this["JST"]["user_list"] = function anonymous(locals