javaquery/demo-calculator/src/main/resources/org/apidesign/bck2brwsr/mavenhtml/Calculator.xhtml
author Jaroslav Tulach <jtulach@netbeans.org>
Thu, 22 Nov 2012 00:18:34 +0100
changeset 197 e7bb314eec32
parent 142 74c37d9cfdc9
child 198 5c1604c5ca9a
permissions -rw-r--r--
Less verbose. Concentrating all operations into single method. Using string switch to determine what operation to run.
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <!--
     3 
     4     Back 2 Browser Bytecode Translator
     5     Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
     6 
     7     This program is free software: you can redistribute it and/or modify
     8     it under the terms of the GNU General Public License as published by
     9     the Free Software Foundation, version 2 of the License.
    10 
    11     This program is distributed in the hope that it will be useful,
    12     but WITHOUT ANY WARRANTY; without even the implied warranty of
    13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14     GNU General Public License for more details.
    15 
    16     You should have received a copy of the GNU General Public License
    17     along with this program. Look for COPYING file in the top folder.
    18     If not, see http://opensource.org/licenses/GPL-2.0.
    19 
    20 -->
    21 <!DOCTYPE html>
    22 <html xmlns="http://www.w3.org/1999/xhtml">
    23     <head>
    24         <title>Simple Calculator in HTML5 and Java</title>
    25 
    26         <style type="text/css">
    27         body {color: #ffffff; background-color: #121e31; font-family: Monospaced}
    28         pre {color: #ffffff; background-color: #121e31; font-family: Monospaced}
    29         table {color: #ffffff; background-color: #121e31; font-family: Monospaced}
    30         .string {color: #e2ce00}
    31         .ST1 {color: #0000cc; font-family: Monospaced; font-weight: bold}
    32         .ST0 {color: #0000ff}
    33         .comment {color: #428bdd}
    34         .keyword-directive {color: #f8bb00}
    35         .tag {color: #f8bb00}
    36         .ST0 {color: #628fb5; background-color: #1b3450}
    37         .sgml-comment {color: #808080}
    38         .value {color: #99006b}
    39         .argument {color: #007c00}
    40         .sgml-declaration {color: #bf9221}
    41         </style>    
    42         </head>
    43     <body>
    44         <h1>Java &amp; HTML5</h1>
    45         <table border="0" cellspacing="2">
    46             <tbody>
    47                 <tr>
    48                     <td colspan="4"><input id="display" value="0" 
    49                             style="text-align: right"/>
    50                 </td>
    51                 </tr>
    52                 <tr>
    53                     <td><button id="n1">1</button></td>
    54                     <td><button id="n2">2</button></td>
    55                     <td><button id="n3">3</button></td>
    56                     <td><button id="plus">+</button></td>
    57                 </tr>
    58                 <tr>
    59                     <td><button id="n4">4</button></td>
    60                     <td><button id="n5">5</button></td>
    61                     <td><button id="n6">6</button></td>
    62                     <td><button id="minus">-</button></td>
    63                 </tr>
    64                 <tr>
    65                     <td><button id="n7">7</button></td>
    66                     <td><button id="n8">8</button></td>
    67                     <td><button id="n9">9</button></td>
    68                     <td><button id="mul">*</button></td>
    69                 </tr>
    70                 <tr>
    71                     <td><button id="clear">C</button></td>
    72                     <td><button id="n0">0</button></td>
    73                     <td><button id="result">=</button></td>
    74                     <td><button id="div">/</button></td>
    75                 </tr>
    76             </tbody>
    77         </table>
    78 
    79         <script src="bootjava.js"/>
    80         
    81         <hr/>
    82         <p>
    83         More information at the <a href="http://wiki.apidesign.org/wiki/Bck2Brwsr">
    84             Bck2Brwsr
    85         </a> project page.
    86         </p>
    87     </body>
    88 </html>