diff --git a/index.html b/index.html index 144a467..5454ef0 100644 --- a/index.html +++ b/index.html @@ -450,9 +450,18 @@ + + +
+
+
+ + +
+
@@ -508,11 +517,16 @@ if(byteIndex < 0){ var byteSet = bitswap(number).toString(16); if(byteSet.length == 1){ byteSet = "0"+byteSet; } - var b = "0x"+byteSet; - output_string += b + ", "; + if (!settings.removeZeroesCommas) { + output_string += "0x" + byteSet + ", "; + } else { + output_string += byteSet; + } output_index++; if(output_index >= 16){ - output_string += "\n"; + if (!settings.removeZeroesCommas) { + output_string += "\n"; + } output_index = 0; } number = 0; @@ -724,6 +738,7 @@ backgroundColor: "white", scale: "1", drawMode: "horizontal", + removeZeroesCommas: false, threshold: 128, outputFormat: "plain", invertColors: false, @@ -766,6 +781,7 @@ var caption = document.getElementById("format-caption-container"); var adafruitGfx = document.getElementById("adafruit-gfx-settings"); var arduino = document.getElementById("arduino-identifier"); + var removeZeroesCommasContainer = document.getElementById("remove-zeroes-commas-container"); for(var i = 0; i < caption.children.length; i++) { caption.children[i].style.display = "none"; @@ -773,7 +789,14 @@ caption = document.querySelector("div[data-caption='" + elm.value + "']"); if(caption) caption.style.display = "block"; - elm.value != "plain" ? arduino.style.display = "block" : arduino.style.display = "none"; + if (elm.value != "plain") { + arduino.style.display = "block"; + removeZeroesCommasContainer.style.display = "none"; + settings.removeZeroesCommas = false; + } else { + arduino.style.display = "none"; + removeZeroesCommasContainer.style.display = "table-row"; + } elm.value == "adafruit_gfx" ? adafruitGfx.style.display = "block" : adafruitGfx.style.display = "none"; settings["outputFormat"] = elm.value; @@ -1443,15 +1466,13 @@ } } function bitswap(b) { - if(settings["bitswap"]) - { - b = (b & 0xF0) >> 4 | (b & 0x0F) << 4; - b = (b & 0xCC) >> 2 | (b & 0x33) << 2; - b = (b & 0xAA) >> 1 | (b & 0x55) << 1; + if(settings["bitswap"]) { + b = (b & 0xF0) >> 4 | (b & 0x0F) << 4; + b = (b & 0xCC) >> 2 | (b & 0x33) << 2; + b = (b & 0xAA) >> 1 | (b & 0x55) << 1; } - return b; + return b; } - // -- document.getElementById("outputFormat").value = "arduino"; document.getElementById("outputFormat").onchange();