floodmeadows / DTX fill all working days

// ==UserScript==
// @name         DTX fill all working days
// @description  Fill all working days with 7.5 hours in DTX detail view
// @namespace    https://openuserjs.org/users/floodmeadows
// @author       andy@floodmeadows.com
// @copyright    2021, floodmeadows (https://openuserjs.org/users/floodmeadows)
// @license      MIT
// @version      0.3
// @match        https://missbhadtx03.corp.capgemini.com/DTX.NET/item.aspx*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=capgemini.com
// @updateURL    https://openuserjs.org/meta/floodmeadows/DTX_fill_all_working_days.meta.js
// @downloadURL  https://openuserjs.org/install/floodmeadows/DTX_fill_all_working_days.user.js
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    addButton("Fill all working days",fillAllWorkingDays);
    addButton("Clear all working days",clearAllWorkingDays);
})();

function addButton(text, eventListener) {
    const textNode = document.createTextNode(text);
    const b = document.createElement("button");
    b.setAttribute("type","button");
    b.addEventListener("click", eventListener, false);
    b.appendChild(textNode);
    const td = document.createElement("td");
    td.appendChild(b);
    const target = document.getElementById('deleteElement');
    target.parentElement.appendChild(td);
}

function fillAllWorkingDays(e) {
    const dayInputs = document.getElementsByClassName("aspTextBoxNumberSmall");
    for (var i=0; i<dayInputs.length; i++) {
        if(dayInputs[i].getAttribute('style') != 'background-color:#E1E1E1;') dayInputs[i].value = 7.5;
    }
    e.stopPropagation();
}

function clearAllWorkingDays(e) {
    const dayInputs = document.getElementsByClassName("aspTextBoxNumberSmall");
    for (var i=0; i<dayInputs.length; i++) {
        if(dayInputs[i].getAttribute('style') != 'background-color:#E1E1E1;') dayInputs[i].value = "";
    }
    e.stopPropagation();
}