User:Technical 13/SandBox/∅ edit transcluded pages.js

Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/*
** Author: [[User:Technical 13]]
** 
** Description: This script adds a portletLink to null edit all pages that transclude a template to update template usage if dynamic value has been changed.
** Version .01
*/
// Get current template name
var templateName = mw.config.get( 'wgTitle' );

// Get list of pages transcluding current page with API and store in an array

// Break the array into an array of arrays consisting of 50 titles each

// Loop through the array and forceupdate link using
// mw.Api().post( { action: 'purge', forcelinkupdate: '', titles: [ array of titles ] } ).done( function() { ... } );
// where there is a list titles of all articles you want to purge at once, up to fifty at a time.

// mw.util.addPortletLink() to create the link to run the script (if last editor of current page?)