Friday, November 11, 2011

YUI Examples


Core

Event

Simple DOM EventsUse the Event Utility to attach simple DOM event handlers.
Creating an Arrow Event for DOM SubscriptionUsing the synthetic event API to create a DOM event that fires in response to arrow keys being pressed.
Supporting A Swipe Left GestureSupporting cross-device swipe gestures, using the event-move gesture events

Node

Set and Get PropertiesUsing selectors and property accessors with Node.
DOM MethodsUsing DOM methods with Node.
Handling DOM EventsListening for DOM events with Node instances.
NodeListNodeList provides Node functionality for multiple nodes.
Delegating Node EventsUsing a single event listener to handle events on multiple nodes.
Node PositioningThis example demonstrates how to position an element in page coordinates.
Node StylingThis example demonstrates how to set styles and get style information.
Adding Node ContentThis example demonstrates how to insert content into a Node.
Showing and HidingThis example demonstrates how to show and hide a Node.

YUI Global Object

YUI CoreSetting up a YUI Instance
Multiple InstancesWorking with multiple YUI instances.
YUI Loader - Dynamically Adding YUI and External ModulesOn-demand loading of YUI and non-YUI assets
Create Class Hierarchies with `extend`Create Class Hierarchies with `extend`
Compose Classes of Objects with `augment`Creating a composition-based class structure using `augment`
Add Behaviors to Objects with `mix`Add behaviors to objects or static classes with `mix`
Combine Data Sets with `merge`Combine data sets and create shallow copies of objects with `merge`
Check Data Types with `Lang`Check data types with the `Lang Utilities`
Browser Detection with `UA`Get information about the current user agent with `UA`
Working with YUI 2 in 3Working with YUI 2 in 3
Natively use YUI Gallery ModulesNatively use YUI Gallery Modules

CSS

CSS Base

Global (Page-Level) ExampleWhen CSS Base is included in a page it provides consistent and basic cross-browser styling for HTML elements.
Contextual ExampleCSS Base applied to a portion of a page based on the location of a class value.

CSS Fonts

Global (Page-Level) ExampleWhen CSS Fonts is included in a page, it applies a baseline font treatment to all HTML elements. This baseline is Arial at the equivalent of 13px size and 16px line-height.
Contextual ExampleUse the alternate contextual version of YUI Fonts to have precise control over which regions of the page are targeted.
Setting Font SizeDefine all non-baseline sizes in percentages when using YUI Fonts.

CSS Grids

Using Grid UnitsEach unit has a className that provides its percentage width.
Fixed Page TemplateThis is a template for creating fixed-width layouts.
Fluid Page TemplateThis is a template for creating fluid layouts.
Aligning Grid UnitsBasic CSS properties are leveraged to horizontally and vertically align units.

CSS Reset

Global (Page-Level) ExampleWhen CSS Reset is included in a page, it removes the browser-provided styling for HTML elements.
Contextual ExampleCSS Reset applied to a portion of a page based on the location of a class value.

Developer Tools

Console

Creating a Console for DebuggingThe basics of setting up a Console
YUI Configuration to Filter Log MessagesUsing your YUI instance configuration to filter which messages are reported in the Console
Creating a Universal ConsoleUsing the Console's logSource attribute to consolidate log messages from multiple YUI instances into one Console

ConsoleFilters Plugin

Using the ConsoleFilters PluginAdding the ConsoleFilters plugin to a Console instance for more granular run time log message filtering

Profiler

Simple Profiling ExampleDemonstrates basic usage of the Profiler for profiling functions.
Object Profiling ExampleDemonstrates usage of the Profiler for profiling objects.

Test

Simple Testing ExampleDemonstrates basic usage of YUI Test for setting up and running tests.
Advanced Test OptionsDemonstrates how to use advanced testing features such as defining tests that should fail, tests that should be ignored, and tests that should throw an error.
Array ProcessingDemonstrates how to use the ArrayAssert object to test array data.
Asynchronous TestingDemonstrates basic asynchronous tests.
Asynchronous Event TestingDemonstrates using events with asynchronous tests.

Infrastructure

App Framework

Todo ListA basic todo list built with the Model, Model List, and View components.

Attribute

Basic Attribute ConfigurationUse the Attribute API to define, set and get attribute values.
Read-Only and Write-Once AttributesConfigure attributes to be readOnly or writeOnce.
Attribute Change EventsHow to listen for changes in attribute values.
Attribute Based Speed DatingCreate a basic SpeedDater class, with Attribute support.
Attribute Event Based Speed DatingRefactors the basic Speed Dating example, to use attribute change events to update rendered elements, and have two instances react to another.
Attribute Getters, Setters and ValidatorsAdd custom methods to get and set attribute values and provide validation support.

EventTarget

Custom Event Bubbling and BehaviorsPublish an event with a default behavior, as well as behaviors for reacting to preventing the default or stopping bubbling.

Widget

Extending the Base Widget ClassShows how to extend the base widget class, to create your own Widgets.
Creating Custom Widget Classes With ExtensionsShows how to use Base.create and mix/match extensions to create custom Widget classes.
Creating a Widget PluginShows how to create an IO plugin for Widget.
Creating a Simple Tooltip Widget With ExtensionsShows how to extend the Widget class, and add WidgetPosition and WidgetStack to create a Tooltip widget class.
Creating a Hierarchical ListBox WidgetShows how to extend the Widget class, and add WidgetParent and WidgetChild to create a simple ListBox widget.

Utilities

Anim

Basic AnimationCreating and using a simple animation.
Easing EffectsThe Animation Utility allows you to implement 'easing effects' — for example, when an animation gradually slows down as it nears completion, that's an easing effect known as 'ease-in'. This example shows you how to use easing effects with your animations.
Animating ColorsColor animations can be effective indicators of state during the lifespan of a dynamic page. This example shows you how to animate color attributes of an element.
Alternating IterationsThe direction attribute can be used to reverse the animation on alternate iterations.
Animating XY PositionThis example shows you how to animate the xy coordinates of an element.
Animating Along a Curved PathThis example demonstrates animating an element along a curved path using bezier control points.
Reversing an AnimationThe reverse attribute allows you to change the run direction of an animation.
Using the End EventThis example demonstrates how to use the end event.

AsyncQueue

Building a UI with AsyncQueueThis example employs AsyncQueue to incrementally construct an application interface; this illustrates the approach you'd take to allow chunked rendering of the UI in a process-intensive application.

Cache

Basic CachingBasic caching functionality with the Cache Utility.
Offline CachingOffline caching implements HTML 5 localStorage when available, to allow data to persist across browser sessions.
Simple Cookie ExampleDemonstrates basic usage of the Cookie utility for reading and writing cookies.
Advanced Cookie ExampleDemonstrates using the Cookie utility to get, set and remove cookies.
Subcookie ExampleDemonstrates using the Cookie utility to get and set subcookies.

DataSchema

DataSchema.ArraySchema parsing a JavaScript array.
DataSchema.JSONSchema parsing JSON data.
DataSchema.XML for XML DataSchema parsing XML data.
DataSchema.XML for HTML TablesSchema parsing data held in TABLE elements.
DataSchema.TextSchema parsing delimited plain-text data.
Enforcing DataTypesParsing data into specified types as the schema is being applied.

DataSource

DataSource.LocalThe Local DataSource manages retrieval of in-page data, from JavaScript arrays and objects to DOM elements.
DataSource.GetThe Get DataSource, which manages retrieval of data from remote sources via the Get Utility, can be useful for accessing data from cross-domain servers without the need for a proxy.
DataSource.IOThe IO DataSource manages retrieval of data from remote sources, via the IO Utility.
DataSource.FunctionThe Function DataSource, which manages retrieval of data from a JavaScript function, provides a highly customizeable mechanism for implementer-defined data retrieval algorithms
DataSource with CachingUse the DataSourceCache plugin to enable caching and reduce server calls to remote sources.
DataSource with Offline CacheThe DataSourceCache plugin supports offline caching so that cached data persists across browser sessions.
DataSource with PollingUse the Pollable extension to enable polling in your DataSource.

DataType

DataType.Date.format()Formatting dates into strings.
Formatting Dates Using Language Resource BundlesFormatting dates into strings using pre-packaged language resource bundles.
DataType.Date.parse()Parsing data into dates.
DataType.Number.format()Formatting numbers into strings.
DataType.Number.parse()Parsing data into numbers.
DataType.XML.format()Formatting XML documents into strings.
DataType.XML.parse()Parsing strings into XML documents.

Drag and Drop

Simple DragA simple drag interaction that doesn't require a drop interaction.
Drag - Node pluginHow to apply the Drag Plugin to a node.
Drag - ProxyA simple proxy drag interaction that doesn't require a drop interaction.
Drag - Constrained to a RegionHow to constrain a draggable Node to another Node's region.
Drag - Interaction GroupsUsing interaction groups, this example demonstrates how to tie into the Drag & Drop Utility's interesting moments to provide visual affordances for the current drag operation.
Using the Drag ShimThe use of the drag shim when dragging nodes over other troublesome nodes.
Using Drop Based CodingHow to use the Drop Target events to code your application.
Window ScrollingHow you can use the DD Scroll plugin to scroll the browser window as you drag.
Drag DelegationHow to use DD.Delegate to create a scalable solution which supports multiple draggable items.
Drag Delegation with a Drop TargetUsing DD.Delegate to support dragging multiple items and dropping them onto a Drop Target.
Using Drag Plugins with DelegateHow to use Drag plugins with a DD Delegate based solution.
List Reorder w/BubblingThis example shows how to make a sortable list using Custom Event Bubbling.
List Reorder w/ScrollingThis example shows how to make a sortable list using Custom Event Bubbling and Node Scrolling.
Animated Drop TargetsHow to make an animated node a Drop target.
Photo BrowserExample Photo Browser application.
Portal Style ExamplePortal style example using Drag & Drop Event Bubbling and Animation.

FocusManager Node Plugin

Accessible ToolbarCreating an accessible toolbar using the Focus Manager Node Plugin and Node's support for the WAI-ARIA Roles and States.
Accessible Menu ButtonCreating an accessible menu button using the Focus Manager Node Plugin, Event's delegation support and mouseenter event, along with the Overlay widget and Node's support for the WAI-ARIA Roles and States.

Graphics

Basic Graphics ImplementationShows how to create a Graphic instance and add shapes.
Basic PathShows how to draw lines and polygons.
Create Gradient FillsShows how to create linear and radial gradient fills.
Basic drag with graphic objectShows how to add drag to a shape.
Using TransformsShows how to apply transforms to shape.
Custom ShapeShows how to use a custom shape with the Graphics module.
Transparent Glass with ShadowShows to use the graphics api to draw a realistic glass.
Complex Drawing: ViolinShows to use the graphics api to draw a violin.
Path Drawing UtilityA helper utility for interactively composing path code.

History

History + TabViewDemonstrates how to add browser history support to a TabView widget using the History Utility.

ImageLoader

Basic Features of the ImageLoader UtilityDemonstrates the basic features and operation of the ImageLoader Utility, deferring the loading of images until specific events happen or specific time limits expire.
Loading Images Below the FoldLoading images above the fold immediately while deferring the loading of images below the fold.
Using ImageLoader with CSS Class NamesUsing CSS class names to target specific images for deferred loading.

Internationalization

Language Resource BundlesHow to create components which use language resource bundles.

IO Utility

HTTP GET to request dataUse IO to request data over HTTP.
Request XML data from Yahoo! WeatherUse IO to request XML data from a remote web service.
Request JSON using Yahoo! PipesUse IO to make a cross-domain request to Yahoo! Pipes, returning data from disparate sources.

JSON

JSON with Y.ioUse JSON to parse data received via XMLHttpRequest via Y.io calls — a simple JSON use case.
Rebuilding Class Instances from JSON DataUse the replacer and reviver parameters to reconstitute object instances that have been serialized to JSON.
Adding New Object Members During ParsingUse a currency conversion calculation to add a new price member to a JSON response, demonstrating how JSON data, once retrieved, can be transformed during parsing.

JSONP

Getting Cross Domain JSON Data Using Y.jsonp()Get basic GitHub user info using a Y.jsonp(url, callback).
Reusing a JSONPRequest Instance to Poll a Remote ServerCreate a reusable JSONPRequest object to poll the YUILibrary.com Gallery web service, fetching info on a random Gallery module.

Recordset

Basic RecordsetShows how to instantiate and interact with a standard Recordset by adding, removing and updating records/objects. Explains the events that are fired, and shows how to access the built-in hash table that stores records by their YUIDs.
Recordset Sort PluginShows how to sort a Recordset using the default sorter, or a custom sort function. Additionally, demonstrates how convenience attributes help in determining when Recordset is in a sorted state, and what the last sort parameters were.
Recordset Filter PluginShows how to use filtering methods to Recordset. Key-value filtering, and filtering by providing a custom function are covered.
Recordset Indexer PluginShows how to create and access hash tables on Recordset. Tables are kept in sync through events fired by Recordset.

Resize

Simple ResizeResize a node.
Constrain a ResizeA simple resize implementation that utilizes the ResizeConstrained plugin to set min/max dimensions and to lock in the resized element's aspect ratio.
8-way Image ResizeThis example shows an 8-way image resize, providing the CSS needed for a common image-resize visual treatment.
Widget with simple Resize PluginPlugs a widget with resize functionality.
Widget with Resize Plugin under constraintsPlugs a widget with resize functionality, and implements ResizeConstrained

Rich Text Editor

Using the Editor's instanceUse the Editor's instance to query the iframe
Editor EventsUsing the Editor's built in events.
NodeChange EventUsing the Editor's nodeChange Event.
ExecCommandsCreating and using your own ExecCommands

Sortable

Simple Sortable ListCreate a simple sortable list.
Floated ListSortable list example with floated nodes.
Multiple ListsMultiple Sortable Lists that are separate from one another.
Multiple Lists - Full JoinMultiple Sortable Lists that are fully joined together.
Multiple Lists - Outer JoinMultiple Sortable Lists that are outer joined together.
Multiple Lists - Inner JoinMultiple Sortable Lists that are inner joined together.

StyleSheet

Adjusting a Page Theme on the FlyUse StyleSheet to adjust the CSS rules applying a page theme from user input

Transition

Basic Node TransitionsDemonstrates the basic usage of Transitions.
Using TransitionsDemonstrates more advanced usage of Transitions.
Showing and Hiding with TransitionsDemonstrates how to animate Node's show and hide methods.

Uploader

Simple Uploader with Progress TrackingHow to upload a single file, while tracking progress and using a sprite-skinned button
Single File Upload with Additional DataHow to upload a single file, along with GET and POST Vars Submission and receive data from the server
Multiple Files Upload with Transparent Overlay ButtonHow to upload multiple files with progress tracking and a transparent overlay upload button

YQL Query

Simple YQL QueryCreate a simple YQL Query to retrieve data from the Yahoo! Weather YQL table.
Reusing a YQL queryUse the Flickr Recent Photos YQL table to pull in a small set of recent Flickr images every 8 seconds.

Widgets

AutoComplete

Basic Local DataHow to provide autocomplete suggestions from a local array.
Remote Data via JSONPHow to provide autocomplete suggestions using a remote JSONP source.
Remote Data via YQLHow to provide autocomplete suggestions using a YQL query source.
Remote Data via DataSourceHow to provide autocomplete suggestions using a DataSource instance.
Tag Completion Using Query DelimitersHow to implement delimited tag completion.
Find Photos on Flickr (Custom Formatting, YQL Source)How to find and select Flickr photos using a YQL source and a custom autocomplete result formatter.
Filter a Set of Existing Items on a PageHow to use autocomplete-base to filter a set of existing items on a page.

Calendar

Simple Calendar with SelectionHow to create a single-pane calendar with selectable dates
Two-Pane Calendar with Custom Rendering and Multiple SelectionHow to create a multi-pane calendar with custom-rendered cells and multiple date selection.

Charts

Basic Charts ImplementationShows how to use Charts to create a basic chart.
Chart with Multiple SeriesShows how to create a chart with multiple series.
Specify Chart TypeShows how to create a column chart with multiple series.
Create Stacked ChartShows how to create a column chart with a stacked numeric axis.
Create a Chart with a Time AxisShows how to create a chart with a time axis.
Add Gridlines to a ChartShows how to add gridlines to a chart.
Create a Stacked Area Chart with Planar Based EventsShows how to create a chart with planar based events.
Customize a ChartShows how to use a chart's styles attribute to customize a chart.
Customize a Chart's TooltipShows how to customize the default tooltip of a chart.
Define a Chart's Axes and SeriesShows how to explicitly define the axes and series for a chart.
Pie ChartShows how to use charts to create a pie chart.
Dual Axes ChartShows how to create a chart with multiple value axes.
Update Chart AxisShows how to access a chart instance's value axis after the chart has rendered.
Update Chart SeriesShows how to access a chart instance's seriesCollection after the chart has rendered.

