r77922 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77921‎ | r77922 | r77923 >
Date:22:29, 6 December 2010
Author:reedy
Status:ok (Comments)
Tags:
Comment:
(bug 26265) Many semicolons are missing from JavaScript files

Unterminated statements..
Modified paths:
  • /trunk/phase3/skins/common/IEFixes.js (modified) (history)
  • /trunk/phase3/skins/common/ajax.js (modified) (history)
  • /trunk/phase3/skins/common/block.js (modified) (history)
  • /trunk/phase3/skins/common/changepassword.js (modified) (history)
  • /trunk/phase3/skins/common/edit.js (modified) (history)
  • /trunk/phase3/skins/common/enhancedchanges.js (modified) (history)
  • /trunk/phase3/skins/common/history.js (modified) (history)
  • /trunk/phase3/skins/common/htmlform.js (modified) (history)
  • /trunk/phase3/skins/common/metadata.js (modified) (history)
  • /trunk/phase3/skins/common/mwsuggest.js (modified) (history)
  • /trunk/phase3/skins/common/password.js (modified) (history)
  • /trunk/phase3/skins/common/prefs.js (modified) (history)
  • /trunk/phase3/skins/common/preview.js (modified) (history)
  • /trunk/phase3/skins/common/protect.js (modified) (history)
  • /trunk/phase3/skins/common/search.js (modified) (history)
  • /trunk/phase3/skins/common/upload.js (modified) (history)
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/protect.js
@@ -20,7 +20,7 @@
2121 if( !box )
2222 return false;
2323
24 - var boxbody = box.getElementsByTagName('tbody')[0]
 24+ var boxbody = box.getElementsByTagName('tbody')[0];
2525 var row = document.createElement( 'tr' );
2626 boxbody.insertBefore( row, boxbody.firstChild.nextSibling );
2727
@@ -348,4 +348,4 @@
349349 }
350350 });
351351 }
352 -}
 352+};
Index: trunk/phase3/skins/common/metadata.js
@@ -46,7 +46,7 @@
4747 return true;
4848 }
4949 return false;
50 -}
 50+};
5151
5252 $( document ).ready( function() {
5353 attachMetadataToggle( 'mw_metadata', mediaWiki.msg( 'metadata-expand' ), mediaWiki.msg( 'metadata-collapse' ) );
Index: trunk/phase3/skins/common/block.js
@@ -16,7 +16,7 @@
1717 } else {
1818 field.style.display = 'none';
1919 }
20 -}
 20+};
2121 window.updateBlockOptions = function() {
2222 if ( !document.getElementById ) {
2323 return;
@@ -59,6 +59,6 @@
6060 if( watchuserRow ) {
6161 watchuserRow.style.display = isIpRange && !isEmpty ? 'none' : '';
6262 }
63 -}
 63+};
6464
6565 addOnloadHook( considerChangingExpiryFocus );
\ No newline at end of file
Index: trunk/phase3/skins/common/IEFixes.js
@@ -10,7 +10,7 @@
1111 relativeforfloats();
1212 fixalpha();
1313 }
14 -}
 14+};
1515
1616 if ( document.attachEvent ) {
1717 document.attachEvent( 'onreadystatechange', window.hookit );
@@ -61,7 +61,7 @@
6262 linkFix.style.width = '100%';
6363 }
6464 }
65 -}
 65+};
6666
6767 // fix ie6 disappering float bug
6868 window.relativeforfloats = function() {
@@ -72,7 +72,8 @@
7373 }
7474 setrelative( tables );
7575 setrelative( divs );
76 -}
 76+};
 77+
7778 window.setrelative = function( nodes ) {
7879 var i = 0;
7980 while ( i < nodes.length ) {
@@ -84,7 +85,7 @@
8586 }
8687 i++;
8788 }
88 -}
 89+};
8990
9091 // Expand links for printing
9192 String.prototype.hasClass = function( classWanted ) {
@@ -95,7 +96,7 @@
9697 }
9798 }
9899 return false;
99 -}
 100+};
100101
101102 window.expandedURLs = undefined;
102103
@@ -117,7 +118,7 @@
118119 }
119120 }
120121 }
121 -}
 122+};
122123
123124 window.onafterprint = function() {
124125 for ( var i = 0; i < expandedURLs.length; i++ ) {
@@ -125,4 +126,4 @@
126127 expandedURLs[i].removeNode( true );
127128 }
128129 }
129 -}
 130+};
Index: trunk/phase3/skins/common/enhancedchanges.js
@@ -37,4 +37,4 @@
3838 closearrow.className = 'mw-changeslist-hidden';
3939 subentries.className = 'mw-changeslist-hidden';
4040 }
41 -}
 41+};
