MediaWiki:Common.js: Verskil tussen weergawes

Content deleted Content added
Adriaan (Besprekings | bydraes)
k Weergawe 5031 deur Adriaan ongedaan gemaak (Bespreking).
Adriaan (Besprekings | bydraes)
kopieer vanaf Wikipedia
Lyn 1:
/* Any JavaScript here will be loaded for all users on every page load. */
function returnObjById( id )
{
Line 9 ⟶ 11:
return returnVar;
}
 
function insertTagsTo_(tagOpen, tagClose, sampleText, outputid) {
var txtarea = document.getElementById(outputid);
Line 63 ⟶ 65:
txtarea.caretPos = document.selection.createRange().duplicate();
}
 
/** Extra toolbar options ****************************************************** <nowiki>
*
Line 84 ⟶ 88:
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png",
"speedTip": "DeurstrokeDeurstreep teks",
"tagOpen": "<s>",
"tagClose": "</s>",
"sampleText": "DeurstrokeDeurstreep teks"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
Line 145 ⟶ 149:
"sampleText": "! hoof 1\n! hoof 2\n! hoof 3\n|-\n| ry 1, sel 1\n| ry 1, sel 2\n| ry 1, sel 3\n|-\n| ry 2, sel 1\n| ry 2, sel 2\n| ry 2, sel 3"};
}
 
//fix edit summary prompt for undo
//this code fixes the fact that the undo function combined with the "no edit summary prompter" causes problems if leaving the
//edit summary unchanged
//this was added by [[User:Deskana]], code by [[User:Tra]]
addOnloadHook(function () {
if (document.location.search.indexOf("undo=") != -1
&& document.getElementsByName('wpAutoSummary')[0]) {
document.getElementsByName('wpAutoSummary')[0].value='';
}
})
 
/*
== Small search keyboard ==
; Author: Maciej Jaros [[:pl:User:Nux]]
; Licence: CC-BY or [http://opensource.org/licenses/gpl-license.php GNU General Public License v2]
 
*/
if (wgNamespaceNumber == -1 && wgPageName=="Spesiaal:Search")
Line 190 ⟶ 184:
subEl.parentNode.insertBefore(newEl, subEl);
}
/** Interwiki links to featured articles ***************************************
*
* Description: Highlights interwiki links to featured articles (or
* equivalents) by changing the bullet before the interwiki link
* into a star.
* Maintainers: [[User:R. Koot]]
*/
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 = "Hierdie artikel geniet voorbladartikelstatus in 'n ander taal";
}
}
}
})
addOnloadHook(function ()LinkFA {);
/*
Déplacement des [modifier]
--------------------------
Correction des titres qui s'affichent mal en raison de limitations dues à MediaWiki.
Copyright 2006, Marc Mongenet. Licence GPL et GFDL.
The function looks for <span class="editsection">, and move them
at the end of their parent and display them inline in small font.
var oldEditsectionLinks=true disables the function.
*/
function setModifySectionStyle() {
try {
if (!(typeof oldEditsectionLinks == 'undefined' || oldEditsectionLinks == false)) return;
var spans = document.getElementsByTagName("span");
for (var s = 0; s < spans.length; ++s) {
var span = spans[s];
if (span.className == "editsection") {
span.style.fontSize = "xx-small";
span.style.fontWeight = "normal";
span.style.cssFloat = span.style.styleFloat = "none";
span.parentNode.appendChild(document.createTextNode(" "));
span.parentNode.appendChild(span);
}
}
} catch (e) { /* something went wrong */ }
}
addOnloadHook(setModifySectionStyle);