Commit 6a12102a authored by Yannik Bocksch's avatar Yannik Bocksch 💬

Merge branch 'developement' into 'master'

Version 1.3a

See merge request !10
parents 4ff8d338 f1d56148
......@@ -350,6 +350,79 @@ span.gameinvite {
/*-------------------------------------------------------------
* Game List Lobby Template For Gamelist
*-------------------------------------------------------------*/
.gamelist_lobby {
background: #e6e6e6;
/*border-radius: .25em;*/
width: 575px;
height: 175px;
float: left;
border: 1px solid #ccc;
margin: 4px;
}
.gamelist_lobby_name {
color: #2196f3;
font-weight: bold;
}
.gamelist_lobby_left {
width: 77%;
height: 100%;
padding: .5em 1.5%;
float: left;
}
.gamelist_lobby_right {
width: 20%;
height: 100%;
float: right;
}
.gamelist_lobby_join {
width: 100%;
height: 75%;
text-transform: uppercase;
font-weight: 700;
white-space: normal;
background: #d6d6d6;
/*border: 1px solid #aaa;
background: linear-gradient(#fff, #ddd) #ddd;
border-radius: .25em;*/
}
.gamelist_lobby_spectate {
width: 100%;
height: 25%;
text-transform: uppercase;
font-weight: 700;
background: #d6d6d6;
/*border: 1px solid #aaa;
background: linear-gradient(#fff, #ddd) #ddd;
border-radius: .25em;*/
}
.gamelist_lobby_status {
float: right;
font-weight: 700;
}
.gamelist_lobby_status_joinable {
color: green;
}
.gamelist_lobby_status_unjoinable {
color: #c0c0c0;
}
......@@ -414,67 +487,7 @@ span.gameinvite {
*/
.gamelist_lobby {
background: #b6b6b6;
/*border-radius: .25em;*/
width: 575px;
height: 175px;
float: left;
border: 1px solid #ccc;
margin: 4px;
}
.gamelist_lobby_name {
color: #2196f3;
font-weight: bold;
}
.gamelist_lobby_left {
width: 77%;
height: 100%;
padding: .5em 1.5%;
float: left;
}
.gamelist_lobby_right {
width: 20%;
height: 100%;
float: right;
}
.gamelist_lobby_join {
width: 100%;
height: 75%;
border: 1px solid #aaa;
background: linear-gradient(#fff, #ddd) #ddd;
border-radius: .25em;
text-transform: uppercase;
font-weight: 700;
white-space: normal;
}
.gamelist_lobby_spectate {
width: 100%;
height: 25%;
border: 1px solid #aaa;
background: linear-gradient(#fff, #ddd) #ddd;
border-radius: .25em;
text-transform: uppercase;
font-weight: 700;
}
.gamelist_lobby_status {
float: right;
font-weight: 700;
}
.gamelist_lobby_status_joinable {
color: green;
}
.gamelist_lobby_status_unjoinable {
color: #c0c0c0;
}
......
......@@ -79,7 +79,6 @@ boolean allowBlankCards = injector.getInstance(Key.get(new TypeLiteral<Boolean>(
<script type="text/javascript" src="js/cah.ajax.builder.js"></script>
<script type="text/javascript" src="js/cah.ajax.handlers.js"></script>
<script type="text/javascript" src="js/cah.app.js"></script>
<link rel="stylesheet" type="text/css" href="cah.css" media="screen" />
<link rel="stylesheet" type="text/css" href="jquery-ui.min.css" media="screen" />
<jsp:include page="analytics.jsp" />
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet">
......@@ -97,10 +96,13 @@ boolean allowBlankCards = injector.getInstance(Key.get(new TypeLiteral<Boolean>(
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="favicon/ms-icon-144x144.png">
<meta name="theme-color" content="#2196f3">
<meta name="theme-color" content="#2196f3">
<link rel="stylesheet" href="material.blue-light_blue.min.css" />
<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>
<link rel="stylesheet" type="text/css" href="cah.css" media="screen" />
</head>
<body id="gamebody">
......@@ -133,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.3</span>
<span id="main_content_version">v1.3a</span>
</legend>
<!-- Login Screen -->
......@@ -199,25 +201,28 @@ boolean allowBlankCards = injector.getInstance(Key.get(new TypeLiteral<Boolean>(
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
discussions = JSON.parse(xmlHttp.responseText);
index = 0;
discussions.forEach(function(element) {
if (index >= 3) {
if (index == 3) {
childdiv = document.createElement("div");
childdiv.style = "text-align: center; margin-bottom: 20px;";
childdiv.innerHTML = "<a href='https://forum.clrtd.com/index.php?p=/categories/changelog' style='font-size: 20px; text-decoration: none; color: #2196f3; font-weight: 300;'>MORE</a>";
document.getElementById('changelogbox').appendChild(childdiv);
return;
} else {
index = index + 1;
return;
} else if (index < 3) {
rawhtml = "<span style='font-size: 20px; font-weight: 300; margin-bottom: 14px;'>{TITLE}<br></span><span style='margin-top: 14px; padding-left: 40px; padding-right: 40px;'>{CONTENT}</span>";
finishhtml = rawhtml.replace("{TITLE}", element.name);
finishhtml = finishhtml.replace("{CONTENT}", element.body);
childdiv = document.createElement("div");
childdiv.style = "margin-bottom: 20px; border-radius: 5px; padding: 5px;";
var publishdate = new Date(element.dateInserted);
var threshold = new Date().getTime() - (3 * 24 * 60 * 60 * 1000);
if (publishdate < threshold) {
childdiv.style += "background-color: #2196f360;";
}
console.log(publishdate);
console.log(threshold);
console.log(publishdate > threshold);
childdiv = document.createElement("div");
childdiv.style = "margin-bottom: 20px; border-radius: 5px; padding: 5px;" + ((publishdate > threshold)? "background-color: rgba(33, 150, 243, 0.4);" : "");
childdiv.innerHTML = finishhtml;
document.getElementById('changelogbox').appendChild(childdiv);
index = index + 1;
......@@ -275,7 +280,7 @@ boolean allowBlankCards = injector.getInstance(Key.get(new TypeLiteral<Boolean>(
<!-- Game Filter Input -->
<div id="filter_games_wrapper" class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label" style="margin-left: 10px;">
<input type="text" id="filter_games" class="hide mdl-textfield__input" data-lpignore="true" style="color: white;" />
<input type="text" id="filter_games" class="mdl-textfield__input" data-lpignore="true" style="color: white;" />
<label class="mdl-textfield__label" for="filter_games" style="color: white;">Filter games by keyword</label>
</div>
......@@ -471,22 +476,42 @@ boolean allowBlankCards = injector.getInstance(Key.get(new TypeLiteral<Boolean>(
<span class="gamelist_lobby_status">status</span>
</h3>
<div>
<strong>Players:</strong>
<span class="gamelist_lobby_players">host, player1, player2</span>
<strong>Players:</strong>
<span class="gamelist_lobby_players">host, player1, player2</span>
</div>
<div>
<strong>Spectators:</strong>
<span class="gamelist_lobby_spectators">spectator1</span>
</div>
<div>
<strong>Goal:</strong> <span class="gamelist_lobby_goal"></span>
</div>
<div>
<strong>Spectators:</strong>
<span class="gamelist_lobby_spectators">spectator1</span>
<strong>Show Card Owner:</strong> <span class="gamelist_lobby_conf_cardowner"></span>
</div>
<div><strong>Goal:</strong> <span class="gamelist_lobby_goal"></span></div>
<div>
<strong>Cards:</strong> <span class="gamelist_lobby_cardset"></span>
<strong>Blank Cards:</strong> <span class="gamelist_lobby_conf_blankcards"></span>
</div>
<div>
<!-- <strong>Cards:</strong> <span class="gamelist_lobby_cardset"></span>-->
<dfn title="None" style="font-family: Roboto, 'sans-serif';" class="gamelist_lobby_cardset">
<strong><span style="font-family: Roboto, 'sans-serif'; color: black; text-decoration: none; font-style: normal;">Card Decks</span></strong>
</dfn>
</div>
<div class="hide">Game <span class="gamelist_lobby_id">###</span></div>
</div>
<div class="gamelist_lobby_right">
<input type="button" class="gamelist_lobby_join" value="Join" />
<input type="button" class="gamelist_lobby_spectate" value="Spectate" />
<!--<input type="button" class="gamelist_lobby_join" value="Join" />
<input type="button" class="gamelist_lobby_spectate" value="Spectate" />-->
<!-- Raised button with ripple -->
<button style="width: 100%; height: 75%;" class="mdl-button mdl-js-button mdl-js-ripple-effect gamelist_lobby_join">
Join
</button>
<button style="width: 100%; height: 25%;" class="mdl-button mdl-js-button mdl-js-ripple-effect gamelist_lobby_spectate">
Spectate
</button>
</div>
</div>
</div>
......
......@@ -368,7 +368,7 @@ cah.card.WhiteCard.prototype.isBlankCard = function() {
* owner Username of the User who played the Card.
*/
cah.card.WhiteCard.prototype.setOwner = function(owner) {
$(".card_owner", this.faceUpElem_).html(owner);
$(".card_owner", this.faceUpElem_).html("&lsaquo;" + owner + "&rsaquo;");
// TODO do this better
$(".card_owner", this.faceUpElem_).attr(
"aria-label",
......
......@@ -44,12 +44,13 @@ cah.$.GameOptionData = function() {
cah.$.GameOptionData.prototype.dummyForAutocomplete = undefined;
cah.$.GameOptionData.TIMER_MULTIPLIER = "tm";
cah.$.GameOptionData.PASSWORD = "pw";
cah.$.GameOptionData.NAME = "n";
cah.$.GameOptionData.SPECTATOR_LIMIT = "vL";
cah.$.GameOptionData.SCORE_LIMIT = "sl";
cah.$.GameOptionData.BLANKS_LIMIT = "bl";
cah.$.GameOptionData.PLAYER_LIMIT = "pL";
cah.$.GameOptionData.SHOW_CARDOWNER = "sco";
cah.$.GameOptionData.CARDCAST_SETS = "ccs";
cah.$.GameOptionData.NAME = "n";
cah.$.GameOptionData.CARD_SETS = "css";
cah.$.GameInfo = function() {
......@@ -151,6 +152,7 @@ cah.$.LongPollResponse.SIGIL = "?";
cah.$.LongPollResponse.EMOTE = "me";
cah.$.LongPollResponse.CARDCAST_DECK_INFO = "cdi";
cah.$.LongPollResponse.GAME_ID = "gid";
cah.$.LongPollResponse.CARDOWNERS = "CO";
cah.$.LongPollResponse.ROUND_PERMALINK = "rP";
cah.$.LongPollResponse.NICKNAME = "n";
cah.$.LongPollResponse.BLACK_CARD = "bc";
......@@ -406,3 +408,4 @@ cah.$.DisconnectReason_msg['pt'] = "Ping timeout";
cah.$.DisconnectReason_msg['it'] = "Kicked due to idle";
cah.$.DisconnectReason_msg['k'] = "Kicked by server administrator";
cah.$.DisconnectReason_msg['man'] = "Leaving";
......@@ -1025,6 +1025,7 @@ cah.Game.prototype.updateSpectator = function(spectator) {
$(".game_message", this.element_).text(
cah.$.GamePlayerStatus_msg_2[cah.$.GamePlayerStatus.SPECTATOR]);
$(".confirm_card", this.element_).attr("disabled", "disabled");
$(".game_black_card").find("#skip_black").hide();
}
};
......@@ -1572,7 +1573,7 @@ cah.Game.prototype.optionChanged_ = function(e) {
options[cah.$.GameOptionData.SHOW_CARDOWNER] = $('.option_show_cardowner', this.optionsElement_).attr('checked') != undefined;
var gamename = $(".game_name", this.optionsElement_).val();
gamename = gamename.replace(/([^A-Za-z0-9/\\#_ß?, !-])/g,'').substr(0, 25);
gamename = gamename.replace(/([^A-Za-z0-9/\\#_ß?, !-])/g,'').substr(0, 20);
$(".game_name", this.optionsElement_).val(gamename);
options[cah.$.GameOptionData.NAME] = gamename;
......
......@@ -333,12 +333,17 @@ cah.GameListLobby = function(parentElem, data) {
$(".gamelist_lobby_max_spectators", this.element_).text(
options[cah.$.GameOptionData.SPECTATOR_LIMIT]);
$(".gamelist_lobby_goal", this.element_).text(options[cah.$.GameOptionData.SCORE_LIMIT]);
$(".gamelist_lobby_conf_cardowner", this.element_).text(
options[cah.$.GameOptionData.SHOW_CARDOWNER] ? "enabled" : "disabled");
$(".gamelist_lobby_conf_blankcards", this.element_).text(
options[cah.$.GameOptionData.BLANKS_LIMIT]);
var cardSets = options[cah.$.GameOptionData.CARD_SETS];
var cardSetNames = [];
cardSets.sort();
var cardsetamount = 0;
for ( var key in cardSets) {
if (cardsetamount >= 12) {
if (cardsetamount >= 10) {
cardSetNames.push("...");
break;
}
......@@ -346,7 +351,8 @@ cah.GameListLobby = function(parentElem, data) {
cardSetNames.push(cah.CardSet.list[cardSetId].getName());
cardsetamount = cardsetamount + 1;
}
$(".gamelist_lobby_cardset", this.element_).html(cardSetNames.join(', '));
$(".gamelist_lobby_cardset", this.element_)[0].title = (cardsetamount > 0) ? cardSetNames
.join(', ') : "None";
if (data[cah.$.GameInfo.HAS_PASSWORD]) {
$(".gamelist_lobby_join", this.element_).val("Join (Passworded)");
......
......@@ -42,9 +42,13 @@
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<username>admin</username>
<password>fokmilife</password>
<path>/zy</path>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
......
......@@ -1211,6 +1211,7 @@ public class Game {
killRoundTimer();
returnCardsToHand();
dealState();
logger.info(String.format("User %s skipped a black card in game %d", user.getNickname(), id));
}
}
......
......@@ -86,8 +86,8 @@ public class GameOptions {
this.blanksInDeck = newOptions.blanksInDeck;
this.password = newOptions.password;
this.gameName = newOptions.gameName.replaceAll("[^A-Za-z0-9/\\\\#_ß?, !-]", "");
if (this.gameName.length() > 25) {
this.gameName = this.gameName.substring(0, 25);
if (this.gameName.length() > 20) {
this.gameName = this.gameName.substring(0, 20);
}
this.timerMultiplier = newOptions.timerMultiplier;
this.showCardOwner = newOptions.showCardOwner;
......
......@@ -86,6 +86,7 @@ public class StartGameHandler extends GameWithPlayerHandler {
return data;
}
} catch (final JDBCConnectionException jce) {
jce.printStackTrace();
return error(ErrorCode.SERVER_ERROR);
} finally {
hibernateSession.close();
......
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