// ==UserScript== // @name Mount Olympus // @namespace mobiusevalon.tibbius.com // @version 1.0 // @author Mobius Evalon // @description Common features shared amongst all Olympian scripts. Make sure Olympus comes before all other Olympian scripts in execution order. // @license Creative Commons Attribution-ShareAlike 4.0; http://creativecommons.org/licenses/by-sa/4.0/ // @require https://code.jquery.com/jquery-1.12.4.min.js // @require https://code.jquery.com/ui/1.11.4/jquery-ui.min.js // @include /^https{0,1}:\/\/\w{0,}\.?mturk\.com.*$/ // @exclude /&hit_scraper$/ // @grant none // @downloadURL none // ==/UserScript== if(window.olympus === undefined) window.olympus = {}; // all of these are added separately because then i don't overwrite the entire olympus object, // making it possible to initialize the scripts out of order window.olympus.__init = function() { console.log("olympus init"); olympus.style.add( ".dialog.floats {border-radius: 8px; border: 2px solid #000000; max-height: 550px; position: absolute !important; z-index: 500; background-color: #7fb4cf;} "+ ".dialog.narrow {width: 300px; min-width: 300px;} "+ ".dialog.wide {width: 500px; min-width: 500px;} "+ ".dialog .scrolling-content {max-height: 350px; overflow-y: auto;} "+ ".dialog .actions {margin: 10px auto; padding: 0px; text-align: center; display: block;} "+ ".dialog .actions input:not(:last-of-type) {margin-right: 15px;} "+ ".dialog .head {padding: 0px; margin: 10px auto; font-size: 175%; font-weight: bold; width: 100%; text-align: center; cursor: move;} "+ "#olympian_help {top: 25px; left: 200px;}"+ "#olympian_help p.inset {margin-left: 25px;}"+ "#olympian_help p.inset b {margin-left: -25px; display: block;}" ); // append the fontawesome stylesheet to the page if it does not exist if(!$("link[rel='stylesheet'][href$='font-awesome.min.css']").length) $("head").append( $("") .attr({ "rel":"stylesheet", "href":"https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" }) ); String.prototype.collapseWhitespace = function() { return this.replace(/\s{2,}/g," ").trim(); }; String.prototype.ucFirst = function() { return (this.charAt(0).toUpperCase()+this.slice(1)); }; // append the help window to the document $("body").append( $("
") .attr({ "id":"olympian_help", "class":"dialog wide floats" }) .append( $("

") .attr("class","head") .text("Olympian help"), $("
") .attr("class","scrolling-content") .append( $("
").attr("class","explain") ), $("
") .attr("class","actions") .append( $("