सदस्य:Vibhijain/vector.js
/**
* 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/Marathi.js');
function transetup(event) {
transliterate('searchInput', 'wpTextbox1', 'wpSummary', 'searchText', 'powerSearchText', 'wpNewTitle', 'wpReason', 'nsfrom', 'username', 'mwProtect-reason', 'nsto','wpText', 'wpUploadDescription', 'wpDestFile');
}
if (window.addEventListener){
window.addEventListener('load', transetup, false);
} else if (window.attachEvent){
window.attachEvent('onload', transetup);
}
/* End of Transliteration Tool */
Text is available under the CC BY-SA 4.0 license; additional terms may apply.
Images, videos and audio are available under their respective licenses.