Got a spare minute? The Archives need some love. See the to-do list to find a way to help.
If you upload a new image make sure you name and categorize it properly. If in doubt, ask an admin or see our FAQ page.

User:Magikarp(en)/common.js

From Bulbagarden Archives
Jump to navigationJump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* 清除當前頁片緩存 */
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('已清除本頁的圖片緩存');
    });
}