MTurkForum.com Plus

Style tweaks and keyboard shortcuts for MTurkForum.com

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name                MTurkForum.com Plus
// @author              Chet Manley
// @version             0.1
// @description         Style tweaks and keyboard shortcuts for MTurkForum.com
// @include             http://mturkforum.com/*
// @require				http://code.jquery.com/jquery-latest.min.js
// @namespace https://greasyfork.org/users/6438
// ==/UserScript==

// v0.1, 2013-08-20		Style tweaks and keyboard shortcuts on MTurkForum.com
//                      ---------------------------------------------------------------------------

$(document).ready(function () {
    $('body').attr('style', 'max-width: 90%;');
    $('a.quickreply').hide().next().hide();

    $(window).keyup(function (e) {
        if (!$('input, textarea').is(':focus')) {
            var key = (e.keyCode ? e.keyCode : e.which);
            switch (key) {
                case 37: // Left arrow - Previous page
                    if ($('span.prev_next a[rel="prev"]').attr('href')) {
                        window.location.href = $('span.prev_next a[rel="prev"]').attr('href');
                    }
                    break;
                case 39: // Right arrow - Next page
                    if ($('span.prev_next a[rel="next"]').attr('href')) {
                        window.location.href = $('span.prev_next a[rel="next"]').attr('href');
                    }
                    break;
                case 73: // I - Inbox
                    window.location.href = 'http://mturkforum.com/private.php';
                    break;
                case 82: // R - Start a reply
                    $('#vB_Editor_QR_textarea').focus();
                    break;
                case 83: // S - Settings
                    window.location.href = 'http://mturkforum.com/usercp.php';
                    break;
                default:
                    break;
            }
        }
    });
});