User:Technical 13/Scripts/OrphanStatus.js: Difference between revisions

Content deleted Content added
Technical 13 (talk | contribs)
according to the api response (which was a pain to get) seems I need to use article id instead of titles. so be it...
Technical 13 (talk | contribs)
It WORKS! Add a "reload" link and add a 2.5 timeout for automatic deOrphaning of pages with 3 or more links to.
Line 21:
token: mw.user.tokens.get( 'editToken' )
};
console.log("%O", deOrphanerSubmit);
$.when(
$.post(mw.config.get( 'wgScriptPath' )+"/api.php", deOrphanerSubmit, function(deOrphanerSesponse){
$(".loadinganimation").html("Article deOrphaning in progress..."); })
).done(function() {
$(".loadinganimation").html("Article deOrphaned! <small>(<a href="#reLoad" onClick="___location.reload();" style="font-weight: bold;">reload</a>)</small>");
});
});
Line 55 ⟶ 54:
default:
var blStatement = 'This page is not an <a href="//en.wikipedia.org/wiki/Wikipedia:Orphan" style="font-weight: bold;">orphan</a> as it meets the "Rule of Three" by having three or more links from <a href="//en.wikipedia.org/w/index.php?title=Special:WhatLinksHere/' + mw.config.get('wgTitle') + '&namespace=0&hideredirs=1&hidetrans=1" style="font-weight: bold;">other articles</a>.';
setTimeout(function(){deOrphan(backLinks);}, 2500);
break;
}