r96417 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96416‎ | r96417 | r96418 >
Date:12:03, 7 September 2011
Author:junaidpv
Status:ok
Tags:
Comment:
Some white space business and comment edits.
Modified paths:
  • /trunk/extensions/Narayam/js/ext.narayam.core.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Narayam/js/ext.narayam.core.js
@@ -427,10 +427,10 @@
428428 this.setup = function() {
429429 // Build the menu
430430 if ( !that.buildMenu() ){
431 - // /buildMenu() returned false
432 - // No need to proceed
433 - return;
434 - }
 431+ // /buildMenu() returned false
 432+ // No need to proceed
 433+ return;
 434+ }
435435
436436 // Restore state from cookies
437437 var savedScheme = $.cookie( 'narayam-scheme' );
@@ -439,18 +439,21 @@
440440 $( '#narayam-' + savedScheme ).attr( 'checked', 'checked' );
441441 } else {
442442 //if no saved input scheme, select the first.
443 - $('input.narayam-scheme:first').attr( 'checked', 'checked' );
 443+ $( 'input.narayam-scheme:first' ).attr( 'checked', 'checked' );
444444 }
445445 var enabledCookie = $.cookie( 'narayam-enabled' );
446446 if ( enabledCookie == '1' || ( mw.config.get( 'wgNarayamEnabledByDefault' ) && enabledCookie !== '0' ) ) {
447447 that.enable();
448448 }
449449 else {
450 - $( 'li#pt-narayam').addClass( 'narayam-inactive' );
 450+ $( 'li#pt-narayam' ).addClass( 'narayam-inactive' );
451451 }
452452 // Renew the narayam-enabled cookie. naraym-scheme is renewed by setScheme()
453453 if ( enabledCookie ) {
454 - $.cookie( 'narayam-enabled', enabledCookie, { 'path': '/', 'expires': 30 } );
 454+ $.cookie( 'narayam-enabled', enabledCookie, {
 455+ 'path': '/',
 456+ 'expires': 30
 457+ } );
455458 }
456459
457460 };
@@ -483,7 +486,7 @@
484487
485488 if ( !haveSchemes ) {
486489 // No schemes available, don't show the tool
487 - // So return false
 490+ // So return false
488491 return false;
489492 }
490493
@@ -512,7 +515,10 @@
513516 .append(
514517 $( '<a/>' )
515518 .text( mw.msg( 'narayam-help' ) )
516 - .attr( 'href', mw.util.wikiGetlink( mw.msg( 'narayam-help-page' ) ))
 519+ .attr(
 520+ 'href',
 521+ mw.util.wikiGetlink( mw.msg( 'narayam-help-page' ) )
 522+ )
517523 )
518524 );
519525 }
@@ -532,30 +538,30 @@
533539 )
534540 .append( $menuItemsDiv );
535541
536 - var $li = $( '<li id="pt-narayam" />');
537 - $li
538 - .append( $menu );
 542+ var $li = $( '<li id="pt-narayam" />' );
 543+ $li.append( $menu );
539544
540 - //if rtl, add to the right of top personal links. Else, to the left
541 - var fn = $('body').hasClass( 'rtl' ) ? "append" : "prepend";
542 - $('#p-personal ul:first')[fn]( $li );
 545+ // If rtl, add to the right of top personal links. Else, to the left
 546+ var fn = $( 'body' ).hasClass( 'rtl' ) ? "append" : "prepend";
 547+ $( '#p-personal ul:first' )[fn]( $li );
543548 // Build enable/disable checkbox and label
544549 $checkbox = $( '<input type="checkbox" id="narayam-toggle" />' );
545550 $checkbox
546551 .attr( 'title', mw.msg( 'narayam-checkbox-tooltip' ) )
547552 .click( that.toggle );
548 - //workaround for IE bug - activex components like input fields coming on top of everything.
549 - //TODO: is there a better solution other than hiding it on hover?
 553+ // Workaround for IE bug - activex components like input fields
 554+ // coming on top of everything.
 555+ // TODO: is there a better solution other than hiding it on hover?
550556 if ( $.browser.msie ) {
551 - $("#narayam-menu").hover(function(){
552 - $("#searchform").css({ visibility: "hidden" });
 557+ $( "#narayam-menu" ).hover(function(){
 558+ $( "#searchform" ).css({ visibility: "hidden" });
553559 },function(){
554 - $("#searchform").css({ visibility: "visible" });
 560+ $( "#searchform" ).css({ visibility: "visible" });
555561 });
556562 }
557 -
558 - // Narayam controls setup complete, returns true
559 - return true;
 563+
 564+ // Narayam controls setup complete, returns true
 565+ return true;
560566 }
561567
562568 } )();

Status & tagging log