• Home
  • Quick Start
    • Configurator
    • Download YUI 3
  • Documentation
    • User Guides
    • Examples
    • Tutorials
    • API Docs
  • Community
    • Gallery
    • Blog
    • Forums
    • YUI Theater
    • Calendar
  • Contribute
    • YUI on GitHub »
    • File a Ticket
    • View Tickets
    • Dashboard
  • Other Projects
    • YUI 2
    • YUI Compressor
    • YUI Doc »
    • YUI Builder
    • YUI PHP Loader
    • YUI Test
    • YUI Website

Blog: Archive for April, 2011

« Older Entries

YUI Is Hiring

We’re looking for a senior front-end engineer to join the YUI team! You must be an expert at JavaScript and well-versed in various front-end technologies. You love solving complex problems at massive scale, know what it takes to design robust and intuitive APIs, and embrace the best practices of performance, security, accessibility, and usability. You also have excellent communication skills, possess great attention to detail, and are independent and resourceful.

Minimum Job Qualifications:

  • Expert-level JavaScript, HTML, and CSS skills.
  • Demonstrated experience building reusable JS components that are modular, performant, and maintainable.
  • A passion for building and evangelizing a world-class front-end library that impacts millions of people every day.
  • Familiarity with open-source software projects, especially YUI.
  • Computer Science degree or equivalent work experience.

Preferred Job Qualifications:

  • Demonstrated depth of expertise in one or more front-end domains such as mobile, performance, server-side JavaScript, or internationalization.

If this sounds like you, please send your resume and cover letter to yui-jobs (at) yahoo-inc (dot) com.

About Yahoo!

Think about impacting 1 out of every 2 people online — in innovative and imaginative ways that are uniquely Yahoo!. We do just that each and every day, and you could too. After all, it’s big thinkers like you who will create the next generation of Internet experiences for consumers and advertisers across the globe. Now’s the time to show the world what you’ve got. Put your ideas to work for over half a billion people.

Yahoo! Inc. is an equal opportunity employer. For more information or to search all of our openings please visit http://careers.yahoo.com.

By Jenny DonnellyApril 29th, 2011

Announcing YUI Compressor 2.4.6

We’re pleased to announce the immediate availability of version 2.4.6 of the YUI Compressor. This version contains mostly updates related to Compressor’s handling of CSS minification and introduces batch processing of multiple files with a single command.

CSS minification

Highlights include:

  • Fixed numerous bugs that break the compressor and/or the resulting minified files.
  • Added documentation on what exactly the minifier does and also which CSS hacks it tolerates.
  • There’s a JavaScript port of CSS min in case it’s more suitable for your build process. Here’s also a test web UI that uses the JavaScript port, where you can experiment with the minifier.
  • A significant number of new tests added (but you can add even more).
  • Safe handling of some CSS features that are getting more adoption such as media queries and CSS3 transforms.

Batch processing

Another welcome addition to Compressor is that it can now handle batches of files. This can significantly reduce the time your build process takes, especially if you have a great number of files to minify.

For example the following commands minify all .js and .css files and write the minified files with a “-min.css” suffix.

$ java -jar yuicompressor.jar -o '.css$:-min.css' *.css
$ java -jar yuicompressor.jar -o '.js$:-min.js' *.js

Thanks go out to Stephen Woods and the Flickr team for this feature!

Links

YUI Compressor 2.4.6 is available for immediate download. Feel free to help us out by filing a bug or feature request, writing more tests, forking the code or joining the conversation.

By Stoyan StefanovApril 26th, 2011

Direction-friendly Navigation Bar

I recently came across a horizontal navigational menu with right-aligned links. As you might expect, it was a list element with float:right and the list items with float:left. Even though there is nothing wrong with this approach, it inspired me to take this opportunity to discuss directionality for layout.

The cost of floating elements

Floats have no concept of directionality; they do not work like inline elements or table columns (for which the dir attribute is a magic bullet). With floats, authors must implement a mechanism to "swap" values whenever the interface changes (ltr vs. rtl).

So instead of using float, authors may favor inline-block. Here is a simple example:

ul {  
    text-align: end; 
    text-align: right\9;  
    *text-align: right; 
}
li {
    display: inline; 
}
a {
    display: inline-block;
    padding: 5px 15px;
    margin: 0 5px;
}

Note that using "\ 0" (with no space) instead of "\9" would take care of Opera, but may not be as future proof as "\9" (IE only).

As this demo page shows, in Chrome, Safari and Firefox, the inline-block technique makes the layout writing-mode dependent (the direction of the flow matches the value of the dir attribute, or the initial value if no direction is specified). For other UAs, and because of IE’s lack of support for the attribute selector (i.e. html[dir="rtl"]), authors need to add a hook in the markup to cater to the change of direction. For example, for full A-grade compatibility:

