Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 67 lines (62 sloc) 2.095 kb
9a744c3 split fisheye menu controller binding into its own file
Jason Johnston authored
1 <?xml version="1.0"?>
2 <bindings xmlns="http://www.mozilla.org/xbl" xmlns:h="http://www.w3.org/1999/xhtml">
3
4 <binding id="controller">
5 <implementation>
6 <constructor><![CDATA[
7 var thisRef=this;
8 var loadHdlr = function() {
9 var i, fld;
10 var anon = document.getAnonymousNodes(thisRef)[0];
11 var flds = anon.getElementsByTagName("input"); //get text inputs
12 flds[flds.length] = anon.getElementsByTagName("select")[0]; //add the select field
13 var menu = document.getElementById(thisRef.getAttribute("title"));
14 if(!menu) return;
15 for(i=0; (fld=flds[i]); i++) {
16 fld.value = menu[fld.name]; // Set field to menu initial value
17 fld.onchange = function() { // When changed, set menu to field value:
18 var p = "parentNode";
19 var id = this[p][p][p][p][p].getAttribute("title");
20 if(menu) menu[this.name] = (this.name=="edge" ? this.value : parseFloat(this.value));
21 };
22 }
23 };
24 if(window.addEventListener) window.addEventListener("load", loadHdlr, false); //fire after load so we can be sure the menu is fully loaded and bound
25 loadHdlr(); //in case doc already loaded
26 ]]></constructor>
27 </implementation>
28
29 <content>
30 <table xmlns="http://www.w3.org/1999/xhtml">
31 <tbody>
32 <tr>
33 <th>Edge of Window:</th>
34 <td>
35 <select name="edge">
36 <option value="left">left</option>
37 <option value="bottom">bottom</option>
38 <option value="right">right</option>
39 <option value="top">top</option>
40 </select>
41 </td>
42 </tr>
43 <tr>
44 <th>Min. Icon Size:</th>
45 <td><input type="text" size="3" name="iconMinSize" /> pixels</td>
46 </tr>
47 <tr>
48 <th>Max. Icon Size:</th>
49 <td><input type="text" size="3" name="iconMaxSize" /> pixels</td>
50 </tr>
51 <tr>
52 <th>Icon Spacing:</th>
53 <td><input type="text" size="3" name="iconSpacing" /> pixels</td>
54 </tr>
55 <tr>
56 <th>Scaling Curve:</th>
57 <td><input type="text" size="3" name="scaleReach" /> (bigger number is smoother curve)</td>
58 </tr>
59 </tbody>
60 </table>
61 <children />
62 </content>
63 </binding>
64
65
66 </bindings>
Something went wrong with that request. Please try again.