सदस्यः:Vibhijain/Common.js

विकिपीडिया, कश्चन स्वतन्त्रः विश्वकोशः

सूचना : भवता/भवत्या कृतानि सम्पादनानि संरक्ष्य तानि परिवर्तनेषु द्रष्टुं गवेषकस्य पृष्ठस्य पुनरारोपणम् (reload) आवश्यकं भवति ।

  • Firefox / Safari: Shiftकुड्मलेन सह Reloadकुड्मलं नुदतु ।
  • Google Chrome: Ctrl-Shift-R नोदनेन पुनरारोपणं भवति । (⌘-R इति Mac तन्त्रांशप्रयोक्तॄभ्यः)
  • Internet Explorer: Ctrlकुड्मलेन सह Refreshकुड्मलं नुदतु, Ctrl-F5 नुदतु वा ।
  • Opera: Tools → Preferences इत्यत्र गत्वा कर्तुं शक्नोति ।
/**
 * Beginning of Transliteration Tool
 * Author: Vaibhav Jain [[user:Vibhijain]]
 * added date: 2011-06-18
 */
function addOptionsToSimpleSearch() {
	// To add checkbox for simple search box
	//added by : [[User:Vibhijain]] (vbhijain@yahoo.in)
	//********************* 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('http://ilit.microsoft.com/bookmarklet/script/Hindi.js');
 
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 = "http://sa.wikipedia.org/wiki/Help:Typing";
	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 */
"https://sa.wikipedia.org/w/index.php?title=सदस्यः:Vibhijain/Common.js&oldid=457734" इत्यस्माद् प्रतिप्राप्तम्