r113605 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113604‎ | r113605 | r113606 >
Date:00:18, 12 March 2012
Author:nad
Status:new
Tags:
Comment:
put name of root node into config and change to "current article"
Modified paths:
  • /trunk/extensions/TreeAndMenu/star.js (modified) (history)

Diff [purge]

Index: trunk/extensions/TreeAndMenu/star.js
@@ -1,4 +1,5 @@
22 window.star_config = {
 3+ root: 'Current article',
34 img_node: '/img/star-node-plus.gif',
45 img_leaf: '/img/star-node-empty.gif',
56 img_open: '/img/star-node-minus.gif',
@@ -19,7 +20,7 @@
2021 $('div.tam-star').each( function() {
2122 var tree = $(this);
2223 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({
2425 width: window.star_config.width,
2526 height: window.star_config.height
2627 });
@@ -95,7 +96,7 @@
9697 var e = $('#'+root);
9798 e.css({
9899 display: 'block',
99 - left: tree.left + tree.width() / 2,
 100+ left: 500,
100101 top: tree.top + tree.height() / 2
101102 });
102103 });
@@ -147,8 +148,8 @@
148149 // Position the children to their locations around the parent
149150 var n = data.children.length;
150151 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;
153154 for( var i in data.children ) {
154155 var child = data.children[i];
155156 var cdata = getData(child);

Status & tagging log