[Formatting] Switched to double quote across the board for consistency

This commit is contained in:
David Hudson 2016-09-02 11:58:15 +09:00
parent e370271093
commit 3e3d3ebcf9
2 changed files with 12 additions and 12 deletions

View File

@ -373,21 +373,21 @@ define(
* Export the plot to PDF * Export the plot to PDF
*/ */
PlotController.prototype.exportPDF = function () { PlotController.prototype.exportPDF = function () {
this.ExportImageService.exportPDF(this.$element[0], 'plot.pdf'); this.ExportImageService.exportPDF(this.$element[0], "plot.pdf");
}; };
/** /**
* Export the plot to PNG * Export the plot to PNG
*/ */
PlotController.prototype.exportPNG = function () { PlotController.prototype.exportPNG = function () {
this.ExportImageService.exportPNG(this.$element[0], 'plot.png'); this.ExportImageService.exportPNG(this.$element[0], "plot.png");
}; };
/** /**
* Export the plot to JPG * Export the plot to JPG
*/ */
PlotController.prototype.exportJPG = function () { PlotController.prototype.exportJPG = function () {
this.ExportImageService.exportJPG(this.$element[0], 'plot.jpg'); this.ExportImageService.exportJPG(this.$element[0], "plot.jpg");
}; };
return PlotController; return PlotController;

View File

@ -25,9 +25,9 @@
*/ */
define( define(
[ [
'html2canvas', "html2canvas",
'jsPDF', "jsPDF",
'saveAs' "saveAs"
], ],
function (html2canvas, jsPDF, saveAs) { function (html2canvas, jsPDF, saveAs) {
@ -48,7 +48,7 @@ define(
* @returns {string} the color, in #RRGGBB form * @returns {string} the color, in #RRGGBB form
*/ */
function renderElement(element, callback, type) { function renderElement(element, callback, type) {
type = type || 'jpeg'; type = type || "jpeg";
html2canvas(element, { html2canvas(element, {
onrendered: function (canvas) { onrendered: function (canvas) {
@ -58,13 +58,13 @@ define(
break; break;
case "png": case "png":
callback(canvas.toDataURL('image/png', 1.0)); callback(canvas.toDataURL("image/png", 1.0));
break; break;
default: default:
case "jpg": case "jpg":
case "jpeg": case "jpeg":
callback(canvas.toDataURL('image/jpeg', 1.0)); callback(canvas.toDataURL("image/jpeg", 1.0));
break; break;
} }
} }
@ -73,10 +73,10 @@ define(
ExportImageService.prototype.exportPDF = function (element, filename) { ExportImageService.prototype.exportPDF = function (element, filename) {
renderElement(element, function (img) { renderElement(element, function (img) {
var pdf = new jsPDF('l', 'px', [element.offsetHeight, element.offsetWidth]); var pdf = new jsPDF("l", "px", [element.offsetHeight, element.offsetWidth]);
pdf.addImage(img, 'JPEG', 0, 0, element.offsetWidth, element.offsetHeight); pdf.addImage(img, "JPEG", 0, 0, element.offsetWidth, element.offsetHeight);
pdf.save(filename); pdf.save(filename);
}, 'jpeg'); }, "jpeg");
}; };
ExportImageService.prototype.exportJPG = function (element, filename) { ExportImageService.prototype.exportJPG = function (element, filename) {