Gebruiker:Rots61/common.js: verschil tussen versies
Naar navigatie springen
Naar zoeken springen
Label: Ongedaan maken |
|||
Regel 22: | Regel 22: | ||
if (isMainPage) |
if (isMainPage) |
||
{window.location="https://wikikids.nl/";} |
{window.location="https://wikikids.nl/";} |
||
+ | |||
+ | |||
+ | // Verander tekst in tekstveld |
||
+ | |||
+ | function fixClear() { |
||
+ | var text = document.editform.wpTextbox1.value; |
||
+ | text = text.replace(/[ ]{2,}, '$1 '); |
||
+ | document.editform.wpTextbox1.value = text; |
||
+ | } |
||
+ | |||
+ | mw.loader.using( 'mediawiki.util', function () { |
||
+ | |||
+ | // Wait for the page to be parsed |
||
+ | $( document ).ready( function () { |
||
+ | |||
+ | if (document.editform) { |
||
+ | var link = mw.util.addPortletLink("p-tb", "#", "Clear", "tb-clear", "Verander kleine foutjes. ", ""); |
||
+ | $( link ).click( function ( event ) { |
||
+ | event.preventDefault(); |
||
+ | fixClear(); |
||
+ | |||
+ | } ); |
||
+ | } |
||
+ | } ); |
||
+ | } ); |
Versie van 15 nov 2022 22:01
mw.loader.using('mediawiki.util', function() {
mw.util.addPortletLink('p-tb',
'https://nl.wikipedia.org/wiki/' + encodeURIComponent(mw.config.get('wgPageName')),
'Wikipedia ', '#wikipedialink', mw.config.get('wgPageName') + " op Wikipedia ");
});
mw.loader.using('mediawiki.util', function() {
mw.util.addPortletLink('p-tb',
'https://www.google.nl/search?q=' + encodeURIComponent(mw.config.get('wgPageName')),
'Google ', '#googlelink', mw.config.get('wgPageName') + " op Google ");
});
mw.loader.using('mediawiki.util', function() {
mw.util.addPortletLink('p-tb',
'https://wikikids.nl/Speciaal:AllePaginas?hideredirects=1&from=' + encodeURIComponent(mw.config.get('wgPageName')),
'Alles ', '#alles', " alles");
});
// Redirecten
var mpTitle = "Wikikids:Visuele tekstverwerker";
var isMainPage = wgPageName == mpTitle
if (isMainPage)
{window.location="https://wikikids.nl/";}
// Verander tekst in tekstveld
function fixClear() {
var text = document.editform.wpTextbox1.value;
text = text.replace(/[ ]{2,}, '$1 ');
document.editform.wpTextbox1.value = text;
}
mw.loader.using( 'mediawiki.util', function () {
// Wait for the page to be parsed
$( document ).ready( function () {
if (document.editform) {
var link = mw.util.addPortletLink("p-tb", "#", "Clear", "tb-clear", "Verander kleine foutjes. ", "");
$( link ).click( function ( event ) {
event.preventDefault();
fixClear();
} );
}
} );
} );