Commit Graph

96 Commits

Author SHA1 Message Date
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
5120e59f5e Drop jslider dependency
jslider was incredibly buggy, and most likely the cause of the problems
with the teambuilder on mobile, and required some pretty ridiculous
hacks, and leaked memory.

We're now using HTML5 sliders, like we are with the volume controls.

HTML5 sliders aren't supported by IE9, but they're supported by most
other browsers PS cares about. If not, well, they won't look too ugly
probably...
2017-12-21 05:05:22 -06:00
Guangcong Luo
bf45602b4b Make base page slightly smaller
The biggest change is probably that the meta charset tag is now in the
first 1024 bytes, making the page actually valid HTML.

In addition, everything has been unindented, and some extraneous tags
have been removed.
2017-11-23 01:32:05 -05:00
Guangcong Luo
a8d78b397c Add homescreen app manifest for Android Chrome
Android Chrome fixed the keyboard issue, so we can finally use the
no-URL-bar version of the homescreen app.
2017-10-29 21:16:05 -04:00
Guangcong Luo
5d363f4c44 Lighten cyan/blue usernames slightly 2017-10-21 14:51:12 -04:00
Guangcong Luo
644d5ccf91 Support Google login (two-factor auth) (#999)
This doesn't support setting accounts up for Google login: that still
has to be manually done via the database by setting the email field to
`username@gmail.com@`, where the second `@` denotes that it's using
Gmail login.

If the email field does end in `@`, `getassertion` will note this by
sending `;;@gmail`, to convey that the server is expecting a Google
login token rather than a password.

Upon receiving `;;@gmail`, the client will replace the password box will
with a Google login button, and then send the resulting Google login
token to the server in the `password` field. The server will validate
the "password" using the Google server libraries, and otherwise handle
the login as normal.

Note that Google login requires various features that a paranoid person
might disable; most notably 3rd-party cookies.

Fixes Zarel/Pokemon-Showdown#3394
2017-09-13 16:20:38 -04:00
Felix Rilling
cde8151838 Update Backbone and lodash #906 (#907) 2017-04-24 22:02:17 -07:00
Guangcong Luo
1c18bf0f4d Move config.js to /config/ 2016-10-20 13:16:06 -04:00
Guangcong Luo
fb19307927 Update SockJS to 1.1.1
Note that it's had to be modified slightly for compatibility for our
version of nwjs.
2016-09-05 06:46:30 -04:00
Guangcong Luo
98403d0c71 Update PSdex link 2016-09-05 06:46:30 -04:00
Guangcong Luo
094b9effa1 Implement Retina logo 2016-04-02 03:13:09 -04: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
9109de7925 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

Added filename to index.template.html
2015-12-29 12:16:41 +05:30
Guangcong Luo
2768569b5a Add Credits to main menu footer 2015-12-26 10:22:44 -05:00
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
4981a223b0 Teambuilder: Improve past gen support
This is a large collection of changes that greatly improve past gen
support in the teambuilder.

- Tier lists are now compiled separately from each gen (build-indexes
  is really slow about this, which isn't particularly surprising),
  as well as for Doubles.

- Learnsets are now compiled separately from each gen. TODO: make an
  optimized learnsets.js with gen 1-2 support for client.

- Types in the pokemon list now account for old gens.

- Abilities no longer display in the pokemon list in gen 1-2

- SpA/SpD are replaced by Spc in the pokemon list in gen 1

Also included: A small optimization to the number of DOM nodes for the
teambuilder display, which should improve 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
b718a335a2 News tracking 2015-11-30 02:11:27 -05:00
Guangcong Luo
cf8bb24e71 Refactor data storage
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().
2015-11-28 04:36:41 -05:00
Guangcong Luo
f90f650372 Remove a workaround for some old malware
This malware is probably no longer around, and even if it is, the
rest of the file has been changed enough that the previous
workaround probably doesn't work anymore, anyway.
2015-10-22 04:35:20 -04:00
Guangcong Luo
28f7956d8c Various micro-optimizations to index.template.html
In particular, the header comment was cut down from 2KB to 1KB.
Sadly still not within the spec requirement of 512bytes to the
meta charset, but closer!
2015-10-22 03:08:13 -04: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
urkerab
a1c674851a Make it possible to minimise the Latest News box 2015-09-09 12:33:09 +01:00
Guangcong Luo
51476ce695 Remove scrollbar from News 2015-08-01 00:54:54 -04:00
Guangcong Luo
d6173c2485 We don't use IRC anymore 2015-07-25 16:53:55 -04:00
Guangcong Luo
a78d233785 Add link for 128x128 app icon 2015-07-15 00:42:29 -04:00
Guangcong Luo
e2a8627b11 Native resolution for mobile
We now support resolutions down to 320px width, down from the
previous 640px.
2015-07-15 00:42:07 -04:00
Guangcong Luo
5abc202006 Don't cache old tournament JS files 2015-07-02 12:47:51 -04:00
Guangcong Luo
a6e56e969a Update jQuery to 2.1.4 2015-06-28 00:50:16 -04:00
Guangcong Luo
d2b5a0bad3 Support some CSS in sanitized HTML 2015-06-27 02:46:00 -04:00
Guangcong Luo
f5b3d7c0c3 Add 'Forum' link to bottom left linkbar 2015-06-12 14:29:34 -04:00
Guangcong Luo
6c42d72548 Update jQuery 2015-06-07 23:42:03 -04:00
Guangcong Luo
3aa8b47ae5 Merge pull request #380 from xfix/disable-chrome-frame
Disable Chrome Frame
2015-05-20 05:24:14 +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
Konrad Borowski
d9f3ca74be Remove useless </small> from index.html 2015-05-15 12:23:01 +02:00
Morfent
d2bc6dd260 Update jQuery to version 2.1.3 2015-02-06 05:07:58 -04:00
Guangcong Luo
88a5a2e5e9 Chrome frame is deprecated
We now redirect to the Windows download for old IE versions
2014-07-11 18:35:52 -05:00
Guangcong Luo
46a7cf5970 Add intro comment to top of source 2014-07-11 18:35:52 -05:00
Guangcong Luo
d367d2dc8a Make News box smaller 2014-07-04 15:47:02 -05:00
Guangcong Luo
694f140943 Update to Universal Analytics 2014-06-02 16:20:49 -05:00
Guangcong Luo
96a69a8c74 Update jQuery and SockJS 2014-03-23 20:45:35 -05:00
Guangcong Luo
6cb657bbe5 Remove forum link in footer
We've already deemphasized the forum a lot.
2014-03-15 23:43:10 -05:00
Guangcong Luo
cbe7eef0b2 Make News box bigger 2014-03-06 18:18:40 -06:00
Guangcong Luo
95f2b90d9a Work around teambuilder virus issue
There's a virus floating around that's causing teambuilder not to work
for many users. Further investigation shows that it deletes the tenth
byte before the utilichart.js include, changing a </script> into
</sript> and preventing the utilichart.js include from working.

This change prevents the virus from interfering with utilichart.js,
and also makes it possible to detect the virus. We currently don't
do anything after detecting it, though.
2014-01-03 22:45:43 -06:00
小太
ef69e954c2 Rename client-tournament.js to client-chat-tournament.js 2013-12-09 16:16:11 +11:00
小太
8ec4a07c52 Add tournament includes to index.template.html 2013-12-09 12:00:48 +11:00
Guangcong Luo
550071c0e1 Newest jQuery versions 2013-11-20 17:55:59 -06:00