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.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Fix Games Workshop Image viewer
// @namespace    http://your.homepage/
// @version      0.1
// @description  I am sick of their stupid magnifying glass so just wrote a horribly ugly fix to put the big images in by default.
// @author       You
// @match        http://www.games-workshop.com/*
// @grant        snone
// ==/UserScript==
$('#hero-slot').css(
    {
        width: $(document).width(),
        textAlign: 'center'
    }
);
$('.img-holder').css(
    {
        width: 920,
        textAlign: 'center'
    }
);

$('.als-wrapper').on('click', '.als-item', function(ev){
    var imgSrc = $(this).find('img').attr('src'),
        imgSizePos = imgSrc.indexOf('70x70'),
        imgNewSrc = imgSrc.replace('70x70', '920x950');

    $('.img-holder img').attr('src', imgNewSrc);
    ev.stopPropagation();
    return false;
});