33 Commits

Author SHA1 Message Date
Stefan Breunig
70ff64fd1c fix missing space in divider 2013-02-16 11:06:03 +01:00
Stefan Breunig
5445006d5a make chat copy&paste friendly again 2013-02-16 10:56:58 +01:00
Stefan Breunig
6d41221131 finish changes for #179. Fixes #179, fixes #49.
Please look for regressions.
2013-02-16 10:46:02 +01:00
Stefan Breunig
cf17fef699 maybe fix #152 (haven’t checked) 2013-02-13 16:28:20 +01:00
Stefan Breunig
fbd892e88d also show anonymous messages such as 'field decyed'. Fixes #145 2013-02-13 12:36:06 +01:00
Stefan Breunig
164d067d4a fix scroll back issues for public chats 2013-02-13 12:35:51 +01:00
Stefan Breunig
79b917c8f1 divider bar too short 2013-02-13 03:22:01 +01:00
Stefan Breunig
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
Stefan Breunig
847a3d5fc1 warn when chat message didn’t make it but the server actually send a response 2013-02-12 23:22:45 +01:00
Stefan Breunig
0d0bd4b26a fix indenting 2013-02-12 23:12:28 +01:00
Stefan Breunig
331d9a3781 add debugging/console capability to devices where it is not available or easily accessibile 2013-02-12 10:01:21 +01:00
Stefan Breunig
52306b033d fix indenting 2013-02-12 09:20:08 +01:00
Stefan Breunig
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
Stefan Breunig
c5d2366cf7 leaflet zoom buttons would be at wrong location after shrinking chat again 2013-02-11 00:23:15 +01:00
Pavol Babincak
c66bc0f171 Hide elements used only for clipboard & removed unused selector 2013-02-10 19:22:35 +01:00
Pavol Babincak
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
Stefan Breunig
f2400d1f8b fix #79 and part of #39 2013-02-10 09:02:08 +01:00
Stefan Breunig
8dc0f3b3e0 Merge pull request #50 from firetech/fixes
Use keydown for key press detection in chat.
2013-02-08 08:52:51 -08:00
Stefan Breunig
9316d49e68 get time for chat input differently, so it reflects the local time 2013-02-08 17:25:35 +01:00
Joakim Andersson
7a9f75a2ef Use keydown for key press detection in chat.
Fixes tab completion in Chrome. Closes #45.
2013-02-08 16:41:11 +01:00
Stefan Breunig
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
Xelio
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
Stefan Breunig
fc123d7abf enable chat tab completion 2013-02-05 17:25:04 +01:00
Stefan Breunig
6c6cd10827 implement nick highlight feature in chat 2013-02-05 15:33:15 +01:00
Stefan Breunig
7f7d716d2b auto linkify links in comments 2013-02-05 15:08:02 +01:00
Stefan Breunig
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
Stefan Breunig
f85a3b2443 revert last commit, it broke scrolling. also replace expensive CSS rules with differen solution 2013-02-04 14:21:49 +01:00
Stefan Breunig
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
Stefan Breunig
f92c963a54 finish chat feature; hide low level portal on zoom out; introduce render limit 2013-02-04 02:52:24 +01:00
Stefan Breunig
ecfaca7f9b more chat related stuff. public user chat and message posting is still missing though 2013-02-03 19:44:35 +01:00
Stefan Breunig
a7db7e656a make faction chat display work completely 2013-02-03 14:20:21 +01:00
Stefan Breunig
b7f1270ff6 make faction chat display almost work 2013-02-03 13:19:56 +01:00
Stefan Breunig
25d6b4cdc5 preliminary chat support 2013-02-01 22:27:43 +01:00