Commit Graph

65 Commits

Author SHA1 Message Date
Guangcong Luo
a0aac91aac Fix testclient.html for latest Chrome
Unfortunately, the `loadRemoteData` trick we used to load data no
longer works. The new trick is to load asynchronously, and defer
initialization to `onload`.
2018-11-20 01:53:04 -06:00
Guangcong Luo
9019543dc1 Don't build graphics.js by default
graphics.js will still be built by `./build full`, and once it already
exists, `./build` will rebuild it when it's modified.

Fixes #1150
2018-10-16 03:26:51 -05: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
c590a0c370 Add new BattleScene animation engine
battle.js is probably PS's oldest code. It's received minor touch-ups:
a refactor to prototypes early on, and then a refactor to TypeScript
and classes recently, but otherwise it's had basically zero maintenance
until now.

That's probably why this refactor took me over a week.

The biggest change is that the animation engine strewn around
Pokemon, Side, and Battle has been broken out into a new class named
BattleScene.

Pokemon, Side, and Battle now only track state; all animation is now
done in BattleScene and PokemonSprite.

The fates of major classes:

battle.ts:Pokemon - animation has been moved, mostly to PokemonSprite
battle.ts:Side - animation has been moved, to PokemonSprite/BattleScene
battle.ts:Battle - animation has been moved, mostly to BattleScene

Major changes:

- Many many variables have been renamed to be much clearer about what
  they mean. For instance, `animationDelay` is now `timeOffset`, and
  `activityDelay` is now `minWait`. A few bugs relating to me mixing
  up these two variables have also been fixed. jQuery variables named
  like `fooElem` have been renamed like `$foo`.

- The unnecessarily complicated queue1/queue2/activeQueue system,
  previously used for telling the animation engine to stop after Pause
  was pressed, has been replaced with a simple `interruptionCount`
  counter.

- The entire scene can now be reconstructed from scratch, which means
  that the `fastForward` system no longer needs to touch the DOM
  outside of the battle log. "Prev turn" and "Skip to turn" should be
  faster in 1000-turn battles now.

- The animation engine now supports displaying weather and terrain
  simultaneously.

- During a replay, Team Preview is shown for a second (instead of
  immediately skipping to the battle).

- Various aspects of the animation engine should be much less brittle
  now.

