"മീഡിയവിക്കി:Common.js" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

Schoolwiki സംരംഭത്തിൽ നിന്ന്
No edit summary
No edit summary
 
(2 ഉപയോക്താക്കൾ ചെയ്ത ഇടയ്ക്കുള്ള 15 നാൾപ്പതിപ്പുകൾ പ്രദർശിപ്പിക്കുന്നില്ല)
വരി 1: വരി 1:
/**
/*ടൂൾബാറിൽ അവലംബം ചേർക്കാനുള്ള സൗകര്യം കൂട്ടിച്ചേർക്കുന്നതിനായി */
* Modifie Special:Search pour pouvoir utiliser différents moteurs de recherche,
if ( mw.config.get( 'wgAction' ) === 'edit' || mw.config.get( 'wgAction' ) === 'submit' || mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Upload' ) {
* disponibles dans une boîte déroulante.
     /* scripts specific to editing pages */
* Auteurs : Jakob Voss, Guillaume, importé depuis la Wiki allemande
/*    importScript( 'മീഡിയവിക്കി:Common.js/edit.js' ); */
* <pre><nowiki>
     mw.loader.load( '/index.php?title=മീഡിയവിക്കി:Common.js/edit.js&action=raw&ctype=text/javascript' );
*/
 
 
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;
    }
  }
}
}
/**തിരഞ്ഞെടുത്ത ലേഖനങ്ങളിലേയ്ക്ക്‌ ഇന്റര്‍ വിക്കി ലിങ്കുകള്‍ നല്‍കാന്‍**************
*  തിരഞ്ഞെടുത്ത ലേഖനങ്ങളിലേയ്ക്ക്‌ ഇന്റര്‍ വിക്കി ലിങ്കുകള്‍ നല്‍കാനായി ഈ സ്ക്രിപ്റ്റ്‌ ഉപയോഗിയ്ക്കാം മറ്റു ഭാഷകളില്‍ എന്നു
*  കാണുന്ന സെക്ഷനിലെ ബുള്ളറ്റുകള്‍ ഈ ഫങ്ക്ഷന്‍ മാറ്റിയെഴുതും. ആംഗലേയ വിക്കിയില്‍ നിന്നും കൊണ്ടുവന്നത്‌
*/
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 = "മറ്റൊരു ഭാഷയില്‍ ഈ ലേഖനം തിരഞ്ഞെടുക്കപ്പെട്ടതാണ്‌.";
            }
        }
    }
}
addOnloadHook( LinkFA );
/** Main Page layout fixes *********************************************************
*
*  Description:        Various layout fixes for the main page, including an
*                      additional link to the complete list of languages available
*                      and the renaming of the 'Article' to to 'Main Page'.
*  Maintainers:        User:AzaToth, User:R. Koot
*/
function mainPageRenameNamespaceTab() {
    try {
        var Node = document.getElementById( 'ca-nstab-main' ).firstChild;
        if ( Node.textContent ) {      // Per DOM Level 3
            Node.textContent = 'പ്രധാന താള്‍';
        } else if ( Node.innerText ) { // IE doesn't handle .textContent
            Node.innerText = 'പ്രധാന താള്‍';
        } else {                      // Fallback
            Node.replaceChild( Node.firstChild, document.createTextNode( 'പ്രധാന താള്‍' ) );
        }
    } catch(e) {
        // bailing out!
    }
}
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' , 'http://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 ( wgTitle == 'പ്രധാന താള്‍' && ( wgNamespaceNumber == 0 || wgNamespaceNumber == 1 ) ) {
      addOnloadHook( mainPageRenameNamespaceTab );
}
if ( wgTitle == 'പ്രധാന താള്‍' && wgNamespaceNumber == 0 ) {
      addOnloadHook( mainPageAppendCompleteListLink );
}
/**<pre><nowiki>*/
/** Extra toolbar options ******************************************************
  *
  *  Description: UNDOCUMENTED
  *  Maintainers: [[User:MarkS]]?, [[User:Voice of All]], [[User:R. Koot]]
  */
//This is a modified copy of a script by User:MarkS for extra features added by User:Voice of All.
// This is based on the original code on Wikipedia:Tools/Editing tools
// To disable this script, add <code>mwCustomEditButtons = [];<code> to [[Special:Mypage/monobook.js]]
if (mwCustomEditButtons) {
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png",
    "speedTip": "Redirect",
    "tagOpen": "#REDIRECT [[",
    "tagClose": "]]",
    "sampleText": "Insert text"};
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png",
    "speedTip": "Strike",
    "tagOpen": "<s>",
    "tagClose": "</s>",
    "sampleText": "Strike-through text"};
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png",
    "speedTip": "Line break",
    "tagOpen": "<br />",
    "tagClose": "",
    "sampleText": ""};
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/en/8/80/Button_upper_letter.png",
    "speedTip": "Superscript",
    "tagOpen": "<sup>",
    "tagClose": "</sup>",
    "sampleText": "Superscript text"};
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/en/7/70/Button_lower_letter.png",
    "speedTip": "Subscript",
    "tagOpen": "<sub>",
    "tagClose": "</sub>",
    "sampleText": "Subscript text"};
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/en/5/58/Button_small.png",
    "speedTip": "Small",
    "tagOpen": "<small>",
    "tagClose": "</small>",
    "sampleText": "Small Text"};
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/en/3/34/Button_hide_comment.png",
    "speedTip": "Insert hidden Comment",
    "tagOpen": "<!-- ",
    "tagClose": " -->",
    "sampleText": "Comment"};
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/en/1/12/Button_gallery.png",
    "speedTip": "Insert a picture gallery",
    "tagOpen": "\n<gallery>\n",
    "tagClose": "\n</gallery>",
    "sampleText": "Image:Example.jpg|Caption1\nImage:Example.jpg|Caption2"};
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png",
    "speedTip": "Insert block of quoted text",
    "tagOpen": "<blockquote>\n",
    "tagClose": "\n</blockquote>",
    "sampleText": "Block quote"};
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/en/6/60/Button_insert_table.png",
    "speedTip": "Insert a table",
    "tagOpen": '{| class="wikitable"\n|-\n',
    "tagClose": "\n|}",
    "sampleText": "! header 1\n! header 2\n! header 3\n|-\n| row 1, cell 1\n| row 1, cell 2\n| row 1, cell 3\n|-\n| row 2, cell 1\n| row 2, cell 2\n| row 2, cell 3"};
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/ml/2/20/Button_subst.png",
    "speedTip": "സബ്സ്റ്റിറ്റിയൂഷന്‍ (subst) ചേര്‍ക്കുക",
    "tagOpen": "{{ബദല്‍:",
    "tagClose": "}}",
    "sampleText": "സ്വാഗതം"};
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/7/79/Button_reflink.png",
    "speedTip": "റഫറന്‍‌സുകള്‍ നല്‍കാന്‍",
    "tagOpen": "<ref>\n",
    "tagClose": "\n</ref>",
    "sampleText": "References"};
 
}
/*</nowiki></pre>*/
/*<pre><nowiki>
ടൂള്‍ ബാര്‍ ബട്ടണുകള്‍ അടുക്കിപ്പെറുക്കി വയ്ക്കാനുള്ള സ്ക്രിപ്റ്റ്‌
Maintainer : [[User:Tux the penguin]]
*/
function lija_rearrange()
{
var def,ext;
if(mwEditButtons)
def=mwEditButtons;
if(mwCustomEditButtons)
ext=mwCustomEditButtons;
if(def!=null && ext!=null)
{
var defc=def.slice();
var extc=ext.slice();
try
  {
def[2]=extc[1];
def[3]=defc[4];
def[4]=extc[8];
def[5]=extc[5];
def[6]=extc[9];
def[7]=extc[2];
def[8]=defc[10];
def[9]=extc[6];
def[10]=defc[8];
def[def.length]={
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/8/88/Btn_toolbar_enum.png",
    "speedTip": "എണ്ണമിട്ട പട്ടിക",
    "tagOpen": "\n#",
    "tagClose": "\n#രണ്ടാമത്തെ ഇനം\n#മൂന്നാമത്തെ ഇനം",
    "sampleText": "ഒന്നാമത്തെ ഇനം"};
def[def.length]={
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/1/11/Btn_toolbar_liste.png",
    "speedTip": "എണ്ണമിടാത്ത പട്ടിക",
    "tagOpen": "\n*",
    "tagClose": "\n*രണ്ടാമത്തെ ഇനം\n*മൂന്നാമത്തെ ഇനം",
    "sampleText": "ഒന്നാമത്തെ ഇനം"};
def[def.length]={
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/b/b4/Button_category03.png",
    "speedTip": "സൂചിക ചേര്‍ക്കുക",
    "tagOpen": "[[Category:",
    "tagClose": "]]",
    "sampleText": "ഉള്ളടക്കം"};
ext[0]=defc[2];
ext[1]=defc[3];
ext[2]=defc[5];
ext[3]=defc[6];
ext[4]=extc[7];
ext[5]=defc[7];
ext[6]=extc[3];
ext[7]=extc[4];
ext[8]=extc[0];
ext[9]=extc[10];
ext[10]=extc[11];
ext[11]=defc[9];
}
catch(ex)
{
//എറര്‍ ഉണ്ടായാല്‍..... സഹിക്കുക. അല്ലാണ്ടെന്തു ചെയ്യാന്‍ ?
}
}
}
addOnloadHook(lija_rearrange);
//****************************************************************************************************************
//ടൂള്‍ ബാര്‍ സ്ക്രിപ്റ്റ്‌ ഇവിടെ അവസാനിയ്ക്കുന്നു.
//****************************************************************************************************************
/*</nowiki></pre>*/




