Skip to content

Commit

Permalink
Release v3.3.14
Browse files Browse the repository at this point in the history
  • Loading branch information
lindell committed Jun 26, 2016
1 parent 993b6a8 commit f0c95b5
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 45 deletions.
16 changes: 10 additions & 6 deletions bin/barcodes/EAN_UPC/EAN13.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ var EAN13 = function () {
this.string = string;
}

this.displayValue = options.displayValue;

// Define the EAN-13 structure
this.structure = ["LLLLLL", "LLGLGG", "LLGGLG", "LLGGGL", "LGLLGG", "LGGLLG", "LGGGLL", "LGLGLG", "LGLGGL", "LGGLGL"];

Expand Down Expand Up @@ -58,11 +60,13 @@ var EAN13 = function () {
var rightSide = this.string.substr(7, 6);

// Add the first digigt
result.push({
data: "000000000000",
text: this.string[0],
options: { textAlign: "left", fontSize: this.fontSize }
});
if (this.displayValue) {
result.push({
data: "000000000000",
text: this.string[0],
options: { textAlign: "left", fontSize: this.fontSize }
});
}

// Add the guard bars
result.push({
Expand Down Expand Up @@ -96,7 +100,7 @@ var EAN13 = function () {
options: { height: this.guardHeight }
});

if (this.lastChar) {
if (this.lastChar && this.displayValue) {
result.push({ data: "00" });

result.push({
Expand Down
26 changes: 16 additions & 10 deletions bin/barcodes/EAN_UPC/UPC.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ var UPC = function () {
this.string = string;
}

this.displayValue = options.displayValue;

// Make sure the font is not bigger than the space between the guard bars
if (options.fontSize > options.width * 10) {
this.fontSize = options.width * 10;
Expand All @@ -44,11 +46,13 @@ var UPC = function () {
var result = [];

// Add the first digigt
result.push({
data: "00000000",
text: this.string[0],
options: { textAlign: "left", fontSize: this.fontSize }
});
if (this.displayValue) {
result.push({
data: "00000000",
text: this.string[0],
options: { textAlign: "left", fontSize: this.fontSize }
});
}

// Add the guard bars
result.push({
Expand Down Expand Up @@ -83,11 +87,13 @@ var UPC = function () {
});

// Add the last digit
result.push({
data: "00000000",
text: this.string[11],
options: { textAlign: "right", fontSize: this.fontSize }
});
if (this.displayValue) {
result.push({
data: "00000000",
text: this.string[11],
options: { textAlign: "right", fontSize: this.fontSize }
});
}

return result;
};
Expand Down
2 changes: 1 addition & 1 deletion bin/help/optionsFromStrings.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports.default = optionsFromStrings;
// Convert string to integers/booleans where it should be

function optionsFromStrings(options) {
var intOptions = ["width", "height", "textMargin", "fontSize", "margin", "marginLeft", "marginBottom", "marginLeft", "marginRight"];
var intOptions = ["width", "height", "textMargin", "fontSize", "margin", "marginTop", "marginBottom", "marginLeft", "marginRight"];

for (var intOption in intOptions) {
intOption = intOptions[intOption];
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "JsBarcode",
"main": "dist/JsBarcode.all.min.js",
"version": "3.3.13",
"version": "3.3.14",
"homepage": "https://github.com/lindell/JsBarcode",
"authors": [
"Johan Lindell <[email protected]>"
Expand Down
44 changes: 27 additions & 17 deletions dist/JsBarcode.all.js
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,8 @@
this.string = string;
}

this.displayValue = options.displayValue;

// Define the EAN-13 structure
this.structure = ["LLLLLL", "LLGLGG", "LLGGLG", "LLGGGL", "LGLLGG", "LGGLLG", "LGGGLL", "LGLGLG", "LGLGGL", "LGGLGL"];

Expand Down Expand Up @@ -1400,11 +1402,13 @@
var rightSide = this.string.substr(7, 6);

// Add the first digigt
result.push({
data: "000000000000",
text: this.string[0],
options: { textAlign: "left", fontSize: this.fontSize }
});
if (this.displayValue) {
result.push({
data: "000000000000",
text: this.string[0],
options: { textAlign: "left", fontSize: this.fontSize }
});
}

// Add the guard bars
result.push({
Expand Down Expand Up @@ -1438,7 +1442,7 @@
options: { height: this.guardHeight }
});

if (this.lastChar) {
if (this.lastChar && this.displayValue) {
result.push({ data: "00" });

result.push({
Expand Down Expand Up @@ -1720,6 +1724,8 @@
this.string = string;
}

this.displayValue = options.displayValue;

// Make sure the font is not bigger than the space between the guard bars
if (options.fontSize > options.width * 10) {
this.fontSize = options.width * 10;
Expand All @@ -1740,11 +1746,13 @@
var result = [];

// Add the first digigt
result.push({
data: "00000000",
text: this.string[0],
options: { textAlign: "left", fontSize: this.fontSize }
});
if (this.displayValue) {
result.push({
data: "00000000",
text: this.string[0],
options: { textAlign: "left", fontSize: this.fontSize }
});
}

// Add the guard bars
result.push({
Expand Down Expand Up @@ -1779,11 +1787,13 @@
});

// Add the last digit
result.push({
data: "00000000",
text: this.string[11],
options: { textAlign: "right", fontSize: this.fontSize }
});
if (this.displayValue) {
result.push({
data: "00000000",
text: this.string[11],
options: { textAlign: "right", fontSize: this.fontSize }
});
}

return result;
};
Expand Down Expand Up @@ -2350,7 +2360,7 @@
// Convert string to integers/booleans where it should be

function optionsFromStrings(options) {
var intOptions = ["width", "height", "textMargin", "fontSize", "margin", "marginLeft", "marginBottom", "marginLeft", "marginRight"];
var intOptions = ["width", "height", "textMargin", "fontSize", "margin", "marginTop", "marginBottom", "marginLeft", "marginRight"];

for (var intOption in intOptions) {
intOption = intOptions[intOption];
Expand Down
4 changes: 2 additions & 2 deletions dist/JsBarcode.all.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/barcodes/JsBarcode.code128.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/barcodes/JsBarcode.code39.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/barcodes/JsBarcode.ean-upc.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/barcodes/JsBarcode.itf-14.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/barcodes/JsBarcode.itf.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit f0c95b5

Please sign in to comment.