Geekup Leeds - Why the YUI?

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    6 Favorites

    Geekup Leeds - Why the YUI? - Presentation Transcript

    1. Y the YUI?
      • Christian Heilmann,
      • GeekUp Leeds, February 2008
    2. Why any library?
    3. Because not everybody likes pain.
    4. Browsers have shifty eyes and will steal your lunch money!
    5. Memory leaks, creative standards support and syntax oddities make your life less fun
    6. So why the YUI?
    7. First of all, please stop the fanboy fights.
    8. All good libraries want to do the same thing: make your life easier.
    9. YUI has one big benefit though:
    10. It is Dr.Martens for the web: Industrial strength for your solutions.
    11. Safety and Maintainability.
    12. Namespacing included.
    13. Let’s guess what the following things are...
    14. YAHOO.util.Dom YAHOO.util.Event YAHOO.widget.ColorPicker
    15. Roll your own: YAHOO.namespace(‘GeekUp’); YAHOO.GeekUp.getRoundIn = function(){...}
    16. Mess around with JavaScript: YAHOO.lang. ...
    17. OO-goodness for JS, Testing for types: isArray, isBoolean, isFunction, isNull, isNumber isObject, isString, isUndefined, isValue
    18. React to User Agents: YAHOO.env.ua if(YAHOO.env.ua.ie === 5){ alert(“you hate developers,right?”); }
    19. OMG! It is so HUGE!
    20. Hosting by YAHOO (CDN, gzipped, minified)
    21. Include on-demand, either with YAHOO loader, get or YAHOO_config.
    22. Take control with Custom Events.
    23. You do know what happens when and how and you can react to it.
    24. Yes, you can use CSS selectors! (as a query and as a filter)
    25. You have full API documentation, examples and cheatsheets - even offline! (Elephants, Tigers and Bears are extra.)
    26. Oh, and the YUI is *not* a JavaScript library!
    27. It is a framework of JS, CSS, Design Patterns and Widgets.
    28. Developed and tested for use in Yahoo! properties, and handed over to you for free! (BSD license FTW)
    29. Go, fetch! http://developer.yahoo.com/yui
    30. Tips for quick YUI development:
    31. Get an IDE that supports it (Aptana, Eclipse, TextMate Bundle)
    32. Make your own shortcuts and nest them in a module pattern.
    33. YAHOO.namespace('geekup'); YAHOO.geekup.doStuff = function(){ function handler(){ if(YAHOO.util.Dom.hasClass(this, 'hl')){ YAHOO.util.Dom.removeClass(this, 'hl'); } else { YAHOO.util.Dom.addClass(this, 'hl'); } } var nav = YAHOO.util.Dom.get('nav'); var lis = YAHOO.util.Selector.query('#nav li') for(var i=0;lis[i];i++){ YAHOO.util.Event.addListener(lis[i], 'click', handler); } }();
    34. YAHOO.namespace('geekup'); YAHOO.geekup.doStuff = function(){ var YD = YAHOO.util.Dom, var YE = YAHOO.util.Event; var $ = YAHOO.util.Selector.query; function handler(){ if(YD.hasClass(this, 'hl')){ YD.removeClass(this, 'hl'); } else { YD.addClass(this, 'hl'); } } var lis = $('#nav li') for(var i=0;lis[i];i++){ YE.on(lis[i], 'click', handler); } }();
    35. YAHOO.namespace('geekup'); YAHOO.geekup.doStuff = function(){ var YD = YAHOO.util.Dom, var YE = YAHOO.util.Event; var $ = YAHOO.util.Selector.query; function handler(){ if(YD.hasClass(this, 'hl')){ YD.removeClass(this, 'hl'); } else { YD.addClass(this, 'hl'); } } var lis = $('#nav li') for(var i=0;lis[i];i++){ YE.on(lis[i], 'click', handler); } }();
    36. YAHOO.namespace('geekup'); YAHOO.geekup.doStuff = function(){ var YD = YAHOO.util.Dom; var YE = YAHOO.util.Event; var $ = YAHOO.util.Selector.query; YE.on($('#nav li'),'click',function(){ if(YD.hasClass(this, 'hl')){ YD.removeClass(this, 'hl'); } else { YD.addClass(this, 'hl'); } }); }();
    37. YAHOO.namespace('geekup'); YAHOO.geekup.doStuff = function(){ var YD = YAHOO.util.Dom; var YE = YAHOO.util.Event; var $ = YAHOO.util.Selector.query; YE.on($('#nav li'),'click',function(){ if(YD.hasClass(this, 'hl')){ YD.removeClass(this, 'hl'); } else { YD.addClass(this, 'hl'); } }); }();
    38. YAHOO.namespace('geekup'); YAHOO.geekup.doStuff = function(){ var YD = YAHOO.util.Dom; var YE = YAHOO.util.Event; YE.on(YD.get('nav'),'click',function(e){ var t = YE.getTarget(e); if(t.nodeName.toLowerCase()==='li'){ if(YD.hasClass(t, 'hl')){ YD.removeClass(t, 'hl'); } else { YD.addClass(t, 'hl'); } } }); }();
    39. Thanks, now tell me what you’d like to know.

    + Christian HeilmannChristian Heilmann, 2 years ago

    custom

    9581 views, 6 favs, 12 embeds more stats

    My presentation at GeekUp in Leeds, UK about the in more

    More info about this document

    CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

    Go to text version

    • Total Views 9581
      • 9084 on SlideShare
      • 497 from embeds
    • Comments 0
    • Favorites 6
    • Downloads 92
    Most viewed embeds
    • 176 views on http://www.wait-till-i.com
    • 164 views on http://developer.yahoo.com
    • 121 views on http://developer.yahoo.net
    • 15 views on http://docupia.tistory.com
    • 9 views on http://icant.co.uk

    more

    All embeds
    • 176 views on http://www.wait-till-i.com
    • 164 views on http://developer.yahoo.com
    • 121 views on http://developer.yahoo.net
    • 15 views on http://docupia.tistory.com
    • 9 views on http://icant.co.uk
    • 4 views on http://all-for-women.com
    • 3 views on http://localhost
    • 1 views on file://
    • 1 views on http://nanotechrobotics.com
    • 1 views on http://geneticnanobot.com
    • 1 views on http://nanotechnologyproducts.org
    • 1 views on http://retinalprojectors.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories