Created
October 10, 2010 05:43
-
-
Save junaidpv/618999 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Change Special:Search to use a drop-down menu ******************************************************* | |
* | |
* Description: Change Special:Search to use a drop-down menu, with the default being | |
* the internal MediaWiki engine | |
* Created and maintained by: [[w:User:Gracenotes]] | |
* local maintainer [[User:Tux the penguin]] | |
*/ | |
if (wgPageName == "പ്രത്യേകം:Search") { | |
var searchEngines = []; | |
addOnloadHook(SpecialSearchEnhanced); | |
} | |
function SpecialSearchEnhanced() { | |
var createOption = function(site, action, mainQ, addQ, addV) { | |
var opt = document.createElement('option'); | |
opt.appendChild(document.createTextNode(site)); | |
searchEngines[searchEngines.length] = [action, mainQ, addQ, addV]; | |
return opt; | |
} | |
var searchForm = document.forms['search']; | |
var selectBox = document.createElement('select'); | |
selectBox.id = 'searchEngine'; | |
searchForm.onsubmit = function() { | |
var optSelected = searchEngines[document.getElementById('searchEngine').selectedIndex]; | |
searchForm.action = optSelected[0]; | |
searchForm.lsearchbox.name = optSelected[1]; | |
searchForm.title.value = optSelected[3]; | |
searchForm.title.name = optSelected[2]; | |
} | |
selectBox.appendChild(createOption('മീഡിയവിക്കി', wgScriptPath + '/index.php', 'search', 'title', 'Special:Search')); | |
selectBox.appendChild(createOption('ഗൂഗിൾ ', 'http://www.google.com/search', 'q', 'sitesearch', 'ml.wiktionary.org')); | |
selectBox.appendChild(createOption('യാഹൂ', 'http://search.yahoo.com/search', 'p', 'vs', 'ml.wiktionary.org')); | |
selectBox.appendChild(createOption('വിൻഡോസ് ലൈവ്', 'http://search.live.com/results.aspx', 'q', 'q1', 'site:http://ml.wiktionary.org')); | |
selectBox.appendChild(createOption('എക്സലേഡ്', 'http://www.exalead.com/wiktionary/results', 'q', 'language', 'ml')); | |
searchForm.lsearchbox.style.marginLeft = '0px'; | |
var lStat = document.getElementById('loadStatus'); | |
lStat.parentNode.insertBefore(selectBox, lStat); | |
} | |
/**തിരഞ്ഞെടുത്ത ലേഖനങ്ങളിലേയ്ക്ക് ഇന്റർ വിക്കി ലിങ്കുകൾ നൽകാൻ************** | |
* തിരഞ്ഞെടുത്ത ലേഖനങ്ങളിലേയ്ക്ക് ഇന്റർ വിക്കി ലിങ്കുകൾ നൽകാനായി ഈ സ്ക്രിപ്റ്റ് ഉപയോഗിയ്ക്കാം മറ്റു ഭാഷകളിൽ എന്നു | |
* കാണുന്ന സെക്ഷനിലെ ബുള്ളറ്റുകൾ ഈ ഫങ്ക്ഷൻ മാറ്റിയെഴുതും. ആംഗലേയ വിക്കിയിൽ നിന്നും കൊണ്ടുവന്നത് | |
*/ | |
function LinkFA() | |
{ | |
if ( document.getElementById( "p-lang" ) ) { | |
var InterwikiLinks = document.getElementById( "p-lang" ).getElementsByTagName( "li" ); | |
for ( var i = 0; i < InterwikiLinks.length; i++ ) { | |
if ( document.getElementById( InterwikiLinks[i].className + "-fa" ) ) { | |
InterwikiLinks[i].className += " FA" | |
InterwikiLinks[i].title = "മറ്റൊരു ഭാഷയിൽ ഈ ലേഖനം തിരഞ്ഞെടുക്കപ്പെട്ടതാണ്."; | |
} | |
} | |
} | |
} | |
addOnloadHook( LinkFA ); | |
/** 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 Wiktionaries' ); | |
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 ); | |
} | |
/**<pre><nowiki>*/ | |
/** Extra toolbar options ****************************************************** | |
* | |
* Description: UNDOCUMENTED | |
* Maintainers: [[User:MarkS]]?, [[User:Voice of All]], [[User:R. Koot]] | |
*/ | |
//This is a modified copy of a script by User:MarkS for extra features added by User:Voice of All. | |
// This is based on the original code on Wikipedia:Tools/Editing tools | |
// To disable this script, add <code>mwCustomEditButtons = [];<code> to [[Special:Mypage/monobook.js]] | |
if (mwCustomEditButtons) { | |
mwCustomEditButtons[mwCustomEditButtons.length] = { | |
"imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png", | |
"speedTip": "Redirect", | |
"tagOpen": "#REDIRECT [[", | |
"tagClose": "]]", | |
"sampleText": "Insert text"}; | |
mwCustomEditButtons[mwCustomEditButtons.length] = { | |
"imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png", | |
"speedTip": "Strike", | |
"tagOpen": "<s>", | |
"tagClose": "</s>", | |
"sampleText": "Strike-through text"}; | |
mwCustomEditButtons[mwCustomEditButtons.length] = { | |
"imageFile": "http://upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png", | |
"speedTip": "Line break", | |
"tagOpen": "<br />", | |
"tagClose": "", | |
"sampleText": ""}; | |
mwCustomEditButtons[mwCustomEditButtons.length] = { | |
"imageFile": "http://upload.wikimedia.org/wikipedia/en/8/80/Button_upper_letter.png", | |
"speedTip": "Superscript", | |
"tagOpen": "<sup>", | |
"tagClose": "</sup>", | |
"sampleText": "Superscript text"}; | |
mwCustomEditButtons[mwCustomEditButtons.length] = { | |
"imageFile": "http://upload.wikimedia.org/wikipedia/en/7/70/Button_lower_letter.png", | |
"speedTip": "Subscript", | |
"tagOpen": "<sub>", | |
"tagClose": "</sub>", | |
"sampleText": "Subscript text"}; | |
mwCustomEditButtons[mwCustomEditButtons.length] = { | |
"imageFile": "http://upload.wikimedia.org/wikipedia/en/5/58/Button_small.png", | |
"speedTip": "Small", | |
"tagOpen": "<small>", | |
"tagClose": "</small>", | |
"sampleText": "Small Text"}; | |
mwCustomEditButtons[mwCustomEditButtons.length] = { | |
"imageFile": "http://upload.wikimedia.org/wikipedia/en/3/34/Button_hide_comment.png", | |
"speedTip": "Insert hidden Comment", | |
"tagOpen": "", | |
"sampleText": "Comment"}; | |
mwCustomEditButtons[mwCustomEditButtons.length] = { | |
"imageFile": "http://upload.wikimedia.org/wikipedia/en/1/12/Button_gallery.png", | |
"speedTip": "Insert a picture gallery", | |
"tagOpen": "\n<gallery>\n", | |
"tagClose": "\n</gallery>", | |
"sampleText": "Image:Example.jpg|Caption1\nImage:Example.jpg|Caption2"}; | |
mwCustomEditButtons[mwCustomEditButtons.length] = { | |
"imageFile": "http://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png", | |
"speedTip": "Insert block of quoted text", | |
"tagOpen": "<blockquote>\n", | |
"tagClose": "\n</blockquote>", | |
"sampleText": "Block quote"}; | |
mwCustomEditButtons[mwCustomEditButtons.length] = { | |
"imageFile": "http://upload.wikimedia.org/wikipedia/en/6/60/Button_insert_table.png", | |
"speedTip": "Insert a table", | |
"tagOpen": '{| class="wikitable"\n|-\n', | |
"tagClose": "\n|}", | |
"sampleText": "! header 1\n! header 2\n! header 3\n|-\n| row 1, cell 1\n| row 1, cell 2\n| row 1, cell 3\n|-\n| row 2, cell 1\n| row 2, cell 2\n| row 2, cell 3"}; | |
mwCustomEditButtons[mwCustomEditButtons.length] = { | |
"imageFile": "http://upload.wikimedia.org/wikipedia/ml/2/20/Button_subst.png", | |
"speedTip": "സബ്സ്റ്റിറ്റിയൂഷൻ (subst) ചേർക്കുക", | |
"tagOpen": "{{Subst:", | |
"tagClose": "}}", | |
"sampleText": "Welcome"}; | |
mwCustomEditButtons[mwCustomEditButtons.length] = { | |
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/7/79/Button_reflink.png", | |
"speedTip": "റഫറൻസുകൾ നൽകാൻ", | |
"tagOpen": "<ref>\n", | |
"tagClose": "\n</ref>", | |
"sampleText": "References"}; | |
} | |
/*</nowiki></pre>*/ | |
/*<pre><nowiki> | |
ടൂൾ ബാർ ബട്ടണുകൾ അടുക്കിപ്പെറുക്കി വയ്ക്കാനുള്ള സ്ക്രിപ്റ്റ് | |
Maintainer : [[User:Tux the penguin]] | |
*/ | |
function lija_rearrange() | |
{ | |
var def,ext; | |
if(mwEditButtons) | |
def=mwEditButtons; | |
if(mwCustomEditButtons) | |
ext=mwCustomEditButtons; | |
if(def!=null && ext!=null) | |
{ | |
var defc=def.slice(); | |
var extc=ext.slice(); | |
try | |
{ | |
def[2]=extc[1]; | |
def[3]=defc[4]; | |
def[4]=extc[8]; | |
def[5]=extc[5]; | |
def[6]=extc[9]; | |
def[7]=extc[2]; | |
def[8]=defc[10]; | |
def[9]=extc[6]; | |
def[10]=defc[8]; | |
def[def.length]={ | |
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/8/88/Btn_toolbar_enum.png", | |
"speedTip": "എണ്ണമിട്ട പട്ടിക", | |
"tagOpen": "\n#", | |
"tagClose": "\n#രണ്ടാമത്തെ ഇനം\n#മൂന്നാമത്തെ ഇനം", | |
"sampleText": "ഒന്നാമത്തെ ഇനം"}; | |
def[def.length]={ | |
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/1/11/Btn_toolbar_liste.png", | |
"speedTip": "എണ്ണമിടാത്ത പട്ടിക", | |
"tagOpen": "\n*", | |
"tagClose": "\n*രണ്ടാമത്തെ ഇനം\n*മൂന്നാമത്തെ ഇനം", | |
"sampleText": "ഒന്നാമത്തെ ഇനം"}; | |
def[def.length]={ | |
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/b/b4/Button_category03.png", | |
"speedTip": "സൂചിക ചേര്ക്കുക", | |
"tagOpen": "[[Category:", | |
"tagClose": "]]", | |
"sampleText": "ഉള്ളടക്കം"}; | |
ext[0]=defc[2]; | |
ext[1]=defc[3]; | |
ext[2]=defc[5]; | |
ext[3]=defc[6]; | |
ext[4]=extc[7]; | |
ext[5]=defc[7]; | |
ext[6]=extc[3]; | |
ext[7]=extc[4]; | |
ext[8]=extc[0]; | |
ext[9]=extc[10]; | |
ext[10]=extc[11]; | |
ext[11]=defc[9]; | |
} | |
catch(ex) | |
{ | |
//എറർ ഉണ്ടായാൽ..... സഹിക്കുക. അല്ലാണ്ടെന്തു ചെയ്യാൻ ? | |
} | |
} | |
} | |
addOnloadHook(lija_rearrange); | |
//**************************************************************************************************************** | |
//ടൂൾ ബാർ സ്ക്രിപ്റ്റ് ഇവിടെ അവസാനിയ്ക്കുന്നു. | |
//**************************************************************************************************************** | |
/*</nowiki></pre>*/ | |
/* | |
==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> */ | |
/* | |
== customizeWiktionary == | |
<pre> */ | |
function customizeWiktionary() { | |
addCharSubsetMenu(); | |
} | |
addLoadEvent(customizeWiktionary); | |
/* </pre> */ | |
/** | |
* Beginning of Transliteration Tool | |
* Author: Junaid P V [[user:Junaidpv]] | |
* added date: 2010-09-28 | |
*/ | |
function addCheckBoxToSimpleSearch() { | |
//സേർച്ച്ബോക്സിനു മുകളിലായി "മലയാളത്തിലെഴുതുക" എന്ന ചെക്ക്ബോക്സ് ചേർക്കുവാൻ | |
//പരിപാലകൻ : [[User:Sadik Khalid]] ([email protected]) | |
//********************* ഇവിടെ തുടങ്ങുന്നു ********************************** | |
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('മീഡിയവിക്കി:rules.js'); | |
importScript('മീഡിയവിക്കി:transli.js'); | |
$j(document).ready( function() { | |
transliterate('searchInput', 'wpTextbox1', 'wpSummary', 'searchText', 'powerSearchText', 'wpNewTitle', 'wpReason', 'nsfrom', 'username', 'mwProtect-reason', 'nsto','wpText'); | |
CHECKBOX_TEXT = "മലയാളത്തിലെഴുതുക (Ctrl+M)"; | |
addTransliterationOption( 'searchText', 'powerSearchText', 'wpNewTitle', 'wpReason', 'nsfrom', 'username', 'mwProtect-reason', 'nsto','wpText', 'wpUploadDescription', 'wpDestFile'); | |
TO_POSITION = "before"; | |
addTransliterationOption( 'wpTextbox1', 'wpSummary' ); | |
addCheckBoxToSimpleSearch(); | |
translitStateSynWithCookie('searchInput', 'wpTextbox1', 'wpSummary', 'searchText', 'powerSearchText', 'wpNewTitle', 'wpReason', 'nsfrom', 'username', 'mwProtect-reason', 'nsto','wpText'); | |
}); | |
/* End of Transliteration Tool */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment