-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
339 lines (289 loc) · 11 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="author" content="Jouni Kaplas" />
<title>Windows 8 + JavaScript: Does it really suck?</title>
<link rel="stylesheet" href="presentation/css/normalize.css" type="text/css">
<link rel="stylesheet" href="presentation/css/style.css" type="text/css">
<script>
window.toStaticHTML = window.toStaticHTML || function (str) { return str; };
</script>
<script src="presentation/js/jquery-1.8.2.min.js"></script>
<script src="presentation/js/jquery.scrollTo-1.4.3.1.min.js"></script>
<script src="presentation/js/jquery.easing.1.3.js"></script>
<script src="presentation/js/jquery.scrollorama.js"></script>
<script src="presentation/js/jquery.scrolldeck.js"></script>
</head>
<body>
<footer>
<h1>Windows 8 + JS: Does it really suck? <span class="not-so-important">presented on November 10th 2012 at <a href="http://treweb.net/">treweb</a></span></h1>
<h2>
<a href="http://www.kaplas.net/">Jouni Kaplas</a>
<span class="not-so-important">from</span>
<a href="http://www.futurice.com/">Futurice</a>
</h2>
</footer>
<div class="slide" id="hero">
<!-- no content, just a background image -->
</div>
<div class="slide" id="metrosexual-socks">
<!-- no content, just a background image -->
</div>
<div class="slide vcenter" id="start-menu"><!-- ID may be changed to 'windows-key' as well -->
<h2>[demo time! start menu and marco polo]</h2>
</div>
<div class="slide vcenter">
<h1>It's an IE10 without chrome</h1>
<h2 class="animate-build" data-build="1">
And FYI, it's a <span class="green-2">fabulous</span> browser
</h2>
</div>
<div class="slide vcenter crowded">
<h1>
Windows 8 is practically the first <span class="green-1">serious</span> platform, which supports JavaScript apps <span class="green-2">natively</span>.
</h1>
</div>
<div class="slide vcenter">
<h1>Special global objects</h1>
<ul>
<li>WinJS (~50 KLOC of JS)</li>
<li>Windows (platform APIs)</li>
</ul>
</div>
<div class="slide vcenter">
<h1>Constraints</h1>
<ul>
<li>From operating system (eg. max memory consumption)</li>
<li>From Windows Store quality assurance process</li>
<li>From the ugly truth that JS is not (yet) truly a first class citizen</li>
</ul>
</div>
<div class="slide" id="things-i-liked">
<!-- no content, just a background image -->
</div>
<div class="slide vcenter crowded">
<h1>
Visual Studio with on-device debugging. And the normal debugger as well.
</h1>
</div>
<div class="slide bullet-list-with-side-title">
<h1>
CSS3 support in IE10
</h1>
<ul>
<li>Regions</li>
<li>Multi-column layout</li>
<li>Flexbox</li>
<li>Transitions</li>
<li>MS-specific snap guides</li>
<li>MS-grid<ul>
<li>fdsafdas</li>
</ul></li>
</ul>
</div>
<div class="slide bullet-list-with-side-title">
<h1>
Ease of implementation
</h1>
<ul>
<li>Appbar commands</li>
<li>Live tile</li>
<li>Sharing</li>
<li>Settings panel</li>
<li>i18n</li>
</ul>
</div>
<div class="slide vcenter crowded">
<h1>
Smooth operation andquite a lightweight footprint.
</h1>
</div>
<div class="slide" id="things-i-did-not-like">
<!-- no content, just a background image -->
</div>
<div class="slide vcenter">
<h1>
APIs are usually quite cumbersome
</h1>
<blockquote><pre>internetIsAvailable: function () {
var connectionProfile =
Windows.Networking.Connectivity.NetworkInformation.getInternetConnectionProfile();
var currentStatus;
if (typeof connectionProfile !== undefined) {
currentStatus = connectionProfile.getNetworkConnectivityLevel();
}
return (currentStatus ===
Windows.Networking.Connectivity.NetworkConnectivityLevel.internetAccess);
}</pre></blockquote>
</div>
<div class="slide bullet-list-with-side-title">
<h1>
Lack of
</h1>
<ul>
<li>Advanced UI elements</li>
<li>Better MVVM / MVC / what ever implementation</li>
<li>More in-depth examples and documentation</li>
<li>Testability</li>
</ul>
</div>
<div class="slide vcenter" id="screen-sizes">
<div>
<img src="presentation/images/screen-sizes.jpg" />
<div class="texts">
<h1>Scaling to different screen sizes, DPI, input devices</h1>
<h2>(sometimes even on the very same device)</h2>
<p class="copyright">
Image copied from
<a href="Image copied from http://msdn.microsoft.com/en-us/library/windows/apps/hh780612.aspx">
http://msdn.microsoft.com/en-us/library/windows/apps/hh780612.aspx
</a>
</p>
</div>
</div>
</div>
<div class="slide" id="verdict">
<!-- no content, just a background image -->
</div>
<div class="slide bullet-list-with-side-title">
<h1>
Things to consider
</h1>
<ul>
<li>Not too many contenders in the app space</li>
<li>JavaScript fits very well for development of webish apps</li>
<li>Windows 8 market penetration</li>
</ul>
</div>
<div class="slide vcenter crowded">
<h1>
So...
</h1>
</div>
<div class="slide vcenter crowded">
<h1>
I think Windows 8 is a platform big enough for the effort
</h1>
</div>
<div class="slide vcenter crowded">
<h1>
Creating Windows 8 apps with JS is not the easiest thing out there
</h1>
<h1 class="pink animate-build" data-build="1">
...but it doesn't suck too much
</h1>
</div>
<div class="slide" id="thank-you">
<div class="texts">
<p>
You can find me at:<br />
<img src="presentation/images/twitter.png" /><a href="https://www.twitter.com/JouniKaplas/">@JouniKaplas</a><br />
<img src="presentation/images/movember.png" /><a href="http://mobro.co/imhairybutstillhandsome/">mobro.co/imhairybutstillhandsome</a>
</p>
<p>
These slides are available at:<br />
<a href="http://cido.github.com/win8-js-presentation/">cido.github.com/win8-js-presentation</a>
</p>
</div>
</div>
<div id="app-bar" data-win-control="WinJS.UI.AppBar" data-win-options="">
<button data-win-control="WinJS.UI.AppBarCommand"
data-win-options="{id:'cmdCamera',label:'Foo',icon:'camera',section:'selection',tooltip:'Take a picture'}">
</button>
<button data-win-control="WinJS.UI.AppBarCommand"
data-win-options="{id:'cmdAdd',label:'Bar',icon:'add',section:'global',tooltip:'Add item'}">
</button>
<button data-win-control="WinJS.UI.AppBarCommand"
data-win-options="{id:'cmdRemove',label:'Foo',icon:'remove',section:'global',tooltip:'Remove item'}">
</button>
<hr data-win-control="WinJS.UI.AppBarCommand"
data-win-options="{type:'separator',section:'global'}" />
<button data-win-control="WinJS.UI.AppBarCommand"
data-win-options="{id:'cmdDelete',label:'Bar',icon:'delete',section:'global',tooltip:'Delete item'}">
</button>
</div>
<!--[if !IE]><!--><script>if(/*@cc_on!@*/false||window.Windows){document.documentElement.className+=' ie10';}</script><!--<![endif]-->
<script>
$(document).ready(function() {
// Vertical alignment of things
$('.vcenter').each(function (index, element) {
$(element).html('<div class="vcenter-helper">' + $(element).html() +'</div>');
})
// Modify the windows start menu slide, if we are actually giving the presentation here
if (window.Windows) {
$('#start-menu').attr("id","windows-key");
}
function getTileUpdater() {
if (!(window.cachedTileUpdater)) {
window.cachedTileUpdater = Windows.UI.Notifications.TileUpdateManager.createTileUpdaterForApplication();
window.cachedTileUpdater.enableNotificationQueue(true);
}
return window.cachedTileUpdater;
}
window.updateLiveTiles = function () { /* empty implementation for non-metro environments */ }
if (window.Windows) {
// Import WinJS stuff
var headID = $('head')[0];
var cssNode = document.createElement('link');
cssNode.rel = 'stylesheet';
cssNode.href = '//Microsoft.WinJS.1.0/css/ui-light.css';
headID.insertBefore(cssNode, $('head title')[0]);
var base = document.createElement('script');
base.type = 'text/javascript';
base.src = '//Microsoft.WinJS.1.0/js/base.js';
headID.appendChild(base);
var ui = document.createElement('script');
ui.type = 'text/javascript';
ui.src = '//Microsoft.WinJS.1.0/js/ui.js';
headID.appendChild(ui);
// Enable sharing
Windows.ApplicationModel.DataTransfer.DataTransferManager.getForCurrentView().addEventListener("datarequested", function (e) {
var request = e.request;
request.data.properties.title = "Sharing is easy!";
request.data.properties.description = "...and the audience keeps nodding...";
request.data.setText("Hey @trewebdev crew, your event is awesome! BTW, did you notice, I'm tweeting from the actual presentation itself!?!");
//request.data.setText("Test message xx xxxx xx xxxx xx xxxx xx xxxx xx xxxx xx xxxx xx xxxx xx xxxx xx xxxx xx xxxx xx xxxx xx xxxx xx xxxx");
});
// Live tile updates
window.updateLiveTiles = function (slideNumber, totalNumberOfSlides) {
if (slideNumber !== totalNumberOfSlides) {
var imageXml = Windows.UI.Notifications.TileUpdateManager.getTemplateContent(Windows.UI.Notifications.TileTemplateType.tileSquareImage);
var imageElements = imageXml.getElementsByTagName("image");
imageElements[0].setAttribute('src', '/images/logo.png');
var tileNotification = new Windows.UI.Notifications.TileNotification(imageXml);
tileNotification.tag = 'jouni1';
var expirationTime = new Date();
expirationTime.setFullYear((new Date()).getFullYear() + 1);
tileNotification.expirationTime = expirationTime;
getTileUpdater().update(tileNotification);
var textXml = Windows.UI.Notifications.TileUpdateManager.getTemplateContent(Windows.UI.Notifications.TileTemplateType.tileSquareBlock);
var textElements = textXml.getElementsByTagName("text");
textElements[0].appendChild(textXml.createTextNode(slideNumber));
textElements[1].appendChild(textXml.createTextNode("Slide number"));
tileNotification = new Windows.UI.Notifications.TileNotification(textXml);
tileNotification.tag = 'jouni2';
var expirationTime = new Date();
expirationTime.setFullYear((new Date()).getFullYear() + 1);
tileNotification.expirationTime = expirationTime;
getTileUpdater().update(tileNotification);
} else {
getTileUpdater().clear();
}
}
window.updateLiveTiles("1");
// Process all needed elements from body (ie. the appbar)
WinJS.UI.processAll($('body')[0]);
} else {
// This is not metro! Hide the appbar element quickly!
$('#app-bar').hide();
}
// Initialize the actual presentation
var deck = new $.scrolldeck({
buttons: '.nav-button',
easing: 'easeOutExpo'
});
});
</script>
</body></html>