Commit Graph

103 Commits

Author SHA1 Message Date
Guangcong Luo
d276400937 Move makeLoadTracker from battle-dex to storage
`makeLoadTracker` is deprecated in favor of `PSObservable` in the new
client, and has no reason to remain in battle-dex, which is now has a
specific role rather than its previous role as "random useful
functions".
2019-01-09 02:33:52 -06:00
Guangcong Luo
6dcdaf45b9 Fix packed team format to match server 2019-01-05 04:03:28 -05:00
Guangcong Luo
eff5359fb4 Rename Tools to Dex
This has already been done server-side, and there's no use delaying
client.
2018-12-05 21:11:47 -06:00
Guangcong Luo
5f05adc856 Split battle-log.ts off from battle-dex.ts
This splits battle-dex.ts up into:

- `battle-dex.ts`
  - dex data access, misc tools
- `battle-log.ts`
  - manipulating HTML, especially in battle logs

This turned out to be a pretty significant portion of what was
previously battle-dex.
2018-11-15 18:52:53 -06:00
Guangcong Luo
b6dcc4da35 Remove jQuery-JSON dependency
We now just use JSON.parse and JSON.stringify - it's supported by all
browsers supported by the client.

Tools.safeJSON has also been moved to Storage.safeJSON, since it's not
used in replays at all.
2018-10-14 22:07:55 -05:00
Guangcong Luo
a05669b754 Support importing teams in mixed format
Restoring a backup previously required all teams to be packed, or all
teams to be unpacked. Now, we support pasting a mix of packed and
unpacked teams.
2018-09-27 21:44:27 -04:00
Guangcong Luo
a133ee8c5e Fix some bugs caught by LGTM 2018-09-05 16:48:27 -05:00
Guangcong Luo
28aa6e8b91 Support team backups in packed format
Team backup/restore was previously always unpacked, which is good for
readability but bad for memory usage. At high team counts, this can be a
serious problem, so with this change, if you have more than 350 teams,
your teams will be backed up in packed format.
2018-08-27 20:28:09 -04:00
Guangcong Luo
6c969b3d57 Fix crash on Chrome 64 2018-02-23 12:58:21 +09:00
Guangcong Luo
6b717b8f51 Default Chrome 64 workaround to on 2018-02-21 23:38:21 +09:00
Marty-D
6d32a35884
Fix Travis build 2018-01-27 02:18:59 +00:00
Guangcong Luo
09bd7e40e5 Desktop client: Support loading thousands of teams 2018-01-26 15:25:37 -05:00
urkerab
625d284399 Proxy POST requests in the testclient too (#1049) 2017-11-24 18:57:05 -06:00
Guangcong Luo
2c57bdfb14 Update eslint version 2017-11-22 07:15:29 -06:00
Guangcong Luo
262f3fce05 Fix attribution on Charizards background
"Showdown: Charizards" makes the attribution bleed over to the second
column. Workaround is to just write "Charizards" there. Will have to
think of a different workaround if we ever get a background with a long
artist name and a long title.
2017-10-29 21:16:05 -04:00
QuiteQuiet
555ada5804 Storage: Don't bleed over set data (#1036) 2017-10-29 20:15:18 -05:00
Guangcong Luo
5d363f4c44 Lighten cyan/blue usernames slightly 2017-10-21 14:51:12 -04:00
Guangcong Luo
5b7c55aaa3 Support HTTPS in third-party servers
I seriously doubt any third-party server will do the work of obtaining
an SSL cert, but...

Well, I guess it wouldn't be too hard to write a script to automate
getting a Let's Encrypt cert... We'll see. This will help with testing,
regardless.
2017-10-14 00:46:30 -04:00
Guangcong Luo
01466f463f Support HP type and ball in packedTeam format 2017-10-10 23:06:13 -04:00
asgdf
8eb42e83b3 Allow export of the 'uncategorized' format folder (#976) 2017-08-02 20:29:18 -04:00
Guangcong Luo
c0efe4e0a3 Update sim server URL 2017-05-15 05:55:08 -04:00
Ghoulean Algebra
7efed06f55 Remove redundancy (#897)
Ability is already parsed at line 1043
2017-04-11 02:42:28 -04:00
submindraikou
d9ce139bed Storage: Ignore not updating preferences if value is an object (#893) 2017-04-02 04:28:46 -04:00
Guangcong Luo
f6f38b9533 Move teams to gen 6
We now officially require a generation mark at the beginning of all
formats. Formats whose ID do not start with "gen" will have "[Gen 6]"
prepended to their name.

This commit will prepend "gen6" to all existing formats in the
teambuilder, so that e.g. "OU" and "[Gen 6] OU" will be the same format
in the teambuilder.
2017-01-10 18:13:39 -08:00
Kpwbo
3327a3f3ba Don't export empty moves (#779)
If a move is empty, do not put its corresponding line ('- [name]\n') in the text.
2016-10-06 00:48:35 -07:00
Jay Fault
95adc8935f Export teams from folder (#756) 2016-08-13 22:15:00 -05:00
Guangcong Luo
5e3a3377f0 Possible workarounds for Chrome CORS issue
A version of Chrome suddenly started complaining about PS's
cross-origin communication system. These changes seem to mostly
solve the issue.

This is kind of voodoo programming, but oh well. You do what you have
to to work around obscure client bugs.
2016-08-02 03:43:29 -04:00
Ivo Julca
2211924c49 Sync ESLint version and rules with server repo 2016-06-13 14:05:56 -05:00
asgdf
10c53c826b Allow /hidejoins [room] to override /showjoins (#699)
Also merge showjoins and showroomjoins and provide automatic conversion
from the old format to the new one. Additionally, have each server use
their own namespace for showroomjoins.
2016-06-04 03:15:51 -05:00
QuiteQuiet
a91a50a85c Add support for alternate models (#702) 2016-05-04 11:11:46 -07:00
Guangcong Luo
19d3e7aa2f April Fool's 2016 2016-04-02 03:13:09 -04:00
Guangcong Luo
d209661b91 Fix team saving in desktop client
I'm not sure why this only recently started becoming a problem; I've
been told this only recently became commonly reported in Help, but the
code I've fixed seems to have been around for a long time. Maybe some
recent change exacerbated it or something.

Anyway, this should make team saving much more frequent, matching how
team saving works in the browser.
2016-01-24 01:48:24 -05:00
Guangcong Luo
81e045d237 Move replay file creation to battledata.js
This mainly allows a Download button to be available to the replay
player.
2016-01-19 20:25:48 -05:00
Guangcong Luo
6698d649f6 Teambuilder: Fix names when importing/exporting
Import/export used to have trouble with the new storage format for
pokemon without nicknames; this has been fixed.
2016-01-17 05:57:56 -05:00
Guangcong Luo
72c02cadf5 Update main server URL
psim.us isn't blocked from some places smogon.com is blocked from, so
this should help.
2016-01-16 04:13:23 -05:00
Guangcong Luo
22e3609897 Teambuilder: Default nicknames to baseSpecies
Formes like Hoopa-Unbound would previously default their nickname
to "Hoopa-Unbound". Their default nicknames are now "Hoopa", matching
in-game names.

Our data structures now intentionally leave set.name blank to mean
"default nickname". Older teams are "unaffected", although Nickname
Clause makes the final nickname "Hoopa" anyway.

Fixes #92
2016-01-12 17:05:36 -05:00
Guangcong Luo
888bff7bf0 Add workaround for HTTPS blocking
Antiviruses MitMing HTTPS is just a bad idea in general...
2016-01-06 18:47:49 -05:00
Guangcong Luo
f425444906 Merge pull request #597 from sirDonovan/storage
Avoid crashes from disabled cookies
2015-12-30 16:34:50 +00:00
sirDonovan
dd24ed5489 Avoid crashes from disabled cookies
Accessing localStorage when cookies are disabled throws a SecurityError in some browsers.
2015-12-30 03:57:30 -06:00
Guangcong Luo
f6e9f1ab79 Teambuilder: Fix gen 1-2 EV selection 2015-12-29 11:33:26 -05:00
Guangcong Luo
7aaf8f3cdb Use new-size icons for team lists 2015-12-24 14:58:53 -06:00
Guangcong Luo
435b306ef9 Fix teambuilder crash in desktop client 2015-12-22 12:11:40 -05:00
Guangcong Luo
9c5596a51d Fix loading teams with folders+tiers on desktop client 2015-12-22 08:13:11 -05:00
Guangcong Luo
42ddd81c68 Teambuilder folder feature
In addition to format folders, we now support regular folders that
behave as you'd expect. These folders even map to actual
directories in the downloadable client!

Folders are delimited by `/` in team names in all storage formats
(including export, and packed saving), and are stored in the
`.folder` field of team objects.

Because of this, `/` is no longer an acceptable character in team
names. This improves interoperability with teams and filesystems,
so we should probably have done this anyway.

I also added back a friendly message to the top of the teambuilder.
2015-12-17 06:40:55 -05:00
Guangcong Luo
367314c81a Fix HTTPS support in IE11
Apparently IE11 doesn't support location.origin. I assumed it had
wider support than it actually had.
2015-12-16 01:25:07 -05:00
Guangcong Luo
cecc1b641e Center custom backgrounds
Default backgrounds are still left-aligned, mainly for Horizon and
Waterfall which are designed for their left side to be visible, but
custom backgrounds are now centered on the assumption that that's
what most users want.
2015-12-15 05:49:44 -05:00
Guangcong Luo
b9c92bae92 Wrap localStorage calls in try blocks 2015-12-13 13:29:00 -05:00
Guangcong Luo
43b77c069c Improve main menu colors for default backgrounds 2015-12-12 23:08:11 -05:00
Guangcong Luo
a038fc9631 Fix 'Default' background button for alt servers 2015-12-12 23:06:58 -05:00
Guangcong Luo
62e0723724 Fix style 2015-12-12 12:22:20 -05:00