Fix Games Workshop Image viewer

I am sick of their stupid magnifying glass so just wrote a horribly ugly fix to put the big images in by default.

目前为 2015-03-21 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Fix Games Workshop Image viewer
  3. // @namespace http://your.homepage/
  4. // @version 0.1
  5. // @description I am sick of their stupid magnifying glass so just wrote a horribly ugly fix to put the big images in by default.
  6. // @author You
  7. // @match http://www.games-workshop.com/*
  8. // @grant snone
  9. // ==/UserScript==
  10. $('#hero-slot').css(
  11. {
  12. width: $(document).width(),
  13. textAlign: 'center'
  14. }
  15. );
  16. $('.img-holder').css(
  17. {
  18. width: 920,
  19. textAlign: 'center'
  20. }
  21. );
  22.  
  23. $('.als-wrapper').on('click', '.als-item', function(ev){
  24. var imgSrc = $(this).find('img').attr('src'),
  25. imgSizePos = imgSrc.indexOf('70x70'),
  26. imgNewSrc = imgSrc.replace('70x70', '920x950');
  27.  
  28. $('.img-holder img').attr('src', imgNewSrc);
  29. ev.stopPropagation();
  30. return false;
  31. });