/*
/*
<nowiki><pre>
==addCharSubsetMenu==
 
    This script is a modified version of Alex benenson's cyrillic translitarator and this version was created by [[User:Peringz|Peringz]]
*/
*/


var consonants = {"ക":"ക","ഖ":"ഖ","ഗ":"ഗ","ഘ":"ഘ","ങ":"ങ","ച":"ച","ഛ":"ഛ","ജ":"ജ","ഝ":"ഝ","ഞ":"ഞ","ട":"ട","ഠ":"ഠ","ഡ":"ഡ","ഢ":"ഢ","ണ":"ണ","ത":"ത","ഥ":"ഥ","ദ":"ദ","ധ":"ധ","ന":"ന","പ":"പ","ഫ":"ഫ","ബ":"ബ","ഭ":"ഭ","മ":"മ","യ":"യ","ര":"ര","ല":"ല","വ":"വ","ശ":"ശ","ഷ":"ഷ","സ":"സ","ഹ":"ഹ","ള":"ള","ഴ":"ഴ","റ":"റ","റ്റ":"റ്റ"};
/* add menu for selecting subsets of secial characters  */
var chillaksharam = {"ണ്‍":"ണ","ന്‍":"ന","ം":"മ","ര്‍":"ര","ല്‍":"ല","ള്‍":"ള","്\\u200D":""};
/***** must match MediaWiki:Edittools *****/
 
function addCharSubsetMenu() {
var vowels = '"്a":"","്e":"െ","്i":"ി","്o":"ൊ","്u":"ു","്A":"ാ","്E":"േ","്I":"ീ","്O":"ോ","്U":"ൂ","്Y":"ൈ","െe":"ീ","ൊo":"ൂ","ിi":"ീ","ിe":"ീ","ുu":"ൂ","ുo":"ൂ","്r":"്ര്",';
if($('#editpage-specialchars').length>0) {
var roman = '"k":"ക്","ക്h":"ഖ്","g":"ഗ്","ഗ്h":"ഘ്","ന്‍g":"ങ്","c":"ക്\\u200D","ക്\\u200Dh":"ച്","ച്h":"ഛ്","j":"ജ്","ജ്h":"ഝ്","ന്‍j":"ഞ്","ന്‍h":"ഞ്","T":"ട്","ട്h":"ഠ്","D":"ഡ്","ഡ്h":"ഢ്","റ്റ്h":"ത്","ത്h":"ഥ്","d":"ദ്","ദ്h":"ധ്","p":"പ്","പ്h":"ഫ്","f":"ഫ്","b":"ബ്","ബ്h":"ഭ്","y":"യ്","v":"വ്","w":"വ്","z":"ശ്","S":"ശ്","സ്h":"ഷ്","s":"സ്","h":"ഹ്","ശ്h":"ഴ്","x":"ക്ഷ്","R":"റ്","t":"റ്റ്",';
/* default subset from cookie */
var chill = '"N":"ണ്‍","n":"ന്‍","m":"ം","r":"ര്‍","l":"ല്‍","L":"ള്‍",';
var s = parseInt( $.cookie('edittoolscharsubset') );
var swaram = '"a":"അ","അa":"ആ","A":"ആ","e":"","E":"ഏ","എe":"ഈ","i":"ഇ","ഇi":"ഈ","ഇe":"ഈ","അi":"ഐ","I":"ഐ","o":"ഒ","ഒo":"ഊ","O":"ഓ","അu":"ഔ","ഒu":"ഔ","u":"ഉ","ഉu":"ഊ","U":"ഊ","H":"ഃ","റ്h":"ഋ","ര്‍^":"ഋ","ഋ^":"ൠ","ല്‍^":"ഌ","ഌ^":"ൡ",';
if ( isNaN(s) ) s = 0;
//var numerals = '"1":"൧","2":"൨","3":"൩","4":"൪","5":"൫","6":"൬","7":"൭","8":"൮","9":"൯","0":"൦",';
var $menu = $('<select />')
var conjuncts = '"ന്‍t":"ന്റ്","ന്റ്h":"ന്ത്","ന്‍k":"ങ്ക്","ന്‍n":"ന്ന്","ണ്‍N":"ണ്ണ്","ള്‍L":"ള്ള്","ല്‍l":"ല്ല്","ംm":"മ്മ്","ന്‍m":"ന്മ്","ന്ന്g":"ങ്ങ്","ന്‍d":"ന്ദ്","ണ്‍m":"ണ്മ്","ല്‍p":"ല്പ്","ംp":"മ്പ്","റ്റ്t":"ട്ട്","ന്‍T":"ണ്ട്","ണ്‍T":"ണ്ട്","്ര്^":"ൃ","ന്‍c":"ന്‍\\u200D","ന്‍\\u200Dh":"ഞ്ച്","ണ്‍D":"ണ്ഡ്",';
.attr('id', 'charSubsetControl')
var others = '"്L":"്ല്","~":"്\\u200C","്~":"\\u200C", "\\u200C~":"\\u200C", "\\u200D\\u200C":"\\u200D", "\\u200C_":"__", "___":"___","~":"്","ക്\\u200Dc":"ക്ക്\\u200D","ക്ക്\\u200Dh":"ച്ച്","q":"ക്യൂ",';
.css('display', 'inline');
var caps = '"B":"ബ്ബ്","C":"ക്ക്\\u200D","F":"ഫ്","G":"ഗ്ഗ്","J":"ജ്ജ്","K":"ക്ക്","M":"മ്മ്","P":"പ്പ്","Q":"ക്യൂ","V":"വ്വ്","W":"വ്വ്","X":"ക്ഷ്","Y":"യ്യ്","Z":"ശ്ശ്",';
$menu.change(chooseCharSubset)
var ZWNJ = '"_":"\\u200C"';
.data('previousSelectedIndex', s)
 
.append($('<option />').text('ഫലകങ്ങൾ'))
// for compatibility with bookmarklets
.append($('<option />').text('വിക്കിവിന്യാസങ്ങൾ'))
function cyr_translit(src) {
.append($('<option />').text('അനുമതിപത്രങ്ങൾ'))
    return to_cyrillic(src);
.append($('<option />').text('മലയാളം'))
.append($('<option />').text('കൊറിയൻ'))
.append($('<option />').text('ലത്തീൻ'))
.append($('<option />').text('ഐ.പി..'))
.append($('<option />').text('പലവക'))
.append($('<option />').text('അറബി'))
.append($('<option />').text('ദേവനാഗരി'))
.append($('<option />').text('ഹിബ്രു'))
.append($('<option />').text('പഴയ ഇംഗ്ലീഷ്'));
$('#editpage-specialchars').prepend($menu);
/* update dropdown control to value of cookie */
$('#charSubsetControl')[0].selectedIndex = s;
$('p', '#editpage-specialchars').each(function(index) {
if(index==s) {
$(this).css('display', 'inline');
$(this).css('visibility', 'visible');
} else {
$(this).css('display', 'none');
$(this).css('visibility', 'hidden');
}
});
}
}
}


