Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
從前端工程師觀點看 Metro Style App 開發
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Ping-Yen Tsai
June 20, 2012
Technology
310
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
從前端工程師觀點看 Metro Style App 開發
2012 微軟開發者日
Ping-Yen Tsai
June 20, 2012
More Decks by Ping-Yen Tsai
See All by Ping-Yen Tsai
「台灣報紙新聞」與「台灣即時新聞」
pingyen
0
190
我的工作經驗 (到目前為止)
pingyen
2
490
網頁前端⼯程師與室內裝修師傅的相似之處
pingyen
0
180
JavaScript Closure
pingyen
1
150
HTML5 Sectioning Elements
pingyen
0
110
次世代搜尋引擎戰爭
pingyen
0
170
進階 JavaScript
pingyen
0
310
jQuery 入門
pingyen
0
150
Windows 市集應⽤用程式實例解說 (使⽤ JavaScript)
pingyen
0
180
Other Decks in Technology
See All in Technology
enechainの内製セルフサービスプラットフォーム
hiyosi
0
140
GoにおけるFFIのこれまでとこれから
goccy
4
1.4k
GuardDuty 検知対応を DevOps Agent で効率化しようとしている話 / GuardDuty Investigations with DevOps Agent
masahirokawahara
1
340
Sigmaユーザーのための有用リソース一挙公開 & Sigmaで使えるMCP #sigma_ucj /useful-resources-for-sigma-computing-users-and-mcps-with-sigma
shinyaa31
0
170
Amazon Quick on DesktopがIAM Identity Centerで動かない理由
yukiogawa
0
120
20260903 Tokyo Jazug Night #62 | Azure エンジニアよ、 その環境は本当にセキュアか?
olivia_0707
1
640
Bet AI Day 2026丨AIによって本質に戻るシステムリスク管理
layerx
PRO
0
1.3k
KPIだけでは評価できないプロダクトが考えるべき Evalsという第二の評価系 / Beyond KPIs: Evals as a Second Evaluation Framework for Products #PdEConf
aki_iinuma
4
3.8k
20260906 「AWS運用入門」著者が教える、運用業務への生成AI活用入門
masaruogura
0
250
コスト最適化の「めんどくさい」を AWS FinOps Agent でチョット楽にする
classmethod_kaz
0
280
[DroidKaigi 2026] Making UI specifications visible: Android UI development in the AI agent era supported by Compose Screenshot Testing and galleries
syarihu
0
610
OpenTelemetry eBPF Instrumentationの舞台裏 / Behind the Scenes of OpenTelemetry eBPF Instrumentation
ymotongpoo
3
400
Featured
See All Featured
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.3k
Designing Experiences People Love
moore
143
24k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.5k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Everyday Curiosity
cassininazir
0
310
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
The SEO Collaboration Effect
kristinabergwall1
1
550
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
ラッコキーワード サービス紹介資料
rakko
1
4.8M
A designer walks into a library…
pauljervisheath
211
25k
Accessibility Awareness
sabderemane
1
200
Transcript
None
從前端⼯工程師觀點看 Metro Style App 開發 蔡秉諺 Vexed 中華電信隨意窩 Xuite
JavaScript
JavaScript
⼀一切的根源 JavaScript 跟其他語⾔言太不⼀一樣了 Prototype based inheritance Weak typing Functions
are objects Closure
出現了兩種⼈人 想把 JavaScript 變成他會的語⾔言 想⽤用 JavaScript 統治世界
想把 JavaScript 變成他會的語⾔言 Google Web Toolkit Java -> JavaScript
CoffeeScript CoffeeScript -> JavaScript Ruby
想⽤用 JavaScript 統治世界 nodeJS WebOS B2G Tizen PhoneGap Titanium
WebView .NET Qt GTK+ Chrome Firefox Extension / App
SQLite Manager :: Firefox Add-on
Secure Shell - Chrome App
Chrome / Firefox App JavaScript API 不⾜足 Chrome -> Native
Client (C++) Firefox -> NPAPI (C++) UX 先開瀏覽器 e.g., SQLite Manager
None
None
謝天謝地 微軟站在 ⽤用 JavaScript 統治世界 這邊
Windows 8 開發架構圖
幾乎是 Windows 7 版本號碼 6.2 Windows on ARM 不可安裝第三⽅方程式與外掛 不可安裝
FLASH ActiveX
(Server +) Client sandbox same origin policy
on IE10 Client / Browser 經驗 Debug 、 第三⽅方 Library
jQuery YUI Knockout Backbone
DOM Explorer
JavaScript Console
Metro style App using JavaScript in IE10 sandbox 沒有 same
origin policy 多 Windows 物件 多 WinJS 物件 少⼀一些函式 …
Windows 物件 不是 window 物件 Windows Runtime API WinRT
API C++ C# VB JavaScript 共通 使⽤用同⼀一般 JavaScript 物件 Windows.Storage.KnownFolders.musicLibrary
JavaScript API 充⾜足
Windows 物件不夠⽤用? ⾃自⼰己寫 WinRT Component C++ C# VB
WinJS 物件 Windows Library for JavaScript 100% JavaScript 寫成 jQuery
100% JavaScript 寫成 YUI 100% JavaScript 寫成 WinJS 100% JavaScript 寫成 看不懂可以看原始碼
WinJS 100% JavaScript 寫成 base.js WinJS ui.js WinJS.UI
WinJS.Promise 超過 0.5 秒 ⾮非同步 吐回 Promise 物件
IO readText() 、 PickSingleFileAsync() AJAX WinJS.xhr() 與 callback 相⽐比 語意清晰
AJAX a.php -> b.php -> c.php var xhr = new
XMLHttpRequest(); xhr.open('GET', 'a.php', true); xhr.onreadystatechange(function() { if(http.readyState == 4 && http.status == 200) { xhr.open('GET', 'b.php', true); xhr.onreadystatechange(function() { if(http.readyState == 4 && http.status == 200) { xhr.open('GET', 'c.php', true); xhr.onreadystatechange(function() { if(http.readyState == 4 && http.status == 200) { // ... } } xhr.send(); } } xhr.send(); } }); xhr.send();
AJAX a.php -> b.php -> c.php WinJS.xhr('a.php') .then(function() { return
WinJS.xhr('b.php'); }) .then(function() { return WinJS.xhr('c.php'); }) .done(function() { // ... });
AJAX a.php b.php c.php 同時送出 等三者皆完成 再下⼀一步 不⽤用 Promise
AJAX a.php b.php c.php 同時送出 WinJS.Promise.join([ WinJS.xhr('a.php'), WinJS.xhr('b.php'), WinJS.xhr('c.php')]) .done(function()
{ // ... });
還多了什麼? Live Connect API DOM MSApp MSProtocol MSProtocolsCollection
少了什麼? alert() confirm() prompt() 請⽤用 Windows.UI.Popups.MessageDialog … window .open() .close()
.moveBy() .moveTo() .resizeBy() .resizeTo() …
IE10 ECMAScript 5 "use strict"; [].map() Object getter
setter WinJS.Binding.as
IE10 CSS3 transition transform animation Grid Layout dev.w3.org 2010
年微軟提出 display : -ms-grid; -ms-grid-columns -ms-grid-column -ms-grid-column-span
Controls HTML5 有的 ⽤用 HTML 寫 HTML5 沒有的 <div
data-win-control="…" data-win-options="{ … }" > </div>
HTML5 有的 Controls <button>A Button</button> <video controls="controls" >
<source src="video.mp4" type="..." > </video> <canvas /> …
HTML5 沒有的 Controls DatePicker Rating ListView FlipView … <div
data-win-control="WinJS.UI.DatePicker" data-win-options="{ current: '2/20/2011' }" > </div> App 開啟時或 DOMContentLoaded 時 執⾏行 WinJS.UI.processAll();
Template data { title: "Banana", text: "Banana Frozen Yogurt", picture:
"images/banana.jpg" }
Template HTML <div data-win-control="WinJS.Binding.Template"> <div> <img data-win-bind="alt: title; src: picture"
/> <h4 data-win-bind="innerText: title" ></h4> <h6 data-win-bind="innerText: text" ></h6> </div> </div>
Application lifecycle 沒有關閉 App Suspened -> NotRunning 不會通知你
Charms & Contracts
Charms & Contracts
Charms & Contracts
考量各種檢視尺⼨寸 最⼩小 1024 * 768 最佳 1366 * 768
Snap View 320 * 768 1024 * 768
UX Metro® is a design language Guideline Guideline Guideline
對使⽤用者⼀一定是好事 對開發者和美術呢? Windows store 上架審核?
single-page navigation Grid App 點下 item 怎麼沒換⾴頁? 只有網⾴頁中間換內容?
把 <a> 預設動作 ⽤用 e.preventDefault() 擋掉! WinJS.UI.Pages & navigation.js
dev.windows.com MSDN Sample
謝謝