மீடியாவிக்கி:Common.js

கட்டற்ற பன்மொழி அகரமுதலியான விக்சனரியில் இருந்து.

குறிப்பு - சேமித்த பின்னர், நீங்கள் செய்த மாற்றங்களைக் காண்பதற்கு உங்கள் உலவியின் இடைமாற்று அகற்றப்பட வேண்டும்.

  • மொஸில்லா பயர்பாக்ஸ் / சபாரி: Shift+Reload, அல்லது Ctrl-F5 அல்லது Ctrl-R (⌘-R Mac ல்)
  • கூகிள் குரோம் Ctrl-Shift-R அழுத்தவும். (⌘-Shift-R Mac ல்) ;
  • இண்டர்நெட் எக்ஸ்ப்ளோரர்: Ctrl-Refresh அல்லது Ctrl-F5 ஐ அழுத்தவும்.
  • ஒபேரா: Tools → Preferences இல் இடைமாற்றை அகற்றவும்;
 /** 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.
  *  Maintainers: [[User:R. Koot]]
  */
 
 function LinkFA() 
 {
     if ( document.getElementById( "p-lang" ) ) {
         var InterwikiLinks = document.getElementById( "p-lang" ).getElementsByTagName( "li" );
 
         for ( var i = 0; i < InterwikiLinks.length; i++ ) {
             if ( document.getElementById( InterwikiLinks[i].className + "-fa" ) ) {
                 InterwikiLinks[i].className += " FA"
                 InterwikiLinks[i].title = "இக்கட்டுரை வேறு மொழியில் சிறப்புக் கட்டுரையாக உள்ளது.";
             }
         }
     }
 }
 
 $( LinkFA );

/** Collapsible tables *********************************************************
 *
 *  Description: Allows tables to be collapsed, showing only the header. See
 *               [[Wikipedia:NavFrame]].
 *  Maintainers: [[User:R. Koot]]
 */
 
var autoCollapse = 2;
var collapseCaption = "மறை";
var expandCaption = "காட்டு";
 
function collapseTable( tableIndex )
{
    var Button = document.getElementById( "collapseButton" + tableIndex );
    var Table = document.getElementById( "collapsibleTable" + tableIndex );
 
    if ( !Table || !Button ) {
        return false;
    }
 
    var Rows = Table.rows;
 
    if ( Button.firstChild.data == collapseCaption ) {
        for ( var i = 1; i < Rows.length; i++ ) {
            Rows[i].style.display = "none";
        }
        Button.firstChild.data = expandCaption;
    } else {
        for ( var i = 1; i < Rows.length; i++ ) {
            Rows[i].style.display = Rows[0].style.display;
        }
        Button.firstChild.data = collapseCaption;
    }
}
 
function createCollapseButtons()
{
    var tableIndex = 0;
    var NavigationBoxes = new Object();
    var Tables = document.getElementsByTagName( "table" );
 
    for ( var i = 0; i < Tables.length; i++ ) {
        if ( $(Tables[i]).hasClass("collapsible" ) ) {
 
            /* only add button and increment count if there is a header row to work with */
            var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0];
            if (!HeaderRow) continue;
            var Header = HeaderRow.getElementsByTagName( "th" )[0];
            if (!Header) continue;
 
            NavigationBoxes[ tableIndex ] = Tables[i];
            Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );
 
            var Button     = document.createElement( "span" );
            var ButtonLink = document.createElement( "a" );
            var ButtonText = document.createTextNode( collapseCaption );
 
            Button.className = "collapseButton";  //Styles are declared in Common.css
 
            ButtonLink.style.color = Header.style.color;
            ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
            ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );
            ButtonLink.appendChild( ButtonText );
 
            Button.appendChild( document.createTextNode( "[" ) );
            Button.appendChild( ButtonLink );
            Button.appendChild( document.createTextNode( "]" ) );
 
            Header.insertBefore( Button, Header.childNodes[0] );
            tableIndex++;
        }
    }
 
    for ( var i = 0;  i < tableIndex; i++ ) {
        if ( $(NavigationBoxes[i]).hasClass("collapsed" ) || ( tableIndex >= autoCollapse && $(NavigationBoxes[i]).hasClass( "autocollapse" ) ) ) {
            collapseTable( i );
        } 
        else if ( $(NavigationBoxes[i]).hasClass("innercollapse" ) ) {
            var element = NavigationBoxes[i];
            while (element = element.parentNode) {
                if ( $(element).hasClass("outercollapse" ) ) {
                    collapseTable ( i );
                    break;
                }
            }
        }
    }
}
 