For the float technique:
.rtl ul { float: left; }
.rtl ul li { float: right; }
For the inline-block technique:
.rtl ul { 
    text-align: left\9;  /* IE8/9 */
    *text-align: left;   /* IE5/6/7 */
}

text-align: start | end

Unlike left and right, start and end are writing-mode dependent keywords. In English, start maps to left and end maps to right. Relying on start and end rather than left and right allows some browsers to do the swapping (ltr/rtl) automatically.

Differences between browsers and techniques

In browsers that do not support "start/end" (IE, Opera)
float technique: swapping direction does not change anything
inline-block technique: swapping direction does not change the alignment of the menu, but links are displayed in the proper sequence
In browsers that do support "start/end" (Chrome, Safari, Firefox)
float technique: swapping direction does not change anything
inline-block technique: swapping direction is enough to swap the direction of both the menu and the links

That’s it! Next time you have to style elements horizontally, remember to give display:inline-block or display:table a try.


Thierry KoblentzAbout the author:
Thierry Koblentz is a front-end engineer at Yahoo! He owns
TJK Design,
ez-css.org and
css-101.org. You can follow Thierry on Twitter at
@thierrykoblentz
.

By Thierry KoblentzApril 25th, 2011

YUI 3 “Building Blocks, Modules, and Applications” Workshop Coming to Portland, and Free!

YUI, together with the Yahoo! Developer Network, is excited to sponsor a complimentary YUI 3 “Building Blocks, Modules, and Applications” Workshop on Sunday, May 1, 2011 in Portland, Oregon. This is a great way to kick-off your time at JSConf, but you do not need a JSConf ticket to attend the workshop. All are invited to this free event!

I will be joined by fellow Yahoo! Gonzalo Cordero for a full-day of hands-on training where you will learn how to build stateful classes, plugins, and widgets using the YUI 3 infrastructure components, package them into reusable modules, and assemble them into a simple application. The morning class will focus on what the building blocks (such as Base and Widget) have to offer and when and how to use them. The afternoon class will get into more advanced class configurations, setting up the Loader to combine your hosted modules, and setting up application controllers to relate your various module classes and APIs via custom events.

Space is limited, so reserve your seat today at http://training.bocoup.com/PreJSConf-2011/

By Luke SmithApril 19th, 2011

Quick Edit mode for YUI 3 DataTable

Even though YUI 3 DataTable does not yet have inline editing of individual cells, it is relatively simple to implement Quick Edit mode. The QuickEdit plugin for DataTable in the YUI 3 Gallery allows all the visible values in a DataTable to be edited simultaneously.

(Click the screenshot to play with this example.)

Overview

As with the YUI 2 version, the core idea of Quick Edit mode is to swap out all the cell formatters with new ones which populate the cells with form elements, e.g., input fields or dropdowns. This is done when start() is called, based on the configuration described below. After the user is finished, you can call getChanges() to get the changed values and then persist them. To exit Quick Edit mode, call cancel(). (It is named cancel instead of stop to remind you that it discards all changes.)

Since the Quick Edit gallery module is a plugin for DataTable, you need to plug it in to your datatable before you can use it:

my_table.plug(Y.Plugin.DataTableQuickEdit);

This stores the plugin in the qe member of the datatable, so you must call the plugin’s functions like this:

my_table.qe.start();

Configuration

Quick Edit adds two new configuration attributes to all columns: quickEdit and qeFormatter.

If a column’s quickEdit property is defined, the column will be editable in Quick Edit mode. To accept all the defaults, you can simply set quickEdit:true. For more control, you can pass an object with the following properties:

formatter

The cell formatter which will render an appropriate form field: <input type=”text”>, <textarea>, or <select>. By default, the cell formatter Y.Plugin.DataTableQuickEdit.textFormatter is used for all cells to produce input elements. To get a textarea element, configure a column to use Y.Plugin.DataTableQuickEdit.textareaFormatter instead.

validation

Validation configuration for every field in the column.

css

CSS classes encoding basic validation rules:

yiv-required

Value must not be empty.

yiv-length:[x,y]

String must be at least x characters and at most y characters. At least one of x and y must be specified.

yiv-integer:[x,y]

The integer value must be at least x and at most y. x and y are both optional.

yiv-decimal:[x,y]

The decimal value must be at least x and at most y. Exponents are not allowed. x and y are both optional.

fn

A function that will be called with the DataTable as its scope and the cell’s form element as the argument. Return true if the value is valid. Otherwise, call this.displayMessage(...) to display an error and then return false.

msg

A map of types to messages that will be displayed when a basic or regex validation rule fails. The valid types are: required, min_length, max_length, integer, decimal, and regex. There is no default for type regex, so you must specify a message if you configure a regex validation. The default error messages for the other types are stored in Y.FormManager.Strings (provided by gallery-formmgr-css-validation) and can be overridden and/or localized.

regex

Regular expression that the value must satisfy in order to be considered valid.

