mirror of
https://github.com/nasa/openmct.git
synced 2025-06-01 15:10:50 +00:00
[Formatting] Linting
This commit is contained in:
parent
a8900f3d6d
commit
3a19890be9
7
main.js
7
main.js
@ -29,7 +29,7 @@ requirejs.config({
|
|||||||
"csv": "bower_components/comma-separated-values/csv.min",
|
"csv": "bower_components/comma-separated-values/csv.min",
|
||||||
"es6-promise": "bower_components/es6-promise/promise.min",
|
"es6-promise": "bower_components/es6-promise/promise.min",
|
||||||
"html2canvas": "bower_components/html2canvas/build/html2canvas.min",
|
"html2canvas": "bower_components/html2canvas/build/html2canvas.min",
|
||||||
"jspdf": "bower_components/jspdf/dist/jspdf.min",
|
"jsPDF": "bower_components/jspdf/dist/jspdf.min",
|
||||||
"moment": "bower_components/moment/moment",
|
"moment": "bower_components/moment/moment",
|
||||||
"moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format",
|
"moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format",
|
||||||
"saveAs": "bower_components/FileSaver.js/FileSaver.min",
|
"saveAs": "bower_components/FileSaver.js/FileSaver.min",
|
||||||
@ -48,6 +48,9 @@ requirejs.config({
|
|||||||
"html2canvas": {
|
"html2canvas": {
|
||||||
"exports": "html2canvas"
|
"exports": "html2canvas"
|
||||||
},
|
},
|
||||||
|
"jsPDF": {
|
||||||
|
"exports": "jsPDF"
|
||||||
|
},
|
||||||
"moment-duration-format": {
|
"moment-duration-format": {
|
||||||
"deps": ["moment"]
|
"deps": ["moment"]
|
||||||
},
|
},
|
||||||
@ -64,8 +67,6 @@ define([
|
|||||||
'./platform/framework/src/Main',
|
'./platform/framework/src/Main',
|
||||||
'legacyRegistry',
|
'legacyRegistry',
|
||||||
|
|
||||||
'html2canvas',
|
|
||||||
'jspdf',
|
|
||||||
'./platform/framework/bundle',
|
'./platform/framework/bundle',
|
||||||
'./platform/core/bundle',
|
'./platform/core/bundle',
|
||||||
'./platform/representation/bundle',
|
'./platform/representation/bundle',
|
||||||
|
@ -258,15 +258,15 @@ define(
|
|||||||
new PlotAxis("ranges", [], AXIS_DEFAULTS[1])
|
new PlotAxis("ranges", [], AXIS_DEFAULTS[1])
|
||||||
];
|
];
|
||||||
|
|
||||||
$scope.exportPDF = function() {
|
$scope.exportPDF = function () {
|
||||||
PlotController.prototype.exportPDF(self.$element, 'plot.pdf');
|
PlotController.prototype.exportPDF(self.$element, 'plot.pdf');
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.exportPNG = function() {
|
$scope.exportPNG = function () {
|
||||||
PlotController.prototype.exportPNG(self.$element, 'plot.png');
|
PlotController.prototype.exportPNG(self.$element, 'plot.png');
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.exportJPG = function() {
|
$scope.exportJPG = function () {
|
||||||
PlotController.prototype.exportJPG(self.$element, 'plot.jpg');
|
PlotController.prototype.exportJPG(self.$element, 'plot.jpg');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -24,15 +24,19 @@
|
|||||||
* Module defining ExportImageService. Created by hudsonfoo on 09/02/16
|
* Module defining ExportImageService. Created by hudsonfoo on 09/02/16
|
||||||
*/
|
*/
|
||||||
define(
|
define(
|
||||||
['saveAs'],
|
[
|
||||||
function (saveAs) {
|
'html2canvas',
|
||||||
|
'jsPDF',
|
||||||
|
'saveAs'
|
||||||
|
],
|
||||||
|
function (html2canvas, jsPDF, saveAs) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The export image service will export any HTML node to
|
* The export image service will export any HTML node to
|
||||||
* PDF, JPG, or PNG.
|
* PDF, JPG, or PNG.
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function ExportImageService() {
|
function ExportImageService () {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -47,7 +51,7 @@ define(
|
|||||||
type = type || 'jpeg';
|
type = type || 'jpeg';
|
||||||
|
|
||||||
html2canvas(element, {
|
html2canvas(element, {
|
||||||
onrendered: function(canvas) {
|
onrendered: function (canvas) {
|
||||||
switch (type.toLowerCase()) {
|
switch (type.toLowerCase()) {
|
||||||
case "blob":
|
case "blob":
|
||||||
canvas.toBlob(callback);
|
canvas.toBlob(callback);
|
||||||
@ -67,22 +71,22 @@ define(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ExportImageService.exportPDF = function(element, filename) {
|
ExportImageService.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.exportJPG = function(element, filename) {
|
ExportImageService.exportJPG = function (element, filename) {
|
||||||
renderElement(element, function(img) {
|
renderElement(element, function (img) {
|
||||||
saveAs(img, filename);
|
saveAs(img, filename);
|
||||||
}, "blob");
|
}, "blob");
|
||||||
};
|
};
|
||||||
|
|
||||||
ExportImageService.exportPNG = function(element, filename) {
|
ExportImageService.exportPNG = function (element, filename) {
|
||||||
renderElement(element, function(img) {
|
renderElement(element, function (img) {
|
||||||
saveAs(img, filename);
|
saveAs(img, filename);
|
||||||
}, "blob");
|
}, "blob");
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user