|
1 | 1 | /** @preserve
|
2 | 2 | * jsPDF - PDF Document creation from JavaScript
|
3 |
| - * Version 1.0.0-trunk Built on 2014-02-18T05:11 |
4 |
| - * Commit c9c9c7b66f942ca54bdf6c57f13fb3181d743300 |
| 3 | + * Version 1.0.0-trunk Built on 2014-03-04T20:11 |
| 4 | + * Commit 6ce43270b972dfb0a30aed81838fac32a7bd5896 |
5 | 5 | *
|
6 | 6 | * Copyright (c) 2010-2014 James Hall, https://github.com/MrRio/jsPDF
|
7 | 7 | * 2010 Aaron Spike, https://github.com/acspike
|
@@ -1670,8 +1670,16 @@ var jsPDF = (function(global) {
|
1670 | 1670 | jsPDF.API = {events:[]};
|
1671 | 1671 | jsPDF.version = "1.0.0-trunk";
|
1672 | 1672 |
|
1673 |
| - if (typeof define === 'function') { |
1674 |
| - define(function() {return jsPDF}); |
| 1673 | + var exports = { |
| 1674 | + jsPDF : jsPDF |
| 1675 | + }; |
| 1676 | + |
| 1677 | + if (typeof module === 'object') { |
| 1678 | + module.exports = exports; |
| 1679 | + } else if (typeof define === 'function') { |
| 1680 | + define(function() { |
| 1681 | + return exports; |
| 1682 | + }); |
1675 | 1683 | } else {
|
1676 | 1684 | global.jsPDF = jsPDF;
|
1677 | 1685 | }
|
@@ -4140,12 +4148,14 @@ else var Blob = (function (view) {
|
4140 | 4148 |
|
4141 | 4149 | var saveAs = saveAs
|
4142 | 4150 | // IE 10+ (native saveAs)
|
4143 |
| - || (navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator)) |
| 4151 | + || (typeof navigator !== "undefined" && |
| 4152 | + navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator)) |
4144 | 4153 | // Everyone else
|
4145 | 4154 | || (function(view) {
|
4146 | 4155 | "use strict";
|
4147 | 4156 | // IE <10 is explicitly unsupported
|
4148 |
| - if (/MSIE [1-9]\./.test(navigator.userAgent)) { |
| 4157 | + if (typeof navigator !== "undefined" && |
| 4158 | + /MSIE [1-9]\./.test(navigator.userAgent)) { |
4149 | 4159 | return;
|
4150 | 4160 | }
|
4151 | 4161 | var
|
@@ -4354,6 +4364,10 @@ var saveAs = saveAs
|
4354 | 4364 | null;
|
4355 | 4365 |
|
4356 | 4366 | view.addEventListener("unload", process_deletion_queue, false);
|
| 4367 | + saveAs.unload = function() { |
| 4368 | + process_deletion_queue(); |
| 4369 | + view.removeEventListener("unload", process_deletion_queue, false); |
| 4370 | + }; |
4357 | 4371 | return saveAs;
|
4358 | 4372 | }(
|
4359 | 4373 | typeof self !== "undefined" && self
|
|
0 commit comments