Gaxx / Timelog Improver

// ==UserScript==
// @name        Timelog Improver
// @namespace   Timelog_Improver
// @description Imrpove timelog for UK users
// @include     https://app1.timelog.com/trapeze/Registration/TimeTracking*
// @version     2.0.1
// @grant       none
// @run-at document-idle
// @noframes
// @license     MIT
// ==/UserScript==

// -- Version Info --
// v2.0.0: Handles new timelog
// v1.1.0: Handles some totals recalculation when filling in fields.
// v1.0.1: First Release version.
// -- /Version Info --

console.log("--- Timelog Improver v" + GM_info.script.version + " ---");

function transformTypedCharacter(typedChar) {
    return typedChar == "." ? "," : typedChar;
}

function bindKeyPress(objBox) {
    objBox.onkeypress = function(evt){
        if (evt.which) {
            var charStr = String.fromCharCode(evt.which);
            var transformedChar = transformTypedCharacter(charStr);
            if (transformedChar != charStr) {
                objBox.value += transformedChar;
                return false;
            }
        }
    };
}

function waitForLoad() {
    var boxes = document.getElementsByTagName("input");
    var procd = 0;
    for (var i = 0; i < boxes.length; i++) {
        var box = boxes[i];
        if (box.className == "align-right") {
            procd++;
            //console.log(box);
            bindKeyPress(box);
        }
    }
    if (procd == 0) {
        setTimeout(function(){ waitForLoad(); }, 500);
    }
}

waitForLoad();
console.log("/-- Timelog Improver v" + GM_info.script.version + " --/");