| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 5 | <title>UpgradeBar Test</title> |
| 6 | <style type="text/css"> |
| 7 | body{ |
| 8 | font-family:sans-serif; |
| 9 | } |
| 10 | @import "../../../dijit/tests/css/dijitTests.css"; |
| 11 | </style> |
| 12 | <link href="../UpgradeBar/UpgradeBar.css" rel="stylesheet" /> |
| 13 | |
| 14 | <script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="parseOnLoad:false, isDebug: false"></script> |
| 15 | |
| 16 | <script type="text/javascript"> |
| 17 | require(["dojox/widget/UpgradeBar", "dojo/sniff", "dojox/embed/Flash"], function(UpgradeBar, has, flash){ |
| 18 | |
| 19 | new UpgradeBar({ |
| 20 | notifications:[ |
| 21 | { |
| 22 | validate:function(){ |
| 23 | return has("ie")<10; |
| 24 | }, |
| 25 | message: '<span>Your version of Internet Explorer needs to be upgraded to Firefox.</span>' |
| 26 | + '<a href="http://www.getfirefox.net/">Get Firefox</a>' |
| 27 | }, |
| 28 | { |
| 29 | validate:function(){ |
| 30 | return has("ff")<20; |
| 31 | }, |
| 32 | message: '<span>Your version of Firefox needs to be upgraded to a version that does not exist.</span>' |
| 33 | + '<a href="http://www.getfirefox.net/">Get Firefox</a>' |
| 34 | }, |
| 35 | { |
| 36 | validate:function(){ |
| 37 | var evals = true; |
| 38 | try{ evals = flash.available<14}catch(e){} |
| 39 | return evals; |
| 40 | }, |
| 41 | message: '<span>This app needs a version of Flash that has never been released.</span>' |
| 42 | + '<a href="http://www.adobe.com/downloads/">Get Flash Player</a>' |
| 43 | }, |
| 44 | { |
| 45 | validate:function(){ |
| 46 | return typeof google == "undefined" || !google.gears; |
| 47 | }, |
| 48 | message: '<span>This app will perform better with Google Gears.</span>' |
| 49 | + '<a href="http://gears.google.com/download.html">Download Google Gears</a>' |
| 50 | } |
| 51 | ] |
| 52 | }); |
| 53 | }); |
| 54 | </script> |
| 55 | |
| 56 | </head> |
| 57 | <body class="tundra"> |
| 58 | <h1 class="testTitle">dojox/widget/UpgradeBar</h1> |
| 59 | </body> |
| 60 | </html> |