chess/src/main/web/pages/index.html
author Jaroslav Tulach <jtulach@netbeans.org>
Thu, 25 Jul 2013 15:57:52 +0200
branchchess
changeset 23 827f30fbdeab
parent 22 fb06534ab8db
permissions -rw-r--r--
Rendering the board with knockout
     1 <!--
     2 
     3     The MIT License (MIT)
     4 
     5     Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
     6 
     7     Permission is hereby granted, free of charge, to any person obtaining a copy
     8     of this software and associated documentation files (the "Software"), to deal
     9     in the Software without restriction, including without limitation the rights
    10     to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    11     copies of the Software, and to permit persons to whom the Software is
    12     furnished to do so, subject to the following conditions:
    13 
    14     The above copyright notice and this permission notice shall be included in
    15     all copies or substantial portions of the Software.
    16 
    17     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    18     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    19     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    20     AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    21     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    22     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    23     THE SOFTWARE.
    24 
    25 -->
    26 <!DOCTYPE html>
    27 <html lang="en">
    28 <head>
    29 	<meta charset="utf-8">
    30 	<title>Chess Client</title>
    31 	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    32 	<meta name="description" content="">
    33 	<meta name="author" content="">
    34 
    35 	<!-- Le styles -->
    36 	<link href="./css/bootstrap.css" rel="stylesheet">
    37 	<link href="./css/bootstrap-responsive.css" rel="stylesheet">
    38 	<link href="./css/chess.css" rel="stylesheet">
    39 	<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    40 	<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    41 	<script>
    42 		$(function() {
    43 			$( ".figure" ).draggable({grid:[76,77]});			
    44 		});
    45 	</script>
    46 </head>
    47 <body>
    48 	<div class="navbar">
    49 		<div class="navbar-inner">
    50 			<a class="brand" href="#">Chess Game</a>
    51 			<ul class="nav">
    52 				<li class="active"><a href="#">My Game</a></li>
    53 				<li><a href="#">New game</a></li>
    54 				<li><a href="#">View games</a></li>
    55 				<li><a href="#">Blah..</a></li>
    56 			</ul>
    57 			<form class="navbar-search pull-right">
    58 				<input type="text" class="search-query" placeholder="Search">
    59 			</form>
    60 		</div>
    61 	</div>
    62 	<div class="container-fluid">
    63 		<div class="row-fluid">
    64 			<div class="span9">
    65 				<h1>My game</h1>
    66 				<table class="board">
    67                     <tbody data-bind="foreach: rows">
    68                         <tr >
    69                             <!-- ko foreach: columns -->
    70                             <td data-bind="click: changeToPawn, css: squareColor" >
    71                                 <span data-bind='html: pieceEntity'></span>
    72                             </td>
    73                             <!-- /ko -->
    74                         </tr>
    75                     </tbody>
    76 				</table>
    77 			</div>
    78 			<div class="span2 offset1">
    79 				<h2>Game Log</h2>
    80 				<div class="log">
    81 					<table class="table table-striped log-table">
    82 						<thead>
    83 							<tr>
    84 								<th>#</th>
    85 								<th>Move</th>
    86 							</tr>
    87 						</thead>
    88 						<tbody>
    89 							<tr>
    90 								<td>10</td>
    91 								<td>Move</td>
    92 							</tr>
    93 							<tr>
    94 								<td>9</td>
    95 								<td>Move</td>
    96 							</tr>
    97 							<tr>
    98 								<td>8</td>
    99 								<td>Move</td>
   100 							</tr>
   101 							<tr>
   102 								<td>7</td>
   103 								<td>Move</td>
   104 							</tr>
   105 							<tr>
   106 								<td>6</td>
   107 								<td>Move</td>
   108 							</tr>
   109 							<tr>
   110 								<td>5</td>
   111 								<td>Move</td>
   112 							</tr>
   113 							<tr>
   114 								<td>4</td>
   115 								<td>Move</td>
   116 							</tr>
   117 							<tr>
   118 								<td>3</td>
   119 								<td>Move</td>
   120 							</tr>
   121 							<tr>
   122 								<td>2</td>
   123 								<td>Move</td>
   124 							</tr>
   125 							<tr>
   126 								<td>1</td>
   127 								<td>Move</td>
   128 							</tr>
   129 						</tbody>
   130 					</table>
   131 				</div>
   132 			</div>
   133 		</div>
   134 	</div>
   135 </body>
   136 </html>