$( createCollapseButtons );
 
 
/** Dynamic Navigation Bars (experimental) *************************************
 *
 *  Description: See [[Wikipedia:NavFrame]].
 *  Maintainers: UNMAINTAINED
 */
 
// set up the words in your language
var NavigationBarHide = '[' + collapseCaption + ']';
var NavigationBarShow = '[' + expandCaption + ']';
 
// shows and hides content and picture (if available) of navigation bars
// Parameters:
//     indexNavigationBar: the index of navigation bar to be toggled
function toggleNavigationBar(indexNavigationBar)
{
    var NavToggle = document.getElementById("NavToggle" + indexNavigationBar);
    var NavFrame = document.getElementById("NavFrame" + indexNavigationBar);
 
    if (!NavFrame || !NavToggle) {
        return false;
    }
 
    // if shown now
    if (NavToggle.firstChild.data == NavigationBarHide) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if ($(NavChild).hasClass('NavContent') || $(NavChild).hasClass('NavPic')) {
                NavChild.style.display = 'none';
            }
        }
    NavToggle.firstChild.data = NavigationBarShow;
 
    // if hidden now
    } else if (NavToggle.firstChild.data == NavigationBarShow) {
        for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
            if ($(NavChild).hasClass('NavContent') || $(NavChild).hasClass('NavPic')) {
                NavChild.style.display = 'block';
            }
        }
        NavToggle.firstChild.data = NavigationBarHide;
    }
}
 
// adds show/hide-button to navigation bars
function createNavigationBarToggleButton()
{
    var indexNavigationBar = 0;
    // iterate over all < div >-elements 
    var divs = document.getElementsByTagName("div");
    for (var i = 0; NavFrame = divs[i]; i++) {
        // if found a navigation bar
        if ($(NavFrame).hasClass("NavFrame")) {
 
            indexNavigationBar++;
            var NavToggle = document.createElement("a");
            NavToggle.className = 'NavToggle';
            NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
            NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');
 
            var isCollapsed = $(NavFrame).hasClass("collapsed" );
            /*
             * Check if any children are already hidden.  This loop is here for backwards compatibility:
             * the old way of making NavFrames start out collapsed was to manually add style="display:none"
             * to all the NavPic/NavContent elements.  Since this was bad for accessibility (no way to make
             * the content visible without JavaScript support), the new recommended way is to add the class
             * "collapsed" to the NavFrame itself, just like with collapsible tables.
             */
            for (var NavChild = NavFrame.firstChild; NavChild != null && !isCollapsed; NavChild = NavChild.nextSibling) {
                if ( $(NavChild).hasClass('NavPic' ) || $(NavChild).hasClass('NavContent' ) ) {
                    if ( NavChild.style.display == 'none' ) {
                        isCollapsed = true;
                    }
                }
            }
            if (isCollapsed) {
                for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
                    if ( $(NavChild).hasClass('NavPic' ) || $(NavChild).hasClass('NavContent' ) ) {
                        NavChild.style.display = 'none';
                    }
                }
            }
            var NavToggleText = document.createTextNode(isCollapsed ? NavigationBarShow : NavigationBarHide);
            NavToggle.appendChild(NavToggleText);
 
            // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
            for(var j=0; j < NavFrame.childNodes.length; j++) {
                if ($(NavFrame.childNodes[j]).hasClass("NavHead")) {
                    NavFrame.childNodes[j].appendChild(NavToggle);
                }
            }
            NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
        }
    }
}
 
