remember friends box status
This commit is contained in:
parent
3992356055
commit
70b5929fdf
|
@ -7,7 +7,7 @@ import controllers.routes
|
|||
|
||||
trait AssetHelper {
|
||||
|
||||
val assetVersion = 71
|
||||
val assetVersion = 72
|
||||
|
||||
private val domain = lila.api.Env.current.Net.AssetDomain
|
||||
|
||||
|
|
|
@ -8,152 +8,154 @@ chat: Option[Html] = None,
|
|||
underchat: Option[Html] = None,
|
||||
robots: Boolean = true,
|
||||
moreCss: Html = Html(""),
|
||||
moreJs: Html = Html(""),
|
||||
moreJs: Html = Html(""),
|
||||
signedJs: Option[String] = None,
|
||||
themepicker: Boolean = false)(body: Html)(implicit ctx: Context)
|
||||
<!doctype html>
|
||||
<html lang="@lang.language">
|
||||
<head>
|
||||
<title>@isProd.fold("lichess", "[dev]") @title • @trans.freeOnlineChess()</title>
|
||||
@if(setting.bg == "dark") {
|
||||
@cssTag("dark.css")
|
||||
<head>
|
||||
<title>@isProd.fold("lichess", "[dev]") @title • @trans.freeOnlineChess()</title>
|
||||
@if(setting.bg == "dark") {
|
||||
@cssTag("dark.css")
|
||||
}
|
||||
@cssTag("common.css")
|
||||
@cssTag("board.css")
|
||||
@moreCss
|
||||
<meta content="@trans.freeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents()" name="description">
|
||||
<meta charset="utf-8">
|
||||
<link rel="shortcut icon" href="@routes.Assets.at("images/favicon-32-white.png")" type="image/x-icon" />
|
||||
@if(!robots) {
|
||||
<meta content="noindex, nofollow" name="robots">
|
||||
}
|
||||
</head>
|
||||
<body class="@setting.theme.cssClass @setting.bg"
|
||||
data-sound-file="@routes.Assets.at("sound/alert.ogg")"
|
||||
data-troll="@ctx.troll.toString"
|
||||
data-port="@netPort"
|
||||
data-accept-languages="@acceptLanguages">
|
||||
<div id="site_description">@trans.freeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents()</div>
|
||||
<div id="top" class="clearfix">
|
||||
<a title="@trans.toggleSound()" id="sound_state" class="available">
|
||||
<span></span>
|
||||
</a>
|
||||
<div class="lichess_language">
|
||||
<a class="toggle" href="#">
|
||||
<span class="s16 ddown">@langName(lang)</span>
|
||||
</a>
|
||||
<ul class="language_links dropdown">
|
||||
@langLinks(lang)
|
||||
<li><a href="@routes.I18n.contribute">Help translate Lichess!</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@siteMenu.all(ctx.me).map { elem =>
|
||||
@elem.code match {
|
||||
case "message" => {
|
||||
<a title="@elem.name()" data-href="@routes.Message.preview" class="message goto_nav blank_if_play @elem.currentClass(active)" href="@elem.route">
|
||||
<span class="s16 message"></span>
|
||||
@defining(messageNbUnread(ctx)) { nbUnread =>
|
||||
<span id="nb_messages" class="new_messages @{ (nbUnread > 0).??("unread") }">@nbUnread</span>
|
||||
}
|
||||
@cssTag("common.css")
|
||||
@cssTag("board.css")
|
||||
@moreCss
|
||||
<meta content="@trans.freeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents()" name="description">
|
||||
<meta charset="utf-8">
|
||||
<link rel="shortcut icon" href="@routes.Assets.at("images/favicon-32-white.png")" type="image/x-icon" />
|
||||
@if(!robots) {
|
||||
<meta content="noindex, nofollow" name="robots">
|
||||
}
|
||||
</head>
|
||||
<body class="@setting.theme.cssClass @setting.bg"
|
||||
data-sound-file="@routes.Assets.at("sound/alert.ogg")"
|
||||
data-troll="@ctx.troll.toString"
|
||||
data-port="@netPort"
|
||||
data-accept-languages="@acceptLanguages">
|
||||
<div id="site_description">@trans.freeOnlineChessGamePlayChessNowInACleanInterfaceNoRegistrationNoAdsNoPluginRequiredPlayChessWithComputerFriendsOrRandomOpponents()</div>
|
||||
<div id="top" class="clearfix">
|
||||
<a title="@trans.toggleSound()" id="sound_state" class="available">
|
||||
<span></span>
|
||||
</a>
|
||||
<div class="lichess_language">
|
||||
<a class="toggle" href="#">
|
||||
<span class="s16 ddown">@langName(lang)</span>
|
||||
</a>
|
||||
<ul class="language_links dropdown">
|
||||
@langLinks(lang)
|
||||
<li><a href="@routes.I18n.contribute">Help translate Lichess!</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@siteMenu.all(ctx.me).map { elem =>
|
||||
@elem.code match {
|
||||
case "message" => {
|
||||
<a title="@elem.name()" data-href="@routes.Message.preview" class="message goto_nav blank_if_play @elem.currentClass(active)" href="@elem.route">
|
||||
<span class="s16 message"></span>
|
||||
@defining(messageNbUnread(ctx)) { nbUnread =>
|
||||
<span id="nb_messages" class="new_messages @{ (nbUnread > 0).??("unread") }">@nbUnread</span>
|
||||
}
|
||||
</a>
|
||||
</a>
|
||||
}
|
||||
case "team" if teamNbRequests(ctx) > 0 => {
|
||||
@defining(teamNbRequests(ctx)) { nbr =>
|
||||
<a class="goto_nav blank_if_play @elem.currentClass(active)" href="@routes.Team.requests()">
|
||||
@elem.name()
|
||||
<span id="nb_messages" class="new_messages unread">@nbr</span>
|
||||
</a>
|
||||
}
|
||||
}
|
||||
case _ => {
|
||||
<a class="goto_nav blank_if_play @elem.currentClass(active)" href="@elem.route">
|
||||
@elem.name()
|
||||
</a>
|
||||
}
|
||||
}
|
||||
}
|
||||
<div id="nb_connected_players" class="nb_connected_players">
|
||||
@trans.nbConnectedPlayers("<strong>?</strong>")
|
||||
</div>
|
||||
<a id="reconnecting" onclick="location.reload();">@trans.reconnecting()</a>
|
||||
@if(themepicker) {
|
||||
<div class="themepicker">
|
||||
<a class="theme_toggle toggle" href="#"><span class="s16 ddown">@trans.color()</span></a>
|
||||
<div class="themes dropdown" data-href="@routes.Setting.set("theme")">
|
||||
@themeList.map { theme =>
|
||||
<div class="theme" data-theme="@theme.name"><div class="color_demo @theme.name"></div></div>
|
||||
}
|
||||
case "team" if teamNbRequests(ctx) > 0 => {
|
||||
@defining(teamNbRequests(ctx)) { nbr =>
|
||||
<a class="goto_nav blank_if_play @elem.currentClass(active)" href="@routes.Team.requests()">
|
||||
@elem.name()
|
||||
<span id="nb_messages" class="new_messages unread">@nbr</span>
|
||||
</a>
|
||||
}
|
||||
}
|
||||
case _ => {
|
||||
<a class="goto_nav blank_if_play @elem.currentClass(active)" href="@elem.route">
|
||||
@elem.name()
|
||||
</a>
|
||||
}
|
||||
}
|
||||
}
|
||||
<div id="nb_connected_players" class="nb_connected_players">
|
||||
@trans.nbConnectedPlayers("<strong>?</strong>")
|
||||
</div>
|
||||
<a id="reconnecting" onclick="location.reload();">@trans.reconnecting()</a>
|
||||
@if(themepicker) {
|
||||
<div class="themepicker">
|
||||
<a class="theme_toggle toggle" href="#"><span class="s16 ddown">@trans.color()</span></a>
|
||||
<div class="themes dropdown" data-href="@routes.Setting.set("theme")">
|
||||
@themeList.map { theme =>
|
||||
<div class="theme" data-theme="@theme.name"><div class="color_demo @theme.name"></div></div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<a href="@routes.Setting.set("bg")" title="@trans.toggleBackground()" class="bgpicker">
|
||||
<span></span>
|
||||
</a>
|
||||
@ctx.me.fold(auth.miniLogin())(auth.loggedIn(_))
|
||||
</div>
|
||||
@ctx.me.map { me =>
|
||||
<div class="notifications">@notifications(me)</div>
|
||||
}.getOrElse {
|
||||
<div class="notifications"></div>
|
||||
</div>
|
||||
}
|
||||
<a href="@routes.Setting.set("bg")" title="@trans.toggleBackground()" class="bgpicker">
|
||||
<span></span>
|
||||
</a>
|
||||
@ctx.me.fold(auth.miniLogin())(auth.loggedIn(_))
|
||||
</div>
|
||||
@ctx.me.map { me =>
|
||||
<div class="notifications">@notifications(me)</div>
|
||||
}.getOrElse {
|
||||
<div class="notifications"></div>
|
||||
}
|
||||
<div class="content">
|
||||
<div id="site_header">
|
||||
<h1>
|
||||
<a id="site_title" href="@routes.Lobby.home">
|
||||
lichess<span class="extension">.org</span>
|
||||
</a>
|
||||
@baseline
|
||||
</h1>
|
||||
@menu.map { side =>
|
||||
<div class="side_menu">@side</div>
|
||||
}
|
||||
<div class="content">
|
||||
<div id="site_header">
|
||||
<h1>
|
||||
<a id="site_title" href="@routes.Lobby.home">
|
||||
lichess<span class="extension">.org</span>
|
||||
</a>
|
||||
@baseline
|
||||
</h1>
|
||||
@menu.map { side =>
|
||||
<div class="side_menu">@side</div>
|
||||
}
|
||||
@goodies
|
||||
@chat
|
||||
@underchat.map { g =>
|
||||
<div class="under_chat">@g</div>
|
||||
}
|
||||
</div>
|
||||
<div id="lichess">
|
||||
@body
|
||||
</div>
|
||||
@goodies
|
||||
@chat
|
||||
@underchat.map { g =>
|
||||
<div class="under_chat">@g</div>
|
||||
}
|
||||
</div>
|
||||
<div id="lichess">
|
||||
@body
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer_wrap">
|
||||
<div id="lichess_social"></div>
|
||||
<div class="footer">
|
||||
<div class="right">
|
||||
<a href="http://github.com/ornicar">github.com/ornicar</a> | <a class="js_email">email me</a><br />
|
||||
<a href="@routes.Main.developers">Developers</a> |
|
||||
<a href="http://www.facebook.com/appcenter/510511915639555">Facebook app</a>
|
||||
</div>
|
||||
<div class="footer_wrap">
|
||||
<div id="lichess_social"></div>
|
||||
<div class="footer">
|
||||
<div class="right">
|
||||
<a href="http://github.com/ornicar">github.com/ornicar</a> | <a class="js_email">email me</a><br />
|
||||
<a href="@routes.Main.developers">Developers</a> |
|
||||
<a href="http://www.facebook.com/appcenter/510511915639555">Facebook app</a>
|
||||
</div>
|
||||
<a href="@routes.Wiki.home()" title="@trans.learnMoreAboutLichess()">Wiki</a> |
|
||||
<a href="@routes.ForumCateg.show("lichess-feedback", 1)" title="Having a suggestion, feature request or bug report? Let me know">Feedback</a> |
|
||||
<a href="http://github.com/ornicar/lila" target="_blank" title="See what's inside, fork and contribute">Source Code</a><br />
|
||||
<a href="@routes.Monitor.index">Monitor</a> |
|
||||
<a href="@routes.I18n.contribute">Translate Lichess</a>
|
||||
<br />
|
||||
Ping: <span id="connection_lag">?</span>
|
||||
</div>
|
||||
<a href="@routes.Wiki.home()" title="@trans.learnMoreAboutLichess()">Wiki</a> |
|
||||
<a href="@routes.ForumCateg.show("lichess-feedback", 1)" title="Having a suggestion, feature request or bug report? Let me know">Feedback</a> |
|
||||
<a href="http://github.com/ornicar/lila" target="_blank" title="See what's inside, fork and contribute">Source Code</a><br />
|
||||
<a href="@routes.Monitor.index">Monitor</a> |
|
||||
<a href="@routes.I18n.contribute">Translate Lichess</a>
|
||||
<br />
|
||||
Ping: <span id="connection_lag">?</span>
|
||||
</div>
|
||||
</div>
|
||||
@ctx.me.map { me =>
|
||||
<div id="friend_box" data-preload="@onlineFriends(me.id)">
|
||||
<div class="title">@trans.onlineFriends() - <strong class="online"> </strong>/<span class="total"> </span></div>
|
||||
<div class="content_wrap">
|
||||
<div class="content list"></div>
|
||||
<div class="nobody">
|
||||
<span>@trans.noFriendsOnline()</span>
|
||||
<a class="find button" href="@routes.Relation.suggest(me.username)">
|
||||
<span class="s16 tup">@trans.findFriends()</span>
|
||||
</a>
|
||||
</div>
|
||||
@ctx.me.map { me =>
|
||||
<div id="friend_box" data-preload="@onlineFriends(me.id)">
|
||||
<div class="title">@trans.onlineFriends() - <strong class="online"> </strong>/<span class="total"> </span></div>
|
||||
<div class="content list"></div>
|
||||
<div class="nobody">
|
||||
<span>@trans.noFriendsOnline()</span>
|
||||
<a class="find button" href="@routes.Relation.suggest(me.username)">
|
||||
<span class="s16 tup">@trans.findFriends()</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@jsTag("deps.min.js")
|
||||
@signedJs.fold(isProd.fold(jsTagC("big.js"), jsTag("big.js")))(js => jsAt(js, false))
|
||||
@moreJs
|
||||
@if(lang.language != "en") {
|
||||
<script src="@routes.Assets.at("trans/" + lang.language + ".js")?v=@assetVersion"></script>
|
||||
@timeagoLocale.map { l =>
|
||||
<script src="@routes.Assets.at("vendor/timeago/locales/jquery.timeago." + l + ".js")"></script>
|
||||
}
|
||||
}
|
||||
</body>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@jsTag("deps.min.js")
|
||||
@signedJs.fold(isProd.fold(jsTagC("big.js"), jsTag("big.js")))(js => jsAt(js, false))
|
||||
@moreJs
|
||||
@if(lang.language != "en") {
|
||||
<script src="@routes.Assets.at("trans/" + lang.language + ".js")?v=@assetVersion"></script>
|
||||
@timeagoLocale.map { l =>
|
||||
<script src="@routes.Assets.at("vendor/timeago/locales/jquery.timeago." + l + ".js")"></script>
|
||||
}
|
||||
}
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1424,8 +1424,11 @@ var storage = {
|
|||
var self = this;
|
||||
self.$list = self.element.find("div.list");
|
||||
self.$title = self.element.find('.title').click(function() {
|
||||
self.$list.toggle(500);
|
||||
self.element.find('.content_wrap').toggle(500, function() {
|
||||
storage.set('friends-hide', $(this).is(':visible') ? 0 : 1);
|
||||
});
|
||||
});
|
||||
if (storage.get('friends-hide') == 1) self.$title.click();
|
||||
self.$nbOnline = self.$title.find('.online');
|
||||
self.$nbTotal = self.$title.find('.total');
|
||||
self.$nobody = self.element.find("div.nobody");
|
||||
|
|
Loading…
Reference in a new issue