प्रयोगकर्ता:Mayur/transliterationtool.js
टिप्पणी सङ्ग्रह गरेपछि, परिवर्तन हेर्नको लागि तपाईंले आफ्नो ब्राउजरको क्याच बाईपास गर्नु पर्ने हुनसक्छ।
- फायरफक्स / सफारीमा: Shift कुञ्जी थिची राखेर Reload क्लिक गर्नुपर्छ, वा Ctrl-F5 वा Ctrl-R दबाउनुहोस् (म्याकमा ⌘-R)
- गुगल क्रोम: Ctrl-Shift-R कुञ्जी दबाउनुहोस् (म्याकमा ⌘-R)
- ओपेरा: Tools → Preferences मा गएर क्याश हटाउनुहोस्
- इन्टरनेट एक्सप्लोरर: Ctrl लाई थिची राखेर Refresh क्लिक गर्नुहोस् वा Ctrl-F5 थिच्नुहोस्
/**
* Beginning of Transliteration Tool
* @authors: Junaid P V ([[user:Junaidpv]])
* @Maintainer: Mayur ([[user:Mayur]])
*/
function addCheckBoxToSimpleSearch() {
//To add "देवनागरी" transliteration tool
//********************* देवनागरी **********************************
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="-3.8em";
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://ne.wikipedia.org/wiki/विकिपीडिया:नेपालीमा कसरी टाइप गर्ने";
linktohelp.title= "Phonetic Roman-to-Devanagari: 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)
{
//finished script written by junaid and sajid from malayalam wiki(thanks to them)
}
}
//************************* end of script ****************************
}
importScript('User:Mayur/DevnagriRules.js');
importScript('User:Mayur/Translit.js');
$(document).ready( function() {
transliterate('searchInput', 'wpTextbox1', 'wpSummary', 'wpFilterDescription', 'wpFilterTags', 'wpFilterRules', 'wpFilterNotes', 'wikieditor-toolbar-reference-text', 'mw-upload-form', 'wpDestFile', 'wpUploadDescription', 'emailuser', 'wpSubject', 'searchText', 'powerSearchText', 'wpNewTitle', 'wpReason', 'nsfrom', 'username', 'mwProtect-reason', 'nsto','wpText');
CHECKBOX_TEXT = "देवनागरी (Ctrl+M)";
addTransliterationOption( 'wpSummary', 'searchText', 'powerSearchText', 'wpFilterDescription', 'wpFilterTags', 'wpFilterRules', 'wpFilterNotes', 'wikieditor-toolbar-reference-text', 'mw-upload-form', 'wpDestFile', 'wpUploadDescription', 'emailuser', 'wpSubject', 'wpNewTitle', 'wpReason', 'nsfrom', 'username', 'mwProtect-reason', 'nsto','wpText');
TO_POSITION = "before";
addTransliterationOption( 'wpTextbox1');
addCheckBoxToSimpleSearch();
translitStateSynWithCookie('searchInput', 'wpTextbox1', 'wpSummary', 'wpFilterDescription', 'wpFilterTags', 'wpFilterRules', 'wpFilterNotes', 'wikieditor-toolbar-reference-text', 'mw-upload-form', 'wpDestFile', 'wpUploadDescription', 'emailuser', 'wpSubject', 'searchText', 'powerSearchText', 'wpNewTitle', 'wpReason', 'nsfrom', 'username', 'mwProtect-reason', 'nsto','wpText');
});
/* End of Transliteration Tool */