$( createNavigationBarToggleButton );

 
function mainPageAppendCompleteListLink() {
	mw.util.addPortletLink('p-lang', '//meta.wikimedia.org/wiki/List_of_Wikipedias', 
	'Complete list', 'interwiki-completelist', 'Complete list of Wikipedias')
}
 
if ( mw.config.get('wgTitle') == 'முதற் பக்கம்' && mw.config.get('wgNamespaceNumber') == 0 ) {
	$( mainPageAppendCompleteListLink );
}

 /** "Technical restrictions" title fix *****************************************
 *
 * Description:
 * Maintainers: User:Interiot, User:Mets501, User:Freakofnurture
 */
 //
 // For pages that have something like Template:Lowercase, replace the title, but only if it is cut-and-pasteable as a valid wikilink.
 // (for instance iPod's title is updated. But [[C#]] is not an equivalent
 // wikilink, so [[C Sharp]] doesn't have its main title changed)
 // Likewise for users who have selected the U.K. date format ("1 March") the  
 // titles of day-of-the-year articles will appear in that style. Users with any
 // other date setting are not affected.
 //
 // The function looks for a banner like this: 
 // &lt;div id="RealTitleBanner"&gt;  ... &lt;span id="RealTitle"&gt;title&lt;/span&gt; ... &lt;/div&gt;
 // An element with id=DisableRealTitle disables the function.
 //
 var disableRealTitle = 0; // users can set disableRealTitle = 1 locally to disable.
 if (mw.config.get('wgIsArticle')) { // don't display the RealTitle when editing, since it is apparently inconsistent (doesn't show when editing sections, doesn't show when not previewing)
  $(document).ready(function() {
    try {
        var realTitleBanner = document.getElementById("RealTitleBanner");
        if (realTitleBanner && !document.getElementById("DisableRealTitle") && !disableRealTitle ) {
            var realTitle = document.getElementById("RealTitle");
            if (realTitle) {
                var realTitleHTML = realTitle.innerHTML;
                realTitleText = $(realTitle).text();

                var isPasteable = 0;
                //var containsHTML = /</.test(realTitleHTML);    // contains ANY HTML
                var containsTooMuchHTML = /</.test( realTitleHTML.replace(/<\/?(sub|sup|small|big)>/gi, "") ); // contains HTML that will be ignored when cut-n-pasted as a wikilink
                // calculate whether the title is pasteable
                var verifyTitle = realTitleText.replace(/^ +/, "");       // trim left spaces
                verifyTitle = verifyTitle.charAt(0).toUpperCase() + verifyTitle.substring(1, verifyTitle.length);    // uppercase first character
 
                // if the namespace prefix is there, remove it on our verification copy. If it isn't there, add it to the original realValue copy.
                if (mw.config.get('wgNamespaceNumber') != 0) {
                    if (mw.config.get('wgCanonicalNamespace') == verifyTitle.substr(0, mw.config.get('wgCanonicalNamespace').length).replace(/ /g, "_") && verifyTitle.charAt(mw.config.get('wgCanonicalNamespace').length) == ":") {
                        verifyTitle = verifyTitle.substr(mw.config.get('wgCanonicalNamespace').length + 1);
                    } else {
                        realTitleText = mw.config.get('wgCanonicalNamespace').replace(/_/g, " ") + ":" + realTitleText;
                        realTitleHTML = mw.config.get('wgCanonicalNamespace').replace(/_/g, " ") + ":" + realTitleHTML;
                    }
                }
 
                // verify whether wgTitle matches
                verifyTitle = verifyTitle.replace(/[\s_]+/g, " ");      // underscores and multiple spaces to single spaces
                verifyTitle = verifyTitle.replace(/^\s+/, "").replace(/\s+$/, "");        // trim left and right spaces
                verifyTitle = verifyTitle.charAt(0).toUpperCase() + verifyTitle.substring(1, verifyTitle.length);    // uppercase first character
                if ( (verifyTitle == mw.config.get('wgTitle')) || (verifyTitle == mw.config.get('wgTitle').replace(/^(.+)?(January|February|March|April|May|June|July|August|September|October|November|December)\s+([12]?[0-9]|3[0123])([^\d].*)?$/g, "$1$3 $2$4") )) isPasteable = 1;
                var h1 = document.getElementsByTagName("h1")[0];
                if (h1 && isPasteable) {
                    h1.innerHTML = containsTooMuchHTML ? realTitleText : realTitleHTML;
                    if (!containsTooMuchHTML)
                        realTitleBanner.style.display = "none";
                }
                document.title = realTitleText + " - Wikipedia, the free encyclopedia";
            }
        }
    } catch (e) {
        /* Something went wrong. */
    }
  });
 }
 
 //fix edit summary prompt for undo
 //this code fixes the fact that the undo function combined with the "no edit summary prompter" causes problems if leaving the
 //edit summary unchanged
 //this was added by [[User:Deskana]], code by [[User:Tra]]
 $(document).ready(function () {
   if (document.location.search.indexOf("undo=") != -1
   && document.getElementsByName('wpAutoSummary')[0]) {
     document.getElementsByName('wpAutoSummary')[0].value='1';
   }
 })

 /** Add dismiss button to watchlist-message *************************************
  *
  *  Description: Hide the watchlist message for one week.
  *  Maintainers: [[User:Ruud Koot|Ruud Koot]]
  */
 
 function addDismissButton() {
    var watchlistMessage = document.getElementById("watchlist-message");
    if ( watchlistMessage == null ) return;
    var watchlistCookieID = watchlistMessage.className.replace(/cookie\-ID\_/ig,'');
 
    if ( document.cookie.indexOf( "hidewatchlistmessage-" + watchlistCookieID + "=yes" ) != -1 ) {
        watchlistMessage.style.display = "none";
    }
 
    var Button     = document.createElement( "span" );
    var ButtonLink = document.createElement( "a" );
    var ButtonText = document.createTextNode( "dismiss" );
 
    ButtonLink.setAttribute( "id", "dismissButton" );
    ButtonLink.setAttribute( "href", "javascript:dismissWatchlistMessage();" );
    ButtonLink.setAttribute( "title", "Hide this message for one week" );
    ButtonLink.appendChild( ButtonText );
 
    Button.appendChild( document.createTextNode( "[" ) );
    Button.appendChild( ButtonLink );
    Button.appendChild( document.createTextNode( "]" ) );
 
    watchlistMessage.appendChild( Button );
 }
 
 function dismissWatchlistMessage() {
    var e = new Date();
    e.setTime( e.getTime() + (7*24*60*60*1000) );
    var watchlistMessage = document.getElementById("watchlist-message");
    var watchlistCookieID = watchlistMessage.className.replace(/cookie\-ID\_/ig,'');
    document.cookie = "hidewatchlistmessage-" + watchlistCookieID + "=yes; expires=" + e.toGMTString() + "; path=/";
    watchlistMessage.style.display = "none";
 }
 
 $(document).ready( addDismissButton );

 // Choice of multiple search engines
// Autor: Jakob Voss, Guillaume (tret de de:MediaWiki:SpezialSuche.js)
// Version: 0.3.8
// Published as Public Domain

// Map of search engines and some OpenSearch-based fields
var searchEngines = {
  mediawiki: {
    ShortName: "MediaWiki search",
    Template: "/w/index.php?search={searchTerms}"
  },
  globalwpsearch: {
    ShortName: "Global WP",
    Template: "http://vs.aka-online.de/cgi-bin/globalwpsearch.pl?timeout=120&search={searchTerms}"
  },
  google: {
    ShortName: "Google",
    Template: "http://www.google.cat/search?as_sitesearch=ta.wikipedia.org&hl={language}&q={searchTerms}"
  },
  wikiwix: {
    ShortName: "Wikiwix",
    Template: "http://www.wikiwix.com/index.php?action={searchTerms}&lang=ta"
  },
  yahoo: {
    ShortName: "Yahoo!",
    Template: "http://search.yahoo.com/search?p={searchTerms}&vs=ta.wikipedia.org"
  },
  wlive: {
    ShortName: "Windows Live",
    Template: "http://search.live.com/results.aspx?q={searchTerms}&q1=site:http://ta.wikipedia.org"
  }
};
 
function externalSearchEngines() {
  if (typeof SpecialSearchEnhanced2Disabled != 'undefined') return;


  var mainNode = document.getElementById("powersearch");
  if (!mainNode) mainNode = document.getElementById("search");
  if (!mainNode) return;

  var beforeNode = document.getElementById("mw-search-top-table");
  if (!beforeNode) return;
  beforeNode = beforeNode.nextSibling;
  if (!beforeNode) return;
 
  var firstEngine = "mediawiki";
 
  var choices = document.createElement("div");
  choices.setAttribute("id","searchengineChoices");
  choices.style.textAlign = "center";
 
  var lsearchbox = document.getElementById("searchText");
  var initValue = lsearchbox.value;
 
  var space = "";

  for (var id in searchEngines) {
    var engine = searchEngines[id];
if(engine.ShortName)
   {
    if (space) choices.appendChild(space);
    space = document.createTextNode(" ");
 
    var attr = { 
      type: "radio", 
      name: "searchengineselect",
      value: id,
      onFocus: "changeSearchEngine(this.value)",
      id: "searchengineRadio-"+id
    };
 
    var html = "<input";
    for (var a in attr) html += " " + a + "='" + attr[a] + "'";
    html += " />";
    var span = document.createElement("span");
    span.innerHTML = html;
 
    choices.appendChild( span );
    var label;
    if (engine.Template.indexOf('http') == 0) {
      label = document.createElement("a");
      label.href = engine.Template.replace("{searchTerms}", initValue).replace("{language}", "fr");
    } else {
      label = document.createElement("label");
    }
  
    label.appendChild( document.createTextNode( engine.ShortName ) );
    choices.appendChild( label );
  }
 }
  mainNode.insertBefore(choices, beforeNode);
 
  var input = document.createElement("input");
  input.id = "searchengineextraparam";
  input.type = "hidden";
 
  mainNode.insertBefore(input, beforeNode);

  changeSearchEngine(firstEngine, initValue);
}

