Reddit WebPreview

Webpage Preview like hoverzoom

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name       Reddit WebPreview
// @version    7.19.14
// @description  Webpage Preview like hoverzoom
// @match      *://www.reddit.com*/*
// @copyright  2014+,  Hans Strausl
// @namespace https://greasyfork.org/users/3445
// ==/UserScript==
var RWP_DEBUG = false;
var things, link, i, x, w, h, page, timeout = null;

function init(){
    setTimeout(function(){
        G("Reddit WebPreview Started");
        things = document.getElementsByClassName("thing link");
        for (i = 0; i < things.length; i++){
            link = things[i].getElementsByClassName("title may-blank")[0];
            link.onmouseover = function(e){
                if (!(this.className.search("hoverZoomLink") > -1)){
                    G(link);
                    
                    prvw(this, e.pageX);
                }
            };
        }
    }, 500);
}

window.onload = init();

function prvw(link, mouseX){
    timeout = setTimeout(function(){
        w = screen.width;
        h = screen.height - 200;
        x = (w / 2) - 150;
        G(w + " x " + h + " : " + x + " : " + (mouseX - 25));
        page = window.open(link.href,"","height=" + h + ",width=" + x + ",left=" + (mouseX - 25) + ",top=50");
    }, 500);
    link.onmouseout = function(e){
        clearTimeout(timeout);
        if (typeof page !== "undefined"){
            page.close();
        }
    };
    window.onbeforeunload = function(e){
        if (typeof page !== "undefined"){
            page.close();
        }
    }
}

function G(data){
    if (RWP_DEBUG === true){
        console.log(data);
    }
}