r49962 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49961‎ | r49962 | r49963 >
Date:16:58, 27 April 2009
Author:ialex
Status:deferred
Tags:
Comment:
* (bugs 16828, 18582) Fixed some JavaScript issues on Internet Explorer
* Removed an obsolete statement
* Whitespaces tweaks
Modified paths:
  • /trunk/extensions/Configure/CHANGELOG (modified) (history)
  • /trunk/extensions/Configure/Configure.js (modified) (history)
  • /trunk/extensions/Configure/Configure.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Configure/CHANGELOG
@@ -1,6 +1,9 @@
22 This file lists changes on this extension.
33 Localisation updates are done on betawiki and aren't listed here.
44
 5+0.13.12 - 27 April 2009
 6+ (bugs 16828, 18582) Fixed some JavaScript issues on Internet Explorer.
 7+
58 0.13.11 - 26 April 2009
69 Removed obsolete translateSettings.php maintenance script.
710
Index: trunk/extensions/Configure/Configure.php
@@ -18,7 +18,7 @@
1919 'url' => 'http://www.mediawiki.org/wiki/Extension:Configure',
2020 'description' => 'Allow authorised users to configure the wiki via a web-based interface',
2121 'descriptionmsg' => 'configure-desc',
22 - 'version' => '0.13.11',
 22+ 'version' => '0.13.12',
2323 );
2424
2525 # Configuration part
@@ -167,7 +167,7 @@
168168 /**
169169 * Styles versions, you shouldn't change it
170170 */
171 -$wgConfigureStyleVersion = '20';
 171+$wgConfigureStyleVersion = '21';
172172
173173 # Adding new rights...
174174 $wgAvailableRights[] = 'configure';
Index: trunk/extensions/Configure/Configure.js
@@ -24,25 +24,24 @@
2525 var sections = [];
2626 var children = configform.childNodes;
2727 var hid = 0;
28 - var toc = document.createElement('ul');
 28+ var toc = document.createElement( 'ul' );
2929 toc.className = 'configtoc';
3030 toc.id = 'configtoc';
3131 toc.subLen = {};
32 - toc.confSec = 1;
3332 toc.confSub = -1;
3433 for( var i = 0; i < children.length; i++ ){
35 - if (children[i].nodeName.toLowerCase() == 'fieldset') {
 34+ if ( children[i].nodeName.toLowerCase() == 'fieldset' ) {
3635 children[i].id = 'config-section-' + i;
3736 children[i].className = 'configsection';
3837 var legends = children[i].getElementsByTagName( 'legend' );
39 - if (legends[0] && legends[0].firstChild.nodeValue) {
 38+ if ( legends[0] && legends[0].firstChild.nodeValue ) {
4039 var legend = legends[0].firstChild.nodeValue;
4140 } else {
4241 var legend = '# ' + seci;
4342 }
4443
45 - var li = document.createElement('li');
46 - if (i === 0) {
 44+ var li = document.createElement( 'li' );
 45+ if ( i == 0 ) {
4746 li.className = 'selected';
4847 }
4948
@@ -50,12 +49,12 @@
5150 var tables = getElementsByClassName( children[i], 'table', 'configure-table' );
5251
5352 if (headers.length > 1 && headers.length == tables.length) {
54 - var a = document.createElement('a');
 53+ var a = document.createElement( 'a' );
5554 a.onmousedown = a.onclick = configTocToggleElement;
5655 a.tocId = i;
5756 a.collapsed = true;
5857 a.appendChild( document.createTextNode( '[+]' ) );
59 - li.appendChild(a);
 58+ li.appendChild( a );
6059 }
6160
6261 var a = document.createElement('a');
@@ -68,7 +67,7 @@
6968 a.className = 'selected';
7069 }
7170 a.appendChild( document.createTextNode( legend ) );
72 - li.appendChild(a);
 71+ li.appendChild( a );
7372
7473 if( headers.length == tables.length && headers.length > 1 ){
7574 var len = headers.length;
@@ -83,7 +82,7 @@
8483 for( var subsect = 0; subsect < len; subsect++ ){
8584 headers[subsect].id = 'config-head-' + i + '-' + subsect;
8685 tables[subsect].id = 'config-table-' + i + '-' + subsect;
87 - var a = document.createElement('a');
 86+ var a = document.createElement( 'a' );
8887 a.href = '#' + headers[subsect].id;
8988 a.onmousedown = a.onclick = configToggle;
9089 a.confSec = i;
@@ -100,6 +99,9 @@
101100 toc.appendChild( li );
102101 if( hid == 1 ){
103102 children[i].style.display = 'none';
 103+ } else {
 104+ // IE wants 1, but FF and others want 0
 105+ toc.confSec = i;
104106 }
105107 hid = 1;
106108 }
@@ -291,7 +293,7 @@
292294 var li = document.createElement( 'li' );
293295
294296 a.href = '#config-head-'+data.fid+'-'+data.sid;
295 - addHandler( a, 'click', configToggle );
 297+ a.onclick = configToggle;
296298 a.confSec = data.fid;
297299 a.confSub = data.sid;
298300 a.appendChild( document.createTextNode( data.displayDescription ) );
@@ -466,7 +468,7 @@
467469 }
468470 }
469471
470 - if (!rows) {
 472+ if ( !rows ) {
471473 tr = document.createElement( 'tr' );
472474 var td = document.createElement( 'td' );
473475 td.setAttribute( 'colspan', 2 );
@@ -494,7 +496,7 @@
495497 var newLinkText;
496498 var newPlaceholderText;
497499
498 - if (toggleLink.firstChild.nodeValue == wgConfigureBiglistShow) {
 500+ if ( toggleLink.firstChild.nodeValue == wgConfigureBiglistShow ) {
499501 act = 'show';
500502 newLinkText = wgConfigureBiglistHide;
501503 content.style.display = 'block';
@@ -722,7 +724,6 @@
723725 * Helper for TOC
724726 */
725727 function configToggle() {
726 - var oldsecid = this.parentNode.parentNode.selectedid;
727728 var confSec = this.confSec;
728729 var confSub = this.confSub;
729730 var toc = document.getElementById( 'configtoc' );

Status & tagging log