Skip to content

Commit cbe6766

Browse files
committed
More fixes related to #237 and new dist files.
1 parent cb7dcd4 commit cbe6766

File tree

6 files changed

+101
-113
lines changed

6 files changed

+101
-113
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jspdf",
3-
"version": "1.0.115",
3+
"version": "1.0.116",
44
"homepage": "https://github.com/mrrio/jspdf",
55
"description": "PDF Document creation from JavaScript",
66
"main": "dist/jspdf.min.js",

build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ while [ $# -gt 0 ]
6969
-p|-push)
7070
git_push=1
7171
;;
72+
-t|-tag)
73+
git_tag=1
74+
;;
7275
*)
7376
break
7477
;;
@@ -85,3 +88,8 @@ fi
8588
if [ "$git_push" = "1" ]; then
8689
git push
8790
fi
91+
if [ "$git_tag" = "1" ]; then
92+
commit=`git rev-parse --short=10 HEAD`
93+
git tag -m "v${version} ${commit}" -s v${version}
94+
git push upstream v${version}
95+
fi

dist/jspdf.debug.js

Lines changed: 75 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @preserve
22
* jsPDF - PDF Document creation from JavaScript
3-
* Version 1.0.115-git Built on 2014-04-25T11:37
4-
* CommitID a73ecd3aa1
3+
* Version 1.0.116-git Built on 2014-04-26T23:20
4+
* CommitID cb7dcd4c77
55
*
66
* Copyright (c) 2010-2014 James Hall, https://github.com/MrRio/jsPDF
77
* 2010 Aaron Spike, https://github.com/acspike
@@ -1002,10 +1002,7 @@ var jsPDF = (function(global) {
10021002
};
10031003

10041004
API.line = function(x1, y1, x2, y2) {
1005-
out(
1006-
f2(x1 * k) + ' ' + f2((pageHeight - y1) * k) + ' m ' +
1007-
f2(x2 * k) + ' ' + f2((pageHeight - y2) * k) + ' l S');
1008-
return this;
1005+
return this.lines([[x2 - x1, y2 - y1]], x1, y1);
10091006
};
10101007

10111008
/**
@@ -1696,7 +1693,7 @@ var jsPDF = (function(global) {
16961693
* pdfdoc.mymethod() // <- !!!!!!
16971694
*/
16981695
jsPDF.API = {events:[]};
1699-
jsPDF.version = "1.0.115-debug 2014-04-25T11:37:jameshall";
1696+
jsPDF.version = "1.0.116-debug 2014-04-26T23:20:diegocr";
17001697

17011698
if (typeof define === 'function') {
17021699
define(function() {
@@ -2081,7 +2078,7 @@ var jsPDF = (function(global) {
20812078
* Check to see if ArrayBuffer is supported
20822079
*/
20832080
jsPDFAPI.supportsArrayBuffer = function() {
2084-
return typeof ArrayBuffer === 'function';
2081+
return typeof ArrayBuffer === 'function' && typeof Uint8Array !== 'undefined';
20852082
};
20862083

20872084
/**
@@ -2101,9 +2098,11 @@ var jsPDF = (function(global) {
21012098
jsPDFAPI.isArrayBufferView = function(object) {
21022099
if(!this.supportsArrayBuffer())
21032100
return false;
2101+
if(typeof Uint32Array === 'undefined')
2102+
return false;
21042103
return (object instanceof Int8Array ||
21052104
object instanceof Uint8Array ||
2106-
object instanceof Uint8ClampedArray ||
2105+
(typeof Uint8ClampedArray !== 'undefined' && object instanceof Uint8ClampedArray) ||
21072106
object instanceof Int16Array ||
21082107
object instanceof Uint16Array ||
21092108
object instanceof Int32Array ||
@@ -3766,9 +3765,9 @@ var jsPDF = (function(global) {
37663765
img, dp, trns,
37673766
colors, pal, smask;
37683767

3769-
if(this.isString(imageData)) {
3768+
/* if(this.isString(imageData)) {
37703769
3771-
}
3770+
}*/
37723771

37733772
if(this.isArrayBuffer(imageData))
37743773
imageData = new Uint8Array(imageData);
@@ -3928,7 +3927,7 @@ var jsPDF = (function(global) {
39283927
bpc, decode, imageIndex, alias, dp, trns, pal, smask);
39293928
}
39303929

3931-
return info;
3930+
throw new Error("Unsupported PNG image data, try using JPEG instead.");
39323931
}
39333932

39343933
})(jsPDF.API)
@@ -8532,26 +8531,26 @@ var FlateStream = (function() {
85328531
return dec;
85338532
};
85348533
}
8535-
8536-
if (!Array.prototype.map) {
8537-
Array.prototype.map = function(fun /*, thisArg */) {
8538-
if (this === void 0 || this === null || typeof fun !== "function")
8534+
8535+
if (!Array.prototype.map) {
8536+
Array.prototype.map = function(fun /*, thisArg */) {
8537+
if (this === void 0 || this === null || typeof fun !== "function")
85398538
throw new TypeError();
8540-
8541-
var t = Object(this), len = t.length >>> 0, res = new Array(len);
8542-
var thisArg = arguments.length > 1 ? arguments[1] : void 0;
8543-
for (var i = 0; i < len; i++) {
8544-
// NOTE: Absolute correctness would demand Object.defineProperty
8545-
// be used. But this method is fairly new, and failure is
8546-
// possible only if Object.prototype or Array.prototype
8547-
// has a property |i| (very unlikely), so use a less-correct
8548-
// but more portable alternative.
8549-
if (i in t)
8550-
res[i] = fun.call(thisArg, t[i], i, t);
8551-
}
8552-
8553-
return res;
8554-
};
8539+
8540+
var t = Object(this), len = t.length >>> 0, res = new Array(len);
8541+
var thisArg = arguments.length > 1 ? arguments[1] : void 0;
8542+
for (var i = 0; i < len; i++) {
8543+
// NOTE: Absolute correctness would demand Object.defineProperty
8544+
// be used. But this method is fairly new, and failure is
8545+
// possible only if Object.prototype or Array.prototype
8546+
// has a property |i| (very unlikely), so use a less-correct
8547+
// but more portable alternative.
8548+
if (i in t)
8549+
res[i] = fun.call(thisArg, t[i], i, t);
8550+
}
8551+
8552+
return res;
8553+
};
85558554
}
85568555

85578556
if (!Array.prototype.forEach) {
@@ -8568,55 +8567,55 @@ var FlateStream = (function() {
85688567
}
85698568
};
85708569
}
8571-
8572-
if (!Object.keys) {
8573-
Object.keys = (function () {
8570+
8571+
if (!Object.keys) {
8572+
Object.keys = (function () {
85748573
'use strict';
8575-
8576-
var hasOwnProperty = Object.prototype.hasOwnProperty,
8577-
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
8578-
dontEnums = ['toString','toLocaleString','valueOf','hasOwnProperty',
8579-
'isPrototypeOf','propertyIsEnumerable','constructor'],
8574+
8575+
var hasOwnProperty = Object.prototype.hasOwnProperty,
8576+
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
8577+
dontEnums = ['toString','toLocaleString','valueOf','hasOwnProperty',
8578+
'isPrototypeOf','propertyIsEnumerable','constructor'],
85808579
dontEnumsLength = dontEnums.length;
8581-
8582-
return function (obj) {
8583-
if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {
8584-
throw new TypeError();
8585-
}
8580+
8581+
return function (obj) {
8582+
if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {
8583+
throw new TypeError();
8584+
}
85868585
var result = [], prop, i;
8587-
8588-
for (prop in obj) {
8589-
if (hasOwnProperty.call(obj, prop)) {
8590-
result.push(prop);
8591-
}
8586+
8587+
for (prop in obj) {
8588+
if (hasOwnProperty.call(obj, prop)) {
8589+
result.push(prop);
8590+
}
8591+
}
8592+
8593+
if (hasDontEnumBug) {
8594+
for (i = 0; i < dontEnumsLength; i++) {
8595+
if (hasOwnProperty.call(obj, dontEnums[i])) {
8596+
result.push(dontEnums[i]);
8597+
}
8598+
}
85928599
}
8593-
8594-
if (hasDontEnumBug) {
8595-
for (i = 0; i < dontEnumsLength; i++) {
8596-
if (hasOwnProperty.call(obj, dontEnums[i])) {
8597-
result.push(dontEnums[i]);
8598-
}
8599-
}
8600-
}
8601-
return result;
8602-
};
8603-
}());
8600+
return result;
8601+
};
8602+
}());
86048603
}
86058604

8606-
if (!String.prototype.trim) {
8607-
String.prototype.trim = function () {
8608-
return this.replace(/^\s+|\s+$/g, '');
8609-
};
8610-
}
8611-
if (!String.prototype.trimLeft) {
8612-
String.prototype.trimLeft = function() {
8613-
return this.replace(/^\s+/g, "");
8614-
};
8615-
}
8616-
if (!String.prototype.trimRight) {
8617-
String.prototype.trimRight = function() {
8618-
return this.replace(/\s+$/g, "");
8619-
};
8605+
if (!String.prototype.trim) {
8606+
String.prototype.trim = function () {
8607+
return this.replace(/^\s+|\s+$/g, '');
8608+
};
8609+
}
8610+
if (!String.prototype.trimLeft) {
8611+
String.prototype.trimLeft = function() {
8612+
return this.replace(/^\s+/g, "");
8613+
};
86208614
}
8621-
8622-
})(self);
8615+
if (!String.prototype.trimRight) {
8616+
String.prototype.trimRight = function() {
8617+
return this.replace(/\s+$/g, "");
8618+
};
8619+
}
8620+
8621+
})(this);

dist/jspdf.min.js

Lines changed: 15 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jspdf.plugin.addimage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@
305305
* Check to see if ArrayBuffer is supported
306306
*/
307307
jsPDFAPI.supportsArrayBuffer = function() {
308-
return typeof ArrayBuffer === 'function';
308+
return typeof ArrayBuffer === 'function' && typeof Uint8Array !== 'undefined';
309309
};
310310

311311
/**

libs/FileSaver.js

0 commit comments

Comments
 (0)