Verskil tussen weergawes van "Gebruiker:K175/Ruim skakels op"

geen wysigingsopsomming nie
 
<source lang="js">
javascript:!function(){var e=document.getElementById("wpTextbox1").value,t=e,n=$("#wpTextbox1"),s=e.match(/\[\[([^\]\|]+)\|([^\]\|]+)\]\]/gm);s&&(s.forEach(e=>{var n=e.split("|"),s=n[0].substring(2),l=n[1].substring(0,n[1].length-2),u=!1;if([" ","-",":"].forEach(e=>{s.indexOf(e)<0&&l.indexOf(e)>=0&&(u=!0)}),!u&&s.toLowerCase()==l.toLowerCase().substring(0,s.length)){var i=l.substring(s.length);if(-1==["-","'","ë"," "].indexOf(i.substring(0,1))){var a="[["+s+"|"+l+"]]",o="[["+l.substring(0,s.length)+"]]"+i;t=t.replace(a,o)}}}),t!=e&&(n.textSelection("setContents",t),document.getElementById("wpSummary").value="[[Gebruiker:K175/Ruim skakels op|Ruim skakels op]]",document.evaluate('//*[@id="wpDiff"]',document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue.click()))}();
(function() {
var originalText = document.getElementById('wpTextbox1').value;
var newText = originalText;
var $textbox = $( '#wpTextbox1' );
var links = originalText.match(/\[\[([^\]\|]+)\|([^\]\|]+)\]\]/gm);
if (links) {
links.forEach(link => {
var parts = link.split('|');
var part1 = parts[0].substring(2);
var part2 = parts[1].substring(0, parts[1].length-2);
var cancel = false;
 
[' ', '-', ':'].forEach(char => {
if (part1.indexOf(char) < 0 && part2.indexOf(char) >= 0) {
cancel = true;
}
});
 
if (cancel) {
return;
}
if (part1.toLowerCase() == part2.toLowerCase().substring(0, part1.length)) {
var suffix = part2.substring(part1.length);
if (['-', "'", 'ë', ' '].indexOf(suffix.substring(0, 1)) == -1) {
var old = '[[' + part1 + '|' + part2 + ']]';
var _new = '[[' + part2.substring(0, part1.length) + ']]' + suffix;
newText = newText.replace(old, _new);
}
};
});
 
if (newText != originalText) {
$textbox.textSelection( 'setContents', newText );
document.getElementById('wpSummary').value = '[[Gebruiker:K175/Ruim skakels op|Ruim skakels op]]';
document.evaluate('//*[@id="wpDiff"]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click();
}
}
})();
</source>