Gebruiker:Rots61/common.js: verschil tussen versies
Naar navigatie springen
Naar zoeken springen
(17 tussenliggende versies door dezelfde gebruiker niet weergegeven) | |||
Regel 1: | Regel 1: | ||
mw.loader.using('mediawiki.util', function() { |
mw.loader.using('mediawiki.util', function() { |
||
+ | if (!/(bewerken|geschiedenis|overleg|:)/g.test(firstHeading.innerHTML) && mw.config.get('wgNamespaceNumber') === 0 && mw.config.get('wgAction') === 'view') { |
||
+ | firstHeading.innerHTML = '<a href="https://wikikids.nl/index.php?search=' + firstHeading.innerHTML + '&title=Speciaal%3AZoeken&profile=default&fulltext=1">' + firstHeading.innerHTML + '</a>'; |
||
⚫ | |||
mw.util.addPortletLink('p-tb', |
mw.util.addPortletLink('p-tb', |
||
'https://nl.wikipedia.org/wiki/' + encodeURIComponent(mw.config.get('wgPageName')), |
'https://nl.wikipedia.org/wiki/' + encodeURIComponent(mw.config.get('wgPageName')), |
||
'Wikipedia ', '#wikipedialink', mw.config.get('wgPageName') + " op Wikipedia "); |
'Wikipedia ', '#wikipedialink', mw.config.get('wgPageName') + " op Wikipedia "); |
||
− | }); |
||
− | |||
− | mw.loader.using('mediawiki.util', function() { |
||
mw.util.addPortletLink('p-tb', |
mw.util.addPortletLink('p-tb', |
||
'https://www.google.nl/search?q=' + encodeURIComponent(mw.config.get('wgPageName')), |
'https://www.google.nl/search?q=' + encodeURIComponent(mw.config.get('wgPageName')), |
||
Regel 17: | Regel 17: | ||
$('#footer-info').before(beg); |
$('#footer-info').before(beg); |
||
} |
} |
||
− | |||
− | mw.loader.using(['site']).done(function() { |
||
− | if(document.getElementById("wpTextbox2")) { |
||
− | var myTextBox = document.getElementById('wpTextbox2'); |
||
− | var myText = myTextBox.value; |
||
− | |||
− | var a = new mw.Api(); |
||
− | |||
− | var ns = mw.config.get("wgCanonicalNamespace"); |
||
− | if (ns !== "") { |
||
− | ns = ns + ":"; |
||
− | } |
||
− | var title = mw.config.get("wgTitle"); |
||
− | var fulltitle = ns + title; |
||
− | |||
− | var currentUser = mw.config.get('wgUserName'); |
||
− | |||
− | var backupLocation = "User:" + currentUser + "/Editconflict/" + fulltitle; |
||
− | a.postWithToken("csrf",{ |
||
− | action:"edit", |
||
− | title:backupLocation, |
||
− | text:myText, |
||
− | tags:"edit_conflict", |
||
− | summary:"Automatically backing up edit conflict" |
||
− | }).done(function(data) { |
||
− | displayColor("gadget-action-success"); |
||
− | console.log('Done!'); |
||
− | return; |
||
− | }).fail(function(data) { |
||
− | displayColor("gadget-action-fail"); |
||
− | console.log('Failed to back up editing conflict oh no'); |
||
− | return; |
||
− | }); |
||
− | |||
⚫ | |||
− | }); |
||
− | |||
mw.loader.load('//wikikids.nl/index.php?title=Gebruiker:Rots61/Script-AddSpecial.js&action=raw&ctype=text/javascript'); |
mw.loader.load('//wikikids.nl/index.php?title=Gebruiker:Rots61/Script-AddSpecial.js&action=raw&ctype=text/javascript'); |
||
Regel 59: | Regel 22: | ||
mw.loader.load('//wikikids.nl/index.php?title=Gebruiker:Rots61/JS-DisamAssist.js&action=raw&ctype=text/javascript'); |
mw.loader.load('//wikikids.nl/index.php?title=Gebruiker:Rots61/JS-DisamAssist.js&action=raw&ctype=text/javascript'); |
||
mw.loader.load('//wikikids.nl/index.php?title=Gebruiker:Rots61/Gadget-LogTheCounter.js&action=raw&ctype=text/javascript'); |
mw.loader.load('//wikikids.nl/index.php?title=Gebruiker:Rots61/Gadget-LogTheCounter.js&action=raw&ctype=text/javascript'); |
||
− | |||
− | |||
if (document.getElementsByClassName('patrollink')[0]) { |
if (document.getElementsByClassName('patrollink')[0]) { |
Huidige versie van 27 jul 2024 om 12:55
mw.loader.using('mediawiki.util', function() {
if (!/(bewerken|geschiedenis|overleg|:)/g.test(firstHeading.innerHTML) && mw.config.get('wgNamespaceNumber') === 0 && mw.config.get('wgAction') === 'view') {
firstHeading.innerHTML = '<a href="https://wikikids.nl/index.php?search=' + firstHeading.innerHTML + '&title=Speciaal%3AZoeken&profile=default&fulltext=1">' + firstHeading.innerHTML + '</a>';
}
mw.util.addPortletLink('p-tb',
'https://nl.wikipedia.org/wiki/' + encodeURIComponent(mw.config.get('wgPageName')),
'Wikipedia ', '#wikipedialink', mw.config.get('wgPageName') + " op Wikipedia ");
mw.util.addPortletLink('p-tb',
'https://www.google.nl/search?q=' + encodeURIComponent(mw.config.get('wgPageName')),
'Google ', '#googlelink', mw.config.get('wgPageName') + " op Google ");
});
if (document.getElementById('beginnetje')) { //oranje: FF5733 //'blauw': #23819C
var beg = '<center><span style="color:gray">(Dit artikel is een beginnetje)</span></center>';
document.getElementById('beginnetje').style.display = "none";
$('#footer-info').before(beg);
}
mw.loader.load('//wikikids.nl/index.php?title=Gebruiker:Rots61/Script-AddSpecial.js&action=raw&ctype=text/javascript');
mw.loader.load('//wikikids.nl/index.php?title=Gebruiker:Rots61/GevraagdePaginas.js&action=raw&ctype=text/javascript');
mw.loader.load('//wikikids.nl/index.php?title=Gebruiker:Rots61/JS-DisamAssist.js&action=raw&ctype=text/javascript');
mw.loader.load('//wikikids.nl/index.php?title=Gebruiker:Rots61/Gadget-LogTheCounter.js&action=raw&ctype=text/javascript');
if (document.getElementsByClassName('patrollink')[0]) {
var rcid = document.getElementsByClassName('patrollink')[0].getElementsByTagName('a')[0].href.split("rcid=").pop();
mw.util.addPortletLink('p-namespaces',
'javascript:patrolR61(' + rcid + ')',
'Patrol ', 'ca-patrollinkr61', " Controleer " + mw.config.get('wgPageName'), 'a');
}
function patrolR61(rcid){
api.get({
action: 'query',
meta: 'tokens',
type: 'patrol',
}).done(
function (data) {
console.log(data);
edit_token = data.query.tokens.patroltoken;
}).done(function (data) {
api.post({
'action': 'patrol',
'rcid': rcid,
'token': edit_token,
}).done(
function (data) {
console.log(data);
mw.notify('Gecontroleerd');
document.getElementById('ca-patrollinkr61').innerHTML = '';
});
});
}