r44177 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44176‎ | r44177 | r44178 >
Date:16:07, 3 December 2008
Author:ialex
Status:ok
Tags:
Comment:
* CHANGELOG entry, bump $wgConfigureStyleVersion and version
* Fix problem in setting search: row.tagName (line 333) is lowercase
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,10 @@
22 This file lists changes on this extension.
33 Localisation updates are done on betawiki and aren't listed here.
44
 5+0.10.13 - 3 December 2008
 6+ * JavaScript-based setting search in Special:Configure and Special:Extensions
 7+ * Hidden settings now have a summary
 8+
59 0.10.12 - 2 December 2008
610 * Fix a problem of duplicate files with the same timestamp if two users save
711 a new version at the same time
@@ -10,8 +14,8 @@
1115 * New reason field in Special:Configure and Special:Extension to allow users
1216 to put a comment for each version
1317 * File handler now uses PHP files instead of serialized files.
14 - NOTE FOR PEOPLE USING FILES HANDLER: OLD SERIALIZED WON'T WORK ANYMORE IN
15 - THIS VERSION, PLEASE RUN THE migrateFiles.php SCRIPT.
 18+ NOTE FOR PEOPLE USING FILES HANDLER: OLD SERIALIZED FILES WON'T WORK ANYMORE
 19+ IN THIS VERSION, PLEASE RUN THE migrateFiles.php SCRIPT.
1620
1721 0.10.10 - 30 November 2008
1822 * Editable settings are now restricted by default to some settings, if you
Index: trunk/extensions/Configure/Configure.php
@@ -17,7 +17,7 @@
1818 'url' => 'http://www.mediawiki.org/wiki/Extension:Configure',
1919 'description' => 'Allow authorised users to configure the wiki via a web-based interface',
2020 'descriptionmsg' => 'configure-desc',
21 - 'version' => '0.10.12',
 21+ 'version' => '0.10.13',
2222 );
2323
2424 # Configuration part
@@ -147,7 +147,7 @@
148148 /**
149149 * Styles versions, you shouldn't change it
150150 */
151 -$wgConfigureStyleVersion = '13';
 151+$wgConfigureStyleVersion = '14';
152152
153153 # Adding new rights...
154154 $wgAvailableRights[] = 'configure';
Index: trunk/extensions/Configure/Configure.js
@@ -235,7 +235,7 @@
236236 /** Collapsible big lists */
237237 var biglists = getElementsByClassName( configform, '*', 'configure-biglist' );
238238
239 - for( var l = 0; l < biglists.length; l++ ) {
 239+ for( var l = 0; l < biglists.length; l++ ) {
240240 var list = biglists[l];
241241
242242 list.id = 'configure-biglist-content-'+l;
@@ -279,18 +279,18 @@
280280 var results = document.getElementById( 'configure-search-results' );
281281
282282 // Empty the existing results
283 - while(results.firstChild) {
 283+ while( results.firstChild ) {
284284 results.removeChild(results.firstChild);
285285 }
286286
287 - if (query == '') {
 287+ if ( query == '' ) {
288288 return;
289289 }
290290
291291 var isMatch = function(element) { return element.description.indexOf( query ) !== -1; }
292 - for( var i=0;i<allSettings.length;++i ) {
 292+ for( var i=0; i<allSettings.length; ++i ) {
293293 var data = allSettings[i];
294 - if (isMatch( data )) {
 294+ if ( isMatch( data ) ) {
295295 var a = document.createElement( 'a' );
296296 var li = document.createElement( 'li' );
297297
@@ -312,12 +312,12 @@
313313 // For each section...
314314 var rootElement = document.getElementById( 'configure' );
315315 var fieldsets = rootElement.getElementsByTagName( 'fieldset' );
316 - for( var fid=0;fid<fieldsets.length;++fid ) {
 316+ for( var fid=0; fid<fieldsets.length; ++fid ) {
317317 // For each subsection...
318318 var fieldset = fieldsets[fid];
319319 var fieldset_title = getInnerText( fieldset.getElementsByTagName( 'legend' )[0] );
320320 var subsections = getElementsByClassName( fieldset, 'table', 'configure-table' );
321 - for( var sid=0;sid<subsections.length;++sid ) {
 321+ for( var sid=0; sid<subsections.length; ++sid ) {
322322 var subsection;
323323 if (subsections[sid].getElementsByTagName( 'tbody' ).length > 0) {
324324 subsection = subsections[sid].getElementsByTagName( 'tbody' )[0];
@@ -328,17 +328,20 @@
329329
330330 // For each setting...
331331 for( var i=0; i<subsection.childNodes.length;++i ) {
 332+
332333 var row = subsection.childNodes[i];
333 - if ( row.nodeType != row.ELEMENT_NODE || row.tagName != 'TR' ) {
 334+ if ( row.nodeType != row.ELEMENT_NODE || ( row.tagName != 'tr' && row.tagName != 'TR' ) ) {
334335 continue;
335336 }
336337
337338 var desc_cell = getElementsByClassName( row, 'td', 'configure-left-column' )[0];
338 -
339 -
 339+ if( typeof desc_cell == "undefined" ){
 340+ continue;
 341+ }
 342+
340343 var description;
341344
342 - if (desc_cell.getElementsByTagName( 'p' ).length) { // Ward off comments like "This setting has been customised"
 345+ if ( desc_cell.getElementsByTagName( 'p' ).length ) { // Ward off comments like "This setting has been customised"
343346 description = getInnerText( desc_cell.getElementsByTagName( 'p' )[0] );
344347 } else {
345348 description = getInnerText( desc_cell );

Status & tagging log