show engine users in lobby

This commit is contained in:
Thibault Duplessis 2013-06-08 20:13:48 +02:00
parent 32c1d0e6e8
commit bc5a491bb7
3 changed files with 15 additions and 7 deletions

View file

@ -2199,13 +2199,11 @@ var lichess_sri = Math.random().toString(36).substring(5); // 8 chars
function renderHook(hook) {
var title = hook.action == 'cancel' ? 'title="Click to cancel"' : '';
var html = '<div '+title+' data-id="' + hook.id + '" class="hook ' + hook.id + ' ' + hook.action + '">';
var isEngine = hook.engine && hook.action == 'join';
var userClass = isEngine ? "engine" : "";
var klass = ['hook', hook.id, hook.action].join(' ');
var html = '<div '+title+' data-id="' + hook.id + '" class="' + klass + '">';
if (hook.elo) {
html += '<a class="opponent ulpt" href="/@/' + hook.username + '">' + hook.username.substr(0, 14) + '</a>';
html += '<span class="elo">' + hook.elo + '</span>';
html += isEngine ? '<span class="engine_mark"></span>' : '';
} else {
html += '<span class="opponent anon">Anonymous</span>';
}
@ -2224,6 +2222,9 @@ var lichess_sri = Math.random().toString(36).substring(5); // 8 chars
if(hook.color) {
html += '<span class="color s16 '+hook.color+'"></span>';
}
if(hook.engine && hook.action == 'join') {
html += '<span class="s16 engine"></span>';
}
if (hook.action == "cancel") {
html += '<a class="action socket-link" data-msg="cancel"><span></span></a>';
} else {

View file

@ -1514,6 +1514,16 @@ div.game_config div.color_submits button.random span {
#hooks .color.black {
background-position: 0 -256px;
}
#hooks .engine {
position: absolute;
bottom: 0px;
right: 0px;
display: block;
width: 16px;
height: 16px;
background: red url(../images/engine_small.png) top left no-repeat;
border-radius: 8px 0 3px 0;
}
#featured_game div.vstext {
margin-top: 0.7em;
text-align: center;

3
todo
View file

@ -62,9 +62,6 @@ IE10 no sound toggle http://en.lichess.org/forum/lichess-feedback/notification-o
filter current games for watching http://en.lichess.org/forum/lichess-feedback/viewing-current-games-suggestion#2
declined challenge still appears
no time data http://en.lichess.org/x9tls3mh/stats
show cheater sign (red bg?)
dark version of lobby
variant filter
---