var conversionHash = undefined;
/*
var maxcyrlength = 0;
===chooseCharSubsetMenu===
 
*/
function getConversionHash() {
/* select subsection of special characters */
    if (conversionHash == undefined) {
function chooseCharSubset() {
        // TODO
var selectedIndex = $(this).find(':selected').index();
        var opr = "{" + vowels + roman + chill + swaram +  conjuncts + caps + others;
$('p', '#editpage-specialchars').each(function(index) {
        for (var consonant in consonants) {
if(index==selectedIndex) {
        opr += '"' + consonant + 'a":"' + consonant + 'ാ",';
$(this).css('display', 'inline');
        opr += '"' + consonant + 'e":"' + consonant + 'േ",';
$(this).css('visibility', 'visible');
        opr += '"' + consonant + 'i":"' + consonant + 'ൈ",';
}else {
        opr += '"' + consonant + 'o":"' + consonant + 'ോ",';
$(this).css('display', 'none');
        opr += '"' + consonant + 'u":"' + consonant + 'ൗ",';
$(this).css('visibility', 'hidden');
        }
}
});
        for (var chk in chillaksharam) {
$.cookie('edittoolscharsubset', selectedIndex);
            opr += '"' + chk + 'a":"' + chillaksharam[chk] + '",';
$(this).data('previousSelectedIndex', selectedIndex);
            opr += '"' + chk + 'e":"' + chillaksharam[chk] + 'െ",';
            opr += '"' + chk + 'i":"' + chillaksharam[chk] + 'ി",';
            opr += '"' + chk + 'o":"' + chillaksharam[chk] + 'ൊ",';
            opr += '"' + chk + 'u":"' + chillaksharam[chk] + 'ു",';
            opr += '"' + chk + 'A":"' + chillaksharam[chk] + 'ാ",';
            opr += '"' + chk + 'E":"' + chillaksharam[chk] + 'േ",';
            opr += '"' + chk + 'I":"' + chillaksharam[chk] + 'ീ",';
            opr += '"' + chk + 'O":"' + chillaksharam[chk] + 'ോ",';
            opr += '"' + chk + 'U":"' + chillaksharam[chk] + 'ൂ",';
            opr += '"' + chk + 'Y":"' + chillaksharam[chk] + 'ൈ",';
            opr += '"' + chk + 'r":"' + chillaksharam[chk] + '്ര്",';
            opr += '"' + chk + 'y":"' + chillaksharam[chk] + '്യ്",';
            opr += '"' + chk + 'v":"' + chillaksharam[chk] + '്വ്",';
            opr += '"' + chk + 'w":"' + chillaksharam[chk] + '്വ്",';
            opr += '"' + chk + '~":"' + chillaksharam[chk] + '്\\u200C",';
        }
        opr += ZWNJ + "}";
        // var tb = document.getElementById('wpTextbox1');
        // tb.value = opr;
        conversionHash = eval("("+opr+")");
        maxcyrlength=6;
    }
 
    return conversionHash;
}
}


function to_cyrillic(src, output, chunks) {
/*
    if (src == undefined || src == "" || src == null)
== customizeWikipedia ==
        return src;
*/
    if (output == undefined)
        output = new String();


    var hash = getConversionHash();
function customizeWikipedia() {
addCharSubsetMenu();
    var location = 0;
    while (location < src.length) {
        var len = Math.min(maxcyrlength, src.length - location);
        var arr = undefined;
        var sub;
        while (len > 0) {
        sub = src.substr(location, len);
        arr = hash[sub];
        if (arr != undefined)
        break;
        else
        len--;
        }
        // need this for translit on the fly
        if (chunks != undefined)
        chunks[chunks.length] = sub;
        if (arr == undefined) {
        output += sub;
        location ++;
        }
        else {
 
        // case analysis
        var newChar = arr;
        if (sub.toLowerCase() == sub.toUpperCase() && arr.length > 1 && arr[1] && (newChar.toUpperCase() != newChar.toLowerCase())) {
        // need translit hash to determine if previous character (and possibly the one before it)
        // were converted and are in upper case
        // set prevDud to true previous is not a translated character or simply a blank
        // set prevCap to true if previous was translated and was upper case
 
        var prevCh = output.length == 0 ? null : output.substr(output.length - 1, 1);
        var prevDud = !prevCh || !getTranslitString(prevCh);
        var prevCap = (!prevDud && prevCh == prevCh.toUpperCase());
 
        // sub is caseless but result isn't. case will depend on lookbehind and lookahead
        if (prevDud || !prevCap) {
        output += newChar.toLowerCase();
        prevCap = false;
        }
        else {
        var next = " ";
        if (location + len < src.length)
        next = src.substr(location + len, 1);
 
        if (next != next.toUpperCase() && next == next.toLowerCase() ) {
        //next is lowercase (and not caseless)
        output += newChar.toLowerCase();
        }
        else if (next == next.toUpperCase() && next != next.toLowerCase() ) {
        // next is uppercase (and not caseless)
        output += newChar.toUpperCase();
        }
        else {
        // next is caseless. output case determined by the case of output[length - 2]
        var pprevCh = output.length == 1 ? null : output.substr(output.length - 2, 1);
        var pprevDud = !pprevCh || !getTranslitString(pprevCh);
        if (!pprevDud && (pprevCh == pprevCh.toUpperCase())) {
        //pre-prev is in upper case. output is also uppercase
        output += newChar.toUpperCase();
        }
        else {
            output += newChar.toLowerCase();
        }
        }
        }
        }
        else if ((sub.toLowerCase() == sub.toUpperCase()) && (arr.length < 2 || !arr[1])) {
        // literal treatment of newChar
        output += newChar;
 
        }
        else if (sub != sub.toLowerCase()) {
        // sub not all-lowercase
        output += newChar.toUpperCase();
        }
        else {
        // sub is lowercase
            output += newChar.toLowerCase();
        }
        location += len;
        }
    }
    return output;
}
}
$(customizeWikipedia);


/**
* Dynamic Navigation Bars (experimental)
*
* Description: See [[Wikipedia:NavFrame]].
* Maintainers: UNMAINTAINED
*/


/* set up the words in your language */
var NavigationBarHide = 'മറയ്ക്കുക';
var NavigationBarShow = 'പ്രദർശിപ്പിക്കുക';
var indexNavigationBar = 0;


function convertIt(src,converter){
/**
var resultbuffer="";
* Shows and hides content and picture (if available) of navigation bars
     for(var i=0;i<src.length;i++){
* Parameters:
     resultbuffer=converter(resultbuffer+src[i]);
*    indexNavigationBar: the index of navigation bar to be toggled
     }
**/
        return converter(resultbuffer);
window.toggleNavigationBar = function ( indexNavigationBar, event ) {
     var NavToggle = document.getElementById( 'NavToggle' + indexNavigationBar );
     var NavFrame = document.getElementById( 'NavFrame' + indexNavigationBar );
     var NavChild;


}
     if ( !NavFrame || !NavToggle ) {
 
         return false;
 
 
var translitHash = undefined;
 
function initTranslit() {
     if (translitHash == undefined) {
         translitHash = new Array();
 
        for (var i = 0; i < conversionHash.length; i++) {
        var ch = conversionHash[i][1];
        // if the translit string is not caseless, convert cyr string to upper case
        // otherwise maintain its case
        if (conversionHash[i][0].toUpperCase() != conversionHash[i][0].toLowerCase())
        ch = ch.toUpperCase();
        if (translitHash[ch] == undefined)
        translitHash[ch] = conversionHash[i][0];
        }
     }
     }
}


 
    /* if shown now */
 
     if ( NavToggle.firstChild.data === NavigationBarHide ) {
 
         for ( NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling ) {
//-- translit on-the-fly --
            if ( $( NavChild ).hasClass( 'NavContent' ) || $( NavChild ).hasClass( 'NavPic' ) ) {
 
                NavChild.style.display = 'none';
function replaceValue(node, value, stepback) {
            }
     if (stepback == undefined)
        stepback = 0;
    if (isExplorer()) {
        var range = document.selection.createRange();
        range.moveStart("character", -stepback);
        range.text = value;
        range.collapse(false);
        range.select();
    }
    else {
        var scrollTop = node.scrollTop;
        var cursorLoc = node.selectionStart;
        node.value = node.value.substring(0, node.selectionStart - stepback) + value +
                node.value.substring(node.selectionEnd, node.value.length);
        node.scrollTop = scrollTop;
        node.selectionStart = cursorLoc + value.length - stepback;
        node.selectionEnd = cursorLoc + value.length - stepback;
    }
}
 
 
// compare positions
function positionIsEqual(other) {
    if (isExplorer())
         return this.position.isEqual(other.position);
    else
        return this.position == other.position;
 
}
 
function Position(node) {
  if (node.selectionStart != undefined)
    this.position = node.selectionStart;
  else if (document.selection && document.selection.createRange())
    this.position = document.selection.createRange();
   
  this.isEqual = positionIsEqual;
}
 
function resetState() {
    this.position = new Position(this.node);
    this.transBuffer = "";
    this.cyrBuffer = "";
}
 
function StateObject(node) {
    this.node = node;
    this.reset = resetState;
    this.cyrBuffer = "";
    this.transBuffer = "";
    this.position = new Position(node);
}
 
 
var stateHash = new Array();
 
function isExplorer() {
  return (document.selection != undefined && document.selection.createRange().isEqual != undefined);
}
 
function pressedKey(event) {
  if (isExplorer())
    return event.keyCode;
  else
    return event.which;
}
 
function transliterateKey(event) {
    /*
    if ((event.keyCode == 255 && event.charCode > 0) || event.keyCode == 8) {
        return;
    }
    */
   
    if (event == undefined)
        event = window.event;
   
    var node = null;
    if (event.target) {
        node = event.target;
         }
         }
     else if (event.srcElement) {
     NavToggle.firstChild.data = NavigationBarShow;
        node = event.srcElement;
        }
    // initialize state
    var state = stateHash[node];
    if (state == null) {
        state = new StateObject(node);
        stateHash[node] = state;
    }
    if ( (pressedKey(event) > 20) && !event.ctrlKey && !event.altKey && !event.metaKey) {
 
        var c = String.fromCharCode(pressedKey(event));
 
        // process input
        var result = process_translit(state, c);
        // finish up
        if (c != result.out || result.replace != 0) {
          if (isExplorer())
        event.returnValue = false;
          else
            event.preventDefault();
 
          replaceValue(node, result.out, result.replace);
 
          state.position = new Position(node);


    /* if hidden now */
    } else if ( NavToggle.firstChild.data === NavigationBarShow ) {
        for ( NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling ) {
            if ( $( NavChild ).hasClass( 'NavContent' ) || $( NavChild ).hasClass( 'NavPic' ) ) {
                NavChild.style.display = 'block';
            }
         }
         }
        NavToggle.firstChild.data = NavigationBarHide;
     }
     }
}


function TranslitResult() {
    event.preventDefault();
    this.out = "";
};
    this.replace = 0;
}


