Josephj Open At Yahoo Nsysu2

94
NSYSU MIS 2009/3/5 科技 開放 雅虎 站在巨人的肩膀上、開發網站 josephj

description

 

Transcript of Josephj Open At Yahoo Nsysu2

Page 1: Josephj Open At Yahoo Nsysu2

NSYSU MIS2009/3/5

科技 開放 雅虎站在巨人的肩膀上、開發網站

josephj

Page 2: Josephj Open At Yahoo Nsysu2

• 2.5 年前端工程師(F2E)

• 0.5 年科技推廣傳教士(Evangelist)

•目前在無名小站擔任工程師(RD)

@josephj6802http://josephj.com

[email protected]

Hi! 我是 josephj(啊嗚)

Page 3: Josephj Open At Yahoo Nsysu2

2008.5 跑步環島

Page 4: Josephj Open At Yahoo Nsysu2

Question 1:建立一個成功網站最基本且

重要的元素為何?

Page 5: Josephj Open At Yahoo Nsysu2

Open APIs輕鬆取得 Yahoo! 上的資料

Page 6: Josephj Open At Yahoo Nsysu2

Open API

AJAX API

Open API

Page 7: Josephj Open At Yahoo Nsysu2

Yahoo! 的許多服務都提供了各式各樣的輸出 Format(以全世界最受歡迎的相簿 Flickr 為例)

Page 13: Josephj Open At Yahoo Nsysu2
Page 14: Josephj Open At Yahoo Nsysu2

每當碰到要結合多個 API 的 Feed,格式、Schema 都不一樣! 頭大!

Page 15: Josephj Open At Yahoo Nsysu2

從不同 Service 取得資料...

Page 16: Josephj Open At Yahoo Nsysu2

JavaScript 組合成 HTML ...

Page 17: Josephj Open At Yahoo Nsysu2

抓取資料、處理 Schema 得寫超多的程式有可能不寫 Code 就做到嗎?

Page 18: Josephj Open At Yahoo Nsysu2

是的!用 Pipes 來 Remix Feed

Page 19: Josephj Open At Yahoo Nsysu2

拖拉、填寫、完成

多個中山正妹的 RSS Feed

利用 Union 結合為一個

以日期做排序

輸出最後結果:各種格式

Page 20: Josephj Open At Yahoo Nsysu2

但... 開發者的要求:CLI

Page 21: Josephj Open At Yahoo Nsysu2

YQL 滿足你的需求Yahoo! Query Language

Page 22: Josephj Open At Yahoo Nsysu2
Page 23: Josephj Open At Yahoo Nsysu2

把 Yahoo! 當成是你的資料庫!

Page 24: Josephj Open At Yahoo Nsysu2

Question 2:有資料了,要怎麼樣把網頁

做出來?

Page 25: Josephj Open At Yahoo Nsysu2

YUI Library快速開發功能強大的 Web2.0 網站

Page 26: Josephj Open At Yahoo Nsysu2

在瀏覽器上建立使用者 UI(控制項)

Def. But.Button

Label Menu

Label Text Field

Label

Label

Text Area

click me

傳統內建 UI 使用 YUI 所建立的 UI

Page 27: Josephj Open At Yahoo Nsysu2

YUI 的特點

Page 28: Josephj Open At Yahoo Nsysu2

最佳的瀏覽器支援度

Page 29: Josephj Open At Yahoo Nsysu2
Page 30: Josephj Open At Yahoo Nsysu2

http://blogs.computerworld.com/nytimes_iphone_browser_marketshare

即使是 iPhone 上的瀏覽器,YUI 也支援

Page 31: Josephj Open At Yahoo Nsysu2

http://marketshare.hitslink.com/report.aspx?sample=21&qprid=43&qpcustom=Chrome+0.2

Google Chrome 也一視同仁 ;)

Page 32: Josephj Open At Yahoo Nsysu2

Rich Text Editor

Page 33: Josephj Open At Yahoo Nsysu2

結構複雜、但使用起來簡單愉快

Page 34: Josephj Open At Yahoo Nsysu2

