.. _dojox/widget/UpgradeBar: dojox.widget.UpgradeBar ========================= :Status: Up to date :Version: 1.4 :Project owner: Mike Wilcox, Revin Guillen :Author: Mike Wilcox :Available: since 1.4 Basic Description ----------------- Shows the "yellow bar" at the top of the screen when the user is to be notified that they should upgrade their browser or a plugin. You can insert custom validations to trigger the UpgradeBar to display. An evaluation of 'true' shows the bar (as this version *is* less than it should be). Multiple validations may be checked, although only the first in the list will be displayed. The user would have to upgrade then refresh the page to see the next notification. Of course, validations can also be used for each browser, like only allowing those that support CSS3 or SVG, or maybe even something that's in IE8. Markup and programmatic are supported. Markup is a little cleaner, since a majority of the parameters are the HTML snippets to be displayed. In markup, the validate code should be an expression that will evaluate to true or false. This expression is wrapped in a try/catch, so if it blows up, it is assumed to be true and trigger the bar. In programmatic, a function should be used that returns true or false. You would need to use your own try/catch in that. Notifications ------------- The only required parameter is *notifications*. This is an array of objects, and each object contains a validation expression and a message. The messages can be plain text, but HTML is recommended, so that you may provide a link to the upgrade site. If you don't provide a link, this widget may as well be named the HarassmentBar. To provide the validation in markup, use _validate_ as an attribute like the two examples that follow: .. code-block :: html :linenos: