SlideShare una empresa de Scribd logo
1 de 28
Descargar para leer sin conexión
Introduction to YUI 3
Jeff Craig
May 13, 2010
Jeff Craig () Introduction to YUI 3 May 13, 2010 1 / 21
About Me
Who am I?
Software Developer at Washington State University
Contact:
foxxtrot@foxxtrot.net
http://blog.foxxtrot.net/
twitter.com/foxxtrot
github.com/foxxtrot
Jeff Craig () Introduction to YUI 3 May 13, 2010 2 / 21
YUI What
What is YUI?
Housed and Developed at Yahoo!
YUI2 Released in 2006, still actively supported
YUI3 launched late 2009
Used across most Yahoo! properties, new development is in YUI3
Designed to be scalable, fast, secure, and modular
Jeff Craig () Introduction to YUI 3 May 13, 2010 3 / 21
YUI What
YUI3 Structure
Core
Component Infrastructure
Utilities
Widgets
Developer Tools
Jeff Craig () Introduction to YUI 3 May 13, 2010 4 / 21
YUI What
YUI3 Structure
Core
Lang, UA, Queue, Object, Get, Array, Node, Event
Component Infrastructure
Utilities
Widgets
Developer Tools
Jeff Craig () Introduction to YUI 3 May 13, 2010 4 / 21
YUI What
YUI3 Structure
Core
Component Infrastructure
Base, Attribute, Plugin, Widget
Utilities
Widgets
Developer Tools
Jeff Craig () Introduction to YUI 3 May 13, 2010 4 / 21
YUI What
YUI3 Structure
Core
Component Infrastructure
Utilities
Animation, Cache, Cookie, DataSchema, IO, JSON, ImageLoader,
Internationalization, etc.
Widgets
Developer Tools
Jeff Craig () Introduction to YUI 3 May 13, 2010 4 / 21
YUI What
YUI3 Structure
Core
Component Infrastructure
Utilities
Widgets
Overlay, Slider, TabView, GridView
Developer Tools
Jeff Craig () Introduction to YUI 3 May 13, 2010 4 / 21
YUI What
YUI3 Structure
Core
Component Infrastructure
Utilities
Widgets
Developer Tools
Console, Profiler, Test
Jeff Craig () Introduction to YUI 3 May 13, 2010 4 / 21
YUI Why?
Why YUI3?
Modular: Load only the code you need.
Flexible: Base functionality provides flexible Attribute and Plugin
systems
Complete: Tons of utilities available now, and widgets are coming
Fast: Demonstrable faster at common tasks, and fast enough for one
of the worlds largest websites.
Jeff Craig () Introduction to YUI 3 May 13, 2010 5 / 21
YUI Why Not?
Why not YUI3?
Your existing codebase works
Many widgets haven’t been ported yet.
Jeff Craig () Introduction to YUI 3 May 13, 2010 6 / 21
YUI Why Not?
Why not YUI3?
Your existing codebase works
Many widgets haven’t been ported yet.
Some will not be.
Jeff Craig () Introduction to YUI 3 May 13, 2010 6 / 21
YUI SimpleYUI
SimpleYUI
Introduced with YUI 3.2
Eliminates the Sandbox
Fastest way to get started with YUI3
Provides Node/Events, Transitions, IO
Jeff Craig () Introduction to YUI 3 May 13, 2010 7 / 21
YUI SimpleYUI
Why not use SimpleYUI?
There are performance benefits to using the module pattern
There is safety in the sandbox
You have more control in standard YUI
Jeff Craig () Introduction to YUI 3 May 13, 2010 8 / 21
YUI Community
YUI3 and the Community
With YUI3, the team refocused on open-source. They launched YUI3 with
a public bug tracker and forums, and put the source up on GitHub.
In October 2009, the Gallery launched, providing a mechanism for modules
to be shared easily outside of the core of YUI, including offering hosting on
the Yahoo! CDN for modules, and easy inclusion within YUI3 projects.
In early 2010, the YUI Team began hosting ”YUI Open Hours” a periodic
conference call.
Jeff Craig () Introduction to YUI 3 May 13, 2010 9 / 21
YUI Resources
YUI Resources
http://yuilibrary.com/
http://developer.yahoo.com/yui/3/
http://github.com/yui/
http://yuiblog.com/
http://twitter.com/miraglia/yui/members
Jeff Craig () Introduction to YUI 3 May 13, 2010 10 / 21
YUI Standard Utilities
Node
Y.one(’#nav’);
Y.all(’#nav li’);
Y.one returns a ’Node’
Y.all returns a ’NodeList’
Jeff Craig () Introduction to YUI 3 May 13, 2010 11 / 21
YUI Standard Utilities
Node Methods
var input = Y.one(’input[type=text]’);
input.addClass(’hide’); // Add the ’hide’ class to the node
input.removeClass(’hide’);
input.toggleClass(’hide’);
input.get(’value’);
input.getStyle(’display’);
input.test(’.hide’); // Tests if the node matches a selctor
Jeff Craig () Introduction to YUI 3 May 13, 2010 12 / 21
YUI Standard Utilities
NodeList Methods
var items = Y.one(’li’);
items.filter(’.hidden’);
items.even().addClass(’even’);
items.odd().addClass(’odd’);
items.item(4); // NOT an array-like object
items.size();
items.each(function(item, index, list) {
// Treat this kind of like a for loop.
});
Jeff Craig () Introduction to YUI 3 May 13, 2010 13 / 21
YUI Standard Utilities
Events
Y.on(’click’, handler, ’#actionButton’);
handler = function(e) {
// e is a DOM Event Facade
// Same betwen all browsers
e.halt(); // Stop propogation and default action
e.preventDefault();
e.stopPropogation();
}
Same syntax as custom events
Support for touch events
Jeff Craig () Introduction to YUI 3 May 13, 2010 14 / 21
YUI Standard Utilities
Event Delegation
Y.delegate(’click’, handler, ’#container’, selector);
Assign one event, on the container, but only call the handler on
children that match the selector.
Jeff Craig () Introduction to YUI 3 May 13, 2010 15 / 21
YUI Standard Utilities
Event Delegation
Y.delegate(’click’, handler, ’#container’, selector);
Assign one event, on the container, but only call the handler on
children that match the selector.
Doesn’t fix non-bubbling events, like change-events in Internet
Explorer
Jeff Craig () Introduction to YUI 3 May 13, 2010 15 / 21
YUI Standard Utilities
YUI3 Templating
TEMPLATE = "<li><a href=’{link}’>{label}</a></li>";
data = {
link: "http://blog.foxxtrot.net/",
label: "My Blog"
};
Y.Lang.sub(TEMPLATE, data);
Jeff Craig () Introduction to YUI 3 May 13, 2010 16 / 21
YUI Standard Utilities
Advanced YUI3 Templating
TEMPLATE = "<li class=’{selected}’><a href=’{link}’>{label}</a
data = {
link: "http://blog.foxxtrot.net/",
label: "My Blog",
selected: true
};
Y.use(’substitutue’, function(Y) {
Y.substitute(TEMPLATE, data,
function(key, value) {
if(key === "selected") {
return value ? "selected" : "";
}
return value;
});
});
Jeff Craig () Introduction to YUI 3 May 13, 2010 17 / 21
YUI AJAX
Server Calls
Y.io("/path/to/request", {
method: ’GET’,
data: ’field1=value&field2=3’,
on: {
start: handler,
complete: handler,
success: handler,
failure: handler,
end: handler
}
sync: false,
timeout: 2000
});
Jeff Craig () Introduction to YUI 3 May 13, 2010 18 / 21
YUI AJAX
JSON
Y.JSON.stringify({
name: "Jeff Craig",
nick: "foxxtrot",
session: "Intro to YUI3"
});
Y.JSON.parse("{’event’: ’Palouse Code Camp’,
’date’: ’2010.10.30’}");
Jeff Craig () Introduction to YUI 3 May 13, 2010 19 / 21
YUI AJAX
Transistions
Y.one(’#demo’).transition({
duration: 1, // seconds
easing: ’ease-out’,
height: 0,
width: 0,
left: ’150px’,
top: ’100px’,
opacity: 0
}, function() { Y.one(’#demo’).destroy(true); } );
Jeff Craig () Introduction to YUI 3 May 13, 2010 20 / 21
YUI End Notes
Links
YUI:
http://yuilibrary.com/
http://developer.yahoo.com/yui/3/
http://github.com/yui/
http://yuiblog.com/
http://twitter.com/miraglia/yui/members
Me:
foxxtrot@foxxtrot.net
http://blog.foxxtrot.net/
twitter.com/foxxtrot
github.com/foxxtrot
Jeff Craig () Introduction to YUI 3 May 13, 2010 21 / 21

Más contenido relacionado

Destacado

Adverbs of frequency
Adverbs of frequencyAdverbs of frequency
Adverbs of frequencymarielasiri
 
Asesoría en creación e implementación de Franquicias por ELG ASESORES PERÚ.
Asesoría en creación e implementación de Franquicias por ELG ASESORES PERÚ.Asesoría en creación e implementación de Franquicias por ELG ASESORES PERÚ.
Asesoría en creación e implementación de Franquicias por ELG ASESORES PERÚ.ELG Asesores PERU
 
Produttività in Italia: una chimera?
Produttività in Italia: una chimera?Produttività in Italia: una chimera?
Produttività in Italia: una chimera?Quattrogatti.info
 
Università e mercato del lavoro
Università e mercato del lavoro Università e mercato del lavoro
Università e mercato del lavoro Quattrogatti.info
 
Sky gate presentation
Sky gate presentationSky gate presentation
Sky gate presentationSachin Tomar
 

Destacado (7)

Adverbs of frequency
Adverbs of frequencyAdverbs of frequency
Adverbs of frequency
 
Asesoría en creación e implementación de Franquicias por ELG ASESORES PERÚ.
Asesoría en creación e implementación de Franquicias por ELG ASESORES PERÚ.Asesoría en creación e implementación de Franquicias por ELG ASESORES PERÚ.
Asesoría en creación e implementación de Franquicias por ELG ASESORES PERÚ.
 
Chrysler 300
Chrysler 300Chrysler 300
Chrysler 300
 
Produttività in Italia: una chimera?
Produttività in Italia: una chimera?Produttività in Italia: una chimera?
Produttività in Italia: una chimera?
 
Dyes classification
Dyes   classificationDyes   classification
Dyes classification
 
Università e mercato del lavoro
Università e mercato del lavoro Università e mercato del lavoro
Università e mercato del lavoro
 
Sky gate presentation
Sky gate presentationSky gate presentation
Sky gate presentation
 

Similar a Introduction to YUI3 - Palouse Code Camp 2010

Advanced YUI3: Module Creation and the Component Infrastructure
Advanced YUI3: Module Creation and the Component InfrastructureAdvanced YUI3: Module Creation and the Component Infrastructure
Advanced YUI3: Module Creation and the Component InfrastructureJeff Craig
 
YUI 3 Loading Strategies - YUIConf2010
YUI 3 Loading Strategies - YUIConf2010YUI 3 Loading Strategies - YUIConf2010
YUI 3 Loading Strategies - YUIConf2010Caridy Patino
 
YUI3 and AlloyUI Introduction for Pernambuco.JS 2012
YUI3 and AlloyUI Introduction for Pernambuco.JS 2012YUI3 and AlloyUI Introduction for Pernambuco.JS 2012
YUI3 and AlloyUI Introduction for Pernambuco.JS 2012Eduardo Lundgren
 
Creating custom modules using YUI3
Creating custom modules using YUI3Creating custom modules using YUI3
Creating custom modules using YUI3Gonzalo Cordero
 
yui3 is Sexy - 使用 YUI 3 的 Sexy Part !
yui3 is Sexy - 使用 YUI 3 的 Sexy Part !yui3 is Sexy - 使用 YUI 3 的 Sexy Part !
yui3 is Sexy - 使用 YUI 3 的 Sexy Part !Joseph Chiang
 
YUI Test The Next Generation (YUIConf 2010)
YUI Test The Next Generation (YUIConf 2010)YUI Test The Next Generation (YUIConf 2010)
YUI Test The Next Generation (YUIConf 2010)Nicholas Zakas
 
Build your web apps with yql and yui
Build your web apps with yql and yuiBuild your web apps with yql and yui
Build your web apps with yql and yuiISOCHK
 
Making Rich Internet Applications Accessible Through jQuery
Making Rich Internet Applications Accessible Through jQueryMaking Rich Internet Applications Accessible Through jQuery
Making Rich Internet Applications Accessible Through jQueryAEGIS-ACCESSIBLE Projects
 
Sakai uPortal Integration Options
Sakai uPortal Integration OptionsSakai uPortal Integration Options
Sakai uPortal Integration OptionsJohn Lewis
 
Y hack-china-2013
Y hack-china-2013Y hack-china-2013
Y hack-china-2013Syu-jhih Wu
 
Feature Bits at LSSC10
Feature  Bits at LSSC10Feature  Bits at LSSC10
Feature Bits at LSSC10Erik Sowa
 
Introduction to YUI - IIT Kharagpur
Introduction to YUI - IIT KharagpurIntroduction to YUI - IIT Kharagpur
Introduction to YUI - IIT KharagpurHarsha Vashisht
 
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 2010Adam Moore
 
Feature Bits at DevOpsDays 2010 US
Feature Bits at DevOpsDays 2010 USFeature Bits at DevOpsDays 2010 US
Feature Bits at DevOpsDays 2010 USErik Sowa
 

Similar a Introduction to YUI3 - Palouse Code Camp 2010 (20)

Advanced YUI3: Module Creation and the Component Infrastructure
Advanced YUI3: Module Creation and the Component InfrastructureAdvanced YUI3: Module Creation and the Component Infrastructure
Advanced YUI3: Module Creation and the Component Infrastructure
 
YUI open for all !
YUI open for all !YUI open for all !
YUI open for all !
 
YUI 3 Loading Strategies - YUIConf2010
YUI 3 Loading Strategies - YUIConf2010YUI 3 Loading Strategies - YUIConf2010
YUI 3 Loading Strategies - YUIConf2010
 
YUI3 and AlloyUI Introduction for Pernambuco.JS 2012
YUI3 and AlloyUI Introduction for Pernambuco.JS 2012YUI3 and AlloyUI Introduction for Pernambuco.JS 2012
YUI3 and AlloyUI Introduction for Pernambuco.JS 2012
 
Creating custom modules using YUI3
Creating custom modules using YUI3Creating custom modules using YUI3
Creating custom modules using YUI3
 
Yui intro
Yui introYui intro
Yui intro
 
yui3 is Sexy - 使用 YUI 3 的 Sexy Part !
yui3 is Sexy - 使用 YUI 3 的 Sexy Part !yui3 is Sexy - 使用 YUI 3 的 Sexy Part !
yui3 is Sexy - 使用 YUI 3 的 Sexy Part !
 
YUI Test The Next Generation (YUIConf 2010)
YUI Test The Next Generation (YUIConf 2010)YUI Test The Next Generation (YUIConf 2010)
YUI Test The Next Generation (YUIConf 2010)
 
Build your web apps with yql and yui
Build your web apps with yql and yuiBuild your web apps with yql and yui
Build your web apps with yql and yui
 
Hack with YUI
Hack with YUIHack with YUI
Hack with YUI
 
Making Rich Internet Applications Accessible Through jQuery
Making Rich Internet Applications Accessible Through jQueryMaking Rich Internet Applications Accessible Through jQuery
Making Rich Internet Applications Accessible Through jQuery
 
Introduction to YUI
Introduction to YUIIntroduction to YUI
Introduction to YUI
 
Sakai uPortal Integration Options
Sakai uPortal Integration OptionsSakai uPortal Integration Options
Sakai uPortal Integration Options
 
Y hack-china-2013
Y hack-china-2013Y hack-china-2013
Y hack-china-2013
 
Feature Bits at LSSC10
Feature  Bits at LSSC10Feature  Bits at LSSC10
Feature Bits at LSSC10
 
Yui mixer
Yui mixerYui mixer
Yui mixer
 
Introduction to YUI - IIT Kharagpur
Introduction to YUI - IIT KharagpurIntroduction to YUI - IIT Kharagpur
Introduction to YUI - IIT Kharagpur
 
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
 
YUI3 - IIT Madras HackU
YUI3 - IIT Madras HackU YUI3 - IIT Madras HackU
YUI3 - IIT Madras HackU
 
Feature Bits at DevOpsDays 2010 US
Feature Bits at DevOpsDays 2010 USFeature Bits at DevOpsDays 2010 US
Feature Bits at DevOpsDays 2010 US
 

Último

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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...Martijn de Jong
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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 Processorsdebabhi2
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Introduction to YUI3 - Palouse Code Camp 2010

  • 1. Introduction to YUI 3 Jeff Craig May 13, 2010 Jeff Craig () Introduction to YUI 3 May 13, 2010 1 / 21
  • 2. About Me Who am I? Software Developer at Washington State University Contact: foxxtrot@foxxtrot.net http://blog.foxxtrot.net/ twitter.com/foxxtrot github.com/foxxtrot Jeff Craig () Introduction to YUI 3 May 13, 2010 2 / 21
  • 3. YUI What What is YUI? Housed and Developed at Yahoo! YUI2 Released in 2006, still actively supported YUI3 launched late 2009 Used across most Yahoo! properties, new development is in YUI3 Designed to be scalable, fast, secure, and modular Jeff Craig () Introduction to YUI 3 May 13, 2010 3 / 21
  • 4. YUI What YUI3 Structure Core Component Infrastructure Utilities Widgets Developer Tools Jeff Craig () Introduction to YUI 3 May 13, 2010 4 / 21
  • 5. YUI What YUI3 Structure Core Lang, UA, Queue, Object, Get, Array, Node, Event Component Infrastructure Utilities Widgets Developer Tools Jeff Craig () Introduction to YUI 3 May 13, 2010 4 / 21
  • 6. YUI What YUI3 Structure Core Component Infrastructure Base, Attribute, Plugin, Widget Utilities Widgets Developer Tools Jeff Craig () Introduction to YUI 3 May 13, 2010 4 / 21
  • 7. YUI What YUI3 Structure Core Component Infrastructure Utilities Animation, Cache, Cookie, DataSchema, IO, JSON, ImageLoader, Internationalization, etc. Widgets Developer Tools Jeff Craig () Introduction to YUI 3 May 13, 2010 4 / 21
  • 8. YUI What YUI3 Structure Core Component Infrastructure Utilities Widgets Overlay, Slider, TabView, GridView Developer Tools Jeff Craig () Introduction to YUI 3 May 13, 2010 4 / 21
  • 9. YUI What YUI3 Structure Core Component Infrastructure Utilities Widgets Developer Tools Console, Profiler, Test Jeff Craig () Introduction to YUI 3 May 13, 2010 4 / 21
  • 10. YUI Why? Why YUI3? Modular: Load only the code you need. Flexible: Base functionality provides flexible Attribute and Plugin systems Complete: Tons of utilities available now, and widgets are coming Fast: Demonstrable faster at common tasks, and fast enough for one of the worlds largest websites. Jeff Craig () Introduction to YUI 3 May 13, 2010 5 / 21
  • 11. YUI Why Not? Why not YUI3? Your existing codebase works Many widgets haven’t been ported yet. Jeff Craig () Introduction to YUI 3 May 13, 2010 6 / 21
  • 12. YUI Why Not? Why not YUI3? Your existing codebase works Many widgets haven’t been ported yet. Some will not be. Jeff Craig () Introduction to YUI 3 May 13, 2010 6 / 21
  • 13. YUI SimpleYUI SimpleYUI Introduced with YUI 3.2 Eliminates the Sandbox Fastest way to get started with YUI3 Provides Node/Events, Transitions, IO Jeff Craig () Introduction to YUI 3 May 13, 2010 7 / 21
  • 14. YUI SimpleYUI Why not use SimpleYUI? There are performance benefits to using the module pattern There is safety in the sandbox You have more control in standard YUI Jeff Craig () Introduction to YUI 3 May 13, 2010 8 / 21
  • 15. YUI Community YUI3 and the Community With YUI3, the team refocused on open-source. They launched YUI3 with a public bug tracker and forums, and put the source up on GitHub. In October 2009, the Gallery launched, providing a mechanism for modules to be shared easily outside of the core of YUI, including offering hosting on the Yahoo! CDN for modules, and easy inclusion within YUI3 projects. In early 2010, the YUI Team began hosting ”YUI Open Hours” a periodic conference call. Jeff Craig () Introduction to YUI 3 May 13, 2010 9 / 21
  • 17. YUI Standard Utilities Node Y.one(’#nav’); Y.all(’#nav li’); Y.one returns a ’Node’ Y.all returns a ’NodeList’ Jeff Craig () Introduction to YUI 3 May 13, 2010 11 / 21
  • 18. YUI Standard Utilities Node Methods var input = Y.one(’input[type=text]’); input.addClass(’hide’); // Add the ’hide’ class to the node input.removeClass(’hide’); input.toggleClass(’hide’); input.get(’value’); input.getStyle(’display’); input.test(’.hide’); // Tests if the node matches a selctor Jeff Craig () Introduction to YUI 3 May 13, 2010 12 / 21
  • 19. YUI Standard Utilities NodeList Methods var items = Y.one(’li’); items.filter(’.hidden’); items.even().addClass(’even’); items.odd().addClass(’odd’); items.item(4); // NOT an array-like object items.size(); items.each(function(item, index, list) { // Treat this kind of like a for loop. }); Jeff Craig () Introduction to YUI 3 May 13, 2010 13 / 21
  • 20. YUI Standard Utilities Events Y.on(’click’, handler, ’#actionButton’); handler = function(e) { // e is a DOM Event Facade // Same betwen all browsers e.halt(); // Stop propogation and default action e.preventDefault(); e.stopPropogation(); } Same syntax as custom events Support for touch events Jeff Craig () Introduction to YUI 3 May 13, 2010 14 / 21
  • 21. YUI Standard Utilities Event Delegation Y.delegate(’click’, handler, ’#container’, selector); Assign one event, on the container, but only call the handler on children that match the selector. Jeff Craig () Introduction to YUI 3 May 13, 2010 15 / 21
  • 22. YUI Standard Utilities Event Delegation Y.delegate(’click’, handler, ’#container’, selector); Assign one event, on the container, but only call the handler on children that match the selector. Doesn’t fix non-bubbling events, like change-events in Internet Explorer Jeff Craig () Introduction to YUI 3 May 13, 2010 15 / 21
  • 23. YUI Standard Utilities YUI3 Templating TEMPLATE = "<li><a href=’{link}’>{label}</a></li>"; data = { link: "http://blog.foxxtrot.net/", label: "My Blog" }; Y.Lang.sub(TEMPLATE, data); Jeff Craig () Introduction to YUI 3 May 13, 2010 16 / 21
  • 24. YUI Standard Utilities Advanced YUI3 Templating TEMPLATE = "<li class=’{selected}’><a href=’{link}’>{label}</a data = { link: "http://blog.foxxtrot.net/", label: "My Blog", selected: true }; Y.use(’substitutue’, function(Y) { Y.substitute(TEMPLATE, data, function(key, value) { if(key === "selected") { return value ? "selected" : ""; } return value; }); }); Jeff Craig () Introduction to YUI 3 May 13, 2010 17 / 21
  • 25. YUI AJAX Server Calls Y.io("/path/to/request", { method: ’GET’, data: ’field1=value&field2=3’, on: { start: handler, complete: handler, success: handler, failure: handler, end: handler } sync: false, timeout: 2000 }); Jeff Craig () Introduction to YUI 3 May 13, 2010 18 / 21
  • 26. YUI AJAX JSON Y.JSON.stringify({ name: "Jeff Craig", nick: "foxxtrot", session: "Intro to YUI3" }); Y.JSON.parse("{’event’: ’Palouse Code Camp’, ’date’: ’2010.10.30’}"); Jeff Craig () Introduction to YUI 3 May 13, 2010 19 / 21
  • 27. YUI AJAX Transistions Y.one(’#demo’).transition({ duration: 1, // seconds easing: ’ease-out’, height: 0, width: 0, left: ’150px’, top: ’100px’, opacity: 0 }, function() { Y.one(’#demo’).destroy(true); } ); Jeff Craig () Introduction to YUI 3 May 13, 2010 20 / 21