MTurkForum.com Plus

Style tweaks and keyboard shortcuts for MTurkForum.com

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==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;
            }
        }
    });
});