Closed minj closed 9 years ago
Comment #1 originally posted by convincedd on 2012-06-08T23:18:15.000Z:
if we make the short name default (you can do that for now):
players.js line 125. there we get the name from the chpp api files. there change the way we want (with regexp replace i guess)
player.nameLink.textContent = playerNode.getElementsByTagName("FirstName")[0].textContent
(for the pure html version, we can't do that. we won't know what the first and the last name is. there realy is no way to tell)
in skilltable.js: nothing to do
Comment #3 originally posted by convincedd on 2012-06-09T00:45:12.000Z:
right. reason is line 113 if(!player) .. we only add the basic info if we don't have it from the html already. hmtl is always upto date while the way we use the xml files, they can be slightly out of date. i guess we just can move the name part in there line:120-127 to the general part further bellow, so in line 193
Comment #6 originally posted by convincedd on 2012-06-09T13:15:07.000Z:
i guess that's only the very first letter then. some have two first names. then regular expressions can do more https://developer.mozilla.org/en/JavaScript/Guide/Regular_Expressions in this case
player.nameLink.textContent = playerNode.getElementsByTagName("FirstName")[0].textContent
.replace(/(-.)([^-\s]+)/g,"$1.") // replaces first name
.replace(/(\s.)([^-\s]+)/g,"$1.") // replace further first names
.replace(/(^.)([^-\s]+)/g,"$1.") // replace names connected with "-"
Comment #8 originally posted by convincedd on 2012-06-09T14:43:50.000Z:
not realy. we don't have there first and last name seperatelly. so of Stefan Frank Hansen we don't know if it should be S.F. Hansen or S. Frank Hansen
Comment #10 originally posted by convincedd on 2012-06-09T14:59:49.000Z:
that's possible naturally. i personnally don't think the displaying Raúl de Miguel as R. Miguel is that nice.
maybe R. d. Miguel still not realy nice but better
Comment #12 originally posted by gantorys on 2012-06-09T15:24:53.000Z:
Yes you're right. Is not really nice,
for example (on transfer list i mean)
Alessandro Del Piero --> 'A. d. Piero' or 'A. D. Piero' it's not cool, because everyone knows him with 'Del Piero'
I know Hattrick players are invented but you know what I mean, lol.
However, I don't understand very well why on players.js get's the name separately and in the transferlist not. I guess because the APIs but it's weird.
Comment #13 originally posted by convincedd on 2012-06-09T15:33:12.000Z:
yes, players have an api and transferlist search results naturally not. in the api there is first and last name seperatelly, but from the pure html in the transfer search we just can't tell
Comment #14 originally posted by convincedd on 2012-06-09T15:36:31.000Z:
btw: no latin names might look wierd eg
李 (Li) 文隆 (Wenlong) playerId=206936537
Original issue 960 created by gantorys on 2012-06-08T17:12:30.000Z:
In the foxtrick skill-table (on players page), show the name of the player abbreviated.
Examples:
Alessandro Del Piero ---> A. Del Piero Roberto Baggio ---------> R. Baggio
(like FIFA)
I try change the code of players.js, skill-table.js... but im lost.
Sorry for my english.