torec subfilter

Add a text box above the subtitle list which allow one to filter the list.

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

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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==
// @id             torec-subfilter
// @name           torec subfilter
// @version        0.2
// @author         Rabin
// @description    Add a text box above the subtitle list which allow one to filter the list.
// @include        http://www.torec.net/sub.asp*
// @require        //code.jquery.com/jquery-1.10.2.js
// @run-at         document-end
// @namespace https://greasyfork.org/users/706
// ==/UserScript==

if(typeof $ == 'undefined'){ var $ = unsafeWindow.jQuery; }

$( "div[class='sub_dl']" ).prepend('<input id="subfilter" type="text"/>');

// new :<function> to for case insensitive filtering.
$.expr[':'].Contains = function(a,i,m){ return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase())>=0; };

$(document).ready(function() {  

    $("#subfilter").change( function () {
        var filter = $(this).val() ; 
        if (filter !== '') {
            $("#download_version").children().show();
            $("#download_version").find("option:not(:Contains("+filter+"))").hide();
        }
        else {
            $("#download_version").children().show();
        }
    }).keyup( function () {
    // fire the above change event after every letter
    $(this).change();
    });

});