Commit 68eb1071 authored by Yannik Bocksch's avatar Yannik Bocksch 💬

Merge branch 'developement' into 'master'

Development

See merge request !11
parents 6a12102a b12c7154
......@@ -182,7 +182,7 @@
}
#main {
height: calc(100% - 64px);
height: calc(100% - 96px);
transition: 0.3s;
overflow-y: auto;
}
......@@ -254,6 +254,14 @@ span.error {
color: red;
}
span.insignificant {
color: #9e9e9e;
}
span.mentioned {
font-weight: bold;
}
span.debug, span.admin {
color: #2196F3;
}
......@@ -389,6 +397,8 @@ span.gameinvite {
font-weight: 700;
white-space: normal;
font-size: 12px;
background: #d6d6d6;
/*border: 1px solid #aaa;
......@@ -396,6 +406,10 @@ span.gameinvite {
border-radius: .25em;*/
}
.passworded:hover {
background: #f44336;
}
.gamelist_lobby_spectate {
width: 100%;
height: 25%;
......@@ -857,4 +871,27 @@ dfn {
.card_text {
word-wrap: break-word;
overflow: hidden;
}
#announcement {
margin-left: 5%;
width: 90%;
line-height: 32px;
text-align: center;
font-weight: 100;
}
#banner_hide {
width: 5%;
text-align: center;
line-height: 32px;
float: right;
cursor: pointer;
transform: translateX(40px);
transition: 0.3s;
}
#banner_hide:hover {
background-color: rgba(0, 0, 0, 0.4);
}
\ No newline at end of file
......@@ -135,7 +135,7 @@ boolean allowBlankCards = injector.getInstance(Key.get(new TypeLiteral<Boolean>(
<!-- Login Page Title -->
<legend>
<span id="main_content_title">CARDS AGAINST HUMANITY</span>
<span id="main_content_version">v1.3a</span>
<span id="main_content_version">v1.3c</span>
</legend>
<!-- Login Screen -->
......@@ -270,7 +270,7 @@ boolean allowBlankCards = injector.getInstance(Key.get(new TypeLiteral<Boolean>(
<div class="mdl-layout__header-row" style="padding: 10px;">
<!-- Left Side of Menu Bar -->
<nav id="menubar_left" class="mdl-navigation mdl-layout--large-screen-only">
<nav id="menubar_left" class="mdl-navigation mdl-layout--large-screen-only" style="width: 45%;">
<!-- Refresh Games Button -->
<input type="button" id="refresh_games" class="hide mdl-button mdl-js-button mdl-js-ripple-effect" style="color: white;" value="Refresh Games" />
......@@ -295,27 +295,37 @@ boolean allowBlankCards = injector.getInstance(Key.get(new TypeLiteral<Boolean>(
</nav>
<!-- Spacer Between Left and Center -> All Space between them -->
<div class="mdl-layout-spacer"></div>
<!-- <div class="mdl-layout-spacer"></div>-->
<!-- Center Menubar Title text -->
<nav id="menubar_center" class="mdl-navigation mdl-layout--large-screen-only">
<nav id="menubar_center" class="mdl-navigation mdl-layout--large-screen-only" style="width: 10%; justify-content: center;">
<span style="font-family: 'Roboto', sans-serif; font-weight: 100; font-size: 50px;">CLRTD</span>
</nav>
<!-- Spacer Between Center and Right -> All Space between them -->
<div class="mdl-layout-spacer"></div>
<!-- <div class="mdl-layout-spacer"></div>-->
<!-- Right Side of Menubar -->
<nav id="menubar_right" class="mdl-navigation mdl-layout--large-screen-only">
Current timer duration: <span id="current_timer">0</span> seconds
<a href="gameold.jsp" class="mdl-button mdl-js-button mdl-js-ripple-effect" style="color: white; margin-left: 10px;" title="Switches your Game to the Old Original Design.">Old Version</a>
<nav id="menubar_right" class="mdl-navigation mdl-layout--large-screen-only" style="width: 45%; direction: rtl;">
<input type="button" class="mdl-button mdl-js-button mdl-js-ripple-effect" style="color: white;" id="logout" value="Log out" />
<input type="button" class="mdl-button mdl-js-button mdl-js-ripple-effect" style="color: white;" id="view_cards" value="View Cards"
title="Open a new window to view all cards in the game."
onclick="window.open('viewcards.jsp', 'viewcards');" />
<input type="button" class="mdl-button mdl-js-button mdl-js-ripple-effect" style="color: white;" id="logout" value="Log out" />
<a href="gameold.jsp" class="mdl-button mdl-js-button mdl-js-ripple-effect" style="color: white; margin-left: 10px;" title="Switches your Game to the Old Original Design.">Old Version</a>
<span id="current_timer" style="display: none;">Current timer duration: 0 seconds</span>
</nav>
</div>
</header>
<header id="announcediv" class="mdl-layout__header" style="display: block; height: 32px; min-height:32px; background-color: #004ecc">
<div class="mdl-layout__header-row" style="height: 32px; justify-content: center;">
<div id="announcement">
Join our Minecraft server: xyzzy.clrtd.com (PC 1.13.2). <a rel="noopener noreferrer" target="_blank" href="https://forum.clrtd.com/index.php?p=/discussion/32/clrtd-minecraft-server#latest">More.</a> &emsp; You can check our development progress for the Minecraft server and this site on our new <a rel="noopener noreferrer" target="_blank" href="https://trello.com/b/5B91sZC0/pretend-youre-clrtd">Trello board.</a>
</div>
<div id="banner_hide" onclick="$('#announcediv').hide();">
Close
</div>
</div>
</header>
<!-- End Menubar -->
</div>
......
......@@ -446,7 +446,6 @@ cah.Game.prototype.setBlackCard = function(card) {
}
if (!this.showingLastRound_) {
console.log("#" + this.blackCard_.id);
$(".game_black_card").find("#skip_black").unbind();
$(".game_black_card", this.element_).empty().append(this.blackCard_.getElement());
}
......@@ -1291,6 +1290,8 @@ cah.Game.prototype.leaveGameClick_ = function() {
$(this.chatElement_).detach();
$(this.gameChatTab_).detach();
$("#current_timer").hide();
$('a.mdl-tabs__tab').removeClass('is-active');
$('a[href="#tab-global"]').addClass('is-active');
$('.mdl-tabs__panel').removeClass('is-active');
......@@ -1478,6 +1479,7 @@ cah.Game.prototype.stateChange = function(data) {
this.judge_ = null;
$(".game_hand_filter", this.element_).addClass("hide"); // in case they were the judge last
$("#stop_game").hide();
$("#current_timer").hide();
// round
this.showOptions_();
......@@ -1490,11 +1492,13 @@ cah.Game.prototype.stateChange = function(data) {
this.refreshGameStatus();
this.setBlackCard(data[cah.$.LongPollResponse.BLACK_CARD]);
this.showGamePermalink_(data);
$("#current_timer").show();
break;
case cah.$.GameState.JUDGING:
$(".game_white_cards", this.element_).empty();
this.setRoundWhiteCards(data[cah.$.LongPollResponse.WHITE_CARDS]);
$("#current_timer").show();
break;
default:
......
......@@ -355,7 +355,21 @@ cah.GameListLobby = function(parentElem, data) {
.join(', ') : "None";
if (data[cah.$.GameInfo.HAS_PASSWORD]) {
$(".gamelist_lobby_join", this.element_).val("Join (Passworded)");
$(".gamelist_lobby_join", this.element_).html("Join (Passworded)");
$(".gamelist_lobby_join", this.element_).addClass("passworded");
$(".gamelist_lobby_spectate", this.element_).html("Spectate (Passworded)");
$(".gamelist_lobby_spectate", this.element_).addClass("passworded");
}
if (data[cah.$.GameInfo.PLAYERS].length >= options[cah.$.GameOptionData.PLAYER_LIMIT]) {
$(".gamelist_lobby_join", this.element_).html("Full");
$(".gamelist_lobby_join", this.element_).addClass("passworded");
}
if (data[cah.$.GameInfo.SPECTATORS].length >= options[cah.$.GameOptionData.SPECTATOR_LIMIT]) {
$(".gamelist_lobby_spectate", this.element_).html("Full");
$(".gamelist_lobby_spectate", this.element_).addClass("passworded");
}
$(this.element_).attr(
......
......@@ -111,6 +111,21 @@ cah.log.status_with_game = function(game_or_id, text, opt_class, opt_allow_html,
if (opt_class) {
$(node).addClass(opt_class);
}
var lastPos = 0;
while (text.indexOf("@", lastPos) != -1) {
var pos = text.indexOf("@", lastPos);
var nextSpace = text.indexOf(" ", pos);
var username = text.substring(pos + 1, nextSpace);
console.log("Cut Username: " + username);
if (username.toLowerCase() == cah.nickname.toLowerCase()) {
$(node).addClass("mentioned");
break;
}
lastPos = pos + 1;
}
logElement.append(node);
// only announce things in our game, or if it has a class (admin or error, likely)
if (game_or_id !== null || opt_class) {
......
......@@ -36,7 +36,7 @@ cah.longpoll.ErrorCodeHandlers[cah.$.ErrorCode.NOT_REGISTERED] = function(data)
cah.longpoll.EventHandlers[cah.$.LongPollEvent.NEW_PLAYER] = function(data) {
// don't display our own join
if (data[cah.$.LongPollResponse.NICKNAME] != cah.nickname && !cah.hideConnectQuit) {
cah.log.status(data[cah.$.LongPollResponse.NICKNAME] + " has connected.");
cah.log.status(data[cah.$.LongPollResponse.NICKNAME] + " has connected.", "insignificant");
}
};
......@@ -65,7 +65,7 @@ cah.longpoll.EventHandlers[cah.$.LongPollEvent.PLAYER_LEAVE] = function(data) {
}
if (show) {
cah.log.status(data[cah.$.LongPollResponse.NICKNAME] + " has disconnected (" + friendly_reason
+ ").");
+ ").", "insignificant");
}
};
......
......@@ -114,7 +114,12 @@ cah.longpoll.done = function(data_list) {
} else {
// FIXME giant hack
if (data[cah.$.LongPollResponse.PLAY_TIMER]) {
$("#current_timer").text(data[cah.$.LongPollResponse.PLAY_TIMER] / 1000);
$("#current_timer").text((data[cah.$.LongPollResponse.PLAY_TIMER] >= 2147483647)? "Current timer duration: Infinite" : "Current timer duration: " + data[cah.$.LongPollResponse.PLAY_TIMER] / 1000 + " seconds");
if ((data[cah.$.LongPollResponse.PLAY_TIMER] / 1000) <= 0) {
$("#current_timer").hide();
} else {
$("#current_timer").show();
}
}
var event = data[cah.$.LongPollResponse.EVENT];
if (cah.longpoll.EventHandlers[event]) {
......
......@@ -22,7 +22,7 @@
<p>
Pretend You're Xyzzy, Java server and JavaScript client, Copyright &copy; 2012-2017, Andy Janata.<br>
<br>
CLRTD version (design and additional features), Copyright &copy; 2018, Erik Aab, Yannik Bocksch.<br>
CLRTD version (design and additional features), Copyright &copy; <script type="text/JavaScript"> var theDate=new Date(); document.write(theDate.getFullYear()); </script>, Erik Aab, Yannik Bocksch.<br>
<br>
All rights reserved.
<br /> <br />
......
......@@ -18,7 +18,7 @@ pyx.id_code_salt=
# comma-separated listed of IP addresses (v4 or v6) from which users are considered admins.
# IPv6 addresses must be fully spelt out without omitting groups of 0s with ::
pyx.admin_addrs=127.0.0.1,192.168.0.123,10.0.0.11,0:0:0:0:0:0:0:1
pyx.admin_addrs=127.0.0.1,192.168.0.123,10.0.0.10,0:0:0:0:0:0:0:1
# comma-separated list of strings banned from appearing in nicks.
pyx.banned_nicks=xyzzy,rett,mastercarp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment