diff --git a/VoltorbFlipSpinners/src/VoltorbFlipSpinners.js b/VoltorbFlipSpinners/src/VoltorbFlipSpinners.js index bac7d0f..2bc5137 100644 --- a/VoltorbFlipSpinners/src/VoltorbFlipSpinners.js +++ b/VoltorbFlipSpinners/src/VoltorbFlipSpinners.js @@ -1,13 +1,15 @@ // ==UserScript== // @name Voltorb Flip Spinners // @namespace http://tampermonkey.net/ -// @version 0.0.1 +// @version 0.0.2 // @description Adds spinners to the inputs of numbers // @author Isaac Shoebottom // @match http://voltorbflip.com/ // @icon http://voltorbflip.com/favicon.ico // @grant none // @run-at document-idle +// @updateURL https://git.shoebottom.ca/IsaacShoebottom/Scripts/raw/branch/master/VoltorbFlipSpinners/src/VoltorbFlipSpinners.js +// @downloadURL https://git.shoebottom.ca/IsaacShoebottom/Scripts/raw/branch/master/VoltorbFlipSpinners/src/VoltorbFlipSpinners.js // ==/UserScript== // To add spinners I just need to change the input type from text to numbers @@ -50,6 +52,17 @@ function addMouseOverSpinner(inputElement) { }); } +/** + * Sets the content of the input to be the passed value + * @param {HTMLElement} inputElement + * @param {number} value + * @returns {void} + */ +function setInputValue(inputElement, value) { + console.log("Setting input value of" + inputElement + "to" + value); + inputElement.value = value; +} + /** * Executes the script * @returns {void} @@ -65,6 +78,7 @@ function execute() { console.log("Found " + inputs.length + " inputs"); inputs.forEach(addMouseOverSpinner) + inputs.forEach((input) => setInputValue(input, 0)); } execute();