johnhbenetech / Secure App

// ==UserScript==
// @name        Secure App
// @namespace   sag-qa.benetech.org
// @include     https://sag-qa.benetech.org/*
// @include     https://sag-staging.benetech.org/*
// @include     http://sag-qa.benetech.org/*
// @include     https://sag.benetech.org/*
// @include     http://sag.benetech.org/*
// @include     http://sag-staging.benetech.org/*
// @version     1
// @grant       GM_addstyle
// ==/UserScript==

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}


addGlobalStyle('body, textarea {background-color: #E8EFEC !important;}');
addGlobalStyle('.textFont { color: #3F2C69 !important; }');
addGlobalStyle('.helpFont { color: #3F2C69 !important; }');
addGlobalStyle('.copyrightFont { color: #3F2C69 !important; }');
addGlobalStyle('.button_start { background-color: #76BF28 !important; }');
addGlobalStyle('.button_next { background-color: #76BF28 !important; }');
addGlobalStyle('.button_previous { background-color: #97A2B5 !important; }');
addGlobalStyle('.appName { background-color: #97A2B5 !important; }');
addGlobalStyle('.cellphone_center_title { background-color: #97A2B5 !important; }');
addGlobalStyle('.cellphone_center_data { background-color: #97A2B5 !important; }');
addGlobalStyle('.cellphone_center_version { background-color: #97A2B5 !important; }');
addGlobalStyle('.cellphone_title { font-family: "Lucida Sans Typewriter",monospace !important; }');
addGlobalStyle('.cellphone_title { font-weight: normal !important; }');
addGlobalStyle('.help_area { top: 620px !important; }');
addGlobalStyle('.copyright_area { top: 645px !important; }');
addGlobalStyle('.progressBarStepActive { color: #fff !important; }');
addGlobalStyle('.buttonCreateXForm { background-color: #97A2B5 !important; }');
addGlobalStyle('.buttonCreateXForm { color: #3F2C69 !important; }');
addGlobalStyle('.ProgressCircleInfo { color: #3F2C69 !important; }');
addGlobalStyle('.error_msg { background-color: #E700FF !important; }');

var phone = document.querySelector('.cellphone');
phone.src = "https://i.imgur.com/lArpCbF.png";

var martuslogo = document.querySelector("img[src='../images/MartusLogoWhite.png']");
martuslogo.src = "https://i.imgur.com/QgzPu7I.png";


var newElem = document.createElement( 'script'); //create a script tag
newElem.type = 'text/javascript'; // add type attribute
newElem.innerHTML = 'function xformSelectionChange() { this.console.log("Checking xFormSelection");var c=this.document.getElementById("defaultXFormSelection");var b=c.selectedIndex;var a=false;var d=this.document.getElementById("uploadCustomXFormButton");if(b==0){a=false}else{a=true;d.value=null}updateNextButton(a);}'; 
document.body.appendChild(newElem); // Insert it as the last child of body

var newElem2 = document.createElement( 'script'); //create a script tag
newElem2.type = 'text/javascript'; // add type attribute
newElem2.innerHTML = 'function uploadxFormSelected() { this.console.log("Checking Upload xFormSelection");var b=this.document.getElementById("defaultXFormSelection").selectedIndex=0;var a=false;var c=this.document.getElementById("uploadCustomXFormButton");if(c.value!=null&&c.value!=""){a=true}updateNextButton(a);}'; 
document.body.appendChild(newElem2); // Insert it as the last child of body

var newElem3 = document.createElement( 'script'); //create a script tag
newElem3.type = 'text/javascript'; // add type attribute
newElem3.innerHTML = 'function updateNextButton(a) { var b=this.document.getElementById("next");if(a){b.disabled=false;b.style.backgroundColor="#76BF28"}else{b.disabled=true;b.style.backgroundColor="gray"}}'; 
document.body.appendChild(newElem3); // Insert it as the last child of body

try {
    var step1 = document.querySelector("img[src='/images/Step1line.png']");
    step1.setAttribute("src","https://i.imgur.com/MgRJkyK.png");
} catch(e) {}

try {
    var step2 = document.querySelector("img[src='/images/Step2line.png']");
    step2.setAttribute("src","https://i.imgur.com/UUqK0rd.png");
} catch(e) {}

try {
    var step3 = document.querySelector("img[src='/images/Step3line.png']");
    step3.setAttribute("src","https://i.imgur.com/Zvcs9Lb.png");
} catch(e) {}

try {
    var step4 = document.querySelector("img[src='/images/Step4line.png']");
    step4.setAttribute("src","https://i.imgur.com/vjS8lgy.png");
} catch(e) {}


try {
    var step5 = document.querySelector("img[src='/images/Step5line.png']");
    step5.setAttribute("src","https://i.imgur.com/91fys8W.png");
} catch(e) {}