Skip to content

Commit 75d18af

Browse files
committed
New dist files with updated Blob.js and FileSaver.js
1 parent dcbc9fc commit 75d18af

File tree

5 files changed

+40
-40
lines changed

5 files changed

+40
-40
lines changed

bower.json

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

dist/jspdf.debug.js

+27-27
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.145-git Built on 2014-05-25T12:54
4-
* CommitID fac3703476
3+
* Version 1.0.150-git Built on 2014-05-30T00:40
4+
* CommitID dcbc9fcb9b
55
*
66
* Copyright (c) 2010-2014 James Hall, https://github.com/MrRio/jsPDF
77
* 2010 Aaron Spike, https://github.com/acspike
@@ -1697,7 +1697,7 @@ var jsPDF = (function(global) {
16971697
* pdfdoc.mymethod() // <- !!!!!!
16981698
*/
16991699
jsPDF.API = {events:[]};
1700-
jsPDF.version = "1.0.145-debug 2014-05-25T12:54:diegocr";
1700+
jsPDF.version = "1.0.150-debug 2014-05-30T00:40:diegocr";
17011701

17021702
if (typeof define === 'function' && define.amd) {
17031703
define(function() {
@@ -5257,12 +5257,12 @@ jsPDFAPI.putTotalPages = function(pageExpression) {
52575257
})(jsPDF.API);
52585258
/* Blob.js
52595259
* A Blob implementation.
5260-
* 2013-12-27
5260+
* 2014-05-27
52615261
*
52625262
* By Eli Grey, http://eligrey.com
52635263
* By Devin Samarin, https://github.com/eboyjr
52645264
* License: X11/MIT
5265-
* See LICENSE.md
5265+
* See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md
52665266
*/
52675267

52685268
/*global self, unescape */
@@ -5271,12 +5271,21 @@ jsPDFAPI.putTotalPages = function(pageExpression) {
52715271

52725272
/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */
52735273

5274-
if (!(typeof Blob === "function" || typeof Blob === "object") || typeof URL === "undefined")
5275-
self.Blob = (function (view) {
5274+
(function (view) {
52765275
"use strict";
52775276

52785277
view.URL = view.URL || view.webkitURL;
5279-
var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || view.MSBlobBuilder || (function(view) {
5278+
5279+
if (view.Blob && view.URL) {
5280+
try {
5281+
new Blob;
5282+
return;
5283+
} catch (e) {}
5284+
}
5285+
5286+
// Internally we use a BlobBuilder implementation to base Blob off of
5287+
// in order to support older browsers that only have BlobBuilder
5288+
var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) {
52805289
var
52815290
get_class = function(object) {
52825291
return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
@@ -5407,10 +5416,13 @@ self.Blob = (function (view) {
54075416
FB_proto.toString = function() {
54085417
return "[object Blob]";
54095418
};
5419+
FB_proto.close = function() {
5420+
this.size = this.data.length = 0;
5421+
};
54105422
return FakeBlobBuilder;
54115423
}(view));
54125424

5413-
return function Blob(blobParts, options) {
5425+
view.Blob = function Blob(blobParts, options) {
54145426
var type = options ? (options.type || "") : "";
54155427
var builder = new BlobBuilder();
54165428
if (blobParts) {
@@ -5421,13 +5433,13 @@ self.Blob = (function (view) {
54215433
return builder.getBlob(type);
54225434
};
54235435
}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this));
5424-
/*! FileSaver.js
5436+
/* FileSaver.js
54255437
* A saveAs() FileSaver implementation.
5426-
* 2014-01-24
5438+
* 2014-05-27
54275439
*
54285440
* By Eli Grey, http://eligrey.com
54295441
* License: X11/MIT
5430-
* See LICENSE.md
5442+
* See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md
54315443
*/
54325444

54335445
/*global self */
@@ -5449,11 +5461,10 @@ var saveAs = saveAs
54495461
}
54505462
var
54515463
doc = view.document
5452-
// only get URL when necessary in case BlobBuilder.js hasn't overridden it yet
5464+
// only get URL when necessary in case Blob.js hasn't overridden it yet
54535465
, get_URL = function() {
54545466
return view.URL || view.webkitURL || view;
54555467
}
5456-
, URL = view.URL || view.webkitURL || view
54575468
, save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a")
54585469
, can_use_save_link = !view.externalHost && "download" in save_link
54595470
, click = function(node) {
@@ -5479,7 +5490,7 @@ var saveAs = saveAs
54795490
while (i--) {
54805491
var file = deletion_queue[i];
54815492
if (typeof file === "string") { // file is an object URL
5482-
URL.revokeObjectURL(file);
5493+
get_URL().revokeObjectURL(file);
54835494
} else { // file is a File
54845495
file.remove();
54855496
}
@@ -5546,20 +5557,9 @@ var saveAs = saveAs
55465557
}
55475558
if (can_use_save_link) {
55485559
object_url = get_object_url(blob);
5549-
// FF for Android has a nasty garbage collection mechanism
5550-
// that turns all objects that are not pure javascript into 'deadObject'
5551-
// this means `doc` and `save_link` are unusable and need to be recreated
5552-
// `view` is usable though:
5553-
doc = view.document;
5554-
save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a");
55555560
save_link.href = object_url;
55565561
save_link.download = name;
5557-
var event = doc.createEvent("MouseEvents");
5558-
event.initMouseEvent(
5559-
"click", true, false, view, 0, 0, 0, 0, 0
5560-
, false, false, false, false, 0, null
5561-
);
5562-
save_link.dispatchEvent(event);
5562+
click(save_link);
55635563
filesaver.readyState = filesaver.DONE;
55645564
dispatch_all();
55655565
return;

dist/jspdf.min.js

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libs/Blob.js

0 commit comments

Comments
 (0)