Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Commit e388241

Browse files
committed
feat: add a modal window for blobs
fixes #37
1 parent 80a9c9e commit e388241

File tree

10 files changed

+315
-44
lines changed

10 files changed

+315
-44
lines changed

package-lock.json

Lines changed: 94 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,22 @@
4545
},
4646
"private": true,
4747
"dependencies": {
48-
"@angular/common": "6.1.0-beta.3",
4948
"@angular/animations": "6.1.0-beta.3",
49+
"@angular/cdk": "6.3.3",
50+
"@angular/common": "6.1.0-beta.3",
5051
"@angular/compiler": "6.1.0-beta.3",
5152
"@angular/core": "6.1.0-beta.3",
5253
"@angular/forms": "6.1.0-beta.3",
5354
"@angular/http": "6.1.0-beta.3",
55+
"@angular/material": "6.3.3",
5456
"@angular/platform-browser-dynamic": "6.1.0-beta.3",
5557
"@angular/platform-browser": "6.1.0-beta.3",
5658
"@angular/router": "6.1.0-beta.3",
5759
"@ngxs/store": "3.1.4",
5860
"@nicky-lenaers/ngx-scroll-to": "1.0.0",
5961
"@types/cheerio": "0.22.8",
6062
"@types/codemirror": "0.0.58",
63+
"@types/fs-extra": "5.0.4",
6164
"@types/jquery": "3.3.4",
6265
"@types/mmmagic": "0.4.29",
6366
"@types/semantic-ui-sidebar": "2.2.2",
@@ -66,17 +69,19 @@
6669
"cheerio": "1.0.0-rc.2",
6770
"class-validator": "0.8.5",
6871
"codemirror": "5.39.0",
69-
"highlight.js": "9.12.0",
7072
"core-js": "2.5.7",
7173
"debug": "3.1.0",
7274
"decko": "1.2.0",
7375
"emoji-named-characters": "1.0.2",
7476
"esrever": "0.2.0",
77+
"fs-extra": "6.0.1",
78+
"highlight.js": "9.12.0",
7579
"humanize-duration": "3.15.0",
7680
"hypermd": "0.3.9",
7781
"jquery": "3.3.1",
7882
"mmmagic": "0.5.0",
7983
"moment": "2.22.2",
84+
"pdfjs-dist": "2.0.489",
8085
"pretty-error": "2.1.1",
8186
"pull-stream": "3.6.8",
8287
"reading-time": "1.1.3",

src/app/app.module.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@
55
import {
66
NgModule,
77
} from '@angular/core';
8+
import {
9+
MatDialogModule,
10+
} from '@angular/material';
811
import {
912
BrowserModule,
1013
} from '@angular/platform-browser';
14+
import {
15+
NoopAnimationsModule,
16+
} from '@angular/platform-browser/animations';
1117
import {
1218
RouterModule,
1319
} from '@angular/router';
@@ -18,6 +24,7 @@ import { ScrollToModule } from '@nicky-lenaers/ngx-scroll-to';
1824
import { HotkeyModule } from 'angular2-hotkeys';
1925

2026
import {
27+
BlobComponent,
2128
NewPostComponent,
2229
PostComponent,
2330
SuggestionBoxComponent,
@@ -62,6 +69,7 @@ import {
6269
PublicFeedComponent,
6370
SafeSSBUrlPipe,
6471
SuggestionBoxComponent,
72+
BlobComponent,
6573
],
6674
imports: [
6775
RouterModule.forRoot([
@@ -93,6 +101,8 @@ import {
93101
disableCheatSheet: false,
94102
cheatSheetCloseEsc: true,
95103
}),
104+
NoopAnimationsModule,
105+
MatDialogModule,
96106
],
97107
providers: [
98108
ElectronService,
@@ -104,6 +114,7 @@ import {
104114
entryComponents: [
105115
PostDetailComponent,
106116
PublicFeedComponent,
117+
BlobComponent,
107118
],
108119
})
109120
export class AppModule { }
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<div class="ui image segment">
2+
<div class="container">
3+
<div class="image">
4+
<div #pdf *ngIf="(mimeType | async) == 'application/pdf'">
5+
<p>
6+
Here should be <a href="http://mozilla.github.io/pdf.js/">pdf.js</a> instance to render this pdf. If you want to work on this have a look at <a href="https://github.com/datenknoten/ngx-ssb-client/issues/42">bug #42</a>
7+
</p>
8+
</div>
9+
<img class="ui fluid rounded image" [src]="blobLink | safeSSBUrlPipe" *ngIf="(mimeType | async) != 'application/pdf'">
10+
</div>
11+
<div class="details">
12+
<h3 class="ui dividing header">{{ blobId }}</h3>
13+
<p>
14+
MimeType: {{ mimeType | async }}
15+
</p>
16+
<p>
17+
<button class="ui green button" (click)="saveBlob()">
18+
Download
19+
</button>
20+
</p>
21+
</div>
22+
</div>
23+
</div>

0 commit comments

Comments
 (0)