Benutzer:Skelabra2509/common.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
K (vielleicht leiegts daran) |
(Das kommt aus meiner common.js aus der Wikipedia, vielen Dank an Schniggendiller und den Umherirrenden für den Code!) |
||
Zeile 23: | Zeile 23: | ||
var text = document.getElementById("searchInput").value; | var text = document.getElementById("searchInput").value; | ||
text = text.replace(/^[B]:/, "Benutzer:"); | text = text.replace(/^[B]:/, "Benutzer:"); | ||
text = text.replace(/^[B][ | text = text.replace(/^[B][Dd]:/, "Benutzer Diskussion:"); | ||
text = text.replace(/^[D]:/, "Datei:"); | text = text.replace(/^[D]:/, "Datei:"); | ||
text = text.replace(/^[D][ | text = text.replace(/^[D][Dd]:/, "Datei Diskussion:"); | ||
text = text.replace(/^[H]:/, "Hilfe:"); | text = text.replace(/^[H]:/, "Hilfe:"); | ||
text = text.replace(/^[H][ | text = text.replace(/^[H][Dd]:/, "Hilfe Diskussion:"); | ||
text = text.replace(/^[K]:/, "Kategorie:"); | text = text.replace(/^[K]:/, "Kategorie:"); | ||
text = text.replace(/^[K][ | text = text.replace(/^[K][Dd]:/, "Kategorie Diskussion:"); | ||
text = text.replace(/^[M][ | text = text.replace(/^[M][Ww]:/, "MediaWiki:"); | ||
text = text.replace(/^[M][ | text = text.replace(/^[M][Dd]:/, "MediaWiki Diskussion:"); | ||
text = text.replace(/^[P][ | text = text.replace(/^[P][Ww]:/, "PokéWiki:"); | ||
text = text.replace(/^[P][ | text = text.replace(/^[P][Dd]:/, "PokéWiki Diskussion:"); | ||
text = text.replace(/^[S]:/, "Spezial:"); | text = text.replace(/^[S]:/, "Spezial:"); | ||
text = text.replace(/^[D]:/, "Diskussion:"); | text = text.replace(/^[D]:/, "Diskussion:"); | ||
text = text.replace(/^[V]:/, "Vorlage:"); | text = text.replace(/^[V]:/, "Vorlage:"); | ||
text = text.replace(/^[V][ | text = text.replace(/^[V][Dd]:/, "Vorlage Diskussion:"); | ||
document.getElementById("searchInput").value = text; | document.getElementById("searchInput").value = text; | ||
} | } | ||
} | } | ||
///////////////////////// Werkzeugleiste ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
mw.loader.using( [ 'mediawiki.util' ], function() { $( function () { | |||
/* 'Logbücher Seite' */ | |||
if ( mw.config.get( 'wgNamespaceNumber' ) >= 0 ) { | |||
mw.util.addPortletLink( | |||
'p-tb', | |||
mw.util.getUrl( 'Special:Log', { 'page': mw.config.get( 'wgPageName' ) } ), | |||
'Logbücher-Seite', | |||
't-pagelog', | |||
'Logbücher-Seite', | |||
'l', | |||
'#t-contributions' | |||
); | |||
} | |||
} ) } ); | |||
/* Manipulation der Werkzeug-Box: Neuer Link „Präfixindex“ */ | |||
jQuery(document).ready(function() { | |||
mw.loader.using("mediawiki.util", | |||
function() { | |||
mw.util.addPortletLink("p-tb", | |||
"/w/index.php?title=Spezial:Präfixindex/" | |||
+ mw.util.wikiUrlencode(mw.config.get("wgPageName")), | |||
"Präfixindex", | |||
"t-prefix", | |||
"Präfixindex dieser Seite", | |||
"ß", | |||
"#t-pagelog", | |||
null); | |||
}); | |||
}); |
Version vom 31. März 2015, 19:09 Uhr
/*
######## Aus der Wikipedia übernommene Code für schnelles Ändern von Kategorien (HotCat) #####################
# #
#Man kann mit wenigen Klicks Kats hinzufügen, ändern oder entfernen. #
# #
############################################################################################################## */
window.hotcat_translations_from_commons = true;
//Lädt HotCat aus Commons
mw.loader.load( "//commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-HotCat.js&action=raw&ctype=text/javascript");
//Lädt das BKL-Helferlein - aber von hier.
mw.loader.load("//www.pokewiki.de/index.php?title=Benutzer:Skelabra2509/BKL-Check.js&action=raw&ctype=text/javascript&maxage=604800&*") ;
mw.loader.load("//www.pokewiki.de/index.php?title=Benutzer:Skelabra2509/BKL-Check.css&action=raw&ctype=text/css",
"text/css");
//Ersetzt Kurzlinks aus der Suche
var shortlinks = window.setInterval("replaceshortlinks()", 1000);
function replaceshortlinks()
{
if (Math.floor((document.getElementById("searchInput").value.indexOf(":")+1)/2) == 1) {
var text = document.getElementById("searchInput").value;
text = text.replace(/^[B]:/, "Benutzer:");
text = text.replace(/^[B][Dd]:/, "Benutzer Diskussion:");
text = text.replace(/^[D]:/, "Datei:");
text = text.replace(/^[D][Dd]:/, "Datei Diskussion:");
text = text.replace(/^[H]:/, "Hilfe:");
text = text.replace(/^[H][Dd]:/, "Hilfe Diskussion:");
text = text.replace(/^[K]:/, "Kategorie:");
text = text.replace(/^[K][Dd]:/, "Kategorie Diskussion:");
text = text.replace(/^[M][Ww]:/, "MediaWiki:");
text = text.replace(/^[M][Dd]:/, "MediaWiki Diskussion:");
text = text.replace(/^[P][Ww]:/, "PokéWiki:");
text = text.replace(/^[P][Dd]:/, "PokéWiki Diskussion:");
text = text.replace(/^[S]:/, "Spezial:");
text = text.replace(/^[D]:/, "Diskussion:");
text = text.replace(/^[V]:/, "Vorlage:");
text = text.replace(/^[V][Dd]:/, "Vorlage Diskussion:");
document.getElementById("searchInput").value = text;
}
}
///////////////////////// Werkzeugleiste /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
mw.loader.using( [ 'mediawiki.util' ], function() { $( function () {
/* 'Logbücher Seite' */
if ( mw.config.get( 'wgNamespaceNumber' ) >= 0 ) {
mw.util.addPortletLink(
'p-tb',
mw.util.getUrl( 'Special:Log', { 'page': mw.config.get( 'wgPageName' ) } ),
'Logbücher-Seite',
't-pagelog',
'Logbücher-Seite',
'l',
'#t-contributions'
);
}
} ) } );
/* Manipulation der Werkzeug-Box: Neuer Link „Präfixindex“ */
jQuery(document).ready(function() {
mw.loader.using("mediawiki.util",
function() {
mw.util.addPortletLink("p-tb",
"/w/index.php?title=Spezial:Präfixindex/"
+ mw.util.wikiUrlencode(mw.config.get("wgPageName")),
"Präfixindex",
"t-prefix",
"Präfixindex dieser Seite",
"ß",
"#t-pagelog",
null);
});
});