mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 04:12:59 +00:00
Show barcode as barcode-image on shopping list (closes #1133)
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
{ 'visible': false, 'targets': 5 },
|
||||
{ 'visible': false, 'targets': 6 },
|
||||
{ 'visible': false, 'targets': 7 },
|
||||
{ 'visible': false, 'targets': 8 },
|
||||
{ "type": "num", "targets": 2 },
|
||||
{ "type": "html-num-fmt", "targets": 5 },
|
||||
{ "type": "html-num-fmt", "targets": 6 }
|
||||
@@ -529,3 +530,18 @@ $(window).on("message", function(e)
|
||||
window.location.href = U('/shoppinglist?list=' + data.Payload);
|
||||
}
|
||||
});
|
||||
|
||||
var dummyCanvas = document.createElement("canvas");
|
||||
$("img.barcode").each(function()
|
||||
{
|
||||
var img = $(this);
|
||||
|
||||
bwipjs.toCanvas(dummyCanvas, {
|
||||
bcid: "ean8",
|
||||
text: img.attr("data-barcode"),
|
||||
height: 5,
|
||||
includetext: false
|
||||
});
|
||||
|
||||
img.attr("src", dummyCanvas.toDataURL("image/png"));
|
||||
});
|
||||
|
Reference in New Issue
Block a user