author | Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
Tue, 24 Feb 2015 11:12:53 +0100 | |
changeset 1787 | ea12a3bb4b33 |
parent 1609 | 752f48257d4a |
child 1852 | 805b62b77f91 |
permissions | -rw-r--r-- |
jaroslav@141 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
jaroslav@141 | 2 |
<!-- |
jaroslav@142 | 3 |
|
jaroslav@142 | 4 |
Back 2 Browser Bytecode Translator |
jaroslav@1787 | 5 |
Copyright (C) 2012-2015 Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
jaroslav@142 | 6 |
|
jaroslav@142 | 7 |
This program is free software: you can redistribute it and/or modify |
jaroslav@142 | 8 |
it under the terms of the GNU General Public License as published by |
jaroslav@142 | 9 |
the Free Software Foundation, version 2 of the License. |
jaroslav@142 | 10 |
|
jaroslav@142 | 11 |
This program is distributed in the hope that it will be useful, |
jaroslav@142 | 12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
jaroslav@142 | 13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
jaroslav@142 | 14 |
GNU General Public License for more details. |
jaroslav@142 | 15 |
|
jaroslav@142 | 16 |
You should have received a copy of the GNU General Public License |
jaroslav@142 | 17 |
along with this program. Look for COPYING file in the top folder. |
jaroslav@142 | 18 |
If not, see http://opensource.org/licenses/GPL-2.0. |
jaroslav@142 | 19 |
|
jaroslav@141 | 20 |
--> |
jaroslav@141 | 21 |
<!DOCTYPE html> |
jaroslav@141 | 22 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
jaroslav@141 | 23 |
<head> |
jaroslav@141 | 24 |
<title>Simple Calculator in HTML5 and Java</title> |
jtulach@197 | 25 |
|
jtulach@197 | 26 |
<style type="text/css"> |
jtulach@197 | 27 |
body {color: #ffffff; background-color: #121e31; font-family: Monospaced} |
jtulach@197 | 28 |
pre {color: #ffffff; background-color: #121e31; font-family: Monospaced} |
jtulach@197 | 29 |
table {color: #ffffff; background-color: #121e31; font-family: Monospaced} |
jtulach@197 | 30 |
.string {color: #e2ce00} |
jaroslav@198 | 31 |
a {color: #e2ce00} |
jtulach@197 | 32 |
.ST1 {color: #0000cc; font-family: Monospaced; font-weight: bold} |
jtulach@197 | 33 |
.ST0 {color: #0000ff} |
jtulach@197 | 34 |
.comment {color: #428bdd} |
jtulach@197 | 35 |
.keyword-directive {color: #f8bb00} |
jtulach@197 | 36 |
.tag {color: #f8bb00} |
jtulach@197 | 37 |
.ST0 {color: #628fb5; background-color: #1b3450} |
jtulach@197 | 38 |
.sgml-comment {color: #808080} |
jtulach@197 | 39 |
.value {color: #99006b} |
jtulach@197 | 40 |
.argument {color: #007c00} |
jtulach@197 | 41 |
.sgml-declaration {color: #bf9221} |
jtulach@197 | 42 |
</style> |
jtulach@197 | 43 |
</head> |
jaroslav@141 | 44 |
<body> |
jaroslav@198 | 45 |
<h1>Java and HTML5 - Together at Last!</h1> |
jaroslav@141 | 46 |
<table border="0" cellspacing="2"> |
jaroslav@141 | 47 |
<tbody> |
jaroslav@141 | 48 |
<tr> |
jaroslav@492 | 49 |
<td colspan="4"><input data-bind="value: display" value="0" |
jtulach@197 | 50 |
style="text-align: right"/> |
jtulach@197 | 51 |
</td> |
jaroslav@141 | 52 |
</tr> |
jaroslav@141 | 53 |
<tr> |
jaroslav@141 | 54 |
<td><button id="n1">1</button></td> |
jaroslav@141 | 55 |
<td><button id="n2">2</button></td> |
jaroslav@141 | 56 |
<td><button id="n3">3</button></td> |
jaroslav@141 | 57 |
<td><button id="plus">+</button></td> |
jaroslav@141 | 58 |
</tr> |
jaroslav@141 | 59 |
<tr> |
jaroslav@141 | 60 |
<td><button id="n4">4</button></td> |
jaroslav@141 | 61 |
<td><button id="n5">5</button></td> |
jaroslav@141 | 62 |
<td><button id="n6">6</button></td> |
jaroslav@141 | 63 |
<td><button id="minus">-</button></td> |
jaroslav@141 | 64 |
</tr> |
jaroslav@141 | 65 |
<tr> |
jaroslav@141 | 66 |
<td><button id="n7">7</button></td> |
jaroslav@141 | 67 |
<td><button id="n8">8</button></td> |
jaroslav@141 | 68 |
<td><button id="n9">9</button></td> |
jaroslav@141 | 69 |
<td><button id="mul">*</button></td> |
jaroslav@141 | 70 |
</tr> |
jaroslav@141 | 71 |
<tr> |
jaroslav@141 | 72 |
<td><button id="clear">C</button></td> |
jaroslav@141 | 73 |
<td><button id="n0">0</button></td> |
jaroslav@141 | 74 |
<td><button id="result">=</button></td> |
jaroslav@141 | 75 |
<td><button id="div">/</button></td> |
jaroslav@141 | 76 |
</tr> |
jaroslav@141 | 77 |
</tbody> |
jaroslav@141 | 78 |
</table> |
jaroslav@877 | 79 |
|
jaroslav@877 | 80 |
<h4>Previous Results</h4> |
jaroslav@877 | 81 |
|
jaroslav@879 | 82 |
<div data-bind="if: emptyHistory">No results yet.</div> |
jaroslav@877 | 83 |
<ul data-bind="foreach: history"> |
jaroslav@879 | 84 |
<li> |
jaroslav@901 | 85 |
<span data-bind="text: $data"></span> - |
jaroslav@879 | 86 |
<a href="#" data-bind="click: $root.recoverMemory">Use</a> |
jaroslav@879 | 87 |
<a href="#" data-bind="click: $root.removeMemory">Remove</a> |
jaroslav@879 | 88 |
</li> |
jaroslav@877 | 89 |
</ul> |
jaroslav@877 | 90 |
|
jaroslav@516 | 91 |
<div data-bind="text: displayPreview"></div> |
jaroslav@901 | 92 |
<script src="bck2brwsr.js"></script> |
jaroslav@674 | 93 |
<script> |
jaroslav@1604 | 94 |
var vm = bck2brwsr('calculator.js'); |
jaroslav@1609 | 95 |
var c = vm.loadClass('org.apidesign.bck2brwsr.demo.calc.staticcompilation.Calc'); |
jaroslav@1609 | 96 |
c.invoke('main'); |
jaroslav@674 | 97 |
</script> |
jaroslav@141 | 98 |
</body> |
jaroslav@141 | 99 |
</html> |