Sometimes, a non-editable column must be rendered differently during Quick Edit mode. The best example is a column containing a link, since navigating away from the page while in Quick Edit mode can be disastrous. To remove the link during Quick Edit, configure qeFormatter for the column to be Y.Plugin.DataTableQuickEdit.readonlyLinkFormatter. For email addresses, use Y.Plugin.DataTableQuickEdit.readonlyEmailFormatter. You can also write you own custom, read-only formatter. Simply follow the normal rules for constructing a DataTable cell formatter.

Missing Features

Due to a bug in YUI 3.3.0 DataTable, the td element passed to a column formatter is actually from the previous column. This made it too troublesome to support copy down, where a button in the first row lets you copy the value down to all other rows.

The bug also required a complete reworking of the basic Quick Edit cell formatters to return text instead of manipulating the DOM. This is why custom cell formatters are not officially supported in this initial release. If you are adventurous, you can still build them, but keep in mind that you will need to rewrite them, including adding in support for copy down, once the bug in DataTable is fixed.

About the author: John Lindal (@jafl5272 on Twitter) is one of the lead engineers constructing the foundation on which Yahoo! APT is built. Previously, he worked on the Yahoo! Publisher Network.

By John LindalApril 19th, 2011

YUI: Open Hours Thurs Apr 21st

YUI Remote Loader Service

For a while now, Reid Burke has been working on a Node.js based service to speed up the process of calculating and requesting module dependencies in YUI 3. He’s got it pretty close to buttoned up at this point, and wants to share what he’s got and get your ideas for what would make it even awesomer.

The problem

For a while now we’ve known that, while really convenient for developers, the Y.use(modules,...) method introduces an unnecessary delay in the spin up time of your implementation code. It turns out that it’s a lot of work calculating dependency trees, and the metadata alone can be burdensome on the overall memory footprint of your page. The traditional method of including the YUI seed file (yui-min.js), then bootstrapping with YUI().use(...) first tells YUI to load the Loader module—which is saddled with dependency metadata for the entire library in its source—then have Loader calculate the complete list of required modules based on your use(...) statement on the client machine.

The solution

The Remote Loader Service moves this calculation to the server, making your code initialize faster and reducing your site’s client memory profile because the metadata and Loader are no longer necessary on the client machine. It also serves as the combo handler, returning all the code directly rather than routing through to the yahooapis combo service (less network traffic), and is capable of being deployed on a Node.js server on your domain.

The plan is to have Reid demo what’s working today, including some pretty impressive stats from its use on yuilibrary.com, then open the call to feedback and requests. Come check out what the future of YUI Loader is looking like!

Time & Details

We’ll be online from 10am to 11am PDT Thursday. The connection details are the same as usual.

  1. Dial in to 1-888-371-8922 (Skype works great for non-US participants*)
  2. Enter the attendee code 47188953#
  3. Join the screen sharing session (this will prompt you to install the Adobe Connect plugin if this is your first time using it)

* – If Skype is not an option, email me or catch me (ls_n) in the #yui IRC channel on freenode for a local number.

By Luke SmithApril 19th, 2011

Announcing YUI 2.9.0

The YUI team is thrilled to announce the release of YUI version 2.9.0. YUI 2.9.0 is the last bug fix release on the YUI 2 code line marking its transition into maintenance mode. Moving forward, expect to see releases consisting of only critical bug fixes or fixes for browser compatibility issues resulting from updates to browsers in the GBS. We’re truly excited to better focus our attention on the upcoming 3.4.0 release of YUI.

To get an idea of the changes included in YUI 2.9.0, you can review the ReadMe Digest which summarizes all of the additions made by component developers to their respective ReadMe files for this release. You can also view the list of tickets fixed in YUI 2.9.0 for a summary of bug fixes and enhancement requests completed in this release.

We’d like to remind everyone that as we begin the process of deprecating YUI 2.x, all released versions will continue to be hosted on Yahoo’s CDN and the code base will continue to be forkable on GitHub.com.

By Jenny DonnellyApril 13th, 2011
« Older Entries

Pages

  • About
  • Contribute
  • YUI Jobs

Recent Posts

  • YUI Weekly for May 17th, 2013
  • Yahoo’s International Team Is Hiring!
  • YUICompressor 2.4.8 Released
  • YUI 3.10.1 Released to Fix SWF Vulnerability
  • YUI Weekly for May 10th, 2013

Archives

Categories

  • Accessibility (25)
  • CSS 101 (6)
  • Design (51)
  • Development (590)
  • Frontend Jobs at Yahoo (13)
  • Graded Browser Support (8)
  • In the Wild (63)
  • Miscellany (11)
  • Open Hours (44)
  • Performance (23)
  • Releases (25)
  • Target Environments (11)
  • Yeti (3)
  • YUI 3 Gallery (29)
  • YUI Events (45)
  • YUI Implementations (55)
  • YUI Theater (146)
  • YUI Weekly (37)

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
© 2013 YUI Blog