SlideShare une entreprise Scribd logo
1  sur  16
Hack
   with
   YUI

    Sumana H
Frontend Engineer,
Data And Analytics
“The browser is the most futile
  deployment environment…”

                - Douglas Crockford
Don’t reinvent the wheel




 Use tools which are already available
A comprehensive suite of tools to help
        you code like a pro!!
       http://yuilibrary.com/
• YUI Library is a set of utilities and controls,
  written with JS and CSS , for building rich
  interactive web applications.

• Free for all users

• Scalable, Fast and Robust

• Most popular, best documented, more
  examples.
YUI Library
• Low level DOM utilities to high level user
  Interface widgets

• Core – Global Object, Node, Events

• Utilities – Animation, drag Drop, get Utility – to
  get js/css dynamically.

• Widgets – Autocomplete, calendar, carousel,
  Overlay…
• CSS
  http://yuilibrary.com/yui/docs/guides/
Global Object
<script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-
min.js"></script>

<div id="demo">Click me</div>
<script>
// Create a new YUI sandbox and load the "node" module.
YUI().use('node','datatable', function (Y) {
var demo = Y.one('#demo'); demo.on('click', function (e) {
      demo.set('text', 'You clicked me!');
   });
});
</script>
Node
Getting a Node

<div id="main" class="mainclass"/>
 // Use Y.one( [css selector string] )
 var node = Y.one('#main');
 var node = Y.one(.mainclass);

  // Or pass an HTML element
  var bodyNode = Y.one(document.body);
