सदस्य:Mayur/savescript1.js
सूचना: यह पृष्ठ सुरक्षित करने बाद, परिवर्तनों को देखने लिए ब्राउज़र का कैश ख़ाली करने की आवश्यकता हो सकती है।
- मोज़िला / फ़ायरफ़ॉक्स / सफ़ारी: shift hold करें जब आप reload क्लिक करते है, या Ctrl-Shift-R (अपल मैक में Cmd-Shift-R) दबाएँ;
- गूगल क्रोम: Ctrl-shift-R (मैक में Cmd-Shift-R) दबाएँ
- इंटरनेट एक्सप्लोरर: Ctrl hold करें जब आप refresh क्लिक करते हैं, या Ctrl-F5 क्लिक करते हैं;
- कॉङ्करर: सिर्फ़ Reload बटन पर क्लिक करें, या F5 क्लिक करें;
- ऑपरा सदस्य को Tools→Preferences में सम्पूर्ण कैश ख़ाली करने की ज़रूरत हो सकती है।
importScript('MediaWiki:Common.js/SearchFix.js');
importScript('MediaWiki:Common.js/toolbar.js');
/** 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 Wikibooks' );
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 );
}
/*
==addLoadEvent==
<pre> */
function addLoadEvent(func)
{
addOnloadHook( func );
}
/* </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
var NavigationBarHide = '[ഒളിപ്പിക്കുക]';
var NavigationBarShow = '[പ്രദർശിപ്പിക്കുക]';
// set up max count of Navigation Bars on page,
// if there are more, all will be hidden
// NavigationBarShowDefault = 0; // all bars will be hidden
// NavigationBarShowDefault = 1; // on pages with more than 1 bar all bars will be hidden
var NavigationBarShowDefault = 1;
//Honor the User Preferences
if ( getCookie('WiktionaryPreferencesShowNav') != '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) {
return false;
}
// if shown now
if (NavToggle.firstChild.data == NavigationBarHide) {
for (
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
} 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++;
var NavToggle = document.createElement("a");
NavToggle.className = 'NavToggle';
NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
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);
}
}
}
addLoadEvent(createNavigationBarToggleButton);
// END Dynamic Navigation Bars
// ======================
/* </pre> */
/*
==Cookies==
<pre> */
//Cookie helpers
//===========
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>Latin/Roman</option>";
menu += "<option>IPA</option>";
menu += "<option>enPR</option>";
menu += "<option>Misc.</option>";
menu += "<option>Arabic</option>";
menu += "<option>Armenian</option>";
menu += "<option>Catalan</option>";
menu += "<option>Cyrillic</option>";
menu += "<option>Devanāgarī</option>";
menu += "<option>Esperanto</option>";
menu += "<option>Estonian</option>";
menu += "<option>French</option>";
menu += "<option>German</option>";
menu += "<option>Gothic</option>";
menu += "<option>Greek (Modern)</option>";
menu += "<option>Greek (Ancient)</option>";
menu += "<option>Hawaiian</option>";
menu += "<option>Hebrew</option>";
menu += "<option>Icelandic</option>";
menu += "<option>Italian</option>";
menu += "<option>Latvian/Lithuanian</option>";
menu += "<option>Maltese</option>";
menu += "<option>Old English</option>";
menu += "<option>Pinyin</option>";
menu += "<option>Portuguese</option>";
menu += "<option>Romaji</option>";
menu += "<option>Romanian</option>";
menu += "<option>Scandinavian</option>";
menu += "<option>Slavic Roman</option>";
menu += "<option>Sorani Kurdish</option>";
menu += "<option>Spanish</option>";
menu += "<option>Turkish</option>";
menu += "<option>Vietnamese</option>";
menu += "<option>Welsh</option>";
menu += "<option>Yoruba</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> */
/*
== customizeWikibooks ==
<pre> */
function customizeWikibooks() {
addCharSubsetMenu();
}
addLoadEvent(customizeWikibooks);
/* </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";
}
mw.loader.load(metaBase+"/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400")
//---------------------------------------------------------------------------------------------------
/*//Codes From En-Wiki
//Search within a book using Google//
// 0 - Main / 102 - Cookbook / 110 - Wikijunior
if ( wgNamespaceNumber == 0 || wgNamespaceNumber == 102 || wgNamespaceNumber == 110) importScript('MediaWiki:Common.js/BookSearch.js');
/**
* Beginning of Transliteration Tool
* Author: Junaid P V [[user:Junaidpv]]
* added date: 2010-09-06
*/
function addCheckBoxToSimpleSearch() {
//സേർച്ച്ബോക്സിനു മുകളിലായി "മലയാളത്തിലെഴുതുക" എന്ന ചെക്ക്ബോക്സ് ചേർക്കുവാൻ
//പരിപാലകൻ : [[User:Sadik Khalid]] (sadik.khalid@gmail.com)
//********************* ഇവിടെ തുടങ്ങുന്നു **********************************
var firstone =document.getElementById('p-search');
if(firstone!= null) {
try
{
var nextone=document.getElementById('h5');
var chkboxelement = document.createElement("input");
chkboxelement.setAttribute("type","checkbox");
chkboxelement.setAttribute("id","searchInputcb");
chkboxelement.style.position ="relative";
chkboxelement.style.left=".5em";
chkboxelement.style.top="-4em";
chkboxelement.value = 'searchInput'; // specifying curresponding input filed.
chkboxelement.checked =true;
if (chkboxelement.addEventListener)
chkboxelement.addEventListener("click", transOptionOnClick, false);
else if (chkboxelement.attachEvent)
chkboxelement.attachEvent("onclick", transOptionOnClick);
var chkboxlabel = document.createElement('chkboxlabel');
chkboxlabel.style.fontSize = '.75em';
chkboxlabel.style.fontWeight = 'bold';
chkboxlabel.style.position ="relative";
chkboxlabel.style.left="1em";
chkboxlabel.style.top="-4.5em"
var linktohelp = document.createElement ('a')
linktohelp.href= "http://ml.wikipedia.org/wiki/Help:Typing";
linktohelp.title= "മലയാളത്തിലെഴുതുവാൻ ഈ ഉപധി സ്വീകരിക്കുക, കുറുക്കുവഴി: Ctrl + M";
linktohelp.appendChild( document.createTextNode('മലയാളത്തിലെഴുതുക') );
chkboxlabel.appendChild(linktohelp);
chkboxlabel.appendChild(document.createElement('br'));
firstone.insertBefore(chkboxelement,nextone);
firstone.insertBefore(chkboxlabel,nextone);
firstone.style.position ="relative";
//firstone.style.top="-1.6em";
}
catch(ex)
{
//എറർ വന്നാൽ : തോമസൂട്ടീ വിട്ടോടാ...
}
}
//************************* ഇവിടെ അവസാനിക്കുന്നു ****************************
}
importScript('mediawiki:Common.js/ml_rules.js');
importScript('mediawiki:Common.js/transli.js');
$(function() {
transliterate('searchInput', 'wpTextbox1', 'wpSummary', 'searchText', 'powerSearchText', 'wpNewTitle', 'wpReason', 'nsfrom', 'username', 'mwProtect-reason', 'nsto');
addTransliterationOption('wpTextbox1', 'wpSummary', 'searchText', 'powerSearchText', 'wpNewTitle', 'wpReason', 'nsfrom', 'username', 'mwProtect-reason', 'nsto');
addCheckBoxToSimpleSearch();
});
/* End of Transliteration Tool */
/*
//</nowiki> End of Common.js
*/