Commit Graph

76 Commits

Author SHA1 Message Date
Guangcong Luo
41a6b2d96b Pokemon with formes work correctly in teambuilder now 2013-02-07 16:33:57 -08:00
Marty-D
538a0afe17 Add the last Pledge move messages. 2013-02-07 12:06:32 -05:00
Cathy J. Fitzpatrick
b15904fe12 Changes to chat history feature
This commit revises the chat history feature to work like my
terminal emulator. Specifically, when reviewing the history
with up/key, changes to the lines are now saved. This makes
the feature significantly more useful and also prevents
annoyance if the user presses up when typing a line, because
the user can now just press down to get the line back (and vice
versa), as opposed to the line being gone.
2013-02-07 03:51:48 -07:00
Cathy J. Fitzpatrick
ddaeb974e3 Track clicks of the 'Report bug' link
This might be an interesting statistic.
2013-02-07 02:23:29 -07:00
Cathy J. Fitzpatrick
7fe3af122b Fix for shift handling in chatbox
I used pull request #11 as the base for @9b976cf9b8, but I forgot
to fix this aspect of it.
2013-02-07 01:41:57 -07:00
Cathy J. Fitzpatrick
9b976cf9b8 Implement chat history recall with up/down keys
This commit implements a feature commonly found in IRC clients,
wherein the user can press the up key to recall previously sent
messages (and can press the down key to cycle back the other
direction in the history).

This commit is similar to pull request #11, except that this
implementation works properly.
2013-02-07 01:26:42 -07:00
Cathy J. Fitzpatrick
7a50b31b6b More changes to cached index.php logging
- check timestamp in index.php rather than sim.js to reduce the chance
  of false positives caused by the user's internet connection being
  slow or the user's clock being slightly wrong

- require timestamp logging to be a POST request
2013-02-06 22:36:32 -07:00
Cathy J. Fitzpatrick
d5cc683e32 Fix typo 2013-02-06 18:43:07 -07:00
Cathy J. Fitzpatrick
22138d3e25 Log cases where user has cached index.php
In addition, if the user has a cached index.php, we no longer make a
special request to action.php?act=upkeep.
2013-02-06 18:40:33 -07:00
Cathy J. Fitzpatrick
599360c363 Changes for browsers that cache index.php
If the browser uses a cached version of index.php more than 50
seconds old, we now make the AJAX request to action.php?act=upkeep.
2013-02-06 17:47:05 -07:00
Cathy J. Fitzpatrick
0ccaf286ce Eliminate initial AJAX request to login server
Instead of making an AJAX request to action.php?act=upkeep, this
commit now includes the initial token directly in index.php.
2013-02-06 17:08:32 -07:00
Cathy J. Fitzpatrick
83fe1d5b72 Don't return valid JavaScript from action.php
This avoids an attack where a malicious webpage contains

  <script id="data" type="application/json"
    src="http://play.pokemonshowdown.com/~~showdown/action.php?act=upkeep"/>

The webpage could then read the value of the `data` element using
standard DOM methods in order to steal the user's login assertion
and login as the user on the `showdown` server.
2013-02-04 20:42:38 -07:00
Cathy J. Fitzpatrick
ce3d876e1a Revise wording of timestamps message for consistency 2013-02-04 06:36:43 -07:00
Joim
8f4f2c045d Add feedback to timestamps
Added a feedback message to users when they configue the timestamps.
2013-02-04 14:32:44 +01:00
Joim
6dd067a6ef Configure timestamps for PMs and lobby separately
Improve timestamps so they can be configured separatedly for
PMs and lobby chat.

Cathy J. Fitzpatrick <cathy@cathyjf.com> revised this commit to
fix a number of bugs.
2013-02-04 02:29:46 -07:00
Guangcong Luo
ee4bdc0997 Fix for the z-index change 2013-02-04 00:37:07 -08:00
Guangcong Luo
c9c6c78119 Corretly z-index pokemon in doubles 2013-02-04 00:00:49 -08:00
Cathy J. Fitzpatrick
29298e97a8 Add notification for new PM 2013-02-03 21:14:41 -07:00
Cathy J. Fitzpatrick
2acc89748a Each server now gets its own session
This commit implements the following:

- each server now has a separate session with a 'sid' cookie
  scoped to /~~server:port

- 'sid' cookies are now HTTP-only and not accessible in JavaScript

- the showdown_token cookie is removed

Together, these changes fix various XSS attacks.
2013-02-02 19:37:57 -07:00
Cathy J. Fitzpatrick
92be502239 Add support for permanent nameTaken error 2013-02-02 16:29:03 -07:00
Guangcong Luo
c5f0f6f001 Only show username rules while forcerenaming 2013-02-02 14:49:09 -08:00
Cathy J. Fitzpatrick
b3416fc983 Include name rules on rename overlay
The name rules have been copied from http://www.pokemonshowdown.com/rules
2013-02-02 04:15:15 -07:00
Cathy J. Fitzpatrick
46f0368215 Add rows attribute to teambuilder <textarea>s
Firefox renders the height of a <textarea> based on the `rows`
attribute, which was not previously specified, causing the <textarea>
in the teambuilder to be very short. This commit specifies a
(somewhat arbitrary) `rows` attribute so that the <textarea> has
some more height.
2013-02-02 00:04:58 -07:00
Cathy J. Fitzpatrick
2a88bcaa5d Revert consolidation of getName and getLowerName 2013-02-01 17:58:18 -07:00
Cathy J. Fitzpatrick
54c80f0247 Don't throw from getHighlight 2013-02-01 17:18:15 -07:00
Cathy J. Fitzpatrick
63f62b3991 Add highlight notification 2013-02-01 17:11:40 -07:00
Marty-D
fe3bd25b5c Fix many messages. 2013-02-01 16:00:02 -05:00
Guangcong Luo
e81b208b5e Feedback for highlight commands 2013-02-01 11:20:19 -08:00
Guangcong Luo
e73721b5da Nicer highlight color 2013-02-01 11:17:16 -08:00
Guangcong Luo
0d3dd1b4b1 Merge pull request #5 from Joimer/patch-1
Adding highlighting words
2013-02-01 11:13:12 -08:00
Cathy J. Fitzpatrick
ed5a7db386 Add ! and # users to the sort order
Users whose names are prefaced by ! (mute) or # (namelock) were
not included in the rank sort order, causing unusual sort results.
2013-02-01 04:14:04 -07:00
yenatch
77c4293942 Add (Hi) Jump Kick crash message 2013-02-01 02:56:10 -05:00
yenatch
b979cc3582 Consolidate Pokemon.getName & Pokemon.getLowerName 2013-02-01 02:55:06 -05:00
yenatch
d1fe1db400 Fix 'attack missed!' message 2013-02-01 02:30:41 -05:00
Joim
7dd40a7d3b Adding highlighting words
Added highlighting words:
Users may now use the new highlight commands:
-Use /highlight add, word to add a highlighting word.
You might add several words separated with commands.
-In a likewise fashion, /highlight delete, word deletes words.
-Using /highlight delete with no words will delete all.
-/highlight show or list will show all current highlight words.
-By default no word is added to highlights.
-Words are escaped
2013-01-31 21:21:15 +01:00
Cathy J. Fitzpatrick
e3be0b3ea3 Remove unused code 2013-01-31 05:41:32 -07:00
Cathy J. Fitzpatrick
b696d366bb Add missing file: jquery-1.9.0.min.js 2013-01-31 02:58:25 -08:00
Marty-D
76ddd847cf Add After You and Quash messages. 2013-01-30 14:46:21 -05:00
Cathy J. Fitzpatrick
9e28dc7e7d Include hostname in assertion to avoid vulnerability 2013-01-30 06:25:32 -07:00
Guangcong Luo
b5f7479ab4 Upgrade jQuery to 1.9.0 2013-01-29 20:01:48 -08:00
Cathy J. Fitzpatrick
a672294ea0 Fix bug in prefs 2013-01-29 16:27:42 -07:00
Guangcong Luo
6712b24913 Fix error when a spread move is marked missed 2013-01-29 14:52:37 -08:00
Cathy J. Fitzpatrick
560d71cecd Introduce self rather than using this in prefs
This doesn't actually matter here, but it provides greater
consistency with the style used in the codebase.
2013-01-29 15:40:27 -07:00
Cathy J. Fitzpatrick
f36d8db188 Refactor timestamps and prefs
- battle logs no longer have timestamps
- getTimestamp is moved to a property of the Lobby function
- the prefs global variable is replaced by a prefs API
2013-01-29 15:31:59 -07:00
Guangcong Luo
e4c3c621fa Stopgap fix to prevent replay crashing 2013-01-29 13:44:16 -08:00
Cathy J. Fitzpatrick
0890dae6c6 Set timestamps off by default
In order to preserve the previous status quo for now, this
commit turns timestamps off by default. They can be turned on
using /timestamps minutes or /timestamps seconds.
2013-01-29 05:39:19 -07:00
Cathy J. Fitzpatrick
310d8a806b Disable timestamps for past log sent from server
The past log sent from the server when joining a room does not
contain information about when the messages were sent, so we
do not show a timestamp for those messages.
2013-01-29 00:41:22 -07:00
Cathy J. Fitzpatrick
b6a9c9d3d0 Implement timestamps; save prefs in localStorage
This commit implements timestamp functionality in the lobby chat,
in private messages, and in battle chats. Timestamps are controlled
by a /timestamps command, which has three legal invocations:

    /timestamps off
        turns off timestamps

    /timestamps minutes
        show timestamps of the form [hh:mm]

    /timestamps seconds
        show timestamps of the form [hh:mm:ss]

For now, the default setting is /timestamps minutes. If this proves
unpopular, it can be changed. The timestamp preference is stored in
localStorage and does not have to be set every time.
2013-01-29 00:10:44 -07:00
Guangcong Luo
a1b11de299 Merged Leech Seed animation 2013-01-28 19:53:12 -08:00
Guangcong Luo
132c5627a8 Uproar messages 2013-01-28 17:22:39 -08:00