DataTable

Basic DataTableThis example illustrates simple DataTable use cases.
DataTable + DataSource.Get + JSON DataDataTable loaded with JSON data from a remote webservice via DataSource.Get
DataTable + DataSource.IO + XML DataDataTable loaded with XML data from a remote webservice via DataSource.IO.
Formatting Row Data for DisplayCustom format data for display.
Nested Column HeadersDataTable with nested column headers.
Column SortingDataTable with column sorting.
Scrolling DataTableDataTable with vertical and/or horizontal scrolling rows.

Dial

Basic DialCreate a Dial from existing markup on the page - a simple use case.
Dial Linked With Text InputLink a Dial with a text input field.
Dial With Image BackgroundUse image backgrounds to control the visual display of a Dial.
Dial With a Surrounding ImageUse images to surround a Dial instance and provide additional styling.
Dial With Interactive UIThis example employs Dial to drive an interactive UI.

MenuNav Node Plugin

Basic Left NavCreating left navigation using the MenuNav Node Plugin.
Basic Top NavCreating top navigation using the MenuNav Node Plugin
Menu Button Top NavCreating menu button navigation using the MenuNav Node Plugin
Split Button Top NavCreating split button navigation using the MenuNav Node Plugin
Left Nav with Submenus with ShadowsAdding shadows to submenus of a left nav using the MenuNav Node Plugin
Left Nav With Submenus With Rounded CornersAdding rounded corners to submenus of a left nav using the MenuNav Node Plugin
Skinning Menus Created Using the MenuNav Node PluginSkining a menu built using the MenuNav Node Plugin to look like the menus on Flickr

Overlay

Basic XY PositioningShows how to instantiate a basic Overlay instance, and use the Overlay's basic XY positioning support.
Alignment SupportShows how to use the Overlay's XY alignment support, to align the Overlay relative to another element, or to the viewport.
Stack SupportShows how to use the Overlay's zindex and shim support when positioning Overlays above other elements on the page.
Standard Module SupportShows how to modify content in the Overlay's header, body and footer sections.
Constrain SupportShows how to use Overlay's constrainment support, to limit the XY value which can be set for an Overlay.
IO PluginShows how to create a simple plugin to retrieve content for the Overlay using the io utility.
Animation PluginShows how to create a simple plugin to animate the Overlay's movement and visibility.

Panel

Creating a modal formShows how to instantiate multiple Panel instances, and use nested modality to interact with a Datatable.
Creating an animated panelShows how to create a panel that animates as it is shown and hidden

ScrollView

Basic ScrollView Without a Scroll IndicatorThis example creates a basic ScrollView which doesn't include a scrollbar indicator.
ScrollView with Scroll Indicator and Link Suppression BehaviorThis example shows the classic Scrollview implementation, including scroll indicators (bars) and including code to suppress link navigation while scrolling.
Horizontal ScrollViewThis example creates a horizontal ScrollView.
ScrollView With PaginationThis example creates a horizontal ScrollView with pagination support.

Slider

Basic SlidersThe basics of setting up a horizontal and vertical Slider
Creating a Slider from Existing MarkupCreating a vertical Slider from existing markup
Alternate SkinsSpecifying an alternate skin for a Slider instance

TabView

TabView from Existing MarkupThis example shows how to create a TabView wigdet from existing HTML.
Dynamic TabView from JavaScriptThis example shows how to create a TabView wigdet from JavaScript.
Adding and Removing TabsThis example shows how to add and remove Tabs.
Loading Tab ContentThis example shows how to load tab content remotely using a YQL plugin.

No comments:

Post a Comment

Thank you for Commenting Will reply soon ......

Featured Posts

🌫️ Project Title: "Fog Buster – AI-Powered Visibility Enhancement System"

🔍 Project Vision: To design a device that allows vehicles (cars, trucks) and aircraft (planes, helicopters, drones) to see clearly during f...