// ==UserScript== // @name Hermes HIT exporter // @namespace mobiusevalon.tibbius.com // @version 2.7 // @author Mobius Evalon // @description Adds an Export button to MTurk HIT capsules to share HITs on forums, reddit, etc. // @license Creative Commons Attribution-ShareAlike 4.0; http://creativecommons.org/licenses/by-sa/4.0/ // @include /^https{0,1}:\/\/\w{0,}\.?mturk\.com\/mturk/ // @exclude /&hit_scraper$/ // @grant none // @downloadURL none // ==/UserScript== if(window.olympus === undefined) window.olympus = {}; olympus.hermes = { __name:"hermes", // properties _format:"", _template:"", tokens: {}, // methods __init:function() { console.log("hermes init"); olympus.style.add( ".hermes_export_button {height: 16px; font-size: 10px; font-weight: bold; border: 1px solid; margin-left: 5px; padding: 0px 5px; background-color: transparent;} "+ "#hermes_export_window {position: fixed; left: 15vw; top: 10vh; background-color: #a5ccdd; border: 2px solid #5c9ebf; border-radius: 10px;} "+ "#hermes_export_window textarea {width: 400px; height: 250px; margin: 0px auto; display: block;} "+ "#hermes_export_window h1 {margin: 10px 0px; padding: 0px; font-size: 150%; font-weight: bold; text-align: center;} "+ "#hermes_export_window input#hhe_completion_time {width: 40px; text-align: center; margin: 0px 5px;} "+ "#hermes_export_window button#hhe_close {display: block; margin: 10px auto; clear: both;} "+ "#hermes_export_window select#hhe_export_format {margin: 0px 5px;} "+ "#hermes_export_window div.hhe_options div.left {display: inline-block; float: left; text-align: left;} "+ "#hermes_export_window div.hhe_options div.right {display: inline-block; float: right; text-align: right;} "+ "#hermes_export_window button {font: inherit;} "+ ".noscroll {overflow: hidden;} " ); Date.prototype.toString = function() { return (""+this.getDate()+" "+this.getMonthString().slice(0,3)+" "+this.getFullYear()+", "+this.getTwoDigitUTCHours()+":"+this.getTwoDigitUTCMinutes()+"."+this.getTwoDigitUTCSeconds()+" UTC"); }; Date.prototype.getMonthString = function() { switch(this.getMonth()) { case 0: return "January"; case 1: return "February"; case 2: return "March"; case 3: return "April"; case 4: return "May"; case 5: return "June"; case 6: return "July"; case 7: return "August"; case 8: return "September"; case 9: return "October"; case 10: return "November"; case 11: return "December"; } }; Date.prototype.getTwoDigitUTCHours = function() { return olympus.utilities.pad_string(this.getUTCHours(),2); }; Date.prototype.getTwoDigitUTCMinutes = function() { return olympus.utilities.pad_string(this.getUTCMinutes(),2); }; Date.prototype.getTwoDigitUTCSeconds = function() { return olympus.utilities.pad_string(this.getUTCSeconds(),2); }; $("body").append( $("
") .attr("id","hermes_export_window") .append( $("

") .text("Hermes HIT exporter"), $("