function changeSearchEngine(selectedId, searchTerms) {

  var currentId = document.getElementById("searchengineChoices").currentChoice;
  if (selectedId == currentId) return;
 
  document.getElementById("searchengineChoices").currentChoice = selectedId;
  var radio = document.getElementById('searchengineRadio-'  + selectedId);
  radio.checked = "checked";
 
  var engine = searchEngines[selectedId];
  var p = engine.Template.indexOf('?');
  var params = engine.Template.substr(p+1);
 
  var form;
  if (document.forms["search"]) {
    form = document.forms["search"];
  } else {
    form = document.getElementById("powersearch");
  }
  form.setAttribute("action", engine.Template.substr(0,p));
 
  var l = ("" + params).split("&");
  for (var idx = 0;idx < l.length;idx++) {
    var p = l[idx].split("=");
    var pValue = p[1];
 
    if (pValue == "{language}") {
    } else if (pValue == "{searchTerms}") {
      var input;
      input = document.getElementById("searchText");
 
      input.name = p[0];
    } else {
      var input = document.getElementById("searchengineextraparam");
 
      input.name = p[0];
      input.value = pValue;
    }
  }
}


if (mw.config.get('wgCanonicalSpecialPageName') == "Search") {
   $(externalSearchEngines);
}

 /** 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. 
   *  Created by: [[User:Dschwen]]
   */

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

