tehchy / Volunteer Login Keyboard

// ==UserScript==
// @name         Volunteer Login Keyboard
// @namespace    http://tehchy.net/
// @version      0.3.1
// @author       Tehchy
// @description  Add Numpad Functionality
// @match        https://www.volgistics.com/ex/touch.dll/?FROM=151428&*
// @match        https://www.volgistics.com/ex/touch.dll/?ID=*
// @license      MIT
// @grant        none
// @history      Fixed Quick Select But disabled it for now
// ==/UserScript==

(function() {
    'use strict';
    var observer0 = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutationRecord) { if (document.getElementById('t7').style.display == "block") t7Go1(); });
    });
    observer0.observe(document.getElementById('t7'), { attributes : true, attributeFilter : ['style'] });
    var observer1 = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutationRecord) { if (document.getElementById('t12').style.display == "block") t12Go1(); });
    });
    observer1.observe(document.getElementById('t12'), { attributes : true, attributeFilter : ['style'] });
    var observer2 = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutationRecord) { if (document.getElementById('t14').style.display == "block") t14Go1(); });
    });
    observer2.observe(document.getElementById('t14'), { attributes : true, attributeFilter : ['style'] });


    $(document).keydown(function(e) {
        switch(e.which) {
            case 48: case 96://0
                Bp(0);
                break;
            case 49: case 97://1
                Bp(1);
                break;
            case 50: case 98://2
                Bp(2);
                break;
            case 51: case 99://3
                if (e.shiftKey) {
                    Bp('#');
                } else {
                    Bp(3);
                }
                break;
            case 52: case 100://4
                Bp(4);
                break;
            case 53: case 101://5
                Bp(5);
                break;
            case 54: case 102://6
                Bp(6);
                break;
            case 55: case 103://7
                Bp(7);
                break;
            case 56: case 104://8
                if (e.shiftKey) {
                    Bp('*');
                } else {
                    Bp(8);
                }
                break;
            case 57: case 105://9
                Bp(9);
                break;
            case 106://*
                Bp('*');
                break;
            case 13://enter
                if ($("#t2").css("display") == "block") {
                    t2Go1();
                }
                if ($("#t3").css("display") == "block") {
                    t3Go1();
                }
                if ($("#t4a").css("display") == "block") {
                    t4Go1();
                }
                if ($("#t8").css("display") == "block") {
                    t8aCallBack();
                }
                break;
            case 8://backspace
                if ($("#t2").css("display") == "block") {
                    Back();
                }
                if ($("#t3").css("display") == "block") {
                    t3Go1();
                }
                if ($("#t4a").css("display") == "block") {
                    t4Go2();
                }
                if ($("#t8").css("display") == "block") {
                    t8Go3();
                }
                break;
        }
    });
})();