reddit r/pathofexile ggg filter

Allows you to filter comments by ggg employees on r/pathofexile

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         reddit r/pathofexile ggg filter
// @namespace    http://porath.org/
// @version      0.13
// @description  Allows you to filter comments by ggg employees on r/pathofexile
// @author       porath
// @include      *.reddit.com/r/pathofexile*
// @grant        none
// ==/UserScript==

$('.panestack-title').append('<a class="gggsort" style="color: red" href="">&nbsp;sort GGG comments to the top</span>');

$('.gggsort').on('click', function (e) {
    e.preventDefault();
    
    $('.entry > p > em').each(function () {
        $(this).siblings('.expand').click();
    });
    
    var GGGEmployees = ['chris_wilson', 'Bex_GGG', 'Negitivefrags', 'qarldev', 'BrianWeissman_GGG', 'Rory_Rackham', 'Omnitect', 'Mark_GGG', 'Daniel_GGG', 'Blake_GGG'];
    
    $('.entry > p > .author').each(function () {
        if (GGGEmployees.indexOf($(this).html()) !== -1) {
            $(this).closest('.nestedlisting').prepend($(this).parents('.nestedlisting > .thing'));
            
            $(this)[0].scrollIntoView();
            $('body').scrollTop($('body').scrollTop() - 30);
        }
    });
});