Now that the symbols at the end aren't necessary for highlighting,
dropping them from tab completion should make talking to people with
emoticons at the end of their name less annoying.
Usernames with spaces can now be completed.
Special characters in front of the username will now be preserved.
This requires usernames to start with an alphanumeric character,
which fortunately we already enforce.
Data (teams and prefs) are now always stored in localStorage in the
`https://play.pokemonshowdown.com` origin. Data storage at a low
level has been mostly rewritten for this, and moved to storage.js.
Tools.prefs has been renamed Storage.prefs, although the API
Tools.prefs(prefName) is still available, and recommended for
battle.js (because storage.js isn't available in replays). All
other pref functionality, such as setting prefs and saving prefs,
should only be used in Storage.prefs.
If the browser blocks third-party cookies in a detectable way,
data is instead stored in the local origin.
As a final safety measure, prefs/teams are mirrored in the local origin
in case third-party cookies are blocked in an undetectable way.
This refactor also replaces the 'init:loadprefs' and 'init:loadteams'
events with a new load tracking system that's basically a simplified
implementation of Promises, documented in the comments for
Tools.makeLoadTracker().
Because of sliders being dumb, the teambuilder frequently has to
clear global handlers, which cleared the global click handler that
handled room link opening, as well as external links on the
desktop client.
Anyway, click handlers are now a lot more standardized and all that.
The name is a bit unfortunate, but Tools is specifically for data
access for game stats/mechanics and other things relevant to
battles, it's not supposed to be a generic place to stick
miscellaneous functions.
We have a new protocol for local (sim server side) ladders.
This involves sending |,LL| in |formatslist| to opt into local ladder
support.
When local ladder is opted-in, /rank etc will be passed to the sim
server, and the ladder tab does `/cmd laddertop FORMATID` expecting
[formatid, toplistHTML] in return.
Everything else works the same as before. This change marks
version 0.10.2.
This fixes an issue where highlight regular expression like :-?\)
couldn't match a smiley, unless it happened to have a word character
on both of its sides.
Most notably, this adds support for /announce and /mee in battle rooms, and /html in chat rooms.
A better user group inference is now used for PMs and chat rooms.
This is done by implementing a general Tools.parseChatMessage method.
Your own messages are now sent with a slightly darker background.
PS actually originally had a feature that made your own messages gray,
which stopped working during the redesign two years ago. I only just
realized this and brought it back, but since the redesign, the
background has gotten darker and gray text is harder to read, so
I'm trying out this new approach with the background.
I personally think design-wise, gray text is better, but readability
is more important. Maybe I'll have a better idea later, but for now,
this doesn't look all that bad.