Apina.biz improved

Browse apina.biz with full-sized images. Plus other tweaks.

Stan na 03-08-2014. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        Apina.biz improved
// @namespace   Rennex/apina.biz
// @description Browse apina.biz with full-sized images. Plus other tweaks.
// @include     http://apina.biz/*
// @version     2.0
// @grant       none
// ==/UserScript==

// if we are in the image browsing mode, viewing a medium-sized image,
// this will find an element
var m, img, a = document.querySelector("#big_image a")
if (a) {
    if (m = a.href.match(/\/\d+[^\/]+$/)) {
        // fix the link to point directly to the image
        a.href = "http://termite.apcdn.com/full" + m[0]
        // and remove that annoying title popup while we're at it
        a.removeAttribute("title")

        // change the img element to use the full-sized image and appear wider
        img = a.querySelector("img")
        if (img) {
            img.src = a.href
            img.style = "max-width: 100%"
        } 
    }
    // also remove that ?ref=randoms bullshit from the address bar
    if (m = location.href.match(/apina\.biz\/(.+)\?ref=randoms/)) {
        history.replaceState(null, "", m[1])
    }
}
else if (m = location.href.match(/apina\.biz\/(\d+\.(jpg|gif|png))/)) {
    // we've somehow landed on the zoom-in page (from an external link?)
    // -> redirect to the picture
    location.replace("http://termite.apcdn.com/full/" + m[1])
}