jdranczewski / IYPT 2018 CC optimiser

// ==UserScript==
// @name         IYPT 2018 CC optimiser
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Displays the name of the problem when hovering over the problem number badge in CC, IYPT's score management system.
// @author       Jakub Dranczewski (team UK 2017)
// @match        https://cc.iypt.org/iypt2018/*
// @require      http://code.jquery.com/jquery-1.12.4.min.js
// @copyright    2018, jdranczewski (https://openuserjs.org/users/jdranczewski)
// @license      MIT
// @grant GM_addStyle
// ==/UserScript==

GM_addStyle('#us_title {position: fixed;bottom: 5px;right: 5px;background-color: #222d32;text-align: right;color: white;padding: 10px;font-size: 1.3em;border-radius: 6px;} .content-wrapper{padding-bottom: 25px;}');

(function() {
    'use strict';

    // Your code here...
    var problems = [
        "",
        "1. Invent Yourself",
        "2. Colour of Powders",
        "3. Dancing Coin",
        "4. Heron's Fountain",
        "5. Drinking Straw",
        "6. Ring Oiler",
        "7. Conical Piles",
        "8. Cusps in a Cylinder",
        "9. Candle in Water",
        "10. Tesla Valve",
        "11. Azimuthal-Radial Pendulum",
        "12. Curie Point Engine",
        "13. Weighing Time",
        "14. Radiant Lantern",
        "15. Blowing Bubbles",
        "16. Acoustic Levitation",
        "17. Water Bottle"
    ];
    $("body").append("<div id='us_title'>Hover over a badge...</div>")
    $(".badge").mouseenter(function() {
        $("#us_title").text(problems[$(this).text()]);
    })
})();