Browse Source

Autofix for markdown.

pull/464/head
Sebastian 7 years ago
parent
commit
debb0aeb00
  1. 4
      frontend/app/features/settings/pages/more/more-page.component.ts
  2. 12
      frontend/app/framework/angular/avatar.component.ts
  3. 1
      frontend/app/shared/components/markdown-editor.component.ts

4
frontend/app/features/settings/pages/more/more-page.component.ts

@ -45,7 +45,7 @@ export class MorePageComponent extends ResourceOwner implements OnInit {
public ngOnInit() { public ngOnInit() {
this.own( this.own(
this.appsState.reloadSelected().pipe(map(x => x!)) this.appsState.selectedApp
.subscribe(app => { .subscribe(app => {
this.app = app; this.app = app;
@ -56,6 +56,8 @@ export class MorePageComponent extends ResourceOwner implements OnInit {
this.updateForm.load(app); this.updateForm.load(app);
this.updateForm.setEnabled(this.isEditable); this.updateForm.setEnabled(this.isEditable);
})); }));
this.appsState.reloadSelected();
} }
public save() { public save() {

12
frontend/app/framework/angular/avatar.component.ts

@ -12,7 +12,7 @@ import { picasso } from '@app/framework/internal';
@Component({ @Component({
selector: 'sqx-avatar', selector: 'sqx-avatar',
template: ` template: `
<img <img *ngIf="imageSource"
[style.width]="sizeInPx" [style.width]="sizeInPx"
[style.height]="sizeInPx" [style.height]="sizeInPx"
[src]="imageSource | sqxSafeUrl" [src]="imageSource | sqxSafeUrl"
@ -20,9 +20,6 @@ import { picasso } from '@app/framework/internal';
` `
}) })
export class AvatarComponent implements OnChanges { export class AvatarComponent implements OnChanges {
public imageSource: string;
public sizeInPx: string;
@Input() @Input()
public identifier: string; public identifier: string;
@ -32,6 +29,9 @@ export class AvatarComponent implements OnChanges {
@Input() @Input()
public size = 50; public size = 50;
public imageSource: string | null;
public sizeInPx: string;
public ngOnChanges() { public ngOnChanges() {
this.imageSource = this.image || this.createSvg(); this.imageSource = this.image || this.createSvg();
@ -39,6 +39,10 @@ export class AvatarComponent implements OnChanges {
} }
private createSvg() { private createSvg() {
if (!this.identifier) {
return null;
}
const svg = picasso(this.identifier); const svg = picasso(this.identifier);
return `data:image/svg+xml;utf8,${svg}`; return `data:image/svg+xml;utf8,${svg}`;

1
frontend/app/shared/components/markdown-editor.component.ts

@ -95,6 +95,7 @@ export class MarkdownEditorComponent extends StatefulControlComponent<State, str
previewRender: (text: string) => { previewRender: (text: string) => {
return marked(text, { pedantic: true }); return marked(text, { pedantic: true });
}, },
autoDownloadFontAwesome: true,
toolbar: [ toolbar: [
{ {
name: 'bold', name: 'bold',

Loading…
Cancel
Save