-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #135 from ExLibrisGroup/preview
Preview/Edit Labels
- Loading branch information
Showing
12 changed files
with
178 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<div class="cloudapp-actions"> | ||
<button mat-flat-button color="secondary" [routerLink]="['/labels']"> | ||
<mat-icon>arrow_back_ios</mat-icon> {{ 'Back' | translate}} | ||
</button> | ||
<button mat-flat-button type="button" color="primary" (click)="reset()">{{ 'Labels.Reset' | translate}}</button> | ||
<button mat-flat-button type="button" color="secondary" (click)="loadLabels()">{{ 'Labels.Reload' | translate}}</button> | ||
</div> | ||
<div> | ||
<h1 translate>Labels.Preview</h1> | ||
<p translate>Labels.EditInstructions</p> | ||
<p> </p> | ||
<editor #editor [init]="{ | ||
base_url: 'assets/tinymce', | ||
suffix: '.min', | ||
height: 600, | ||
menubar: false, | ||
setup: initmce, | ||
fontsize_formats: '8pt 10pt 12pt 13pt 14pt 15pt 16pt 17pt 18pt 19pt 20pt 24pt 36pt', | ||
font_formats: 'ALA BT Courier=ala bt courier,courier; Andale Mono=andale mono,times; Arial=arial,helvetica,sans-serif; Arial Black=arial black,avant garde; Arial Narrow=arial narrow,sans-serif; Book Antiqua=book antiqua,palatino; Comic Sans MS=comic sans ms,sans-serif; Courier New=courier new,courier; Georgia=georgia,palatino; Helvetica=helvetica; Impact=impact,chicago; Microsoft YaHei=microsoft yahei,gothic,sans-serif; Symbol=symbol; Tahoma=tahoma,arial,helvetica,sans-serif; Terminal=terminal,monaco; TH SarabunPSK=th sarabunpsk,sans-serif; Times New Roman=times new roman,times; Trebuchet MS=trebuchet ms,geneva; Verdana=verdana,geneva; Webdings=webdings; Wingdings=wingdings,zapf dingbats', | ||
content_style: 'body, p {font-size: 14px;font-weight: 300;color: #5e5e5e;}', | ||
plugins: 'table code print image lists searchreplace', | ||
toolbar: | ||
'print code | bold italic underline subscript superscript| \ | ||
alignleft aligncenter alignright | numlist bullist | fontselect fontsizeselect forecolor | \ | ||
table tabledelete | tableprops tablerowprops tablecellprops | \ | ||
tableinsertrowbefore tableinsertrowafter tabledeleterow | \ | ||
tableinsertcolbefore tableinsertcolafter tabledeletecol | \ | ||
image | \ | ||
undo redo | removeformat searchreplace' | ||
}" | ||
></editor> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.config { | ||
.mat-form-field { | ||
width: 100%; | ||
max-width: 400px; | ||
display: block; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Component, OnInit, ViewChild } from '@angular/core'; | ||
import { PrintService } from '../services/print.service'; | ||
import { Router } from '@angular/router'; | ||
import { Editor } from '../../assets/tinymce/tinymce'; | ||
import { EditorComponent } from '@tinymce/tinymce-angular' | ||
import { TinyMCE } from '../../assets/tinymce/tinymce'; | ||
import { LABEL_FIELDS } from '../models/item'; | ||
import { TranslateService } from '@ngx-translate/core'; | ||
import { itemExample } from '../models/item-example'; | ||
import * as dot from 'dot-object' | ||
|
||
@Component({ | ||
selector: 'app-preview', | ||
templateUrl: './preview.component.html', | ||
styleUrls: ['./preview.component.scss'] | ||
}) | ||
export class PreviewComponent implements OnInit { | ||
@ViewChild('editor', { static: true }) editor: EditorComponent; | ||
constructor( | ||
private translate: TranslateService, | ||
public printService: PrintService, | ||
private router: Router, | ||
) { } | ||
|
||
initmce = (editor: Editor) => { | ||
editor.on('init', () => { | ||
this.loadLabels() // set editor content | ||
}) | ||
} | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
loadLabels() { | ||
if (this.editor && this.editor.editor) { | ||
this.editor.editor.setContent(this.printService.rawLabels); | ||
} | ||
} | ||
|
||
reset() { | ||
this.printService.clear() | ||
.then(() => this.router.navigate(['/'])); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters