diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameUi.js b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameUi.js index 47c8124a9..da2ae2778 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameUi.js +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameUi.js @@ -11,7 +11,9 @@ var GempLotrGameUI = Class.extend({ cardActionDialog: null, smallDialog: null, gameStateElem: null, - alert: null, + alertBox: null, + alertText: null, + alertButtons: null, infoDialog: null, advPathGroup: null, @@ -160,9 +162,19 @@ var GempLotrGameUI = Class.extend({ })(i)); } - this.alert = $("
"); - this.alert.css({"border-radius": "7px"}); - $("#main").append(this.alert); + this.alertBox = $(""); + this.alertBox.css({"border-radius": "7px"}); + + this.alertText = $(""); + this.alertText.css({position: "absolute", left: "0px", top: "0px", width: "100%", height: "50px", scroll: "auto"}); + + this.alertButtons = $(""); + this.alertButtons.css({position: "absolute", left: "0px", top: "50px", width: "100%", height: "30px", scroll: "auto"}); + + this.alertBox.append(this.alertText); + this.alertBox.append(this.alertButtons); + + $("#main").append(this.alertBox); $("body").click( function (event) { @@ -241,21 +253,21 @@ var GempLotrGameUI = Class.extend({ initializeDialogs: function() { this.smallDialog = $("") .dialog({ - autoOpen: false, - closeOnEscape: false, - resizable: false, - width: 400, - height: 200 - }); + autoOpen: false, + closeOnEscape: false, + resizable: false, + width: 400, + height: 200 + }); this.cardActionDialog = $("") .dialog({ - autoOpen: false, - closeOnEscape: false, - resizable: true, - width: 600, - height: 300 - }); + autoOpen: false, + closeOnEscape: false, + resizable: true, + width: 600, + height: 300 + }); var that = this; @@ -267,15 +279,15 @@ var GempLotrGameUI = Class.extend({ this.infoDialog = $("") .dialog({ - autoOpen: false, - closeOnEscape: true, - resizable: true, - title: "Card information", - minHeight: 80, - minWidth: 200, - width: 600, - height: 300 - }); + autoOpen: false, + closeOnEscape: true, + resizable: true, + title: "Card information", + minHeight: 80, + minWidth: 200, + width: 600, + height: 300 + }); var swipeOptions = { threshold: 20, @@ -387,7 +399,8 @@ var GempLotrGameUI = Class.extend({ this.hand.setBounds(advPathWidth + specialUiWidth + (padding * 2), padding * 6 + yScales[5] * heightPerScale, width - (advPathWidth + specialUiWidth + padding * 3), heightScales[5] * heightPerScale); this.gameStateElem.css({ position: "absolute", left: padding * 2 + advPathWidth, top: padding, width: specialUiWidth - padding, height: height - padding * 4 - alertHeight - chatHeight}); - this.alert.css({ position: "absolute", left: padding * 2 + advPathWidth, top: height - (padding * 2) - alertHeight - chatHeight, width: specialUiWidth - padding, height: alertHeight }); + this.alertBox.css({ position: "absolute", left: padding * 2 + advPathWidth, top: height - (padding * 2) - alertHeight - chatHeight, width: specialUiWidth - padding, height: alertHeight }); + for (var playerId in this.discardPileGroups) if (this.discardPileGroups.hasOwnProperty(playerId)) @@ -553,9 +566,9 @@ var GempLotrGameUI = Class.extend({ else if (zone == "DISCARD") $("#discard" + this.getPlayerIndex(playerId)).text("Discard: " + count); else if (zone == "DEAD") - $("#deadPile" + this.getPlayerIndex(playerId)).text("Dead pile: " + count); - else if (zone == "DECK") - $("#deck" + this.getPlayerIndex(playerId)).text("Deck: " + count); + $("#deadPile" + this.getPlayerIndex(playerId)).text("Dead pile: " + count); + else if (zone == "DECK") + $("#deck" + this.getPlayerIndex(playerId)).text("Deck: " + count); }, playerPosition: function(element) { @@ -709,7 +722,7 @@ var GempLotrGameUI = Class.extend({ if (index != -1) cardData.attachedCards.splice(index, 1); } - ); + ); var card = $(".card:cardId(" + cardId + ")"); var cardData = card.data("card"); @@ -830,7 +843,7 @@ var GempLotrGameUI = Class.extend({ if (index != -1) cardData.attachedCards.splice(index, 1); } - ); + ); } card.remove(); @@ -902,13 +915,13 @@ var GempLotrGameUI = Class.extend({ this.smallDialog .html(text + "