मिडियाविकि:Translit.js

विकिपिडिया नं

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/**
 * Beginning of Transliteration Tool
 * Author: Junaid P V [[user:Junaidpv]]
 * added date: 2010-09-28
 */
function addOptionsToSimpleSearch() {
	// To add checkbox for simple search box
	//added by : [[User:Sadik Khalid]] (sadik.khalid@gmail.com)
	//********************* Starts here **********************************
	var firstone =document.getElementById('p-search');
	if(firstone!= null) {
		try
		{
		var nextone=document.getElementById('h5');
		
		var transListBox = document.createElement("select");
		transListBox.style.position ="relative";
		transListBox.style.fontSize="0.7em";
		transListBox.style.top="-4.5em";
		if (transListBox.addEventListener)
			transListBox.addEventListener("change", writingStyleLBChanged, false);
		else if (transListBox.attachEvent) 
			transListBox.attachEvent("onchange", writingStyleLBChanged);
		var numOfSchemes = transettings.schemes.length;
		for(var i=0; i < numOfSchemes; i++) {
			var schemeOption = document.createElement("option");
			schemeOption.appendChild( document.createTextNode(transettings.schemes[i].text) );
			schemeOption.value = transettings.schemes[i].text;
			if(transettings.default_scheme_index==i) schemeOption.selected=true;
			transListBox.appendChild( schemeOption );
		}
		 
		var chkboxelement = document.createElement("input");
		chkboxelement.setAttribute("type","checkbox");
		chkboxelement.setAttribute("id","searchInputcb");
		chkboxelement.style.position ="relative";
		chkboxelement.style.left=".2em";
		chkboxelement.style.top="-3.8em";
		chkboxelement.value = 'searchInput'; // specifying curresponding input filed.
		chkboxelement.checked = transettings.default_state;			
		 
		if (chkboxelement.addEventListener) 
		chkboxelement.addEventListener("click", transOptionOnClick, false);
		else if (chkboxelement.attachEvent) 
		chkboxelement.attachEvent("onclick", transOptionOnClick);
		 
		var chkboxlabel = document.createElement('chkboxlabel');
		chkboxlabel.style.fontSize = '.7em';
		//chkboxlabel.style.fontWeight = 'bold';
		chkboxlabel.style.position ="relative";
		chkboxlabel.style.left="0.5em";
		chkboxlabel.style.top="-4.8em"
		 
		var linktohelp = document.createElement ('a')
		linktohelp.href= transettings.checkbox.link.href;
		linktohelp.title= transettings.checkbox.link.tooltip;
		linktohelp.appendChild( document.createTextNode(transettings.checkbox.simple_text) );
		chkboxlabel.appendChild(linktohelp);
		chkboxlabel.appendChild(document.createElement('br'));
		firstone.insertBefore(transListBox,nextone);
		firstone.insertBefore(chkboxelement,nextone);		
		firstone.insertBefore(chkboxlabel,nextone);
		firstone.style.position ="relative";
		//firstone.style.top="-1.6em";
		}
		catch(ex)
		{
		//Error
		}
	}
	//************************* Ends here ****************************
}
mw.loader.load('//new.wikipedia.org/w/index.php?title=User:Eukesh/translit.js&action=raw&ctype=text/javascript');
mw.loader.load('//new.wikipedia.org/w/index.php?title=User:Eukesh/Inscript.js&action=raw&ctype=text/javascript');
mw.loader.load('//new.wikipedia.org/w/index.php?title=User:Eukesh/Nepali.js&action=raw&ctype=text/javascript');
function transetup(event) {
	transettings.schemes[0] = tr_sa;
	transettings.schemes[1] = tr_sa_inscript;
	transettings.shortcut.controlkey =true;
	transettings.shortcut.key = 'M';
	transettings.checkbox.text =  "देवनागरी ("+transettings.shortcut.toString()+")";
	transettings.checkbox.link.href = "//new.wikipedia.org/wiki/%E0%A4%B5%E0%A4%BF%E0%A4%95%E0%A4%BF%E0%A4%AA%E0%A4%BF%E0%A4%A1%E0%A4%BF%E0%A4%AF%E0%A4%BE:Input_System";
	transettings.checkbox.simple_text = 'देवनागरी';
	transettings.checkbox.link.tooltip = "देवनागरीइ च्वेत थ्व ज्याभः छ्येलादिसँ: "+transettings.shortcut.toString();
	setDefaultSchmeIndex(readCookie("transToolIndex"));

	transliterate('searchInput', 'wpTextbox1', 'wpSummary', 'searchText', 'powerSearchText', 'wpNewTitle', 'wpReason', 'nsfrom', 'username', 'mwProtect-reason', 'nsto','wpText',  'wpUploadDescription', 'wpDestFile');
	addTransliterationOption( 'searchText', 'powerSearchText', 'wpNewTitle', 'wpReason', 'nsfrom', 'username', 'mwProtect-reason', 'nsto','wpText', 'wpUploadDescription', 'wpDestFile');
	transettings.checkbox.position = "before";
	addTransliterationOption( 'wpTextbox1', 'wpSummary' );
	addOptionsToSimpleSearch();
	initMultiScheme();
	translitStateSynWithCookie('searchInput', 'wpTextbox1', 'wpSummary', 'searchText', 'powerSearchText', 'wpNewTitle', 'wpReason', 'nsfrom', 'username', 'mwProtect-reason', 'nsto','wpText');
}


if (window.addEventListener){
	window.addEventListener('load', transetup, false);
} else if (window.attachEvent){
	window.attachEvent('onload', transetup);
}
/* End of Transliteration Tool */