From 3a0a72aca40153f42a25b2ff47e2a6469a86fa36 Mon Sep 17 00:00:00 2001 From: crusader Date: Thu, 11 Oct 2018 17:32:00 +0900 Subject: [PATCH] ing --- package.json | 1 + src/app/app.component.html | 8 ++++---- src/app/app.component.ts | 6 +++--- ...t-jpg.component.html => export-jpeg.component.html} | 2 +- ...t-jpg.component.scss => export-jpeg.component.scss} | 0 ...xport-jpg.component.ts => export-jpeg.component.ts} | 10 +++++----- src/app/component/menu/index.ts | 4 ++-- src/commons/type/menu-event.ts | 2 +- src/commons/type/menu-ids.ts | 2 +- src/electron/menu/build-default.ts | 7 ++++--- 10 files changed, 22 insertions(+), 20 deletions(-) rename src/app/component/menu/{export-jpg.component.html => export-jpeg.component.html} (80%) rename src/app/component/menu/{export-jpg.component.scss => export-jpeg.component.scss} (100%) rename src/app/component/menu/{export-jpg.component.ts => export-jpeg.component.ts} (83%) diff --git a/package.json b/package.json index 1063f6e..d36f02e 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/app/app.component.html b/src/app/app.component.html index 8b3e3c9..cc0a871 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -33,12 +33,12 @@ - - + - - + + diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 63f8bac..2582662 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -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; diff --git a/src/app/component/menu/export-jpg.component.html b/src/app/component/menu/export-jpeg.component.html similarity index 80% rename from src/app/component/menu/export-jpg.component.html rename to src/app/component/menu/export-jpeg.component.html index c4b25ec..43d7258 100644 --- a/src/app/component/menu/export-jpg.component.html +++ b/src/app/component/menu/export-jpeg.component.html @@ -1,4 +1,4 @@
- Export JPG + Export JPEG
\ No newline at end of file diff --git a/src/app/component/menu/export-jpg.component.scss b/src/app/component/menu/export-jpeg.component.scss similarity index 100% rename from src/app/component/menu/export-jpg.component.scss rename to src/app/component/menu/export-jpeg.component.scss diff --git a/src/app/component/menu/export-jpg.component.ts b/src/app/component/menu/export-jpeg.component.ts similarity index 83% rename from src/app/component/menu/export-jpg.component.ts rename to src/app/component/menu/export-jpeg.component.ts index 6dc25be..969589c 100644 --- a/src/app/component/menu/export-jpg.component.ts +++ b/src/app/component/menu/export-jpeg.component.ts @@ -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(); } diff --git a/src/app/component/menu/index.ts b/src/app/component/menu/index.ts index f9225ac..a106dca 100644 --- a/src/app/component/menu/index.ts +++ b/src/app/component/menu/index.ts @@ -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, diff --git a/src/commons/type/menu-event.ts b/src/commons/type/menu-event.ts index bc76ab9..2b28f19 100644 --- a/src/commons/type/menu-event.ts +++ b/src/commons/type/menu-event.ts @@ -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' diff --git a/src/commons/type/menu-ids.ts b/src/commons/type/menu-ids.ts index c97b3b8..8898e76 100644 --- a/src/commons/type/menu-ids.ts +++ b/src/commons/type/menu-ids.ts @@ -3,7 +3,7 @@ export type MenuIDs = | 'preferences' | 'about' | 'export-png' - | 'export-jpg' + | 'export-jpeg' | 'export-svg' | 'export-csv' | 'print' diff --git a/src/electron/menu/build-default.ts b/src/electron/menu/build-default.ts index 702be53..bbbf6af 100644 --- a/src/electron/menu/build-default.ts +++ b/src/electron/menu/build-default.ts @@ -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',