保證在每個主流瀏覽器都支援

Page 35: Josephj Open At Yahoo Nsysu2

無障礙網頁(Accessbility)

Page 36: Josephj Open At Yahoo Nsysu2

最符合使用者需求你每天都在用的網站是?

Page 37: Josephj Open At Yahoo Nsysu2

所有的 Library 必需符合使用者經驗的設計

Page 38: Josephj Open At Yahoo Nsysu2

Problem Summary

The user needs to enter an item into a text box which could ambiguous or hard to

remember and therefore has the potential to be mis-typed.

EXAMPLE:

Auto completion of contacts in Yahoo! Mail Beta

Use When

The suggestions can be pulled from a manageable set of data.

The input item can be entered in multiple ways.

The input item can be matched with a specific data item in the system.

Speed and accuracy of entry is an important goal.

The total number of items would be too large or inconvenient for displaying in a

standard drop down box.

Solution

Layout

Use a standard text box for input.

Label the text box to match the user's expection of what field will be searched against.

Interaction

As the user types, display a list of suggested items that most closely match what the

user has typed. Continue to narrow or broaden the list of suggested items based on the

user's input.

Display the suggested items list in a drop down box directly underneath the text box.

The suggested items list may be based on the complete set of data or more narrowly

based on other criteria such as each item's frequency of use.

When available, show multiple fields of information for each suggested item. In the

Yahoo! Mail example above, two fields are presented: the contact's full name and the

contact's email address.

Highlight the closest matching item within the suggested items list.

Show the matched item as first in the list.

Highlight the background of the matched item.

When multiple fields are shown for each suggested item the match may occur

with the initial characters of any of the fields presented.

For each suggested item in the suggest items list show the characters that exactly

match the user's input. When multiple fields are shown in a suggested item the

matching characters may appear in any of the fields presented. In the example below,

the characters 'Yu' have been typed by the user. The match is on three items. Notice

that the first item matched on the contact's email address '<yuiblogger.com>' whereas

the second and third items are matched on the contact's name (e.g., 'Yusef Jones'.)

Allow the user to delete a character of input and display the previous suggested items

list.

Allow the user to complete the input field by pressing the Tab key or Enter; key. The

current matched item in the suggested items list will be accepted as the value for the

input field.

Allow the user to optionally highlight an item of their choice from the suggested item list

with the mouse or with the up and down arrow keys.

Allow the user to cancel the suggested items list by pressing the Esc key. The drop

down list will close. Subsequently pressing the Tab key or Enter key will accept the

value from the input field. However, typing more characters after hitting the Esc key will

restart the auto completion behavior displaying the suggested items list.

If multiple input items are allowed in a single input field, allow the user to use the

Comma key to separate each input item.

Pressing the comma key will complete an individual item match.

The auto complete behavior restarts when the user begins typing characters for

the next input item.

Rationale

Reducing the number of keystrokes allows for faster user input.

Showing additional formatting information in the suggested items list (like the email

address in the example above) removes ambiguity.

Continual feedback helps the user narrow in on the correct choice.

Accessibility

Label the text box to match the user's expection of what field will be searched against.

Allow the user to highlight a desired match either using a mouse or navigating to it with

the up or down arrow keys.

Allow the user to complete the form by pressing the Tab or Enter keys.

Allow the user to cancel suggestions by pressing the Esc key.

Allow the input field to receive keyboard focus by pressing the Tab key.

Once the edit field is in focus make sure that the focus stays in the edit field during

autocomplete.

Do not send any page refreshes when updating the field (page refreshes will signal

assistive technology to start reading the page again.)

The insertion cursor should move as the left/right arrow keys are pressed in the text

field.

QUICK JUMP

Solution

Rationale

Accessibility

RELATED PATTERNS

Calendar Picker

AS USED ON YAHOO!

Yahoo! Mail Beta

Yahoo! Maps Beta

Yahoo! My Web 2

BLOG

Blog Article

Y! UI CODE EXAMPLES

Auto Complete

Component

