| You need to be logged into the wiki to be able to edit! To login or join the wiki, click here. |
Difference between revisions of "User:Leech/vector.js"
From Kiwiki
| Line 1: | Line 1: | ||
| − | // addPurge addOnloadHook(function () { | + | // addPurge |
| + | addOnloadHook(function () { | ||
| + | var hist; var url; | ||
| + | if (!(hist = document.getElementById('ca-history') )) return; | ||
| + | if (!(url = hist.getElementsByTagName('a')[0] )) return; | ||
| + | if (!(url = url.href )) return; | ||
| + | addPortletLink('p-cactions', url.replace(/([?&]action=)history([&#]|$)/, '$1purge$2'), | ||
| + | 'Purge', 'ca-purge', 'Purge server cache for this page', '0'); | ||
| + | }); // | ||
Revision as of 01:05, 18 May 2012
// addPurge
addOnloadHook(function () {
var hist; var url;
if (!(hist = document.getElementById('ca-history') )) return;
if (!(url = hist.getElementsByTagName('a')[0] )) return;
if (!(url = url.href )) return;
addPortletLink('p-cactions', url.replace(/([?&]action=)history([&#]|$)/, '$1purge$2'),
'Purge', 'ca-purge', 'Purge server cache for this page', '0');
}); //