- Many bugs were fixed (and new ones were introduced).
2018-06-07 02:22:36 -07:00
Guangcong Luo
c11f8bc356 Remove jQuery Slider from testclient.html 2018-02-21 23:37:59 +09:00
Dickson Tan
2afcc32807 Accessibility improvements to the battle UI (#956)
* Enable screen readers to automatically read incoming battle log text

* Mark sections of the battle UI with landmarks for quicker navigation with screen readers

* Allow tooltips on elements that participate in sequential keyboard navigation to have their tooltips automatically read out by screen readers when they gain focus
2017-06-26 00:21:58 -07:00
Felix Rilling
cde8151838 Update Backbone and lodash #906 (#907) 2017-04-24 22:02:17 -07:00
asgdf
df1aa4357b Fix config file path in testclient (#882)
Also fix possible reference error when config failed to load
2017-03-14 14:45:46 -05:00
Ivo Julca
8918aa2aab Test client: add fallback if local data is unavailable 2016-03-04 19:20:25 -05:00
Guangcong Luo
78334b7a15 Split off client-topbar.js from client.js
client.js is still kind of huge, but oh well. Progress!
2016-01-18 01:42:30 -08:00
Harshvardhan
311acb8fcd Added support for all power-boosting items
Removed redundancy from code

Moved to tooltips file

Reduced code

Reduced code

Reduced code

Reduced globals to 1

Minor error corrections
2015-12-27 21:21:26 +05:30
Guangcong Luo
04a27253e3 Teambuilder: Properly support gen 1-2 learnsets
This also adds a cached learnset format to teambuilder-tables.js,
which replaces and is slightly smaller than learnsets.js and also
has slightly better performance.
2015-12-24 11:33:25 -05:00
Guangcong Luo
a76b0b95ef Build: Minify pokedex.js + formats-data.js, moves.js
The client-relevant parts of formats-data.js have been combined into
pokedex.js. pokedex.js and moves.js are now minified on the client.
2015-12-22 12:11:40 -05:00
Guangcong Luo
7fa72c1d20 Convert teambuilder from utilichart.js to search.js
The teambuilder is now running on search.js! Not all new features I'd
like to be in are in, but we've now reached feature parity, and most
of the bugs I found during testing have been fixed.

New in search.js is on-demand DOM loading, which basically means
much faster performance because instead of trying to load every single
row of e.g. the pokemon list at once, we just load the part that's
visible, and load the rest only when you scroll it into view.

Also new in search.js is a dexsearch-like feature, replacing the old
details-search system. The new filter system is simpler and more powerful
and has the same API as /dexsearch, although not all the more advanced
dexsearch features are supported.

On-demand DOM loading makes teambuilder loading pretty much completely
instantaneous. There are other small differences in how selection of
pokemon/items/abilities/moves works, but it should overall make more
sense.
2015-12-22 00:06:27 -06:00
Guangcong Luo
72ff236cef Hardcode logo img dimensions
Very minor optimization to layout performance, but I'll take it.
2015-12-12 23:04:29 -05:00
Guangcong Luo
211da6e8b1 Major update to background storage and menu colors
When loading a background, we use Color Thief to get a six-color
palette from the image, for use on the main menu buttons.

Only hue and lightness are extracted.

https://github.com/lokesh/color-thief/

Backgrounds are now stored in localStorage in the current origin,
rather than the prefs origin. This allows faster loading, as well
as different backgrounds for different origins, which other
servers should like since it means their backgrounds get seen
at least once before possibly being replaced.

Special thanks to Joim for the base code.
2015-12-12 04:01:00 -06:00
Guangcong Luo
294efc0f4b Stop using the outdated news iframe in testclient 2015-09-25 02:47:06 -05:00
Guangcong Luo
bdcbded0bb Update Font Awesome to 4.4.0
Font Awesome 3 -> 4 was a backwards-incompatible change, so this
update is pretty invasive. I tested everything we use it for and it
still works, though. Including supporting both Font Awesome versions
in battle.js.
2015-09-25 02:46:34 -05:00
Bär Halberkamp
e912b73ac7 Fix the HTML sanitizer in testclient.html 2015-09-25 00:18:24 +02:00
urkerab
a1c674851a Make it possible to minimise the Latest News box 2015-09-09 12:33:09 +01:00
urkerab
84f116be53 Allow non-HTML5 based fragments in the test client 2015-08-18 12:18:17 +01:00
Guangcong Luo
a6e56e969a Update jQuery to 2.1.4 2015-06-28 00:50:16 -04:00
Bryan AA
7c600fdf7c Escape é in "Pokémon"
- Add "é" Instead of "é".
2015-06-20 14:03:25 -06:00
kubetz
f467808606 Remove crossdomain issues on load for testclient over https 2015-06-08 17:56:50 +00:00
kubetz
b77ab203a1 port is now converted into integer when custom server is used 2015-06-06 18:14:03 +00:00
Konrad Borowski
22502eb07e Disable Chrome Frame
Chrome Frame is not supported for two years, which means removing
support for it on Pokémon Showdown should be safe.
2015-05-19 20:08:45 +02:00
Morfent
d2bc6dd260 Update jQuery to version 2.1.3 2015-02-06 05:07:58 -04:00
Guangcong Luo
a39c1078c4 Update links to jQuery and SockJS 2014-03-26 12:31:28 -05:00
小太
ef69e954c2 Rename client-tournament.js to client-chat-tournament.js 2013-12-09 16:16:11 +11:00
小太
4d03e4d393 Merge remote-tracking branch 'upstream/master' into tournaments 2013-11-11 18:38:16 +11:00
Guangcong Luo
83626ee935 New gen-6-only learnsets file
The client doesn't actually need a full learnset file, so this is
enough (even for the dex).
2013-10-23 22:41:44 -05:00
小太
54042f637c Merge remote-tracking branch 'upstream/master' into tournaments
Conflicts:
	testclient.html
2013-10-20 20:43:13 +11:00
Quinella
da1280ba86 Fixes testclient.html; the loading message didn't disappear.
Because of that PMing and challenging others on testclient.html was impossible.
2013-09-22 15:00:53 +02:00
小太
4c13a800d2 Use a different library for rendering the tree and implement draggable brackets to support it 2013-09-17 20:14:17 +10:00
小太
ffcd67478e Add support for tree-type tournaments 2013-09-15 15:36:37 +10:00
小太
dc79480f31 Merge remote-tracking branch 'upstream/master' into tournaments 2013-09-13 21:55:59 +10:00
Quinella
bb88c1f049 Added storage.js include to testclient.html 2013-09-06 00:48:40 +02:00
小太
3c0e3b1a1e Merge remote-tracking branch 'upstream/master' into tournaments 2013-08-20 22:49:31 +10:00
小太
4503e271fb Fix code not using tabs for indenting 2013-08-18 22:54:42 +10:00
小太
cf699c0494 Obliterate trailing whitespace 2013-08-18 22:48:11 +10:00
小太
a7e69c0810 Basic tournament support 2013-08-10 19:19:52 +10:00
sandshrewz
13f3095821 added js/client-rooms.js 2013-07-06 11:18:32 +08:00
Cathy J. Fitzpatrick
89c0fc463b Fix testclient.html query string support 2013-05-24 19:50:10 -06:00
Cathy J. Fitzpatrick
ddca39f096 Re-implement testclient.html to parity with old client 2013-05-24 19:10:28 -06:00
Cathy J. Fitzpatrick
c7a02a9031 Rename some fields of the Config object 2013-04-26 18:37:37 -06:00
Cathy J. Fitzpatrick
53b9d015c6 Remove legacy code for old protocols 2013-04-26 04:15:09 -06:00
Cathy J. Fitzpatrick
c52a0e261b Upgrade to jQuery 2.0.0 2013-04-20 05:42:59 -06:00
Cathy J. Fitzpatrick
5261dc9478 Revert "testclient.html is no longer necessary"
This reverts commit d22a87872c.
2013-04-18 04:20:49 -06:00
Cathy J. Fitzpatrick
d22a87872c testclient.html is no longer necessary 2013-04-17 17:31:38 -06:00
Cathy J. Fitzpatrick
f872ebda0a Move custom name colours to config.js 2013-04-15 19:56:53 -06:00