SlideShare a Scribd company logo
YUI TIDBITS


              Jai Santhosh
                @jaisanth
What We’re Going to Cover
• Why YUI?

• YUI Tidbits


• Before we are done!
http://yuilibrary.com/
What We’re Going to Cover
• Why YUI?

• YUI Tidbits


• Before we are done!
Good Architecture!!
YUI Tidbits
YUI Tidbits
Few others
What’s in Smart Software?

• Reliability

• Maintainability

• Compatibility

• Extensibility
Y U NO SIMPLE?
http://yuilibrary.com/yui/docs/guides/
http://yuilibrary.com/yui/docs/guides/
What We’re Going to Cover
• Why YUI?

• YUI Tidbits


• Before we are done!
Getting YUI 3
// http://yuilibrary.com/yui/docs/yui/

<script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-
min.js"></script>


Getting YUI sandbox instance

YUI().use(function (Y) {

      // Your code here

});
YUI() Tidbits
YUI().use(function (Y) {

      Y.log();
      Y.later();
      Y.cached();

      Y.UA
      Y.Lang

});
Y.log();
      Y.log(message);


Console Widget
YUI().use(”console”, function(Y) {
    var myConsole = new Y.console();
    myConsole.render();

      Y.log(message);
});
Y.dump();
YUI().use(”dump”, function(Y) {

      Y.log(Y.dump(myObj));
});
Y.later();
   var timer = Y.later(50, gizmo, gizmo.foo);

   timer.cancel();

   var args = [10, 20];
   var timer = Y.later(50, gizmo, gizmo.foo, args);
Y.cached();
  var cachedFoo = Y.cached(foo);

  var result = cachedFoo(arg1, arg2);
Y.cached();
      var cachedFoo = Y.cached(foo);

      var result = cachedFoo(arg1, arg2);


Classnamemanager
YUI().use(”classnamemanager”, function(Y) {
    var sClass =
    new Y.ClassNameManager.getclassname(”button”, ”hover”);

      // sclass = ”yui-button-hover”
});
Y.UA
Y.UA.gecko

Y.UA.os

Y.UA.mobile

Y.UA.secure

Y.UA.air

Y.UA.caja
Y.Lang
Y.Lang.isString(something);

Y.Lang.type(something);

Y.Lang.trim(something);
Y.mix();
Y.mix(obj1, obj2);

       obj1          obj2


       name          name

       foo()         bar()

                     baz()
Y.mix();
Y.mix(obj1, obj2);

       obj1          obj2


       name          name

       foo()         bar()
       bar()
                     baz()
       baz()
Y.merge();
var newObj = Y.merge(obj1, obj2, obj3);

 newObj             obj1            obj2   obj3

                    name             foo    bar

                    foo              bar    baz
Y.merge();
var newObj = Y.merge(obj1, obj2, obj3);

 newObj             obj1            obj2   obj3

  name              name             foo    bar

                    foo              bar    baz
Y.merge();
var newObj = Y.merge(obj1, obj2, obj3);

 newObj             obj1            obj2   obj3

  name              name             foo    bar
  foo               foo              bar    baz
Y.merge();
var newObj = Y.merge(obj1, obj2, obj3);

 newObj             obj1            obj2   obj3

  name              name             foo    bar
  foo               foo              bar    baz
  bar

  baz
Y.merge();
var newObj = Y.merge(obj1, obj2, obj3);

 newObj             obj1            obj2   obj3

  name              name             foo    bar
  foo               foo              bar    baz
  bar

  baz
OOP Module
YUI().use(”oop”, function(Y) {

      Y.clone();
      Y.aggregate();
      Y.augment();

});
Y.clone()
 var obj2 = Y.clone(obj1);




         obj2                obj1

   bing               bing
   bong               bong
   foo                foo
    bar                bar
    baz                baz
Y.aggregate()
Y.aggregate(obj2, obj1);



         obj2              obj1

   bing              bing
   bong              bong
   foo               foo
    bar               bam
                      baz
Y.aggregate()
Y.aggregate(obj2, obj1);



         obj2              obj1

   bing              bing
   bong              bong
   foo               foo
    bar               bam

    bam               baz

    baz
Y.augment()
 Y.augment(Y.ModelList, Y.ArrayList);

 var list = new Y.ModelList({ ... });

 list.each(function (item) { ... });



