Index: trunk/extensions/TreeAndMenu/star.js |
— | — | @@ -1,4 +1,5 @@ |
2 | 2 | window.star_config = { |
| 3 | + root: 'Current article', |
3 | 4 | img_node: '/img/star-node-plus.gif', |
4 | 5 | img_leaf: '/img/star-node-empty.gif', |
5 | 6 | img_open: '/img/star-node-minus.gif', |
— | — | @@ -19,7 +20,7 @@ |
20 | 21 | $('div.tam-star').each( function() { |
21 | 22 | var tree = $(this); |
22 | 23 | var root = 'starnode' + window.stars.length; |
23 | | - tree.html( '<ul><li><a href="https://www.mediawiki.org/">root</a>' + tree.html() + '</li></ul>' ).css({ |
| 24 | + tree.html( '<ul><li><a href="https://www.mediawiki.org/">' + window.star_config.root + '</a>' + tree.html() + '</li></ul>' ).css({ |
24 | 25 | width: window.star_config.width, |
25 | 26 | height: window.star_config.height |
26 | 27 | }); |
— | — | @@ -95,7 +96,7 @@ |
96 | 97 | var e = $('#'+root); |
97 | 98 | e.css({ |
98 | 99 | display: 'block', |
99 | | - left: tree.left + tree.width() / 2, |
| 100 | + left: 500, |
100 | 101 | top: tree.top + tree.height() / 2 |
101 | 102 | }); |
102 | 103 | }); |
— | — | @@ -147,8 +148,8 @@ |
148 | 149 | // Position the children to their locations around the parent |
149 | 150 | var n = data.children.length; |
150 | 151 | var k = Math.PI * 2 / n; |
151 | | - var r = t * n * 12; |
152 | | - if( r < 30 ) r = 30; |
| 152 | + var r = t * n * 15; |
| 153 | + if( r < 50 ) r = 50; |
153 | 154 | for( var i in data.children ) { |
154 | 155 | var child = data.children[i]; |
155 | 156 | var cdata = getData(child); |