Filter Requests by Category

Adds a dropdown to filter the requests search by category.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Filter Requests by Category
// @namespace    pxgamer
// @version      0.3
// @description  Adds a dropdown to filter the requests search by category.
// @author       pxgamer
// @include      *kat.cr/request/search/*
// @grant        GM_setValue
// @grant        GM_getValue
// ==/UserScript==

(function() {
    'use strict';

    // Allows you to save your last used value over tabs.
    var saveVal = false;

    $('.buttonsline.floatleft').append(' <select class="sortReqsOpt" style="vertical-align: middle;letter-spacing: 0px; width: 160px !important;"><option value="All">All</option><option value="Movies">Movies</option><option value="TV">TV</option><option value="Music">Music</option><option value="Games">Games</option><option value="Applications">Applications</option><option value="Books">Books</option><option value="Anime">Anime</option><option value="Other">Other</option><option value="XXX">XXX</option><option value="Unassigned">Unassigned</option></select> <button class="siteButton bigButton sortReqs">Filter</button>');

    $('.sortReqs').on('click', function() {
        $('.request-item.ideaBox').show();
        GM_setValue('filterReqType', $('.sortReqsOpt').val());
        if ($('.sortReqsOpt').val() != 'All') {
            $('h6.lightgrey a[href^="/request/popular/"]').each(function() {
                if ($(this).text() != $('.sortReqsOpt').val()) {
                    $(this).parent().parent().parent().hide();
                }
            });
        }
    });

    if (saveVal) {
        var fType = GM_getValue('filterReqType', 'All');
        $('.request-item.ideaBox').show();
        if (fType != 'All') {
            $('h6.lightgrey a[href^="/request/popular/"]').each(function() {
                if ($(this).text() != fType) {
                    $(this).parent().parent().parent().hide();
                }
            });
        }
    }
})();