User:Plastikspork/fpurge.js

// Force Purge

//Allows URI to be properly decoded for view mode (see WP:AutoEd) function SporkPurge_QueryString(p) { var re = RegExp('[&?]' + p + '=([^&]*)'); var matches; if (matches = re.exec(document.location)) { try { return decodeURI(matches[1]); } catch (e) { } } return null; }

$(function { if( SporkPurge_QueryString('SporkPurge1') && document.forms.editform) {   document.forms.editform.wpSave.click; } if ( (mw.config.get('wgAction') == "view") && mw.config.get('wgIsArticle')) {   var url = mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=' + encodeURIComponent(mw.config.get('wgPageName')) + '&action=edit';   mw.util.addPortletLink('p-cactions', url + '&SporkPurge1=true', 'Purge', 'ca-sporkpurge', 'Purge', '', document.getElementById('ca-history')); } });