- Fix (Embedded editor): (Though embedding cross-origin iframes apparently

only working now in Chrome if same origin or if https?--at least not
  localhost of different ports), PDF export has been fixed (we download the
  PDF to workaround data URI limitations in Chrome)
- Fix (Embedded editor): Avoid using same origin shortcut if there is no
  global available to use (e.g., if using the modular editor)
- Fix (Embedded editor): Add events only after load is complete and
  svgCanvas is available; also log blocked error objects
- Enhancement: For PDF export, switch Chrome by default to "save" `outputType`
- Docs (JSdoc): Denote optional arguments
This commit is contained in:
Brett Zamir
2018-10-23 22:24:09 +08:00
parent 5b4dae0d30
commit a714c122d3
13 changed files with 68 additions and 41 deletions

10
dist/index-es.js vendored
View File

@@ -17561,15 +17561,17 @@ function SvgCanvas(container, config) {
* Generates a PDF based on the current image, then calls "exportedPDF" with
* an object including the string, the data URL, and any issues found
* @function module:svgcanvas.SvgCanvas#exportPDF
* @param {string} exportWindowName Will also be used for the download file name here
* @param {string} [exportWindowName] Will also be used for the download file name here
* @param {external:jsPDF.OutputType} [outputType="dataurlstring"]
* @param {module:svgcanvas.PDFExportedCallback} cb
* @param {module:svgcanvas.PDFExportedCallback} [cb]
* @fires module:svgcanvas.SvgCanvas#event:exportedPDF
* @returns {Promise} Resolves to {@link module:svgcanvas.PDFExportedResults}
*/
this.exportPDF = function (exportWindowName, outputType, cb) {
this.exportPDF = function (exportWindowName) {
var outputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isChrome() ? 'save' : undefined;
var cb = arguments.length > 2 ? arguments[2] : undefined;
var that = this;
return new Promise(
/*#__PURE__*/
@@ -32141,7 +32143,7 @@ editor.init = function () {
openExportWindow();
}
svgCanvas.exportPDF(exportWindowName, chrome ? 'save' : undefined);
svgCanvas.exportPDF(exportWindowName);
_context6.next = 13;
break;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

10
dist/index-umd.js vendored
View File

@@ -17567,15 +17567,17 @@
* Generates a PDF based on the current image, then calls "exportedPDF" with
* an object including the string, the data URL, and any issues found
* @function module:svgcanvas.SvgCanvas#exportPDF
* @param {string} exportWindowName Will also be used for the download file name here
* @param {string} [exportWindowName] Will also be used for the download file name here
* @param {external:jsPDF.OutputType} [outputType="dataurlstring"]
* @param {module:svgcanvas.PDFExportedCallback} cb
* @param {module:svgcanvas.PDFExportedCallback} [cb]
* @fires module:svgcanvas.SvgCanvas#event:exportedPDF
* @returns {Promise} Resolves to {@link module:svgcanvas.PDFExportedResults}
*/
this.exportPDF = function (exportWindowName, outputType, cb) {
this.exportPDF = function (exportWindowName) {
var outputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isChrome() ? 'save' : undefined;
var cb = arguments.length > 2 ? arguments[2] : undefined;
var that = this;
return new Promise(
/*#__PURE__*/
@@ -32147,7 +32149,7 @@
openExportWindow();
}
svgCanvas.exportPDF(exportWindowName, chrome ? 'save' : undefined);
svgCanvas.exportPDF(exportWindowName);
_context6.next = 13;
break;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long