1.1 --- a/chess/src/main/webapp/pages/index.html Tue Sep 24 22:20:24 2013 +0200
1.2 +++ b/chess/src/main/webapp/pages/index.html Tue Sep 24 23:52:32 2013 +0200
1.3 @@ -47,7 +47,7 @@
1.4 <body>
1.5 <div class="navbar">
1.6 <div class="navbar-inner">
1.7 - <a id="apptitle" class="brand" data-bind="css: { active: settingsActive }, click: activateSettings" href="#">JavaOne Chess</a>
1.8 + <a id="apptitle" class="brand" data-bind="css: { active: viewGamesActive }, click: activateSettings" href="#">JavaOne Chess</a>
1.9 <ul class="nav" data-bind="foreach: boards">
1.10 <li data-bind="css: { active: active }, click: $root.activateGame">
1.11 <span data-bind="visible: myTurn" class="badge badge-warning myturn">↪</span>
1.12 @@ -57,8 +57,7 @@
1.13 </ul>
1.14 </div>
1.15 </div>
1.16 - <div data-bind="template: { name: 'render-games', data: viewGames }"></div>
1.17 - <div data-bind="template: { name: 'render-settings', data: settings, if : settingsActive }"></div>
1.18 + <div data-bind="template: { name: 'render-games', data: viewGames, ifnot: selectedBoard }"></div>
1.19 <div data-bind="template: { name: 'render-board', data: selectedBoard, if : selectedBoard }"></div>
1.20
1.21 <script type="text/html" id="render-board">
1.22 @@ -119,29 +118,34 @@
1.23 </div>
1.24 </script>
1.25
1.26 - <script type="text/html" id="render-settings">
1.27 + <script type="text/html" id="render-games">
1.28 <div class="container-fluid">
1.29 - <h3>Connection Settings</h3>
1.30 - <p>
1.31 - Status: <span data-bind="text: $root.status"></span>
1.32 - </p>
1.33 - <p>
1.34 - Name:
1.35 - <input type="text" data-bind="value: username, enable: $root.disconnected, valueUpdate: 'afterkeydown'"
1.36 - class="input-small" placeholder="Name"></input>
1.37 - Password:
1.38 - <input type="password" data-bind="value: password, enable: $root.disconnected, valueUpdate: 'afterkeydown'"
1.39 - class="input-small" placeholder="Password"></input>
1.40 - </p>
1.41 - <br/>
1.42 - <p>
1.43 - Chess server URL:
1.44 - <input data-bind="value: url, enable: $root.disconnected" class="inpu-xlarge"></input>
1.45 - </p>
1.46 - <p>
1.47 - <button data-bind="click: $root.reconnect, enable: ($root.disconnected() && validCredentials()) ">Connect</button>
1.48 - <button data-bind="click: $root.disconnect, enable: $root.connected">Disconnect</button>
1.49 - </p>
1.50 + <div data-bind="visible: $root.viewGamesActive">
1.51 + <h3>List of Games</h3>
1.52 + <p>
1.53 + Status: <span data-bind="text: $root.status"></span>
1.54 + </p>
1.55 + <div class="input-append" class="select">
1.56 + <input type="text" data-bind="value: whitePlayer, valueUpdate: 'afterkeydown'"
1.57 + class="input-small" placeholder="White Player"></input>
1.58 + vs.
1.59 + <input type="text" data-bind="value: blackPlayer, valueUpdate: 'afterkeydown'"
1.60 + class="input-small" placeholder="Black Player"></input>
1.61 + </div>
1.62 + <br/>
1.63 + <button data-bind="click: $root.createGame, enable: correctNames"
1.64 + class="btn btn-success" >Create Game!</button>
1.65 + <br/>
1.66 + <div data-bind="foreach: $root.boards">
1.67 + <div class="input-append">
1.68 + <input type="text" data-bind="value: status" disabled></input>
1.69 + <button class="btn" data-bind="click: $root.joinGame">
1.70 + Show
1.71 + </button>
1.72 + </div>
1.73 + <br/>
1.74 + </div>
1.75 + </div>
1.76 </div>
1.77 <div id="chesscube">
1.78 <div id="spinner">
1.79 @@ -154,49 +158,6 @@
1.80 </div>
1.81 </div>
1.82 </script>
1.83 -
1.84 - <script type="text/html" id="render-games">
1.85 - <div class="container-fluid">
1.86 - <div data-bind="visible: $root.viewGamesActive ">
1.87 - <h3>List of Games</h3>
1.88 - <p>
1.89 - <a href="#" data-bind="click: $root.refreshGames">Refresh</a>
1.90 - </p>
1.91 - <!-- ko if: anyOwnGame -->
1.92 - <h5>Own Games</h5>
1.93 - <div data-bind="foreach: own">
1.94 - <div class="input-append">
1.95 - <input type="text" data-bind="value: description" disabled></input>
1.96 - <button class="btn" data-bind="click: $root.joinGame">
1.97 - <span data-bind="ifnot: pendingPlayer">Show</span>
1.98 - <span data-bind="if: pendingPlayer">Challenge Yourself</span>
1.99 - </button>
1.100 - </div>
1.101 - <br/>
1.102 - </div>
1.103 - <!-- /ko -->
1.104 - <h5>Other Games</h5>
1.105 - <div data-bind="foreach: other">
1.106 - <div class="input-append">
1.107 - <input type="text" data-bind="value: description" disabled></input>
1.108 - <!-- ko if: open -->
1.109 - <button class="btn btn-success" data-bind="click: $root.joinGame">Join</button>
1.110 - <!-- /ko -->
1.111 - <button class="btn" data-bind="click: $root.observeGame">Observe</button>
1.112 - </div>
1.113 - <br/>
1.114 - </div>
1.115 - <h3>New game</h3>
1.116 - <div class="input-append" class="select">
1.117 - <select data-bind="value: selectedColor">
1.118 - <option value="W">White</option>
1.119 - <option value="B">Black</option>
1.120 - </select>
1.121 - <button data-bind="click: $root.createGame" class="btn btn-success" >Create Game!</button>
1.122 - </div>
1.123 - </div>
1.124 - </div>
1.125 - </script>
1.126 <center data-bind="visible: false">
1.127 <img src="DukeHTML.png" width="320" height="200" alt="Loading...">
1.128 <h3>Initializing the virtual machine...</h3>
1.129 @@ -204,7 +165,7 @@
1.130 <script type="text/javascript" src="bck2brwsr.js"></script>
1.131 <script>
1.132 var vm = bck2brwsr('${project.build.finalName}.jar');
1.133 - vm.loadClass('com.oracle.chess.client.htmljava.LoadMain');
1.134 + vm.loadClass('org.apidesign.html.demo.chess.LoadMain');
1.135 </script>
1.136 </body>
1.137 </html>