minesweeper/src/main/webapp/pages/index.html
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 08 Feb 2014 10:07:55 +0100
branchminesweeper
changeset 76 55b2e1d3ad2b
parent 73 c56d63aee79e
child 77 b344caeda33f
permissions -rw-r--r--
Showing mine field only conditionally
     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>
    28     <head>
    29         <title></title>
    30         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    31         <link href="bootstrap.css" rel="stylesheet">
    32         <link href="bootstrap-responsive.css" rel="stylesheet">
    33         <link href="mines.css" rel="stylesheet">
    34         <!-- Target tablets -->
    35         <link href="mines-tablet-large.css" 
    36               media="(min-width:600px) and (max-width:780px), (min-height:620px) and (max-height:830px)" 
    37               rel="stylesheet" />
    38         <link href="mines-tablet-small.css" 
    39               media="(min-width:500px) and (max-width:600px), (min-height:520px) and (max-height:640px)" 
    40               rel="stylesheet" />
    41         <!-- Target phones -->
    42         <link href="mines-phone-large.css" 
    43               media="(min-width:400px) and (max-width:500px), (min-height:400px) and (max-height:520px)" 
    44               rel="stylesheet" />
    45         <link href="mines-phone-small.css" 
    46               media="(max-width:400px), (max-height:400px)" 
    47               rel="stylesheet" />
    48     </head>
    49     <body>
    50         <div class="navbar">
    51             <div class="navbar-inner">
    52                 <a id="apptitle" class="brand" href="#" data-bind="click: showHelp">Minesweeper</a>
    53                 <button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: false, click: normalGame">New Game!</button>
    54                 <button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: !fieldShowing(), click: giveUp ">Show Mines!</button>
    55             </div>
    56         </div>
    57         
    58 
    59         <script type="text/html" id="field">
    60             <table class="field">
    61                 <tbody>
    62                     <!-- ko foreach: rows -->
    63                     <tr>
    64                         <!-- ko foreach: columns -->
    65                         <td data-bind="css: style, click: $parents[1].click" >
    66                             <div data-bind='html: html'></div>
    67                         </td>
    68                         <!-- /ko -->
    69                     </tr>
    70                     <!-- /ko -->
    71                 </tbody>
    72             </table>
    73         </script>
    74         
    75         <div data-bind="template: { name : 'field', if: fieldShowing }"/>
    76         
    77         <script type="text/javascript" src="bck2brwsr.js"></script>
    78         <script>
    79             var vm = bck2brwsr('${project.build.finalName}.jar');
    80             vm.loadClass('org.apidesign.demo.minesweeper.MainBrwsr');
    81         </script>
    82         
    83     </body>
    84 </html>