r25935 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25934‎ | r25935 | r25936 >
Date:14:10, 19 September 2007
Author:aaron
Status:old
Tags:
Comment:
*Revert bogus code from r24419. indexOf() is meant for Strings, not arrays. If used on such, it dies miserably in IE.
Modified paths:
  • /trunk/phase3/skins/common/protect.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/protect.js
@@ -47,7 +47,7 @@
4848 if( lists[i].selectedIndex > -1 ) {
4949 var items = lists[i].getElementsByTagName( 'option' );
5050 var selected = items[ lists[i].selectedIndex ].value;
51 - if( wgCascadeableLevels.indexOf( selected ) == -1 ) {
 51+ if( !isCascadeableLevel(selected) ) {
5252 document.getElementById( 'mwProtect-cascade' ).checked = false;
5353 document.getElementById( 'mwProtect-cascade' ).disabled = true;
5454 return false;
@@ -58,6 +58,15 @@
5959 return true;
6060 }
6161
 62+function isCascadeableLevel( level ) {
 63+ for (var k = 0; k < wgCascadeableLevels.length; k++) {
 64+ if ( wgCascadeableLevels[k] == level ) {
 65+ return true;
 66+ }
 67+ }
 68+ return false;
 69+}
 70+
6271 /**
6372 * When protection levels are locked together, update the rest
6473 * when one action's level changes

Follow-up revisions

RevisionCommit summaryAuthorDate
r26015Merged revisions 25932-26011 via svnmerge from...david21:05, 21 September 2007

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r24419* (bug 10732) Protection chaining checkbox broken - this appears to have regr...robchurch23:09, 28 July 2007

Status & tagging log