Y! Search (JSON)

Y! Search (XML)

In-Memory (array)

In-Memory (function)

Flickr (XML)

Flat data

Playground

Show with revisions

This work is licensed under a

Creative Commons Attribution 2.5

License.

Design Pattern Library

Auto Complete

Copyright © 2005-2007 Yahoo! Inc. All rights reserved.

Privacy Policy - Terms of Service - Copyright Policy - Job Openings

Developer Network Home Help Site Search

Yahoo! Developer Network > Design Pattern Library > Auto Complete

Page 39: Josephj Open At Yahoo Nsysu2

客製化自己所需 UI 容易

Page 40: Josephj Open At Yahoo Nsysu2

密碼強度顯示器

Page 41: Josephj Open At Yahoo Nsysu2

跟桌面一樣的選取方式

Page 42: Josephj Open At Yahoo Nsysu2

用 YUI 製作 Web 簡報系統(為前年的 OSDC 所做的)

Page 43: Josephj Open At Yahoo Nsysu2

翻頁(Carousel)模組

Page 44: Josephj Open At Yahoo Nsysu2

手風琴模組

Page 45: Josephj Open At Yahoo Nsysu2

「知識+名片」的手風琴模組

Page 46: Josephj Open At Yahoo Nsysu2

用 YUI 做的俄羅斯方塊

Page 47: Josephj Open At Yahoo Nsysu2

提供專業視覺設計的樣式

Page 48: Josephj Open At Yahoo Nsysu2
Page 49: Josephj Open At Yahoo Nsysu2
Page 50: Josephj Open At Yahoo Nsysu2

超完整的範例目前在 YUI 官網上超過 300 個範例

Page 51: Josephj Open At Yahoo Nsysu2

有 IDE 編輯器嗎?為什麼不體驗一下打字的快感呢...?

Page 52: Josephj Open At Yahoo Nsysu2

Aptana

Page 53: Josephj Open At Yahoo Nsysu2

YUI 是否會收費?

Page 54: Josephj Open At Yahoo Nsysu2

YUI 是基於最鬆散的 BSD License 條款授權

你可以自由引用、修改、甚至放在商業軟體販售

Page 55: Josephj Open At Yahoo Nsysu2

有哪些網站使用 YUI?

Page 56: Josephj Open At Yahoo Nsysu2
Page 57: Josephj Open At Yahoo Nsysu2

YUI 必學招式http://josephj.com/training/nsysu/

Page 58: Josephj Open At Yahoo Nsysu2

1. YUI 排版快速 DIV & CSS Layout 產生器

Page 59: Josephj Open At Yahoo Nsysu2

側邊欄寬度為 240px

平均分配 50%, 50%

版面寬度 950px

Page 60: Josephj Open At Yahoo Nsysu2
Page 61: Josephj Open At Yahoo Nsysu2
Page 62: Josephj Open At Yahoo Nsysu2

http://developer.yahoo.com/yui/grids/builder/

YUI Grid Builder

Page 63: Josephj Open At Yahoo Nsysu2

2. YUI 選單輕鬆地做出巢狀式浮動選單

Page 64: Josephj Open At Yahoo Nsysu2

範例 2:YUI 選單http://josephj.com/training/nsysu/yui-menu.html

1.請以 new YAHOO.widget.MenuBar([模組id]); 新增一個 YUI 選單物件

2.執行這個物件的 render() 方法

Page 65: Josephj Open At Yahoo Nsysu2

範例 2:YUI 選單http://josephj.com/training/nsysu/yui-menu.html

autosubmenudisplay (true 或 false) 是否自動顯示子選單

hidedelay (毫秒)滑鼠移開 n 毫秒後才隱藏

lazyload (true 或 false) 是否滑過去時才建立子選單

常用屬性:

Page 66: Josephj Open At Yahoo Nsysu2

3. YUI 按鈕輕鬆做出互動性豐富的按鈕 UI

Page 67: Josephj Open At Yahoo Nsysu2

YUI Button

一個按鈕該有的互動效果, YUI Button 都提供

