CSW interface reorganizer

Hide the copyright footer, automatically scroll the page down to the work frame, and move the control buttons and timer to the header

As of 2015-10-21. See the latest version.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         CSW interface reorganizer
// @namespace    mobiusevalon.tibbius.com
// @version      0.1
// @description  Hide the copyright footer, automatically scroll the page down to the work frame, and move the control buttons and timer to the header
// @author       Mobius Evalon
// @include      /^https{0,1}:\/\/work\.crowdsurfwork\.com\/tasks\/(ac17bf07e8ce438590f15c683ff430b5|14d7b0778f8b480c9261f9241611ee56).*?$/
// @grant        none
// ==/UserScript==

function ypos(elem)
{
    var y = 0;
    if(elem.offsetParent)
    {
        do y += elem.offsetTop;
        while (elem = elem.offsetParent);
        return y;
    }
}

var header = document.getElementsByClassName("headerwrapper")[0];
var footer = document.getElementsByTagName("footer")[0];
var work_frame = document.getElementById("innerframe");
var task_detail = document.getElementById("task-detail-nav");
var header_right = header.getElementsByClassName("header-right")[0];
var head = document.getElementsByTagName("head")[0];

var css = document.createElement("style");
css.type = "text/css";
css.innerHTML = "#task-detail-nav {margin: 0px !important; padding: 0px !important; color: #ffffff !important;}"+
    "#task-detail-nav a.btn {margin: 0px 10px !important; padding: 6px 15px !important;}"+
    "#task-detail-nav #Countdown h4 {margin: 0px 10px !important;}";
head.appendChild(css);

footer.style.display = "none"; // takes up unnecessary space and contains nothing but a copyright date

task_detail.parentNode.removeChild(task_detail);
task_detail.className = "";
header_right.insertBefore(task_detail,header_right.childNodes[0]);

window.scroll(0,ypos(work_frame)-header.scrollHeight+10); // body tag contains 10px of margin by default