function process_translit(state, c) {
/* adds show/hide-button to navigation bars */
    // reset state if position changed
function createNavigationBarToggleButton( $content ) {
    if (!state.position.isEqual(new Position(state.node)))
     var NavChild;
        state.reset();
     /* iterate over all < div >-elements */
     var $divs = $content.find( 'div' );
     var result = new TranslitResult();
     $divs.each( function ( i, NavFrame ) {
        /* if found a navigation bar */
     // initial backbuffer. Add to it as characters are converted
        if ( $( NavFrame ).hasClass( 'NavFrame' ) ) {
     var backbuffer = getBackBuffer(state.node, state.cyrBuffer.length, 2);
     var chunks = new Array();
    state.transBuffer = state.transBuffer+ c


    var str = to_cyrillic(state.cyrBuffer+c, backbuffer, chunks);
            indexNavigationBar++;
            var NavToggle = document.createElement( 'a' );
            NavToggle.className = 'NavToggle';
            NavToggle.setAttribute( 'id', 'NavToggle' + indexNavigationBar );
            NavToggle.setAttribute( 'href', '#' );
            $( NavToggle ).on( 'click', $.proxy( window.toggleNavigationBar, window, indexNavigationBar ) );


    // remove backbuffer from output
            var isCollapsed = $( NavFrame ).hasClass( 'collapsed' );
    str = str.substr(backbuffer.length);
            /**
    result.out = str;
            * Check if any children are already hidden. This loop is here for backwards compatibility:
    /* str is now left alone - it has the output matching contents of chunks and
            * the old way of making NavFrames start out collapsed was to manually add style="display:none"
      will be used to reinitialize backbuffers, along with chunks and state.transBuffer
            * 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.
    // get the difference between state.cyrBuffer and output
            */
    for (var i = 0; i < Math.min(state.cyrBuffer.length, result.out.length); i++) {
            for ( NavChild = NavFrame.firstChild; NavChild != null && !isCollapsed; NavChild = NavChild.nextSibling ) {
        if (state.cyrBuffer.substr(i, 1) != result.out.substr(i, 1)) {
                if ( $( NavChild ).hasClass( 'NavPic' ) || $( NavChild ).hasClass( 'NavContent' ) ) {
        result.replace = state.cyrBuffer.length - i;
                    if ( NavChild.style.display === 'none' ) {
        result.out = result.out.substr(i);
                        isCollapsed = true;
        break;
                    }
        }
                 }
    }
    if (result.replace == 0) {
              if(result.out.length<state.cyrBuffer.length)
        result.replace=state.cyrBuffer.length- result.out.length;
        result.out = result.out.substr(Math.min(state.cyrBuffer.length, result.out.length));
               
                      //    result.out+="\u0008"
                       
    }
    // update state: backbuffer, bufferArray
    if (chunks.length > 0 && chunks[chunks.length - 1] == result.out.substr(result.out.length - 1)) {
        // no convertion took place, reset state
        state.reset();
    }
    else {
        while (state.transBuffer.length > maxcyrlength) {
        state.transBuffer = state.transBuffer.substr(chunks[0].length);
        chunks.shift();
        str = str.substr(1);
        }
        state.cyrBuffer = str;
    }
    return result;
}
 
function getBackBuffer(node, offset, count) {
    if (isExplorer()) { //.tagName.toUpperCase() == "EDITOR") {
        var range = document.selection.createRange();
        range.moveStart("character", -offset);
        var result = range.text.substr(-count);
        if (!result)
        result = "";
        return result;
 
    } else {
        return node.value.substring(0, node.selectionStart - offset).substr(-count);
    }
}
 
// need this for bookmarklets
function getSelectedNode() {
  if (document.activeElement)
    return document.activeElement;
  else
    if (window.getSelection && window.getSelection() && window.getSelection().rangeCount > 0) {
        var range = window.getSelection().getRangeAt(0);
        if (range.startContainer && range.startContainer.childNodes && range.startContainer.childNodes.length > range.startOffset)
        return range.startContainer.childNodes[range.startOffset]
    }
  return null;
}
 
function toggleCyrMode() {
    var node = getSelectedNode();
    if (node) {
        if (stateHash[node]) {
        if (removeKeyEventListener(node))
        delete stateHash[node];
        }
        else {
        if (addKeyEventListener(node))
        stateHash[node] = new StateObject(node);
        }
    }
}
 
function addKeyEventListener(node) {
    if (node.addEventListener)
        node.addEventListener("keypress", transliterateKey, false);
    else if (node.attachEvent)
        node.attachEvent("onkeypress", transliterateKey);
    else return false;
    return true;
}
function removeKeyEventListener(node) {
    if (node.removeEventListener)
        node.removeEventListener("keypress", transliterateKey, false);
    else if (node.detachEvent)
        node.detachEvent("onkeypress", transliterateKey);
    else return false;
    return true;
}
 
function getSelectedText() {
    if (isExplorer()) {
        return document.selection.createRange().text;
    }
    else {
        var node = getSelectedNode();
        if (node && node.value && node.selectionStart != undefined && node.selectionEnd != undefined)
        return node.value.substring(node.selectionStart, node.selectionEnd);
    }
    return "";
}
 
 
/* calling functions  */
 
        function addLoadEvent(func) {
           
            if (window.addEventListener)  
                window.addEventListener("load", func, false);
            else if (window.attachEvent)  
                window.attachEvent("onload", func);
        }
 
        function addTranslit(editForm,textBox) {
            checkrt(editForm); // check for translit support
 
            if (textBox.addEventListener)
                textBox.addEventListener("keypress", processKeys, false);
            else if (textBox.attachEvent)
                textBox.attachEvent("onkeypress", processKeys);
        }
 
        function addTextEvent() {
 
///////
if(lija_getCookie('mlWikiTranslit')!=null && lija_getCookie('mlWikiTranslit')!="") 
              realTime=(lija_getCookie('mlWikiTranslit')=="true")?true:false;
            //////
 
            var editForm =document.getElementById('editform');
            if(editForm != null) {
                var textBox=document.getElementById('wpTextbox1');
                var textSummary = document.getElementById('wpSummary');
                addTranslit(editForm,textBox);
                 addCheckbox(editForm,textBox );
                if(textSummary) { addTranslit(editForm,textSummary); }
             }
             }
 
             if ( isCollapsed ) {
            // add transliteration feature to search form also
                for ( NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling ) {
            var searchForm = document.getElementById('searchform');
                    if ( $( NavChild ).hasClass( 'NavPic' ) || $( NavChild ).hasClass( 'NavContent' ) ) {
             if( searchForm != null ) {
                        NavChild.style.display = 'none';
try {
                    }
var searchBox = document.getElementById('searchInput');
                 }
// add IME checkbox control to searchForm
if (searchBox != null || searchForm != null) {
var element = document.createElement("input");
element.setAttribute("type","checkbox");
element.setAttribute("id","sbrealtime");
if (element.addEventListener)
element.addEventListener("click", rtClick, false);
else if (element.attachEvent)
element.attachEvent("onclick", rtClick);
// var labelcheckBox = document.createTextNode('മംഗ്ലീഷിലെഴുതാം');
var chkSpan = document.createElement("span");
chkSpan.setAttribute("id","spnRealtime");
var searchBody = document.getElementById('searchBody');
searchBody.appendChild(element);
searchBody.appendChild(chkSpan);
// searchForm.insertBefore(element,searchBox);
document.getElementById("sbrealtime").checked = realTime;
document.getElementById('spnRealtime').innerHTML = '<a href="http://schoolwiki.in/index.php/%E0%B4%B8%E0%B4%B9%E0%B4%BE%E0%B4%AF%E0%B4%82:%E0%B4%9F%E0%B5%88%E0%B4%AA%E0%B5%8D%E0%B4%AA%E0%B4%BF%E0%B4%82%E0%B4%97%E0%B5%8D%E2%80%8C/ " title="Switches keyboard between Malayalam and English">മംഗ്ലീഷിലെഴുതാം </a>';
// searchForm.insertBefore(chkSpan,searchBox);
// var p = document.createElement("p");
// p.setAttribute("style","width:100%;height:1px;");
// searchForm.insertBefore(p,searchBox);
}
}
catch(ex)
{
  //എററിനെ ഓടിക്കുക.
}
if(searchBox) { addTranslit(searchForm,searchBox); }
}           
            //മലയാളം ടൈപ്പിങ് താളുകളിൽ സാധ്യമാക്കാനുള്ള സ്ക്രിപ്റ്റുകൾ  | scripts to avail Malayalam transliteration
            //തിരയല്‍ താള്‍ | Search page
 
            var simpleSearchForm = document.getElementById('search');
            if( simpleSearchForm != null) {
              var simpleSearchBox = document.getElementById('searchText');
              if( simpleSearchBox ) { addTranslit(simpleSearchForm, simpleSearchBox );}
            }
 
            var powerSearchForm = document.getElementById('powersearch');
            if( powerSearchForm != null) {
              var powerSearchBox = document.getElementById('powerSearchText');
              if( powerSearchBox ) { addTranslit(powerSearchForm, powerSearchBox );}
            }
 
            // തലക്കെട്ട് മാറ്റല്‍ താള്‍. | Move page
 
            var movePageForm = document.getElementById('movepage');
            if( movePageForm != null ) {
                var newTitleBox = document.getElementById('wpNewTitle');
                if( newTitleBox ) {addTranslit(movePageForm, newTitleBox);}
                 var reasonBox = document.getElementById('wpReason');
                if( reasonBox ) {addTranslit(movePageForm, reasonBox ); }
                         
             }
             }
            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) */
                      var kalariForm = document.getElementById('createbox');
             for( var j = 0; j < NavFrame.childNodes.length; j++ ) {
             if( kalariForm != null ) {
                 if ( $( NavFrame.childNodes[j] ).hasClass( 'NavHead' ) ) {
 
                    NavToggle.style.color = NavFrame.childNodes[j].style.color;
                 var kalariText = document.getElementsByName('title')[0];
                    NavFrame.childNodes[j].appendChild( NavToggle );
                if( kalariText ) {addTranslit(kalariForm, kalariText);}
                 }
                 }
            //അപ്‌ലോഡ് താള്‍
            //********************
            var upForm=document.getElementById('mw-upload-form');
            if(upForm)//ഈ ഫോം ഇല്ലെങ്കില്‍ പിന്നെ മുന്നോട്ട് പോകണ്ട.
            {
              var upName=document.getElementById('wpDestFile');
              var upComment=document.getElementById('wpUploadDescription');
              if(upName) addTranslit(upForm,upName);
              if(upComment) addTranslit(upForm,upComment);
             }
             }
          //**************     
             NavFrame.setAttribute( 'id', 'NavFrame' + indexNavigationBar );
    }
       
    function addCheckbox(editform,textBox) {
 
 
            if(editform==null||textBox==null) return;
 
                  try
                    {
            var element = document.createElement("input");
             element.setAttribute("type","checkbox");
            element.setAttribute("id","realtime");
 
            if (element.addEventListener)
                element.addEventListener("click", rtClick, false);
            else if (element.attachEvent)
                element.attachEvent("onclick", rtClick);
 
            var labelcheckBox = document.createTextNode(' ഇംഗ്ലീഷില്‍ മലയാളം എഴുതുവാന്‍ ഇതില്‍ ടിക്ക് ചെയ്യുക - Use Ctrl + M to Toggle.');
            editform.insertBefore(element,textBox);
            document.getElementById("realtime").checked = realTime;
            editform.insertBefore(labelcheckBox,textBox);
            var p = document.createElement("p");
            p.setAttribute("style","width:100%;height:1px;");
            editform.insertBefore(p,textBox);
            }
            catch(ex)
            {
              //എററിനെ ഓടിക്കുക.
            }
         }
         }
    } );
}


        var imeStatus = false;
