Skip to content

Commit

Permalink
Release v3.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lindell committed Sep 18, 2016
1 parent 6e14312 commit f6ed672
Show file tree
Hide file tree
Showing 9 changed files with 170 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Download or get the CDN link to the script:

| Name | Supported barcodes | Size (gzip) | CDN / Download |
|------|--------------------|:-----------:|---------------:|
| *All* | *All the barcodes!* | *7.7 kB* | *[JsBarcode.all.min.js][1]* |
| *All* | *All the barcodes!* | *7.9 kB* | *[JsBarcode.all.min.js][1]* |
| CODE128 | CODE128 (auto and force mode) | 5.3 kB | [JsBarcode.code128.min.js][2] |
| CODE39 | CODE39 | 4.6 kB | [JsBarcode.code39.min.js][3] |
| EAN / UPC | EAN-13, EAN-8, EAN-5, EAN-2, UPC (A) | 5.1 kB | [JsBarcode.ean-upc.min.js][4] |
Expand Down
68 changes: 68 additions & 0 deletions bin/barcodes/codabar/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

// Encoding specification:
// http://www.barcodeisland.com/codabar.phtml

var codabar = function () {
function codabar(string) {
_classCallCheck(this, codabar);

this.string = string.toUpperCase();

if (this.string.search(/^[0-9\-\$\:\.\+\/]+$/) === 0) {
this.string = "A" + this.string + "A";
}

this.encodings = {
"0": "101010011",
"1": "101011001",
"2": "101001011",
"3": "110010101",
"4": "101101001",
"5": "110101001",
"6": "100101011",
"7": "100101101",
"8": "100110101",
"9": "110100101",
"-": "101001101",
"$": "101100101",
":": "1101011011",
"/": "1101101011",
".": "1101101101",
"+": "101100110011",
"A": "1011001001",
"B": "1010010011",
"C": "1001001011",
"D": "1010011001"
};
}

codabar.prototype.valid = function valid() {
return this.string.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/) !== -1;
};

codabar.prototype.encode = function encode() {
var result = [];
for (var i = 0; i < this.string.length; i++) {
result.push(this.encodings[this.string.charAt(i)]);
// for all characters except the last, append a narrow-space ("0")
if (i !== this.string.length - 1) {
result.push("0");
}
}
return {
text: this.string.replace(/[A-D]/g, ''),
data: result.join('')
};
};

return codabar;
}();

exports.codabar = codabar;
3 changes: 3 additions & 0 deletions bin/barcodes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ var _MSI = require('./MSI/');

var _pharmacode = require('./pharmacode/');

var _codabar = require('./codabar');

var _GenericBarcode = require('./GenericBarcode/');

