AnandTech Forums Jump

Add a Read link to the Ask The Community block, to jump to each forum.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey 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 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         AnandTech Forums Jump
// @namespace    https://sites.google.com/site/kenscode/
// @version      0.1
// @description  Add a Read link to the Ask The Community block, to jump to each forum.
// @author       Ken g6 (Ken Brazier)
// @match        https://forums.anandtech.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function changeReadLink() {
        var readlink = document.getElementById('askblockreadlink');
        var bselect = document.querySelector("form[data-xf-init*='future-quick-thread-widget draft'] select");
        var h = bselect.options[bselect.selectedIndex].dataset.actionUrl;
        h = h.substr(0, h.lastIndexOf('/')) + '/';
        readlink.href = h;
    }
    var bform = document.querySelector("form[data-xf-init*='future-quick-thread-widget draft']");
    if(bform != null) {
        var bselect = bform.querySelector("select");
        var bbgroup = bform.querySelector(".formButtonGroup");
        var readlink = document.createElement('a');
        readlink.innerHTML = '<span class="button-text">Read</span>';
        readlink.href = '#';
        readlink.className = 'button--primary button button--icon button--icon--search rippleButton';
        readlink.id = 'askblockreadlink';
        bbgroup.insertBefore(readlink, bbgroup.firstChild);
        changeReadLink();
        bselect.addEventListener("change", changeReadLink);
    }
})();