Χρήστης:Dada/monobook.js
Μετάβαση στην πλοήγηση
Πήδηση στην αναζήτηση
Σημείωση: μετά την δημοσίευση, ίσως χρειαστεί να παρακάμψετε την προσωρινή μνήμη του προγράμματος περιήγησής σας για να δείτε τις αλλαγές.
- Firefox / Safari: Κρατήστε πατημένο το Shift κάνοντας ταυτόχρονα κλικ στο κουμπί Ανανέωση ή πιέστε Ctrl-F5 ή Ctrl-R (⌘-R σε Mac)
- Google Chrome: Πιέστε Ctrl-Shift-R (⌘-Shift-R σε Mac)
- Internet Explorer / Edge: Κρατήστε πατημένο το Ctrl κάνοντας ταυτόχρονα κλικ στο κουμπί Ανανέωση, ή πιέστε Ctrl-F5
- Opera: Πιέστε Ctrl-F5.
/*
__TOC__
==MediaWiki tooltips and access keys==
===Top row - user buttons===
<pre> */
ta = new Object();
ta['pt-userpage'] = new Array('.','My user page');
ta['pt-anonuserpage'] = new Array('.','The user page for the ip you\'re editing as');
ta['pt-mytalk'] = new Array('n','My talk page');
ta['pt-anontalk'] = new Array('n','Discussion about edits from this ip address');
ta['pt-preferences'] = new Array('','My preferences');
ta['pt-watchlist'] = new Array('l','The list of pages you\'re monitoring for changes.');
ta['pt-mycontris'] = new Array('y','List of my contributions');
ta['pt-login'] = new Array('o','You are encouraged to log in, it is not mandatory however.');
ta['pt-anonlogin'] = new Array('o','You are encouraged to log in, it is not mandatory however.');
ta['pt-logout'] = new Array('o','Log out');
/* </pre>
===Tabs===
<pre> */
ta['ca-talk'] = new Array('t','Discussion about the content page');
ta['ca-edit'] = new Array('e','You can edit this page. Please use the preview button before saving.');
ta['ca-addsection'] = new Array('+','Add a comment to this discussion.');
ta['ca-viewsource'] = new Array('e','This page is protected. You can view its source.');
ta['ca-history'] = new Array('h','Past versions of this page.');
ta['ca-protect'] = new Array('=','Protect this page');
ta['ca-delete'] = new Array('d','Delete this page');
ta['ca-undelete'] = new Array('d','Restore the edits done to this page before it was deleted');
ta['ca-move'] = new Array('m','Move this page');
ta['ca-nomove'] = new Array('','You don\'t have the permissions to move this page');
ta['ca-watch'] = new Array('w','Add this page to your watchlist');
ta['ca-unwatch'] = new Array('w','Remove this page from your watchlist');
/* </pre>
===Left column Navigation bar===
<pre> */
ta['search'] = new Array('f','Search this wiki');
ta['p-logo'] = new Array('','Main Page');
ta['n-mainpage'] = new Array('z','Visit the Main Page');
ta['n-portal'] = new Array('','About the project, what you can do, where to find things');
/* ta['n-currentevents'] = new Array('','Find background information on current events'); */
ta['n-requestedarticles'] = new Array('','See list of requested words');
ta['n-recentchanges'] = new Array('r','The list of recent changes in the wiki.');
ta['n-discussionrooms'] = new Array('','Find out where you can discuss various aspects of Wiktionary');
ta['n-randompage'] = new Array('x','Load a random page');
ta['n-help'] = new Array('','The place to find out.');
ta['n-sitesupport'] = new Array('','Support us');
/* </pre>
===Toolbar section===
<pre> */
ta['t-whatlinkshere'] = new Array('j','List of all wiki pages that link here');
ta['t-recentchangeslinked'] = new Array('k','Recent changes in pages linked from this page');
ta['feed-rss'] = new Array('','RSS feed for this page');
ta['feed-atom'] = new Array('','Atom feed for this page');
ta['t-contributions'] = new Array('','View the list of contributions of this user');
ta['t-emailuser'] = new Array('','Send a mail to this user');
ta['t-upload'] = new Array('u','Upload images or media files');
ta['t-specialpages'] = new Array('q','List of all special pages');
/* </pre>
===Misc unsorted messages===
<pre> */
ta['ca-nstab-project'] = new Array('c','View the project page');
ta['ca-nstab-main'] = new Array('c','View the content page');
ta['ca-nstab-user'] = new Array('c','View the user page');
ta['ca-nstab-media'] = new Array('c','View the media page');
ta['ca-nstab-special'] = new Array('','This is a special page, you can\'t edit the page itself.');
ta['ca-nstab-wp'] = new Array('a','View the project page');
ta['ca-nstab-image'] = new Array('c','View the image page');
ta['ca-nstab-mediawiki'] = new Array('c','View the system message');
ta['ca-nstab-template'] = new Array('c','View the template');
ta['ca-nstab-help'] = new Array('c','View the help page');
ta['ca-nstab-category'] = new Array('c','View the category page');
/* </pre>
=== Fonctions de gestion ===
<pre> */
/**
* Installation d'une nouvelle fonction de cette façon:
* aOnloadFunctions[aOnloadFunctions.length] = nom_de_la_fonction; // (sans parenthèses)
*/
if (!window.aOnloadFunctions) {
var aOnloadFunctions = new Array();
}
window.onload = function()
{
if (window.aOnloadFunctions) {
for (var _i=0; _i<aOnloadFunctions.length; _i++) {
aOnloadFunctions[_i]();
}
}
}
/**
/* </pre>
===addOnloadHook===
<pre> */
//use both names for it, for Wikipedia compatability (just in case)
function addOnloadHook(f) {
addLoadEvent(f);
}
/* </pre>
// ============================================================
// BEGIN Dynamic Navigation Bars (experimantal)
// 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;
// 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 != null;
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 != null;
NavChild = NavChild.nextSibling
) {
if (NavChild.className == 'NavPic') {
NavChild.style.display = 'block';
}
if (NavChild.className == 'NavContent') {
NavChild.style.display = 'block';
}
}
NavToggle.firstChild.data = NavigationBarHide;
}
}
// 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
// ============================================================
==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>
==doRedirect==
<pre> */
/* Redirect if a case-insensitive search on an external link is found */
function doRedirect() {
dym = document.getElementById('did-you-mean')
if ( dym ) {
if ( getCookie('WiktionaryDisableAutoRedirect') != 'true' ) {
var dymtarget = dym.firstChild.title ;
var target = dymtarget ;
pagetitle = document.getElementsByTagName('h1').item(0).firstChild.nodeValue;
if (pagetitle == target) {
alert('No looping allowed.');
return;
}
if ( pagetitle.toLowerCase().replace(/[^a-z]/g, "") != target.toLowerCase().replace(/[^a-z]/g, "") ) {
alert(target + " does not match " + pagetitle);
return;
}
if ( pagetitle.search(/Editing /g) != -1 ) return;
pagenamee = pagetitle.replace(/\ /g, "_");
document.location.replace( 'http://en.wiktionary.org/wiki/Special:Search/' + pagenamee ) ;
}
}
}
/* </pre>
==fixEditSectionWikifiedLinks==
<pre> */
// edit-section still doesn't return to correct spot if link contains a [[wikified]] term.
function fixEditSectionWikifiedLinks() {
if (/\.5B/.test(window.location.href)) {
var url=window.location.href.replace(/.5B.5B:/g,"").replace(/.5B/g, "").replace(/.5D/g, "");
window.location = url;
}
//#capiche_and_.7B.7Btemp.7Calternative_spelling_of.7D.7D
if (/\.7B\.7Btemp\.7C(.*?)\.7D\.7D/.test(window.location.href)) {
var url=window.location.href.replace(/\.7B\.7Btemp.7C/, ".7B.7B");
window.location = url;
}
}
/* </pre>
==Hide "Main Page" heading and several other elements on the Main Page==
<pre> */
var mpTitle = "Wiktionary:Main Page";
var isMainPage = (document.title.substr(0, document.title.lastIndexOf(" - ")) == mpTitle);
var isDiff = (document.location.search && (document.location.search.indexOf("diff=") != -1 || document.location.search.indexOf("oldid=") != -1));
if (isMainPage && !isDiff) document.write('<style type="text/css">/*<![CDATA[*/ #lastmod, #siteSub, #contentSub, h1.firstHeading { display: none !important; } /*]]>*/</style>');
/* </pre>
== User Preferences (experimental) ==
<pre> */
// [[User:Connel MacKenzie/custom.js]] - User preferences
document.write('<script type="text/javascript" src="/w/index.php?title=User:Connel_MacKenzie/custom.js&action=raw&ctype=text/javascript"><\/script>');
/* </pre>
== Wiktionary-specific tooltips ==
<pre> */
function wiktHeadingToolTips() {
}
// Disabled entirely, 1/5/2007 --~~~~
/*
// only add heading tooltips in the article namespace
// try again, to turn it off 1/19/2007 --~~~~
// if (document.getElementsByTagName('body')[0].className.match(/ns-0/)) {
if (false) {
// all level-2 headings are languages (or equivalents such as Translingual)
var allh2s = document.getElementById('bodyContent').getElementsByTagName('h2');
if (allh2s != -1) {
for (var i = 0; i < allh2s.length; i++) {
allh2s[i].title = 'The language this term belongs to';
}
}
// level 3, 4, and 5 headings depend on their content
var h345 = new Array('h3', 'h4', 'h5');
for (var j = 0; j < h345.length ; j++) {
var allh345s = document.getElementById('bodyContent').getElementsByTagName(h345[j]);
if (allh345s != -1) {
for (var i = 0; i < allh345s.length; i++) {
// part of speech
var ht = allh345s[i].innerHTML.replace(/^(?:\d+(?:\.\d+)* )?(.*)/, "$1");
var ht2 = ht;
if (ht.search(/editsection/) != -1) {
ht = ht.split('<span class="mw-headline">',i)[1];
if (!ht) ht = ht2.split(/<span class=mw-headline>/,i)[1];
if (!ht) ht = "";
ht = ht.split('</span>',i)[0];
}
if (ht == 'Adjective' || ht == 'Adverb' || ht == 'Conjunction' || ht == 'Interjection' || ht == 'Noun' || ht == 'Prefix' || ht == 'Preposition' || ht == 'Pronoun' || ht == 'Proper noun' || ht == 'Suffix' || ht == 'Verb' || ht == 'Verb form') {
allh345s[i].title = 'Part of speech or function of this term';
} else if (ht == 'Alternative spellings') {
allh345s[i].title = 'Other ways to spell this term in the same language';
} else if (ht == 'Anagrams') {
allh345s[i].title = 'Terms spelled with the same letters in a different order';
} else if (ht == 'Antonyms') {
allh345s[i].title = 'Terms with the opposite meaning in at least one sense';
} else if ( (ht == 'Etymology') || (ht == 'Etymology 1') || (ht == 'Etymology 2') || (ht == 'Etymology 3') || (ht == 'Etymology 4') ) {
allh345s[i].title = 'The origin of this term';
} else if (ht == 'Derived terms') {
allh345s[i].title = 'Terms which are derived through applying derivational suffixes etc.';
} else if (ht == 'Dictionary notes') {
allh345s[i].title = 'How other dictionaries treat this term';
} else if (ht == 'Homophones') {
allh345s[i].title = 'Terms with the same pronunciation as this term in at least one dialect or accent';
} else if (ht == 'Pronunciation') {
allh345s[i].title = 'How to pronounce this term, possibly in various dialects';
} else if (ht == 'References') {
allh345s[i].title = 'Links to external language authorities';
} else if (ht == 'Related terms') {
allh345s[i].title = 'Terms which are related etymologically other than simple derivations';
} else if (ht == 'See also') {
allh345s[i].title = 'Terms which have a semantic relationship but not an etymological one';
} else if (ht == 'Synonyms') {
allh345s[i].title = 'Terms with the same meaning in at least one sense';
} else if (ht == 'Translations') {
allh345s[i].title = 'Equivalent terms in other languages';
} else if (ht == 'Usage notes') {
allh345s[i].title = 'Things to keep in mind when using this term';
} else {
// default case - warn that it's nonstandard (or just not handled yet)
allh345s[i].title = '"' + ht + '" is not a standard Wiktionary heading';
}
}
}
}
}
}
*/
// end block disable
/* </pre>
==Statistics==
* Hook to use LeonWP's toolserver statistics generator
*
<pre> */
// ============================================================
// BEGIN pageview counter
// Please talk to de:User:LeonWeber before changing anything or
// if there are any issues with that.
// this should be adjusted to a good value.
// BE CAREFULL, you will break zedler if it's too low!
// And then DaB. will kill Leon :-(
var disable_counter = 0; // 0 = collect stats from anons, 1 = turn off entirely
var counter_factor = 40; //Wikipedias are ~600. Use Alexa for a WAG
function pgcounter_setup()
{
if( (disable_counter == 0) && (wgUserName == null) )
{
var url = window.location.href;
if(Math.floor(Math.random()*counter_factor)==4) // the probability thing
{
if(wgIsArticle==true) // do not count history pages etc.
{
var pgcountNs = wgCanonicalNamespace;
if(wgCanonicalNamespace=="")
{
pgcountNs = "0";
}
var cnt_url = "http://pgcount.wikimedia.de/index.png?ns=" + pgcountNs + "&title=" + encodeURI(wgTitle) + "&factor=" + counter_factor + "&wiki=enwiktionary";
var img = new Image();
img.src = cnt_url;
}
}
}
}
// Do not use aOnloadFunctions[aOnloadFunctions.length] = pgcounter_setup;, some browsers don't like that.
pgcounter_setup();
// END pageview counter
// ============================================================
/* </pre>
==customizeWiktionary==
<pre> */
/* do any Wiktionary-specific customizations */
function customizeWiktionary() {
doRedirect();
addCharSubsetMenu();
fixEditSectionWikifiedLinks();
wiktHeadingToolTips();
}
addLoadEvent(customizeWiktionary);
/* </pre>
=== Ειδικοί χαρακτήρες ===
<pre> */
/* add menu for selecting subsets of special characters */
/***** must match MediaWiki:Edittools) *****/
function addCharSubsetMenu() {
var specialchars = document.getElementById("specialchars");
if (specialchars) {
var menu = "<select 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 += "<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 += "<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 += "<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 += "<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>";
specialchars.innerHTML = menu + specialchars.innerHTML;
chooseCharSubset(0); // Standard-CharSubset
}
}
// CharSubset-Auswahl
function chooseCharSubset(s) {
var l = document.getElementById('specialchars').getElementsByTagName('p');
for (var i = 0; i < l.length ; i++) {
l[i].style.display = i == s ? 'inline' : 'none';
}
}
// Menü-Einfügung
function customizeWiktionary() {
addCharSubsetMenu();
}
hookEvent("load", customizeWiktionary);
//Γεμίζει τη μεταβλητή mwCustomEditButtons που προσθέτει κουμπιά στη μπάρα εργαλείων
function addCustomButton(imageFile, speedTip, tagOpen, tagClose, sampleText)
{
mwCustomEditButtons[mwCustomEditButtons.length] =
{"imageFile": imageFile,
"speedTip": speedTip,
"tagOpen": tagOpen,
"tagClose": tagClose,
"sampleText": sampleText};
}
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png','Διαγραφή','<s>','</s>','');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/8/88/Btn_toolbar_enum.png','Απαρίθμηση','\\n# στοιχείο 1\\n# στοιχείο 2\\n# στοιχείο 3','','');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/1/11/Btn_toolbar_liste.png','Λίστα','\\n* στοιχείο Α\\n* στοιχείο Β\\n* στοιχείο Γ','','');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/3/37/Btn_toolbar_commentaire.png','Σχόλιο','<!--','-->','Γράψτε το σχόλιό σας');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/c/c8/Button_redirect.png','Ανακατεύθυνση','#REDIRECT \[\[','\]\]','όνομα του στόχου');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/b/b4/Button_category03.png','Κατηγορία','\[\[Κατηγορία:','\]\]','όνομα της κατηγορίας');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/6/65/Button_petit.png','Μικρότερη γραφή','<small>','</small>','');
addCustomButton('http://upload.wikimedia.org/wikipedia/en/8/80/Button_upper_letter.png','Εκθέτης','<sup>','</sup>','');
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/4/4b/Button_nbsp.png','Αδιαχώριστο κενό',' \;','','');
//Ressemble à la fonction de /skins-1.5/commons/wikibits.js pour insérer un autre lien que insertTags
function marque_tab()
{
var toolbar = document.getElementById('toolbar');
if (!toolbar) return false;
var textbox = document.getElementById('wpTextbox1');
if (!textbox) return false;
if (!document.selection && textbox.selectionStart == null)
return false;
var image = document.createElement("img");
image.width = 23;
image.height = 22;
image.src = 'http://upload.wikimedia.org/wikipedia/commons/0/04/Button_array.png';
image.border = 0;
image.alt = 'Tableau';
image.title = 'Tableau';
image.style.cursor = "pointer";
image.onclick = function() {
popupTableau();
return false;
}
toolbar.appendChild(image);
}
$(marque_tab);
/*
</pre>
*/