更提供各種形式的按鈕

HTML 預設的按鈕醜又缺乏互動

Page 68: Josephj Open At Yahoo Nsysu2

練習 3:YUI 按鈕http://josephj.com/training/nsysu/yui-button.html

1.請以 new YAHOO.widget.Button([連結 id]); 將連結轉換為按鈕

Page 69: Josephj Open At Yahoo Nsysu2

4. YUI 視窗Web 2.0 的「開新視窗」

Page 70: Josephj Open At Yahoo Nsysu2

YUI 視窗家族

YAHOO.widget.Panel

YAHOO.widget.Panel

YAHOO.widget.Dialog

YAHOO.widget.SimpleDialog

Page 71: Josephj Open At Yahoo Nsysu2

練習 4:YUI 視窗http://josephj.com/training/nsysu/yui-panel.html

1. 請以 var oPanel = new YAHOO.widget.Panel([模組 id], [屬性]); 將 #panel 模組轉換為視窗(屬性設定請看下一頁)

2. oPanel.render(document.body): 將模組 append 到最外層3. oButton.addListener(‘click’, onButtonClick)

onButtonClick 函式:oPanel.show();

Page 72: Josephj Open At Yahoo Nsysu2

練習 4:YUI 視窗http://josephj.com/training/nsysu/yui-panel.html

close 是否要有關閉的按鈕

fixedcenter 是否要置中對齊

modal 是否為獨佔模式

underlay shadow’, ‘matte’

visible 預設是否顯示

width 視窗的寬度

{屬性1 : 屬性值 1, 屬性 2 : 屬性值 2}

Page 73: Josephj Open At Yahoo Nsysu2

5. YUI Get存取跨網域的資料

Page 76: Josephj Open At Yahoo Nsysu2

練習 5:YUI Gethttp://josephj.com/training/nsysu/yui-get.html

Page 77: Josephj Open At Yahoo Nsysu2

Question 3:萬事皆備,該如何吸引使用

者來到你的網站?

Page 78: Josephj Open At Yahoo Nsysu2

Application Platform應用程式平台:YAP

Page 79: Josephj Open At Yahoo Nsysu2

將你的程式放在

全世界最多人使用的頁面

Page 80: Josephj Open At Yahoo Nsysu2

Yahoo! 美國新版首頁

Page 81: Josephj Open At Yahoo Nsysu2

Yahoo! 電子郵件信箱

利用 Mail/Contact API 做 Local 的建議

Page 82: Josephj Open At Yahoo Nsysu2

Pat Jameson 邀請朋友可共享晚餐

Yahoo! 個人頁

Pat Jameson 的部落格

Pat Jameson 的留言板

Page 83: Josephj Open At Yahoo Nsysu2

無名?運動?知識+?拍賣?

結合 Y!Sports 與某家售票系統

Page 84: Josephj Open At Yahoo Nsysu2

YAP Developer StudioYAP 應用程式的開發工具

Page 85: Josephj Open At Yahoo Nsysu2
Page 86: Josephj Open At Yahoo Nsysu2

在 Yahoo! 上開發應用程式給成千上萬人使用?Cool!

Page 87: Josephj Open At Yahoo Nsysu2

More?

Page 88: Josephj Open At Yahoo Nsysu2

BluePrint:在手機上開發程式

Page 89: Josephj Open At Yahoo Nsysu2

SearchMonkey:改變搜尋外觀

Page 90: Josephj Open At Yahoo Nsysu2

Fire Eagle:地址定位系統

Page 91: Josephj Open At Yahoo Nsysu2

OpenID:SSO 的統一作法

Page 92: Josephj Open At Yahoo Nsysu2

Quick Summary•Open APIs:把 Yahoo! 當成你的資料庫

•YUI:快速建立 Web 2.0 網站

•YAP:在 Yahoo! 放置你開發的程式

善用 Yahoo! 工具,可讓你的網站更 Powerful

Page 93: Josephj Open At Yahoo Nsysu2

Questions?

http://www.flickr.com/photos/phploveme/2847931240/