Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
michael@0 | 1 | <html> |
michael@0 | 2 | <head> |
michael@0 | 3 | <title>IconGrid test page</title> |
michael@0 | 4 | <meta name="viewport" content="initial-scale=1.0"/> |
michael@0 | 5 | <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> |
michael@0 | 6 | <script type="application/javascript"> |
michael@0 | 7 | Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); |
michael@0 | 8 | Components.utils.import("resource://gre/modules/Services.jsm"); |
michael@0 | 9 | Components.utils.import("resource://gre/modules/Prompt.jsm"); |
michael@0 | 10 | |
michael@0 | 11 | function start() { |
michael@0 | 12 | var test = location.hash.substring(1); |
michael@0 | 13 | window[test](); |
michael@0 | 14 | } |
michael@0 | 15 | |
michael@0 | 16 | function test1() { |
michael@0 | 17 | var p = new Prompt({ |
michael@0 | 18 | title: "Prompt 1", |
michael@0 | 19 | buttons: [ |
michael@0 | 20 | "OK" |
michael@0 | 21 | ], |
michael@0 | 22 | }).addIconGrid({ |
michael@0 | 23 | items: [ |
michael@0 | 24 | { iconUri: "drawable://alert_app", name: "Icon 1", selected: true }, |
michael@0 | 25 | { iconUri: "drawable://alert_download", name: "Icon 2" }, |
michael@0 | 26 | { iconUri: "drawable://alert_addon", name: "Icon 3" }, |
michael@0 | 27 | { iconUri: "drawable://alert_addon", name: "Icon 4" }, |
michael@0 | 28 | { iconUri: "drawable://alert_addon", name: "Icon 5" }, |
michael@0 | 29 | { iconUri: "drawable://alert_addon", name: "Icon 6" }, |
michael@0 | 30 | { iconUri: "drawable://alert_addon", name: "Icon 7" }, |
michael@0 | 31 | { iconUri: "drawable://alert_addon", name: "Icon 8" }, |
michael@0 | 32 | { iconUri: "drawable://alert_addon", name: "Icon 9" }, |
michael@0 | 33 | { iconUri: "drawable://alert_addon", name: "Icon 10" }, |
michael@0 | 34 | { iconUri: "drawable://alert_addon", name: "Icon 11" }, |
michael@0 | 35 | ] |
michael@0 | 36 | }); |
michael@0 | 37 | p.show(function(data) { |
michael@0 | 38 | sendResult(data.icongrid0 == 10, "Got result " + data.icongrid0); |
michael@0 | 39 | }); |
michael@0 | 40 | } |
michael@0 | 41 | |
michael@0 | 42 | function sendResult(pass, message) { |
michael@0 | 43 | setTimeout(function() { |
michael@0 | 44 | alert((pass ? "PASS " : "FAIL ") + message); |
michael@0 | 45 | }, 1000); |
michael@0 | 46 | } |
michael@0 | 47 | </script> |
michael@0 | 48 | </head> |
michael@0 | 49 | <body onload="start();"> |
michael@0 | 50 | </body> |
michael@0 | 51 | </html> |