ModelList
 Constructor
               ArrayList                list
Prototype                              Prototype
               Constructor
 create                                 create
 init          Prototype                init
 each           each                    each
 item           item                   Prototype
                                        item
Y.augment()
 Y.augment(Y.ModelList, Y.ArrayList);

 var list = new Y.ModelList({ ... });

 list.each(function (item) { ... });




ModelList
 Constructor
                          ArrayList     list
Prototype
                          Constructor
                                        each        1. Copy
 create
 init                     Prototype
                                                    2. Construct
 each                      each                     3. Execute
 item                      item         Prototype
Y.plug()
  var overlay = new Y.Overlay({ ... });

  overlay.plug(Y.Plugin.Drag);

  overlay.dd.set('lock', true);

  overlay.unplug('dd');
Y.plug()
  var overlay = new Y.Overlay({ ... });

  overlay.plug(Y.Plugin.Drag);

  overlay.dd.set('lock', true);

  overlay.unplug('dd');




  Overlay
                                  overlay
  Constructor

  ATTRS
  Attributes                      Attributes
   x                              x

   y                              y
Y.plug()
  var overlay = new Y.Overlay({ ... });

  overlay.plug(Y.Plugin.Drag);

  overlay.dd.set('lock', true);

  overlay.unplug('dd');




  Overlay
                                                            Plugin.Dra
                                  overlay      overlay.dd
  Constructor
                                  dd           Attributes   g
                                                            Constructor
  ATTRS                           Attributes   lock

   x                              x                         ATTRS
                                                            Attributes
   y                              y                          lock
Y.plug()
  var overlay = new Y.Overlay({ ... });

  overlay.plug(Y.Plugin.Drag);

  overlay.dd.set('lock', true);

  overlay.unplug('dd');




  Overlay
                                                        Plugin.Dra
                               overlay     overlay.dd
  Constructor
                               dd          Attributes   g
                                                        Constructor
  ATTRS                       Attributes   lock

   x                              x                     ATTRS
   y                             y                      lock
Y.plug()
  var overlay = new Y.Overlay({ ... });

  overlay.plug(Y.Plugin.Drag);

  overlay.dd.set('lock', true);

  overlay.unplug('dd');




  Overlay
                                                            Plugin.Dra
                                  overlay      overlay.dd
  Constructor
                                  dd           Attributes   g
                                                            Constructor
  ATTRS                           Attributes   lock

   x                              x                         ATTRS
   y                              y                         lock
Y.substitute()

var greeting =
Y.substitute("Hello, {who}!", { who: "World" });
Y.bind()

Y.on('submit', Y.bind(function(e){
   e.halt();
   this.set('businessForDirections', null);
}, this), '#ymap-get-directions');
Y.delegate()

Y.one('#ymap-get-directions').delegate("keypress",
    function(e) { ... }, '>li.input');


node.delegate("myNode|keypress”, function(e)   { ... }, 'input');
node.on("myNode|keypress”, function(e) { ...   }, 'input');
node.delegate("myNode|keypress”, function(e)   { ... }, 'input');
node.delegate("myNode|keypress”, function(e)   { ... }, 'input');
Y.detach()

node.delegate("myNode|keypress", function(e) { ... }, 'input');
node.on("myNode|mouseenter", function(e) { ... });
node.on("myNode|mouseleave", function(e) { ... });
node.on("myNode|click", function(e) { ... });


Y.detach("myNode|*");
Y.Do

YUI().use("event-custom” , function(Y) {

      Y.Do.before(objClass.woo, obj1, 'foo');
      Y.Do.after(objClass.wee, obj2, 'bar');

});
What We’re Going to Cover
• Why YUI?

• YUI Tidbits


• Before we are done!
References
• http://yuilibrary.com/

• Images from Google, Flickr 

• YUI Theater - http://www.youtube.com/yuilibrary


          INDUSTRIAL STRENGTH
             BUILT TO LAST!!
Questions?

• Slides at http://slideshare.net/jaisanth/

• jaisanth@

• IRC freenode: #yui
THANK YOU!

More Related Content

PDF
响应式编程及框架
PDF
深入浅出Jscex
PDF
Jscex: Write Sexy JavaScript (中文)
PDF
The Evolution of Async-Programming (SD 2.0, JavaScript)
PDF
Jscex: Write Sexy JavaScript
KEY
ddd+scala
PDF
Javascript Uncommon Programming
KEY
openFrameworks 007 - utils
响应式编程及框架
深入浅出Jscex
Jscex: Write Sexy JavaScript (中文)
The Evolution of Async-Programming (SD 2.0, JavaScript)
Jscex: Write Sexy JavaScript
ddd+scala
Javascript Uncommon Programming
openFrameworks 007 - utils

What's hot (20)

PDF
Better Software: introduction to good code
PDF
Promise: async programming hero
PPTX
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
PDF
Simulator customizing & testing for Xcode 9
PDF
"let ECMAScript = 6"
PDF
Say It With Javascript
PDF
Android UI Development: Tips, Tricks, and Techniques
PDF
Статичный SQL в С++14. Евгений Захаров ➠ CoreHard Autumn 2019
PDF
Developer Experience i TypeScript. Najbardziej ikoniczne duo
KEY
連邦の白いヤツ 「Objective-C」
PDF
Functional microscope - Lenses in C++
PDF
citigroup January 13, 2006 - Reformatted Quarterly Financial Data Supplement...
PDF
this is ruby test
PPTX
Qt Memory Management & Signal and Slots
PPT
6.1.1一步一步学repast代码解释
PDF
Низкоуровневые оптимизации .NET-приложений
PDF
ES6 - Next Generation Javascript
PDF
Oxygine 2 d objects,events,debug and resources
PPTX
Lexical environment in ecma 262 5
Better Software: introduction to good code
Promise: async programming hero
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
Simulator customizing & testing for Xcode 9
"let ECMAScript = 6"
Say It With Javascript
Android UI Development: Tips, Tricks, and Techniques
Статичный SQL в С++14. Евгений Захаров ➠ CoreHard Autumn 2019
Developer Experience i TypeScript. Najbardziej ikoniczne duo
連邦の白いヤツ 「Objective-C」
Functional microscope - Lenses in C++
citigroup January 13, 2006 - Reformatted Quarterly Financial Data Supplement...
this is ruby test
Qt Memory Management & Signal and Slots
6.1.1一步一步学repast代码解释
Низкоуровневые оптимизации .NET-приложений
ES6 - Next Generation Javascript
Oxygine 2 d objects,events,debug and resources
Lexical environment in ecma 262 5

Viewers also liked (20)

PPTX
Context with Yahoo! BOSS
PPT
React js
PPTX
BOSS around the web
PPT
Hack with YUI
PPTX
YQL & Yahoo! Apis
PPTX
YUI (Advanced)
PDF
XpressEngine : 보드에서 CMS로
PDF
jQuery Trend
PDF
Universal Rendering
PDF
패스트캠퍼스 프론트엔드 강의 오리엔테이션
PDF
진화하는 소셜 큐레이션 서비스와 관련 기술
PDF
Fiddler: 웹 디버깅 프록시
PPTX
React in Native Apps - Meetup React - 20150409
PDF
그런데 스타트업이 뭐더라
PDF
React Native를 사용한
 초간단 커뮤니티 앱 제작
PPT
The Archived Canadian Patent Competitive Intelligence (2013/9/24)
PPT
The Archived Canadian Patent Competitive Intelligence (2012/4/3)
PPT
Thearchived Canadian US Patent Competitive Intelligence Database (2015/11/24)
PPT
The archived Canadian US Patent Competitive Intelligence Database (2014/12/9)
PDF
[오픈소스컨설팅]Data Source Password Encryption on JBoss EAP 6
Context with Yahoo! BOSS
React js
BOSS around the web
Hack with YUI
YQL & Yahoo! Apis
YUI (Advanced)
XpressEngine : 보드에서 CMS로
jQuery Trend
Universal Rendering
패스트캠퍼스 프론트엔드 강의 오리엔테이션
진화하는 소셜 큐레이션 서비스와 관련 기술
Fiddler: 웹 디버깅 프록시
React in Native Apps - Meetup React - 20150409
그런데 스타트업이 뭐더라
React Native를 사용한
 초간단 커뮤니티 앱 제작
The Archived Canadian Patent Competitive Intelligence (2013/9/24)
The Archived Canadian Patent Competitive Intelligence (2012/4/3)
Thearchived Canadian US Patent Competitive Intelligence Database (2015/11/24)
The archived Canadian US Patent Competitive Intelligence Database (2014/12/9)
[오픈소스컨설팅]Data Source Password Encryption on JBoss EAP 6

Similar to YUI Tidbits (20)

PPTX
Get started with YUI
PDF
YUI3 Modules
KEY
Inheritance patterns
KEY
Coffee Scriptでenchant.js
PDF
From YUI3 to K2
PDF
Demystifying Prototypes
PDF
Yui3在美团 2
KEY
Data Binding in qooxdoo
ZIP
YUI 3
PPTX
YUI Hidden Gems
PPTX
Extending javascript part one
PDF
Week 06 Modular Javascript_Brandon, S. H. Wu
PDF
JavaScript with YUI
PPTX
Embracing YUI3 and Frontend Perf
KEY
Achieving Performance Zen with YUI 3
KEY
Attribute
PDF
JavaScript Libraries Overview
PDF
从YUI2到YUI3看前端的演变
PPTX
Object Oriented JavaScript
Get started with YUI
YUI3 Modules
Inheritance patterns
Coffee Scriptでenchant.js
From YUI3 to K2
Demystifying Prototypes
Yui3在美团 2
Data Binding in qooxdoo
YUI 3
YUI Hidden Gems
Extending javascript part one
Week 06 Modular Javascript_Brandon, S. H. Wu
JavaScript with YUI
Embracing YUI3 and Frontend Perf
Achieving Performance Zen with YUI 3
Attribute
JavaScript Libraries Overview
从YUI2到YUI3看前端的演变
Object Oriented JavaScript

Recently uploaded (20)

PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Mushroom cultivation and it's methods.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
August Patch Tuesday
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Tartificialntelligence_presentation.pptx
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
A comparative analysis of optical character recognition models for extracting...
Diabetes mellitus diagnosis method based random forest with bat algorithm
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
cloud_computing_Infrastucture_as_cloud_p
MIND Revenue Release Quarter 2 2025 Press Release
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Mushroom cultivation and it's methods.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Programs and apps: productivity, graphics, security and other tools
Network Security Unit 5.pdf for BCA BBA.
August Patch Tuesday
Assigned Numbers - 2025 - Bluetooth® Document
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Tartificialntelligence_presentation.pptx
SOPHOS-XG Firewall Administrator PPT.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Heart disease approach using modified random forest and particle swarm optimi...
A comparative analysis of optical character recognition models for extracting...

YUI Tidbits

Editor's Notes

  • #4: A.K,.A a big waste of time
  • #53: Community ResourcesHelping you be successful in using Yahoo! Web Services isn&apos;t just about code and documentation. We want to make it easy for developers to get in touch with us and others who are using our services to answer and ask questions, toss around ideas, and give your feedback on what services we could offer next.ForumsYDN General BoardsDesign PatternsHotJobsSearchYOSAPTMusicWidgetsGeoPlanetOpenIDY! GroupsAddress BookAnswersFireEagleDel.icio.usTrafficFlickrMailSearchBOSSMapsJavaScriptSilverlightMerchant SolutionsSearch MarketingExceptional PerformanceYUIJava.NetFlashYDN EUAuthPHPPythonRubyPerlEventsWant your tech event appear in the YDN &apos;Upcoming Events&apos; stream on developer.yahoo.com homepage? List your event on Upcoming and then add it to the Yahoo! Developer Network group on Upcoming. If you are setting up a tech event for developers or designers and would like some Yahoo! involvement, please contact us.ExpertsYahoo! Developer Network is on the lookout for experts to share knowledge and help grow our developer communities. If you are interested in applying to moderate a *group* or forum and become an official expert, please contact us for more information. Remember, we pay in hugs, link-love and schwag only.BlogThe YDN blog is where we talk about our various Yahoo! developer offerings and YDN events around the world. Your comments welcome. If you have a suggestion for the blog or a blog post you&apos;d like to write about your experiences using our APIs or services, let us know. We are particularly interested in posts using Yahoo! APIs, tools, webservices and coverage of tech events. If you need inspiration or want to run some ideas by us, please contact us.YDN TheaterYDN Theater is chock-full of API deep dives, developer interviews, cutting- edge technologies, and recaps of tech events you wish you hadn&apos;t missed. If you have an idea for a story, please contact us.