reddit clickable linkflair

turns flairs to links that search the sub for threads with the same flair

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 clickable linkflair
// @namespace    https://greasyfork.org/en/users/36620
// @version      0.2
// @description  turns flairs to links that search the sub for threads with the same flair
// @author       scriptfairy
// @match        https://www.reddit.com/r/*
// @grant        none
// ==/UserScript==

(function($) {
    $('<style>').text('.linkflairlabel > a, .linkflairlabel > a:visited {color:inherit;}').appendTo($('head'));

    var flair, flairTitle, searchContent;
    var linkFlairs = $('.linkflairlabel');
    var sub = location.href;
    sub = sub.slice(0, sub.indexOf("/", sub.indexOf("/r/")+3));

    for (i = 0; i < linkFlairs.length; i++) {
        flair = linkFlairs[i];
        flairTitle = $(flair).attr('title');
        searchContent = encodeURIComponent("flair_text:'"+flairTitle+"'").replace(/%20/g, "+");
        $(flair).html('<a href="'+sub+'/search?q='+searchContent+'&restrict_sr=on">'+flairTitle+'</a>');
    }

})(window.jQuery);