Difference between revisions 9101 and 9102 on newikibooks

/**
 * @authors: Bhawani Gauatm([[user:Bhawani Gautamiplab Anand ([[user:बिप्लब आनन्द]])
 * @date 2010-10-09
 * License: GPLv3, CC-BY-SA 3.0
 */
 
/*
=== Edittoolsystem ===
*/
(contracted; show full) 
      input.name = p[0];
      input.value = pValue;
    }
  }
}




if ( mw.config.get('wgCanonicalSpecialPageName') == "Search") {
	var searchEngines = {
	  mediawiki: {
		ShortName: "न्तरिक खोज",
		Template: mw.config.get('wgScript') + "?search={searchTerms}"
	  },
	  exalead: {
		ShortName: "इक्सालीड",
		Template: "http://www.exalead.com/wikipedia/results?q={searchTerms}&language=hi"
	  },
	  google: {
		ShortName: "गगल",
		Template: "http://www.google.co.in/search?as_sitesearch=hi.wikipedia.org&hl={language}&q={searchTerms}"
	  },
	  wikiwix: {
		ShortName: "विकीविक्स",
		Template: "http://hi.wikiwix.com/index.php?action={searchTerms}&lang={language}"
	  },
	  wlive: {
		ShortName: "बिङ",
		Template: "http://www.bing.com/search?q={searchTerms}&q1=site:http://hi.wikipedia.org"
	  },
	  yahoo: {
		ShortName: "यहुाहू!",
		Template: "http://search.yahoo.com/search?p={searchTerms}&vs=hi.wikipedia.org"
	  },
	globalwpsearch: {
		ShortName: "अन्तर विकि",
		Template: "http://vs.aka-online.de/cgi-bin/globalwpsearch.pl?timeout=120&search={searchTerms}"
	  }
	};
	jQuery( document ).ready( function( $ ) {
		externalSearchEngines();
	} );
}

/**
 * Interwiki links to featured articles ***************************************
 *
 * Description: Highlights interwiki links to featured articles (or
 *              equivalents) by changing the bullet before the interwiki link
 *              into a star.
 */
function LinkFA() {
    if ( document.getElementById( 'p-lang' ) ) {
        var InterwikiLinks = document.getElementById( 'p-lang' ).getElementsByTagName( 'li' );
 
        for ( var i = 0; i < InterwikiLinks.length; i++ ) {
            var className = InterwikiLinks[i].className.match(/interwiki-[-\w]+/);
            if ( document.getElementById( className + '-fa' ) && InterwikiLinks[i].className.indexOf( 'badge-featuredarticle' ) === -1 ) {
                InterwikiLinks[i].className += ' FA';
                InterwikiLinks[i].title = 'यो यस भाषामा एउटा निर्वाचित निर्वाचित लेख हो  ।';
            } else if ( document.getElementById( className + '-ga' ) && InterwikiLinks[i].className.indexOf( 'badge-goodarticle' ) === -1 ) {
                InterwikiLinks[i].className += ' GA';
                InterwikiLinks[i].title = 'यो यस भाषामा एउटा श्रेउत्कृष् लेख हो  ।';
            }
        }
    }
}
 
mw.hook( 'wikipage.content' ).add( LinkFA );

/** WikiMiniAtlas *******************************************************
  *
  *  Description: WikiMiniAtlas is a popup click and drag world map.
  *               This script causes all of our coordinate links to display the WikiMiniAtlas popup button.
  *               The script itself is located on meta because it is used by many projects.
  *               See [[Meta:WikiMiniAtlas]] for more information. 
  *  Maintainers: [[User:Dschwen]]
  */

mw.loader.load('//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400');



 function mainPageAppendCompleteListLink() {
     try {
         var node = document.getElementById( "p-lang" )
                            .getElementsByTagName('div')[0]
                            .getElementsByTagName('ul')[0];
 
         var aNode = document.createElement( 'a' );
         var liNode = document.createElement( 'li' );
 
         aNode.appendChild( document.createTextNode( 'Complete list' ) );
         aNode.setAttribute( 'href' , '//meta.wikimedia.org/wiki/List_of_Wikipedias' );
         liNode.appendChild( aNode );
         liNode.className = 'interwiki-completelist';
         node.appendChild( liNode );
      } catch(e) {
        // lets just ignore what's happened
        return;
     }
 }
 
if ( mw.config.get('wgTitle') == 'मुख्यपृष्ठ' && mw.config.get('wgNamespaceNumber') == 0IsMainPage') ) {
	jQuery( document ).ready( function( $ ) {
		mainPageAppendCompleteListLink();
	} );
}

/**
 * MainPage-tab
 * On the main page (and its associated namespaces and actions (Talk, edit, history etc.)
 * this script will put  "Main Page" instead of "Article" or "Page" in the first tab.
 *
 * @source: //www.mediawiki.org/wiki/Snippets/Main_Page_tab
 * @rev: 2
 */
$( document ).ready( function() {
        var title =if ( mw.config.get(  'wgTitle' );
        var hasMainPageTab = (title == 'मुख्यपृष्ठ'); // Title of the main page. If applicable, without the namespace prefix (eg. "Wikipedia:")
        if ( hasMainPageTabIsMainPage') ){
                $( '#ca-nstab-main a' ).text( tmw.config.get( 'wgTitle' ) );
        }
} );

/**
 * Collapsible tables *********************************************************
 *
 * Description: Allows tables to be collapsed, showing only the header. See
(contracted; show full)                }
            }
            NavFrame.setAttribute( 'id', 'NavFrame' + indexNavigationBar );
        }
    }
}

mw.hook( 'wikipage.content' ).add( createNavigationBarToggleButton );