mw.hook( 'wikipage.content' ).add( createNavigationBarToggleButton );
       
        function processKeys(event) {
            if (rtsupported) {
                e = event || window.event;


                var myKeyCode = 0;
/*END OF NAVIGATION BARS*/
                var myShiftKey = false;
                if( document.all ) { //IE
                    myKeycode = e.keyCode;
                    myShiftKey = e.shiftKey;
                } else if ( document.getElementById || document.layers ) {
                    myKeyCode = e.which;
                    myShiftKey = (myKeyCode == 16)?true:false;
                }
               


                if ((e.keyCode == 13 && e.ctrlKey) || (e.which == 109 && e.ctrlKey))
/** Collapsible tables *********************************************************
            {
*
            realTime = !realTime;
* Description: Allows tables to be collapsed, showing only the header. See
lija_setCookie('mlWikiTranslit',realTime,1);//save in cookie
*               [[Wikipedia:NavFrame]].
var chk = document.getElementById('realtime');
* Maintainers: [[User:R. Koot]]
var chkSb = document.getElementById('sbrealtime');
*/
if (chk) { chk.checked = realTime; }
if (chkSb) { chkSb.checked = realTime; }
var autoCollapse = 2;
                return false;
var collapseCaption = "മറയ്ക്കുക";
            }
var expandCaption = "പ്രദർശിപ്പിക്കുക";
           
            else if ((e.keyCode >= 3328 && e.keyCode <= 3455) || (e.which >= 3328 && e.which <= 3455)) {
function collapseTable( tableIndex )
                var chk = document.getElementById('realtime');
{
var spanSb = document.getElementById('spnRealtime');
var Button = document.getElementById( "collapseButton" + tableIndex );
var chkSb = document.getElementById('sbrealtime');
var Table = document.getElementById( "collapsibleTable" + tableIndex );
                if (imeStatus == false || realTime) {
                    realTime = false;
if ( !Table || !Button ) {
    if (chk) { chk.checked = realTime; chkSb.checked = realTime; spanSb.innerText = chkSb.checked }
return false;
    imeStatus = true;
}
  //alert('A Malayalam input tool was detected. Disabling in-built transliteration. To turn it On again use Ctrl+M');
window.status='A Malayalam input tool was detected. Disabling in-built transliteration. To turn it On again use Ctrl+M';//FF failure
var Rows = Table.rows;
    // return false;
}
if ( Button.firstChild.data == collapseCaption ) {
            }
for ( var i = 1; i < Rows.length; i++ ) {
                           
Rows[i].style.display = "none";
                else if (realTime) {
                    imeStatus = false;
                    transliterateKey(event); // call transliteration function
                }
            }
        }
        var realTime=false;
 
        function rtClick(event) {
                      realTime = !realTime;
                      lija_setCookie('mlWikiTranslit',realTime,1);//save in cookie
        }
 
        var rtsupported = false;
        var error;
 
        function checkrt(editform) {
            try {
       
            /*
            var nav = navigator.userAgent.toUpperCase();
            rtsupported = (nav.indexOf("GECKO") >= 0 || nav.indexOf("OPERA") >= 0 || nav.indexOf("SAFARI") >= 0);
            */
       
                rtsupported = (document.selection != undefined)
       
                if (!rtsupported) {
                var element = document.createElement("TEXTAREA");
                editform.appendChild(element);
       
                if (element.selectionStart != undefined)
                rtsupported = true;
                editform.removeChild(element);
                }
       
            } catch (error) {}
        }
 
//************************************
// ട്രാന്‍സ്‌ലിറ്ററേഷന്‍ സ്ക്രിപ്റ്റില്‍ കൂക്കി സപ്പോര്‍ട്ട് ചേര്‍ക്കാനുള്ള ശ്രമം
 
function lija_getCookie(cookieName)
{
if (document.cookie.length>0)
{
cookieStart=document.cookie.indexOf(cookieName + "=");
if (cookieStart!=-1)
{
cookieStart=cookieStart + cookieName.length+1;
cookieEnd=document.cookie.indexOf(";",cookieStart);
if (cookieEnd==-1) cookieEnd=document.cookie.length;
return unescape(document.cookie.substring(cookieStart,cookieEnd));
}
}
}
return "";
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 lija_setCookie(cookieName,value,expiredays)
}
{
}
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=cookieName+ "=" +escape(value)+"; path=/"+
((expiredays==null) ? "" : "; expires="+exdate.toGMTString());
}
 
