User:Magikarp(en)/monobook.js: Difference between revisions

m
Blanked the page
(Created page with "→‎清除當前頁片緩存: if ( wgUserName ) { mw.util.addPortletLink('p-personal', '#', '清除圖片緩存', 'pt-purgeimg', '', null, '#pt-preferences'); $('#p-p...")
 
m (Blanked the page)
 
Line 1: Line 1:
/* 清除當前頁片緩存 */
 
if ( wgUserName ) {
    mw.util.addPortletLink('p-personal', '#', '清除圖片緩存', 'pt-purgeimg', '', null, '#pt-preferences');
    $('#p-personal').on('click', '#pt-purgeimg a', function(e){
        e.preventDefault();
        $('img[src^="http://static.52poke.com/wiki"]').each(function(i, img){
            var purge = new Image();
            purge.src = img.src.replace(/\.com\/wiki/, '.com/purge/wiki');
        });
        $('#pt-purgeimg a').text('已清除本頁的圖片緩存');
    });
}
95

edits