ing
This commit is contained in:
parent
d47a5e636c
commit
3a0a72aca4
|
@ -79,6 +79,7 @@
|
|||
"devtron": "^1.4.0",
|
||||
"dexie": "^2.0.4",
|
||||
"electron": "^2.0.9",
|
||||
"electron-i18n": "^1.606.0",
|
||||
"electron-builder": "^20.28.4",
|
||||
"electron-connect": "^0.6.3",
|
||||
"electron-connect-webpack-plugin": "^0.1.1",
|
||||
|
|
|
@ -33,12 +33,12 @@
|
|||
</p-footer>
|
||||
</p-dialog>
|
||||
|
||||
<p-dialog header="Export as JPG" [(visible)]="displayExportJPG" [modal]="true" [responsive]="true" [width]="350"
|
||||
<p-dialog header="Export as JPEG" [(visible)]="displayExportJPEG" [modal]="true" [responsive]="true" [width]="350"
|
||||
[minWidth]="200" [minY]="70" [closable]="false">
|
||||
<app-menu-export-jpg #exportJPG></app-menu-export-jpg>
|
||||
<app-menu-export-jpeg #exportJPEG></app-menu-export-jpeg>
|
||||
<p-footer>
|
||||
<button type="button" pButton icon="pi pi-check" (click)="exportJPG.export();" label="Yes"></button>
|
||||
<button type="button" pButton icon="pi pi-close" (click)="displayExportJPG=false" label="No" class="ui-button-secondary"></button>
|
||||
<button type="button" pButton icon="pi pi-check" (click)="exportJPEG.export();" label="Yes"></button>
|
||||
<button type="button" pButton icon="pi pi-close" (click)="displayExportJPEG=false" label="No" class="ui-button-secondary"></button>
|
||||
</p-footer>
|
||||
</p-dialog>
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ export class AppComponent implements OnInit, AfterContentInit, AfterViewInit, On
|
|||
|
||||
menuSubscription: Subscription;
|
||||
displayAbout: boolean;
|
||||
displayExportJPG: boolean;
|
||||
displayExportJPEG: boolean;
|
||||
displayExportPNG: boolean;
|
||||
displayExportSVG: boolean;
|
||||
displayPreferences: boolean;
|
||||
|
@ -50,8 +50,8 @@ export class AppComponent implements OnInit, AfterContentInit, AfterViewInit, On
|
|||
case 'show-about':
|
||||
this.displayAbout = true;
|
||||
break;
|
||||
case 'show-export-jpg':
|
||||
this.displayExportJPG = true;
|
||||
case 'show-export-jpeg':
|
||||
this.displayExportJPEG = true;
|
||||
break;
|
||||
case 'show-export-png':
|
||||
this.displayExportPNG = true;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div>
|
||||
<p-messages [(value)]="msgs"></p-messages>
|
||||
Export JPG
|
||||
Export JPEG
|
||||
</div>
|
|
@ -9,11 +9,11 @@ import { Message } from 'primeng/primeng';
|
|||
const { saveSvgAsPng, svgAsDataUri } = require('save-svg-as-png');
|
||||
|
||||
@Component({
|
||||
selector: 'app-menu-export-jpg',
|
||||
templateUrl: './export-jpg.component.html',
|
||||
styleUrls: ['./export-jpg.component.scss'],
|
||||
selector: 'app-menu-export-jpeg',
|
||||
templateUrl: './export-jpeg.component.html',
|
||||
styleUrls: ['./export-jpeg.component.scss'],
|
||||
})
|
||||
export class ExportJPGComponent implements OnInit, AfterContentInit, OnDestroy {
|
||||
export class ExportJPEGComponent implements OnInit, AfterContentInit, OnDestroy {
|
||||
msgs: Message[] = [];
|
||||
|
||||
constructor(
|
||||
|
@ -53,7 +53,7 @@ export class ExportJPGComponent implements OnInit, AfterContentInit, OnDestroy {
|
|||
// svgAsDataUri(targetDisplayElementRef.nativeElement, {}, function (uri) {
|
||||
// console.log(`uri: ${uri}`);
|
||||
// });
|
||||
saveSvgAsPng(targetDisplayElementRef.nativeElement, 'diagram.jpg', { backgroundColor: '#ffffff', encoderType: 'image/jpeg' });
|
||||
saveSvgAsPng(targetDisplayElementRef.nativeElement, 'diagram.jpeg', { backgroundColor: '#ffffff', encoderType: 'image/jpeg' });
|
||||
}),
|
||||
).subscribe();
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
import { AboutComponent } from './about.component';
|
||||
import { ExportJPGComponent } from './export-jpg.component';
|
||||
import { ExportJPEGComponent } from './export-jpeg.component';
|
||||
import { ExportPNGComponent } from './export-png.component';
|
||||
import { ExportSVGComponent } from './export-svg.component';
|
||||
import { PreferencesComponent } from './preferences.component';
|
||||
|
@ -7,7 +7,7 @@ import { PrintComponent } from './print.component';
|
|||
|
||||
export const COMPONENTS = [
|
||||
AboutComponent,
|
||||
ExportJPGComponent,
|
||||
ExportJPEGComponent,
|
||||
ExportPNGComponent,
|
||||
ExportSVGComponent,
|
||||
PreferencesComponent,
|
||||
|
|
|
@ -3,7 +3,7 @@ export type MenuEvent =
|
|||
| 'show-preferences'
|
||||
| 'show-about'
|
||||
| 'show-export-png'
|
||||
| 'show-export-jpg'
|
||||
| 'show-export-jpeg'
|
||||
| 'show-export-svg'
|
||||
| 'show-export-csv'
|
||||
| 'show-print'
|
||||
|
|
|
@ -3,7 +3,7 @@ export type MenuIDs =
|
|||
| 'preferences'
|
||||
| 'about'
|
||||
| 'export-png'
|
||||
| 'export-jpg'
|
||||
| 'export-jpeg'
|
||||
| 'export-svg'
|
||||
| 'export-csv'
|
||||
| 'print'
|
||||
|
|
|
@ -62,15 +62,16 @@ export function buildDefaultMenu(
|
|||
click: emit('show-export-png'),
|
||||
},
|
||||
{
|
||||
label: __DARWIN__ ? 'JPG…' : 'JPG…',
|
||||
id: 'export-jpg',
|
||||
click: emit('show-export-jpg'),
|
||||
label: __DARWIN__ ? 'JPEG…' : 'JPEG…',
|
||||
id: 'export-jpeg',
|
||||
click: emit('show-export-jpeg'),
|
||||
},
|
||||
{
|
||||
label: __DARWIN__ ? 'SVG…' : 'SVG…',
|
||||
id: 'export-svg',
|
||||
click: emit('show-export-svg'),
|
||||
},
|
||||
separator,
|
||||
{
|
||||
label: __DARWIN__ ? 'CSV…' : 'CSV…',
|
||||
id: 'export-csv',
|
||||
|
|
Loading…
Reference in New Issue
Block a user