Index: trunk/phase3/skins/common/password.js
@@ -36,7 +36,7 @@
3737 score += ( charClasses - 1 ) * 10;
3838
3939 return score;
40 -}
 40+};
4141
4242 // Calculates a penalty to brute force score due to character repetition
4343 window.repetitionAdjustment = function( pwd ) {
@@ -49,7 +49,7 @@
5050 var ratio = pwd.length / unique.length - 0.4; // allow up to 40% repetition, reward for less, penalize for more
5151
5252 return ratio * 10;
53 -}
 53+};
5454
5555 // Checks how many simple sequences ("abc", "321") are there in the password
5656 window.sequenceScore = function( pwd ) {
@@ -76,7 +76,7 @@
7777 }
7878 }
7979 return score;
80 -}
 80+};
8181
8282 (function( $ ) {
8383 function passwordChanged() {
Index: trunk/phase3/skins/common/search.js
@@ -20,7 +20,7 @@
2121 prefix = '&search=';
2222 }
2323 obj.href = parts[0] + prefix + encodeURIComponent( searchterm ) + lastpart;
24 -}
 24+};
2525
2626 window.mwToggleSearchCheckboxes = function( btn ) {
2727 if( !document.getElementById ) {
@@ -47,4 +47,4 @@
4848 }
4949 }
5050 }
51 -}
 51+};
Index: trunk/phase3/skins/common/changepassword.js
@@ -7,10 +7,10 @@
88 document.getElementById('wpPassword').disabled = false;
99 document.getElementById('wpComment').disabled = true;
1010 }
11 -}
 11+};
1212
1313 window.onNameChangeHook = function() {
1414 document.getElementById( 'wpName' ).onblur = onNameChange;
15 -}
 15+};
1616
1717 addOnloadHook( onNameChangeHook );
Index: trunk/phase3/skins/common/prefs.js
@@ -11,7 +11,7 @@
1212 var junk = msg.split('$1');
1313 document.write( junk[0] + 'UTC' + tzString + junk[1] );
1414 }
15 -}
 15+};
1616
1717 window.timezoneSetup = function() {
1818 var tzSelect = document.getElementById( 'mw-input-timecorrection' );
@@ -23,7 +23,7 @@
2424 }
2525
2626 updateTimezoneSelection( false );
27 -}
 27+};
2828
2929 // in [-]HH:MM format...
3030 // won't yet work with non-even tzs
@@ -37,7 +37,7 @@
3838 var tzString = ( ( tzRaw >= 0 ) ? '-' : '' ) + ( ( tzHour < 10 ) ? '0' : '' ) + tzHour +
3939 ':' + ( ( tzMin < 10 ) ? '0' : '' ) + tzMin;
4040 return tzString;
41 -}
 41+};
4242
4343 window.guessTimezone = function() {
4444 var textbox = document.getElementById( 'mw-input-timecorrection-other' );
@@ -47,7 +47,7 @@
4848 textbox.value = fetchTimezone();
4949 textbox.disabled = false; // The changed handler doesn't trip, obviously.
5050 updateTimezoneSelection( true );
51 -}
 51+};
5252
5353 window.updateTimezoneSelection = function( force_offset ) {
5454 var selector = document.getElementById( 'mw-input-timecorrection' );
@@ -133,6 +133,6 @@
134134 }
135135 textbox.value = hour + ':' + min;
136136 }
137 -}
 137+};
138138
139139 addOnloadHook( timezoneSetup );
Index: trunk/phase3/skins/common/preview.js
@@ -50,7 +50,7 @@
5151
5252 $( mw ).trigger( 'LivePreviewDone', [copyElements] );
5353 } );
54 -}
 54+};
5555
5656 // Shamelessly stolen from the jQuery form plugin, which is licensed under the GPL.
5757 // http://jquery.malsup.com/form/#download
Index: trunk/phase3/skins/common/ajax.js
@@ -156,7 +156,7 @@
157157 }
158158
159159 return;
160 - }
 160+ };
161161
162162 sajax_debug( func_name + ' uri = ' + uri + ' / post = ' + post_data );
163163 x.send( post_data );
Index: trunk/phase3/skins/common/upload.js
@@ -9,7 +9,7 @@
1010 }
1111 // We might show a preview
1212 wgUploadLicenseObj.fetchPreview( selection );
13 -}
 13+};
1414
1515 window.wgUploadSetup = function() {
1616 // Disable URL box if the URL copy upload source type is not selected
@@ -84,7 +84,7 @@
8585 document.getElementById( wgUploadSourceIds[i] ).onchange = function (e) {
8686 fillDestFilename( this.id );
8787 };
88 -}
 88+};
