Skip to content

Commit

Permalink
Merge pull request #2 from basic-experimental/testing
Browse files Browse the repository at this point in the history
Merge testing to main
  • Loading branch information
basic-experimental authored Jun 1, 2024
2 parents 912e7b7 + c336ebc commit 2950bfc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Binary file added other/qr/img/microqrcode.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions other/qr/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ <h3>QR and barcode generator</h3>
<img id="qr" src="http://api.qrserver.com/v1/create-qr-code/?size=200x200&data=Hello World" alt="Error getting the QR code">
</div>
<div id="bottom-screen">
<span style="white-space: nowrap;"><input type="radio" id="aztec" name="codeSelectRadio" value="aztec">
<input type="text" id="text" placeholder="Input text...">
<br>
<button id="btn-gen">Generate</button>
<span style="white-space: nowrap;"><input type="radio" id="qrcode" name="codeSelectRadio" value="qrcode" checked>
<label for="qrcode">QR Code&nbsp;<img src="./img/qrcode.gif" height="25px"></label></span>
<span style="white-space: nowrap;"><input type="radio" id="aztec" name="codeSelectRadio" value="azteccode">
<label for="aztec">Aztec&nbsp;<img src="./img/aztec.gif" height="25px"></label></span>
<span style="white-space: nowrap;"><input type="radio" id="codabar" name="codeSelectRadio" value="codabar">
<label for="codabar">Codabar&nbsp;<img src="./img/codabar.gif" height="25px"></label></span>
<span style="white-space: nowrap;"><input type="radio" id="microqrcode" name="codeSelectRadio" value="microqrcode">
<label for="microqrcode">Micro QR&nbsp;<img src="./img/microqrcode.gif" height="25px"></label></span>
<span style="white-space: nowrap;"><input type="radio" id="code39" name="codeSelectRadio" value="code39">
<label for="code39">Code39&nbsp;<img src="./img/code39.gif" height="25px"></label></span>
<span style="white-space: nowrap;"><input type="radio" id="code128" name="codeSelectRadio" value="code128">
Expand All @@ -36,15 +41,10 @@ <h3>QR and barcode generator</h3>
<label for="ean13">EAN-13&nbsp;<img src="./img/ean13.gif" height="25px"></label></span>
<span style="white-space: nowrap;"><input type="radio" id="pdf417" name="codeSelectRadio" value="pdf417">
<label for="pdf417">PDF-417&nbsp;<img src="./img/pdf417.gif" height="25px"></label></span>
<span style="white-space: nowrap;"><input type="radio" id="qrcode" name="codeSelectRadio" value="qrcode" checked>
<label for="qrcode">QR Code&nbsp;<img src="./img/qrcode.gif" height="25px"></label></span>
<span style="white-space: nowrap;"><input type="radio" id="upca" name="codeSelectRadio" value="upca">
<label for="upca">UPC-A&nbsp;<img src="./img/upca.gif" height="25px"></label></span>
<span style="white-space: nowrap;"><input type="radio" id="upce" name="codeSelectRadio" value="upce">
<label for="upce">UPC-E&nbsp;<img src="./img/upce.gif" height="25px"></label></span>
<button id="btn-gen">Generate</button>
<br>
<input type="text" id="text" placeholder="Input text...">
</div>
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion other/qr/qr.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}

#btn-gen {
margin-top: 2%;
margin-bottom: 2%;
height: 10%;
width: 45%;
border: 2px green solid;
Expand Down
4 changes: 2 additions & 2 deletions other/qr/qr.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ window.addEventListener('load', function() {
};

xhr.onerror = function() {
console.error("Request failed");
callback('./img/ERROR.png'); // Return the error image (likely the code type does not support the input)
};

xhr.send();
}


function generate(str) {
var imageUrl = 'https://barcodeapi.org/api/' + getSelectedCode() + '/' + decodeURIComponent(str);
var imageUrl = 'http://bwipjs-api.metafloor.com?bcid=' + getSelectedCode() + '&text=' + decodeURIComponent(str);
loadImageAsDataURL(imageUrl, function(dataUrl) {
qr.src = dataUrl;
});
Expand Down

0 comments on commit 2950bfc

Please sign in to comment.