Adding contract font and setting richtext to it
This commit is contained in:
BIN
front/app/src/assets/SCHLBKB.TTF
Normal file
BIN
front/app/src/assets/SCHLBKB.TTF
Normal file
Binary file not shown.
@@ -21,25 +21,30 @@ import { FormlyFieldInput } from "@ngx-formly/bootstrap/input";
|
|||||||
(onGetContent)="onGetContent($event)"
|
(onGetContent)="onGetContent($event)"
|
||||||
(onBeforeAddUndo)="onBeforeAddUndo($event)"
|
(onBeforeAddUndo)="onBeforeAddUndo($event)"
|
||||||
></editor>
|
></editor>
|
||||||
<div *ngIf="this.field.props.disabled" [innerHTML]="formControl.value" class="form-control">
|
<div *ngIf="this.field.props.disabled" [innerHTML]="formControl.value" class="form-control contract-body">
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
<!-- <div class="mb-3" [class.form-floating]="props.labelPosition === 'floating'" [class.has-error]="showError">-->
|
<ng-container *ngIf="props.labelPosition !== 'floating'">
|
||||||
<ng-container *ngIf="props.labelPosition !== 'floating'">
|
<ng-container [ngTemplateOutlet]="labelTemplate"></ng-container>
|
||||||
<ng-container [ngTemplateOutlet]="labelTemplate"></ng-container>
|
</ng-container>
|
||||||
</ng-container>
|
<ng-container [ngTemplateOutlet]="inputTemplate"></ng-container>
|
||||||
<ng-container [ngTemplateOutlet]="inputTemplate"></ng-container>
|
<div *ngIf="showError" class="invalid-feedback" [style.display]="'block'">
|
||||||
<div *ngIf="showError" class="invalid-feedback" [style.display]="'block'">
|
<formly-validation-message [field]="field"></formly-validation-message>
|
||||||
<formly-validation-message [field]="field"></formly-validation-message>
|
</div>
|
||||||
</div>
|
<small *ngIf="props.description" class="form-text text-muted">{{ props.description }}</small>
|
||||||
<small *ngIf="props.description" class="form-text text-muted">{{ props.description }}</small>
|
|
||||||
<!-- </div>-->
|
|
||||||
`,
|
`,
|
||||||
})
|
})
|
||||||
export class RichtextTypeComponent extends FormlyFieldInput implements OnInit {
|
export class RichtextTypeComponent extends FormlyFieldInput implements OnInit {
|
||||||
multiline = true;
|
multiline = true;
|
||||||
|
|
||||||
|
init_common = {
|
||||||
|
statusbar: false,
|
||||||
|
autoresize_bottom_margin: 0,
|
||||||
|
body_class: "contract-body",
|
||||||
|
content_style: ".contract-body { font-family: 'New Century Schoolbook', 'sans-serif' }"
|
||||||
|
}
|
||||||
|
|
||||||
init_multiline = {
|
init_multiline = {
|
||||||
plugins: 'lists image imagetools table code searchreplace autoresize',
|
plugins: 'lists image imagetools table code searchreplace autoresize',
|
||||||
menubar: 'edit insert format tools table',
|
menubar: 'edit insert format tools table',
|
||||||
@@ -51,16 +56,12 @@ export class RichtextTypeComponent extends FormlyFieldInput implements OnInit {
|
|||||||
table: { title: 'Table', items: 'inserttable | cell row column | tableprops deletetable' }
|
table: { title: 'Table', items: 'inserttable | cell row column | tableprops deletetable' }
|
||||||
},
|
},
|
||||||
toolbar: 'undo redo | styleselect | bold italic underline | alignleft aligncenter alignright alignjustify | outdent indent bullist numlist | table image',
|
toolbar: 'undo redo | styleselect | bold italic underline | alignleft aligncenter alignright alignjustify | outdent indent bullist numlist | table image',
|
||||||
statusbar: false,
|
|
||||||
autoresize_bottom_margin: 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
init_singleline = {
|
init_singleline = {
|
||||||
plugins: 'autoresize',
|
plugins: 'autoresize',
|
||||||
menubar: '',
|
menubar: '',
|
||||||
toolbar: 'undo redo | bold italic underline',
|
toolbar: 'undo redo | bold italic underline',
|
||||||
statusbar: false,
|
|
||||||
autoresize_bottom_margin: 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -71,19 +72,7 @@ export class RichtextTypeComponent extends FormlyFieldInput implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getInitConfig() {
|
getInitConfig() {
|
||||||
let result: { menubar: string, toolbar: string };
|
return {...this.init_common, ...( this.multiline ? this.init_multiline : this.init_singleline)};
|
||||||
if (this.multiline) {
|
|
||||||
result = this.init_multiline;
|
|
||||||
} else {
|
|
||||||
result = this.init_singleline;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.field.props.readonly) {
|
|
||||||
result.menubar = '';
|
|
||||||
result.toolbar = ''
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onGetContent(param: any) {
|
onGetContent(param: any) {
|
||||||
|
|||||||
@@ -1 +1,9 @@
|
|||||||
/* You can add global styles to this file, and also import other style files */
|
/* You can add global styles to this file, and also import other style files */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Century Schoolbook';
|
||||||
|
src: url('assets/SCHLBKB.TTF');
|
||||||
|
}
|
||||||
|
|
||||||
|
.contract-body {
|
||||||
|
font-family: 'New Century Schoolbook', 'sans-serif';
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user