Introduction to YUI - IIT Kharagpur

35
YUI Hack U – IIT Kharagpur Harsha Vashisht [email protected] http://www.harsharv.com

description

Using YUI for hacks.

Transcript of Introduction to YUI - IIT Kharagpur

Page 1: Introduction to YUI - IIT Kharagpur

YUIHack U – IIT Kharagpur

Harsha [email protected]://www.harsharv.com

Page 2: Introduction to YUI - IIT Kharagpur

The client side is where strange things happen.

Page 3: Introduction to YUI - IIT Kharagpur

Browsers render in fascinating and totally wrong ways.

Page 4: Introduction to YUI - IIT Kharagpur

Random code from dubious sources interferes with your godlike, clean and high quality code.

...and you fix more than you develop.

Page 5: Introduction to YUI - IIT Kharagpur

The web is a total mess!

Page 6: Introduction to YUI - IIT Kharagpur

To make things work for Yahoo! we needed to find a way to abstract these issues away from us.

Page 7: Introduction to YUI - IIT Kharagpur
Page 8: Introduction to YUI - IIT Kharagpur

And this is why we built the YUI.

Page 9: Introduction to YUI - IIT Kharagpur

YUI is a framework to build working web applications.

Page 10: Introduction to YUI - IIT Kharagpur

It includes CSS solutions to create layouts that work across browsers and allow for predictable typography.

Page 11: Introduction to YUI - IIT Kharagpur

And it takes the pain out of writing JavaScript.

Page 12: Introduction to YUI - IIT Kharagpur

Last but very much not least it allows you to create applications using tested and working widgets that extend what HTML gives

us.

Page 13: Introduction to YUI - IIT Kharagpur

Inte

rface

Wid

gets

Auto Complete Data Table

Button Layout

Calendar Menu

Charts Rich Text

Container Tab View

Page 14: Introduction to YUI - IIT Kharagpur

Everything is fully documented with around 300 examples!

Page 15: Introduction to YUI - IIT Kharagpur

1. Documentationhttp://developer.yahoo.com/yui/docs/

2. Exampleshttp://developer.yahoo.com/yui/examples/

Page 16: Introduction to YUI - IIT Kharagpur

All YUI components come as a debug version which log everything that is going on to the logger.

Page 17: Introduction to YUI - IIT Kharagpur

All in all YUI allows you to build web interfaces without having to know all the pain that goes on in the browser world.

Page 18: Introduction to YUI - IIT Kharagpur

Now, lets have a look at what YUI has to offer.

Page 19: Introduction to YUI - IIT Kharagpur

1. Data Sourcehttp://developer.yahoo.com/yui/3/datasource/

Page 20: Introduction to YUI - IIT Kharagpur

The DataSource Utility provides a consistent API for the retrieval of data from arbitrary sources over a variety of supported

protocols.

Page 21: Introduction to YUI - IIT Kharagpur

1. Remote sources2. Polling3. Caching4. Events

Page 22: Introduction to YUI - IIT Kharagpur

http://developer.yahoo.com/yui/3/examples/datasource/datasource_get.html

Page 23: Introduction to YUI - IIT Kharagpur

YUI allows you to fetch data from YQL directly!

Page 24: Introduction to YUI - IIT Kharagpur

http://developer.yahoo.com/yui/3/examples/yql/simple-yql.html

Page 25: Introduction to YUI - IIT Kharagpur

2. Auto complete

Page 26: Introduction to YUI - IIT Kharagpur

http://developer.yahoo.com/yui/3/examples/autocomplete/ac_datasource.html

Page 27: Introduction to YUI - IIT Kharagpur

3. Data Charts

Page 28: Introduction to YUI - IIT Kharagpur

Now.. I want to draw a graph..

Page 29: Introduction to YUI - IIT Kharagpur

Duck.. There will be codeDuck.. There will be code

Page 30: Introduction to YUI - IIT Kharagpur

My code..

YUI().use('charts', function (Y) { var myDataValues = [ {category:"5/1/2010", values:2000}, {category:"5/2/2010", values:50}, {category:"5/3/2010", values:400}, {category:"5/4/2010", values:200}, {category:"5/5/2010", values:5000} ]; var mychart = new Y.Chart({dataProvider:myDataValues, render:"#mychart"});});

Page 31: Introduction to YUI - IIT Kharagpur

Ain’t that kick ass???

Page 32: Introduction to YUI - IIT Kharagpur

Let us look at the examples page…

http://developer.yahoo.com/yui/3/examples/

Page 33: Introduction to YUI - IIT Kharagpur

Questions???

Page 34: Introduction to YUI - IIT Kharagpur

Some people I need to thank…

1. Christian Heilmann2. Gopalrathnam Venkatesan

Page 35: Introduction to YUI - IIT Kharagpur

Harsha R. [email protected]

http://www.harsharv.comhttp://twitter.com/harsharv

http://www.facebook.com/harsharv