//************************************
 
// add this line to your monobook.js to disable in-built transliteration - thanks to Sadik Khalid for this quick tip
// var userIMEEnabled = false;  // paste this line to user monobook.js and remove // from the begining of this line
 
// check for user preference and load in-built transliteration tool
  if(typeof(window.userIMEEnabled) == 'undefined') { addLoadEvent(addTextEvent); }
   
   
/*
function createCollapseButtons()
</pre></nowiki>
*/
 
/*
==addLoadEvent==
<pre> */
function addLoadEvent(func)  
{
{
  addOnloadHook( func );
var tableIndex = 0;
}
var NavigationBoxes = new Object();
 
var Tables = document.getElementsByTagName( "table" );
/* </pre> */
 
 
/*
== Dynamic Navigation Bars (experimental) ==
<pre> */
// BEGIN Dynamic Navigation Bars (experimental)
// FIXME: currently only works for one nav bar on a page at a time
// ===============================================
   
   
// set up the words in your language
for ( var i = 0; i < Tables.length; i++ ) {
var NavigationBarHide = '[മറയ്ക്കുക]';
if ( $(Tables[i]).hasClass( "collapsible" ) ) {
var NavigationBarShow = '[പ്രദര്‍ശിപ്പിക്കുക]';
   
   
// set up max count of Navigation Bars on page,
/* only add button and increment count if there is a header row to work with */
// if there are more, all will be hidden
var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0];
// NavigationBarShowDefault = 0; // all bars will be hidden
if (!HeaderRow) continue;
// NavigationBarShowDefault = 1; // on pages with more than 1 bar all bars will be hidden
var Header = HeaderRow.getElementsByTagName( "th" )[0];
var NavigationBarShowDefault = 1;
if (!Header) continue;
//Honor the User Preferences
if ( getCookie('WikipediaPreferencesShowNav') != 'true' ) {
        NavigationBarShowDefault = 0;
    } else {
      if ( wgNamespaceNumber == 0 ) NavigationBarShowDefault = 999 ;
    }
/* </pre> */
 
 
/*
=== toggleNavigationBar ===*
<pre> */
// 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) {
NavigationBoxes[ tableIndex ] = Tables[i];
        return false;
Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );
    }
   
   
     // if shown now
var Button     = document.createElement( "span" );
    if (NavToggle.firstChild.data == NavigationBarHide) {
var ButtonLink = document.createElement( "a" );
        for (
var ButtonText = document.createTextNode( collapseCaption );
                var NavChild = NavFrame.firstChild;
                NavChild;
                NavChild = NavChild.nextSibling
            ) {
            if (NavChild.className == 'NavPic') {
                NavChild.style.display = 'none';
            }
            if (NavChild.className == 'NavContent') {
                NavChild.style.display = 'none';
            }
        }
    NavToggle.firstChild.data = NavigationBarShow;
   
   
    // if hidden now
Button.className = "collapseButton"; //Styles are declared in Common.css
    } else if (NavToggle.firstChild.data == NavigationBarShow) {
        for (
                var NavChild = NavFrame.firstChild;
                NavChild;
                NavChild = NavChild.nextSibling
            ) {
            if (NavChild.className == 'NavPic') {
                NavChild.style.display = 'block';
            }
            if (NavChild.className == 'NavContent') {
                NavChild.style.display = 'block';
            }
        }
    NavToggle.firstChild.data = NavigationBarHide;
    }
}
/* </pre> */
 
 
/*
=== createNavigationBarToggleButton ===
<pre> */
// adds show/hide-button to navigation bars
function createNavigationBarToggleButton()
{
    var indexNavigationBar = 0;
    // iterate over all < div >-elements
    for(
            var i=0;
            NavFrame = document.getElementsByTagName("div")[i];  
            i++
        ) {
        // if found a navigation bar
        if (NavFrame.className == "NavFrame") {
   
   
            indexNavigationBar++;
ButtonLink.style.color = Header.style.color;
            var NavToggle = document.createElement("a");
ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
            NavToggle.className = 'NavToggle';
ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );
            NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
ButtonLink.appendChild( ButtonText );
            NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');
           
            var NavToggleText = document.createTextNode(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].className == "NavHead") {
                NavFrame.childNodes[j].appendChild(NavToggle);
              }
            }
            NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
        }
    }
    // if more Navigation Bars found than Default: hide all
    if (NavigationBarShowDefault < indexNavigationBar) {
        for(
                var i=1;  
                i<=indexNavigationBar;
                i++
        ) {
            toggleNavigationBar(i);
        }
    }
   
   
}
Button.appendChild( document.createTextNode( "[" ) );
Button.appendChild( ButtonLink );
Button.appendChild( document.createTextNode( "]" ) );
   
   
addLoadEvent(createNavigationBarToggleButton);
Header.insertBefore( Button, Header.childNodes[0] );
tableIndex++;
}
}
   
   
// END Dynamic Navigation Bars
for ( var i = 0i < tableIndex; i++ ) {
// ======================
if ( $(NavigationBoxes[i]).hasClass( "collapsed" ) || ( tableIndex >= autoCollapse && $(NavigationBoxes[i]).hasClass( "autocollapse" ) ) ) {
/* </pre> */
collapseTable( i );
 
}
 
else if ( $(NavigationBoxes[i]).hasClass( "innercollapse" ) ) {
/*
var element = NavigationBoxes[i];
==Cookies==
while (element = element.parentNode) {
<pre> */
if ( $(element).hasClass( "outercollapse" ) ) {
//Cookie helpers
collapseTable ( i );
//===========
break;
function setCookie(cookieName, cookieValue) {
}
var today = new Date();
}
  var expire = new Date();
}
var nDays = 30;
}
expire.setTime( today.getTime() + (3600000 * 24 * nDays) );
document.cookie = cookieName + "=" + escape(cookieValue)
                + ";path=/w"
                + ";expires="+expire.toGMTString();
document.cookie = cookieName + "=" + escape(cookieValue)
                + ";path=/wiki"
                + ";expires="+expire.toGMTString();
}
 
function getCookie(cookieName) {
  var start = document.cookie.indexOf( cookieName + "=" );
  if ( start == -1 ) return "";
  var len = start + cookieName.length + 1;
  if ( ( !start ) &&
    ( cookieName != document.cookie.substring( 0, cookieName.length ) ) )
      {
        return "";
      }
  var end = document.cookie.indexOf( ";", len );
  if ( end == -1 ) end = document.cookie.length;
  return unescape( document.cookie.substring( len, end ) );
}
 
function deleteCookie(cookieName) {
  if ( getCookie(cookieName) ) {
    document.cookie = cookieName + "=" + ";path=/w" +
    ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
    document.cookie = cookieName + "=" + ";path=/wiki" +
    ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
  }
}
/* </pre> */
 
 
/*
== Interproject links ==
<pre> */
function Projectlinks() {
        var elements = new Array();
        var spans = document.getElementsByTagName('span');
       
        // filter for projectlinks
        for (var i=0, j=0; i<spans.length; i++) {
                if (spans[i].className == 'interProject') {
                        elements[j] = spans[i].getElementsByTagName('a')[0];
                        j++;
                }
        }
       
       
        if (j) {
                // create navbox
                var plheader = document.createElement('h5');
                plheader.appendChild(document.createTextNode('In other projects'));
                var plbox = document.createElement('div');
                plbox.setAttribute('class','pBody');
                plbox.setAttribute('style','margin-top:0.7em;');
                var pllist = document.createElement('ul');
 
                // append
                for (var i=0; i<elements.length; i++) {
                        var plitem = document.createElement('li');
                        plitem.appendChild(elements[i]);
                        pllist.appendChild(plitem);
                }
                plbox.appendChild(plheader);
                plbox.appendChild(pllist);
                document.getElementById("p-tb").appendChild(plbox);
        }
}
 
