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: | ||
− | + | // <pre><nowiki> | |
// addPurge | // addPurge | ||
addOnloadHook(function () { | 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'); | |
− | + | }); | |
+ | |||
+ | // </nowiki></pre> |
Revision as of 01:05, 18 May 2012
// <pre><nowiki> // 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'); }); // </nowiki></pre>