FAQ Search Language Filter

Filters out any unwanted languages when searching the FAQ.

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         FAQ Search Language Filter
// @namespace    pxgamer
// @version      0.2
// @description  Filters out any unwanted languages when searching the FAQ.
// @author       pxgamer
// @include      *kat.cr/faq/search*
// @grant        none
// ==/UserScript==
/*jshint multistr: true */

(function() {
    'use strict';

    // Set languages you want to keep
    var langs = [
        "", // MUST KEEP THIS ONE...
        "en"/*,
        "br",
        "de",
        "es",
        "ar",
        "ka",
        "lt"
        */
    ];
    $('ul.textcontent.questionList li').hide();
    $('ul.textcontent.questionList li a').each(function(){
        var url_lang = $(this).attr('href').split('/')[4];
        for (var i = 0; i < langs.length; i++) {
            if (url_lang == langs[i]) {
                $(this).parent().show();
            }
        }
    });
})();