Fixing few extra bugs.
This commit is contained in:
@@ -41,17 +41,31 @@
|
|||||||
|
|
||||||
$(document).ready(
|
$(document).ready(
|
||||||
function() {
|
function() {
|
||||||
var hall = new GempLotrHallUI($("#hall"), "/gemp-lotr/server");
|
if (getUrlParam("participantId") == null) {
|
||||||
|
$("#hall").append("Enter your assigned name and press DONE, you have to open one page for each user you want to use now.<br/>");
|
||||||
|
$("#hall").append("<input id='name' type='text'> ");
|
||||||
|
var but = $("<button>DONE</button>");
|
||||||
|
$("#hall").append(but);
|
||||||
|
but.click(
|
||||||
|
function() {
|
||||||
|
location.href = "/gemp-lotr/index.html?participantId=" + $("#name").val();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
var participantId = getUrlParam("participantId");
|
||||||
|
$("#user").append("You are logged in as <b>" + participantId + "</b>, create a table or join one where other player is waiting.");
|
||||||
|
|
||||||
var chat = new ChatBoxUI("default", $("#chat"), "/gemp-lotr/server");
|
var hall = new GempLotrHallUI($("#hall"), "/gemp-lotr/server");
|
||||||
chat.setBounds(2, 2, 780 - 4, 200 - 4);
|
|
||||||
|
var chat = new ChatBoxUI("default", $("#chat"), "/gemp-lotr/server");
|
||||||
|
chat.setBounds(2, 2, 780 - 4, 200 - 4);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div id="user" style="position:absolute;left:0px;top:0px;width:780px;height:20px;"></div>
|
||||||
<div id="hall" style="position:absolute;left:0px;top:0px;width:780px;height:300px;"></div>
|
<div id="hall" style="position:absolute;left:0px;top:20px;width:780px;height:300px;"></div>
|
||||||
<div id="chat" style="position:absolute;left:0px;top:300px;width:780px;height:200px;"></div>
|
<div id="chat" style="position:absolute;left:0px;top:320px;width:780px;height:200px;"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ var GempLotrHallUI = Class.extend({
|
|||||||
|
|
||||||
createTableDiv: function(id, status, players) {
|
createTableDiv: function(id, status, players) {
|
||||||
var tableDiv = $("<div></div>");
|
var tableDiv = $("<div></div>");
|
||||||
tableDiv.css({ display: "inline", width: "120px", height: "120px", margin: "5px", "background-color": "#333300", color: "#ffffff"});
|
tableDiv.css({ display: "inline-block", width: "120px", height: "120px", margin: "5px", "background-color": "#333300", color: "#ffffff"});
|
||||||
tableDiv.append("<i>" + status + "</i><br/>");
|
tableDiv.append("<i>" + status + "</i><br/>");
|
||||||
tableDiv.append("Players:<br/>");
|
tableDiv.append("Players:<br/>");
|
||||||
for (var i = 0; i < players.length; i++)
|
for (var i = 0; i < players.length; i++)
|
||||||
|
|||||||
Reference in New Issue
Block a user