biangbiangmian / Fix Neto Site Survey Orders

// ==UserScript==
// @license MIT
// @name         Fix Neto Site Survey Orders
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  Formats the orders into a readable layout
// @author       Nicholas Smith
// @include     /^https?://www\.telcoantennas\.com\.au/_cpanel/order.*$/
// @grant        none
// ==/UserScript==
! function() {
    'use strict';
    // Begin...
    ! function() {
        for (var allSurveys = document.getElementsByClassName('col-product-name'), semiColon = /[*;*]/g, afterColon = /\:(.*?)\<br><br>/g, address = "Please enter your GPS coordinates or Address: ", i = 0; i < allSurveys.length; i++)
        /* Make everything after a colon (:) bold */
        /* Turn semicolons into line breaks */
            if (null !== allSurveys[i].innerHTML.match(semiColon) && (allSurveys[i].innerHTML = allSurveys[i].innerHTML.replace(semiColon, "<br><br>"))
            /* Put addresses on a new line */
            , null !== allSurveys[i].innerHTML.match(address) && (allSurveys[i].innerHTML = allSurveys[i].innerHTML.replace(address, address + "<br>")), null !== allSurveys[i].innerHTML.match(afterColon)) {
            for (var j = 0; j < allSurveys[i].innerHTML.match(afterColon).length; j++) {
                //console.log("log: " + allSurveys[j].innerHTML.match(afterColon)[k]);
                allSurveys[i].innerHTML = allSurveys[i].innerHTML.replace(allSurveys[i].innerHTML.match(afterColon)[j], "<b>" + allSurveys[i].innerHTML.match(afterColon)[j] + "</b>");
                allSurveys[i].innerHTML = allSurveys[i].innerHTML.replace("Telstra", "<span style='background-color: cyan'>Telstra</span>")
                allSurveys[i].innerHTML = allSurveys[i].innerHTML.replace("Optus", "<span style='background-color: yellow'>Optus</span>")
                allSurveys[i].innerHTML = allSurveys[i].innerHTML.replace("Vodafone", "<span style='background-color: pink'>Vodafone</span>")
                allSurveys[i].innerHTML = allSurveys[i].innerHTML.replace("TPG Mobile", "<span style='background-color: pink'>TPG Mobile</span>")


            }
        }
    }()
}();