Creating Nodes and Modifying
          Content
   // Create a new Node
   var item = Y.Node.create('<li id="step3"
class="highlight"><em>Profit</em></li>');

  // Replace the content in a Node
  Y.one("#hello").setContent("<h1>Hello,
<em>World</em>!</h1>");

   // Append new markup inside a Node
   bodyNode.append("<p>This is the end, beautiful friend,
the end.</p>");
Nodelist
var doneTasks = Y.all('#tasklist .completed');

// NodeLists host most Node methods for simple
iterative operations
doneTasks.removeClass('highlight');

// or call each() to do more work on each Node
doneTasks.each(function (taskNode) {
   taskNode.transition({ opacity: 0 }, function () {
      ……..
   });
});
Event
YUI().use('event', function (Y) {
 // Step 1. Capture a button node
  var button = Y.one("#readygo");

      // Step 2. Subscribe to its click event with a callback
      function
      button.on("click", function (e) {

        // Step 3. do stuff when the button is clicked

      });
});
Examples
- Factorial example
- Widget - Carousel

Gallery – http://github.com/yahoo
CSS
• <link rel="stylesheet" type="text/css"
  href="http://yui.yahooapis.com/gallery-
  2010.10.20-19-33/build/gallery-
  carousel/assets/skins/sam/gallery-
  carousel.css"/>

• Grids - <link rel="stylesheet" type="text/css"
  href="http://yui.yahooapis.com/3.6.0/build/cssgr
  ids/grids-min.css">

CSS Grids
  Class         Description


 .yui3-u-1      Fills 100% of the available width.


 .yui3-u-1-3    Fills 1/3 of available width.


 .yui3-u-4-5    Fills 4/5 of available width.




 Examples
 http://developer.yahoo.com/yui/grids/builder/
Resources
• http://www.slideshare.net/SumanaHariharan/yui
  hacku-iitdsumana
THANK YOU

Contenu connexe

Tendances

Artdm170 Week4 Java Script Effects
Artdm170 Week4 Java Script EffectsArtdm170 Week4 Java Script Effects
Artdm170 Week4 Java Script Effects
Gilbert Guerrero
 
Leave No One Behind with HTML5 - FFWD.PRO, Croatia
Leave No One Behind with HTML5 - FFWD.PRO, CroatiaLeave No One Behind with HTML5 - FFWD.PRO, Croatia
Leave No One Behind with HTML5 - FFWD.PRO, Croatia
Robert Nyman
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao PauloJavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
Robert Nyman
 
Short intro to JQuery and Modernizr
Short intro to JQuery and ModernizrShort intro to JQuery and Modernizr
Short intro to JQuery and Modernizr
Jussi Pohjolainen
 
Auto tools
Auto toolsAuto tools
Auto tools
祺 周
 
CT presentatie JQuery 7.12.11
CT presentatie JQuery 7.12.11CT presentatie JQuery 7.12.11
CT presentatie JQuery 7.12.11
virtualsciences41
 
Mume JQueryMobile Intro
Mume JQueryMobile IntroMume JQueryMobile Intro
Mume JQueryMobile Intro
Gonzalo Parra
 
jQuery presentation
jQuery presentationjQuery presentation
jQuery presentation
Mahesh Reddy
 

Tendances (20)

Artdm170 Week4 Java Script Effects
Artdm170 Week4 Java Script EffectsArtdm170 Week4 Java Script Effects
Artdm170 Week4 Java Script Effects
 
Developing Context-sensitive Help for Web-based Applications - Scott DeLoach,...
Developing Context-sensitive Help for Web-based Applications - Scott DeLoach,...Developing Context-sensitive Help for Web-based Applications - Scott DeLoach,...
Developing Context-sensitive Help for Web-based Applications - Scott DeLoach,...
 
Leave No One Behind with HTML5 - FFWD.PRO, Croatia
Leave No One Behind with HTML5 - FFWD.PRO, CroatiaLeave No One Behind with HTML5 - FFWD.PRO, Croatia
Leave No One Behind with HTML5 - FFWD.PRO, Croatia
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao PauloJavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
 
Flash Widget Tutorial
Flash Widget TutorialFlash Widget Tutorial
Flash Widget Tutorial
 
Short intro to JQuery and Modernizr
Short intro to JQuery and ModernizrShort intro to JQuery and Modernizr
Short intro to JQuery and Modernizr
 
JQuery
JQueryJQuery
JQuery
 
Auto tools
Auto toolsAuto tools
Auto tools
 
CT presentatie JQuery 7.12.11
CT presentatie JQuery 7.12.11CT presentatie JQuery 7.12.11
CT presentatie JQuery 7.12.11
 
Css secrets
Css secretsCss secrets
Css secrets
 
Cookies
CookiesCookies
Cookies
 
Processing and Processing.js
Processing and Processing.jsProcessing and Processing.js
Processing and Processing.js
 
Utility libraries to make your life easier
Utility libraries to make your life easierUtility libraries to make your life easier
Utility libraries to make your life easier
 
Casl. isomorphic permission management.pptx
Casl. isomorphic permission management.pptxCasl. isomorphic permission management.pptx
Casl. isomorphic permission management.pptx
 
PHP - Getting good with cookies
PHP - Getting good with cookiesPHP - Getting good with cookies
PHP - Getting good with cookies
 
The Fine Art of JavaScript Event Handling
The Fine Art of JavaScript Event HandlingThe Fine Art of JavaScript Event Handling
The Fine Art of JavaScript Event Handling
 
Video synced interactive web visualisations
Video synced interactive web visualisationsVideo synced interactive web visualisations
Video synced interactive web visualisations
 
Mume JQueryMobile Intro
Mume JQueryMobile IntroMume JQueryMobile Intro
Mume JQueryMobile Intro
 
Gutenberg Blocks Development for Programmers with no time
Gutenberg Blocks Development for Programmers with no timeGutenberg Blocks Development for Programmers with no time
Gutenberg Blocks Development for Programmers with no time
 
jQuery presentation
jQuery presentationjQuery presentation
jQuery presentation
 

Similaire à Yuihacku iitd-sumana

Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007
Netvibes
 
Server Side JavaScript - You ain't seen nothing yet
Server Side JavaScript - You ain't seen nothing yetServer Side JavaScript - You ain't seen nothing yet
Server Side JavaScript - You ain't seen nothing yet
Tom Croucher
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
Justin Cataldo
 

Similaire à Yuihacku iitd-sumana (20)

Hack U - YUI - 2012 IIT Kharagpur
Hack U - YUI - 2012 IIT KharagpurHack U - YUI - 2012 IIT Kharagpur
Hack U - YUI - 2012 IIT Kharagpur
 
YUI3 - IIT Madras HackU
YUI3 - IIT Madras HackU YUI3 - IIT Madras HackU
YUI3 - IIT Madras HackU
 
Jquery 5
Jquery 5Jquery 5
Jquery 5
 
Jquery fundamentals
Jquery fundamentalsJquery fundamentals
Jquery fundamentals
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" Domino
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
jQuery
jQueryjQuery
jQuery
 
JavaScript DOM - Dynamic interactive Code
JavaScript DOM - Dynamic interactive CodeJavaScript DOM - Dynamic interactive Code
JavaScript DOM - Dynamic interactive Code
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012
 
Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007
 
A Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NETA Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NET
 
Ext JS Introduction
Ext JS IntroductionExt JS Introduction
Ext JS Introduction
 
JavaScript Everywhere! Creating a 100% JavaScript web stack
JavaScript Everywhere! Creating a 100% JavaScript web stackJavaScript Everywhere! Creating a 100% JavaScript web stack
JavaScript Everywhere! Creating a 100% JavaScript web stack
 
Server Side JavaScript - You ain't seen nothing yet
Server Side JavaScript - You ain't seen nothing yetServer Side JavaScript - You ain't seen nothing yet
Server Side JavaScript - You ain't seen nothing yet
 
Praktik Pengembangan Konten E-Learning HTML5 Sederhana
Praktik Pengembangan Konten E-Learning HTML5 SederhanaPraktik Pengembangan Konten E-Learning HTML5 Sederhana
Praktik Pengembangan Konten E-Learning HTML5 Sederhana
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
 
Running YUI 3 on Node.js - JSConf 2010
Running YUI 3 on Node.js - JSConf 2010Running YUI 3 on Node.js - JSConf 2010
Running YUI 3 on Node.js - JSConf 2010
 
Jquery- One slide completing all JQuery
Jquery- One slide completing all JQueryJquery- One slide completing all JQuery
Jquery- One slide completing all JQuery
 
Django at the Disco
Django at the DiscoDjango at the Disco
Django at the Disco
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Yuihacku iitd-sumana

  • 1. Hack with YUI Sumana H Frontend Engineer, Data And Analytics
  • 2. “The browser is the most futile deployment environment…” - Douglas Crockford
  • 3. Don’t reinvent the wheel Use tools which are already available
  • 4. A comprehensive suite of tools to help you code like a pro!! http://yuilibrary.com/
  • 5. • YUI Library is a set of utilities and controls, written with JS and CSS , for building rich interactive web applications. • Free for all users • Scalable, Fast and Robust • Most popular, best documented, more examples.
  • 6. YUI Library • Low level DOM utilities to high level user Interface widgets • Core – Global Object, Node, Events • Utilities – Animation, drag Drop, get Utility – to get js/css dynamically. • Widgets – Autocomplete, calendar, carousel, Overlay… • CSS http://yuilibrary.com/yui/docs/guides/
  • 7. Global Object <script src="http://yui.yahooapis.com/3.4.1/build/yui/yui- min.js"></script> <div id="demo">Click me</div> <script> // Create a new YUI sandbox and load the "node" module. YUI().use('node','datatable', function (Y) { var demo = Y.one('#demo'); demo.on('click', function (e) { demo.set('text', 'You clicked me!'); }); }); </script>
  • 8. Node Getting a Node <div id="main" class="mainclass"/> // Use Y.one( [css selector string] ) var node = Y.one('#main'); var node = Y.one(.mainclass); // Or pass an HTML element var bodyNode = Y.one(document.body);
  • 9. Creating Nodes and Modifying Content // Create a new Node var item = Y.Node.create('<li id="step3" class="highlight"><em>Profit</em></li>'); // Replace the content in a Node Y.one("#hello").setContent("<h1>Hello, <em>World</em>!</h1>"); // Append new markup inside a Node bodyNode.append("<p>This is the end, beautiful friend, the end.</p>");
  • 10. Nodelist var doneTasks = Y.all('#tasklist .completed'); // NodeLists host most Node methods for simple iterative operations doneTasks.removeClass('highlight'); // or call each() to do more work on each Node doneTasks.each(function (taskNode) { taskNode.transition({ opacity: 0 }, function () { …….. }); });
  • 11. Event YUI().use('event', function (Y) { // Step 1. Capture a button node var button = Y.one("#readygo"); // Step 2. Subscribe to its click event with a callback function button.on("click", function (e) { // Step 3. do stuff when the button is clicked }); });
  • 12. Examples - Factorial example - Widget - Carousel Gallery – http://github.com/yahoo
  • 13. CSS • <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/gallery- 2010.10.20-19-33/build/gallery- carousel/assets/skins/sam/gallery- carousel.css"/> • Grids - <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.6.0/build/cssgr ids/grids-min.css"> 
  • 14. CSS Grids Class Description .yui3-u-1 Fills 100% of the available width. .yui3-u-1-3 Fills 1/3 of available width. .yui3-u-4-5 Fills 4/5 of available width.  Examples  http://developer.yahoo.com/yui/grids/builder/