austindh / MTurk Worker ID paste

// ==UserScript==
// @name       MTurk Worker ID paste
// @namespace  http://use.i.E.your.homepage/
// @version    0.1
// @noframes
// @description  Give popup to copy MTurk Worker ID from
// @match      https://*/*
// @match      http://*/*
// @copyright  2012+, You
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==

	//Bind event for ctrl + m
	$( "html" ).on( "keydown", function( e ) {
        if ( e.ctrlKey && e.keyCode === 77 ) { //show popup on ctrl + m
            if ( $( ".mturk" ).is( ":visible" ) ) {
            	$( ".mturk" ).remove();
            } else {
                $( "body" ).prepend( popup() );
            }
            
        }
        else if ( e.ctrlKey && e.keyCode === 67 ) { //remove popup on ctrl + c
            window.setTimeout( function () {
            	$( ".mturk" ).remove();
            } ,10);
            
        }
    });

	//HTML for popup with MTurk Worker ID
	var popup = function () {
		return "<div class=\"mturk\">A310K524IJQ5X</div>";
    };
    
    //CSS for popup
    GM_addStyle('.mturk {position: fixed;z-index: 99999;padding: 10px;background-color: rgb(179, 185, 255);left: 50%;top: 50%;font-weight: bold;}');