addLoadEvent(Projectlinks);
/* </pre> */
 
 
/*
==addCharSubsetMenu==
<pre> */
 
/* add menu for selecting subsets of secial characters  */
/***** must match MediaWiki:Edittools *****/
function addCharSubsetMenu() {
  var edittools = document.getElementById('editpage-specialchars');
 
  if (edittools) {
    var menu = "<select id=\"charSubsetControl\" style=\"display:inline\" onChange=\"chooseCharSubset(selectedIndex)\">";
    menu += "<option>ഫലകങ്ങള്‍</option>";
    menu += "<option>വിക്കിവിന്യാസങ്ങള്‍</option>";
    menu += "<option>അനുമതിപത്രങ്ങള്‍</option>";
    menu += "<option>മലയാളം</option>";
    menu += "<option>കൊറിയന്‍</option>";
    menu += "<option>ലത്തീന്‍</option>";
    menu += "<option>ഐ.പി.എ.</option>";
    menu += "<option>പലവക</option>";
    menu += "<option>അറബി</option>";
    menu += "<option>ദേവനാഗരി</option>";
    menu += "<option>ഹിബ്രു</option>";
    menu += "<option>പഴയ ഇംഗ്ലീഷ്</option>";
    menu += "</select>";
    edittools.innerHTML = menu + edittools.innerHTML;
 
    /* default subset from cookie */
    var s = parseInt( getCookie('edittoolscharsubset') );
    if ( isNaN(s) ) s = 0;
 
    /* update dropdown control to value of cookie */
    document.getElementById('charSubsetControl').selectedIndex = s;  
 
    /* display the subset indicated by the cookie */
    chooseCharSubset( s );
  }
}
/* </pre> */
 
/*
===chooseCharSubsetMenu===
<pre> */
/* select subsection of special characters */
function chooseCharSubset(s) {
  var l = document.getElementById('editpage-specialchars').getElementsByTagName('p');
  for (var i = 0; i < l.length ; i++) {
    l[i].style.display = i == s ? 'inline' : 'none';
    l[i].style.visibility = i == s ? 'visible' : 'hidden';
  }
  setCookie('edittoolscharsubset', s);
}
 
 
/* </pre> */
 
/*
== customizeWikipedia ==
<pre> */
 
function customizeWikipedia() {
  addCharSubsetMenu();
}
}
   
   
addLoadEvent(customizeWikipedia);
$( createCollapseButtons );/** Collapsible tables *********************************************************
 
/* </pre> */
 
 
/*HERE STARTS THE WORKING-CODE OF "METABOXES"*/
 
/* Funcionament de la Plantilla:Metacaixa
Implementat per: Usuari:Peleguer.
Actualitzat per Joanjoc seguint les indicacions d'en Martorell
*/
 
function MetaCaixaInit(){
  //S'executa al carregar-se la pàgina, si hi ha metacaixes,
  // s'assignen els esdeveniments als botons
  //alert("MetaCaixaInit");
 
  var i=0      //Inicialitzem comptador de caixes
  for (i=0;i<=9;i++){
    var vMc = document.getElementById("mc"+i);
    if (!vMc) break;
    //alert("MetaCaixaInit, trobada Metacaixa mc"+i);
   
    var j=1    //Inicialitzem comptador de botons dins de la caixa
    var vPsIni = 0  //Pestanya visible inicial
    for (j=1;j<=9;j++){
        var vBt = document.getElementById("mc"+i+"bt"+j);
        if (!vBt) break;
        //alert("MetaCaixaInit, trobat botó mc"+i+"bt"+j);
        vBt.onclick = MetaCaixaMostraPestanya;          //A cada botó assignem l'esdeveniment onclick
        //alert (vBt.className);
        if (vBt.className=="mcBotoSel") vPsIni=j;  //Si tenim un botó seleccionat, en guardem l'index
    }
    //alert ("mc="+i+", ps="+j+", psini="+vPsIni );
    if (vPsIni == 0) { //Si no tenim cap botó seleccionat, n'agafem un aleatòriament
        vPsIni = 1+Math.floor((j-1)*Math.random()) ;
        //alert ("Activant Pestanya a l'atzar; _mc"+i+"bt"+vPsIni +"_");
        document.getElementById("mc"+i+"ps"+vPsIni).style.display = "block";
        document.getElementById("mc"+i+"ps"+vPsIni).style.visibility = "visible";
        document.getElementById("mc"+i+"bt"+vPsIni).className="mcBotoSel";
    }
  }
}
 
function MetaCaixaMostraPestanya(){
  //S'executa al clicar una pestanya,
  //aquella es fa visible i les altres s'oculten
  var vMcNom = this.id.substr(0,3); //A partir del nom del botó, deduïm el nom de la caixa
  var vIndex = this.id.substr(5,1); //I l'index
 
  var i=1
  for (i=1;i<=9;i++){        //busquem totes les pestanyes d'aquella caixa
      //alert(vMcNom+"ps"+i);
        var vPsElem = document.getElementById(vMcNom+"ps"+i);
        if (!vPsElem) break;
        if (vIndex==i){ //Si és la pestanya bona la mostrem i canviem la classe de botó
                vPsElem.style.display = "block";
                vPsElem.style.visibility = "visible";
                document.getElementById(vMcNom+"bt"+i).className="mcBotoSel";
        } else {            //Sinó, l'ocultem i canviem la classe de botó
                vPsElem.style.display = "none";
                vPsElem.style.visibility = "hidden";
                document.getElementById(vMcNom+"bt"+i).className="mcBoto";
        }
  }
  return false; //evitem la recàrrega de la pàgina
}
addOnloadHook(MetaCaixaInit);
 
/*HERE FINISHES THE WORKING-CODE OF "METABOXES"*/
 
/** 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]]
  */
 
if (wgServer == "https://secure.wikimedia.org") {
  var metaBase = "https://secure.wikimedia.org/wikipedia/meta";
} else {
  var metaBase = "http://meta.wikimedia.org";
}
importScriptURI(metaBase+"/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400")
 
/** Collapsible tables *********************************************************
  *
  *
  *  Description: Allows tables to be collapsed, showing only the header. See
  *  Description: Allows tables to be collapsed, showing only the header. See
വരി 1,486: വരി 282:
var autoCollapse = 2;
var autoCollapse = 2;
var collapseCaption = "മറയ്ക്കുക";
var collapseCaption = "മറയ്ക്കുക";
var expandCaption = "പ്രദര്‍ശിപ്പിക്കുക";
var expandCaption = "പ്രദർശിപ്പിക്കുക";
   
   
function collapseTable( tableIndex )
function collapseTable( tableIndex )
{
{
    var Button = document.getElementById( "collapseButton" + tableIndex );
var Button = document.getElementById( "collapseButton" + tableIndex );
    var Table = document.getElementById( "collapsibleTable" + tableIndex );
var Table = document.getElementById( "collapsibleTable" + tableIndex );
   
   
    if ( !Table || !Button ) {
if ( !Table || !Button ) {
        return false;
return false;
    }
}
   
   
    var Rows = Table.rows;
var Rows = Table.rows;
   
   
    if ( Button.firstChild.data == collapseCaption ) {
if ( Button.firstChild.data == collapseCaption ) {
        for ( var i = 1; i < Rows.length; i++ ) {
for ( var i = 1; i < Rows.length; i++ ) {
            Rows[i].style.display = "none";
Rows[i].style.display = "none";
        }
}
        Button.firstChild.data = expandCaption;
Button.firstChild.data = expandCaption;
    } else {
} else {
        for ( var i = 1; i < Rows.length; i++ ) {
for ( var i = 1; i < Rows.length; i++ ) {
            Rows[i].style.display = Rows[0].style.display;
Rows[i].style.display = Rows[0].style.display;
        }
}
        Button.firstChild.data = collapseCaption;
Button.firstChild.data = collapseCaption;
    }
}
}
}
   
   
function createCollapseButtons()
function createCollapseButtons()
{
{
    var tableIndex = 0;
var tableIndex = 0;
    var NavigationBoxes = new Object();
var NavigationBoxes = new Object();
    var Tables = document.getElementsByTagName( "table" );
var Tables = document.getElementsByTagName( "table" );
   
   
    for ( var i = 0; i < Tables.length; i++ ) {
for ( var i = 0; i < Tables.length; i++ ) {
        if ( hasClass( Tables[i], "collapsible" ) ) {
if ( $(Tables[i]).hasClass( "collapsible" ) ) {
   
   
            /* only add button and increment count if there is a header row to work with */
