jtulach@63
|
1 |
<!--
|
jtulach@63
|
2 |
|
jtulach@63
|
3 |
The MIT License (MIT)
|
jtulach@63
|
4 |
|
jtulach@63
|
5 |
Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
|
jtulach@63
|
6 |
|
jtulach@63
|
7 |
Permission is hereby granted, free of charge, to any person obtaining a copy
|
jtulach@63
|
8 |
of this software and associated documentation files (the "Software"), to deal
|
jtulach@63
|
9 |
in the Software without restriction, including without limitation the rights
|
jtulach@63
|
10 |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
jtulach@63
|
11 |
copies of the Software, and to permit persons to whom the Software is
|
jtulach@63
|
12 |
furnished to do so, subject to the following conditions:
|
jtulach@63
|
13 |
|
jtulach@63
|
14 |
The above copyright notice and this permission notice shall be included in
|
jtulach@63
|
15 |
all copies or substantial portions of the Software.
|
jtulach@63
|
16 |
|
jtulach@63
|
17 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
jtulach@63
|
18 |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
jtulach@63
|
19 |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
jtulach@63
|
20 |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
jtulach@63
|
21 |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
jtulach@63
|
22 |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
jtulach@63
|
23 |
THE SOFTWARE.
|
jtulach@63
|
24 |
|
jtulach@63
|
25 |
-->
|
jtulach@63
|
26 |
<!DOCTYPE html>
|
jtulach@63
|
27 |
<html>
|
jtulach@63
|
28 |
<head>
|
jaroslav@202
|
29 |
<title>Férové miny</title>
|
jtulach@63
|
30 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
jaroslav@228
|
31 |
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"/>
|
jtulach@63
|
32 |
<link href="bootstrap.css" rel="stylesheet">
|
jtulach@63
|
33 |
<link href="bootstrap-responsive.css" rel="stylesheet">
|
jtulach@63
|
34 |
<link href="mines.css" rel="stylesheet">
|
jtulach@71
|
35 |
<!-- Target tablets -->
|
jtulach@73
|
36 |
<link href="mines-tablet-large.css"
|
jaroslav@139
|
37 |
media="(min-width:640px), (min-height:660px)"
|
jtulach@73
|
38 |
rel="stylesheet" />
|
jtulach@73
|
39 |
<link href="mines-tablet-small.css"
|
jtulach@80
|
40 |
media="(min-width:510px) and (max-width:640px), (min-height:520px) and (max-height:660px)"
|
jtulach@73
|
41 |
rel="stylesheet" />
|
jtulach@71
|
42 |
<!-- Target phones -->
|
jtulach@73
|
43 |
<link href="mines-phone-large.css"
|
jtulach@80
|
44 |
media="(min-width:410px) and (max-width:510px), (min-height:400px) and (max-height:520px)"
|
jtulach@73
|
45 |
rel="stylesheet" />
|
jtulach@73
|
46 |
<link href="mines-phone-small.css"
|
jtulach@180
|
47 |
media="(min-width:300px) and (max-width:410px), (min-height:300px) and (max-height:400px)"
|
jtulach@80
|
48 |
rel="stylesheet" />
|
jtulach@80
|
49 |
<link href="mines-phone-smaller.css"
|
jtulach@180
|
50 |
media="(max-width:300px), (max-height:300px)"
|
jtulach@73
|
51 |
rel="stylesheet" />
|
jtulach@63
|
52 |
</head>
|
jtulach@63
|
53 |
<body>
|
jtulach@70
|
54 |
<div class="navbar">
|
jtulach@70
|
55 |
<div class="navbar-inner">
|
jaroslav@175
|
56 |
<a id="apptitle" class="brand" href="#" data-bind="click: showHelp">
|
jaroslav@175
|
57 |
<img height="20" width="20" src="DukeSweeper.png">
|
jaroslav@202
|
58 |
<span class="hidden-phone">Miny</span>
|
jaroslav@175
|
59 |
</a>
|
jtulach@80
|
60 |
<button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: false, click: normalGame">
|
jtulach@80
|
61 |
<span>↻</span>
|
jaroslav@202
|
62 |
<span class="info-text">Hra</span>
|
jtulach@80
|
63 |
</button>
|
jaroslav@200
|
64 |
<button class="hidden-phone btn btn-default navbar-btn" disabled="true" data-bind="disable: !gameInProgress(), click: giveUp ">
|
jtulach@80
|
65 |
<span>✗</span>
|
jaroslav@202
|
66 |
<span>Vzdát</span>
|
jtulach@80
|
67 |
</button>
|
jaroslav@176
|
68 |
<button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: !gameInProgress(), click: markMine">
|
jaroslav@164
|
69 |
<span>⚠</span>
|
jaroslav@202
|
70 |
<span class="info-text">Označkovat</span>
|
jaroslav@164
|
71 |
</button>
|
jtulach@70
|
72 |
</div>
|
jtulach@70
|
73 |
</div>
|
jaroslav@163
|
74 |
|
jtulach@63
|
75 |
|
jtulach@76
|
76 |
<script type="text/html" id="field">
|
jaroslav@139
|
77 |
<center>
|
jaroslav@166
|
78 |
<table class="field" data-bind="css: gameStyle">
|
jtulach@76
|
79 |
<tbody>
|
jtulach@76
|
80 |
<!-- ko foreach: rows -->
|
jtulach@76
|
81 |
<tr>
|
jtulach@76
|
82 |
<!-- ko foreach: columns -->
|
jtulach@76
|
83 |
<td data-bind="css: style, click: $parents[1].click" >
|
jaroslav@163
|
84 |
<div></div>
|
jtulach@76
|
85 |
</td>
|
jtulach@76
|
86 |
<!-- /ko -->
|
jtulach@76
|
87 |
</tr>
|
jtulach@63
|
88 |
<!-- /ko -->
|
jtulach@76
|
89 |
</tbody>
|
jtulach@76
|
90 |
</table>
|
jaroslav@139
|
91 |
</center>
|
jtulach@76
|
92 |
</script>
|
jtulach@78
|
93 |
|
jtulach@78
|
94 |
<div data-bind="template: { name : 'field', if: fieldShowing }"></div>
|
jtulach@63
|
95 |
|
jtulach@77
|
96 |
<div class="jumbotron control-label" data-bind="visible: !fieldShowing() ">
|
jtulach@77
|
97 |
<div class="container">
|
jaroslav@202
|
98 |
<h1>Ukázka HTML/Java technologie</h1>
|
jtulach@77
|
99 |
|
jaroslav@202
|
100 |
<p>Na první pohled se jedná o staré dobré <em>miny</em>.
|
jaroslav@202
|
101 |
Bližší pohled však odhalí revoluční technologii, jež
|
jaroslav@202
|
102 |
umožňuje programovat logiku aplikace v <strong>Javě</strong>
|
jaroslav@202
|
103 |
a uživatelské rozhraní definovat v <strong>HTML</strong>.
|
jaroslav@202
|
104 |
To vše na jakémkoli zařízení schopném zobrazit moderní
|
jaroslav@202
|
105 |
<strong>HTML5</strong> prohlížeč.
|
jtulach@77
|
106 |
</p>
|
jtulach@77
|
107 |
<p><a class="btn btn-primary btn-lg" role="button"
|
jtulach@78
|
108 |
target="_blank" href="http://html.java.net"
|
jaroslav@202
|
109 |
>Navštívit stránky projektu</a>
|
jtulach@77
|
110 |
</p>
|
jtulach@77
|
111 |
</div>
|
jtulach@77
|
112 |
</div>
|
jtulach@78
|
113 |
|
jtulach@78
|
114 |
<div class="container" data-bind="visible: !fieldShowing()">
|
jaroslav@186
|
115 |
<div>
|
jtulach@78
|
116 |
<div class="col-md-4">
|
jaroslav@202
|
117 |
<h2>Miny</h2>
|
jtulach@78
|
118 |
<p>
|
jaroslav@202
|
119 |
Odhalte deset políček jež skrývají miny
|
jaroslav@202
|
120 |
a označte je znakem ⚠.
|
jaroslav@202
|
121 |
Dotykem políčka se zjistí,
|
jaroslav@202
|
122 |
zda-li je na něm mina či kolik min se
|
jaroslav@202
|
123 |
nachází v sousedních osmi políčkách.
|
jaroslav@202
|
124 |
Nespoléhejte na náhodu,
|
jaroslav@202
|
125 |
tato verze min dokáže detekovat
|
jaroslav@202
|
126 |
náhodné hádání a v takovém případě přerovnat miny.
|
jaroslav@202
|
127 |
Tato hra je <b>fér</b>!
|
jtulach@78
|
128 |
</p>
|
jaroslav@202
|
129 |
<p><a class="btn btn-default" href="#" data-bind="click: normalGame"role="button">Hrát »</a></p>
|
jtulach@78
|
130 |
</div>
|
jtulach@78
|
131 |
<div class="col-md-4">
|
jaroslav@202
|
132 |
<h2>Dokumentace</h2>
|
jtulach@78
|
133 |
<p>
|
jaroslav@202
|
134 |
Chcete-li psát aplikace jako je tato
|
jaroslav@202
|
135 |
(tedy používat <strong>Javu</strong> a <strong>HTML</strong>)
|
jaroslav@202
|
136 |
můžete se nyní dozvědět něco o knihovnách, které
|
jaroslav@202
|
137 |
to umožňují. Následující odkaz Vás zavede
|
jaroslav@202
|
138 |
stránky s dokumentací.
|
jtulach@78
|
139 |
</p>
|
jtulach@78
|
140 |
<p><a class="btn btn-default"
|
jaroslav@135
|
141 |
target="_blank" href="http://bits.netbeans.org/html+java/"
|
jaroslav@202
|
142 |
role="button">Více »</a></p>
|
jtulach@78
|
143 |
</div>
|
jtulach@78
|
144 |
<div class="col-md-4">
|
jaroslav@202
|
145 |
<h2>Verze pro prohlížeč</h2>
|
jtulach@78
|
146 |
<p>
|
jaroslav@202
|
147 |
Tato technologie je primárně určena pro
|
jaroslav@202
|
148 |
klasické osobní počítače či pro tablety a telefony.
|
jaroslav@202
|
149 |
Přesto je však možné spustit tu samou aplikaci
|
jaroslav@202
|
150 |
s nezměným kódem v prohlížeči. Je k tomu potřeba
|
jaroslav@202
|
151 |
implementace <b>Java</b> virtuálního stroje zvaná
|
jaroslav@202
|
152 |
<a href="http://bck2brwsr.apidesign.org">bck2brwsr</a>.
|
jtulach@78
|
153 |
</p>
|
jtulach@78
|
154 |
<p><a class="btn btn-default"
|
jtulach@182
|
155 |
target="_blank" href="http://xelfi.cz/minesweeper/bck2brwsr/"
|
jaroslav@202
|
156 |
role="button">Vyzkoušet »</a></p>
|
jtulach@78
|
157 |
</div>
|
jtulach@93
|
158 |
</div>
|
jtulach@78
|
159 |
</div>
|
jaroslav@186
|
160 |
<div class="container" data-bind="visible: !fieldShowing()">
|
jtulach@183
|
161 |
<div class="col-sm-6 col-md-4">
|
jtulach@183
|
162 |
<div class="thumbnail">
|
jtulach@183
|
163 |
<img src="android_logo.jpg" width="120" height="120" alt="Android">
|
jtulach@183
|
164 |
<div class="caption">
|
jtulach@183
|
165 |
<h3>DlvkBrwsr</h3>
|
jtulach@183
|
166 |
<p>
|
jaroslav@202
|
167 |
Tato apliace byla přeložena pro Váš telefon se systémem Android
|
jaroslav@202
|
168 |
a je dostupná na Google Play! tržišti. V této konfiguraci
|
jaroslav@202
|
169 |
se používá virtuální stroj Dalvik pro spouštění <b>Java</b> kódu
|
jaroslav@202
|
170 |
a Androidí WebView k zobrazení uživatelského rozhraní a
|
jaroslav@202
|
171 |
interpretaci generovaného JavaScriptu. Tyto komponenty jsou
|
jaroslav@202
|
172 |
spojeny dohromady pomocí <a href="http://wiki.apidesign.org/wiki/DlvkBrwsr">
|
jaroslav@202
|
173 |
DlvkBrwsr</a> technologie.
|
jtulach@183
|
174 |
</p>
|
jtulach@183
|
175 |
<p>
|
jtulach@183
|
176 |
<a href="https://play.google.com/store/apps/details?id=org.apidesign.demo.minesweeper"
|
jtulach@183
|
177 |
target="_blank"
|
jtulach@183
|
178 |
class="btn btn-primary" role="button"
|
jaroslav@202
|
179 |
>Instalovat »</a>
|
jtulach@183
|
180 |
</p>
|
jtulach@183
|
181 |
</div>
|
jtulach@183
|
182 |
</div>
|
jtulach@183
|
183 |
</div>
|
jtulach@183
|
184 |
<div class="col-sm-6 col-md-4">
|
jtulach@183
|
185 |
<div class="thumbnail">
|
jtulach@183
|
186 |
<img src="ios_logo.jpg" width="120" height="120" alt="Android">
|
jtulach@183
|
187 |
<div class="caption">
|
jtulach@183
|
188 |
<h3>iBrwsr</h3>
|
jtulach@183
|
189 |
<p>
|
jaroslav@202
|
190 |
Tato aplikace byla přeložena a zabalena tak, aby běžela na
|
jaroslav@202
|
191 |
Vašem iPhonu
|
jaroslav@202
|
192 |
nebo iPadu a je dostupná na tržišti AppStore.
|
jaroslav@202
|
193 |
V této konfiguraci se používá
|
jaroslav@202
|
194 |
virtuální stroj <a target="_blank" href="http://www.robovm.org">RoboVM</a>
|
jaroslav@202
|
195 |
pro přeložení <b>Java</b> kódu do nativního formátu.
|
jaroslav@202
|
196 |
Pro zobrazení a provádění vygenerovaného JavaScriptu
|
jaroslav@202
|
197 |
se využívá iOS WebView. Obě tyto komponenty jsou spojeny
|
jaroslav@202
|
198 |
pomocí <a target="_blank"
|
jtulach@183
|
199 |
href="http://wiki.apidesign.org/wiki/IBrwsr">
|
jaroslav@202
|
200 |
iBrwsr</a> knihovny.
|
jtulach@183
|
201 |
</p>
|
jtulach@183
|
202 |
<p>
|
jaroslav@202
|
203 |
<a href="https://itunes.apple.com/us/app/fair-minesweeper/id903688146"
|
jtulach@183
|
204 |
target="_blank"
|
jtulach@183
|
205 |
class="btn btn-primary" role="button"
|
jaroslav@202
|
206 |
>Instalovat »</a>
|
jtulach@183
|
207 |
</p>
|
jtulach@183
|
208 |
</div>
|
jtulach@183
|
209 |
</div>
|
jtulach@183
|
210 |
</div>
|
jtulach@183
|
211 |
<div class="col-sm-6 col-md-4">
|
jtulach@183
|
212 |
<div class="thumbnail">
|
jtulach@183
|
213 |
<img src="netbeans_logo.jpg" width="120" height="120" alt="Android">
|
jtulach@183
|
214 |
<div class="caption">
|
jaroslav@202
|
215 |
<h3>Vyvíjejte své aplikace!</h3>
|
jtulach@183
|
216 |
<p>
|
jaroslav@216
|
217 |
Tuto aplikaci lze zabalit jako
|
jtulach@183
|
218 |
<a href="http://plugins.netbeans.org/plugin/53864/"
|
jtulach@183
|
219 |
target="_blank"
|
jaroslav@202
|
220 |
>rozšíření pro NetBeans</a> a nebo
|
jaroslav@202
|
221 |
lze použít vývojové prostředí
|
jaroslav@202
|
222 |
<a href="http://www.netbeans.org" target="_blank">
|
jaroslav@202
|
223 |
NetBeans</a> k vytvoření své vlastní aplikace,
|
jaroslav@202
|
224 |
jež bude využívat synergie
|
jaroslav@202
|
225 |
<em>HTML</em> a <em>Javy</em>.
|
jaroslav@202
|
226 |
Pište své aplikace jednou a zobrazte je na
|
jaroslav@202
|
227 |
každém zařízení schopném zobrazit <em>HTML</em>!
|
jtulach@183
|
228 |
</p>
|
jtulach@183
|
229 |
<p>
|
jtulach@183
|
230 |
<a href="http://wiki.apidesign.org/wiki/DukeScriptInNetBeans"
|
jtulach@183
|
231 |
target="_blank"
|
jtulach@183
|
232 |
class="btn btn-primary" role="button"
|
jaroslav@202
|
233 |
>Vyvíjejte »</a>
|
jtulach@183
|
234 |
</p>
|
jtulach@183
|
235 |
</div>
|
jtulach@183
|
236 |
</div>
|
jtulach@183
|
237 |
</div>
|
jtulach@183
|
238 |
</div>
|
jtulach@94
|
239 |
<!-- boot bck2brwsr -->
|
jtulach@63
|
240 |
<script type="text/javascript" src="bck2brwsr.js"></script>
|
jtulach@63
|
241 |
<script>
|
jaroslav@225
|
242 |
if (!this.hasOwnProperty("main")) {
|
jaroslav@225
|
243 |
this.main = function() {
|
jaroslav@225
|
244 |
var vm = bck2brwsr('minesweeper.js');
|
jaroslav@225
|
245 |
var c = vm.loadClass('org.apidesign.demo.minesweeper.MinesModel');
|
jaroslav@225
|
246 |
c.invoke('main');
|
jaroslav@225
|
247 |
}
|
jaroslav@225
|
248 |
}
|
jaroslav@225
|
249 |
this.main();
|
jtulach@63
|
250 |
</script>
|
jtulach@63
|
251 |
</body>
|
jtulach@63
|
252 |
</html>
|