mirror of
https://github.com/javl/image2cpp.git
synced 2026-07-27 19:56:07 +00:00
Merge branch 'master' into gh-pages
This commit is contained in:
+26
-4
@@ -453,6 +453,14 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="table-row" id="remove-zeroes-commas-container">
|
||||||
|
<div class="table-cell"><label>Extra formatting options:</label></div>
|
||||||
|
<div class="table-cell">
|
||||||
|
<input id="removeZeroesCommas" type="checkbox" onchange="updateBoolean('removeZeroesCommas')"/>
|
||||||
|
<label for="removeZeroesCommas">Remove '0x' and commas from output</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="note1bit">
|
<div id="note1bit">
|
||||||
@@ -508,11 +516,16 @@
|
|||||||
if(byteIndex < 0){
|
if(byteIndex < 0){
|
||||||
var byteSet = bitswap(number).toString(16);
|
var byteSet = bitswap(number).toString(16);
|
||||||
if(byteSet.length == 1){ byteSet = "0"+byteSet; }
|
if(byteSet.length == 1){ byteSet = "0"+byteSet; }
|
||||||
var b = "0x"+byteSet;
|
if (!settings.removeZeroesCommas) {
|
||||||
output_string += b + ", ";
|
output_string += "0x" + byteSet + ", ";
|
||||||
|
} else {
|
||||||
|
output_string += byteSet;
|
||||||
|
}
|
||||||
output_index++;
|
output_index++;
|
||||||
if(output_index >= 16){
|
if(output_index >= 16){
|
||||||
output_string += "\n";
|
if (!settings.removeZeroesCommas) {
|
||||||
|
output_string += "\n";
|
||||||
|
}
|
||||||
output_index = 0;
|
output_index = 0;
|
||||||
}
|
}
|
||||||
number = 0;
|
number = 0;
|
||||||
@@ -724,6 +737,7 @@
|
|||||||
backgroundColor: "white",
|
backgroundColor: "white",
|
||||||
scale: "1",
|
scale: "1",
|
||||||
drawMode: "horizontal",
|
drawMode: "horizontal",
|
||||||
|
removeZeroesCommas: false,
|
||||||
threshold: 128,
|
threshold: 128,
|
||||||
outputFormat: "plain",
|
outputFormat: "plain",
|
||||||
invertColors: false,
|
invertColors: false,
|
||||||
@@ -766,6 +780,7 @@
|
|||||||
var caption = document.getElementById("format-caption-container");
|
var caption = document.getElementById("format-caption-container");
|
||||||
var adafruitGfx = document.getElementById("adafruit-gfx-settings");
|
var adafruitGfx = document.getElementById("adafruit-gfx-settings");
|
||||||
var arduino = document.getElementById("arduino-identifier");
|
var arduino = document.getElementById("arduino-identifier");
|
||||||
|
var removeZeroesCommasContainer = document.getElementById("remove-zeroes-commas-container");
|
||||||
|
|
||||||
for(var i = 0; i < caption.children.length; i++) {
|
for(var i = 0; i < caption.children.length; i++) {
|
||||||
caption.children[i].style.display = "none";
|
caption.children[i].style.display = "none";
|
||||||
@@ -773,7 +788,14 @@
|
|||||||
caption = document.querySelector("div[data-caption='" + elm.value + "']");
|
caption = document.querySelector("div[data-caption='" + elm.value + "']");
|
||||||
if(caption) caption.style.display = "block";
|
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";
|
elm.value == "adafruit_gfx" ? adafruitGfx.style.display = "block" : adafruitGfx.style.display = "none";
|
||||||
|
|
||||||
settings["outputFormat"] = elm.value;
|
settings["outputFormat"] = elm.value;
|
||||||
|
|||||||
Reference in New Issue
Block a user