aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-02-08 17:31:05 +0100
committerChocobozzz <me@florianbigard.com>2018-02-08 17:31:05 +0100
commit7193ad1044d2dfad8f929f0951f9a3601c056f67 (patch)
treee40ab985552696caad2e09861842d043e436fe7d /client/src
parent151edeee3a1bff047bda4cdb60d98ad74f627488 (diff)
downloadPeerTube-7193ad1044d2dfad8f929f0951f9a3601c056f67.tar.gz
PeerTube-7193ad1044d2dfad8f929f0951f9a3601c056f67.tar.zst
PeerTube-7193ad1044d2dfad8f929f0951f9a3601c056f67.zip
Add service worker
Diffstat (limited to 'client/src')
-rw-r--r--client/src/app/app.module.ts9
-rw-r--r--client/src/app/shared/video/abstract-video-list.scss24
-rw-r--r--client/src/index.html2
-rw-r--r--client/src/manifest.json2
-rw-r--r--client/src/ngsw-config.json30
5 files changed, 63 insertions, 4 deletions
diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts
index 1134d061b..34114b60b 100644
--- a/client/src/app/app.module.ts
+++ b/client/src/app/app.module.ts
@@ -1,9 +1,11 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { BrowserModule } from '@angular/platform-browser' 2import { BrowserModule } from '@angular/platform-browser'
3import { ServiceWorkerModule } from '@angular/service-worker'
3import { AboutModule } from '@app/about' 4import { AboutModule } from '@app/about'
4import { ResetPasswordModule } from '@app/reset-password' 5import { ResetPasswordModule } from '@app/reset-password'
5 6
6import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core' 7import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core'
8import { environment } from '../environments/environment'
7 9
8import { AccountModule } from './account' 10import { AccountModule } from './account'
9 11
@@ -24,7 +26,8 @@ export function metaFactory (): MetaLoader {
24 applicationName: 'PeerTube', 26 applicationName: 'PeerTube',
25 defaults: { 27 defaults: {
26 title: 'PeerTube', 28 title: 'PeerTube',
27 description: 'PeerTube, a decentralized video streaming platform using P2P (BitTorrent) directly in the web browser' 29 description: 'PeerTube, a federated (ActivityPub) video streaming platform ' +
30 'using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular. '
28 } 31 }
29 }) 32 })
30} 33}
@@ -57,7 +60,9 @@ export function metaFactory (): MetaLoader {
57 MetaModule.forRoot({ 60 MetaModule.forRoot({
58 provide: MetaLoader, 61 provide: MetaLoader,
59 useFactory: (metaFactory) 62 useFactory: (metaFactory)
60 }) 63 }),
64
65 ServiceWorkerModule.register('/ngsw-worker.js', { enabled: environment.production })
61 ], 66 ],
62 providers: [ ] 67 providers: [ ]
63}) 68})
diff --git a/client/src/app/shared/video/abstract-video-list.scss b/client/src/app/shared/video/abstract-video-list.scss
index 52797bc6c..0f0ff20f0 100644
--- a/client/src/app/shared/video/abstract-video-list.scss
+++ b/client/src/app/shared/video/abstract-video-list.scss
@@ -5,3 +5,27 @@
5 text-align: left; 5 text-align: left;
6 } 6 }
7} 7}
8
9@media screen and (max-width: 400px) and (min-resolution: 1.5dppx) {
10 .videos {
11 text-align: center;
12
13 /deep/ .video-miniature {
14 padding-right: 0;
15 height: 215px;
16 width: 100%;
17
18 .video-miniature-information {
19 width: 100%;
20 }
21
22 /deep/ .video-thumbnail {
23 width: 100%;
24
25 img {
26 width: 100%;
27 }
28 }
29 }
30 }
31}
diff --git a/client/src/index.html b/client/src/index.html
index 61a8d2ed1..8ff89f6a4 100644
--- a/client/src/index.html
+++ b/client/src/index.html
@@ -8,7 +8,7 @@
8 <meta name="description" content="PeerTube, a decentralized video streaming platform using P2P (BitTorrent) directly in the web browser" /> 8 <meta name="description" content="PeerTube, a decentralized video streaming platform using P2P (BitTorrent) directly in the web browser" />
9 9
10 <!-- Web Manifest file --> 10 <!-- Web Manifest file -->
11 <link rel="manifest" href="/client/manifest.json"> 11 <link rel="manifest" href="/manifest.json">
12 12
13 <!-- The following comment is used by the server to prerender OpenGraph and oEmbed tags --> 13 <!-- The following comment is used by the server to prerender OpenGraph and oEmbed tags -->
14 <!-- open graph and oembed tags --> 14 <!-- open graph and oembed tags -->
diff --git a/client/src/manifest.json b/client/src/manifest.json
index ac5eac647..a9e885739 100644
--- a/client/src/manifest.json
+++ b/client/src/manifest.json
@@ -42,5 +42,5 @@
42 ], 42 ],
43 "name": "PeerTube", 43 "name": "PeerTube",
44 "short_name": "PeerTube", 44 "short_name": "PeerTube",
45 "start_url": "/videos/recently-added" 45 "start_url": "."
46} 46}
diff --git a/client/src/ngsw-config.json b/client/src/ngsw-config.json
new file mode 100644
index 000000000..47a116bb7
--- /dev/null
+++ b/client/src/ngsw-config.json
@@ -0,0 +1,30 @@
1{
2 "index": "/index.html",
3 "assetGroups": [
4 {
5 "name": "app",
6 "installMode": "prefetch",
7 "resources": {
8 "files": [
9 "/index.html",
10 "/client/assets/images/favicon.png"
11 ],
12 "versionedFiles": [
13 "/client/*.bundle.css",
14 "/client/*.bundle.js",
15 "/client/*.chunk.js"
16 ]
17 }
18 },
19 {
20 "name": "assets",
21 "installMode": "lazy",
22 "updateMode": "prefetch",
23 "resources": {
24 "files": [
25 "/client/assets/**"
26 ]
27 }
28 }
29 ]
30}