exports.default = {
Expand All @@ -28,5 +30,6 @@ exports.default = {
ITF: _ITF2.ITF,
MSI: _MSI.MSI, MSI10: _MSI.MSI10, MSI11: _MSI.MSI11, MSI1010: _MSI.MSI1010, MSI1110: _MSI.MSI1110,
pharmacode: _pharmacode.pharmacode,
codabar: _codabar.codabar,
GenericBarcode: _GenericBarcode.GenericBarcode
};
3 changes: 3 additions & 0 deletions bin/barcodes/index.tmp.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ var _MSI = require('./MSI/');

var _pharmacode = require('./pharmacode/');

var _codabar = require('./codabar');

var _GenericBarcode = require('./GenericBarcode/');

exports.default = {
Expand All @@ -28,5 +30,6 @@ exports.default = {
ITF: _ITF2.ITF,
MSI: _MSI.MSI, MSI10: _MSI.MSI10, MSI11: _MSI.MSI11, MSI1010: _MSI.MSI1010, MSI1110: _MSI.MSI1110,
pharmacode: _pharmacode.pharmacode,
codabar: _codabar.codabar,
GenericBarcode: _GenericBarcode.GenericBarcode
};
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.23",
"version": "3.4.0",
"homepage": "https://github.com/lindell/JsBarcode",
"authors": [
"Johan Lindell <johan@lindell.me>"
Expand Down
103 changes: 90 additions & 13 deletions dist/JsBarcode.all.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
/******/ __webpack_require__.p = "";

/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 39);
/******/ return __webpack_require__(__webpack_require__.s = 40);
/******/ })
/************************************************************************/
/******/ ([
Expand Down Expand Up @@ -704,7 +704,9 @@ var _ITF2 = __webpack_require__(26);

var _MSI = __webpack_require__(32);

var _pharmacode = __webpack_require__(33);
var _pharmacode = __webpack_require__(34);

var _codabar = __webpack_require__(33);

var _GenericBarcode = __webpack_require__(25);

Expand All @@ -716,6 +718,7 @@ exports.default = {
ITF: _ITF2.ITF,
MSI: _MSI.MSI, MSI10: _MSI.MSI10, MSI11: _MSI.MSI11, MSI1010: _MSI.MSI1010, MSI1110: _MSI.MSI1110,
pharmacode: _pharmacode.pharmacode,
codabar: _codabar.codabar,
GenericBarcode: _GenericBarcode.GenericBarcode
};

Expand Down Expand Up @@ -807,11 +810,11 @@ Object.defineProperty(exports, "__esModule", {
value: true
});

var _getOptionsFromElement = __webpack_require__(34);
var _getOptionsFromElement = __webpack_require__(35);

var _getOptionsFromElement2 = _interopRequireDefault(_getOptionsFromElement);

var _renderers = __webpack_require__(37);
var _renderers = __webpack_require__(38);

var _exceptions = __webpack_require__(6);

Expand Down Expand Up @@ -2275,6 +2278,80 @@ Object.defineProperty(exports, "__esModule", {

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

// Encoding specification:
// http://www.barcodeisland.com/codabar.phtml

var codabar = function () {
function codabar(string) {
_classCallCheck(this, codabar);

this.string = string.toUpperCase();

if (this.string.search(/^[0-9\-\$\:\.\+\/]+$/) === 0) {
this.string = "A" + this.string + "A";
}

this.encodings = {
"0": "101010011",
"1": "101011001",
"2": "101001011",
"3": "110010101",
"4": "101101001",
"5": "110101001",
"6": "100101011",
"7": "100101101",
"8": "100110101",
"9": "110100101",
"-": "101001101",
"$": "101100101",
":": "1101011011",
"/": "1101101011",
".": "1101101101",
"+": "101100110011",
"A": "1011001001",
"B": "1010010011",
"C": "1001001011",
"D": "1010011001"
};
}

codabar.prototype.valid = function valid() {
return this.string.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/) !== -1;
};

codabar.prototype.encode = function encode() {
var result = [];
for (var i = 0; i < this.string.length; i++) {
result.push(this.encodings[this.string.charAt(i)]);
// for all characters except the last, append a narrow-space ("0")
if (i !== this.string.length - 1) {
result.push("0");
}
}
return {
text: this.string.replace(/[A-D]/g, ''),
data: result.join('')
};
};

return codabar;
}();

exports.codabar = codabar;

/***/ },
/* 34 */
/***/ function(module, exports) {

"use strict";
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

// Encoding documentation
// http://www.gomaro.ch/ftproot/Laetus_PHARMA-CODE.pdf

Expand Down Expand Up @@ -2322,7 +2399,7 @@ var pharmacode = function () {
exports.pharmacode = pharmacode;

/***/ },
/* 34 */
/* 35 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
Expand All @@ -2332,7 +2409,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});

var _optionsFromStrings = __webpack_require__(35);
var _optionsFromStrings = __webpack_require__(36);

var _optionsFromStrings2 = _interopRequireDefault(_optionsFromStrings);

Expand Down Expand Up @@ -2369,7 +2446,7 @@ function getOptionsFromElement(element) {
exports.default = getOptionsFromElement;

/***/ },
/* 35 */
/* 36 */
/***/ function(module, exports) {

"use strict";
Expand Down Expand Up @@ -2402,7 +2479,7 @@ function optionsFromStrings(options) {
}

/***/ },
/* 36 */
/* 37 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
Expand Down Expand Up @@ -2556,7 +2633,7 @@ var CanvasRenderer = function () {
exports.default = CanvasRenderer;

/***/ },
/* 37 */
/* 38 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
Expand All @@ -2567,11 +2644,11 @@ Object.defineProperty(exports, "__esModule", {
});
exports.getRendererClass = undefined;

var _canvas = __webpack_require__(36);
var _canvas = __webpack_require__(37);

var _canvas2 = _interopRequireDefault(_canvas);

var _svg = __webpack_require__(38);
var _svg = __webpack_require__(39);

var _svg2 = _interopRequireDefault(_svg);

Expand All @@ -2591,7 +2668,7 @@ function getRendererClass(name) {
exports.getRendererClass = getRendererClass;

/***/ },
/* 38 */
/* 39 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
Expand Down Expand Up @@ -2772,7 +2849,7 @@ function drawLine(x, y, width, height, parent) {
exports.default = SVGRenderer;

/***/ },
/* 39 */
/* 40 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
Expand Down
4 changes: 2 additions & 2 deletions dist/JsBarcode.all.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit f6ed672

Please sign in to comment.