/* only add button and increment count if there is a header row to work with */
            var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0];
var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0];
            if (!HeaderRow) continue;
if (!HeaderRow) continue;
            var Header = HeaderRow.getElementsByTagName( "th" )[0];
var Header = HeaderRow.getElementsByTagName( "th" )[0];
            if (!Header) continue;
if (!Header) continue;
   
   
            NavigationBoxes[ tableIndex ] = Tables[i];
NavigationBoxes[ tableIndex ] = Tables[i];
            Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );
Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );
   
   
            var Button    = document.createElement( "span" );
var Button    = document.createElement( "span" );
            var ButtonLink = document.createElement( "a" );
var ButtonLink = document.createElement( "a" );
            var ButtonText = document.createTextNode( collapseCaption );
var ButtonText = document.createTextNode( collapseCaption );
   
   
            Button.className = "collapseButton";  //Styles are declared in Common.css
Button.className = "collapseButton";  //Styles are declared in Common.css
   
   
            ButtonLink.style.color = Header.style.color;
ButtonLink.style.color = Header.style.color;
            ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
            ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );
ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );
            ButtonLink.appendChild( ButtonText );
ButtonLink.appendChild( ButtonText );
   
   
            Button.appendChild( document.createTextNode( "[" ) );
Button.appendChild( document.createTextNode( "[" ) );
            Button.appendChild( ButtonLink );
Button.appendChild( ButtonLink );
            Button.appendChild( document.createTextNode( "]" ) );
Button.appendChild( document.createTextNode( "]" ) );
   
   
            Header.insertBefore( Button, Header.childNodes[0] );
Header.insertBefore( Button, Header.childNodes[0] );
            tableIndex++;
tableIndex++;
        }
}
    }
}
   
   
    for ( var i = 0;  i < tableIndex; i++ ) {
for ( var i = 0;  i < tableIndex; i++ ) {
        if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) {
if ( $(NavigationBoxes[i]).hasClass( "collapsed" ) || ( tableIndex >= autoCollapse && $(NavigationBoxes[i]).hasClass( "autocollapse" ) ) ) {
            collapseTable( i );
collapseTable( i );
        }  
}
        else if ( hasClass( NavigationBoxes[i], "innercollapse" ) ) {
else if ( $(NavigationBoxes[i]).hasClass( "innercollapse" ) ) {
            var element = NavigationBoxes[i];
var element = NavigationBoxes[i];
            while (element = element.parentNode) {
while (element = element.parentNode) {
                if ( hasClass( element, "outercollapse" ) ) {
if ( $(element).hasClass( "outercollapse" ) ) {
                    collapseTable ( i );
collapseTable ( i );
                    break;
break;
                }
}
            }
}
        }
}
    }
}
}
}
   
   
addOnloadHook( createCollapseButtons );
$( createCollapseButtons );
 
var hasClass = (function () {
    var reCache = {};
    return function (element, className) {
        return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);
    };
})();

15:45, 22 നവംബർ 2020-നു നിലവിലുള്ള രൂപം

/*ടൂൾബാറിൽ അവലംബം ചേർക്കാനുള്ള സൗകര്യം കൂട്ടിച്ചേർക്കുന്നതിനായി */
if ( mw.config.get( 'wgAction' ) === 'edit' || mw.config.get( 'wgAction' ) === 'submit' || mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Upload' ) {
    /* scripts specific to editing pages */
/*    importScript( 'മീഡിയവിക്കി:Common.js/edit.js' ); */
    mw.loader.load( '/index.php?title=മീഡിയവിക്കി:Common.js/edit.js&action=raw&ctype=text/javascript' );
}


/*
==addCharSubsetMenu==
*/

/* add menu for selecting subsets of secial characters  */
/***** must match MediaWiki:Edittools *****/
function addCharSubsetMenu() {
	if($('#editpage-specialchars').length>0) {
		/* default subset from cookie */
		var s = parseInt( $.cookie('edittoolscharsubset') );
		if ( isNaN(s) ) s = 0;
		var $menu = $('<select />')
		.attr('id', 'charSubsetControl')
		.css('display', 'inline');
		$menu.change(chooseCharSubset)
		.data('previousSelectedIndex', s)
		.append($('<option />').text('ഫലകങ്ങൾ'))
		.append($('<option />').text('വിക്കിവിന്യാസങ്ങൾ'))
		.append($('<option />').text('അനുമതിപത്രങ്ങൾ'))
		.append($('<option />').text('മലയാളം'))
		.append($('<option />').text('കൊറിയൻ'))
		.append($('<option />').text('ലത്തീൻ'))
		.append($('<option />').text('ഐ.പി.എ.'))
		.append($('<option />').text('പലവക'))
		.append($('<option />').text('അറബി'))
		.append($('<option />').text('ദേവനാഗരി'))
		.append($('<option />').text('ഹിബ്രു'))
		.append($('<option />').text('പഴയ ഇംഗ്ലീഷ്'));
		$('#editpage-specialchars').prepend($menu);
		/* update dropdown control to value of cookie */
		$('#charSubsetControl')[0].selectedIndex = s;
		$('p', '#editpage-specialchars').each(function(index) {
			if(index==s) {
				$(this).css('display', 'inline');
				$(this).css('visibility', 'visible');
			} else {
				$(this).css('display', 'none');
				$(this).css('visibility', 'hidden');
			}
		});
	}
}

/* 
===chooseCharSubsetMenu===
 */
/* select subsection of special characters */
function chooseCharSubset() {
	var selectedIndex = $(this).find(':selected').index();
	$('p', '#editpage-specialchars').each(function(index) {
		if(index==selectedIndex) {
			$(this).css('display', 'inline');
			$(this).css('visibility', 'visible');
		}else {
			$(this).css('display', 'none');
			$(this).css('visibility', 'hidden');
		}
	});
	$.cookie('edittoolscharsubset', selectedIndex);
	$(this).data('previousSelectedIndex', selectedIndex);
}

/* 
== customizeWikipedia ==
 */

function customizeWikipedia() {
	addCharSubsetMenu();
}
 
$(customizeWikipedia);

/**
 * Dynamic Navigation Bars (experimental)
 *
 * Description: See [[Wikipedia:NavFrame]].
 * Maintainers: UNMAINTAINED
 */

/* set up the words in your language */
var NavigationBarHide = 'മറയ്ക്കുക';
var NavigationBarShow = 'പ്രദർശിപ്പിക്കുക';
var indexNavigationBar = 0;

/**
 * Shows and hides content and picture (if available) of navigation bars
 * Parameters:
 *     indexNavigationBar: the index of navigation bar to be toggled
 **/
window.toggleNavigationBar = function ( indexNavigationBar, event ) {
    var NavToggle = document.getElementById( 'NavToggle' + indexNavigationBar );
    var NavFrame = document.getElementById( 'NavFrame' + indexNavigationBar );
    var NavChild;

    if ( !NavFrame || !NavToggle ) {
        return false;
    }

    /* if shown now */
    if ( NavToggle.firstChild.data === NavigationBarHide ) {
        for ( 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 ( NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling ) {
            if ( $( NavChild ).hasClass( 'NavContent' ) || $( NavChild ).hasClass( 'NavPic' ) ) {
                NavChild.style.display = 'block';
            }
        }
        NavToggle.firstChild.data = NavigationBarHide;
    }

    event.preventDefault();
};

/* adds show/hide-button to navigation bars */
function createNavigationBarToggleButton( $content ) {
    var NavChild;
    /* iterate over all < div >-elements */
    var $divs = $content.find( 'div' );
    $divs.each( function ( i, NavFrame ) {
        /* 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', '#' );
            $( NavToggle ).on( 'click', $.proxy( window.toggleNavigationBar, window, 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 ( 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 ( 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' ) ) {
                    NavToggle.style.color = NavFrame.childNodes[j].style.color;
                    NavFrame.childNodes[j].appendChild( NavToggle );
                }
            }
            NavFrame.setAttribute( 'id', 'NavFrame' + indexNavigationBar );
        }
    } );
}

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

/*END OF NAVIGATION BARS*/

/** 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 );/** 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 );
"https://schoolwiki.in/index.php?title=മീഡിയവിക്കി:Common.js&oldid=1055901" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്