8989
9090 /**
9191 * Iterate over all upload source fields and disable all except the selected one.
@@ -123,7 +123,7 @@
124124 inputs[j].disabled = !isChecked;
125125 }
126126 }
127 -}
 127+};
128128
129129 window.wgUploadWarningObj = {
130130 'responseCache' : { '' : '&nbsp;' },
@@ -209,7 +209,7 @@
210210 element.innerHTML = text;
211211 }
212212 }
213 -}
 213+};
214214
215215 window.fillDestFilename = function(id) {
216216 if (!wgUploadAutoFill) {
@@ -263,7 +263,7 @@
264264 if( e ) e.className = 'error';
265265
266266 // Clear wpDestFile as well
267 - var e = document.getElementById( 'wpDestFile' )
 267+ var e = document.getElementById( 'wpDestFile' );
268268 if( e ) e.value = '';
269269
270270 return false;
@@ -283,7 +283,7 @@
284284 destFile.value = fname;
285285 wgUploadWarningObj.checkNow(fname) ;
286286 }
287 -}
 287+};
288288
289289 window.toggleFilenameFiller = function() {
290290 if(!document.getElementById) return;
@@ -294,7 +294,7 @@
295295 } else {
296296 wgUploadAutoFill = false;
297297 }
298 -}
 298+};
299299
300300 window.wgUploadLicenseObj = {
301301
@@ -340,6 +340,6 @@
341341 previewPanel.innerHTML = preview;
342342 }
343343
344 -}
 344+};
345345
346346 addOnloadHook( wgUploadSetup );
Index: trunk/phase3/skins/common/mwsuggest.js
@@ -57,7 +57,7 @@
5858 this.id = id;
5959 this.r = r;
6060 this.query = query;
61 -}
 61+};
6262
6363 /** Property class for single search box */
6464 window.os_Results = function( name, formname ) {
@@ -77,7 +77,7 @@
7878 this.containerTotal = 0; // total height of the container will all results
7979 this.visible = false; // if container is visible
8080 this.stayHidden = false; // don't try to show if lost focus
81 -}
 81+};
8282
8383 /** Timer user to animate expansion/contraction of container width */
8484 window.os_AnimationTimer = function( r, target ) {
@@ -91,7 +91,7 @@
9292 this.inc = -os_animation_min_step;
9393 }
9494 this.target = target;
95 -}
 95+};
9696
9797 /******************
9898 * Initialization
@@ -107,7 +107,7 @@
108108 os_initHandlers( id, form, element );
109109 }
110110 }
111 -}
 111+};
112112
113113 /** Init Result objects and event handlers */
114114 window.os_initHandlers = function( name, formname, element ) {
@@ -157,7 +157,7 @@
158158 } */
159159 }
160160
161 -}
 161+};
162162
163163 window.os_hookEvent = function( element, hookName, hookFunct ) {
164164 if ( element.addEventListener ) {
@@ -165,7 +165,7 @@
166166 } else if ( window.attachEvent ) {
167167 element.attachEvent( 'on' + hookName, hookFunct );
168168 }
169 -}
 169+};
170170
171171 /********************
172172 * Keyboard events
@@ -185,7 +185,7 @@
186186 }
187187 var query = targ.value;
188188 os_fetchResults( r, query, os_search_timeout );
189 -}
 189+};
190190
191191 /** catch arrows up/down and escape to hide the suggestions */
192192 window.os_processKey = function( r, keypressed, targ ) {
@@ -215,7 +215,7 @@
216216 } else if( r.query != document.getElementById( r.searchbox ).value ) {
217217 // os_hideResults( r ); // don't show old suggestions
218218 }
219 -}
 219+};
220220
221221 /** When keys is held down use a timer to output regular events */
222222 window.os_eventKeypress = function( e ) {
@@ -229,7 +229,7 @@
230230
231231 os_keypressed_count++;
232232 os_processKey( r, keypressed, targ );
233 -}
 233+};
234234
235235 /** Catch the key code (Firefox bug) */
236236 window.os_eventKeydown = function( e ) {
@@ -246,7 +246,7 @@
247247
248248 os_cur_keypressed = ( e.keyCode == undefined ) ? e.which : e.keyCode;
249249 os_keypressed_count = 0;
250 -}
 250+};
251251
252252
253253 /** When the form is submitted hide everything, cancel updates... */
@@ -272,7 +272,7 @@
273273 }
274274 }
275275 return true;
276 -}
 276+};
277277
278278
279279
@@ -289,7 +289,7 @@
290290 }
291291 r.visible = false;
292292 r.selected = -1;
293 -}
 293+};
294294
295295 window.os_decodeValue = function( value ) {
296296 if ( decodeURIComponent ) {
@@ -299,7 +299,7 @@
300300 return unescape( value );
301301 }
302302 return null;
303 -}
 303+};
304304
305305 window.os_encodeQuery = function( value ) {
306306 if ( encodeURIComponent ) {
@@ -309,7 +309,7 @@
310310 return escape( value );
311311 }
312312 return null;
313 -}
 313+};
314314
315315 /** Handles data from XMLHttpRequest, and updates the suggest results */
316316 window.os_updateResults = function( r, query, text, cacheKey ) {
@@ -340,7 +340,7 @@
341341 os_cache[cacheKey] = null;
342342 }
343343 }
344 -}
 344+};
345345
346346 /**
347347 * Create and populate a <datalist>.
@@ -370,7 +370,7 @@
371371 r.results[i] = title;
372372 c.appendChild( opt );
373373 }
374 -}
 374+};
375375
376376 /** Fetch namespaces from checkboxes or hidden fields in the search form,
377377 if none defined use wgSearchNamespaces global */
@@ -395,7 +395,7 @@
396396 namespaces = wgSearchNamespaces.join('|');
397397 }
398398 return namespaces;
399 -}
 399+};
400400
401401 /** Update results if user hasn't already typed something else */
402402 window.os_updateIfRelevant = function( r, query, text, cacheKey ) {
@@ -404,7 +404,7 @@
405405 os_updateResults( r, query, text, cacheKey );
406406 }
407407 r.query = query;
408 -}
 408+};
409409
410410 /** Fetch results after some timeout */
411411 window.os_delayedFetch = function() {
@@ -441,7 +441,7 @@
442442 }
443443 }
444444 }
445 -}
 445+};
446446
447447 /** Init timed update via os_delayedUpdate() */
448448 window.os_fetchResults = function( r, query, timeout ) {
@@ -466,7 +466,7 @@
467467 os_timer = new os_Timer( null, r, query );
468468 os_delayedFetch(); // do it now!
469469 }
470 -}
 470+};
471471
472472 /** Find event target */
473473 window.os_getTarget = function( e ) {
@@ -480,7 +480,7 @@
481481 } else {
482482 return null;
483483 }
484 -}
 484+};
485485
486486 /** Check if x is a valid integer */
487487 window.os_isNumber = function( x ) {
@@ -494,12 +494,12 @@
495495 }
496496 }
497497 return true;
498 -}
 498+};
499499
500500 /** Call this to enable suggestions on input (id=inputId), on a form (name=formName) */
501501 window.os_enableSuggestionsOn = function( inputId, formName ) {
502502 os_initHandlers( inputId, formName, document.getElementById( inputId ) );
503 -}
 503+};
504504
505505 /** Call this to disable suggestios on input box (id=inputId) */
506506 window.os_disableSuggestionsOn = function( inputId ) {
@@ -519,7 +519,7 @@
520520 if ( index >= 0 ) {
521521 os_autoload_inputs[index] = os_autoload_forms[index] = '';
522522 }
523 -}
 523+};
524524
525525 /************************************************
526526 * Div-only functions (irrelevant for datalist)
@@ -542,7 +542,7 @@
543543 }
544544 os_timer = null;
545545 }
546 -}
 546+};
547547
548548 /** Event: focus (catch only when stopped) */
549549 window.os_eventFocus = function( e ) {
@@ -552,7 +552,7 @@
553553 return; // not our event
554554 }
555555 r.stayHidden = false;
556 -}
 556+};
557557
558558 /**
559559 * Create and populate a <div>, for non-<datalist>-supporting browsers.
@@ -573,7 +573,7 @@
574574 os_fitContainer( r );
575575 os_trimResultText( r );
576576 os_showResults( r );
577 -}
 577+};
578578
579579 /** Create the result table to be placed in the container div */
580580 window.os_createResultTable = function( r, results ) {
@@ -589,7 +589,7 @@
590590 }
591591 html += '</table>';
592592 return html;
593 -}
 593+};
594594
595595 /** Show results div */
596596 window.os_showResults = function( r ) {
@@ -607,7 +607,7 @@
608608 c.style.visibility = 'visible';
609609 r.visible = true;
610610 }
611 -}
 611+};
612612
613613 window.os_operaWidthFix = function( x ) {
614614 // For browsers that don't understand overflow-x, estimate scrollbar width
@@ -615,7 +615,7 @@
616616 return 30;
617617 }
618618 return 0;
619 -}
 619+};
620620
621621 /** Brower-dependent functions to find window inner size, and scroll status */
622622 window.f_clientWidth = function() {
@@ -624,7 +624,7 @@
625625 document.documentElement ? document.documentElement.clientWidth : 0,
626626 document.body ? document.body.clientWidth : 0
627627 );
628 -}
 628+};
629629
630630 window.f_clientHeight = function() {
631631 return f_filterResults(
@@ -632,7 +632,7 @@
633633 document.documentElement ? document.documentElement.clientHeight : 0,
634634 document.body ? document.body.clientHeight : 0
635635 );
636 -}
 636+};
637637
638638 window.f_scrollLeft = function() {
639639 return f_filterResults(
@@ -640,7 +640,7 @@
641641 document.documentElement ? document.documentElement.scrollLeft : 0,
642642 document.body ? document.body.scrollLeft : 0
643643 );
644 -}
 644+};
645645
646646 window.f_scrollTop = function() {
647647 return f_filterResults(
@@ -648,7 +648,7 @@
649649 document.documentElement ? document.documentElement.scrollTop : 0,
650650 document.body ? document.body.scrollTop : 0
651651 );
652 -}
 652+};
653653
654654 window.f_filterResults = function( n_win, n_docel, n_body ) {
655655 var n_result = n_win ? n_win : 0;
@@ -656,7 +656,7 @@
657657 n_result = n_docel;
658658 }
659659 return n_body && ( !n_result || ( n_result > n_body ) ) ? n_body : n_result;
660 -}
 660+};
661661
662662 /** Get the height available for the results container */
663663 window.os_availableHeight = function( r ) {
@@ -666,7 +666,7 @@
667667 absTop = absTop.substring( 0, px );
668668 }
669669 return f_clientHeight() - ( absTop - f_scrollTop() );
670 -}
 670+};
671671
672672 /** Get element absolute position {left,top} */
673673 window.os_getElementPosition = function( elemID ) {
@@ -683,33 +683,41 @@
684684 offsetTop += document.body.topMargin;
685685 }
686686 return { left:offsetLeft, top:offsetTop };
687 -}
 687+};
688688
689689 /** Create the container div that will hold the suggested titles */
690 -window.os_createContainer = function( r ) {
691 - var c = document.createElement( 'div' );
692 - var s = document.getElementById( r.searchbox );
693 - var pos = os_getElementPosition( r.searchbox );
 690+window.os_createContainer = function(r) {
 691+ var c = document.createElement('div');
 692+ var s = document.getElementById(r.searchbox);
 693+ var pos = os_getElementPosition(r.searchbox);
694694 var left = pos.left;
695695 var top = pos.top + s.offsetHeight;
696696 c.className = 'os-suggest';
697 - c.setAttribute( 'id', r.container );
698 - document.body.appendChild( c );
 697+ c.setAttribute('id', r.container);
 698+ document.body.appendChild(c);
699699
700700 // dynamically generated style params
701701 // IE workaround, cannot explicitely set "style" attribute
702 - c = document.getElementById( r.container );
 702+ c = document.getElementById(r.container);
703703 c.style.top = top + 'px';
704704 c.style.left = left + 'px';
705705 c.style.width = s.offsetWidth + 'px';
706706
707707 // mouse event handlers
708 - c.onmouseover = function( event ) { os_eventMouseover( r.searchbox, event ); };
709 - c.onmousemove = function( event ) { os_eventMousemove( r.searchbox, event ); };
710 - c.onmousedown = function( event ) { return os_eventMousedown( r.searchbox, event ); };
711 - c.onmouseup = function( event ) { os_eventMouseup( r.searchbox, event ); };
 708+ c.onmouseover = function(event) {
 709+ os_eventMouseover(r.searchbox, event);
 710+ };
 711+ c.onmousemove = function(event) {
 712+ os_eventMousemove(r.searchbox, event);
 713+ };
 714+ c.onmousedown = function(event) {
 715+ return os_eventMousedown(r.searchbox, event);
 716+ };
 717+ c.onmouseup = function(event) {
 718+ os_eventMouseup(r.searchbox, event);
 719+ };
712720 return c;
713 -}
 721+};
714722
715723 /** change container height to fit to screen */
716724 window.os_fitContainer = function( r ) {
@@ -730,7 +738,7 @@
731739 c.style.height = r.containerTotal + 'px';
732740 r.containerCount = r.resultCount;
733741 }
734 -}
 742+};
735743
736744 /** If some entries are longer than the box, replace text with "..." */
737745 window.os_trimResultText = function( r ) {
@@ -796,7 +804,7 @@
797805 document.getElementById( r.resultTable + i ).setAttribute( 'title', r.results[i] );
798806 }
799807 }
800 -}
 808+};
801809
802810 /** Invoked on timer to animate change in container width */
803811 window.os_animateChangeWidth = function() {
@@ -820,7 +828,7 @@
821829 c.style.left = ( normL + normW + ( target - nw ) - os_animation_timer.target - 1 ) + 'px';
822830 }
823831 }
824 -}
 832+};
825833
826834 /** Change the highlighted row (i.e. suggestion), from position cur to next */
827835 window.os_changeHighlight = function( r, cur, next, updateSearchBox ) {
@@ -868,7 +876,7 @@
869877 if( updateSearchBox ) {
870878 os_updateSearchQuery( r, newText );
871879 }
872 -}
 880+};
873881
874882 window.os_HighlightClass = function() {
875883 var match = navigator.userAgent.match(/AppleWebKit\/(\d+)/);
@@ -882,12 +890,12 @@
883891 }
884892 }
885893 return 'os-suggest-result-hl';
886 -}
 894+};
887895
888896 window.os_updateSearchQuery = function( r, newText ) {
889897 document.getElementById( r.searchbox ).value = newText;
890898 r.query = newText;
891 -}
 899+};
892900
893901
894902 /********************
@@ -905,7 +913,7 @@
906914 if( num >= 0 ) {
907915 os_changeHighlight( r, r.selected, num, false );
908916 }
909 -}
 917+};
910918
911919 /* Get row where the event occured (from its id) */
912920 window.os_getNumberSuffix = function( id ) {
@@ -918,12 +926,12 @@
919927 } else {
920928 return -1;
921929 }
922 -}
 930+};
923931
924932 /** Save mouse move as last action */
925933 window.os_eventMousemove = function( srcId, e ) {
926934 os_mouse_moved = true;
927 -}
 935+};
928936
929937 /** Mouse button held down, register possible click */
930938 window.os_eventMousedown = function( srcId, e ) {
@@ -943,7 +951,7 @@
944952 document.getElementById( r.searchbox ).focus();
945953
946954 return false; // prevents selection
947 -}
 955+};
948956
949957 /** Mouse button released, check for click on some row */
950958 window.os_eventMouseup = function( srcId, e ) {
@@ -962,7 +970,7 @@
963971 os_mouse_pressed = false;
964972 // keep the focus on the search field
965973 document.getElementById( r.searchbox ).focus();
966 -}
 974+};
967975
968976 /** Toggle stuff seems to be dead code? */
969977
@@ -978,7 +986,7 @@
979987 link.appendChild( msg );
980988 t.appendChild( link );
981989 return t;
982 -}
 990+};
983991
984992 /** Call when user clicks on some of the toggle links */
985993 window.os_toggle = function( inputId, formName ) {
@@ -995,6 +1003,6 @@
9961004 // change message
9971005 var link = document.getElementById( r.toggle ).firstChild;
9981006 link.replaceChild( document.createTextNode( msg ), link.firstChild );
999 -}
 1007+};
10001008
10011009 hookEvent( 'load', os_MWSuggestInit );
Index: trunk/phase3/skins/common/edit.js
@@ -12,7 +12,7 @@
1313 'tagClose': tagClose,
1414 'sampleText': sampleText
1515 });
16 -}
 16+};
1717
1818 // this function adds one toolbar button from a mwEditButtons/mwCustomEditButtons item
1919 window.mwInsertEditButton = function( parent, item ) {
@@ -39,7 +39,7 @@
4040
4141 parent.appendChild( image );
4242 return true;
43 -}
 43+};
4444
4545 // this function generates the actual toolbar buttons with localized text
4646 // we use it to avoid creating the toolbar where javascript is not enabled
@@ -73,7 +73,7 @@
7474 mwInsertEditButton( toolbar, mwCustomEditButtons[i] );
7575 }
7676 return true;
77 -}
 77+};
7878
7979 // apply tagOpen/tagClose to selection in textarea,
8080 // use sampleText instead of selection if there is none
@@ -160,7 +160,7 @@
161161 }
162162 }
163163
164 -}
 164+};
165165
166166 /**
167167 * Restore the edit box scroll state following a preview operation,
@@ -178,7 +178,7 @@
179179 scrollTop.value = editBox.scrollTop;
180180 } );
181181 }
182 -}
 182+};
183183 hookEvent( 'load', scrollEditBox );
184184 hookEvent( 'load', mwSetupToolbar );
185185 hookEvent( 'load', function() {
@@ -262,7 +262,7 @@
263263 e.returnValue = false; //IE
264264 return false;
265265 }
266 - }
 266+ };
267267
268268 addHandler(summary, 'keypress', checkSummary);
269269 });
Index: trunk/phase3/skins/common/wikibits.js
@@ -63,7 +63,7 @@
6464 } else {
6565 hookFunct(); // bug in MSIE script loading
6666 }
67 -}
 67+};
6868
6969 window.importScript = function( page ) {
7070 // TODO: might want to introduce a utility function to match wfUrlencode() in PHP
@@ -71,7 +71,7 @@
7272 encodeURIComponent(page.replace(/ /g,'_')).replace(/%2F/ig,'/').replace(/%3A/ig,':') +
7373 '&action=raw&ctype=text/javascript';
7474 return importScriptURI( uri );
75 -}
 75+};
7676
7777 window.loadedScripts = {}; // included-scripts tracker
7878 window.importScriptURI = function( url ) {
@@ -84,11 +84,11 @@
8585 s.setAttribute( 'type', 'text/javascript' );
8686 document.getElementsByTagName('head')[0].appendChild( s );
8787 return s;
88 -}
 88+};
8989
9090 window.importStylesheet = function( page ) {
9191 return importStylesheetURI( wgScript + '?action=raw&ctype=text/css&title=' + encodeURIComponent( page.replace(/ /g,'_') ) );
92 -}
 92+};
9393
9494 window.importStylesheetURI = function( url, media ) {
9595 var l = document.createElement( 'link' );
@@ -100,7 +100,7 @@
101101 }
102102 document.getElementsByTagName('head')[0].appendChild( l );
103103 return l;
104 -}
 104+};
105105
106106 window.appendCSS = function( text ) {
107107 var s = document.createElement( 'style' );
@@ -113,7 +113,7 @@
114114 }
115115 document.getElementsByTagName('head')[0].appendChild( s );
116116 return s;
117 -}
 117+};
118118
119119 // Special stylesheet links for Monobook only (see bug 14717)
120120 if ( typeof stylepath != 'undefined' && skin == 'monobook' ) {
@@ -170,7 +170,7 @@
171171 toggleToc();
172172 }
173173 }
174 -}
 174+};
175175
176176 window.changeText = function( el, newText ) {
177177 // Safari work around
@@ -179,7 +179,7 @@
180180 } else if ( el.firstChild && el.firstChild.nodeValue ) {
181181 el.firstChild.nodeValue = newText;
182182 }
183 -}
 183+};
184184
185185 window.killEvt = function( evt ) {
186186 evt = evt || window.event || window.Event; // W3C, IE, Netscape
@@ -190,7 +190,7 @@
191191 evt.cancelBubble = true; // IE
192192 }
193193 return false; // Don't follow the link (IE)
194 -}
 194+};
195195
196196 window.toggleToc = function() {
197197 var tocmain = document.getElementById( 'toc' );
@@ -209,7 +209,7 @@
210210 tocmain.className = 'toc tochidden';
211211 }
212212 return false;
213 -}
 213+};
214214
215215 window.mwEditButtons = [];
216216 window.mwCustomEditButtons = []; // eg to add in MediaWiki:Common.js
@@ -220,7 +220,7 @@
221221 re = new RegExp( "\\n", "g" );
222222 text = text.replace( re, "\\n" );
223223 return escapeQuotesHTML( text );
224 -}
 224+};
225225
226226 window.escapeQuotesHTML = function( text ) {
227227 var re = new RegExp( '&', "g" );
@@ -232,7 +232,7 @@
233233 re = new RegExp( '>', "g" );
234234 text = text.replace( re, "&gt;" );
235235 return text;
236 -}
 236+};
237237
238238 /**
239239 * Set the accesskey prefix based on browser detection.
@@ -291,7 +291,7 @@
292292 element.setAttribute( 'title', tip );
293293 }
294294 }
295 -}
 295+};
296296
297297 /**
298298 * Add a link to one of the portlet menus on the page, including:
@@ -384,7 +384,7 @@
385385 }
386386
387387 return item;
388 -}
 388+};
389389
390390 window.getInnerText = function( el ) {
391391 if ( el.getAttribute( 'data-sort-value' ) !== null ) {
@@ -418,12 +418,12 @@
419419 }
420420 }
421421 return str;
422 -}
 422+};
423423
424424 /* Dummy for deprecated function */
425425 window.ta = [];
426426 window.akeytt = function( doId ) {
427 -}
 427+};
428428
429429 window.checkboxes = undefined;
430430 window.lastCheckbox = undefined;
@@ -433,7 +433,7 @@
434434 lastCheckbox = null;
435435 var inputs = document.getElementsByTagName( 'input' );
436436 addCheckboxClickHandlers( inputs );
437 -}
 437+};
438438
439439 window.addCheckboxClickHandlers = function( inputs, start ) {
440440 if ( !start ) {
@@ -461,7 +461,7 @@
462462 addCheckboxClickHandlers( inputs, finish );
463463 }, 200 );
464464 }
465 -}
 465+};
466466
467467 window.checkboxClickHandler = function( e ) {
468468 if ( typeof e == 'undefined' ) {
@@ -488,7 +488,7 @@
489489 }
490490 lastCheckbox = this.index;
491491 return true;
492 -}
 492+};
493493
494494
495495 /*
@@ -539,7 +539,7 @@
540540 }
541541 }
542542 return ( arrReturnElements );
543 -}
 543+};
544544
545545 window.redirectToFragment = function( fragment ) {
546546 var match = navigator.userAgent.match(/AppleWebKit\/(\d+)/);
@@ -568,7 +568,7 @@
569569 });
570570 }
571571 }
572 -}
 572+};
573573
574574 /*
575575 * Table sorting script based on one (c) 1997-2006 Stuart Langridge and Joost
@@ -601,7 +601,7 @@
602602 }
603603 ts_makeSortable( tables[ti] );
604604 }
605 -}
 605+};
606606
607607 window.ts_makeSortable = function( table ) {
608608 var firstRow;
@@ -632,11 +632,11 @@
633633 if ( ts_alternate_row_colors ) {
634634 ts_alternate( table );
635635 }
636 -}
 636+};
637637
638638 window.ts_getInnerText = function( el ) {
639639 return getInnerText( el );
640 -}
 640+};
641641
642642 window.ts_resortTable = function( lnk ) {
643643 // get the span
Index: trunk/phase3/skins/common/htmlform.js
@@ -36,5 +36,5 @@
3737 textbox.disabled = true;
3838 }
3939 }
40 -}
 40+};
4141
Index: trunk/phase3/skins/common/history.js
@@ -7,7 +7,7 @@
88 }
99 }
1010 return radios;
11 -}
 11+};
1212
1313 // check selection and tweak visibility/class onclick
1414 window.diffcheck = function() {
@@ -74,4 +74,4 @@
7575 }
7676 }
7777 return true;
78 -}
 78+};

Follow-up revisions

RevisionCommit summaryAuthorDate
r77923(bug 26265) Many semicolons are missing from JavaScript files...reedy22:30, 6 December 2010
r77924(bug 26265) Many semicolons are missing from JavaScript files...reedy22:30, 6 December 2010
r77926(bug 26265) Many semicolons are missing from JavaScript files...reedy22:34, 6 December 2010
r77928Some more unterminated statements (bug 26265)reedy22:51, 6 December 2010
r77932Wikibasha: bug 26265 - Missing ; from JSreedy23:32, 6 December 2010
r78086Revert unintended whitespace changes from r77922reedy19:16, 8 December 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r77872bug 26265, a few explicit ; at end of blocksreedy12:18, 6 December 2010

Comments

#Comment by Catrope (talk | contribs)   18:51, 8 December 2010
-window.os_createContainer = function( r ) {
-	var c = document.createElement( 'div' );
-	var s = document.getElementById( r.searchbox );
-	var pos = os_getElementPosition( r.searchbox );
+window.os_createContainer = function(r) {
+	var c = document.createElement('div');
+	var s = document.getElementById(r.searchbox);
+	var pos = os_getElementPosition(r.searchbox);
 	var left = pos.left;
 	var top = pos.top + s.offsetHeight;
 	c.className = 'os-suggest';
-	c.setAttribute( 'id', r.container );
-	document.body.appendChild( c );
+	c.setAttribute('id', r.container);
+	document.body.appendChild(c);
 
 	// dynamically generated style params
 	// IE workaround, cannot explicitely set "style" attribute
-	c = document.getElementById( r.container );
+	c = document.getElementById(r.container);
 	c.style.top = top + 'px';
 	c.style.left = left + 'px';
 	c.style.width = s.offsetWidth + 'px';
 
 	// mouse event handlers
-	c.onmouseover = function( event ) { os_eventMouseover( r.searchbox, event ); };
-	c.onmousemove = function( event ) { os_eventMousemove( r.searchbox, event ); };
-	c.onmousedown = function( event ) { return os_eventMousedown( r.searchbox, event ); };
-	c.onmouseup = function( event ) { os_eventMouseup( r.searchbox, event ); };
+	c.onmouseover = function(event) {
+		os_eventMouseover(r.searchbox, event);
+	};
+	c.onmousemove = function(event) {
+		os_eventMousemove(r.searchbox, event);
+	};
+	c.onmousedown = function(event) {
+		return os_eventMousedown(r.searchbox, event);
+	};
+	c.onmouseup = function(event) {
+		os_eventMouseup(r.searchbox, event);
+	};
 	return c;
-}
+};

This changes an entire function that previously complied with our whitespace guidelines and changes it not to. Please revert that.

Status & tagging log