r14923 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14922‎ | r14923 | r14924 >
Date:05:26, 23 June 2006
Author:tstarling
Status:old
Tags:
Comment:
Various JS warning fixes by Nick Jenkins
Modified paths:
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/wikibits.js
@@ -114,7 +114,7 @@
115115 var oli = false; // the li where the oldid radio is checked
116116 var hf = document.getElementById('pagehistory');
117117 if (!hf)
118 - return;
 118+ return true;
119119 var lis = hf.getElementsByTagName('li');
120120 for (i=0;i<lis.length;i++) {
121121 var inputs = historyRadios(lis[i]);
@@ -125,7 +125,7 @@
126126 if (oli) { // it's the second checked radio
127127 if (inputs[1].checked) {
128128 oli.className = "selected";
129 - return false
 129+ return false;
130130 }
131131 } else if (inputs[0].checked) {
132132 return false;
@@ -151,6 +151,7 @@
152152 }
153153 }
154154 }
 155+ return true;
155156 }
156157
157158 // generate toc from prefs form, fold sections
@@ -164,15 +165,15 @@
165166 return; // Occasional IE problem
166167 prefform.className = prefform.className + 'jsprefs';
167168 var sections = new Array();
168 - children = prefform.childNodes;
 169+ var children = prefform.childNodes;
169170 var seci = 0;
170 - for (i = 0; i < children.length; i++) {
 171+ for (var i = 0; i < children.length; i++) {
171172 if (children[i].nodeName.toLowerCase() == 'fieldset') {
172173 children[i].id = 'prefsection-' + seci;
173174 children[i].className = 'prefsection';
174175 if (is_opera || is_khtml)
175176 children[i].className = 'prefsection operaprefsection';
176 - legends = children[i].getElementsByTagName('legend');
 177+ var legends = children[i].getElementsByTagName('legend');
177178 sections[seci] = new Object();
178179 legends[0].className = 'mainLegend';
179180 if (legends[0] && legends[0].firstChild.nodeValue)
@@ -207,15 +208,15 @@
208209 }
209210
210211 function uncoversection() {
211 - oldsecid = this.parentNode.parentNode.selectedid;
212 - newsec = document.getElementById(this.secid);
 212+ var oldsecid = this.parentNode.parentNode.selectedid;
 213+ var newsec = document.getElementById(this.secid);
213214 if (oldsecid != this.secid) {
214 - ul = document.getElementById('preftoc');
 215+ var ul = document.getElementById('preftoc');
215216 document.getElementById(oldsecid).style.display = 'none';
216217 newsec.style.display = 'block';
217218 ul.selectedid = this.secid;
218 - lis = ul.getElementsByTagName('li');
219 - for (i = 0; i< lis.length; i++) {
 219+ var lis = ul.getElementsByTagName('li');
 220+ for (var i = 0; i< lis.length; i++) {
220221 lis[i].className = '';
221222 }
222223 this.parentNode.className = 'selected';
@@ -239,7 +240,7 @@
240241 }
241242
242243 function unhidetzbutton() {
243 - tzb = document.getElementById('guesstimezonebutton')
 244+ var tzb = document.getElementById('guesstimezonebutton');
244245 if (tzb)
245246 tzb.style.display = 'inline';
246247 }
@@ -348,6 +349,7 @@
349350 }
350351
351352 parent.appendChild(image);
 353+ return true;
352354 }
353355
354356 function mwSetupToolbar() {
@@ -368,6 +370,7 @@
369371 for (var i in mwCustomEditButtons) {
370372 mwInsertEditButton(toolbar, mwCustomEditButtons[i]);
371373 }
 374+ return true;
372375 }
373376
374377 function escapeQuotes(text) {
@@ -742,4 +745,4 @@
743746 }
744747
745748 hookEvent("load", allmessagesshow);
746 -hookEvent("load", mwSetupToolbar);
\ No newline at end of file
 749+hookEvent("load", mwSetupToolbar);

Status & tagging log