Support client-side chat logging

This commit is contained in:
Guangcong Luo
2013-08-31 17:04:34 -05:00
parent f414e8c346
commit 46de389961
2 changed files with 5 additions and 0 deletions

View File

@@ -95,6 +95,7 @@
<script src="//play.pokemonshowdown.com/data/pokedex-mini.js?"></script>
<script src="//play.pokemonshowdown.com/js/battle.js?"></script>
<script src="//play.pokemonshowdown.com/js/lib/sockjs-0.3.min.js"></script>
<script src="//play.pokemonshowdown.com/js/storage.js?"></script>
<script src="//play.pokemonshowdown.com/js/client.js?"></script>
<script src="//play.pokemonshowdown.com/js/client-mainmenu.js?"></script>

View File

@@ -945,6 +945,7 @@
} else {
outputChat();
}
Storage.logChat(this.id, '* '+name+' '+message);
} else if (message.substr(0,5) === '/mee ') {
message = message.substr(5);
if (showme) {
@@ -952,8 +953,10 @@
} else {
outputChat();
}
Storage.logChat(this.id, '* '+name+message);
} else if (message.substr(0,10) === '/announce ') {
this.$chat.append(chatDiv + timestamp + '<strong style="' + color + '">' + clickableName + ':</strong> <span class="message-announce">' + Tools.parseMessage(message.substr(10), name) + '</span></div>');
Storage.logChat(this.id, ''+name+': /announce '+message);
} else if (message.substr(0,6) === '/warn ') {
app.addPopup(RulesPopup, {warning: message.substr(6)});
} else if (message.substr(0,14) === '/data-pokemon ') {
@@ -968,6 +971,7 @@
// Normal chat message.
if (message.substr(0,2) === '//') message = message.substr(1);
outputChat();
Storage.logChat(this.id, ''+name+': '+message);
}
}
}, {