മീഡിയവിക്കി:Common.js (മൂലരൂപം കാണുക)
03:26, 25 ഒക്ടോബർ 2009-നു നിലവിലുണ്ടായിരുന്ന രൂപം
, 25 ഒക്ടോബർ 2009തിരുത്തലിനു സംഗ്രഹമില്ല
No edit summary |
No edit summary |
||
| വരി 1: | വരി 1: | ||
Reading Problems? Click here | |||
മീഡിയവിക്കി:Common.js | |||
വിക്കിപീഡിയ, ഒരു സ്വതന്ത്ര വിജ്ഞാനകോശം. | |||
പോവുക: വഴികാട്ടി, തിരയൂ | |||
പ്രത്യേക ശ്രദ്ധയ്ക്ക്: | |||
സേവ് ചെയ്ത ക്രമീകരണങ്ങള് കാണാന് നിങ്ങളുടെ ബ്രൗസറിന്റെ കാഷെ ക്ലിയര് ചെയ്യണം. | |||
* മോസില്ല/ഫയര്ഫോക്സ്/സഫാരി എന്നീ ബ്രൗസറുകളില് Reload ബട്ടണ് അമര്ത്തുമ്പോള് Shift കീ അമര്ത്തി പിടിക്കുകയോ Ctrl-Shift-R ഒരുമിച്ച് അമര്ത്തുകയോ (Cmd-Shift-R on Apple Mac) ചെയ്യുക; | |||
* ഇന്റര്നെറ്റ് എക്സ്പ്ലോറര് (IE):Refresh ബട്ടണ് അമര്ത്തുമ്പോള് Ctrl കീ അമര്ത്തിപിടിക്കുക. അല്ലെങ്കില് Ctrl-F5 അമര്ത്തുക; | |||
* ഓപ്പറ (Opera): Tools→Preferences ഉപയോഗിച്ച് കാഷെ പൂര്ണ്ണമായും ക്ലിയര് ചെയ്യുക; | |||
* Konqueror:: Reload ബട്ടണ് അമര്ത്തുകയോ F5 കീ അമര്ത്തുകയോ ചെയ്യുക. | |||
/** | |||
* Modifie Special:Search pour pouvoir utiliser différents moteurs de recherche, | |||
* disponibles dans une boîte déroulante. | |||
* Auteurs : Jakob Voss, Guillaume, importé depuis la Wiki allemande | |||
* <pre><nowiki> | |||
*/ | |||
function externalSearchEngines() { | |||
if (typeof SpecialSearchEnhanced2Disabled != 'undefined') return; | |||
var mainNode = document.getElementById("powersearch"); | |||
if (!mainNode) mainNode = document.getElementById("search"); | |||
if (!mainNode) return; | |||
var beforeNode = document.getElementById("mw-search-top-table"); | |||
if (!beforeNode) return; | |||
beforeNode = beforeNode.nextSibling; | |||
if (!beforeNode) return; | |||
var firstEngine = "mediawiki"; | |||
var choices = document.createElement("div"); | |||
choices.setAttribute("id","searchengineChoices"); | |||
choices.style.textAlign = "center"; | |||
var lsearchbox = document.getElementById("searchText"); | |||
var initValue = lsearchbox.value; | |||
var space = ""; | |||
for (var id in searchEngines) { | |||
var engine = searchEngines[id]; | |||
if(engine.ShortName) | |||
{ | |||
if (space) choices.appendChild(space); | |||
space = document.createTextNode(" "); | |||
var attr = { | |||
type: "radio", | |||
name: "searchengineselect", | |||
value: id, | |||
onFocus: "changeSearchEngine(this.value)", | |||
id: "searchengineRadio-"+id | |||
}; | |||
var html = "<input"; | |||
for (var a in attr) html += " " + a + "='" + attr[a] + "'"; | |||
html += " />"; | |||
var span = document.createElement("span"); | |||
span.innerHTML = html; | |||
choices.appendChild( span ); | |||
var label | |||
if (engine.Template.indexOf('http') == 0) { | |||
label = document.createElement("a"); | |||
label.href = engine.Template.replace("{searchTerms}", initValue).replace("{language}", "fr"); | |||
} else { | |||
label = document.createElement("label"); | |||
} | |||
label.appendChild( document.createTextNode( engine.ShortName ) ); | |||
choices.appendChild( label ); | |||
} | |||
} | |||
mainNode.insertBefore(choices, beforeNode); | |||
var input = document.createElement("input"); | |||
input.id = "searchengineextraparam"; | |||
input.type = "hidden"; | |||
mainNode.insertBefore(input, beforeNode); | |||
changeSearchEngine(firstEngine, initValue); | |||
} | |||
function changeSearchEngine(selectedId, searchTerms) { | |||
var currentId = document.getElementById("searchengineChoices").currentChoice; | |||
if (selectedId == currentId) return; | |||
document.getElementById("searchengineChoices").currentChoice = selectedId; | |||
var radio = document.getElementById('searchengineRadio-' + selectedId); | |||
radio.checked = "checked"; | |||
var engine = searchEngines[selectedId]; | |||
var p = engine.Template.indexOf('?'); | |||
var params = engine.Template.substr(p+1); | |||
var form; | |||
if (document.forms["search"]) { | |||
form = document.forms["search"]; | |||
} else { | |||
form = document.getElementById("powersearch"); | |||
} | |||
form.setAttribute("action", engine.Template.substr(0,p)); | |||
var l = ("" + params).split("&"); | |||
for (var idx = 0;idx < l.length;idx++) { | |||
var p = l[idx].split("="); | |||
var pValue = p[1]; | |||
if (pValue == "{language}") { | |||
} else if (pValue == "{searchTerms}") { | |||
var input; | |||
input = document.getElementById("searchText"); | |||
input.name = p[0]; | |||
} else { | |||
var input = document.getElementById("searchengineextraparam"); | |||
input.name = p[0]; | |||
input.value = pValue; | |||
} | |||
} | |||
} | |||
if (wgCanonicalSpecialPageName == "Search") { | |||
var searchEngines = { | |||
mediawiki: { | |||
ShortName: "ആഭ്യന്തര അന്വേഷണം", | |||
Template: "/w/index.php?search={searchTerms}" | |||
}, | |||
wikiwix: { | |||
ShortName: "വിക്കിവിക്സ്", | |||
Template: "http://ml.wikiwix.com/index.php?action={searchTerms}&lang={language}" | |||
}, | |||
google: { | |||
ShortName: "ഗൂഗിൾ", | |||
Template: "http://www.google.com/search?as_sitesearch=ml.wikipedia.org&hl={language}&q={searchTerms}" | |||
}, | |||
wlive: { | |||
ShortName: "വിൻഡോസ് ലൈവ്", | |||
Template: "http://search.live.com/results.aspx?q={searchTerms}&q1=site:http://ml.wikipedia.org" | |||
}, | |||
yahoo: { | |||
ShortName: "യാഹൂ!", | |||
Template: "http://search.yahoo.com/search?p={searchTerms}&vs=ml.wikipedia.org" | |||
}, | |||
exalead: { | |||
ShortName: "എക്സാലീഡ്", | |||
Template: "http://www.exalead.com/wikipedia/results?q={searchTerms}&language=ml" | |||
}, | |||
globalwpsearch: { | |||
ShortName: "ഗ്ലോബൽ ഡബ്ല്യൂപി", | |||
Template: "http://vs.aka-online.de/cgi-bin/globalwpsearch.pl?timeout=120&search={searchTerms}" | |||
} | |||
}; | |||
addOnloadHook(externalSearchEngines); | |||
} | |||
/**തിരഞ്ഞെടുത്ത ലേഖനങ്ങളിലേയ്ക്ക് ഇന്റര് വിക്കി ലിങ്കുകള് നല്കാന്************** | |||
* തിരഞ്ഞെടുത്ത ലേഖനങ്ങളിലേയ്ക്ക് ഇന്റര് വിക്കി ലിങ്കുകള് നല്കാനായി ഈ സ്ക്രിപ്റ്റ് ഉപയോഗിയ്ക്കാം മറ്റു ഭാഷകളില് എന്നു | |||
* കാണുന്ന സെക്ഷനിലെ ബുള്ളറ്റുകള് ഈ ഫങ്ക്ഷന് മാറ്റിയെഴുതും. ആംഗലേയ വിക്കിയില് നിന്നും കൊണ്ടുവന്നത് | |||
*/ | |||
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_Wikipedias ' ); | |||
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": "<!-- ", | |||
"tagClose": " -->", | |||
"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": "{{ബദല്:", | |||
"tagClose": "}}", | |||
"sampleText": "സ്വാഗതം"}; | |||
mwCustomEditButtons[mwCustomEditButtons.length] = { | |||
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/7/79/Button_reflink.png", | |||
"speedTip": "റഫറന്സുകള് നല്കാന്", | |||
"tagOpen": "<ref>\n", | |||
"tagClose": "\n</ref>", | |||
"sampleText": "References"}; | |||
mwCustomEditButtons[mwCustomEditButtons.length] = { | |||
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/e/ef/Button_cite_book.png", | |||
"speedTip": "പുസ്തകസ്രോതസ്സ്", | |||
"tagOpen": "{{cite book ", | |||
"tagClose": "\n| last= \n| first= \n| authorlink= \n| coauthors= \n| editor= \n| others= \n| title= \n| origdate= \n| origyear= \n| origmonth= \n| url= \n| format= \n| accessdate= \n| accessyear= \n| accessmonth= \n| edition= \n| series= \n| date= \n| year= \n| month= \n| publisher= \n| location= \n| language= \n| isbn= \n| oclc= \n| doi= \n| id= \n| pages= \n| chapter= \n| chapterurl= \n| quote= \n}}", | |||
"sampleText": ""}; | |||
mwCustomEditButtons[mwCustomEditButtons.length] = { | |||
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/2/2c/Button_cite_news.png", | |||
"speedTip": "വാര്ത്താസ്രോതസ്സ്", | |||
"tagOpen": "{{cite news ", | |||
"tagClose": "\n| first = \n| last = \n| authorlink = \n| author = \n| coauthors = \n| title = \n| url = \n| format = \n| work = \n| publisher = \n| pages = \n| page = \n| date = \n| accessdate = \n| language = \n}}", | |||
"sampleText": ""}; | |||
mwCustomEditButtons[mwCustomEditButtons.length] = { | |||
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/9/91/Button_cite_web.png", | |||
"speedTip": "വെബ്ബ്സ്രോതസ്സ്", | |||
"tagOpen": "{{cite book ", | |||
"tagClose": "\n| url = \n| title = \n| accessdate = \n| accessmonthday = \n| accessyear = \n| author = \n| last = \n| first = \n| authorlink = \n| coauthors = \n| date = \n| year = \n| month = \n| format = \n| work = \n| publisher = \n| pages = \n| language = \n| archiveurl = \n| archivedate = \n| quote = \n}}", | |||
"sampleText": ""}; | |||
} | |||
/*</nowiki></pre>*/ | |||
/*<pre><nowiki> | /*<pre><nowiki> | ||
ടൂള് ബാര് ബട്ടണുകള് അടുക്കിപ്പെറുക്കി വയ്ക്കാനുള്ള സ്ക്രിപ്റ്റ് | ടൂള് ബാര് ബട്ടണുകള് അടുക്കിപ്പെറുക്കി വയ്ക്കാനുള്ള സ്ക്രിപ്റ്റ് | ||
| വരി 9: | വരി 365: | ||
if(mwEditButtons) | if(mwEditButtons) | ||
def=mwEditButtons; | def=mwEditButtons; | ||
if(mwCustomEditButtons) | if(mwCustomEditButtons) | ||
ext=mwCustomEditButtons; | ext=mwCustomEditButtons; | ||
if(def!=null && ext!=null) | if(def!=null && ext!=null) | ||
{ | { | ||
| വരി 42: | വരി 398: | ||
def[def.length]={ | def[def.length]={ | ||
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/b/b4/Button_category03.png", | "imageFile": "http://upload.wikimedia.org/wikipedia/commons/b/b4/Button_category03.png", | ||
"speedTip": "സൂചിക | "speedTip": "സൂചിക ചേര്ക്കുക", | ||
"tagOpen": "[[Category:", | "tagOpen": "[[Category:", | ||
"tagClose": "]]", | "tagClose": "]]", | ||
"sampleText": "ഉള്ളടക്കം"}; | "sampleText": "ഉള്ളടക്കം"}; | ||
ext[0]=defc[2]; | ext[0]=defc[2]; | ||
ext[1]=defc[3]; | ext[1]=defc[3]; | ||
| വരി 66: | വരി 422: | ||
} | } | ||
} | } | ||
} | } | ||
addOnloadHook(lija_rearrange); | addOnloadHook(lija_rearrange); | ||
//**************************************************************************************************************** | //**************************************************************************************************************** | ||
| വരി 75: | വരി 431: | ||
//**************************************************************************************************************** | //**************************************************************************************************************** | ||
/*</nowiki></pre>*/ | /*</nowiki></pre>*/ | ||
/* | /* | ||
<nowiki><pre> | <nowiki><pre> | ||
This script is a modified version of Alex benenson's cyrillic translitarator and this version was created by [[User:Peringz|Peringz]] | This script is a modified version of Alex benenson's cyrillic translitarator and this version was created by [[User:Peringz|Peringz]] | ||
*/ | */ | ||
var consonants = {"ക":"ക","ഖ":"ഖ","ഗ":"ഗ","ഘ":"ഘ","ങ":"ങ","ച":"ച","ഛ":"ഛ","ജ":"ജ","ഝ":"ഝ","ഞ":"ഞ","ട":"ട","ഠ":"ഠ","ഡ":"ഡ","ഢ":"ഢ","ണ":"ണ","ത":"ത","ഥ":"ഥ","ദ":"ദ","ധ":"ധ","ന":"ന","പ":"പ","ഫ":"ഫ","ബ":"ബ","ഭ":"ഭ","മ":"മ","യ":"യ","ര":"ര","ല":"ല","വ":"വ","ശ":"ശ","ഷ":"ഷ","സ":"സ","ഹ":"ഹ","ള":"ള","ഴ":"ഴ","റ":"റ","റ്റ":"റ്റ"}; | var consonants = {"ക":"ക","ഖ":"ഖ","ഗ":"ഗ","ഘ":"ഘ","ങ":"ങ","ച":"ച","ഛ":"ഛ","ജ":"ജ","ഝ":"ഝ","ഞ":"ഞ","ട":"ട","ഠ":"ഠ","ഡ":"ഡ","ഢ":"ഢ","ണ":"ണ","ത":"ത","ഥ":"ഥ","ദ":"ദ","ധ":"ധ","ന":"ന","പ":"പ","ഫ":"ഫ","ബ":"ബ","ഭ":"ഭ","മ":"മ","യ":"യ","ര":"ര","ല":"ല","വ":"വ","ശ":"ശ","ഷ":"ഷ","സ":"സ","ഹ":"ഹ","ള":"ള","ഴ":"ഴ","റ":"റ","റ്റ":"റ്റ"}; | ||
var chillaksharam = {"ണ്":"ണ","ന്":"ന","ം":"മ","ര്":"ര","ല്":"ല","ള്":"ള","്\\u200D":""}; | var chillaksharam = {"ണ്":"ണ","ന്":"ന","ം":"മ","ര്":"ര","ല്":"ല","ള്":"ള","്\\u200D":""}; | ||
var vowels = '"്a":"","്e":"െ","്i":"ി","്o":"ൊ","്u":"ു","്A":"ാ","്E":"േ","്I":"ീ","്O":"ോ","്U":"ൂ","്Y":"ൈ","െe":"ീ","ൊo":"ൂ","ിi":"ീ","ിe":"ീ","ുu":"ൂ","ുo":"ൂ","്r":"്ര്",'; | var vowels = '"്a":"","്e":"െ","്i":"ി","്o":"ൊ","്u":"ു","്A":"ാ","്E":"േ","്I":"ീ","്O":"ോ","്U":"ൂ","്Y":"ൈ","െe":"ീ","ൊo":"ൂ","ിi":"ീ","ിe":"ീ","ുu":"ൂ","ുo":"ൂ","്r":"്ര്",'; | ||
var roman = '"k":"ക്","ക്h":"ഖ്","g":"ഗ്","ഗ്h":"ഘ്","ന്g":"ങ്","c":"ക്\\u200D","ക്\\u200Dh":"ച്","ച്h":"ഛ്","j":"ജ്","ജ്h":"ഝ്","ന്j":"ഞ്","ന്h":"ഞ്","T":"ട്","ട്h":"ഠ്","D":"ഡ്","ഡ്h":"ഢ്","റ്റ്h":"ത്","ത്h":"ഥ്","d":"ദ്","ദ്h":"ധ്","p":"പ്","പ്h":"ഫ്","f":"ഫ്","b":"ബ്","ബ്h":"ഭ്","y":"യ്","v":"വ്","w":"വ്","z":"ശ്","S":"ശ്","സ്h":"ഷ്","s":"സ്","h":"ഹ്","ശ്h":"ഴ്","x":"ക്ഷ്","R":"റ്","t":"റ്റ്",'; | var roman = '"k":"ക്","ക്h":"ഖ്","g":"ഗ്","ഗ്h":"ഘ്","ന്g":"ങ്","c":"ക്\\u200D","ക്\\u200Dh":"ച്","ച്h":"ഛ്","j":"ജ്","ജ്h":"ഝ്","ന്j":"ഞ്","ന്h":"ഞ്","T":"ട്","ട്h":"ഠ്","D":"ഡ്","ഡ്h":"ഢ്","റ്റ്h":"ത്","ത്h":"ഥ്","d":"ദ്","ദ്h":"ധ്","p":"പ്","പ്h":"ഫ്","f":"ഫ്","b":"ബ്","ബ്h":"ഭ്","y":"യ്","v":"വ്","w":"വ്","z":"ശ്","S":"ശ്","സ്h":"ഷ്","s":"സ്","h":"ഹ്","ശ്h":"ഴ്","x":"ക്ഷ്","R":"റ്","t":"റ്റ്",'; | ||
| വരി 92: | വരി 448: | ||
//var numerals = '"1":"൧","2":"൨","3":"൩","4":"൪","5":"൫","6":"൬","7":"൭","8":"൮","9":"൯","0":"൦",'; | //var numerals = '"1":"൧","2":"൨","3":"൩","4":"൪","5":"൫","6":"൬","7":"൭","8":"൮","9":"൯","0":"൦",'; | ||
var conjuncts = '"ന്t":"ന്റ്","ന്റ്h":"ന്ത്","ന്k":"ങ്ക്","ന്n":"ന്ന്","ണ്N":"ണ്ണ്","ള്L":"ള്ള്","ല്l":"ല്ല്","ംm":"മ്മ്","ന്m":"ന്മ്","ന്ന്g":"ങ്ങ്","ന്d":"ന്ദ്","ണ്m":"ണ്മ്","ല്p":"ല്പ്","ംp":"മ്പ്","റ്റ്t":"ട്ട്","ന്T":"ണ്ട്","ണ്T":"ണ്ട്","്ര്^":"ൃ","ന്c":"ന്\\u200D","ന്\\u200Dh":"ഞ്ച്","ണ്D":"ണ്ഡ്",'; | var conjuncts = '"ന്t":"ന്റ്","ന്റ്h":"ന്ത്","ന്k":"ങ്ക്","ന്n":"ന്ന്","ണ്N":"ണ്ണ്","ള്L":"ള്ള്","ല്l":"ല്ല്","ംm":"മ്മ്","ന്m":"ന്മ്","ന്ന്g":"ങ്ങ്","ന്d":"ന്ദ്","ണ്m":"ണ്മ്","ല്p":"ല്പ്","ംp":"മ്പ്","റ്റ്t":"ട്ട്","ന്T":"ണ്ട്","ണ്T":"ണ്ട്","്ര്^":"ൃ","ന്c":"ന്\\u200D","ന്\\u200Dh":"ഞ്ച്","ണ്D":"ണ്ഡ്",'; | ||
var others = '"്L":"്ല്","~":"്\\u200C","്~":" | var others = '"്L":"്ല്","~":"്\\u200C","്~":"\\u200C", "\\u200C~":"\\u200C", "\\u200D\\u200C":"\\u200D", "\\u200C_":"__", "___":"___","~":"്","ക്\\u200Dc":"ക്ക്\\u200D","ക്ക്\\u200Dh":"ച്ച്","q":"ക്യൂ",'; | ||
var caps = '"B":"ബ്ബ്","C":"ക്ക്\\u200D","F":"ഫ്","G":"ഗ്ഗ്","J":"ജ്ജ്","K":"ക്ക്","M":"മ്മ്","P":"പ്പ്","Q":"ക്യൂ","V":"വ്വ്","W":"വ്വ്","X":"ക്ഷ്","Y":"യ്യ്","Z":"ശ്ശ്",'; | var caps = '"B":"ബ്ബ്","C":"ക്ക്\\u200D","F":"ഫ്","G":"ഗ്ഗ്","J":"ജ്ജ്","K":"ക്ക്","M":"മ്മ്","P":"പ്പ്","Q":"ക്യൂ","V":"വ്വ്","W":"വ്വ്","X":"ക്ഷ്","Y":"യ്യ്","Z":"ശ്ശ്",'; | ||
var ZWNJ = '"_":"\\u200C"'; | var ZWNJ = '"_":"\\u200C"'; | ||
// for compatibility with bookmarklets | // for compatibility with bookmarklets | ||
function cyr_translit(src) { | function cyr_translit(src) { | ||
return to_cyrillic(src); | return to_cyrillic(src); | ||
} | } | ||
var conversionHash = undefined; | var conversionHash = undefined; | ||
var maxcyrlength = 0; | var maxcyrlength = 0; | ||
function getConversionHash() { | function getConversionHash() { | ||
if (conversionHash == undefined) { | if (conversionHash == undefined) { | ||
| വരി 115: | വരി 471: | ||
opr += '"' + consonant + 'u":"' + consonant + 'ൗ",'; | opr += '"' + consonant + 'u":"' + consonant + 'ൗ",'; | ||
} | } | ||
for (var chk in chillaksharam) { | for (var chk in chillaksharam) { | ||
opr += '"' + chk + 'a":"' + chillaksharam[chk] + '",'; | opr += '"' + chk + 'a":"' + chillaksharam[chk] + '",'; | ||
| വരി 134: | വരി 490: | ||
opr += '"' + chk + '~":"' + chillaksharam[chk] + '്\\u200C",'; | opr += '"' + chk + '~":"' + chillaksharam[chk] + '്\\u200C",'; | ||
} | } | ||
opr += ZWNJ + "}"; | opr += ZWNJ + "}"; | ||
// var tb = document.getElementById('wpTextbox1'); | // var tb = document.getElementById('wpTextbox1'); | ||
| വരി 141: | വരി 497: | ||
maxcyrlength=6; | maxcyrlength=6; | ||
} | } | ||
return conversionHash; | return conversionHash; | ||
} | } | ||
function to_cyrillic(src, output, chunks) { | function to_cyrillic(src, output, chunks) { | ||
if (src == undefined || src == "" || src == null) | if (src == undefined || src == "" || src == null) | ||
| വരി 150: | വരി 506: | ||
if (output == undefined) | if (output == undefined) | ||
output = new String(); | output = new String(); | ||
var hash = getConversionHash(); | var hash = getConversionHash(); | ||
var location = 0; | var location = 0; | ||
while (location < src.length) { | while (location < src.length) { | ||
var len = Math.min(maxcyrlength, src.length - location); | var len = Math.min(maxcyrlength, src.length - location); | ||
| വരി 167: | വരി 523: | ||
len--; | len--; | ||
} | } | ||
// need this for translit on the fly | // need this for translit on the fly | ||
if (chunks != undefined) | if (chunks != undefined) | ||
chunks[chunks.length] = sub; | chunks[chunks.length] = sub; | ||
if (arr == undefined) { | if (arr == undefined) { | ||
output += sub; | output += sub; | ||
| വരി 177: | വരി 533: | ||
} | } | ||
else { | else { | ||
// case analysis | // case analysis | ||
var newChar = arr; | var newChar = arr; | ||
if (sub.toLowerCase() == sub.toUpperCase() && arr.length > 1 && arr[1] && (newChar.toUpperCase() != newChar.toLowerCase())) { | if (sub.toLowerCase() == sub.toUpperCase() && arr.length > 1 && arr[1] && (newChar.toUpperCase() != newChar.toLowerCase())) { | ||
// need translit hash to determine if previous character (and possibly the one before it) | // need translit hash to determine if previous character (and possibly the one before it) | ||
// were converted and are in upper case | // were converted and are in upper case | ||
// set prevDud to true previous is not a translated character or simply a blank | // set prevDud to true previous is not a translated character or simply a blank | ||
// set prevCap to true if previous was translated and was upper case | // set prevCap to true if previous was translated and was upper case | ||
var prevCh = output.length == 0 ? null : output.substr(output.length - 1, 1); | var prevCh = output.length == 0 ? null : output.substr(output.length - 1, 1); | ||
var prevDud = !prevCh || !getTranslitString(prevCh); | var prevDud = !prevCh || !getTranslitString(prevCh); | ||
var prevCap = (!prevDud && prevCh == prevCh.toUpperCase()); | var prevCap = (!prevDud && prevCh == prevCh.toUpperCase()); | ||
// sub is caseless but result isn't. case will depend on lookbehind and lookahead | // sub is caseless but result isn't. case will depend on lookbehind and lookahead | ||
if (prevDud || !prevCap) { | if (prevDud || !prevCap) { | ||
| വരി 202: | വരി 558: | ||
if (location + len < src.length) | if (location + len < src.length) | ||
next = src.substr(location + len, 1); | next = src.substr(location + len, 1); | ||
if (next != next.toUpperCase() && next == next.toLowerCase() ) { | if (next != next.toUpperCase() && next == next.toLowerCase() ) { | ||
//next is lowercase (and not caseless) | //next is lowercase (and not caseless) | ||
| വരി 222: | വരി 578: | ||
output += newChar.toLowerCase(); | output += newChar.toLowerCase(); | ||
} | } | ||
} | } | ||
} | } | ||
} | } | ||
else if ((sub.toLowerCase() == sub.toUpperCase()) && (arr.length < 2 || !arr[1])) { | else if ((sub.toLowerCase() == sub.toUpperCase()) && (arr.length < 2 || !arr[1])) { | ||
// literal treatment of newChar | // literal treatment of newChar | ||
output += newChar; | output += newChar; | ||
} | } | ||
else if (sub != sub.toLowerCase()) { | else if (sub != sub.toLowerCase()) { | ||
// sub not all-lowercase | // sub not all-lowercase | ||
output += newChar.toUpperCase(); | output += newChar.toUpperCase(); | ||
} | } | ||
else { | else { | ||
// sub is lowercase | // sub is lowercase | ||
output += newChar.toLowerCase(); | output += newChar.toLowerCase(); | ||
| വരി 248: | വരി 604: | ||
} | } | ||
} | } | ||
return output; | return output; | ||
} | } | ||
function convertIt(src,converter){ | function convertIt(src,converter){ | ||
var resultbuffer=""; | var resultbuffer=""; | ||
| വരി 260: | വരി 616: | ||
} | } | ||
return converter(resultbuffer); | return converter(resultbuffer); | ||
} | } | ||
var translitHash = undefined; | var translitHash = undefined; | ||
function initTranslit() { | function initTranslit() { | ||
if (translitHash == undefined) { | if (translitHash == undefined) { | ||
translitHash = new Array(); | translitHash = new Array(); | ||
for (var i = 0; i < conversionHash.length; i++) { | for (var i = 0; i < conversionHash.length; i++) { | ||
var ch = conversionHash[i][1]; | var ch = conversionHash[i][1]; | ||
| വരി 277: | വരി 633: | ||
if (conversionHash[i][0].toUpperCase() != conversionHash[i][0].toLowerCase()) | if (conversionHash[i][0].toUpperCase() != conversionHash[i][0].toLowerCase()) | ||
ch = ch.toUpperCase(); | ch = ch.toUpperCase(); | ||
if (translitHash[ch] == undefined) | if (translitHash[ch] == undefined) | ||
translitHash[ch] = conversionHash[i][0]; | translitHash[ch] = conversionHash[i][0]; | ||
| വരി 283: | വരി 639: | ||
} | } | ||
} | } | ||
//-- translit on-the-fly -- | //-- translit on-the-fly -- | ||
function replaceValue(node, value, stepback) { | function replaceValue(node, value, stepback) { | ||
if (stepback == undefined) | if (stepback == undefined) | ||
stepback = 0; | stepback = 0; | ||
if (isExplorer()) { | if (isExplorer()) { | ||
var range = document.selection.createRange(); | var range = document.selection.createRange(); | ||
| വരി 310: | വരി 666: | ||
} | } | ||
} | } | ||
// compare positions | // compare positions | ||
function positionIsEqual(other) { | function positionIsEqual(other) { | ||
| വരി 318: | വരി 674: | ||
else | else | ||
return this.position == other.position; | return this.position == other.position; | ||
} | } | ||
function Position(node) { | function Position(node) { | ||
if (node.selectionStart != undefined) | if (node.selectionStart != undefined) | ||
| വരി 326: | വരി 682: | ||
else if (document.selection && document.selection.createRange()) | else if (document.selection && document.selection.createRange()) | ||
this.position = document.selection.createRange(); | this.position = document.selection.createRange(); | ||
this.isEqual = positionIsEqual; | this.isEqual = positionIsEqual; | ||
} | } | ||
function resetState() { | function resetState() { | ||
this.position = new Position(this.node); | this.position = new Position(this.node); | ||
| വരി 335: | വരി 691: | ||
this.cyrBuffer = ""; | this.cyrBuffer = ""; | ||
} | } | ||
function StateObject(node) { | function StateObject(node) { | ||
this.node = node; | this.node = node; | ||
| വരി 343: | വരി 699: | ||
this.position = new Position(node); | this.position = new Position(node); | ||
} | } | ||
var stateHash = new Array(); | var stateHash = new Array(); | ||
function isExplorer() { | function isExplorer() { | ||
return (document.selection != undefined && document.selection.createRange().isEqual != undefined); | return (document.selection != undefined && document.selection.createRange().isEqual != undefined); | ||
} | } | ||
function pressedKey(event) { | function pressedKey(event) { | ||
if (isExplorer()) | if (isExplorer()) | ||
| വരി 357: | വരി 713: | ||
return event.which; | return event.which; | ||
} | } | ||
function transliterateKey(event) { | function transliterateKey(event) { | ||
/* | /* | ||
| വരി 364: | വരി 720: | ||
} | } | ||
*/ | */ | ||
if (event == undefined) | if (event == undefined) | ||
event = window.event; | event = window.event; | ||
var node = null; | var node = null; | ||
if (event.target) { | if (event.target) { | ||
| വരി 375: | വരി 731: | ||
node = event.srcElement; | node = event.srcElement; | ||
} | } | ||
// initialize state | // initialize state | ||
var state = stateHash[node]; | var state = stateHash[node]; | ||
| വരി 384: | വരി 740: | ||
} | } | ||
if ( (pressedKey(event) > 20) && !event.ctrlKey && !event.altKey && !event.metaKey) { | if ( (pressedKey(event) > 20) && !event.ctrlKey && !event.altKey && !event.metaKey) { | ||
var c = String.fromCharCode(pressedKey(event)); | var c = String.fromCharCode(pressedKey(event)); | ||
// process input | // process input | ||
var result = process_translit(state, c); | var result = process_translit(state, c); | ||
| വരി 395: | വരി 751: | ||
else | else | ||
event.preventDefault(); | event.preventDefault(); | ||
replaceValue(node, result.out, result.replace); | replaceValue(node, result.out, result.replace); | ||
state.position = new Position(node); | state.position = new Position(node); | ||
} | } | ||
} | } | ||
} | } | ||
function TranslitResult() { | function TranslitResult() { | ||
this.out = ""; | this.out = ""; | ||
this.replace = 0; | this.replace = 0; | ||
} | } | ||
function process_translit(state, c) { | function process_translit(state, c) { | ||
// reset state if position changed | // reset state if position changed | ||
if (!state.position.isEqual(new Position(state.node))) | if (!state.position.isEqual(new Position(state.node))) | ||
state.reset(); | state.reset(); | ||
var result = new TranslitResult(); | var result = new TranslitResult(); | ||
// initial backbuffer. Add to it as characters are converted | // initial backbuffer. Add to it as characters are converted | ||
var backbuffer = getBackBuffer(state.node, state.cyrBuffer.length, 2); | var backbuffer = getBackBuffer(state.node, state.cyrBuffer.length, 2); | ||
var chunks = new Array(); | var chunks = new Array(); | ||
state.transBuffer = state.transBuffer+ c | state.transBuffer = state.transBuffer+ c | ||
var str = to_cyrillic(state.cyrBuffer+c, backbuffer, chunks); | var str = to_cyrillic(state.cyrBuffer+c, backbuffer, chunks); | ||
// remove backbuffer from output | // remove backbuffer from output | ||
str = str.substr(backbuffer.length); | str = str.substr(backbuffer.length); | ||
| വരി 431: | വരി 787: | ||
will be used to reinitialize backbuffers, along with chunks and state.transBuffer | will be used to reinitialize backbuffers, along with chunks and state.transBuffer | ||
*/ | */ | ||
// get the difference between state.cyrBuffer and output | // get the difference between state.cyrBuffer and output | ||
for (var i = 0; i < Math.min(state.cyrBuffer.length, result.out.length); i++) { | for (var i = 0; i < Math.min(state.cyrBuffer.length, result.out.length); i++) { | ||
| വരി 444: | വരി 800: | ||
result.replace=state.cyrBuffer.length- result.out.length; | result.replace=state.cyrBuffer.length- result.out.length; | ||
result.out = result.out.substr(Math.min(state.cyrBuffer.length, result.out.length)); | result.out = result.out.substr(Math.min(state.cyrBuffer.length, result.out.length)); | ||
// result.out+="\u0008" | // result.out+="\u0008" | ||
} | } | ||
// update state: backbuffer, bufferArray | // update state: backbuffer, bufferArray | ||
if (chunks.length > 0 && chunks[chunks.length - 1] == result.out.substr(result.out.length - 1)) { | if (chunks.length > 0 && chunks[chunks.length - 1] == result.out.substr(result.out.length - 1)) { | ||
| വരി 464: | വരി 820: | ||
return result; | return result; | ||
} | } | ||
function getBackBuffer(node, offset, count) { | function getBackBuffer(node, offset, count) { | ||
if (isExplorer()) { //.tagName.toUpperCase() == "EDITOR") { | if (isExplorer()) { //.tagName.toUpperCase() == "EDITOR") { | ||
var range = document.selection.createRange(); | var range = document.selection.createRange(); | ||
range.moveStart("character", -offset); | range.moveStart("character", -offset); | ||
| വരി 474: | വരി 830: | ||
if (!result) | if (!result) | ||
result = ""; | result = ""; | ||
return result; | return result; | ||
} else { | } else { | ||
return node.value.substring(0, node.selectionStart - offset).substr(-count); | return node.value.substring(0, node.selectionStart - offset).substr(-count); | ||
} | } | ||
} | } | ||
// need this for bookmarklets | // need this for bookmarklets | ||
function getSelectedNode() { | function getSelectedNode() { | ||
| വരി 494: | വരി 850: | ||
return null; | return null; | ||
} | } | ||
function toggleCyrMode() { | function toggleCyrMode() { | ||
var node = getSelectedNode(); | var node = getSelectedNode(); | ||
| വരി 508: | വരി 864: | ||
} | } | ||
} | } | ||
function addKeyEventListener(node) { | function addKeyEventListener(node) { | ||
if (node.addEventListener) | if (node.addEventListener) | ||
| വരി 525: | വരി 881: | ||
return true; | return true; | ||
} | } | ||
function getSelectedText() { | function getSelectedText() { | ||
if (isExplorer()) { | if (isExplorer()) { | ||
| വരി 537: | വരി 893: | ||
return ""; | return ""; | ||
} | } | ||
/* calling functions */ | /* calling functions */ | ||
function addLoadEvent(func) { | function addLoadEvent(func) { | ||
if (window.addEventListener) | if (window.addEventListener) | ||
window.addEventListener("load", func, false); | window.addEventListener("load", func, false); | ||
| വരി 548: | വരി 904: | ||
window.attachEvent("onload", func); | window.attachEvent("onload", func); | ||
} | } | ||
function addTranslit(editForm,textBox) { | function addTranslit(editForm,textBox) { | ||
checkrt(editForm); // check for translit support | checkrt(editForm); // check for translit support | ||
if (textBox.addEventListener) | if (textBox.addEventListener) | ||
textBox.addEventListener("keypress", processKeys, false); | textBox.addEventListener("keypress", processKeys, false); | ||
| വരി 557: | വരി 913: | ||
textBox.attachEvent("onkeypress", processKeys); | textBox.attachEvent("onkeypress", processKeys); | ||
} | } | ||
function addTextEvent() { | function addTextEvent() { | ||
/////// | /////// | ||
if(lija_getCookie('mlWikiTranslit')!=null && lija_getCookie('mlWikiTranslit')!="") | if(lija_getCookie('mlWikiTranslit')!=null && lija_getCookie('mlWikiTranslit')!="") | ||
realTime=(lija_getCookie('mlWikiTranslit')=="true")?true:false; | realTime=(lija_getCookie('mlWikiTranslit')=="true")?true:false; | ||
////// | ////// | ||
var editForm =document.getElementById('editform'); | var editForm =document.getElementById('editform'); | ||
if(editForm != null) { | if(editForm != null) { | ||
| വരി 573: | വരി 929: | ||
if(textSummary) { addTranslit(editForm,textSummary); } | if(textSummary) { addTranslit(editForm,textSummary); } | ||
} | } | ||
// add transliteration feature to search form also | // add transliteration feature to search form also | ||
var searchForm = document.getElementById('searchform'); | var searchForm = document.getElementById('searchform'); | ||
| വരി 588: | വരി 944: | ||
else if (element.attachEvent) | else if (element.attachEvent) | ||
element.attachEvent("onclick", rtClick); | element.attachEvent("onclick", rtClick); | ||
// var labelcheckBox = document.createTextNode('മലയാളത്തിലെഴുതുക'); | // var labelcheckBox = document.createTextNode('മലയാളത്തിലെഴുതുക'); | ||
var chkSpan = document.createElement("span"); | var chkSpan = document.createElement("span"); | ||
| വരി 595: | വരി 951: | ||
searchBody.appendChild(element); | searchBody.appendChild(element); | ||
searchBody.appendChild(chkSpan); | searchBody.appendChild(chkSpan); | ||
// searchForm.insertBefore(element,searchBox); | // searchForm.insertBefore(element,searchBox); | ||
document.getElementById("sbrealtime").checked = realTime; | document.getElementById("sbrealtime").checked = realTime; | ||
| വരി 609: | വരി 965: | ||
//എററിനെ ഓടിക്കുക. | //എററിനെ ഓടിക്കുക. | ||
} | } | ||
if(searchBox) { addTranslit(searchForm,searchBox); } | if(searchBox) { addTranslit(searchForm,searchBox); } | ||
} | } | ||
//മലയാളം ടൈപ്പിങ് താളുകളിൽ സാധ്യമാക്കാനുള്ള സ്ക്രിപ്റ്റുകൾ | scripts to avail Malayalam transliteration | |||
//തിരയല് താള് | Search page | |||
var powerSearchForm = document.getElementById(' | |||
var simpleSearchForm = document.getElementById('search'); | |||
if( simpleSearchForm != null) { | |||
var simpleSearchBox = document.getElementById('searchText'); | |||
if( simpleSearchBox ) { addTranslit(simpleSearchForm, simpleSearchBox );} | |||
} | |||
var powerSearchForm = document.getElementById('powersearch'); | |||
if( powerSearchForm != null) { | if( powerSearchForm != null) { | ||
var powerSearchBox = document.getElementById(' | var powerSearchBox = document.getElementById('powerSearchText'); | ||
if( powerSearchBox ) { addTranslit(powerSearchForm, powerSearchBox );} | if( powerSearchBox ) { addTranslit(powerSearchForm, powerSearchBox );} | ||
} // | } | ||
// തലക്കെട്ട് മാറ്റല് താള്. | Move page | |||
var movePageForm = document.getElementById('movepage'); | var movePageForm = document.getElementById('movepage'); | ||
if( movePageForm != null ) { | if( movePageForm != null ) { | ||
| വരി 627: | വരി 992: | ||
var reasonBox = document.getElementById('wpReason'); | var reasonBox = document.getElementById('wpReason'); | ||
if( reasonBox ) {addTranslit(movePageForm, reasonBox ); } | if( reasonBox ) {addTranslit(movePageForm, reasonBox ); } | ||
} | } | ||
//വിക്കിപീഡിയ:കളരി | //വിക്കിപീഡിയ:കളരി | ||
var kalariForm = document.getElementById('createbox'); | |||
if( kalariForm != null ) { | if( kalariForm != null ) { | ||
var kalariText = document.getElementsByName('title')[0]; | var kalariText = document.getElementsByName('title')[0]; | ||
if( kalariText ) {addTranslit(kalariForm, kalariText);} | if( kalariText ) {addTranslit(kalariForm, kalariText);} | ||
} | } | ||
//അപ്ലോഡ് താള് | //അപ്ലോഡ് താള് | ||
//******************** | //******************** | ||
var upForm=document.getElementById('upload'); | var upForm=document.getElementById('mw-upload-form'); | ||
if(upForm)//ഈ ഫോം ഇല്ലെങ്കില് പിന്നെ മുന്നോട്ട് പോകണ്ട. | if(upForm)//ഈ ഫോം ഇല്ലെങ്കില് പിന്നെ മുന്നോട്ട് പോകണ്ട. | ||
{ | { | ||
| വരി 648: | വരി 1,013: | ||
if(upComment) addTranslit(upForm,upComment); | if(upComment) addTranslit(upForm,upComment); | ||
} | } | ||
//************** | |||
} | } | ||
function addCheckbox(editform,textBox) { | function addCheckbox(editform,textBox) { | ||
if(editform==null||textBox==null) return; | if(editform==null||textBox==null) return; | ||
try | try | ||
{ | { | ||
| വരി 671: | വരി 1,026: | ||
element.setAttribute("type","checkbox"); | element.setAttribute("type","checkbox"); | ||
element.setAttribute("id","realtime"); | element.setAttribute("id","realtime"); | ||
if (element.addEventListener) | if (element.addEventListener) | ||
element.addEventListener("click", rtClick, false); | element.addEventListener("click", rtClick, false); | ||
else if (element.attachEvent) | else if (element.attachEvent) | ||
element.attachEvent("onclick", rtClick); | element.attachEvent("onclick", rtClick); | ||
var labelcheckBox = document.createTextNode(' മലയാളം എഴുതുവാന് ഈ ഉപാധി സ്വീകരിക്കുക - Use Ctrl + M to Toggle.'); | var labelcheckBox = document.createTextNode(' മലയാളം എഴുതുവാന് ഈ ഉപാധി സ്വീകരിക്കുക - Use Ctrl + M to Toggle.'); | ||
editform.insertBefore(element,textBox); | editform.insertBefore(element,textBox); | ||
| വരി 690: | വരി 1,045: | ||
} | } | ||
} | } | ||
var imeStatus = false; | var imeStatus = false; | ||
function processKeys(event) { | function processKeys(event) { | ||
if (rtsupported) { | if (rtsupported) { | ||
e = event || window.event; | e = event || window.event; | ||
var myKeyCode = 0; | var myKeyCode = 0; | ||
var myShiftKey = false; | var myShiftKey = false; | ||
| വരി 706: | വരി 1,061: | ||
myShiftKey = (myKeyCode == 16)?true:false; | myShiftKey = (myKeyCode == 16)?true:false; | ||
} | } | ||
if ((e.keyCode == 13 && e.ctrlKey) || (e.which == 109 && e.ctrlKey)) | if ((e.keyCode == 13 && e.ctrlKey) || (e.which == 109 && e.ctrlKey)) | ||
{ | { | ||
| വരി 718: | വരി 1,073: | ||
return false; | return false; | ||
} | } | ||
else if ((e.keyCode >= 3328 && e.keyCode <= 3455) || (e.which >= 3328 && e.which <= 3455)) { | else if ((e.keyCode >= 3328 && e.keyCode <= 3455) || (e.which >= 3328 && e.which <= 3455)) { | ||
var chk = document.getElementById('realtime'); | var chk = document.getElementById('realtime'); | ||
| വരി 732: | വരി 1,087: | ||
} | } | ||
} | } | ||
else if (realTime) { | else if (realTime) { | ||
imeStatus = false; | imeStatus = false; | ||
| വരി 740: | വരി 1,095: | ||
} | } | ||
var realTime=false; | var realTime=false; | ||
function rtClick(event) { | function rtClick(event) { | ||
realTime = !realTime; | realTime = !realTime; | ||
lija_setCookie('mlWikiTranslit',realTime,1);//save in cookie | lija_setCookie('mlWikiTranslit',realTime,1);//save in cookie | ||
} | } | ||
var rtsupported = false; | var rtsupported = false; | ||
var error; | var error; | ||
function checkrt(editform) { | function checkrt(editform) { | ||
try { | try { | ||
/* | /* | ||
var nav = navigator.userAgent.toUpperCase(); | var nav = navigator.userAgent.toUpperCase(); | ||
rtsupported = (nav.indexOf("GECKO") >= 0 || nav.indexOf("OPERA") >= 0 || nav.indexOf("SAFARI") >= 0); | rtsupported = (nav.indexOf("GECKO") >= 0 || nav.indexOf("OPERA") >= 0 || nav.indexOf("SAFARI") >= 0); | ||
*/ | */ | ||
rtsupported = (document.selection != undefined) | rtsupported = (document.selection != undefined) | ||
if (!rtsupported) { | if (!rtsupported) { | ||
var element = document.createElement("TEXTAREA"); | var element = document.createElement("TEXTAREA"); | ||
editform.appendChild(element); | editform.appendChild(element); | ||
if (element.selectionStart != undefined) | if (element.selectionStart != undefined) | ||
rtsupported = true; | rtsupported = true; | ||
editform.removeChild(element); | editform.removeChild(element); | ||
} | } | ||
} catch (error) {} | } catch (error) {} | ||
} | } | ||
//************************************ | //************************************ | ||
// ട്രാന്സ്ലിറ്ററേഷന് സ്ക്രിപ്റ്റില് കൂക്കി സപ്പോര്ട്ട് ചേര്ക്കാനുള്ള ശ്രമം | // ട്രാന്സ്ലിറ്ററേഷന് സ്ക്രിപ്റ്റില് കൂക്കി സപ്പോര്ട്ട് ചേര്ക്കാനുള്ള ശ്രമം | ||
function lija_getCookie(cookieName) | function lija_getCookie(cookieName) | ||
{ | { | ||
| വരി 789: | വരി 1,144: | ||
return ""; | return ""; | ||
} | } | ||
function lija_setCookie(cookieName,value,expiredays) | function lija_setCookie(cookieName,value,expiredays) | ||
{ | { | ||
| വരി 797: | വരി 1,152: | ||
((expiredays==null) ? "" : "; expires="+exdate.toGMTString()); | ((expiredays==null) ? "" : "; expires="+exdate.toGMTString()); | ||
} | } | ||
//************************************ | //************************************ | ||
// add this line to your monobook.js to disable in-built transliteration - thanks to Sadik Khalid for this quick tip | // add this line to your monobook.js to disable in-built transliteration - thanks to Sadik Khalid for this quick tip | ||
// var userIMEEnabled = false; // paste this line to user monobook.js and remove // from the begining of this line | // var userIMEEnabled = false; // paste this line to user monobook.js and remove // from the begining of this line | ||
// check for user preference and load in-built transliteration tool | // check for user preference and load in-built transliteration tool | ||
if(typeof(window.userIMEEnabled) == 'undefined') { addLoadEvent(addTextEvent); } | if(typeof(window.userIMEEnabled) == 'undefined') { addLoadEvent(addTextEvent); } | ||
| വരി 809: | വരി 1,164: | ||
</pre></nowiki> | </pre></nowiki> | ||
*/ | */ | ||
/* | /* | ||
==addLoadEvent== | ==addLoadEvent== | ||
| വരി 817: | വരി 1,172: | ||
addOnloadHook( func ); | addOnloadHook( func ); | ||
} | } | ||
/* </pre> */ | /* </pre> */ | ||
/* | /* | ||
== Dynamic Navigation Bars (experimental) == | == Dynamic Navigation Bars (experimental) == | ||
| വരി 829: | വരി 1,184: | ||
// set up the words in your language | // set up the words in your language | ||
var NavigationBarHide = '[ | var NavigationBarHide = '[മറയ്ക്കുക]'; | ||
var NavigationBarShow = '[പ്രദര്ശിപ്പിക്കുക]'; | var NavigationBarShow = '[പ്രദര്ശിപ്പിക്കുക]'; | ||
| വരി 838: | വരി 1,193: | ||
var NavigationBarShowDefault = 1; | var NavigationBarShowDefault = 1; | ||
//Honor the User Preferences | //Honor the User Preferences | ||
if ( getCookie(' | if ( getCookie('WikipediaPreferencesShowNav') != 'true' ) { | ||
NavigationBarShowDefault = 0; | NavigationBarShowDefault = 0; | ||
} else { | } else { | ||
| വരി 844: | വരി 1,199: | ||
} | } | ||
/* </pre> */ | /* </pre> */ | ||
/* | /* | ||
=== toggleNavigationBar ===* | === toggleNavigationBar ===* | ||
| വരി 895: | വരി 1,250: | ||
} | } | ||
/* </pre> */ | /* </pre> */ | ||
/* | /* | ||
=== createNavigationBarToggleButton === | === createNavigationBarToggleButton === | ||
| വരി 918: | വരി 1,273: | ||
NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar); | NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar); | ||
NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');'); | NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');'); | ||
var NavToggleText = document.createTextNode(NavigationBarHide); | var NavToggleText = document.createTextNode(NavigationBarHide); | ||
NavToggle.appendChild(NavToggleText); | NavToggle.appendChild(NavToggleText); | ||
| വരി 952: | വരി 1,307: | ||
// ====================== | // ====================== | ||
/* </pre> */ | /* </pre> */ | ||
/* | /* | ||
==Cookies== | ==Cookies== | ||
| വരി 971: | വരി 1,326: | ||
+ ";expires="+expire.toGMTString(); | + ";expires="+expire.toGMTString(); | ||
} | } | ||
function getCookie(cookieName) { | function getCookie(cookieName) { | ||
var start = document.cookie.indexOf( cookieName + "=" ); | var start = document.cookie.indexOf( cookieName + "=" ); | ||
| വരി 985: | വരി 1,340: | ||
return unescape( document.cookie.substring( len, end ) ); | return unescape( document.cookie.substring( len, end ) ); | ||
} | } | ||
function deleteCookie(cookieName) { | function deleteCookie(cookieName) { | ||
if ( getCookie(cookieName) ) { | if ( getCookie(cookieName) ) { | ||
| വരി 995: | വരി 1,350: | ||
} | } | ||
/* </pre> */ | /* </pre> */ | ||
/* | /* | ||
== Interproject links == | == Interproject links == | ||
| വരി 1,003: | വരി 1,358: | ||
var elements = new Array(); | var elements = new Array(); | ||
var spans = document.getElementsByTagName('span'); | var spans = document.getElementsByTagName('span'); | ||
// filter for projectlinks | // filter for projectlinks | ||
for (var i=0, j=0; i<spans.length; i++) { | for (var i=0, j=0; i<spans.length; i++) { | ||
| വരി 1,011: | വരി 1,366: | ||
} | } | ||
} | } | ||
if (j) { | if (j) { | ||
// create navbox | // create navbox | ||
| വരി 1,021: | വരി 1,376: | ||
plbox.setAttribute('style','margin-top:0.7em;'); | plbox.setAttribute('style','margin-top:0.7em;'); | ||
var pllist = document.createElement('ul'); | var pllist = document.createElement('ul'); | ||
// append | // append | ||
for (var i=0; i<elements.length; i++) { | for (var i=0; i<elements.length; i++) { | ||
| വരി 1,033: | വരി 1,388: | ||
} | } | ||
} | } | ||
addLoadEvent(Projectlinks); | addLoadEvent(Projectlinks); | ||
/* </pre> */ | /* </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>ലത്തീന്</option>"; | |||
menu += "<option>ഐ.പി.എ.</option>"; | |||
menu += "<option>പലവക</option>"; | |||
menu += "<option>അറബി</option>"; | |||
menu += "<option>ദേവനാഗരി</option>"; | |||
menu += "<option>ഹിബ്രു</option>"; | |||
menu += "<option>പഴയ ഇംഗ്ലീഷ്</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> */ | |||
/* | |||
== customizeWikipedia == | |||
<pre> */ | |||
function customizeWikipedia() { | |||
addCharSubsetMenu(); | |||
} | |||
addLoadEvent(customizeWikipedia); | |||
/* </pre> */ | |||
/*HERE STARTS THE WORKING-CODE OF "METABOXES"*/ | |||
/* Funcionament de la Plantilla:Metacaixa | |||
Implementat per: Usuari:Peleguer. | |||
Actualitzat per Joanjoc seguint les indicacions d'en Martorell | |||
*/ | |||
function MetaCaixaInit(){ | |||
//S'executa al carregar-se la pàgina, si hi ha metacaixes, | |||
// s'assignen els esdeveniments als botons | |||
//alert("MetaCaixaInit"); | |||
var i=0 //Inicialitzem comptador de caixes | |||
for (i=0;i<=9;i++){ | |||
var vMc = document.getElementById("mc"+i); | |||
if (!vMc) break; | |||
//alert("MetaCaixaInit, trobada Metacaixa mc"+i); | |||
var j=1 //Inicialitzem comptador de botons dins de la caixa | |||
var vPsIni = 0 //Pestanya visible inicial | |||
for (j=1;j<=9;j++){ | |||
var vBt = document.getElementById("mc"+i+"bt"+j); | |||
if (!vBt) break; | |||
//alert("MetaCaixaInit, trobat botó mc"+i+"bt"+j); | |||
vBt.onclick = MetaCaixaMostraPestanya; //A cada botó assignem l'esdeveniment onclick | |||
//alert (vBt.className); | |||
if (vBt.className=="mcBotoSel") vPsIni=j; //Si tenim un botó seleccionat, en guardem l'index | |||
} | |||
//alert ("mc="+i+", ps="+j+", psini="+vPsIni ); | |||
if (vPsIni == 0) { //Si no tenim cap botó seleccionat, n'agafem un aleatòriament | |||
vPsIni = 1+Math.floor((j-1)*Math.random()) ; | |||
//alert ("Activant Pestanya a l'atzar; _mc"+i+"bt"+vPsIni +"_"); | |||
document.getElementById("mc"+i+"ps"+vPsIni).style.display = "block"; | |||
document.getElementById("mc"+i+"ps"+vPsIni).style.visibility = "visible"; | |||
document.getElementById("mc"+i+"bt"+vPsIni).className="mcBotoSel"; | |||
} | |||
} | |||
} | |||
function MetaCaixaMostraPestanya(){ | |||
//S'executa al clicar una pestanya, | |||
//aquella es fa visible i les altres s'oculten | |||
var vMcNom = this.id.substr(0,3); //A partir del nom del botó, deduïm el nom de la caixa | |||
var vIndex = this.id.substr(5,1); //I l'index | |||
var i=1 | |||
for (i=1;i<=9;i++){ //busquem totes les pestanyes d'aquella caixa | |||
//alert(vMcNom+"ps"+i); | |||
var vPsElem = document.getElementById(vMcNom+"ps"+i); | |||
if (!vPsElem) break; | |||
if (vIndex==i){ //Si és la pestanya bona la mostrem i canviem la classe de botó | |||
vPsElem.style.display = "block"; | |||
vPsElem.style.visibility = "visible"; | |||
document.getElementById(vMcNom+"bt"+i).className="mcBotoSel"; | |||
} else { //Sinó, l'ocultem i canviem la classe de botó | |||
vPsElem.style.display = "none"; | |||
vPsElem.style.visibility = "hidden"; | |||
document.getElementById(vMcNom+"bt"+i).className="mcBoto"; | |||
} | |||
} | |||
return false; //evitem la recàrrega de la pàgina | |||
} | |||
addOnloadHook(MetaCaixaInit); | |||
/*HERE FINISHES THE WORKING-CODE OF "METABOXES"*/ | |||
/** WikiMiniAtlas ******************************************************* | |||
* | |||
* Description: WikiMiniAtlas is a popup click and drag world map. | |||
* This script causes all of our coordinate links to display the WikiMiniAtlas popup button. | |||
* The script itself is located on meta because it is used by many projects. | |||
* See [[Meta:WikiMiniAtlas]] for more information. | |||
* Maintainers: [[User:Dschwen]] | |||
*/ | |||
if (wgServer == "https://secure.wikimedia.org") { | |||
var metaBase = "https://secure.wikimedia.org/wikipedia/meta"; | |||
} else { | |||
var metaBase = "http://meta.wikimedia.org"; | |||
} | |||
importScriptURI(metaBase+"/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400") | |||
/** Collapsible tables ********************************************************* | |||
* | |||
* Description: Allows tables to be collapsed, showing only the header. See | |||
* [[Wikipedia:NavFrame]]. | |||
* Maintainers: [[User:R. Koot]] | |||
*/ | |||
var autoCollapse = 2; | |||
var collapseCaption = "മറയ്ക്കുക"; | |||
var expandCaption = "പ്രദര്ശിപ്പിക്കുക"; | |||
function collapseTable( tableIndex ) | |||
{ | |||
var Button = document.getElementById( "collapseButton" + tableIndex ); | |||
var Table = document.getElementById( "collapsibleTable" + tableIndex ); | |||
if ( !Table || !Button ) { | |||
return false; | |||
} | |||
var Rows = Table.rows; | |||
if ( Button.firstChild.data == collapseCaption ) { | |||
for ( var i = 1; i < Rows.length; i++ ) { | |||
Rows[i].style.display = "none"; | |||
} | |||
Button.firstChild.data = expandCaption; | |||
} else { | |||
for ( var i = 1; i < Rows.length; i++ ) { | |||
Rows[i].style.display = Rows[0].style.display; | |||
} | |||
Button.firstChild.data = collapseCaption; | |||
} | |||
} | |||
function createCollapseButtons() | |||
{ | |||
var tableIndex = 0; | |||
var NavigationBoxes = new Object(); | |||
var Tables = document.getElementsByTagName( "table" ); | |||
for ( var i = 0; i < Tables.length; i++ ) { | |||
if ( hasClass( Tables[i], "collapsible" ) ) { | |||
/* only add button and increment count if there is a header row to work with */ | |||
var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0]; | |||
if (!HeaderRow) continue; | |||
var Header = HeaderRow.getElementsByTagName( "th" )[0]; | |||
if (!Header) continue; | |||
NavigationBoxes[ tableIndex ] = Tables[i]; | |||
Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex ); | |||
var Button = document.createElement( "span" ); | |||
var ButtonLink = document.createElement( "a" ); | |||
var ButtonText = document.createTextNode( collapseCaption ); | |||
Button.className = "collapseButton"; //Styles are declared in Common.css | |||
ButtonLink.style.color = Header.style.color; | |||
ButtonLink.setAttribute( "id", "collapseButton" + tableIndex ); | |||
ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" ); | |||
ButtonLink.appendChild( ButtonText ); | |||
Button.appendChild( document.createTextNode( "[" ) ); | |||
Button.appendChild( ButtonLink ); | |||
Button.appendChild( document.createTextNode( "]" ) ); | |||
Header.insertBefore( Button, Header.childNodes[0] ); | |||
tableIndex++; | |||
} | |||
} | |||
for ( var i = 0; i < tableIndex; i++ ) { | |||
if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) { | |||
collapseTable( i ); | |||
} | |||
else if ( hasClass( NavigationBoxes[i], "innercollapse" ) ) { | |||
var element = NavigationBoxes[i]; | |||
while (element = element.parentNode) { | |||
if ( hasClass( element, "outercollapse" ) ) { | |||
collapseTable ( i ); | |||
break; | |||
} | |||
} | |||
} | |||
} | |||
} | |||
addOnloadHook( createCollapseButtons ); | |||
var hasClass = (function () { | |||
var reCache = {}; | |||
return function (element, className) { | |||
return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className); | |||
}; | |||
})(); | |||
"http://ml.wikipedia.org/wiki/%E0%B4%AE%E0%B5%80%E0%B4%A1%E0%B4%BF%E0%B4%AF%E0%B4%B5%E0%B4%BF%E0%B4%95%E0%B5%8D%E0%B4%95%E0%B4%BF:Common.js" എന്ന താളില്നിന്നു ശേഖരിച്ചത് | |||
താളിന്റെ അനുബന്ധങ്ങള് | |||
* സന്ദേശം | |||
* സംവാദം | |||
* മൂലരൂപം കാണുക | |||
* നാള്വഴി | |||
സ്വകാര്യതാളുകള് | |||
* ബീറ്റ പരീക്ഷിക്കുക | |||
* പ്രവേശിക്കുക / അംഗത്വമെടുക്കുക | |||
ഉള്ളടക്കം | |||
* പ്രധാന താള് | |||
* പുതിയ മാറ്റങ്ങള് | |||
* പുതിയ താളുകള് | |||
* സമകാലികം | |||
* ഏതെങ്കിലും ലേഖനം | |||
* ലേഖനം തുടങ്ങുക | |||
തിരയൂ | |||
മലയാളത്തിലെഴുതുക | |||
പങ്കാളിത്തം | |||
* സാമൂഹ്യകവാടം | |||
* കവാടം | |||
* പഞ്ചായത്ത് | |||
* Embassy | |||
* ധനസമാഹരണം | |||
വഴികാട്ടി | |||
* സഹായം | |||
* എഴുത്തുകളരി | |||
* ശൈലീപുസ്തകം | |||
* നയങ്ങളും മാര്ഗ്ഗരേഖകളും | |||
ആശയവിനിമയം | |||
* തല്സമയസംവാദം | |||
പണിസഞ്ചി | |||
* അനുബന്ധകണ്ണികള് | |||
* അനുബന്ധ മാറ്റങ്ങള് | |||
* അപ്ലോഡ് | |||
* പ്രത്യേക താളുകള് | |||
* അച്ചടിരൂപം | |||
* സ്ഥിരംകണ്ണി | |||
Powered by MediaWiki | |||
Wikimedia Foundation | |||
* ഈ താള് അവസാനം തിരുത്തപ്പെട്ടത് 07:37, 22 ഒക്ടോബര് 2009. | |||
* ഈ താള് ക്രിയേറ്റീവ് കോമണ്സ് ആട്രിബ്യൂഷന്/ഷെയര്-എലൈക്ക് പകര്പ്പവകാശ നിയമത്തിനു കീഴില് ലഭ്യമാണ്. കൂടുതല് നിബന്ധനകള് ചിലപ്പോള് ഉണ്ടാവാം. കൂടുതല് വിവരങ്ങള്ക്ക് നിബന്ധനാ പ്രമാണം കാണുക. | |||
* സ്വകാര്യതാനയം | |||
* വിക്കിപീഡിയ സംരംഭത്തെക്കുറിച്ച് | |||
* നിരാകരണങ്ങള് | |||