Commit Graph

97 Commits

Author SHA1 Message Date
ee4be2503e Merge pull request #30 from teo96/master
#issue 29 : add nickname in the chat textbox when I click on it
2013-03-23 07:41:25 -07:00
5a283759cc I said “FIX #31” 2013-03-22 19:37:35 +01:00
3684e64847 fix #31 2013-03-22 19:00:28 +01:00
6f870a2b58 quick fix for #24 - handle AT_PLAYER like TEXT in chat 2013-03-22 14:33:10 +00:00
a32adf6e6c issue#29 add player name in chat box when click on it 2013-03-22 15:18:25 +01:00
a0bc896559 Add a new hook after receiving new faction messages 2013-03-12 12:33:44 +00:00
a189fab9c4 nits 2013-03-09 09:47:22 -06:00
9cd15edc54 USPS Chat Log - Take 5 2013-03-09 01:38:45 -06:00
17c6227412 don’t use reserved keyword in JS as variable 2013-03-08 12:29:36 +01:00
1e2935c018 don’t try to request more chat messages when no chat is active. This only affected smartphones. 2013-03-08 10:46:52 +01:00
94190bd900 color text in red for public chat (see #73) 2013-03-08 09:14:41 +01:00
971cbef11f add "nickname" class to all nicknames within the page 2013-03-01 22:11:04 +01:00
07cb3c2f49 Add href link in chat msg 2013-02-27 14:41:39 +08:00
044b5f2147 add hook for chat data 2013-02-18 11:12:26 +01:00
70ff64fd1c fix missing space in divider 2013-02-16 11:06:03 +01:00
5445006d5a make chat copy&paste friendly again 2013-02-16 10:56:58 +01:00
6d41221131 finish changes for #179. Fixes #179, fixes #49.
Please look for regressions.
2013-02-16 10:46:02 +01:00
cf17fef699 maybe fix #152 (haven’t checked) 2013-02-13 16:28:20 +01:00
fbd892e88d also show anonymous messages such as 'field decyed'. Fixes #145 2013-02-13 12:36:06 +01:00
164d067d4a fix scroll back issues for public chats 2013-02-13 12:35:51 +01:00
79b917c8f1 divider bar too short 2013-02-13 03:22:01 +01:00
360f6f8336 rework chat handling completely
The old system was getting too complicated to add new features to.
The new one should be easier to understand and will be explained
below. This patch should fix #140 and fix #16.

There are several places where new data requests may come from:
- chat.needMoreMessages checks if we are scrolled too far up or
  there is no scrollbar. It then requests new messages.
- scrolling up
- switching the chat tab via chat.chooser
- auto refresh
- once on boot
The latter two always request both types of chat.

Faction and public are handled the same way. Public is later split
into categories. I will explain the faction chat here because it’s
easier.

It starts in chat.requestFaction. This will initialize the query to
the server for data. The exact query is determined by chat.
genPostData. There can only be one faction chat request at a time.
Clearing on map move is handled automatically in code/requests.js.

Let’s assume the data query is successful. It is now passed to
chat.handleFaction which runs some basic checks before the data is
processed and stored in chat._factionData. This is done by chat.
writeDataToHash. The hash keys are the message GUIDs to avoid
duplicates. The hash values are an array of timestamp, processed
message and other meta data.

There is only one way to render faction chat, so data is directly
handed to chat.renderFaction which immediately hands it to chat
.renderData. renderData discards the GUIDs and sorts the values
by their timestamp. It then iterates over the data to insert
date break lines and finally renders the data in the DOM. It also
does some magic to keep the correct scrolling position.

Chat data will be cleared on map move or zoom. However, the
display is not refreshed, so the old, invalid chat data is still
displayed. Only once the data query is finished the data is
rendered. The upside is that small map operations within your
local area appear to never lose their chat data. Downside is that
there’s invalid chat for some time when changing cities.
2013-02-13 02:52:27 +01:00
847a3d5fc1 warn when chat message didn’t make it but the server actually send a response 2013-02-12 23:22:45 +01:00
0d0bd4b26a fix indenting 2013-02-12 23:12:28 +01:00
331d9a3781 add debugging/console capability to devices where it is not available or easily accessibile 2013-02-12 10:01:21 +01:00
52306b033d fix indenting 2013-02-12 09:20:08 +01:00
9416aeb50f replace unicode arrows with CSS tricks that should work on all platforms (patch by mledoze). Fixes #98, #116 2013-02-11 17:32:02 +01:00
c5d2366cf7 leaflet zoom buttons would be at wrong location after shrinking chat again 2013-02-11 00:23:15 +01:00
c66bc0f171 Hide elements used only for clipboard & removed unused selector 2013-02-10 19:22:35 +01:00
0cfb86eff0 Use invisible formatting for clipboard copy-paste
When text is copied from browser it looks like "00:00 <nick> text."
Firefox adds new lines between records. It would be good to get rid of
it.
2013-02-10 15:44:28 +01:00
f2400d1f8b fix #79 and part of #39 2013-02-10 09:02:08 +01:00
8dc0f3b3e0 Merge pull request #50 from firetech/fixes
Use keydown for key press detection in chat.
2013-02-08 08:52:51 -08:00
9316d49e68 get time for chat input differently, so it reflects the local time 2013-02-08 17:25:35 +01:00
7a9f75a2ef Use keydown for key press detection in chat.
Fixes tab completion in Chrome. Closes #45.
2013-02-08 16:41:11 +01:00
46303be80a rename 'tell public' to something else, so it doesn’t collide with a player name.
(yeah I’m watching at least two people right now with very unfortunate name choices. Also, whoever is named 'broadcast' owes me a beer.)
2013-02-08 14:50:55 +01:00
d4a781d4dc Fixing bug in window.chat.setupTime
Problem:
"#chatinput time" use "toLocaleTimeString().slice(0, 5)" to get time, but hh:mm not always at 0-5 in all locale




Fix:
Use "toISOString().slice(11, 16)" to get time for "#chatinput time"
2013-02-08 13:50:06 +08:00
fc123d7abf enable chat tab completion 2013-02-05 17:25:04 +01:00
6c6cd10827 implement nick highlight feature in chat 2013-02-05 15:33:15 +01:00
7f7d716d2b auto linkify links in comments 2013-02-05 15:08:02 +01:00
302de091e6 handle clearing differently to avoid clearing text before new one is available. Also throw some more magic at scrolling in chat so it works better. 2013-02-04 15:03:24 +01:00
f85a3b2443 revert last commit, it broke scrolling. also replace expensive CSS rules with differen solution 2013-02-04 14:21:49 +01:00
1f2c5514d4 make sure chat sticks to the bottom of the chat window to prevent moving when loading 2013-02-04 14:02:52 +01:00
f92c963a54 finish chat feature; hide low level portal on zoom out; introduce render limit 2013-02-04 02:52:24 +01:00
ecfaca7f9b more chat related stuff. public user chat and message posting is still missing though 2013-02-03 19:44:35 +01:00
a7db7e656a make faction chat display work completely 2013-02-03 14:20:21 +01:00
b7f1270ff6 make faction chat display almost work 2013-02-03 13:19:56 +01:00
25d6b4cdc5 preliminary chat support 2013-02-01 22:27:43 +01:00