AnandTech Forums Jump

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==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);
    }
})();