/**
  * Remove need for CSS hacks regarding MSIE and IPA.
  */

if(navigator.userAgent.indexOf("MSIE") != -1 && document.createStyleSheet) {
	mw.loader.using('mediawiki.util', function() {
		mw.util.addCSS('.IPA { font-family: "Doulos SIL", "Charis SIL", Gentium, "DejaVu Sans", Code2000, "TITUS Cyberbit Basic", "Arial Unicode MS", "Lucida Sans Unicode", "Chrysanthi Unicode"; }');
	});
}

/* ==Visibility toggling== */
var VisibilityToggles = window.VisibilityToggles = {
	// toggles[category] = [[show, hide],...]; statuses[category] = [true, false,...]; buttons = <li>
	toggles: {},
	statuses: {},
	buttons: null,
	
	// Add a new toggle, adds a Show/Hide category button in the toolbar,
	// and will call show_function and hide_function once on register, and every alternate click.
	register: function (category, show_function, hide_function) {
		var id = 0;
		if (!this.toggles[category]) {
			this.toggles[category] = [];
			this.statuses[category] = [];
		} else {
			id = this.toggles[category].length;
		}
		this.toggles[category].push([show_function, hide_function]);
		this.statuses[category].push(this.currentStatus(category));
		this.addGlobalToggle(category);
		
		(this.statuses[category][id] ? show_function : hide_function)();
		
		return function () {
			var statuses = VisibilityToggles.statuses[category];
			statuses[id] = !statuses[id];
			VisibilityToggles.checkGlobalToggle(category);
			return (statuses[id] ? show_function : hide_function)();
		};
	},
	
	// Add a new global toggle to the side bar
	addGlobalToggle: function (category) {
		if (document.getElementById('p-visibility-' + category))
			return;
		if (this.buttons === null) {
			this.buttons = $('<ul>');
			var collapsed = mw.cookie.get("vector-nav-p-visibility") === "false",
				toolbox = $('<div>', {
						'class': "portal portlet " + (collapsed ? "collapsed" : "expanded"),
						'id': 'p-visibility'
					})
					.append($('<h3>கட்புலன்</h3>'))
					.append($('<div>').addClass("pBody body").css("display", "block")
							.append(this.buttons));
			var sidebar = document.getElementById('mw-panel') || document.getElementById('column-one');
			var insert = document.getElementById('p-lang') || document.getElementById('p-feedback');
			if (insert)
				$(insert).before(toolbox);
			else
				$(sidebar).append(toolbox);
		}
		var status = this.currentStatus(category);
		var newToggle = $('<li>').append($('<a>', {
				id: 'p-visibility-' + category,
				style: 'cursor: pointer',
		href: '#visibility-' + category}).on("click", function (e) {
					VisibilityToggles.toggleGlobal(category);
					if (e && e.preventDefault)
						e.preventDefault();
					else
						window.event.returnValue = false;
					return false;
				}).text((status ? 'மறை ' : 'காட்டு ') + category));
		
		this.buttons.children().filter(function(i, elem) {
			return elem.id < newToggle.id;
		}).first().before(newToggle);

		this.buttons.append(newToggle);
	},
	
	// Update the toggle-all buttons when all things are toggled one way
	checkGlobalToggle: function (category) {
		var statuses = this.statuses[category];
		var status = statuses[0];
		for (var i = 1; i < statuses.length; i++) {
			if (status != statuses[i])
				return;
		}
		document.getElementById('p-visibility-' + category).innerHTML = (status ? 'மறை ' : 'காட்டு ') + category;
	},
	
	// Toggle all un-toggled elements when the global button is clicked
	toggleGlobal: function (category) {
		var status = document.getElementById('p-visibility-' + category).innerHTML.indexOf('காட்டு ') === 0;
		for (var i = 0; i < this.toggles[category].length; i++) {
			if (this.statuses[category][i] != status) {
				this.toggles[category][i][status ? 0 : 1]();
				this.statuses[category][i] = status;
			}
		}
		document.getElementById('p-visibility-' + category).innerHTML = (status ? 'மறை ' : 'காட்டு ') + category;
		var current = mw.cookie.get('Visibility');
		if (!current)
			current = ";";
		current = current.replace(';' + category + ';', ';');
		if (status)
			current = current + category + ";";
		mw.cookie.set('Visibility', current);
	},
	
	currentStatus: function (category) {
		if (location.hash.toLowerCase().split('_')[0] == '#' + category.toLowerCase())
			return true;
		if (location.href.search(/[?](.*&)?hidecats=/) > 0) {
			var hidecats = location.href;
			hidecats = hidecats.replace(/^[^?]+[?]((?!hidecats=)[^&]*&)*hidecats=/, '');
			hidecats = hidecats.replace(/&.*/, '');
			hidecats = hidecats.split(',');
			for (var i = 0; i < hidecats.length; ++i)
				if (hidecats[i] == category || hidecats[i] == 'all')
					return false;
				else if (hidecats[i] == '!' + category || hidecats[i] == 'none')
					return true;
		}
		if (mw.cookie.get('WiktionaryPreferencesShowNav') == 'true')
			return true;
		if ((mw.cookie.get('Visibility') || "").indexOf(';' + category + ';') >= 0)
			return true;
		// TODO check category-specific cookies
		return false;
	}
};


