+ const deltaCreated = maxCreated - minCreated;
+ return augmentedGames.sort((g1,g2) => {
+ return g2.priority - g1.priority +
+ (g2.created - g1.created) / deltaCreated;
+ });
+ },
+ },
+ methods: {
+ player_s: function(g) {
+ if (this.showBoth)
+ return (g.players[0].name || "@nonymous") + " - " + (g.players[1].name || "@nonymous");
+ if (this.st.user.sid == g.players[0].sid || this.st.user.id == g.players[0].uid)
+ return g.players[1].name || "@nonymous";
+ return g.players[0].name || "@nonymous";
+ },
+ deleteGame: function(game, e) {
+ if (game.score != "*")
+ {
+ if (confirm(this.st.tr["Remove game?"]))
+ GameStorage.remove(game.id);
+ e.stopPropagation();
+ }