| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| 2 | "http://www.w3.org/TR/html4/strict.dtd"> |
| 3 | <html> |
| 4 | <head> |
| 5 | <title>FisheyeList Widget Dojo Tests</title> |
| 6 | <style type="text/css"> |
| 7 | @import "../../../dojo/resources/dojo.css"; |
| 8 | @import "../../../dijit/themes/tundra/tundra.css"; |
| 9 | @import "../../../dijit/themes/dijit.css"; |
| 10 | @import "../../../dijit/tests/css/dijitTests.css"; |
| 11 | @import "../FisheyeList/FisheyeList.css"; |
| 12 | </style> |
| 13 | |
| 14 | <script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="isDebug:true, parseOnLoad: true"></script> |
| 15 | <script type="text/javascript"> |
| 16 | require([ |
| 17 | "dojox/widget/FisheyeList", |
| 18 | "dojox/widget/FisheyeListItem", |
| 19 | "dijit/registry", |
| 20 | "dojo/parser", |
| 21 | "dojo/ready" |
| 22 | ], function(FisheyeList, FisheyeListItem, registry, parser, ready){ |
| 23 | |
| 24 | ready(function(){ |
| 25 | fish1 = registry.byId("fisheye1"); |
| 26 | fish2 = registry.byId("fisheye2"); |
| 27 | }); |
| 28 | var counter = 1; |
| 29 | addToFirstList = function(){ |
| 30 | var item = new FisheyeListItem({ |
| 31 | label:"Dynamically Added "+counter, |
| 32 | iconSrc: "images/fisheye_"+counter+".png" |
| 33 | }); |
| 34 | counter++; |
| 35 | if(counter>4){counter=1;} |
| 36 | fish1.addChild(item); |
| 37 | fish1.startup(); |
| 38 | item.startup(); |
| 39 | } |
| 40 | }); |
| 41 | </script> |
| 42 | </head> |
| 43 | <body class="tundra"> |
| 44 | <h1>dojox.widget.FisheyeList test</h1> |
| 45 | <p>HTML before</p> |
| 46 | <button onclick="addToFirstList();">Add a new item to the first list</button> |
| 47 | <p>HTML before</p> |
| 48 | <p>HTML before</p> |
| 49 | <p>Liberal trigger: move the mouse anywhere near the menu and it will start to expand:</p> |
| 50 | <div dojoType="dojox.widget.FisheyeList" |
| 51 | itemWidth="40" itemHeight="40" |
| 52 | itemMaxWidth="150" itemMaxHeight="150" |
| 53 | orientation="horizontal" |
| 54 | effectUnits="2" |
| 55 | itemPadding="10" |
| 56 | attachEdge="center" |
| 57 | labelEdge="bottom" |
| 58 | id="fisheye1" |
| 59 | > |
| 60 | |
| 61 | <div dojoType="dojox.widget.FisheyeListItem" |
| 62 | id="item1" |
| 63 | onClick="alert('click on ' + this.label + '(from widget id ' + this.id + ')!');" |
| 64 | label="Item 1" |
| 65 | iconSrc="images/fisheye_1.png"> |
| 66 | </div> |
| 67 | |
| 68 | <div dojoType="dojox.widget.FisheyeListItem" |
| 69 | label="Item 2" |
| 70 | iconSrc="images/fisheye_2.png"> |
| 71 | </div> |
| 72 | |
| 73 | <div dojoType="dojox.widget.FisheyeListItem" |
| 74 | label="Item 3" |
| 75 | iconSrc="images/fisheye_3.png"> |
| 76 | </div> |
| 77 | |
| 78 | <div dojoType="dojox.widget.FisheyeListItem" |
| 79 | iconSrc="images/fisheye_4.png"> |
| 80 | </div> |
| 81 | |
| 82 | <div dojoType="dojox.widget.FisheyeListItem" |
| 83 | label="Really Long Item Label" |
| 84 | iconSrc="images/fisheye_3.png"> |
| 85 | </div> |
| 86 | |
| 87 | <div dojoType="dojox.widget.FisheyeListItem" |
| 88 | iconSrc="images/fisheye_2.png"> |
| 89 | </div> |
| 90 | |
| 91 | <div dojoType="dojox.widget.FisheyeListItem" |
| 92 | iconSrc="images/fisheye_1.png"> |
| 93 | </div> |
| 94 | </div> |
| 95 | |
| 96 | <p>HTML after</p> |
| 97 | <p>HTML after</p> |
| 98 | <p>HTML after</p> |
| 99 | <p>This one has strict triggering, so you actually have to mouse over the menu to make it start moving:</p> |
| 100 | <div dojoType="dojox.widget.FisheyeList" |
| 101 | itemWidth="40" itemHeight="40" |
| 102 | itemMaxWidth="150" itemMaxHeight="150" |
| 103 | orientation="horizontal" |
| 104 | effectUnits="2" |
| 105 | itemPadding="10" |
| 106 | attachEdge="center" |
| 107 | labelEdge="bottom" |
| 108 | conservativeTrigger="true" |
| 109 | id="fisheye2" |
| 110 | > |
| 111 | |
| 112 | <div dojoType="dojox.widget.FisheyeListItem" |
| 113 | id="item1b" |
| 114 | onClick="alert('click on ' + this.label + '(from widget id ' + this.id + ')!');" |
| 115 | label="Item 1" |
| 116 | iconSrc="images/fisheye_1.png"> |
| 117 | </div> |
| 118 | |
| 119 | <div dojoType="dojox.widget.FisheyeListItem" |
| 120 | label="Item 2" |
| 121 | iconSrc="images/fisheye_2.png"> |
| 122 | </div> |
| 123 | |
| 124 | <div dojoType="dojox.widget.FisheyeListItem" |
| 125 | label="Item 3" |
| 126 | iconSrc="images/fisheye_3.png"> |
| 127 | </div> |
| 128 | |
| 129 | <div dojoType="dojox.widget.FisheyeListItem" |
| 130 | iconSrc="images/fisheye_4.png"> |
| 131 | </div> |
| 132 | |
| 133 | <div dojoType="dojox.widget.FisheyeListItem" |
| 134 | label="Really Long Item Label" |
| 135 | iconSrc="images/fisheye_3.png"> |
| 136 | </div> |
| 137 | |
| 138 | <div dojoType="dojox.widget.FisheyeListItem" |
| 139 | iconSrc="images/fisheye_2.png"> |
| 140 | </div> |
| 141 | |
| 142 | <div dojoType="dojox.widget.FisheyeListItem" |
| 143 | iconSrc="images/fisheye_1.png"> |
| 144 | </div> |
| 145 | </div> |
| 146 | |
| 147 | |
| 148 | </body> |
| 149 | </html> |