/* ==Hidden Quotes== */
function setupHiddenQuotes(li) {
	var HQToggle, liComp, dl;
	var HQShow = 'மேற்கோள்கள் ▼';
	var HQHide = 'மேற்கோள்கள் ▲';
	function show() {
		HQToggle.html(HQHide);
		$(li).children("ul").show();
	}
	function hide() {
		HQToggle.html(HQShow);
		$(li).children("ul").hide();
	}
	
	for (var k = 0; k < li.childNodes.length; k++) {
		// Look at each component of the definition.
		liComp = li.childNodes[k];
		if (liComp.nodeName.toLowerCase() === "dl" && !dl) {
			dl = liComp;
		}
		// If we find a ul or dl, we have quotes or example sentences, and thus need a button.
		if (/^(ul|UL)$/.test(liComp.nodeName)) {
			HQToggle = $('<a>');
			$(dl || liComp).before($('<span>').addClass('HQToggle').append(HQToggle));
			HQToggle.on("click", VisibilityToggles.register('மேற்கோள்கள்', show, hide));
			break;
		}
	}
}


/* == Apply three functions defined above == */
$.when($.ready, mw.loader.using('mediawiki.cookie')).done(function(){

	//quotes
	if (mw.config.get('wgNamespaceNumber') === 0) {
		// First, find all the ordered lists, i.e. all the series of definitions.
		$('ol > li').each(function(){
			setupHiddenQuotes(this);
		});
	}

});

jQuery(mw).on('LivePreviewDone', function (ev, sels) {
	var ols = jQuery(sels.join(',')).find('ol');
	for (var i = 0; i < ols.length; i++) {
		for (var j = 0; j < ols[i].childNodes.length; j++) {
			var li = ols[i].childNodes[j];
			if (li.nodeName.toUpperCase() == 'LI') {
				setupHiddenQuotes(li);
			}
		}
	}
});

// Add colon button in editbar [[File:Indic-TechCom-AddColonButton]]
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Indic-TechCom/Script/AddColonButton.js&action=raw&ctype=text/javascript');
"https://ta.wiktionary.org/w/index.php?title=மீடியாவிக்கி:Common.js&oldid=1972702" இலிருந்து மீள்விக்கப்பட்டது