notify spectator move when someone tries to move the pieces

pull/1/merge
Thibault Duplessis 2012-06-11 22:39:43 +02:00
parent 79d658da7a
commit 9ce814a585
7 changed files with 13 additions and 2 deletions

View File

@ -71,6 +71,7 @@ final class I18nKeys(translator: Translator) {
val contact = new Key("contact")
val thereIsNothingToSeeHereIfYouThinkItsABugYouCouldSendAnEmailToEmail = new Key("thereIsNothingToSeeHereIfYouThinkItsABugYouCouldSendAnEmailToEmail")
val shareThisUrlToLetSpectatorsSeeTheGame = new Key("shareThisUrlToLetSpectatorsSeeTheGame")
val youAreViewingThisGameAsASpectator = new Key("youAreViewingThisGameAsASpectator")
val replayAndAnalyse = new Key("replayAndAnalyse")
val viewGameStats = new Key("viewGameStats")
val flipBoard = new Key("flipBoard")

View File

@ -7,7 +7,7 @@ import play.api.templates.Html
trait AssetHelper {
val assetVersion = 26
val assetVersion = 28
def cssTag(name: String) = css("stylesheets/" + name)

View File

@ -22,6 +22,7 @@ underchat = underchat.some) {
<div class="lichess_board_wrap">
@widget.connection()
<div class="lichess_board colorable_board grey with_marks">@Html(ui.Board.render(pov))</div>
<div id="dont_touch">@trans.youAreViewingThisGameAsASpectator()</div>
</div>
<div class="lichess_ground">
@round.cemetery(pov, "top")

View File

@ -47,6 +47,7 @@ blackLeftTheGame=Black left the game
contact=Contact
thereIsNothingToSeeHereIfYouThinkItsABugYouCouldSendAnEmailToEmail=There is nothing to see here. If you think it's a bug, you could send an email to %s
shareThisUrlToLetSpectatorsSeeTheGame=Share this URL to let spectators see the game
youAreViewingThisGameAsASpectator=You are viewing this game as a spectator
replayAndAnalyse=Replay and analyse
viewGameStats=View game stats
flipBoard=Flip board

View File

@ -41,6 +41,12 @@ $.widget("lichess.game", {
}
}
if (self.options.player.spectator) {
self.$board.find("div.lcs").mousedown(function() {
$("#dont_touch").toggle();
});
}
if (!self.options.opponent.ai && !self.options.player.spectator) {
// update document title to show playing state
setTimeout(self.updateTitle = function() {

View File

@ -196,7 +196,7 @@ div.lichess_overboard p.explanations {
-webkit-box-shadow: 0px 0px 20px #d85000;
}
#premove {
#premove, #dont_touch {
display: none;
position: absolute;
top: 512px;

2
todo
View File

@ -25,6 +25,8 @@ autoclose top menus
tournaments http://www.chess.com/tournaments/help.html
long name display issue http://en.lichess.org/forum/lichess-feedback/long-names-alter-layout
fix game list translations
replay moved square bg
join friend rated as anon
new translations:
-rematchOfferCanceled=Rematch offer canceled